@kaspernj/api-maker 1.0.2054 → 1.0.2055

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 (381) hide show
  1. package/build/api.js +64 -212
  2. package/build/api.js.map +1 -1
  3. package/build/attribute-not-loaded-error.js +2 -25
  4. package/build/attribute-not-loaded-error.js.map +1 -1
  5. package/build/base-component.js +3 -26
  6. package/build/base-component.js.map +1 -1
  7. package/build/base-error.js +20 -45
  8. package/build/base-error.js.map +1 -1
  9. package/build/base-model/attribute.js +14 -21
  10. package/build/base-model/attribute.js.map +1 -1
  11. package/build/base-model/column.js +4 -8
  12. package/build/base-model/column.js.map +1 -1
  13. package/build/base-model/reflection.js +11 -51
  14. package/build/base-model/reflection.js.map +1 -1
  15. package/build/base-model/scope.js +8 -45
  16. package/build/base-model/scope.js.map +1 -1
  17. package/build/base-model.js +583 -836
  18. package/build/base-model.js.map +1 -1
  19. package/build/bootstrap/attribute-row.js +87 -172
  20. package/build/bootstrap/attribute-row.js.map +1 -1
  21. package/build/bootstrap/attribute-rows.js +21 -50
  22. package/build/bootstrap/attribute-rows.js.map +1 -1
  23. package/build/bootstrap/card.js +76 -159
  24. package/build/bootstrap/card.js.map +1 -1
  25. package/build/bootstrap/checkbox.js +53 -102
  26. package/build/bootstrap/checkbox.js.map +1 -1
  27. package/build/bootstrap/checkboxes.js +116 -202
  28. package/build/bootstrap/checkboxes.js.map +1 -1
  29. package/build/bootstrap/input.js +80 -131
  30. package/build/bootstrap/input.js.map +1 -1
  31. package/build/bootstrap/invalid-feedback.js +18 -46
  32. package/build/bootstrap/invalid-feedback.js.map +1 -1
  33. package/build/bootstrap/paginate.js +99 -164
  34. package/build/bootstrap/paginate.js.map +1 -1
  35. package/build/bootstrap/radio-buttons.js +43 -80
  36. package/build/bootstrap/radio-buttons.js.map +1 -1
  37. package/build/bootstrap/select.js +43 -90
  38. package/build/bootstrap/select.js.map +1 -1
  39. package/build/bootstrap/sort-link.js +68 -151
  40. package/build/bootstrap/sort-link.js.map +1 -1
  41. package/build/cable-connection-pool.js +43 -65
  42. package/build/cable-connection-pool.js.map +1 -1
  43. package/build/cable-subscription-pool.js +104 -161
  44. package/build/cable-subscription-pool.js.map +1 -1
  45. package/build/cable-subscription.js +9 -16
  46. package/build/cable-subscription.js.map +1 -1
  47. package/build/cache-key-generator.js +27 -36
  48. package/build/cache-key-generator.js.map +1 -1
  49. package/build/can-can.js +80 -201
  50. package/build/can-can.js.map +1 -1
  51. package/build/channels-consumer.js +5 -10
  52. package/build/channels-consumer.js.map +1 -1
  53. package/build/collection-loader.js +35 -53
  54. package/build/collection-loader.js.map +1 -1
  55. package/build/collection.js +160 -307
  56. package/build/collection.js.map +1 -1
  57. package/build/command-submit-data.d.ts +1 -1
  58. package/build/command-submit-data.d.ts.map +1 -1
  59. package/build/command-submit-data.js +29 -38
  60. package/build/command-submit-data.js.map +1 -1
  61. package/build/commands-pool.js +139 -215
  62. package/build/commands-pool.js.map +1 -1
  63. package/build/compose.js +3 -11
  64. package/build/compose.js.map +1 -1
  65. package/build/config.js +20 -67
  66. package/build/config.js.map +1 -1
  67. package/build/custom-error.js +4 -29
  68. package/build/custom-error.js.map +1 -1
  69. package/build/data-set-to-attributes.js +5 -41
  70. package/build/data-set-to-attributes.js.map +1 -1
  71. package/build/deserializer.js +26 -79
  72. package/build/deserializer.js.map +1 -1
  73. package/build/destroy-error.js +4 -29
  74. package/build/destroy-error.js.map +1 -1
  75. package/build/devise.js +83 -187
  76. package/build/devise.js.map +1 -1
  77. package/build/draggable-sort/controller.js +87 -110
  78. package/build/draggable-sort/controller.js.map +1 -1
  79. package/build/draggable-sort/index.js +67 -144
  80. package/build/draggable-sort/index.js.map +1 -1
  81. package/build/draggable-sort/item.js +131 -197
  82. package/build/draggable-sort/item.js.map +1 -1
  83. package/build/error-logger.js +78 -163
  84. package/build/error-logger.js.map +1 -1
  85. package/build/error-messages.js +4 -7
  86. package/build/error-messages.js.map +1 -1
  87. package/build/event-connection.js +23 -61
  88. package/build/event-connection.js.map +1 -1
  89. package/build/event-emitter-listener.js +6 -23
  90. package/build/event-emitter-listener.js.map +1 -1
  91. package/build/event-model-class.js +19 -46
  92. package/build/event-model-class.js.map +1 -1
  93. package/build/events.js +3 -8
  94. package/build/events.js.map +1 -1
  95. package/build/form.js +65 -153
  96. package/build/form.js.map +1 -1
  97. package/build/history-expo.js +12 -24
  98. package/build/history-expo.js.map +1 -1
  99. package/build/history-react-native.js +14 -26
  100. package/build/history-react-native.js.map +1 -1
  101. package/build/history.js +2 -4
  102. package/build/history.js.map +1 -1
  103. package/build/index.js +2 -5
  104. package/build/index.js.map +1 -1
  105. package/build/inputs/attachment.js +71 -122
  106. package/build/inputs/attachment.js.map +1 -1
  107. package/build/inputs/auto-submit.js +15 -54
  108. package/build/inputs/auto-submit.js.map +1 -1
  109. package/build/inputs/checkbox.js +77 -166
  110. package/build/inputs/checkbox.js.map +1 -1
  111. package/build/inputs/checkboxes.js +75 -158
  112. package/build/inputs/checkboxes.js.map +1 -1
  113. package/build/inputs/id-for-component.js +4 -40
  114. package/build/inputs/id-for-component.js.map +1 -1
  115. package/build/inputs/input-wrapper.js +7 -26
  116. package/build/inputs/input-wrapper.js.map +1 -1
  117. package/build/inputs/input.js +158 -244
  118. package/build/inputs/input.js.map +1 -1
  119. package/build/inputs/money.js +123 -185
  120. package/build/inputs/money.js.map +1 -1
  121. package/build/inputs/name-for-component.js +4 -40
  122. package/build/inputs/name-for-component.js.map +1 -1
  123. package/build/inputs/select.js +68 -122
  124. package/build/inputs/select.js.map +1 -1
  125. package/build/instance-of-class-name.js +15 -20
  126. package/build/instance-of-class-name.js.map +1 -1
  127. package/build/is-expo.js +8 -10
  128. package/build/is-expo.js.map +1 -1
  129. package/build/key-value-store.js +51 -127
  130. package/build/key-value-store.js.map +1 -1
  131. package/build/link.js +51 -114
  132. package/build/link.js.map +1 -1
  133. package/build/logger.js +19 -25
  134. package/build/logger.js.map +1 -1
  135. package/build/merge-styles.js +5 -9
  136. package/build/merge-styles.js.map +1 -1
  137. package/build/modal.js +14 -61
  138. package/build/modal.js.map +1 -1
  139. package/build/model-class-require.js +8 -43
  140. package/build/model-class-require.js.map +1 -1
  141. package/build/model-events.js +24 -33
  142. package/build/model-events.js.map +1 -1
  143. package/build/model-name.js +15 -56
  144. package/build/model-name.js.map +1 -1
  145. package/build/model-prop-type.js +51 -62
  146. package/build/model-prop-type.js.map +1 -1
  147. package/build/model-recipes-loader.js +16 -24
  148. package/build/model-recipes-loader.js.map +1 -1
  149. package/build/model-recipes-model-loader.d.ts +1 -1
  150. package/build/model-recipes-model-loader.js +129 -207
  151. package/build/model-recipes-model-loader.js.map +1 -1
  152. package/build/models-response-reader.js +24 -65
  153. package/build/models-response-reader.js.map +1 -1
  154. package/build/models.js +5 -10
  155. package/build/models.js.map +1 -1
  156. package/build/money-formatter.d.ts +2 -2
  157. package/build/money-formatter.d.ts.map +1 -1
  158. package/build/money-formatter.js +45 -55
  159. package/build/money-formatter.js.map +1 -1
  160. package/build/not-loaded-error.js +2 -25
  161. package/build/not-loaded-error.js.map +1 -1
  162. package/build/params.js +31 -41
  163. package/build/params.js.map +1 -1
  164. package/build/preloaded.js +18 -58
  165. package/build/preloaded.js.map +1 -1
  166. package/build/resize-observer.js +5 -11
  167. package/build/resize-observer.js.map +1 -1
  168. package/build/rest-props-validator.js +4 -6
  169. package/build/rest-props-validator.js.map +1 -1
  170. package/build/result.js +10 -14
  171. package/build/result.js.map +1 -1
  172. package/build/router/route.js +178 -311
  173. package/build/router/route.js.map +1 -1
  174. package/build/router/switch.js +55 -129
  175. package/build/router/switch.js.map +1 -1
  176. package/build/router.js +33 -93
  177. package/build/router.js.map +1 -1
  178. package/build/routes-native.js +63 -147
  179. package/build/routes-native.js.map +1 -1
  180. package/build/routes.js +25 -79
  181. package/build/routes.js.map +1 -1
  182. package/build/run-last.js +19 -24
  183. package/build/run-last.js.map +1 -1
  184. package/build/serializer.js +28 -33
  185. package/build/serializer.js.map +1 -1
  186. package/build/services.js +9 -18
  187. package/build/services.js.map +1 -1
  188. package/build/session-status-updater.js +84 -183
  189. package/build/session-status-updater.js.map +1 -1
  190. package/build/source-maps-loader.d.ts +37 -0
  191. package/build/source-maps-loader.d.ts.map +1 -0
  192. package/build/source-maps-loader.js +102 -224
  193. package/build/source-maps-loader.js.map +1 -1
  194. package/build/super-admin/config-reader.d.ts +2 -2
  195. package/build/super-admin/config-reader.js +41 -82
  196. package/build/super-admin/config-reader.js.map +1 -1
  197. package/build/super-admin/edit-page/edit-attribute-checkbox.js +52 -114
  198. package/build/super-admin/edit-page/edit-attribute-checkbox.js.map +1 -1
  199. package/build/super-admin/edit-page/edit-attribute-content.js +46 -76
  200. package/build/super-admin/edit-page/edit-attribute-content.js.map +1 -1
  201. package/build/super-admin/edit-page/edit-attribute-input.js +56 -118
  202. package/build/super-admin/edit-page/edit-attribute-input.js.map +1 -1
  203. package/build/super-admin/edit-page/edit-attribute.js +39 -103
  204. package/build/super-admin/edit-page/edit-attribute.js.map +1 -1
  205. package/build/super-admin/edit-page.js +87 -200
  206. package/build/super-admin/edit-page.js.map +1 -1
  207. package/build/super-admin/has-edit-config.js +6 -12
  208. package/build/super-admin/has-edit-config.js.map +1 -1
  209. package/build/super-admin/index-page.js +16 -43
  210. package/build/super-admin/index-page.js.map +1 -1
  211. package/build/super-admin/index.js +86 -209
  212. package/build/super-admin/index.js.map +1 -1
  213. package/build/super-admin/layout/header/index.js +90 -151
  214. package/build/super-admin/layout/header/index.js.map +1 -1
  215. package/build/super-admin/layout/index.js +69 -152
  216. package/build/super-admin/layout/index.js.map +1 -1
  217. package/build/super-admin/layout/menu/index.js +84 -160
  218. package/build/super-admin/layout/menu/index.js.map +1 -1
  219. package/build/super-admin/layout/menu/menu-content.js +24 -84
  220. package/build/super-admin/layout/menu/menu-content.js.map +1 -1
  221. package/build/super-admin/layout/menu/menu-item.js +51 -101
  222. package/build/super-admin/layout/menu/menu-item.js.map +1 -1
  223. package/build/super-admin/layout/no-access.js +18 -44
  224. package/build/super-admin/layout/no-access.js.map +1 -1
  225. package/build/super-admin/model-class-table.js +44 -128
  226. package/build/super-admin/model-class-table.js.map +1 -1
  227. package/build/super-admin/models.js +5 -41
  228. package/build/super-admin/models.js.map +1 -1
  229. package/build/super-admin/show-nav.js +26 -88
  230. package/build/super-admin/show-nav.js.map +1 -1
  231. package/build/super-admin/show-page/belongs-to-attribute-row.js +17 -75
  232. package/build/super-admin/show-page/belongs-to-attribute-row.js.map +1 -1
  233. package/build/super-admin/show-page/index.js +100 -186
  234. package/build/super-admin/show-page/index.js.map +1 -1
  235. package/build/super-admin/show-reflection-actions.js +38 -99
  236. package/build/super-admin/show-reflection-actions.js.map +1 -1
  237. package/build/super-admin/show-reflection-link.js +26 -98
  238. package/build/super-admin/show-reflection-link.js.map +1 -1
  239. package/build/super-admin/show-reflection-page.js +33 -96
  240. package/build/super-admin/show-reflection-page.js.map +1 -1
  241. package/build/table/column-content.js +76 -120
  242. package/build/table/column-content.js.map +1 -1
  243. package/build/table/column-identifier.js +6 -10
  244. package/build/table/column-identifier.js.map +1 -1
  245. package/build/table/column-visible.js +1 -4
  246. package/build/table/column-visible.js.map +1 -1
  247. package/build/table/components/column.js +12 -59
  248. package/build/table/components/column.js.map +1 -1
  249. package/build/table/components/flat-list.js +12 -59
  250. package/build/table/components/flat-list.js.map +1 -1
  251. package/build/table/components/header.js +14 -61
  252. package/build/table/components/header.js.map +1 -1
  253. package/build/table/components/row.js +15 -62
  254. package/build/table/components/row.js.map +1 -1
  255. package/build/table/filters/attribute-element.js +33 -61
  256. package/build/table/filters/attribute-element.js.map +1 -1
  257. package/build/table/filters/filter-form.js +279 -482
  258. package/build/table/filters/filter-form.js.map +1 -1
  259. package/build/table/filters/filter.js +44 -72
  260. package/build/table/filters/filter.js.map +1 -1
  261. package/build/table/filters/index.js +94 -138
  262. package/build/table/filters/index.js.map +1 -1
  263. package/build/table/filters/load-search-modal.js +63 -211
  264. package/build/table/filters/load-search-modal.js.map +1 -1
  265. package/build/table/filters/reflection-element.js +26 -54
  266. package/build/table/filters/reflection-element.js.map +1 -1
  267. package/build/table/filters/save-search-modal.js +43 -139
  268. package/build/table/filters/save-search-modal.js.map +1 -1
  269. package/build/table/filters/scope-element.js +27 -55
  270. package/build/table/filters/scope-element.js.map +1 -1
  271. package/build/table/header-column-content.js +32 -70
  272. package/build/table/header-column-content.js.map +1 -1
  273. package/build/table/header-column.js +88 -217
  274. package/build/table/header-column.js.map +1 -1
  275. package/build/table/header-select.js +44 -76
  276. package/build/table/header-select.js.map +1 -1
  277. package/build/table/model-callback-args.js +4 -40
  278. package/build/table/model-callback-args.js.map +1 -1
  279. package/build/table/model-column.js +58 -143
  280. package/build/table/model-column.js.map +1 -1
  281. package/build/table/model-row.js +74 -186
  282. package/build/table/model-row.js.map +1 -1
  283. package/build/table/select-calculator.js +26 -85
  284. package/build/table/select-calculator.js.map +1 -1
  285. package/build/table/settings/column-row.js +65 -185
  286. package/build/table/settings/column-row.js.map +1 -1
  287. package/build/table/settings/download-action.js +37 -73
  288. package/build/table/settings/download-action.js.map +1 -1
  289. package/build/table/settings/index.js +37 -101
  290. package/build/table/settings/index.js.map +1 -1
  291. package/build/table/table-settings.js +184 -322
  292. package/build/table/table-settings.js.map +1 -1
  293. package/build/table/table.js +582 -780
  294. package/build/table/table.js.map +1 -1
  295. package/build/table/use-sorting.js +15 -34
  296. package/build/table/use-sorting.js.map +1 -1
  297. package/build/table/widths.js +31 -37
  298. package/build/table/widths.js.map +1 -1
  299. package/build/table/worker-plugins-check-all-checkbox.js +76 -224
  300. package/build/table/worker-plugins-check-all-checkbox.js.map +1 -1
  301. package/build/table/worker-plugins-checkbox.js +73 -184
  302. package/build/table/worker-plugins-checkbox.js.map +1 -1
  303. package/build/translated-attributes.js +5 -10
  304. package/build/translated-attributes.js.map +1 -1
  305. package/build/translated-collections.js +10 -19
  306. package/build/translated-collections.js.map +1 -1
  307. package/build/updated-attribute.js +46 -119
  308. package/build/updated-attribute.js.map +1 -1
  309. package/build/url-encode.js +5 -11
  310. package/build/url-encode.js.map +1 -1
  311. package/build/use-breakpoint.js +42 -94
  312. package/build/use-breakpoint.js.map +1 -1
  313. package/build/use-can-can.js +29 -91
  314. package/build/use-can-can.js.map +1 -1
  315. package/build/use-collection.js +118 -228
  316. package/build/use-collection.js.map +1 -1
  317. package/build/use-created-event.js +26 -43
  318. package/build/use-created-event.js.map +1 -1
  319. package/build/use-current-user-context.js +56 -150
  320. package/build/use-current-user-context.js.map +1 -1
  321. package/build/use-current-user.js +13 -31
  322. package/build/use-current-user.js.map +1 -1
  323. package/build/use-destroyed-event.js +21 -42
  324. package/build/use-destroyed-event.js.map +1 -1
  325. package/build/use-event-emitter.js +9 -14
  326. package/build/use-event-emitter.js.map +1 -1
  327. package/build/use-event-listener.js +12 -21
  328. package/build/use-event-listener.js.map +1 -1
  329. package/build/use-input.js +48 -68
  330. package/build/use-input.js.map +1 -1
  331. package/build/use-model-event.js +21 -42
  332. package/build/use-model-event.js.map +1 -1
  333. package/build/use-model.js +95 -198
  334. package/build/use-model.js.map +1 -1
  335. package/build/use-resize-observer.js +10 -20
  336. package/build/use-resize-observer.js.map +1 -1
  337. package/build/use-router.js +64 -106
  338. package/build/use-router.js.map +1 -1
  339. package/build/use-screen-layout.js +16 -18
  340. package/build/use-screen-layout.js.map +1 -1
  341. package/build/use-styles.js +23 -74
  342. package/build/use-styles.js.map +1 -1
  343. package/build/use-updated-event.js +21 -43
  344. package/build/use-updated-event.js.map +1 -1
  345. package/build/use-validation-errors.js +11 -17
  346. package/build/use-validation-errors.js.map +1 -1
  347. package/build/utils/button.js +85 -135
  348. package/build/utils/button.js.map +1 -1
  349. package/build/utils/card.js +30 -105
  350. package/build/utils/card.js.map +1 -1
  351. package/build/utils/checkbox.js +50 -111
  352. package/build/utils/checkbox.js.map +1 -1
  353. package/build/utils/checkboxes.js +108 -181
  354. package/build/utils/checkboxes.js.map +1 -1
  355. package/build/utils/default-style.js +28 -102
  356. package/build/utils/default-style.js.map +1 -1
  357. package/build/utils/header.js +7 -34
  358. package/build/utils/header.js.map +1 -1
  359. package/build/utils/icon.js +35 -116
  360. package/build/utils/icon.js.map +1 -1
  361. package/build/utils/invalid-feedback.js +15 -42
  362. package/build/utils/invalid-feedback.js.map +1 -1
  363. package/build/utils/modal.js +24 -107
  364. package/build/utils/modal.js.map +1 -1
  365. package/build/utils/text.js +9 -36
  366. package/build/utils/text.js.map +1 -1
  367. package/build/validation-error.js +30 -88
  368. package/build/validation-error.js.map +1 -1
  369. package/build/validation-errors.js +60 -110
  370. package/build/validation-errors.js.map +1 -1
  371. package/build/with-api-maker.js +14 -66
  372. package/build/with-api-maker.js.map +1 -1
  373. package/build/with-collection.js +13 -63
  374. package/build/with-collection.js.map +1 -1
  375. package/build/with-current-user.js +6 -22
  376. package/build/with-current-user.js.map +1 -1
  377. package/build/with-model.js +10 -26
  378. package/build/with-model.js.map +1 -1
  379. package/build/with-router.js +7 -34
  380. package/build/with-router.js.map +1 -1
  381. package/package.json +1 -1
