From ac88cb399a68788a843041b6d4dc133df1e5b578 Mon Sep 17 00:00:00 2001 From: "Xc@centOs" Date: Tue, 22 Mar 2022 15:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4src-base-domain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base-domain/Address/Schema.ts | 144 ---------------- src/base-domain/Address/Storage.ts | 34 ---- src/base-domain/Application/Schema.ts | 153 ----------------- src/base-domain/Application/Storage.ts | 25 --- src/base-domain/Area/Schema.ts | 141 ---------------- src/base-domain/Area/Storage.ts | 28 ---- src/base-domain/EntityDict.ts | 22 --- src/base-domain/ExtraFile/Schema.ts | 191 ---------------------- src/base-domain/ExtraFile/Storage.ts | 63 ------- src/base-domain/Mobile/Schema.ts | 127 -------------- src/base-domain/Mobile/Storage.ts | 16 -- src/base-domain/Storage.ts | 24 --- src/base-domain/System/Schema.ts | 112 ------------- src/base-domain/System/Storage.ts | 18 -- src/base-domain/Token/Action.ts | 5 - src/base-domain/Token/Schema.ts | 180 -------------------- src/base-domain/Token/Storage.ts | 36 ---- src/base-domain/User/Action.ts | 25 --- src/base-domain/User/Schema.ts | 218 ------------------------- src/base-domain/User/Storage.ts | 87 ---------- src/base-domain/UserSystem/Schema.ts | 151 ----------------- src/base-domain/UserSystem/Storage.ts | 20 --- src/base-domain/WechatUser/Schema.ts | 193 ---------------------- src/base-domain/WechatUser/Storage.ts | 53 ------ src/base-domain/_SubQuery.ts | 83 ---------- 25 files changed, 2149 deletions(-) delete mode 100644 src/base-domain/Address/Schema.ts delete mode 100644 src/base-domain/Address/Storage.ts delete mode 100644 src/base-domain/Application/Schema.ts delete mode 100644 src/base-domain/Application/Storage.ts delete mode 100644 src/base-domain/Area/Schema.ts delete mode 100644 src/base-domain/Area/Storage.ts delete mode 100644 src/base-domain/EntityDict.ts delete mode 100644 src/base-domain/ExtraFile/Schema.ts delete mode 100644 src/base-domain/ExtraFile/Storage.ts delete mode 100644 src/base-domain/Mobile/Schema.ts delete mode 100644 src/base-domain/Mobile/Storage.ts delete mode 100644 src/base-domain/Storage.ts delete mode 100644 src/base-domain/System/Schema.ts delete mode 100644 src/base-domain/System/Storage.ts delete mode 100644 src/base-domain/Token/Action.ts delete mode 100644 src/base-domain/Token/Schema.ts delete mode 100644 src/base-domain/Token/Storage.ts delete mode 100644 src/base-domain/User/Action.ts delete mode 100644 src/base-domain/User/Schema.ts delete mode 100644 src/base-domain/User/Storage.ts delete mode 100644 src/base-domain/UserSystem/Schema.ts delete mode 100644 src/base-domain/UserSystem/Storage.ts delete mode 100644 src/base-domain/WechatUser/Schema.ts delete mode 100644 src/base-domain/WechatUser/Storage.ts delete mode 100644 src/base-domain/_SubQuery.ts diff --git a/src/base-domain/Address/Schema.ts b/src/base-domain/Address/Schema.ts deleted file mode 100644 index a37cf8d..0000000 --- a/src/base-domain/Address/Schema.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { GenericAction } from "../../actions/action"; -import * as Area from "../Area/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - detail: String<32>; - areaId: ForeignKey<"area">; - phone: String<12>; - name: String<32>; - default: Boolean; - remark: Text; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - detail: String<32>; - areaId: ForeignKey<"area">; - phone: String<12>; - name: String<32>; - default: Boolean; - remark: Text; - area: Area.Schema; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.AddressIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - detail: Q_StringValue; - areaId: Q_StringValue | SubQuery.AreaIdSubQuery; - area: Area.Filter; - phone: Q_StringValue; - name: Q_StringValue; - default: Q_BooleanValue; - remark: Q_StringValue; -}; -export type Filter = MakeFilter>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - detail?: 1; - areaId?: 1; - area?: Area.Projection; - phone?: 1; - name?: 1; - default?: 1; - remark?: 1; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - detail?: string; - areaId?: string; - area?: Area.ExportProjection; - phone?: string; - name?: string; - default?: string; - remark?: string; -} & Partial>; -type AddressIdProjection = OneOf<{ - id: 1; -}>; -type AreaIdProjection = OneOf<{ - areaId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - detail: 1; - areaId: 1; - area: Area.SortAttr; - phone: 1; - name: 1; - default: 1; - remark: 1; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - area?: Area.CreateSingleOperation | (Area.UpdateOperation & { - id: String<64>; - }); - areaId?: undefined; -} | { - area?: undefined; - areaId?: String<64>; -}) & { - [k: string]: any; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - area?: Area.CreateSingleOperation | Omit; - areaId?: undefined; -} | { - area?: undefined; - areaId?: String<64>; -}) & { - [k: string]: any; -}; -export type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>; -type RemoveOperationData = {} & { - area?: Omit; -} & { - [k: string]: any; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type AreaIdSubQuery = Selection; -export type AddressIdSubQuery = Selection; -export type NativeAttr = OpAttr | `area.${Area.NativeAttr}`; -export type FullAttr = NativeAttr; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: GenericAction; - Selection: Selection; - Operation: Operation; -}; \ No newline at end of file diff --git a/src/base-domain/Address/Storage.ts b/src/base-domain/Address/Storage.ts deleted file mode 100644 index 8004d6f..0000000 --- a/src/base-domain/Address/Storage.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - detail: { - type: "varchar", - params: { - width: 32 - } - }, - areaId: { - type: "ref", - ref: "area" - }, - phone: { - type: "varchar", - params: { - width: 12 - } - }, - name: { - type: "varchar", - params: { - width: 32 - } - }, - default: { - type: "boolean" - }, - remark: { - type: "text" - } - } -}; \ No newline at end of file diff --git a/src/base-domain/Application/Schema.ts b/src/base-domain/Application/Schema.ts deleted file mode 100644 index 9fc7b40..0000000 --- a/src/base-domain/Application/Schema.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { GenericAction } from "../../actions/action"; -import * as System from "../System/Schema"; -import * as Token from "../Token/Schema"; -import * as WechatUser from "../WechatUser/Schema"; -import * as ExtraFile from "../ExtraFile/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - name: String<32>; - description: Text; - type: 'web' | 'wechatPublic' | 'weChatMp'; - systemId: ForeignKey<"system">; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - name: String<32>; - description: Text; - type: 'web' | 'wechatPublic' | 'weChatMp'; - systemId: ForeignKey<"system">; - system: System.Schema; - token$application?: Array; - wechatUser$application?: Array; - extraFile$entity?: Array; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.ApplicationIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - name: Q_StringValue; - description: Q_StringValue; - type: Q_EnumValue<'web' | 'wechatPublic' | 'weChatMp'>; - systemId: Q_StringValue | SubQuery.SystemIdSubQuery; - system: System.Filter; -}; -export type Filter = MakeFilter>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - name?: 1; - description?: 1; - type?: 1; - systemId?: 1; - system?: System.Projection; - token$application?: Token.Selection; - wechatUser$application?: WechatUser.Selection; - extraFile$entity?: ExtraFile.Selection; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - name?: string; - description?: string; - type?: string; - systemId?: string; - system?: System.ExportProjection; - token$application?: Token.Exportation; - wechatUser$application?: WechatUser.Exportation; - extraFile$entity?: ExtraFile.Exportation; -} & Partial>; -type ApplicationIdProjection = OneOf<{ - id: 1; -}>; -type SystemIdProjection = OneOf<{ - systemId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - name: 1; - description: 1; - type: 1; - systemId: 1; - system: System.SortAttr; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - system?: System.CreateSingleOperation | (System.UpdateOperation & { - id: String<64>; - }); - systemId?: undefined; -} | { - system?: undefined; - systemId?: String<64>; -}) & { - [k: string]: any; - token$application?: Token.CreateOperation | Token.UpdateOperation; - wechatUser$application?: WechatUser.CreateOperation | WechatUser.UpdateOperation; - extraFile$entity?: ExtraFile.CreateOperation | ExtraFile.UpdateOperation; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - system?: System.CreateSingleOperation | Omit; - systemId?: undefined; -} | { - system?: undefined; - systemId?: String<64>; -}) & { - [k: string]: any; - tokens$application?: Token.CreateOperation | Omit; - wechatUsers$application?: WechatUser.CreateOperation | Omit; - extraFiles$entity?: ExtraFile.CreateOperation | Omit; -}; -export type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>; -type RemoveOperationData = {} & { - system?: Omit; -} & { - [k: string]: any; - tokens$application?: Omit; - wechatUsers$application?: Omit; - extraFiles$entity?: Omit; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type SystemIdSubQuery = Selection; -export type ApplicationIdSubQuery = Selection; -export type NativeAttr = OpAttr | `system.${System.NativeAttr}`; -export type FullAttr = NativeAttr | `tokens$${number}.${Token.NativeAttr}` | `wechatUsers$${number}.${WechatUser.NativeAttr}` | `extraFiles$${number}.${ExtraFile.NativeAttr}`; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: GenericAction; - Selection: Selection; - Operation: Operation; -}; \ No newline at end of file diff --git a/src/base-domain/Application/Storage.ts b/src/base-domain/Application/Storage.ts deleted file mode 100644 index 7fab634..0000000 --- a/src/base-domain/Application/Storage.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - name: { - type: "varchar", - params: { - width: 32 - } - }, - description: { - type: "text" - }, - type: { - type: "varchar", - params: { - length: 16 - } - }, - systemId: { - type: "ref", - ref: "system" - } - } -}; \ No newline at end of file diff --git a/src/base-domain/Area/Schema.ts b/src/base-domain/Area/Schema.ts deleted file mode 100644 index 23fead5..0000000 --- a/src/base-domain/Area/Schema.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { GenericAction } from "../../actions/action"; -import * as Address from "../Address/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - name: String<32>; - level: 'province' | 'city' | 'district' | 'street'; - parentId: ForeignKey<"area">; - code: String<12>; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - name: String<32>; - level: 'province' | 'city' | 'district' | 'street'; - parentId: ForeignKey<"area">; - code: String<12>; - parent: Schema; - address$area?: Array; - area$parent?: Array; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.AreaIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - name: Q_StringValue; - level: Q_EnumValue<'province' | 'city' | 'district' | 'street'>; - parentId: Q_StringValue | SubQuery.AreaIdSubQuery; - parent: Filter; - code: Q_StringValue; -}; -export type Filter = MakeFilter>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - name?: 1; - level?: 1; - parentId?: 1; - parent?: Projection; - code?: 1; - address$area?: Address.Selection; - area$parent?: Selection; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - name?: string; - level?: string; - parentId?: string; - parent?: ExportProjection; - code?: string; - address$area?: Address.Exportation; - area$parent?: Exportation; -} & Partial>; -type AreaIdProjection = OneOf<{ - id: 1; - parentId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - name: 1; - level: 1; - parentId: 1; - parent: SortAttr; - code: 1; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - parent?: CreateSingleOperation | (UpdateOperation & { - id: String<64>; - }); - parentId?: undefined; -} | { - parent?: undefined; - parentId?: String<64>; -}) & { - [k: string]: any; - address$area?: Address.CreateOperation | Address.UpdateOperation; - area$parent?: CreateOperation | UpdateOperation; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - parent?: CreateSingleOperation | Omit; - parentId?: undefined; -} | { - parent?: undefined; - parentId?: String<64>; -}) & { - [k: string]: any; - addresss$area?: Address.CreateOperation | Omit; - areas$parent?: CreateOperation | Omit; -}; -export type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>; -type RemoveOperationData = {} & { - parent?: Omit; -} & { - [k: string]: any; - addresss$area?: Omit; - areas$parent?: Omit; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type AreaIdSubQuery = Selection; -export type NativeAttr = OpAttr | `parent.${OpAttr}` | `parent.parent.${OpAttr}` | `parent.parent.parent.${OpAttr}`; -export type FullAttr = NativeAttr | `addresss$${number}.${Address.NativeAttr}` | `areas$${number}.${NativeAttr}`; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: GenericAction; - Selection: Selection; - Operation: Operation; -}; \ No newline at end of file diff --git a/src/base-domain/Area/Storage.ts b/src/base-domain/Area/Storage.ts deleted file mode 100644 index db3fc52..0000000 --- a/src/base-domain/Area/Storage.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - name: { - type: "varchar", - params: { - width: 32 - } - }, - level: { - type: "varchar", - params: { - length: 16 - } - }, - parentId: { - type: "ref", - ref: "area" - }, - code: { - type: "varchar", - params: { - width: 12 - } - } - } -}; \ No newline at end of file diff --git a/src/base-domain/EntityDict.ts b/src/base-domain/EntityDict.ts deleted file mode 100644 index 6b3b608..0000000 --- a/src/base-domain/EntityDict.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { EntityDef as Address } from "./Address/Schema"; -import { EntityDef as Application } from "./Application/Schema"; -import { EntityDef as Area } from "./Area/Schema"; -import { EntityDef as ExtraFile } from "./ExtraFile/Schema"; -import { EntityDef as Mobile } from "./Mobile/Schema"; -import { EntityDef as UserSystem } from "./UserSystem/Schema"; -import { EntityDef as System } from "./System/Schema"; -import { EntityDef as Token } from "./Token/Schema"; -import { EntityDef as User } from "./User/Schema"; -import { EntityDef as WechatUser } from "./WechatUser/Schema"; -export type EntityDict = { - address: Address; - application: Application; - area: Area; - extraFile: ExtraFile; - mobile: Mobile; - userSystem: UserSystem; - system: System; - token: Token; - user: User; - wechatUser: WechatUser; -}; diff --git a/src/base-domain/ExtraFile/Schema.ts b/src/base-domain/ExtraFile/Schema.ts deleted file mode 100644 index b8f2ad2..0000000 --- a/src/base-domain/ExtraFile/Schema.ts +++ /dev/null @@ -1,191 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { GenericAction } from "../../actions/action"; -import * as Application from "../Application/Schema"; -import * as User from "../User/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - origin: 'qiniu'; - type: 'image' | 'pdf' | 'video' | 'audio' | 'file'; - bucket: String<16>; - objectId: String<64>; - tag1: String<16>; - tag2: String<16>; - filename: String<64>; - md5: Text; - entity: "application" | "user" | string; - entityId: String<64>; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - origin: 'qiniu'; - type: 'image' | 'pdf' | 'video' | 'audio' | 'file'; - bucket: String<16>; - objectId: String<64>; - tag1: String<16>; - tag2: String<16>; - filename: String<64>; - md5: Text; - entity: "application" | "user" | string; - entityId: String<64>; - application?: Application.Schema; - user?: User.Schema; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.ExtraFileIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - origin: Q_EnumValue<'qiniu'>; - type: Q_EnumValue<'image' | 'pdf' | 'video' | 'audio' | 'file'>; - bucket: Q_StringValue; - objectId: Q_StringValue; - tag1: Q_StringValue; - tag2: Q_StringValue; - filename: Q_StringValue; - md5: Q_StringValue; - entity: E; - entityId: Q_StringValue; -}; -export type Filter> = MakeFilter & ExprOp>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - origin?: 1; - type?: 1; - bucket?: 1; - objectId?: 1; - tag1?: 1; - tag2?: 1; - filename?: 1; - md5?: 1; - entity?: 1; - entityId?: 1; - application?: Application.Projection; - user?: User.Projection; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - origin?: string; - type?: string; - bucket?: string; - objectId?: string; - tag1?: string; - tag2?: string; - filename?: string; - md5?: string; - entity?: string; - entityId?: string; - application?: Application.ExportProjection; - user?: User.ExportProjection; -} & Partial>; -type ExtraFileIdProjection = OneOf<{ - id: 1; -}>; -type ApplicationIdProjection = OneOf<{ - entityId: 1; -}>; -type UserIdProjection = OneOf<{ - entityId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - origin: 1; - type: 1; - bucket: 1; - objectId: 1; - tag1: 1; - tag2: 1; - filename: 1; - md5: 1; - entity: 1; - entityId: 1; - application: Application.SortAttr; - user: User.SortAttr; - [k: string]: any; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - entity: "application" | "user" | string; - entityId: String<64>; -} | ({ - entity?: undefined; - entityId?: undefined; -} & OneOf<{ - application: Application.CreateSingleOperation | (Application.UpdateOperation & { - id: String<64>; - }); - user: User.CreateSingleOperation | (User.UpdateOperation & { - id: String<64>; - }); - [K: string]: any; -}>)) & { - [k: string]: any; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - entity?: "application" | "user" | string; - entityId?: String<64>; - application?: undefined; - user?: undefined; -} | ({ - entity?: undefined; - entityId?: undefined; -} & OneOf<{ - application: Application.CreateSingleOperation | Omit; - user: User.CreateSingleOperation | Omit; - [K: string]: any; -}>)) & { - [k: string]: any; -}; -export type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>; -type RemoveOperationData = {} & OneOf<{ - application?: Omit; - user?: Omit; - [K: string]: any; -}> & { - [k: string]: any; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type ApplicationIdSubQuery = Selection; -export type UserIdSubQuery = Selection; -export type ExtraFileIdSubQuery = Selection; -export type NativeAttr = OpAttr | `entity.${Application.NativeAttr}` | `entity.${User.NativeAttr}`; -export type FullAttr = NativeAttr; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: GenericAction; - Selection: Selection; - Operation: Operation; -}; \ No newline at end of file diff --git a/src/base-domain/ExtraFile/Storage.ts b/src/base-domain/ExtraFile/Storage.ts deleted file mode 100644 index 83bd14b..0000000 --- a/src/base-domain/ExtraFile/Storage.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - origin: { - type: "varchar", - params: { - length: 16 - } - }, - type: { - type: "varchar", - params: { - length: 16 - } - }, - bucket: { - type: "varchar", - params: { - width: 16 - } - }, - objectId: { - type: "varchar", - params: { - width: 64 - } - }, - tag1: { - type: "varchar", - params: { - width: 16 - } - }, - tag2: { - type: "varchar", - params: { - width: 16 - } - }, - filename: { - type: "varchar", - params: { - width: 64 - } - }, - md5: { - type: "text" - }, - entity: { - type: "varchar", - params: { - width: 32 - } - }, - entityId: { - type: "varchar", - params: { - width: 64 - } - } - } -}; \ No newline at end of file diff --git a/src/base-domain/Mobile/Schema.ts b/src/base-domain/Mobile/Schema.ts deleted file mode 100644 index 1946746..0000000 --- a/src/base-domain/Mobile/Schema.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { GenericAction } from "../../actions/action"; -import * as User from "../User/Schema"; -import * as Token from "../Token/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - mobile: String<16>; - userId: ForeignKey<"user">; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - mobile: String<16>; - userId: ForeignKey<"user">; - user: User.Schema; - token$entity?: Array; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.MobileIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - mobile: Q_StringValue; - userId: Q_StringValue | SubQuery.UserIdSubQuery; - user: User.Filter; -}; -export type Filter = MakeFilter>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - mobile?: 1; - userId?: 1; - user?: User.Projection; - token$entity?: Token.Selection; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - mobile?: string; - userId?: string; - user?: User.ExportProjection; - token$entity?: Token.Exportation; -} & Partial>; -type MobileIdProjection = OneOf<{ - id: 1; -}>; -type UserIdProjection = OneOf<{ - userId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - mobile: 1; - userId: 1; - user: User.SortAttr; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - user?: User.CreateSingleOperation | (User.UpdateOperation & { - id: String<64>; - }); - userId?: undefined; -} | { - user?: undefined; - userId?: String<64>; -}) & { - [k: string]: any; - token$entity?: Token.CreateOperation | Token.UpdateOperation; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - user?: User.CreateSingleOperation | Omit; - userId?: undefined; -} | { - user?: undefined; - userId?: String<64>; -}) & { - [k: string]: any; - tokens$entity?: Token.CreateOperation | Omit; -}; -export type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>; -type RemoveOperationData = {} & { - user?: Omit; -} & { - [k: string]: any; - tokens$entity?: Omit; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type UserIdSubQuery = Selection; -export type MobileIdSubQuery = Selection; -export type NativeAttr = OpAttr | `user.${User.NativeAttr}`; -export type FullAttr = NativeAttr | `tokens$${number}.${Token.NativeAttr}`; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: GenericAction; - Selection: Selection; - Operation: Operation; -}; \ No newline at end of file diff --git a/src/base-domain/Mobile/Storage.ts b/src/base-domain/Mobile/Storage.ts deleted file mode 100644 index a326b3e..0000000 --- a/src/base-domain/Mobile/Storage.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - mobile: { - type: "varchar", - params: { - width: 16 - } - }, - userId: { - type: "ref", - ref: "user" - } - } -}; \ No newline at end of file diff --git a/src/base-domain/Storage.ts b/src/base-domain/Storage.ts deleted file mode 100644 index 80d8246..0000000 --- a/src/base-domain/Storage.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { StorageSchema } from "../types/Storage"; -import { EntityDict } from "./EntityDict"; -import { desc as addressDesc } from "./Address/Storage"; -import { desc as applicationDesc } from "./Application/Storage"; -import { desc as areaDesc } from "./Area/Storage"; -import { desc as extraFileDesc } from "./ExtraFile/Storage"; -import { desc as mobileDesc } from "./Mobile/Storage"; -import { desc as userSystemDesc } from "./UserSystem/Storage"; -import { desc as systemDesc } from "./System/Storage"; -import { desc as tokenDesc } from "./Token/Storage"; -import { desc as userDesc } from "./User/Storage"; -import { desc as wechatUserDesc } from "./WechatUser/Storage"; -export const storageSchema: StorageSchema = { - address: addressDesc, - application: applicationDesc, - area: areaDesc, - extraFile: extraFileDesc, - mobile: mobileDesc, - userSystem: userSystemDesc, - system: systemDesc, - token: tokenDesc, - user: userDesc, - wechatUser: wechatUserDesc -}; \ No newline at end of file diff --git a/src/base-domain/System/Schema.ts b/src/base-domain/System/Schema.ts deleted file mode 100644 index 09eb81c..0000000 --- a/src/base-domain/System/Schema.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { GenericAction } from "../../actions/action"; -import * as Application from "../Application/Schema"; -import * as UserSystem from "../UserSystem/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - name: String<32>; - description: Text; - config: Object; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - name: String<32>; - description: Text; - config: Object; - application$system?: Array; - userSystem$system?: Array; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.SystemIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - name: Q_StringValue; - description: Q_StringValue; -}; -export type Filter = MakeFilter>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - name?: 1; - description?: 1; - config?: 1; - application$system?: Application.Selection; - userSystem$system?: UserSystem.Selection; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - name?: string; - description?: string; - config?: string; - application$system?: Application.Exportation; - userSystem$system?: UserSystem.Exportation; -} & Partial>; -type SystemIdProjection = OneOf<{ - id: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - name: 1; - description: 1; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData & { - [k: string]: any; - applications$system?: Application.CreateOperation | Omit; - userSystems$system?: UserSystem.CreateOperation | Omit; -}; -export type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>; -type RemoveOperationData = {} & { - [k: string]: any; - applications$system?: Omit; - userSystems$system?: Omit; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type SystemIdSubQuery = Selection; -export type NativeAttr = OpAttr; -export type FullAttr = NativeAttr | `applications$${number}.${Application.NativeAttr}` | `userSystems$${number}.${UserSystem.NativeAttr}`; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: GenericAction; - Selection: Selection; - Operation: Operation; -}; \ No newline at end of file diff --git a/src/base-domain/System/Storage.ts b/src/base-domain/System/Storage.ts deleted file mode 100644 index c398e3e..0000000 --- a/src/base-domain/System/Storage.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - name: { - type: "varchar", - params: { - width: 32 - } - }, - description: { - type: "text" - }, - config: { - type: "object" - } - } -}; \ No newline at end of file diff --git a/src/base-domain/Token/Action.ts b/src/base-domain/Token/Action.ts deleted file mode 100644 index 3018574..0000000 --- a/src/base-domain/Token/Action.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { AbleAction } from "../../actions/action"; -import { ActionDef } from "../../types/Action"; -import { GenericAction } from "../../actions/action"; -export type ParticularAction = AbleAction; -export type Action = GenericAction | ParticularAction; \ No newline at end of file diff --git a/src/base-domain/Token/Schema.ts b/src/base-domain/Token/Schema.ts deleted file mode 100644 index 2a20221..0000000 --- a/src/base-domain/Token/Schema.ts +++ /dev/null @@ -1,180 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { AbleState } from "../../actions/action"; -import { ParticularAction, Action } from "./Action"; -import * as Application from "../Application/Schema"; -import * as User from "../User/Schema"; -import * as Mobile from "../Mobile/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - applicationId: ForeignKey<"application">; - entity: "mobile" | string; - entityId: String<64>; - userId?: ForeignKey<"user">; - playerId?: ForeignKey<"user">; - ableState?: AbleState; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - applicationId: ForeignKey<"application">; - entity: "mobile" | string; - entityId: String<64>; - userId?: ForeignKey<"user">; - playerId?: ForeignKey<"user">; - ableState?: AbleState; - application: Application.Schema; - user?: User.Schema; - player?: User.Schema; - mobile?: Mobile.Schema; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.TokenIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - applicationId: Q_StringValue | SubQuery.ApplicationIdSubQuery; - application: Application.Filter; - entity: E; - entityId: Q_StringValue; - userId: Q_StringValue | SubQuery.UserIdSubQuery; - user: User.Filter; - playerId: Q_StringValue | SubQuery.UserIdSubQuery; - player: User.Filter; - ableState: Q_EnumValue; -}; -export type Filter> = MakeFilter & ExprOp>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - applicationId?: 1; - application?: Application.Projection; - entity?: 1; - entityId?: 1; - userId?: 1; - user?: User.Projection; - playerId?: 1; - player?: User.Projection; - ableState?: 1; - mobile?: Mobile.Projection; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - applicationId?: string; - application?: Application.ExportProjection; - entity?: string; - entityId?: string; - userId?: string; - user?: User.ExportProjection; - playerId?: string; - player?: User.ExportProjection; - ableState?: string; - mobile?: Mobile.ExportProjection; -} & Partial>; -type TokenIdProjection = OneOf<{ - id: 1; -}>; -type ApplicationIdProjection = OneOf<{ - applicationId: 1; -}>; -type UserIdProjection = OneOf<{ - userId: 1; - playerId: 1; -}>; -type MobileIdProjection = OneOf<{ - entityId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - applicationId: 1; - application: Application.SortAttr; - entity: 1; - entityId: 1; - userId: 1; - user: User.SortAttr; - playerId: 1; - player: User.SortAttr; - ableState: 1; - mobile: Mobile.SortAttr; - [k: string]: any; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - entity: "mobile" | string; - entityId: String<64>; -} | ({ - entity?: undefined; - entityId?: undefined; -} & OneOf<{ - mobile: Mobile.CreateSingleOperation | (Mobile.UpdateOperation & { - id: String<64>; - }); - [K: string]: any; -}>)) & { - [k: string]: any; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - entity?: "mobile" | string; - entityId?: String<64>; - mobile?: undefined; -} | ({ - entity?: undefined; - entityId?: undefined; -} & OneOf<{ - mobile: Mobile.CreateSingleOperation | Omit; - [K: string]: any; -}>)) & { - [k: string]: any; -}; -export type UpdateOperation = OakOperation; -type RemoveOperationData = {} & OneOf<{ - mobile?: Omit; - [K: string]: any; -}> & { - [k: string]: any; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type ApplicationIdSubQuery = Selection; -export type UserIdSubQuery = Selection; -export type MobileIdSubQuery = Selection; -export type TokenIdSubQuery = Selection; -export type NativeAttr = OpAttr | `application.${Application.NativeAttr}` | `user.${User.NativeAttr}` | `player.${User.NativeAttr}` | `entity.${Mobile.NativeAttr}`; -export type FullAttr = NativeAttr; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: Action; - Selection: Selection; - Operation: Operation; - ParticularAction: ParticularAction; -}; \ No newline at end of file diff --git a/src/base-domain/Token/Storage.ts b/src/base-domain/Token/Storage.ts deleted file mode 100644 index 85347e7..0000000 --- a/src/base-domain/Token/Storage.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - applicationId: { - type: "ref", - ref: "application" - }, - entity: { - type: "varchar", - params: { - width: 32 - } - }, - entityId: { - type: "varchar", - params: { - width: 64 - } - }, - userId: { - type: "ref", - ref: "user" - }, - playerId: { - type: "ref", - ref: "user" - }, - ableState: { - type: "varchar", - params: { - length: 16 - } - } - } -}; \ No newline at end of file diff --git a/src/base-domain/User/Action.ts b/src/base-domain/User/Action.ts deleted file mode 100644 index 37731e3..0000000 --- a/src/base-domain/User/Action.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ActionDef } from "../../types/Action"; -import { GenericAction } from "../../actions/action"; -type IdAction = 'verify' | 'accept' | 'reject'; -export type IdState = 'unverified' | 'verified' | 'verifying'; -const IdActionDef: ActionDef = { - stm: { - verify: ['unverified', 'verifying'], - accept: [['unverified', 'verifying'], 'verified'], - reject: [['verifying', 'verified'], 'unverified'] - }, - is: 'unverified' -}; -type UserAction = 'activate' | 'disable' | 'enable' | 'mergeTo' | 'mergeFrom'; -export type UserState = 'shadow' | 'normal' | 'disabled' | 'merged'; -const UserActionDef: ActionDef = { - stm: { - activate: ['shadow', 'normal'], - disable: [['normal', 'shadow'], 'disabled'], - enable: ['disabled', 'normal'], - mergeTo: [['normal', 'shadow'], 'merged'], - mergeFrom: ['normal', 'normal'] - } -}; -export type ParticularAction = UserAction | IdAction; -export type Action = GenericAction | ParticularAction; \ No newline at end of file diff --git a/src/base-domain/User/Schema.ts b/src/base-domain/User/Schema.ts deleted file mode 100644 index 833de71..0000000 --- a/src/base-domain/User/Schema.ts +++ /dev/null @@ -1,218 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { UserState, IdState, ParticularAction, Action } from "./Action"; -import * as Mobile from "../Mobile/Schema"; -import * as UserSystem from "../UserSystem/Schema"; -import * as Token from "../Token/Schema"; -import * as WechatUser from "../WechatUser/Schema"; -import * as ExtraFile from "../ExtraFile/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - name: String<16>; - nickname?: String<64>; - password?: Text; - birth?: Datetime; - gender?: 'male' | 'female'; - avatar?: Image; - idCardType?: 'ID-Card' | 'passport' | 'Mainland-passport'; - idNumber?: String<32>; - refId?: ForeignKey<"user">; - userState?: UserState; - idState?: IdState; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - name: String<16>; - nickname?: String<64>; - password?: Text; - birth?: Datetime; - gender?: 'male' | 'female'; - avatar?: Image; - idCardType?: 'ID-Card' | 'passport' | 'Mainland-passport'; - idNumber?: String<32>; - refId?: ForeignKey<"user">; - userState?: UserState; - idState?: IdState; - ref?: Schema; - mobile$user?: Array; - userSystem$user?: Array; - token$user?: Array; - token$player?: Array; - user$ref?: Array; - wechatUser$user?: Array; - extraFile$entity?: Array; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.UserIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - name: Q_StringValue; - nickname: Q_StringValue; - password: Q_StringValue; - birth: Q_DateValue; - gender: Q_EnumValue<'male' | 'female'>; - avatar: Q_StringValue; - idCardType: Q_EnumValue<'ID-Card' | 'passport' | 'Mainland-passport'>; - idNumber: Q_StringValue; - refId: Q_StringValue | SubQuery.UserIdSubQuery; - ref: Filter; - userState: Q_EnumValue; - idState: Q_EnumValue; -}; -export type Filter = MakeFilter & FulltextFilter>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - name?: 1; - nickname?: 1; - password?: 1; - birth?: 1; - gender?: 1; - avatar?: 1; - idCardType?: 1; - idNumber?: 1; - refId?: 1; - ref?: Projection; - userState?: 1; - idState?: 1; - mobile$user?: Mobile.Selection; - userSystem$user?: UserSystem.Selection; - token$user?: Token.Selection; - token$player?: Token.Selection; - user$ref?: Selection; - wechatUser$user?: WechatUser.Selection; - extraFile$entity?: ExtraFile.Selection; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - name?: string; - nickname?: string; - password?: string; - birth?: string; - gender?: string; - avatar?: string; - idCardType?: string; - idNumber?: string; - refId?: string; - ref?: ExportProjection; - userState?: string; - idState?: string; - mobile$user?: Mobile.Exportation; - userSystem$user?: UserSystem.Exportation; - token$user?: Token.Exportation; - token$player?: Token.Exportation; - user$ref?: Exportation; - wechatUser$user?: WechatUser.Exportation; - extraFile$entity?: ExtraFile.Exportation; -} & Partial>; -type UserIdProjection = OneOf<{ - id: 1; - refId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - name: 1; - nickname: 1; - password: 1; - birth: 1; - gender: 1; - avatar: 1; - idCardType: 1; - idNumber: 1; - refId: 1; - ref: SortAttr; - userState: 1; - idState: 1; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - ref?: CreateSingleOperation | (UpdateOperation & { - id: String<64>; - }); - refId?: undefined; -} | { - ref?: undefined; - refId?: String<64>; -}) & { - [k: string]: any; - mobile$user?: Mobile.CreateOperation | Mobile.UpdateOperation; - userSystem$user?: UserSystem.CreateOperation | UserSystem.UpdateOperation; - token$user?: Token.CreateOperation | Token.UpdateOperation; - token$player?: Token.CreateOperation | Token.UpdateOperation; - user$ref?: CreateOperation | UpdateOperation; - wechatUser$user?: WechatUser.CreateOperation | WechatUser.UpdateOperation; - extraFile$entity?: ExtraFile.CreateOperation | ExtraFile.UpdateOperation; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - ref?: CreateSingleOperation | Omit; - refId?: undefined; -} | { - ref?: undefined; - refId?: String<64>; -}) & { - [k: string]: any; - mobiles$user?: Mobile.CreateOperation | Omit; - userSystems$user?: UserSystem.CreateOperation | Omit; - tokens$user?: Token.CreateOperation | Omit; - tokens$player?: Token.CreateOperation | Omit; - users$ref?: CreateOperation | Omit; - wechatUsers$user?: WechatUser.CreateOperation | Omit; - extraFiles$entity?: ExtraFile.CreateOperation | Omit; -}; -export type UpdateOperation = OakOperation; -type RemoveOperationData = {} & { - ref?: Omit; -} & { - [k: string]: any; - mobiles$user?: Omit; - userSystems$user?: Omit; - tokens$user?: Omit; - tokens$player?: Omit; - users$ref?: Omit; - wechatUsers$user?: Omit; - extraFiles$entity?: Omit; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type UserIdSubQuery = Selection; -export type NativeAttr = OpAttr | `ref.${OpAttr}` | `ref.ref.${OpAttr}` | `ref.ref.ref.${OpAttr}`; -export type FullAttr = NativeAttr | `mobiles$${number}.${Mobile.NativeAttr}` | `userSystems$${number}.${UserSystem.NativeAttr}` | `tokens$user$${number}.${Token.NativeAttr}` | `tokens$player$${number}.${Token.NativeAttr}` | `users$${number}.${NativeAttr}` | `wechatUsers$${number}.${WechatUser.NativeAttr}` | `extraFiles$${number}.${ExtraFile.NativeAttr}`; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: Action; - Selection: Selection; - Operation: Operation; - ParticularAction: ParticularAction; -}; \ No newline at end of file diff --git a/src/base-domain/User/Storage.ts b/src/base-domain/User/Storage.ts deleted file mode 100644 index db64133..0000000 --- a/src/base-domain/User/Storage.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - name: { - type: "varchar", - params: { - width: 16 - } - }, - nickname: { - type: "varchar", - params: { - width: 64 - } - }, - password: { - type: "text" - }, - birth: { - type: "datetime" - }, - gender: { - type: "varchar", - params: { - length: 16 - } - }, - avatar: { - type: "text" - }, - idCardType: { - type: "varchar", - params: { - length: 16 - } - }, - idNumber: { - type: "varchar", - params: { - width: 32 - } - }, - refId: { - type: "ref", - ref: "user" - }, - userState: { - type: "varchar", - params: { - length: 16 - } - }, - idState: { - type: "varchar", - params: { - length: 16 - } - } - }, - indexes: [ - { - name: 'index_test2', - attributes: [ - { - name: 'birth', - direction: 'ASC' - }, - ] - }, - { - name: 'index_test', - attributes: [ - { - name: 'name' - }, - { - name: 'nickname' - } - ], - config: { - type: 'fulltext', - parser: 'ngram' - } - } - ] -}; \ No newline at end of file diff --git a/src/base-domain/UserSystem/Schema.ts b/src/base-domain/UserSystem/Schema.ts deleted file mode 100644 index 538f4a8..0000000 --- a/src/base-domain/UserSystem/Schema.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { GenericAction } from "../../actions/action"; -import * as User from "../User/Schema"; -import * as System from "../System/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - userId: ForeignKey<"user">; - systemId: ForeignKey<"system">; - relation: 'owner'; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - userId: ForeignKey<"user">; - systemId: ForeignKey<"system">; - relation: 'owner'; - user: User.Schema; - system: System.Schema; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.UserSystemIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - userId: Q_StringValue | SubQuery.UserIdSubQuery; - user: User.Filter; - systemId: Q_StringValue | SubQuery.SystemIdSubQuery; - system: System.Filter; - relation: Q_EnumValue<'owner'>; -}; -export type Filter = MakeFilter>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - userId?: 1; - user?: User.Projection; - systemId?: 1; - system?: System.Projection; - relation?: 1; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - userId?: string; - user?: User.ExportProjection; - systemId?: string; - system?: System.ExportProjection; - relation?: string; -} & Partial>; -type UserSystemIdProjection = OneOf<{ - id: 1; -}>; -type UserIdProjection = OneOf<{ - userId: 1; -}>; -type SystemIdProjection = OneOf<{ - systemId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - userId: 1; - user: User.SortAttr; - systemId: 1; - system: System.SortAttr; - relation: 1; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - user?: User.CreateSingleOperation | (User.UpdateOperation & { - id: String<64>; - }); - userId?: undefined; -} | { - user?: undefined; - userId?: String<64>; -}) & ({ - system?: System.CreateSingleOperation | (System.UpdateOperation & { - id: String<64>; - }); - systemId?: undefined; -} | { - system?: undefined; - systemId?: String<64>; -}) & { - [k: string]: any; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - user?: User.CreateSingleOperation | Omit; - userId?: undefined; -} | { - user?: undefined; - userId?: String<64>; -}) & ({ - system?: System.CreateSingleOperation | Omit; - systemId?: undefined; -} | { - system?: undefined; - systemId?: String<64>; -}) & { - [k: string]: any; -}; -export type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>; -type RemoveOperationData = {} & { - user?: Omit; - system?: Omit; -} & { - [k: string]: any; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type UserIdSubQuery = Selection; -export type SystemIdSubQuery = Selection; -export type UserSystemIdSubQuery = Selection; -export type NativeAttr = OpAttr | `user.${User.NativeAttr}` | `system.${System.NativeAttr}`; -export type FullAttr = NativeAttr; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: GenericAction; - Selection: Selection; - Operation: Operation; -}; \ No newline at end of file diff --git a/src/base-domain/UserSystem/Storage.ts b/src/base-domain/UserSystem/Storage.ts deleted file mode 100644 index 9945117..0000000 --- a/src/base-domain/UserSystem/Storage.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - userId: { - type: "ref", - ref: "user" - }, - systemId: { - type: "ref", - ref: "system" - }, - relation: { - type: "varchar", - params: { - length: 16 - } - } - } -}; \ No newline at end of file diff --git a/src/base-domain/WechatUser/Schema.ts b/src/base-domain/WechatUser/Schema.ts deleted file mode 100644 index 4db6f11..0000000 --- a/src/base-domain/WechatUser/Schema.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { String, Int, Float, Double, Boolean, Text, Datetime, File, Image, PrimaryKey, ForeignKey } from "../../types/DataType"; -import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "../../types/Demand"; -import { OneOf, ValueOf } from "../../types/Polyfill"; -import * as SubQuery from "../_SubQuery"; -import { FormCreateData, FormUpdateData, Operation as OakOperation } from "../../types/Entity"; -import { GenericAction } from "../../actions/action"; -import * as User from "../User/Schema"; -import * as Application from "../Application/Schema"; -export type OpSchema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - origin: 'mp' | 'public'; - openId?: String<32>; - unionId?: String<32>; - accessToken: String<32>; - sessionKey?: String<64>; - subscribed?: Boolean; - subscribedAt?: Datetime; - unsubscribedAt?: Datetime; - userId?: ForeignKey<"user">; - applicationId: ForeignKey<"application">; -}; -export type OpAttr = keyof OpSchema; -export type Schema = { - id: PrimaryKey; - $$createAt$$: Datetime; - $$updateAt$$: Datetime; - $$removeAt$$?: Datetime; - origin: 'mp' | 'public'; - openId?: String<32>; - unionId?: String<32>; - accessToken: String<32>; - sessionKey?: String<64>; - subscribed?: Boolean; - subscribedAt?: Datetime; - unsubscribedAt?: Datetime; - userId?: ForeignKey<"user">; - applicationId: ForeignKey<"application">; - user?: User.Schema; - application: Application.Schema; -} & { - [A in ExpressionKey]?: any; -}; -type AttrFilter = { - id: Q_StringValue | SubQuery.WechatUserIdSubQuery; - $$createAt$$: Q_DateValue; - $$updateAt$$: Q_DateValue; - origin: Q_EnumValue<'mp' | 'public'>; - openId: Q_StringValue; - unionId: Q_StringValue; - accessToken: Q_StringValue; - sessionKey: Q_StringValue; - subscribed: Q_BooleanValue; - subscribedAt: Q_DateValue; - unsubscribedAt: Q_DateValue; - userId: Q_StringValue | SubQuery.UserIdSubQuery; - user: User.Filter; - applicationId: Q_StringValue | SubQuery.ApplicationIdSubQuery; - application: Application.Filter; -}; -export type Filter = MakeFilter>; -export type Projection = { - "#id"?: NodeId; - [k: string]: any; - id: 1; - $$createAt$$?: 1; - $$updateAt$$?: 1; - origin?: 1; - openId?: 1; - unionId?: 1; - accessToken?: 1; - sessionKey?: 1; - subscribed?: 1; - subscribedAt?: 1; - unsubscribedAt?: 1; - userId?: 1; - user?: User.Projection; - applicationId?: 1; - application?: Application.Projection; -} & Partial>; -export type ExportProjection = { - "#id"?: NodeId; - [k: string]: any; - id?: string; - $$createAt$$?: string; - $$updateAt$$?: string; - origin?: string; - openId?: string; - unionId?: string; - accessToken?: string; - sessionKey?: string; - subscribed?: string; - subscribedAt?: string; - unsubscribedAt?: string; - userId?: string; - user?: User.ExportProjection; - applicationId?: string; - application?: Application.ExportProjection; -} & Partial>; -type WechatUserIdProjection = OneOf<{ - id: 1; -}>; -type UserIdProjection = OneOf<{ - userId: 1; -}>; -type ApplicationIdProjection = OneOf<{ - applicationId: 1; -}>; -export type SortAttr = OneOf<{ - id: 1; - $$createAt$$: 1; - $$updateAt$$: 1; - origin: 1; - openId: 1; - unionId: 1; - accessToken: 1; - sessionKey: 1; - subscribed: 1; - subscribedAt: 1; - unsubscribedAt: 1; - userId: 1; - user: User.SortAttr; - applicationId: 1; - application: Application.SortAttr; -} & ExprOp>; -export type SortNode = { - $attr: SortAttr; - $direction?: "asc" | "desc"; -}; -export type Sorter = SortNode[]; -export type SelectOperation

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

