@byted-apaas/server-sdk-node 1.1.18-beta.13 → 1.1.18-beta.14

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.
@@ -101,6 +101,7 @@ class _KObjectSync {
101
101
  }
102
102
  ;
103
103
  async deleteV3(recordOrRecordID) {
104
+ console.log("---------------");
104
105
  let recordIDStr;
105
106
  if (typeof recordOrRecordID === 'number') {
106
107
  recordIDStr = recordOrRecordID.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byted-apaas/server-sdk-node",
3
- "version": "1.1.18-beta.13",
3
+ "version": "1.1.18-beta.14",
4
4
  "description": "aPaaS Server SDK",
5
5
  "author": "zhouwexin <zhouwexin@bytedance.com>",
6
6
  "homepage": "",
@@ -69,7 +69,6 @@ async function createRecordBySync(objectApiName, record, authType) {
69
69
  }
70
70
  return data;
71
71
  }
72
- // todo wby
73
72
  async function createRecordV3BySync(objectApiName, record, authType) {
74
73
  // 1.check
75
74
  if (!objectApiName) {
@@ -128,7 +127,6 @@ async function updateRecordBySync(objectApiName, recordID, record, authType) {
128
127
  }
129
128
  return openapi.doRequest(null, urlPath, options);
130
129
  }
131
- // todo wby
132
130
  async function updateRecordV3BySync(objectApiName, recordID, record, authType) {
133
131
  // 1.check
134
132
  if (!objectApiName) {
@@ -180,8 +178,26 @@ async function deleteRecordBySync(objectApiName, recordID, authType) {
180
178
  }
181
179
  return openapi.doRequest(null, urlPath, options);
182
180
  }
183
- // todo wby
184
181
  async function deleteRecordV3BySync(objectApiName, recordID, authType) {
182
+ // 1.check
183
+ if (!objectApiName) {
184
+ throw new exceptions.InvalidParamError('objectApiName is empty');
185
+ }
186
+ // 2.获取 options
187
+ let options = commonHttp.getOptions(null, openapiHttpPath.deleteRecordV3BySync);
188
+ let urlPath = options._reqPath.replace(replaceKeys.namespace, await (0, common_1.getNamespaceForOpenAndFaaSSDK)());
189
+ urlPath = urlPath.replace(replaceKeys.objectApiName, objectApiName);
190
+ urlPath = urlPath.replace(replaceKeys.recordID, recordID);
191
+ authType = (0, utils_1.formatAuthType)(authType);
192
+ options.headers.User = String(utils.getUserIDFromCtx());
193
+ if (authType) {
194
+ options.headers[constants_3.AuthTypeHttpHeader] = authType;
195
+ }
196
+ let task_id = utils.getTriggerTaskID();
197
+ if (task_id) {
198
+ options.json.task_id = task_id;
199
+ }
200
+ return openapi.doRequest(null, urlPath, options);
185
201
  }
186
202
  async function createRecordsByAsync(objectApiName, records, authType) {
187
203
  // 1.获取 options
@@ -342,7 +358,6 @@ async function updateRecordsV3BySync(objectApiName, records, authType) {
342
358
  if (!resp || !resp.err_map) {
343
359
  return undefined;
344
360
  }
345
- // todo wby 待确认返回值
346
361
  const errMap = {};
347
362
  for (let recordID of Object.keys(resp.err_map)) {
348
363
  errMap[String(recordID)] = resp.err_map[recordID];
@@ -495,7 +510,6 @@ async function getRecordsV3OrCountByCriterion(objectApiName, criterion, quickQue
495
510
  'filter': criterion,
496
511
  'quick_query': quickQuery,
497
512
  'quick_query_fields': quickQueryFields,
498
- // fuzzySearch, // todo wby
499
513
  // 只返回 slice 结果,使用 SliceResult
500
514
  // 只返回 map 结果,使用 MapResult
501
515
  // 分不清场景可以用 BothResult,性能较差,建议区分场景