This commit is contained in:
梁朝伟 2022-08-22 21:54:42 +08:00
parent da4efb5192
commit b31d129bdc
153 changed files with 6229 additions and 320 deletions

View File

@ -9,7 +9,7 @@ export declare function createWechatQrCode<ED extends EntityDict, T extends keyo
lifetimeLength?: number; lifetimeLength?: number;
permanent?: boolean; permanent?: boolean;
props: WechatQrCodeProps; props: WechatQrCodeProps;
}, context: Cxt): Promise<Omit<Omit<import("../general-app-domain/WechatQrCode/Schema").OpSchema, "applicationId" | "entity" | "entityId">, import("oak-domain/lib/types").InstinctiveAttributes> & { }, context: Cxt): Promise<Omit<Omit<import("../general-app-domain/WechatQrCode/Schema").OpSchema, "entity" | "entityId" | "applicationId">, import("oak-domain/lib/types").InstinctiveAttributes> & {
id: string; id: string;
} & { } & {
applicationId: string; applicationId: string;
@ -18,6 +18,6 @@ export declare function createWechatQrCode<ED extends EntityDict, T extends keyo
[K: string]: any; [K: string]: any;
} & { } & {
[k: string]: any; [k: string]: any;
operEntity$entity?: import("oak-domain/lib/types").Operation<string, Omit<import("../general-app-domain/OperEntity/Schema").UpdateOperationData, "entity" | "entityId">, import("../general-app-domain/OperEntity/Schema").Filter<import("oak-domain/lib/types").Q_EnumValue<string>>, undefined> | (import("oak-domain/lib/types").Operation<string, Omit<import("../general-app-domain/OperEntity/Schema").UpdateOperationData, "entity" | "entityId">, import("../general-app-domain/OperEntity/Schema").Filter<import("oak-domain/lib/types").Q_EnumValue<string>>, undefined> | import("oak-domain/lib/types").Operation<"create", Omit<import("../general-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId"> | Omit<import("../general-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[], undefined, undefined>)[] | undefined; operEntity$entity?: import("oak-domain/lib/types").Operation<"update", Omit<import("../general-app-domain/OperEntity/Schema").UpdateOperationData, "entity" | "entityId">, import("../general-app-domain/OperEntity/Schema").Filter<import("oak-domain/lib/types").Q_EnumValue<string>>, undefined> | (import("oak-domain/lib/types").Operation<"update", Omit<import("../general-app-domain/OperEntity/Schema").UpdateOperationData, "entity" | "entityId">, import("../general-app-domain/OperEntity/Schema").Filter<import("oak-domain/lib/types").Q_EnumValue<string>>, undefined> | import("oak-domain/lib/types").Operation<"create", Omit<import("../general-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId"> | Omit<import("../general-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[], undefined, undefined>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<string, Omit<import("../general-app-domain/ModiEntity/Schema").UpdateOperationData, "entity" | "entityId">, import("../general-app-domain/ModiEntity/Schema").Filter<import("oak-domain/lib/types").Q_EnumValue<string>>, undefined> | (import("oak-domain/lib/types").Operation<string, Omit<import("../general-app-domain/ModiEntity/Schema").UpdateOperationData, "entity" | "entityId">, import("../general-app-domain/ModiEntity/Schema").Filter<import("oak-domain/lib/types").Q_EnumValue<string>>, undefined> | import("oak-domain/lib/types").Operation<"create", Omit<import("../general-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId"> | Omit<import("../general-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[], undefined, undefined>)[] | undefined; modiEntity$entity?: import("oak-domain/lib/types").Operation<"update", Omit<import("../general-app-domain/ModiEntity/Schema").UpdateOperationData, "entity" | "entityId">, import("../general-app-domain/ModiEntity/Schema").Filter<import("oak-domain/lib/types").Q_EnumValue<string>>, undefined> | (import("oak-domain/lib/types").Operation<"update", Omit<import("../general-app-domain/ModiEntity/Schema").UpdateOperationData, "entity" | "entityId">, import("../general-app-domain/ModiEntity/Schema").Filter<import("oak-domain/lib/types").Q_EnumValue<string>>, undefined> | import("oak-domain/lib/types").Operation<"create", Omit<import("../general-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId"> | Omit<import("../general-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[], undefined, undefined>)[] | undefined;
}>; }>;

10
lib/base-app-domain/ActionDefDict.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
export declare const ActionDefDict: {
token: {
ableState: import("oak-domain/lib/types").ActionDef<import("oak-domain/lib/actions/action").AbleAction, import("oak-domain/lib/actions/action").AbleState>;
};
user: {
idState: import("oak-domain/lib/types").ActionDef<import("./User/Action").IdAction, import("./User/Action").IdState>;
userState: import("oak-domain/lib/types").ActionDef<import("./User/Action").UserAction, import("./User/Action").UserState>;
};
userEntityGrant: {};
};

View File

@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionDefDict = void 0;
const Action_1 = require("./Token/Action");
const Action_2 = require("./User/Action");
const Action_3 = require("./UserEntityGrant/Action");
exports.ActionDefDict = {
token: Action_1.ActionDefDict,
user: Action_2.ActionDefDict,
userEntityGrant: Action_3.ActionDefDict
};

148
lib/base-app-domain/Address/Schema.d.ts vendored Normal file
View File

@ -0,0 +1,148 @@
import { String, Boolean, Text, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_BooleanValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as Area from "../Area/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
detail: String<32>;
areaId: ForeignKey<"area">;
phone: String<12>;
name: String<32>;
default: Boolean;
remark: Text;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
detail: String<32>;
areaId: ForeignKey<"area">;
phone: String<12>;
name: String<32>;
default: Boolean;
remark: Text;
area: Area.Schema;
} & {
[A in ExpressionKey]?: any;
};
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare 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<ExprOp<OpAttr>>;
export declare 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<ExprOp<OpAttr>>;
declare type AddressIdProjection = OneOf<{
id: 1;
}>;
declare type AreaIdProjection = OneOf<{
areaId: 1;
}>;
export declare 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<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "areaId">> & (({
areaId?: never | null;
area: Area.CreateSingleOperation;
} | {
areaId: String<64>;
area?: Area.UpdateOperation;
})) & {
[k: string]: any;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "areaId">> & (({
area?: Area.CreateSingleOperation | Area.UpdateOperation | Area.RemoveOperation;
areaId?: undefined;
} | {
area?: undefined;
areaId?: String<64> | null;
})) & {
[k: string]: any;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
area?: Area.UpdateOperation;
} | {
area?: Area.RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type AreaIdSubQuery = Selection<AreaIdProjection>;
export declare type AddressIdSubQuery = Selection<AddressIdProjection>;
export declare type NativeAttr = OpAttr | `area.${Area.NativeAttr}`;
export declare type FullAttr = NativeAttr;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
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"
}
}
};

View File

@ -0,0 +1,11 @@
declare const _default: {
attr: {
detail: string;
area: string;
phone: string;
name: string;
default: string;
remark: string;
};
};
export default _default;

View File

@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
detail: '详情',
area: '所在地区',
phone: '联系电话',
name: '姓名',
default: '是否默认',
remark: '备注'
}
};

View File

@ -0,0 +1,185 @@
import { String, Text, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as System from "../System/Schema";
import * as Token from "../Token/Schema";
import * as WechatQrCode from "../WechatQrCode/Schema";
import * as WechatUser from "../WechatUser/Schema";
export declare type WechatMpConfig = {
type: 'wechatMp';
appId: string;
appSecret: string;
qrCodePrefix?: string;
};
export declare type WebConfig = {
type: 'web';
domain: string;
};
export declare type WechatPublicCofig = {
type: 'wechatPublic';
appId: string;
appSecret: string;
};
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name: String<32>;
description: Text;
type: 'web' | 'wechatPublic' | 'wechatMp';
systemId: ForeignKey<"system">;
config: WebConfig | WechatMpConfig | WechatPublicCofig;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name: String<32>;
description: Text;
type: 'web' | 'wechatPublic' | 'wechatMp';
systemId: ForeignKey<"system">;
config: WebConfig | WechatMpConfig | WechatPublicCofig;
system: System.Schema;
token$application?: Array<Token.Schema>;
wechatQrCode$application?: Array<WechatQrCode.Schema>;
wechatUser$application?: Array<WechatUser.Schema>;
} & {
[A in ExpressionKey]?: any;
};
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare type Projection = {
"#id"?: NodeId;
[k: string]: any;
id: 1;
$$createAt$$?: 1;
$$updateAt$$?: 1;
name?: 1;
description?: 1;
type?: 1;
systemId?: 1;
system?: System.Projection;
config?: 1;
token$application?: Token.Selection & {
$entity: "token";
};
wechatQrCode$application?: WechatQrCode.Selection & {
$entity: "wechatQrCode";
};
wechatUser$application?: WechatUser.Selection & {
$entity: "wechatUser";
};
} & Partial<ExprOp<OpAttr>>;
export declare type ExportProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: string;
$$createAt$$?: string;
$$updateAt$$?: string;
name?: string;
description?: string;
type?: string;
systemId?: string;
system?: System.ExportProjection;
config?: string;
token$application?: Token.Exportation & {
$entity: "token";
};
wechatQrCode$application?: WechatQrCode.Exportation & {
$entity: "wechatQrCode";
};
wechatUser$application?: WechatUser.Exportation & {
$entity: "wechatUser";
};
} & Partial<ExprOp<OpAttr>>;
declare type ApplicationIdProjection = OneOf<{
id: 1;
}>;
declare type SystemIdProjection = OneOf<{
systemId: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
name: 1;
description: 1;
type: 1;
systemId: 1;
system: System.SortAttr;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "systemId">> & (({
systemId?: never | null;
system: System.CreateSingleOperation;
} | {
systemId: String<64>;
system?: System.UpdateOperation;
})) & {
[k: string]: any;
token$application?: OakOperation<"update", Omit<Token.UpdateOperationData, "application" | "applicationId">, Token.Filter> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId"> | Omit<Token.CreateOperationData, "application" | "applicationId">[]> | OakOperation<"update", Omit<Token.UpdateOperationData, "application" | "applicationId">, Token.Filter>>;
wechatQrCode$application?: OakOperation<"update", Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, WechatQrCode.Filter> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId"> | Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | OakOperation<"update", Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, WechatQrCode.Filter>>;
wechatUser$application?: OakOperation<"update", Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, WechatUser.Filter> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId"> | Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | OakOperation<"update", Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, WechatUser.Filter>>;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "systemId">> & (({
system?: System.CreateSingleOperation | System.UpdateOperation | System.RemoveOperation;
systemId?: undefined;
} | {
system?: undefined;
systemId?: String<64> | null;
})) & {
[k: string]: any;
tokens$application?: Token.UpdateOperation | Token.RemoveOperation | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId"> | Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Token.UpdateOperation | Token.RemoveOperation>;
wechatQrCodes$application?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId"> | Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation>;
wechatUsers$application?: WechatUser.UpdateOperation | WechatUser.RemoveOperation | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId"> | Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | WechatUser.UpdateOperation | WechatUser.RemoveOperation>;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
system?: System.UpdateOperation;
} | {
system?: System.RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
export declare type NativeAttr = OpAttr | `system.${System.NativeAttr}`;
export declare type FullAttr = NativeAttr | `tokens$${number}.${Token.NativeAttr}` | `wechatQrCodes$${number}.${WechatQrCode.NativeAttr}` | `wechatUsers$${number}.${WechatUser.NativeAttr}`;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
name: {
type: "varchar",
params: {
width: 32
}
},
description: {
type: "text"
},
type: {
type: "varchar",
params: {
length: 16
}
},
systemId: {
type: "ref",
ref: "system"
},
config: {
type: "object"
}
}
};

