build
This commit is contained in:
parent
2c6343e520
commit
4ae7c24362
|
|
@ -64,6 +64,5 @@ jspm_packages/
|
|||
|
||||
build
|
||||
package-lock.json
|
||||
src/general-app-domain
|
||||
src/oak-app-domain
|
||||
# src/oak-app-domain
|
||||
scripts/local
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var locale = {
|
||||
zh_CN: {
|
||||
name: '文章分类',
|
||||
attr: {
|
||||
name: '分类标题',
|
||||
isArticle: '是否存在文章',
|
||||
parent: '所属分类',
|
||||
entity: '对象',
|
||||
entityId: '对象Id',
|
||||
isLeaf: '结点下是否存在叶子结点',
|
||||
files: '图片',
|
||||
var entityDesc = {
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '文章分类',
|
||||
attr: {
|
||||
name: '分类标题',
|
||||
isArticle: '是否存在文章',
|
||||
parent: '所属分类',
|
||||
entity: '对象',
|
||||
entityId: '对象Id',
|
||||
isLeaf: '结点下是否存在叶子结点',
|
||||
files: '图片',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,24 +1,26 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var locale = {
|
||||
zh_CN: {
|
||||
name: '寄生',
|
||||
attr: {
|
||||
user: '用户',
|
||||
showTip: '提示',
|
||||
expired: '已过期',
|
||||
expiresAt: '过期时间',
|
||||
redirectTo: '重定向页面',
|
||||
multiple: '允许反复使用',
|
||||
tokens: '令牌',
|
||||
entity: '关联对象',
|
||||
entityId: '关联对象Id',
|
||||
tokenLifeLength: '令牌生命长度',
|
||||
},
|
||||
action: {
|
||||
wakeup: '激活',
|
||||
cancel: '作废',
|
||||
qrcode: '采集码'
|
||||
var entityDesc = {
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '寄生',
|
||||
attr: {
|
||||
user: '用户',
|
||||
showTip: '提示',
|
||||
expired: '已过期',
|
||||
expiresAt: '过期时间',
|
||||
redirectTo: '重定向页面',
|
||||
multiple: '允许反复使用',
|
||||
tokens: '令牌',
|
||||
entity: '关联对象',
|
||||
entityId: '关联对象Id',
|
||||
tokenLifeLength: '令牌生命长度',
|
||||
},
|
||||
action: {
|
||||
wakeup: '激活',
|
||||
cancel: '作废',
|
||||
qrcode: '采集码',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,32 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var indexes = [
|
||||
{
|
||||
name: 'index_uuid',
|
||||
attributes: [
|
||||
{
|
||||
name: 'expired',
|
||||
},
|
||||
{
|
||||
name: 'expiresAt',
|
||||
}
|
||||
],
|
||||
},
|
||||
];
|
||||
var entityDesc = {
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_uuid',
|
||||
attributes: [
|
||||
{
|
||||
name: 'expired',
|
||||
},
|
||||
{
|
||||
name: 'expiresAt',
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '绑定微信号',
|
||||
|
|
@ -57,5 +31,18 @@ var entityDesc = {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_uuid',
|
||||
attributes: [
|
||||
{
|
||||
name: 'expired',
|
||||
},
|
||||
{
|
||||
name: 'expiresAt',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ exports.desc = {
|
|||
},
|
||||
{
|
||||
name: 'expiresAt'
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/** index.wxss **/
|
||||
@import "../../../config/styles/mp/index.less";
|
||||
@import "../../../config/styles/mp/mixins.less";
|
||||
@import "../../../../config/styles/mp/index.less";
|
||||
@import "../../../../config/styles/mp/mixins.less";
|
||||
|
||||
|
||||
page {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import LocaleBuilder from 'oak-domain/src/compiler/localeBuilder';
|
||||
|
||||
const localeBuilder = new LocaleBuilder();
|
||||
const localeBuilder = new LocaleBuilder(true);
|
||||
localeBuilder.build();
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Relation from "../Relation/Schema";
|
||||
type Actions = string[];
|
||||
type Paths = string[];
|
||||
export type OpSchema = EntityShape & {
|
||||
relationId?: ForeignKey<"relation"> | null;
|
||||
paths: Paths;
|
||||
destEntity: String<32>;
|
||||
deActions: Actions;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
relationId?: ForeignKey<"relation"> | null;
|
||||
paths: Paths;
|
||||
destEntity: String<32>;
|
||||
deActions: Actions;
|
||||
relation?: Relation.Schema | null;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
relationId: Q_StringValue;
|
||||
relation: Relation.Filter;
|
||||
paths: JsonFilter<Paths>;
|
||||
destEntity: Q_StringValue;
|
||||
deActions: JsonFilter<Actions>;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
relationId?: number;
|
||||
relation?: Relation.Projection;
|
||||
paths?: number | JsonProjection<Paths>;
|
||||
destEntity?: number;
|
||||
deActions?: number | JsonProjection<Actions>;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ActionAuthIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type RelationIdProjection = OneOf<{
|
||||
relationId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
relationId: number;
|
||||
} | {
|
||||
relation: Relation.SortAttr;
|
||||
} | {
|
||||
paths: number;
|
||||
} | {
|
||||
destEntity: number;
|
||||
} | {
|
||||
deActions: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "relationId">> & (({
|
||||
relationId?: never;
|
||||
relation?: Relation.CreateSingleOperation;
|
||||
} | {
|
||||
relationId: ForeignKey<"relation">;
|
||||
relation?: Relation.UpdateOperation;
|
||||
} | {
|
||||
relationId?: ForeignKey<"relation">;
|
||||
}));
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relationId">> & (({
|
||||
relation: Relation.CreateSingleOperation;
|
||||
relationId?: never;
|
||||
} | {
|
||||
relation: Relation.UpdateOperation;
|
||||
relationId?: never;
|
||||
} | {
|
||||
relation: Relation.RemoveOperation;
|
||||
relationId?: never;
|
||||
} | {
|
||||
relation?: never;
|
||||
relationId?: ForeignKey<"relation"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
relation?: Relation.UpdateOperation | Relation.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type RelationIdSubQuery = Selection<RelationIdProjection>;
|
||||
export type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
relationId: {
|
||||
type: "ref",
|
||||
ref: "relation"
|
||||
},
|
||||
paths: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
destEntity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
deActions: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_entity_relation',
|
||||
attributes: [
|
||||
{
|
||||
name: 'destEntity'
|
||||
},
|
||||
{
|
||||
name: "relationId"
|
||||
},
|
||||
],
|
||||
config: {
|
||||
unique: true
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"用户授权","attr":{"relation":"关系","paths":"路径","destEntity":"目标对象","deActions":"目标对象动作"}}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import { ActionDefDict as Modi } from "./Modi/Action";
|
||||
import { ActionDefDict as Captcha } from "./Captcha/Action";
|
||||
import { ActionDefDict as Email } from "./Email/Action";
|
||||
import { ActionDefDict as Message } from "./Message/Action";
|
||||
import { ActionDefDict as Mobile } from "./Mobile/Action";
|
||||
import { ActionDefDict as Notification } from "./Notification/Action";
|
||||
import { ActionDefDict as Parasite } from "./Parasite/Action";
|
||||
import { ActionDefDict as Token } from "./Token/Action";
|
||||
import { ActionDefDict as User } from "./User/Action";
|
||||
import { ActionDefDict as UserEntityGrant } from "./UserEntityGrant/Action";
|
||||
import { ActionDefDict as WechatLogin } from "./WechatLogin/Action";
|
||||
export const ActionDefDict = {
|
||||
modi: Modi,
|
||||
captcha: Captcha,
|
||||
email: Email,
|
||||
message: Message,
|
||||
mobile: Mobile,
|
||||
notification: Notification,
|
||||
parasite: Parasite,
|
||||
token: Token,
|
||||
user: User,
|
||||
userEntityGrant: UserEntityGrant,
|
||||
wechatLogin: WechatLogin
|
||||
};
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Datetime, Image, Boolean, Text } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Area from "../Area/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
detail: String<32>;
|
||||
areaId: ForeignKey<"area">;
|
||||
phone: String<12>;
|
||||
name: String<32>;
|
||||
default: Boolean;
|
||||
remark: Text;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
detail: String<32>;
|
||||
areaId: ForeignKey<"area">;
|
||||
phone: String<12>;
|
||||
name: String<32>;
|
||||
default: Boolean;
|
||||
remark: Text;
|
||||
area: Area.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
detail: Q_StringValue;
|
||||
areaId: Q_StringValue;
|
||||
area: Area.Filter;
|
||||
phone: Q_StringValue;
|
||||
name: Q_StringValue;
|
||||
default: Q_BooleanValue;
|
||||
remark: Q_StringValue;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
detail?: number;
|
||||
areaId?: number;
|
||||
area?: Area.Projection;
|
||||
phone?: number;
|
||||
name?: number;
|
||||
default?: number;
|
||||
remark?: number;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type AddressIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type AreaIdProjection = OneOf<{
|
||||
areaId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
detail: number;
|
||||
} | {
|
||||
areaId: number;
|
||||
} | {
|
||||
area: Area.SortAttr;
|
||||
} | {
|
||||
phone: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
default: number;
|
||||
} | {
|
||||
remark: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "areaId">> & ({
|
||||
areaId: ForeignKey<"area">;
|
||||
});
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "areaId">> & ({
|
||||
area?: never;
|
||||
areaId?: ForeignKey<"area"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type AreaIdSubQuery = Selection<AreaIdProjection>;
|
||||
export type AddressIdSubQuery = Selection<AddressIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
detail: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
areaId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "area"
|
||||
},
|
||||
phone: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 12
|
||||
}
|
||||
},
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
default: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
},
|
||||
remark: {
|
||||
notNull: true,
|
||||
type: "text"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"地址","attr":{"detail":"详细地址","area":"所在地区","phone":"联系电话","name":"姓名","default":"是否默认","remark":"备注"}}
|
||||
|
|
@ -0,0 +1,266 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Datetime, Image, Boolean, Text } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { Style } from "../../types/Style";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as System from "../System/Schema";
|
||||
import * as MessageTypeTemplateId from "../MessageTypeTemplateId/Schema";
|
||||
import * as Notification from "../Notification/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
export type Passport = 'email' | 'mobile' | 'wechat' | 'wechatPublic';
|
||||
export type AppType = 'web' | 'wechatMp' | 'wechatPublic';
|
||||
export type WechatMpConfig = {
|
||||
type: 'wechatMp';
|
||||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string; //原始id
|
||||
qrCodePrefix?: string; // 扫描二维码跳转的前缀(在小程序后台配置,必须统一跳转到weCharQrCode/scan/index)
|
||||
server?: {
|
||||
url?: string; //服务器地址(URL)
|
||||
token: string; //令牌(Token)
|
||||
encodingAESKey: string; //消息加解密密钥(EncodingAESKey)
|
||||
mode: 'clear' | 'compatible' | 'safe'; //消息加解密方式 明文模式 兼容模式 安全模式
|
||||
dataFormat: 'json' | 'xml';
|
||||
};
|
||||
passport?: Passport[];
|
||||
};
|
||||
export type WebConfig = {
|
||||
type: 'web';
|
||||
wechat?: {
|
||||
appId: string;
|
||||
appSecret: string; //网站 微信扫码登录
|
||||
domain?: string;
|
||||
enable?: boolean; //启用扫码登录
|
||||
};
|
||||
passport?: Passport[];
|
||||
};
|
||||
export type WechatPublicTemplateMsgsConfig = Record<string, string>; // key值代表messageTypeId,value的值代表对应的templateId,data的转换改成message上的函数注入
|
||||
export type WechatPublicConfig = {
|
||||
type: 'wechatPublic';
|
||||
isService: boolean; // 是否服务号
|
||||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string; //原始id
|
||||
enable?: boolean;
|
||||
templateMsgs?: WechatPublicTemplateMsgsConfig;
|
||||
server?: {
|
||||
url?: string; //服务器地址(URL)
|
||||
token: string; //令牌(Token)
|
||||
encodingAESKey: string; //消息加解密密钥(EncodingAESKey)
|
||||
mode: 'clear' | 'compatible' | 'safe'; //消息加解密方式 明文模式 兼容模式 安全模式
|
||||
};
|
||||
wechatMp?: {
|
||||
appId: string;
|
||||
//公众号跳小程序配置 originalId
|
||||
originalId: string; //原始id
|
||||
};
|
||||
passport?: Passport[];
|
||||
};
|
||||
export type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
type: AppType;
|
||||
systemId: ForeignKey<"system">;
|
||||
config: WebConfig | WechatMpConfig | WechatPublicConfig;
|
||||
style?: Style | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
type: AppType;
|
||||
systemId: ForeignKey<"system">;
|
||||
config: WebConfig | WechatMpConfig | WechatPublicConfig;
|
||||
style?: Style | null;
|
||||
system: System.Schema;
|
||||
messageTypeTemplateId$application?: Array<MessageTypeTemplateId.Schema>;
|
||||
messageTypeTemplateId$application$$aggr?: AggregationResult<MessageTypeTemplateId.Schema>;
|
||||
notification$application?: Array<Notification.Schema>;
|
||||
notification$application$$aggr?: AggregationResult<Notification.Schema>;
|
||||
token$application?: Array<Token.Schema>;
|
||||
token$application$$aggr?: AggregationResult<Token.Schema>;
|
||||
wechatPublicTag$application?: Array<WechatPublicTag.Schema>;
|
||||
wechatPublicTag$application$$aggr?: AggregationResult<WechatPublicTag.Schema>;
|
||||
wechatQrCode$application?: Array<WechatQrCode.Schema>;
|
||||
wechatQrCode$application$$aggr?: AggregationResult<WechatQrCode.Schema>;
|
||||
wechatUser$application?: Array<WechatUser.Schema>;
|
||||
wechatUser$application$$aggr?: AggregationResult<WechatUser.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
name: Q_StringValue;
|
||||
description: Q_StringValue;
|
||||
type: Q_EnumValue<AppType>;
|
||||
systemId: Q_StringValue;
|
||||
system: System.Filter;
|
||||
config: JsonFilter<WebConfig | WechatMpConfig | WechatPublicConfig>;
|
||||
style: JsonFilter<Style>;
|
||||
messageTypeTemplateId$application: MessageTypeTemplateId.Filter & SubQueryPredicateMetadata;
|
||||
notification$application: Notification.Filter & SubQueryPredicateMetadata;
|
||||
token$application: Token.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicTag$application: WechatPublicTag.Filter & SubQueryPredicateMetadata;
|
||||
wechatQrCode$application: WechatQrCode.Filter & SubQueryPredicateMetadata;
|
||||
wechatUser$application: WechatUser.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
description?: number;
|
||||
type?: number;
|
||||
systemId?: number;
|
||||
system?: System.Projection;
|
||||
config?: number | JsonProjection<WebConfig | WechatMpConfig | WechatPublicConfig>;
|
||||
style?: number | JsonProjection<Style>;
|
||||
messageTypeTemplateId$application?: MessageTypeTemplateId.Selection & {
|
||||
$entity: "messageTypeTemplateId";
|
||||
};
|
||||
messageTypeTemplateId$application$$aggr?: MessageTypeTemplateId.Aggregation & {
|
||||
$entity: "messageTypeTemplateId";
|
||||
};
|
||||
notification$application?: Notification.Selection & {
|
||||
$entity: "notification";
|
||||
};
|
||||
notification$application$$aggr?: Notification.Aggregation & {
|
||||
$entity: "notification";
|
||||
};
|
||||
token$application?: Token.Selection & {
|
||||
$entity: "token";
|
||||
};
|
||||
token$application$$aggr?: Token.Aggregation & {
|
||||
$entity: "token";
|
||||
};
|
||||
wechatPublicTag$application?: WechatPublicTag.Selection & {
|
||||
$entity: "wechatPublicTag";
|
||||
};
|
||||
wechatPublicTag$application$$aggr?: WechatPublicTag.Aggregation & {
|
||||
$entity: "wechatPublicTag";
|
||||
};
|
||||
wechatQrCode$application?: WechatQrCode.Selection & {
|
||||
$entity: "wechatQrCode";
|
||||
};
|
||||
wechatQrCode$application$$aggr?: WechatQrCode.Aggregation & {
|
||||
$entity: "wechatQrCode";
|
||||
};
|
||||
wechatUser$application?: WechatUser.Selection & {
|
||||
$entity: "wechatUser";
|
||||
};
|
||||
wechatUser$application$$aggr?: WechatUser.Aggregation & {
|
||||
$entity: "wechatUser";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ApplicationIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type SystemIdProjection = OneOf<{
|
||||
systemId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
description: number;
|
||||
} | {
|
||||
type: number;
|
||||
} | {
|
||||
systemId: number;
|
||||
} | {
|
||||
system: System.SortAttr;
|
||||
} | {
|
||||
style: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "systemId">> & (({
|
||||
systemId?: never;
|
||||
system: System.CreateSingleOperation;
|
||||
} | {
|
||||
systemId: ForeignKey<"system">;
|
||||
system?: System.UpdateOperation;
|
||||
} | {
|
||||
systemId: ForeignKey<"system">;
|
||||
})) & {
|
||||
messageTypeTemplateId$application?: OakOperation<MessageTypeTemplateId.UpdateOperation["action"], Omit<MessageTypeTemplateId.UpdateOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<MessageTypeTemplateId.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<MessageTypeTemplateId.CreateOperationData, "application" | "applicationId">> | OakOperation<MessageTypeTemplateId.UpdateOperation["action"], Omit<MessageTypeTemplateId.UpdateOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">>>;
|
||||
notification$application?: OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Notification.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Notification.CreateOperationData, "application" | "applicationId">> | OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">>>;
|
||||
token$application?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTag$application?: OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">>>;
|
||||
wechatQrCode$application?: OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">>>;
|
||||
wechatUser$application?: OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "systemId">> & (({
|
||||
system: System.CreateSingleOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.UpdateOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.RemoveOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId?: ForeignKey<"system"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
messageTypeTemplateId$application?: OakOperation<MessageTypeTemplateId.UpdateOperation["action"], Omit<MessageTypeTemplateId.UpdateOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">> | OakOperation<MessageTypeTemplateId.RemoveOperation["action"], Omit<MessageTypeTemplateId.RemoveOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<MessageTypeTemplateId.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<MessageTypeTemplateId.CreateOperationData, "application" | "applicationId">> | OakOperation<MessageTypeTemplateId.UpdateOperation["action"], Omit<MessageTypeTemplateId.UpdateOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">> | OakOperation<MessageTypeTemplateId.RemoveOperation["action"], Omit<MessageTypeTemplateId.RemoveOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">>>;
|
||||
notification$application?: OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">> | OakOperation<Notification.RemoveOperation["action"], Omit<Notification.RemoveOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Notification.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Notification.CreateOperationData, "application" | "applicationId">> | OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">> | OakOperation<Notification.RemoveOperation["action"], Omit<Notification.RemoveOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">>>;
|
||||
token$application?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTag$application?: OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTag.RemoveOperation["action"], Omit<WechatPublicTag.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTag.RemoveOperation["action"], Omit<WechatPublicTag.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">>>;
|
||||
wechatQrCode$application?: OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<WechatQrCode.RemoveOperation["action"], Omit<WechatQrCode.RemoveOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<WechatQrCode.RemoveOperation["action"], Omit<WechatQrCode.RemoveOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">>>;
|
||||
wechatUser$application?: OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<WechatUser.RemoveOperation["action"], Omit<WechatUser.RemoveOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<WechatUser.RemoveOperation["action"], Omit<WechatUser.RemoveOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
system?: System.UpdateOperation | System.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
description: {
|
||||
notNull: true,
|
||||
type: "text"
|
||||
},
|
||||
type: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["web", "wechatMp", "wechatPublic"]
|
||||
},
|
||||
systemId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "system"
|
||||
},
|
||||
config: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
style: {
|
||||
type: "object"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"应用","attr":{"description":"描述","type":"类型","system":"系统","name":"名称","config":"设置","style":"样式"},"v":{"type":{"web":"网站","wechatPublic":"微信公众号","wechatMp":"微信小程序"}}}
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Geo } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape, Configuration } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Address from "../Address/Schema";
|
||||
import * as Station from "../Station/Schema";
|
||||
import * as Subway from "../Subway/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
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 type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
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>;
|
||||
address$area$$aggr?: AggregationResult<Address.Schema>;
|
||||
area$parent?: Array<Schema>;
|
||||
area$parent$$aggr?: AggregationResult<Schema>;
|
||||
station$area?: Array<Station.Schema>;
|
||||
station$area$$aggr?: AggregationResult<Station.Schema>;
|
||||
subway$area?: Array<Subway.Schema>;
|
||||
subway$area$$aggr?: AggregationResult<Subway.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$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;
|
||||
parent: Filter;
|
||||
code: Q_StringValue;
|
||||
address$area: Address.Filter & SubQueryPredicateMetadata;
|
||||
area$parent: Filter & SubQueryPredicateMetadata;
|
||||
station$area: Station.Filter & SubQueryPredicateMetadata;
|
||||
subway$area: Subway.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
level?: number;
|
||||
depth?: number;
|
||||
parentId?: number;
|
||||
parent?: Projection;
|
||||
code?: number;
|
||||
center?: number;
|
||||
address$area?: Address.Selection & {
|
||||
$entity: "address";
|
||||
};
|
||||
address$area$$aggr?: Address.Aggregation & {
|
||||
$entity: "address";
|
||||
};
|
||||
area$parent?: Selection & {
|
||||
$entity: "area";
|
||||
};
|
||||
area$parent$$aggr?: Aggregation & {
|
||||
$entity: "area";
|
||||
};
|
||||
station$area?: Station.Selection & {
|
||||
$entity: "station";
|
||||
};
|
||||
station$area$$aggr?: Station.Aggregation & {
|
||||
$entity: "station";
|
||||
};
|
||||
subway$area?: Subway.Selection & {
|
||||
$entity: "subway";
|
||||
};
|
||||
subway$area$$aggr?: Subway.Aggregation & {
|
||||
$entity: "subway";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type AreaIdProjection = OneOf<{
|
||||
id: number;
|
||||
parentId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
level: number;
|
||||
} | {
|
||||
depth: number;
|
||||
} | {
|
||||
parentId: number;
|
||||
} | {
|
||||
parent: SortAttr;
|
||||
} | {
|
||||
code: number;
|
||||
} | {
|
||||
center: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "parentId">> & ({
|
||||
parentId?: ForeignKey<"parent">;
|
||||
}) & {
|
||||
address$area?: OakOperation<Address.UpdateOperation["action"], Omit<Address.UpdateOperationData, "area" | "areaId">, Omit<Address.Filter, "area" | "areaId">> | OakOperation<"create", Omit<Address.CreateOperationData, "area" | "areaId">[]> | Array<OakOperation<"create", Omit<Address.CreateOperationData, "area" | "areaId">> | OakOperation<Address.UpdateOperation["action"], Omit<Address.UpdateOperationData, "area" | "areaId">, Omit<Address.Filter, "area" | "areaId">>>;
|
||||
station$area?: OakOperation<Station.UpdateOperation["action"], Omit<Station.UpdateOperationData, "area" | "areaId">, Omit<Station.Filter, "area" | "areaId">> | OakOperation<"create", Omit<Station.CreateOperationData, "area" | "areaId">[]> | Array<OakOperation<"create", Omit<Station.CreateOperationData, "area" | "areaId">> | OakOperation<Station.UpdateOperation["action"], Omit<Station.UpdateOperationData, "area" | "areaId">, Omit<Station.Filter, "area" | "areaId">>>;
|
||||
subway$area?: OakOperation<Subway.UpdateOperation["action"], Omit<Subway.UpdateOperationData, "area" | "areaId">, Omit<Subway.Filter, "area" | "areaId">> | OakOperation<"create", Omit<Subway.CreateOperationData, "area" | "areaId">[]> | Array<OakOperation<"create", Omit<Subway.CreateOperationData, "area" | "areaId">> | OakOperation<Subway.UpdateOperation["action"], Omit<Subway.UpdateOperationData, "area" | "areaId">, Omit<Subway.Filter, "area" | "areaId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "parentId">> & ({
|
||||
parent?: never;
|
||||
parentId?: ForeignKey<"parent"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
address$area?: OakOperation<Address.UpdateOperation["action"], Omit<Address.UpdateOperationData, "area" | "areaId">, Omit<Address.Filter, "area" | "areaId">> | OakOperation<Address.RemoveOperation["action"], Omit<Address.RemoveOperationData, "area" | "areaId">, Omit<Address.Filter, "area" | "areaId">> | OakOperation<"create", Omit<Address.CreateOperationData, "area" | "areaId">[]> | Array<OakOperation<"create", Omit<Address.CreateOperationData, "area" | "areaId">> | OakOperation<Address.UpdateOperation["action"], Omit<Address.UpdateOperationData, "area" | "areaId">, Omit<Address.Filter, "area" | "areaId">> | OakOperation<Address.RemoveOperation["action"], Omit<Address.RemoveOperationData, "area" | "areaId">, Omit<Address.Filter, "area" | "areaId">>>;
|
||||
station$area?: OakOperation<Station.UpdateOperation["action"], Omit<Station.UpdateOperationData, "area" | "areaId">, Omit<Station.Filter, "area" | "areaId">> | OakOperation<Station.RemoveOperation["action"], Omit<Station.RemoveOperationData, "area" | "areaId">, Omit<Station.Filter, "area" | "areaId">> | OakOperation<"create", Omit<Station.CreateOperationData, "area" | "areaId">[]> | Array<OakOperation<"create", Omit<Station.CreateOperationData, "area" | "areaId">> | OakOperation<Station.UpdateOperation["action"], Omit<Station.UpdateOperationData, "area" | "areaId">, Omit<Station.Filter, "area" | "areaId">> | OakOperation<Station.RemoveOperation["action"], Omit<Station.RemoveOperationData, "area" | "areaId">, Omit<Station.Filter, "area" | "areaId">>>;
|
||||
subway$area?: OakOperation<Subway.UpdateOperation["action"], Omit<Subway.UpdateOperationData, "area" | "areaId">, Omit<Subway.Filter, "area" | "areaId">> | OakOperation<Subway.RemoveOperation["action"], Omit<Subway.RemoveOperationData, "area" | "areaId">, Omit<Subway.Filter, "area" | "areaId">> | OakOperation<"create", Omit<Subway.CreateOperationData, "area" | "areaId">[]> | Array<OakOperation<"create", Omit<Subway.CreateOperationData, "area" | "areaId">> | OakOperation<Subway.UpdateOperation["action"], Omit<Subway.UpdateOperationData, "area" | "areaId">, Omit<Subway.Filter, "area" | "areaId">> | OakOperation<Subway.RemoveOperation["action"], Omit<Subway.RemoveOperationData, "area" | "areaId">, Omit<Subway.Filter, "area" | "areaId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type AreaIdSubQuery = Selection<AreaIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<ReadOnlyAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { readOnlyActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
level: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["province", "city", "district", "street", "country"]
|
||||
},
|
||||
depth: {
|
||||
notNull: true,
|
||||
type: "int",
|
||||
params: {
|
||||
width: 4
|
||||
}
|
||||
},
|
||||
parentId: {
|
||||
type: "ref",
|
||||
ref: "area"
|
||||
},
|
||||
code: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 12
|
||||
}
|
||||
},
|
||||
center: {
|
||||
notNull: true,
|
||||
type: "geometry"
|
||||
}
|
||||
},
|
||||
static: true,
|
||||
actionType: "readOnly",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"地区","attr":{"level":"层级","depth":"深度","parent":"上级地区","name":"名称","code":"地区编码","center":"中心坐标"},"v":{"level":{"country":"国家","province":"省","city":"市","district":"区","street":"街道"}}}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Float, Text } from "oak-domain/lib/types/DataType";
|
||||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as ArticleMenu from "../ArticleMenu/Schema";
|
||||
import * as ExtraFile from "../ExtraFile/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
content: Text;
|
||||
articleMenuId: ForeignKey<"articleMenu">;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
name: String<32>;
|
||||
content: Text;
|
||||
articleMenuId: ForeignKey<"articleMenu">;
|
||||
articleMenu: ArticleMenu.Schema;
|
||||
extraFile$entity?: Array<ExtraFile.Schema>;
|
||||
extraFile$entity$$aggr?: AggregationResult<ExtraFile.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
name: Q_StringValue;
|
||||
content: Q_StringValue;
|
||||
articleMenuId: Q_StringValue;
|
||||
articleMenu: ArticleMenu.Filter;
|
||||
extraFile$entity: ExtraFile.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
content?: number;
|
||||
articleMenuId?: number;
|
||||
articleMenu?: ArticleMenu.Projection;
|
||||
extraFile$entity?: ExtraFile.Selection & {
|
||||
$entity: "extraFile";
|
||||
};
|
||||
extraFile$entity$$aggr?: ExtraFile.Aggregation & {
|
||||
$entity: "extraFile";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ArticleIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type ArticleMenuIdProjection = OneOf<{
|
||||
articleMenuId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
content: number;
|
||||
} | {
|
||||
articleMenuId: number;
|
||||
} | {
|
||||
articleMenu: ArticleMenu.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "articleMenuId">> & (({
|
||||
articleMenuId?: never;
|
||||
articleMenu: ArticleMenu.CreateSingleOperation;
|
||||
} | {
|
||||
articleMenuId: ForeignKey<"articleMenu">;
|
||||
articleMenu?: ArticleMenu.UpdateOperation;
|
||||
} | {
|
||||
articleMenuId: ForeignKey<"articleMenu">;
|
||||
})) & {
|
||||
extraFile$entity?: OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">> | OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "articleMenuId">> & (({
|
||||
articleMenu: ArticleMenu.CreateSingleOperation;
|
||||
articleMenuId?: never;
|
||||
} | {
|
||||
articleMenu: ArticleMenu.UpdateOperation;
|
||||
articleMenuId?: never;
|
||||
} | {
|
||||
articleMenu: ArticleMenu.RemoveOperation;
|
||||
articleMenuId?: never;
|
||||
} | {
|
||||
articleMenu?: never;
|
||||
articleMenuId?: ForeignKey<"articleMenu"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
extraFile$entity?: OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<ExtraFile.RemoveOperation["action"], Omit<ExtraFile.RemoveOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">> | OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<ExtraFile.RemoveOperation["action"], Omit<ExtraFile.RemoveOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
articleMenu?: ArticleMenu.UpdateOperation | ArticleMenu.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ArticleMenuIdSubQuery = Selection<ArticleMenuIdProjection>;
|
||||
export type ArticleIdSubQuery = Selection<ArticleIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
content: {
|
||||
notNull: true,
|
||||
type: "text"
|
||||
},
|
||||
articleMenuId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "articleMenu"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"文章","attr":{"name":"文章标题","content":"请输入正文内容","articleMenu":"文章菜单","files":"文件"}}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Boolean } from "oak-domain/lib/types/DataType";
|
||||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { EntityShape, Configuration } from "oak-domain/lib/types/Entity";
|
||||
import { LocaleDef } from "oak-domain/lib/types/Locale";
|
||||
import { Index } from "oak-domain/lib/types/Storage";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Article from "../Article/Schema";
|
||||
import * as ExtraFile from "../ExtraFile/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
isArticle: Boolean;
|
||||
parentId?: ForeignKey<"articleMenu"> | null;
|
||||
isLeaf: Boolean;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
name: String<32>;
|
||||
isArticle: Boolean;
|
||||
parentId?: ForeignKey<"articleMenu"> | null;
|
||||
isLeaf: Boolean;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
parent?: Schema | null;
|
||||
article$articleMenu?: Array<Article.Schema>;
|
||||
article$articleMenu$$aggr?: AggregationResult<Article.Schema>;
|
||||
articleMenu$parent?: Array<Schema>;
|
||||
articleMenu$parent$$aggr?: AggregationResult<Schema>;
|
||||
extraFile$entity?: Array<ExtraFile.Schema>;
|
||||
extraFile$entity$$aggr?: AggregationResult<ExtraFile.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
name: Q_StringValue;
|
||||
isArticle: Q_BooleanValue;
|
||||
parentId: Q_StringValue;
|
||||
parent: Filter;
|
||||
isLeaf: Q_BooleanValue;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
article$articleMenu: Article.Filter & SubQueryPredicateMetadata;
|
||||
articleMenu$parent: Filter & SubQueryPredicateMetadata;
|
||||
extraFile$entity: ExtraFile.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
isArticle?: number;
|
||||
parentId?: number;
|
||||
parent?: Projection;
|
||||
isLeaf?: number;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
article$articleMenu?: Article.Selection & {
|
||||
$entity: "article";
|
||||
};
|
||||
article$articleMenu$$aggr?: Article.Aggregation & {
|
||||
$entity: "article";
|
||||
};
|
||||
articleMenu$parent?: Selection & {
|
||||
$entity: "articleMenu";
|
||||
};
|
||||
articleMenu$parent$$aggr?: Aggregation & {
|
||||
$entity: "articleMenu";
|
||||
};
|
||||
extraFile$entity?: ExtraFile.Selection & {
|
||||
$entity: "extraFile";
|
||||
};
|
||||
extraFile$entity$$aggr?: ExtraFile.Aggregation & {
|
||||
$entity: "extraFile";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ArticleMenuIdProjection = OneOf<{
|
||||
id: number;
|
||||
parentId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
isArticle: number;
|
||||
} | {
|
||||
parentId: number;
|
||||
} | {
|
||||
parent: SortAttr;
|
||||
} | {
|
||||
isLeaf: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "parentId">> & (({
|
||||
parentId?: never;
|
||||
parent?: CreateSingleOperation;
|
||||
} | {
|
||||
parentId: ForeignKey<"parent">;
|
||||
parent?: UpdateOperation;
|
||||
} | {
|
||||
parentId?: ForeignKey<"parent">;
|
||||
})) & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
}) & {
|
||||
article$articleMenu?: OakOperation<Article.UpdateOperation["action"], Omit<Article.UpdateOperationData, "articleMenu" | "articleMenuId">, Omit<Article.Filter, "articleMenu" | "articleMenuId">> | OakOperation<"create", Omit<Article.CreateOperationData, "articleMenu" | "articleMenuId">[]> | Array<OakOperation<"create", Omit<Article.CreateOperationData, "articleMenu" | "articleMenuId">> | OakOperation<Article.UpdateOperation["action"], Omit<Article.UpdateOperationData, "articleMenu" | "articleMenuId">, Omit<Article.Filter, "articleMenu" | "articleMenuId">>>;
|
||||
articleMenu$parent?: OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "parent" | "parentId">, Omit<Filter, "parent" | "parentId">> | OakOperation<"create", Omit<CreateOperationData, "parent" | "parentId">[]> | Array<OakOperation<"create", Omit<CreateOperationData, "parent" | "parentId">> | OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "parent" | "parentId">, Omit<Filter, "parent" | "parentId">>>;
|
||||
extraFile$entity?: OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">> | OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "parentId">> & (({
|
||||
parent: CreateSingleOperation;
|
||||
parentId?: never;
|
||||
} | {
|
||||
parent: UpdateOperation;
|
||||
parentId?: never;
|
||||
} | {
|
||||
parent: RemoveOperation;
|
||||
parentId?: never;
|
||||
} | {
|
||||
parent?: never;
|
||||
parentId?: ForeignKey<"parent"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
article$articleMenu?: OakOperation<Article.UpdateOperation["action"], Omit<Article.UpdateOperationData, "articleMenu" | "articleMenuId">, Omit<Article.Filter, "articleMenu" | "articleMenuId">> | OakOperation<Article.RemoveOperation["action"], Omit<Article.RemoveOperationData, "articleMenu" | "articleMenuId">, Omit<Article.Filter, "articleMenu" | "articleMenuId">> | OakOperation<"create", Omit<Article.CreateOperationData, "articleMenu" | "articleMenuId">[]> | Array<OakOperation<"create", Omit<Article.CreateOperationData, "articleMenu" | "articleMenuId">> | OakOperation<Article.UpdateOperation["action"], Omit<Article.UpdateOperationData, "articleMenu" | "articleMenuId">, Omit<Article.Filter, "articleMenu" | "articleMenuId">> | OakOperation<Article.RemoveOperation["action"], Omit<Article.RemoveOperationData, "articleMenu" | "articleMenuId">, Omit<Article.Filter, "articleMenu" | "articleMenuId">>>;
|
||||
articleMenu$parent?: OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "parent" | "parentId">, Omit<Filter, "parent" | "parentId">> | OakOperation<RemoveOperation["action"], Omit<RemoveOperationData, "parent" | "parentId">, Omit<Filter, "parent" | "parentId">> | OakOperation<"create", Omit<CreateOperationData, "parent" | "parentId">[]> | Array<OakOperation<"create", Omit<CreateOperationData, "parent" | "parentId">> | OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "parent" | "parentId">, Omit<Filter, "parent" | "parentId">> | OakOperation<RemoveOperation["action"], Omit<RemoveOperationData, "parent" | "parentId">, Omit<Filter, "parent" | "parentId">>>;
|
||||
extraFile$entity?: OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<ExtraFile.RemoveOperation["action"], Omit<ExtraFile.RemoveOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">> | OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<ExtraFile.RemoveOperation["action"], Omit<ExtraFile.RemoveOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
parent?: UpdateOperation | RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ArticleMenuIdSubQuery = Selection<ArticleMenuIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
isArticle: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
},
|
||||
parentId: {
|
||||
type: "ref",
|
||||
ref: "articleMenu"
|
||||
},
|
||||
isLeaf: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
},
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"文章分类","attr":{"name":"分类标题","isArticle":"是否存在文章","parent":"所属分类","entity":"对象","entityId":"对象Id","isLeaf":"结点下是否存在叶子结点","files":"图片"}}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
export type IState = 'unsent' | 'sending' | 'sent' | 'failure' | string;
|
||||
export type IAction = 'send' | 'success' | 'fail' | string;
|
||||
const IActionDef: ActionDef<IAction, IState> = {
|
||||
stm: {
|
||||
send: ['unsent', 'sending'],
|
||||
success: ['sending', 'sent'],
|
||||
fail: ['sending', 'failure']
|
||||
},
|
||||
is: 'unsent'
|
||||
};
|
||||
export type ParticularAction = IAction;
|
||||
export type Action = GenericAction | ParticularAction | string;
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "send", "success", "fail"];
|
||||
export const ActionDefDict = {
|
||||
iState: IActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction, IState } from "./Action";
|
||||
import { RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { ActionType, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { String, Text, Boolean, Datetime } from "oak-domain/lib/types/DataType";
|
||||
import { ActionDef, Index } from "oak-domain/lib/types";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
export type OpSchema = EntityShape & {
|
||||
mobile: String<11>;
|
||||
code: String<4>;
|
||||
visitorId: Text;
|
||||
reason?: Text | null;
|
||||
env: Object;
|
||||
expired: Boolean;
|
||||
expiresAt: Datetime;
|
||||
iState?: IState | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
mobile: String<11>;
|
||||
code: String<4>;
|
||||
visitorId: Text;
|
||||
reason?: Text | null;
|
||||
env: Object;
|
||||
expired: Boolean;
|
||||
expiresAt: Datetime;
|
||||
iState?: IState | null;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
mobile: Q_StringValue;
|
||||
code: Q_StringValue;
|
||||
visitorId: Q_StringValue;
|
||||
reason: Q_StringValue;
|
||||
env: Object;
|
||||
expired: Q_BooleanValue;
|
||||
expiresAt: Q_DateValue;
|
||||
iState: Q_EnumValue<IState>;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
mobile?: number;
|
||||
code?: number;
|
||||
visitorId?: number;
|
||||
reason?: number;
|
||||
env?: number | Object;
|
||||
expired?: number;
|
||||
expiresAt?: number;
|
||||
iState?: number;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type CaptchaIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
mobile: number;
|
||||
} | {
|
||||
code: number;
|
||||
} | {
|
||||
visitorId: number;
|
||||
} | {
|
||||
reason: number;
|
||||
} | {
|
||||
expired: number;
|
||||
} | {
|
||||
expiresAt: number;
|
||||
} | {
|
||||
iState: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<OpSchema>;
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type CaptchaIdSubQuery = Selection<CaptchaIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<Action> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
ParticularAction: ParticularAction;
|
||||
};
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { actions } from "./Action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
mobile: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 11
|
||||
}
|
||||
},
|
||||
code: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 4
|
||||
}
|
||||
},
|
||||
visitorId: {
|
||||
notNull: true,
|
||||
type: "text"
|
||||
},
|
||||
reason: {
|
||||
type: "text"
|
||||
},
|
||||
env: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
expired: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
},
|
||||
expiresAt: {
|
||||
notNull: true,
|
||||
type: "datetime"
|
||||
},
|
||||
iState: {
|
||||
type: "enum",
|
||||
enumeration: ["unsent", "sending", "sent", "failure"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_mobile_code',
|
||||
attributes: [
|
||||
{
|
||||
name: 'mobile',
|
||||
direction: 'ASC'
|
||||
},
|
||||
{
|
||||
name: 'code',
|
||||
direction: 'ASC'
|
||||
},
|
||||
{
|
||||
name: '$$createAt$$',
|
||||
direction: 'DESC'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"验证码","attr":{"mobile":"手机号","code":"验证码","visitorId":"用户标识","reason":"失败原因","env":"用户环境","expired":"是否过期","expiresAt":"过期时间","iState":"状态"},"action":{"send":"发送","fail":"失败","success":"成功"},"v":{"iState":{"unsent":"未发送","sending":"发送中","sent":"已发送","failure":"已失败"}}}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Datetime, Image, Boolean, Text } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as System from "../System/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
url: String<64>;
|
||||
apiPath: String<32>;
|
||||
protocol: 'http' | 'https';
|
||||
port: Int<2>;
|
||||
systemId: ForeignKey<"system">;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
url: String<64>;
|
||||
apiPath: String<32>;
|
||||
protocol: 'http' | 'https';
|
||||
port: Int<2>;
|
||||
systemId: ForeignKey<"system">;
|
||||
system: System.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
url: Q_StringValue;
|
||||
apiPath: Q_StringValue;
|
||||
protocol: Q_EnumValue<'http' | 'https'>;
|
||||
port: Q_NumberValue;
|
||||
systemId: Q_StringValue;
|
||||
system: System.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
url?: number;
|
||||
apiPath?: number;
|
||||
protocol?: number;
|
||||
port?: number;
|
||||
systemId?: number;
|
||||
system?: System.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type DomainIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type SystemIdProjection = OneOf<{
|
||||
systemId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
url: number;
|
||||
} | {
|
||||
apiPath: number;
|
||||
} | {
|
||||
protocol: number;
|
||||
} | {
|
||||
port: number;
|
||||
} | {
|
||||
systemId: number;
|
||||
} | {
|
||||
system: System.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "systemId">> & (({
|
||||
systemId?: never;
|
||||
system: System.CreateSingleOperation;
|
||||
} | {
|
||||
systemId: ForeignKey<"system">;
|
||||
system?: System.UpdateOperation;
|
||||
} | {
|
||||
systemId: ForeignKey<"system">;
|
||||
}));
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "systemId">> & (({
|
||||
system: System.CreateSingleOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.UpdateOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.RemoveOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId?: ForeignKey<"system"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
system?: System.UpdateOperation | System.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export type DomainIdSubQuery = Selection<DomainIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
url: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
apiPath: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
protocol: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["http", "https"]
|
||||
},
|
||||
port: {
|
||||
notNull: true,
|
||||
type: "int",
|
||||
params: {
|
||||
width: 2,
|
||||
signed: true
|
||||
}
|
||||
},
|
||||
systemId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "system"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"域名","attr":{"url":"域名","apiPath":"api路径","protocol":"协议","port":"端口","system":"系统"},"v":{"protocol":{"http":"http","https":"https"}}}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import { AbleAction, AbleState, makeAbleActionDef } from 'oak-domain/lib/actions/action';
|
||||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
export type ParticularAction = AbleAction;
|
||||
export type Action = GenericAction | ParticularAction | string;
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "enable", "disable"];
|
||||
const AbleActionDef: ActionDef<AbleAction, AbleState> = makeAbleActionDef('enabled');
|
||||
export const ActionDefDict = {
|
||||
ableState: AbleActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction } from "./Action";
|
||||
import { RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Text, Image } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { AbleAction, AbleState, makeAbleActionDef } from "oak-domain/lib/actions/action";
|
||||
import { ActionDef } from "oak-domain/lib/types";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
email: String<16>;
|
||||
userId: ForeignKey<"user">;
|
||||
ableState?: AbleState | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
email: String<16>;
|
||||
userId: ForeignKey<"user">;
|
||||
ableState?: AbleState | null;
|
||||
user: User.Schema;
|
||||
token$entity?: Array<Token.Schema>;
|
||||
token$entity$$aggr?: AggregationResult<Token.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
email: Q_StringValue;
|
||||
userId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
ableState: Q_EnumValue<AbleState>;
|
||||
token$entity: Token.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
email?: number;
|
||||
userId?: number;
|
||||
user?: User.Projection;
|
||||
ableState?: number;
|
||||
token$entity?: Token.Selection & {
|
||||
$entity: "token";
|
||||
};
|
||||
token$entity$$aggr?: Token.Aggregation & {
|
||||
$entity: "token";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type EmailIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
email: number;
|
||||
} | {
|
||||
userId: number;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
ableState: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "userId">> & (({
|
||||
userId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
})) & {
|
||||
token$entity?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
token$entity?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type EmailIdSubQuery = Selection<EmailIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<Action> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
ParticularAction: ParticularAction;
|
||||
};
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { actions } from "./Action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
email: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
}
|
||||
},
|
||||
userId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
ableState: {
|
||||
type: "enum",
|
||||
enumeration: ["enabled", "disabled"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_email_ableState',
|
||||
attributes: [
|
||||
{
|
||||
name: 'email',
|
||||
direction: 'ASC'
|
||||
},
|
||||
{
|
||||
name: 'ableState',
|
||||
direction: 'ASC'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"邮箱","attr":{"ableState":"是否可用","email":"邮箱","user":"关联用户","tokens":"相关令牌"},"action":{"enable":"启用","disable":"禁用"},"v":{"ableState":{"enabled":"可用的","disabled":"禁用的"}}}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
import { EntityDef as ActionAuth } from "./ActionAuth/Schema";
|
||||
import { EntityDef as I18n } from "./I18n/Schema";
|
||||
import { EntityDef as Modi } from "./Modi/Schema";
|
||||
import { EntityDef as ModiEntity } from "./ModiEntity/Schema";
|
||||
import { EntityDef as Oper } from "./Oper/Schema";
|
||||
import { EntityDef as OperEntity } from "./OperEntity/Schema";
|
||||
import { EntityDef as Relation } from "./Relation/Schema";
|
||||
import { EntityDef as RelationAuth } from "./RelationAuth/Schema";
|
||||
import { EntityDef as User } from "./User/Schema";
|
||||
import { EntityDef as UserEntityGrant } from "./UserEntityGrant/Schema";
|
||||
import { EntityDef as UserRelation } from "./UserRelation/Schema";
|
||||
import { EntityDef as Address } from "./Address/Schema";
|
||||
import { EntityDef as Application } from "./Application/Schema";
|
||||
import { EntityDef as Area } from "./Area/Schema";
|
||||
import { EntityDef as Article } from "./Article/Schema";
|
||||
import { EntityDef as ArticleMenu } from "./ArticleMenu/Schema";
|
||||
import { EntityDef as Captcha } from "./Captcha/Schema";
|
||||
import { EntityDef as Domain } from "./Domain/Schema";
|
||||
import { EntityDef as Email } from "./Email/Schema";
|
||||
import { EntityDef as ExtraFile } from "./ExtraFile/Schema";
|
||||
import { EntityDef as Livestream } from "./Livestream/Schema";
|
||||
import { EntityDef as Message } from "./Message/Schema";
|
||||
import { EntityDef as MessageSystem } from "./MessageSystem/Schema";
|
||||
import { EntityDef as MessageType } from "./MessageType/Schema";
|
||||
import { EntityDef as MessageTypeTemplateId } from "./MessageTypeTemplateId/Schema";
|
||||
import { EntityDef as Mobile } from "./Mobile/Schema";
|
||||
import { EntityDef as Notification } from "./Notification/Schema";
|
||||
import { EntityDef as Parasite } from "./Parasite/Schema";
|
||||
import { EntityDef as Platform } from "./Platform/Schema";
|
||||
import { EntityDef as Station } from "./Station/Schema";
|
||||
import { EntityDef as Subscription } from "./Subscription/Schema";
|
||||
import { EntityDef as Subway } from "./Subway/Schema";
|
||||
import { EntityDef as SubwayStation } from "./SubwayStation/Schema";
|
||||
import { EntityDef as System } from "./System/Schema";
|
||||
import { EntityDef as Token } from "./Token/Schema";
|
||||
import { EntityDef as UserSystem } from "./UserSystem/Schema";
|
||||
import { EntityDef as UserWechatPublicTag } from "./UserWechatPublicTag/Schema";
|
||||
import { EntityDef as WechatLogin } from "./WechatLogin/Schema";
|
||||
import { EntityDef as WechatPublicTag } from "./WechatPublicTag/Schema";
|
||||
import { EntityDef as WechatQrCode } from "./WechatQrCode/Schema";
|
||||
import { EntityDef as WechatUser } from "./WechatUser/Schema";
|
||||
export type EntityDict = {
|
||||
actionAuth: ActionAuth;
|
||||
i18n: I18n;
|
||||
modi: Modi;
|
||||
modiEntity: ModiEntity;
|
||||
oper: Oper;
|
||||
operEntity: OperEntity;
|
||||
relation: Relation;
|
||||
relationAuth: RelationAuth;
|
||||
user: User;
|
||||
userEntityGrant: UserEntityGrant;
|
||||
userRelation: UserRelation;
|
||||
address: Address;
|
||||
application: Application;
|
||||
area: Area;
|
||||
article: Article;
|
||||
articleMenu: ArticleMenu;
|
||||
captcha: Captcha;
|
||||
domain: Domain;
|
||||
email: Email;
|
||||
extraFile: ExtraFile;
|
||||
livestream: Livestream;
|
||||
message: Message;
|
||||
messageSystem: MessageSystem;
|
||||
messageType: MessageType;
|
||||
messageTypeTemplateId: MessageTypeTemplateId;
|
||||
mobile: Mobile;
|
||||
notification: Notification;
|
||||
parasite: Parasite;
|
||||
platform: Platform;
|
||||
station: Station;
|
||||
subscription: Subscription;
|
||||
subway: Subway;
|
||||
subwayStation: SubwayStation;
|
||||
system: System;
|
||||
token: Token;
|
||||
userSystem: UserSystem;
|
||||
userWechatPublicTag: UserWechatPublicTag;
|
||||
wechatLogin: WechatLogin;
|
||||
wechatPublicTag: WechatPublicTag;
|
||||
wechatQrCode: WechatQrCode;
|
||||
wechatUser: WechatUser;
|
||||
};
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Text, Image, Float, Boolean } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Article from "../Article/Schema";
|
||||
import * as ArticleMenu from "../ArticleMenu/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
origin: 'qiniu' | 'unknown';
|
||||
type: 'image' | 'video' | 'audio' | 'file';
|
||||
bucket: String<16>;
|
||||
objectId: String<64>;
|
||||
tag1?: String<32> | null;
|
||||
tag2?: String<32> | null;
|
||||
filename: String<256>;
|
||||
md5?: Text | null;
|
||||
entity: "article" | "articleMenu" | "user" | string;
|
||||
entityId: String<64>;
|
||||
extra1?: Text | null;
|
||||
extension: String<16>;
|
||||
size?: Int<4> | null;
|
||||
sort?: Float<22, 10> | null;
|
||||
fileType?: String<128> | null;
|
||||
isBridge?: Boolean | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
origin: 'qiniu' | 'unknown';
|
||||
type: 'image' | 'video' | 'audio' | 'file';
|
||||
bucket: String<16>;
|
||||
objectId: String<64>;
|
||||
tag1?: String<32> | null;
|
||||
tag2?: String<32> | null;
|
||||
filename: String<256>;
|
||||
md5?: Text | null;
|
||||
entity: "article" | "articleMenu" | "user" | string;
|
||||
entityId: String<64>;
|
||||
extra1?: Text | null;
|
||||
extension: String<16>;
|
||||
size?: Int<4> | null;
|
||||
sort?: Float<22, 10> | null;
|
||||
fileType?: String<128> | null;
|
||||
isBridge?: Boolean | null;
|
||||
article?: Article.Schema;
|
||||
articleMenu?: ArticleMenu.Schema;
|
||||
user?: User.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
origin: Q_EnumValue<'qiniu' | 'unknown'>;
|
||||
type: Q_EnumValue<'image' | 'video' | 'audio' | 'file'>;
|
||||
bucket: Q_StringValue;
|
||||
objectId: Q_StringValue;
|
||||
tag1: Q_StringValue;
|
||||
tag2: Q_StringValue;
|
||||
filename: Q_StringValue;
|
||||
md5: Q_StringValue;
|
||||
entity: Q_EnumValue<"article" | "articleMenu" | "user" | string>;
|
||||
entityId: Q_StringValue;
|
||||
extra1: Q_StringValue;
|
||||
extension: Q_StringValue;
|
||||
size: Q_NumberValue;
|
||||
sort: Q_NumberValue;
|
||||
fileType: Q_StringValue;
|
||||
isBridge: Q_BooleanValue;
|
||||
article: Article.Filter;
|
||||
articleMenu: ArticleMenu.Filter;
|
||||
user: User.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
origin?: number;
|
||||
type?: number;
|
||||
bucket?: number;
|
||||
objectId?: number;
|
||||
tag1?: number;
|
||||
tag2?: number;
|
||||
filename?: number;
|
||||
md5?: number;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
extra1?: number;
|
||||
extension?: number;
|
||||
size?: number;
|
||||
sort?: number;
|
||||
fileType?: number;
|
||||
isBridge?: number;
|
||||
article?: Article.Projection;
|
||||
articleMenu?: ArticleMenu.Projection;
|
||||
user?: User.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ExtraFileIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type ArticleIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type ArticleMenuIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type UserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
origin: number;
|
||||
} | {
|
||||
type: number;
|
||||
} | {
|
||||
bucket: number;
|
||||
} | {
|
||||
objectId: number;
|
||||
} | {
|
||||
tag1: number;
|
||||
} | {
|
||||
tag2: number;
|
||||
} | {
|
||||
filename: number;
|
||||
} | {
|
||||
md5: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
extra1: number;
|
||||
} | {
|
||||
extension: number;
|
||||
} | {
|
||||
size: number;
|
||||
} | {
|
||||
sort: number;
|
||||
} | {
|
||||
fileType: number;
|
||||
} | {
|
||||
isBridge: number;
|
||||
} | {
|
||||
article: Article.SortAttr;
|
||||
} | {
|
||||
articleMenu: ArticleMenu.SortAttr;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
article: Article.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "article";
|
||||
entityId: ForeignKey<"Article">;
|
||||
article: Article.UpdateOperation;
|
||||
} | {
|
||||
entity: "article";
|
||||
entityId: ForeignKey<"Article">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
articleMenu: ArticleMenu.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "articleMenu";
|
||||
entityId: ForeignKey<"ArticleMenu">;
|
||||
articleMenu: ArticleMenu.UpdateOperation;
|
||||
} | {
|
||||
entity: "articleMenu";
|
||||
entityId: ForeignKey<"ArticleMenu">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "user";
|
||||
entityId: ForeignKey<"User">;
|
||||
user: User.UpdateOperation;
|
||||
} | {
|
||||
entity: "user";
|
||||
entityId: ForeignKey<"User">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
});
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
article?: Article.CreateSingleOperation | Article.UpdateOperation | Article.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
articleMenu?: ArticleMenu.CreateSingleOperation | ArticleMenu.UpdateOperation | ArticleMenu.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("article" | "articleMenu" | "user" | string) | null;
|
||||
entityId?: ForeignKey<"Article" | "ArticleMenu" | "User"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & ({
|
||||
article?: Article.UpdateOperation | Article.RemoveOperation;
|
||||
} | {
|
||||
articleMenu?: ArticleMenu.UpdateOperation | ArticleMenu.RemoveOperation;
|
||||
} | {
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ArticleIdSubQuery = Selection<ArticleIdProjection>;
|
||||
export type ArticleMenuIdSubQuery = Selection<ArticleMenuIdProjection>;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type ExtraFileIdSubQuery = Selection<ExtraFileIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
origin: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["qiniu", "unknown"]
|
||||
},
|
||||
type: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["image", "video", "audio", "file"]
|
||||
},
|
||||
bucket: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
}
|
||||
},
|
||||
objectId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
tag1: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
tag2: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
filename: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 256
|
||||
}
|
||||
},
|
||||
md5: {
|
||||
type: "text"
|
||||
},
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["article", "articleMenu", "user"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
extra1: {
|
||||
type: "text"
|
||||
},
|
||||
extension: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
}
|
||||
},
|
||||
size: {
|
||||
type: "int",
|
||||
params: {
|
||||
width: 4,
|
||||
signed: true
|
||||
}
|
||||
},
|
||||
sort: {
|
||||
type: "decimal",
|
||||
params: {
|
||||
precision: 22,
|
||||
scale: 10
|
||||
}
|
||||
},
|
||||
fileType: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 128
|
||||
}
|
||||
},
|
||||
isBridge: {
|
||||
type: "boolean"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"文件","attr":{"origin":"源","type":"类型","bucket":"桶","objectId":"对象编号","tag1":"标签一","tag2":"标签二","filename":"文件名","md5":"md5","entity":"关联对象","entityId":"关联对象id","extra1":"额外信息","extension":"后缀名","size":"文件大小","sort":"排序","fileType":"文件类型","isBridge":"是否桥接访问"},"v":{"origin":{"qiniu":"七牛云","unknown":"未知"},"type":{"image":"图像","video":"视频","audio":"音频","file":"文件"}}}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
export type OpSchema = EntityShape & {
|
||||
module: String<64>;
|
||||
position: String<188>;
|
||||
namespace: String<256>;
|
||||
language: String<32>;
|
||||
data: Object;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
module: String<64>;
|
||||
position: String<188>;
|
||||
namespace: String<256>;
|
||||
language: String<32>;
|
||||
data: Object;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
module: Q_StringValue;
|
||||
position: Q_StringValue;
|
||||
namespace: Q_StringValue;
|
||||
language: Q_StringValue;
|
||||
data: Object;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
module?: number;
|
||||
position?: number;
|
||||
namespace?: number;
|
||||
language?: number;
|
||||
data?: number | Object;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type I18nIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
module: number;
|
||||
} | {
|
||||
position: number;
|
||||
} | {
|
||||
namespace: number;
|
||||
} | {
|
||||
language: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<OpSchema>;
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type I18nIdSubQuery = Selection<I18nIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
module: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
position: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 188
|
||||
}
|
||||
},
|
||||
namespace: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 256
|
||||
}
|
||||
},
|
||||
language: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
data: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"用户授权","attr":{"module":"模块","position":"文件位置","namespace":"命名空间","language":"语言","data":"数据"}}
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Float, Int, Boolean, Datetime, } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
export type OpSchema = EntityShape & {
|
||||
title: String<32>;
|
||||
streamTitle: String<32>;
|
||||
liveonly: 'online' | 'offline';
|
||||
hub: String<32>;
|
||||
streamKey: String<64>;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
rtmpPushUrl: String<64>;
|
||||
rtmpPlayUrl: String<64>;
|
||||
pcPushUrl: String<64>;
|
||||
expireAt: Datetime;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
title: String<32>;
|
||||
streamTitle: String<32>;
|
||||
liveonly: 'online' | 'offline';
|
||||
hub: String<32>;
|
||||
streamKey: String<64>;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
rtmpPushUrl: String<64>;
|
||||
rtmpPlayUrl: String<64>;
|
||||
pcPushUrl: String<64>;
|
||||
expireAt: Datetime;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
title: Q_StringValue;
|
||||
streamTitle: Q_StringValue;
|
||||
liveonly: Q_EnumValue<'online' | 'offline'>;
|
||||
hub: Q_StringValue;
|
||||
streamKey: Q_StringValue;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
rtmpPushUrl: Q_StringValue;
|
||||
rtmpPlayUrl: Q_StringValue;
|
||||
pcPushUrl: Q_StringValue;
|
||||
expireAt: Q_DateValue;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
title?: number;
|
||||
streamTitle?: number;
|
||||
liveonly?: number;
|
||||
hub?: number;
|
||||
streamKey?: number;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
rtmpPushUrl?: number;
|
||||
rtmpPlayUrl?: number;
|
||||
pcPushUrl?: number;
|
||||
expireAt?: number;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type LivestreamIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
title: number;
|
||||
} | {
|
||||
streamTitle: number;
|
||||
} | {
|
||||
liveonly: number;
|
||||
} | {
|
||||
hub: number;
|
||||
} | {
|
||||
streamKey: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
rtmpPushUrl: number;
|
||||
} | {
|
||||
rtmpPlayUrl: number;
|
||||
} | {
|
||||
pcPushUrl: number;
|
||||
} | {
|
||||
expireAt: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
});
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type LivestreamIdSubQuery = Selection<LivestreamIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
title: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
streamTitle: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
liveonly: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["online", "offline"]
|
||||
},
|
||||
hub: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
streamKey: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
rtmpPushUrl: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
rtmpPlayUrl: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
pcPushUrl: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
expireAt: {
|
||||
notNull: true,
|
||||
type: "datetime"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"直播流","attr":{"title":"名称","streamTitle":"直播流名称","liveonly":"活跃状态","hub":"直播空间名称","entity":"所属实体","entityId":"所属实体id","rtmpPushUrl":"推流地址","rtmpPlayUrl":"播放地址","expireAt":"推流过期时间","pcPushUrl":"OBS推流地址","streamKey":"OBS串流密钥"},"v":{"liveonly":{"online":"在线","offline":"下线"}}}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
export type IAction = 'succeed' | 'fail' | string;
|
||||
export type IState = 'sending' | 'success' | 'failure' | string;
|
||||
export type VisitState = 'unvisited' | 'visited' | string;
|
||||
export type VisitAction = 'visit' | string;
|
||||
export type ParticularAction = IAction | VisitAction;
|
||||
export type Action = GenericAction | ParticularAction | string;
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "succeed", "fail", "visit"];
|
||||
const IActionDef: ActionDef<IAction, IState> = {
|
||||
stm: {
|
||||
succeed: ['sending', 'success'],
|
||||
fail: ['sending', 'failure']
|
||||
}
|
||||
};
|
||||
const VisitActionDef: ActionDef<VisitAction, VisitState> = {
|
||||
stm: {
|
||||
visit: ['unvisited', 'visited']
|
||||
},
|
||||
is: 'unvisited'
|
||||
};
|
||||
export const ActionDefDict = {
|
||||
iState: IActionDef,
|
||||
visitState: VisitActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,210 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction, IState, VisitState } from "./Action";
|
||||
import { RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Text, Image } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { Index, ActionDef } from "oak-domain/lib/types";
|
||||
import { Channel, Weight } from "../../types/Message";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as User from "../User/Schema";
|
||||
import * as MessageSystem from "../MessageSystem/Schema";
|
||||
type Router = {
|
||||
pathname: string;
|
||||
props?: Record<string, any>;
|
||||
state?: Record<string, any>;
|
||||
isTabBar?: boolean; //小程序独有 小程序跳回tabBar的话 必须使用 wx.switchTab
|
||||
};
|
||||
type MessageRestriction = {
|
||||
systemIds?: string[]; // 允许发送的system
|
||||
channels?: Array<Channel>; // 允许推送的渠道
|
||||
};
|
||||
export type OpSchema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
userId: ForeignKey<"user">;
|
||||
type: String<64>;
|
||||
weight: Weight;
|
||||
restriction?: MessageRestriction | null;
|
||||
title: String<256>;
|
||||
content: Text;
|
||||
data?: Object | null;
|
||||
router?: Router | null;
|
||||
iState?: IState | null;
|
||||
visitState?: VisitState | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
userId: ForeignKey<"user">;
|
||||
type: String<64>;
|
||||
weight: Weight;
|
||||
restriction?: MessageRestriction | null;
|
||||
title: String<256>;
|
||||
content: Text;
|
||||
data?: Object | null;
|
||||
router?: Router | null;
|
||||
iState?: IState | null;
|
||||
visitState?: VisitState | null;
|
||||
user: User.Schema;
|
||||
messageSystem$message?: Array<MessageSystem.Schema>;
|
||||
messageSystem$message$$aggr?: AggregationResult<MessageSystem.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
userId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
type: Q_StringValue;
|
||||
weight: Q_EnumValue<Weight>;
|
||||
restriction: JsonFilter<MessageRestriction>;
|
||||
title: Q_StringValue;
|
||||
content: Q_StringValue;
|
||||
data: Object;
|
||||
router: JsonFilter<Router>;
|
||||
iState: Q_EnumValue<IState>;
|
||||
visitState: Q_EnumValue<VisitState>;
|
||||
messageSystem$message: MessageSystem.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
userId?: number;
|
||||
user?: User.Projection;
|
||||
type?: number;
|
||||
weight?: number;
|
||||
restriction?: number | JsonProjection<MessageRestriction>;
|
||||
title?: number;
|
||||
content?: number;
|
||||
data?: number | Object;
|
||||
router?: number | JsonProjection<Router>;
|
||||
iState?: number;
|
||||
visitState?: number;
|
||||
messageSystem$message?: MessageSystem.Selection & {
|
||||
$entity: "messageSystem";
|
||||
};
|
||||
messageSystem$message$$aggr?: MessageSystem.Aggregation & {
|
||||
$entity: "messageSystem";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type MessageIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
userId: number;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
type: number;
|
||||
} | {
|
||||
weight: number;
|
||||
} | {
|
||||
restriction: number;
|
||||
} | {
|
||||
title: number;
|
||||
} | {
|
||||
content: number;
|
||||
} | {
|
||||
router: number;
|
||||
} | {
|
||||
iState: number;
|
||||
} | {
|
||||
visitState: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "userId">> & (({
|
||||
userId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
})) & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
}) & {
|
||||
messageSystem$message?: OakOperation<MessageSystem.UpdateOperation["action"], Omit<MessageSystem.UpdateOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">> | OakOperation<"create", Omit<MessageSystem.CreateOperationData, "message" | "messageId">[]> | Array<OakOperation<"create", Omit<MessageSystem.CreateOperationData, "message" | "messageId">> | OakOperation<MessageSystem.UpdateOperation["action"], Omit<MessageSystem.UpdateOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
messageSystem$message?: OakOperation<MessageSystem.UpdateOperation["action"], Omit<MessageSystem.UpdateOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">> | OakOperation<MessageSystem.RemoveOperation["action"], Omit<MessageSystem.RemoveOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">> | OakOperation<"create", Omit<MessageSystem.CreateOperationData, "message" | "messageId">[]> | Array<OakOperation<"create", Omit<MessageSystem.CreateOperationData, "message" | "messageId">> | OakOperation<MessageSystem.UpdateOperation["action"], Omit<MessageSystem.UpdateOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">> | OakOperation<MessageSystem.RemoveOperation["action"], Omit<MessageSystem.RemoveOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type MessageIdSubQuery = Selection<MessageIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<Action> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
ParticularAction: ParticularAction;
|
||||
};
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { actions } from "./Action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
userId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
type: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
weight: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["high", "medium", "low"]
|
||||
},
|
||||
restriction: {
|
||||
type: "object"
|
||||
},
|
||||
title: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 256
|
||||
}
|
||||
},
|
||||
content: {
|
||||
notNull: true,
|
||||
type: "text"
|
||||
},
|
||||
data: {
|
||||
type: "object"
|
||||
},
|
||||
router: {
|
||||
type: "object"
|
||||
},
|
||||
iState: {
|
||||
type: "enum",
|
||||
enumeration: ["sending", "success", "failure"]
|
||||
},
|
||||
visitState: {
|
||||
type: "enum",
|
||||
enumeration: ["unvisited", "visited"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"消息","attr":{"entity":"关联对象","entityId":"关联对象ID","restriction":"限制","title":"标题","content":"内容","user":"关联用户","type":"消息类型","weight":"优先级","iState":"发送状态","visitState":"访问状态","router":"目标路由","data":"透传数据"},"action":{"succeed":"成功","fail":"失败","visit":"阅读"},"v":{"iState":{"sending":"发送中","success":"发送成功","failure":"发送失败"},"visitState":{"unvisited":"未读","visited":"已读"},"weight":{"high":"高","medium":"中","low":"低"}}}
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Message from "../Message/Schema";
|
||||
import * as System from "../System/Schema";
|
||||
import * as Notification from "../Notification/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
messageId: ForeignKey<"message">;
|
||||
systemId: ForeignKey<"system">;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
messageId: ForeignKey<"message">;
|
||||
systemId: ForeignKey<"system">;
|
||||
message: Message.Schema;
|
||||
system: System.Schema;
|
||||
notification$messageSystem?: Array<Notification.Schema>;
|
||||
notification$messageSystem$$aggr?: AggregationResult<Notification.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
messageId: Q_StringValue;
|
||||
message: Message.Filter;
|
||||
systemId: Q_StringValue;
|
||||
system: System.Filter;
|
||||
notification$messageSystem: Notification.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
messageId?: number;
|
||||
message?: Message.Projection;
|
||||
systemId?: number;
|
||||
system?: System.Projection;
|
||||
notification$messageSystem?: Notification.Selection & {
|
||||
$entity: "notification";
|
||||
};
|
||||
notification$messageSystem$$aggr?: Notification.Aggregation & {
|
||||
$entity: "notification";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type MessageSystemIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type MessageIdProjection = OneOf<{
|
||||
messageId: number;
|
||||
}>;
|
||||
type SystemIdProjection = OneOf<{
|
||||
systemId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
messageId: number;
|
||||
} | {
|
||||
message: Message.SortAttr;
|
||||
} | {
|
||||
systemId: number;
|
||||
} | {
|
||||
system: System.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "messageId" | "systemId">> & (({
|
||||
messageId?: never;
|
||||
message: Message.CreateSingleOperation;
|
||||
} | {
|
||||
messageId: ForeignKey<"message">;
|
||||
message?: Message.UpdateOperation;
|
||||
} | {
|
||||
messageId: ForeignKey<"message">;
|
||||
}) & ({
|
||||
systemId?: never;
|
||||
system: System.CreateSingleOperation;
|
||||
} | {
|
||||
systemId: ForeignKey<"system">;
|
||||
system?: System.UpdateOperation;
|
||||
} | {
|
||||
systemId: ForeignKey<"system">;
|
||||
})) & {
|
||||
notification$messageSystem?: OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "messageSystem" | "messageSystemId">, Omit<Notification.Filter, "messageSystem" | "messageSystemId">> | OakOperation<"create", Omit<Notification.CreateOperationData, "messageSystem" | "messageSystemId">[]> | Array<OakOperation<"create", Omit<Notification.CreateOperationData, "messageSystem" | "messageSystemId">> | OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "messageSystem" | "messageSystemId">, Omit<Notification.Filter, "messageSystem" | "messageSystemId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "messageId" | "systemId">> & (({
|
||||
message: Message.CreateSingleOperation;
|
||||
messageId?: never;
|
||||
} | {
|
||||
message: Message.UpdateOperation;
|
||||
messageId?: never;
|
||||
} | {
|
||||
message: Message.RemoveOperation;
|
||||
messageId?: never;
|
||||
} | {
|
||||
message?: never;
|
||||
messageId?: ForeignKey<"message"> | null;
|
||||
}) & ({
|
||||
system: System.CreateSingleOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.UpdateOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.RemoveOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId?: ForeignKey<"system"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
notification$messageSystem?: OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "messageSystem" | "messageSystemId">, Omit<Notification.Filter, "messageSystem" | "messageSystemId">> | OakOperation<Notification.RemoveOperation["action"], Omit<Notification.RemoveOperationData, "messageSystem" | "messageSystemId">, Omit<Notification.Filter, "messageSystem" | "messageSystemId">> | OakOperation<"create", Omit<Notification.CreateOperationData, "messageSystem" | "messageSystemId">[]> | Array<OakOperation<"create", Omit<Notification.CreateOperationData, "messageSystem" | "messageSystemId">> | OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "messageSystem" | "messageSystemId">, Omit<Notification.Filter, "messageSystem" | "messageSystemId">> | OakOperation<Notification.RemoveOperation["action"], Omit<Notification.RemoveOperationData, "messageSystem" | "messageSystemId">, Omit<Notification.Filter, "messageSystem" | "messageSystemId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
message?: Message.UpdateOperation | Message.RemoveOperation;
|
||||
}) & ({
|
||||
system?: System.UpdateOperation | System.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type MessageIdSubQuery = Selection<MessageIdProjection>;
|
||||
export type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export type MessageSystemIdSubQuery = Selection<MessageSystemIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
messageId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "message"
|
||||
},
|
||||
systemId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "system"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"消息系统连接","attr":{"message":"消息","system":"系统"}}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
export type OpSchema = EntityShape & {
|
||||
type: String<64>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
type: String<64>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
type: Q_StringValue;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
type?: number;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type MessageTypeIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
type: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<OpSchema>;
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type MessageTypeIdSubQuery = Selection<MessageTypeIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
type: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"消息类型","attr":{"type":"类型"}}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Float, Int, Boolean, Datetime, } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Application from "../Application/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
type: String<64>;
|
||||
templateId: String<128>;
|
||||
applicationId: ForeignKey<"application">;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
type: String<64>;
|
||||
templateId: String<128>;
|
||||
applicationId: ForeignKey<"application">;
|
||||
application: Application.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
type: Q_StringValue;
|
||||
templateId: Q_StringValue;
|
||||
applicationId: Q_StringValue;
|
||||
application: Application.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
type?: number;
|
||||
templateId?: number;
|
||||
applicationId?: number;
|
||||
application?: Application.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type MessageTypeTemplateIdIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type ApplicationIdProjection = OneOf<{
|
||||
applicationId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
type: number;
|
||||
} | {
|
||||
templateId: number;
|
||||
} | {
|
||||
applicationId: number;
|
||||
} | {
|
||||
application: Application.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "applicationId">> & (({
|
||||
applicationId?: never;
|
||||
application: Application.CreateSingleOperation;
|
||||
} | {
|
||||
applicationId: ForeignKey<"application">;
|
||||
application?: Application.UpdateOperation;
|
||||
} | {
|
||||
applicationId: ForeignKey<"application">;
|
||||
}));
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "applicationId">> & (({
|
||||
application: Application.CreateSingleOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application: Application.UpdateOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application: Application.RemoveOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application?: never;
|
||||
applicationId?: ForeignKey<"application"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
application?: Application.UpdateOperation | Application.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
|
||||
export type MessageTypeTemplateIdIdSubQuery = Selection<MessageTypeTemplateIdIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
type: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
templateId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 128
|
||||
}
|
||||
},
|
||||
applicationId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "application"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"消息类型模板","attr":{"type":"消息类型","templateId":"模板编号","application":"关联应用"}}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import { AbleAction, AbleState, makeAbleActionDef } from 'oak-domain/lib/actions/action';
|
||||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
export type ParticularAction = AbleAction;
|
||||
export type Action = GenericAction | ParticularAction | string;
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "enable", "disable"];
|
||||
const AbleActionDef: ActionDef<AbleAction, AbleState> = makeAbleActionDef('enabled');
|
||||
export const ActionDefDict = {
|
||||
ableState: AbleActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction } from "./Action";
|
||||
import { RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Text, Image } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { AbleAction, AbleState, makeAbleActionDef } from "oak-domain/lib/actions/action";
|
||||
import { ActionDef, Index } from "oak-domain/lib/types";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
mobile: String<16>;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
ableState?: AbleState | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
mobile: String<16>;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
ableState?: AbleState | null;
|
||||
user?: User.Schema | null;
|
||||
token$entity?: Array<Token.Schema>;
|
||||
token$entity$$aggr?: AggregationResult<Token.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
mobile: Q_StringValue;
|
||||
userId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
ableState: Q_EnumValue<AbleState>;
|
||||
token$entity: Token.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
mobile?: number;
|
||||
userId?: number;
|
||||
user?: User.Projection;
|
||||
ableState?: number;
|
||||
token$entity?: Token.Selection & {
|
||||
$entity: "token";
|
||||
};
|
||||
token$entity$$aggr?: Token.Aggregation & {
|
||||
$entity: "token";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type MobileIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
mobile: number;
|
||||
} | {
|
||||
userId: number;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
ableState: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "userId">> & (({
|
||||
userId?: never;
|
||||
user?: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId?: ForeignKey<"user">;
|
||||
})) & {
|
||||
token$entity?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
token$entity?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type MobileIdSubQuery = Selection<MobileIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<Action> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
ParticularAction: ParticularAction;
|
||||
};
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { actions } from "./Action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
mobile: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
}
|
||||
},
|
||||
userId: {
|
||||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
ableState: {
|
||||
type: "enum",
|
||||
enumeration: ["enabled", "disabled"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_mobile_ableState',
|
||||
attributes: [
|
||||
{
|
||||
name: 'mobile',
|
||||
direction: 'ASC'
|
||||
},
|
||||
{
|
||||
name: 'ableState',
|
||||
direction: 'ASC'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"手机","attr":{"ableState":"是否可用","mobile":"手机号","user":"关联用户","tokens":"相关令牌"},"action":{"enable":"启用","disable":"禁用"},"v":{"ableState":{"enabled":"可用的","disabled":"禁用的"}}}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
export type IState = 'active' | 'applied' | 'abandoned' | string;
|
||||
export type IAction = 'apply' | 'abandon' | string;
|
||||
const IActionDef: ActionDef<IAction, IState> = {
|
||||
stm: {
|
||||
apply: ['active', 'applied'],
|
||||
abandon: ['active', 'abandoned']
|
||||
},
|
||||
is: 'active'
|
||||
};
|
||||
export type ParticularAction = IAction;
|
||||
export type Action = GenericAction | ParticularAction | string;
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "apply", "abandon"];
|
||||
export const ActionDefDict = {
|
||||
iState: IActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction, IState } from "./Action";
|
||||
import { RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as ModiEntity from "../ModiEntity/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
targetEntity: String<32>;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
action: String<16>;
|
||||
data: Object;
|
||||
filter?: Object | null;
|
||||
extra?: Object | null;
|
||||
iState?: IState | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
targetEntity: String<32>;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
action: String<16>;
|
||||
data: Object;
|
||||
filter?: Object | null;
|
||||
extra?: Object | null;
|
||||
iState?: IState | null;
|
||||
modiEntity$modi?: Array<ModiEntity.Schema>;
|
||||
modiEntity$modi$$aggr?: AggregationResult<ModiEntity.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
targetEntity: Q_StringValue;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
action: Q_StringValue;
|
||||
data: Object;
|
||||
filter: Object;
|
||||
extra: Object;
|
||||
iState: Q_EnumValue<IState>;
|
||||
modiEntity$modi: ModiEntity.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
targetEntity?: number;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
action?: number;
|
||||
data?: number | Object;
|
||||
filter?: number | Object;
|
||||
extra?: number | Object;
|
||||
iState?: number;
|
||||
modiEntity$modi?: ModiEntity.Selection & {
|
||||
$entity: "modiEntity";
|
||||
};
|
||||
modiEntity$modi$$aggr?: ModiEntity.Aggregation & {
|
||||
$entity: "modiEntity";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ModiIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
targetEntity: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
action: number;
|
||||
} | {
|
||||
iState: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
}) & {
|
||||
modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ModiIdSubQuery = Selection<ModiIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<Action> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
ParticularAction: ParticularAction;
|
||||
};
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { actions } from "./Action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
targetEntity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
action: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
}
|
||||
},
|
||||
data: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
filter: {
|
||||
type: "object"
|
||||
},
|
||||
extra: {
|
||||
type: "object"
|
||||
},
|
||||
iState: {
|
||||
type: "enum",
|
||||
enumeration: ["active", "applied", "abandoned"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_state',
|
||||
attributes: [
|
||||
{
|
||||
name: 'iState',
|
||||
direction: 'ASC'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"更新","attr":{"targetEntity":"目标对象","entity":"关联对象","entityId":"关联对象Id","action":"动作","data":"数据","filter":"条件","extra":"其它","iState":"状态"},"action":{"abandon":"放弃","apply":"应用"},"v":{"iState":{"active":"活跃的","abandoned":"放弃的","applied":"应用的"}}}
|
||||
|
|
@ -0,0 +1,352 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Modi from "../Modi/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
||||
import * as UserSystem from "../UserSystem/Schema";
|
||||
import * as UserWechatPublicTag from "../UserWechatPublicTag/Schema";
|
||||
import * as WechatLogin from "../WechatLogin/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
modiId: ForeignKey<"modi">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatPublicTag" | "wechatQrCode" | "wechatUser" | string;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
modiId: ForeignKey<"modi">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatPublicTag" | "wechatQrCode" | "wechatUser" | string;
|
||||
entityId: String<64>;
|
||||
modi: Modi.Schema;
|
||||
user?: User.Schema;
|
||||
userEntityGrant?: UserEntityGrant.Schema;
|
||||
userSystem?: UserSystem.Schema;
|
||||
userWechatPublicTag?: UserWechatPublicTag.Schema;
|
||||
wechatLogin?: WechatLogin.Schema;
|
||||
wechatPublicTag?: WechatPublicTag.Schema;
|
||||
wechatQrCode?: WechatQrCode.Schema;
|
||||
wechatUser?: WechatUser.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
modiId: Q_StringValue;
|
||||
modi: Modi.Filter;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatPublicTag" | "wechatQrCode" | "wechatUser" | string>;
|
||||
entityId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
userEntityGrant: UserEntityGrant.Filter;
|
||||
userSystem: UserSystem.Filter;
|
||||
userWechatPublicTag: UserWechatPublicTag.Filter;
|
||||
wechatLogin: WechatLogin.Filter;
|
||||
wechatPublicTag: WechatPublicTag.Filter;
|
||||
wechatQrCode: WechatQrCode.Filter;
|
||||
wechatUser: WechatUser.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
modiId?: number;
|
||||
modi?: Modi.Projection;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
user?: User.Projection;
|
||||
userEntityGrant?: UserEntityGrant.Projection;
|
||||
userSystem?: UserSystem.Projection;
|
||||
userWechatPublicTag?: UserWechatPublicTag.Projection;
|
||||
wechatLogin?: WechatLogin.Projection;
|
||||
wechatPublicTag?: WechatPublicTag.Projection;
|
||||
wechatQrCode?: WechatQrCode.Projection;
|
||||
wechatUser?: WechatUser.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ModiEntityIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type ModiIdProjection = OneOf<{
|
||||
modiId: number;
|
||||
}>;
|
||||
type UserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type UserEntityGrantIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type UserSystemIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type UserWechatPublicTagIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatLoginIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatPublicTagIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatQrCodeIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatUserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
modiId: number;
|
||||
} | {
|
||||
modi: Modi.SortAttr;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
userEntityGrant: UserEntityGrant.SortAttr;
|
||||
} | {
|
||||
userSystem: UserSystem.SortAttr;
|
||||
} | {
|
||||
userWechatPublicTag: UserWechatPublicTag.SortAttr;
|
||||
} | {
|
||||
wechatLogin: WechatLogin.SortAttr;
|
||||
} | {
|
||||
wechatPublicTag: WechatPublicTag.SortAttr;
|
||||
} | {
|
||||
wechatQrCode: WechatQrCode.SortAttr;
|
||||
} | {
|
||||
wechatUser: WechatUser.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
|
||||
modiId?: never;
|
||||
modi: Modi.CreateSingleOperation;
|
||||
} | {
|
||||
modiId: ForeignKey<"modi">;
|
||||
modi?: Modi.UpdateOperation;
|
||||
} | {
|
||||
modiId: ForeignKey<"modi">;
|
||||
})) & ({
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "user";
|
||||
entityId: ForeignKey<"User">;
|
||||
user: User.UpdateOperation;
|
||||
} | {
|
||||
entity: "user";
|
||||
entityId: ForeignKey<"User">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
userEntityGrant: UserEntityGrant.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "userEntityGrant";
|
||||
entityId: ForeignKey<"UserEntityGrant">;
|
||||
userEntityGrant: UserEntityGrant.UpdateOperation;
|
||||
} | {
|
||||
entity: "userEntityGrant";
|
||||
entityId: ForeignKey<"UserEntityGrant">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
userSystem: UserSystem.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "userSystem";
|
||||
entityId: ForeignKey<"UserSystem">;
|
||||
userSystem: UserSystem.UpdateOperation;
|
||||
} | {
|
||||
entity: "userSystem";
|
||||
entityId: ForeignKey<"UserSystem">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
userWechatPublicTag: UserWechatPublicTag.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "userWechatPublicTag";
|
||||
entityId: ForeignKey<"UserWechatPublicTag">;
|
||||
userWechatPublicTag: UserWechatPublicTag.UpdateOperation;
|
||||
} | {
|
||||
entity: "userWechatPublicTag";
|
||||
entityId: ForeignKey<"UserWechatPublicTag">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatLogin: WechatLogin.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatLogin";
|
||||
entityId: ForeignKey<"WechatLogin">;
|
||||
wechatLogin: WechatLogin.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatLogin";
|
||||
entityId: ForeignKey<"WechatLogin">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicTag: WechatPublicTag.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicTag";
|
||||
entityId: ForeignKey<"WechatPublicTag">;
|
||||
wechatPublicTag: WechatPublicTag.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicTag";
|
||||
entityId: ForeignKey<"WechatPublicTag">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatQrCode: WechatQrCode.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatQrCode";
|
||||
entityId: ForeignKey<"WechatQrCode">;
|
||||
wechatQrCode: WechatQrCode.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatQrCode";
|
||||
entityId: ForeignKey<"WechatQrCode">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatUser: WechatUser.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatUser";
|
||||
entityId: ForeignKey<"WechatUser">;
|
||||
wechatUser: WechatUser.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatUser";
|
||||
entityId: ForeignKey<"WechatUser">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
});
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
|
||||
modi: Modi.CreateSingleOperation;
|
||||
modiId?: never;
|
||||
} | {
|
||||
modi: Modi.UpdateOperation;
|
||||
modiId?: never;
|
||||
} | {
|
||||
modi: Modi.RemoveOperation;
|
||||
modiId?: never;
|
||||
} | {
|
||||
modi?: never;
|
||||
modiId?: ForeignKey<"modi"> | null;
|
||||
})) & ({
|
||||
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
userEntityGrant?: UserEntityGrant.CreateSingleOperation | UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
userSystem?: UserSystem.CreateSingleOperation | UserSystem.UpdateOperation | UserSystem.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
userWechatPublicTag?: UserWechatPublicTag.CreateSingleOperation | UserWechatPublicTag.UpdateOperation | UserWechatPublicTag.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatLogin?: WechatLogin.CreateSingleOperation | WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.CreateSingleOperation | WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatQrCode?: WechatQrCode.CreateSingleOperation | WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatUser?: WechatUser.CreateSingleOperation | WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatPublicTag" | "wechatQrCode" | "wechatUser" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatPublicTag" | "WechatQrCode" | "WechatUser"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
modi?: Modi.UpdateOperation | Modi.RemoveOperation;
|
||||
})) & ({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
} | {
|
||||
userEntityGrant?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
|
||||
} | {
|
||||
userSystem?: UserSystem.UpdateOperation | UserSystem.RemoveOperation;
|
||||
} | {
|
||||
userWechatPublicTag?: UserWechatPublicTag.UpdateOperation | UserWechatPublicTag.RemoveOperation;
|
||||
} | {
|
||||
wechatLogin?: WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
} | {
|
||||
wechatQrCode?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation;
|
||||
} | {
|
||||
wechatUser?: WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ModiIdSubQuery = Selection<ModiIdProjection>;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
|
||||
export type UserSystemIdSubQuery = Selection<UserSystemIdProjection>;
|
||||
export type UserWechatPublicTagIdSubQuery = Selection<UserWechatPublicTagIdProjection>;
|
||||
export type WechatLoginIdSubQuery = Selection<WechatLoginIdProjection>;
|
||||
export type WechatPublicTagIdSubQuery = Selection<WechatPublicTagIdProjection>;
|
||||
export type WechatQrCodeIdSubQuery = Selection<WechatQrCodeIdProjection>;
|
||||
export type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
|
||||
export type ModiEntityIdSubQuery = Selection<ModiEntityIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<AppendOnlyAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { appendOnlyActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
modiId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "modi"
|
||||
},
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatPublicTag", "wechatQrCode", "wechatUser"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "appendOnly",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"更新对象连接","attr":{"modi":"更新","entity":"关联对象","entityId":"关联对象id"}}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
export type IAction = 'succeed' | 'fail' | string;
|
||||
export type IState = 'sending' | 'success' | 'failure' | string;
|
||||
export type ParticularAction = IAction;
|
||||
export type Action = GenericAction | ParticularAction | string;
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "succeed", "fail"];
|
||||
const IActionDef: ActionDef<IAction, IState> = {
|
||||
stm: {
|
||||
succeed: ['sending', 'success'],
|
||||
fail: ['sending', 'failure']
|
||||
},
|
||||
is: 'sending'
|
||||
};
|
||||
export const ActionDefDict = {
|
||||
iState: IActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction, IState } from "./Action";
|
||||
import { RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { Index, ActionDef } from "oak-domain/lib/types";
|
||||
import { Channel } from "../../types/Message";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Application from "../Application/Schema";
|
||||
import * as MessageSystem from "../MessageSystem/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
channel: Channel;
|
||||
applicationId?: ForeignKey<"application"> | null;
|
||||
data?: Object | null;
|
||||
messageSystemId: ForeignKey<"messageSystem">;
|
||||
data1?: Object | null;
|
||||
data2?: Object | null;
|
||||
templateId?: String<128> | null;
|
||||
iState?: IState | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
channel: Channel;
|
||||
applicationId?: ForeignKey<"application"> | null;
|
||||
data?: Object | null;
|
||||
messageSystemId: ForeignKey<"messageSystem">;
|
||||
data1?: Object | null;
|
||||
data2?: Object | null;
|
||||
templateId?: String<128> | null;
|
||||
iState?: IState | null;
|
||||
application?: Application.Schema | null;
|
||||
messageSystem: MessageSystem.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
channel: Q_EnumValue<Channel>;
|
||||
applicationId: Q_StringValue;
|
||||
application: Application.Filter;
|
||||
data: Object;
|
||||
messageSystemId: Q_StringValue;
|
||||
messageSystem: MessageSystem.Filter;
|
||||
data1: Object;
|
||||
data2: Object;
|
||||
templateId: Q_StringValue;
|
||||
iState: Q_EnumValue<IState>;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
channel?: number;
|
||||
applicationId?: number;
|
||||
application?: Application.Projection;
|
||||
data?: number | Object;
|
||||
messageSystemId?: number;
|
||||
messageSystem?: MessageSystem.Projection;
|
||||
data1?: number | Object;
|
||||
data2?: number | Object;
|
||||
templateId?: number;
|
||||
iState?: number;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type NotificationIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type ApplicationIdProjection = OneOf<{
|
||||
applicationId: number;
|
||||
}>;
|
||||
type MessageSystemIdProjection = OneOf<{
|
||||
messageSystemId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
channel: number;
|
||||
} | {
|
||||
applicationId: number;
|
||||
} | {
|
||||
application: Application.SortAttr;
|
||||
} | {
|
||||
messageSystemId: number;
|
||||
} | {
|
||||
messageSystem: MessageSystem.SortAttr;
|
||||
} | {
|
||||
templateId: number;
|
||||
} | {
|
||||
iState: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "applicationId" | "messageSystemId">> & (({
|
||||
applicationId?: never;
|
||||
application?: Application.CreateSingleOperation;
|
||||
} | {
|
||||
applicationId: ForeignKey<"application">;
|
||||
application?: Application.UpdateOperation;
|
||||
} | {
|
||||
applicationId?: ForeignKey<"application">;
|
||||
}) & ({
|
||||
messageSystemId?: never;
|
||||
messageSystem: MessageSystem.CreateSingleOperation;
|
||||
} | {
|
||||
messageSystemId: ForeignKey<"messageSystem">;
|
||||
messageSystem?: MessageSystem.UpdateOperation;
|
||||
} | {
|
||||
messageSystemId: ForeignKey<"messageSystem">;
|
||||
}));
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "applicationId" | "messageSystemId">> & (({
|
||||
application: Application.CreateSingleOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application: Application.UpdateOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application: Application.RemoveOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application?: never;
|
||||
applicationId?: ForeignKey<"application"> | null;
|
||||
}) & ({
|
||||
messageSystem: MessageSystem.CreateSingleOperation;
|
||||
messageSystemId?: never;
|
||||
} | {
|
||||
messageSystem: MessageSystem.UpdateOperation;
|
||||
messageSystemId?: never;
|
||||
} | {
|
||||
messageSystem: MessageSystem.RemoveOperation;
|
||||
messageSystemId?: never;
|
||||
} | {
|
||||
messageSystem?: never;
|
||||
messageSystemId?: ForeignKey<"messageSystem"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
application?: Application.UpdateOperation | Application.RemoveOperation;
|
||||
}) & ({
|
||||
messageSystem?: MessageSystem.UpdateOperation | MessageSystem.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
|
||||
export type MessageSystemIdSubQuery = Selection<MessageSystemIdProjection>;
|
||||
export type NotificationIdSubQuery = Selection<NotificationIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<Action> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
ParticularAction: ParticularAction;
|
||||
};
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { actions } from "./Action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
channel: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["wechatPublic", "jPush", "jim", "wechatMp", "sms"]
|
||||
},
|
||||
applicationId: {
|
||||
type: "ref",
|
||||
ref: "application"
|
||||
},
|
||||
data: {
|
||||
type: "object"
|
||||
},
|
||||
messageSystemId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "messageSystem"
|
||||
},
|
||||
data1: {
|
||||
type: "object"
|
||||
},
|
||||
data2: {
|
||||
type: "object"
|
||||
},
|
||||
templateId: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 128
|
||||
}
|
||||
},
|
||||
iState: {
|
||||
type: "enum",
|
||||
enumeration: ["sending", "success", "failure"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"通知","attr":{"channel":"消息渠道","data":"消息数据","messageSystem":"消息系统连接","data1":"数据1","data2":"数据2","iState":"状态","application":"关联应用","templateId":"模板id"},"action":{"succeed":"成功","fail":"失败"},"v":{"iState":{"sending":"发送中","success":"发送成功","failure":"发送失败"},"channel":{"wechatPublic":"公众号","jPush":"极光推送","jim":"极光消息","wechatMp":"小程序","sms":"短信"}}}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Datetime, Image, Boolean, Text } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as User from "../User/Schema";
|
||||
import * as OperEntity from "../OperEntity/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
action: String<16>;
|
||||
data: Object;
|
||||
filter?: Object | null;
|
||||
extra?: Object | null;
|
||||
operatorId?: ForeignKey<"user"> | null;
|
||||
targetEntity: String<32>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
action: String<16>;
|
||||
data: Object;
|
||||
filter?: Object | null;
|
||||
extra?: Object | null;
|
||||
operatorId?: ForeignKey<"user"> | null;
|
||||
targetEntity: String<32>;
|
||||
operator?: User.Schema | null;
|
||||
operEntity$oper?: Array<OperEntity.Schema>;
|
||||
operEntity$oper$$aggr?: AggregationResult<OperEntity.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
action: Q_StringValue;
|
||||
data: Object;
|
||||
filter: Object;
|
||||
extra: Object;
|
||||
operatorId: Q_StringValue;
|
||||
operator: User.Filter;
|
||||
targetEntity: Q_StringValue;
|
||||
operEntity$oper: OperEntity.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
action?: number;
|
||||
data?: number | Object;
|
||||
filter?: number | Object;
|
||||
extra?: number | Object;
|
||||
operatorId?: number;
|
||||
operator?: User.Projection;
|
||||
targetEntity?: number;
|
||||
operEntity$oper?: OperEntity.Selection & {
|
||||
$entity: "operEntity";
|
||||
};
|
||||
operEntity$oper$$aggr?: OperEntity.Aggregation & {
|
||||
$entity: "operEntity";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type OperIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type UserIdProjection = OneOf<{
|
||||
operatorId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
action: number;
|
||||
} | {
|
||||
operatorId: number;
|
||||
} | {
|
||||
operator: User.SortAttr;
|
||||
} | {
|
||||
targetEntity: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> & (({
|
||||
operatorId?: never;
|
||||
operator?: User.CreateSingleOperation;
|
||||
} | {
|
||||
operatorId: ForeignKey<"operator">;
|
||||
operator?: User.UpdateOperation;
|
||||
} | {
|
||||
operatorId?: ForeignKey<"operator">;
|
||||
})) & {
|
||||
operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operatorId">> & (({
|
||||
operator: User.CreateSingleOperation;
|
||||
operatorId?: never;
|
||||
} | {
|
||||
operator: User.UpdateOperation;
|
||||
operatorId?: never;
|
||||
} | {
|
||||
operator: User.RemoveOperation;
|
||||
operatorId?: never;
|
||||
} | {
|
||||
operator?: never;
|
||||
operatorId?: ForeignKey<"operator"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
operator?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type OperIdSubQuery = Selection<OperIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<AppendOnlyAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { appendOnlyActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
action: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
}
|
||||
},
|
||||
data: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
filter: {
|
||||
type: "object"
|
||||
},
|
||||
extra: {
|
||||
type: "object"
|
||||
},
|
||||
operatorId: {
|
||||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
targetEntity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "appendOnly",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"操作","attr":{"action":"动作","data":"数据","filter":"选择条件","extra":"其它","operator":"操作者","targetEntity":"关联对象"}}
|
||||
|
|
@ -0,0 +1,342 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape, Configuration } from "oak-domain/lib/types/Entity";
|
||||
import { LocaleDef } from "oak-domain/lib/types/Locale";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Oper from "../Oper/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
||||
import * as UserSystem from "../UserSystem/Schema";
|
||||
import * as UserWechatPublicTag from "../UserWechatPublicTag/Schema";
|
||||
import * as WechatLogin from "../WechatLogin/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
operId: ForeignKey<"oper">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatPublicTag" | "wechatQrCode" | "wechatUser" | string;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
operId: ForeignKey<"oper">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatPublicTag" | "wechatQrCode" | "wechatUser" | string;
|
||||
entityId: String<64>;
|
||||
oper: Oper.Schema;
|
||||
user?: User.Schema;
|
||||
userEntityGrant?: UserEntityGrant.Schema;
|
||||
userSystem?: UserSystem.Schema;
|
||||
userWechatPublicTag?: UserWechatPublicTag.Schema;
|
||||
wechatLogin?: WechatLogin.Schema;
|
||||
wechatPublicTag?: WechatPublicTag.Schema;
|
||||
wechatQrCode?: WechatQrCode.Schema;
|
||||
wechatUser?: WechatUser.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
operId: Q_StringValue;
|
||||
oper: Oper.Filter;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatPublicTag" | "wechatQrCode" | "wechatUser" | string>;
|
||||
entityId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
userEntityGrant: UserEntityGrant.Filter;
|
||||
userSystem: UserSystem.Filter;
|
||||
userWechatPublicTag: UserWechatPublicTag.Filter;
|
||||
wechatLogin: WechatLogin.Filter;
|
||||
wechatPublicTag: WechatPublicTag.Filter;
|
||||
wechatQrCode: WechatQrCode.Filter;
|
||||
wechatUser: WechatUser.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
operId?: number;
|
||||
oper?: Oper.Projection;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
user?: User.Projection;
|
||||
userEntityGrant?: UserEntityGrant.Projection;
|
||||
userSystem?: UserSystem.Projection;
|
||||
userWechatPublicTag?: UserWechatPublicTag.Projection;
|
||||
wechatLogin?: WechatLogin.Projection;
|
||||
wechatPublicTag?: WechatPublicTag.Projection;
|
||||
wechatQrCode?: WechatQrCode.Projection;
|
||||
wechatUser?: WechatUser.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type OperEntityIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type OperIdProjection = OneOf<{
|
||||
operId: number;
|
||||
}>;
|
||||
type UserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type UserEntityGrantIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type UserSystemIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type UserWechatPublicTagIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatLoginIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatPublicTagIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatQrCodeIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatUserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
operId: number;
|
||||
} | {
|
||||
oper: Oper.SortAttr;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
userEntityGrant: UserEntityGrant.SortAttr;
|
||||
} | {
|
||||
userSystem: UserSystem.SortAttr;
|
||||
} | {
|
||||
userWechatPublicTag: UserWechatPublicTag.SortAttr;
|
||||
} | {
|
||||
wechatLogin: WechatLogin.SortAttr;
|
||||
} | {
|
||||
wechatPublicTag: WechatPublicTag.SortAttr;
|
||||
} | {
|
||||
wechatQrCode: WechatQrCode.SortAttr;
|
||||
} | {
|
||||
wechatUser: WechatUser.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
|
||||
operId?: never;
|
||||
oper: Oper.CreateSingleOperation;
|
||||
} | {
|
||||
operId: ForeignKey<"oper">;
|
||||
})) & ({
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "user";
|
||||
entityId: ForeignKey<"User">;
|
||||
user: User.UpdateOperation;
|
||||
} | {
|
||||
entity: "user";
|
||||
entityId: ForeignKey<"User">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
userEntityGrant: UserEntityGrant.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "userEntityGrant";
|
||||
entityId: ForeignKey<"UserEntityGrant">;
|
||||
userEntityGrant: UserEntityGrant.UpdateOperation;
|
||||
} | {
|
||||
entity: "userEntityGrant";
|
||||
entityId: ForeignKey<"UserEntityGrant">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
userSystem: UserSystem.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "userSystem";
|
||||
entityId: ForeignKey<"UserSystem">;
|
||||
userSystem: UserSystem.UpdateOperation;
|
||||
} | {
|
||||
entity: "userSystem";
|
||||
entityId: ForeignKey<"UserSystem">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
userWechatPublicTag: UserWechatPublicTag.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "userWechatPublicTag";
|
||||
entityId: ForeignKey<"UserWechatPublicTag">;
|
||||
userWechatPublicTag: UserWechatPublicTag.UpdateOperation;
|
||||
} | {
|
||||
entity: "userWechatPublicTag";
|
||||
entityId: ForeignKey<"UserWechatPublicTag">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatLogin: WechatLogin.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatLogin";
|
||||
entityId: ForeignKey<"WechatLogin">;
|
||||
wechatLogin: WechatLogin.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatLogin";
|
||||
entityId: ForeignKey<"WechatLogin">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicTag: WechatPublicTag.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicTag";
|
||||
entityId: ForeignKey<"WechatPublicTag">;
|
||||
wechatPublicTag: WechatPublicTag.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicTag";
|
||||
entityId: ForeignKey<"WechatPublicTag">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatQrCode: WechatQrCode.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatQrCode";
|
||||
entityId: ForeignKey<"WechatQrCode">;
|
||||
wechatQrCode: WechatQrCode.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatQrCode";
|
||||
entityId: ForeignKey<"WechatQrCode">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatUser: WechatUser.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatUser";
|
||||
entityId: ForeignKey<"WechatUser">;
|
||||
wechatUser: WechatUser.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatUser";
|
||||
entityId: ForeignKey<"WechatUser">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
});
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
|
||||
oper: Oper.CreateSingleOperation;
|
||||
operId?: never;
|
||||
} | {
|
||||
oper?: never;
|
||||
operId?: ForeignKey<"oper"> | null;
|
||||
})) & ({
|
||||
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
userEntityGrant?: UserEntityGrant.CreateSingleOperation | UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
userSystem?: UserSystem.CreateSingleOperation | UserSystem.UpdateOperation | UserSystem.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
userWechatPublicTag?: UserWechatPublicTag.CreateSingleOperation | UserWechatPublicTag.UpdateOperation | UserWechatPublicTag.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatLogin?: WechatLogin.CreateSingleOperation | WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.CreateSingleOperation | WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatQrCode?: WechatQrCode.CreateSingleOperation | WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatUser?: WechatUser.CreateSingleOperation | WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatPublicTag" | "wechatQrCode" | "wechatUser" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatPublicTag" | "WechatQrCode" | "WechatUser"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & ({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
} | {
|
||||
userEntityGrant?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
|
||||
} | {
|
||||
userSystem?: UserSystem.UpdateOperation | UserSystem.RemoveOperation;
|
||||
} | {
|
||||
userWechatPublicTag?: UserWechatPublicTag.UpdateOperation | UserWechatPublicTag.RemoveOperation;
|
||||
} | {
|
||||
wechatLogin?: WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
} | {
|
||||
wechatQrCode?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation;
|
||||
} | {
|
||||
wechatUser?: WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type OperIdSubQuery = Selection<OperIdProjection>;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
|
||||
export type UserSystemIdSubQuery = Selection<UserSystemIdProjection>;
|
||||
export type UserWechatPublicTagIdSubQuery = Selection<UserWechatPublicTagIdProjection>;
|
||||
export type WechatLoginIdSubQuery = Selection<WechatLoginIdProjection>;
|
||||
export type WechatPublicTagIdSubQuery = Selection<WechatPublicTagIdProjection>;
|
||||
export type WechatQrCodeIdSubQuery = Selection<WechatQrCodeIdProjection>;
|
||||
export type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
|
||||
export type OperEntityIdSubQuery = Selection<OperEntityIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<AppendOnlyAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { appendOnlyActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
operId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "oper"
|
||||
},
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatPublicTag", "wechatQrCode", "wechatUser"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "appendOnly",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"操作对象连接","attr":{"oper":"操作","entity":"关联对象","entityId":"关联对象id"}}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
export type IAction = 'wakeup' | 'cancel' | 'qrcode' | string;
|
||||
export type ParticularAction = IAction;
|
||||
export type Action = GenericAction | ParticularAction | string;
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "wakeup", "cancel", "qrcode"];
|
||||
export const ActionDefDict = {};
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction } from "./Action";
|
||||
import { RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Datetime, Image, Boolean, Text, } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { LocaleDef } from "oak-domain/lib/types/Locale";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
type RedirectTo = {
|
||||
pathname: string;
|
||||
props?: Record<string, any>;
|
||||
state?: Record<string, any>;
|
||||
};
|
||||
export type OpSchema = EntityShape & {
|
||||
userId: ForeignKey<"user">;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
showTip?: Boolean | null;
|
||||
expiresAt: Datetime;
|
||||
expired: Boolean;
|
||||
redirectTo: RedirectTo;
|
||||
multiple?: Boolean | null;
|
||||
tokenLifeLength?: Int<4> | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
userId: ForeignKey<"user">;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
showTip?: Boolean | null;
|
||||
expiresAt: Datetime;
|
||||
expired: Boolean;
|
||||
redirectTo: RedirectTo;
|
||||
multiple?: Boolean | null;
|
||||
tokenLifeLength?: Int<4> | null;
|
||||
user: User.Schema;
|
||||
token$entity?: Array<Token.Schema>;
|
||||
token$entity$$aggr?: AggregationResult<Token.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
userId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
showTip: Q_BooleanValue;
|
||||
expiresAt: Q_DateValue;
|
||||
expired: Q_BooleanValue;
|
||||
redirectTo: JsonFilter<RedirectTo>;
|
||||
multiple: Q_BooleanValue;
|
||||
tokenLifeLength: Q_NumberValue;
|
||||
token$entity: Token.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
userId?: number;
|
||||
user?: User.Projection;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
showTip?: number;
|
||||
expiresAt?: number;
|
||||
expired?: number;
|
||||
redirectTo?: number | JsonProjection<RedirectTo>;
|
||||
multiple?: number;
|
||||
tokenLifeLength?: number;
|
||||
token$entity?: Token.Selection & {
|
||||
$entity: "token";
|
||||
};
|
||||
token$entity$$aggr?: Token.Aggregation & {
|
||||
$entity: "token";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ParasiteIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
userId: number;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
showTip: number;
|
||||
} | {
|
||||
expiresAt: number;
|
||||
} | {
|
||||
expired: number;
|
||||
} | {
|
||||
redirectTo: number;
|
||||
} | {
|
||||
multiple: number;
|
||||
} | {
|
||||
tokenLifeLength: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "userId">> & (({
|
||||
userId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
})) & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
}) & {
|
||||
token$entity?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
token$entity?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type ParasiteIdSubQuery = Selection<ParasiteIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<Action> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
ParticularAction: ParticularAction;
|
||||
};
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { actions } from "./Action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
userId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
showTip: {
|
||||
type: "boolean"
|
||||
},
|
||||
expiresAt: {
|
||||
notNull: true,
|
||||
type: "datetime"
|
||||
},
|
||||
expired: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
},
|
||||
redirectTo: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
multiple: {
|
||||
type: "boolean"
|
||||
},
|
||||
tokenLifeLength: {
|
||||
type: "int",
|
||||
params: {
|
||||
width: 4,
|
||||
signed: true
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"寄生","attr":{"user":"用户","showTip":"提示","expired":"已过期","expiresAt":"过期时间","redirectTo":"重定向页面","multiple":"允许反复使用","tokens":"令牌","entity":"关联对象","entityId":"关联对象Id","tokenLifeLength":"令牌生命长度"},"action":{"wakeup":"激活","cancel":"作废","qrcode":"采集码"}}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Int, Datetime, Image, Boolean, Text } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { Config } from "../../types/Config";
|
||||
import { Style } from "../../types/Style";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as System from "../System/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
config: Config;
|
||||
style?: Style | null;
|
||||
entity?: String<32> | null;
|
||||
entityId?: String<64> | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
config: Config;
|
||||
style?: Style | null;
|
||||
entity?: String<32> | null;
|
||||
entityId?: String<64> | null;
|
||||
system$platform?: Array<System.Schema>;
|
||||
system$platform$$aggr?: AggregationResult<System.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
name: Q_StringValue;
|
||||
description: Q_StringValue;
|
||||
config: JsonFilter<Config>;
|
||||
style: JsonFilter<Style>;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
system$platform: System.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
description?: number;
|
||||
config?: number | JsonProjection<Config>;
|
||||
style?: number | JsonProjection<Style>;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
system$platform?: System.Selection & {
|
||||
$entity: "system";
|
||||
};
|
||||
system$platform$$aggr?: System.Aggregation & {
|
||||
$entity: "system";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type PlatformIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
description: number;
|
||||
} | {
|
||||
config: number;
|
||||
} | {
|
||||
style: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
}) & {
|
||||
system$platform?: OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">> | OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">[]> | Array<OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">> | OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
system$platform?: OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">> | OakOperation<System.RemoveOperation["action"], Omit<System.RemoveOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">> | OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">[]> | Array<OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">> | OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">> | OakOperation<System.RemoveOperation["action"], Omit<System.RemoveOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type PlatformIdSubQuery = Selection<PlatformIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
description: {
|
||||
notNull: true,
|
||||
type: "text"
|
||||
},
|
||||
config: {
|
||||
notNull: true,
|
||||
type: "object"
|
||||
},
|
||||
style: {
|
||||
type: "object"
|
||||
},
|
||||
entity: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
entityId: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"平台","attr":{"name":"名称","description":"描述","config":"设置","style":"样式","entity":"关联对象","entityId":"关联对象id"}}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
import { AuthCascadePath, AuthDeduceRelationMap, SelectFreeEntities } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDict } from "./EntityDict";
|
||||
import { CreateOperationData as Relation } from "./Relation/Schema";
|
||||
export const ActionCascadePathGraph: AuthCascadePath<EntityDict>[] = [
|
||||
["email", "user", "email", false],
|
||||
["extraFile", "user", "extraFile", false],
|
||||
["message", "user", "message", false],
|
||||
["messageSystem", "message.user", "message", false],
|
||||
["mobile", "user", "mobile", false],
|
||||
["notification", "messageSystem.message.user", "message", false],
|
||||
["parasite", "user", "parasite", false],
|
||||
["token", "email.user", "email", false],
|
||||
["token", "mobile.user", "mobile", false],
|
||||
["token", "parasite.user", "parasite", false],
|
||||
["token", "user", "token", false],
|
||||
["token", "player", "token", false],
|
||||
["token", "wechatUser.user", "wechatUser", false],
|
||||
["userEntityGrant", "granter", "userEntityGrant", false],
|
||||
["userEntityGrant", "grantee", "userEntityGrant", false],
|
||||
["userSystem", "user", "userSystem", false],
|
||||
["userWechatPublicTag", "user", "userWechatPublicTag", false],
|
||||
["wechatLogin", "user", "wechatLogin", false],
|
||||
["wechatQrCode", "userEntityGrant.granter", "userEntityGrant", false],
|
||||
["wechatQrCode", "userEntityGrant.grantee", "userEntityGrant", false],
|
||||
["wechatQrCode", "wechatLogin.user", "wechatLogin", false],
|
||||
["wechatQrCode", "user", "wechatQrCode", false],
|
||||
["wechatUser", "user", "wechatUser", false]
|
||||
];
|
||||
export const RelationCascadePathGraph: AuthCascadePath<EntityDict>[] = [];
|
||||
export const relations: Relation[] = [];
|
||||
export const deducedRelationMap: AuthDeduceRelationMap<EntityDict> = {};
|
||||
export const selectFreeEntities: SelectFreeEntities<EntityDict> = [];
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as ActionAuth from "../ActionAuth/Schema";
|
||||
import * as RelationAuth from "../RelationAuth/Schema";
|
||||
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
||||
import * as UserRelation from "../UserRelation/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entityId?: String<64> | null;
|
||||
name?: String<32> | null;
|
||||
display?: String<32> | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entityId?: String<64> | null;
|
||||
name?: String<32> | null;
|
||||
display?: String<32> | null;
|
||||
actionAuth$relation?: Array<ActionAuth.Schema>;
|
||||
actionAuth$relation$$aggr?: AggregationResult<ActionAuth.Schema>;
|
||||
relationAuth$sourceRelation?: Array<RelationAuth.Schema>;
|
||||
relationAuth$sourceRelation$$aggr?: AggregationResult<RelationAuth.Schema>;
|
||||
relationAuth$destRelation?: Array<RelationAuth.Schema>;
|
||||
relationAuth$destRelation$$aggr?: AggregationResult<RelationAuth.Schema>;
|
||||
userEntityGrant$relation?: Array<UserEntityGrant.Schema>;
|
||||
userEntityGrant$relation$$aggr?: AggregationResult<UserEntityGrant.Schema>;
|
||||
userRelation$relation?: Array<UserRelation.Schema>;
|
||||
userRelation$relation$$aggr?: AggregationResult<UserRelation.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
name: Q_StringValue;
|
||||
display: Q_StringValue;
|
||||
actionAuth$relation: ActionAuth.Filter & SubQueryPredicateMetadata;
|
||||
relationAuth$sourceRelation: RelationAuth.Filter & SubQueryPredicateMetadata;
|
||||
relationAuth$destRelation: RelationAuth.Filter & SubQueryPredicateMetadata;
|
||||
userEntityGrant$relation: UserEntityGrant.Filter & SubQueryPredicateMetadata;
|
||||
userRelation$relation: UserRelation.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
name?: number;
|
||||
display?: number;
|
||||
actionAuth$relation?: ActionAuth.Selection & {
|
||||
$entity: "actionAuth";
|
||||
};
|
||||
actionAuth$relation$$aggr?: ActionAuth.Aggregation & {
|
||||
$entity: "actionAuth";
|
||||
};
|
||||
relationAuth$sourceRelation?: RelationAuth.Selection & {
|
||||
$entity: "relationAuth";
|
||||
};
|
||||
relationAuth$sourceRelation$$aggr?: RelationAuth.Aggregation & {
|
||||
$entity: "relationAuth";
|
||||
};
|
||||
relationAuth$destRelation?: RelationAuth.Selection & {
|
||||
$entity: "relationAuth";
|
||||
};
|
||||
relationAuth$destRelation$$aggr?: RelationAuth.Aggregation & {
|
||||
$entity: "relationAuth";
|
||||
};
|
||||
userEntityGrant$relation?: UserEntityGrant.Selection & {
|
||||
$entity: "userEntityGrant";
|
||||
};
|
||||
userEntityGrant$relation$$aggr?: UserEntityGrant.Aggregation & {
|
||||
$entity: "userEntityGrant";
|
||||
};
|
||||
userRelation$relation?: UserRelation.Selection & {
|
||||
$entity: "userRelation";
|
||||
};
|
||||
userRelation$relation$$aggr?: UserRelation.Aggregation & {
|
||||
$entity: "userRelation";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type RelationIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
display: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
}) & {
|
||||
actionAuth$relation?: OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">> | OakOperation<"create", Omit<ActionAuth.CreateOperationData, "relation" | "relationId">[]> | Array<OakOperation<"create", Omit<ActionAuth.CreateOperationData, "relation" | "relationId">> | OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">>>;
|
||||
relationAuth$sourceRelation?: OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">> | OakOperation<"create", Omit<RelationAuth.CreateOperationData, "sourceRelation" | "sourceRelationId">[]> | Array<OakOperation<"create", Omit<RelationAuth.CreateOperationData, "sourceRelation" | "sourceRelationId">> | OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">>>;
|
||||
relationAuth$destRelation?: OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "destRelation" | "destRelationId">, Omit<RelationAuth.Filter, "destRelation" | "destRelationId">> | OakOperation<"create", Omit<RelationAuth.CreateOperationData, "destRelation" | "destRelationId">[]> | Array<OakOperation<"create", Omit<RelationAuth.CreateOperationData, "destRelation" | "destRelationId">> | OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "destRelation" | "destRelationId">, Omit<RelationAuth.Filter, "destRelation" | "destRelationId">>>;
|
||||
userEntityGrant$relation?: OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "relation" | "relationId">, Omit<UserEntityGrant.Filter, "relation" | "relationId">> | OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "relation" | "relationId">[]> | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "relation" | "relationId">> | OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "relation" | "relationId">, Omit<UserEntityGrant.Filter, "relation" | "relationId">>>;
|
||||
userRelation$relation?: OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">> | OakOperation<"create", Omit<UserRelation.CreateOperationData, "relation" | "relationId">[]> | Array<OakOperation<"create", Omit<UserRelation.CreateOperationData, "relation" | "relationId">> | OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
actionAuth$relation?: OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">> | OakOperation<ActionAuth.RemoveOperation["action"], Omit<ActionAuth.RemoveOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">> | OakOperation<"create", Omit<ActionAuth.CreateOperationData, "relation" | "relationId">[]> | Array<OakOperation<"create", Omit<ActionAuth.CreateOperationData, "relation" | "relationId">> | OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">> | OakOperation<ActionAuth.RemoveOperation["action"], Omit<ActionAuth.RemoveOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">>>;
|
||||
relationAuth$sourceRelation?: OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">> | OakOperation<RelationAuth.RemoveOperation["action"], Omit<RelationAuth.RemoveOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">> | OakOperation<"create", Omit<RelationAuth.CreateOperationData, "sourceRelation" | "sourceRelationId">[]> | Array<OakOperation<"create", Omit<RelationAuth.CreateOperationData, "sourceRelation" | "sourceRelationId">> | OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">> | OakOperation<RelationAuth.RemoveOperation["action"], Omit<RelationAuth.RemoveOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">>>;
|
||||
relationAuth$destRelation?: OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "destRelation" | "destRelationId">, Omit<RelationAuth.Filter, "destRelation" | "destRelationId">> | OakOperation<RelationAuth.RemoveOperation["action"], Omit<RelationAuth.RemoveOperationData, "destRelation" | "destRelationId">, Omit<RelationAuth.Filter, "destRelation" | "destRelationId">> | OakOperation<"create", Omit<RelationAuth.CreateOperationData, "destRelation" | "destRelationId">[]> | Array<OakOperation<"create", Omit<RelationAuth.CreateOperationData, "destRelation" | "destRelationId">> | OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "destRelation" | "destRelationId">, Omit<RelationAuth.Filter, "destRelation" | "destRelationId">> | OakOperation<RelationAuth.RemoveOperation["action"], Omit<RelationAuth.RemoveOperationData, "destRelation" | "destRelationId">, Omit<RelationAuth.Filter, "destRelation" | "destRelationId">>>;
|
||||
userEntityGrant$relation?: OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "relation" | "relationId">, Omit<UserEntityGrant.Filter, "relation" | "relationId">> | OakOperation<UserEntityGrant.RemoveOperation["action"], Omit<UserEntityGrant.RemoveOperationData, "relation" | "relationId">, Omit<UserEntityGrant.Filter, "relation" | "relationId">> | OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "relation" | "relationId">[]> | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "relation" | "relationId">> | OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "relation" | "relationId">, Omit<UserEntityGrant.Filter, "relation" | "relationId">> | OakOperation<UserEntityGrant.RemoveOperation["action"], Omit<UserEntityGrant.RemoveOperationData, "relation" | "relationId">, Omit<UserEntityGrant.Filter, "relation" | "relationId">>>;
|
||||
userRelation$relation?: OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">> | OakOperation<UserRelation.RemoveOperation["action"], Omit<UserRelation.RemoveOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">> | OakOperation<"create", Omit<UserRelation.CreateOperationData, "relation" | "relationId">[]> | Array<OakOperation<"create", Omit<UserRelation.CreateOperationData, "relation" | "relationId">> | OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">> | OakOperation<UserRelation.RemoveOperation["action"], Omit<UserRelation.RemoveOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type RelationIdSubQuery = Selection<RelationIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
entityId: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
name: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
display: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_targetEntity_entityId_name',
|
||||
attributes: [
|
||||
{
|
||||
name: 'entity'
|
||||
},
|
||||
{
|
||||
name: 'entityId'
|
||||
},
|
||||
{
|
||||
name: 'name'
|
||||
}
|
||||
],
|
||||
config: {
|
||||
unique: true
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"用户授权","attr":{"name":"关系","entity":"目标对象","entityId":"目标对象id","display":"显示值"}}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Relation from "../Relation/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
sourceRelationId: ForeignKey<"relation">;
|
||||
path: String<256>;
|
||||
destRelationId: ForeignKey<"relation">;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
sourceRelationId: ForeignKey<"relation">;
|
||||
path: String<256>;
|
||||
destRelationId: ForeignKey<"relation">;
|
||||
sourceRelation: Relation.Schema;
|
||||
destRelation: Relation.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
sourceRelationId: Q_StringValue;
|
||||
sourceRelation: Relation.Filter;
|
||||
path: Q_StringValue;
|
||||
destRelationId: Q_StringValue;
|
||||
destRelation: Relation.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
sourceRelationId?: number;
|
||||
sourceRelation?: Relation.Projection;
|
||||
path?: number;
|
||||
destRelationId?: number;
|
||||
destRelation?: Relation.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type RelationAuthIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type RelationIdProjection = OneOf<{
|
||||
sourceRelationId: number;
|
||||
destRelationId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
sourceRelationId: number;
|
||||
} | {
|
||||
sourceRelation: Relation.SortAttr;
|
||||
} | {
|
||||
path: number;
|
||||
} | {
|
||||
destRelationId: number;
|
||||
} | {
|
||||
destRelation: Relation.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "sourceRelationId" | "destRelationId">> & (({
|
||||
sourceRelationId?: never;
|
||||
sourceRelation: Relation.CreateSingleOperation;
|
||||
} | {
|
||||
sourceRelationId: ForeignKey<"sourceRelation">;
|
||||
sourceRelation?: Relation.UpdateOperation;
|
||||
} | {
|
||||
sourceRelationId: ForeignKey<"sourceRelation">;
|
||||
}) & ({
|
||||
destRelationId?: never;
|
||||
destRelation: Relation.CreateSingleOperation;
|
||||
} | {
|
||||
destRelationId: ForeignKey<"destRelation">;
|
||||
destRelation?: Relation.UpdateOperation;
|
||||
} | {
|
||||
destRelationId: ForeignKey<"destRelation">;
|
||||
}));
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "sourceRelationId" | "destRelationId">> & (({
|
||||
sourceRelation: Relation.CreateSingleOperation;
|
||||
sourceRelationId?: never;
|
||||
} | {
|
||||
sourceRelation: Relation.UpdateOperation;
|
||||
sourceRelationId?: never;
|
||||
} | {
|
||||
sourceRelation: Relation.RemoveOperation;
|
||||
sourceRelationId?: never;
|
||||
} | {
|
||||
sourceRelation?: never;
|
||||
sourceRelationId?: ForeignKey<"sourceRelation"> | null;
|
||||
}) & ({
|
||||
destRelation: Relation.CreateSingleOperation;
|
||||
destRelationId?: never;
|
||||
} | {
|
||||
destRelation: Relation.UpdateOperation;
|
||||
destRelationId?: never;
|
||||
} | {
|
||||
destRelation: Relation.RemoveOperation;
|
||||
destRelationId?: never;
|
||||
} | {
|
||||
destRelation?: never;
|
||||
destRelationId?: ForeignKey<"destRelation"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
sourceRelation?: Relation.UpdateOperation | Relation.RemoveOperation;
|
||||
}) & ({
|
||||
destRelation?: Relation.UpdateOperation | Relation.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type RelationIdSubQuery = Selection<RelationIdProjection>;
|
||||
export type RelationAuthIdSubQuery = Selection<RelationAuthIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
sourceRelationId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "relation"
|
||||
},
|
||||
path: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 256
|
||||
}
|
||||
},
|
||||
destRelationId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "relation"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_entity_relation_path',
|
||||
attributes: [
|
||||
{
|
||||
name: "sourceRelationId"
|
||||
},
|
||||
{
|
||||
name: 'path'
|
||||
},
|
||||
{
|
||||
name: "destRelationId"
|
||||
},
|
||||
],
|
||||
config: {
|
||||
unique: true
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"用户授权","attr":{"sourceRelation":"源关系","path":"路径","destRelation":"目标关系"}}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
import * as Area from "../Area/Schema";
|
||||
import * as SubwayStation from "../SubwayStation/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
areaId: ForeignKey<"area">;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
name: String<32>;
|
||||
areaId: ForeignKey<"area">;
|
||||
area: Area.Schema;
|
||||
subwayStation$station?: Array<SubwayStation.Schema>;
|
||||
subwayStation$station$$aggr?: AggregationResult<SubwayStation.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
name: Q_StringValue;
|
||||
areaId: Q_StringValue;
|
||||
area: Area.Filter;
|
||||
subwayStation$station: SubwayStation.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
areaId?: number;
|
||||
area?: Area.Projection;
|
||||
subwayStation$station?: SubwayStation.Selection & {
|
||||
$entity: "subwayStation";
|
||||
};
|
||||
subwayStation$station$$aggr?: SubwayStation.Aggregation & {
|
||||
$entity: "subwayStation";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type StationIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type AreaIdProjection = OneOf<{
|
||||
areaId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
areaId: number;
|
||||
} | {
|
||||
area: Area.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "areaId">> & ({
|
||||
areaId: ForeignKey<"area">;
|
||||
}) & {
|
||||
subwayStation$station?: OakOperation<SubwayStation.UpdateOperation["action"], Omit<SubwayStation.UpdateOperationData, "station" | "stationId">, Omit<SubwayStation.Filter, "station" | "stationId">> | OakOperation<"create", Omit<SubwayStation.CreateOperationData, "station" | "stationId">[]> | Array<OakOperation<"create", Omit<SubwayStation.CreateOperationData, "station" | "stationId">> | OakOperation<SubwayStation.UpdateOperation["action"], Omit<SubwayStation.UpdateOperationData, "station" | "stationId">, Omit<SubwayStation.Filter, "station" | "stationId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "areaId">> & ({
|
||||
area?: never;
|
||||
areaId?: ForeignKey<"area"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
subwayStation$station?: OakOperation<SubwayStation.UpdateOperation["action"], Omit<SubwayStation.UpdateOperationData, "station" | "stationId">, Omit<SubwayStation.Filter, "station" | "stationId">> | OakOperation<SubwayStation.RemoveOperation["action"], Omit<SubwayStation.RemoveOperationData, "station" | "stationId">, Omit<SubwayStation.Filter, "station" | "stationId">> | OakOperation<"create", Omit<SubwayStation.CreateOperationData, "station" | "stationId">[]> | Array<OakOperation<"create", Omit<SubwayStation.CreateOperationData, "station" | "stationId">> | OakOperation<SubwayStation.UpdateOperation["action"], Omit<SubwayStation.UpdateOperationData, "station" | "stationId">, Omit<SubwayStation.Filter, "station" | "stationId">> | OakOperation<SubwayStation.RemoveOperation["action"], Omit<SubwayStation.RemoveOperationData, "station" | "stationId">, Omit<SubwayStation.Filter, "station" | "stationId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type AreaIdSubQuery = Selection<AreaIdProjection>;
|
||||
export type StationIdSubQuery = Selection<StationIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc: StorageDesc<OpSchema> = {
|
||||
attributes: {
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
areaId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "area"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"name":"站点","attr":{"name":"站点名","area":"城市"}}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
import { StorageSchema } from "oak-domain/lib/types/Storage";
|
||||
import { EntityDict } from "./EntityDict";
|
||||
import { desc as actionAuthDesc } from "./ActionAuth/Storage";
|
||||
import { desc as i18nDesc } from "./I18n/Storage";
|
||||
import { desc as modiDesc } from "./Modi/Storage";
|
||||
import { desc as modiEntityDesc } from "./ModiEntity/Storage";
|
||||
import { desc as operDesc } from "./Oper/Storage";
|
||||
import { desc as operEntityDesc } from "./OperEntity/Storage";
|
||||
import { desc as relationDesc } from "./Relation/Storage";
|
||||
import { desc as relationAuthDesc } from "./RelationAuth/Storage";
|
||||
import { desc as userDesc } from "./User/Storage";
|
||||
import { desc as userEntityGrantDesc } from "./UserEntityGrant/Storage";
|
||||
import { desc as userRelationDesc } from "./UserRelation/Storage";
|
||||
import { desc as addressDesc } from "./Address/Storage";
|
||||
import { desc as applicationDesc } from "./Application/Storage";
|
||||
import { desc as areaDesc } from "./Area/Storage";
|
||||
import { desc as articleDesc } from "./Article/Storage";
|
||||
import { desc as articleMenuDesc } from "./ArticleMenu/Storage";
|
||||
import { desc as captchaDesc } from "./Captcha/Storage";
|
||||
import { desc as domainDesc } from "./Domain/Storage";
|
||||
import { desc as emailDesc } from "./Email/Storage";
|
||||
import { desc as extraFileDesc } from "./ExtraFile/Storage";
|
||||
import { desc as livestreamDesc } from "./Livestream/Storage";
|
||||
import { desc as messageDesc } from "./Message/Storage";
|
||||
import { desc as messageSystemDesc } from "./MessageSystem/Storage";
|
||||
import { desc as messageTypeDesc } from "./MessageType/Storage";
|
||||
import { desc as messageTypeTemplateIdDesc } from "./MessageTypeTemplateId/Storage";
|
||||
import { desc as mobileDesc } from "./Mobile/Storage";
|
||||
import { desc as notificationDesc } from "./Notification/Storage";
|
||||
import { desc as parasiteDesc } from "./Parasite/Storage";
|
||||
import { desc as platformDesc } from "./Platform/Storage";
|
||||
import { desc as stationDesc } from "./Station/Storage";
|
||||
import { desc as subscriptionDesc } from "./Subscription/Storage";
|
||||
import { desc as subwayDesc } from "./Subway/Storage";
|
||||
import { desc as subwayStationDesc } from "./SubwayStation/Storage";
|
||||
import { desc as systemDesc } from "./System/Storage";
|
||||
import { desc as tokenDesc } from "./Token/Storage";
|
||||
import { desc as userSystemDesc } from "./UserSystem/Storage";
|
||||
import { desc as userWechatPublicTagDesc } from "./UserWechatPublicTag/Storage";
|
||||
import { desc as wechatLoginDesc } from "./WechatLogin/Storage";
|
||||
import { desc as wechatPublicTagDesc } from "./WechatPublicTag/Storage";
|
||||
import { desc as wechatQrCodeDesc } from "./WechatQrCode/Storage";
|
||||
import { desc as wechatUserDesc } from "./WechatUser/Storage";
|
||||
export const storageSchema: StorageSchema<EntityDict> = {
|
||||
actionAuth: actionAuthDesc,
|
||||
i18n: i18nDesc,
|
||||
modi: modiDesc,
|
||||
modiEntity: modiEntityDesc,
|
||||
oper: operDesc,
|
||||
operEntity: operEntityDesc,
|
||||
relation: relationDesc,
|
||||
relationAuth: relationAuthDesc,
|
||||
user: userDesc,
|
||||
userEntityGrant: userEntityGrantDesc,
|
||||
userRelation: userRelationDesc,
|
||||
address: addressDesc,
|
||||
application: applicationDesc,
|
||||
area: areaDesc,
|
||||
article: articleDesc,
|
||||
articleMenu: articleMenuDesc,
|
||||
captcha: captchaDesc,
|
||||
domain: domainDesc,
|
||||
email: emailDesc,
|
||||
extraFile: extraFileDesc,
|
||||
livestream: livestreamDesc,
|
||||
message: messageDesc,
|
||||
messageSystem: messageSystemDesc,
|
||||
messageType: messageTypeDesc,
|
||||
messageTypeTemplateId: messageTypeTemplateIdDesc,
|
||||
mobile: mobileDesc,
|
||||
notification: notificationDesc,
|
||||
parasite: parasiteDesc,
|
||||
platform: platformDesc,
|
||||
station: stationDesc,
|
||||
subscription: subscriptionDesc,
|
||||
subway: subwayDesc,
|
||||
subwayStation: subwayStationDesc,
|
||||
system: systemDesc,
|
||||
token: tokenDesc,
|
||||
userSystem: userSystemDesc,
|
||||
userWechatPublicTag: userWechatPublicTagDesc,
|
||||
wechatLogin: wechatLoginDesc,
|
||||
wechatPublicTag: wechatPublicTagDesc,
|
||||
wechatQrCode: wechatQrCodeDesc,
|
||||
wechatUser: wechatUserDesc
|
||||
};
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
import { PrimaryKey, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, FulltextFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf, ValueOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, AppendOnlyAction, ReadOnlyAction, ExcludeUpdateAction, ExcludeRemoveAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Boolean, Text, Int, } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { EntityDesc } from "oak-domain/lib/types/EntityDesc";
|
||||
export type WechatPublicConfig = {
|
||||
type: 'wechatPublic';
|
||||
appId: string;
|
||||
appSecret: string;
|
||||
};
|
||||
export type OpSchema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
name: String<32>;
|
||||
description?: Text | null;
|
||||
config?: WechatPublicConfig | null;
|
||||
offset?: Int<4> | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
name: String<32>;
|
||||
description?: Text | null;
|
||||
config?: WechatPublicConfig | null;
|
||||
offset?: Int<4> | null;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
name: Q_StringValue;
|
||||
description: Q_StringValue;
|
||||
config: JsonFilter<WechatPublicConfig>;
|
||||
offset: Q_NumberValue;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
name?: number;
|
||||
description?: number;
|
||||
config?: number | JsonProjection<WechatPublicConfig>;
|
||||
offset?: number;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type SubscriptionIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
description: number;
|
||||
} | {
|
||||
config: number;
|
||||
} | {
|
||||
offset: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
});
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type SubscriptionIdSubQuery = Selection<SubscriptionIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue