@byted-apaas/server-sdk-node 1.1.3-beta.23 → 1.1.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 (64) hide show
  1. package/application/application.js +0 -1
  2. package/application/function/function.js +0 -1
  3. package/application/impl/common.js +0 -1
  4. package/application/impl/impl.js +0 -1
  5. package/constants/constants.js +0 -1
  6. package/context/context.js +0 -1
  7. package/context/db/db.js +0 -1
  8. package/context/db/impl/IObject.d.ts +3 -4
  9. package/context/db/impl/IObject.js +0 -1
  10. package/context/db/impl/db.js +0 -1
  11. package/context/db/impl/object.d.ts +3 -4
  12. package/context/db/impl/object.js +3 -16
  13. package/context/db/impl/oql/ioql.js +0 -1
  14. package/context/db/impl/oql/oql.js +1 -2
  15. package/context/db/impl/order.js +0 -1
  16. package/context/db/impl/propertiesStore.js +0 -1
  17. package/context/db/impl/queryBuilder.js +0 -1
  18. package/context/db/impl/transaction/index.js +1 -6
  19. package/context/db/impl/transaction/operation.js +0 -1
  20. package/context/db/impl/transaction.js +0 -1
  21. package/context/globalConfig/globalConfig.js +0 -1
  22. package/context/integration/IIntegration.js +0 -1
  23. package/context/integration/impl/integration.js +4 -5
  24. package/context/metadata/components/common.js +0 -1
  25. package/context/metadata/components/components.js +0 -1
  26. package/context/metadata/components/desktop/list.js +0 -1
  27. package/context/metadata/components/desktop/recordDetail.js +0 -1
  28. package/context/metadata/components/mobile/list.js +0 -1
  29. package/context/metadata/metadata.js +0 -1
  30. package/context/metadata/objects/fields.js +0 -1
  31. package/context/metadata/objects/fields.util.js +0 -1
  32. package/context/metadata/objects/objects.js +0 -1
  33. package/context/metadata/types/common.js +0 -1
  34. package/context/metadata/types/components.js +0 -1
  35. package/context/metadata/types/objects.js +0 -1
  36. package/context/msg/msg.js +0 -1
  37. package/context/resources/IResources.js +0 -1
  38. package/context/resources/impl/resources.js +0 -1
  39. package/context/tasks/tasks.js +0 -1
  40. package/data/index.js +0 -1
  41. package/global/application/flow/flow.js +0 -1
  42. package/global/application/globalVar/globalVar.js +0 -1
  43. package/global/global.js +0 -1
  44. package/hooks/api.js +0 -1
  45. package/hooks/hooks.js +0 -1
  46. package/kunlun/kunlun.js +0 -1
  47. package/kunlun/operator/IOperator.js +0 -1
  48. package/kunlun/operator/impl/expression.js +0 -1
  49. package/kunlun/operator/impl/logic.js +0 -1
  50. package/kunlun/operator/impl/logicV2.js +0 -1
  51. package/kunlun/operator/impl/operator.js +0 -1
  52. package/kunlun/operator/impl/operatorV2.js +0 -1
  53. package/lib/core.js +0 -1
  54. package/package.json +2 -2
  55. package/request/common.js +0 -1
  56. package/request/constants.js +0 -1
  57. package/request/faasinfra.js +0 -1
  58. package/request/innerapi.d.ts +2 -2
  59. package/request/innerapi.js +4 -30
  60. package/request/interface.d.ts +2 -2
  61. package/request/interface.js +0 -1
  62. package/request/openapi.d.ts +2 -2
  63. package/request/openapi.js +5 -42
  64. package/types/types.js +0 -1
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=application.js.map
@@ -18,4 +18,3 @@ class Function {
18
18
  }
19
19
  }
20
20
  exports.Function = Function;
21
- //# sourceMappingURL=function.js.map
@@ -50,4 +50,3 @@ async function runCtxForOpenSDK(appCtx, promise) {
50
50
  return await promise();
51
51
  }
52
52
  exports.runCtxForOpenSDK = runCtxForOpenSDK;
53
- //# sourceMappingURL=common.js.map
@@ -43,4 +43,3 @@ class Application {
43
43
  }
44
44
  }
45
45
  exports.Application = Application;
46
- //# sourceMappingURL=impl.js.map
@@ -16,4 +16,3 @@ exports.httpStatusCodes = {
16
16
  exports.triggerType = {
17
17
  defaultTrigger: 'default-trigger',
18
18
  };
19
- //# sourceMappingURL=constants.js.map
@@ -23,4 +23,3 @@ class Context extends server_common_node_1.Context {
23
23
  }
24
24
  }
25
25
  exports.Context = Context;
26
- //# sourceMappingURL=context.js.map
package/context/db/db.js CHANGED
@@ -2,4 +2,3 @@
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
- //# sourceMappingURL=db.js.map
@@ -1,5 +1,4 @@
1
1
  import { _Cond, _Record, _WhereCond } from '../../../types/types';
2
- import { BatchResult } from "../../../common/structs";
3
2
  export interface _IKAllEndpoint<T> extends _IKSyncEndpoint<T>, _IKAsyncEndpoint<T> {
4
3
  }