View File

@ -0,0 +1,17 @@
declare const _default: {
attr: {
description: string;
type: string;
system: string;
name: string;
config: string;
};
v: {
type: {
web: string;
wechatPublic: string;
wechatMp: string;
};
};
};
export default _default;

View File

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
description: '描述',
type: '类型',
system: '系统',
name: '名称',
config: '设置'
},
v: {
type: {
web: '网站',
wechatPublic: '微信公众号',
wechatMp: '微信小程序'
}
}
};

162
lib/base-app-domain/Area/Schema.d.ts vendored Normal file
View File

@ -0,0 +1,162 @@
import { String, Datetime, PrimaryKey, ForeignKey, Geo } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as Address from "../Address/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name: String<32>;
level: 'province' | 'city' | 'district' | 'street' | 'country';
depth: 0 | 1 | 2 | 3 | 4;
parentId?: ForeignKey<"area"> | null;
code: String<12>;
center: Geo;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name: String<32>;
level: 'province' | 'city' | 'district' | 'street' | 'country';
depth: 0 | 1 | 2 | 3 | 4;
parentId?: ForeignKey<"area"> | null;
code: String<12>;
center: Geo;
parent?: Schema | null;
address$area?: Array<Address.Schema>;
area$parent?: Array<Schema>;
} & {
[A in ExpressionKey]?: any;
};
declare type AttrFilter = {
id: Q_StringValue | SubQuery.AreaIdSubQuery;
$$createAt$$: Q_DateValue;
$$updateAt$$: Q_DateValue;
name: Q_StringValue;
level: Q_EnumValue<'province' | 'city' | 'district' | 'street' | 'country'>;
depth: Q_EnumValue<0 | 1 | 2 | 3 | 4>;
parentId: Q_StringValue | SubQuery.AreaIdSubQuery;
parent: Filter;
code: Q_StringValue;
};
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare type Projection = {
"#id"?: NodeId;
[k: string]: any;
id: 1;
$$createAt$$?: 1;
$$updateAt$$?: 1;
name?: 1;
level?: 1;
depth?: 1;
parentId?: 1;
parent?: Projection;
code?: 1;
center?: 1;
address$area?: Address.Selection & {
$entity: "address";
};
area$parent?: Selection & {
$entity: "area";
};
} & Partial<ExprOp<OpAttr>>;
export declare type ExportProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: string;
$$createAt$$?: string;
$$updateAt$$?: string;
name?: string;
level?: string;
depth?: string;
parentId?: string;
parent?: ExportProjection;
code?: string;
center?: string;
address$area?: Address.Exportation & {
$entity: "address";
};
area$parent?: Exportation & {
$entity: "area";
};
} & Partial<ExprOp<OpAttr>>;
declare type AreaIdProjection = OneOf<{
id: 1;
parentId: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
name: 1;
level: 1;
depth: 1;
parentId: 1;
parent: SortAttr;
code: 1;
center: 1;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "parentId">> & (({
parentId?: never | null;
parent?: CreateSingleOperation;
} | {
parentId?: String<64>;
parent?: UpdateOperation;
})) & {
[k: string]: any;
address$area?: OakOperation<"update", Omit<Address.UpdateOperationData, "area" | "areaId">, Address.Filter> | Array<OakOperation<"create", Omit<Address.CreateOperationData, "area" | "areaId"> | Omit<Address.CreateOperationData, "area" | "areaId">[]> | OakOperation<"update", Omit<Address.UpdateOperationData, "area" | "areaId">, Address.Filter>>;
area$parent?: OakOperation<"update", Omit<UpdateOperationData, "parent" | "parentId">, Filter> | Array<OakOperation<"create", Omit<CreateOperationData, "parent" | "parentId"> | Omit<CreateOperationData, "parent" | "parentId">[]> | OakOperation<"update", Omit<UpdateOperationData, "parent" | "parentId">, Filter>>;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "parentId">> & (({
parent?: CreateSingleOperation | UpdateOperation | RemoveOperation;
parentId?: undefined;
} | {
parent?: undefined;
parentId?: String<64> | null;
})) & {
[k: string]: any;
addresss$area?: Address.UpdateOperation | Address.RemoveOperation | Array<OakOperation<"create", Omit<Address.CreateOperationData, "area" | "areaId"> | Omit<Address.CreateOperationData, "area" | "areaId">[]> | Address.UpdateOperation | Address.RemoveOperation>;
areas$parent?: UpdateOperation | RemoveOperation | Array<OakOperation<"create", Omit<CreateOperationData, "parent" | "parentId"> | Omit<CreateOperationData, "parent" | "parentId">[]> | UpdateOperation | RemoveOperation>;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
parent?: UpdateOperation;
} | {
parent?: RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type AreaIdSubQuery = Selection<AreaIdProjection>;
export declare type NativeAttr = OpAttr | `parent.${OpAttr}` | `parent.parent.${OpAttr}` | `parent.parent.parent.${OpAttr}`;
export declare type FullAttr = NativeAttr | `addresss$${number}.${Address.NativeAttr}` | `areas$${number}.${NativeAttr}`;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

3
lib/base-app-domain/Area/Storage.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
name: {
type: "varchar",
params: {
width: 32
}
},
level: {
type: "varchar",
params: {
length: 16
}
},
depth: {
type: "int",
params: {
precision: 8,
scale: 2
}
},
parentId: {
type: "ref",
ref: "area"
},
code: {
type: "varchar",
params: {
width: 12
}
},
center: {
type: "geometry"
}
}
};

View File

@ -0,0 +1,20 @@
declare const _default: {
attr: {
level: string;
depth: string;
parent: string;
name: string;
code: string;
center: string;
};
v: {
level: {
country: string;
province: string;
city: string;
district: string;
street: string;
};
};
};
export default _default;

View File

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
level: '层级',
depth: '深度',
parent: '上级地区',
name: '名称',
code: '邮政编码',
center: '中心坐标'
},
v: {
level: {
country: '国家',
province: '省',
city: '市',
district: '区',
street: '街道'
}
}
};

30
lib/base-app-domain/EntityDict.d.ts vendored Normal file
View File

@ -0,0 +1,30 @@
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 UserRole } from "./UserRole/Schema";
import { EntityDef as Role } from "./Role/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 UserEntityGrant } from "./UserEntityGrant/Schema";
import { EntityDef as WechatQrCode } from "./WechatQrCode/Schema";
import { EntityDef as WechatUser } from "./WechatUser/Schema";
export declare type EntityDict = {
address: Address;
application: Application;
area: Area;
extraFile: ExtraFile;
mobile: Mobile;
userRole: UserRole;
role: Role;
userSystem: UserSystem;
system: System;
token: Token;
user: User;
userEntityGrant: UserEntityGrant;
wechatQrCode: WechatQrCode;
wechatUser: WechatUser;
};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,197 @@
import { String, Int, Text, Datetime, PrimaryKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as User from "../User/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
origin: 'qiniu' | 'unknown';
type: 'image' | 'pdf' | 'video' | 'audio' | 'file';
bucket: String<16>;
objectId: String<64>;
tag1: String<16>;
tag2: String<16>;
filename: String<64>;
md5: Text;
entity: "user" | string;
entityId: String<64>;
extra1?: Text | null;
extension: String<16>;
size?: Int<4> | null;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
origin: 'qiniu' | 'unknown';
type: 'image' | 'pdf' | 'video' | 'audio' | 'file';
bucket: String<16>;
objectId: String<64>;
tag1: String<16>;
tag2: String<16>;
filename: String<64>;
md5: Text;
entity: "user" | string;
entityId: String<64>;
extra1?: Text | null;
extension: String<16>;
size?: Int<4> | null;
user?: User.Schema;
} & {
[A in ExpressionKey]?: any;
};
declare type AttrFilter<E> = {
id: Q_StringValue | SubQuery.ExtraFileIdSubQuery;
$$createAt$$: Q_DateValue;
$$updateAt$$: Q_DateValue;
origin: Q_EnumValue<'qiniu' | 'unknown'>;
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;
extra1: Q_StringValue;
extension: Q_StringValue;
size: Q_NumberValue;
};
export declare type Filter<E = Q_EnumValue<"user" | string>> = MakeFilter<AttrFilter<E> & ExprOp<OpAttr>>;
export declare 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;
extra1?: 1;
extension?: 1;
size?: 1;
user?: User.Projection;
} & Partial<ExprOp<OpAttr>>;
export declare 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;
extra1?: string;
extension?: string;
size?: string;
user?: User.ExportProjection;
} & Partial<ExprOp<OpAttr>>;
declare type ExtraFileIdProjection = OneOf<{
id: 1;
}>;
declare type UserIdProjection = OneOf<{
entityId: 1;
}>;
export declare 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;
extra1: 1;
extension: 1;
size: 1;
user: User.SortAttr;
[k: string]: any;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entityId" | "entity" | "entityId">> & ({
entity?: never;
entityId?: never;
user: User.CreateSingleOperation;
} | {
entity: "user";
entityId: String<64>;
user?: User.UpdateOperation;
} | {
[K: string]: any;
}) & {
[k: string]: any;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entityId" | "entity" | "entityId">> & ({
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
entityId?: undefined;
entity?: undefined;
} | {
entity?: ("user" | string) | null;
entityId?: String<64> | null;
}) & {
[k: string]: any;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & ({
user?: User.UpdateOperation;
} | {
user?: User.RemoveOperation;
} | {
[k: string]: any;
});
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type UserIdSubQuery = Selection<UserIdProjection>;
export declare type ExtraFileIdSubQuery = Selection<ExtraFileIdProjection>;
export declare type NativeAttr = OpAttr | `entity.${User.NativeAttr}`;
export declare type FullAttr = NativeAttr;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
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
}
},
extra1: {
type: "text"
},
extension: {
type: "varchar",
params: {
width: 16
}
},
size: {
type: "int",
params: {
width: 4,
signed: true
}
}
}
};

View File

@ -0,0 +1,31 @@
declare const _default: {
attr: {
origin: string;
type: string;
bucket: string;
objectId: string;
tag1: string;
tag2: string;
filename: string;
md5: string;
entity: string;
entityId: string;
extra1: string;
extension: string;
size: string;
};
v: {
origin: {
qiniu: string;
unknown: string;
};
type: {
image: string;
pdf: string;
video: string;
audio: string;
file: string;
};
};
};
export default _default;

View File

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
origin: '源',
type: '类型',
bucket: '桶',
objectId: '对象编号',
tag1: '标签一',
tag2: '标签二',
filename: '文件名',
md5: "md5",
entity: '关联对象',
entityId: '关联对象id',
extra1: '额外信息',
extension: '后缀名',
size: '体积'
},
v: {
origin: {
qiniu: '七牛云',
unknown: '未知'
},
type: {
image: '图像',
pdf: 'pdf',
video: '视频',
audio: '音频',
file: '文件'
}
}
};

134
lib/base-app-domain/Mobile/Schema.d.ts vendored Normal file
View File

