@byted-apaas/server-sdk-node 0.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +0 -0
- package/README.md +1 -0
- package/application/application.d.ts +27 -0
- package/application/application.js +3 -0
- package/application/application.js.map +1 -0
- package/application/application.ts +40 -0
- package/application/function/function.d.ts +14 -0
- package/application/function/function.js +22 -0
- package/application/function/function.js.map +1 -0
- package/application/function/function.ts +37 -0
- package/application/impl/common.d.ts +2 -0
- package/application/impl/common.js +51 -0
- package/application/impl/common.js.map +1 -0
- package/application/impl/common.ts +50 -0
- package/application/impl/impl.d.ts +16 -0
- package/application/impl/impl.js +39 -0
- package/application/impl/impl.js.map +1 -0
- package/application/impl/impl.ts +48 -0
- package/constants/constants.d.ts +10 -0
- package/constants/constants.js +14 -0
- package/constants/constants.js.map +1 -0
- package/constants/constants.ts +12 -0
- package/context/context.d.ts +74 -0
- package/context/context.js +24 -0
- package/context/context.js.map +1 -0
- package/context/context.ts +127 -0
- package/context/db/db.d.ts +73 -0
- package/context/db/db.js +3 -0
- package/context/db/db.js.map +1 -0
- package/context/db/db.ts +77 -0
- package/context/db/impl/IObject.d.ts +251 -0
- package/context/db/impl/IObject.js +4 -0
- package/context/db/impl/IObject.js.map +1 -0
- package/context/db/impl/IObject.ts +244 -0
- package/context/db/impl/db.d.ts +61 -0
- package/context/db/impl/db.js +87 -0
- package/context/db/impl/db.js.map +1 -0
- package/context/db/impl/db.ts +95 -0
- package/context/db/impl/object.d.ts +92 -0
- package/context/db/impl/object.js +523 -0
- package/context/db/impl/object.js.map +1 -0
- package/context/db/impl/object.ts +628 -0
- package/context/db/impl/oql/ioql.d.ts +6 -0
- package/context/db/impl/oql/ioql.js +3 -0
- package/context/db/impl/oql/ioql.js.map +1 -0
- package/context/db/impl/oql/ioql.ts +6 -0
- package/context/db/impl/oql/oql.d.ts +8 -0
- package/context/db/impl/oql/oql.js +20 -0
- package/context/db/impl/oql/oql.js.map +1 -0
- package/context/db/impl/oql/oql.ts +22 -0
- package/context/db/impl/order.d.ts +9 -0
- package/context/db/impl/order.js +14 -0
- package/context/db/impl/order.js.map +1 -0
- package/context/db/impl/order.ts +16 -0
- package/context/db/impl/propertiesStore.d.ts +8 -0
- package/context/db/impl/propertiesStore.js +28 -0
- package/context/db/impl/propertiesStore.js.map +1 -0
- package/context/db/impl/propertiesStore.ts +28 -0
- package/context/db/impl/queryBuilder.d.ts +29 -0
- package/context/db/impl/queryBuilder.js +77 -0
- package/context/db/impl/queryBuilder.js.map +1 -0
- package/context/db/impl/queryBuilder.ts +103 -0
- package/context/db/impl/transaction/index.d.ts +20 -0
- package/context/db/impl/transaction/index.js +276 -0
- package/context/db/impl/transaction/index.js.map +1 -0
- package/context/db/impl/transaction/index.ts +337 -0
- package/context/db/impl/transaction/operation.d.ts +27 -0
- package/context/db/impl/transaction/operation.js +70 -0
- package/context/db/impl/transaction/operation.js.map +1 -0
- package/context/db/impl/transaction/operation.ts +72 -0
- package/context/db/impl/transaction.d.ts +67 -0
- package/context/db/impl/transaction.js +3 -0
- package/context/db/impl/transaction.js.map +1 -0
- package/context/db/impl/transaction.ts +76 -0
- package/context/globalConfig/globalConfig.d.ts +7 -0
- package/context/globalConfig/globalConfig.js +15 -0
- package/context/globalConfig/globalConfig.js.map +1 -0
- package/context/globalConfig/globalConfig.ts +11 -0
- package/context/metadata/components/common.d.ts +6 -0
- package/context/metadata/components/common.js +16 -0
- package/context/metadata/components/common.js.map +1 -0
- package/context/metadata/components/common.ts +19 -0
- package/context/metadata/components/components.d.ts +12 -0
- package/context/metadata/components/components.js +18 -0
- package/context/metadata/components/components.js.map +1 -0
- package/context/metadata/components/components.ts +19 -0
- package/context/metadata/components/desktop/list.d.ts +16 -0
- package/context/metadata/components/desktop/list.js +403 -0
- package/context/metadata/components/desktop/list.js.map +1 -0
- package/context/metadata/components/desktop/list.ts +457 -0
- package/context/metadata/components/desktop/recordDetail.d.ts +11 -0
- package/context/metadata/components/desktop/recordDetail.js +52 -0
- package/context/metadata/components/desktop/recordDetail.js.map +1 -0
- package/context/metadata/components/desktop/recordDetail.ts +64 -0
- package/context/metadata/components/mobile/list.d.ts +24 -0
- package/context/metadata/components/mobile/list.js +144 -0
- package/context/metadata/components/mobile/list.js.map +1 -0
- package/context/metadata/components/mobile/list.ts +176 -0
- package/context/metadata/metadata.d.ts +61 -0
- package/context/metadata/metadata.js +102 -0
- package/context/metadata/metadata.js.map +1 -0
- package/context/metadata/metadata.ts +175 -0
- package/context/metadata/objects/fields.d.ts +130 -0
- package/context/metadata/objects/fields.js +333 -0
- package/context/metadata/objects/fields.js.map +1 -0
- package/context/metadata/objects/fields.ts +454 -0
- package/context/metadata/objects/fields.util.d.ts +40 -0
- package/context/metadata/objects/fields.util.js +320 -0
- package/context/metadata/objects/fields.util.js.map +1 -0
- package/context/metadata/objects/fields.util.ts +360 -0
- package/context/metadata/objects/objects.d.ts +11 -0
- package/context/metadata/objects/objects.js +19 -0
- package/context/metadata/objects/objects.js.map +1 -0
- package/context/metadata/objects/objects.ts +27 -0
- package/context/metadata/types/common.d.ts +6 -0
- package/context/metadata/types/common.js +8 -0
- package/context/metadata/types/common.js.map +1 -0
- package/context/metadata/types/common.ts +10 -0
- package/context/metadata/types/components.d.ts +90 -0
- package/context/metadata/types/components.js +3 -0
- package/context/metadata/types/components.js.map +1 -0
- package/context/metadata/types/components.ts +105 -0
- package/context/metadata/types/objects.d.ts +226 -0
- package/context/metadata/types/objects.js +3 -0
- package/context/metadata/types/objects.js.map +1 -0
- package/context/metadata/types/objects.ts +251 -0
- package/context/msg/msg.d.ts +38 -0
- package/context/msg/msg.js +34 -0
- package/context/msg/msg.js.map +1 -0
- package/context/msg/msg.ts +49 -0
- package/context/resources/IResources.d.ts +66 -0
- package/context/resources/IResources.js +3 -0
- package/context/resources/IResources.js.map +1 -0
- package/context/resources/IResources.ts +73 -0
- package/context/resources/impl/resources.d.ts +42 -0
- package/context/resources/impl/resources.js +149 -0
- package/context/resources/impl/resources.js.map +1 -0
- package/context/resources/impl/resources.ts +170 -0
- package/context/tasks/tasks.d.ts +33 -0
- package/context/tasks/tasks.js +140 -0
- package/context/tasks/tasks.js.map +1 -0
- package/context/tasks/tasks.ts +159 -0
- package/data/index.d.ts +27 -0
- package/data/index.js +5 -0
- package/data/index.js.map +1 -0
- package/data/index.ts +30 -0
- package/hooks/api.d.ts +61 -0
- package/hooks/api.js +328 -0
- package/hooks/api.js.map +1 -0
- package/hooks/api.ts +341 -0
- package/hooks/hooks.d.ts +1 -0
- package/hooks/hooks.js +89 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/hooks.ts +100 -0
- package/kunlun/kunlun.d.ts +55 -0
- package/kunlun/kunlun.js +57 -0
- package/kunlun/kunlun.js.map +1 -0
- package/kunlun/kunlun.ts +69 -0
- package/kunlun/operator/IOperator.d.ts +158 -0
- package/kunlun/operator/IOperator.js +3 -0
- package/kunlun/operator/IOperator.js.map +1 -0
- package/kunlun/operator/IOperator.ts +163 -0
- package/kunlun/operator/impl/expression.d.ts +47 -0
- package/kunlun/operator/impl/expression.js +55 -0
- package/kunlun/operator/impl/expression.js.map +1 -0
- package/kunlun/operator/impl/expression.ts +71 -0
- package/kunlun/operator/impl/logic.d.ts +50 -0
- package/kunlun/operator/impl/logic.js +508 -0
- package/kunlun/operator/impl/logic.js.map +1 -0
- package/kunlun/operator/impl/logic.ts +595 -0
- package/kunlun/operator/impl/logicV2.d.ts +58 -0
- package/kunlun/operator/impl/logicV2.js +201 -0
- package/kunlun/operator/impl/logicV2.js.map +1 -0
- package/kunlun/operator/impl/logicV2.ts +254 -0
- package/kunlun/operator/impl/operator.d.ts +179 -0
- package/kunlun/operator/impl/operator.js +221 -0
- package/kunlun/operator/impl/operator.js.map +1 -0
- package/kunlun/operator/impl/operator.ts +255 -0
- package/kunlun/operator/impl/operatorV2.d.ts +180 -0
- package/kunlun/operator/impl/operatorV2.js +217 -0
- package/kunlun/operator/impl/operatorV2.js.map +1 -0
- package/kunlun/operator/impl/operatorV2.ts +249 -0
- package/lib/core.d.ts +4 -0
- package/lib/core.js +18 -0
- package/lib/core.js.map +1 -0
- package/lib/core.ts +4 -0
- package/package.json +50 -0
- package/request/common.d.ts +13 -0
- package/request/common.js +88 -0
- package/request/common.js.map +1 -0
- package/request/common.ts +91 -0
- package/request/constants.d.ts +10 -0
- package/request/constants.js +26 -0
- package/request/constants.js.map +1 -0
- package/request/constants.ts +25 -0
- package/request/faasinfra.d.ts +8 -0
- package/request/faasinfra.js +359 -0
- package/request/faasinfra.js.map +1 -0
- package/request/faasinfra.ts +393 -0
- package/request/innerapi.d.ts +67 -0
- package/request/innerapi.js +1411 -0
- package/request/innerapi.js.map +1 -0
- package/request/innerapi.ts +1645 -0
- package/request/interface.d.ts +95 -0
- package/request/interface.js +40 -0
- package/request/interface.js.map +1 -0
- package/request/interface.ts +166 -0
- package/request/openapi.d.ts +69 -0
- package/request/openapi.js +1013 -0
- package/request/openapi.js.map +1 -0
- package/request/openapi.ts +1220 -0
- package/types/types.d.ts +79 -0
- package/types/types.js +3 -0
- package/types/types.js.map +1 -0
- package/types/types.ts +105 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as common from "@byted-apaas/server-common-node"
|
|
2
|
+
import * as Request from "../../request/interface"
|
|
3
|
+
|
|
4
|
+
const utils = common.utils
|
|
5
|
+
const exceptions = common.exceptions
|
|
6
|
+
|
|
7
|
+
export class _Options {
|
|
8
|
+
/**
|
|
9
|
+
* 并发数量,默认值为 5,最大可设置值为 10
|
|
10
|
+
*/
|
|
11
|
+
concurrency?: number;
|
|
12
|
+
/**
|
|
13
|
+
* 单个子任务的最大数据量,默认值为 5,最大可设置值为 100
|
|
14
|
+
*/
|
|
15
|
+
maxSliceNumber?: number;
|
|
16
|
+
/**
|
|
17
|
+
* 触发进度回调函数的步长,以百分比为单位,每当发生大于等于步长的进度变化时,便触发进度回调函数。默认为每当有进度变化时,便触发进度回调函数(进度变化精度为 1%)
|
|
18
|
+
*/
|
|
19
|
+
progressCallbackStep?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// export async function asyncTaskV1(apiName: string, params: any, oldFuncName: string, isSync: boolean) {
|
|
23
|
+
// return await invokeFuncSync(apiName, params, oldFuncName, false);
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
export class Tasks<cf> {
|
|
27
|
+
private f: Function
|
|
28
|
+
|
|
29
|
+
constructor(_f?: Function) {
|
|
30
|
+
this.f = _f
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 创建异步任务
|
|
35
|
+
* @param apiName 函数的 apiName
|
|
36
|
+
* @param params 参数
|
|
37
|
+
*/
|
|
38
|
+
public async createAsyncTask(apiName: cf, params: object): Promise<void> {
|
|
39
|
+
if (apiName && params) {
|
|
40
|
+
// low_code 1.0
|
|
41
|
+
if (utils.isOnlineDev()) {// TODO 区分 4.0 vs 5.0
|
|
42
|
+
// 1.debug模式
|
|
43
|
+
if (utils.isDebug()) {
|
|
44
|
+
return await this.f(apiName).invoke(params);
|
|
45
|
+
}
|
|
46
|
+
// 2.运行时
|
|
47
|
+
let newApiName = utils.handleFuncName(null, apiName as any);
|
|
48
|
+
if (!newApiName) {
|
|
49
|
+
throw new exceptions.InvalidParamError(`The function (${apiName}) does not exist, please confirm ${apiName} exists and has been deployed.`);
|
|
50
|
+
}
|
|
51
|
+
let idOrName: any = {};
|
|
52
|
+
if (newApiName === apiName) {
|
|
53
|
+
idOrName = {
|
|
54
|
+
APIName: newApiName,
|
|
55
|
+
isInvokeByAPIName: true,
|
|
56
|
+
}
|
|
57
|
+
} else if (utils.isMicroservice()) {
|
|
58
|
+
idOrName = {
|
|
59
|
+
APIName: apiName,
|
|
60
|
+
isInvokeByAPIName: true,
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
idOrName = {
|
|
64
|
+
APIId: newApiName,
|
|
65
|
+
isInvokeByAPIName: false,
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
task_id: await Request.GetInstance().createAsyncTaskV1(idOrName, params),
|
|
70
|
+
} as any
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
// low_code 2.0
|
|
75
|
+
// 如果是本地调试模式,则直接异步执行
|
|
76
|
+
if (utils.isLocalDebug()) {
|
|
77
|
+
this.f(apiName).invoke(params);
|
|
78
|
+
return {task_id: 1234567890123456} as any;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
task_id: await Request.GetInstance().createAsyncTaskV2(apiName as string, params),
|
|
83
|
+
} as any
|
|
84
|
+
} else {
|
|
85
|
+
throw new exceptions.InvalidParamError(`context.tasks.createAsyncTask params is error`);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 创建分布式任务
|
|
91
|
+
* @param dataset 待处理数据组成的数组
|
|
92
|
+
* @param handlerFunc 用于处理数据集的全局函数的 API name
|
|
93
|
+
* @param progressCallbackFunc 任务进度发生变化时回调的全局函数的 API name,可通过传入 "" / null / undefined 跳过此步骤
|
|
94
|
+
* @param completedCallbackFunc 任务完成时回调的全局函数的 API name,可通过传入 "" / null / undefined 跳过此步骤
|
|
95
|
+
* @param options 高级配置参数,可选
|
|
96
|
+
*/
|
|
97
|
+
public async createDistributedTask(dataset: any[], handlerFunc: cf, progressCallbackFunc: cf | "" | null | undefined, completedCallbackFunc: cf | "" | null | undefined, options?: _Options): Promise<number> {
|
|
98
|
+
if (utils.isLocalDebug()) {
|
|
99
|
+
throw new exceptions.InvalidParamError("Local debugging isn't supported for distributed tasks. You can only deploy them to the cloud");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (utils.getDistributedHandleMask()) {
|
|
103
|
+
throw new exceptions.InvalidParamError("Does not support creating distributed tasks in handler function and progress callback function");
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// dataset
|
|
107
|
+
if (!(dataset instanceof Array)) {
|
|
108
|
+
throw new exceptions.InvalidParamError(`parameter dataset is not list`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// handlerFunc
|
|
112
|
+
if (!handlerFunc || typeof handlerFunc !== 'string') {
|
|
113
|
+
throw new exceptions.InvalidParamError(`parameter handlerFunc is not string or handlerFunc is empty`);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// progressCallbackFunc
|
|
117
|
+
if (progressCallbackFunc === null || progressCallbackFunc === undefined) {
|
|
118
|
+
progressCallbackFunc = "";
|
|
119
|
+
}
|
|
120
|
+
if (typeof progressCallbackFunc !== 'string') {
|
|
121
|
+
throw new exceptions.InvalidParamError(`parameter progressCallbackFunc is not string`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// completedCallbackFunc
|
|
125
|
+
if (completedCallbackFunc === null || completedCallbackFunc === undefined) {
|
|
126
|
+
completedCallbackFunc = "";
|
|
127
|
+
}
|
|
128
|
+
if (typeof completedCallbackFunc !== 'string') {
|
|
129
|
+
throw new exceptions.InvalidParamError(`parameter completedCallbackFunc is not string`);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// option.concurrency
|
|
133
|
+
if (options.concurrency === null || options.concurrency === undefined) {
|
|
134
|
+
options.concurrency = 5;
|
|
135
|
+
}
|
|
136
|
+
if ((typeof options.concurrency !== 'number') || options.concurrency <= 0) {
|
|
137
|
+
throw new exceptions.InvalidParamError(`parameter option.concurrency is not Number or not graterThan 0`);
|
|
138
|
+
}
|
|
139
|
+
// option.maxSliceNumber
|
|
140
|
+
if (options.maxSliceNumber === null || options.maxSliceNumber === undefined) {
|
|
141
|
+
options.maxSliceNumber = 5;
|
|
142
|
+
}
|
|
143
|
+
if ((typeof options.maxSliceNumber !== 'number') || options.maxSliceNumber <= 0) {
|
|
144
|
+
throw new exceptions.InvalidParamError(`parameter option.maxSliceNumber is not Number or not graterThan 0`);
|
|
145
|
+
}
|
|
146
|
+
// option.notifyStep
|
|
147
|
+
if (options.progressCallbackStep === null || options.progressCallbackStep === undefined) {
|
|
148
|
+
options.progressCallbackStep = 1;
|
|
149
|
+
}
|
|
150
|
+
if ((typeof options.progressCallbackStep !== 'number') || options.progressCallbackStep <= 0 || options.progressCallbackStep > 100) {
|
|
151
|
+
throw new exceptions.InvalidParamError(`parameter option.progressCallbackStep is not Number or not between 0 and 100`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (utils.isOnlineDev()) {
|
|
155
|
+
return Request.GetFaaSInfraInstance().createDistributeTaskV1([dataset], handlerFunc, progressCallbackFunc, completedCallbackFunc, options);
|
|
156
|
+
}
|
|
157
|
+
return Request.GetFaaSInfraInstance().createDistributeTaskV2([dataset], handlerFunc, progressCallbackFunc, completedCallbackFunc, options);
|
|
158
|
+
};
|
|
159
|
+
}
|
package/data/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface workflowVariables {
|
|
2
|
+
}
|
|
3
|
+
export declare type globalFuncNames = "a" | "b";
|
|
4
|
+
export interface globalVariablesMap {
|
|
5
|
+
a: string;
|
|
6
|
+
b: string;
|
|
7
|
+
}
|
|
8
|
+
export declare type globalVariables = keyof globalVariablesMap;
|
|
9
|
+
export interface metadataMap {
|
|
10
|
+
/**
|
|
11
|
+
* @description 用户
|
|
12
|
+
*/
|
|
13
|
+
_user: User;
|
|
14
|
+
_department: Department;
|
|
15
|
+
}
|
|
16
|
+
export declare type currentObjApiName = "_user";
|
|
17
|
+
interface User {
|
|
18
|
+
_name: string;
|
|
19
|
+
_id: number;
|
|
20
|
+
_department: Department;
|
|
21
|
+
}
|
|
22
|
+
interface Department {
|
|
23
|
+
_id: number;
|
|
24
|
+
_name: string;
|
|
25
|
+
_superior: Department;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
package/data/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAsC,CAAC;AAMtC,CAAC"}
|
package/data/index.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface workflowVariables { };
|
|
2
|
+
export type globalFuncNames = "a" | "b"
|
|
3
|
+
|
|
4
|
+
export interface globalVariablesMap {
|
|
5
|
+
a: string,
|
|
6
|
+
b: string
|
|
7
|
+
};
|
|
8
|
+
export type globalVariables = keyof globalVariablesMap;
|
|
9
|
+
|
|
10
|
+
export interface metadataMap {
|
|
11
|
+
/**
|
|
12
|
+
* @description 用户
|
|
13
|
+
*/
|
|
14
|
+
_user: User,
|
|
15
|
+
_department: Department,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type currentObjApiName = "_user"
|
|
19
|
+
|
|
20
|
+
interface User {
|
|
21
|
+
_name: string,
|
|
22
|
+
_id: number
|
|
23
|
+
_department: Department,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface Department {
|
|
27
|
+
_id: number,
|
|
28
|
+
_name: string,
|
|
29
|
+
_superior: Department,
|
|
30
|
+
}
|
package/hooks/api.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as common from "@byted-apaas/server-common-node";
|
|
2
|
+
import { IGfCtx } from "@byted-apaas/server-common-node/context/IContext";
|
|
3
|
+
import { Tasks } from "../context/tasks/tasks";
|
|
4
|
+
import { DB } from "../context/db/impl/db";
|
|
5
|
+
import { _Resources } from "../context/resources/impl/resources";
|
|
6
|
+
import { Message } from "../context/msg/msg";
|
|
7
|
+
import { IMetaData } from "../context/metadata/metadata";
|
|
8
|
+
declare type invokeGlobalFuncT = (funcNames: string) => {
|
|
9
|
+
invoke: (params?: any) => Promise<any>;
|
|
10
|
+
};
|
|
11
|
+
export declare function getFunctionSync(context?: any, logger?: common.Logger): invokeGlobalFuncT;
|
|
12
|
+
export declare function setRespHeader(): () => void;
|
|
13
|
+
export declare function toString(value: any): string;
|
|
14
|
+
export declare function setRedirectLocation(context: any): (location: string) => void;
|
|
15
|
+
export declare function method(): string;
|
|
16
|
+
export declare function mountMetadata(context: any): void;
|
|
17
|
+
export declare function mountWorkflowFeature(context: any): void;
|
|
18
|
+
export declare function terminateWorkflow(): (workflowInstanceId: number, options: any) => Promise<void>;
|
|
19
|
+
export declare function mockFlowFeature(context: any): any;
|
|
20
|
+
export declare function invokeMicroservice(): (apiName: string) => {
|
|
21
|
+
/**
|
|
22
|
+
* 同步调用微服务
|
|
23
|
+
* @param path 请求路径,如:/ping
|
|
24
|
+
* @param method 请求方法,默认为 GET
|
|
25
|
+
* @param params 请求参数,默认为 undefined
|
|
26
|
+
*/
|
|
27
|
+
invoke: (path: string, method?: string, params?: any) => Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* 异步调用微服务
|
|
30
|
+
* @param path 请求路径,如:/ping
|
|
31
|
+
* @param method 请求方法,默认为 GET
|
|
32
|
+
* @param params 请求参数,默认为 undefined
|
|
33
|
+
*/
|
|
34
|
+
invokeAsync: (path: string, method?: string, params?: any) => Promise<any>;
|
|
35
|
+
};
|
|
36
|
+
export declare const db: DB<IGfCtx, import("../data").metadataMap>;
|
|
37
|
+
export declare const resources: _Resources;
|
|
38
|
+
export declare const msg: Message;
|
|
39
|
+
export declare const tasks: Tasks<unknown>;
|
|
40
|
+
export declare const cloudfunction: invokeGlobalFuncT;
|
|
41
|
+
export declare const microservice: (apiName: string) => {
|
|
42
|
+
/**
|
|
43
|
+
* 同步调用微服务
|
|
44
|
+
* @param path 请求路径,如:/ping
|
|
45
|
+
* @param method 请求方法,默认为 GET
|
|
46
|
+
* @param params 请求参数,默认为 undefined
|
|
47
|
+
*/
|
|
48
|
+
invoke: (path: string, method?: string, params?: any) => Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* 异步调用微服务
|
|
51
|
+
* @param path 请求路径,如:/ping
|
|
52
|
+
* @param method 请求方法,默认为 GET
|
|
53
|
+
* @param params 请求参数,默认为 undefined
|
|
54
|
+
*/
|
|
55
|
+
invokeAsync: (path: string, method?: string, params?: any) => Promise<any>;
|
|
56
|
+
};
|
|
57
|
+
export declare const workflow: {
|
|
58
|
+
terminate: (workflowInstanceId: number, options: any) => Promise<void>;
|
|
59
|
+
};
|
|
60
|
+
export declare const metaData: IMetaData<{}>;
|
|
61
|
+
export { Application } from "../application/impl/impl";
|
package/hooks/api.js
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Application = exports.metaData = exports.workflow = exports.microservice = exports.cloudfunction = exports.tasks = exports.msg = exports.resources = exports.db = exports.invokeMicroservice = exports.mockFlowFeature = exports.terminateWorkflow = exports.mountWorkflowFeature = exports.mountMetadata = exports.method = exports.setRedirectLocation = exports.toString = exports.setRespHeader = exports.getFunctionSync = void 0;
|
|
4
|
+
const common = require("@byted-apaas/server-common-node");
|
|
5
|
+
const exceptions_1 = require("@byted-apaas/server-common-node/utils/exceptions");
|
|
6
|
+
const api = require("../hooks/api");
|
|
7
|
+
const metadataApi = require("../context/metadata/metadata");
|
|
8
|
+
const tasks_1 = require("../context/tasks/tasks");
|
|
9
|
+
const db_1 = require("../context/db/impl/db");
|
|
10
|
+
const resources_1 = require("../context/resources/impl/resources");
|
|
11
|
+
const msg_1 = require("../context/msg/msg");
|
|
12
|
+
const Request = require("../request/interface");
|
|
13
|
+
const constants = require("../constants/constants");
|
|
14
|
+
const utils_1 = require("@byted-apaas/server-common-node/utils/utils");
|
|
15
|
+
const metadata_1 = require("../context/metadata/metadata");
|
|
16
|
+
const nodeCls = require("node-cls");
|
|
17
|
+
const nodeClsCtx = common.nodeClsCtx;
|
|
18
|
+
const exceptions = common.exceptions;
|
|
19
|
+
const utils = common.utils;
|
|
20
|
+
const checkUtils = common.checkUtils;
|
|
21
|
+
const functionSources = common.constants.functionSources;
|
|
22
|
+
// 同步调用云函数
|
|
23
|
+
function getFunctionSync(context, logger) {
|
|
24
|
+
return (funcName) => {
|
|
25
|
+
if (utils.isOnlineDev()) {
|
|
26
|
+
let oldFuncName = funcName;
|
|
27
|
+
if (!utils.isMicroservice()) {
|
|
28
|
+
funcName = utils.handleFuncName(null, funcName);
|
|
29
|
+
if (!funcName) {
|
|
30
|
+
throw new exceptions.InvalidParamError(`The function (${oldFuncName}) does not exist, please confirm ${oldFuncName} exists and has been deployed.`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
funcName = undefined;
|
|
35
|
+
}
|
|
36
|
+
let idOrName = {};
|
|
37
|
+
// 2.0 通过 apiAlias 触发
|
|
38
|
+
if (funcName === oldFuncName) {
|
|
39
|
+
idOrName = {
|
|
40
|
+
APIName: funcName,
|
|
41
|
+
isInvokeByAPIName: true,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
else if (utils.isMicroservice()) {
|
|
45
|
+
// 微服务
|
|
46
|
+
idOrName = {
|
|
47
|
+
APIName: oldFuncName,
|
|
48
|
+
isInvokeByAPIName: true,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
else { // 1.0 通过 apiID 触发
|
|
52
|
+
idOrName = {
|
|
53
|
+
APIId: funcName,
|
|
54
|
+
isInvokeByAPIName: false,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
invoke: async (params) => {
|
|
59
|
+
// 微服务的场景
|
|
60
|
+
if (utils.isMicroservice()) {
|
|
61
|
+
return await Request.GetInstance().invokeFuncSync(idOrName, params);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
let func = utils.getGlobalFunc(null, funcName);
|
|
65
|
+
if (!func) {
|
|
66
|
+
// 改为远程调用
|
|
67
|
+
return await Request.GetInstance().invokeFuncSync(idOrName, params);
|
|
68
|
+
}
|
|
69
|
+
let loopMasks = [funcName];
|
|
70
|
+
let reqCtx = nodeCls.get("loopCtx");
|
|
71
|
+
if (reqCtx && reqCtx.loopMasks && Array.isArray(reqCtx.loopMasks)) {
|
|
72
|
+
if (reqCtx.loopMasks.includes(funcName)) {
|
|
73
|
+
throw new exceptions.InvalidParamError(`Task execution forms a loop.`);
|
|
74
|
+
}
|
|
75
|
+
loopMasks.push(...reqCtx.loopMasks);
|
|
76
|
+
}
|
|
77
|
+
// 修改 source 全局函数
|
|
78
|
+
let ctx = nodeCls.create("loopCtx");
|
|
79
|
+
ctx.loopMasks = loopMasks;
|
|
80
|
+
return await ctx.run(async () => {
|
|
81
|
+
const dynCtx = nodeClsCtx.getDynCtx();
|
|
82
|
+
dynCtx.source = functionSources.globalFunction;
|
|
83
|
+
return await dynCtx.run(async () => {
|
|
84
|
+
return await common.hooks.invoke(func, params, context, logger);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
invoke: async (params) => {
|
|
93
|
+
let func = (0, utils_1.getRequireFunc)()(funcName);
|
|
94
|
+
if (!func) {
|
|
95
|
+
throw new exceptions.InvalidParamError(`The function (${funcName}) does not exist.`);
|
|
96
|
+
}
|
|
97
|
+
let loopMasks = [funcName];
|
|
98
|
+
let reqCtx = nodeCls.get("loopCtx");
|
|
99
|
+
if (reqCtx && reqCtx.loopMasks && Array.isArray(reqCtx.loopMasks)) {
|
|
100
|
+
if (reqCtx.loopMasks.includes(funcName)) {
|
|
101
|
+
throw new exceptions.InvalidParamError(`Task execution forms a loop.`);
|
|
102
|
+
}
|
|
103
|
+
loopMasks.push(...reqCtx.loopMasks);
|
|
104
|
+
}
|
|
105
|
+
// 修改 source 全局函数
|
|
106
|
+
let ctx = nodeCls.create("loopCtx");
|
|
107
|
+
ctx.loopMasks = loopMasks;
|
|
108
|
+
return await ctx.run(async () => {
|
|
109
|
+
const dynCtx = nodeClsCtx.getDynCtx();
|
|
110
|
+
dynCtx.source = functionSources.globalFunction;
|
|
111
|
+
return await dynCtx.run(async () => {
|
|
112
|
+
return await common.hooks.invoke(func, params, context, logger);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
exports.getFunctionSync = getFunctionSync;
|
|
120
|
+
// 设置请求头
|
|
121
|
+
function setRespHeader() {
|
|
122
|
+
return function () {
|
|
123
|
+
switch (arguments.length) {
|
|
124
|
+
case 1:
|
|
125
|
+
if (checkUtils.isObject(arguments[0])) {
|
|
126
|
+
try {
|
|
127
|
+
for (let k of Object.keys(arguments[0])) {
|
|
128
|
+
utils.setHttpHeaders(k, toString(arguments[0][k]));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
throw new exceptions.InternalError(err.message);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
throw new exceptions.InvalidParamError("setResponseHeaders param is not a object");
|
|
137
|
+
}
|
|
138
|
+
break;
|
|
139
|
+
case 2:
|
|
140
|
+
try {
|
|
141
|
+
utils.setHttpHeaders(arguments[0], toString(arguments[1]));
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
throw new exceptions.InternalError(err.message);
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
default:
|
|
148
|
+
throw new exceptions.InvalidParamError("the number of setResponseHeaders param is 1 or 2");
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
exports.setRespHeader = setRespHeader;
|
|
153
|
+
function toString(value) {
|
|
154
|
+
if (value instanceof Array) {
|
|
155
|
+
let arr = [];
|
|
156
|
+
for (let v of value) {
|
|
157
|
+
if (typeof v === "string") {
|
|
158
|
+
arr.push(v);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
arr.push(utils.stringify(v));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return arr.join(", ");
|
|
165
|
+
}
|
|
166
|
+
else if (typeof value === "string") {
|
|
167
|
+
return value;
|
|
168
|
+
}
|
|
169
|
+
return utils.stringify(value);
|
|
170
|
+
}
|
|
171
|
+
exports.toString = toString;
|
|
172
|
+
function setRedirectLocation(context) {
|
|
173
|
+
return function (location) {
|
|
174
|
+
context.setResponseHeader(constants.httpHeaderKeys.location, location);
|
|
175
|
+
context.setResponseHeader(constants.httpHeaderKeys.statusCode, String(constants.httpStatusCodes.redirect));
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
exports.setRedirectLocation = setRedirectLocation;
|
|
179
|
+
// 请求方法
|
|
180
|
+
function method() {
|
|
181
|
+
return utils.getHttpMethod();
|
|
182
|
+
}
|
|
183
|
+
exports.method = method;
|
|
184
|
+
function mountMetadata(context) {
|
|
185
|
+
// 1.挂载metadata
|
|
186
|
+
context.metadata = metadataApi.metadata(context);
|
|
187
|
+
// 2.挂载metaType
|
|
188
|
+
if (!global.kunlun) {
|
|
189
|
+
global.kunlun = {};
|
|
190
|
+
}
|
|
191
|
+
global.kunlun.metaType = metadataApi.metaType();
|
|
192
|
+
}
|
|
193
|
+
exports.mountMetadata = mountMetadata;
|
|
194
|
+
function mountWorkflowFeature(context) {
|
|
195
|
+
if (context && context.workflow) {
|
|
196
|
+
context.workflow.updateVariable = common.updateVariable(context, Request.GetInstance().updateWorkflowVariables);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
context.workflow = {};
|
|
200
|
+
}
|
|
201
|
+
// 此处挂载保证了 terminate 存在
|
|
202
|
+
context.workflow.terminate = terminateWorkflow();
|
|
203
|
+
}
|
|
204
|
+
exports.mountWorkflowFeature = mountWorkflowFeature;
|
|
205
|
+
function terminateWorkflow() {
|
|
206
|
+
return async (workflowInstanceId, options) => {
|
|
207
|
+
let operator = utils.getUser()._id, reason = null;
|
|
208
|
+
if (options && options.reason) {
|
|
209
|
+
// instanceof 改动5
|
|
210
|
+
// if (options.reason instanceof common.fieldType.Multilingual) {
|
|
211
|
+
if (common.fieldType.isKFieldTypeMultilingual(options.reason)) {
|
|
212
|
+
reason = options.reason.toString();
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
reason = new common.fieldType.Multilingual(options.reason).toString();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
await Request.GetInstance().terminateWorkflowInstance(workflowInstanceId, operator, reason);
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
exports.terminateWorkflow = terminateWorkflow;
|
|
222
|
+
function mockFlowFeature(context) {
|
|
223
|
+
if (!context.flow) {
|
|
224
|
+
context.flow = {};
|
|
225
|
+
}
|
|
226
|
+
context.flow.updateVariable = common.updateVariable(context, Request.GetInstance().updateWorkflowVariables);
|
|
227
|
+
context.flow.getExecutionUserTaskInfo = mockGetExecutionUserTaskInfo();
|
|
228
|
+
context.flow.execute = mockExecuteFlow();
|
|
229
|
+
context.flow.revokeExecution = mockRevokeExecution();
|
|
230
|
+
context.flow.getExecutionInfo = mockGetExecutionInfo();
|
|
231
|
+
return context.flow;
|
|
232
|
+
}
|
|
233
|
+
exports.mockFlowFeature = mockFlowFeature;
|
|
234
|
+
function mockGetExecutionUserTaskInfo() {
|
|
235
|
+
return async (executionId) => {
|
|
236
|
+
if (!executionId || typeof executionId !== "number") {
|
|
237
|
+
throw new exceptions_1.InvalidParamError(`param's type (${executionId}) need number, but is ${typeof executionId}`);
|
|
238
|
+
}
|
|
239
|
+
return await Request.GetInstance().getExecutionUserTaskInfo(executionId);
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function mockExecuteFlow() {
|
|
243
|
+
return async (APIName, options) => {
|
|
244
|
+
if (!APIName || typeof APIName !== "string") {
|
|
245
|
+
throw new exceptions_1.InvalidParamError(`param's type (${APIName}) need string, but is ${typeof APIName}`);
|
|
246
|
+
}
|
|
247
|
+
if (options && options.params && checkUtils.isNotObject(options.params)) {
|
|
248
|
+
throw new exceptions_1.InvalidParamError(`options.params's type (${options}) need object, but is ${Array.isArray(options) ? "array" : typeof options.params}`);
|
|
249
|
+
}
|
|
250
|
+
if (!options) {
|
|
251
|
+
options = {};
|
|
252
|
+
}
|
|
253
|
+
return await Request.GetInstance().executeFlow(APIName, options);
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function mockRevokeExecution() {
|
|
257
|
+
return async (executionId, options) => {
|
|
258
|
+
if (!executionId || typeof executionId !== "number") {
|
|
259
|
+
throw new exceptions_1.InvalidParamError(`param's type (${executionId}) is need number, but is ${typeof executionId}`);
|
|
260
|
+
}
|
|
261
|
+
return await Request.GetInstance().revokeExecution(executionId, options);
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function mockGetExecutionInfo() {
|
|
265
|
+
return async (executionId) => {
|
|
266
|
+
if (!executionId || typeof executionId !== "number") {
|
|
267
|
+
throw new exceptions_1.InvalidParamError(`param's type (${executionId}) is not matched to number, but is ${typeof executionId}`);
|
|
268
|
+
}
|
|
269
|
+
return await Request.GetInstance().getExecutionInfo(executionId);
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function invokeMicroservice() {
|
|
273
|
+
/**
|
|
274
|
+
* 微服务
|
|
275
|
+
* @param apiName 微服务的名称
|
|
276
|
+
*/
|
|
277
|
+
return function (apiName) {
|
|
278
|
+
if (!apiName || typeof (apiName) !== "string") {
|
|
279
|
+
throw new exceptions_1.InvalidParamError(`The apiName (${apiName}) is invalid and should be a non-empty field string.`);
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
/**
|
|
283
|
+
* 同步调用微服务
|
|
284
|
+
* @param path 请求路径,如:/ping
|
|
285
|
+
* @param method 请求方法,默认为 GET
|
|
286
|
+
* @param params 请求参数,默认为 undefined
|
|
287
|
+
*/
|
|
288
|
+
invoke: async function (path, method = "GET", params = undefined) {
|
|
289
|
+
if (!path || typeof (path) !== "string") {
|
|
290
|
+
throw new exceptions_1.InvalidParamError(`The path (${path}) is invalid and should be a non-empty field string.`);
|
|
291
|
+
}
|
|
292
|
+
if (!method || typeof (method) !== "string") {
|
|
293
|
+
throw new exceptions_1.InvalidParamError(`The method (${method}) is invalid and should be a non-empty field string.`);
|
|
294
|
+
}
|
|
295
|
+
return await Request.GetFaaSInfraInstance().invokeMicroserviceSync(apiName, path, method, params);
|
|
296
|
+
},
|
|
297
|
+
/**
|
|
298
|
+
* 异步调用微服务
|
|
299
|
+
* @param path 请求路径,如:/ping
|
|
300
|
+
* @param method 请求方法,默认为 GET
|
|
301
|
+
* @param params 请求参数,默认为 undefined
|
|
302
|
+
*/
|
|
303
|
+
invokeAsync: async function (path, method = "GET", params = undefined) {
|
|
304
|
+
if (!path || typeof (path) !== "string") {
|
|
305
|
+
throw new exceptions_1.InvalidParamError(`The path (${path}) is invalid and should be a non-empty field string.`);
|
|
306
|
+
}
|
|
307
|
+
if (!method || typeof (method) !== "string") {
|
|
308
|
+
throw new exceptions_1.InvalidParamError(`The method (${method}) is invalid and should be a non-empty field string.`);
|
|
309
|
+
}
|
|
310
|
+
return await Request.GetFaaSInfraInstance().invokeMicroserviceAsync(apiName, path, method, params);
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
exports.invokeMicroservice = invokeMicroservice;
|
|
316
|
+
exports.db = new db_1.DB();
|
|
317
|
+
exports.resources = new resources_1._Resources();
|
|
318
|
+
exports.msg = new msg_1.Message();
|
|
319
|
+
exports.tasks = new tasks_1.Tasks();
|
|
320
|
+
exports.cloudfunction = api.getFunctionSync();
|
|
321
|
+
exports.microservice = api.invokeMicroservice();
|
|
322
|
+
exports.workflow = {
|
|
323
|
+
terminate: terminateWorkflow(),
|
|
324
|
+
};
|
|
325
|
+
exports.metaData = new metadata_1.MetaData(null);
|
|
326
|
+
var impl_1 = require("../application/impl/impl");
|
|
327
|
+
Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return impl_1.Application; } });
|
|
328
|
+
//# sourceMappingURL=api.js.map
|
package/hooks/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;;AAAA,0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