5
4
  export interface _IKSyncEndpoint<T> {
@@ -74,19 +73,19 @@ export interface _IKSyncEndpoint<T> {
74
73
  * @param recordIdList 多个用于删除的记录 ID 组成的数组
75
74
  * @paramExample [1001, 1002, 1003]
76
75
  */
77
- batchDelete(recordIdList: number[]): Promise<BatchResult>;
76
+ batchDelete(recordIdList: number[]): Promise<void>;
78
77
  /**
79
78
  * 批量删除记录
80
79
  * @param recordList 多条用于删除的记录数据组成的数组,记录数据需对 _id 赋值
81
80
  * @paramExample [{_id: 1001, _name: 'John', gender: 'male'}, {_id: 1002, _name: 'Alis', gender: 'female'}]
82
81
  */
83
- batchDelete(recordList: _Cond<T>[]): Promise<BatchResult>;
82
+ batchDelete(recordList: _Cond<T>[]): Promise<void>;
84
83
  /**
85
84
  * 根据 _id 批量更新记录
86
85
  * @param recordMapList 多条用于更新的记录数据组成的数组,记录数据需对 _id 赋值
87
86
  * @paramExample [{_id: 1001, _name: 'John', gender: 'male'}, {_id: 1002, _name: 'Alis', gender: 'female'}]
88
87
  */
89
- batchUpdate(recordMapList: _Cond<T>[]): Promise<BatchResult>;
88
+ batchUpdate(recordMapList: _Cond<T>[]): Promise<void>;
90
89
  /**
91
90
  * 用户级鉴权
92
91
  */
@@ -3,4 +3,3 @@
3
3
  // SPDX-License-Identifier: MIT
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  ;
6
- //# sourceMappingURL=IObject.js.map
@@ -79,4 +79,3 @@ class ApplicationDB {
79
79
  }
80
80
  }
81
81
  exports.ApplicationDB = ApplicationDB;
82
- //# sourceMappingURL=db.js.map
@@ -1,7 +1,6 @@
1
1
  import { _Cond, _Record, _WhereCond } from '../../../types/types';
2
2
  import { _IKAsyncEndpoint, _IKQuery, _IKSyncEndpoint } from './IObject';
3
3
  import { AppCtx } from '../../../application/application';
4
- import { BatchResult } from "../../../common/structs";
5
4
  /**
6
5
  * _KObject is kunlun object, every method new a _KQuery object to deal.
7
6
  */
@@ -33,9 +32,9 @@ declare class _KObjectSync<T> implements _IKSyncEndpoint<T> {
33
32
  update(_id: number, recordMap: _Cond<T>): Promise<void>;
34
33
  update(recordMap: _Cond<T>): Promise<void>;
35
34
  batchCreate(recordMapList: _Cond<T>[]): Promise<number[]>;
36
- batchDelete(recordIdList: number[]): Promise<BatchResult>;
37
- batchDelete(recordList: _Cond<T>[]): Promise<BatchResult>;
38
- batchUpdate(recordMapList: _Cond<T>[]): Promise<BatchResult>;
35
+ batchDelete(recordIdList: number[]): Promise<void>;
36
+ batchDelete(recordList: _Cond<T>[]): Promise<void>;
37
+ batchUpdate(recordMapList: _Cond<T>[]): Promise<void>;
39
38
  useUserAuth(): this;
40
39
  useSystemAuth(): this;
41
40
  }
@@ -13,8 +13,6 @@ const common_1 = require("../../../application/impl/common");
13
13
  const logicV2_1 = require("../../../kunlun/operator/impl/logicV2");
14
14
  const operator_1 = require("../../../kunlun/operator/impl/operator");
15
15
  const constants_1 = require("@byted-apaas/server-common-node/constants/constants");
16
- const permissionUtils = require("@byted-apaas/server-common-node/utils/permissionUtils");
17
- const structs_1 = require("../../../common/structs");
18
16
  const queryPropertiesStore = new propertiesStore_1.default();
19
17
  // _KObject will be Mixin with [_KObjectSync, _KObjectAsync, _KObjectQuery]
20
18
  class _KObject {
@@ -49,7 +47,6 @@ class _KObjectSync {
49
47
  if (server_common_node_1.checkUtils.isNotObject(recordMap)) {
50
48
  throw new server_common_node_1.exceptions.InvalidParamError('record is not object');
51
49
  }
52
- recordMap = permissionUtils.delUnauthField(recordMap).newRecord;
53
50
  if (this.appCtx && this.appCtx.mode == 'openSDK') {
54
51
  // request from OpenSDK
55
52
  return await (0, common_1.runCtxForOpenSDK)(this.appCtx, async () => {
@@ -109,7 +106,6 @@ class _KObjectSync {
109
106
  if (!record) {
110
107
  throw new server_common_node_1.exceptions.InvalidParamError('param is empty');
111
108
  }
112
- record = permissionUtils.delUnauthField(record).newRecord;
113
109
  let recordID = record['_id'];
114
110
  if (recordID <= 0) {
115
111
  throw new server_common_node_1.exceptions.InvalidParamError('record._id must greater than 0');
@@ -137,7 +133,6 @@ class _KObjectSync {
137
133
  throw new server_common_node_1.exceptions.InvalidParamError('record is not object');
138
134
  }
139
135
  }
140
- recordMapList = permissionUtils.batchDelUnauthField(recordMapList).newRecords;
141
136
  let data = (this.appCtx && this.appCtx.mode == 'openSDK') ?
142
137
  await (0, common_1.runCtxForOpenSDK)(this.appCtx, async () => {
143
138
  return await Request.GetInstance().openSDKCreateRecordsBySync(this.apiName, recordMapList);
@@ -175,8 +170,7 @@ class _KObjectSync {
175
170
  return await Request.GetInstance().openSDKDeleteRecordsBySync(this.apiName, recordIDs);
176
171
  });
177
172
  }
178
- const errMap = await Request.GetInstance().deleteRecordsBySync(this.apiName, recordIDs, this.authType);
179
- return (0, structs_1.NewBatchResult)(recordIDs, errMap);
173
+ return await Request.GetInstance().deleteRecordsBySync(this.apiName, recordIDs, this.authType);
180
174
  }
181
175
  async batchUpdate(recordMapList) {
182
176
  // 参数校验、组装
@@ -186,8 +180,6 @@ class _KObjectSync {
186
180
  if (!(recordMapList instanceof Array) || recordMapList.length === 0) {
187
181
  throw new server_common_node_1.exceptions.InvalidParamError('param records is not an array or an empty array');
188
182
  }
189
- recordMapList = permissionUtils.batchDelUnauthField(recordMapList).newRecords;
190
- const recordIDs = [];
191
183
  let recordMap = {};
192
184
  for (let record of recordMapList) {
193
185
  let recordID = record['_id'];
@@ -195,7 +187,6 @@ class _KObjectSync {
195
187
  throw new server_common_node_1.exceptions.InvalidParamError('record._id is empty');
196
188
  }
197
189
  recordMap[recordID] = record;
198
- recordIDs.push(recordID);
199
190
  }
200
191
  if (this.appCtx && this.appCtx.mode == 'openSDK') {
201
192
  // request from OpenSDK
@@ -203,8 +194,7 @@ class _KObjectSync {
203
194
  return await Request.GetInstance().openSDKUpdateRecordsBySync(this.apiName, recordMapList);
204
195
  });
205
196
  }
206
- const errMap = await Request.GetInstance().updateRecordsBySync(this.apiName, recordMap, this.authType);
207
- return (0, structs_1.NewBatchResult)(recordIDs, errMap);
197
+ return await Request.GetInstance().updateRecordsBySync(this.apiName, recordMap, this.authType);
208
198
  }
209
199
  ;
210
200
  useUserAuth() {
@@ -240,7 +230,6 @@ class _KObjectAsync {
240
230
  if (server_common_node_1.utils.stringify(recordMapList).length > 50 * 1024 * 1024) {
241
231
  throw new server_common_node_1.exceptions.InvalidParamError('parameter records size exceeds 50MB');
242
232
  }
243
- recordMapList = permissionUtils.batchDelUnauthField(recordMapList).newRecords;
244
233
  return await Request.GetInstance().createRecordsByAsync(this.apiName, recordMapList, this.authType);
245
234
  }
246
235
  ;
@@ -283,7 +272,6 @@ class _KObjectAsync {
283
272
  if (recordMapList.length > 1000) {
284
273
  throw new server_common_node_1.exceptions.InvalidParamError('more than 1000 records in one operation');
285
274
  }
286
- recordMapList = permissionUtils.batchDelUnauthField(recordMapList).newRecords;
287
275
  let recordMap = {};
288
276
  for (let record of recordMapList) {
289
277
  let recordID = record['_id'];
@@ -774,5 +762,4 @@ function applyMixins(derivedCtor, constructors) {
774
762
  });
775
763
  }
776
764
  applyMixins(_KObject, [_KObjectSync, _KObjectAsync, _KObjectQuery]);
777
- applyMixins(_KApplicationObject, [_KObjectSync, _KObjectQuery]); // @ts-ignore
778
- //# sourceMappingURL=object.js.map
765
+ applyMixins(_KApplicationObject, [_KObjectSync, _KObjectQuery]);
@@ -2,4 +2,3 @@
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
- //# sourceMappingURL=ioql.js.map
@@ -27,9 +27,8 @@ class Oql {
27
27
  return this;
28
28
  }
29
29
  useUserAuth() {
30
- this.authType = constants_1.AuthTypeMixUserSystem;
30
+ this.authType = constants_1.AuthTypeUser;
31
31
  return this;
32
32
  }
33
33
  }
34
34
  exports.Oql = Oql;
35
- //# sourceMappingURL=oql.js.map
@@ -13,4 +13,3 @@ class Order {
13
13
  }
14
14
  }
15
15
  exports.Order = Order;
16
- //# sourceMappingURL=order.js.map
@@ -27,4 +27,3 @@ class PropertiesStore {
27
27
  }
28
28
  }
29
29
  exports.default = PropertiesStore;
30
- //# sourceMappingURL=propertiesStore.js.map
@@ -70,4 +70,3 @@ class QueryBuilder {
70
70
  }
71
71
  }
72
72
  exports.QueryBuilder = QueryBuilder;
73
- //# sourceMappingURL=queryBuilder.js.map
@@ -7,7 +7,6 @@ const server_common_node_1 = require("@byted-apaas/server-common-node");
7
7
  const Request = require("../../../../request/interface");
8
8
  const operation_1 = require("./operation");
9
9
  const constants_1 = require("@byted-apaas/server-common-node/constants/constants");
10
- const permissionUtils = require("@byted-apaas/server-common-node/utils/permissionUtils");
11
10
  const assert = require('assert');
12
11
  // eslint-disable-next-line @typescript-eslint/no-require-imports
13
12
  const { v4: uuidv4 } = require('uuid'); //nolint:byted_s_ts_no_require_imports
@@ -45,7 +44,7 @@ class Transaction {
45
44
  if (server_common_node_1.checkUtils.isNotObject(oldRecord)) {
46
45
  throw new server_common_node_1.exceptions.InvalidParamError('record is not object');
47
46
  }
48
- let record = permissionUtils.delUnauthField(oldRecord).newRecord;
47
+ let record = { ...oldRecord };
49
48
  let uuid = uuidv4();
50
49
  let result = { _id: uuid };
51
50
  record._id = uuid;
@@ -71,7 +70,6 @@ class Transaction {
71
70
  if (!recordMap) {
72
71
  throw new server_common_node_1.exceptions.InvalidParamError('record is empty');
73
72
  }
74
- recordMap = permissionUtils.delUnauthField(recordMap).newRecord;
75
73
  const recordID = recordMap._id;
76
74
  if (!recordID) {
77
75
  throw new server_common_node_1.exceptions.InvalidParamError('record._id is empty');
@@ -118,7 +116,6 @@ class Transaction {
118
116
  if (recordMaps.length < 1) {
119
117
  return [];
120
118
  }
121
- recordMaps = permissionUtils.batchDelUnauthField(recordMaps).newRecords;
122
119
  let result = [];
123
120
  let records = [];
124
121
  for (let oldRecord of recordMaps) {
@@ -146,7 +143,6 @@ class Transaction {
146
143
  if (recordMaps.length < 1) {
147
144
  return;
148
145
  }
149
- recordMaps = permissionUtils.batchDelUnauthField(recordMaps).newRecords;
150
146
  // 判断同字段同值更新标志
151
147
  let isSameValue = true;
152
148
  let ids = [];
@@ -289,4 +285,3 @@ function deepEqual(left, right) {
289
285
  }
290
286
  return true;
291
287
  }
292
- //# sourceMappingURL=index.js.map
@@ -67,4 +67,3 @@ class BatchUpdateSameValueOperation extends TransactionOperation {
67
67
  }
68
68
  }
69
69
  exports.BatchUpdateSameValueOperation = BatchUpdateSameValueOperation;
70
- //# sourceMappingURL=operation.js.map
@@ -2,4 +2,3 @@
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
- //# sourceMappingURL=transaction.js.map
@@ -14,4 +14,3 @@ class GlobalConfig {
14
14
  }
15
15
  }
16
16
  exports.GlobalConfig = GlobalConfig;
17
- //# sourceMappingURL=globalConfig.js.map
@@ -2,4 +2,3 @@
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
- //# sourceMappingURL=IIntegration.js.map
@@ -44,20 +44,19 @@ class _Integration {
44
44
  if (!apiName) {
45
45
  throw new exceptions.InvalidParamError(`apiName is null`);
46
46
  }
47
- return await Request.GetInstance().getIntegrationAppAccessToken(apiName);
47
+ return await Request.GetHttpInstance().getIntegrationAppAccessToken(apiName);
48
48
  }
49
49
  async getDefaultAppAccessToken() {
50
- return await Request.GetInstance().getDefaultIntegrationAppAccessToken();
50
+ return await Request.GetHttpInstance().getDefaultIntegrationAppAccessToken();
51
51
  }
52
52
  async getDefaultTenantAccessToken() {
53
- return await Request.GetInstance().getDefaultIntegrationTenantAccessToken();
53
+ return await Request.GetHttpInstance().getDefaultIntegrationTenantAccessToken();
54
54
  }
55
55
  async getTenantAccessToken(apiName) {
56
56
  if (!apiName) {
57
57
  throw new exceptions.InvalidParamError(`apiName is null`);
58
58
  }
59
- return await Request.GetInstance().getIntegrationTenantAccessToken(apiName);
59
+ return await Request.GetHttpInstance().getIntegrationTenantAccessToken(apiName);
60
60
  }
61
61
  }
62
62
  exports._Integration = _Integration;
63
- //# sourceMappingURL=integration.js.map
@@ -15,4 +15,3 @@ class Component {
15
15
  }
16
16
  }
17
17
  exports.Component = Component;
18
- //# sourceMappingURL=common.js.map
@@ -17,4 +17,3 @@ const mobile = {
17
17
  List: list_2.List,
18
18
  };
19
19
  exports.mobile = mobile;
20
- //# sourceMappingURL=components.js.map
@@ -400,4 +400,3 @@ function parseConcatenate(element) {
400
400
  }
401
401
  return null;
402
402
  }
403
- //# sourceMappingURL=list.js.map
@@ -51,4 +51,3 @@ function getSelectedFields(input) {
51
51
  }
52
52
  return selectedFields;
53
53
  }
54
- //# sourceMappingURL=recordDetail.js.map
@@ -143,4 +143,3 @@ function getFilter(input) {
143
143
  return {};
144
144
  }
145
145
  }
146
- //# sourceMappingURL=list.js.map
@@ -97,4 +97,3 @@ function metaType() {
97
97
  };
98
98
  }
99
99
  exports.metaType = metaType;
100
- //# sourceMappingURL=metadata.js.map
@@ -332,4 +332,3 @@ const fieldTypeMap = {
332
332
  'extractSingleRecord': 'compositeType',
333
333
  'richText': 'richText',
334
334
  };
335
- //# sourceMappingURL=fields.js.map
@@ -317,4 +317,3 @@ function getRecordPosition(field) {
317
317
  return pos;
318
318
  }
319
319
  exports.getRecordPosition = getRecordPosition;
320
- //# sourceMappingURL=fields.util.js.map
@@ -18,4 +18,3 @@ class Objects {
18
18
  }
19
19
  }
20
20
  exports.Object = Objects;
21
- //# sourceMappingURL=objects.js.map
@@ -7,4 +7,3 @@ function isNullOrUndefined(param) {
7
7
  return param === null || param === undefined;
8
8
  }
9
9
  exports.isNullOrUndefined = isNullOrUndefined;
10
- //# sourceMappingURL=common.js.map
@@ -2,4 +2,3 @@
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
- //# sourceMappingURL=components.js.map
@@ -2,4 +2,3 @@
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
- //# sourceMappingURL=objects.js.map
@@ -33,4 +33,3 @@ class Message {
33
33
  }
34
34
  }
