@steedos/objectql 2.2.55-beta.9 → 2.2.55

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 (221) hide show
  1. package/lib/actions/field_updates.js +36 -50
  2. package/lib/actions/field_updates.js.map +1 -1
  3. package/lib/actions/workflow_notifications.d.ts +0 -12
  4. package/lib/actions/workflow_notifications.js +14 -31
  5. package/lib/actions/workflow_notifications.js.map +1 -1
  6. package/lib/actions/workflow_rule.js +33 -54
  7. package/lib/actions/workflow_rule.js.map +1 -1
  8. package/lib/broker.js +5 -5
  9. package/lib/broker.js.map +1 -1
  10. package/lib/driver/driver.d.ts +0 -38
  11. package/lib/driver/field-encrytion/index.js +0 -7
  12. package/lib/driver/field-encrytion/index.js.map +1 -1
  13. package/lib/driver/field-encrytion/mongosharedconst.js +4 -20
  14. package/lib/driver/field-encrytion/mongosharedconst.js.map +1 -1
  15. package/lib/driver/fieldDBType.js +0 -4
  16. package/lib/driver/fieldDBType.js.map +1 -1
  17. package/lib/driver/format.d.ts +0 -12
  18. package/lib/driver/format.js +0 -12
  19. package/lib/driver/format.js.map +1 -1
  20. package/lib/driver/metadata.js +2 -10
  21. package/lib/driver/metadata.js.map +1 -1
  22. package/lib/driver/meteorMongo.js +32 -36
  23. package/lib/driver/meteorMongo.js.map +1 -1
  24. package/lib/driver/mongo.d.ts +0 -3
  25. package/lib/driver/mongo.js +59 -64
  26. package/lib/driver/mongo.js.map +1 -1
  27. package/lib/driver/mysql.js +1 -8
  28. package/lib/driver/mysql.js.map +1 -1
  29. package/lib/driver/oracle.js +3 -11
  30. package/lib/driver/oracle.js.map +1 -1
  31. package/lib/driver/postgres.js +1 -8
  32. package/lib/driver/postgres.js.map +1 -1
  33. package/lib/driver/sqlite3.js +1 -8
  34. package/lib/driver/sqlite3.js.map +1 -1
  35. package/lib/driver/sqlserver.js +3 -10
  36. package/lib/driver/sqlserver.js.map +1 -1
  37. package/lib/dynamic-load/actions.js +26 -27
  38. package/lib/dynamic-load/actions.js.map +1 -1
  39. package/lib/dynamic-load/approval_process.js +0 -1
  40. package/lib/dynamic-load/approval_process.js.map +1 -1
  41. package/lib/dynamic-load/button.js +13 -13
  42. package/lib/dynamic-load/button.js.map +1 -1
  43. package/lib/dynamic-load/chart.js +3 -3
  44. package/lib/dynamic-load/chart.js.map +1 -1
  45. package/lib/dynamic-load/client_script.js +0 -24
  46. package/lib/dynamic-load/client_script.js.map +1 -1
  47. package/lib/dynamic-load/field.js +13 -13
  48. package/lib/dynamic-load/field.js.map +1 -1
  49. package/lib/dynamic-load/layout.js +16 -16
  50. package/lib/dynamic-load/layout.js.map +1 -1
  51. package/lib/dynamic-load/listview.js +13 -13
  52. package/lib/dynamic-load/listview.js.map +1 -1
  53. package/lib/dynamic-load/object_translations.js +8 -20
  54. package/lib/dynamic-load/object_translations.js.map +1 -1
  55. package/lib/dynamic-load/package.d.ts +0 -8
  56. package/lib/dynamic-load/package.js +83 -95
  57. package/lib/dynamic-load/package.js.map +1 -1
  58. package/lib/dynamic-load/page.js +3 -3
  59. package/lib/dynamic-load/page.js.map +1 -1
  60. package/lib/dynamic-load/permission.js +24 -25
  61. package/lib/dynamic-load/permission.js.map +1 -1
  62. package/lib/dynamic-load/permissionset.js +22 -23
  63. package/lib/dynamic-load/permissionset.js.map +1 -1
  64. package/lib/dynamic-load/preload_data.js +73 -73
  65. package/lib/dynamic-load/preload_data.js.map +1 -1
  66. package/lib/dynamic-load/profile.js +22 -25
  67. package/lib/dynamic-load/profile.js.map +1 -1
  68. package/lib/dynamic-load/query.js +3 -3
  69. package/lib/dynamic-load/query.js.map +1 -1
  70. package/lib/dynamic-load/restrictionRules.js +3 -3
  71. package/lib/dynamic-load/restrictionRules.js.map +1 -1
  72. package/lib/dynamic-load/shareRules.js +3 -3
  73. package/lib/dynamic-load/shareRules.js.map +1 -1
  74. package/lib/dynamic-load/tab.js +4 -4
  75. package/lib/dynamic-load/tab.js.map +1 -1
  76. package/lib/dynamic-load/tabs.d.ts +0 -3
  77. package/lib/dynamic-load/tabs.js +4 -7
  78. package/lib/dynamic-load/tabs.js.map +1 -1
  79. package/lib/dynamic-load/translations.js +17 -28
  80. package/lib/dynamic-load/translations.js.map +1 -1
  81. package/lib/dynamic-load/trigger.d.ts +0 -5
  82. package/lib/dynamic-load/trigger.js +0 -29
  83. package/lib/dynamic-load/trigger.js.map +1 -1
  84. package/lib/errors/index.js +1 -25
  85. package/lib/errors/index.js.map +1 -1
  86. package/lib/formula/core.d.ts +0 -63
  87. package/lib/formula/core.js +94 -211
  88. package/lib/formula/core.js.map +1 -1
  89. package/lib/formula/field_formula.d.ts +0 -23
  90. package/lib/formula/field_formula.js +12 -36
  91. package/lib/formula/field_formula.js.map +1 -1
  92. package/lib/formula/index.js +15 -22
  93. package/lib/formula/index.js.map +1 -1
  94. package/lib/formula/params.js +23 -48
  95. package/lib/formula/params.js.map +1 -1
  96. package/lib/formula/recompute.d.ts +0 -8
  97. package/lib/formula/recompute.js +32 -45
  98. package/lib/formula/recompute.js.map +1 -1
  99. package/lib/formula/simple_params.js +10 -10
  100. package/lib/formula/simple_params.js.map +1 -1
  101. package/lib/formula/type.d.ts +0 -52
  102. package/lib/formula/type.js +0 -4
  103. package/lib/formula/type.js.map +1 -1
  104. package/lib/formula/util.d.ts +0 -69
  105. package/lib/formula/util.js +0 -70
  106. package/lib/formula/util.js.map +1 -1
  107. package/lib/index.js +0 -7
  108. package/lib/index.js.map +1 -1
  109. package/lib/metadata-register/_base.js +13 -13
  110. package/lib/metadata-register/_base.js.map +1 -1
  111. package/lib/metadata-register/app.js +8 -8
  112. package/lib/metadata-register/app.js.map +1 -1
  113. package/lib/metadata-register/chart.js +1 -1
  114. package/lib/metadata-register/index.js +49 -49
  115. package/lib/metadata-register/index.js.map +1 -1
  116. package/lib/metadata-register/layout.js +10 -10
  117. package/lib/metadata-register/layout.js.map +1 -1
  118. package/lib/metadata-register/object.js +10 -15
  119. package/lib/metadata-register/object.js.map +1 -1
  120. package/lib/metadata-register/page.js +1 -1
  121. package/lib/metadata-register/permissionFields.js +1 -1
  122. package/lib/metadata-register/permissionset.js +6 -6
  123. package/lib/metadata-register/permissionset.js.map +1 -1
  124. package/lib/metadata-register/process.js +1 -8
  125. package/lib/metadata-register/process.js.map +1 -1
  126. package/lib/metadata-register/processTrigger.d.ts +0 -11
  127. package/lib/metadata-register/processTrigger.js +1 -12
  128. package/lib/metadata-register/processTrigger.js.map +1 -1
  129. package/lib/metadata-register/profile.js +6 -6
  130. package/lib/metadata-register/profile.js.map +1 -1
  131. package/lib/metadata-register/query.js +1 -1
  132. package/lib/metadata-register/restrictionRules.js +1 -1
  133. package/lib/metadata-register/shareRules.js +1 -1
  134. package/lib/metadata-register/tab.js +1 -1
  135. package/lib/metadata-register/tabs.d.ts +0 -3
  136. package/lib/metadata-register/tabs.js +10 -13
  137. package/lib/metadata-register/tabs.js.map +1 -1
  138. package/lib/services/datasourceServiceFactory.js +5 -8
  139. package/lib/services/datasourceServiceFactory.js.map +1 -1
  140. package/lib/services/helpers/graphql/consts.js +0 -7
  141. package/lib/services/helpers/graphql/consts.js.map +1 -1
  142. package/lib/services/helpers/graphql/getPrimaryFieldType.d.ts +0 -4
  143. package/lib/services/helpers/graphql/getPrimaryFieldType.js +0 -12
  144. package/lib/services/helpers/graphql/getPrimaryFieldType.js.map +1 -1
  145. package/lib/services/helpers/graphql/getQueryFields.js +0 -4
  146. package/lib/services/helpers/graphql/getQueryFields.js.map +1 -1
  147. package/lib/services/helpers/graphql/index.js +84 -108
  148. package/lib/services/helpers/graphql/index.js.map +1 -1
  149. package/lib/services/objectService.js +127 -179
  150. package/lib/services/objectService.js.map +1 -1
  151. package/lib/services/objectServiceDispatcher.js +87 -87
  152. package/lib/services/objectServiceDispatcher.js.map +1 -1
  153. package/lib/services/objectServiceFactory.js +4 -4
  154. package/lib/services/objectServiceFactory.js.map +1 -1
  155. package/lib/summary/core.d.ts +0 -68
  156. package/lib/summary/core.js +46 -130
  157. package/lib/summary/core.js.map +1 -1
  158. package/lib/summary/field_summary.d.ts +0 -16
  159. package/lib/summary/field_summary.js +10 -27
  160. package/lib/summary/field_summary.js.map +1 -1
  161. package/lib/summary/index.d.ts +0 -5
  162. package/lib/summary/index.js +10 -28
  163. package/lib/summary/index.js.map +1 -1
  164. package/lib/summary/recompute.d.ts +0 -8
  165. package/lib/summary/recompute.js +8 -23
  166. package/lib/summary/recompute.js.map +1 -1
  167. package/lib/summary/type.d.ts +0 -17
  168. package/lib/summary/type.js +0 -13
  169. package/lib/summary/type.js.map +1 -1
  170. package/lib/typeorm/driver.js +69 -77
  171. package/lib/typeorm/driver.js.map +1 -1
  172. package/lib/typeorm/util.js +0 -4
  173. package/lib/typeorm/util.js.map +1 -1
  174. package/lib/types/action.js +1 -1
  175. package/lib/types/app.js +38 -43
  176. package/lib/types/app.js.map +1 -1
  177. package/lib/types/config.js +11 -15
  178. package/lib/types/config.js.map +1 -1
  179. package/lib/types/connection.d.ts +0 -10
  180. package/lib/types/connection.js +9 -16
  181. package/lib/types/connection.js.map +1 -1
  182. package/lib/types/dashboard.js +1 -1
  183. package/lib/types/datasource.d.ts +0 -3
  184. package/lib/types/datasource.js +97 -110
  185. package/lib/types/datasource.js.map +1 -1
  186. package/lib/types/field.js +3 -33
  187. package/lib/types/field.js.map +1 -1
  188. package/lib/types/field_permission.js +7 -7
  189. package/lib/types/field_permission.js.map +1 -1
  190. package/lib/types/list_view.js +2 -2
  191. package/lib/types/object.d.ts +0 -38
  192. package/lib/types/object.js +282 -389
  193. package/lib/types/object.js.map +1 -1
  194. package/lib/types/object_dynamic_load.js +39 -44
  195. package/lib/types/object_dynamic_load.js.map +1 -1
  196. package/lib/types/object_events.js +4 -14
  197. package/lib/types/object_events.js.map +1 -1
  198. package/lib/types/object_layouts.js +4 -4
  199. package/lib/types/object_layouts.js.map +1 -1
  200. package/lib/types/object_permission.js +2 -2
  201. package/lib/types/query.d.ts +0 -12
  202. package/lib/types/report.js +1 -1
  203. package/lib/types/restrictionRule.js +6 -6
  204. package/lib/types/restrictionRule.js.map +1 -1
  205. package/lib/types/schema.d.ts +0 -14
  206. package/lib/types/schema.js +14 -39
  207. package/lib/types/schema.js.map +1 -1
  208. package/lib/types/shareRule.js +6 -6
  209. package/lib/types/shareRule.js.map +1 -1
  210. package/lib/types/trigger.js +1 -1
  211. package/lib/types/validation_rules.js +10 -15
  212. package/lib/types/validation_rules.js.map +1 -1
  213. package/lib/util/index.d.ts +0 -12
  214. package/lib/util/index.js +10 -50
  215. package/lib/util/index.js.map +1 -1
  216. package/lib/util/locale.d.ts +0 -6
  217. package/lib/util/locale.js +0 -6
  218. package/lib/util/locale.js.map +1 -1
  219. package/lib/util/suffix.js +4 -12
  220. package/lib/util/suffix.js.map +1 -1
  221. package/package.json +13 -13
@@ -7,7 +7,6 @@ var datasource_1 = require("../types/datasource");
7
7
  var object_dynamic_load_1 = require("../types/object_dynamic_load");
8
8
  var _ = require("underscore");
9
9
  var graphql_1 = require("./helpers/graphql");
10
- // generateActionRestProp,
11
10
  var _1 = require(".");
12
11
  var convert_1 = require("../util/convert");
13
12
  var util_1 = require("../util");
@@ -21,8 +20,8 @@ function getObjectServiceMethodsSchema() {
21
20
  return tslib_1.__awaiter(this, void 0, void 0, function () {
22
21
  return tslib_1.__generator(this, function (_a) {
23
22
  switch (_a.label) {
24
- case 0: return [4 /*yield*/, this.object.aggregate(query, externalPipeline, userSession)];
25
- case 1: return [2 /*return*/, _a.sent()];
23
+ case 0: return [4, this.object.aggregate(query, externalPipeline, userSession)];
24
+ case 1: return [2, _a.sent()];
26
25
  }
27
26
  });
28
27
  });
@@ -34,11 +33,11 @@ function getObjectServiceMethodsSchema() {
34
33
  return tslib_1.__generator(this, function (_a) {
35
34
  switch (_a.label) {
36
35
  case 0:
37
- if (!(this.object.name == 'users')) return [3 /*break*/, 2];
38
- return [4 /*yield*/, this.object.find(query)];
39
- case 1: return [2 /*return*/, _a.sent()];
40
- case 2: return [4 /*yield*/, this.object.find(query, userSession)];
41
- case 3: return [2 /*return*/, _a.sent()];
36
+ if (!(this.object.name == 'users')) return [3, 2];
37
+ return [4, this.object.find(query)];
38
+ case 1: return [2, _a.sent()];
39
+ case 2: return [4, this.object.find(query, userSession)];
40
+ case 3: return [2, _a.sent()];
42
41
  }
43
42
  });
44
43
  });
@@ -50,11 +49,11 @@ function getObjectServiceMethodsSchema() {
50
49
  return tslib_1.__generator(this, function (_a) {
51
50
  switch (_a.label) {
52
51
  case 0:
53
- if (!(this.object.name == 'users')) return [3 /*break*/, 2];
54
- return [4 /*yield*/, this.object.findOne(id, query)];
55
- case 1: return [2 /*return*/, _a.sent()];
56
- case 2: return [4 /*yield*/, this.object.findOne(id, query, userSession)];
57
- case 3: return [2 /*return*/, _a.sent()];
52
+ if (!(this.object.name == 'users')) return [3, 2];
53
+ return [4, this.object.findOne(id, query)];
54
+ case 1: return [2, _a.sent()];
55
+ case 2: return [4, this.object.findOne(id, query, userSession)];
56
+ case 3: return [2, _a.sent()];
58
57
  }
59
58
  });
60
59
  });
@@ -65,8 +64,8 @@ function getObjectServiceMethodsSchema() {
65
64
  return tslib_1.__awaiter(this, void 0, void 0, function () {
66
65
  return tslib_1.__generator(this, function (_a) {
67
66
  switch (_a.label) {
68
- case 0: return [4 /*yield*/, this.object.insert(doc, userSession)];
69
- case 1: return [2 /*return*/, _a.sent()];
67
+ case 0: return [4, this.object.insert(doc, userSession)];
68
+ case 1: return [2, _a.sent()];
70
69
  }
71
70
  });
72
71
  });
@@ -77,8 +76,8 @@ function getObjectServiceMethodsSchema() {
77
76
  return tslib_1.__awaiter(this, void 0, void 0, function () {
78
77
  return tslib_1.__generator(this, function (_a) {
79
78
  switch (_a.label) {
80
- case 0: return [4 /*yield*/, this.object.update(id, doc, userSession)];
81
- case 1: return [2 /*return*/, _a.sent()];
79
+ case 0: return [4, this.object.update(id, doc, userSession)];
80
+ case 1: return [2, _a.sent()];
82
81
  }
83
82
  });
84
83
  });
@@ -89,8 +88,8 @@ function getObjectServiceMethodsSchema() {
89
88
  return tslib_1.__awaiter(this, void 0, void 0, function () {
90
89
  return tslib_1.__generator(this, function (_a) {
91
90
  switch (_a.label) {
92
- case 0: return [4 /*yield*/, this.object.updateOne(id, doc, userSession)];
93
- case 1: return [2 /*return*/, _a.sent()];
91
+ case 0: return [4, this.object.updateOne(id, doc, userSession)];
92
+ case 1: return [2, _a.sent()];
94
93
  }
95
94
  });
96
95
  });
@@ -101,8 +100,8 @@ function getObjectServiceMethodsSchema() {
101
100
  return tslib_1.__awaiter(this, void 0, void 0, function () {
102
101
  return tslib_1.__generator(this, function (_a) {
103
102
  switch (_a.label) {
104
- case 0: return [4 /*yield*/, this.object.updateMany(queryFilters, doc, userSession)];
105
- case 1: return [2 /*return*/, _a.sent()];
103
+ case 0: return [4, this.object.updateMany(queryFilters, doc, userSession)];
104
+ case 1: return [2, _a.sent()];
106
105
  }
107
106
  });
108
107
  });
@@ -113,8 +112,8 @@ function getObjectServiceMethodsSchema() {
113
112
  return tslib_1.__awaiter(this, void 0, void 0, function () {
114
113
  return tslib_1.__generator(this, function (_a) {
115
114
  switch (_a.label) {
116
- case 0: return [4 /*yield*/, this.object.delete(id, userSession)];
117
- case 1: return [2 /*return*/, _a.sent()];
115
+ case 0: return [4, this.object.delete(id, userSession)];
116
+ case 1: return [2, _a.sent()];
118
117
  }
119
118
  });
120
119
  });
@@ -125,8 +124,8 @@ function getObjectServiceMethodsSchema() {
125
124
  return tslib_1.__awaiter(this, void 0, void 0, function () {
126
125
  return tslib_1.__generator(this, function (_a) {
127
126
  switch (_a.label) {
128
- case 0: return [4 /*yield*/, this.object.directAggregate(query, externalPipeline, userSession)];
129
- case 1: return [2 /*return*/, _a.sent()];
127
+ case 0: return [4, this.object.directAggregate(query, externalPipeline, userSession)];
128
+ case 1: return [2, _a.sent()];
130
129
  }
131
130
  });
132
131
  });
@@ -137,8 +136,8 @@ function getObjectServiceMethodsSchema() {
137
136
  return tslib_1.__awaiter(this, void 0, void 0, function () {
138
137
  return tslib_1.__generator(this, function (_a) {
139
138
  switch (_a.label) {
140
- case 0: return [4 /*yield*/, this.object.directAggregatePrefixalPipeline(query, externalPipeline, userSession)];
141
- case 1: return [2 /*return*/, _a.sent()];
139
+ case 0: return [4, this.object.directAggregatePrefixalPipeline(query, externalPipeline, userSession)];
140
+ case 1: return [2, _a.sent()];
142
141
  }
143
142
  });
144
143
  });
@@ -149,8 +148,8 @@ function getObjectServiceMethodsSchema() {
149
148
  return tslib_1.__awaiter(this, void 0, void 0, function () {
150
149
  return tslib_1.__generator(this, function (_a) {
151
150
  switch (_a.label) {
152
- case 0: return [4 /*yield*/, this.object.directFind(query, userSession)];
153
- case 1: return [2 /*return*/, _a.sent()];
151
+ case 0: return [4, this.object.directFind(query, userSession)];
152
+ case 1: return [2, _a.sent()];
154
153
  }
155
154
  });
156
155
  });
@@ -161,8 +160,8 @@ function getObjectServiceMethodsSchema() {
161
160
  return tslib_1.__awaiter(this, void 0, void 0, function () {
162
161
  return tslib_1.__generator(this, function (_a) {
163
162
  switch (_a.label) {
164
- case 0: return [4 /*yield*/, this.object.directInsert(doc, userSession)];
165
- case 1: return [2 /*return*/, _a.sent()];
163
+ case 0: return [4, this.object.directInsert(doc, userSession)];
164
+ case 1: return [2, _a.sent()];
166
165
  }
167
166
  });
168
167
  });
@@ -173,8 +172,8 @@ function getObjectServiceMethodsSchema() {
173
172
  return tslib_1.__awaiter(this, void 0, void 0, function () {
174
173
  return tslib_1.__generator(this, function (_a) {
175
174
  switch (_a.label) {
176
- case 0: return [4 /*yield*/, this.object.directUpdate(id, doc, userSession)];
177
- case 1: return [2 /*return*/, _a.sent()];
175
+ case 0: return [4, this.object.directUpdate(id, doc, userSession)];
176
+ case 1: return [2, _a.sent()];
178
177
  }
179
178
  });
180
179
  });
@@ -185,8 +184,8 @@ function getObjectServiceMethodsSchema() {
185
184
  return tslib_1.__awaiter(this, void 0, void 0, function () {
186
185
  return tslib_1.__generator(this, function (_a) {
187
186
  switch (_a.label) {
188
- case 0: return [4 /*yield*/, this.object.directDelete(id, userSession)];
189
- case 1: return [2 /*return*/, _a.sent()];
187
+ case 0: return [4, this.object.directDelete(id, userSession)];
188
+ case 1: return [2, _a.sent()];
190
189
  }
191
190
  });
192
191
  });
@@ -197,8 +196,8 @@ function getObjectServiceMethodsSchema() {
197
196
  return tslib_1.__awaiter(this, void 0, void 0, function () {
198
197
  return tslib_1.__generator(this, function (_a) {
199
198
  switch (_a.label) {
200
- case 0: return [4 /*yield*/, this.object.count(query, userSession)];
201
- case 1: return [2 /*return*/, _a.sent()];
199
+ case 0: return [4, this.object.count(query, userSession)];
200
+ case 1: return [2, _a.sent()];
202
201
  }
203
202
  });
204
203
  });
@@ -239,8 +238,8 @@ function getObjectServiceMethodsSchema() {
239
238
  return tslib_1.__awaiter(this, void 0, void 0, function () {
240
239
  return tslib_1.__generator(this, function (_a) {
241
240
  switch (_a.label) {
242
- case 0: return [4 /*yield*/, this.object._makeNewID()];
243
- case 1: return [2 /*return*/, _a.sent()];
241
+ case 0: return [4, this.object._makeNewID()];
242
+ case 1: return [2, _a.sent()];
244
243
  }
245
244
  });
246
245
  });
@@ -250,7 +249,7 @@ function getObjectServiceMethodsSchema() {
250
249
  handler: function () {
251
250
  return tslib_1.__awaiter(this, void 0, void 0, function () {
252
251
  return tslib_1.__generator(this, function (_a) {
253
- return [2 /*return*/, this.object.getRecordAbsoluteUrl()];
252
+ return [2, this.object.getRecordAbsoluteUrl()];
254
253
  });
255
254
  });
256
255
  }
@@ -259,7 +258,7 @@ function getObjectServiceMethodsSchema() {
259
258
  handler: function () {
260
259
  return tslib_1.__awaiter(this, void 0, void 0, function () {
261
260
  return tslib_1.__generator(this, function (_a) {
262
- return [2 /*return*/, this.object.getGridAbsoluteUrl()];
261
+ return [2, this.object.getGridAbsoluteUrl()];
263
262
  });
264
263
  });
265
264
  }
@@ -268,7 +267,7 @@ function getObjectServiceMethodsSchema() {
268
267
  handler: function (record, userSession) {
269
268
  return tslib_1.__awaiter(this, void 0, void 0, function () {
270
269
  return tslib_1.__generator(this, function (_a) {
271
- return [2 /*return*/, this.object.getRecordPermissions(record, userSession)];
270
+ return [2, this.object.getRecordPermissions(record, userSession)];
272
271
  });
273
272
  });
274
273
  }
@@ -278,8 +277,8 @@ function getObjectServiceMethodsSchema() {
278
277
  return tslib_1.__awaiter(this, void 0, void 0, function () {
279
278
  return tslib_1.__generator(this, function (_a) {
280
279
  switch (_a.label) {
281
- case 0: return [4 /*yield*/, this.object.getRecordView(userSession, context)];
282
- case 1: return [2 /*return*/, _a.sent()];
280
+ case 0: return [4, this.object.getRecordView(userSession, context)];
281
+ case 1: return [2, _a.sent()];
283
282
  }
284
283
  });
285
284
  });
@@ -290,8 +289,8 @@ function getObjectServiceMethodsSchema() {
290
289
  return tslib_1.__awaiter(this, void 0, void 0, function () {
291
290
  return tslib_1.__generator(this, function (_a) {
292
291
  switch (_a.label) {
293
- case 0: return [4 /*yield*/, this.object.createDefaultRecordView(userSession)];
294
- case 1: return [2 /*return*/, _a.sent()];
292
+ case 0: return [4, this.object.createDefaultRecordView(userSession)];
293
+ case 1: return [2, _a.sent()];
295
294
  }
296
295
  });
297
296
  });
@@ -302,8 +301,8 @@ function getObjectServiceMethodsSchema() {
302
301
  return tslib_1.__awaiter(this, void 0, void 0, function () {
303
302
  return tslib_1.__generator(this, function (_a) {
304
303
  switch (_a.label) {
305
- case 0: return [4 /*yield*/, this.object.getDefaultRecordView(userSession)];
306
- case 1: return [2 /*return*/, _a.sent()];
304
+ case 0: return [4, this.object.getDefaultRecordView(userSession)];
305
+ case 1: return [2, _a.sent()];
307
306
  }
308
307
  });
309
308
  });
@@ -314,8 +313,8 @@ function getObjectServiceMethodsSchema() {
314
313
  return tslib_1.__awaiter(this, void 0, void 0, function () {
315
314
  return tslib_1.__generator(this, function (_a) {
316
315
  switch (_a.label) {
317
- case 0: return [4 /*yield*/, this.object.getRelateds()];
318
- case 1: return [2 /*return*/, _a.sent()];
316
+ case 0: return [4, this.object.getRelateds()];
317
+ case 1: return [2, _a.sent()];
319
318
  }
320
319
  });
321
320
  });
@@ -326,8 +325,8 @@ function getObjectServiceMethodsSchema() {
326
325
  return tslib_1.__awaiter(this, void 0, void 0, function () {
327
326
  return tslib_1.__generator(this, function (_a) {
328
327
  switch (_a.label) {
329
- case 0: return [4 /*yield*/, this.object.refreshIndexes()];
330
- case 1: return [2 /*return*/, _a.sent()];
328
+ case 0: return [4, this.object.refreshIndexes()];
329
+ case 1: return [2, _a.sent()];
331
330
  }
332
331
  });
333
332
  });
@@ -338,8 +337,8 @@ function getObjectServiceMethodsSchema() {
338
337
  return tslib_1.__awaiter(this, void 0, void 0, function () {
339
338
  return tslib_1.__generator(this, function (_a) {
340
339
  switch (_a.label) {
341
- case 0: return [4 /*yield*/, this.object.allowRead(userSession)];
342
- case 1: return [2 /*return*/, _a.sent()];
340
+ case 0: return [4, this.object.allowRead(userSession)];
341
+ case 1: return [2, _a.sent()];
343
342
  }
344
343
  });
345
344
  });
@@ -350,8 +349,8 @@ function getObjectServiceMethodsSchema() {
350
349
  return tslib_1.__awaiter(this, void 0, void 0, function () {
351
350
  return tslib_1.__generator(this, function (_a) {
352
351
  switch (_a.label) {
353
- case 0: return [4 /*yield*/, this.object.allowInsert(userSession)];
354
- case 1: return [2 /*return*/, _a.sent()];
352
+ case 0: return [4, this.object.allowInsert(userSession)];
353
+ case 1: return [2, _a.sent()];
355
354
  }
356
355
  });
357
356
  });
@@ -362,8 +361,8 @@ function getObjectServiceMethodsSchema() {
362
361
  return tslib_1.__awaiter(this, void 0, void 0, function () {
363
362
  return tslib_1.__generator(this, function (_a) {
364
363
  switch (_a.label) {
365
- case 0: return [4 /*yield*/, this.object.allowUpdate(userSession)];
366
- case 1: return [2 /*return*/, _a.sent()];
364
+ case 0: return [4, this.object.allowUpdate(userSession)];
365
+ case 1: return [2, _a.sent()];
367
366
  }
368
367
  });
369
368
  });
@@ -374,16 +373,13 @@ function getObjectServiceMethodsSchema() {
374
373
  return tslib_1.__awaiter(this, void 0, void 0, function () {
375
374
  return tslib_1.__generator(this, function (_a) {
376
375
  switch (_a.label) {
377
- case 0: return [4 /*yield*/, this.object.allowDelete(userSession)];
378
- case 1: return [2 /*return*/, _a.sent()];
376
+ case 0: return [4, this.object.allowDelete(userSession)];
377
+ case 1: return [2, _a.sent()];
379
378
  }
380
379
  });
381
380
  });
382
381
  }
383
382
  }
384
- // getPageView: {
385
- // //TODO
386
- // }
387
383
  };
388
384
  return methods;
389
385
  }
@@ -402,14 +398,13 @@ function getObjectServiceActionsSchema() {
402
398
  case 0:
403
399
  userSession = ctx.meta.user;
404
400
  _a = ctx.params, query = _a.query, externalPipeline = _a.externalPipeline;
405
- return [4 /*yield*/, this.aggregate(query, externalPipeline, userSession)];
406
- case 1: return [2 /*return*/, _b.sent()];
401
+ return [4, this.aggregate(query, externalPipeline, userSession)];
402
+ case 1: return [2, _b.sent()];
407
403
  }
408
404
  });
409
405
  });
410
406
  }
411
407
  },
412
- // meteor、default database 默认不返回is_deleted = true的数据
413
408
  graphqlFind: {
414
409
  params: {
415
410
  fields: { type: 'array', items: "string", optional: true },
@@ -422,7 +417,6 @@ function getObjectServiceActionsSchema() {
422
417
  return tslib_1.__awaiter(this, void 0, void 0, function () {
423
418
  var filters, filtersStr, resolveInfo, fieldNames, userSession;
424
419
  return tslib_1.__generator(this, function (_a) {
425
- //TODO filters: 如果filters中没有查询 is_deleted 则自动添加is_deleted != true 条件
426
420
  if (this.object.datasource.driver === datasource_1.SteedosDatabaseDriverType.MeteorMongo || this.object.datasource.driver === datasource_1.SteedosDatabaseDriverType.Mongo) {
427
421
  filters = ctx.params.filters;
428
422
  if (filters) {
@@ -450,7 +444,7 @@ function getObjectServiceActionsSchema() {
450
444
  }
451
445
  }
452
446
  userSession = ctx.meta.user;
453
- return [2 /*return*/, this.find(ctx.params, userSession)];
447
+ return [2, this.find(ctx.params, userSession)];
454
448
  });
455
449
  });
456
450
  }
@@ -467,7 +461,6 @@ function getObjectServiceActionsSchema() {
467
461
  return tslib_1.__awaiter(this, void 0, void 0, function () {
468
462
  var filters, filtersStr, userSession;
469
463
  return tslib_1.__generator(this, function (_a) {
470
- //TODO filters: 如果filters中没有查询 is_deleted 则自动添加is_deleted != true 条件
471
464
  if (this.object.datasource.driver === datasource_1.SteedosDatabaseDriverType.MeteorMongo || this.object.datasource.driver === datasource_1.SteedosDatabaseDriverType.Mongo) {
472
465
  filters = ctx.params.filters;
473
466
  if (filters) {
@@ -488,7 +481,7 @@ function getObjectServiceActionsSchema() {
488
481
  }
489
482
  }
490
483
  userSession = ctx.meta.user;
491
- return [2 /*return*/, this.count(ctx.params, userSession)];
484
+ return [2, this.count(ctx.params, userSession)];
492
485
  });
493
486
  });
494
487
  }
@@ -506,7 +499,7 @@ function getObjectServiceActionsSchema() {
506
499
  var userSession;
507
500
  return tslib_1.__generator(this, function (_a) {
508
501
  userSession = ctx.meta.user;
509
- return [2 /*return*/, this.find(ctx.params, userSession)];
502
+ return [2, this.find(ctx.params, userSession)];
510
503
  });
511
504
  });
512
505
  }
@@ -522,7 +515,7 @@ function getObjectServiceActionsSchema() {
522
515
  return tslib_1.__generator(this, function (_b) {
523
516
  userSession = ctx.meta.user;
524
517
  _a = ctx.params, id = _a.id, query = _a.query;
525
- return [2 /*return*/, this.findOne(id, query, userSession)];
518
+ return [2, this.findOne(id, query, userSession)];
526
519
  });
527
520
  });
528
521
  }
@@ -548,7 +541,7 @@ function getObjectServiceActionsSchema() {
548
541
  if (userSession && object.getField('space')) {
549
542
  data.space = userSession.spaceId;
550
543
  }
551
- return [2 /*return*/, this.insert(data, userSession)];
544
+ return [2, this.insert(data, userSession)];
552
545
  });
553
546
  });
554
547
  }
@@ -572,7 +565,7 @@ function getObjectServiceActionsSchema() {
572
565
  data = JSON.parse(JSON.stringify(doc));
573
566
  }
574
567
  delete data.space;
575
- return [2 /*return*/, this.update(id, data, userSession)];
568
+ return [2, this.update(id, data, userSession)];
576
569
  });
577
570
  });
578
571
  }
@@ -596,7 +589,7 @@ function getObjectServiceActionsSchema() {
596
589
  data = JSON.parse(JSON.stringify(doc));
597
590
  }
598
591
  delete data.space;
599
- return [2 /*return*/, this.updateOne(id, data, userSession)];
592
+ return [2, this.updateOne(id, data, userSession)];
600
593
  });
601
594
  });
602
595
  }
@@ -622,8 +615,8 @@ function getObjectServiceActionsSchema() {
622
615
  data = JSON.parse(JSON.stringify(doc));
623
616
  }
624
617
  delete data.space;
625
- return [4 /*yield*/, this.updateMany(queryFilters, data, userSession)];
626
- case 1: return [2 /*return*/, _b.sent()];
618
+ return [4, this.updateMany(queryFilters, data, userSession)];
619
+ case 1: return [2, _b.sent()];
627
620
  }
