@byted-apaas/server-sdk-node 1.1.19-beta.1 → 1.1.19-beta.3

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.
@@ -13,7 +13,7 @@ export interface Flow {
13
13
  * - params 流程入参
14
14
  * @constructor
15
15
  */
16
- execute: (APIName: string, options?: ExecuteOptions) => Promise<ExecutionResult>;
16
+ execute: (APIName: string, options?: ExecuteOptions, async?: boolean) => Promise<ExecutionResult>;
17
17
  /**
18
18
  * 撤销流程实例 (仅支持撤销包含人工任务的流程实例)
19
19
  * @param executionId 流程实例 Id
@@ -11,7 +11,7 @@ export declare class Flow implements IFlow {
11
11
  */
12
12
  instanceId: number;
13
13
  constructor(flowParams: any);
14
- execute(APIName: string, options: ExecuteOptions | undefined): Promise<ExecutionResult>;
14
+ execute(APIName: string, options: ExecuteOptions | undefined, async?: boolean | undefined): Promise<ExecutionResult>;
15
15
  getExecutionInfo(executionId: number): Promise<ExecutionInfo>;
16
16
  getExecutionUserTaskInfo(executionId: number): Promise<FlowTaskInfo[]>;
17
17
  revokeExecution(executionId: number, options: RevokeExecutionOptions): Promise<void>;
@@ -10,7 +10,7 @@ class Flow {
10
10
  this.apiName = flowParams?.apiName;
11
11
  this.instanceId = flowParams?.instanceId;
12
12
  }
13
- async execute(APIName, options) {
13
+ async execute(APIName, options, async) {
14
14
  if (!APIName || typeof APIName !== 'string') {
15
15
  throw new exceptions_1.InvalidParamError(`param's type (${APIName}) need string, but is ${typeof APIName}`);
16
16
  }
@@ -20,7 +20,7 @@ class Flow {
20
20
  if (!options) {
21
21
  options = {};
22
22
  }
23
- return await Request.GetInstance().executeFlow(APIName, options);
23
+ return await Request.GetInstance().executeFlow(APIName, options, async);
24
24
  }
25
25
  async getExecutionInfo(executionId) {
26
26
  if (!executionId || typeof executionId !== 'number') {
package/hooks/api.js CHANGED
@@ -267,7 +267,7 @@ function mockExecuteFlow() {
267
267
  if (!options) {
268
268
  options = {};
269
269
  }
270
- return await Request.GetInstance().executeFlow(APIName, options);
270
+ return await Request.GetInstance().executeFlow(APIName, options, false);
271
271
  };
272
272
  }
273
273
  exports.mockExecuteFlow = mockExecuteFlow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byted-apaas/server-sdk-node",
3
- "version": "1.1.19-beta.1",
3
+ "version": "1.1.19-beta.3",
4
4
  "description": "aPaaS Server SDK",
5
5
  "author": "zhouwexin <zhouwexin@bytedance.com>",
6
6
  "homepage": "",
@@ -13,7 +13,7 @@
13
13
  "clean": "tsc --build --clean && rm -rf **/*.js.map"
14
14
  },
15
15
  "dependencies": {
16
- "@byted-apaas/server-common-node": "^2.0.16-beta.0",
16
+ "@byted-apaas/server-common-node": "^2.0.13",
17
17
  "@jorgeferrero/stream-to-buffer": "^2.0.6",
18
18
  "dayjs": "^1.9.6",
19
19
  "form-data": "^3.0.0",
@@ -84,7 +84,7 @@ export interface IInnerAPIBaseRequest {
84
84
  }, params: any) => Promise<any>;
85
85
  createAsyncTaskV2: (name: string, params: any) => Promise<any>;
86
86
  getExecutionUserTaskInfo: (executionId: bigint) => Promise<any>;
87
- executeFlow: (APIName: string, options: any) => Promise<ExecutionResult>;
87
+ executeFlow: (APIName: string, options: any, async: any) => Promise<ExecutionResult>;
88
88
  revokeExecution: (executionId: number, revokeOptions: RevokeExecutionOptions) => Promise<void>;
89
89
  getExecutionInfo: (executionId: number) => Promise<ExecutionInfo>;
90
90
  getTenantInfo: (appCtx: AppCtx) => Promise<any>;
@@ -56,7 +56,7 @@ export declare class RequestHttp implements IInnerAPIRequest {
56
56
  }, params: any): Promise<any>;
57
57
  createAsyncTaskV2(name: string, params: any): Promise<any>;
58
58
  getExecutionUserTaskInfo(executionId: bigint): Promise<any>;
59
- executeFlow(APIName: string, options: any): Promise<ExecutionResult>;
59
+ executeFlow(APIName: string, options: any, async: any): Promise<ExecutionResult>;
60
60
  revokeExecution(executionId: number, revokeOptions: RevokeExecutionOptions): Promise<void>;
61
61
  getExecutionInfo(executionId: number): Promise<ExecutionInfo>;
62
62
  getTenantInfo(appCtx: AppCtx): Promise<any>;
@@ -79,6 +79,6 @@ export declare class RequestHttp implements IInnerAPIRequest {
79
79
  getApprovalInstance(params: IGetApprovalInstanceOptions): Promise<IApprovalInstance>;
80
80
  }
81
81
  export declare function getExecutionUserTaskInfo(executionId: bigint): Promise<any>;
82
- export declare function executeFlow(APIName: string, option: any): Promise<ExecutionResult>;
82
+ export declare function executeFlow(APIName: string, option: any, async: any): Promise<ExecutionResult>;
83
83
  export declare function revokeExecution(executionId: number, revokeOptions: RevokeExecutionOptions): Promise<void>;
84
84
  export declare function getExecutionInfo(executionId: number): Promise<ExecutionInfo>;
@@ -1126,8 +1126,8 @@ class RequestHttp {
1126
1126
  async getExecutionUserTaskInfo(executionId) {
1127
1127
  return await getExecutionUserTaskInfo(executionId);
1128
1128
  }
1129
- async executeFlow(APIName, options) {
1130
- return await executeFlow(APIName, options);
1129
+ async executeFlow(APIName, options, async) {
1130
+ return await executeFlow(APIName, options, async);
1131
1131
  }
1132
1132
  async revokeExecution(executionId, revokeOptions) {
1133
1133
  return await revokeExecution(executionId, revokeOptions);
@@ -1414,7 +1414,7 @@ async function getExecutionUserTaskInfo(executionId) {
1414
1414
  return res.taskList;
1415
1415
  }
1416
1416
  exports.getExecutionUserTaskInfo = getExecutionUserTaskInfo;
1417
- async function executeFlow(APIName, option) {
1417
+ async function executeFlow(APIName, option, async) {
1418
1418
  if (!APIName) {
1419
1419
  throw new exceptions.InvalidParamError(`flow apiName is empty`);
1420
1420
  }
@@ -1425,6 +1425,9 @@ async function executeFlow(APIName, option) {
1425
1425
  'variables': (0, common_1.transMapToFlowVariable)(option.params),
1426
1426
  'loopMasks': utils.getLoopMasks(),
1427
1427
  };
1428
+ if (async) {
1429
+ options.json["async"] = async;
1430
+ }
1428
1431
  let res = await openapi.doRequest(null, urlPath, options);
1429
1432
  return {
1430
1433
  executionId: res.executionId,