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