628
621
  });
629
622
  });
@@ -639,7 +632,7 @@ function getObjectServiceActionsSchema() {
639
632
  return tslib_1.__generator(this, function (_a) {
640
633
  userSession = ctx.meta.user;
641
634
  id = ctx.params.id;
642
- return [2 /*return*/, this.delete(id, userSession)];
635
+ return [2, this.delete(id, userSession)];
643
636
  });
644
637
  });
645
638
  }
@@ -655,7 +648,7 @@ function getObjectServiceActionsSchema() {
655
648
  return tslib_1.__generator(this, function (_b) {
656
649
  userSession = ctx.meta.user;
657
650
  _a = ctx.params, query = _a.query, externalPipeline = _a.externalPipeline;
658
- return [2 /*return*/, this.directAggregate(query, externalPipeline, userSession)];
651
+ return [2, this.directAggregate(query, externalPipeline, userSession)];
659
652
  });
660
653
  });
661
654
  }
@@ -671,7 +664,7 @@ function getObjectServiceActionsSchema() {
671
664
  return tslib_1.__generator(this, function (_b) {
672
665
  userSession = ctx.meta.user;
673
666
  _a = ctx.params, query = _a.query, prefixalPipeline = _a.prefixalPipeline;
674
- return [2 /*return*/, this.directAggregatePrefixalPipeline(query, prefixalPipeline, userSession)];
667
+ return [2, this.directAggregatePrefixalPipeline(query, prefixalPipeline, userSession)];
675
668
  });
676
669
  });
677
670
  }
@@ -689,7 +682,7 @@ function getObjectServiceActionsSchema() {
689
682
  var userSession;
690
683
  return tslib_1.__generator(this, function (_a) {
691
684
  userSession = ctx.meta.user;
692
- return [2 /*return*/, this.directFind(ctx.params, userSession)];
685
+ return [2, this.directFind(ctx.params, userSession)];
693
686
  });
694
687
  });
695
688
  }
@@ -704,7 +697,7 @@ function getObjectServiceActionsSchema() {
704
697
  return tslib_1.__generator(this, function (_a) {
705
698
  userSession = ctx.meta.user;
706
699
  doc = ctx.params.doc;
707
- return [2 /*return*/, this.directInsert(doc, userSession)];
700
+ return [2, this.directInsert(doc, userSession)];
708
701
  });
709
702
  });
710
703
  }
@@ -720,7 +713,7 @@ function getObjectServiceActionsSchema() {
720
713
  return tslib_1.__generator(this, function (_b) {
721
714
  userSession = ctx.meta.user;
722
715
  _a = ctx.params, id = _a.id, doc = _a.doc;
723
- return [2 /*return*/, this.directUpdate(id, doc, userSession)];
716
+ return [2, this.directUpdate(id, doc, userSession)];
724
717
  });
725
718
  });
