import { ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType"; import { Q_DateValue, Q_BooleanValue, Q_NumberValue, 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, EntityShape } from "oak-domain/lib/types/Entity"; import { GenericAction } from "oak-domain/lib/actions/action"; import { Boolean } from "oak-domain/lib/types/DataType"; import * as System from "../System/Schema"; import * as ApplicationPassport from "../ApplicationPassport/Schema"; type Type = "password" | "sms" | "email" | "wechatWeb" | "wechatMp" | "wechatPublic" | "wechatPublicForWeb" | "wechatMpForWeb"; type SmsConfig = { mockSend?: boolean; templateName?: string; codeDuration?: number; }; type EmailConifg = { smtpUrl: string; smtpAccount: string; smtpPassword: string; }; type PfwConfig = { appId: string; }; type MfwConfig = { appId: string; }; export type OpSchema = EntityShape & { systemId: ForeignKey<"system">; type: Type; config?: (SmsConfig | EmailConifg | PfwConfig | MfwConfig) | null; enabled: Boolean; }; export type OpAttr = keyof OpSchema; export type Schema = EntityShape & { systemId: ForeignKey<"system">; type: Type; config?: (SmsConfig | EmailConifg | PfwConfig | MfwConfig) | null; enabled: Boolean; system: System.Schema; applicationPassport$passport?: Array; applicationPassport$passport$$aggr?: AggregationResult; } & { [A in ExpressionKey]?: any; }; type AttrFilter = { id: Q_StringValue; $$createAt$$: Q_DateValue; $$seq$$: Q_NumberValue; $$updateAt$$: Q_DateValue; systemId: Q_StringValue; system: System.Filter; type: Q_EnumValue; config: JsonFilter; enabled: Q_BooleanValue; applicationPassport$passport: ApplicationPassport.Filter & SubQueryPredicateMetadata; }; export type Filter = MakeFilter>; export type Projection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; systemId?: number; system?: System.Projection; type?: number; config?: number | JsonProjection; enabled?: number; applicationPassport$passport?: ApplicationPassport.Selection & { $entity: "applicationPassport"; }; applicationPassport$passport$$aggr?: ApplicationPassport.Aggregation & { $entity: "applicationPassport"; }; } & Partial>; type PassportIdProjection = OneOf<{ id: number; }>; type SystemIdProjection = OneOf<{ systemId: number; }>; export type SortAttr = { id: number; } | { $$createAt$$: number; } | { $$seq$$: number; } | { $$updateAt$$: number; } | { systemId: number; } | { system: System.SortAttr; } | { type: number; } | { enabled: number; } | { [k: string]: any; } | OneOf>; export type SortNode = { $attr: SortAttr; $direction?: "asc" | "desc"; }; export type Sorter = SortNode[]; export type SelectOperation

= OakSelection<"select", P, Filter, Sorter>; export type Selection

= SelectOperation

; export type Aggregation = DeduceAggregation; export type CreateOperationData = FormCreateData> & (({ systemId?: never; system: System.CreateSingleOperation; } | { systemId: ForeignKey<"system">; system?: System.UpdateOperation; } | { system?: never; systemId: ForeignKey<"system">; })) & { applicationPassport$passport?: OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit>>; }; export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; export type CreateMultipleOperation = OakOperation<"create", Array>; export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; export type UpdateOperationData = FormUpdateData> & (({ system?: System.CreateSingleOperation; systemId?: never; } | { system?: System.UpdateOperation; systemId?: never; } | { system?: System.RemoveOperation; systemId?: never; } | { system?: never; systemId?: ForeignKey<"system">; })) & { [k: string]: any; applicationPassport$passport?: OakOperation, Omit> | OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit> | OakOperation, Omit>>; }; export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>; export type RemoveOperationData = {} & (({ system?: System.UpdateOperation | System.RemoveOperation; })); export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export type Operation = CreateOperation | UpdateOperation | RemoveOperation; export type SystemIdSubQuery = Selection; export type PassportIdSubQuery = Selection; export type EntityDef = { Schema: Schema; OpSchema: OpSchema; Action: OakMakeAction | string; Selection: Selection; Aggregation: Aggregation; Operation: Operation; Create: CreateOperation; Update: UpdateOperation; Remove: RemoveOperation; CreateSingle: CreateSingleOperation; CreateMulti: CreateMultipleOperation; }; export {};