@byted-apaas/server-sdk-node 0.0.1-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.
Files changed (163) hide show
  1. package/LICENSE +7 -0
  2. package/NOTICE +3 -0
  3. package/README.md +1 -0
  4. package/application/application.d.ts +27 -0
  5. package/application/application.js +2 -0
  6. package/application/application.ts +40 -0
  7. package/application/function/function.d.ts +14 -0
  8. package/application/function/function.js +21 -0
  9. package/application/function/function.ts +37 -0
  10. package/application/impl/common.d.ts +2 -0
  11. package/application/impl/common.js +50 -0
  12. package/application/impl/common.ts +50 -0
  13. package/application/impl/impl.d.ts +16 -0
  14. package/application/impl/impl.js +38 -0
  15. package/application/impl/impl.ts +48 -0
  16. package/constants/constants.d.ts +10 -0
  17. package/constants/constants.js +15 -0
  18. package/constants/constants.ts +15 -0
  19. package/context/context.d.ts +74 -0
  20. package/context/context.js +25 -0
  21. package/context/context.ts +130 -0
  22. package/context/db/db.d.ts +73 -0
  23. package/context/db/db.js +4 -0
  24. package/context/db/db.ts +80 -0
  25. package/context/db/impl/IObject.d.ts +251 -0
  26. package/context/db/impl/IObject.js +5 -0
  27. package/context/db/impl/IObject.ts +247 -0
  28. package/context/db/impl/db.d.ts +61 -0
  29. package/context/db/impl/db.js +86 -0
  30. package/context/db/impl/db.ts +95 -0
  31. package/context/db/impl/object.d.ts +92 -0
  32. package/context/db/impl/object.js +524 -0
  33. package/context/db/impl/object.ts +631 -0
  34. package/context/db/impl/oql/ioql.d.ts +6 -0
  35. package/context/db/impl/oql/ioql.js +4 -0
  36. package/context/db/impl/oql/ioql.ts +9 -0
  37. package/context/db/impl/oql/oql.d.ts +8 -0
  38. package/context/db/impl/oql/oql.js +21 -0
  39. package/context/db/impl/oql/oql.ts +25 -0
  40. package/context/db/impl/order.d.ts +9 -0
  41. package/context/db/impl/order.js +15 -0
  42. package/context/db/impl/order.ts +19 -0
  43. package/context/db/impl/propertiesStore.d.ts +8 -0
  44. package/context/db/impl/propertiesStore.js +29 -0
  45. package/context/db/impl/propertiesStore.ts +31 -0
  46. package/context/db/impl/queryBuilder.d.ts +29 -0
  47. package/context/db/impl/queryBuilder.js +78 -0
  48. package/context/db/impl/queryBuilder.ts +106 -0
  49. package/context/db/impl/transaction/index.d.ts +20 -0
  50. package/context/db/impl/transaction/index.js +277 -0
  51. package/context/db/impl/transaction/index.ts +340 -0
  52. package/context/db/impl/transaction/operation.d.ts +27 -0
  53. package/context/db/impl/transaction/operation.js +69 -0
  54. package/context/db/impl/transaction/operation.ts +72 -0
  55. package/context/db/impl/transaction.d.ts +67 -0
  56. package/context/db/impl/transaction.js +4 -0
  57. package/context/db/impl/transaction.ts +79 -0
  58. package/context/globalConfig/globalConfig.d.ts +7 -0
  59. package/context/globalConfig/globalConfig.js +16 -0
  60. package/context/globalConfig/globalConfig.ts +14 -0
  61. package/context/metadata/components/common.d.ts +6 -0
  62. package/context/metadata/components/common.js +17 -0
  63. package/context/metadata/components/common.ts +22 -0
  64. package/context/metadata/components/components.d.ts +12 -0
  65. package/context/metadata/components/components.js +19 -0
  66. package/context/metadata/components/components.ts +22 -0
  67. package/context/metadata/components/desktop/list.d.ts +16 -0
  68. package/context/metadata/components/desktop/list.js +402 -0
  69. package/context/metadata/components/desktop/list.ts +457 -0
  70. package/context/metadata/components/desktop/recordDetail.d.ts +11 -0
  71. package/context/metadata/components/desktop/recordDetail.js +53 -0
  72. package/context/metadata/components/desktop/recordDetail.ts +67 -0
  73. package/context/metadata/components/mobile/list.d.ts +24 -0
  74. package/context/metadata/components/mobile/list.js +145 -0
  75. package/context/metadata/components/mobile/list.ts +179 -0
  76. package/context/metadata/metadata.d.ts +61 -0
  77. package/context/metadata/metadata.js +103 -0
  78. package/context/metadata/metadata.ts +178 -0
  79. package/context/metadata/objects/fields.d.ts +130 -0
  80. package/context/metadata/objects/fields.js +334 -0
  81. package/context/metadata/objects/fields.ts +457 -0
  82. package/context/metadata/objects/fields.util.d.ts +40 -0
  83. package/context/metadata/objects/fields.util.js +319 -0
  84. package/context/metadata/objects/fields.util.ts +360 -0
  85. package/context/metadata/objects/objects.d.ts +11 -0
  86. package/context/metadata/objects/objects.js +20 -0
  87. package/context/metadata/objects/objects.ts +30 -0
  88. package/context/metadata/types/common.d.ts +6 -0
  89. package/context/metadata/types/common.js +9 -0
  90. package/context/metadata/types/common.ts +13 -0
  91. package/context/metadata/types/components.d.ts +90 -0
  92. package/context/metadata/types/components.js +4 -0
  93. package/context/metadata/types/components.ts +108 -0
  94. package/context/metadata/types/objects.d.ts +226 -0
  95. package/context/metadata/types/objects.js +4 -0
  96. package/context/metadata/types/objects.ts +254 -0
  97. package/context/msg/msg.d.ts +38 -0
  98. package/context/msg/msg.js +35 -0
  99. package/context/msg/msg.ts +52 -0
  100. package/context/resources/IResources.d.ts +66 -0
  101. package/context/resources/IResources.js +2 -0
  102. package/context/resources/IResources.ts +73 -0
  103. package/context/resources/impl/resources.d.ts +42 -0
  104. package/context/resources/impl/resources.js +150 -0
  105. package/context/resources/impl/resources.ts +173 -0
  106. package/context/tasks/tasks.d.ts +33 -0
  107. package/context/tasks/tasks.js +139 -0
  108. package/context/tasks/tasks.ts +159 -0
  109. package/data/index.d.ts +27 -0
  110. package/data/index.js +4 -0
  111. package/data/index.ts +30 -0
  112. package/hooks/api.d.ts +61 -0
  113. package/hooks/api.js +327 -0
  114. package/hooks/api.ts +341 -0
  115. package/hooks/hooks.d.ts +1 -0
  116. package/hooks/hooks.js +88 -0
  117. package/hooks/hooks.ts +100 -0
  118. package/kunlun/kunlun.d.ts +55 -0
  119. package/kunlun/kunlun.js +58 -0
  120. package/kunlun/kunlun.ts +72 -0
  121. package/kunlun/operator/IOperator.d.ts +158 -0
  122. package/kunlun/operator/IOperator.js +4 -0
  123. package/kunlun/operator/IOperator.ts +166 -0
  124. package/kunlun/operator/impl/expression.d.ts +47 -0
  125. package/kunlun/operator/impl/expression.js +56 -0
  126. package/kunlun/operator/impl/expression.ts +74 -0
  127. package/kunlun/operator/impl/logic.d.ts +50 -0
  128. package/kunlun/operator/impl/logic.js +509 -0
  129. package/kunlun/operator/impl/logic.ts +598 -0
  130. package/kunlun/operator/impl/logicV2.d.ts +58 -0
  131. package/kunlun/operator/impl/logicV2.js +200 -0
  132. package/kunlun/operator/impl/logicV2.ts +254 -0
  133. package/kunlun/operator/impl/operator.d.ts +179 -0
  134. package/kunlun/operator/impl/operator.js +222 -0
  135. package/kunlun/operator/impl/operator.ts +258 -0
  136. package/kunlun/operator/impl/operatorV2.d.ts +180 -0
  137. package/kunlun/operator/impl/operatorV2.js +216 -0
  138. package/kunlun/operator/impl/operatorV2.ts +249 -0
  139. package/lib/core.d.ts +4 -0
  140. package/lib/core.js +19 -0
  141. package/lib/core.ts +7 -0
  142. package/package.json +50 -0
  143. package/request/common.d.ts +13 -0
  144. package/request/common.js +87 -0
  145. package/request/common.ts +91 -0
  146. package/request/constants.d.ts +10 -0
  147. package/request/constants.js +25 -0
  148. package/request/constants.ts +25 -0
  149. package/request/faasinfra.d.ts +8 -0
  150. package/request/faasinfra.js +358 -0
  151. package/request/faasinfra.ts +393 -0
  152. package/request/innerapi.d.ts +67 -0
  153. package/request/innerapi.js +1412 -0
  154. package/request/innerapi.ts +1648 -0
  155. package/request/interface.d.ts +95 -0
  156. package/request/interface.js +41 -0
  157. package/request/interface.ts +169 -0
  158. package/request/openapi.d.ts +69 -0
  159. package/request/openapi.js +1014 -0
  160. package/request/openapi.ts +1223 -0
  161. package/types/types.d.ts +79 -0
  162. package/types/types.js +4 -0
  163. package/types/types.ts +108 -0