@ -0,0 +1,134 @@
import { String, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as User from "../User/Schema";
import * as Token from "../Token/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
mobile: String<16>;
userId: ForeignKey<"user">;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
mobile: String<16>;
userId: ForeignKey<"user">;
user: User.Schema;
token$entity?: Array<Token.Schema>;
} & {
[A in ExpressionKey]?: any;
};
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare type Projection = {
"#id"?: NodeId;
[k: string]: any;
id: 1;
$$createAt$$?: 1;
$$updateAt$$?: 1;
mobile?: 1;
userId?: 1;
user?: User.Projection;
token$entity?: Token.Selection & {
$entity: "token";
};
} & Partial<ExprOp<OpAttr>>;
export declare type ExportProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: string;
$$createAt$$?: string;
$$updateAt$$?: string;
mobile?: string;
userId?: string;
user?: User.ExportProjection;
token$entity?: Token.Exportation & {
$entity: "token";
};
} & Partial<ExprOp<OpAttr>>;
declare type MobileIdProjection = OneOf<{
id: 1;
}>;
declare type UserIdProjection = OneOf<{
userId: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
mobile: 1;
userId: 1;
user: User.SortAttr;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "userId">> & (({
userId?: never | null;
user: User.CreateSingleOperation;
} | {
userId: String<64>;
user?: User.UpdateOperation;
})) & {
[k: string]: any;
token$entity?: OakOperation<"update", Omit<Token.UpdateOperationData, "entity" | "entityId">, Token.Filter> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId"> | Omit<Token.CreateOperationData, "entity" | "entityId">[]> | OakOperation<"update", Omit<Token.UpdateOperationData, "entity" | "entityId">, Token.Filter>>;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
userId?: undefined;
} | {
user?: undefined;
userId?: String<64> | null;
})) & {
[k: string]: any;
tokens$entity?: Token.UpdateOperation | Token.RemoveOperation | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId"> | Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Token.UpdateOperation | Token.RemoveOperation>;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
user?: User.UpdateOperation;
} | {
user?: User.RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type UserIdSubQuery = Selection<UserIdProjection>;
export declare type MobileIdSubQuery = Selection<MobileIdProjection>;
export declare type NativeAttr = OpAttr | `user.${User.NativeAttr}`;
export declare type FullAttr = NativeAttr | `tokens$${number}.${Token.NativeAttr}`;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
mobile: {
type: "varchar",
params: {
width: 16
}
},
userId: {
type: "ref",
ref: "user"
}
}
};

View File

@ -0,0 +1,8 @@
declare const _default: {
attr: {
mobile: string;
user: string;
tokens: string;
};
};
export default _default;

View File

@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
mobile: '手机号',
user: '关联用户',
tokens: '相关令牌'
}
};

102
lib/base-app-domain/Role/Schema.d.ts vendored Normal file
View File

@ -0,0 +1,102 @@
import { String, Datetime, PrimaryKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as UserRole from "../UserRole/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name: String<64>;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name: String<64>;
userRole$role?: Array<UserRole.Schema>;
} & {
[A in ExpressionKey]?: any;
};
declare type AttrFilter = {
id: Q_StringValue | SubQuery.RoleIdSubQuery;
$$createAt$$: Q_DateValue;
$$updateAt$$: Q_DateValue;
name: Q_StringValue;
};
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare type Projection = {
"#id"?: NodeId;
[k: string]: any;
id: 1;
$$createAt$$?: 1;
$$updateAt$$?: 1;
name?: 1;
userRole$role?: UserRole.Selection & {
$entity: "userRole";
};
} & Partial<ExprOp<OpAttr>>;
export declare type ExportProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: string;
$$createAt$$?: string;
$$updateAt$$?: string;
name?: string;
userRole$role?: UserRole.Exportation & {
$entity: "userRole";
};
} & Partial<ExprOp<OpAttr>>;
declare type RoleIdProjection = OneOf<{
id: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
name: 1;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<OpSchema> & {
[k: string]: any;
userRole$role?: OakOperation<"update", Omit<UserRole.UpdateOperationData, "role" | "roleId">, UserRole.Filter> | Array<OakOperation<"create", Omit<UserRole.CreateOperationData, "role" | "roleId"> | Omit<UserRole.CreateOperationData, "role" | "roleId">[]> | OakOperation<"update", Omit<UserRole.UpdateOperationData, "role" | "roleId">, UserRole.Filter>>;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
[k: string]: any;
userRoles$role?: UserRole.UpdateOperation | UserRole.RemoveOperation | Array<OakOperation<"create", Omit<UserRole.CreateOperationData, "role" | "roleId"> | Omit<UserRole.CreateOperationData, "role" | "roleId">[]> | UserRole.UpdateOperation | UserRole.RemoveOperation>;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {};
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type RoleIdSubQuery = Selection<RoleIdProjection>;
export declare type NativeAttr = OpAttr;
export declare type FullAttr = NativeAttr | `userRoles$${number}.${UserRole.NativeAttr}`;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

3
lib/base-app-domain/Role/Storage.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
name: {
type: "varchar",
params: {
width: 64
}
}
}
};

View File

@ -0,0 +1,9 @@
declare const _default: {
attr: {
name: string;
};
r: {
owner: string;
};
};
export default _default;

View File

@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
name: '名称'
},
r: {
owner: '所有者'
}
};

3
lib/base-app-domain/Storage.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import { StorageSchema } from "oak-domain/lib/types/Storage";
import { EntityDict } from "./EntityDict";
export declare const storageSchema: StorageSchema<EntityDict>;

View File

@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.storageSchema = void 0;
const Storage_1 = require("./Address/Storage");
const Storage_2 = require("./Application/Storage");
const Storage_3 = require("./Area/Storage");
const Storage_4 = require("./ExtraFile/Storage");
const Storage_5 = require("./Mobile/Storage");
const Storage_6 = require("./UserRole/Storage");
const Storage_7 = require("./Role/Storage");
const Storage_8 = require("./UserSystem/Storage");
const Storage_9 = require("./System/Storage");
const Storage_10 = require("./Token/Storage");
const Storage_11 = require("./User/Storage");
const Storage_12 = require("./UserEntityGrant/Storage");
const Storage_13 = require("./WechatQrCode/Storage");
const Storage_14 = require("./WechatUser/Storage");
exports.storageSchema = {
address: Storage_1.desc,
application: Storage_2.desc,
area: Storage_3.desc,
extraFile: Storage_4.desc,
mobile: Storage_5.desc,
userRole: Storage_6.desc,
role: Storage_7.desc,
userSystem: Storage_8.desc,
system: Storage_9.desc,
token: Storage_10.desc,
user: Storage_11.desc,
userEntityGrant: Storage_12.desc,
wechatQrCode: Storage_13.desc,
wechatUser: Storage_14.desc
};

143
lib/base-app-domain/System/Schema.d.ts vendored Normal file
View File

@ -0,0 +1,143 @@
import { String, Text, Datetime, PrimaryKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as Application from "../Application/Schema";
import * as UserSystem from "../UserSystem/Schema";
export declare type SystemConfig = {
Cos?: {
qiniu?: {
accessKey: string;
secretKey: string;
uploadHost: string;
bucket: string;
domain: string;
protocol: string | string[];
};
};
Map?: {
amap?: {
webApiKey: string;
};
};
UserEntityGrant?: {
lifetimeLength: number;
};
};
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name: String<32>;
description: Text;
config: SystemConfig;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name: String<32>;
description: Text;
config: SystemConfig;
application$system?: Array<Application.Schema>;
userSystem$system?: Array<UserSystem.Schema>;
} & {
[A in ExpressionKey]?: any;
};
declare type AttrFilter = {
id: Q_StringValue | SubQuery.SystemIdSubQuery;
$$createAt$$: Q_DateValue;
$$updateAt$$: Q_DateValue;
name: Q_StringValue;
description: Q_StringValue;
};
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare type Projection = {
"#id"?: NodeId;
[k: string]: any;
id: 1;
$$createAt$$?: 1;
$$updateAt$$?: 1;
name?: 1;
description?: 1;
config?: 1;
application$system?: Application.Selection & {
$entity: "application";
};
userSystem$system?: UserSystem.Selection & {
$entity: "userSystem";
};
} & Partial<ExprOp<OpAttr>>;
export declare type ExportProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: string;
$$createAt$$?: string;
$$updateAt$$?: string;
name?: string;
description?: string;
config?: string;
application$system?: Application.Exportation & {
$entity: "application";
};
userSystem$system?: UserSystem.Exportation & {
$entity: "userSystem";
};
} & Partial<ExprOp<OpAttr>>;
declare type SystemIdProjection = OneOf<{
id: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
name: 1;
description: 1;
config: 1;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<OpSchema> & {
[k: string]: any;
application$system?: OakOperation<"update", Omit<Application.UpdateOperationData, "system" | "systemId">, Application.Filter> | Array<OakOperation<"create", Omit<Application.CreateOperationData, "system" | "systemId"> | Omit<Application.CreateOperationData, "system" | "systemId">[]> | OakOperation<"update", Omit<Application.UpdateOperationData, "system" | "systemId">, Application.Filter>>;
userSystem$system?: OakOperation<"update", Omit<UserSystem.UpdateOperationData, "system" | "systemId">, UserSystem.Filter> | Array<OakOperation<"create", Omit<UserSystem.CreateOperationData, "system" | "systemId"> | Omit<UserSystem.CreateOperationData, "system" | "systemId">[]> | OakOperation<"update", Omit<UserSystem.UpdateOperationData, "system" | "systemId">, UserSystem.Filter>>;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
[k: string]: any;
applications$system?: Application.UpdateOperation | Application.RemoveOperation | Array<OakOperation<"create", Omit<Application.CreateOperationData, "system" | "systemId"> | Omit<Application.CreateOperationData, "system" | "systemId">[]> | Application.UpdateOperation | Application.RemoveOperation>;
userSystems$system?: UserSystem.UpdateOperation | UserSystem.RemoveOperation | Array<OakOperation<"create", Omit<UserSystem.CreateOperationData, "system" | "systemId"> | Omit<UserSystem.CreateOperationData, "system" | "systemId">[]> | UserSystem.UpdateOperation | UserSystem.RemoveOperation>;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {};
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
export declare type NativeAttr = OpAttr;
export declare type FullAttr = NativeAttr | `applications$${number}.${Application.NativeAttr}` | `userSystems$${number}.${UserSystem.NativeAttr}`;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
name: {
type: "varchar",
params: {
width: 32
}
},
description: {
type: "text"
},
config: {
type: "object"
}
}
};

View File

@ -0,0 +1,11 @@
declare const _default: {
attr: {
name: string;
description: string;
config: string;
};
r: {
owner: string;
};
};
export default _default;

View File

@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
name: '名称',
description: '描述',
config: '设置'
},
r: {
owner: '所有者'
}
};

8
lib/base-app-domain/Token/Action.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
import { AbleAction } from 'oak-domain/lib/actions/action';
import { ActionDef } from "oak-domain/lib/types/Action";
import { GenericAction } from "oak-domain/lib/actions/action";
export declare type ParticularAction = AbleAction;
export declare type Action = GenericAction | ParticularAction;
export declare const ActionDefDict: {
ableState: ActionDef<AbleAction, import("oak-domain/lib/actions/action").AbleState>;
};

View File

@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionDefDict = void 0;
const action_1 = require("oak-domain/lib/actions/action");
const AbleActionDef = (0, action_1.makeAbleActionDef)('enabled');
exports.ActionDefDict = {
ableState: AbleActionDef
};

282
lib/base-app-domain/Token/Schema.d.ts vendored Normal file
View File