726
719
  }
@@ -735,7 +728,7 @@ function getObjectServiceActionsSchema() {
735
728
  return tslib_1.__generator(this, function (_a) {
736
729
  userSession = ctx.meta.user;
737
730
  id = ctx.params.id;
738
- return [2 /*return*/, this.directDelete(id, userSession)];
731
+ return [2, this.directDelete(id, userSession)];
739
732
  });
740
733
  });
741
734
  }
@@ -753,7 +746,7 @@ function getObjectServiceActionsSchema() {
753
746
  var userSession;
754
747
  return tslib_1.__generator(this, function (_a) {
755
748
  userSession = ctx.meta.user;
756
- return [2 /*return*/, this.count(ctx.params, userSession)];
749
+ return [2, this.count(ctx.params, userSession)];
757
750
  });
758
751
  });
759
752
  }
@@ -767,20 +760,16 @@ function getObjectServiceActionsSchema() {
767
760
  var fieldApiName;
768
761
  return tslib_1.__generator(this, function (_a) {
769
762
  fieldApiName = ctx.params.fieldApiName;
770
- return [2 /*return*/, this.getField(fieldApiName)];
763
+ return [2, this.getField(fieldApiName)];
771
764
  });
772
765
  });
773
766
  }
774
767
  },
775
768
  getFields: {
776
- // rest: {
777
- // method: "GET",
778
- // path: "/fields"
779
- // },
780
769
  handler: function (ctx) {
781
770
  return tslib_1.__awaiter(this, void 0, void 0, function () {
782
771
  return tslib_1.__generator(this, function (_a) {
783
- return [2 /*return*/, this.getFields()];
772
+ return [2, this.getFields()];
784
773
  });
785
774
  });
786
775
  }
@@ -789,7 +778,7 @@ function getObjectServiceActionsSchema() {
789
778
  handler: function (ctx) {
790
779
  return tslib_1.__awaiter(this, void 0, void 0, function () {
791
780
  return tslib_1.__generator(this, function (_a) {
792
- return [2 /*return*/, this.getNameFieldKey()];
781
+ return [2, this.getNameFieldKey()];
793
782
  });
794
783
  });
795
784
  }
@@ -798,22 +787,18 @@ function getObjectServiceActionsSchema() {
798
787
  handler: function (ctx) {
799
788
  return tslib_1.__awaiter(this, void 0, void 0, function () {
800
789
  return tslib_1.__generator(this, function (_a) {
801
- return [2 /*return*/, this.toConfig()];
790
+ return [2, this.toConfig()];
802
791
  });
803
792
  });
804
793
  }
805
794
  },
806
795
  getUserObjectPermission: {
807
- // rest: {
808
- // method: "GET",
809
- // path: "/getUserObjectPermission"
810
- // },
811
796
  handler: function (ctx) {
812
797
  return tslib_1.__awaiter(this, void 0, void 0, function () {
813
798
  var userSession;
814
799
  return tslib_1.__generator(this, function (_a) {
815
800
  userSession = ctx.meta.user;
816
- return [2 /*return*/, this.getUserObjectPermission(userSession)];
801
+ return [2, this.getUserObjectPermission(userSession)];
817
802
  });
818
803
  });
819
804
  }
@@ -822,7 +807,7 @@ function getObjectServiceActionsSchema() {
822
807
  handler: function () {
823
808
  return tslib_1.__awaiter(this, void 0, void 0, function () {
824
809
  return tslib_1.__generator(this, function (_a) {
825
- return [2 /*return*/, this.isEnableAudit()];
810
+ return [2, this.isEnableAudit()];
826
811
  });
827
812
  });
828
813
  }
@@ -832,8 +817,8 @@ function getObjectServiceActionsSchema() {
832
817
  return tslib_1.__awaiter(this, void 0, void 0, function () {
833
818
  return tslib_1.__generator(this, function (_a) {
834
819
  switch (_a.label) {
835
- case 0: return [4 /*yield*/, this._makeNewID()];
836
- case 1: return [2 /*return*/, _a.sent()];
820
+ case 0: return [4, this._makeNewID()];
821
+ case 1: return [2, _a.sent()];
837
822
  }
838
823
  });
839
824
  });
@@ -843,7 +828,7 @@ function getObjectServiceActionsSchema() {
843
828
  handler: function () {
844
829
  return tslib_1.__awaiter(this, void 0, void 0, function () {
845
830
  return tslib_1.__generator(this, function (_a) {
846
- return [2 /*return*/, this.getRecordAbsoluteUrl()];
831
+ return [2, this.getRecordAbsoluteUrl()];
847
832
  });
848
833
  });
849
834
  }
@@ -852,16 +837,12 @@ function getObjectServiceActionsSchema() {
852
837
  handler: function () {
853
838
  return tslib_1.__awaiter(this, void 0, void 0, function () {
854
839
  return tslib_1.__generator(this, function (_a) {
855
- return [2 /*return*/, this.getGridAbsoluteUrl()];
840
+ return [2, this.getGridAbsoluteUrl()];
856
841
  });
857
842
  });
858
843
  }
859
844
  },
860
845
  getRecordPermissionsById: {
861
- // rest: {
862
- // method: "GET",
863
- // path: "/recordPermissions/:recordId"
864
- // },
865
846
  handler: function (ctx) {
866
847
  return tslib_1.__awaiter(this, void 0, void 0, function () {
867
848
  var userSession, recordId, record;
@@ -870,10 +851,10 @@ function getObjectServiceActionsSchema() {
870
851
  case 0:
871
852
  userSession = ctx.meta.user;
872
853
  recordId = ctx.params.recordId;
873
- return [4 /*yield*/, this.findOne(recordId)];
854
+ return [4, this.findOne(recordId)];
874
855
  case 1:
875
856
  record = _a.sent();
876
- return [2 /*return*/, this.getRecordPermissions(record, userSession)];
857
+ return [2, this.getRecordPermissions(record, userSession)];
877
858
  }
878
859
  });
879
860
  });
@@ -886,16 +867,12 @@ function getObjectServiceActionsSchema() {
886
867
  return tslib_1.__generator(this, function (_a) {
887
868
  userSession = ctx.meta.user;
888
869
  record = ctx.params.record;
889
- return [2 /*return*/, this.getRecordPermissions(record, userSession)];
870
+ return [2, this.getRecordPermissions(record, userSession)];
890
871
  });
891
872
  });
892
873
  }
893
874
  },
894
875
  getRecordView: {
895
- // rest: {
896
- // method: "GET",
897
- // path: "/uiSchema"
898
- // },
899
876
  handler: function (ctx) {
900
877
  return tslib_1.__awaiter(this, void 0, void 0, function () {
901
878
  var userSession, context;
@@ -904,18 +881,14 @@ function getObjectServiceActionsSchema() {
904
881
  case 0:
905
882
  userSession = ctx.meta.user;
906
883
  context = ctx.params.context;
907
- return [4 /*yield*/, this.getRecordView(userSession, context)];
908
- case 1: return [2 /*return*/, _a.sent()];
884
+ return [4, this.getRecordView(userSession, context)];
885
+ case 1: return [2, _a.sent()];
909
886
  }
910
887
  });
911
888
  });
912
889
  }
913
890
  },
914
891
  createDefaultRecordView: {
915
- // rest: {
916
- // method: "POST",
917
- // path: "/defUiSchema"
918
- // },
919
892
  handler: function (ctx) {
920
893
  return tslib_1.__awaiter(this, void 0, void 0, function () {
921
894
  var userSession;
@@ -926,18 +899,14 @@ function getObjectServiceActionsSchema() {
926
899
  if (!userSession.is_space_admin) {
927
900
  throw new Error('no permission.');
928
901
  }
929
- return [4 /*yield*/, this.createDefaultRecordView(userSession)];
930
- case 1: return [2 /*return*/, _a.sent()];
902
+ return [4, this.createDefaultRecordView(userSession)];
903
+ case 1: return [2, _a.sent()];
931
904
  }
932
905
  });
933
906
  });
934
907
  }