@@ -0,0 +1,95 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Criterion } from "../kunlun/operator/impl/logic";
4
+ import { Stream } from "stream";
5
+ import { ExecutionInfo, ExecutionResult, RevokeExecutionOptions } from "@byted-apaas/server-common-node/context/workflow/workflow";
6
+ import { AppCtx } from "../application/application";
7
+ import { Order } from "../context/db/impl/order";
8
+ export declare function GetInstance(): IInnerAPIRequest;
9
+ export declare function GetFaaSInfraInstance(): IFaaSInfraRequest;
10
+ export declare type UploadFileResp = {
11
+ id: string;
12
+ token: string;
13
+ size: bigint;
14
+ mimeType: string;
15
+ name: string;
16
+ };
17
+ export declare type OrderV2 = {
18
+ field: string;
19
+ direction: string;
20
+ type: string;
21
+ };
22
+ export declare type OpenSDKGetRecordsReq = {
23
+ limit: number;
24
+ offset: number;
25
+ fields: string[];
26
+ quickSearch?: string;
27
+ filter: any[];
28
+ sort: OrderV2[];
29
+ count: boolean;
30
+ };
31
+ export interface IInnerAPIRequest extends IInnerAPIBaseRequest, IInnerAPIOpenSDKRequest {
32
+ }
33
+ export interface IInnerAPIBaseRequest {
34
+ createRecordBySync(objectApiName: string, record: object): any;
35
+ updateRecordBySync(objectApiName: string, recordID: number, record: object): any;
36
+ deleteRecordBySync(objectApiName: string, recordID: number): any;
37
+ createRecordsByAsync(objectApiName: string, records: object[]): any;
38
+ updateRecordsByAsync(objectApiName: string, recordMap: Record<number, object>): any;
39
+ deleteRecordsByAsync(objectApiName: string, recordIDs: number[]): any;
40
+ createRecordsBySync(objectApiName: string, records: object[]): any;
41
+ updateRecordsBySync(objectApiName: string, recordMap: Record<number, object>): any;
42
+ deleteRecordsBySync(objectApiName: string, recordIDs: number[]): any;
43
+ getRecordsOrCountByCriterion(objectApiName: string, criterion: string | Criterion, order: Order[], ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean): any;
44
+ updateWorkflowVariables(ctx: any, instanceId: number, variables: object, variableTypes: object): Promise<void>;
45
+ uploadFile(data: Stream, expire: number): Promise<UploadFileResp>;
46
+ downloadFileByID(fileID: string, filePath?: string): Promise<Buffer | void>;
47
+ downloadFileByToken(fileToken: string, filePath?: string): Promise<Buffer | void>;
48
+ createMessage(msg: any): Promise<number>;
49
+ updateMessage(msgId: number, msg: any): Promise<void>;
50
+ getFields(objectApiName: string): Promise<any>;
51
+ getField(objectApiName: string, fieldApiName: string): Promise<any>;
52
+ terminateWorkflowInstance(workflowInstanceId: number, operator: number, reason: string): Promise<void>;
53
+ modifyRecordsWithTransaction(placeholders: Record<string, number>, operations: object[]): Promise<Map<string, number>>;
54
+ getGlobalConfigByKey<valueT>(key: string): Promise<valueT>;
55
+ oql(oql: string, args: any[], namedArgs: Record<string, any>): Promise<string | any[]>;
56
+ invokeFuncSync(idOrName: {
57
+ APIId?: string;
58
+ APIName?: string;
59
+ isInvokeByAPIName: boolean;
60
+ }, params: any): Promise<any>;
61
+ createAsyncTaskV1(idOrName: {
62
+ APIId?: string;
63
+ APIName?: string;
64
+ isInvokeByAPIName: boolean;
65
+ }, params: any): Promise<any>;
66
+ createAsyncTaskV2(name: string, params: any): Promise<any>;
67
+ getExecutionUserTaskInfo(executionId: bigint): Promise<any>;
68
+ executeFlow(APIName: string, options: any): Promise<ExecutionResult>;
69
+ revokeExecution(executionId: number, revokeOptions: RevokeExecutionOptions): Promise<void>;
70
+ getExecutionInfo(executionId: number): Promise<ExecutionInfo>;
71
+ getTenantInfo(appCtx: AppCtx): Promise<any>;
72
+ }
73
+ export interface IInnerAPIOpenSDKRequest {
74
+ openSDKCreateRecordBySync(objectApiName: string, record: object): any;
75
+ openSDKUpdateRecordBySync(objectApiName: string, recordID: number, record: object): any;
76
+ openSDKDeleteRecordBySync(objectApiName: string, recordID: number): any;
77
+ openSDKCreateRecordsBySync(objectApiName: string, records: object[]): any;
78
+ openSDKUpdateRecordsBySync(objectApiName: string, recordMap: Record<number, object>): any;
79
+ openSDKDeleteRecordsBySync(objectApiName: string, recordIDs: number[]): any;
80
+ openSDKGetRecords(objectApiName: string, param: OpenSDKGetRecordsReq): any;
81
+ openSDKUploadFile(fileName: string, data: Buffer): any;
82
+ openSDKUploadAvatar(fileName: string, data: Buffer): any;
83
+ openSDKDownloadAvatar(imageID: string): any;
84
+ invokeFuncWithAuth(idOrName: {
85
+ APIId?: string;
86
+ APIName?: string;
87
+ isInvokeByAPIName: boolean;
88
+ }, params: any): Promise<any>;
89
+ }
90
+ export interface IFaaSInfraRequest {
91
+ createDistributeTaskV1(dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: any): Promise<any>;
92
+ createDistributeTaskV2(dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: any): Promise<any>;
93
+ invokeMicroserviceSync(apiName: string, path: string, method: string, body: any): Promise<any>;
94
+ invokeMicroserviceAsync(apiName: string, path: string, method: string, body: any): Promise<any>;
95
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ // Copyright 2022 ByteDance Ltd. and/or its affiliates
3
+ // SPDX-License-Identifier: MIT
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.GetFaaSInfraInstance = exports.GetInstance = void 0;
6
+ const openapi_1 = require("./openapi");
7
+ const innerapi_1 = require("./innerapi");
8
+ const common = require("@byted-apaas/server-common-node");
9
+ const faasinfra_1 = require("./faasinfra");
10
+ const utils = common.utils;
11
+ const constants = common.constants;
12
+ const requestInstanceMap = {
13
+ "httpRequest": null,
14
+ "rpcRequest": null,
15
+ };
16
+ function GetHttpInstance() {
17
+ if (!requestInstanceMap["httpRequest"]) {
18
+ requestInstanceMap["httpRequest"] = new openapi_1.RequestHttp();
19
+ }
20
+ return requestInstanceMap["httpRequest"];
21
+ }
22
+ function GetRpcInstance() {
23
+ if (!requestInstanceMap["rpcRequest"]) {
24
+ requestInstanceMap["rpcRequest"] = new innerapi_1.RequestRpc();
25
+ }
26
+ return requestInstanceMap["rpcRequest"];
27
+ }
28
+ function GetInstance() {
29
+ // 内网版 && 非本地开发 使用 RPC 请求
30
+ if ((utils.getFaasType() === constants.faaSAccessType.InspirecloudIntranetAccessType ||
31
+ utils.getFaasType() === constants.faaSAccessType.ByteFaaSIntranetAccessType) && !utils.isLocalDebug()) {
32
+ return GetRpcInstance();
33
+ }
34
+ return GetHttpInstance();
35
+ }
36
+ exports.GetInstance = GetInstance;
37
+ function GetFaaSInfraInstance() {
38
+ return new faasinfra_1.FaaSInfraRequest();
39
+ }
40
+ exports.GetFaaSInfraInstance = GetFaaSInfraInstance;
41
+ ;
@@ -0,0 +1,169 @@
1
+ // Copyright 2022 ByteDance Ltd. and/or its affiliates
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ import { Criterion } from "../kunlun/operator/impl/logic";
5
+ import { Stream } from "stream";
6
+ import { RequestHttp } from "./openapi";
7
+ import { RequestRpc } from "./innerapi";
8
+ import * as common from "@byted-apaas/server-common-node";
9
+ import { FaaSInfraRequest } from "./faasinfra";
10
+ import {
11
+ ExecutionInfo,
12
+ ExecutionResult,
13
+ FlowTaskInfo,
14
+ RevokeExecutionOptions
15
+ } from "@byted-apaas/server-common-node/context/workflow/workflow";
16
+ import { AppCtx } from "../application/application";
17
+ import { Order } from "../context/db/impl/order";
18
+
19
+ const utils = common.utils;
20
+ const constants = common.constants;
21
+
22
+ const requestInstanceMap: Record<string, IInnerAPIRequest> = {
23
+ "httpRequest": null,
24
+ "rpcRequest": null,
25
+ }
26
+
27
+ function GetHttpInstance(): IInnerAPIRequest {
28
+ if (!requestInstanceMap["httpRequest"]) {
29
+ requestInstanceMap["httpRequest"] = new RequestHttp();
30
+ }
31
+ return requestInstanceMap["httpRequest"];
32
+ }
33
+
34
+ function GetRpcInstance(): IInnerAPIRequest {
35
+ if (!requestInstanceMap["rpcRequest"]) {
36
+ requestInstanceMap["rpcRequest"] = new RequestRpc();
37
+ }
38
+ return requestInstanceMap["rpcRequest"];
39
+ }
40
+
41
+ export function GetInstance(): IInnerAPIRequest {
42
+ // 内网版 && 非本地开发 使用 RPC 请求
43
+ if ((utils.getFaasType() === constants.faaSAccessType.InspirecloudIntranetAccessType ||
44
+ utils.getFaasType() === constants.faaSAccessType.ByteFaaSIntranetAccessType) && !utils.isLocalDebug()) {
45
+ return GetRpcInstance();
46
+ }
47
+ return GetHttpInstance();
48
+ }
49
+
50
+ export function GetFaaSInfraInstance(): IFaaSInfraRequest {
51
+ return new FaaSInfraRequest();
52
+ }
53
+
54
+ export type UploadFileResp = {
55
+ // ID, 文件的唯一标识
56
+ id: string
57
+ // Token, 文件的访问 token
58
+ token: string
59
+ // Size, 文件的大小
60
+ size: bigint
61
+ // MIME Type, 文件的 MIME 类型
62
+ mimeType: string
63
+ // Name, 文件的名称
64
+ name: string
65
+ }
66
+
67
+ export type OrderV2 = {
68
+ field: string;
69
+ direction: string;
70
+ type: string;
71
+ }
72
+
73
+ export type OpenSDKGetRecordsReq = {
74
+ limit: number;
75
+ offset: number;
76
+ fields: string[];
77
+ quickSearch?: string;
78
+ filter: any[];
79
+ sort: OrderV2[];
80
+ count: boolean;
81
+ }
82
+
83
+ export interface IInnerAPIRequest extends IInnerAPIBaseRequest, IInnerAPIOpenSDKRequest { };
84
+ export interface IInnerAPIBaseRequest {
85
+ createRecordBySync(objectApiName: string, record: object): any;
86
+
87
+ updateRecordBySync(objectApiName: string, recordID: number, record: object): any;
88
+
89
+ deleteRecordBySync(objectApiName: string, recordID: number): any;
90
+
91
+ createRecordsByAsync(objectApiName: string, records: object[]): any;
92
+
93
+ updateRecordsByAsync(objectApiName: string, recordMap: Record<number, object>): any;
94
+
95
+ deleteRecordsByAsync(objectApiName: string, recordIDs: number[]): any;
96
+
97
+ createRecordsBySync(objectApiName: string, records: object[]): any;
98
+
99
+ updateRecordsBySync(objectApiName: string, recordMap: Record<number, object>): any;
100
+
101
+ deleteRecordsBySync(objectApiName: string, recordIDs: number[]): any;
102
+
103
+ getRecordsOrCountByCriterion(objectApiName: string, criterion: string | Criterion, order: Order[], ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean): any;
104
+
105
+ updateWorkflowVariables(ctx: any, instanceId: number, variables: object, variableTypes: object): Promise<void>;
106
+
107
+ uploadFile(data: Stream, expire: number): Promise<UploadFileResp>;
108
+
109
+ downloadFileByID(fileID: string, filePath?: string): Promise<Buffer | void>;
110
+
111
+ downloadFileByToken(fileToken: string, filePath?: string): Promise<Buffer | void>;
112
+
113
+ createMessage(msg: any): Promise<number>
114
+
115
+ updateMessage(msgId: number, msg: any): Promise<void>
116
+
117
+ getFields(objectApiName: string): Promise<any>;
118
+
119
+ getField(objectApiName: string, fieldApiName: string): Promise<any>;
120
+
121
+ terminateWorkflowInstance(workflowInstanceId: number, operator: number, reason: string): Promise<void>;
122
+
123
+ modifyRecordsWithTransaction(placeholders: Record<string, number>, operations: object[]): Promise<Map<string, number>>;
124
+
125
+ getGlobalConfigByKey<valueT>(key: string): Promise<valueT>;
126
+
127
+ oql(oql: string, args: any[], namedArgs: Record<string, any>): Promise<string | any[]>;
128
+
129
+ invokeFuncSync(idOrName: { APIId?: string; APIName?: string, isInvokeByAPIName: boolean }, params: any): Promise<any>;
130
+
131
+ createAsyncTaskV1(idOrName: { APIId?: string; APIName?: string; isInvokeByAPIName: boolean }, params: any): Promise<any>;
132
+
133
+ createAsyncTaskV2(name: string, params: any): Promise<any>;
134
+
135
+ getExecutionUserTaskInfo(executionId: bigint): Promise<any>;
136
+
137
+ executeFlow(APIName: string, options: any): Promise<ExecutionResult>;
138
+
139
+ revokeExecution(executionId: number, revokeOptions: RevokeExecutionOptions): Promise<void>;
140
+
141
+ getExecutionInfo(executionId: number): Promise<ExecutionInfo>;
142
+
143
+ getTenantInfo(appCtx: AppCtx): Promise<any>;
144
+ }
145
+
146
+ export interface IInnerAPIOpenSDKRequest {
147
+ openSDKCreateRecordBySync(objectApiName: string, record: object): any;
148
+ openSDKUpdateRecordBySync(objectApiName: string, recordID: number, record: object): any;
149
+ openSDKDeleteRecordBySync(objectApiName: string, recordID: number): any;
150
+ openSDKCreateRecordsBySync(objectApiName: string, records: object[]): any;
151
+ openSDKUpdateRecordsBySync(objectApiName: string, recordMap: Record<number, object>): any;
152
+ openSDKDeleteRecordsBySync(objectApiName: string, recordIDs: number[]): any;
153
+ openSDKGetRecords(objectApiName: string, param: OpenSDKGetRecordsReq): any;
154
+
155
+ openSDKUploadFile(fileName: string, data: Buffer): any;
156
+ openSDKUploadAvatar(fileName: string, data: Buffer): any;
157
+ openSDKDownloadAvatar(imageID: string): any;
158
+ invokeFuncWithAuth(idOrName: { APIId?: string; APIName?: string; isInvokeByAPIName: boolean }, params: any): Promise<any>;
159
+ }
160
+
161
+ export interface IFaaSInfraRequest {
162
+ createDistributeTaskV1(dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: any): Promise<any>;
163
+
164
+ createDistributeTaskV2(dataset: any, handlerFunc: string, progressCallbackFunc: string, completedCallbackFunc: string, options: any): Promise<any>;
165
+
166
+ invokeMicroserviceSync(apiName: string, path: string, method: string, body: any): Promise<any>;
167
+
168
+ invokeMicroserviceAsync(apiName: string, path: string, method: string, body: any): Promise<any>;
169
+ }
@@ -0,0 +1,69 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Stream } from "stream";
4
+ import { Order } from "../context/db/impl/order";
5
+ import { Criterion } from "../kunlun/operator/impl/logic";
6
+ import { IInnerAPIRequest, OpenSDKGetRecordsReq, UploadFileResp } from "./interface";
7
+ import { ExecutionInfo, ExecutionResult, RevokeExecutionOptions } from "@byted-apaas/server-common-node/context/workflow/workflow";
8
+ import { AppCtx } from "../application/application";
9
+ export declare function updateWorkflowVariables(ctx: any, instanceId: number, variables: object, variableTypes: object): Promise<void>;
10
+ export declare class RequestHttp implements IInnerAPIRequest {
11
+ constructor();
12
+ updateWorkflowVariables(ctx: any, instanceId: number, variables: object, variableTypes: object): any;
13
+ createRecordBySync(objectApiName: string, record: object): any;
14
+ updateRecordBySync(objectApiName: string, recordID: number, record: object): any;
15
+ deleteRecordBySync(objectApiName: string, recordID: number): any;
16
+ createRecordsByAsync(objectApiName: string, records: object[]): any;
17
+ updateRecordsByAsync(objectApiName: string, recordMap: Record<number, object>): any;
18
+ deleteRecordsByAsync(objectApiName: string, recordIDs: number[]): any;
19
+ createRecordsBySync(objectApiName: string, records: object[]): any;
20
+ updateRecordsBySync(objectApiName: string, recordMap: Record<number, object>): any;
21
+ deleteRecordsBySync(objectApiName: string, recordIDs: number[]): any;
22
+ getRecordsOrCountByCriterion(objectApiName: string, criterion: string | Criterion, order: Order[], ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean): any;
23
+ uploadFile(data: Stream, expire: number): Promise<UploadFileResp>;
24
+ downloadFileByID(fileID: string, filePath?: string): Promise<void | Buffer>;
25
+ downloadFileByToken(fileToken: string, filePath?: string): Promise<Buffer | void>;
26
+ createMessage(msg: any): Promise<number>;
27
+ updateMessage(msgId: number, msg: any): Promise<void>;
28
+ getFields(objectApiName: string): any;
29
+ getField(objectApiName: string, fieldApiName: string): any;
30
+ terminateWorkflowInstance(workflowInstanceId: number, operator: number, reason: string): any;
31
+ modifyRecordsWithTransaction(placeholders: Record<string, number>, operations: object[]): Promise<Map<string, number>>;
32
+ getGlobalConfigByKey<valueT>(key: string): Promise<valueT>;
33
+ oql(oql: string, args: any[], namedArgs: Record<string, any>): any;
34
+ invokeFuncSync(idOrName: {
35
+ APIId?: string;
36
+ APIName?: string;
37
+ isInvokeByAPIName: boolean;
38
+ }, params: any): Promise<any>;
39
+ invokeFuncWithAuth(idOrName: {
40
+ APIId?: string;
41
+ APIName?: string;
42
+ isInvokeByAPIName: boolean;
43
+ }, params: any): Promise<any>;
44
+ createAsyncTaskV1(idOrName: {
45
+ APIId?: string;
46
+ APIName?: string;
47
+ isInvokeByAPIName: boolean;
48
+ }, params: any): Promise<any>;
49
+ createAsyncTaskV2(name: string, params: any): Promise<any>;
50
+ getExecutionUserTaskInfo(executionId: bigint): Promise<any>;
51
+ executeFlow(APIName: string, options: any): Promise<ExecutionResult>;
52
+ revokeExecution(executionId: number, revokeOptions: RevokeExecutionOptions): Promise<void>;
53
+ getExecutionInfo(executionId: number): Promise<ExecutionInfo>;
54
+ getTenantInfo(appCtx: AppCtx): Promise<any>;
55
+ openSDKCreateRecordBySync(objectApiName: string, record: object): any;
56
+ openSDKUpdateRecordBySync(objectApiName: string, recordID: number, record: object): any;
57
+ openSDKDeleteRecordBySync(objectApiName: string, recordID: number): any;
58
+ openSDKCreateRecordsBySync(objectApiName: string, records: object[]): any;
59
+ openSDKUpdateRecordsBySync(objectApiName: string, recordMap: Record<number, object>): any;
60
+ openSDKDeleteRecordsBySync(objectApiName: string, recordIDs: number[]): any;
61
+ openSDKGetRecords(objectApiName: string, param: OpenSDKGetRecordsReq): Promise<any | number>;
62
+ openSDKUploadFile(fileName: string, data: Buffer): any;
63
+ openSDKUploadAvatar(fileName: string, data: Buffer): any;
64
+ openSDKDownloadAvatar(imageID: string): Promise<Buffer>;
65
+ }
66
+ export declare function getExecutionUserTaskInfo(executionId: bigint): Promise<any>;
67
+ export declare function executeFlow(APIName: string, option: any): Promise<ExecutionResult>;
68
+ export declare function revokeExecution(executionId: number, revokeOptions: RevokeExecutionOptions): Promise<void>;
69
+ export declare function getExecutionInfo(executionId: number): Promise<ExecutionInfo>;