@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,91 @@
|
|
|
1
|
+
import {headers} from "@byted-apaas/server-common-node/constants/constants";
|
|
2
|
+
import * as common from "@byted-apaas/server-common-node";
|
|
3
|
+
import {GetInstance} from "./interface";
|
|
4
|
+
import {AppCtx} from "../application/application";
|
|
5
|
+
import {AppCredential} from "@byted-apaas/server-common-node/credential/credential";
|
|
6
|
+
import {InvalidParamError} from "@byted-apaas/server-common-node/utils/exceptions";
|
|
7
|
+
import {runCtxForOpenSDK} from "../application/impl/common";
|
|
8
|
+
|
|
9
|
+
const utils = common.utils;
|
|
10
|
+
const checkUtils = common.checkUtils;
|
|
11
|
+
const exceptions = common.exceptions;
|
|
12
|
+
const nodeCls = require("node-cls");
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
function checkLoopCtx(reqCtx: any): any {
|
|
16
|
+
return reqCtx && reqCtx.loopMasks && Array.isArray(reqCtx.loopMasks)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function getDebugExtraInfo() {
|
|
20
|
+
let extra: Record<string, string> = {
|
|
21
|
+
"FunctionFrameVersion": "FunctionFrameV2",
|
|
22
|
+
};
|
|
23
|
+
if (utils.isDebug()) {
|
|
24
|
+
extra.DebugInfo = utils.getDebugCode();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return extra
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function getTriggerCtx(): any {
|
|
31
|
+
let triggerCtx: Record<string, any> = {}, taskID = utils.getTriggerTaskID();
|
|
32
|
+
if (taskID) {
|
|
33
|
+
triggerCtx[headers.triggerTaskId] = taskID;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let temp = utils.getDistributedHandleMask();
|
|
37
|
+
if (temp) {
|
|
38
|
+
triggerCtx[headers.distributedHandleMask] = temp;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let reqCtx = nodeCls.get(headers.loopCtxKey);
|
|
42
|
+
if (checkLoopCtx(reqCtx)) {
|
|
43
|
+
triggerCtx[headers.loopMasks] = reqCtx.loopMasks
|
|
44
|
+
}
|
|
45
|
+
return triggerCtx;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function transMapToFlowVariable(params: Record<string, any>): { api_name: string, value: any }[] {
|
|
49
|
+
let variables: { api_name: string, value: any }[] = [];
|
|
50
|
+
if (params) {
|
|
51
|
+
if (checkUtils.isNotObject(params)) {
|
|
52
|
+
throw new exceptions.InvalidParamError(`params should be object, and not array`);
|
|
53
|
+
}
|
|
54
|
+
for (const [k, v] of Object.entries(params)) {
|
|
55
|
+
variables.push({api_name: k, value: v});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return variables;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function transFlowVariableToMap(variables: { api_name: string, value: any }[]): Record<string, any> {
|
|
62
|
+
let data: Record<string, any> = {};
|
|
63
|
+
if (variables && Array.isArray(variables)) {
|
|
64
|
+
for (const o of variables) {
|
|
65
|
+
data[o.api_name] = o.value
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function getTenantInfo(appCtx: AppCtx): Promise<any> {
|
|
72
|
+
if (!appCtx) {
|
|
73
|
+
appCtx = {
|
|
74
|
+
mode: "faasSDK",
|
|
75
|
+
credential: new AppCredential(utils.getClientId(), utils.getClientSecret(), true)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!appCtx.credential) {
|
|
79
|
+
throw new InvalidParamError(`credential is empty`)
|
|
80
|
+
}
|
|
81
|
+
return await runCtxForOpenSDK(appCtx, async () => {
|
|
82
|
+
return await GetInstance().getTenantInfo(appCtx);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export async function getNamespaceForOpenAndFaaSSDK(): Promise<string> {
|
|
87
|
+
if (utils.isOpenSDKMode()) { // TODO check need assign?
|
|
88
|
+
return (await utils.getCredential().getTenantInfo()).namespace;
|
|
89
|
+
}
|
|
90
|
+
return utils.getNamespaceFromCtx();
|
|
91
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GetHttpConfig, PostHttpConfig } from "@byted-apaas/server-common-node/http/config";
|
|
2
|
+
export declare const metricsMethodKeys: Record<string, string>;
|
|
3
|
+
export declare const openapiHttpPath: {
|
|
4
|
+
getBatchAttachmentToken: PostHttpConfig;
|
|
5
|
+
oql: PostHttpConfig;
|
|
6
|
+
getExecutionUserTaskInfo: GetHttpConfig;
|
|
7
|
+
executeFlow: PostHttpConfig;
|
|
8
|
+
revokeExecution: PostHttpConfig;
|
|
9
|
+
getExecutionInfo: GetHttpConfig;
|
|
10
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openapiHttpPath = exports.metricsMethodKeys = void 0;
|
|
4
|
+
const config_1 = require("@byted-apaas/server-common-node/http/config");
|
|
5
|
+
const constants_1 = require("@byted-apaas/server-common-node/http/constants");
|
|
6
|
+
exports.metricsMethodKeys = {
|
|
7
|
+
// openapi
|
|
8
|
+
// file upload & download
|
|
9
|
+
getBatchAttachmentToken: "openapi_getBatchAttachmentToken",
|
|
10
|
+
oql: "openapi_oql",
|
|
11
|
+
// flow
|
|
12
|
+
getExecutionUserTaskInfo: "openapi_getExecutionUserTaskInfo",
|
|
13
|
+
getExecutionInfo: "openapi_getExecutionInfo",
|
|
14
|
+
revokeExecution: "openapi_revokeExecution",
|
|
15
|
+
executeFlow: "openapi_executeFlow",
|
|
16
|
+
};
|
|
17
|
+
exports.openapiHttpPath = {
|
|
18
|
+
getBatchAttachmentToken: new config_1.PostHttpConfig(`/attachment/v1/getBatchAttachmentToken`, exports.metricsMethodKeys.getBatchAttachmentToken),
|
|
19
|
+
oql: new config_1.PostHttpConfig(`/data/v5/namespaces/${constants_1.replaceKeys.namespace}/records/query`, exports.metricsMethodKeys.oql),
|
|
20
|
+
// flow
|
|
21
|
+
getExecutionUserTaskInfo: new config_1.GetHttpConfig(`/api/flow/v1/namespaces/${constants_1.replaceKeys.namespace}/executions/${constants_1.replaceKeys.id}/userTaskInfo`, exports.metricsMethodKeys.getExecutionUserTaskInfo),
|
|
22
|
+
executeFlow: new config_1.PostHttpConfig(`/api/flow/v1/namespaces/${constants_1.replaceKeys.namespace}/flows/${constants_1.replaceKeys.apiName}/execute`, exports.metricsMethodKeys.executeFlow),
|
|
23
|
+
revokeExecution: new config_1.PostHttpConfig(`/api/flow/v1/namespaces/${constants_1.replaceKeys.namespace}/executions/${constants_1.replaceKeys.id}/revoke`, exports.metricsMethodKeys.revokeExecution),
|
|
24
|
+
getExecutionInfo: new config_1.GetHttpConfig(`/api/flow/v1/namespaces/${constants_1.replaceKeys.namespace}/executions/${constants_1.replaceKeys.id}/detail`, exports.metricsMethodKeys.getExecutionInfo),
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":";;;AAAA,wEAA0F;AAC1F,8EAA2E;AAE9D,QAAA,iBAAiB,GAA2B;IACrD,UAAU;IACV,yBAAyB;IACzB,uBAAuB,EAAE,iCAAiC;IAC1D,GAAG,EAAE,aAAa;IAClB,OAAO;IACP,wBAAwB,EAAE,kCAAkC;IAC5D,gBAAgB,EAAE,0BAA0B;IAC5C,eAAe,EAAE,yBAAyB;IAC1C,WAAW,EAAE,qBAAqB;CACrC,CAAA;AAEY,QAAA,eAAe,GAAG;IAC3B,uBAAuB,EAAE,IAAI,uBAAc,CAAC,wCAAwC,EAAE,yBAAiB,CAAC,uBAAuB,CAAC;IAChI,GAAG,EAAE,IAAI,uBAAc,CAAC,uBAAuB,uBAAW,CAAC,SAAS,gBAAgB,EAAE,yBAAiB,CAAC,GAAG,CAAC;IAE5G,OAAO;IACP,wBAAwB,EAAE,IAAI,sBAAa,CAAC,2BAA2B,uBAAW,CAAC,SAAS,eAAe,uBAAW,CAAC,EAAE,eAAe,EAAE,yBAAiB,CAAC,wBAAwB,CAAC;IACrL,WAAW,EAAE,IAAI,uBAAc,CAAC,2BAA2B,uBAAW,CAAC,SAAS,UAAU,uBAAW,CAAC,OAAO,UAAU,EAAE,yBAAiB,CAAC,WAAW,CAAC;IACvJ,eAAe,EAAE,IAAI,uBAAc,CAAC,2BAA2B,uBAAW,CAAC,SAAS,eAAe,uBAAW,CAAC,EAAE,SAAS,EAAE,yBAAiB,CAAC,eAAe,CAAC;IAC9J,gBAAgB,EAAE,IAAI,sBAAa,CAAC,2BAA2B,uBAAW,CAAC,SAAS,eAAe,uBAAW,CAAC,EAAE,SAAS,EAAE,yBAAiB,CAAC,gBAAgB,CAAC;CAClK,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {GetHttpConfig, PostHttpConfig} from "@byted-apaas/server-common-node/http/config";
|
|
2
|
+
import {replaceKeys} from "@byted-apaas/server-common-node/http/constants";
|
|
3
|
+
|
|
4
|
+
export const metricsMethodKeys: Record<string, string> = {
|
|
5
|
+
// openapi
|
|
6
|
+
// file upload & download
|
|
7
|
+
getBatchAttachmentToken: "openapi_getBatchAttachmentToken",
|
|
8
|
+
oql: "openapi_oql",
|
|
9
|
+
// flow
|
|
10
|
+
getExecutionUserTaskInfo: "openapi_getExecutionUserTaskInfo",
|
|
11
|
+
getExecutionInfo: "openapi_getExecutionInfo",
|
|
12
|
+
revokeExecution: "openapi_revokeExecution",
|
|
13
|
+
executeFlow: "openapi_executeFlow",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const openapiHttpPath = {
|
|
17
|
+
getBatchAttachmentToken: new PostHttpConfig(`/attachment/v1/getBatchAttachmentToken`, metricsMethodKeys.getBatchAttachmentToken),
|
|
18
|
+
oql: new PostHttpConfig(`/data/v5/namespaces/${replaceKeys.namespace}/records/query`, metricsMethodKeys.oql),
|
|
19
|
+
|
|
20
|
+
// flow
|
|
21
|
+
getExecutionUserTaskInfo: new GetHttpConfig(`/api/flow/v1/namespaces/${replaceKeys.namespace}/executions/${replaceKeys.id}/userTaskInfo`, metricsMethodKeys.getExecutionUserTaskInfo),
|
|
22
|
+
executeFlow: new PostHttpConfig(`/api/flow/v1/namespaces/${replaceKeys.namespace}/flows/${replaceKeys.apiName}/execute`, metricsMethodKeys.executeFlow),
|
|
23
|
+
revokeExecution: new PostHttpConfig(`/api/flow/v1/namespaces/${replaceKeys.namespace}/executions/${replaceKeys.id}/revoke`, metricsMethodKeys.revokeExecution),
|
|
24
|
+
getExecutionInfo: new GetHttpConfig(`/api/flow/v1/namespaces/${replaceKeys.namespace}/executions/${replaceKeys.id}/detail`, metricsMethodKeys.getExecutionInfo),
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IFaaSInfraRequest } from "./interface";
|
|
2
|
+
export declare class FaaSInfraRequest implements IFaaSInfraRequest {
|
|
3
|
+
constructor();
|
|
4
|
+
createDistributeTaskV1(dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: any): Promise<any>;
|
|
5
|
+
createDistributeTaskV2(dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: any): Promise<any>;
|
|
6
|
+
invokeMicroserviceSync(apiName: string, path: string, method: string, body: any): Promise<any>;
|
|
7
|
+
invokeMicroserviceAsync(apiName: string, path: string, method: string, body: any): Promise<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FaaSInfraRequest = void 0;
|
|
4
|
+
const common = require("@byted-apaas/server-common-node");
|
|
5
|
+
const headers = common.constants.headers;
|
|
6
|
+
const commonHttp = common.http;
|
|
7
|
+
const faasinfra = common.http.faasinfra;
|
|
8
|
+
const faasinfraHttpPath = common.http.faasinfraHttpPath;
|
|
9
|
+
const replaceKeys = common.http.replaceKeys;
|
|
10
|
+
const exceptions = common.exceptions;
|
|
11
|
+
const utils = common.utils;
|
|
12
|
+
const nodeCls = require("node-cls");
|
|
13
|
+
const distributedHandleMask = headers.distributedHandleMask;
|
|
14
|
+
const loopMasks = headers.loopMasks;
|
|
15
|
+
const loopMasksKey = headers.loopMasksKey;
|
|
16
|
+
const loopCtxKey = headers.loopCtxKey;
|
|
17
|
+
const url_1 = require("url");
|
|
18
|
+
const exceptions_1 = require("@byted-apaas/server-common-node/utils/exceptions");
|
|
19
|
+
class FaaSInfraRequest {
|
|
20
|
+
constructor() {
|
|
21
|
+
}
|
|
22
|
+
async createDistributeTaskV1(dataset, handlerFunc, progressCallbackFunc, completedCallbackFunc, options) {
|
|
23
|
+
// 1.获取 options
|
|
24
|
+
let config = commonHttp.getOptions(null, faasinfraHttpPath.createDistributedTask);
|
|
25
|
+
// 2.构造url
|
|
26
|
+
let urlPath = config._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
27
|
+
// 3.请求
|
|
28
|
+
config.json = {
|
|
29
|
+
"domainName": utils.getTenantNameFromCtx(),
|
|
30
|
+
"namespace": utils.getNamespaceFromCtx(),
|
|
31
|
+
"userId": utils.getUserIDFromCtx(),
|
|
32
|
+
"dataset": dataset,
|
|
33
|
+
"handlerFunc": handlerFunc,
|
|
34
|
+
"progressCallbackFunc": progressCallbackFunc,
|
|
35
|
+
"completedCallbackFunc": completedCallbackFunc,
|
|
36
|
+
"options": options
|
|
37
|
+
};
|
|
38
|
+
let task_id = utils.getTriggerTaskID();
|
|
39
|
+
if (task_id) {
|
|
40
|
+
config.json[headers.triggerTaskId] = task_id;
|
|
41
|
+
}
|
|
42
|
+
let loopCtx = nodeCls.get(loopCtxKey);
|
|
43
|
+
if (checkLoopCtx(loopCtx)) {
|
|
44
|
+
config.json[loopMasksKey] = loopCtx.loopMasks;
|
|
45
|
+
if (!utils.isMicroservice() && (handlerFunc !== "" && config.json[loopMasksKey].includes(utils.handleFuncName({}, handlerFunc))) ||
|
|
46
|
+
(progressCallbackFunc != "" && config.json[loopMasksKey].includes(utils.handleFuncName({}, progressCallbackFunc))) ||
|
|
47
|
+
(completedCallbackFunc != "" && config.json[loopMasksKey].includes(utils.handleFuncName({}, completedCallbackFunc)))) {
|
|
48
|
+
throw new exceptions.InvalidParamError(`Task execution forms a loop.`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return await faasinfra.doRequest(null, urlPath, config);
|
|
52
|
+
}
|
|
53
|
+
async createDistributeTaskV2(dataset, handlerFunc, progressCallbackFunc, completedCallbackFunc, options) {
|
|
54
|
+
// 检查函数是否存在
|
|
55
|
+
utils.requireFunction(handlerFunc);
|
|
56
|
+
// 1.获取 options
|
|
57
|
+
let config = commonHttp.getOptions(null, faasinfraHttpPath.createDistributedTaskV2);
|
|
58
|
+
// 2.构造url
|
|
59
|
+
let urlPath = config._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
60
|
+
// 3.请求
|
|
61
|
+
config.json = {
|
|
62
|
+
"domainName": utils.getTenantNameFromCtx(),
|
|
63
|
+
"namespace": utils.getNamespaceFromCtx(),
|
|
64
|
+
"userId": utils.getUserIDFromCtx(),
|
|
65
|
+
"dataset": dataset,
|
|
66
|
+
"handlerFunc": handlerFunc,
|
|
67
|
+
"progressCallbackFunc": progressCallbackFunc,
|
|
68
|
+
"completedCallbackFunc": completedCallbackFunc,
|
|
69
|
+
"options": options,
|
|
70
|
+
"extra": getDebugExtraInfo()
|
|
71
|
+
};
|
|
72
|
+
let task_id = utils.getTriggerTaskID();
|
|
73
|
+
if (task_id) {
|
|
74
|
+
config.json[headers.triggerTaskId] = task_id;
|
|
75
|
+
}
|
|
76
|
+
let loopCtx = nodeCls.get(loopCtxKey);
|
|
77
|
+
if (checkLoopCtx(loopCtx)) {
|
|
78
|
+
config.json[loopMasksKey] = loopCtx.loopMasks;
|
|
79
|
+
if ((handlerFunc !== "" && config.json[loopMasksKey].includes(handlerFunc)) ||
|
|
80
|
+
(progressCallbackFunc != "" && config.json[loopMasksKey].includes(progressCallbackFunc)) ||
|
|
81
|
+
(completedCallbackFunc != "" && config.json[loopMasksKey].includes(completedCallbackFunc))) {
|
|
82
|
+
throw new exceptions.InvalidParamError(`Task execution forms a loop.`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return await faasinfra.doRequest(null, urlPath, config);
|
|
86
|
+
}
|
|
87
|
+
async invokeMicroserviceSync(apiName, path, method, body) {
|
|
88
|
+
let reqPath = faasinfraHttpPath.invokeMicroserviceSync;
|
|
89
|
+
let options = commonHttp.getOptions(null, reqPath);
|
|
90
|
+
let urlPath = options._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
91
|
+
options.json = {
|
|
92
|
+
"microserviceId": apiName,
|
|
93
|
+
"path": path,
|
|
94
|
+
"method": method,
|
|
95
|
+
"query": parseQueryParams(path),
|
|
96
|
+
};
|
|
97
|
+
// 处理 body 参数
|
|
98
|
+
if (method.toUpperCase() !== "GET") {
|
|
99
|
+
options.json.body = JSON.stringify(body);
|
|
100
|
+
}
|
|
101
|
+
return await faasinfra.doRequest(null, urlPath, options);
|
|
102
|
+
}
|
|
103
|
+
async invokeMicroserviceAsync(apiName, path, method, body) {
|
|
104
|
+
let reqPath = faasinfraHttpPath.invokeMicroserviceAsync;
|
|
105
|
+
let options = commonHttp.getOptions(null, reqPath);
|
|
106
|
+
let urlPath = options._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
107
|
+
options.json = {
|
|
108
|
+
"microserviceId": apiName,
|
|
109
|
+
"path": path,
|
|
110
|
+
"method": method,
|
|
111
|
+
"query": parseQueryParams(path),
|
|
112
|
+
};
|
|
113
|
+
// 处理 body 参数
|
|
114
|
+
if (method.toUpperCase() !== "GET") {
|
|
115
|
+
options.json.body = JSON.stringify(body);
|
|
116
|
+
}
|
|
117
|
+
return await faasinfra.doRequest(null, urlPath, options);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.FaaSInfraRequest = FaaSInfraRequest;
|
|
121
|
+
function getDebugExtraInfo() {
|
|
122
|
+
let extra = {
|
|
123
|
+
"FunctionFrameVersion": "FunctionFrameV2",
|
|
124
|
+
};
|
|
125
|
+
if (utils.isDebug()) {
|
|
126
|
+
extra.DebugInfo = utils.getDebugCode();
|
|
127
|
+
}
|
|
128
|
+
return extra;
|
|
129
|
+
}
|
|
130
|
+
function checkLoopCtx(reqCtx) {
|
|
131
|
+
return reqCtx && reqCtx.loopMasks && Array.isArray(reqCtx.loopMasks);
|
|
132
|
+
}
|
|
133
|
+
function parseQueryParams(path) {
|
|
134
|
+
let params = {};
|
|
135
|
+
let url = new url_1.URL(path, "https://aa.bb.cc");
|
|
136
|
+
for (let [k, v] of url.searchParams.entries()) {
|
|
137
|
+
if (typeof (k) !== "string") {
|
|
138
|
+
throw new exceptions_1.InternalError(`The type of k should be string, but ${typeof (k)}`);
|
|
139
|
+
}
|
|
140
|
+
if (typeof (v) !== "string") {
|
|
141
|
+
throw new exceptions_1.InternalError(`The type of v should be string, but ${typeof (v)}`);
|
|
142
|
+
}
|
|
143
|
+
params[k] = v.split(",");
|
|
144
|
+
}
|
|
145
|
+
if (Object.keys(params).length === 0) {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
return params;
|
|
149
|
+
}
|
|
150
|
+
/*
|
|
151
|
+
export async function invokeFuncSync(apiName: string, params: any, oldFuncName: string, isSync: boolean) {
|
|
152
|
+
let result = await invokeFunc(apiName, params, oldFuncName, isSync);
|
|
153
|
+
if (result && result.code === "0") {
|
|
154
|
+
return result.data;
|
|
155
|
+
}
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async function invokeFunc(apiName: string, params: any, oldFuncName: string, isSync = false) {
|
|
160
|
+
let reqPath = faasinfraHttpPath.createAsyncTask;
|
|
161
|
+
if (isSync) {
|
|
162
|
+
reqPath = faasinfraHttpPath.invokeFuncSync;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let options = commonHttp.getOptions(null, reqPath);
|
|
166
|
+
let urlPath = options._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
167
|
+
|
|
168
|
+
let triggerCtx: Record<string, any> = {};
|
|
169
|
+
let task_id = utils.getTriggerTaskID();
|
|
170
|
+
if (task_id) {
|
|
171
|
+
triggerCtx[headers.triggerTaskId] = task_id;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
let temp = utils.getDistributedHandleMask();
|
|
175
|
+
if (temp) {
|
|
176
|
+
triggerCtx[distributedHandleMask] = temp;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
let reqCtx = nodeCls.get(loopCtxKey);
|
|
180
|
+
if (checkLoopCtx(reqCtx)) {
|
|
181
|
+
triggerCtx[loopMasks] = reqCtx.loopMasks
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// 相等时,表示是新版本函数的场景
|
|
185
|
+
if (apiName === oldFuncName) {
|
|
186
|
+
options.json = {
|
|
187
|
+
"apiAlias": apiName,
|
|
188
|
+
"params": JSON.stringify(params),
|
|
189
|
+
"context": JSON.stringify(triggerCtx),
|
|
190
|
+
"triggerType": utils.getTriggerType(),
|
|
191
|
+
}
|
|
192
|
+
} else {
|
|
193
|
+
options.json = {
|
|
194
|
+
"function_name": apiName,
|
|
195
|
+
"params": JSON.stringify(params),
|
|
196
|
+
"context": JSON.stringify(triggerCtx),
|
|
197
|
+
"triggerType": utils.getTriggerType(),
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (utils.isMicroservice()) {
|
|
202
|
+
options.json.apiAlias = oldFuncName;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return await faasinfra.doRequest(null, urlPath, options);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export async function asyncTask(apiName: string, params: any) {
|
|
209
|
+
// 检查函数是否存在
|
|
210
|
+
utils.requireFunction(apiName);
|
|
211
|
+
|
|
212
|
+
let reqPath = faasinfraHttpPath.createAsyncTaskV2;
|
|
213
|
+
let options = commonHttp.getOptions(null, reqPath);
|
|
214
|
+
let urlPath = options._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
215
|
+
|
|
216
|
+
let triggerCtx: Record<string, any> = {};
|
|
217
|
+
let task_id = utils.getTriggerTaskID();
|
|
218
|
+
if (task_id) {
|
|
219
|
+
triggerCtx[headers.triggerTaskId] = task_id;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
let temp = utils.getDistributedHandleMask();
|
|
223
|
+
if (temp) {
|
|
224
|
+
triggerCtx[distributedHandleMask] = temp;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
let reqCtx = nodeCls.get(loopCtxKey);
|
|
228
|
+
if (checkLoopCtx(reqCtx)) {
|
|
229
|
+
triggerCtx[loopMasks] = reqCtx.loopMasks
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
options.json = {
|
|
233
|
+
"api_name": apiName,
|
|
234
|
+
"params": JSON.stringify(params),
|
|
235
|
+
"context": JSON.stringify(triggerCtx),
|
|
236
|
+
"triggerType": utils.getTriggerType(),
|
|
237
|
+
"extra": getDebugExtraInfo()
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return await faasinfra.doRequest(null, urlPath, options);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export async function createDistributedTaskV1(dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: _Options):
|
|
244
|
+
Promise<number> {
|
|
245
|
+
// 1.获取 options
|
|
246
|
+
let config = commonHttp.getOptions(null, faasinfraHttpPath.createDistributedTask);
|
|
247
|
+
|
|
248
|
+
// 2.构造url
|
|
249
|
+
let urlPath = config._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
250
|
+
|
|
251
|
+
// 3.请求
|
|
252
|
+
config.json = {
|
|
253
|
+
"domainName": utils.getTenantNameFromCtx(),
|
|
254
|
+
"namespace": utils.getNamespaceFromCtx(),
|
|
255
|
+
"userId": utils.getUserIDFromCtx(),
|
|
256
|
+
|
|
257
|
+
"dataset": dataset,
|
|
258
|
+
"handlerFunc": handlerFunc,
|
|
259
|
+
"progressCallbackFunc": progressCallbackFunc,
|
|
260
|
+
"completedCallbackFunc": completedCallbackFunc,
|
|
261
|
+
"options": options
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
let task_id = utils.getTriggerTaskID();
|
|
265
|
+
if (task_id) {
|
|
266
|
+
config.json[headers.triggerTaskId] = task_id;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
let loopCtx = nodeCls.get(loopCtxKey);
|
|
270
|
+
if (checkLoopCtx(loopCtx)) {
|
|
271
|
+
config.json[loopMasksKey] = loopCtx.loopMasks;
|
|
272
|
+
if (!utils.isMicroservice() && (handlerFunc !== "" && config.json[loopMasksKey].includes(utils.handleFuncName({}, handlerFunc))) ||
|
|
273
|
+
(progressCallbackFunc != "" && config.json[loopMasksKey].includes(utils.handleFuncName({}, progressCallbackFunc))) ||
|
|
274
|
+
(completedCallbackFunc != "" && config.json[loopMasksKey].includes(utils.handleFuncName({}, completedCallbackFunc)))) {
|
|
275
|
+
throw new exceptions.InvalidParamError(`Task execution forms a loop.`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return await faasinfra.doRequest(null, urlPath, config);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export async function createDistributedTask(dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: _Options): Promise<number> {
|
|
283
|
+
if (utils.isOnlineDev()) {
|
|
284
|
+
return await createDistributedTaskV1(dataset, handlerFunc, progressCallbackFunc, completedCallbackFunc, options);
|
|
285
|
+
}
|
|
286
|
+
// 检查函数是否存在
|
|
287
|
+
utils.requireFunction(handlerFunc);
|
|
288
|
+
|
|
289
|
+
// 1.获取 options
|
|
290
|
+
let config = commonHttp.getOptions(null, faasinfraHttpPath.createDistributedTaskV2);
|
|
291
|
+
|
|
292
|
+
// 2.构造url
|
|
293
|
+
let urlPath = config._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
294
|
+
|
|
295
|
+
// 3.请求
|
|
296
|
+
config.json = {
|
|
297
|
+
"domainName": utils.getTenantNameFromCtx(),
|
|
298
|
+
"namespace": utils.getNamespaceFromCtx(),
|
|
299
|
+
"userId": utils.getUserIDFromCtx(),
|
|
300
|
+
|
|
301
|
+
"dataset": dataset,
|
|
302
|
+
"handlerFunc": handlerFunc,
|
|
303
|
+
"progressCallbackFunc": progressCallbackFunc,
|
|
304
|
+
"completedCallbackFunc": completedCallbackFunc,
|
|
305
|
+
"options": options,
|
|
306
|
+
"extra": getDebugExtraInfo()
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
let task_id = utils.getTriggerTaskID();
|
|
310
|
+
if (task_id) {
|
|
311
|
+
config.json[headers.triggerTaskId] = task_id;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
let loopCtx = nodeCls.get(loopCtxKey);
|
|
315
|
+
if (checkLoopCtx(loopCtx)) {
|
|
316
|
+
config.json[loopMasksKey] = loopCtx.loopMasks;
|
|
317
|
+
if ((handlerFunc !== "" && config.json[loopMasksKey].includes(handlerFunc)) ||
|
|
318
|
+
(progressCallbackFunc != "" && config.json[loopMasksKey].includes(progressCallbackFunc)) ||
|
|
319
|
+
(completedCallbackFunc != "" && config.json[loopMasksKey].includes(completedCallbackFunc))) {
|
|
320
|
+
throw new exceptions.InvalidParamError(`Task execution forms a loop.`);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return await faasinfra.doRequest(null, urlPath, config);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export async function invokeMicroserviceSync(apiName: string, path: string, method: string, body: any) {
|
|
328
|
+
return await invokeMicroservice(apiName, path, method, body, true);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export async function invokeMicroserviceAsync(apiName: string, path: string, method: string, body: any) {
|
|
332
|
+
return await invokeMicroservice(apiName, path, method, body, false);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
async function invokeMicroservice(apiName: string, path: string, method: string, body: any, isSync = false) {
|
|
336
|
+
let reqPath = faasinfraHttpPath.invokeMicroserviceAsync;
|
|
337
|
+
if (isSync) {
|
|
338
|
+
reqPath = faasinfraHttpPath.invokeMicroserviceSync;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
let options = commonHttp.getOptions(null, reqPath);
|
|
342
|
+
let urlPath = options._reqPath.replace(replaceKeys.namespace, utils.getNamespaceFromCtx());
|
|
343
|
+
|
|
344
|
+
options.json = {
|
|
345
|
+
"microserviceId": apiName,
|
|
346
|
+
"path": path,
|
|
347
|
+
"method": method,
|
|
348
|
+
"query": parseQueryParams(path),
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// 处理 body 参数
|
|
352
|
+
if (method.toUpperCase() !== "GET") {
|
|
353
|
+
options.json.body = JSON.stringify(body);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return await faasinfra.doRequest(null, urlPath, options);
|
|
357
|
+
}
|
|
358
|
+
*/
|
|
359
|
+
//# sourceMappingURL=faasinfra.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faasinfra.js","sourceRoot":"","sources":["faasinfra.ts"],"names":[],"mappings":";;;AAAA,0DAAyD;AAEzD,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;AACzC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;AAC/B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;AACxC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC;AACxD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;AAC5C,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AACrC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC5D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;AACpC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;AAEtC,6BAAwB;AACxB,iFAA+E;AAG/E,MAAa,gBAAgB;IACzB;IACA,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,OAAY,EAAE,WAAmB,EAAE,oBAA4B,EAAE,qBAA6B,EAAE,OAAY;QACrI,eAAe;QACf,IA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