@ -0,0 +1,282 @@
import { String, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { AbleState } from 'oak-domain/lib/actions/action';
import { Action, ParticularAction } from "./Action";
import * as Application from "../Application/Schema";
import * as User from "../User/Schema";
import * as Mobile from "../Mobile/Schema";
import * as WechatUser from "../WechatUser/Schema";
export declare type WechatMpEnv = {
type: 'wechatMp';
brand: string;
model: string;
pixelRatio: number;
screenWidth: number;
screenHeight: number;
windowWidth: number;
windowHeight: number;
statusBarHeight: number;
language: string;
version: string;
system: string;
platform: string;
fontSizeSetting: number;
SDKVersion: string;
};
export declare type WebEnv = {
type: 'web';
};
export declare type Environment = WechatMpEnv | WebEnv;
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
applicationId: ForeignKey<"application">;
entity: "mobile" | "wechatUser" | string;
entityId: String<64>;
userId?: ForeignKey<"user"> | null;
playerId?: ForeignKey<"user"> | null;
env: Environment;
ableState?: AbleState | null;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
applicationId: ForeignKey<"application">;
entity: "mobile" | "wechatUser" | string;
entityId: String<64>;
userId?: ForeignKey<"user"> | null;
playerId?: ForeignKey<"user"> | null;
env: Environment;
ableState?: AbleState | null;
application: Application.Schema;
user?: User.Schema | null;
player?: User.Schema | null;
mobile?: Mobile.Schema;
wechatUser?: WechatUser.Schema;
} & {
[A in ExpressionKey]?: any;
};
declare type AttrFilter<E> = {
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<AbleState>;
};
export declare type Filter<E = Q_EnumValue<"mobile" | "wechatUser" | string>> = MakeFilter<AttrFilter<E> & ExprOp<OpAttr>>;
export declare 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;
env?: 1;
ableState?: 1;
mobile?: Mobile.Projection;
wechatUser?: WechatUser.Projection;
} & Partial<ExprOp<OpAttr>>;
export declare 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;
env?: string;
ableState?: string;
mobile?: Mobile.ExportProjection;
wechatUser?: WechatUser.ExportProjection;
} & Partial<ExprOp<OpAttr>>;
declare type TokenIdProjection = OneOf<{
id: 1;
}>;
declare type ApplicationIdProjection = OneOf<{
applicationId: 1;
}>;
declare type UserIdProjection = OneOf<{
userId: 1;
playerId: 1;
}>;
declare type MobileIdProjection = OneOf<{
entityId: 1;
}>;
declare type WechatUserIdProjection = OneOf<{
entityId: 1;
}>;
export declare 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;
env: 1;
ableState: 1;
mobile: Mobile.SortAttr;
wechatUser: WechatUser.SortAttr;
[k: string]: any;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "applicationId" | "userId" | "playerId" | "entityId" | "entityId" | "entity" | "entityId">> & (({
applicationId?: never | null;
application: Application.CreateSingleOperation;
} | {
applicationId: String<64>;
application?: Application.UpdateOperation;
}) & ({
userId?: never | null;
user?: User.CreateSingleOperation;
} | {
userId?: String<64>;
user?: User.UpdateOperation;
}) & ({
playerId?: never | null;
player?: User.CreateSingleOperation;
} | {
playerId?: String<64>;
player?: User.UpdateOperation;
})) & ({
entity?: never;
entityId?: never;
mobile: Mobile.CreateSingleOperation;
} | {
entity: "mobile";
entityId: String<64>;
mobile?: Mobile.UpdateOperation;
} | {
entity?: never;
entityId?: never;
wechatUser: WechatUser.CreateSingleOperation;
} | {
entity: "wechatUser";
entityId: String<64>;
wechatUser?: WechatUser.UpdateOperation;
} | {
[K: string]: any;
}) & {
[k: string]: any;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "applicationId" | "userId" | "playerId" | "entityId" | "entityId" | "entity" | "entityId">> & (({
application?: Application.CreateSingleOperation | Application.UpdateOperation | Application.RemoveOperation;
applicationId?: undefined;
} | {
application?: undefined;
applicationId?: String<64> | null;
}) & ({
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
userId?: undefined;
} | {
user?: undefined;
userId?: String<64> | null;
}) & ({
player?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
playerId?: undefined;
} | {
player?: undefined;
playerId?: String<64> | null;
})) & ({
mobile?: Mobile.CreateSingleOperation | Mobile.UpdateOperation | Mobile.RemoveOperation;
entityId?: undefined;
entity?: undefined;
} | {
wechatUser?: WechatUser.CreateSingleOperation | WechatUser.UpdateOperation | WechatUser.RemoveOperation;
entityId?: undefined;
entity?: undefined;
} | {
entity?: ("mobile" | "wechatUser" | string) | null;
entityId?: String<64> | null;
}) & {
[k: string]: any;
};
export declare type UpdateOperation = OakOperation<ParticularAction | "update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
application?: Application.UpdateOperation;
} | {
application?: Application.RemoveOperation;
}) & ({
user?: User.UpdateOperation;
} | {
user?: User.RemoveOperation;
}) & ({
player?: User.UpdateOperation;
} | {
player?: User.RemoveOperation;
})) & ({
mobile?: Mobile.UpdateOperation;
} | {
mobile?: Mobile.RemoveOperation;
} | {
wechatUser?: WechatUser.UpdateOperation;
} | {
wechatUser?: WechatUser.RemoveOperation;
} | {
[k: string]: any;
});
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
export declare type UserIdSubQuery = Selection<UserIdProjection>;
export declare type MobileIdSubQuery = Selection<MobileIdProjection>;
export declare type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
export declare type TokenIdSubQuery = Selection<TokenIdProjection>;
export declare type NativeAttr = OpAttr | `application.${Application.NativeAttr}` | `user.${User.NativeAttr}` | `player.${User.NativeAttr}` | `entity.${Mobile.NativeAttr}` | `entity.${WechatUser.NativeAttr}`;
export declare type FullAttr = NativeAttr;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: Action;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
ParticularAction: ParticularAction;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
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"
},
env: {
type: "object"
},
ableState: {
type: "varchar",
params: {
length: 16
}
}
}
};

View File

@ -0,0 +1,15 @@
declare const _default: {
attr: {
application: string;
entity: string;
entityId: string;
user: string;
player: string;
env: string;
};
action: {
enable: string;
disable: string;
};
};
export default _default;

View File

@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
application: '应用',
entity: '关联对象',
entityId: '关联对象id',
user: '用户',
player: '扮演者',
env: '环境'
},
action: {
enable: '激活',
disable: '禁用'
}
};

13
lib/base-app-domain/User/Action.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
import { ActionDef } from "oak-domain/lib/types/Action";
import { GenericAction } from "oak-domain/lib/actions/action";
export declare type IdAction = 'verify' | 'accept' | 'reject';
export declare type IdState = 'unverified' | 'verified' | 'verifying';
export declare type UserAction = 'activate' | 'disable' | 'enable' | 'mergeTo' | 'mergeFrom';
export declare type UserState = 'shadow' | 'normal' | 'disabled' | 'merged';
export declare type CascadeAction = 'play';
export declare type ParticularAction = UserAction | IdAction | CascadeAction;
export declare type Action = GenericAction | ParticularAction;
export declare const ActionDefDict: {
idState: ActionDef<IdAction, IdState>;
userState: ActionDef<UserAction, UserState>;
};

View File

@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionDefDict = void 0;
const IdActionDef = {
stm: {
verify: ['unverified', 'verifying'],
accept: [['unverified', 'verifying'], 'verified'],
reject: [['verifying', 'verified'], 'unverified']
},
is: 'unverified'
};
const UserActionDef = {
stm: {
activate: ['shadow', 'normal'],
disable: [['normal', 'shadow'], 'disabled'],
enable: ['disabled', 'normal'],
mergeTo: [['normal', 'shadow'], 'merged'],
mergeFrom: ['normal', 'normal']
}
};
exports.ActionDefDict = {
idState: IdActionDef,
userState: UserActionDef
};

272
lib/base-app-domain/User/Schema.d.ts vendored Normal file
View File