35
35
  exports.Message = Message;
36
- //# sourceMappingURL=msg.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IResources.js.map
@@ -159,4 +159,3 @@ class _Resources {
159
159
  }
160
160
  }
161
161
  exports._Resources = _Resources;
162
- //# sourceMappingURL=resources.js.map
@@ -137,4 +137,3 @@ class Tasks {
137
137
  ;
138
138
  }
139
139
  exports.Tasks = Tasks;
140
- //# sourceMappingURL=tasks.js.map
package/data/index.js CHANGED
@@ -2,4 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  ;
4
4
  ;
5
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=flow.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=globalVar.js.map
package/global/global.js CHANGED
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const common = require("@byted-apaas/server-common-node");
4
- //# sourceMappingURL=global.js.map
package/hooks/api.js CHANGED
@@ -345,4 +345,3 @@ exports.workflow = {
345
345
  exports.metaData = new metadata_1.MetaData(null);
346
346
  var impl_1 = require("../application/impl/impl");
347
347
  Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return impl_1.Application; } });
348
- //# sourceMappingURL=api.js.map
package/hooks/hooks.js CHANGED
@@ -107,4 +107,3 @@ function mountApplication(context) {
107
107
  module.exports = {
108
108
  pre,
109
109
  };
110
- //# sourceMappingURL=hooks.js.map
package/kunlun/kunlun.js CHANGED
@@ -56,4 +56,3 @@ var kunlun;
56
56
  */
57
57
  kunlun.operator = new operator_1.Operator();
58
58
  })(kunlun = exports.kunlun || (exports.kunlun = {}));
59
- //# sourceMappingURL=kunlun.js.map
@@ -2,4 +2,3 @@
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
- //# sourceMappingURL=IOperator.js.map
@@ -54,4 +54,3 @@ class MetadataExpressionField extends ExpressionField {
54
54
  }
55
55
  }
56
56
  exports.MetadataExpressionField = MetadataExpressionField;
57
- //# sourceMappingURL=expression.js.map
@@ -524,4 +524,3 @@ function dateAdd(date, num) {
524
524
  return date;
525
525
  }
526
526
  }
527
- //# sourceMappingURL=logic.js.map
@@ -195,4 +195,3 @@ function buildCriterionV2(filter) {
195
195
  return conditions;
196
196
  }
197
197
  exports.buildCriterionV2 = buildCriterionV2;
198
- //# sourceMappingURL=logicV2.js.map
@@ -220,4 +220,3 @@ class Operator {
220
220
  ;
221
221
  }
222
222
  exports.Operator = Operator;
223
- //# sourceMappingURL=operator.js.map
@@ -214,4 +214,3 @@ class OperatorV2 {
214
214
  ;
215
215
  }
216
216
  exports.OperatorV2 = OperatorV2;
217
- //# sourceMappingURL=operatorV2.js.map
package/lib/core.js CHANGED
@@ -17,4 +17,3 @@ Object.defineProperty(exports, "microservice", { enumerable: true, get: function
17
17
  Object.defineProperty(exports, "workflow", { enumerable: true, get: function () { return api_1.workflow; } });
18
18
  Object.defineProperty(exports, "metaData", { enumerable: true, get: function () { return api_1.metaData; } });
19
19
  Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return api_1.Application; } });
20
- //# sourceMappingURL=core.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byted-apaas/server-sdk-node",
3
- "version": "1.1.3-beta.23",
3
+ "version": "1.1.3",
4
4
  "description": "aPaaS Server SDK",
5
5
  "author": "zhouwexin <zhouwexin@bytedance.com>",
6
6
  "homepage": "",
@@ -12,7 +12,7 @@
12
12
  "pre-build": "rm -rf build && tsc"
13
13
  },
14
14
  "dependencies": {
15
- "@byted-apaas/server-common-node": "^1.0.17-beta.43",
15
+ "@byted-apaas/server-common-node": "^1.0.18",
16
16
  "@jorgeferrero/stream-to-buffer": "^2.0.6",
17
17
  "dayjs": "^1.9.6",
18
18
  "form-data": "^3.0.0",
package/request/common.js CHANGED
@@ -86,4 +86,3 @@ async function getNamespaceForOpenAndFaaSSDK() {
86
86
  return utils.getNamespaceFromCtx();
87
87
  }
88
88
  exports.getNamespaceForOpenAndFaaSSDK = getNamespaceForOpenAndFaaSSDK;
89
- //# sourceMappingURL=common.js.map
@@ -23,4 +23,3 @@ exports.openapiHttpPath = {
23
23
  revokeExecution: new config_1.PostHttpConfig(`/api/flow/v1/namespaces/${constants_1.replaceKeys.namespace}/executions/${constants_1.replaceKeys.id}/revoke`, exports.metricsMethodKeys.revokeExecution),
24
24
  getExecutionInfo: new config_1.GetHttpConfig(`/api/flow/v1/namespaces/${constants_1.replaceKeys.namespace}/executions/${constants_1.replaceKeys.id}/detail`, exports.metricsMethodKeys.getExecutionInfo),
25
25
  };
26
- //# sourceMappingURL=constants.js.map
@@ -146,4 +146,3 @@ function parseQueryParams(path) {
146
146
  }
147
147
  return params;
148
148
  }
