@steedos/objectql 2.2.52-beta.21 → 2.2.52-beta.25

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 (163) hide show
  1. package/LICENSE.txt +2 -3
  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/driver/field-encrytion/index.js +1 -1
  11. package/lib/driver/field-encrytion/index.js.map +1 -1
  12. package/lib/driver/index.js +2 -2
  13. package/lib/driver/index.js.map +1 -1
  14. package/lib/driver/meteorMongo.js +32 -32
  15. package/lib/driver/mongo.js +38 -38
  16. package/lib/driver/mysql.js +1 -1
  17. package/lib/driver/mysql.js.map +1 -1
  18. package/lib/driver/oracle.js +3 -3
  19. package/lib/driver/oracle.js.map +1 -1
  20. package/lib/driver/postgres.js +1 -1
  21. package/lib/driver/postgres.js.map +1 -1
  22. package/lib/driver/sqlite3.js +1 -1
  23. package/lib/driver/sqlite3.js.map +1 -1
  24. package/lib/driver/sqlserver.js +3 -3
  25. package/lib/driver/sqlserver.js.map +1 -1
  26. package/lib/dynamic-load/actions.js +6 -6
  27. package/lib/dynamic-load/actions.js.map +1 -1
  28. package/lib/dynamic-load/approval_process.js +1 -1
  29. package/lib/dynamic-load/approval_process.js.map +1 -1
  30. package/lib/dynamic-load/button.js +5 -7
  31. package/lib/dynamic-load/button.js.map +1 -1
  32. package/lib/dynamic-load/chart.js +2 -2
  33. package/lib/dynamic-load/field.js +5 -7
  34. package/lib/dynamic-load/field.js.map +1 -1
  35. package/lib/dynamic-load/index.js +21 -21
  36. package/lib/dynamic-load/index.js.map +1 -1
  37. package/lib/dynamic-load/layout.js +6 -7
  38. package/lib/dynamic-load/layout.js.map +1 -1
  39. package/lib/dynamic-load/listview.js +4 -5
  40. package/lib/dynamic-load/listview.js.map +1 -1
  41. package/lib/dynamic-load/object_translations.js +7 -7
  42. package/lib/dynamic-load/object_translations.js.map +1 -1
  43. package/lib/dynamic-load/package.js +15 -15
  44. package/lib/dynamic-load/package.js.map +1 -1
  45. package/lib/dynamic-load/page.js +2 -2
  46. package/lib/dynamic-load/permission.js +4 -4
  47. package/lib/dynamic-load/permission.js.map +1 -1
  48. package/lib/dynamic-load/permissionset.js +20 -20
  49. package/lib/dynamic-load/permissionset.js.map +1 -1
  50. package/lib/dynamic-load/preload_data.js +21 -21
  51. package/lib/dynamic-load/preload_data.js.map +1 -1
  52. package/lib/dynamic-load/profile.js +23 -23
  53. package/lib/dynamic-load/profile.js.map +1 -1
  54. package/lib/dynamic-load/query.js +2 -2
  55. package/lib/dynamic-load/restrictionRules.js +2 -2
  56. package/lib/dynamic-load/shareRules.js +2 -2
  57. package/lib/dynamic-load/tab.js +2 -2
  58. package/lib/dynamic-load/tabs.js +4 -4
  59. package/lib/dynamic-load/translations.js +9 -9
  60. package/lib/dynamic-load/translations.js.map +1 -1
  61. package/lib/dynamic-load/trigger.js +1 -1
  62. package/lib/dynamic-load/trigger.js.map +1 -1
  63. package/lib/dynamic-load/workflow.js +3 -3
  64. package/lib/dynamic-load/workflow.js.map +1 -1
  65. package/lib/formula/core.js +87 -54
  66. package/lib/formula/core.js.map +1 -1
  67. package/lib/formula/field_formula.js +12 -12
  68. package/lib/formula/index.js +13 -13
  69. package/lib/formula/index.js.map +1 -1
  70. package/lib/formula/recompute.js +13 -13
  71. package/lib/formula/recompute.js.map +1 -1
  72. package/lib/formula/type.d.ts +1 -0
  73. package/lib/formula/type.js.map +1 -1
  74. package/lib/formula/util.js +4 -3
  75. package/lib/formula/util.js.map +1 -1
  76. package/lib/index.d.ts +0 -1
  77. package/lib/index.js +18 -19
  78. package/lib/index.js.map +1 -1
  79. package/lib/metadata-register/_base.js +12 -12
  80. package/lib/metadata-register/app.js +8 -8
  81. package/lib/metadata-register/chart.js +1 -1
  82. package/lib/metadata-register/chart.js.map +1 -1
  83. package/lib/metadata-register/index.js +48 -48
  84. package/lib/metadata-register/layout.js +10 -10
  85. package/lib/metadata-register/object.js +10 -10
  86. package/lib/metadata-register/page.js +1 -1
  87. package/lib/metadata-register/page.js.map +1 -1
  88. package/lib/metadata-register/permissionFields.js +1 -1
  89. package/lib/metadata-register/permissionFields.js.map +1 -1
  90. package/lib/metadata-register/permissionset.js +6 -6
  91. package/lib/metadata-register/process.js +1 -1
  92. package/lib/metadata-register/process.js.map +1 -1
  93. package/lib/metadata-register/processTrigger.js +1 -1
  94. package/lib/metadata-register/processTrigger.js.map +1 -1
  95. package/lib/metadata-register/profile.js +6 -6
  96. package/lib/metadata-register/query.js +1 -1
  97. package/lib/metadata-register/query.js.map +1 -1
  98. package/lib/metadata-register/restrictionRules.js +1 -1
  99. package/lib/metadata-register/restrictionRules.js.map +1 -1
  100. package/lib/metadata-register/shareRules.js +1 -1
  101. package/lib/metadata-register/shareRules.js.map +1 -1
  102. package/lib/metadata-register/tab.js +1 -1
  103. package/lib/metadata-register/tab.js.map +1 -1
  104. package/lib/metadata-register/tabs.js +10 -10
  105. package/lib/services/datasourceServiceFactory.js +2 -2
  106. package/lib/services/helpers/graphql/index.js +29 -29
  107. package/lib/services/helpers/graphql/index.js.map +1 -1
  108. package/lib/services/index.js +4 -4
  109. package/lib/services/index.js.map +1 -1
  110. package/lib/services/objectService.js +142 -142
  111. package/lib/services/objectService.js.map +1 -1
  112. package/lib/services/objectServiceDispatcher.js +89 -89
  113. package/lib/services/objectServiceDispatcher.js.map +1 -1
  114. package/lib/services/objectServiceFactory.js +2 -2
  115. package/lib/summary/core.js +16 -16
  116. package/lib/summary/core.js.map +1 -1
  117. package/lib/summary/field_summary.js +10 -10
  118. package/lib/summary/index.js +8 -8
  119. package/lib/summary/index.js.map +1 -1
  120. package/lib/summary/recompute.js +6 -6
  121. package/lib/ts-types/index.js +3 -3
  122. package/lib/ts-types/index.js.map +1 -1
  123. package/lib/typeorm/driver.js +40 -40
  124. package/lib/typeorm/index.js +1 -1
  125. package/lib/typeorm/index.js.map +1 -1
  126. package/lib/typeorm/util.js +1 -1
  127. package/lib/typeorm/util.js.map +1 -1
  128. package/lib/types/app.js +21 -21
  129. package/lib/types/app.js.map +1 -1
  130. package/lib/types/config.js +2 -2
  131. package/lib/types/connection.js +10 -10
  132. package/lib/types/datasource.js +64 -64
  133. package/lib/types/datasource.js.map +1 -1
  134. package/lib/types/field.js +1 -1
  135. package/lib/types/field.js.map +1 -1
  136. package/lib/types/field_permission.js +6 -6
  137. package/lib/types/index.js +10 -10
  138. package/lib/types/index.js.map +1 -1
  139. package/lib/types/list_view.js +1 -1
  140. package/lib/types/list_view.js.map +1 -1
  141. package/lib/types/object.js +165 -152
  142. package/lib/types/object.js.map +1 -1
  143. package/lib/types/object_dynamic_load.js +10 -10
  144. package/lib/types/object_events.js +2 -2
  145. package/lib/types/object_layouts.js +4 -4
  146. package/lib/types/object_permission.js +1 -1
  147. package/lib/types/object_permission.js.map +1 -1
  148. package/lib/types/restrictionRule.js +4 -4
  149. package/lib/types/schema.js +8 -8
  150. package/lib/types/shareRule.js +4 -4
  151. package/lib/types/validation_rules.js +3 -3
  152. package/lib/types/validation_rules.js.map +1 -1
  153. package/lib/util/convert.js +2 -3
  154. package/lib/util/convert.js.map +1 -1
  155. package/lib/util/index.js +11 -11
  156. package/lib/util/index.js.map +1 -1
  157. package/package.json +10 -10
  158. package/lib/edition/index.d.ts +0 -1
  159. package/lib/edition/index.js +0 -12
  160. package/lib/edition/index.js.map +0 -1
  161. package/lib/edition/isPlatformEnterPrise.d.ts +0 -1
  162. package/lib/edition/isPlatformEnterPrise.js +0 -28
  163. 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];