935
908
  },
936
909
  getDefaultRecordView: {
937
- // rest: {
938
- // method: "GET",
939
- // path: "/uiSchemaTemplate"
940
- // },
941
910
  handler: function (ctx) {
942
911
  return tslib_1.__awaiter(this, void 0, void 0, function () {
943
912
  var userSession;
@@ -948,24 +917,20 @@ function getObjectServiceActionsSchema() {
948
917
  if (!userSession.is_space_admin) {
949
918
  throw new Error('no permission.');
950
919
  }
951
- return [4 /*yield*/, this.getDefaultRecordView(userSession)];
952
- case 1: return [2 /*return*/, _a.sent()];
920
+ return [4, this.getDefaultRecordView(userSession)];
921
+ case 1: return [2, _a.sent()];
953
922
  }
954
923
  });
955
924
  });
956
925
  }
957
926
  },
958
927
  getRelateds: {
959
- // rest: {
960
- // method: "GET",
961
- // path: "/relateds"
962
- // },
963
928
  handler: function (ctx) {
964
929
  return tslib_1.__awaiter(this, void 0, void 0, function () {
965
930
  return tslib_1.__generator(this, function (_a) {
966
931
  switch (_a.label) {
967
- case 0: return [4 /*yield*/, this.getRelateds()];
968
- case 1: return [2 /*return*/, _a.sent()];
932
+ case 0: return [4, this.getRelateds()];
933
+ case 1: return [2, _a.sent()];
969
934
  }
970
935
  });
971
936
  });
@@ -976,8 +941,8 @@ function getObjectServiceActionsSchema() {
976
941
  return tslib_1.__awaiter(this, void 0, void 0, function () {
977
942
  return tslib_1.__generator(this, function (_a) {
978
943
  switch (_a.label) {
979
- case 0: return [4 /*yield*/, this.refreshIndexes()];
980
- case 1: return [2 /*return*/, _a.sent()];
944
+ case 0: return [4, this.refreshIndexes()];
945
+ case 1: return [2, _a.sent()];
981
946
  }
982
947
  });
983
948
  });
@@ -991,8 +956,8 @@ function getObjectServiceActionsSchema() {
991
956
  switch (_a.label) {
992
957
  case 0:
993
958
  userSession = ctx.meta.user;
994
- return [4 /*yield*/, this.allowRead(userSession)];
995
- case 1: return [2 /*return*/, _a.sent()];
959
+ return [4, this.allowRead(userSession)];
960
+ case 1: return [2, _a.sent()];
996
961
  }
997
962
  });
998
963
  });
@@ -1006,8 +971,8 @@ function getObjectServiceActionsSchema() {
1006
971
  switch (_a.label) {
1007
972
  case 0:
1008
973
  userSession = ctx.meta.user;
1009
- return [4 /*yield*/, this.allowInsert(userSession)];
1010
- case 1: return [2 /*return*/, _a.sent()];
974
+ return [4, this.allowInsert(userSession)];
975
+ case 1: return [2, _a.sent()];
1011
976
  }
1012
977
  });
1013
978
  });
@@ -1021,8 +986,8 @@ function getObjectServiceActionsSchema() {
1021
986
  switch (_a.label) {
1022
987
  case 0:
1023
988
  userSession = ctx.meta.user;
1024
- return [4 /*yield*/, this.allowUpdate(userSession)];
1025
- case 1: return [2 /*return*/, _a.sent()];
989
+ return [4, this.allowUpdate(userSession)];
990
+ case 1: return [2, _a.sent()];
1026
991
  }
1027
992
  });
1028
993
  });
@@ -1036,8 +1001,8 @@ function getObjectServiceActionsSchema() {
1036
1001
  switch (_a.label) {
1037
1002
  case 0:
1038
1003
  userSession = ctx.meta.user;
1039
- return [4 /*yield*/, this.allowDelete(userSession)];
1040
- case 1: return [2 /*return*/, _a.sent()];
1004
+ return [4, this.allowDelete(userSession)];
1005
+ case 1: return [2, _a.sent()];
1041
1006
  }
1042
1007
  });
1043
1008
  });
@@ -1062,10 +1027,7 @@ function getObjectServiceSchema(serviceName, objectConfig) {
1062
1027
  exports.getObjectServiceSchema = getObjectServiceSchema;
1063
1028
  module.exports = {
1064
1029
  name: '#_objectBaseService',
1065
- settings: {
1066
- // objectApiName: //TODO
1067
- // objectConfig
1068
- },
1030
+ settings: {},
1069
1031
  actions: getObjectServiceActionsSchema(),
1070
1032
  methods: getObjectServiceMethodsSchema(),
1071
1033
  created: function (broker) {
@@ -1093,7 +1055,7 @@ module.exports = {
1093
1055
  objectApiName = objectConfig.name;
1094
1056
  steedosSchema = (0, __1.getSteedosSchema)();
1095
1057
  obj = steedosSchema.getObject(objectApiName);
1096
- return [4 /*yield*/, obj.getRelationsInfo()];
1058
+ return [4, obj.getRelationsInfo()];
1097
1059
  case 1:
1098
1060
  relationsInfo = _b.sent();
1099
1061
  detailsInfo = relationsInfo.details || [];
@@ -1116,7 +1078,7 @@ module.exports = {
1116
1078
  }
1117
1079
  finally { if (e_1) throw e_1.error; }
1118
1080
  }
1119
- return [2 /*return*/];
1081
+ return [2];
1120
1082
  }
1121
1083
  });
1122
1084
  });