= Omit, "action">; -export type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; -type CreateOperationData = FormCreateData & ({ - user?: User.CreateSingleOperation | (User.UpdateOperation & { - id: String<64>; - }); - userId?: undefined; -} | { - user?: undefined; - userId?: String<64>; -}) & ({ - application?: Application.CreateSingleOperation | (Application.UpdateOperation & { - id: String<64>; - }); - applicationId?: undefined; -} | { - application?: undefined; - applicationId?: String<64>; -}) & { - [k: string]: any; -}>; -export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; -export type CreateMultipleOperation = OakOperation<"create", Array>; -export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -type UpdateOperationData = FormUpdateData> & ({ - user?: User.CreateSingleOperation | Omit; - userId?: undefined; -} | { - user?: undefined; - userId?: String<64>; -}) & ({ - application?: Application.CreateSingleOperation | Omit; - applicationId?: undefined; -} | { - application?: undefined; - applicationId?: String<64>; -}) & { - [k: string]: any; -}; -export type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>; -type RemoveOperationData = {} & { - user?: Omit; - application?: Omit; -} & { - [k: string]: any; -}; -export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>; -export type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; -export type UserIdSubQuery = Selection; -export type ApplicationIdSubQuery = Selection; -export type WechatUserIdSubQuery = Selection; -export type NativeAttr = OpAttr | `user.${User.NativeAttr}` | `application.${Application.NativeAttr}`; -export type FullAttr = NativeAttr; -export type EntityDef = { - Schema: Schema; - OpSchema: OpSchema; - Action: GenericAction; - Selection: Selection; - Operation: Operation; -}; \ No newline at end of file diff --git a/src/base-domain/WechatUser/Storage.ts b/src/base-domain/WechatUser/Storage.ts deleted file mode 100644 index d2ffea2..0000000 --- a/src/base-domain/WechatUser/Storage.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { StorageDesc } from "../../types/Storage"; -import { OpSchema } from "./Schema"; -export const desc: StorageDesc = { - attributes: { - origin: { - type: "varchar", - params: { - length: 16 - } - }, - openId: { - type: "varchar", - params: { - width: 32 - } - }, - unionId: { - type: "varchar", - params: { - width: 32 - } - }, - accessToken: { - type: "varchar", - params: { - width: 32 - } - }, - sessionKey: { - type: "varchar", - params: { - width: 64 - } - }, - subscribed: { - type: "boolean" - }, - subscribedAt: { - type: "datetime" - }, - unsubscribedAt: { - type: "datetime" - }, - userId: { - type: "ref", - ref: "user" - }, - applicationId: { - type: "ref", - ref: "application" - } - } -}; \ No newline at end of file diff --git a/src/base-domain/_SubQuery.ts b/src/base-domain/_SubQuery.ts deleted file mode 100644 index 62fc03f..0000000 --- a/src/base-domain/_SubQuery.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { Selection } from "../types/Entity"; -import * as Address from "./Address/Schema"; -import * as Application from "./Application/Schema"; -import * as Area from "./Area/Schema"; -import * as ExtraFile from "./ExtraFile/Schema"; -import * as Mobile from "./Mobile/Schema"; -import * as UserSystem from "./UserSystem/Schema"; -import * as System from "./System/Schema"; -import * as Token from "./Token/Schema"; -import * as User from "./User/Schema"; -import * as WechatUser from "./WechatUser/Schema"; -export type AddressIdSubQuery = { - [K in "$in" | "$nin"]?: (Address.AddressIdSubQuery & { - entity: "address"; - }) | any; -}; -export type ApplicationIdSubQuery = { - [K in "$in" | "$nin"]?: (Token.ApplicationIdSubQuery & { - entity: "token"; - }) | (WechatUser.ApplicationIdSubQuery & { - entity: "wechatUser"; - }) | (Application.ApplicationIdSubQuery & { - entity: "application"; - }) | any; -}; -export type AreaIdSubQuery = { - [K in "$in" | "$nin"]?: (Address.AreaIdSubQuery & { - entity: "address"; - }) | (Area.AreaIdSubQuery & { - entity: "area"; - }) | (Area.AreaIdSubQuery & { - entity: "area"; - }) | any; -}; -export type ExtraFileIdSubQuery = { - [K in "$in" | "$nin"]?: (ExtraFile.ExtraFileIdSubQuery & { - entity: "extraFile"; - }) | any; -}; -export type MobileIdSubQuery = { - [K in "$in" | "$nin"]?: (Mobile.MobileIdSubQuery & { - entity: "mobile"; - }) | any; -}; -export type UserSystemIdSubQuery = { - [K in "$in" | "$nin"]?: (UserSystem.UserSystemIdSubQuery & { - entity: "userSystem"; - }) | any; -}; -export type SystemIdSubQuery = { - [K in "$in" | "$nin"]?: (Application.SystemIdSubQuery & { - entity: "application"; - }) | (UserSystem.SystemIdSubQuery & { - entity: "userSystem"; - }) | (System.SystemIdSubQuery & { - entity: "system"; - }) | any; -}; -export type TokenIdSubQuery = { - [K in "$in" | "$nin"]?: (Token.TokenIdSubQuery & { - entity: "token"; - }) | any; -}; -export type UserIdSubQuery = { - [K in "$in" | "$nin"]?: (Mobile.UserIdSubQuery & { - entity: "mobile"; - }) | (UserSystem.UserIdSubQuery & { - entity: "userSystem"; - }) | (Token.UserIdSubQuery & { - entity: "token"; - }) | (User.UserIdSubQuery & { - entity: "user"; - }) | (WechatUser.UserIdSubQuery & { - entity: "wechatUser"; - }) | (User.UserIdSubQuery & { - entity: "user"; - }) | any; -}; -export type WechatUserIdSubQuery = { - [K in "$in" | "$nin"]?: (WechatUser.WechatUserIdSubQuery & { - entity: "wechatUser"; - }) | any; -};