@@ -564,8 +564,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
564
564
  return this.NAME_FIELD_KEY;
565
565
  };
566
566
  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) {
567
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
568
+ return tslib_1.__generator(this, function (_a) {
569
569
  switch (_a.label) {
570
570
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getDetailPaths", { objectApiName: this.name })];
571
571
  case 1: return [2 /*return*/, _a.sent()];
@@ -574,8 +574,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
574
574
  });
575
575
  };
576
576
  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) {
577
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
578
+ return tslib_1.__generator(this, function (_a) {
579
579
  switch (_a.label) {
580
580
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMasterPaths", { objectApiName: this.name })];
581
581
  case 1: return [2 /*return*/, _a.sent()];
@@ -584,8 +584,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
584
584
  });
585
585
  };
586
586
  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) {
587
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
588
+ return tslib_1.__generator(this, function (_a) {
589
589
  switch (_a.label) {
590
590
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMaxDetailsLeave", { objectApiName: this.name, paths: paths })];
591
591
  case 1: return [2 /*return*/, _a.sent()];
@@ -594,8 +594,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
594
594
  });
595
595
  };
596
596
  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) {
597
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
598
+ return tslib_1.__generator(this, function (_a) {
599
599
  switch (_a.label) {
600
600
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMaxMastersLeave", { objectApiName: this.name, paths: paths })];
601
601
  case 1: return [2 /*return*/, _a.sent()];
@@ -642,9 +642,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
642
642
  };
643
643
  SteedosObjectType.prototype.refreshIndexes = function () {
644
644
  var e_3, _a;
645
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
645
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
646
646
  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) {
647
+ return tslib_1.__generator(this, function (_b) {
648
648
  switch (_b.label) {
649
649
  case 0:
650
650
  if (!(this.datasource.driver === datasource_1.SteedosDatabaseDriverType.Mongo || this.datasource.driver === datasource_1.SteedosDatabaseDriverType.MeteorMongo)) return [3 /*break*/, 21];
@@ -680,7 +680,7 @@ var SteedosObjectType = /** @class */ (function (_super) {
680
680
  _b.label = 5;
681
681
  case 5:
682
682
  _b.trys.push([5, 13, 14, 19]);
683
- indexesInfo_1 = (0, tslib_1.__asyncValues)(indexesInfo);
683
+ indexesInfo_1 = tslib_1.__asyncValues(indexesInfo);
684
684
  _b.label = 6;
685
685
  case 6: return [4 /*yield*/, indexesInfo_1.next()];
686
686
  case 7:
@@ -765,9 +765,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
765
765
  * @return {*}
766
766
  */
767
767
  SteedosObjectType.prototype.getUserObjectPermission = function (userSession, rolesFieldsPermission) {
768
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
768
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
769
769
  var roles, objectRolesPermission, userObjectPermission, field_permissions, spaceId;
770
- return (0, tslib_1.__generator)(this, function (_a) {
770
+ return tslib_1.__generator(this, function (_a) {
771
771
  switch (_a.label) {
772
772
  case 0:
773
773
  if (!userSession) {
@@ -847,11 +847,11 @@ var SteedosObjectType = /** @class */ (function (_super) {
847
847
  else if (['viewAssignCompanysRecords', 'modifyAssignCompanysRecords'].indexOf(k) > -1) {
848
848
  if ('modifyAssignCompanysRecords' === k) {
849
849
  if (!_.isEmpty(_v) && _.isArray(_v)) {
850
- (_a = userObjectPermission['viewAssignCompanysRecords']).push.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(_v), false));
850
+ (_a = userObjectPermission['viewAssignCompanysRecords']).push.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(_v), false));
851
851
  }
852
852
  }
853
853
  if (!_.isEmpty(_v) && _.isArray(_v)) {
854
- (_b = userObjectPermission[k]).push.apply(_b, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(_v), false));
854
+ (_b = userObjectPermission[k]).push.apply(_b, tslib_1.__spreadArray([], tslib_1.__read(_v), false));
855
855
  }
856
856
  }
857
857
  else if ((_.isArray(v) || _.isNull(v))) {
@@ -911,9 +911,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
911
911
  });
912
912
  };
913
913
  SteedosObjectType.prototype.allowRead = function (userSession) {
914
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
914
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
915
915
  var userObjectPermission;
916
- return (0, tslib_1.__generator)(this, function (_a) {
916
+ return tslib_1.__generator(this, function (_a) {
917
917
  switch (_a.label) {
918
918
  case 0:
919
919
  if (!userSession)
@@ -933,9 +933,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
933
933
  });
934
934
  };
935
935
  SteedosObjectType.prototype.allowInsert = function (userSession) {
936
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
936
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
937
937
  var userObjectPermission;
938
- return (0, tslib_1.__generator)(this, function (_a) {
938
+ return tslib_1.__generator(this, function (_a) {
939
939
  switch (_a.label) {
940
940
  case 0:
941
941
  if (!userSession)
@@ -955,9 +955,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
955
955
  });
956
956
  };
957
957
  SteedosObjectType.prototype.allowUpdate = function (userSession) {
958
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
958
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
959
959
  var userObjectPermission;
960
- return (0, tslib_1.__generator)(this, function (_a) {
960
+ return tslib_1.__generator(this, function (_a) {
961
961
  switch (_a.label) {
962
962
  case 0:
963
963
  if (!userSession)
@@ -977,9 +977,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
977
977
  });
978
978
  };
979
979
  SteedosObjectType.prototype.allowDelete = function (userSession) {
980
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
980
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
981
981
  var userObjectPermission;
982
- return (0, tslib_1.__generator)(this, function (_a) {
982
+ return tslib_1.__generator(this, function (_a) {
983
983
  switch (_a.label) {
984
984
  case 0:
985
985
  if (!userSession)
@@ -999,9 +999,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
999
999
  });
1000
1000
  };
1001
1001
  SteedosObjectType.prototype.find = function (query, userSession) {
1002
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1002
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1003
1003
  var clonedQuery;
1004
- return (0, tslib_1.__generator)(this, function (_a) {
1004
+ return tslib_1.__generator(this, function (_a) {
1005
1005
  switch (_a.label) {
1006
1006
  case 0:
1007
1007
  clonedQuery = Object.assign({}, query);
@@ -1018,9 +1018,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1018
1018
  };
1019
1019
  // 此函数支持driver: MeteorMongo
1020
1020
  SteedosObjectType.prototype.aggregate = function (query, externalPipeline, userSession) {
1021
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1021
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1022
1022
  var clonedQuery;
1023
- return (0, tslib_1.__generator)(this, function (_a) {
1023
+ return tslib_1.__generator(this, function (_a) {
1024
1024
  switch (_a.label) {
1025
1025
  case 0:
1026
1026
  clonedQuery = Object.assign({}, query);
@@ -1037,9 +1037,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1037
1037
  };
1038
1038
  // 此函数支持driver: MeteorMongo
1039
1039
  SteedosObjectType.prototype.directAggregate = function (query, externalPipeline, userSession) {
1040
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1040
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1041
1041
  var clonedQuery;
1042
- return (0, tslib_1.__generator)(this, function (_a) {
1042
+ return tslib_1.__generator(this, function (_a) {
1043
1043
  switch (_a.label) {
1044
1044
  case 0:
1045
1045
  clonedQuery = Object.assign({}, query);
@@ -1056,9 +1056,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1056
1056
  };
1057
1057
  // 此函数支持driver: MeteorMongo,类似于aggregate,其参数externalPipeline放在最前面而已
1058
1058
  SteedosObjectType.prototype.directAggregatePrefixalPipeline = function (query, prefixalPipeline, userSession) {
1059
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1059
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1060
1060
  var clonedQuery;
1061
- return (0, tslib_1.__generator)(this, function (_a) {
1061
+ return tslib_1.__generator(this, function (_a) {
1062
1062
  switch (_a.label) {
1063
1063
  case 0:
1064
1064
  clonedQuery = Object.assign({}, query);
@@ -1074,9 +1074,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1074
1074
  });
1075
1075
  };
1076
1076
  SteedosObjectType.prototype.findOne = function (id, query, userSession) {
1077
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1077
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1078
1078
  var clonedQuery, result;
1079
- return (0, tslib_1.__generator)(this, function (_a) {
1079
+ return tslib_1.__generator(this, function (_a) {
1080
1080
  switch (_a.label) {
1081
1081
  case 0:
1082
1082
  clonedQuery = Object.assign({}, query);
@@ -1094,8 +1094,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1094
1094
  });
1095
1095
  };
1096
1096
  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) {
1097
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1098
+ return tslib_1.__generator(this, function (_a) {
1099
1099
  switch (_a.label) {
1100
1100
  case 0:
1101
1101
  doc = this.formatRecord(doc);
@@ -1106,9 +1106,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1106
1106
  });
1107
1107
  };
1108
1108
  SteedosObjectType.prototype.update = function (id, doc, userSession) {
1109
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1109
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1110
1110
  var clonedId;
1111
- return (0, tslib_1.__generator)(this, function (_a) {
1111
+ return tslib_1.__generator(this, function (_a) {
1112
1112
  switch (_a.label) {
1113
1113
  case 0:
1114
1114
  doc = this.formatRecord(doc);
@@ -1120,9 +1120,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1120
1120
  });
1121
1121
  };
1122
1122
  SteedosObjectType.prototype.updateOne = function (id, doc, userSession) {
1123
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1123
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1124
1124
  var clonedId;
1125
- return (0, tslib_1.__generator)(this, function (_a) {
1125
+ return tslib_1.__generator(this, function (_a) {
1126
1126
  switch (_a.label) {
1127
1127
  case 0:
1128
1128
  doc = this.formatRecord(doc);
@@ -1135,9 +1135,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1135
1135
  };
1136
1136
  // 此函数支持driver: MeteorMongo、Mongo
1137
1137
  SteedosObjectType.prototype.updateMany = function (queryFilters, doc, userSession) {
1138
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1138
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1139
1139
  var clonedQueryFilters;
1140
- return (0, tslib_1.__generator)(this, function (_a) {
1140
+ return tslib_1.__generator(this, function (_a) {
1141
1141
  switch (_a.label) {
1142
1142
  case 0:
1143
1143
  doc = this.formatRecord(doc);
@@ -1149,9 +1149,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1149
1149
  });
1150
1150
  };
1151
1151
  SteedosObjectType.prototype.delete = function (id, userSession) {
1152
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1152
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1153
1153
  var clonedId;
1154
- return (0, tslib_1.__generator)(this, function (_a) {
1154
+ return tslib_1.__generator(this, function (_a) {
1155
1155
  switch (_a.label) {
1156
1156
  case 0:
1157
1157
  clonedId = id;
@@ -1162,9 +1162,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1162
1162
  });
1163
1163
  };
1164
1164
  SteedosObjectType.prototype.directFind = function (query, userSession) {
1165
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1165
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1166
1166
  var clonedQuery;
1167
- return (0, tslib_1.__generator)(this, function (_a) {
1167
+ return tslib_1.__generator(this, function (_a) {
1168
1168
  switch (_a.label) {
1169
1169
  case 0:
1170
1170
  clonedQuery = Object.assign({}, query);
@@ -1178,8 +1178,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1178
1178
  });
1179
1179
  };
1180
1180
  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) {
1181
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1182
+ return tslib_1.__generator(this, function (_a) {
1183
1183
  switch (_a.label) {
1184
1184
  case 0:
1185
1185
  doc = this.formatRecord(doc);
@@ -1190,9 +1190,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1190
1190
  });
1191
1191
  };
1192
1192
  SteedosObjectType.prototype.directUpdate = function (id, doc, userSession) {
1193
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1193
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1194
1194
  var clonedId;
1195
- return (0, tslib_1.__generator)(this, function (_a) {
1195
+ return tslib_1.__generator(this, function (_a) {
1196
1196
  switch (_a.label) {
1197
1197
  case 0:
1198
1198
  doc = this.formatRecord(doc);
@@ -1204,9 +1204,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1204
1204
  });
1205
1205
  };
1206
1206
  SteedosObjectType.prototype.directDelete = function (id, userSession) {
1207
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1207
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1208
1208
  var clonedId;
1209
- return (0, tslib_1.__generator)(this, function (_a) {
1209
+ return tslib_1.__generator(this, function (_a) {
1210
1210
  switch (_a.label) {
1211
1211
  case 0:
1212
1212
  clonedId = id;
@@ -1217,8 +1217,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1217
1217
  });
1218
1218
  };
1219
1219
  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) {
1220
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1221
+ return tslib_1.__generator(this, function (_a) {
1222
1222
  switch (_a.label) {
1223
1223
  case 0: return [4 /*yield*/, this._datasource._makeNewID(this.table_name)];
1224
1224
  case 1: return [2 /*return*/, _a.sent()];
@@ -1227,16 +1227,16 @@ var SteedosObjectType = /** @class */ (function (_super) {
1227
1227
  });
1228
1228
  };
1229
1229
  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) {
1230
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1231
+ return tslib_1.__generator(this, function (_a) {
1232
1232
  return [2 /*return*/, this.list_views[0]];
1233
1233
  });
1234
1234
  });
1235
1235
  };
1236
1236
  SteedosObjectType.prototype.getAbsoluteUrl = function (app_id, record_id) {
1237
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1237
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1238
1238
  var object_name, list_view, list_view_id;
1239
- return (0, tslib_1.__generator)(this, function (_a) {
1239
+ return tslib_1.__generator(this, function (_a) {
1240
1240
  switch (_a.label) {
1241
1241
  case 0:
1242
1242
  object_name = this.name;
@@ -1260,8 +1260,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1260
1260
  });
1261
1261
  };
1262
1262
  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) {
1263
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1264
+ return tslib_1.__generator(this, function (_a) {
1265
1265
  switch (_a.label) {
1266
1266
  case 0: return [4 /*yield*/, this.getAbsoluteUrl(app_id, record_id)];
1267
1267
  case 1: return [2 /*return*/, _a.sent()];
@@ -1270,8 +1270,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1270
1270
  });
1271
1271
  };
1272
1272
  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) {
1273
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1274
+ return tslib_1.__generator(this, function (_a) {
1275
1275
  switch (_a.label) {
1276
1276
  case 0: return [4 /*yield*/, this.getAbsoluteUrl(app_id)];
1277
1277
  case 1: return [2 /*return*/, _a.sent()];
@@ -1280,15 +1280,15 @@ var SteedosObjectType = /** @class */ (function (_super) {
1280
1280
  });
1281
1281
  };
1282
1282
  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) {
1283
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1284
+ return tslib_1.__generator(this, function (_a) {
1285
1285
  return [2 /*return*/, this.enable_audit];
1286
1286
  });
1287
1287
  });
1288
1288
  };
1289
1289
  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) {
1290
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1291
+ return tslib_1.__generator(this, function (_a) {
1292
1292
  switch (_a.label) {
1293
1293
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getDetails", { objectApiName: this.name })];
1294
1294
  case 1: return [2 /*return*/, _a.sent()];
@@ -1297,8 +1297,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1297
1297
  });
1298
1298
  };
1299
1299
  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) {
1300
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1301
+ return tslib_1.__generator(this, function (_a) {
1302
1302
  switch (_a.label) {
1303
1303
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMasters", { objectApiName: this.name })];
1304
1304
  case 1: return [2 /*return*/, _a.sent()];
@@ -1307,8 +1307,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1307
1307
  });
1308
1308
  };
1309
1309
  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) {
1310
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1311
+ return tslib_1.__generator(this, function (_a) {
1312
1312
  switch (_a.label) {
1313
1313
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getLookupDetails", { objectApiName: this.name })];
1314
1314
  case 1: return [2 /*return*/, _a.sent()];
@@ -1317,8 +1317,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1317
1317
  });
1318
1318
  };
1319
1319
  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) {
1320
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1321
+ return tslib_1.__generator(this, function (_a) {
1322
1322
  switch (_a.label) {
1323
1323
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getDetailsInfo", { objectApiName: this.name })];
1324
1324
  case 1: return [2 /*return*/, _a.sent()];
@@ -1327,8 +1327,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1327
1327
  });
1328
1328
  };
1329
1329
  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) {
1330
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1331
+ return tslib_1.__generator(this, function (_a) {
1332
1332
  switch (_a.label) {
1333
1333
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getMastersInfo", { objectApiName: this.name })];
1334
1334
  case 1: return [2 /*return*/, _a.sent()];
@@ -1337,8 +1337,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1337
1337
  });
1338
1338
  };
1339
1339
  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) {
1340
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1341
+ return tslib_1.__generator(this, function (_a) {
1342
1342
  switch (_a.label) {
1343
1343
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getLookupDetailsInfo", { objectApiName: this.name })];
1344
1344
  case 1: return [2 /*return*/, _a.sent()];
@@ -1350,8 +1350,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1350
1350
  * 此函数返回getDetailsInfo、getMastersInfo、getLookupDetailsInfo 3个请求的结果,用于优化访问速度
1351
1351
  */
1352
1352
  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) {
1353
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1354
+ return tslib_1.__generator(this, function (_a) {
1355
1355
  switch (_a.label) {
1356
1356
  case 0: return [4 /*yield*/, this.callMetadataObjectServiceAction("getRelationsInfo", { objectApiName: this.name })];
1357
1357
  case 1: return [2 /*return*/, _a.sent()];
@@ -1360,9 +1360,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1360
1360
  });
1361
1361
  };
1362
1362
  SteedosObjectType.prototype.getRecordPermissions = function (record, userSession) {
1363
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1363
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1364
1364
  var permissions, userId, user_company_ids, recordOwnerId, isOwner, record_company_id, record_company_ids;
1365
- return (0, tslib_1.__generator)(this, function (_a) {
1365
+ return tslib_1.__generator(this, function (_a) {
1366
1366
  switch (_a.label) {
1367
1367
  case 0: return [4 /*yield*/, this.getUserObjectPermission(userSession)];
1368
1368
  case 1:
@@ -1527,9 +1527,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1527
1527
  };
1528
1528
  SteedosObjectType.prototype.getRecordView = function (userSession, context) {
1529
1529
  if (context === void 0) { context = {}; }
1530
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1530
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1531
1531
  var objectConfig, layouts, spaceProcessDefinition, dbListViews, rolesFieldsPermission, relationsInfo, lng, objectMetadataConfig, _a, objectLayout, layoutButtonsName_1;
1532
- return (0, tslib_1.__generator)(this, function (_b) {
1532
+ return tslib_1.__generator(this, function (_b) {
1533
1533
  switch (_b.label) {
1534
1534
  case 0:
1535
1535
  objectConfig = context.objectConfig, layouts = context.layouts, spaceProcessDefinition = context.spaceProcessDefinition, dbListViews = context.dbListViews, rolesFieldsPermission = context.rolesFieldsPermission, relationsInfo = context.relationsInfo;
@@ -1632,9 +1632,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1632
1632
  };
1633
1633
  SteedosObjectType.prototype.getDefaultRecordView = function (userSession) {
1634
1634
  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) {
1635
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1636
+ var object_name, type, buttons, fields, related_lists, objectConfig, sortedFields, relatedLists, details, lookup_details, _loop_1, relatedLists_1, relatedLists_1_1, e_4_1;
1637
+ return tslib_1.__generator(this, function (_b) {
1638
1638
  switch (_b.label) {
1639
1639
  case 0:
1640
1640
  object_name = this.name;
@@ -1691,36 +1691,49 @@ var SteedosObjectType = /** @class */ (function (_super) {
1691
1691
  _b.label = 4;
1692
1692
  case 4:
1693
1693
  _b.trys.push([4, 10, 11, 16]);
1694
- relatedLists_1 = (0, tslib_1.__asyncValues)(relatedLists);
1694
+ _loop_1 = function () {
1695
+ var related, relatedItem, foo, rObjectName, relatedObject, relatedObjectAllListView, fieldNames_1;
1696
+ return tslib_1.__generator(this, function (_c) {
1697
+ switch (_c.label) {
1698
+ case 0:
1699
+ related = relatedLists_1_1.value;
1700
+ if (!related) return [3 /*break*/, 2];
1701
+ relatedItem = {};
1702
+ relatedItem.related_field_fullname = related;
1703
+ foo = related.split('.');
1704
+ rObjectName = foo[0];
1705
+ return [4 /*yield*/, getObject(rObjectName).toConfig()];
1706
+ case 1:
1707
+ relatedObject = _c.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);
1724
+ _c.label = 2;
1725
+ case 2: return [2 /*return*/];
1726
+ }
1727
+ });
1728
+ };
1729
+ relatedLists_1 = tslib_1.__asyncValues(relatedLists);
1695
1730
  _b.label = 5;
1696
1731
  case 5: return [4 /*yield*/, relatedLists_1.next()];
1697
1732
  case 6:
1698
1733
  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()];
1734
+ return [5 /*yield**/, _loop_1()];
1706
1735
  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);
1736
+ _b.sent();
1724
1737
  _b.label = 8;
1725
1738
  case 8: return [3 /*break*/, 5];
1726
1739
  case 9: return [3 /*break*/, 16];
@@ -1770,9 +1783,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1770
1783
  });
1771
1784
  };
1772
1785
  SteedosObjectType.prototype.createDefaultRecordView = function (userSession) {
1773
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1786
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1774
1787
  var name, label, profiles, defaultRecordView, error_3;
1775
- return (0, tslib_1.__generator)(this, function (_a) {
1788
+ return tslib_1.__generator(this, function (_a) {
1776
1789
  switch (_a.label) {
1777
1790
  case 0:
1778
1791
  name = 'default';
@@ -1795,10 +1808,10 @@ var SteedosObjectType = /** @class */ (function (_super) {
1795
1808
  });
1796
1809
  };
1797
1810
  SteedosObjectType.prototype.getRelateds = function () {
1798
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1811
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1799
1812
  var related_objects, detailsInfo, lookupsInfo, relatedInfos, relatedInfos_1, relatedInfos_1_1, info, infos, detailObjectApiName, detailFieldName, related_field, e_5_1;
1800
1813
  var e_5, _a;
1801
- return (0, tslib_1.__generator)(this, function (_b) {
1814
+ return tslib_1.__generator(this, function (_b) {
1802
1815
  switch (_b.label) {
1803
1816
  case 0:
1804
1817
  related_objects = [];
@@ -1815,7 +1828,7 @@ var SteedosObjectType = /** @class */ (function (_super) {
1815
1828
  _b.label = 3;
1816
1829
  case 3:
1817
1830
  _b.trys.push([3, 8, 9, 10]);
1818
- relatedInfos_1 = (0, tslib_1.__values)(relatedInfos), relatedInfos_1_1 = relatedInfos_1.next();
1831
+ relatedInfos_1 = tslib_1.__values(relatedInfos), relatedInfos_1_1 = relatedInfos_1.next();
1819
1832
  _b.label = 4;
1820
1833
  case 4:
1821
1834
  if (!!relatedInfos_1_1.done) return [3 /*break*/, 7];
@@ -1880,9 +1893,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1880
1893
  return methodName.startsWith("direct");
1881
1894
  };
1882
1895
  SteedosObjectType.prototype.count = function (query, userSession) {
1883
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1896
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1884
1897
  var clonedQuery;
1885
- return (0, tslib_1.__generator)(this, function (_a) {
1898
+ return tslib_1.__generator(this, function (_a) {
1886
1899
  switch (_a.label) {
1887
1900
  case 0:
1888
1901
  clonedQuery = Object.assign({}, query);
@@ -1893,8 +1906,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
1893
1906
  });
1894
1907
  };
1895
1908
  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) {
1909
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1910
+ return tslib_1.__generator(this, function (_a) {
1898
1911
  switch (_a.label) {
1899
1912
  case 0:
1900
1913
  if (_.isNull(userSession) || _.isUndefined(userSession)) {
@@ -1921,15 +1934,15 @@ var SteedosObjectType = /** @class */ (function (_super) {
1921
1934
  });
1922
1935
  };
1923
1936
  SteedosObjectType.prototype.runBeforeTriggers = function (method, context) {
1924
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1937
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1925
1938
  var meteorWhen, when;
1926
- return (0, tslib_1.__generator)(this, function (_a) {
1939
+ return tslib_1.__generator(this, function (_a) {
1927
1940
  switch (_a.label) {
1928
1941
  case 0:
1929
1942
  if (method === 'count' || method === "findOne") {
1930
1943
  method = 'find';
1931
1944
  }
1932
- meteorWhen = "before".concat(method.charAt(0).toLocaleUpperCase()).concat(_.rest((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(method), false)).join(''));
1945
+ meteorWhen = "before".concat(method.charAt(0).toLocaleUpperCase()).concat(_.rest(tslib_1.__spreadArray([], tslib_1.__read(method), false)).join(''));
1933
1946
  when = "before.".concat(method);
1934
1947
  return [4 /*yield*/, this.runTriggers(meteorWhen, context)];
1935
1948
  case 1:
@@ -1941,12 +1954,12 @@ var SteedosObjectType = /** @class */ (function (_super) {
1941
1954
  });
1942
1955
  };
1943
1956
  SteedosObjectType.prototype.runAfterTriggers = function (method, context) {
1944
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1957
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1945
1958
  var meteorWhen, when;
1946
- return (0, tslib_1.__generator)(this, function (_a) {
1959
+ return tslib_1.__generator(this, function (_a) {
1947
1960
  switch (_a.label) {
1948
1961
  case 0:
1949
- meteorWhen = "after".concat(method.charAt(0).toLocaleUpperCase()).concat(_.rest((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(method), false)).join(''));
1962
+ meteorWhen = "after".concat(method.charAt(0).toLocaleUpperCase()).concat(_.rest(tslib_1.__spreadArray([], tslib_1.__read(method), false)).join(''));
1950
1963
  when = "after.".concat(method);
1951
1964
  return [4 /*yield*/, this.runTriggers(meteorWhen, context)];
1952
1965
  case 1:
@@ -1958,9 +1971,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1958
1971
  });
1959
1972
  };
1960
1973
  SteedosObjectType.prototype.appendRecordPermission = function (records, userSession) {
1961
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
1974
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1962
1975
  var _ids, objPm, permissionFilters, filters, results, allowEditIds;
1963
- return (0, tslib_1.__generator)(this, function (_a) {
1976
+ return tslib_1.__generator(this, function (_a) {
1964
1977
  switch (_a.label) {
1965
1978
  case 0:
1966
1979
  _ids = _.pluck(records, '_id');
@@ -1994,9 +2007,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
1994
2007
  });
1995
2008
  };
1996
2009
  SteedosObjectType.prototype.getTriggerContext = function (when, method, args, recordId) {
1997
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2010
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1998
2011
  var userSession, context, _a;
1999
- return (0, tslib_1.__generator)(this, function (_b) {
2012
+ return tslib_1.__generator(this, function (_b) {
2000
2013
  switch (_b.label) {
2001
2014
  case 0:
2002
2015
  userSession = args[args.length - 1];
@@ -2025,9 +2038,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
2025
2038
  });
2026
2039
  };
2027
2040
  SteedosObjectType.prototype.processUnreadableField = function (userSession, query) {
2028
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2041
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2029
2042
  var userObjectPermission, userObjectUnreadableFields, queryFields_1;
2030
- return (0, tslib_1.__generator)(this, function (_a) {
2043
+ return tslib_1.__generator(this, function (_a) {
2031
2044
  switch (_a.label) {
2032
2045
  case 0:
2033
2046
  if (!userSession) {
@@ -2097,9 +2110,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
2097
2110
  for (var _i = 1; _i < arguments.length; _i++) {
2098
2111
  args[_i - 1] = arguments[_i];
2099
2112
  }
2100
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2113
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2101
2114
  var adapterMethod, userSession, allow, objectName, recordId, doc, paramRecordId, returnValue, beforeTriggerContext, afterTriggerContext, previousDoc, values, _records;
2102
- return (0, tslib_1.__generator)(this, function (_a) {
2115
+ return tslib_1.__generator(this, function (_a) {
2103
2116
  switch (_a.label) {
2104
2117
  case 0:
2105
2118
  adapterMethod = this._datasource[method];
@@ -2248,9 +2261,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
2248
2261
  };
2249
2262
  ;
2250
2263
  SteedosObjectType.prototype.runRecordFormula = function (method, objectName, recordId, doc, userSession) {
2251
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2264
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2252
2265
  var currentUserId, onlyForOwn, withoutCurrent;
2253
- return (0, tslib_1.__generator)(this, function (_a) {
2266
+ return tslib_1.__generator(this, function (_a) {
2254
2267
  switch (_a.label) {
2255
2268
  case 0:
2256
2269
  if (!(["insert", "update", "updateMany", "delete"].indexOf(method) > -1)) return [3 /*break*/, 5];
@@ -2276,8 +2289,8 @@ var SteedosObjectType = /** @class */ (function (_super) {
2276
2289
  });
2277
2290
  };
2278
2291
  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) {
2292
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2293
+ return tslib_1.__generator(this, function (_a) {
2281
2294
  switch (_a.label) {
2282
2295
  case 0:
2283
2296
  if (!(["insert", "update", "updateMany", "delete"].indexOf(method) > -1)) return [3 /*break*/, 5];
@@ -2324,9 +2337,9 @@ var SteedosObjectType = /** @class */ (function (_super) {
2324
2337
  }
2325
2338
  };
2326
2339
  SteedosObjectType.prototype.dealWithMethodPermission = function (method, args) {
2327
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2340
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
2328
2341
  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) {
2342
+ return tslib_1.__generator(this, function (_a) {
2330
2343
  switch (_a.label) {
2331
2344
  case 0:
2332
2345
  userSession = args[args.length - 1];