@@ -1132,16 +1094,14 @@ module.exports = {
1132
1094
  case 0:
1133
1095
  objectApiName = ctx.params.objectApiName;
1134
1096
  _a = this.settings, onDestroyObjectService = _a.onDestroyObjectService, objectConfig = _a.objectConfig;
1135
- if (!(objectApiName === this.object.name)) return [3 /*break*/, 3];
1097
+ if (!(objectApiName === this.object.name)) return [3, 3];
1136
1098
  _.each(objectConfig.fields, function (field, name) {
1137
1099
  if ((field.type === 'lookup' || field.type === 'master_detail') && (field.reference_to && _.isString(field.reference_to))) {
1138
1100
  ctx.broker.emit("".concat((0, _1.getObjectServiceName)(field.reference_to), ".refresh"), {});
1139
1101
  }
1140
1102
  });
1141
- // console.log(`ctx.broker.destroyService`, this.object.name);
1142
- return [4 /*yield*/, ctx.broker.destroyService(this)];
1103
+ return [4, ctx.broker.destroyService(this)];
1143
1104
  case 1:
1144
- // console.log(`ctx.broker.destroyService`, this.object.name);
1145
1105
  _c.sent();
1146
1106
  if (onDestroyObjectService && _.isFunction(onDestroyObjectService)) {
1147
1107
  onDestroyObjectService(objectApiName);
@@ -1152,7 +1112,7 @@ module.exports = {
1152
1112
  }
1153
1113
  steedosSchema = (0, __1.getSteedosSchema)();
1154
1114
  obj = steedosSchema.getObject(objectApiName);
1155
- return [4 /*yield*/, obj.getRelationsInfo()];
1115
+ return [4, obj.getRelationsInfo()];
1156
1116
  case 2:
1157
1117
  relationsInfo = _c.sent();
1158
1118
  detailsInfo = relationsInfo.details || [];
@@ -1177,7 +1137,7 @@ module.exports = {
1177
1137
  }
1178
1138
  ctx.emit('$services.changed');
1179
1139
  _c.label = 3;
1180
- case 3: return [2 /*return*/];
1140
+ case 3: return [2];
1181
1141
  }
1182
1142
  });
1183
1143
  });
@@ -1187,16 +1147,7 @@ module.exports = {
1187
1147
  merged: function (schema) {
1188
1148
  var settings = schema.settings;
1189
1149
  var objectConfig = settings.objectConfig;
1190
- // 先关闭对象服务action rest api, 否则会导致 action rest api 过多, 请求速度变慢.
1191
- // if (objectConfig.enable_api) {
1192
- // _.each(schema.actions, (action, actionName) => {
1193
- // let rest = generateActionRestProp(actionName);
1194
- // if (rest.method) {
1195
- // action.rest = rest;
1196
- // }
1197
- // })
1198
- // }
1199
- if (objectConfig.enable_graphql || true) { // TODO object.yml添加enable_graphql属性
1150
+ if (objectConfig.enable_graphql || true) {
1200
1151
  _.each(schema.actions, function (action, actionName) {
1201
1152
  var gpObj = (0, graphql_1.generateActionGraphqlProp)(actionName, objectConfig);
1202
1153
  if (!_.isEmpty(gpObj)) {
@@ -1221,12 +1172,12 @@ module.exports = {
1221
1172
  type = this.settings.graphql.type;
1222
1173
  relatedFieldName = (0, graphql_1.correctName)("".concat(graphql_1.RELATED_PREFIX, "_").concat(detailObjectApiName, "_").concat(detailFieldName));
1223
1174
  relatedType = (0, graphql_1._getRelatedType)(relatedFieldName, detailObjectApiName);
1224
- if (type.indexOf(relatedType) > -1) { // 防止重复定义field
1225
- return [2 /*return*/];
1175
+ if (type.indexOf(relatedType) > -1) {
1176
+ return [2];
1226
1177
  }
1227
1178
  this.settings.graphql.type = type.substring(0, type.length - 1) + relatedType + '}';
1228
1179
  resolvers[objectApiName][relatedFieldName] = (0, graphql_1.getRelatedResolver)(objectApiName, detailObjectApiName, detailFieldName, detailFieldReferenceToFieldName);
1229
- return [2 /*return*/];
1180
+ return [2];
1230
1181
  });
1231
1182
  });
1232
1183
  }
@@ -1241,7 +1192,7 @@ module.exports = {
1241
1192
  case 0:
1242
1193
  objectConfig = ctx.params.data;
1243
1194
  datasource = (0, datasource_1.getDataSource)(objectConfig.datasource);
1244
- if (!datasource) return [3 /*break*/, 4];
1195
+ if (!datasource) return [3, 4];
1245
1196
  localObjectConfig = (0, object_dynamic_load_1.getObjectConfig)(objectConfig.name);
1246
1197
  if (localObjectConfig) {
1247
1198
  objectConfig.listeners = localObjectConfig.listeners;
@@ -1251,13 +1202,13 @@ module.exports = {
1251
1202
  datasource.setLocalObject(objectConfig.name, object);
1252
1203
  this.object = object;
1253
1204
  if (!(datasource.name != "meteor" &&
1254
- datasource.name != "default")) return [3 /*break*/, 2];
1255
- return [4 /*yield*/, datasource.init()];
1205
+ datasource.name != "default")) return [3, 2];
1206
+ return [4, datasource.init()];
1256
1207
  case 1:
1257
1208
  _a.sent();
1258
1209
  _a.label = 2;
1259
1210
  case 2:
1260
- if (!(datasource.name === 'meteor' && Creator.Objects[objectConfig.name])) return [3 /*break*/, 4];
1211
+ if (!(datasource.name === 'meteor' && Creator.Objects[objectConfig.name])) return [3, 4];
1261
1212
  (0, convert_1.jsonToObject)(objectConfig);
1262
1213
  localTriggers = localObjectConfig.triggers;
1263
1214
  if (localTriggers) {
@@ -1265,7 +1216,7 @@ module.exports = {
1265
1216
  }
1266
1217
  (0, util_1.extend)(objectConfig, { triggers: Creator.Objects[objectConfig.name].triggers }, { triggers: localObjectConfig._baseTriggers });
1267
1218
  Creator.Objects[objectConfig.name] = objectConfig;
1268
- return [4 /*yield*/, Future.task(function () {
1219
+ return [4, Future.task(function () {
1269
1220
  try {
1270
1221
  Creator.loadObjects(objectConfig, objectConfig.name);
1271
1222
  }
@@ -1280,11 +1231,8 @@ module.exports = {
1280
1231
  gobj = (0, graphql_1.generateSettingsGraphql)(objectConfig);
1281
1232
  this.settings.graphql = gobj;
1282
1233
  (0, graphql_1.dealWithRelatedFields)(objectConfig, this.settings.graphql);
1283
- // TODO 重写 actions
1284
- // let graphqlActions = getGraphqlActions(objectConfig);
1285
- // schema.actions = _.extend({}, graphqlActions, schema.actions);
1286
1234
  ctx.emit('$services.changed');
1287
- return [2 /*return*/];
1235
+ return [2];
1288
1236
  }
1289
1237
  });
1290
1238
  });
@@ -1302,7 +1250,7 @@ module.exports = {
1302
1250
  (0, graphql_1.dealWithRelatedFields)(_objectConfig, this.settings.graphql);
1303
1251
  ctx.emit('$services.changed');
1304
1252
  }
1305
- return [2 /*return*/];
1253
+ return [2];
1306
1254
  });
1307
1255
  });
1308
1256
  }