@byted-apaas/server-sdk-node 1.1.18-beta.15 → 1.1.18-beta.16

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.
@@ -59,7 +59,7 @@ class _KObjectSync {
59
59
  });
60
60
  }
61
61
  else if (this.appCtx && this.appCtx.dataVersion === 'v3') {
62
- return await Request.GetInstance().createRecordV3BySync(this.apiName, recordMap, this.authType);
62
+ return await Request.GetInstance().createRecordBySyncV3(this.apiName, recordMap, this.authType);
63
63
  }
64
64
  return await Request.GetInstance().createRecordBySync(this.apiName, recordMap, this.authType);
65
65
  }
@@ -127,7 +127,7 @@ class _KObjectSync {
127
127
  if (recordIDStr.length <= 0) {
128
128
  throw new server_common_node_1.exceptions.InvalidParamError('record._id must greater than 0');
129
129
  }
130
- return await Request.GetInstance().deleteRecordV3BySync(this.apiName, recordIDStr, this.authType);
130
+ return await Request.GetInstance().deleteRecordBySyncV3(this.apiName, recordIDStr, this.authType);
131
131
  }
132
132
  async update(_idOrRecordMap, recordMap) {
133
133
  if (this.appCtx && this.appCtx.dataVersion === 'v3') {
@@ -196,7 +196,7 @@ class _KObjectSync {
196
196
  if (recordIDStr.length <= 0) {
197
197
  throw new server_common_node_1.exceptions.InvalidParamError('record._id must greater than 0');
198
198
  }
199
- return await Request.GetInstance().updateRecordV3BySync(this.apiName, recordIDStr, record, this.authType);
199
+ return await Request.GetInstance().updateRecordBySyncV3(this.apiName, recordIDStr, record, this.authType);
200
200
  }
201
201
  // batch sync
202
202
  async batchCreate(recordMapList) {
@@ -227,7 +227,7 @@ class _KObjectSync {
227
227
  }
228
228
  ;
229
229
  async batchCreateV3(recordMapList) {
230
- const dataV3 = await Request.GetInstance().createRecordsV3BySync(this.apiName, recordMapList, this.authType);
230
+ const dataV3 = await Request.GetInstance().createRecordsBySyncV3(this.apiName, recordMapList, this.authType);
231
231
  const ids = (dataV3.items || []).map((item) => item?._id);
232
232
  return ids;
233
233
  }
@@ -279,7 +279,7 @@ class _KObjectSync {
279
279
  throw new server_common_node_1.exceptions.InvalidParamError('record must be string or number or object');
280
280
  }
281
281
  }
282
- const errMap = await Request.GetInstance().deleteRecordsV3BySync(this.apiName, recordIDs, this.authType);
282
+ const errMap = await Request.GetInstance().deleteRecordsBySyncV3(this.apiName, recordIDs, this.authType);
283
283
  return (0, structs_1.NewBatchResult)(recordIDs, errMap);
284
284
  }
285
285
  async batchUpdate(recordMapList) {
@@ -336,7 +336,7 @@ class _KObjectSync {
336
336
  }
337
337
  recordIDs.push(recordID);
338
338
  }
339
- const errMap = await Request.GetInstance().updateRecordsV3BySync(this.apiName, recordMapList, this.authType);
339
+ const errMap = await Request.GetInstance().updateRecordsBySyncV3(this.apiName, recordMapList, this.authType);
340
340
  return (0, structs_1.NewBatchResult)(recordIDs, errMap);
341
341
  }
342
342
  useUserAuth() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byted-apaas/server-sdk-node",
3
- "version": "1.1.18-beta.15",
3
+ "version": "1.1.18-beta.16",
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.12-beta.4",
16
+ "@byted-apaas/server-common-node": "2.0.12-beta.6",
17
17
  "@jorgeferrero/stream-to-buffer": "^2.0.6",
18
18
  "dayjs": "^1.9.6",
19
19
  "form-data": "^3.0.0",
@@ -44,20 +44,20 @@ export interface IInnerAPIRequest extends IInnerAPIBaseRequest, IInnerAPIOpenSDK
44
44
  }
45
45
  export interface IInnerAPIBaseRequest {
46
46
  createRecordBySync: (objectApiName: string, record: object, authType: string) => any;
47
- createRecordV3BySync: (objectApiName: string, record: object, authType: string) => any;
47
+ createRecordBySyncV3: (objectApiName: string, record: object, authType: string) => any;
48
48
  updateRecordBySync: (objectApiName: string, recordID: number, record: object, authType: string) => any;
49
- updateRecordV3BySync: (objectApiName: string, recordID: string, record: object, authType: string) => any;
49
+ updateRecordBySyncV3: (objectApiName: string, recordID: string, record: object, authType: string) => any;
50
50
  deleteRecordBySync: (objectApiName: string, recordID: number, authType: string) => any;
51
- deleteRecordV3BySync: (objectApiName: string, recordID: string, authType: string) => any;
51
+ deleteRecordBySyncV3: (objectApiName: string, recordID: string, authType: string) => any;
52
52
  createRecordsByAsync: (objectApiName: string, records: object[], authType: string) => any;
53
53
  updateRecordsByAsync: (objectApiName: string, recordMap: Record<number, object>, authType: string) => any;
54
54
  deleteRecordsByAsync: (objectApiName: string, recordIDs: number[], authType: string) => any;
55
55
  createRecordsBySync: (objectApiName: string, records: object[], authType: string) => any;
56
- createRecordsV3BySync: (objectApiName: string, records: object[], authType: string) => any;
56
+ createRecordsBySyncV3: (objectApiName: string, records: object[], authType: string) => any;
57
57
  updateRecordsBySync: (objectApiName: string, recordMap: Record<number, object>, authType: string) => Promise<Record<number, string>>;
58
- updateRecordsV3BySync: (objectApiName: string, recordMap: object[], authType: string) => Promise<Record<string, string>>;
58
+ updateRecordsBySyncV3: (objectApiName: string, recordMap: object[], authType: string) => Promise<Record<string, string>>;
59
59
  deleteRecordsBySync: (objectApiName: string, recordIDs: number[], authType: string) => Promise<Record<number, string>>;
60
- deleteRecordsV3BySync: (objectApiName: string, recordIDs: string[], authType: string) => Promise<Record<string, string>>;
60
+ deleteRecordsBySyncV3: (objectApiName: string, recordIDs: string[], authType: string) => Promise<Record<string, string>>;
61
61
  getRecordsOrCountByCriterion: (objectApiName: string, criterion: string | Criterion, fuzzySearch: any, order: Order[], ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string) => any;
62
62
  getRecordsV3OrCounByCriterion: (objectApiName: string, criterion: string | CriterionV3, quickQuery: string, quickQueryFields: string[], order: Order[], fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string) => any;
63
63
  updateWorkflowVariables: (ctx: any, instanceId: number, variables: object, variableTypes: object) => Promise<void>;
@@ -12,20 +12,20 @@ export declare class RequestHttp implements IInnerAPIRequest {
12
12
  constructor();
13
13
  updateWorkflowVariables(ctx: any, instanceId: number, variables: object, variableTypes: object): any;
14
14
  createRecordBySync(objectApiName: string, record: object, authType: string): any;
15
- createRecordV3BySync(objectApiName: string, record: object, authType: string): any;
15
+ createRecordBySyncV3(objectApiName: string, record: object, authType: string): any;
16
16
  updateRecordBySync(objectApiName: string, recordID: number, record: object, authType: string): any;
17
- updateRecordV3BySync(objectApiName: string, recordID: string, record: object, authType: string): any;
17
+ updateRecordBySyncV3(objectApiName: string, recordID: string, record: object, authType: string): any;
18
18
  deleteRecordBySync(objectApiName: string, recordID: number, authType: string): any;
19
- deleteRecordV3BySync(objectApiName: string, recordID: string, authType: string): any;
19
+ deleteRecordBySyncV3(objectApiName: string, recordID: string, authType: string): any;
20
20
  createRecordsByAsync(objectApiName: string, records: object[], authType: string): any;
21
21
  updateRecordsByAsync(objectApiName: string, recordMap: Record<number, object>, authType: string): any;
22
22
  deleteRecordsByAsync(objectApiName: string, recordIDs: number[], authType: string): any;
23
23
  createRecordsBySync(objectApiName: string, records: object[], authType: string): any;
24
- createRecordsV3BySync(objectApiName: string, records: object[], authType: string): any;
24
+ createRecordsBySyncV3(objectApiName: string, records: object[], authType: string): any;
25
25
  updateRecordsBySync(objectApiName: string, recordMap: Record<number, object>, authType: string): Promise<Record<number, string>>;
26
- updateRecordsV3BySync(objectApiName: string, records: object[], authType: string): Promise<Record<string, string>>;
26
+ updateRecordsBySyncV3(objectApiName: string, records: object[], authType: string): Promise<Record<string, string>>;
27
27
  deleteRecordsBySync(objectApiName: string, recordIDs: number[], authType: string): Promise<Record<number, string>>;
28
- deleteRecordsV3BySync(objectApiName: string, recordIDs: string[], authType: string): Promise<Record<string, string>>;
28
+ deleteRecordsBySyncV3(objectApiName: string, recordIDs: string[], authType: string): Promise<Record<string, string>>;
29
29
  getRecordsOrCountByCriterion(objectApiName: string, criterion: string | Criterion, order: Order[], fuzzySearch: any, ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string): any;
30
30
  getRecordsV3OrCounByCriterion(objectApiName: string, criterion: string | CriterionV3, quickQuery: string, quickQueryFields: string[], order: Order[], fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string): any;
31
31
  uploadFile(data: Stream, expire: number, fileName?: string): Promise<UploadFileResp>;
@@ -69,13 +69,13 @@ async function createRecordBySync(objectApiName, record, authType) {
69
69
  }
70
70
  return data;
71
71
  }
72
- async function createRecordV3BySync(objectApiName, record, authType) {
72
+ async function createRecordBySyncV3(objectApiName, record, authType) {
73
73
  // 1.check
74
74
  if (!objectApiName) {
75
75
  throw new exceptions.InvalidParamError('objectApiName is empty');
76
76
  }
77
77
  // 2.获取 options
78
- let options = commonHttp.getOptions(null, openapiHttpPath.createRecordV3BySync);
78
+ let options = commonHttp.getOptions(null, openapiHttpPath.createRecordBySyncV3);
79
79
  let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
80
80
  urlPath = urlPath.replace(replaceKeys.objectApiName, objectApiName);
81
81
  // 3.请求
@@ -127,13 +127,13 @@ async function updateRecordBySync(objectApiName, recordID, record, authType) {
127
127
  }
128
128
  return openapi.doRequest(null, urlPath, options);
129
129
  }
130
- async function updateRecordV3BySync(objectApiName, recordID, record, authType) {
130
+ async function updateRecordBySyncV3(objectApiName, recordID, record, authType) {
131
131
  // 1.check
132
132
  if (!objectApiName) {
133
133
  throw new exceptions.InvalidParamError('objectApiName is empty');
134
134
  }
135
135
  // 2.获取 options
136
- let options = commonHttp.getOptions(null, openapiHttpPath.updateRecordV3BySync);
136
+ let options = commonHttp.getOptions(null, openapiHttpPath.updateRecordBySyncV3);
137
137
  let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
138
138
  urlPath = urlPath.replace(replaceKeys.objectApiName, objectApiName);
139
139
  urlPath = urlPath.replace(replaceKeys.recordID, recordID);
@@ -178,13 +178,13 @@ async function deleteRecordBySync(objectApiName, recordID, authType) {
178
178
  }
179
179
  return openapi.doRequest(null, urlPath, options);
180
180
  }
181
- async function deleteRecordV3BySync(objectApiName, recordID, authType) {
181
+ async function deleteRecordBySyncV3(objectApiName, recordID, authType) {
182
182
  // 1.check
183
183
  if (!objectApiName) {
184
184
  throw new exceptions.InvalidParamError('objectApiName is empty');
185
185
  }
186
186
  // 2.获取 options
187
- let options = commonHttp.getOptions(null, openapiHttpPath.deleteRecordV3BySync);
187
+ let options = commonHttp.getOptions(null, openapiHttpPath.deleteRecordBySyncV3);
188
188
  let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
189
189
  urlPath = urlPath.replace(replaceKeys.objectApiName, objectApiName);
190
190
  urlPath = urlPath.replace(replaceKeys.recordID, recordID);
@@ -284,9 +284,9 @@ async function createRecordsBySync(objectApiName, records, authType) {
284
284
  }
285
285
  return openapi.doRequest(null, urlPath, options);
286
286
  }
287
- async function createRecordsV3BySync(objectApiName, records, authType) {
287
+ async function createRecordsBySyncV3(objectApiName, records, authType) {
288
288
  // 1.获取 options
289
- const options = commonHttp.getOptions(null, openapiHttpPath.createRecordsV3BySync);
289
+ const options = commonHttp.getOptions(null, openapiHttpPath.createRecordsBySyncV3);
290
290
  let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
291
291
  urlPath = urlPath.replace(replaceKeys.objectApiName, objectApiName);
292
292
  // 2.请求
@@ -335,9 +335,9 @@ async function updateRecordsBySync(objectApiName, recordMap, authType) {
335
335
  }
336
336
  return errMap;
337
337
  }
338
- async function updateRecordsV3BySync(objectApiName, records, authType) {
338
+ async function updateRecordsBySyncV3(objectApiName, records, authType) {
339
339
  // 1.获取 options
340
- let options = commonHttp.getOptions(null, openapiHttpPath.updateRecordsV3BySync);
340
+ let options = commonHttp.getOptions(null, openapiHttpPath.updateRecordsBySyncV3);
341
341
  let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
342
342
  urlPath = urlPath.replace(replaceKeys.objectApiName, objectApiName);
343
343
  // 2.请求
@@ -394,9 +394,9 @@ async function deleteRecordsBySync(objectApiName, recordIDs, authType) {
394
394
  }
395
395
  return errMap;
396
396
  }
397
- async function deleteRecordsV3BySync(objectApiName, recordIDs, authType) {
397
+ async function deleteRecordsBySyncV3(objectApiName, recordIDs, authType) {
398
398
  // 1.获取 options
399
- const options = commonHttp.getOptions(null, openapiHttpPath.deleteRecordsV3BySync);
399
+ const options = commonHttp.getOptions(null, openapiHttpPath.deleteRecordsBySyncV3);
400
400
  let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
401
401
  urlPath = urlPath.replace(replaceKeys.objectApiName, objectApiName);
402
402
  // 2.请求
@@ -996,20 +996,20 @@ class RequestHttp {
996
996
  constructor() {
997
997
  this.updateWorkflowVariables = updateWorkflowVariables;
998
998
  this.createRecordBySync = createRecordBySync;
999
- this.createRecordV3BySync = createRecordV3BySync;
999
+ this.createRecordBySyncV3 = createRecordBySyncV3;
1000
1000
  this.updateRecordBySync = updateRecordBySync;
1001
- this.updateRecordV3BySync = updateRecordV3BySync;
1001
+ this.updateRecordBySyncV3 = updateRecordBySyncV3;
1002
1002
  this.deleteRecordBySync = deleteRecordBySync;
1003
- this.deleteRecordV3BySync = deleteRecordV3BySync;
1003
+ this.deleteRecordBySyncV3 = deleteRecordBySyncV3;
1004
1004
  this.createRecordsByAsync = createRecordsByAsync;
1005
1005
  this.updateRecordsByAsync = updateRecordsByAsync;
1006
1006
  this.deleteRecordsByAsync = deleteRecordsByAsync;
1007
1007
  this.createRecordsBySync = createRecordsBySync;
1008
- this.createRecordsV3BySync = createRecordsV3BySync;
1008
+ this.createRecordsBySyncV3 = createRecordsBySyncV3;
1009
1009
  this.updateRecordsBySync = updateRecordsBySync;
1010
- this.updateRecordsV3BySync = updateRecordsV3BySync;
1010
+ this.updateRecordsBySyncV3 = updateRecordsBySyncV3;
1011
1011
  this.deleteRecordsBySync = deleteRecordsBySync;
1012
- this.deleteRecordsV3BySync = deleteRecordsV3BySync;
1012
+ this.deleteRecordsBySyncV3 = deleteRecordsBySyncV3;
1013
1013
  this.getRecordsOrCountByCriterion = getRecordsOrCountByCriterion;
1014
1014
  this.getRecordsV3OrCounByCriterion = getRecordsV3OrCountByCriterion;
1015
1015
  this.uploadFile = uploadFile;
@@ -1044,15 +1044,15 @@ class RequestHttp {
1044
1044
  }
1045
1045
  createRecordBySync(objectApiName, record, authType) {
1046
1046
  }
1047
- createRecordV3BySync(objectApiName, record, authType) {
1047
+ createRecordBySyncV3(objectApiName, record, authType) {
1048
1048
  }
1049
1049
  updateRecordBySync(objectApiName, recordID, record, authType) {
1050
1050
  }
1051
- updateRecordV3BySync(objectApiName, recordID, record, authType) {
1051
+ updateRecordBySyncV3(objectApiName, recordID, record, authType) {
1052
1052
  }
1053
1053
  deleteRecordBySync(objectApiName, recordID, authType) {
1054
1054
  }
1055
- deleteRecordV3BySync(objectApiName, recordID, authType) {
1055
+ deleteRecordBySyncV3(objectApiName, recordID, authType) {
1056
1056
  }
1057
1057
  createRecordsByAsync(objectApiName, records, authType) {
1058
1058
  }
@@ -1062,18 +1062,18 @@ class RequestHttp {
1062
1062
  }
1063
1063
  createRecordsBySync(objectApiName, records, authType) {
1064
1064
  }
1065
- createRecordsV3BySync(objectApiName, records, authType) {
1065
+ createRecordsBySyncV3(objectApiName, records, authType) {
1066
1066
  }
1067
1067
  updateRecordsBySync(objectApiName, recordMap, authType) {
1068
1068
  return new Promise(undefined);
1069
1069
  }
1070
- updateRecordsV3BySync(objectApiName, records, authType) {
1070
+ updateRecordsBySyncV3(objectApiName, records, authType) {
1071
1071
  return new Promise(undefined);
1072
1072
  }
1073
1073
  deleteRecordsBySync(objectApiName, recordIDs, authType) {
1074
1074
  return new Promise(undefined);
1075
1075
  }
1076
- deleteRecordsV3BySync(objectApiName, recordIDs, authType) {
1076
+ deleteRecordsBySyncV3(objectApiName, recordIDs, authType) {
1077
1077
  return new Promise(undefined);
1078
1078
  }
1079
1079
  getRecordsOrCountByCriterion(objectApiName, criterion, order, fuzzySearch, ignoreBackLookupField, fieldApiNames, offset, limit, needCount, authType) {