图片组件 tsx文件中不用features
This commit is contained in:
parent
f983e43a4e
commit
297405f136
|
|
@ -96,6 +96,15 @@ exports.default = OakComponent({
|
|||
showUploadProgress: false,
|
||||
},
|
||||
methods: {
|
||||
getUrl: function (extraFile) {
|
||||
return this.features.extraFile.getUrl(extraFile);
|
||||
},
|
||||
getFileName: function (extraFile) {
|
||||
return this.features.extraFile.getFileName(extraFile);
|
||||
},
|
||||
eFFormatBytes: function (value) {
|
||||
return this.features.extraFile.formatBytes(value);
|
||||
},
|
||||
/**
|
||||
* 获取组件内部节点位置信息(单个)
|
||||
* @param component 组件实例
|
||||
|
|
|
|||
|
|
@ -27,5 +27,8 @@ export default function render(props: WebComponentProps<EntityDict, "extraFile",
|
|||
}, {
|
||||
onPickByWeb: (files: UploadFile[], callback?: (file: any, status: string) => void) => void;
|
||||
onDeleteByWeb: (file: UploadFile) => void;
|
||||
getUrl: (extraFile: EntityDict['extraFile']['OpSchema']) => string;
|
||||
getFileName: (extraFile: EntityDict['extraFile']['OpSchema']) => string;
|
||||
eFFormatBytes: (value: number) => string;
|
||||
}>): JSX.Element;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ var icons_1 = require("@ant-design/icons");
|
|||
var utils_1 = require("antd/es/upload/utils");
|
||||
var classnames_1 = tslib_1.__importDefault(require("classnames"));
|
||||
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||
var useFeatures_1 = tslib_1.__importDefault(require("../../../hooks/useFeatures"));
|
||||
var react_dnd_1 = require("react-dnd");
|
||||
var react_dnd_html5_backend_1 = require("react-dnd-html5-backend");
|
||||
var react_dnd_touch_backend_1 = require("react-dnd-touch-backend");
|
||||
|
|
@ -56,8 +55,7 @@ var DragableUploadListItem = function (_a) {
|
|||
function render(props) {
|
||||
var _this = this;
|
||||
var _a = props.data, _b = _a.accept, accept = _b === void 0 ? "image/*" : _b, _c = _a.maxNumber, maxNumber = _c === void 0 ? 20 : _c, _d = _a.multiple, multiple = _d === void 0 ? maxNumber !== 1 : _d, _e = _a.draggable, draggable = _e === void 0 ? false : _e, _f = _a.theme, theme = _f === void 0 ? "image" : _f, tips = _a.tips, beforeUpload = _a.beforeUpload, disabled = _a.disabled, style = _a.style, className = _a.className, _g = _a.directory, directory = _g === void 0 ? false : _g, onPreview = _a.onPreview, onDownload = _a.onDownload, children = _a.children, _h = _a.showUploadList, showUploadList = _h === void 0 ? true : _h, files = _a.files, _j = _a.disableInsert, disableInsert = _j === void 0 ? false : _j, _k = _a.disableAdd, disableAdd = _k === void 0 ? false : _k, _l = _a.disableDownload, disableDownload = _l === void 0 ? false : _l, _m = _a.disableDelete, disableDelete = _m === void 0 ? false : _m, _o = _a.preview, preview = _o === void 0 ? true : _o;
|
||||
var _p = props.methods, onPickByWeb = _p.onPickByWeb, onDeleteByWeb = _p.onDeleteByWeb, updateItem = _p.updateItem, t = _p.t;
|
||||
var features = (0, useFeatures_1.default)();
|
||||
var _p = props.methods, onPickByWeb = _p.onPickByWeb, onDeleteByWeb = _p.onDeleteByWeb, updateItem = _p.updateItem, t = _p.t, getFileName = _p.getFileName, getUrl = _p.getUrl, eFFormatBytes = _p.eFFormatBytes;
|
||||
var _q = tslib_1.__read((0, react_1.useState)([]), 2), newFiles = _q[0], setNewFiles = _q[1];
|
||||
var _r = tslib_1.__read((0, react_1.useState)([]), 2), newUploadFiles = _r[0], setNewUploadFiles = _r[1];
|
||||
var listType = getListType(theme);
|
||||
|
|
@ -72,10 +70,10 @@ function render(props) {
|
|||
var extraFileToUploadFile = function (extraFile) {
|
||||
return {
|
||||
id: extraFile.id,
|
||||
url: features.extraFile.getUrl(extraFile),
|
||||
thumbUrl: features.extraFile.getUrl(extraFile),
|
||||
name: features.extraFile.getFileName(extraFile),
|
||||
fileName: features.extraFile.getFileName(extraFile),
|
||||
url: getUrl(extraFile),
|
||||
thumbUrl: getUrl(extraFile),
|
||||
name: getFileName(extraFile),
|
||||
fileName: getFileName(extraFile),
|
||||
size: extraFile.size,
|
||||
type: extraFile.fileType,
|
||||
uid: extraFile.id, //upload 组件需要uid来维护fileList
|
||||
|
|
@ -194,7 +192,7 @@ function render(props) {
|
|||
dataIndex: "size",
|
||||
title: "文件大小",
|
||||
render: function (value, record, index) {
|
||||
return features.extraFile.formatBytes(value);
|
||||
return eFFormatBytes(value);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -255,11 +255,11 @@ var i18ns = [
|
|||
}
|
||||
},
|
||||
{
|
||||
id: "e07ce685f0383e7f7f3ce86501567f28",
|
||||
namespace: "oak-general-business-l-common",
|
||||
id: "7a96eb13e533aeab2eba87643ed834b3",
|
||||
namespace: "oak-general-business-l-Common",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "locales/common",
|
||||
position: "locales/Common",
|
||||
data: {
|
||||
"noData": "暂无数据",
|
||||
"areYouSure": "请确认",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,133 @@
|
|||
import { String, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as Relation from "../Relation/Schema";
|
||||
declare type Actions = string[];
|
||||
declare type Paths = string[];
|
||||
export declare type OpSchema = EntityShape & {
|
||||
relationId?: ForeignKey<"relation"> | null;
|
||||
paths: Paths;
|
||||
destEntity: String<32>;
|
||||
deActions: Actions;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
relationId?: ForeignKey<"relation"> | null;
|
||||
paths: Paths;
|
||||
destEntity: String<32>;
|
||||
deActions: Actions;
|
||||
relation?: Relation.Schema | null;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type ActionAuthIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type RelationIdProjection = OneOf<{
|
||||
relationId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "relationId">> & (({
|
||||
relationId?: never;
|
||||
relation?: Relation.CreateSingleOperation;
|
||||
} | {
|
||||
relationId: String<64>;
|
||||
relation?: Relation.UpdateOperation;
|
||||
} | {
|
||||
relationId?: String<64>;
|
||||
}));
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relationId">> & (({
|
||||
relation: Relation.CreateSingleOperation;
|
||||
relationId?: never;
|
||||
} | {
|
||||
relation: Relation.UpdateOperation;
|
||||
relationId?: never;
|
||||
} | {
|
||||
relation: Relation.RemoveOperation;
|
||||
relationId?: never;
|
||||
} | {
|
||||
relation?: never;
|
||||
relationId?: String<64> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
relation?: Relation.UpdateOperation | Relation.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
|
||||
export declare type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.genericActions,
|
||||
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,31 @@
|
|||
export declare const ActionDefDict: {
|
||||
modi: {
|
||||
iState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
};
|
||||
captcha: {
|
||||
iState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
};
|
||||
email: {
|
||||
ableState: import("oak-domain/lib/types").ActionDef<import("oak-domain/lib/actions/action").AbleAction, import("oak-domain/lib/actions/action").AbleState>;
|
||||
};
|
||||
message: {
|
||||
iState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
visitState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
};
|
||||
mobile: {
|
||||
ableState: import("oak-domain/lib/types").ActionDef<import("oak-domain/lib/actions/action").AbleAction, import("oak-domain/lib/actions/action").AbleState>;
|
||||
};
|
||||
notification: {
|
||||
iState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
};
|
||||
parasite: {};
|
||||
token: {
|
||||
ableState: import("oak-domain/lib/types").ActionDef<import("oak-domain/lib/actions/action").AbleAction, import("oak-domain/lib/actions/action").AbleState>;
|
||||
};
|
||||
user: {
|
||||
idState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
userState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
};
|
||||
userEntityGrant: {};
|
||||
wechatLogin: {};
|
||||
};
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionDefDict = void 0;
|
||||
var Action_1 = require("./Modi/Action");
|
||||
var Action_2 = require("./Captcha/Action");
|
||||
var Action_3 = require("./Email/Action");
|
||||
var Action_4 = require("./Message/Action");
|
||||
var Action_5 = require("./Mobile/Action");
|
||||
var Action_6 = require("./Notification/Action");
|
||||
var Action_7 = require("./Parasite/Action");
|
||||
var Action_8 = require("./Token/Action");
|
||||
var Action_9 = require("./User/Action");
|
||||
var Action_10 = require("./UserEntityGrant/Action");
|
||||
var Action_11 = require("./WechatLogin/Action");
|
||||
exports.ActionDefDict = {
|
||||
modi: Action_1.ActionDefDict,
|
||||
captcha: Action_2.ActionDefDict,
|
||||
email: Action_3.ActionDefDict,
|
||||
message: Action_4.ActionDefDict,
|
||||
mobile: Action_5.ActionDefDict,
|
||||
notification: Action_6.ActionDefDict,
|
||||
parasite: Action_7.ActionDefDict,
|
||||
token: Action_8.ActionDefDict,
|
||||
user: Action_9.ActionDefDict,
|
||||
userEntityGrant: Action_10.ActionDefDict,
|
||||
wechatLogin: Action_11.ActionDefDict
|
||||
};
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
import { String, Boolean, Text, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as Area from "../Area/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
detail: String<32>;
|
||||
areaId: ForeignKey<"area">;
|
||||
phone: String<12>;
|
||||
name: String<32>;
|
||||
default: Boolean;
|
||||
remark: Text;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
detail: String<32>;
|
||||
areaId: ForeignKey<"area">;
|
||||
phone: String<12>;
|
||||
name: String<32>;
|
||||
default: Boolean;
|
||||
remark: Text;
|
||||
area: Area.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
declare type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type AddressIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type AreaIdProjection = OneOf<{
|
||||
areaId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "areaId">> & ({
|
||||
areaId: String<64>;
|
||||
});
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "areaId">> & ({
|
||||
area?: never;
|
||||
areaId?: String<64> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type AreaIdSubQuery = Selection<AreaIdProjection>;
|
||||
export declare type AddressIdSubQuery = Selection<AddressIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "地址", "attr": { "detail": "详细地址", "area": "所在地区", "phone": "联系电话", "name": "姓名", "default": "是否默认", "remark": "备注" } }
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
import { String, Text, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import { Style } from "../../types/Style";
|
||||
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 declare type Passport = 'email' | 'mobile' | 'wechat' | 'wechatPublic';
|
||||
export declare type AppType = 'web' | 'wechatMp' | 'wechatPublic';
|
||||
export declare type WechatMpConfig = {
|
||||
type: 'wechatMp';
|
||||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string;
|
||||
qrCodePrefix?: string;
|
||||
server?: {
|
||||
url?: string;
|
||||
token: string;
|
||||
encodingAESKey: string;
|
||||
mode: 'clear' | 'compatible' | 'safe';
|
||||
dataFormat: 'json' | 'xml';
|
||||
};
|
||||
passport?: Passport[];
|
||||
};
|
||||
export declare type WebConfig = {
|
||||
type: 'web';
|
||||
wechat?: {
|
||||
appId: string;
|
||||
appSecret: string;
|
||||
domain?: string;
|
||||
enable?: boolean;
|
||||
};
|
||||
passport?: Passport[];
|
||||
};
|
||||
export declare type WechatPublicTemplateMsgsConfig = Record<string, string>;
|
||||
export declare type WechatPublicConfig = {
|
||||
type: 'wechatPublic';
|
||||
isService: boolean;
|
||||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string;
|
||||
enable?: boolean;
|
||||
templateMsgs?: WechatPublicTemplateMsgsConfig;
|
||||
server?: {
|
||||
url?: string;
|
||||
token: string;
|
||||
encodingAESKey: string;
|
||||
mode: 'clear' | 'compatible' | 'safe';
|
||||
};
|
||||
wechatMp?: {
|
||||
appId: string;
|
||||
originalId: string;
|
||||
};
|
||||
passport?: Passport[];
|
||||
};
|
||||
export declare type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
type: AppType;
|
||||
systemId: ForeignKey<"system">;
|
||||
config: WebConfig | WechatMpConfig | WechatPublicConfig;
|
||||
style?: Style | null;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type ApplicationIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type SystemIdProjection = OneOf<{
|
||||
systemId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "systemId">> & (({
|
||||
systemId?: never;
|
||||
system: System.CreateSingleOperation;
|
||||
} | {
|
||||
systemId: String<64>;
|
||||
system?: System.UpdateOperation;
|
||||
} | {
|
||||
systemId: String<64>;
|
||||
})) & {
|
||||
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "systemId">> & (({
|
||||
system: System.CreateSingleOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.UpdateOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.RemoveOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId?: String<64> | 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 declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
system?: System.UpdateOperation | System.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "应用", "attr": { "description": "描述", "type": "类型", "system": "系统", "name": "名称", "config": "设置", "style": "样式" }, "v": { "type": { "web": "网站", "wechatPublic": "微信公众号", "wechatMp": "微信小程序" } } }
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
import { String, ForeignKey, Geo } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { ReadOnlyAction } from "oak-domain/lib/actions/action";
|
||||
import * as Address from "../Address/Schema";
|
||||
import * as Station from "../Station/Schema";
|
||||
import * as Subway from "../Subway/Schema";
|
||||
export declare 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 declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type AreaIdProjection = OneOf<{
|
||||
id: number;
|
||||
parentId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "parentId">> & ({
|
||||
parentId?: String<64>;
|
||||
}) & {
|
||||
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "parentId">> & ({
|
||||
parent?: never;
|
||||
parentId?: String<64> | 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 declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type AreaIdSubQuery = Selection<AreaIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.readOnlyActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "地区", "attr": { "level": "层级", "depth": "深度", "parent": "上级地区", "name": "名称", "code": "地区编码", "center": "中心坐标" }, "v": { "level": { "country": "国家", "province": "省", "city": "市", "district": "区", "street": "街道" } } }
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
import { String, Text, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as ArticleMenu from "../ArticleMenu/Schema";
|
||||
import * as ExtraFile from "../ExtraFile/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
content: Text;
|
||||
articleMenuId: ForeignKey<"articleMenu">;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type ArticleIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type ArticleMenuIdProjection = OneOf<{
|
||||
articleMenuId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "articleMenuId">> & (({
|
||||
articleMenuId?: never;
|
||||
articleMenu: ArticleMenu.CreateSingleOperation;
|
||||
} | {
|
||||
articleMenuId: String<64>;
|
||||
articleMenu?: ArticleMenu.UpdateOperation;
|
||||
} | {
|
||||
articleMenuId: String<64>;
|
||||
})) & {
|
||||
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "articleMenuId">> & (({
|
||||
articleMenu: ArticleMenu.CreateSingleOperation;
|
||||
articleMenuId?: never;
|
||||
} | {
|
||||
articleMenu: ArticleMenu.UpdateOperation;
|
||||
articleMenuId?: never;
|
||||
} | {
|
||||
articleMenu: ArticleMenu.RemoveOperation;
|
||||
articleMenuId?: never;
|
||||
} | {
|
||||
articleMenu?: never;
|
||||
articleMenuId?: String<64> | 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 declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
articleMenu?: ArticleMenu.UpdateOperation | ArticleMenu.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type ArticleMenuIdSubQuery = Selection<ArticleMenuIdProjection>;
|
||||
export declare type ArticleIdSubQuery = Selection<ArticleIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
attributes: {
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
content: {
|
||||
notNull: true,
|
||||
type: "text"
|
||||
},
|
||||
articleMenuId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "articleMenu"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "文章", "attr": { "name": "文章标题", "content": "请输入正文内容", "articleMenu": "文章菜单", "files": "文件" } }
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
import { String, Boolean, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as Article from "../Article/Schema";
|
||||
import * as ExtraFile from "../ExtraFile/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
isArticle: Boolean;
|
||||
parentId?: ForeignKey<"articleMenu"> | null;
|
||||
isLeaf: Boolean;
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type ArticleMenuIdProjection = OneOf<{
|
||||
id: number;
|
||||
parentId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "parentId">> & (({
|
||||
parentId?: never;
|
||||
parent?: CreateSingleOperation;
|
||||
} | {
|
||||
parentId: String<64>;
|
||||
parent?: UpdateOperation;
|
||||
} | {
|
||||
parentId?: String<64>;
|
||||
})) & ({
|
||||
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "parentId">> & (({
|
||||
parent: CreateSingleOperation;
|
||||
parentId?: never;
|
||||
} | {
|
||||
parent: UpdateOperation;
|
||||
parentId?: never;
|
||||
} | {
|
||||
parent: RemoveOperation;
|
||||
parentId?: never;
|
||||
} | {
|
||||
parent?: never;
|
||||
parentId?: String<64> | 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 declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
parent?: UpdateOperation | RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type ArticleMenuIdSubQuery = Selection<ArticleMenuIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "文章分类", "attr": { "name": "分类标题", "isArticle": "是否存在文章", "parent": "所属分类", "entity": "对象", "entityId": "对象Id", "isLeaf": "结点下是否存在叶子结点", "files": "图片" } }
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export declare type IState = 'unsent' | 'sending' | 'sent' | 'failure' | string;
|
||||
export declare type IAction = 'send' | 'success' | 'fail' | string;
|
||||
export declare type ParticularAction = IAction;
|
||||
export declare type Action = GenericAction | ParticularAction | string;
|
||||
export declare const actions: string[];
|
||||
export declare const ActionDefDict: {
|
||||
iState: ActionDef<string, string>;
|
||||
};
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionDefDict = exports.actions = void 0;
|
||||
var IActionDef = {
|
||||
stm: {
|
||||
send: ['unsent', 'sending'],
|
||||
success: ['sending', 'sent'],
|
||||
fail: ['sending', 'failure']
|
||||
},
|
||||
is: 'unsent'
|
||||
};
|
||||
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "send", "success", "fail"];
|
||||
exports.ActionDefDict = {
|
||||
iState: IActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
import { String, Boolean, Text, Datetime } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction, IState } from "./Action";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
mobile: String<11>;
|
||||
code: String<4>;
|
||||
visitorId: Text;
|
||||
reason?: Text | null;
|
||||
env: Object;
|
||||
expired: Boolean;
|
||||
expiresAt: Datetime;
|
||||
iState?: IState | null;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type CaptchaIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<OpSchema>;
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type CaptchaIdSubQuery = Selection<CaptchaIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var Action_1 = require("./Action");
|
||||
exports.desc = {
|
||||
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: Action_1.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,137 @@
|
|||
import { String, Int, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as System from "../System/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
url: String<64>;
|
||||
apiPath: String<32>;
|
||||
protocol: 'http' | 'https';
|
||||
port: Int<2>;
|
||||
systemId: ForeignKey<"system">;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type DomainIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type SystemIdProjection = OneOf<{
|
||||
systemId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "systemId">> & (({
|
||||
systemId?: never;
|
||||
system: System.CreateSingleOperation;
|
||||
} | {
|
||||
systemId: String<64>;
|
||||
system?: System.UpdateOperation;
|
||||
} | {
|
||||
systemId: String<64>;
|
||||
}));
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "systemId">> & (({
|
||||
system: System.CreateSingleOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.UpdateOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.RemoveOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId?: String<64> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
system?: System.UpdateOperation | System.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export declare type DomainIdSubQuery = Selection<DomainIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "域名", "attr": { "url": "域名", "apiPath": "api路径", "protocol": "协议", "port": "端口", "system": "系统" }, "v": { "protocol": { "http": "http", "https": "https" } } }
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import { AbleAction, AbleState } from 'oak-domain/lib/actions/action';
|
||||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export declare type ParticularAction = AbleAction;
|
||||
export declare type Action = GenericAction | ParticularAction | string;
|
||||
export declare const actions: string[];
|
||||
export declare const ActionDefDict: {
|
||||
ableState: ActionDef<AbleAction, AbleState>;
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionDefDict = exports.actions = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "enable", "disable"];
|
||||
var AbleActionDef = (0, action_1.makeAbleActionDef)('enabled');
|
||||
exports.ActionDefDict = {
|
||||
ableState: AbleActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
import { String, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { AbleState } from 'oak-domain/lib/actions/action';
|
||||
import { Action, ParticularAction } from "./Action";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
email: String<16>;
|
||||
userId: ForeignKey<"user">;
|
||||
ableState?: AbleState | null;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type EmailIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "userId">> & (({
|
||||
userId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: String<64>;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId: String<64>;
|
||||
})) & {
|
||||
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: String<64> | 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 declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type EmailIdSubQuery = Selection<EmailIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var Action_1 = require("./Action");
|
||||
exports.desc = {
|
||||
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: Action_1.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,82 @@
|
|||
import { EntityDef as ActionAuth } from "./ActionAuth/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 declare type EntityDict = {
|
||||
actionAuth: ActionAuth;
|
||||
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,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,261 @@
|
|||
import { String, Int, Float, Boolean, Text } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as Article from "../Article/Schema";
|
||||
import * as ArticleMenu from "../ArticleMenu/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
export declare 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 declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type ExtraFileIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type ArticleIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
declare type ArticleMenuIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
declare type UserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
article: Article.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "article";
|
||||
entityId: String<64>;
|
||||
article: Article.UpdateOperation;
|
||||
} | {
|
||||
entity: "article";
|
||||
entityId: String<64>;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
articleMenu: ArticleMenu.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "articleMenu";
|
||||
entityId: String<64>;
|
||||
articleMenu: ArticleMenu.UpdateOperation;
|
||||
} | {
|
||||
entity: "articleMenu";
|
||||
entityId: String<64>;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "user";
|
||||
entityId: String<64>;
|
||||
user: User.UpdateOperation;
|
||||
} | {
|
||||
entity: "user";
|
||||
entityId: String<64>;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
});
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "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?: String<64> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & ({
|
||||
article?: Article.UpdateOperation | Article.RemoveOperation;
|
||||
} | {
|
||||
articleMenu?: ArticleMenu.UpdateOperation | ArticleMenu.RemoveOperation;
|
||||
} | {
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type ArticleIdSubQuery = Selection<ArticleIdProjection>;
|
||||
export declare type ArticleMenuIdSubQuery = Selection<ArticleMenuIdProjection>;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type ExtraFileIdSubQuery = Selection<ExtraFileIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.genericActions
|
||||
};
|
||||
|
|
@ -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,145 @@
|
|||
import { String, Datetime } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export declare 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 declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type LivestreamIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
});
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type LivestreamIdSubQuery = Selection<LivestreamIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.genericActions
|
||||
};
|
||||
|
|
@ -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,13 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export declare type IAction = 'succeed' | 'fail' | string;
|
||||
export declare type IState = 'sending' | 'success' | 'failure' | string;
|
||||
export declare type VisitState = 'unvisited' | 'visited' | string;
|
||||
export declare type VisitAction = 'visit' | string;
|
||||
export declare type ParticularAction = IAction | VisitAction;
|
||||
export declare type Action = GenericAction | ParticularAction | string;
|
||||
export declare const actions: string[];
|
||||
export declare const ActionDefDict: {
|
||||
iState: ActionDef<string, string>;
|
||||
visitState: ActionDef<string, string>;
|
||||
};
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionDefDict = exports.actions = void 0;
|
||||
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "succeed", "fail", "visit"];
|
||||
var IActionDef = {
|
||||
stm: {
|
||||
succeed: ['sending', 'success'],
|
||||
fail: ['sending', 'failure']
|
||||
}
|
||||
};
|
||||
var VisitActionDef = {
|
||||
stm: {
|
||||
visit: ['unvisited', 'visited']
|
||||
},
|
||||
is: 'unvisited'
|
||||
};
|
||||
exports.ActionDefDict = {
|
||||
iState: IActionDef,
|
||||
visitState: VisitActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
import { String, Text, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction, IState, VisitState } from "./Action";
|
||||
import { Channel, Weight } from "../../types/Message";
|
||||
import * as User from "../User/Schema";
|
||||
import * as MessageSystem from "../MessageSystem/Schema";
|
||||
declare type Router = {
|
||||
pathname: string;
|
||||
props?: Record<string, any>;
|
||||
state?: Record<string, any>;
|
||||
isTabBar?: boolean;
|
||||
};
|
||||
declare type MessageRestriction = {
|
||||
systemIds?: string[];
|
||||
channels?: Array<Channel>;
|
||||
};
|
||||
export declare 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 declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type MessageIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "userId">> & (({
|
||||
userId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: String<64>;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId: String<64>;
|
||||
})) & ({
|
||||
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: String<64> | 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 declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type MessageIdSubQuery = Selection<MessageIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var Action_1 = require("./Action");
|
||||
exports.desc = {
|
||||
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: Action_1.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,164 @@
|
|||
import { String, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as Message from "../Message/Schema";
|
||||
import * as System from "../System/Schema";
|
||||
import * as Notification from "../Notification/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
messageId: ForeignKey<"message">;
|
||||
systemId: ForeignKey<"system">;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type MessageSystemIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type MessageIdProjection = OneOf<{
|
||||
messageId: number;
|
||||
}>;
|
||||
declare type SystemIdProjection = OneOf<{
|
||||
systemId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "messageId" | "systemId">> & (({
|
||||
messageId?: never;
|
||||
message: Message.CreateSingleOperation;
|
||||
} | {
|
||||
messageId: String<64>;
|
||||
message?: Message.UpdateOperation;
|
||||
} | {
|
||||
messageId: String<64>;
|
||||
}) & ({
|
||||
systemId?: never;
|
||||
system: System.CreateSingleOperation;
|
||||
} | {
|
||||
systemId: String<64>;
|
||||
system?: System.UpdateOperation;
|
||||
} | {
|
||||
systemId: String<64>;
|
||||
})) & {
|
||||
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "messageId" | "systemId">> & (({
|
||||
message: Message.CreateSingleOperation;
|
||||
messageId?: never;
|
||||
} | {
|
||||
message: Message.UpdateOperation;
|
||||
messageId?: never;
|
||||
} | {
|
||||
message: Message.RemoveOperation;
|
||||
messageId?: never;
|
||||
} | {
|
||||
message?: never;
|
||||
messageId?: String<64> | null;
|
||||
}) & ({
|
||||
system: System.CreateSingleOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.UpdateOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.RemoveOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId?: String<64> | 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 declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
message?: Message.UpdateOperation | Message.RemoveOperation;
|
||||
}) & ({
|
||||
system?: System.UpdateOperation | System.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type MessageIdSubQuery = Selection<MessageIdProjection>;
|
||||
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export declare type MessageSystemIdSubQuery = Selection<MessageSystemIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
attributes: {
|
||||
messageId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "message"
|
||||
},
|
||||
systemId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "system"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "消息系统连接", "attr": { "message": "消息", "system": "系统" } }
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
type: String<64>;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
type: String<64>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
declare type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
type: Q_StringValue;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
type?: number;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
declare type MessageTypeIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
type: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<OpSchema>;
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type MessageTypeIdSubQuery = Selection<MessageTypeIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
attributes: {
|
||||
type: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "消息类型", "attr": { "type": "类型" } }
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
import { String, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as Application from "../Application/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
type: String<64>;
|
||||
templateId: String<128>;
|
||||
applicationId: ForeignKey<"application">;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
type: String<64>;
|
||||
templateId: String<128>;
|
||||
applicationId: ForeignKey<"application">;
|
||||
application: Application.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type MessageTypeTemplateIdIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type ApplicationIdProjection = OneOf<{
|
||||
applicationId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "applicationId">> & (({
|
||||
applicationId?: never;
|
||||
application: Application.CreateSingleOperation;
|
||||
} | {
|
||||
applicationId: String<64>;
|
||||
application?: Application.UpdateOperation;
|
||||
} | {
|
||||
applicationId: String<64>;
|
||||
}));
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "applicationId">> & (({
|
||||
application: Application.CreateSingleOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application: Application.UpdateOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application: Application.RemoveOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application?: never;
|
||||
applicationId?: String<64> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
application?: Application.UpdateOperation | Application.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
|
||||
export declare type MessageTypeTemplateIdIdSubQuery = Selection<MessageTypeTemplateIdIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
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: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "消息类型模板", "attr": { "type": "消息类型", "templateId": "模板编号", "application": "关联应用" } }
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import { AbleAction, AbleState } from 'oak-domain/lib/actions/action';
|
||||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export declare type ParticularAction = AbleAction;
|
||||
export declare type Action = GenericAction | ParticularAction | string;
|
||||
export declare const actions: string[];
|
||||
export declare const ActionDefDict: {
|
||||
ableState: ActionDef<AbleAction, AbleState>;
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionDefDict = exports.actions = void 0;
|
||||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "enable", "disable"];
|
||||
var AbleActionDef = (0, action_1.makeAbleActionDef)('enabled');
|
||||
exports.ActionDefDict = {
|
||||
ableState: AbleActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
import { String, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { AbleState } from 'oak-domain/lib/actions/action';
|
||||
import { Action, ParticularAction } from "./Action";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
mobile: String<16>;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
ableState?: AbleState | null;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type MobileIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "userId">> & (({
|
||||
userId?: never;
|
||||
user?: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: String<64>;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId?: String<64>;
|
||||
})) & {
|
||||
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: String<64> | 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 declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type MobileIdSubQuery = Selection<MobileIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.desc = void 0;
|
||||
var Action_1 = require("./Action");
|
||||
exports.desc = {
|
||||
attributes: {
|
||||
mobile: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
}
|
||||
},
|
||||
userId: {
|
||||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
ableState: {
|
||||
type: "enum",
|
||||
enumeration: ["enabled", "disabled"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions: Action_1.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,10 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export declare type IState = 'active' | 'applied' | 'abandoned' | string;
|
||||
export declare type IAction = 'apply' | 'abandon' | string;
|
||||
export declare type ParticularAction = IAction;
|
||||
export declare type Action = GenericAction | ParticularAction | string;
|
||||
export declare const actions: string[];
|
||||
export declare const ActionDefDict: {
|
||||
iState: ActionDef<string, string>;
|
||||
};
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionDefDict = exports.actions = void 0;
|
||||
var IActionDef = {
|
||||
stm: {
|
||||
apply: ['active', 'applied'],
|
||||
abandon: ['active', 'abandoned']
|
||||
},
|
||||
is: 'active'
|
||||
};
|
||||
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "apply", "abandon"];
|
||||
exports.ActionDefDict = {
|
||||
iState: IActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction, IState } from "./Action";
|
||||
import * as ModiEntity from "../ModiEntity/Schema";
|
||||
export declare 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 declare type OpAttr = keyof OpSchema;
|
||||
export declare 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;
|
||||
};
|
||||
declare 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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare 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>>;
|
||||
declare type ModiIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export declare 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 declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare 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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
|
||||
export declare 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;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue