@steedos/objectql 2.2.52-beta.7 → 2.2.52

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 (182) hide show
  1. package/LICENSE.txt +2 -5
  2. package/lib/actions/field_updates.js +7 -7
  3. package/lib/actions/field_updates.js.map +1 -1
  4. package/lib/actions/index.js +3 -3
  5. package/lib/actions/index.js.map +1 -1
  6. package/lib/actions/workflow_notifications.js +6 -6
  7. package/lib/actions/workflow_notifications.js.map +1 -1
  8. package/lib/actions/workflow_rule.js +9 -9
  9. package/lib/actions/workflow_rule.js.map +1 -1
  10. package/lib/broker.d.ts +7 -0
  11. package/lib/broker.js +41 -0
  12. package/lib/broker.js.map +1 -0
  13. package/lib/driver/field-encrytion/index.js +1 -1
  14. package/lib/driver/field-encrytion/index.js.map +1 -1
  15. package/lib/driver/field-encrytion/mongosharedconst.d.ts +2 -1
  16. package/lib/driver/index.js +2 -2
  17. package/lib/driver/index.js.map +1 -1
  18. package/lib/driver/meteorMongo.d.ts +1 -1
  19. package/lib/driver/meteorMongo.js +32 -32
  20. package/lib/driver/mongo.d.ts +1 -1
  21. package/lib/driver/mongo.js +39 -40
  22. package/lib/driver/mongo.js.map +1 -1
  23. package/lib/driver/mysql.d.ts +1 -1
  24. package/lib/driver/mysql.js +9 -2
  25. package/lib/driver/mysql.js.map +1 -1
  26. package/lib/driver/oracle.d.ts +1 -1
  27. package/lib/driver/oracle.js +11 -4
  28. package/lib/driver/oracle.js.map +1 -1
  29. package/lib/driver/postgres.d.ts +1 -1
  30. package/lib/driver/postgres.js +9 -2
  31. package/lib/driver/postgres.js.map +1 -1
  32. package/lib/driver/sqlite3.d.ts +1 -1
  33. package/lib/driver/sqlite3.js +9 -2
  34. package/lib/driver/sqlite3.js.map +1 -1
  35. package/lib/driver/sqlserver.d.ts +1 -1
  36. package/lib/driver/sqlserver.js +11 -4
  37. package/lib/driver/sqlserver.js.map +1 -1
  38. package/lib/dynamic-load/actions.js +6 -6
  39. package/lib/dynamic-load/actions.js.map +1 -1
  40. package/lib/dynamic-load/approval_process.js +1 -1
  41. package/lib/dynamic-load/approval_process.js.map +1 -1
  42. package/lib/dynamic-load/button.js +5 -7
  43. package/lib/dynamic-load/button.js.map +1 -1
  44. package/lib/dynamic-load/chart.js +2 -2
  45. package/lib/dynamic-load/client_script.js +19 -18
  46. package/lib/dynamic-load/client_script.js.map +1 -1
  47. package/lib/dynamic-load/field.js +5 -7
  48. package/lib/dynamic-load/field.js.map +1 -1
  49. package/lib/dynamic-load/index.js +21 -21
  50. package/lib/dynamic-load/index.js.map +1 -1
  51. package/lib/dynamic-load/layout.js +6 -7
  52. package/lib/dynamic-load/layout.js.map +1 -1
  53. package/lib/dynamic-load/listview.js +4 -5
  54. package/lib/dynamic-load/listview.js.map +1 -1
  55. package/lib/dynamic-load/object_translations.js +7 -7
  56. package/lib/dynamic-load/object_translations.js.map +1 -1
  57. package/lib/dynamic-load/package.js +15 -15
  58. package/lib/dynamic-load/package.js.map +1 -1
  59. package/lib/dynamic-load/page.js +2 -2
  60. package/lib/dynamic-load/permission.js +4 -4
  61. package/lib/dynamic-load/permission.js.map +1 -1
  62. package/lib/dynamic-load/permissionset.js +20 -20
  63. package/lib/dynamic-load/permissionset.js.map +1 -1
  64. package/lib/dynamic-load/preload_data.js +21 -21
  65. package/lib/dynamic-load/preload_data.js.map +1 -1
  66. package/lib/dynamic-load/profile.js +23 -23
  67. package/lib/dynamic-load/profile.js.map +1 -1
  68. package/lib/dynamic-load/query.js +2 -2
  69. package/lib/dynamic-load/restrictionRules.js +2 -2
  70. package/lib/dynamic-load/shareRules.js +2 -2
  71. package/lib/dynamic-load/tab.js +2 -2
  72. package/lib/dynamic-load/tabs.js +4 -4
  73. package/lib/dynamic-load/translations.js +9 -9
  74. package/lib/dynamic-load/translations.js.map +1 -1
  75. package/lib/dynamic-load/trigger.js +1 -1
  76. package/lib/dynamic-load/trigger.js.map +1 -1
  77. package/lib/dynamic-load/workflow.js +3 -3
  78. package/lib/dynamic-load/workflow.js.map +1 -1
  79. package/lib/formula/core.js +87 -54
  80. package/lib/formula/core.js.map +1 -1
  81. package/lib/formula/field_formula.js +12 -12
  82. package/lib/formula/index.js +13 -13
  83. package/lib/formula/index.js.map +1 -1
  84. package/lib/formula/recompute.js +13 -13
  85. package/lib/formula/recompute.js.map +1 -1
  86. package/lib/formula/type.d.ts +1 -0
  87. package/lib/formula/type.js.map +1 -1
  88. package/lib/formula/util.js +4 -3
  89. package/lib/formula/util.js.map +1 -1
  90. package/lib/index.d.ts +2 -1
  91. package/lib/index.js +22 -20
  92. package/lib/index.js.map +1 -1
  93. package/lib/metadata-register/_base.js +12 -12
  94. package/lib/metadata-register/app.js +8 -8
  95. package/lib/metadata-register/chart.js +1 -1
  96. package/lib/metadata-register/chart.js.map +1 -1
  97. package/lib/metadata-register/index.js +48 -48
  98. package/lib/metadata-register/layout.js +10 -10
  99. package/lib/metadata-register/object.js +10 -10
  100. package/lib/metadata-register/page.js +1 -1
  101. package/lib/metadata-register/page.js.map +1 -1
  102. package/lib/metadata-register/permissionFields.js +1 -1
  103. package/lib/metadata-register/permissionFields.js.map +1 -1
  104. package/lib/metadata-register/permissionset.js +6 -6
  105. package/lib/metadata-register/process.js +1 -1
  106. package/lib/metadata-register/process.js.map +1 -1
  107. package/lib/metadata-register/processTrigger.js +1 -1
  108. package/lib/metadata-register/processTrigger.js.map +1 -1
  109. package/lib/metadata-register/profile.js +6 -6
  110. package/lib/metadata-register/query.js +1 -1
  111. package/lib/metadata-register/query.js.map +1 -1
  112. package/lib/metadata-register/restrictionRules.js +1 -1
  113. package/lib/metadata-register/restrictionRules.js.map +1 -1
  114. package/lib/metadata-register/shareRules.js +1 -1
  115. package/lib/metadata-register/shareRules.js.map +1 -1
  116. package/lib/metadata-register/tab.js +1 -1
  117. package/lib/metadata-register/tab.js.map +1 -1
  118. package/lib/metadata-register/tabs.js +10 -10
  119. package/lib/services/datasourceServiceFactory.js +2 -2
  120. package/lib/services/helpers/graphql/index.js +149 -104
  121. package/lib/services/helpers/graphql/index.js.map +1 -1
  122. package/lib/services/index.js +4 -4
  123. package/lib/services/index.js.map +1 -1
  124. package/lib/services/objectService.js +142 -142
  125. package/lib/services/objectService.js.map +1 -1
  126. package/lib/services/objectServiceDispatcher.js +89 -89
  127. package/lib/services/objectServiceDispatcher.js.map +1 -1
  128. package/lib/services/objectServiceFactory.js +2 -2
  129. package/lib/summary/core.js +34 -22
  130. package/lib/summary/core.js.map +1 -1
  131. package/lib/summary/field_summary.js +10 -10
  132. package/lib/summary/index.js +16 -8
  133. package/lib/summary/index.js.map +1 -1
  134. package/lib/summary/recompute.js +17 -9
  135. package/lib/summary/recompute.js.map +1 -1
  136. package/lib/summary/type.d.ts +1 -0
  137. package/lib/summary/type.js.map +1 -1
  138. package/lib/ts-types/index.js +3 -3
  139. package/lib/ts-types/index.js.map +1 -1
  140. package/lib/typeorm/driver.d.ts +1 -1
  141. package/lib/typeorm/driver.js +42 -69
  142. package/lib/typeorm/driver.js.map +1 -1
  143. package/lib/typeorm/index.js +1 -1
  144. package/lib/typeorm/index.js.map +1 -1
  145. package/lib/typeorm/util.js +5 -5
  146. package/lib/typeorm/util.js.map +1 -1
  147. package/lib/types/app.js +21 -21
  148. package/lib/types/app.js.map +1 -1
  149. package/lib/types/config.js +2 -2
  150. package/lib/types/connection.js +10 -10
  151. package/lib/types/datasource.js +64 -64
  152. package/lib/types/datasource.js.map +1 -1
  153. package/lib/types/field.js +1 -1
  154. package/lib/types/field.js.map +1 -1
  155. package/lib/types/field_permission.js +6 -6
  156. package/lib/types/index.js +10 -10
  157. package/lib/types/index.js.map +1 -1
  158. package/lib/types/list_view.js +1 -1
  159. package/lib/types/list_view.js.map +1 -1
  160. package/lib/types/object.js +166 -152
  161. package/lib/types/object.js.map +1 -1
  162. package/lib/types/object_dynamic_load.js +10 -10
  163. package/lib/types/object_events.js +2 -2
  164. package/lib/types/object_layouts.js +4 -4
  165. package/lib/types/object_permission.js +1 -1
  166. package/lib/types/object_permission.js.map +1 -1
  167. package/lib/types/restrictionRule.js +4 -4
  168. package/lib/types/schema.js +8 -8
  169. package/lib/types/shareRule.js +4 -4
  170. package/lib/types/validation_rules.js +3 -3
  171. package/lib/types/validation_rules.js.map +1 -1
  172. package/lib/util/convert.js +2 -3
  173. package/lib/util/convert.js.map +1 -1
  174. package/lib/util/index.js +18 -16
  175. package/lib/util/index.js.map +1 -1
  176. package/package.json +22 -36
  177. package/lib/edition/index.d.ts +0 -1
  178. package/lib/edition/index.js +0 -12
  179. package/lib/edition/index.js.map +0 -1
  180. package/lib/edition/isPlatformEnterPrise.d.ts +0 -1
  181. package/lib/edition/isPlatformEnterPrise.js +0 -28
  182. package/lib/edition/isPlatformEnterPrise.js.map +0 -1
@@ -43,7 +43,7 @@ var getRepeatObjectNameFromPaths = function (paths) {
43
43
  var e_1, _a;
44
44
  var repeatItem;
45
45
  try {
46
- for (var paths_1 = (0, tslib_1.__values)(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {
46
+ for (var paths_1 = tslib_1.__values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {
47
47
  var p = paths_1_1.value;
48
48
  if (repeatItem) {
49
49
  break;
@@ -75,7 +75,7 @@ var SteedosObjectProperties = /** @class */ (function () {
75
75
  exports._TRIGGERKEYS = ['beforeFind', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterFind', 'afterCount', 'afterFindOne', 'afterInsert', 'afterUpdate', 'afterDelete', 'beforeAggregate', 'afterAggregate'];
76
76
  var properties = ['label', 'icon', 'enable_search', 'sidebar', 'is_enable', 'enable_files', 'enable_tasks', 'enable_notes', 'enable_events', 'enable_api', 'enable_share', 'enable_instances', 'enable_chatter', 'enable_audit', 'enable_web_forms', 'enable_inline_edit', 'enable_approvals', 'enable_trash', 'enable_space_global', 'enable_tree', 'parent_field', 'children_field', 'enable_enhanced_lookup', 'enable_workflow', 'is_view', 'hidden', 'description', 'custom', 'owner', 'methods', '_id', 'relatedList', 'fields_serial_number', "is_enable", "in_development", "version", "paging"];
77
77
  var SteedosObjectType = /** @class */ (function (_super) {
78
- (0, tslib_1.__extends)(SteedosObjectType, _super);
78
+ tslib_1.__extends(SteedosObjectType, _super);
79
79
  function SteedosObjectType(object_name, datasource, config) {
80
80
  var _this = _super.call(this) || this;
81
81
  _this._fields = {};
@@ -232,9 +232,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
232
232
  configurable: true
233
233
  });
234
234
  SteedosObjectType.prototype.callMetadataObjectServiceAction = function (action, params) {
235
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
235
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
236
236
  var actionFullName, result;
237
- return (0, tslib_1.__generator)(this, function (_a) {
237
+ return tslib_1.__generator(this, function (_a) {
238
238
  switch (_a.label) {
239
239
  case 0:
240
240
  actionFullName = "objects.".concat(action);
@@ -311,10 +311,10 @@ var SteedosObjectType = /** @class */ (function (_super) {
311
311
  delete this._triggersQueue[trigger.when][trigger.name];
312
312
  };
313
313
  SteedosObjectType.prototype.runTirgger = function (trigger, context) {
314
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
314
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
315
315
  var object_name, event, todoWrapper, thisArg;
316
316
  var _this = this;
317
- return (0, tslib_1.__generator)(this, function (_a) {
317
+ return tslib_1.__generator(this, function (_a) {
318
318
  switch (_a.label) {
319
319
  case 0:
320
320
  object_name = this.name;
@@ -324,8 +324,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
324
324
  for (var _i = 0; _i < arguments.length; _i++) {
325
325
  args[_i] = arguments[_i];
326
326
  }
327
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
328
- return (0, tslib_1.__generator)(this, function (_a) {
327
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
328
+ return tslib_1.__generator(this, function (_a) {
329
329
  switch (_a.label) {
330
330
  case 0: return [4 /*yield*/, event.apply(thisArg, args)];
331
331
  case 1:
@@ -335,7 +335,7 @@ var SteedosObjectType = /** @class */ (function (_super) {
335
335
  });
336
336
  });
337
337
  };
338
- thisArg = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, context), { object_name: object_name, datasource_name: this._datasource.name, getObject: function (object_name) {
338
+ thisArg = tslib_1.__assign(tslib_1.__assign({}, context), { object_name: object_name, datasource_name: this._datasource.name, getObject: function (object_name) {
339
339
  return _this._schema.getObject(object_name);
340
340
  } });
341
341
  return [4 /*yield*/, todoWrapper.call(thisArg)];
@@ -345,9 +345,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
345
345
  });
346
346
  };
347
347
  SteedosObjectType.prototype.runTriggers = function (when, context) {
348
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
348
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
349
349
  var triggers, triggerKeys, index, trigger, wildcardListeners, _a, _b, _i, key, listener, triggerConfig, trigger;
350
- return (0, tslib_1.__generator)(this, function (_c) {
350
+ return tslib_1.__generator(this, function (_c) {
351
351
  switch (_c.label) {
352
352
  case 0:
353
353
  triggers = this._triggersQueue[when];
@@ -443,10 +443,10 @@ var SteedosObjectType = /** @class */ (function (_super) {
443
443
  return triggers;
444
444
  };
445
445
  SteedosObjectType.prototype.runTriggerActions = function (when, context) {
446
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
446
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
447
447
  var triggers, triggers_1, triggers_1_1, trigger, params, e_2_1;
448
448
  var e_2, _a;
449
- return (0, tslib_1.__generator)(this, function (_b) {
449
+ return tslib_1.__generator(this, function (_b) {
450
450
  switch (_b.label) {
451
451
  case 0:
452
452
  triggers = this.getTriggerActions(when);
@@ -456,7 +456,7 @@ var SteedosObjectType = /** @class */ (function (_super) {
456
456
  _b.label = 1;
457
457
  case 1:
458
458
  _b.trys.push([1, 6, 7, 8]);
459
- triggers_1 = (0, tslib_1.__values)(triggers), triggers_1_1 = triggers_1.next();
459
+ triggers_1 = tslib_1.__values(triggers), triggers_1_1 = triggers_1.next();
460
460
  _b.label = 2;
461
461
  case 2:
462
462
  if (!!triggers_1_1.done) return [3 /*break*/, 5];
@@ -496,6 +496,7 @@ var SteedosObjectType = /** @class */ (function (_super) {
496
496
  SteedosObjectType.prototype.toConfig = function () {
497
497
  var _this = this;
498
498
  var config = {
499
+ idFieldName: this.idFieldName,
499
500
  name: this.name,
500
501
  fields: {}
501
502
  };
@@ -564,8 +565,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
564
565
  return this.NAME_FIELD_KEY;
565
566
  };
566
567
  SteedosObjectType.prototype.getDetailPaths = function () {
567
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
568
- return (0, tslib_1.__generator)(this, function (_a) {
568
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
569
+ return tslib_1.__generator(this, function (_a) {
569
570
  switch (_a.label) {
570
571
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getDetailPaths", { objectApiName: this.name })];
571
572
  case 1: return [2 /*return*/, _a.sent()];
@@ -574,8 +575,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
574
575
  });
575
576
  };
576
577
  SteedosObjectType.prototype.getMasterPaths = function () {
577
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
578
- return (0, tslib_1.__generator)(this, function (_a) {
578
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
579
+ return tslib_1.__generator(this, function (_a) {
579
580
  switch (_a.label) {
580
581
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMasterPaths", { objectApiName: this.name })];
581
582
  case 1: return [2 /*return*/, _a.sent()];
@@ -584,8 +585,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
584
585
  });
585
586
  };
586
587
  SteedosObjectType.prototype.getMaxDetailsLeave = function (paths) {
587
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
588
- return (0, tslib_1.__generator)(this, function (_a) {
588
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
589
+ return tslib_1.__generator(this, function (_a) {
589
590
  switch (_a.label) {
590
591
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMaxDetailsLeave", { objectApiName: this.name, paths: paths })];
591
592
  case 1: return [2 /*return*/, _a.sent()];
@@ -594,8 +595,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
594
595
  });
595
596
  };
596
597
  SteedosObjectType.prototype.getMaxMastersLeave = function (paths) {
597
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
598
- return (0, tslib_1.__generator)(this, function (_a) {
598
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
599
+ return tslib_1.__generator(this, function (_a) {
599
600
  switch (_a.label) {
600
601
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMaxMastersLeave", { objectApiName: this.name, paths: paths })];
601
602
  case 1: return [2 /*return*/, _a.sent()];
@@ -642,9 +643,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
642
643
  };
643
644
  SteedosObjectType.prototype.refreshIndexes = function () {
644
645
  var e_3, _a;
645
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
646
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
646
647
  var adapter, collection, defaultAdapter, indexesInfo, dropIndexNames, key, field, info, indexesInfo_1, indexesInfo_1_1, indexInfo, key, error_1, e_3_1, error_2;
647
- return (0, tslib_1.__generator)(this, function (_b) {
648
+ return tslib_1.__generator(this, function (_b) {
648
649
  switch (_b.label) {
649
650
  case 0:
650
651
  if (!(this.datasource.driver === datasource_1.SteedosDatabaseDriverType.Mongo || this.datasource.driver === datasource_1.SteedosDatabaseDriverType.MeteorMongo)) return [3 /*break*/, 21];
@@ -680,7 +681,7 @@ var SteedosObjectType = /** @class */ (function (_super) {
680
681
  _b.label = 5;
681
682
  case 5:
682
683
  _b.trys.push([5, 13, 14, 19]);
683
- indexesInfo_1 = (0, tslib_1.__asyncValues)(indexesInfo);
684
+ indexesInfo_1 = tslib_1.__asyncValues(indexesInfo);
684
685
  _b.label = 6;
685
686
  case 6: return [4 /*yield*/, indexesInfo_1.next()];
686
687
  case 7:
@@ -765,9 +766,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
765
766
  * @return {*}
766
767
  */
767
768
  SteedosObjectType.prototype.getUserObjectPermission = function (userSession, rolesFieldsPermission) {
768
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
769
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
769
770
  var roles, objectRolesPermission, userObjectPermission, field_permissions, spaceId;
770
- return (0, tslib_1.__generator)(this, function (_a) {
771
+ return tslib_1.__generator(this, function (_a) {
771
772
  switch (_a.label) {
772
773
  case 0:
773
774
  if (!userSession) {
@@ -847,11 +848,11 @@ var SteedosObjectType = /** @class */ (function (_super) {
847
848
  else if (['viewAssignCompanysRecords', 'modifyAssignCompanysRecords'].indexOf(k) > -1) {
848
849
  if ('modifyAssignCompanysRecords' === k) {
849
850
  if (!_.isEmpty(_v) && _.isArray(_v)) {
850
- (_a = userObjectPermission['viewAssignCompanysRecords']).push.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(_v), false));
851
+ (_a = userObjectPermission['viewAssignCompanysRecords']).push.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(_v), false));
851
852
  }
852
853
  }
853
854
  if (!_.isEmpty(_v) && _.isArray(_v)) {
854
- (_b = userObjectPermission[k]).push.apply(_b, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(_v), false));
855
+ (_b = userObjectPermission[k]).push.apply(_b, tslib_1.__spreadArray([], tslib_1.__read(_v), false));
855
856
  }
856
857
  }
857
858
  else if ((_.isArray(v) || _.isNull(v))) {
@@ -911,9 +912,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
911
912
  });
912
913
  };
913
914
  SteedosObjectType.prototype.allowRead = function (userSession) {
914
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
915
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
915
916
  var userObjectPermission;
916
- return (0, tslib_1.__generator)(this, function (_a) {
917
+ return tslib_1.__generator(this, function (_a) {
917
918
  switch (_a.label) {
918
919
  case 0:
919
920
  if (!userSession)
@@ -933,9 +934,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
933
934
  });
934
935
  };
935
936
  SteedosObjectType.prototype.allowInsert = function (userSession) {
936
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
937
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
937
938
  var userObjectPermission;
938
- return (0, tslib_1.__generator)(this, function (_a) {
939
+ return tslib_1.__generator(this, function (_a) {
939
940
  switch (_a.label) {
940
941
  case 0:
941
942
  if (!userSession)
@@ -955,9 +956,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
955
956
  });
956
957
  };
957
958
  SteedosObjectType.prototype.allowUpdate = function (userSession) {
958
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
959
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
959
960
  var userObjectPermission;
960
- return (0, tslib_1.__generator)(this, function (_a) {
961
+ return tslib_1.__generator(this, function (_a) {
961
962
  switch (_a.label) {
962
963
  case 0:
963
964
  if (!userSession)
@@ -977,9 +978,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
977
978
  });
978
979
  };
979
980
  SteedosObjectType.prototype.allowDelete = function (userSession) {
980
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
981
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
981
982
  var userObjectPermission;
982
- return (0, tslib_1.__generator)(this, function (_a) {
983
+ return tslib_1.__generator(this, function (_a) {
983
984
  switch (_a.label) {
984
985
  case 0:
985
986
  if (!userSession)
@@ -999,9 +1000,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
999
1000
  });
1000
1001
  };
1001
1002
  SteedosObjectType.prototype.find = function (query, userSession) {
1002
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1003
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1003
1004
  var clonedQuery;
1004
- return (0, tslib_1.__generator)(this, function (_a) {
1005
+ return tslib_1.__generator(this, function (_a) {
1005
1006
  switch (_a.label) {
1006
1007
  case 0:
1007
1008
  clonedQuery = Object.assign({}, query);
@@ -1018,9 +1019,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1018
1019
  };
1019
1020
  // 此函数支持driver: MeteorMongo
1020
1021
  SteedosObjectType.prototype.aggregate = function (query, externalPipeline, userSession) {
1021
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1022
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1022
1023
  var clonedQuery;
1023
- return (0, tslib_1.__generator)(this, function (_a) {
1024
+ return tslib_1.__generator(this, function (_a) {
1024
1025
  switch (_a.label) {
1025
1026
  case 0:
1026
1027
  clonedQuery = Object.assign({}, query);
@@ -1037,9 +1038,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1037
1038
  };
1038
1039
  // 此函数支持driver: MeteorMongo
1039
1040
  SteedosObjectType.prototype.directAggregate = function (query, externalPipeline, userSession) {
1040
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1041
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1041
1042
  var clonedQuery;
1042
- return (0, tslib_1.__generator)(this, function (_a) {
1043
+ return tslib_1.__generator(this, function (_a) {
1043
1044
  switch (_a.label) {
1044
1045
  case 0:
1045
1046
  clonedQuery = Object.assign({}, query);
@@ -1056,9 +1057,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1056
1057
  };
1057
1058
  // 此函数支持driver: MeteorMongo,类似于aggregate,其参数externalPipeline放在最前面而已
1058
1059
  SteedosObjectType.prototype.directAggregatePrefixalPipeline = function (query, prefixalPipeline, userSession) {
1059
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1060
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1060
1061
  var clonedQuery;
1061
- return (0, tslib_1.__generator)(this, function (_a) {
1062
+ return tslib_1.__generator(this, function (_a) {
1062
1063
  switch (_a.label) {
1063
1064
  case 0:
1064
1065
  clonedQuery = Object.assign({}, query);
@@ -1074,9 +1075,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1074
1075
  });
1075
1076
  };
1076
1077
  SteedosObjectType.prototype.findOne = function (id, query, userSession) {
1077
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1078
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1078
1079
  var clonedQuery, result;
1079
- return (0, tslib_1.__generator)(this, function (_a) {
1080
+ return tslib_1.__generator(this, function (_a) {
1080
1081
  switch (_a.label) {
1081
1082
  case 0:
1082
1083
  clonedQuery = Object.assign({}, query);
@@ -1094,8 +1095,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1094
1095
  });
1095
1096
  };
1096
1097
  SteedosObjectType.prototype.insert = function (doc, userSession) {
1097
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1098
- return (0, tslib_1.__generator)(this, function (_a) {
1098
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1099
+ return tslib_1.__generator(this, function (_a) {
1099
1100
  switch (_a.label) {
1100
1101
  case 0:
1101
1102
  doc = this.formatRecord(doc);
@@ -1106,9 +1107,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1106
1107
  });
1107
1108
  };
1108
1109
  SteedosObjectType.prototype.update = function (id, doc, userSession) {
1109
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1110
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1110
1111
  var clonedId;
1111
- return (0, tslib_1.__generator)(this, function (_a) {
1112
+ return tslib_1.__generator(this, function (_a) {
1112
1113
  switch (_a.label) {
1113
1114
  case 0:
1114
1115
  doc = this.formatRecord(doc);
@@ -1120,9 +1121,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1120
1121
  });
1121
1122
  };
1122
1123
  SteedosObjectType.prototype.updateOne = function (id, doc, userSession) {
1123
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1124
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1124
1125
  var clonedId;
1125
- return (0, tslib_1.__generator)(this, function (_a) {
1126
+ return tslib_1.__generator(this, function (_a) {
1126
1127
  switch (_a.label) {
1127
1128
  case 0:
1128
1129
  doc = this.formatRecord(doc);
@@ -1135,9 +1136,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1135
1136
  };
1136
1137
  // 此函数支持driver: MeteorMongo、Mongo
1137
1138
  SteedosObjectType.prototype.updateMany = function (queryFilters, doc, userSession) {
1138
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1139
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1139
1140
  var clonedQueryFilters;
1140
- return (0, tslib_1.__generator)(this, function (_a) {
1141
+ return tslib_1.__generator(this, function (_a) {
1141
1142
  switch (_a.label) {
1142
1143
  case 0:
1143
1144
  doc = this.formatRecord(doc);
@@ -1149,9 +1150,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1149
1150
  });
1150
1151
  };
1151
1152
  SteedosObjectType.prototype.delete = function (id, userSession) {
1152
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1153
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1153
1154
  var clonedId;
1154
- return (0, tslib_1.__generator)(this, function (_a) {
1155
+ return tslib_1.__generator(this, function (_a) {
1155
1156
  switch (_a.label) {
1156
1157
  case 0:
1157
1158
  clonedId = id;
@@ -1162,9 +1163,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1162
1163
  });
1163
1164
  };
1164
1165
  SteedosObjectType.prototype.directFind = function (query, userSession) {
1165
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1166
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1166
1167
  var clonedQuery;
1167
- return (0, tslib_1.__generator)(this, function (_a) {
1168
+ return tslib_1.__generator(this, function (_a) {
1168
1169
  switch (_a.label) {
1169
1170
  case 0:
1170
1171
  clonedQuery = Object.assign({}, query);
@@ -1178,8 +1179,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1178
1179
  });
1179
1180
  };
1180
1181
  SteedosObjectType.prototype.directInsert = function (doc, userSession) {
1181
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1182
- return (0, tslib_1.__generator)(this, function (_a) {
1182
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1183
+ return tslib_1.__generator(this, function (_a) {
1183
1184
  switch (_a.label) {
1184
1185
  case 0:
1185
1186
  doc = this.formatRecord(doc);
@@ -1190,9 +1191,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1190
1191
  });
1191
1192
  };
1192
1193
  SteedosObjectType.prototype.directUpdate = function (id, doc, userSession) {
1193
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1194
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1194
1195
  var clonedId;
1195
- return (0, tslib_1.__generator)(this, function (_a) {
1196
+ return tslib_1.__generator(this, function (_a) {
1196
1197
  switch (_a.label) {
1197
1198
  case 0:
1198
1199
  doc = this.formatRecord(doc);
@@ -1204,9 +1205,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1204
1205
  });
1205
1206
  };
1206
1207
  SteedosObjectType.prototype.directDelete = function (id, userSession) {
1207
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1208
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1208
1209
  var clonedId;
1209
- return (0, tslib_1.__generator)(this, function (_a) {
1210
+ return tslib_1.__generator(this, function (_a) {
1210
1211
  switch (_a.label) {
1211
1212
  case 0:
1212
1213
  clonedId = id;
@@ -1217,8 +1218,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1217
1218
  });
1218
1219
  };
1219
1220
  SteedosObjectType.prototype._makeNewID = function () {
1220
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1221
- return (0, tslib_1.__generator)(this, function (_a) {
1221
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1222
+ return tslib_1.__generator(this, function (_a) {
1222
1223
  switch (_a.label) {
1223
1224
  case 0: return [4 /*yield*/, this._datasource._makeNewID(this.table_name)];
1224
1225
  case 1: return [2 /*return*/, _a.sent()];
@@ -1227,16 +1228,16 @@ var SteedosObjectType = /** @class */ (function (_super) {
1227
1228
  });
1228
1229
  };
1229
1230
  SteedosObjectType.prototype.getFirstListView = function () {
1230
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1231
- return (0, tslib_1.__generator)(this, function (_a) {
1231
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1232
+ return tslib_1.__generator(this, function (_a) {
1232
1233
  return [2 /*return*/, this.list_views[0]];
1233
1234
  });
1234
1235
  });
1235
1236
  };
1236
1237
  SteedosObjectType.prototype.getAbsoluteUrl = function (app_id, record_id) {
1237
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1238
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1238
1239
  var object_name, list_view, list_view_id;
1239
- return (0, tslib_1.__generator)(this, function (_a) {
1240
+ return tslib_1.__generator(this, function (_a) {
1240
1241
  switch (_a.label) {
1241
1242
  case 0:
1242
1243
  object_name = this.name;
@@ -1260,8 +1261,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1260
1261
  });
1261
1262
  };
1262
1263
  SteedosObjectType.prototype.getRecordAbsoluteUrl = function (app_id, record_id) {
1263
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1264
- return (0, tslib_1.__generator)(this, function (_a) {
1264
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1265
+ return tslib_1.__generator(this, function (_a) {
1265
1266
  switch (_a.label) {
1266
1267
  case 0: return [4 /*yield*/, this.getAbsoluteUrl(app_id, record_id)];
1267
1268
  case 1: return [2 /*return*/, _a.sent()];
@@ -1270,8 +1271,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1270
1271
  });
1271
1272
  };
1272
1273
  SteedosObjectType.prototype.getGridAbsoluteUrl = function (app_id) {
1273
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1274
- return (0, tslib_1.__generator)(this, function (_a) {
1274
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1275
+ return tslib_1.__generator(this, function (_a) {
1275
1276
  switch (_a.label) {
1276
1277
  case 0: return [4 /*yield*/, this.getAbsoluteUrl(app_id)];
1277
1278
  case 1: return [2 /*return*/, _a.sent()];
@@ -1280,15 +1281,15 @@ var SteedosObjectType = /** @class */ (function (_super) {
1280
1281
  });
1281
1282
  };
1282
1283
  SteedosObjectType.prototype.isEnableAudit = function () {
1283
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1284
- return (0, tslib_1.__generator)(this, function (_a) {
1284
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1285
+ return tslib_1.__generator(this, function (_a) {
1285
1286
  return [2 /*return*/, this.enable_audit];
1286
1287
  });
1287
1288
  });
1288
1289
  };
1289
1290
  SteedosObjectType.prototype.getDetails = function () {
1290
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1291
- return (0, tslib_1.__generator)(this, function (_a) {
1291
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1292
+ return tslib_1.__generator(this, function (_a) {
1292
1293
  switch (_a.label) {
1293
1294
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getDetails", { objectApiName: this.name })];
1294
1295
  case 1: return [2 /*return*/, _a.sent()];
@@ -1297,8 +1298,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1297
1298
  });
1298
1299
  };
1299
1300
  SteedosObjectType.prototype.getMasters = function () {
1300
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1301
- return (0, tslib_1.__generator)(this, function (_a) {
1301
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1302
+ return tslib_1.__generator(this, function (_a) {
1302
1303
  switch (_a.label) {
1303
1304
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMasters", { objectApiName: this.name })];
1304
1305
  case 1: return [2 /*return*/, _a.sent()];
@@ -1307,8 +1308,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1307
1308
  });
1308
1309
  };
1309
1310
  SteedosObjectType.prototype.getLookupDetails = function () {
1310
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1311
- return (0, tslib_1.__generator)(this, function (_a) {
1311
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1312
+ return tslib_1.__generator(this, function (_a) {
1312
1313
  switch (_a.label) {
1313
1314
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getLookupDetails", { objectApiName: this.name })];
1314
1315
  case 1: return [2 /*return*/, _a.sent()];
@@ -1317,8 +1318,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1317
1318
  });
1318
1319
  };
1319
1320
  SteedosObjectType.prototype.getDetailsInfo = function () {
1320
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1321
- return (0, tslib_1.__generator)(this, function (_a) {
1321
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1322
+ return tslib_1.__generator(this, function (_a) {
1322
1323
  switch (_a.label) {
1323
1324
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getDetailsInfo", { objectApiName: this.name })];
1324
1325
  case 1: return [2 /*return*/, _a.sent()];
@@ -1327,8 +1328,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1327
1328
  });
1328
1329
  };
1329
1330
  SteedosObjectType.prototype.getMastersInfo = function () {
1330
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1331
- return (0, tslib_1.__generator)(this, function (_a) {
1331
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1332
+ return tslib_1.__generator(this, function (_a) {
1332
1333
  switch (_a.label) {
1333
1334
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMastersInfo", { objectApiName: this.name })];
1334
1335
  case 1: return [2 /*return*/, _a.sent()];
@@ -1337,8 +1338,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1337
1338
  });
1338
1339
  };
1339
1340
  SteedosObjectType.prototype.getLookupDetailsInfo = function () {
1340
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1341
- return (0, tslib_1.__generator)(this, function (_a) {
1341
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1342
+ return tslib_1.__generator(this, function (_a) {
1342
1343
  switch (_a.label) {
1343
1344
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getLookupDetailsInfo", { objectApiName: this.name })];
1344
1345
  case 1: return [2 /*return*/, _a.sent()];
@@ -1350,8 +1351,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1350
1351
  * 此函数返回getDetailsInfo、getMastersInfo、getLookupDetailsInfo 3个请求的结果,用于优化访问速度
1351
1352
  */
1352
1353
  SteedosObjectType.prototype.getRelationsInfo = function () {
1353
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1354
- return (0, tslib_1.__generator)(this, function (_a) {
1354
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1355
+ return tslib_1.__generator(this, function (_a) {
1355
1356
  switch (_a.label) {
1356
1357
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getRelationsInfo", { objectApiName: this.name })];
1357
1358
  case 1: return [2 /*return*/, _a.sent()];
@@ -1360,9 +1361,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1360
1361
  });
1361
1362
  };
1362
1363
  SteedosObjectType.prototype.getRecordPermissions = function (record, userSession) {
1363
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1364
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1364
1365
  var permissions, userId, user_company_ids, recordOwnerId, isOwner, record_company_id, record_company_ids;
1365
- return (0, tslib_1.__generator)(this, function (_a) {
1366
+ return tslib_1.__generator(this, function (_a) {
1366
1367
  switch (_a.label) {
1367
1368
  case 0: return [4 /*yield*/, this.getUserObjectPermission(userSession)];
1368
1369
  case 1:
@@ -1527,9 +1528,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1527
1528
  };
1528
1529
  SteedosObjectType.prototype.getRecordView = function (userSession, context) {
1529
1530
  if (context === void 0) { context = {}; }
1530
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1531
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1531
1532
  var objectConfig, layouts, spaceProcessDefinition, dbListViews, rolesFieldsPermission, relationsInfo, lng, objectMetadataConfig, _a, objectLayout, layoutButtonsName_1;
1532
- return (0, tslib_1.__generator)(this, function (_b) {
1533
+ return tslib_1.__generator(this, function (_b) {
1533
1534
  switch (_b.label) {
1534
1535
  case 0:
1535
1536
  objectConfig = context.objectConfig, layouts = context.layouts, spaceProcessDefinition = context.spaceProcessDefinition, dbListViews = context.dbListViews, rolesFieldsPermission = context.rolesFieldsPermission, relationsInfo = context.relationsInfo;
@@ -1632,9 +1633,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1632
1633
  };
1633
1634
  SteedosObjectType.prototype.getDefaultRecordView = function (userSession) {
1634
1635
  var e_4, _a;
1635
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1636
- var object_name, type, buttons, fields, related_lists, objectConfig, sortedFields, relatedLists, details, lookup_details, relatedLists_1, relatedLists_1_1, related, relatedItem, foo, rObjectName, relatedObject, relatedObjectAllListView, fieldNames_1, e_4_1;
1637
- return (0, tslib_1.__generator)(this, function (_b) {
1636
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1637
+ var object_name, type, buttons, fields, related_lists, objectConfig, sortedFields, relatedLists, details, lookup_details, _loop_1, relatedLists_1, relatedLists_1_1, e_4_1;
1638
+ return tslib_1.__generator(this, function (_b) {
1638
1639
  switch (_b.label) {
1639
1640
  case 0:
1640
1641
  object_name = this.name;
@@ -1691,36 +1692,49 @@ var SteedosObjectType = /** @class */ (function (_super) {
1691
1692
  _b.label = 4;
1692
1693
  case 4:
1693
1694
  _b.trys.push([4, 10, 11, 16]);
1694
- relatedLists_1 = (0, tslib_1.__asyncValues)(relatedLists);
1695
+ _loop_1 = function () {
1696
+ var related, relatedItem, foo, rObjectName, relatedObject, relatedObjectAllListView, fieldNames_1;
1697
+ return tslib_1.__generator(this, function (_c) {
1698
+ switch (_c.label) {
1699
+ case 0:
1700
+ related = relatedLists_1_1.value;
1701
+ if (!related) return [3 /*break*/, 2];
1702
+ relatedItem = {};
1703
+ relatedItem.related_field_fullname = related;
1704
+ foo = related.split('.');
1705
+ rObjectName = foo[0];
1706
+ return [4 /*yield*/, getObject(rObjectName).toConfig()];
1707
+ case 1:
1708
+ relatedObject = _c.sent();
1709
+ relatedObjectAllListView = _.find(relatedObject.list_views, function (listview) {
1710
+ return listview.name === 'all';
1711
+ });
1712
+ if (relatedObjectAllListView && relatedObjectAllListView.columns) {
1713
+ fieldNames_1 = [];
1714
+ _.each(relatedObjectAllListView.columns, function (column) {
1715
+ if (_.isString(column)) {
1716
+ fieldNames_1.push(column);
1717
+ }
1718
+ else if (_.isObject(column)) {
1719
+ fieldNames_1.push(column.field);
1720
+ }
1721
+ });
1722
+ relatedItem.field_names = fieldNames_1;
1723
+ }
1724
+ related_lists.push(relatedItem);
1725
+ _c.label = 2;
1726
+ case 2: return [2 /*return*/];
1727
+ }
1728
+ });
1729
+ };
1730
+ relatedLists_1 = tslib_1.__asyncValues(relatedLists);
1695
1731
  _b.label = 5;
1696
1732
  case 5: return [4 /*yield*/, relatedLists_1.next()];
1697
1733
  case 6:
1698
1734
  if (!(relatedLists_1_1 = _b.sent(), !relatedLists_1_1.done)) return [3 /*break*/, 9];
1699
- related = relatedLists_1_1.value;
1700
- if (!related) return [3 /*break*/, 8];
1701
- relatedItem = {};
1702
- relatedItem.related_field_fullname = related;
1703
- foo = related.split('.');
1704
- rObjectName = foo[0];
1705
- return [4 /*yield*/, getObject(rObjectName).toConfig()];
1735
+ return [5 /*yield**/, _loop_1()];
1706
1736
  case 7:
1707
- relatedObject = _b.sent();
1708
- relatedObjectAllListView = _.find(relatedObject.list_views, function (listview) {
1709
- return listview.name === 'all';
1710
- });
1711
- if (relatedObjectAllListView && relatedObjectAllListView.columns) {
1712
- fieldNames_1 = [];
1713
- _.each(relatedObjectAllListView.columns, function (column) {
1714
- if (_.isString(column)) {
1715
- fieldNames_1.push(column);
1716
- }
1717
- else if (_.isObject(column)) {
1718
- fieldNames_1.push(column.field);
1719
- }
1720
- });
1721
- relatedItem.field_names = fieldNames_1;
1722
- }
1723
- related_lists.push(relatedItem);
1737
+ _b.sent();
1724
1738
  _b.label = 8;
1725
1739
  case 8: return [3 /*break*/, 5];
1726
1740
  case 9: return [3 /*break*/, 16];
@@ -1770,9 +1784,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1770
1784
  });
1771
1785
  };
1772
1786
  SteedosObjectType.prototype.createDefaultRecordView = function (userSession) {
1773
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1787
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1774
1788
  var name, label, profiles, defaultRecordView, error_3;
1775
- return (0, tslib_1.__generator)(this, function (_a) {
1789
+ return tslib_1.__generator(this, function (_a) {
1776
1790
  switch (_a.label) {
1777
1791
  case 0:
1778
1792
  name = 'default';
@@ -1795,10 +1809,10 @@ var SteedosObjectType = /** @class */ (function (_super) {
1795
1809
  });
1796
1810
  };
1797
1811
  SteedosObjectType.prototype.getRelateds = function () {
1798
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1812
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1799
1813
  var related_objects, detailsInfo, lookupsInfo, relatedInfos, relatedInfos_1, relatedInfos_1_1, info, infos, detailObjectApiName, detailFieldName, related_field, e_5_1;
1800
1814
  var e_5, _a;
1801
- return (0, tslib_1.__generator)(this, function (_b) {
1815
+ return tslib_1.__generator(this, function (_b) {
1802
1816
  switch (_b.label) {
1803
1817
  case 0:
1804
1818
  related_objects = [];
@@ -1815,7 +1829,7 @@ var SteedosObjectType = /** @class */ (function (_super) {
1815
1829
  _b.label = 3;
1816
1830
  case 3:
1817
1831
  _b.trys.push([3, 8, 9, 10]);
1818
- relatedInfos_1 = (0, tslib_1.__values)(relatedInfos), relatedInfos_1_1 = relatedInfos_1.next();
1832
+ relatedInfos_1 = tslib_1.__values(relatedInfos), relatedInfos_1_1 = relatedInfos_1.next();
1819
1833
  _b.label = 4;
1820
1834
  case 4:
1821
1835
  if (!!relatedInfos_1_1.done) return [3 /*break*/, 7];
@@ -1880,9 +1894,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1880
1894
  return methodName.startsWith("direct");
1881
1895
  };
1882
1896
  SteedosObjectType.prototype.count = function (query, userSession) {
1883
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1897
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1884
1898
  var clonedQuery;
1885
- return (0, tslib_1.__generator)(this, function (_a) {
1899
+ return tslib_1.__generator(this, function (_a) {
1886
1900
  switch (_a.label) {
1887
1901
  case 0:
1888
1902
  clonedQuery = Object.assign({}, query);
@@ -1893,8 +1907,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1893
1907
  });
1894
1908
  };
1895
1909
  SteedosObjectType.prototype.allow = function (method, userSession) {
1896
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1897
- return (0, tslib_1.__generator)(this, function (_a) {
1910
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1911
+ return tslib_1.__generator(this, function (_a) {
1898
1912
  switch (_a.label) {
1899
1913
  case 0:
1900
1914
  if (_.isNull(userSession) || _.isUndefined(userSession)) {
@@ -1921,15 +1935,15 @@ var SteedosObjectType = /** @class */ (function (_super) {
1921
1935
  });
1922
1936
  };
1923
1937
  SteedosObjectType.prototype.runBeforeTriggers = function (method, context) {
1924
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1938
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1925
1939
  var meteorWhen, when;
1926
- return (0, tslib_1.__generator)(this, function (_a) {
1940
+ return tslib_1.__generator(this, function (_a) {
1927
1941
  switch (_a.label) {
1928
1942
  case 0:
1929
1943
  if (method === 'count' || method === "findOne") {
1930
1944
  method = 'find';
1931
1945
  }
1932
- meteorWhen = "before".concat(method.charAt(0).toLocaleUpperCase()).concat(_.rest((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(method), false)).join(''));
1946
+ meteorWhen = "before".concat(method.charAt(0).toLocaleUpperCase()).concat(_.rest(tslib_1.__spreadArray([], tslib_1.__read(method), false)).join(''));
1933
1947
  when = "before.".concat(method);
1934
1948
  return [4 /*yield*/, this.runTriggers(meteorWhen, context)];
1935
1949
  case 1:
@@ -1941,12 +1955,12 @@ var SteedosObjectType = /** @class */ (function (_super) {
1941
1955
  });
1942
1956
  };
1943
1957
  SteedosObjectType.prototype.runAfterTriggers = function (method, context) {
1944
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1958
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1945
1959
  var meteorWhen, when;
1946
- return (0, tslib_1.__generator)(this, function (_a) {
1960
+ return tslib_1.__generator(this, function (_a) {
1947
1961
  switch (_a.label) {
1948
1962
  case 0:
1949
- meteorWhen = "after".concat(method.charAt(0).toLocaleUpperCase()).concat(_.rest((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(method), false)).join(''));
1963
+ meteorWhen = "after".concat(method.charAt(0).toLocaleUpperCase()).concat(_.rest(tslib_1.__spreadArray([], tslib_1.__read(method), false)).join(''));
1950
1964
  when = "after.".concat(method);
1951
1965
  return [4 /*yield*/, this.runTriggers(meteorWhen, context)];
1952
1966
  case 1:
@@ -1958,9 +1972,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1958
1972
  });
1959
1973
  };
1960
1974
  SteedosObjectType.prototype.appendRecordPermission = function (records, userSession) {
1961
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1975
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1962
1976
  var _ids, objPm, permissionFilters, filters, results, allowEditIds;
1963
- return (0, tslib_1.__generator)(this, function (_a) {
1977
+ return tslib_1.__generator(this, function (_a) {
1964
1978
  switch (_a.label) {
1965
1979
  case 0:
1966
1980
  _ids = _.pluck(records, '_id');
@@ -1994,9 +2008,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1994
2008
  });
1995
2009
  };
1996
2010
  SteedosObjectType.prototype.getTriggerContext = function (when, method, args, recordId) {
1997
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2011
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1998
2012
  var userSession, context, _a;
1999
- return (0, tslib_1.__generator)(this, function (_b) {
2013
+ return tslib_1.__generator(this, function (_b) {
2000
2014
  switch (_b.label) {
2001
2015
  case 0:
2002
2016
  userSession = args[args.length - 1];
@@ -2025,9 +2039,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
2025
2039
  });
2026
2040
  };
2027
2041
  SteedosObjectType.prototype.processUnreadableField = function (userSession, query) {
2028
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2042
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2029
2043
  var userObjectPermission, userObjectUnreadableFields, queryFields_1;
2030
- return (0, tslib_1.__generator)(this, function (_a) {
2044
+ return tslib_1.__generator(this, function (_a) {
2031
2045
  switch (_a.label) {
2032
2046
  case 0:
2033
2047
  if (!userSession) {
@@ -2097,9 +2111,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
2097
2111
  for (var _i = 1; _i < arguments.length; _i++) {
2098
2112
  args[_i - 1] = arguments[_i];
2099
2113
  }
2100
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2114
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2101
2115
  var adapterMethod, userSession, allow, objectName, recordId, doc, paramRecordId, returnValue, beforeTriggerContext, afterTriggerContext, previousDoc, values, _records;
2102
- return (0, tslib_1.__generator)(this, function (_a) {
2116
+ return tslib_1.__generator(this, function (_a) {
2103
2117
  switch (_a.label) {
2104
2118
  case 0:
2105
2119
  adapterMethod = this._datasource[method];
@@ -2248,9 +2262,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
2248
2262
  };
2249
2263
  ;
2250
2264
  SteedosObjectType.prototype.runRecordFormula = function (method, objectName, recordId, doc, userSession) {
2251
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2265
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2252
2266
  var currentUserId, onlyForOwn, withoutCurrent;
2253
- return (0, tslib_1.__generator)(this, function (_a) {
2267
+ return tslib_1.__generator(this, function (_a) {
2254
2268
  switch (_a.label) {
2255
2269
  case 0:
2256
2270
  if (!(["insert", "update", "updateMany", "delete"].indexOf(method) > -1)) return [3 /*break*/, 5];
@@ -2276,8 +2290,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
2276
2290
  });
2277
2291
  };
2278
2292
  SteedosObjectType.prototype.runRecordSummaries = function (method, objectName, recordId, doc, previousDoc, userSession) {
2279
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2280
- return (0, tslib_1.__generator)(this, function (_a) {
2293
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2294
+ return tslib_1.__generator(this, function (_a) {
2281
2295
  switch (_a.label) {
2282
2296
  case 0:
2283
2297
  if (!(["insert", "update", "updateMany", "delete"].indexOf(method) > -1)) return [3 /*break*/, 5];
@@ -2324,9 +2338,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
2324
2338
  }
2325
2339
  };
2326
2340
  SteedosObjectType.prototype.dealWithMethodPermission = function (method, args) {
2327
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2341
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2328
2342
  var userSession, spaceId, userId, objPm, query, spaceFilter, companyFilter, ownerFilter, sharesFilter, shareRuleFilters, restrictionRuleFilters, clientFilter, filters, permissionFilters, userFilters, viewAssignCompanysRecordsFilter_1, permissionFilters, objectPermissionEditFilters, id, companyFilters, queryFilters, companyFilters, permissionFilters, objectPermissionEditFilters, id, companyFilters;
2329
- return (0, tslib_1.__generator)(this, function (_a) {
2343
+ return tslib_1.__generator(this, function (_a) {
2330
2344
  switch (_a.label) {
2331
2345
  case 0:
2332
2346
  userSession = args[args.length - 1];