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 "../../types/Style"; export type CosOrigin = "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "local" | "unknown" | "s3"; 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"; }; cos?: { defaultOrigin: CosOrigin; }; }; export type WebConfig = { type: "web"; wechat?: { appId: string; appSecret: string; domain?: string; enable?: boolean; }; wechatPay?: { appId: string; appSecret: string; }; location: { protocol: "http:" | "https:"; hostname: string; port: string; }; cos?: { defaultOrigin: CosOrigin; }; }; export type WechatPublicConfig = { type: "wechatPublic"; isService: boolean; appId: string; appSecret: string; originalId?: string; server?: { url?: string; token: string; encodingAESKey: string; mode: "clear" | "compatible" | "safe"; }; wechatMp?: { appId: string; originalId: string; }; location: { protocol: "http:" | "https:"; hostname: string; port: string; }; cos?: { defaultOrigin: CosOrigin; }; }; export type NativeConfig = { type: "native"; wechatNative?: { appId: string; appSecret: string; domain?: string; }; location: { protocol: "http:" | "https:"; hostname: string; port: string; }; cos?: { defaultOrigin: CosOrigin; }; }; 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; systemId: Q_StringValue; config: JsonFilter; style: JsonFilter