import { ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType"; import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand"; import { OneOf } from "oak-domain/lib/types/Polyfill"; import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity"; import { GenericAction } from "oak-domain/lib/actions/action"; import { String, Text } from "oak-domain/lib/types/DataType"; import { EntityShape } from "oak-domain/lib/types/Entity"; import { Style } from "../../types/Style"; import * as System from "../System/Schema"; import * as ExtraFile from "../ExtraFile/Schema"; import * as Notification from "../Notification/Schema"; import * as SessionMessage from "../SessionMessage/Schema"; import * as Token from "../Token/Schema"; import * as WechatMenu from "../WechatMenu/Schema"; import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema"; import * as WechatPublicTag from "../WechatPublicTag/Schema"; import * as WechatPublicTemplate from "../WechatPublicTemplate/Schema"; import * as WechatQrCode from "../WechatQrCode/Schema"; import * as WechatUser from "../WechatUser/Schema"; import * as Session from "../Session/Schema"; export type Passport = 'email' | 'mobile' | 'wechat' | 'wechatPublic'; export type AppType = 'web' | 'wechatMp' | 'wechatPublic'; 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[]; }; export type WechatPublicTemplateMsgsConfig = Record; export type WechatPublicConfig = { type: 'wechatPublic'; isService: boolean; appId: string; appSecret: string; originalId?: string; enable?: boolean; templateMsgs?: WechatPublicTemplateMsgsConfig; server?: { url?: string; token: string; encodingAESKey: string; mode: 'clear' | 'compatible' | 'safe'; }; wechatMp?: { appId: string; originalId: string; }; passport?: Passport[]; }; export type OpSchema = EntityShape & { name: String<32>; description: Text; type: AppType; systemId: ForeignKey<"system">; config: WebConfig | WechatMpConfig | WechatPublicConfig; style?: Style | null; }; export type OpAttr = keyof OpSchema; export type Schema = EntityShape & { name: String<32>; description: Text; type: AppType; systemId: ForeignKey<"system">; config: WebConfig | WechatMpConfig | WechatPublicConfig; style?: Style | null; system: System.Schema; extraFile$application?: Array; extraFile$application$$aggr?: AggregationResult; notification$application?: Array; notification$application$$aggr?: AggregationResult; sessionMessage$application?: Array; sessionMessage$application$$aggr?: AggregationResult; token$application?: Array; token$application$$aggr?: AggregationResult; wechatMenu$application?: Array; wechatMenu$application$$aggr?: AggregationResult; wechatPublicAutoReply$application?: Array; wechatPublicAutoReply$application$$aggr?: AggregationResult; wechatPublicTag$application?: Array; wechatPublicTag$application$$aggr?: AggregationResult; wechatPublicTemplate$application?: Array; wechatPublicTemplate$application$$aggr?: AggregationResult; wechatQrCode$application?: Array; wechatQrCode$application$$aggr?: AggregationResult; wechatUser$application?: Array; wechatUser$application$$aggr?: AggregationResult; session$entity?: Array; session$entity$$aggr?: AggregationResult; } & { [A in ExpressionKey]?: any; }; type AttrFilter = { id: Q_StringValue; $$createAt$$: Q_DateValue; $$seq$$: Q_StringValue; $$updateAt$$: Q_DateValue; name: Q_StringValue; description: Q_StringValue; type: Q_EnumValue; systemId: Q_StringValue; system: System.Filter; config: JsonFilter; style: JsonFilter