@@ -1,85 +1,11 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
- var __generator = (this && this.__generator) || function (thisArg, body) {
45
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
46
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
47
- function verb(n) { return function (v) { return step([n, v]); }; }
48
- function step(op) {
49
- if (f) throw new TypeError("Generator is already executing.");
50
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
51
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
52
- if (y = 0, t) op = [op[0] & 2, t.value];
53
- switch (op[0]) {
54
- case 0: case 1: t = op; break;
55
- case 4: _.label++; return { value: op[1], done: false };
56
- case 5: _.label++; y = op[1]; op = [0]; continue;
57
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
58
- default:
59
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
60
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
61
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
62
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
63
- if (t[2]) _.ops.pop();
64
- _.trys.pop(); continue;
65
- }
66
- op = body.call(thisArg, _);
67
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
68
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
69
- }
70
- };
71
- var __importDefault = (this && this.__importDefault) || function (mod) {
72
- return (mod && mod.__esModule) ? mod : { "default": mod };
73
- };
74
- Object.defineProperty(exports, "__esModule", { value: true });
75
- var clone_deep_1 = __importDefault(require("clone-deep"));
76
- var commands_pool_js_1 = __importDefault(require("./commands-pool.js"));
77
- var diggerize_1 = require("diggerize");
78
- var inflection = __importStar(require("inflection"));
79
- var incorporator_1 = require("incorporator");
80
- var model_class_require_js_1 = __importDefault(require("./model-class-require.js"));
81
- var result_js_1 = __importDefault(require("./result.js"));
82
- var uniqunize_1 = __importDefault(require("uniqunize"));
1
+ import cloneDeep from "clone-deep";
2
+ import CommandsPool from "./commands-pool.js";
3
+ import { digg } from "diggerize";
4
+ import * as inflection from "inflection";
5
+ import { incorporate } from "incorporator";
6
+ import modelClassRequire from "./model-class-require.js";
7
+ import Result from "./result.js";
8
+ import uniqunize from "uniqunize";
83
9
  /**
84
10
  * @template {typeof import("./base-model.js").default} MC
85
11
  * @typedef {InstanceType<MC>} ModelOf
@@ -111,124 +37,86 @@ var uniqunize_1 = __importDefault(require("uniqunize"));
111
37
  /**
112
38
  * @template {typeof import("./base-model.js").default} MC
113
39
  */