@ -0,0 +1,272 @@
import { String, Text, Datetime, Image, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { Action, ParticularAction, UserState, IdState } from "./Action";
import * as Mobile from "../Mobile/Schema";
import * as UserRole from "../UserRole/Schema";
import * as UserSystem from "../UserSystem/Schema";
import * as Token from "../Token/Schema";
import * as UserEntityGrant from "../UserEntityGrant/Schema";
import * as WechatUser from "../WechatUser/Schema";
import * as ExtraFile from "../ExtraFile/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name?: String<16> | null;
nickname?: String<64> | null;
password?: Text | null;
birth?: Datetime | null;
gender?: ('male' | 'female') | null;
avatar?: Image | null;
idCardType?: ('ID-Card' | 'passport' | 'Mainland-passport') | null;
idNumber?: String<32> | null;
refId?: ForeignKey<"user"> | null;
idState?: IdState | null;
userState?: UserState | null;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
name?: String<16> | null;
nickname?: String<64> | null;
password?: Text | null;
birth?: Datetime | null;
gender?: ('male' | 'female') | null;
avatar?: Image | null;
idCardType?: ('ID-Card' | 'passport' | 'Mainland-passport') | null;
idNumber?: String<32> | null;
refId?: ForeignKey<"user"> | null;
idState?: IdState | null;
userState?: UserState | null;
ref?: Schema | null;
mobile$user?: Array<Mobile.Schema>;
userRole$user?: Array<UserRole.Schema>;
userSystem$user?: Array<UserSystem.Schema>;
token$user?: Array<Token.Schema>;
token$player?: Array<Token.Schema>;
user$ref?: Array<Schema>;
userEntityGrant$granter?: Array<UserEntityGrant.Schema>;
userEntityGrant$grantee?: Array<UserEntityGrant.Schema>;
wechatUser$user?: Array<WechatUser.Schema>;
extraFile$entity?: Array<ExtraFile.Schema>;
} & {
[A in ExpressionKey]?: any;
};
declare 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;
idState: Q_EnumValue<IdState>;
userState: Q_EnumValue<UserState>;
};
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr> & FulltextFilter>;
export declare 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;
idState?: 1;
userState?: 1;
mobile$user?: Mobile.Selection & {
$entity: "mobile";
};
userRole$user?: UserRole.Selection & {
$entity: "userRole";
};
userSystem$user?: UserSystem.Selection & {
$entity: "userSystem";
};
token$user?: Token.Selection & {
$entity: "token";
};
token$player?: Token.Selection & {
$entity: "token";
};
user$ref?: Selection & {
$entity: "user";
};
userEntityGrant$granter?: UserEntityGrant.Selection & {
$entity: "userEntityGrant";
};
userEntityGrant$grantee?: UserEntityGrant.Selection & {
$entity: "userEntityGrant";
};
wechatUser$user?: WechatUser.Selection & {
$entity: "wechatUser";
};
extraFile$entity?: ExtraFile.Selection & {
$entity: "extraFile";
};
} & Partial<ExprOp<OpAttr>>;
export declare 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;
idState?: string;
userState?: string;
mobile$user?: Mobile.Exportation & {
$entity: "mobile";
};
userRole$user?: UserRole.Exportation & {
$entity: "userRole";
};
userSystem$user?: UserSystem.Exportation & {
$entity: "userSystem";
};
token$user?: Token.Exportation & {
$entity: "token";
};
token$player?: Token.Exportation & {
$entity: "token";
};
user$ref?: Exportation & {
$entity: "user";
};
userEntityGrant$granter?: UserEntityGrant.Exportation & {
$entity: "userEntityGrant";
};
userEntityGrant$grantee?: UserEntityGrant.Exportation & {
$entity: "userEntityGrant";
};
wechatUser$user?: WechatUser.Exportation & {
$entity: "wechatUser";
};
extraFile$entity?: ExtraFile.Exportation & {
$entity: "extraFile";
};
} & Partial<ExprOp<OpAttr>>;
declare type UserIdProjection = OneOf<{
id: 1;
refId: 1;
}>;
export declare 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;
idState: 1;
userState: 1;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "refId">> & (({
refId?: never | null;
ref?: CreateSingleOperation;
} | {
refId?: String<64>;
ref?: UpdateOperation;
})) & {
[k: string]: any;
mobile$user?: OakOperation<"update", Omit<Mobile.UpdateOperationData, "user" | "userId">, Mobile.Filter> | Array<OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId"> | Omit<Mobile.CreateOperationData, "user" | "userId">[]> | OakOperation<"update", Omit<Mobile.UpdateOperationData, "user" | "userId">, Mobile.Filter>>;
userRole$user?: OakOperation<"update", Omit<UserRole.UpdateOperationData, "user" | "userId">, UserRole.Filter> | Array<OakOperation<"create", Omit<UserRole.CreateOperationData, "user" | "userId"> | Omit<UserRole.CreateOperationData, "user" | "userId">[]> | OakOperation<"update", Omit<UserRole.UpdateOperationData, "user" | "userId">, UserRole.Filter>>;
userSystem$user?: OakOperation<"update", Omit<UserSystem.UpdateOperationData, "user" | "userId">, UserSystem.Filter> | Array<OakOperation<"create", Omit<UserSystem.CreateOperationData, "user" | "userId"> | Omit<UserSystem.CreateOperationData, "user" | "userId">[]> | OakOperation<"update", Omit<UserSystem.UpdateOperationData, "user" | "userId">, UserSystem.Filter>>;
token$user?: OakOperation<"update", Omit<Token.UpdateOperationData, "user" | "userId">, Token.Filter> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId"> | Omit<Token.CreateOperationData, "user" | "userId">[]> | OakOperation<"update", Omit<Token.UpdateOperationData, "user" | "userId">, Token.Filter>>;
token$player?: OakOperation<"update", Omit<Token.UpdateOperationData, "player" | "playerId">, Token.Filter> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId"> | Omit<Token.CreateOperationData, "player" | "playerId">[]> | OakOperation<"update", Omit<Token.UpdateOperationData, "player" | "playerId">, Token.Filter>>;
user$ref?: OakOperation<"update", Omit<UpdateOperationData, "ref" | "refId">, Filter> | Array<OakOperation<"create", Omit<CreateOperationData, "ref" | "refId"> | Omit<CreateOperationData, "ref" | "refId">[]> | OakOperation<"update", Omit<UpdateOperationData, "ref" | "refId">, Filter>>;
userEntityGrant$granter?: OakOperation<"update", Omit<UserEntityGrant.UpdateOperationData, "granter" | "granterId">, UserEntityGrant.Filter> | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "granter" | "granterId"> | Omit<UserEntityGrant.CreateOperationData, "granter" | "granterId">[]> | OakOperation<"update", Omit<UserEntityGrant.UpdateOperationData, "granter" | "granterId">, UserEntityGrant.Filter>>;
userEntityGrant$grantee?: OakOperation<"update", Omit<UserEntityGrant.UpdateOperationData, "grantee" | "granteeId">, UserEntityGrant.Filter> | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "grantee" | "granteeId"> | Omit<UserEntityGrant.CreateOperationData, "grantee" | "granteeId">[]> | OakOperation<"update", Omit<UserEntityGrant.UpdateOperationData, "grantee" | "granteeId">, UserEntityGrant.Filter>>;
wechatUser$user?: OakOperation<"update", Omit<WechatUser.UpdateOperationData, "user" | "userId">, WechatUser.Filter> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "user" | "userId"> | Omit<WechatUser.CreateOperationData, "user" | "userId">[]> | OakOperation<"update", Omit<WechatUser.UpdateOperationData, "user" | "userId">, WechatUser.Filter>>;
extraFile$entity?: OakOperation<"update", Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, ExtraFile.Filter> | Array<OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId"> | Omit<ExtraFile.CreateOperationData, "entity" | "entityId">[]> | OakOperation<"update", Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, ExtraFile.Filter>>;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "refId">> & (({
ref?: CreateSingleOperation | UpdateOperation | RemoveOperation;
refId?: undefined;
} | {
ref?: undefined;
refId?: String<64> | null;
})) & {
[k: string]: any;
mobiles$user?: Mobile.UpdateOperation | Mobile.RemoveOperation | Array<OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId"> | Omit<Mobile.CreateOperationData, "user" | "userId">[]> | Mobile.UpdateOperation | Mobile.RemoveOperation>;
userRoles$user?: UserRole.UpdateOperation | UserRole.RemoveOperation | Array<OakOperation<"create", Omit<UserRole.CreateOperationData, "user" | "userId"> | Omit<UserRole.CreateOperationData, "user" | "userId">[]> | UserRole.UpdateOperation | UserRole.RemoveOperation>;
userSystems$user?: UserSystem.UpdateOperation | UserSystem.RemoveOperation | Array<OakOperation<"create", Omit<UserSystem.CreateOperationData, "user" | "userId"> | Omit<UserSystem.CreateOperationData, "user" | "userId">[]> | UserSystem.UpdateOperation | UserSystem.RemoveOperation>;
tokens$user?: Token.UpdateOperation | Token.RemoveOperation | Array<OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId"> | Omit<Token.CreateOperationData, "user" | "userId">[]> | Token.UpdateOperation | Token.RemoveOperation>;
tokens$player?: Token.UpdateOperation | Token.RemoveOperation | Array<OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId"> | Omit<Token.CreateOperationData, "player" | "playerId">[]> | Token.UpdateOperation | Token.RemoveOperation>;
users$ref?: UpdateOperation | RemoveOperation | Array<OakOperation<"create", Omit<CreateOperationData, "ref" | "refId"> | Omit<CreateOperationData, "ref" | "refId">[]> | UpdateOperation | RemoveOperation>;
userEntityGrants$granter?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "granter" | "granterId"> | Omit<UserEntityGrant.CreateOperationData, "granter" | "granterId">[]> | UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation>;
userEntityGrants$grantee?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "grantee" | "granteeId"> | Omit<UserEntityGrant.CreateOperationData, "grantee" | "granteeId">[]> | UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation>;
wechatUsers$user?: WechatUser.UpdateOperation | WechatUser.RemoveOperation | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "user" | "userId"> | Omit<WechatUser.CreateOperationData, "user" | "userId">[]> | WechatUser.UpdateOperation | WechatUser.RemoveOperation>;
extraFiles$entity?: ExtraFile.UpdateOperation | ExtraFile.RemoveOperation | Array<OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId"> | Omit<ExtraFile.CreateOperationData, "entity" | "entityId">[]> | ExtraFile.UpdateOperation | ExtraFile.RemoveOperation>;
};
export declare type UpdateOperation = OakOperation<ParticularAction | "update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
ref?: UpdateOperation;
} | {
ref?: RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type UserIdSubQuery = Selection<UserIdProjection>;
export declare type NativeAttr = OpAttr | `ref.${OpAttr}` | `ref.ref.${OpAttr}` | `ref.ref.ref.${OpAttr}`;
export declare type FullAttr = NativeAttr | `mobiles$${number}.${Mobile.NativeAttr}` | `userRoles$${number}.${UserRole.NativeAttr}` | `userSystems$${number}.${UserSystem.NativeAttr}` | `tokens$user$${number}.${Token.NativeAttr}` | `tokens$player$${number}.${Token.NativeAttr}` | `users$${number}.${NativeAttr}` | `userEntityGrants$granter$${number}.${UserEntityGrant.NativeAttr}` | `userEntityGrants$grantee$${number}.${UserEntityGrant.NativeAttr}` | `wechatUsers$${number}.${WechatUser.NativeAttr}` | `extraFiles$${number}.${ExtraFile.NativeAttr}`;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: Action;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
ParticularAction: ParticularAction;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

3
lib/base-app-domain/User/Storage.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,88 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
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"
},
idState: {
type: "varchar",
params: {
length: 16
}
},
userState: {
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'
}
}
]
};

View File

@ -0,0 +1,48 @@
declare const _default: {
attr: {
name: string;
nickname: string;
birth: string;
password: string;
gender: string;
avatar: string;
idCardType: string;
idNumber: string;
ref: string;
files: string;
};
action: {
activate: string;
play: string;
accept: string;
verify: string;
reject: string;
enable: string;
disable: string;
mergeTo: string;
mergeFrom: string;
};
v: {
userState: {
shadow: string;
normal: string;
disabled: string;
merged: string;
};
idState: {
unverified: string;
verifying: string;
verified: string;
};
gender: {
male: string;
female: string;
};
idCardType: {
"ID-Card": string;
passport: string;
"Mainland-passport": string;
};
};
};
export default _default;

View File

@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
name: '姓名',
nickname: '昵称',
birth: '生日',
password: '密码',
gender: '性别',
avatar: '头像',
idCardType: '证件类型',
idNumber: '证件号码',
ref: '介绍人',
files: '相关文件'
},
action: {
activate: '激活',
play: '扮演',
accept: '同意',
verify: '验证',
reject: '拒绝',
enable: '启用',
disable: '禁用',
mergeTo: '合并',
mergeFrom: '使合并'
},
v: {
userState: {
shadow: '未激活',
normal: '正常',
disabled: '禁用',
merged: '已被合并'
},
idState: {
unverified: '未验证',
verifying: '验证中',
verified: '已验证'
},
gender: {
male: '男',
female: '女'
},
idCardType: {
"ID-Card": '身份证',
passport: '护照',
"Mainland-passport": '港澳台通行证'
}
}
};

View File

@ -0,0 +1,4 @@
import { GenericAction } from "oak-domain/lib/actions/action";
export declare type ParticularAction = 'confirm';
export declare type Action = GenericAction | ParticularAction;
export declare const ActionDefDict: {};

View File

@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionDefDict = void 0;
exports.ActionDefDict = {};

View File