149
- //# sourceMappingURL=faasinfra.js.map
@@ -15,8 +15,8 @@ export declare class RequestRpc implements IInnerAPIRequest {
15
15
  updateRecordsByAsync(objectApiName: string, recordMap: Record<number, object>, authType: string): any;
16
16
  deleteRecordsByAsync(objectApiName: string, recordIDs: number[], authType: string): any;
17
17
  createRecordsBySync(objectApiName: string, records: object[], authType: string): any;
18
- updateRecordsBySync(objectApiName: string, recordMap: Record<number, object>, authType: string): Promise<Record<number, string>>;
19
- deleteRecordsBySync(objectApiName: string, recordIDs: number[], authType: string): Promise<Record<number, string>>;
18
+ updateRecordsBySync(objectApiName: string, recordMap: Record<number, object>, authType: string): any;
19
+ deleteRecordsBySync(objectApiName: string, recordIDs: number[], authType: string): any;
20
20
  getRecordsOrCountByCriterion(objectApiName: string, criterion: string | Criterion, fuzzySearch: any, order: Order[], ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string): any;
21
21
  updateWorkflowVariables(ctx: any, instanceId: number, variables: object, variableTypes: object): Promise<void>;
22
22
  uploadFile(data: Stream, expire: number): Promise<UploadFileResp>;
@@ -10,8 +10,6 @@ const common_1 = require("./common");
10
10
  const exceptions_1 = require("@byted-apaas/server-common-node/utils/exceptions");
11
11
  const fs = require("fs");
12
12
  const path = require("path");
13
- const permissionUtils = require("@byted-apaas/server-common-node/utils/permissionUtils");
14
- const constants_2 = require("@byted-apaas/server-common-node/constants/constants");
15
13
  const rpc = common.rpc;
16
14
  const exceptions = common.exceptions;
17
15
  const utils = common.utils;
@@ -289,14 +287,11 @@ async function updateRecordsBySync(objectApiName, recordMap, authType) {
289
287
  }
290
288
  // 5.后置处理
291
289
  post(resp.BaseResp);
292
- if (!resp || !resp.ErrMap) {
293
- return undefined;
294
- }
295
290
  const errMap = {};
296
291
  resp.ErrMap.forEach((v, k) => {
297
292
  errMap[Number(k)] = v;
298
293
  });
299
- return errMap;
294
+ return { err_map: errMap };
300
295
  }
301
296
  async function deleteRecordsBySync(objectApiName, recordIDs, authType) {
302
297
  // 1.check
@@ -330,14 +325,11 @@ async function deleteRecordsBySync(objectApiName, recordIDs, authType) {
330
325
  }
331
326
  // 5.后置处理
332
327
  post(resp.BaseResp);
333
- if (!resp || !resp.ErrMap) {
334
- return undefined;
335
- }
336
328
  const errMap = {};
337
329
  resp.ErrMap.forEach((v, k) => {
338
330
  errMap[Number(k)] = v;
339
331
  });
340
- return errMap;
332
+ return { err_map: errMap };
341
333
  }
