增加了Platform定义
This commit is contained in:
parent
03d0196768
commit
869de6b1be
|
|
@ -2,7 +2,7 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getApplication = void 0;
|
||||
var tslib_1 = require("tslib");
|
||||
var __1 = require("..");
|
||||
var DEV_CONFIG_1 = require("../data/DEV-CONFIG");
|
||||
function getApplication(params, context) {
|
||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||
var type, APP_ID, appId, _a, application;
|
||||
|
|
@ -11,9 +11,9 @@ function getApplication(params, context) {
|
|||
case 0:
|
||||
type = params.type;
|
||||
APP_ID = {
|
||||
web: __1.DEV_WEB_APPLICATION_ID,
|
||||
wechatMp: __1.DEV_WECHATMP_APPLICATION_ID,
|
||||
wechatPublic: __1.DEV_WECHATPUPLIC_APPLICATION_ID,
|
||||
web: DEV_CONFIG_1.DEV_WEB_APPLICATION_ID,
|
||||
wechatMp: DEV_CONFIG_1.DEV_WECHATMP_APPLICATION_ID,
|
||||
wechatPublic: DEV_CONFIG_1.DEV_WECHATPUPLIC_APPLICATION_ID,
|
||||
};
|
||||
appId = APP_ID[type];
|
||||
return [4 /*yield*/, context.rowStore.select('application', {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getApplication = void 0;
|
||||
var tslib_1 = require("tslib");
|
||||
var __1 = require("..");
|
||||
var DEV_CONFIG_1 = require("../data/DEV-CONFIG");
|
||||
function getApplication(params, context) {
|
||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||
var type, APP_ID, appId, url, _a, application;
|
||||
|
|
@ -11,9 +11,9 @@ function getApplication(params, context) {
|
|||
case 0:
|
||||
type = params.type;
|
||||
APP_ID = {
|
||||
web: __1.DEV_WEB_APPLICATION_ID,
|
||||
wechatMp: __1.DEV_WECHATMP_APPLICATION_ID,
|
||||
wechatPublic: __1.DEV_WECHATPUPLIC_APPLICATION_ID,
|
||||
web: DEV_CONFIG_1.DEV_WEB_APPLICATION_ID,
|
||||
wechatMp: DEV_CONFIG_1.DEV_WECHATMP_APPLICATION_ID,
|
||||
wechatPublic: DEV_CONFIG_1.DEV_WECHATPUPLIC_APPLICATION_ID,
|
||||
};
|
||||
appId = APP_ID[type];
|
||||
url = context.getHeader('url');
|
||||
|
|
|
|||
|
|
@ -3,3 +3,4 @@ export declare const DEV_WEB_APPLICATION_ID = "MY_DEV_WEB_APPLICATION_ID";
|
|||
export declare const DEV_WECHATPUPLIC_APPLICATION_ID = "MY_DEV_WECHATPUPLIC_APPLICATION_ID";
|
||||
export declare const DEV_DOMAIN_ID = "MY_DEV_DOMAIN_ID";
|
||||
export declare const DEV_SYSTEM_ID = "MY_DEV_SYSTEM_ID";
|
||||
export declare const DEV_PLATFORM_ID = "MY_DEV_PLATFORM_ID";
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DEV_SYSTEM_ID = exports.DEV_DOMAIN_ID = exports.DEV_WECHATPUPLIC_APPLICATION_ID = exports.DEV_WEB_APPLICATION_ID = exports.DEV_WECHATMP_APPLICATION_ID = void 0;
|
||||
exports.DEV_PLATFORM_ID = exports.DEV_SYSTEM_ID = exports.DEV_DOMAIN_ID = exports.DEV_WECHATPUPLIC_APPLICATION_ID = exports.DEV_WEB_APPLICATION_ID = exports.DEV_WECHATMP_APPLICATION_ID = void 0;
|
||||
exports.DEV_WECHATMP_APPLICATION_ID = 'MY_DEV_WECHATMP_APPLICATION_ID';
|
||||
exports.DEV_WEB_APPLICATION_ID = 'MY_DEV_WEB_APPLICATION_ID';
|
||||
exports.DEV_WECHATPUPLIC_APPLICATION_ID = 'MY_DEV_WECHATPUPLIC_APPLICATION_ID';
|
||||
exports.DEV_DOMAIN_ID = 'MY_DEV_DOMAIN_ID';
|
||||
exports.DEV_SYSTEM_ID = 'MY_DEV_SYSTEM_ID';
|
||||
exports.DEV_PLATFORM_ID = 'MY_DEV_PLATFORM_ID';
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
import { CreateOperationData as Application } from '../general-app-domain/Application/Schema';
|
||||
export declare const applications: Application[];
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.applications = void 0;
|
||||
var DEV_CONFIG_1 = require("./DEV-CONFIG");
|
||||
exports.applications = [
|
||||
{
|
||||
id: DEV_CONFIG_1.DEV_WECHATMP_APPLICATION_ID,
|
||||
name: '测试小程序',
|
||||
type: 'wechatMp',
|
||||
systemId: DEV_CONFIG_1.DEV_SYSTEM_ID,
|
||||
config: {
|
||||
type: 'wechatMp',
|
||||
appId: '',
|
||||
appSecret: '',
|
||||
},
|
||||
description: '小程序应用,指向dev_system',
|
||||
},
|
||||
{
|
||||
id: DEV_CONFIG_1.DEV_WEB_APPLICATION_ID,
|
||||
name: 'devWeb',
|
||||
type: 'web',
|
||||
systemId: DEV_CONFIG_1.DEV_SYSTEM_ID,
|
||||
config: {
|
||||
type: 'web',
|
||||
},
|
||||
description: 'web应用,指向dev_system',
|
||||
},
|
||||
];
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,2 @@
|
|||
import { CreateOperationData as Domain } from '../general-app-domain/Domain/Schema';
|
||||
export declare const domains: Domain[];
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.domains = void 0;
|
||||
var DEV_CONFIG_1 = require("./DEV-CONFIG");
|
||||
exports.domains = [
|
||||
{
|
||||
id: DEV_CONFIG_1.DEV_DOMAIN_ID,
|
||||
protocol: 'http',
|
||||
url: 'localhost',
|
||||
port: 3001,
|
||||
apiPath: '/rest/aspect',
|
||||
systemId: DEV_CONFIG_1.DEV_SYSTEM_ID,
|
||||
},
|
||||
];
|
||||
|
|
@ -3,6 +3,9 @@ declare const _default: {
|
|||
role: import("../general-app-domain/Role/Schema").CreateOperationData[];
|
||||
mobile: import("../general-app-domain/Mobile/Schema").CreateOperationData[];
|
||||
token: import("../general-app-domain/Token/Schema").CreateOperationData[];
|
||||
application: import("../general-app-domain/Application/Schema").CreateOperationData[];
|
||||
system: import("../general-app-domain/System/Schema").CreateOperationData[];
|
||||
platform: import("../general-app-domain/Platform/Schema").CreateOperationData[];
|
||||
area: ({
|
||||
code: string;
|
||||
level: string;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,16 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var userRole_1 = require("./userRole");
|
||||
var area_1 = require("./area");
|
||||
var application_1 = require("./application");
|
||||
var system_1 = require("./system");
|
||||
var platform_1 = require("./platform");
|
||||
exports.default = {
|
||||
user: userRole_1.users,
|
||||
role: userRole_1.roles,
|
||||
mobile: userRole_1.mobiles,
|
||||
token: userRole_1.tokens,
|
||||
application: application_1.applications,
|
||||
system: system_1.systems,
|
||||
platform: platform_1.platforms,
|
||||
area: area_1.area,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
import { CreateOperationData as Platform } from '../general-app-domain/Platform/Schema';
|
||||
export declare const platforms: Platform[];
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.platforms = void 0;
|
||||
var DEV_CONFIG_1 = require("./DEV-CONFIG");
|
||||
exports.platforms = [
|
||||
{
|
||||
id: DEV_CONFIG_1.DEV_PLATFORM_ID,
|
||||
name: '测试平台',
|
||||
description: '测试平台',
|
||||
config: {},
|
||||
}
|
||||
];
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
import { CreateOperationData as System } from '../general-app-domain/System/Schema';
|
||||
export declare const systems: System[];
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.systems = void 0;
|
||||
var DEV_CONFIG_1 = require("./DEV-CONFIG");
|
||||
exports.systems = [
|
||||
{
|
||||
id: DEV_CONFIG_1.DEV_SYSTEM_ID,
|
||||
name: '',
|
||||
description: '',
|
||||
config: {},
|
||||
platformId: DEV_CONFIG_1.DEV_PLATFORM_ID,
|
||||
super: true,
|
||||
},
|
||||
];
|
||||
|
|
@ -2,14 +2,14 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.tokens = exports.mobiles = exports.roles = exports.users = void 0;
|
||||
var constants_1 = require("../constants");
|
||||
var DEV_ID_1 = require("./DEV-ID");
|
||||
var DEV_CONFIG_1 = require("./DEV-CONFIG");
|
||||
exports.users = [
|
||||
{
|
||||
password: 'oak@2022',
|
||||
nickname: 'root',
|
||||
name: 'root',
|
||||
id: constants_1.ROOT_USER_ID,
|
||||
systemId: DEV_ID_1.DEV_SYSTEM_ID,
|
||||
systemId: DEV_CONFIG_1.DEV_SYSTEM_ID,
|
||||
}
|
||||
];
|
||||
exports.roles = [
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
import { String, Text } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { QiniuConfig } from '../types/Config';
|
||||
export declare type PlatformConfig = {
|
||||
Cos?: {
|
||||
qiniu?: QiniuConfig;
|
||||
};
|
||||
Map?: {
|
||||
amap?: {
|
||||
webApiKey: string;
|
||||
};
|
||||
};
|
||||
UserEntityGrant?: {
|
||||
lifetimeLength: number;
|
||||
};
|
||||
};
|
||||
export interface Schema extends EntityShape {
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
config: PlatformConfig;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
;
|
||||
var locale = {
|
||||
zh_CN: {
|
||||
attr: {
|
||||
name: '名称',
|
||||
description: '描述',
|
||||
config: '设置',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -1,22 +1,10 @@
|
|||
import { String, Text } from 'oak-domain/lib/types/DataType';
|
||||
import { String, Boolean, Text } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { QiniuConfig } from '../types/Config';
|
||||
import { Schema as Platform } from './Platform';
|
||||
export declare type SystemConfig = {
|
||||
Cos?: {
|
||||
qiniu?: {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
uploadHost: string;
|
||||
liveHost?: string;
|
||||
puhlishDomain?: string;
|
||||
playDomain?: string;
|
||||
playBackDomain?: string;
|
||||
hub?: string;
|
||||
publisthKey?: string;
|
||||
playKey?: string;
|
||||
bucket: string;
|
||||
domain: string;
|
||||
protocol: string | string[];
|
||||
};
|
||||
qiniu?: QiniuConfig;
|
||||
};
|
||||
Map?: {
|
||||
amap?: {
|
||||
|
|
@ -31,5 +19,6 @@ export interface Schema extends EntityShape {
|
|||
name: String<32>;
|
||||
description: Text;
|
||||
config: SystemConfig;
|
||||
platform: Platform;
|
||||
super?: Boolean;
|
||||
}
|
||||
export declare type Relation = 'owner';
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@ var locale = {
|
|||
name: '名称',
|
||||
description: '描述',
|
||||
config: '设置',
|
||||
platform: '平台',
|
||||
super: '超级系统',
|
||||
},
|
||||
r: {
|
||||
owner: '所有者',
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import { EntityDef as Email } from "./Email/Schema";
|
|||
import { EntityDef as ExtraFile } from "./ExtraFile/Schema";
|
||||
import { EntityDef as Livestream } from "./Livestream/Schema";
|
||||
import { EntityDef as Mobile } from "./Mobile/Schema";
|
||||
import { EntityDef as Platform } from "./Platform/Schema";
|
||||
import { EntityDef as UserRole } from "./UserRole/Schema";
|
||||
import { EntityDef as Role } from "./Role/Schema";
|
||||
import { EntityDef as UserSystem } from "./UserSystem/Schema";
|
||||
import { EntityDef as System } from "./System/Schema";
|
||||
import { EntityDef as Token } from "./Token/Schema";
|
||||
import { EntityDef as UserEntityGrant } from "./UserEntityGrant/Schema";
|
||||
|
|
@ -37,9 +37,9 @@ export declare type EntityDict = {
|
|||
extraFile: ExtraFile;
|
||||
livestream: Livestream;
|
||||
mobile: Mobile;
|
||||
platform: Platform;
|
||||
userRole: UserRole;
|
||||
role: Role;
|
||||
userSystem: UserSystem;
|
||||
system: System;
|
||||
token: Token;
|
||||
userEntityGrant: UserEntityGrant;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,32 @@
|
|||
import { String, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { String, Text, Datetime, PrimaryKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import * as SubQuery from "../_SubQuery";
|
||||
import { FormCreateData, FormUpdateData, Operation as OakOperation, MakeAction as OakMakeAction } from "oak-domain/lib/types/Entity";
|
||||
import { ExcludeUpdateAction } from "oak-domain/lib/actions/action";
|
||||
import * as User from "../User/Schema";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import { QiniuConfig } from "..\\..\\types\\Config";
|
||||
import * as System from "../System/Schema";
|
||||
export declare type PlatformConfig = {
|
||||
Cos?: {
|
||||
qiniu?: QiniuConfig;
|
||||
};
|
||||
Map?: {
|
||||
amap?: {
|
||||
webApiKey: string;
|
||||
};
|
||||
};
|
||||
UserEntityGrant?: {
|
||||
lifetimeLength: number;
|
||||
};
|
||||
};
|
||||
export declare type OpSchema = {
|
||||
id: PrimaryKey;
|
||||
$$createAt$$: Datetime;
|
||||
$$updateAt$$: Datetime;
|
||||
$$deleteAt$$?: Datetime | null;
|
||||
userId: ForeignKey<"user">;
|
||||
systemId: ForeignKey<"system">;
|
||||
relation: 'owner';
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
config: PlatformConfig;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = {
|
||||
|
|
@ -21,23 +34,20 @@ export declare type Schema = {
|
|||
$$createAt$$: Datetime;
|
||||
$$updateAt$$: Datetime;
|
||||
$$deleteAt$$?: Datetime | null;
|
||||
userId: ForeignKey<"user">;
|
||||
systemId: ForeignKey<"system">;
|
||||
relation: 'owner';
|
||||
user: User.Schema;
|
||||
system: System.Schema;
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
config: PlatformConfig;
|
||||
system$platform?: Array<System.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
declare type AttrFilter = {
|
||||
id: Q_StringValue | SubQuery.UserSystemIdSubQuery;
|
||||
id: Q_StringValue | SubQuery.PlatformIdSubQuery;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
userId: Q_StringValue | SubQuery.UserIdSubQuery;
|
||||
user: User.Filter;
|
||||
systemId: Q_StringValue | SubQuery.SystemIdSubQuery;
|
||||
system: System.Filter;
|
||||
relation: Q_EnumValue<'owner'>;
|
||||
name: Q_StringValue;
|
||||
description: Q_StringValue;
|
||||
config: Q_EnumValue<PlatformConfig>;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare type Projection = {
|
||||
|
|
@ -46,11 +56,12 @@ export declare type Projection = {
|
|||
id: 1;
|
||||
$$createAt$$?: 1;
|
||||
$$updateAt$$?: 1;
|
||||
userId?: 1;
|
||||
user?: User.Projection;
|
||||
systemId?: 1;
|
||||
system?: System.Projection;
|
||||
relation?: 1;
|
||||
name?: 1;
|
||||
description?: 1;
|
||||
config?: 1;
|
||||
system$platform?: System.Selection & {
|
||||
$entity: "system";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
export declare type ExportProjection = {
|
||||
"#id"?: NodeId;
|
||||
|
|
@ -58,21 +69,16 @@ export declare type ExportProjection = {
|
|||
id?: string;
|
||||
$$createAt$$?: string;
|
||||
$$updateAt$$?: string;
|
||||
userId?: string;
|
||||
user?: User.ExportProjection;
|
||||
systemId?: string;
|
||||
system?: System.ExportProjection;
|
||||
relation?: string;
|
||||
name?: string;
|
||||
description?: string;
|
||||
config?: string;
|
||||
system$platform?: System.Exportation & {
|
||||
$entity: "system";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
declare type UserSystemIdProjection = OneOf<{
|
||||
declare type PlatformIdProjection = OneOf<{
|
||||
id: 1;
|
||||
}>;
|
||||
declare type UserIdProjection = OneOf<{
|
||||
userId: 1;
|
||||
}>;
|
||||
declare type SystemIdProjection = OneOf<{
|
||||
systemId: 1;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: 1;
|
||||
} | {
|
||||
|
|
@ -80,15 +86,11 @@ export declare type SortAttr = {
|
|||
} | {
|
||||
$$updateAt$$: 1;
|
||||
} | {
|
||||
userId: 1;
|
||||
name: 1;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
description: 1;
|
||||
} | {
|
||||
systemId: 1;
|
||||
} | {
|
||||
system: System.SortAttr;
|
||||
} | {
|
||||
relation: 1;
|
||||
config: 1;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -100,70 +102,27 @@ export declare type Sorter = SortNode[];
|
|||
export declare type SelectOperation<P extends Object = Projection> = Omit<OakOperation<"select", P, Filter, Sorter>, "id">;
|
||||
export declare type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
|
||||
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "userId" | "systemId">> & (({
|
||||
userId?: never;
|
||||
user?: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: String<64>;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId?: String<64>;
|
||||
}) & ({
|
||||
systemId?: never;
|
||||
system?: System.CreateSingleOperation;
|
||||
} | {
|
||||
systemId: String<64>;
|
||||
system?: System.UpdateOperation;
|
||||
} | {
|
||||
systemId?: String<64>;
|
||||
}));
|
||||
export declare type CreateOperationData = FormCreateData<OpSchema> & {
|
||||
system$platform?: OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, System.Filter> | OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">[]> | Array<OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">> | OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, System.Filter>>;
|
||||
};
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId" | "systemId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: String<64> | null;
|
||||
}) & ({
|
||||
system: System.CreateSingleOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.UpdateOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system: System.RemoveOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId?: String<64> | null;
|
||||
})) & {
|
||||
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
systems$platform?: System.UpdateOperation | System.RemoveOperation | OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">[]> | Array<OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">> | System.UpdateOperation | System.RemoveOperation>;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}) & ({
|
||||
system?: System.UpdateOperation | System.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export declare type UserSystemIdSubQuery = Selection<UserSystemIdProjection>;
|
||||
export declare type NativeAttr = OpAttr | `user.${User.NativeAttr}` | `system.${System.NativeAttr}`;
|
||||
export declare type FullAttr = NativeAttr;
|
||||
export declare type PlatformIdSubQuery = Selection<PlatformIdProjection>;
|
||||
export declare type NativeAttr = OpAttr;
|
||||
export declare type FullAttr = NativeAttr | `systems$${number}.${System.NativeAttr}`;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<ExcludeUpdateAction> | string;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
|
|
@ -4,21 +4,19 @@ exports.desc = void 0;
|
|||
var action_1 = require("oak-domain/lib/actions/action");
|
||||
exports.desc = {
|
||||
attributes: {
|
||||
userId: {
|
||||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
systemId: {
|
||||
type: "ref",
|
||||
ref: "system"
|
||||
},
|
||||
relation: {
|
||||
name: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 24
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
description: {
|
||||
type: "text"
|
||||
},
|
||||
config: {
|
||||
type: "object"
|
||||
}
|
||||
},
|
||||
actionType: "excludeUpdate",
|
||||
actions: action_1.excludeUpdateActions
|
||||
actionType: "crud",
|
||||
actions: action_1.genericActions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "attr": { "name": "名称", "description": "描述", "config": "设置" } }
|
||||
|
|
@ -16,9 +16,9 @@ var Storage_12 = require("./Email/Storage");
|
|||
var Storage_13 = require("./ExtraFile/Storage");
|
||||
var Storage_14 = require("./Livestream/Storage");
|
||||
var Storage_15 = require("./Mobile/Storage");
|
||||
var Storage_16 = require("./UserRole/Storage");
|
||||
var Storage_17 = require("./Role/Storage");
|
||||
var Storage_18 = require("./UserSystem/Storage");
|
||||
var Storage_16 = require("./Platform/Storage");
|
||||
var Storage_17 = require("./UserRole/Storage");
|
||||
var Storage_18 = require("./Role/Storage");
|
||||
var Storage_19 = require("./System/Storage");
|
||||
var Storage_20 = require("./Token/Storage");
|
||||
var Storage_21 = require("./UserEntityGrant/Storage");
|
||||
|
|
@ -40,9 +40,9 @@ exports.storageSchema = {
|
|||
extraFile: Storage_13.desc,
|
||||
livestream: Storage_14.desc,
|
||||
mobile: Storage_15.desc,
|
||||
userRole: Storage_16.desc,
|
||||
role: Storage_17.desc,
|
||||
userSystem: Storage_18.desc,
|
||||
platform: Storage_16.desc,
|
||||
userRole: Storage_17.desc,
|
||||
role: Storage_18.desc,
|
||||
system: Storage_19.desc,
|
||||
token: Storage_20.desc,
|
||||
userEntityGrant: Storage_21.desc,
|
||||
|
|
|
|||
|
|
@ -1,30 +1,17 @@
|
|||
import { String, Text, Datetime, PrimaryKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { String, Boolean, Text, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import * as SubQuery from "../_SubQuery";
|
||||
import { FormCreateData, FormUpdateData, Operation as OakOperation, MakeAction as OakMakeAction } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import { QiniuConfig } from "..\\..\\types\\Config";
|
||||
import * as Platform from "../Platform/Schema";
|
||||
import * as Application from "../Application/Schema";
|
||||
import * as Domain from "../Domain/Schema";
|
||||
import * as UserSystem from "../UserSystem/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
export declare type SystemConfig = {
|
||||
Cos?: {
|
||||
qiniu?: {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
uploadHost: string;
|
||||
liveHost?: string;
|
||||
puhlishDomain?: string;
|
||||
playDomain?: string;
|
||||
playBackDomain?: string;
|
||||
hub?: string;
|
||||
publisthKey?: string;
|
||||
playKey?: string;
|
||||
bucket: string;
|
||||
domain: string;
|
||||
protocol: string | string[];
|
||||
};
|
||||
qiniu?: QiniuConfig;
|
||||
};
|
||||
Map?: {
|
||||
amap?: {
|
||||
|
|
@ -43,6 +30,8 @@ export declare type OpSchema = {
|
|||
name: String<32>;
|
||||
description: Text;
|
||||
config: SystemConfig;
|
||||
platformId: ForeignKey<"platform">;
|
||||
super?: Boolean | null;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = {
|
||||
|
|
@ -53,9 +42,11 @@ export declare type Schema = {
|
|||
name: String<32>;
|
||||
description: Text;
|
||||
config: SystemConfig;
|
||||
platformId: ForeignKey<"platform">;
|
||||
super?: Boolean | null;
|
||||
platform: Platform.Schema;
|
||||
application$system?: Array<Application.Schema>;
|
||||
domain$system?: Array<Domain.Schema>;
|
||||
userSystem$system?: Array<UserSystem.Schema>;
|
||||
user$system?: Array<User.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
|
|
@ -67,6 +58,9 @@ declare type AttrFilter = {
|
|||
name: Q_StringValue;
|
||||
description: Q_StringValue;
|
||||
config: Q_EnumValue<SystemConfig>;
|
||||
platformId: Q_StringValue | SubQuery.PlatformIdSubQuery;
|
||||
platform: Platform.Filter;
|
||||
super: Q_BooleanValue;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare type Projection = {
|
||||
|
|
@ -78,15 +72,15 @@ export declare type Projection = {
|
|||
name?: 1;
|
||||
description?: 1;
|
||||
config?: 1;
|
||||
platformId?: 1;
|
||||
platform?: Platform.Projection;
|
||||
super?: 1;
|
||||
application$system?: Application.Selection & {
|
||||
$entity: "application";
|
||||
};
|
||||
domain$system?: Domain.Selection & {
|
||||
$entity: "domain";
|
||||
};
|
||||
userSystem$system?: UserSystem.Selection & {
|
||||
$entity: "userSystem";
|
||||
};
|
||||
user$system?: User.Selection & {
|
||||
$entity: "user";
|
||||
};
|
||||
|
|
@ -100,15 +94,15 @@ export declare type ExportProjection = {
|
|||
name?: string;
|
||||
description?: string;
|
||||
config?: string;
|
||||
platformId?: string;
|
||||
platform?: Platform.ExportProjection;
|
||||
super?: string;
|
||||
application$system?: Application.Exportation & {
|
||||
$entity: "application";
|
||||
};
|
||||
domain$system?: Domain.Exportation & {
|
||||
$entity: "domain";
|
||||
};
|
||||
userSystem$system?: UserSystem.Exportation & {
|
||||
$entity: "userSystem";
|
||||
};
|
||||
user$system?: User.Exportation & {
|
||||
$entity: "user";
|
||||
};
|
||||
|
|
@ -116,6 +110,9 @@ export declare type ExportProjection = {
|
|||
declare type SystemIdProjection = OneOf<{
|
||||
id: 1;
|
||||
}>;
|
||||
declare type PlatformIdProjection = OneOf<{
|
||||
platformId: 1;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: 1;
|
||||
} | {
|
||||
|
|
@ -128,6 +125,12 @@ export declare type SortAttr = {
|
|||
description: 1;
|
||||
} | {
|
||||
config: 1;
|
||||
} | {
|
||||
platformId: 1;
|
||||
} | {
|
||||
platform: Platform.SortAttr;
|
||||
} | {
|
||||
super: 1;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -139,33 +142,54 @@ export declare type Sorter = SortNode[];
|
|||
export declare type SelectOperation<P extends Object = Projection> = Omit<OakOperation<"select", P, Filter, Sorter>, "id">;
|
||||
export declare type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
|
||||
export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<OpSchema> & {
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "platformId">> & (({
|
||||
platformId?: never;
|
||||
platform: Platform.CreateSingleOperation;
|
||||
} | {
|
||||
platformId: String<64>;
|
||||
platform?: Platform.UpdateOperation;
|
||||
} | {
|
||||
platformId: String<64>;
|
||||
})) & {
|
||||
application$system?: OakOperation<Application.UpdateOperation["action"], Omit<Application.UpdateOperationData, "system" | "systemId">, Application.Filter> | OakOperation<"create", Omit<Application.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<Application.CreateOperationData, "system" | "systemId">> | OakOperation<Application.UpdateOperation["action"], Omit<Application.UpdateOperationData, "system" | "systemId">, Application.Filter>>;
|
||||
domain$system?: OakOperation<Domain.UpdateOperation["action"], Omit<Domain.UpdateOperationData, "system" | "systemId">, Domain.Filter> | OakOperation<"create", Omit<Domain.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<Domain.CreateOperationData, "system" | "systemId">> | OakOperation<Domain.UpdateOperation["action"], Omit<Domain.UpdateOperationData, "system" | "systemId">, Domain.Filter>>;
|
||||
userSystem$system?: OakOperation<"create", Omit<UserSystem.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<UserSystem.CreateOperationData, "system" | "systemId">>>;
|
||||
user$system?: OakOperation<User.UpdateOperation["action"], Omit<User.UpdateOperationData, "system" | "systemId">, User.Filter> | OakOperation<"create", Omit<User.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<User.CreateOperationData, "system" | "systemId">> | OakOperation<User.UpdateOperation["action"], Omit<User.UpdateOperationData, "system" | "systemId">, User.Filter>>;
|
||||
};
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "platformId">> & (({
|
||||
platform: Platform.CreateSingleOperation;
|
||||
platformId?: never;
|
||||
} | {
|
||||
platform: Platform.UpdateOperation;
|
||||
platformId?: never;
|
||||
} | {
|
||||
platform: Platform.RemoveOperation;
|
||||
platformId?: never;
|
||||
} | {
|
||||
platform?: never;
|
||||
platformId?: String<64> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
applications$system?: Application.UpdateOperation | Application.RemoveOperation | OakOperation<"create", Omit<Application.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<Application.CreateOperationData, "system" | "systemId">> | Application.UpdateOperation | Application.RemoveOperation>;
|
||||
domains$system?: Domain.UpdateOperation | Domain.RemoveOperation | OakOperation<"create", Omit<Domain.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<Domain.CreateOperationData, "system" | "systemId">> | Domain.UpdateOperation | Domain.RemoveOperation>;
|
||||
userSystems$system?: UserSystem.RemoveOperation | OakOperation<"create", Omit<UserSystem.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<UserSystem.CreateOperationData, "system" | "systemId">> | UserSystem.RemoveOperation>;
|
||||
users$system?: User.UpdateOperation | User.RemoveOperation | OakOperation<"create", Omit<User.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<User.CreateOperationData, "system" | "systemId">> | User.UpdateOperation | User.RemoveOperation>;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | RelationAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
platform?: Platform.UpdateOperation | Platform.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
|
||||
export declare type PlatformIdSubQuery = Selection<PlatformIdProjection>;
|
||||
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export declare type NativeAttr = OpAttr;
|
||||
export declare type FullAttr = NativeAttr | `applications$${number}.${Application.NativeAttr}` | `domains$${number}.${Domain.NativeAttr}` | `userSystems$${number}.${UserSystem.NativeAttr}` | `users$${number}.${User.NativeAttr}`;
|
||||
export declare type NativeAttr = OpAttr | `platform.${Platform.NativeAttr}`;
|
||||
export declare type FullAttr = NativeAttr | `applications$${number}.${Application.NativeAttr}` | `domains$${number}.${Domain.NativeAttr}` | `users$${number}.${User.NativeAttr}`;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction | RelationAction> | string;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,15 @@ exports.desc = {
|
|||
},
|
||||
config: {
|
||||
type: "object"
|
||||
},
|
||||
platformId: {
|
||||
type: "ref",
|
||||
ref: "platform"
|
||||
},
|
||||
super: {
|
||||
type: "boolean"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions: action_1.genericActions.concat(action_1.relationActions)
|
||||
actions: action_1.genericActions
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{ "attr": { "name": "名称", "description": "描述", "config": "设置" }, "r": { "owner": "所有者" } }
|
||||
{ "attr": { "name": "名称", "description": "描述", "config": "设置", "platform": "平台", "super": "超级系统" } }
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import * as Oper from "../Oper/Schema";
|
|||
import * as Email from "../Email/Schema";
|
||||
import * as Mobile from "../Mobile/Schema";
|
||||
import * as UserRole from "../UserRole/Schema";
|
||||
import * as UserSystem from "../UserSystem/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
|
|
@ -61,7 +60,6 @@ export declare type Schema = {
|
|||
email$user?: Array<Email.Schema>;
|
||||
mobile$user?: Array<Mobile.Schema>;
|
||||
userRole$user?: Array<UserRole.Schema>;
|
||||
userSystem$user?: Array<UserSystem.Schema>;
|
||||
token$user?: Array<Token.Schema>;
|
||||
token$player?: Array<Token.Schema>;
|
||||
user$ref?: Array<Schema>;
|
||||
|
|
@ -128,9 +126,6 @@ export declare type Projection = {
|
|||
userRole$user?: UserRole.Selection & {
|
||||
$entity: "userRole";
|
||||
};
|
||||
userSystem$user?: UserSystem.Selection & {
|
||||
$entity: "userSystem";
|
||||
};
|
||||
token$user?: Token.Selection & {
|
||||
$entity: "token";
|
||||
};
|
||||
|
|
@ -192,9 +187,6 @@ export declare type ExportProjection = {
|
|||
userRole$user?: UserRole.Exportation & {
|
||||
$entity: "userRole";
|
||||
};
|
||||
userSystem$user?: UserSystem.Exportation & {
|
||||
$entity: "userSystem";
|
||||
};
|
||||
token$user?: Token.Exportation & {
|
||||
$entity: "token";
|
||||
};
|
||||
|
|
@ -298,7 +290,6 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "refId"
|
|||
email$user?: OakOperation<Email.UpdateOperation["action"], Omit<Email.UpdateOperationData, "user" | "userId">, Email.Filter> | OakOperation<"create", Omit<Email.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Email.CreateOperationData, "user" | "userId">> | OakOperation<Email.UpdateOperation["action"], Omit<Email.UpdateOperationData, "user" | "userId">, Email.Filter>>;
|
||||
mobile$user?: OakOperation<Mobile.UpdateOperation["action"], Omit<Mobile.UpdateOperationData, "user" | "userId">, Mobile.Filter> | OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId">> | OakOperation<Mobile.UpdateOperation["action"], Omit<Mobile.UpdateOperationData, "user" | "userId">, Mobile.Filter>>;
|
||||
userRole$user?: OakOperation<"create", Omit<UserRole.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<UserRole.CreateOperationData, "user" | "userId">>>;
|
||||
userSystem$user?: OakOperation<"create", Omit<UserSystem.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<UserSystem.CreateOperationData, "user" | "userId">>>;
|
||||
token$user?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "user" | "userId">, Token.Filter> | OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "user" | "userId">, Token.Filter>>;
|
||||
token$player?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "player" | "playerId">, Token.Filter> | OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "player" | "playerId">, Token.Filter>>;
|
||||
user$ref?: OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "ref" | "refId">, Filter> | OakOperation<"create", Omit<CreateOperationData, "ref" | "refId">[]> | Array<OakOperation<"create", Omit<CreateOperationData, "ref" | "refId">> | OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "ref" | "refId">, Filter>>;
|
||||
|
|
@ -342,7 +333,6 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "refId"
|
|||
emails$user?: Email.UpdateOperation | Email.RemoveOperation | OakOperation<"create", Omit<Email.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Email.CreateOperationData, "user" | "userId">> | Email.UpdateOperation | Email.RemoveOperation>;
|
||||
mobiles$user?: Mobile.UpdateOperation | Mobile.RemoveOperation | OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId">> | Mobile.UpdateOperation | Mobile.RemoveOperation>;
|
||||
userRoles$user?: UserRole.RemoveOperation | OakOperation<"create", Omit<UserRole.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<UserRole.CreateOperationData, "user" | "userId">> | UserRole.RemoveOperation>;
|
||||
userSystems$user?: UserSystem.RemoveOperation | OakOperation<"create", Omit<UserSystem.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<UserSystem.CreateOperationData, "user" | "userId">> | UserSystem.RemoveOperation>;
|
||||
tokens$user?: Token.UpdateOperation | Token.RemoveOperation | OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId">> | Token.UpdateOperation | Token.RemoveOperation>;
|
||||
tokens$player?: Token.UpdateOperation | Token.RemoveOperation | OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId">> | Token.UpdateOperation | Token.RemoveOperation>;
|
||||
users$ref?: UpdateOperation | RemoveOperation | OakOperation<"create", Omit<CreateOperationData, "ref" | "refId">[]> | Array<OakOperation<"create", Omit<CreateOperationData, "ref" | "refId">> | UpdateOperation | RemoveOperation>;
|
||||
|
|
@ -364,7 +354,7 @@ export declare type Operation = CreateOperation | UpdateOperation | RemoveOperat
|
|||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export declare type NativeAttr = OpAttr | `ref.${OpAttr}` | `ref.ref.${OpAttr}` | `ref.ref.ref.${OpAttr}` | `system.${System.NativeAttr}`;
|
||||
export declare type FullAttr = NativeAttr | `opers$${number}.${Oper.NativeAttr}` | `emails$${number}.${Email.NativeAttr}` | `mobiles$${number}.${Mobile.NativeAttr}` | `userRoles$${number}.${UserRole.NativeAttr}` | `userSystems$${number}.${UserSystem.NativeAttr}` | `tokens$user$${number}.${Token.NativeAttr}` | `tokens$player$${number}.${Token.NativeAttr}` | `users$${number}.${NativeAttr}` | `userEntityGrants$granter$${number}.${UserEntityGrant.NativeAttr}` | `userEntityGrants$grantee$${number}.${UserEntityGrant.NativeAttr}` | `wechatUsers$${number}.${WechatUser.NativeAttr}` | `operEntitys$${number}.${OperEntity.NativeAttr}` | `modiEntitys$${number}.${ModiEntity.NativeAttr}` | `extraFiles$${number}.${ExtraFile.NativeAttr}`;
|
||||
export declare type FullAttr = NativeAttr | `opers$${number}.${Oper.NativeAttr}` | `emails$${number}.${Email.NativeAttr}` | `mobiles$${number}.${Mobile.NativeAttr}` | `userRoles$${number}.${UserRole.NativeAttr}` | `tokens$user$${number}.${Token.NativeAttr}` | `tokens$player$${number}.${Token.NativeAttr}` | `users$${number}.${NativeAttr}` | `userEntityGrants$granter$${number}.${UserEntityGrant.NativeAttr}` | `userEntityGrants$grantee$${number}.${UserEntityGrant.NativeAttr}` | `wechatUsers$${number}.${WechatUser.NativeAttr}` | `operEntitys$${number}.${OperEntity.NativeAttr}` | `modiEntitys$${number}.${ModiEntity.NativeAttr}` | `extraFiles$${number}.${ExtraFile.NativeAttr}`;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import * as Email from "./Email/Schema";
|
|||
import * as ExtraFile from "./ExtraFile/Schema";
|
||||
import * as Livestream from "./Livestream/Schema";
|
||||
import * as Mobile from "./Mobile/Schema";
|
||||
import * as Platform from "./Platform/Schema";
|
||||
import * as UserRole from "./UserRole/Schema";
|
||||
import * as Role from "./Role/Schema";
|
||||
import * as UserSystem from "./UserSystem/Schema";
|
||||
import * as System from "./System/Schema";
|
||||
import * as Token from "./Token/Schema";
|
||||
import * as UserEntityGrant from "./UserEntityGrant/Schema";
|
||||
|
|
@ -54,8 +54,6 @@ export declare type UserIdSubQuery = {
|
|||
entity: "mobile";
|
||||
}) | (UserRole.UserIdSubQuery & {
|
||||
entity: "userRole";
|
||||
}) | (UserSystem.UserIdSubQuery & {
|
||||
entity: "userSystem";
|
||||
}) | (Token.UserIdSubQuery & {
|
||||
entity: "token";
|
||||
}) | (User.UserIdSubQuery & {
|
||||
|
|
@ -128,6 +126,13 @@ export declare type MobileIdSubQuery = {
|
|||
entity: "mobile";
|
||||
}) | any;
|
||||
};
|
||||
export declare type PlatformIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (System.PlatformIdSubQuery & {
|
||||
entity: "system";
|
||||
}) | (Platform.PlatformIdSubQuery & {
|
||||
entity: "platform";
|
||||
}) | any;
|
||||
};
|
||||
export declare type UserRoleIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (UserRole.UserRoleIdSubQuery & {
|
||||
entity: "userRole";
|
||||
|
|
@ -140,18 +145,11 @@ export declare type RoleIdSubQuery = {
|
|||
entity: "role";
|
||||
}) | any;
|
||||
};
|
||||
export declare type UserSystemIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (UserSystem.UserSystemIdSubQuery & {
|
||||
entity: "userSystem";
|
||||
}) | any;
|
||||
};
|
||||
export declare type SystemIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (Application.SystemIdSubQuery & {
|
||||
entity: "application";
|
||||
}) | (Domain.SystemIdSubQuery & {
|
||||
entity: "domain";
|
||||
}) | (UserSystem.SystemIdSubQuery & {
|
||||
entity: "userSystem";
|
||||
}) | (User.SystemIdSubQuery & {
|
||||
entity: "user";
|
||||
}) | (System.SystemIdSubQuery & {
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ import { routers as exceptionRouters } from './exceptionRouters';
|
|||
export { checkers, triggers, watchers, data, aspectDict, exceptionRouters, };
|
||||
export * from './types/Exceptions';
|
||||
export { composeFileUrl, decomposeFileUrl } from './utils/extraFile';
|
||||
export * from './data/DEV-ID';
|
||||
export * from './data/DEV-CONFIG';
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ tslib_1.__exportStar(require("./types/Exceptions"), exports);
|
|||
var extraFile_1 = require("./utils/extraFile");
|
||||
Object.defineProperty(exports, "composeFileUrl", { enumerable: true, get: function () { return extraFile_1.composeFileUrl; } });
|
||||
Object.defineProperty(exports, "decomposeFileUrl", { enumerable: true, get: function () { return extraFile_1.decomposeFileUrl; } });
|
||||
tslib_1.__exportStar(require("./data/DEV-ID"), exports);
|
||||
tslib_1.__exportStar(require("./data/DEV-CONFIG"), exports);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
export declare type QiniuConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
uploadHost: string;
|
||||
liveHost?: string;
|
||||
puhlishDomain?: string;
|
||||
playDomain?: string;
|
||||
playBackDomain?: string;
|
||||
hub?: string;
|
||||
publisthKey?: string;
|
||||
playKey?: string;
|
||||
bucket: string;
|
||||
domain: string;
|
||||
protocol: string | string[];
|
||||
};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { unset } from 'oak-domain/lib/utils/lodash';
|
||||
import { buildSchema, analyzeEntities } from 'oak-domain/lib/compiler/schemalBuilder';
|
||||
import { buildSchema, analyzeEntities } from 'oak-domain/src/compiler/schemalBuilder';
|
||||
|
||||
process.env.NODE_ENV = 'development';
|
||||
process.env.COMPLING_AS_LIB = 'yes';
|
||||
analyzeEntities('node_modules/oak-domain/src/entities');
|
||||
analyzeEntities('node_modules/oak-domain/src/entities', 'oak-domain/lib/entities');
|
||||
analyzeEntities('src/entities');
|
||||
buildSchema('src/general-app-domain/');
|
||||
unset(process.env, 'COMPLING_AS_LIB');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
DEV_WEB_APPLICATION_ID,
|
||||
DEV_WECHATMP_APPLICATION_ID,
|
||||
DEV_WECHATPUPLIC_APPLICATION_ID,
|
||||
} from '..';
|
||||
} from '../data/DEV-CONFIG';
|
||||
import { RuntimeContext } from '../context/RuntimeContext';
|
||||
|
||||
export async function getApplication<ED extends EntityDict, Cxt extends RuntimeContext<ED>>(params: {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
DEV_WEB_APPLICATION_ID,
|
||||
DEV_WECHATMP_APPLICATION_ID,
|
||||
DEV_WECHATPUPLIC_APPLICATION_ID,
|
||||
} from '..';
|
||||
} from '../data/DEV-CONFIG';
|
||||
import { RuntimeContext } from '../context/RuntimeContext';
|
||||
|
||||
export async function getApplication<ED extends EntityDict, Cxt extends RuntimeContext<ED>>(params: {
|
||||
|
|
@ -20,6 +20,7 @@ export async function getApplication<ED extends EntityDict, Cxt extends RuntimeC
|
|||
const url = context.getHeader('url');
|
||||
console.log('url is', url);
|
||||
|
||||
// TODO
|
||||
const { result: [application]} = await context.rowStore.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
|
|
|
|||
|
|
@ -3,3 +3,4 @@ export const DEV_WEB_APPLICATION_ID = 'MY_DEV_WEB_APPLICATION_ID';
|
|||
export const DEV_WECHATPUPLIC_APPLICATION_ID = 'MY_DEV_WECHATPUPLIC_APPLICATION_ID';
|
||||
export const DEV_DOMAIN_ID = 'MY_DEV_DOMAIN_ID';
|
||||
export const DEV_SYSTEM_ID = 'MY_DEV_SYSTEM_ID';
|
||||
export const DEV_PLATFORM_ID = 'MY_DEV_PLATFORM_ID';
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
import { CreateOperationData as Application } from '../general-app-domain/Application/Schema';
|
||||
import {
|
||||
DEV_SYSTEM_ID,
|
||||
DEV_WECHATMP_APPLICATION_ID,
|
||||
DEV_WEB_APPLICATION_ID,
|
||||
} from './DEV-CONFIG';
|
||||
|
||||
export const applications: Application[] = [
|
||||
{
|
||||
id: DEV_WECHATMP_APPLICATION_ID,
|
||||
name: '测试小程序',
|
||||
type: 'wechatMp',
|
||||
systemId: DEV_SYSTEM_ID,
|
||||
config: {
|
||||
type: 'wechatMp',
|
||||
appId: '',
|
||||
appSecret: '',
|
||||
},
|
||||
description: '小程序应用,指向dev_system',
|
||||
},
|
||||
{
|
||||
id: DEV_WEB_APPLICATION_ID,
|
||||
name: 'devWeb',
|
||||
type: 'web',
|
||||
systemId: DEV_SYSTEM_ID,
|
||||
config: {
|
||||
type: 'web',
|
||||
},
|
||||
description: 'web应用,指向dev_system',
|
||||
},
|
||||
];
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,13 @@
|
|||
import { CreateOperationData as Domain } from '../general-app-domain/Domain/Schema';
|
||||
import { DEV_SYSTEM_ID, DEV_DOMAIN_ID } from './DEV-CONFIG';
|
||||
|
||||
export const domains: Domain[] = [
|
||||
{
|
||||
id: DEV_DOMAIN_ID,
|
||||
protocol: 'http',
|
||||
url: 'localhost',
|
||||
port: 3001,
|
||||
apiPath: '/rest/aspect',
|
||||
systemId: DEV_SYSTEM_ID,
|
||||
},
|
||||
];
|
||||
|
|
@ -1,10 +1,16 @@
|
|||
import { users, roles, mobiles, tokens } from './userRole';
|
||||
import { area } from './area';
|
||||
import { applications } from './application';
|
||||
import { systems } from './system';
|
||||
import { platforms } from './platform';
|
||||
|
||||
export default {
|
||||
user: users,
|
||||
role: roles,
|
||||
mobile: mobiles,
|
||||
token: tokens,
|
||||
application: applications,
|
||||
system: systems,
|
||||
platform: platforms,
|
||||
area,
|
||||
};
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import { CreateOperationData as Platform } from '../general-app-domain/Platform/Schema';
|
||||
import { DEV_PLATFORM_ID } from './DEV-CONFIG';
|
||||
export const platforms: Platform[] = [
|
||||
{
|
||||
id: DEV_PLATFORM_ID,
|
||||
name: '测试平台',
|
||||
description: '测试平台',
|
||||
config: {},
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
import { CreateOperationData as System } from '../general-app-domain/System/Schema';
|
||||
import { DEV_PLATFORM_ID, DEV_SYSTEM_ID } from './DEV-CONFIG';
|
||||
|
||||
|
||||
export const systems: System[] = [
|
||||
{
|
||||
id: DEV_SYSTEM_ID,
|
||||
name: '',
|
||||
description: '',
|
||||
config: {},
|
||||
platformId: DEV_PLATFORM_ID,
|
||||
super: true,
|
||||
},
|
||||
];
|
||||
|
|
@ -3,7 +3,7 @@ import { CreateOperationData as RoleCreate } from '../general-app-domain/Role/Sc
|
|||
import { CreateOperationData as MobileCreate } from '../general-app-domain/Mobile/Schema';
|
||||
import { CreateOperationData as TokenCreate } from '../general-app-domain/Token/Schema';
|
||||
import { ROOT_MOBILE_ID, ROOT_ROLE_ID, ROOT_TOKEN_ID, ROOT_USER_ID } from '../constants';
|
||||
import { DEV_SYSTEM_ID } from './DEV-ID';
|
||||
import { DEV_SYSTEM_ID } from './DEV-CONFIG';
|
||||
export const users: Array<UserCreate> = [
|
||||
{
|
||||
password: 'oak@2022',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
import { String, Int, Datetime, Image, Boolean, Text } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { LocaleDef } from 'oak-domain/lib/types/Locale';
|
||||
import { QiniuConfig } from '../types/Config';
|
||||
|
||||
export type PlatformConfig = {
|
||||
Cos?: {
|
||||
qiniu?: QiniuConfig;
|
||||
};
|
||||
Map?: {
|
||||
amap?: {
|
||||
webApiKey: string; // 高德访问rest服务接口的key
|
||||
};
|
||||
};
|
||||
UserEntityGrant?: {
|
||||
lifetimeLength: number; // 授权的过期时间(ms)
|
||||
};
|
||||
};
|
||||
|
||||
export interface Schema extends EntityShape {
|
||||
name: String<32>;
|
||||
description: Text;
|
||||
config: PlatformConfig;
|
||||
};
|
||||
|
||||
const locale: LocaleDef<Schema, '', '', {}> = {
|
||||
zh_CN: {
|
||||
attr: {
|
||||
name: '名称',
|
||||
description: '描述',
|
||||
config: '设置',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -1,24 +1,12 @@
|
|||
import { String, Int, Datetime, Image, Boolean, Text } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { LocaleDef } from 'oak-domain/lib/types/Locale';
|
||||
import { QiniuConfig } from '../types/Config';
|
||||
import { Schema as Platform } from './Platform';
|
||||
|
||||
export type SystemConfig = {
|
||||
Cos?: {
|
||||
qiniu?: {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
uploadHost: string; // 七牛上传域名
|
||||
liveHost?: string; // 七牛直播云接口域名
|
||||
puhlishDomain?: string; // 推流域名
|
||||
playDomain?: string; // 拉流域名
|
||||
playBackDomain?: string; // 直播回放存储域名
|
||||
hub?: string; // 直播空间名,
|
||||
publisthKey?: string; // 直播空间限时鉴权密钥
|
||||
playKey?: string; // 拉流密钥
|
||||
bucket: string;
|
||||
domain: string; // 域名
|
||||
protocol: string | string[];
|
||||
};
|
||||
qiniu?: QiniuConfig;
|
||||
};
|
||||
Map?: {
|
||||
amap?: {
|
||||
|
|
@ -34,20 +22,19 @@ export interface Schema extends EntityShape {
|
|||
name: String<32>;
|
||||
description: Text;
|
||||
config: SystemConfig;
|
||||
platform: Platform;
|
||||
super?: Boolean; // super表示是这个platform本身的系统,可以操作application/system这些数据,也可以访问超出本system的其它数据。
|
||||
};
|
||||
|
||||
export type Relation = 'owner';
|
||||
|
||||
|
||||
const locale: LocaleDef<Schema, '', Relation, {}> = {
|
||||
const locale: LocaleDef<Schema, '', '', {}> = {
|
||||
zh_CN: {
|
||||
attr: {
|
||||
name: '名称',
|
||||
description: '描述',
|
||||
config: '设置',
|
||||
platform: '平台',
|
||||
super: '超级系统',
|
||||
},
|
||||
r: {
|
||||
owner: '所有者',
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
@ -16,4 +16,4 @@ export {
|
|||
|
||||
export * from './types/Exceptions';
|
||||
export { composeFileUrl, decomposeFileUrl } from './utils/extraFile';
|
||||
export * from './data/DEV-ID';
|
||||
export * from './data/DEV-CONFIG';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
export type QiniuConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
uploadHost: string; // 七牛上传域名
|
||||
liveHost?: string; // 七牛直播云接口域名
|
||||
puhlishDomain?: string; // 推流域名
|
||||
playDomain?: string; // 拉流域名
|
||||
playBackDomain?: string; // 直播回放存储域名
|
||||
hub?: string; // 直播空间名,
|
||||
publisthKey?: string; // 直播空间限时鉴权密钥
|
||||
playKey?: string; // 拉流密钥
|
||||
bucket: string;
|
||||
domain: string; // 域名
|
||||
protocol: string | string[];
|
||||
};
|
||||
Loading…
Reference in New Issue