@ -0,0 +1,211 @@
import { String, Int, Boolean, Text, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { Action, ParticularAction } from "./Action";
import * as User from "../User/Schema";
import * as WechatQrCode from "../WechatQrCode/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
entity: String<32>;
entityId: String<64>;
relation: String<32>;
type: 'grant' | 'transfer';
number: Int<2>;
confirmed: Int<2>;
remark?: Text | null;
granterId: ForeignKey<"user">;
granteeId?: ForeignKey<"user"> | null;
expiresAt?: Datetime | null;
expired?: Boolean | null;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
entity: String<32>;
entityId: String<64>;
relation: String<32>;
type: 'grant' | 'transfer';
number: Int<2>;
confirmed: Int<2>;
remark?: Text | null;
granterId: ForeignKey<"user">;
granteeId?: ForeignKey<"user"> | null;
expiresAt?: Datetime | null;
expired?: Boolean | null;
granter: User.Schema;
grantee?: User.Schema | null;
wechatQrCode$entity?: Array<WechatQrCode.Schema>;
} & {
[A in ExpressionKey]?: any;
};
declare type AttrFilter = {
id: Q_StringValue | SubQuery.UserEntityGrantIdSubQuery;
$$createAt$$: Q_DateValue;
$$updateAt$$: Q_DateValue;
entity: Q_StringValue;
entityId: Q_StringValue;
relation: Q_StringValue;
type: Q_EnumValue<'grant' | 'transfer'>;
number: Q_NumberValue;
confirmed: Q_NumberValue;
remark: Q_StringValue;
granterId: Q_StringValue | SubQuery.UserIdSubQuery;
granter: User.Filter;
granteeId: Q_StringValue | SubQuery.UserIdSubQuery;
grantee: User.Filter;
expiresAt: Q_DateValue;
expired: Q_BooleanValue;
};
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare type Projection = {
"#id"?: NodeId;
[k: string]: any;
id: 1;
$$createAt$$?: 1;
$$updateAt$$?: 1;
entity?: 1;
entityId?: 1;
relation?: 1;
type?: 1;
number?: 1;
confirmed?: 1;
remark?: 1;
granterId?: 1;
granter?: User.Projection;
granteeId?: 1;
grantee?: User.Projection;
expiresAt?: 1;
expired?: 1;
wechatQrCode$entity?: WechatQrCode.Selection & {
$entity: "wechatQrCode";
};
} & Partial<ExprOp<OpAttr>>;
export declare type ExportProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: string;
$$createAt$$?: string;
$$updateAt$$?: string;
entity?: string;
entityId?: string;
relation?: string;
type?: string;
number?: string;
confirmed?: string;
remark?: string;
granterId?: string;
granter?: User.ExportProjection;
granteeId?: string;
grantee?: User.ExportProjection;
expiresAt?: string;
expired?: string;
wechatQrCode$entity?: WechatQrCode.Exportation & {
$entity: "wechatQrCode";
};
} & Partial<ExprOp<OpAttr>>;
declare type UserEntityGrantIdProjection = OneOf<{
id: 1;
}>;
declare type UserIdProjection = OneOf<{
granterId: 1;
granteeId: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
entity: 1;
entityId: 1;
relation: 1;
type: 1;
number: 1;
confirmed: 1;
remark: 1;
granterId: 1;
granter: User.SortAttr;
granteeId: 1;
grantee: User.SortAttr;
expiresAt: 1;
expired: 1;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "granterId" | "granteeId">> & (({
granterId?: never | null;
granter: User.CreateSingleOperation;
} | {
granterId: String<64>;
granter?: User.UpdateOperation;
}) & ({
granteeId?: never | null;
grantee?: User.CreateSingleOperation;
} | {
granteeId?: String<64>;
grantee?: User.UpdateOperation;
})) & {
[k: string]: any;
wechatQrCode$entity?: OakOperation<"update", Omit<WechatQrCode.UpdateOperationData, "entity" | "entityId">, WechatQrCode.Filter> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "entity" | "entityId"> | Omit<WechatQrCode.CreateOperationData, "entity" | "entityId">[]> | OakOperation<"update", Omit<WechatQrCode.UpdateOperationData, "entity" | "entityId">, WechatQrCode.Filter>>;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "granterId" | "granteeId">> & (({
granter?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
granterId?: undefined;
} | {
granter?: undefined;
granterId?: String<64> | null;
}) & ({
grantee?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
granteeId?: undefined;
} | {
grantee?: undefined;
granteeId?: String<64> | null;
})) & {
[k: string]: any;
wechatQrCodes$entity?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "entity" | "entityId"> | Omit<WechatQrCode.CreateOperationData, "entity" | "entityId">[]> | WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation>;
};
export declare type UpdateOperation = OakOperation<ParticularAction | "update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
granter?: User.UpdateOperation;
} | {
granter?: User.RemoveOperation;
}) & ({
grantee?: User.UpdateOperation;
} | {
grantee?: User.RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type UserIdSubQuery = Selection<UserIdProjection>;
export declare type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
export declare type NativeAttr = OpAttr | `granter.${User.NativeAttr}` | `grantee.${User.NativeAttr}`;
export declare type FullAttr = NativeAttr | `wechatQrCodes$${number}.${WechatQrCode.NativeAttr}`;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: Action;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
ParticularAction: ParticularAction;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,86 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
entity: {
type: "varchar",
params: {
width: 32
}
},
entityId: {
type: "varchar",
params: {
width: 64
}
},
relation: {
type: "varchar",
params: {
width: 32
}
},
type: {
type: "varchar",
params: {
length: 16
}
},
number: {
type: "int",
params: {
width: 2,
signed: true
}
},
confirmed: {
type: "int",
params: {
width: 2,
signed: true
}
},
remark: {
type: "text"
},
granterId: {
type: "ref",
ref: "user"
},
granteeId: {
type: "ref",
ref: "user"
},
expiresAt: {
type: "datetime"
},
expired: {
type: "boolean"
}
},
indexes: [
{
name: 'index_entity_entityId',
attributes: [
{
name: 'entity'
},
{
name: 'entityId'
},
]
},
{
name: 'index_uuid',
attributes: [
{
name: 'expired'
},
{
name: 'expiresAt'
}
]
}
]
};

View File

@ -0,0 +1,26 @@
declare const _default: {
attr: {
relation: string;
entity: string;
entityId: string;
type: string;
number: string;
confirmed: string;
remark: string;
grantee: string;
granter: string;
files: string;
expired: string;
expiresAt: string;
};
action: {
confirm: string;
};
v: {
type: {
grant: string;
transfer: string;
};
};
};
export default _default;

View File

@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
relation: '关系',
entity: '关联对象',
entityId: '关联对象id',
type: '类型',
number: '次数',
confirmed: '已确认人数',
remark: '备注',
grantee: '领取人',
granter: '授权人',
files: '微信码',
expired: '是否过期',
expiresAt: '过期时间'
},
action: {
confirm: '确认'
},
v: {
type: {
grant: '授予',
transfer: '转交'
}
}
};

156
lib/base-app-domain/UserRole/Schema.d.ts vendored Normal file
View File

@ -0,0 +1,156 @@
import { String, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as User from "../User/Schema";
import * as Role from "../Role/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
userId: ForeignKey<"user">;
roleId: ForeignKey<"role">;
relation: 'owner';
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
userId: ForeignKey<"user">;
roleId: ForeignKey<"role">;
relation: 'owner';
user: User.Schema;
role: Role.Schema;
} & {
[A in ExpressionKey]?: any;
};
declare type AttrFilter = {
id: Q_StringValue | SubQuery.UserRoleIdSubQuery;
$$createAt$$: Q_DateValue;
$$updateAt$$: Q_DateValue;
userId: Q_StringValue | SubQuery.UserIdSubQuery;
user: User.Filter;
roleId: Q_StringValue | SubQuery.RoleIdSubQuery;
role: Role.Filter;
relation: Q_EnumValue<'owner'>;
};
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare type Projection = {
"#id"?: NodeId;
[k: string]: any;
id: 1;
$$createAt$$?: 1;
$$updateAt$$?: 1;
userId?: 1;
user?: User.Projection;
roleId?: 1;
role?: Role.Projection;
relation?: 1;
} & Partial<ExprOp<OpAttr>>;
export declare type ExportProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: string;
$$createAt$$?: string;
$$updateAt$$?: string;
userId?: string;
user?: User.ExportProjection;
roleId?: string;
role?: Role.ExportProjection;
relation?: string;
} & Partial<ExprOp<OpAttr>>;
declare type UserRoleIdProjection = OneOf<{
id: 1;
}>;
declare type UserIdProjection = OneOf<{
userId: 1;
}>;
declare type RoleIdProjection = OneOf<{
roleId: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
userId: 1;
user: User.SortAttr;
roleId: 1;
role: Role.SortAttr;
relation: 1;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "userId" | "roleId">> & (({
userId?: never | null;
user?: User.CreateSingleOperation;
} | {
userId?: String<64>;
user?: User.UpdateOperation;
}) & ({
roleId?: never | null;
role?: Role.CreateSingleOperation;
} | {
roleId?: String<64>;
role?: Role.UpdateOperation;
})) & {
[k: string]: any;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId" | "roleId">> & (({
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
userId?: undefined;
} | {
user?: undefined;
userId?: String<64> | null;
}) & ({
role?: Role.CreateSingleOperation | Role.UpdateOperation | Role.RemoveOperation;
roleId?: undefined;
} | {
role?: undefined;
roleId?: String<64> | null;
})) & {
[k: string]: any;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
user?: User.UpdateOperation;
} | {
user?: User.RemoveOperation;
}) & ({
role?: Role.UpdateOperation;
} | {
role?: Role.RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type UserIdSubQuery = Selection<UserIdProjection>;
export declare type RoleIdSubQuery = Selection<RoleIdProjection>;
export declare type UserRoleIdSubQuery = Selection<UserRoleIdProjection>;
export declare type NativeAttr = OpAttr | `user.${User.NativeAttr}` | `role.${Role.NativeAttr}`;
export declare type FullAttr = NativeAttr;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
userId: {
type: "ref",
ref: "user"
},
roleId: {
type: "ref",
ref: "role"
},
relation: {
type: "varchar",
params: {
length: 16
}
}
}
};

View File

@ -0,0 +1,156 @@
import { String, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as User from "../User/Schema";
import * as System from "../System/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
userId: ForeignKey<"user">;
systemId: ForeignKey<"system">;
relation: 'owner';
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
userId: ForeignKey<"user">;
systemId: ForeignKey<"system">;
relation: 'owner';
user: User.Schema;
system: System.Schema;
} & {
[A in ExpressionKey]?: any;
};
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare 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<ExprOp<OpAttr>>;
export declare 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<ExprOp<OpAttr>>;
declare type UserSystemIdProjection = OneOf<{
id: 1;
}>;
declare type UserIdProjection = OneOf<{
userId: 1;
}>;
declare type SystemIdProjection = OneOf<{
systemId: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
userId: 1;
user: User.SortAttr;
systemId: 1;
system: System.SortAttr;
relation: 1;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "userId" | "systemId">> & (({
userId?: never | null;
user?: User.CreateSingleOperation;
} | {
userId?: String<64>;
user?: User.UpdateOperation;
}) & ({
systemId?: never | null;
system?: System.CreateSingleOperation;
} | {
systemId?: String<64>;
system?: System.UpdateOperation;
})) & {
[k: string]: any;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId" | "systemId">> & (({
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
userId?: undefined;
} | {
user?: undefined;
userId?: String<64> | null;
}) & ({
system?: System.CreateSingleOperation | System.UpdateOperation | System.RemoveOperation;
systemId?: undefined;
} | {
system?: undefined;
systemId?: String<64> | null;
})) & {
[k: string]: any;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
user?: User.UpdateOperation;
} | {
user?: User.RemoveOperation;
}) & ({
system?: System.UpdateOperation;
} | {
system?: System.RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type UserIdSubQuery = Selection<UserIdProjection>;
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
export declare type UserSystemIdSubQuery = Selection<UserSystemIdProjection>;
export declare type NativeAttr = OpAttr | `user.${User.NativeAttr}` | `system.${System.NativeAttr}`;
export declare type FullAttr = NativeAttr;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
userId: {
type: "ref",
ref: "user"
},
systemId: {
type: "ref",
ref: "system"
},
relation: {
type: "varchar",
params: {
length: 16
}
}
}
};

View File

@ -0,0 +1,227 @@
import { String, Boolean, Text, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_BooleanValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as Application from "../Application/Schema";
import * as UserEntityGrant from "../UserEntityGrant/Schema";
export declare type WechatQrCodeProps = {
pathname: string;
props?: Record<string, any>;
state?: Record<string, any>;
};
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
entity: "userEntityGrant" | string;
entityId: String<64>;
type: 'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp';
allowShare: Boolean;
tag?: String<32> | null;
expiresAt?: Datetime | null;
expired?: Boolean | null;
ticket?: Text | null;
url?: String<64> | null;
permanent: Boolean;
buffer?: Text | null;
applicationId: ForeignKey<"application">;
props: WechatQrCodeProps;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
entity: "userEntityGrant" | string;
entityId: String<64>;
type: 'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp';
allowShare: Boolean;
tag?: String<32> | null;
expiresAt?: Datetime | null;
expired?: Boolean | null;
ticket?: Text | null;
url?: String<64> | null;
permanent: Boolean;
buffer?: Text | null;
applicationId: ForeignKey<"application">;
props: WechatQrCodeProps;
application: Application.Schema;
userEntityGrant?: UserEntityGrant.Schema;
} & {
[A in ExpressionKey]?: any;
};
declare type AttrFilter<E> = {
id: Q_StringValue | SubQuery.WechatQrCodeIdSubQuery;
$$createAt$$: Q_DateValue;
$$updateAt$$: Q_DateValue;
entity: E;
entityId: Q_StringValue;
type: Q_EnumValue<'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp'>;
allowShare: Q_BooleanValue;
tag: Q_StringValue;
expiresAt: Q_DateValue;
expired: Q_BooleanValue;
ticket: Q_StringValue;
url: Q_StringValue;
permanent: Q_BooleanValue;
buffer: Q_StringValue;
applicationId: Q_StringValue | SubQuery.ApplicationIdSubQuery;
application: Application.Filter;
};
export declare type Filter<E = Q_EnumValue<"userEntityGrant" | string>> = MakeFilter<AttrFilter<E> & ExprOp<OpAttr>>;
export declare type Projection = {
"#id"?: NodeId;
[k: string]: any;
id: 1;
$$createAt$$?: 1;
$$updateAt$$?: 1;
entity?: 1;
entityId?: 1;
type?: 1;
allowShare?: 1;
tag?: 1;
expiresAt?: 1;
expired?: 1;
ticket?: 1;
url?: 1;
permanent?: 1;
buffer?: 1;
applicationId?: 1;
application?: Application.Projection;
props?: 1;
userEntityGrant?: UserEntityGrant.Projection;
} & Partial<ExprOp<OpAttr>>;
export declare type ExportProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: string;
$$createAt$$?: string;
$$updateAt$$?: string;
entity?: string;
entityId?: string;
type?: string;
allowShare?: string;
tag?: string;
expiresAt?: string;
expired?: string;
ticket?: string;
url?: string;
permanent?: string;
buffer?: string;
applicationId?: string;
application?: Application.ExportProjection;
props?: string;
userEntityGrant?: UserEntityGrant.ExportProjection;
} & Partial<ExprOp<OpAttr>>;
declare type WechatQrCodeIdProjection = OneOf<{
id: 1;
}>;
declare type ApplicationIdProjection = OneOf<{
applicationId: 1;
}>;
declare type UserEntityGrantIdProjection = OneOf<{
entityId: 1;
}>;
export declare type SortAttr = OneOf<{
id: 1;
$$createAt$$: 1;
$$updateAt$$: 1;
entity: 1;
entityId: 1;
type: 1;
allowShare: 1;
tag: 1;
expiresAt: 1;
expired: 1;
ticket: 1;
url: 1;
permanent: 1;
buffer: 1;
applicationId: 1;
application: Application.SortAttr;
props: 1;
userEntityGrant: UserEntityGrant.SortAttr;
[k: string]: any;
} & ExprOp<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "applicationId" | "entityId" | "entity" | "entityId">> & (({
applicationId?: never | null;
application: Application.CreateSingleOperation;
} | {
applicationId: String<64>;
application?: Application.UpdateOperation;
})) & ({
entity?: never;
entityId?: never;
userEntityGrant: UserEntityGrant.CreateSingleOperation;
} | {
entity: "userEntityGrant";
entityId: String<64>;
userEntityGrant?: UserEntityGrant.UpdateOperation;
} | {
[K: string]: any;
}) & {
[k: string]: any;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "applicationId" | "entityId" | "entity" | "entityId">> & (({
application?: Application.CreateSingleOperation | Application.UpdateOperation | Application.RemoveOperation;
applicationId?: undefined;
} | {
application?: undefined;
applicationId?: String<64> | null;
})) & ({
userEntityGrant?: UserEntityGrant.CreateSingleOperation | UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
entityId?: undefined;
entity?: undefined;
} | {
entity?: ("userEntityGrant" | string) | null;
entityId?: String<64> | null;
}) & {
[k: string]: any;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
application?: Application.UpdateOperation;
} | {
application?: Application.RemoveOperation;
})) & ({
userEntityGrant?: UserEntityGrant.UpdateOperation;
} | {
userEntityGrant?: UserEntityGrant.RemoveOperation;
} | {
[k: string]: any;
});
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
export declare type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
export declare type WechatQrCodeIdSubQuery = Selection<WechatQrCodeIdProjection>;
export declare type NativeAttr = OpAttr | `application.${Application.NativeAttr}` | `entity.${UserEntityGrant.NativeAttr}`;
export declare type FullAttr = NativeAttr;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,97 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
attributes: {
entity: {
type: "varchar",
params: {
width: 32
}
},
entityId: {
type: "varchar",
params: {
width: 64
}
},
type: {
type: "varchar",
params: {
length: 16
}
},
allowShare: {
type: "boolean"
},
tag: {
type: "varchar",
params: {
width: 32
}
},
expiresAt: {
type: "datetime"
},
expired: {
type: "boolean"
},
ticket: {
type: "text"
},
url: {
type: "varchar",
params: {
width: 64
}
},
permanent: {
type: "boolean"
},
buffer: {
type: "text"
},
applicationId: {
type: "ref",
ref: "application"
},
props: {
type: "object"
}
},
indexes: [
{
name: 'index_entity_entityId_tag',
attributes: [
{
name: 'entity'
},
{
name: 'entityId'
},
{
name: 'tag'
}
]
},
{
name: 'index_expired_expiresAt',
attributes: [
{
name: 'expired'
},
{
name: 'expiresAt'
},
]
},
{
name: 'index_url',
attributes: [
{
name: 'url'
},
]
}
]
};

View File

@ -0,0 +1,26 @@
declare const _default: {
attr: {
entity: string;
entityId: string;
type: string;
allowShare: string;
tag: string;
ticket: string;
url: string;
permanent: string;
buffer: string;
expired: string;
expiresAt: string;
application: string;
props: string;
};
v: {
type: {
wechatMpDomainUrl: string;
wechatMpWxaCode: string;
wechatPublic: string;
wechatPublicForMp: string;
};
};
};
export default _default;

View File

@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
entity: '关联对象',
entityId: '关联对象id',
type: '类型',
allowShare: '允许分享',
tag: 'tag',
ticket: 'ticket',
url: 'url',
permanent: '是否永久码',
buffer: '小程序码数据(动态)',
expired: '是否过期',
expiresAt: '过期时间',
application: '应用',
props: '属性'
},
v: {
type: {
wechatMpDomainUrl: '小程序域名跳转',
wechatMpWxaCode: '小程序码',
wechatPublic: '公众号码',
wechatPublicForMp: '公众号跳小程序'
}
}
};

View File

@ -0,0 +1,208 @@
import { String, Boolean, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
import { Q_DateValue, Q_BooleanValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
import { OneOf } from "oak-domain/lib/types/Polyfill";
import * as SubQuery from "../_SubQuery";
import { FormCreateData, FormUpdateData, Operation as OakOperation } from "oak-domain/lib/types/Entity";
import { GenericAction } from "oak-domain/lib/actions/action";
import * as User from "../User/Schema";
import * as Application from "../Application/Schema";
import * as Token from "../Token/Schema";
export declare type OpSchema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
origin: 'mp' | 'public';
openId?: String<32> | null;
unionId?: String<32> | null;
accessToken?: String<32> | null;
sessionKey?: String<64> | null;
subscribed?: Boolean | null;
subscribedAt?: Datetime | null;
unsubscribedAt?: Datetime | null;
userId?: ForeignKey<"user"> | null;
applicationId: ForeignKey<"application">;
};
export declare type OpAttr = keyof OpSchema;
export declare type Schema = {
id: PrimaryKey;
$$createAt$$: Datetime;
$$updateAt$$: Datetime;
$$removeAt$$?: Datetime | null;
origin: 'mp' | 'public';
openId?: String<32> | null;
unionId?: String<32> | null;
accessToken?: String<32> | null;
sessionKey?: String<64> | null;
subscribed?: Boolean | null;
subscribedAt?: Datetime | null;
unsubscribedAt?: Datetime | null;
userId?: ForeignKey<"user"> | null;
applicationId: ForeignKey<"application">;
user?: User.Schema | null;
application: Application.Schema;
token$entity?: Array<Token.Schema>;
} & {
[A in ExpressionKey]?: any;
};
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr>>;
export declare 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;
token$entity?: Token.Selection & {
$entity: "token";
};
} & Partial<ExprOp<OpAttr>>;
export declare 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;
token$entity?: Token.Exportation & {
$entity: "token";
};
} & Partial<ExprOp<OpAttr>>;
declare type WechatUserIdProjection = OneOf<{
id: 1;
}>;
declare type UserIdProjection = OneOf<{
userId: 1;
}>;
declare type ApplicationIdProjection = OneOf<{
applicationId: 1;
}>;
export declare 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<OpAttr>>;
export declare type SortNode = {
$attr: SortAttr;
$direction?: "asc" | "desc";
};
export declare type Sorter = SortNode[];
export declare type SelectOperation<P = Projection> = OakOperation<"select", P, Filter, Sorter>;
export declare type Selection<P = Projection> = Omit<SelectOperation<P>, "action">;
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "userId" | "applicationId">> & (({
userId?: never | null;
user?: User.CreateSingleOperation;
} | {
userId?: String<64>;
user?: User.UpdateOperation;
}) & ({
applicationId?: never | null;
application: Application.CreateSingleOperation;
} | {
applicationId: String<64>;
application?: Application.UpdateOperation;
})) & {
[k: string]: any;
token$entity?: OakOperation<"update", Omit<Token.UpdateOperationData, "entity" | "entityId">, Token.Filter> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId"> | Omit<Token.CreateOperationData, "entity" | "entityId">[]> | OakOperation<"update", Omit<Token.UpdateOperationData, "entity" | "entityId">, Token.Filter>>;
};
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId" | "applicationId">> & (({
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
userId?: undefined;
} | {
user?: undefined;
userId?: String<64> | null;
}) & ({
application?: Application.CreateSingleOperation | Application.UpdateOperation | Application.RemoveOperation;
applicationId?: undefined;
} | {
application?: undefined;
applicationId?: String<64> | null;
})) & {
[k: string]: any;
tokens$entity?: Token.UpdateOperation | Token.RemoveOperation | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId"> | Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Token.UpdateOperation | Token.RemoveOperation>;
};
export declare type UpdateOperation = OakOperation<"update", UpdateOperationData, Filter>;
export declare type RemoveOperationData = {} & (({
user?: User.UpdateOperation;
} | {
user?: User.RemoveOperation;
}) & ({
application?: Application.UpdateOperation;
} | {
application?: Application.RemoveOperation;
}));
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter>;
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
export declare type UserIdSubQuery = Selection<UserIdProjection>;
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
export declare type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
export declare type NativeAttr = OpAttr | `user.${User.NativeAttr}` | `application.${Application.NativeAttr}`;
export declare type FullAttr = NativeAttr | `tokens$${number}.${Token.NativeAttr}`;
export declare type EntityDef = {
Schema: Schema;
OpSchema: OpSchema;
Action: GenericAction;
Selection: Selection;
Operation: Operation;
Create: CreateOperation;
Update: UpdateOperation;
Remove: RemoveOperation;
CreateSingle: CreateSingleOperation;
CreateMulti: CreateMultipleOperation;
};
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { StorageDesc } from "oak-domain/lib/types/Storage";
import { OpSchema } from "./Schema";
export declare const desc: StorageDesc<OpSchema>;

View File

@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
exports.desc = {
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"
}
}
};

View File

@ -0,0 +1,22 @@
declare const _default: {
attr: {
origin: string;
openId: string;
unionId: string;
accessToken: string;
sessionKey: string;
subscribed: string;
subscribedAt: string;
unsubscribedAt: string;
user: string;
tokens: string;
application: string;
};
v: {
origin: {
mp: string;
public: string;
};
};
};
export default _default;

View File

@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
attr: {
origin: '源',
openId: 'openId',
unionId: 'unionId',
accessToken: 'accessToken',
sessionKey: 'sessionKey',
subscribed: '是否订阅',
subscribedAt: '订阅时间',
unsubscribedAt: '取关时间',
user: '用户',
tokens: '相关令牌',
application: '应用'
},
v: {
origin: {
mp: '小程序',
public: '公众号'
}
}
};

114
lib/base-app-domain/_SubQuery.d.ts vendored Normal file
View File

@ -0,0 +1,114 @@
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 UserRole from "./UserRole/Schema";
import * as Role from "./Role/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 UserEntityGrant from "./UserEntityGrant/Schema";
import * as WechatQrCode from "./WechatQrCode/Schema";
import * as WechatUser from "./WechatUser/Schema";
export declare type AddressIdSubQuery = {
[K in "$in" | "$nin"]?: (Address.AddressIdSubQuery & {
entity: "address";
}) | any;
};
export declare type ApplicationIdSubQuery = {
[K in "$in" | "$nin"]?: (Token.ApplicationIdSubQuery & {
entity: "token";
}) | (WechatQrCode.ApplicationIdSubQuery & {
entity: "wechatQrCode";
}) | (WechatUser.ApplicationIdSubQuery & {
entity: "wechatUser";
}) | (Application.ApplicationIdSubQuery & {
entity: "application";
}) | any;
};
export declare type AreaIdSubQuery = {
[K in "$in" | "$nin"]?: (Address.AreaIdSubQuery & {
entity: "address";
}) | (Area.AreaIdSubQuery & {
entity: "area";
}) | (Area.AreaIdSubQuery & {
entity: "area";
}) | any;
};
export declare type ExtraFileIdSubQuery = {
[K in "$in" | "$nin"]?: (ExtraFile.ExtraFileIdSubQuery & {
entity: "extraFile";
}) | any;
};
export declare type MobileIdSubQuery = {
[K in "$in" | "$nin"]?: (Mobile.MobileIdSubQuery & {
entity: "mobile";
}) | any;
};
export declare type UserRoleIdSubQuery = {
[K in "$in" | "$nin"]?: (UserRole.UserRoleIdSubQuery & {
entity: "userRole";
}) | any;
};
export declare type RoleIdSubQuery = {
[K in "$in" | "$nin"]?: (UserRole.RoleIdSubQuery & {
entity: "userRole";
}) | (Role.RoleIdSubQuery & {
entity: "role";
}) | any;
};
export declare type UserSystemIdSubQuery = {
[K in "$in" | "$nin"]?: (UserSystem.UserSystemIdSubQuery & {
entity: "userSystem";
}) | any;
};
export declare type SystemIdSubQuery = {
[K in "$in" | "$nin"]?: (Application.SystemIdSubQuery & {
entity: "application";
}) | (UserSystem.SystemIdSubQuery & {
entity: "userSystem";
}) | (System.SystemIdSubQuery & {
entity: "system";
}) | any;
};
export declare type TokenIdSubQuery = {
[K in "$in" | "$nin"]?: (Token.TokenIdSubQuery & {
entity: "token";
}) | any;
};
export declare type UserIdSubQuery = {
[K in "$in" | "$nin"]?: (Mobile.UserIdSubQuery & {
entity: "mobile";
}) | (UserRole.UserIdSubQuery & {
entity: "userRole";
}) | (UserSystem.UserIdSubQuery & {
entity: "userSystem";
}) | (Token.UserIdSubQuery & {
entity: "token";
}) | (User.UserIdSubQuery & {
entity: "user";
}) | (UserEntityGrant.UserIdSubQuery & {
entity: "userEntityGrant";
}) | (WechatUser.UserIdSubQuery & {
entity: "wechatUser";
}) | (User.UserIdSubQuery & {
entity: "user";
}) | any;
};
export declare type UserEntityGrantIdSubQuery = {
[K in "$in" | "$nin"]?: (UserEntityGrant.UserEntityGrantIdSubQuery & {
entity: "userEntityGrant";
}) | any;
};
export declare type WechatQrCodeIdSubQuery = {
[K in "$in" | "$nin"]?: (WechatQrCode.WechatQrCodeIdSubQuery & {
entity: "wechatQrCode";
}) | any;
};
export declare type WechatUserIdSubQuery = {
[K in "$in" | "$nin"]?: (WechatUser.WechatUserIdSubQuery & {
entity: "wechatUser";
}) | any;
};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

235
lib/base-app-domain/_locales/zh_CN.d.ts vendored Normal file
View File

@ -0,0 +1,235 @@
declare const _default: {
address: {
attr: {
detail: string;
area: string;
phone: string;
name: string;
default: string;
remark: string;
};
};
application: {
attr: {
description: string;
type: string;
system: string;
name: string;
config: string;
};
v: {
type: {
web: string;
wechatPublic: string;
wechatMp: string;
};
};
};
area: {
attr: {
level: string;
depth: string;
parent: string;
name: string;
code: string;
center: string;
};
v: {
level: {
country: string;
province: string;
city: string;
district: string;
street: string;
};
};
};
extraFile: {
attr: {
origin: string;
type: string;
bucket: string;
objectId: string;
tag1: string;
tag2: string;
filename: string;
md5: string;
entity: string;
entityId: string;
extra1: string;
extension: string;
size: string;
};
v: {
origin: {
qiniu: string;
unknown: string;
};
type: {
image: string;
pdf: string;
video: string;
audio: string;
file: string;
};
};
};
mobile: {
attr: {
mobile: string;
user: string;
tokens: string;
};
};
role: {
attr: {
name: string;
};
r: {
owner: string;
};
};
system: {
attr: {
name: string;
description: string;
config: string;
};
r: {
owner: string;
};
};
token: {
attr: {
application: string;
entity: string;
entityId: string;
user: string;
player: string;
env: string;
};
action: {
enable: string;
disable: string;
};
};
user: {
attr: {
name: string;
nickname: string;
birth: string;
password: string;
gender: string;
avatar: string;
idCardType: string;
idNumber: string;
ref: string;
files: string;
};
action: {
activate: string;
play: string;
accept: string;
verify: string;
reject: string;
enable: string;
disable: string;
mergeTo: string;
mergeFrom: string;
};
v: {
userState: {
shadow: string;
normal: string;
disabled: string;
merged: string;
};
idState: {
unverified: string;
verifying: string;
verified: string;
};
gender: {
male: string;
female: string;
};
idCardType: {
"ID-Card": string;
passport: string;
"Mainland-passport": string;
};
};
};
userEntityGrant: {
attr: {
relation: string;
entity: string;
entityId: string;
type: string;
number: string;
confirmed: string;
remark: string;
grantee: string;
granter: string;
files: string;
expired: string;
expiresAt: string;
};
action: {
confirm: string;
};
v: {
type: {
grant: string;
transfer: string;
};
};
};
wechatQrCode: {
attr: {
entity: string;
entityId: string;
type: string;
allowShare: string;
tag: string;
ticket: string;
url: string;
permanent: string;
buffer: string;
expired: string;
expiresAt: string;
application: string;
props: string;
};
v: {
type: {
wechatMpDomainUrl: string;
wechatMpWxaCode: string;
wechatPublic: string;
wechatPublicForMp: string;
};
};
};
wechatUser: {
attr: {
origin: string;
openId: string;
unionId: string;
accessToken: string;
sessionKey: string;
subscribed: string;
subscribedAt: string;
unsubscribedAt: string;
user: string;
tokens: string;
application: string;
};
v: {
origin: {
mp: string;
public: string;
};
};
};
};
export default _default;

View File

@ -0,0 +1,31 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const zh_CN_1 = __importDefault(require("../Address/locales/zh_CN"));
const zh_CN_2 = __importDefault(require("../Application/locales/zh_CN"));
const zh_CN_3 = __importDefault(require("../Area/locales/zh_CN"));
const zh_CN_4 = __importDefault(require("../ExtraFile/locales/zh_CN"));
const zh_CN_5 = __importDefault(require("../Mobile/locales/zh_CN"));
const zh_CN_6 = __importDefault(require("../Role/locales/zh_CN"));
const zh_CN_7 = __importDefault(require("../System/locales/zh_CN"));
const zh_CN_8 = __importDefault(require("../Token/locales/zh_CN"));
const zh_CN_9 = __importDefault(require("../User/locales/zh_CN"));
const zh_CN_10 = __importDefault(require("../UserEntityGrant/locales/zh_CN"));
const zh_CN_11 = __importDefault(require("../WechatQrCode/locales/zh_CN"));
const zh_CN_12 = __importDefault(require("../WechatUser/locales/zh_CN"));
exports.default = {
address: zh_CN_1.default,
application: zh_CN_2.default,
area: zh_CN_3.default,
extraFile: zh_CN_4.default,
mobile: zh_CN_5.default,
role: zh_CN_6.default,
system: zh_CN_7.default,
token: zh_CN_8.default,
user: zh_CN_9.default,
userEntityGrant: zh_CN_10.default,
wechatQrCode: zh_CN_11.default,
wechatUser: zh_CN_12.default
};

3
lib/base-app-domain/index.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
export * from './EntityDict';
export * from './Storage';
export * from './ActionDefDict';

View File

@ -0,0 +1,19 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./EntityDict"), exports);
__exportStar(require("./Storage"), exports);
__exportStar(require("./ActionDefDict"), exports);

View File

@ -11,9 +11,9 @@ function extraFileToUploadFile(extraFile, systemConfig) {
} }
function render() { function render() {
var _this = this; var _this = this;
var _a = this.props, mediaType = _a.mediaType, _b = _a.maxNumber, maxNumber = _b === void 0 ? 100 : _b, _c = _a.multiple, multiple = _c === void 0 ? true : _c; var _a = this.props, mediaType = _a.mediaType, _b = _a.maxNumber, maxNumber = _b === void 0 ? 100 : _b, _c = _a.multiple, multiple = _c === void 0 ? true : _c, _d = _a.useMockProgress, useMockProgress = _d === void 0 ? false : _d, _e = _a.draggable, draggable = _e === void 0 ? false : _e, _f = _a.showUploadProgress, showUploadProgress = _f === void 0 ? false : _f, _g = _a.theme, theme = _g === void 0 ? 'image' : _g;
var _d = this.state, files = _d.files, systemConfig = _d.systemConfig; var _h = this.state, files = _h.files, systemConfig = _h.systemConfig;
return ((0, jsx_runtime_1.jsx)(tdesign_react_1.Upload, { multiple: multiple, autoUpload: false, max: maxNumber, accept: mediaType, showUploadProgress: false, theme: "image", files: (files || []).map(function (ele) { return ((0, jsx_runtime_1.jsx)(tdesign_react_1.Upload, { multiple: multiple, autoUpload: false, draggable: draggable, useMockProgress: useMockProgress, max: maxNumber, accept: mediaType, showUploadProgress: showUploadProgress, theme: theme, files: (files || []).map(function (ele) {
return extraFileToUploadFile(ele, systemConfig); return extraFileToUploadFile(ele, systemConfig);
}), onChange: function (uploadFiles) { }), onChange: function (uploadFiles) {
var newUploadFiles = (uploadFiles === null || uploadFiles === void 0 ? void 0 : uploadFiles.filter(function (ele) { return !ele.id; })) || []; var newUploadFiles = (uploadFiles === null || uploadFiles === void 0 ? void 0 : uploadFiles.filter(function (ele) { return !ele.id; })) || [];

Some files were not shown because too many files have changed in this diff Show More