@byted-apaas/server-sdk-node 1.1.18-beta.25 → 1.1.18-beta.27
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/context/task/taskCenter.d.ts +7 -14
- package/context/task/taskCenter.js +5 -11
- package/package.json +1 -1
- package/request/openapi.d.ts +2 -2
- package/request/openapi.js +6 -19
|
@@ -8,32 +8,25 @@ export interface _APaaSRecord {
|
|
|
8
8
|
record_id?: string;
|
|
9
9
|
record_data?: string;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* 任务中心类
|
|
13
|
+
*/
|
|
14
|
+
export declare class TaskCenter {
|
|
12
15
|
/**
|
|
13
16
|
* 推送任务
|
|
14
17
|
* @param tasks 任务
|
|
15
18
|
* @param cacheDuration 缓存时长
|
|
16
19
|
*/
|
|
17
|
-
syncTasks(tasks?: _Task[], cacheDuration?: number): Promise<
|
|
20
|
+
syncTasks(tasks?: _Task[], cacheDuration?: number): Promise<any>;
|
|
18
21
|
/**
|
|
19
22
|
* 查询任务详情(从缓存)
|
|
20
23
|
* @param task 任务
|
|
21
24
|
*/
|
|
22
|
-
getTaskDetail(task?: _Task): Promise<
|
|
25
|
+
getTaskDetail(task?: _Task): Promise<any>;
|
|
23
26
|
/**
|
|
24
27
|
* 刷新任务详情缓存
|
|
25
28
|
* @param tasks 任务
|
|
26
29
|
* @param cacheDuration 缓存时长
|
|
27
30
|
*/
|
|
28
|
-
refreshTasksCache(tasks?: _Task[], cacheDuration?: number): Promise<
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* 任务中心类
|
|
32
|
-
*/
|
|
33
|
-
export declare class TaskCenter {
|
|
34
|
-
/**
|
|
35
|
-
* 任务中心
|
|
36
|
-
*/
|
|
37
|
-
taskCenter: _TaskCenter;
|
|
38
|
-
constructor();
|
|
31
|
+
refreshTasksCache(tasks?: _Task[], cacheDuration?: number): Promise<any>;
|
|
39
32
|
}
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
// Copyright 2022 ByteDance Ltd. and/or its affiliates
|
|
3
3
|
// SPDX-License-Identifier: MIT
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.TaskCenter =
|
|
5
|
+
exports.TaskCenter = void 0;
|
|
6
6
|
const Request = require("../../request/interface");
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* 任务中心类
|
|
9
|
+
*/
|
|
10
|
+
class TaskCenter {
|
|
8
11
|
/**
|
|
9
12
|
* 推送任务
|
|
10
13
|
* @param tasks 任务
|
|
@@ -32,13 +35,4 @@ class _TaskCenter {
|
|
|
32
35
|
}
|
|
33
36
|
;
|
|
34
37
|
}
|
|
35
|
-
exports._TaskCenter = _TaskCenter;
|
|
36
|
-
/**
|
|
37
|
-
* 任务中心类
|
|
38
|
-
*/
|
|
39
|
-
class TaskCenter {
|
|
40
|
-
constructor() {
|
|
41
|
-
this.taskCenter = new _TaskCenter();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
38
|
exports.TaskCenter = TaskCenter;
|
package/package.json
CHANGED
package/request/openapi.d.ts
CHANGED
|
@@ -26,9 +26,9 @@ export declare class RequestHttp implements IInnerAPIRequest {
|
|
|
26
26
|
downloadFileByToken(fileToken: string, filePath?: string): Promise<Buffer | undefined>;
|
|
27
27
|
createMessage(msg: any): Promise<number>;
|
|
28
28
|
updateMessage(msgId: number, msg: any): Promise<void>;
|
|
29
|
-
syncTasks(tasks: any, cacheDuration: number): Promise<
|
|
29
|
+
syncTasks(tasks: any, cacheDuration: number): Promise<any>;
|
|
30
30
|
getTaskDetail(task: any): Promise<any>;
|
|
31
|
-
refreshTasksCache(cacheDuration: number, tasks: any): Promise<
|
|
31
|
+
refreshTasksCache(cacheDuration: number, tasks: any): Promise<any>;
|
|
32
32
|
getFields(objectApiName: string): any;
|
|
33
33
|
getField(objectApiName: string, fieldApiName: string): any;
|
|
34
34
|
terminateWorkflowInstance(workflowInstanceId: number, operator: number, reason: string): any;
|
package/request/openapi.js
CHANGED
|
@@ -1301,38 +1301,25 @@ async function syncTasks(tasks, cacheDuration) {
|
|
|
1301
1301
|
let options = commonHttp.getOptions(null, openapiHttpPath.taskCenterSyncTasks);
|
|
1302
1302
|
let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
|
|
1303
1303
|
options.json = {
|
|
1304
|
-
'tasks':
|
|
1304
|
+
'tasks': tasks,
|
|
1305
1305
|
'cache_duration': cacheDuration,
|
|
1306
1306
|
};
|
|
1307
|
-
|
|
1308
|
-
return res.affect;
|
|
1307
|
+
return await openapi.doRequest(null, urlPath, options);
|
|
1309
1308
|
}
|
|
1310
1309
|
async function getTaskDetail(task) {
|
|
1311
1310
|
let options = commonHttp.getOptions(null, openapiHttpPath.taskCenterGetTaskDetail);
|
|
1312
1311
|
let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
|
|
1313
1312
|
options.json = {
|
|
1314
|
-
'task':
|
|
1315
|
-
};
|
|
1316
|
-
let res = await openapi.doRequest(null, urlPath, options);
|
|
1317
|
-
return {
|
|
1318
|
-
taskDetail: {
|
|
1319
|
-
taskID: res?.task_id,
|
|
1320
|
-
aPaaSRecord: {
|
|
1321
|
-
objectID: res?.APaaSRecord?.object_id,
|
|
1322
|
-
ObjectAPIName: res?.APaaSRecord?.object_api_name,
|
|
1323
|
-
RecordID: res?.APaaSRecord?.record_id,
|
|
1324
|
-
RecordData: res?.APaaSRecord?.record_data,
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1313
|
+
'task': task,
|
|
1327
1314
|
};
|
|
1315
|
+
return await openapi.doRequest(null, urlPath, options);
|
|
1328
1316
|
}
|
|
1329
1317
|
async function refreshTasksCache(tasks, cacheDuration) {
|
|
1330
1318
|
let options = commonHttp.getOptions(null, openapiHttpPath.taskCenterRefreshTasksCache);
|
|
1331
1319
|
let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
|
|
1332
1320
|
options.json = {
|
|
1333
|
-
'tasks':
|
|
1321
|
+
'tasks': tasks,
|
|
1334
1322
|
'cache_duration': cacheDuration,
|
|
1335
1323
|
};
|
|
1336
|
-
|
|
1337
|
-
return res.affect;
|
|
1324
|
+
return await openapi.doRequest(null, urlPath, options);
|
|
1338
1325
|
}
|