114
- var ApiMakerCollection = /** @class */ (function () {
40
+ export default class ApiMakerCollection {
41
+ static apiMakerType = "Collection";
115
42
  /**
116
43
  * @param {CollectionArgsType<MC>} args
117
44
  * @param {QueryArgsType} queryArgs
118
45
  */
119
- function ApiMakerCollection(args, queryArgs) {
120
- if (queryArgs === void 0) { queryArgs = {}; }
46
+ constructor(args, queryArgs = {}) {
121
47
  if (!args.modelClass)
122
- throw new Error("No modelClass given in ".concat(Object.keys(args).join(", ")));
48
+ throw new Error(`No modelClass given in ${Object.keys(args).join(", ")}`);
123
49
  this.queryArgs = queryArgs;
124
50
  this.args = args;
125
51
  }
126
- ApiMakerCollection.prototype.abilities = function (originalAbilities) {
127
- var newAbilities = {};
128
- for (var originalAbilityName in originalAbilities) {
129
- var newModelName = inflection.underscore(originalAbilityName);
130
- var newValues = [];
131
- var originalValues = originalAbilities[originalAbilityName];
132
- for (var _i = 0, originalValues_1 = originalValues; _i < originalValues_1.length; _i++) {
133
- var originalAbilityName_1 = originalValues_1[_i];
134
- var newAbilityName = inflection.underscore(originalAbilityName_1);
52
+ abilities(originalAbilities) {
53
+ const newAbilities = {};
54
+ for (const originalAbilityName in originalAbilities) {
55
+ const newModelName = inflection.underscore(originalAbilityName);
56
+ const newValues = [];
57
+ const originalValues = originalAbilities[originalAbilityName];
58
+ for (const originalAbilityName of originalValues) {
59
+ const newAbilityName = inflection.underscore(originalAbilityName);
135
60
  newValues.push(newAbilityName);
136
61
  }
137
62
  newAbilities[newModelName] = newValues;
138
63
  }
139
64
  return this._merge({ abilities: newAbilities });
140
- };
65
+ }
141
66
  /**
142
67
  * @param {string} abilityName
143
68
  * @returns {this}
144
69
  */
145
- ApiMakerCollection.prototype.accessibleBy = function (abilityName) {
70
+ accessibleBy(abilityName) {
146
71
  return this._merge({ accessibleBy: inflection.underscore(abilityName) });
147
- };
72
+ }
148
73
  /**
149
74
  * @returns {Promise<number>}
150
75
  */
151
- ApiMakerCollection.prototype.count = function () {
152
- return __awaiter(this, void 0, void 0, function () {
153
- var response;
154
- return __generator(this, function (_a) {
155
- switch (_a.label) {
156
- case 0: return [4 /*yield*/, this.clone()._merge({ count: true })._response()];
157
- case 1:
158
- response = _a.sent();
159
- return [2 /*return*/, (0, diggerize_1.digg)(response, "count")];
160
- }
161
- });
162
- });
163
- };
76
+ async count() {
77
+ const response = await this.clone()._merge({ count: true })._response();
78
+ return digg(response, "count");
79
+ }
164
80
  /**
165
81
  * @returns {this}
166
82
  */
167
- ApiMakerCollection.prototype.distinct = function () {
83
+ distinct() {
168
84
  return this._merge({ distinct: true });
169
- };
85
+ }
170
86
  /**
171
87
  * @param {function(import("./base-model.js").default) : void} callback
172
88
  * @returns {Promise<void>}
173
89
  */
174
- ApiMakerCollection.prototype.each = function (callback) {
175
- return __awaiter(this, void 0, void 0, function () {
176
- var array, model;
177
- return __generator(this, function (_a) {
178
- switch (_a.label) {
179
- case 0: return [4 /*yield*/, this.toArray()];
180
- case 1:
181
- array = _a.sent();
182
- for (model in array) {
183
- callback.call(model);
184
- }
185
- return [2 /*return*/];
186
- }
187
- });
188
- });
189
- };
90
+ async each(callback) {
91
+ const array = await this.toArray();
92
+ for (const model in array) {
93
+ callback.call(model);
94
+ }
95
+ }
190
96
  /**
191
97
  * @param {...string} keys
192
98
  * @returns {this}
193
99
  */
194
- ApiMakerCollection.prototype.except = function () {
195
- var keys = [];
196
- for (var _i = 0; _i < arguments.length; _i++) {
197
- keys[_i] = arguments[_i];
198
- }
199
- for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) {
200
- var key = keys_1[_a];
100
+ except(...keys) {
101
+ for (const key of keys) {
201
102
  if (key == "page") {
202
103
  delete this.queryArgs[key];
203
104
  }
204
105
  else {
205
- throw new Error("Unhandled key: ".concat(key));
106
+ throw new Error(`Unhandled key: ${key}`);
206
107
  }
207
108
  }
208
109
  return this;
209
- };
110
+ }
210
111
  /**
211
112
  * @returns {Promise<ModelOf<MC>>}
212
113
  */
213
- ApiMakerCollection.prototype.first = function () {
214
- return __awaiter(this, void 0, void 0, function () {
215
- var models;
216
- return __generator(this, function (_a) {
217
- switch (_a.label) {
218
- case 0: return [4 /*yield*/, this.toArray()];
219
- case 1:
220
- models = _a.sent();
221
- return [2 /*return*/, models[0]];
222
- }
223
- });
224
- });
225
- };
226
- ApiMakerCollection.prototype.groupBy = function () {
227
- var arrayOfTablesAndColumns = [];
228
- for (var _i = 0; _i < arguments.length; _i++) {
229
- arrayOfTablesAndColumns[_i] = arguments[_i];
230
- }
231
- var arrayOfTablesAndColumnsWithLowercaseColumns = arrayOfTablesAndColumns.map(function (tableAndColumn) {
114
+ async first() {
115
+ const models = await this.toArray();
116
+ return models[0];
117
+ }
118
+ groupBy(...arrayOfTablesAndColumns) {
119
+ const arrayOfTablesAndColumnsWithLowercaseColumns = arrayOfTablesAndColumns.map((tableAndColumn) => {
232
120
  if (Array.isArray(tableAndColumn)) {
233
121
  return [tableAndColumn[0], tableAndColumn[1].toLowerCase()];
234
122
  }
@@ -236,34 +124,24 @@ var ApiMakerCollection = /** @class */ (function () {
236
124
  return tableAndColumn.toLowerCase();
237
125
  }
238
126
  });
239
- var currentGroupBy = this.queryArgs.groupBy || [];
240
- var newGroupBy = currentGroupBy.concat(arrayOfTablesAndColumnsWithLowercaseColumns);
127
+ const currentGroupBy = this.queryArgs.groupBy || [];
128
+ const newGroupBy = currentGroupBy.concat(arrayOfTablesAndColumnsWithLowercaseColumns);
241
129
  return this._merge({
242
130
  groupBy: newGroupBy
243
131
  });
244
- };
245
- ApiMakerCollection.prototype.ensureLoaded = function () {
246
- return __awaiter(this, void 0, void 0, function () {
247
- var models;
248
- return __generator(this, function (_a) {
249
- switch (_a.label) {
250
- case 0:
251
- if (!!this.isLoaded()) return [3 /*break*/, 2];
252
- return [4 /*yield*/, this.toArray()];
253
- case 1:
254
- models = _a.sent();
255
- this.set(models);
256
- _a.label = 2;
257
- case 2: return [2 /*return*/, this.loaded()];
258
- }
259
- });
260
- });
261
- };
132
+ }
133
+ async ensureLoaded() {
134
+ if (!this.isLoaded()) {
135
+ const models = await this.toArray();
136
+ this.set(models);
137
+ }
138
+ return this.loaded();
139
+ }
262
140
  /**
263
141
  * @returns {boolean}
264
142
  */
265
- ApiMakerCollection.prototype.isLoaded = function () {
266
- var _a = this.args, model = _a.model, reflectionName = _a.reflectionName;
143
+ isLoaded() {
144
+ const { model, reflectionName } = this.args;
267
145
  if (reflectionName in model.relationshipsCache) {
268
146
  return true;
269
147
  }
@@ -271,28 +149,28 @@ var ApiMakerCollection = /** @class */ (function () {
271
149
  return true;
272
150
  }
273
151
  return false;
274
- };
152
+ }
275
153
  /**
276
154
  * @param {number} amount
277
155
  * @returns {this}
278
156
  */
279
- ApiMakerCollection.prototype.limit = function (amount) {
157
+ limit(amount) {
280
158
  return this._merge({ limit: amount });
281
- };
159
+ }
282
160
  /**
283
161
  * @returns {Array<ModelOf<MC>>}
284
162
  */
285
- ApiMakerCollection.prototype.preloaded = function () {
163
+ preloaded() {
286
164
  if (!(this.args.reflectionName in this.args.model.relationshipsCache)) {
287
- throw new Error("".concat(this.args.reflectionName, " hasnt been loaded yet"));
165
+ throw new Error(`${this.args.reflectionName} hasnt been loaded yet`);
288
166
  }
289
167
  return this.args.model.relationshipsCache[this.args.reflectionName];
290
- };
168
+ }
291
169
  /**
292
170
  * @returns {ModelOf<MC> | Array<ModelOf<MC>>}
293
171
  */
294
- ApiMakerCollection.prototype.loaded = function () {
295
- var _a = this.args, model = _a.model, reflectionName = _a.reflectionName;
172
+ loaded() {
173
+ const { model, reflectionName } = this.args;
296
174
  if (reflectionName in model.relationships) {
297
175
  return model.relationships[reflectionName];
298
176
  }
@@ -300,84 +178,84 @@ var ApiMakerCollection = /** @class */ (function () {
300
178
  return model.relationshipsCache[reflectionName];
301
179
  }
302
180
  else if (model.isNewRecord()) {
303
- var reflectionNameUnderscore = inflection.underscore(reflectionName);
181
+ const reflectionNameUnderscore = inflection.underscore(reflectionName);
304
182
  // Initialize as empty and try again to return the empty result
305
183
  this.set([]);
306
- return (0, diggerize_1.digg)(model.relationships, reflectionNameUnderscore);
184
+ return digg(model.relationships, reflectionNameUnderscore);
307
185
  }
308
186
  else {
309
- var relationshipsLoaded = (0, uniqunize_1.default)(Object.keys(model.relationships).concat(Object.keys(model.relationshipsCache)));
310
- throw new Error("".concat(reflectionName, " hasnt been loaded yet on ").concat(model.modelClassData().name, ". Loaded was: ").concat(relationshipsLoaded.join(", ")));
187
+ const relationshipsLoaded = uniqunize(Object.keys(model.relationships).concat(Object.keys(model.relationshipsCache)));
188
+ throw new Error(`${reflectionName} hasnt been loaded yet on ${model.modelClassData().name}. Loaded was: ${relationshipsLoaded.join(", ")}`);
311
189
  }
312
- };
190
+ }
313
191
  /** @returns {Array<ModelOf<MC>>} */
314
- ApiMakerCollection.prototype.loadedArray = function () {
315
- var loaded = this.loaded();
192
+ loadedArray() {
193
+ const loaded = this.loaded();
316
194
  if (Array.isArray(loaded)) {
317
195
  return loaded;
318
196
  }
319
197
  else {
320
198
  throw new Error("'loaded' wasn't an array");
321
199
  }
322
- };
200
+ }
323
201
  // Replaces the relationships with the given new collection.
324
- ApiMakerCollection.prototype.set = function (newCollection) {
202
+ set(newCollection) {
325
203
  this.args.model.relationships[this.args.reflectionName] = newCollection;
326
- };
204
+ }
327
205
  // Pushes another model onto the given collection.
328
- ApiMakerCollection.prototype.push = function (newModel) {
329
- var _a = this.args, model = _a.model, reflectionName = _a.reflectionName;
206
+ push(newModel) {
207
+ const { model, reflectionName } = this.args;
330
208
  if (!(reflectionName in model.relationships)) {
331
209
  model.relationships[reflectionName] = [];
332
210
  }
333
211
  if (!model.relationships[reflectionName].includes(newModel)) {
334
212
  model.relationships[reflectionName].push(newModel);
335
213
  }
336
- };
214
+ }
337
215
  // Array shortcuts
338
216
  /**
339
217
  * @param {function(import("./base-model.js").default): boolean} callback
340
218
  * @returns {import("./base-model.js").default}
341
219
  */
342
- ApiMakerCollection.prototype.find = function (callback) { return this.loadedArray().find(callback); };
220
+ find(callback) { return this.loadedArray().find(callback); }
343
221
  /**
344
222
  * @param {function(import("./base-model.js").default): void} callback
345
223
  * @returns {void}
346
224
  */
347
- ApiMakerCollection.prototype.forEach = function (callback) { return this.loadedArray().forEach(callback); };
225
+ forEach(callback) { return this.loadedArray().forEach(callback); }
348
226
  /**
349
227
  * @param {function(import("./base-model.js").default): void} callback
350
228
  * @returns {any[]}
351
229
  */
352
- ApiMakerCollection.prototype.map = function (callback) { return this.loadedArray().map(callback); };
230
+ map(callback) { return this.loadedArray().map(callback); }
353
231
  /**
354
232
  * @param {string[]} preloadValue
355
233
  * @returns {this}
356
234
  */
357
- ApiMakerCollection.prototype.preload = function (preloadValue) {
235
+ preload(preloadValue) {
358
236
  return this._merge({ preload: preloadValue });
359
- };
237
+ }
360
238
  /**
361
239
  * @param {number} page
362
240
  * @returns {this}
363
241
  */
364
- ApiMakerCollection.prototype.page = function (page) {
242
+ page(page) {
365
243
  if (!page)
366
244
  page = 1;
367
- return this._merge({ page: page });
368
- };
245
+ return this._merge({ page });
246
+ }
369
247
  /**
370
248
  * @param {string} pageKey
371
249
  * @returns {this}
372
250
  */
373
- ApiMakerCollection.prototype.pageKey = function (pageKey) {
374
- return this._merge({ pageKey: pageKey });
375
- };
251
+ pageKey(pageKey) {
252
+ return this._merge({ pageKey });
253
+ }
376
254
  /**
377
255
  * @returns {boolean}
378
256
  */
379
- ApiMakerCollection.prototype.isFiltered = function () {
380
- var queryArgs = this.queryArgs;
257
+ isFiltered() {
258
+ const { queryArgs } = this;
381
259
  if (queryArgs.accessibleBy ||
382
260
  queryArgs.count ||
383
261
  queryArgs.limit ||
@@ -389,14 +267,14 @@ var ApiMakerCollection = /** @class */ (function () {
389
267
  return true;
390
268
  }
391
269
  return false;
392
- };
270
+ }
393
271
  /**
394
272
  * @returns {Record<string, any>}
395
273
  */
396
- ApiMakerCollection.prototype.params = function () {
397
- var params = {};
274
+ params() {
275
+ let params = {};
398
276
  if (this.queryArgs.params)
399
- params = (0, incorporator_1.incorporate)(params, this.queryArgs.params);
277
+ params = incorporate(params, this.queryArgs.params);
400
278
  if (this.queryArgs.abilities)
401
279
  params.abilities = this.queryArgs.abilities;
402
280
  if (this.queryArgs.accessibleBy)
@@ -424,173 +302,148 @@ var ApiMakerCollection = /** @class */ (function () {
424
302
  if (this.queryArgs.selectColumns)
425
303
  params.select_columns = this.queryArgs.selectColumns;
426
304
  return params;
427
- };
305
+ }
428
306
  /**
429
307
  * @param {number} per
430
308
  * @returns {this}
431
309
  */
432
- ApiMakerCollection.prototype.per = function (per) {
433
- return this._merge({ per: per });
434
- };
310
+ per(per) {
311
+ return this._merge({ per });
312
+ }
435
313
  /**
436
314
  * @param {string} perKey
437
315
  * @returns {this}
438
316
  */
439
- ApiMakerCollection.prototype.perKey = function (perKey) {
440
- return this._merge({ perKey: perKey });
441
- };
317
+ perKey(perKey) {
318
+ return this._merge({ perKey });
319
+ }
442
320
  /**
443
321
  * @param {Record<string, any>} params
444
322
  * @returns {this}
445
323
  */
446
- ApiMakerCollection.prototype.ransack = function (params) {
324
+ ransack(params) {
447
325
  if (params)
448
326
  this._merge({ ransack: params });
449
327
  return this;
450
- };
328
+ }
451
329
  /**
452
330
  * @returns {Promise<Result>}
453
331
  */
454
- ApiMakerCollection.prototype.result = function () {
455
- return __awaiter(this, void 0, void 0, function () {
456
- var response, models, result;
457
- return __generator(this, function (_a) {
458
- switch (_a.label) {
459
- case 0: return [4 /*yield*/, this._response()];
460
- case 1:
461
- response = _a.sent();
462
- models = (0, diggerize_1.digg)(response, "collection");
463
- this._addQueryToModels(models);
464
- result = new result_js_1.default({ collection: this, models: models, response: response });
465
- return [2 /*return*/, result];
466
- }
467
- });
468
- });
469
- };
332
+ async result() {
333
+ const response = await this._response();
334
+ const models = digg(response, "collection");
335
+ this._addQueryToModels(models);
336
+ const result = new Result({ collection: this, models, response });
337
+ return result;
338
+ }
470
339
  /**
471
340
  * @param {Record<string, any>} params
472
341
  * @returns {this}
473
342
  */
474
- ApiMakerCollection.prototype.search = function (params) {
343
+ search(params) {
475
344
  if (params)
476
345
  this._merge({ search: params });
477
346
  return this;
478
- };
347
+ }
479
348
  /**
480
349
  * @param {string} searchKey
481
350
  * @returns {this}
482
351
  */
483
- ApiMakerCollection.prototype.searchKey = function (searchKey) {
484
- return this._merge({ searchKey: searchKey });
485
- };
352
+ searchKey(searchKey) {
353
+ return this._merge({ searchKey });
354
+ }
486
355
  /**
487
356
  * @param {Record<string, string[]>} originalSelect
488
357
  * @returns {this}
489
358
  */
490
- ApiMakerCollection.prototype.select = function (originalSelect) {
491
- var newSelect = {};
492
- for (var originalModelName in originalSelect) {
493
- var newModelName = inflection.underscore(originalModelName);
494
- var newValues = [];
495
- var originalValues = originalSelect[originalModelName];
496
- for (var _i = 0, originalValues_2 = originalValues; _i < originalValues_2.length; _i++) {
497
- var originalAttributeName = originalValues_2[_i];
498
- var newAttributeName = inflection.underscore(originalAttributeName);
359
+ select(originalSelect) {
360
+ const newSelect = {};
361
+ for (const originalModelName in originalSelect) {
362
+ const newModelName = inflection.underscore(originalModelName);
363
+ const newValues = [];
364
+ const originalValues = originalSelect[originalModelName];
365
+ for (const originalAttributeName of originalValues) {
366
+ const newAttributeName = inflection.underscore(originalAttributeName);
499
367
  newValues.push(newAttributeName);
500
368
  }
501
369
  newSelect[newModelName] = newValues;
502
370
  }
503
371
  return this._merge({ select: newSelect });
504
- };
372
+ }
505
373
  /**
506
374
  * @param {Record<string, string[]>} originalSelect
507
375
  * @returns {this}
508
376
  */
509
- ApiMakerCollection.prototype.selectColumns = function (originalSelect) {
510
- var newSelect = {};
511
- for (var originalModelName in originalSelect) {
512
- var newModelName = inflection.underscore(inflection.underscore(originalModelName));
513
- var newValues = [];
514
- var originalValues = originalSelect[originalModelName];
515
- for (var _i = 0, originalValues_3 = originalValues; _i < originalValues_3.length; _i++) {
516
- var originalAttributeName = originalValues_3[_i];
517
- var newAttributeName = inflection.underscore(originalAttributeName);
377
+ selectColumns(originalSelect) {
378
+ const newSelect = {};
379
+ for (const originalModelName in originalSelect) {
380
+ const newModelName = inflection.underscore(inflection.underscore(originalModelName));
381
+ const newValues = [];
382
+ const originalValues = originalSelect[originalModelName];
383
+ for (const originalAttributeName of originalValues) {
384
+ const newAttributeName = inflection.underscore(originalAttributeName);
518
385
  newValues.push(newAttributeName);
519
386
  }
520
387
  newSelect[newModelName] = newValues;
521
388
  }
522
389
  return this._merge({ selectColumns: newSelect });
523
- };
390
+ }
524
391
  /**
525
392
  * @param {string} sortBy
526
393
  * @returns {this}
527
394
  */
528
- ApiMakerCollection.prototype.sort = function (sortBy) {
395
+ sort(sortBy) {
529
396
  return this._merge({ ransack: { s: sortBy } });
530
- };
397
+ }
531
398
  /**
532
399
  * @returns {Promise<Array<ModelOf<MC>>>}
533
400
  */
534
- ApiMakerCollection.prototype.toArray = function () {
535
- return __awaiter(this, void 0, void 0, function () {
536
- var response, models;
537
- return __generator(this, function (_a) {
538
- switch (_a.label) {
539
- case 0: return [4 /*yield*/, this._response()];
540
- case 1:
541
- response = _a.sent();
542
- models = (0, diggerize_1.digg)(response, "collection");
543
- this._addQueryToModels(models);
544
- return [2 /*return*/, models];
545
- }
546
- });
547
- });
548
- };
401
+ async toArray() {
402
+ const response = await this._response();
403
+ const models = digg(response, "collection");
404
+ this._addQueryToModels(models);
405
+ return models;
406
+ }
549
407
  /**
550
408
  * @returns {MC}
551
409
  */
552
- ApiMakerCollection.prototype.modelClass = function () {
410
+ modelClass() {
553
411
  if (!this.args.modelClass) {
554
412
  throw new Error("No model class given in args");
555
413
  }
556
414
  return this.args.modelClass;
557
- };
415
+ }
558
416
  /**
559
417
  * @returns {ApiMakerCollection}
560
418
  */
561
- ApiMakerCollection.prototype.clone = function () {
562
- var clonedQueryArgs = (0, clone_deep_1.default)(this.queryArgs);
419
+ clone() {
420
+ const clonedQueryArgs = cloneDeep(this.queryArgs);
563
421
  return new ApiMakerCollection(this.args, clonedQueryArgs);
564
- };
422
+ }
565
423
  // This is needed when reloading a version of the model with the same selected attributes and preloads
566
- ApiMakerCollection.prototype._addQueryToModels = function (models) {
567
- for (var _i = 0, models_1 = models; _i < models_1.length; _i++) {
568
- var model = models_1[_i];
424
+ _addQueryToModels(models) {
425
+ for (const model of models) {
569
426
  model.collection = this;
570
427
  }
571
- };
572
- ApiMakerCollection.prototype._merge = function (newQueryArgs) {
573
- (0, incorporator_1.incorporate)(this.queryArgs, newQueryArgs);
428
+ }
429
+ _merge(newQueryArgs) {
430
+ incorporate(this.queryArgs, newQueryArgs);
574
431
  return this;
575
- };
576
- ApiMakerCollection.prototype._response = function () {
577
- var _a;
432
+ }
433
+ _response() {
578
434
  if (!this.args)
579
435
  throw new Error("No args?");
580
436
  if (!this.args.modelClass)
581
437
  throw new Error("No modelClass in args");
582
438
  if (!this.args.modelClass.modelClassData)
583
- throw new Error("No modelClassData on modelClass ".concat((_a = this.args.modelClass) === null || _a === void 0 ? void 0 : _a.name, " (").concat(typeof this.args.modelClass, ")"));
584
- var modelClassData = this.args.modelClass.modelClassData();
585
- return commands_pool_js_1.default.addCommand({
439
+ throw new Error(`No modelClassData on modelClass ${this.args.modelClass?.name} (${typeof this.args.modelClass})`);
440
+ const modelClassData = this.args.modelClass.modelClassData();
441
+ return CommandsPool.addCommand({
586
442
  args: this.params(),
587
- command: "".concat(modelClassData.collectionName, "-index"),
443
+ command: `${modelClassData.collectionName}-index`,
588
444
  collectionName: modelClassData.collectionName,
589
445
  type: "index"
590
446
  }, {});
591
- };
592
- ApiMakerCollection.apiMakerType = "Collection";
593
- return ApiMakerCollection;
594
- }());
595
- exports.default = ApiMakerCollection;
447
+ }
448
+ }
596
449
  //# sourceMappingURL=collection.js.map