oak-pay-business/lib/oak-app-domain/Application/_baseSchema.d.ts

145 lines
4.2 KiB
TypeScript

import { ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey, JsonFilter } from "oak-domain/lib/types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import { String, Text } from "oak-domain/lib/types/DataType";
import { Style } from "oak-general-business/lib/types/Style";
export type Passport = "email" | "mobile" | "wechat" | "wechatPublic" | "wechatNative";
export type AppType = "web" | "wechatMp" | "wechatPublic" | "native";
export type WechatMpConfig = {
type: "wechatMp";
appId: string;
appSecret: string;
originalId?: string;
qrCodePrefix?: string;
server?: {
url?: string;
token: string;
encodingAESKey: string;
mode: "clear" | "compatible" | "safe";
dataFormat: "json" | "xml";
};
passport?: Passport[];
};
export type WebConfig = {
type: "web";
wechat?: {
appId: string;
appSecret: string;
domain?: string;
enable?: boolean;
};
passport?: Passport[];
location: {
protocol: "http:" | "https:";
hostname: string;
port: string;
};
};
export type WechatPublicTemplateMsgsConfig = Record<string, string>;
export type WechatPublicConfig = {
type: "wechatPublic";
isService: boolean;
appId: string;
appSecret: string;
originalId?: string;
templateMsgs?: WechatPublicTemplateMsgsConfig;
server?: {
url?: string;
token: string;
encodingAESKey: string;
mode: "clear" | "compatible" | "safe";
};
wechatMp?: {
appId: string;
originalId: string;
};
passport?: Passport[];
location: {
protocol: "http:" | "https:";
hostname: string;
port: string;
};
};
export type NativeConfig = {
type: "native";
passport?: Passport[];
wechatNative?: {
appId: string;
appSecret: string;
domain?: string;
};
location: {
protocol: "http:" | "https:";
hostname: string;
port: string;
};
};
type Versions = string[];
export type OpSchema = EntityShape & {
name: String<32>;
description?: Text | null;
type: AppType;
systemId: ForeignKey<"system">;
config: WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig;
style?: Style | null;
dangerousVersions: Versions;
warningVersions: Versions;
soaVersion: String<32>;
domainId?: ForeignKey<"domain"> | null;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
name: Q_StringValue;
description: Q_StringValue;
type: Q_EnumValue<AppType>;
systemId: Q_StringValue;
config: JsonFilter<WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig>;
style: JsonFilter<Style>;
dangerousVersions: JsonFilter<Versions>;
warningVersions: JsonFilter<Versions>;
soaVersion: Q_StringValue;
domainId: Q_StringValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
name?: number;
description?: number;
type?: number;
systemId?: number;
config?: number | JsonProjection<WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig>;
style?: number | JsonProjection<Style>;
dangerousVersions?: number | JsonProjection<Versions>;
warningVersions?: number | JsonProjection<Versions>;
soaVersion?: number;
domainId?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
name: number;
description: number;
type: number;
style: number;
dangerousVersions: number;
warningVersions: number;
soaVersion: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;
export {};