342
334
  async function getRecordsOrCountByCriterion(objectApiName, criterion, fuzzySearch, order, ignoreBackLookupField, fieldApiNames, offset, limit, needCount, authType) {
343
335
  // 1.check
@@ -367,11 +359,6 @@ async function getRecordsOrCountByCriterion(objectApiName, criterion, fuzzySearc
367
359
  param.NeedFilterUserPermission = false;
368
360
  param.NeedTotalCount = needCount;
369
361
  param.FuzzySearch = fuzzySearch;
370
- // 只返回 slice 结果,使用 SliceResult
371
- // 只返回 map 结果,使用 MapResult
372
- // 分不清场景可以用 BothResult,性能较差,建议区分场景
373
- // 0 表示不返回 unauth field 任何数据; 1 表示两者都返回;2 表示仅返回 slice;3 表示仅返回 map
374
- param.ProcessAuthFieldType = 2;
375
362
  // 4.发起请求
376
363
  let resp;
377
364
  try {
@@ -386,11 +373,7 @@ async function getRecordsOrCountByCriterion(objectApiName, criterion, fuzzySearc
386
373
  return Number(resp.Total);
387
374
  }
388
375
  else {
389
- const records = JSON.parse(resp.DataList);
390
- if (resp.UnauthPermissionInfo && resp.UnauthPermissionInfo.unauth_field_slice) {
391
- permissionUtils.appendUnauthFieldRecordList(objectApiName, records, resp.UnauthPermissionInfo.unauth_field_slice, true);
392
- }
393
- return records;
376
+ return JSON.parse(resp.DataList);
394
377
  }
395
378
  }
396
379
  async function updateWorkflowVariables(iCtx, instanceId, variables, variableTypes) {
@@ -804,16 +787,12 @@ async function oql(oql, args, namedArgs, authType) {
804
787
  args,
805
788
  namedArgs,
806
789
  'compat': true,
807
- 'unauthFields': true,
808
790
  });
809
791
  // 2. prepare args
810
792
  let param = {};
811
793
  param.Namespace = await (0, common_1.getNamespaceForOpenAndFaaSSDK)();
812
794
  param.QueryData = Buffer.from(queryData);
813
795
  // 3. prepare request
814
- if (authType === constants_2.AuthTypeUser) {
815
- authType = constants_2.AuthTypeMixUserSystem;
816
- }
817
796
  let ctx = await pre(true, authType);
818
797
  // 4. do request
819
798
  let resp;
@@ -826,9 +805,7 @@ async function oql(oql, args, namedArgs, authType) {
826
805
  // 5. deal with response
827
806
  post(resp.BaseResp);
828
807
  try {
829
- const records = JSON.parse(resp.Rows ? resp.Rows : '[]');
830
- permissionUtils.appendUnauthFieldRecordList("", records, resp.UnauthFieldSlice, true);
831
- return records;
808
+ return JSON.parse(resp.Rows ? resp.Rows : '[]');
832
809
  }
833
810
  catch (e) {
834
811
  throw new exceptions.InternalError(`oql result parse failed: ${e.message}`);
@@ -1136,10 +1113,8 @@ class RequestRpc {
1136
1113
  createRecordsBySync(objectApiName, records, authType) {
1137
1114
  }
1138
1115
  updateRecordsBySync(objectApiName, recordMap, authType) {
1139
- return undefined;
1140
1116
  }
1141
1117
  deleteRecordsBySync(objectApiName, recordIDs, authType) {
1142
- return undefined;
1143
1118
  }
1144
1119
  getRecordsOrCountByCriterion(objectApiName, criterion, fuzzySearch, order, ignoreBackLookupField, fieldApiNames, offset, limit, needCount, authType) {
1145
1120
  }
@@ -1578,4 +1553,3 @@ async function getDefaultIntegrationTenantAccessToken() {
1578
1553
  appId: resp.AppID ? resp.AppID : undefined,
1579
1554
  };
1580
1555
  }
1581
- //# sourceMappingURL=innerapi.js.map
@@ -49,8 +49,8 @@ export interface IInnerAPIBaseRequest {
49
49
  updateRecordsByAsync: (objectApiName: string, recordMap: Record<number, object>, authType: string) => any;
50
50
  deleteRecordsByAsync: (objectApiName: string, recordIDs: number[], authType: string) => any;
51
51
  createRecordsBySync: (objectApiName: string, records: object[], authType: string) => any;
52
- updateRecordsBySync: (objectApiName: string, recordMap: Record<number, object>, authType: string) => Promise<Record<number, string>>;
53
- deleteRecordsBySync: (objectApiName: string, recordIDs: number[], authType: string) => Promise<Record<number, string>>;
52
+ updateRecordsBySync: (objectApiName: string, recordMap: Record<number, object>, authType: string) => any;
53
+ deleteRecordsBySync: (objectApiName: string, recordIDs: number[], authType: string) => any;
54
54
  getRecordsOrCountByCriterion: (objectApiName: string, criterion: string | Criterion, fuzzySearch: any, order: Order[], ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string) => any;
55
55
  updateWorkflowVariables: (ctx: any, instanceId: number, variables: object, variableTypes: object) => Promise<void>;
56
56
  uploadFile: (data: Stream, expire: number) => Promise<UploadFileResp>;
@@ -39,4 +39,3 @@ function GetFaaSInfraInstance() {
39
39
  return new faasinfra_1.FaaSInfraRequest();
40
40
  }
41
41
  exports.GetFaaSInfraInstance = GetFaaSInfraInstance;
42
- //# sourceMappingURL=interface.js.map
@@ -17,8 +17,8 @@ export declare class RequestHttp implements IInnerAPIRequest {
17
17
  updateRecordsByAsync(objectApiName: string, recordMap: Record<number, object>, authType: string): any;
18
18
  deleteRecordsByAsync(objectApiName: string, recordIDs: number[], authType: string): any;
19
19
  createRecordsBySync(objectApiName: string, records: object[], authType: string): any;
20
- updateRecordsBySync(objectApiName: string, recordMap: Record<number, object>, authType: string): Promise<Record<number, string>>;
21
- deleteRecordsBySync(objectApiName: string, recordIDs: number[], authType: string): Promise<Record<number, string>>;
20
+ updateRecordsBySync(objectApiName: string, recordMap: Record<number, object>, authType: string): any;
21
+ deleteRecordsBySync(objectApiName: string, recordIDs: number[], authType: string): any;
22
22
  getRecordsOrCountByCriterion(objectApiName: string, criterion: string | Criterion, order: Order[], fuzzySearch: any, ignoreBackLookupField: boolean, fieldApiNames: string[], offset: number, limit: number, needCount: boolean, authType: string): any;
23
23
  uploadFile(data: Stream, expire: number): Promise<UploadFileResp>;
24
24
  downloadFileByID(fileID: string, filePath?: string): Promise<undefined | Buffer>;
@@ -10,7 +10,6 @@ const constants_2 = require("./constants");
10
10
  const constants_3 = require("@byted-apaas/server-common-node/constants/constants");
11
11
  const common_1 = require("./common");
12
12
  const utils_1 = require("@byted-apaas/server-common-node/utils/utils");
13
- const permissionUtils = require("@byted-apaas/server-common-node/utils/permissionUtils");
14
13
  // eslint-disable-next-line @typescript-eslint/no-require-imports
15
14
  const nodeCls = require('node-cls'); //nolint:byted_s_ts_no_require_imports
16
15
  const fs = require('fs');
@@ -224,15 +223,7 @@ async function updateRecordsBySync(objectApiName, recordMap, authType) {
224
223
  if (task_id) {
225
224
  options.json.automation_task_id = task_id;
226
225
  }
227
- const resp = await openapi.doRequest(null, urlPath, options);
228
- if (!resp || !resp.err_map) {
229
- return undefined;
230
- }
231
- const errMap = {};
232
- for (let recordID of Object.keys(resp.err_map)) {
233
- errMap[Number(recordID)] = resp.err_map[recordID];
234
- }
235
- return errMap;
226
+ return openapi.doRequest(null, urlPath, options);
236
227
  }
237
228
  async function deleteRecordsBySync(objectApiName, recordIDs, authType) {
238
229
  // 1.获取 options
@@ -254,17 +245,9 @@ async function deleteRecordsBySync(objectApiName, recordIDs, authType) {
254
245
  if (task_id) {
255
246
  options.json.automation_task_id = task_id;
256
247
  }
257
- const resp = await openapi.doRequest(null, urlPath, options);
258
- if (!resp || !resp.err_map) {
259
- return undefined;
260
- }
261
- const errMap = {};
262
- for (let recordID of Object.keys(resp.err_map)) {
263
- errMap[Number(recordID)] = resp.err_map[recordID];
264
- }
265
- return errMap;
248
+ return openapi.doRequest(null, urlPath, options);
266
249
  }
267
- function handleResponse(objectAPIName, data, needCount) {
250
+ function handleResponse(data, needCount) {
268
251
  // 返回数据的特殊处理
269
252
  if (needCount) {
270
253
  if (checkUtils.isObject(data) && data.total) {
@@ -274,11 +257,7 @@ function handleResponse(objectAPIName, data, needCount) {
274
257
  }
275
258
  else {
276
259
  if (checkUtils.isObject(data) && data.data_list) {
277
- const records = data.data_list;
278
- if (data.unauthPermissionInfo && data.unauthPermissionInfo.UnauthFieldSlice) {
279
- permissionUtils.appendUnauthFieldRecordList(objectAPIName, records, data.unauthPermissionInfo.UnauthFieldSlice, true);
280
- }
281
- return records;
260
+ return data.data_list;
282
261
  }
283
262
  return [];
284
263
  }
@@ -303,11 +282,6 @@ async function getRecordsOrCountByCriterion(objectApiName, criterion, fuzzySearc
303
282
  'need_filter_user_permission': false,
304
283
  'need_total_count': needCount,
305
284
  fuzzySearch,
306
- // 只返回 slice 结果,使用 SliceResult
307
- // 只返回 map 结果,使用 MapResult
308
- // 分不清场景可以用 BothResult,性能较差,建议区分场景
309
- // 0 表示不返回 unauth field 任何数据; 1 表示两者都返回;2 表示仅返回 slice;3 表示仅返回 map
310
- 'process_auth_field_type': 2,
311
285
  };
312
286
  authType = (0, utils_1.formatAuthType)(authType);
313
287
  options.headers.User = String(utils.getUserIDFromCtx());
@@ -315,7 +289,7 @@ async function getRecordsOrCountByCriterion(objectApiName, criterion, fuzzySearc
315
289
  options.headers[constants_3.AuthTypeHttpHeader] = authType;
316
290
  }
317
291
  let data = await openapi.doRequest(null, urlPath, options);
318
- return handleResponse(objectApiName, data, needCount);
292
+ return handleResponse(data, needCount);
319
293
  }
320
294
  /**
321
295
  * 上传文件
@@ -625,22 +599,14 @@ async function oql(oql, args, namedArgs, authType) {
625
599
  args,
626
600
  namedArgs,
627
601
  'compat': true,
628
- variable: {
629
- unauth_fields: true,
630
- },
631
602
  };
632
603
  authType = (0, utils_1.formatAuthType)(authType);
633
604
  options.headers.User = String(utils.getUserIDFromCtx());
634
605
  if (authType) {
635
- if (authType === constants_3.AuthTypeUser) {
636
- // select 鉴权,where、groupBy、orderBy 不鉴权
637
- authType = constants_3.AuthTypeMixUserSystem;
638
- }
639
606
  options.headers[constants_3.AuthTypeHttpHeader] = authType;
640
607
  }
641
608
  let result = await openapi.doRequest(null, urlPath, options);
642
609
  if (result && result.rows) {
643
- permissionUtils.appendUnauthFieldRecordList("", result.rows, result.unauth_field_slice, true);
644
610
  return result.rows;
645
611
  }
646
612
  return [];
@@ -825,10 +791,8 @@ class RequestHttp {
825
791
  createRecordsBySync(objectApiName, records, authType) {
826
792
  }
827
793
  updateRecordsBySync(objectApiName, recordMap, authType) {
828
- return undefined;
829
794
  }
830
795
  deleteRecordsBySync(objectApiName, recordIDs, authType) {
831
- return undefined;
832
796
  }
833
797
  getRecordsOrCountByCriterion(objectApiName, criterion, order, fuzzySearch, ignoreBackLookupField, fieldApiNames, offset, limit, needCount, authType) {
834
798
  }
@@ -1186,4 +1150,3 @@ async function getDefaultIntegrationTenantAccessToken() {
1186
1150
  appId: res.appId,
1187
1151
  };
1188
1152
  }
1189
- //# sourceMappingURL=openapi.js.map
package/types/types.js CHANGED
@@ -2,4 +2,3 @@
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
- //# sourceMappingURL=types.js.map