@kaspernj/api-maker 1.0.2160 → 1.0.2161

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 (524) hide show
  1. package/build/api.d.ts +46 -34
  2. package/build/api.d.ts.map +1 -1
  3. package/build/api.js +32 -25
  4. package/build/attribute-not-loaded-error.d.ts.map +1 -1
  5. package/build/attribute-not-loaded-error.js +2 -1
  6. package/build/base-error.d.ts +49 -60
  7. package/build/base-error.d.ts.map +1 -1
  8. package/build/base-error.js +3 -2
  9. package/build/base-model/column.d.ts +2 -2
  10. package/build/base-model/column.d.ts.map +1 -1
  11. package/build/base-model/column.js +3 -2
  12. package/build/base-model/reflection.d.ts +8 -3
  13. package/build/base-model/reflection.d.ts.map +1 -1
  14. package/build/base-model/reflection.js +8 -3
  15. package/build/base-model/scope.d.ts +1 -1
  16. package/build/base-model/scope.d.ts.map +1 -1
  17. package/build/base-model/scope.js +3 -2
  18. package/build/base-model.d.ts +3801 -117
  19. package/build/base-model.d.ts.map +1 -1
  20. package/build/base-model.js +271 -143
  21. package/build/bootstrap/attribute-row.d.ts +12 -0
  22. package/build/bootstrap/attribute-row.d.ts.map +1 -1
  23. package/build/bootstrap/attribute-row.js +23 -5
  24. package/build/bootstrap/attribute-rows.d.ts +8 -0
  25. package/build/bootstrap/attribute-rows.d.ts.map +1 -1
  26. package/build/bootstrap/attribute-rows.js +14 -5
  27. package/build/bootstrap/card.d.ts +17 -0
  28. package/build/bootstrap/card.d.ts.map +1 -1
  29. package/build/bootstrap/card.js +30 -10
  30. package/build/bootstrap/checkbox.d.ts +16 -0
  31. package/build/bootstrap/checkbox.d.ts.map +1 -1
  32. package/build/bootstrap/checkbox.js +20 -2
  33. package/build/bootstrap/checkboxes.d.ts +31 -0
  34. package/build/bootstrap/checkboxes.d.ts.map +1 -1
  35. package/build/bootstrap/checkboxes.js +35 -3
  36. package/build/bootstrap/index.js +2 -1
  37. package/build/bootstrap/input.d.ts +24 -0
  38. package/build/bootstrap/input.d.ts.map +1 -1
  39. package/build/bootstrap/input.js +27 -2
  40. package/build/bootstrap/invalid-feedback.d.ts.map +1 -1
  41. package/build/bootstrap/invalid-feedback.js +2 -1
  42. package/build/bootstrap/paginate.d.ts +5 -0
  43. package/build/bootstrap/paginate.d.ts.map +1 -1
  44. package/build/bootstrap/paginate.js +9 -4
  45. package/build/bootstrap/radio-buttons.js +2 -1
  46. package/build/bootstrap/select.js +2 -1
  47. package/build/bootstrap/sort-link.d.ts +10 -0
  48. package/build/bootstrap/sort-link.d.ts.map +1 -1
  49. package/build/bootstrap/sort-link.js +15 -4
  50. package/build/cable-connection-pool.d.ts +201 -24
  51. package/build/cable-connection-pool.d.ts.map +1 -1
  52. package/build/cable-connection-pool.js +76 -16
  53. package/build/cable-subscription-pool.d.ts +186 -20
  54. package/build/cable-subscription-pool.d.ts.map +1 -1
  55. package/build/cable-subscription-pool.js +61 -22
  56. package/build/cable-subscription.d.ts.map +1 -1
  57. package/build/cable-subscription.js +3 -2
  58. package/build/cache-key-generator.d.ts +194 -20
  59. package/build/cache-key-generator.d.ts.map +1 -1
  60. package/build/cache-key-generator.js +63 -12
  61. package/build/can-can.d.ts +146 -29
  62. package/build/can-can.d.ts.map +1 -1
  63. package/build/can-can.js +105 -19
  64. package/build/channels-consumer.d.ts +23 -1
  65. package/build/channels-consumer.d.ts.map +1 -1
  66. package/build/channels-consumer.js +26 -8
  67. package/build/collection-loader.js +2 -1
  68. package/build/collection.d.ts +361 -370
  69. package/build/collection.d.ts.map +1 -1
  70. package/build/collection.js +59 -19
  71. package/build/command-execution.d.ts +50 -26
  72. package/build/command-execution.d.ts.map +1 -1
  73. package/build/command-execution.js +31 -13
  74. package/build/command-submit-data.d.ts +50 -37
  75. package/build/command-submit-data.d.ts.map +1 -1
  76. package/build/command-submit-data.js +35 -22
  77. package/build/commands-pool.d.ts +65 -27
  78. package/build/commands-pool.d.ts.map +1 -1
  79. package/build/commands-pool.js +67 -20
  80. package/build/compose.d.ts +8 -2
  81. package/build/compose.d.ts.map +1 -1
  82. package/build/compose.js +9 -2
  83. package/build/config.d.ts +31 -15
  84. package/build/config.d.ts.map +1 -1
  85. package/build/config.js +60 -23
  86. package/build/custom-error.d.ts.map +1 -1
  87. package/build/custom-error.js +2 -1
  88. package/build/data-set-to-attributes.d.ts +14 -2
  89. package/build/data-set-to-attributes.d.ts.map +1 -1
  90. package/build/data-set-to-attributes.js +12 -3
  91. package/build/deserializer.d.ts +116 -2
  92. package/build/deserializer.d.ts.map +1 -1
  93. package/build/deserializer.js +13 -2
  94. package/build/destroy-error.d.ts.map +1 -1
  95. package/build/destroy-error.js +2 -1
  96. package/build/devise.d.ts +638 -39
  97. package/build/devise.d.ts.map +1 -1
  98. package/build/devise.js +97 -28
  99. package/build/draggable-sort/controller.d.ts +126 -35
  100. package/build/draggable-sort/controller.d.ts.map +1 -1
  101. package/build/draggable-sort/controller.js +100 -28
  102. package/build/draggable-sort/index.d.ts +55 -0
  103. package/build/draggable-sort/index.d.ts.map +1 -1
  104. package/build/draggable-sort/index.js +71 -3
  105. package/build/draggable-sort/item.d.ts +54 -0
  106. package/build/draggable-sort/item.d.ts.map +1 -1
  107. package/build/draggable-sort/item.js +94 -6
  108. package/build/error-logger.d.ts +30 -14
  109. package/build/error-logger.d.ts.map +1 -1
  110. package/build/error-logger.js +22 -11
  111. package/build/event-connection.d.ts.map +1 -1
  112. package/build/event-connection.js +3 -2
  113. package/build/event-emitter-listener.d.ts.map +1 -1
  114. package/build/event-emitter-listener.js +2 -1
  115. package/build/event-model-class.d.ts.map +1 -1
  116. package/build/event-model-class.js +2 -1
  117. package/build/events.d.ts.map +1 -1
  118. package/build/events.js +2 -1
  119. package/build/form.d.ts +23 -0
  120. package/build/form.d.ts.map +1 -1
  121. package/build/form.js +16 -4
  122. package/build/history-expo.d.ts +6 -2
  123. package/build/history-expo.d.ts.map +1 -1
  124. package/build/history-expo.js +5 -2
  125. package/build/history-react-native.d.ts +6 -2
  126. package/build/history-react-native.d.ts.map +1 -1
  127. package/build/history-react-native.js +5 -2
  128. package/build/history.js +2 -1
  129. package/build/index.d.ts.map +1 -1
  130. package/build/index.js +2 -1
  131. package/build/inputs/attachment.d.ts +11 -0
  132. package/build/inputs/attachment.d.ts.map +1 -1
  133. package/build/inputs/attachment.js +17 -4
  134. package/build/inputs/auto-submit.d.ts +41 -13
  135. package/build/inputs/auto-submit.d.ts.map +1 -1
  136. package/build/inputs/auto-submit.js +16 -4
  137. package/build/inputs/checkbox.d.ts +15 -0
  138. package/build/inputs/checkbox.d.ts.map +1 -1
  139. package/build/inputs/checkbox.js +22 -6
  140. package/build/inputs/checkboxes.d.ts +16 -0
  141. package/build/inputs/checkboxes.d.ts.map +1 -1
  142. package/build/inputs/checkboxes.js +20 -4
  143. package/build/inputs/id-for-component.d.ts +21 -2
  144. package/build/inputs/id-for-component.d.ts.map +1 -1
  145. package/build/inputs/id-for-component.js +9 -2
  146. package/build/inputs/input-wrapper.d.ts.map +1 -1
  147. package/build/inputs/input-wrapper.js +2 -1
  148. package/build/inputs/input.d.ts +36 -0
  149. package/build/inputs/input.d.ts.map +1 -1
  150. package/build/inputs/input.js +26 -7
  151. package/build/inputs/money.d.ts +2 -0
  152. package/build/inputs/money.d.ts.map +1 -1
  153. package/build/inputs/money.js +6 -3
  154. package/build/inputs/name-for-component.d.ts +21 -2
  155. package/build/inputs/name-for-component.d.ts.map +1 -1
  156. package/build/inputs/name-for-component.js +9 -2
  157. package/build/inputs/select.d.ts +33 -0
  158. package/build/inputs/select.d.ts.map +1 -1
  159. package/build/inputs/select.js +21 -4
  160. package/build/instance-of-class-name.d.ts +7 -2
  161. package/build/instance-of-class-name.d.ts.map +1 -1
  162. package/build/instance-of-class-name.js +8 -4
  163. package/build/is-expo.d.ts.map +1 -1
  164. package/build/is-expo.js +2 -1
  165. package/build/key-value-store.d.ts +24 -14
  166. package/build/key-value-store.d.ts.map +1 -1
  167. package/build/key-value-store.js +22 -12
  168. package/build/link.d.ts +30 -0
  169. package/build/link.d.ts.map +1 -1
  170. package/build/link.js +76 -30
  171. package/build/logger.d.ts +10 -6
  172. package/build/logger.d.ts.map +1 -1
  173. package/build/logger.js +7 -4
  174. package/build/merge-styles.d.ts +10 -2
  175. package/build/merge-styles.d.ts.map +1 -1
  176. package/build/merge-styles.js +10 -3
  177. package/build/modal.d.ts +2 -0
  178. package/build/modal.d.ts.map +1 -1
  179. package/build/modal.js +6 -4
  180. package/build/model-class-require.d.ts +4 -2
  181. package/build/model-class-require.d.ts.map +1 -1
  182. package/build/model-class-require.js +4 -2
  183. package/build/model-events.d.ts +139 -346
  184. package/build/model-events.d.ts.map +1 -1
  185. package/build/model-events.js +21 -9
  186. package/build/model-name.d.ts +21 -7
  187. package/build/model-name.d.ts.map +1 -1
  188. package/build/model-name.js +12 -2
  189. package/build/model-prop-type.d.ts +533 -26
  190. package/build/model-prop-type.d.ts.map +1 -1
  191. package/build/model-prop-type.js +69 -11
  192. package/build/model-recipes-loader.d.ts +7 -3
  193. package/build/model-recipes-loader.d.ts.map +1 -1
  194. package/build/model-recipes-loader.js +4 -2
  195. package/build/model-recipes-model-loader.d.ts +189 -1493
  196. package/build/model-recipes-model-loader.d.ts.map +1 -1
  197. package/build/model-recipes-model-loader.js +119 -17
  198. package/build/models-response-reader.d.ts +600 -195
  199. package/build/models-response-reader.d.ts.map +1 -1
  200. package/build/models-response-reader.js +12 -4
  201. package/build/models.d.ts +438 -1
  202. package/build/models.d.ts.map +1 -1
  203. package/build/models.js +2 -1
  204. package/build/money-formatter.d.ts +25 -31
  205. package/build/money-formatter.d.ts.map +1 -1
  206. package/build/money-formatter.js +11 -8
  207. package/build/not-loaded-error.d.ts.map +1 -1
  208. package/build/not-loaded-error.js +2 -1
  209. package/build/params.d.ts +25 -17
  210. package/build/params.d.ts.map +1 -1
  211. package/build/params.js +19 -15
  212. package/build/preloaded.d.ts +61 -64
  213. package/build/preloaded.d.ts.map +1 -1
  214. package/build/preloaded.js +10 -4
  215. package/build/reset-realtime-runtime-state.d.ts.map +1 -1
  216. package/build/reset-realtime-runtime-state.js +2 -1
  217. package/build/resize-observer.d.ts.map +1 -1
  218. package/build/resize-observer.js +2 -1
  219. package/build/rest-props-validator.d.ts +2 -2
  220. package/build/rest-props-validator.d.ts.map +1 -1
  221. package/build/rest-props-validator.js +3 -2
  222. package/build/result.d.ts +142 -175
  223. package/build/result.d.ts.map +1 -1
  224. package/build/result.js +3 -2
  225. package/build/router/route.d.ts +50 -0
  226. package/build/router/route.d.ts.map +1 -1
  227. package/build/router/route.js +39 -10
  228. package/build/router/switch.d.ts +37 -1
  229. package/build/router/switch.d.ts.map +1 -1
  230. package/build/router/switch.js +29 -7
  231. package/build/router.d.ts +20 -0
  232. package/build/router.d.ts.map +1 -1
  233. package/build/router.js +15 -4
  234. package/build/routes-native.d.ts +13 -13
  235. package/build/routes-native.d.ts.map +1 -1
  236. package/build/routes-native.js +23 -11
  237. package/build/routes.d.ts +17 -9
  238. package/build/routes.d.ts.map +1 -1
  239. package/build/routes.js +7 -2
  240. package/build/run-last.d.ts.map +1 -1
  241. package/build/run-last.js +2 -1
  242. package/build/serializer.d.ts +44 -12
  243. package/build/serializer.d.ts.map +1 -1
  244. package/build/serializer.js +36 -7
  245. package/build/services.d.ts +29 -4
  246. package/build/services.d.ts.map +1 -1
  247. package/build/services.js +16 -4
  248. package/build/session-status-updater.d.ts +73 -25
  249. package/build/session-status-updater.d.ts.map +1 -1
  250. package/build/session-status-updater.js +52 -14
  251. package/build/source-maps-loader.d.ts +88 -33
  252. package/build/source-maps-loader.d.ts.map +1 -1
  253. package/build/source-maps-loader.js +74 -18
  254. package/build/super-admin/config-reader.d.ts.map +1 -1
  255. package/build/super-admin/config-reader.js +11 -16
  256. package/build/super-admin/edit-page/edit-attribute-checkbox.d.ts +10 -0
  257. package/build/super-admin/edit-page/edit-attribute-checkbox.d.ts.map +1 -1
  258. package/build/super-admin/edit-page/edit-attribute-checkbox.js +16 -4
  259. package/build/super-admin/edit-page/edit-attribute-content.d.ts +9 -0
  260. package/build/super-admin/edit-page/edit-attribute-content.d.ts.map +1 -1
  261. package/build/super-admin/edit-page/edit-attribute-content.js +15 -4
  262. package/build/super-admin/edit-page/edit-attribute-input.d.ts +8 -0
  263. package/build/super-admin/edit-page/edit-attribute-input.d.ts.map +1 -1
  264. package/build/super-admin/edit-page/edit-attribute-input.js +13 -4
  265. package/build/super-admin/edit-page/edit-attribute.d.ts +6 -0
  266. package/build/super-admin/edit-page/edit-attribute.d.ts.map +1 -1
  267. package/build/super-admin/edit-page/edit-attribute.js +11 -4
  268. package/build/super-admin/edit-page.d.ts +5 -0
  269. package/build/super-admin/edit-page.d.ts.map +1 -1
  270. package/build/super-admin/edit-page.js +11 -5
  271. package/build/super-admin/has-edit-config.d.ts.map +1 -1
  272. package/build/super-admin/has-edit-config.js +2 -1
  273. package/build/super-admin/index-page.d.ts +4 -0
  274. package/build/super-admin/index-page.d.ts.map +1 -1
  275. package/build/super-admin/index-page.js +9 -4
  276. package/build/super-admin/index.d.ts +4 -0
  277. package/build/super-admin/index.d.ts.map +1 -1
  278. package/build/super-admin/index.js +12 -6
  279. package/build/super-admin/layout/header/index.d.ts +4 -0
  280. package/build/super-admin/layout/header/index.d.ts.map +1 -1
  281. package/build/super-admin/layout/header/index.js +13 -8
  282. package/build/super-admin/layout/index.d.ts +24 -0
  283. package/build/super-admin/layout/index.d.ts.map +1 -1
  284. package/build/super-admin/layout/index.js +33 -5
  285. package/build/super-admin/layout/menu/index.d.ts +2 -0
  286. package/build/super-admin/layout/menu/index.d.ts.map +1 -1
  287. package/build/super-admin/layout/menu/index.js +8 -6
  288. package/build/super-admin/layout/menu/menu-content.d.ts +2 -0
  289. package/build/super-admin/layout/menu/menu-content.d.ts.map +1 -1
  290. package/build/super-admin/layout/menu/menu-content.js +6 -4
  291. package/build/super-admin/layout/menu/menu-item.d.ts +9 -0
  292. package/build/super-admin/layout/menu/menu-item.d.ts.map +1 -1
  293. package/build/super-admin/layout/menu/menu-item.js +15 -4
  294. package/build/super-admin/layout/no-access.d.ts +2 -0
  295. package/build/super-admin/layout/no-access.d.ts.map +1 -1
  296. package/build/super-admin/layout/no-access.js +7 -5
  297. package/build/super-admin/model-class-table.d.ts +4 -0
  298. package/build/super-admin/model-class-table.d.ts.map +1 -1
  299. package/build/super-admin/model-class-table.js +9 -4
  300. package/build/super-admin/models.d.ts.map +1 -1
  301. package/build/super-admin/models.js +2 -1
  302. package/build/super-admin/show-nav.d.ts +2 -0
  303. package/build/super-admin/show-nav.d.ts.map +1 -1
  304. package/build/super-admin/show-nav.js +6 -4
  305. package/build/super-admin/show-page/belongs-to-attribute-row.d.ts +17 -1
  306. package/build/super-admin/show-page/belongs-to-attribute-row.d.ts.map +1 -1
  307. package/build/super-admin/show-page/belongs-to-attribute-row.js +14 -5
  308. package/build/super-admin/show-page/index.d.ts +4 -0
  309. package/build/super-admin/show-page/index.d.ts.map +1 -1
  310. package/build/super-admin/show-page/index.js +9 -4
  311. package/build/super-admin/show-reflection-actions.d.ts +6 -0
  312. package/build/super-admin/show-reflection-actions.d.ts.map +1 -1
  313. package/build/super-admin/show-reflection-actions.js +11 -4
  314. package/build/super-admin/show-reflection-link.d.ts +4 -0
  315. package/build/super-admin/show-reflection-link.d.ts.map +1 -1
  316. package/build/super-admin/show-reflection-link.js +9 -4
  317. package/build/super-admin/show-reflection-page.d.ts +5 -0
  318. package/build/super-admin/show-reflection-page.d.ts.map +1 -1
  319. package/build/super-admin/show-reflection-page.js +10 -4
  320. package/build/table/column-content.d.ts +155 -19
  321. package/build/table/column-content.d.ts.map +1 -1
  322. package/build/table/column-content.js +55 -12
  323. package/build/table/column-identifier.d.ts +11 -2
  324. package/build/table/column-identifier.d.ts.map +1 -1
  325. package/build/table/column-identifier.js +7 -2
  326. package/build/table/column-visible.d.ts +11 -2
  327. package/build/table/column-visible.d.ts.map +1 -1
  328. package/build/table/column-visible.js +8 -2
  329. package/build/table/components/column.d.ts +2 -0
  330. package/build/table/components/column.d.ts.map +1 -1
  331. package/build/table/components/column.js +6 -4
  332. package/build/table/components/flat-list.d.ts +2 -0
  333. package/build/table/components/flat-list.d.ts.map +1 -1
  334. package/build/table/components/flat-list.js +6 -4
  335. package/build/table/components/header.d.ts +2 -0
  336. package/build/table/components/header.d.ts.map +1 -1
  337. package/build/table/components/header.js +6 -4
  338. package/build/table/components/row.d.ts +2 -0
  339. package/build/table/components/row.d.ts.map +1 -1
  340. package/build/table/components/row.js +6 -4
  341. package/build/table/filters/attribute-element.d.ts +2 -0
  342. package/build/table/filters/attribute-element.d.ts.map +1 -1
  343. package/build/table/filters/attribute-element.js +7 -7
  344. package/build/table/filters/filter-form.d.ts +58 -0
  345. package/build/table/filters/filter-form.d.ts.map +1 -1
  346. package/build/table/filters/filter-form.js +72 -9
  347. package/build/table/filters/filter.d.ts +2 -0
  348. package/build/table/filters/filter.d.ts.map +1 -1
  349. package/build/table/filters/filter.js +6 -4
  350. package/build/table/filters/index.d.ts +127 -0
  351. package/build/table/filters/index.d.ts.map +1 -1
  352. package/build/table/filters/index.js +21 -4
  353. package/build/table/filters/load-search-modal.d.ts +130 -0
  354. package/build/table/filters/load-search-modal.d.ts.map +1 -1
  355. package/build/table/filters/load-search-modal.js +28 -6
  356. package/build/table/filters/reflection-element.d.ts +2 -0
  357. package/build/table/filters/reflection-element.d.ts.map +1 -1
  358. package/build/table/filters/reflection-element.js +6 -4
  359. package/build/table/filters/save-search-modal.d.ts +134 -0
  360. package/build/table/filters/save-search-modal.d.ts.map +1 -1
  361. package/build/table/filters/save-search-modal.js +36 -5
  362. package/build/table/filters/scope-element.d.ts +6 -0
  363. package/build/table/filters/scope-element.d.ts.map +1 -1
  364. package/build/table/filters/scope-element.js +13 -8
  365. package/build/table/header-column-content.d.ts +7 -0
  366. package/build/table/header-column-content.d.ts.map +1 -1
  367. package/build/table/header-column-content.js +12 -4
  368. package/build/table/header-column.d.ts +50 -0
  369. package/build/table/header-column.d.ts.map +1 -1
  370. package/build/table/header-column.js +32 -5
  371. package/build/table/header-select.d.ts +18 -0
  372. package/build/table/header-select.d.ts.map +1 -1
  373. package/build/table/header-select.js +19 -4
  374. package/build/table/model-callback-args.d.ts +116 -3
  375. package/build/table/model-callback-args.d.ts.map +1 -1
  376. package/build/table/model-callback-args.js +10 -3
  377. package/build/table/model-column.d.ts +136 -0
  378. package/build/table/model-column.d.ts.map +1 -1
  379. package/build/table/model-column.js +27 -4
  380. package/build/table/model-row.d.ts +19 -0
  381. package/build/table/model-row.d.ts.map +1 -1
  382. package/build/table/model-row.js +24 -4
  383. package/build/table/select-calculator.d.ts +37 -2
  384. package/build/table/select-calculator.d.ts.map +1 -1
  385. package/build/table/select-calculator.js +29 -6
  386. package/build/table/settings/column-row.d.ts +6 -0
  387. package/build/table/settings/column-row.d.ts.map +1 -1
  388. package/build/table/settings/column-row.js +13 -12
  389. package/build/table/settings/download-action.d.ts +5 -0
  390. package/build/table/settings/download-action.d.ts.map +1 -1
  391. package/build/table/settings/download-action.js +10 -4
  392. package/build/table/settings/index.d.ts +5 -0
  393. package/build/table/settings/index.d.ts.map +1 -1
  394. package/build/table/settings/index.js +10 -4
  395. package/build/table/should-render-loading-content.d.ts +2 -2
  396. package/build/table/should-render-loading-content.d.ts.map +1 -1
  397. package/build/table/should-render-loading-content.js +3 -2
  398. package/build/table/table-settings.d.ts +236 -43
  399. package/build/table/table-settings.d.ts.map +1 -1
  400. package/build/table/table-settings.js +104 -20
  401. package/build/table/table.d.ts +271 -0
  402. package/build/table/table.d.ts.map +1 -1
  403. package/build/table/table.js +167 -16
  404. package/build/table/use-sorting.d.ts +10 -8
  405. package/build/table/use-sorting.d.ts.map +1 -1
  406. package/build/table/use-sorting.js +16 -8
  407. package/build/table/widths.d.ts +55 -8
  408. package/build/table/widths.d.ts.map +1 -1
  409. package/build/table/widths.js +25 -2
  410. package/build/table/worker-plugins-check-all-checkbox.d.ts +18 -0
  411. package/build/table/worker-plugins-check-all-checkbox.d.ts.map +1 -1
  412. package/build/table/worker-plugins-check-all-checkbox.js +25 -5
  413. package/build/table/worker-plugins-checkbox.d.ts +5 -0
  414. package/build/table/worker-plugins-checkbox.d.ts.map +1 -1
  415. package/build/table/worker-plugins-checkbox.js +10 -4
  416. package/build/translated-attributes.d.ts +7 -2
  417. package/build/translated-attributes.d.ts.map +1 -1
  418. package/build/translated-attributes.js +8 -2
  419. package/build/translated-collections.d.ts +11 -2
  420. package/build/translated-collections.d.ts.map +1 -1
  421. package/build/translated-collections.js +9 -3
  422. package/build/updated-attribute.d.ts.map +1 -1
  423. package/build/updated-attribute.js +2 -1
  424. package/build/url-encode.d.ts.map +1 -1
  425. package/build/url-encode.js +2 -1
  426. package/build/use-can-can.d.ts +2 -2
  427. package/build/use-can-can.d.ts.map +1 -1
  428. package/build/use-can-can.js +27 -12
  429. package/build/use-collection.d.ts +167 -121
  430. package/build/use-collection.d.ts.map +1 -1
  431. package/build/use-collection.js +113 -44
  432. package/build/use-created-event.d.ts +120 -11
  433. package/build/use-created-event.d.ts.map +1 -1
  434. package/build/use-created-event.js +10 -7
  435. package/build/use-current-user-context.d.ts +2 -2
  436. package/build/use-current-user-context.d.ts.map +1 -1
  437. package/build/use-current-user-context.js +3 -2
  438. package/build/use-current-user.d.ts +86 -70
  439. package/build/use-current-user.d.ts.map +1 -1
  440. package/build/use-current-user.js +36 -8
  441. package/build/use-destroyed-event.d.ts +117 -8
  442. package/build/use-destroyed-event.d.ts.map +1 -1
  443. package/build/use-destroyed-event.js +29 -22
  444. package/build/use-input.d.ts +74 -12
  445. package/build/use-input.d.ts.map +1 -1
  446. package/build/use-input.js +33 -5
  447. package/build/use-model-class-event.d.ts +124 -10
  448. package/build/use-model-class-event.d.ts.map +1 -1
  449. package/build/use-model-class-event.js +26 -16
  450. package/build/use-model-event.d.ts +121 -8
  451. package/build/use-model-event.d.ts.map +1 -1
  452. package/build/use-model-event.js +24 -19
  453. package/build/use-model.d.ts +162 -244
  454. package/build/use-model.d.ts.map +1 -1
  455. package/build/use-model.js +85 -32
  456. package/build/use-resize-observer.d.ts.map +1 -1
  457. package/build/use-resize-observer.js +2 -1
  458. package/build/use-router.d.ts.map +1 -1
  459. package/build/use-router.js +2 -1
  460. package/build/use-screen-layout.d.ts +7 -2
  461. package/build/use-screen-layout.d.ts.map +1 -1
  462. package/build/use-screen-layout.js +8 -5
  463. package/build/use-shape.js +2 -1
  464. package/build/use-styles.d.ts +11 -5
  465. package/build/use-styles.d.ts.map +1 -1
  466. package/build/use-styles.js +16 -9
  467. package/build/use-updated-event.d.ts +66 -182
  468. package/build/use-updated-event.d.ts.map +1 -1
  469. package/build/use-updated-event.js +22 -18
  470. package/build/use-validation-errors.d.ts.map +1 -1
  471. package/build/use-validation-errors.js +2 -1
  472. package/build/utils/button.d.ts +14 -0
  473. package/build/utils/button.d.ts.map +1 -1
  474. package/build/utils/button.js +24 -7
  475. package/build/utils/card.d.ts +9 -0
  476. package/build/utils/card.d.ts.map +1 -1
  477. package/build/utils/card.js +13 -2
  478. package/build/utils/checkbox.d.ts +12 -0
  479. package/build/utils/checkbox.d.ts.map +1 -1
  480. package/build/utils/checkbox.js +18 -4
  481. package/build/utils/checkboxes.d.ts +25 -0
  482. package/build/utils/checkboxes.d.ts.map +1 -1
  483. package/build/utils/checkboxes.js +29 -3
  484. package/build/utils/default-style.d.ts +10 -4
  485. package/build/utils/default-style.d.ts.map +1 -1
  486. package/build/utils/default-style.js +12 -4
  487. package/build/utils/header.d.ts +6 -1
  488. package/build/utils/header.d.ts.map +1 -1
  489. package/build/utils/header.js +4 -2
  490. package/build/utils/icon.d.ts +7 -6
  491. package/build/utils/icon.d.ts.map +1 -1
  492. package/build/utils/icon.js +12 -11
  493. package/build/utils/invalid-feedback.d.ts +4 -0
  494. package/build/utils/invalid-feedback.d.ts.map +1 -1
  495. package/build/utils/invalid-feedback.js +8 -2
  496. package/build/utils/modal.d.ts +2 -0
  497. package/build/utils/modal.d.ts.map +1 -1
  498. package/build/utils/modal.js +9 -7
  499. package/build/utils/text.d.ts +8 -1
  500. package/build/utils/text.d.ts.map +1 -1
  501. package/build/utils/text.js +9 -2
  502. package/build/validation-error.d.ts +5 -2
  503. package/build/validation-error.d.ts.map +1 -1
  504. package/build/validation-error.js +5 -2
  505. package/build/validation-errors.d.ts +57 -15
  506. package/build/validation-errors.d.ts.map +1 -1
  507. package/build/validation-errors.js +37 -8
  508. package/build/websocket-request-client.d.ts +61 -15
  509. package/build/websocket-request-client.d.ts.map +1 -1
  510. package/build/websocket-request-client.js +35 -9
  511. package/build/with-api-maker.d.ts.map +1 -1
  512. package/build/with-api-maker.js +2 -1
  513. package/build/with-collection.d.ts.map +1 -1
  514. package/build/with-collection.js +2 -1
  515. package/build/with-current-user.d.ts.map +1 -1
  516. package/build/with-current-user.js +2 -1
  517. package/build/with-model.d.ts.map +1 -1
  518. package/build/with-model.js +2 -1
  519. package/build/with-router.d.ts.map +1 -1
  520. package/build/with-router.js +2 -1
  521. package/package.json +4 -3
  522. package/build/base-component.d.ts +0 -5
  523. package/build/base-component.d.ts.map +0 -1
  524. package/build/base-component.js +0 -4
@@ -1,4 +1,609 @@
1
1
  export default BaseModel;
2
+ export type ModelIdentifier = string | number;
3
+ export type ModelScalarValue = string | number | boolean | null | undefined | Date | File | Blob;
4
+ export type ModelValueMap = {
5
+ [key: string]: ModelValue;
6
+ };
7
+ export type ModelValueArray = Array<ModelValue>;
8
+ export type ModelValue = ModelScalarValue | ModelValueMap | ModelValueArray;
9
+ export type ModelDataMap = Record<string, ModelValue>;
10
+ export type ModelAbilityMap = Record<string, boolean>;
11
+ export type PreloadedRelationshipValue = ModelIdentifier | ModelIdentifier[] | null;
12
+ export type PreloadedRelationshipMap = Record<string, PreloadedRelationshipValue>;
13
+ export type LoadedRelationshipValue = {
14
+ abilities: ModelAbilityMap;
15
+ changes: ModelDataMap;
16
+ collection: Collection<any>;
17
+ _identifierKey: string | number;
18
+ _markedForDestruction: boolean;
19
+ modelData: ModelDataMap;
20
+ newRecord: boolean;
21
+ previousModelData: any;
22
+ preloadedRelationships: PreloadedRelationshipMap;
23
+ relationshipsCache: LoadedRelationshipMap;
24
+ relationships: LoadedRelationshipMap;
25
+ uniqueKeyValue: number;
26
+ /**
27
+ * @param {ModelDataMap} newAttributes
28
+ * @returns {void}
29
+ */
30
+ assignAttributes(newAttributes: ModelDataMap): void;
31
+ /** @returns {ModelDataMap} */
32
+ attributes(): ModelDataMap;
33
+ /**
34
+ * @param {string} givenAbilityName
35
+ * @returns {boolean}
36
+ */
37
+ can(givenAbilityName: string): boolean;
38
+ /** @returns {BaseModel} */
39
+ clone(): /*elided*/ any;
40
+ /** @returns {number | string} */
41
+ cacheKey(): number | string;
42
+ /** @returns {string} */
43
+ localCacheKey(): string;
44
+ /** @returns {string} */
45
+ fullCacheKey(): string;
46
+ /**
47
+ * @param {ModelDataMap} [attributes]
48
+ * @param {ParseValidationErrorsOptions} [options]
49
+ * @returns {Promise<{
50
+ * model: BaseModel,
51
+ * response: ModelCommandResponse
52
+ * }>}
53
+ */
54
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
55
+ model: /*elided*/ any;
56
+ response: ModelCommandResponse;
57
+ }>;
58
+ /**
59
+ * @param {RawDataInput} rawData
60
+ * @param {ParseValidationErrorsOptions} [options]
61
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
62
+ */
63
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
64
+ model: /*elided*/ any;
65
+ response: ModelCommandResponse;
66
+ }>;
67
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
68
+ destroy(): Promise<{
69
+ model: /*elided*/ any;
70
+ response: ModelCommandResponse;
71
+ }>;
72
+ /**
73
+ * @param {string[]} listOfAbilities
74
+ * @returns {Promise<void>}
75
+ */
76
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
77
+ /** @returns {ModelDataMap} */
78
+ getAttributes(): ModelDataMap;
79
+ /**
80
+ * @param {ModelCommandResponse} response
81
+ * @returns {never}
82
+ */
83
+ handleResponseError(response: ModelCommandResponse): never;
84
+ /** @returns {number | string} */
85
+ identifierKey(): number | string;
86
+ /**
87
+ * @param {string} associationName
88
+ * @returns {boolean}
89
+ */
90
+ isAssociationLoaded(associationName: string): boolean;
91
+ /**
92
+ * @param {string} associationNameUnderscore
93
+ * @returns {boolean}
94
+ */
95
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
96
+ /**
97
+ * @param {string} associationName
98
+ * @returns {boolean}
99
+ */
100
+ isAssociationPresent(associationName: string): boolean;
101
+ /**
102
+ * @param {string} associationName
103
+ * @returns {Promise<LoadedRelationshipValue>}
104
+ */
105
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
106
+ /**
107
+ * @param {string} associationNameUnderscore
108
+ * @returns {Promise<LoadedRelationshipValue>}
109
+ */
110
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
111
+ /**
112
+ * @param {string} attributeName
113
+ * @returns {boolean}
114
+ */
115
+ isAttributeChanged(attributeName: string): boolean;
116
+ /** @returns {boolean} */
117
+ isChanged(): boolean;
118
+ /** @returns {boolean} */
119
+ isNewRecord(): boolean;
120
+ /** @returns {boolean} */
121
+ isPersisted(): boolean;
122
+ /**
123
+ * @param {string} attributeName
124
+ * @returns {boolean}
125
+ */
126
+ savedChangeToAttribute(attributeName: string): boolean;
127
+ /**
128
+ * @param {BaseModel} model
129
+ * @returns {void}
130
+ */
131
+ setNewModel(model: /*elided*/ any): void;
132
+ /**
133
+ * @param {BaseModel} model
134
+ * @returns {void}
135
+ */
136
+ setNewModelData(model: /*elided*/ any): void;
137
+ /**
138
+ * @param {ModelValue | null | undefined} oldValue
139
+ * @param {ModelValue | null | undefined} newValue
140
+ * @returns {boolean | void}
141
+ */
142
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
143
+ /**
144
+ * @param {ModelValue | null | undefined} oldValue
145
+ * @param {ModelValue | null | undefined} newValue
146
+ * @returns {boolean | void}
147
+ */
148
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
149
+ /**
150
+ * @param {ModelValue | null | undefined} oldValue
151
+ * @param {ModelValue | null | undefined} newValue
152
+ * @returns {boolean | void}
153
+ */
154
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
155
+ /** @returns {ModelClassDataType} */
156
+ modelClassData(): ModelClassDataType;
157
+ /** @returns {Promise<void>} */
158
+ reload(): Promise<void>;
159
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
160
+ save(): Promise<{
161
+ model: /*elided*/ any;
162
+ response?: object;
163
+ }>;
164
+ /**
165
+ * @param {RawDataInput} rawData
166
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
167
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
168
+ */
169
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
170
+ simpleModelErrors?: boolean;
171
+ }): Promise<{
172
+ model: /*elided*/ any;
173
+ response: ModelCommandResponse;
174
+ }>;
175
+ /**
176
+ * @param {ModelDataMap} [newAttributes]
177
+ * @param {ParseValidationErrorsOptions} [options]
178
+ * @returns {Promise<{
179
+ * model: BaseModel,
180
+ * response?: object
181
+ * }>}
182
+ */
183
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
184
+ model: /*elided*/ any;
185
+ response?: object;
186
+ }>;
187
+ /**
188
+ * @param {ModelCommandResponse} response
189
+ * @returns {void}
190
+ */
191
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
192
+ /**
193
+ * @param {ModelCommandResponse} response
194
+ * @returns {void}
195
+ */
196
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
197
+ /**
198
+ * @param {RawDataInput} rawData
199
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
200
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
201
+ */
202
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
203
+ simpleModelErrors?: boolean;
204
+ }): Promise<{
205
+ response: ModelCommandResponse;
206
+ model: /*elided*/ any;
207
+ }>;
208
+ /** @returns {never} */
209
+ isValid(): never;
210
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
211
+ isValidOnServer(): Promise<{
212
+ valid: boolean;
213
+ errors: ValidationResponseErrors;
214
+ }>;
215
+ /** @returns {BaseModelClassType} */
216
+ modelClass(): BaseModelClassType;
217
+ /**
218
+ * @param {string} relationshipName
219
+ * @param {BaseModel | BaseModel[] | null} model
220
+ * @returns {void}
221
+ */
222
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
223
+ /** @returns {void} */
224
+ markForDestruction(): void;
225
+ /** @returns {boolean} */
226
+ markedForDestruction(): boolean;
227
+ /** @returns {number} */
228
+ uniqueKey(): number;
229
+ /**
230
+ * @param {ModelCommandDescriptor} args
231
+ * @param {ModelCommandOptions} commandArgs
232
+ * @returns {import("./command-execution.js").default}
233
+ */
234
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
235
+ /**
236
+ * @param {string} attributeName
237
+ * @returns {ModelValue | null | undefined}
238
+ */
239
+ readAttribute(attributeName: string): ModelValue | null | undefined;
240
+ /**
241
+ * @param {string} attributeName
242
+ * @returns {ModelValue | null | undefined}
243
+ */
244
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
245
+ /**
246
+ * @param {string} attributeName
247
+ * @returns {boolean}
248
+ */
249
+ isAttributeLoaded(attributeName: string): boolean;
250
+ /**
251
+ * @param {ModelValue | null | undefined} value
252
+ * @returns {boolean}
253
+ */
254
+ _isPresent(value: ModelValue | null | undefined): boolean;
255
+ /**
256
+ *
257
+ * @param {RelationshipLoadArgs} args
258
+ * @param {import("./collection.js").QueryArgsType} queryArgs
259
+ * @returns {Promise<BaseModel | null>}
260
+ */
261
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
262
+ /**
263
+ *
264
+ * @param {RelationshipLoadArgs} args
265
+ * @returns {BaseModel | null}
266
+ */
267
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
268
+ /**
269
+ *
270
+ * @param {RelationshipLoadArgs} args
271
+ * @param {import("./collection.js").QueryArgsType} queryArgs
272
+ * @returns {Promise<BaseModel[]>}
273
+ */
274
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
275
+ /**
276
+ *
277
+ * @param {RelationshipLoadArgs} args
278
+ * @param {import("./collection.js").QueryArgsType} queryArgs
279
+ * @returns {Promise<BaseModel | null>}
280
+ */
281
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
282
+ /**
283
+ *
284
+ * @param {RelationshipLoadArgs} args
285
+ * @returns {BaseModel | null}
286
+ */
287
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
288
+ /**
289
+ * @param {BaseModelArgsObject} [args]
290
+ * @returns {void}
291
+ */
292
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
293
+ /**
294
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
295
+ * @returns {void}
296
+ */
297
+ _readPreloadedRelationships(preloaded: {
298
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
299
+ }): void;
300
+ /** @returns {number | string} */
301
+ primaryKey(): number | string;
302
+ } | {
303
+ abilities: ModelAbilityMap;
304
+ changes: ModelDataMap;
305
+ collection: Collection<any>;
306
+ _identifierKey: string | number;
307
+ _markedForDestruction: boolean;
308
+ modelData: ModelDataMap;
309
+ newRecord: boolean;
310
+ previousModelData: any;
311
+ preloadedRelationships: PreloadedRelationshipMap;
312
+ relationshipsCache: LoadedRelationshipMap;
313
+ relationships: LoadedRelationshipMap;
314
+ uniqueKeyValue: number;
315
+ /**
316
+ * @param {ModelDataMap} newAttributes
317
+ * @returns {void}
318
+ */
319
+ assignAttributes(newAttributes: ModelDataMap): void;
320
+ /** @returns {ModelDataMap} */
321
+ attributes(): ModelDataMap;
322
+ /**
323
+ * @param {string} givenAbilityName
324
+ * @returns {boolean}
325
+ */
326
+ can(givenAbilityName: string): boolean;
327
+ /** @returns {BaseModel} */
328
+ clone(): /*elided*/ any;
329
+ /** @returns {number | string} */
330
+ cacheKey(): number | string;
331
+ /** @returns {string} */
332
+ localCacheKey(): string;
333
+ /** @returns {string} */
334
+ fullCacheKey(): string;
335
+ /**
336
+ * @param {ModelDataMap} [attributes]
337
+ * @param {ParseValidationErrorsOptions} [options]
338
+ * @returns {Promise<{
339
+ * model: BaseModel,
340
+ * response: ModelCommandResponse
341
+ * }>}
342
+ */
343
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
344
+ model: /*elided*/ any;
345
+ response: ModelCommandResponse;
346
+ }>;
347
+ /**
348
+ * @param {RawDataInput} rawData
349
+ * @param {ParseValidationErrorsOptions} [options]
350
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
351
+ */
352
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
353
+ model: /*elided*/ any;
354
+ response: ModelCommandResponse;
355
+ }>;
356
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
357
+ destroy(): Promise<{
358
+ model: /*elided*/ any;
359
+ response: ModelCommandResponse;
360
+ }>;
361
+ /**
362
+ * @param {string[]} listOfAbilities
363
+ * @returns {Promise<void>}
364
+ */
365
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
366
+ /** @returns {ModelDataMap} */
367
+ getAttributes(): ModelDataMap;
368
+ /**
369
+ * @param {ModelCommandResponse} response
370
+ * @returns {never}
371
+ */
372
+ handleResponseError(response: ModelCommandResponse): never;
373
+ /** @returns {number | string} */
374
+ identifierKey(): number | string;
375
+ /**
376
+ * @param {string} associationName
377
+ * @returns {boolean}
378
+ */
379
+ isAssociationLoaded(associationName: string): boolean;
380
+ /**
381
+ * @param {string} associationNameUnderscore
382
+ * @returns {boolean}
383
+ */
384
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
385
+ /**
386
+ * @param {string} associationName
387
+ * @returns {boolean}
388
+ */
389
+ isAssociationPresent(associationName: string): boolean;
390
+ /**
391
+ * @param {string} associationName
392
+ * @returns {Promise<LoadedRelationshipValue>}
393
+ */
394
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
395
+ /**
396
+ * @param {string} associationNameUnderscore
397
+ * @returns {Promise<LoadedRelationshipValue>}
398
+ */
399
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
400
+ /**
401
+ * @param {string} attributeName
402
+ * @returns {boolean}
403
+ */
404
+ isAttributeChanged(attributeName: string): boolean;
405
+ /** @returns {boolean} */
406
+ isChanged(): boolean;
407
+ /** @returns {boolean} */
408
+ isNewRecord(): boolean;
409
+ /** @returns {boolean} */
410
+ isPersisted(): boolean;
411
+ /**
412
+ * @param {string} attributeName
413
+ * @returns {boolean}
414
+ */
415
+ savedChangeToAttribute(attributeName: string): boolean;
416
+ /**
417
+ * @param {BaseModel} model
418
+ * @returns {void}
419
+ */
420
+ setNewModel(model: /*elided*/ any): void;
421
+ /**
422
+ * @param {BaseModel} model
423
+ * @returns {void}
424
+ */
425
+ setNewModelData(model: /*elided*/ any): void;
426
+ /**
427
+ * @param {ModelValue | null | undefined} oldValue
428
+ * @param {ModelValue | null | undefined} newValue
429
+ * @returns {boolean | void}
430
+ */
431
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
432
+ /**
433
+ * @param {ModelValue | null | undefined} oldValue
434
+ * @param {ModelValue | null | undefined} newValue
435
+ * @returns {boolean | void}
436
+ */
437
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
438
+ /**
439
+ * @param {ModelValue | null | undefined} oldValue
440
+ * @param {ModelValue | null | undefined} newValue
441
+ * @returns {boolean | void}
442
+ */
443
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
444
+ /** @returns {ModelClassDataType} */
445
+ modelClassData(): ModelClassDataType;
446
+ /** @returns {Promise<void>} */
447
+ reload(): Promise<void>;
448
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
449
+ save(): Promise<{
450
+ model: /*elided*/ any;
451
+ response?: object;
452
+ }>;
453
+ /**
454
+ * @param {RawDataInput} rawData
455
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
456
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
457
+ */
458
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
459
+ simpleModelErrors?: boolean;
460
+ }): Promise<{
461
+ model: /*elided*/ any;
462
+ response: ModelCommandResponse;
463
+ }>;
464
+ /**
465
+ * @param {ModelDataMap} [newAttributes]
466
+ * @param {ParseValidationErrorsOptions} [options]
467
+ * @returns {Promise<{
468
+ * model: BaseModel,
469
+ * response?: object
470
+ * }>}
471
+ */
472
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
473
+ model: /*elided*/ any;
474
+ response?: object;
475
+ }>;
476
+ /**
477
+ * @param {ModelCommandResponse} response
478
+ * @returns {void}
479
+ */
480
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
481
+ /**
482
+ * @param {ModelCommandResponse} response
483
+ * @returns {void}
484
+ */
485
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
486
+ /**
487
+ * @param {RawDataInput} rawData
488
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
489
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
490
+ */
491
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
492
+ simpleModelErrors?: boolean;
493
+ }): Promise<{
494
+ response: ModelCommandResponse;
495
+ model: /*elided*/ any;
496
+ }>;
497
+ /** @returns {never} */
498
+ isValid(): never;
499
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
500
+ isValidOnServer(): Promise<{
501
+ valid: boolean;
502
+ errors: ValidationResponseErrors;
503
+ }>;
504
+ /** @returns {BaseModelClassType} */
505
+ modelClass(): BaseModelClassType;
506
+ /**
507
+ * @param {string} relationshipName
508
+ * @param {BaseModel | BaseModel[] | null} model
509
+ * @returns {void}
510
+ */
511
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
512
+ /** @returns {void} */
513
+ markForDestruction(): void;
514
+ /** @returns {boolean} */
515
+ markedForDestruction(): boolean;
516
+ /** @returns {number} */
517
+ uniqueKey(): number;
518
+ /**
519
+ * @param {ModelCommandDescriptor} args
520
+ * @param {ModelCommandOptions} commandArgs
521
+ * @returns {import("./command-execution.js").default}
522
+ */
523
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
524
+ /**
525
+ * @param {string} attributeName
526
+ * @returns {ModelValue | null | undefined}
527
+ */
528
+ readAttribute(attributeName: string): ModelValue | null | undefined;
529
+ /**
530
+ * @param {string} attributeName
531
+ * @returns {ModelValue | null | undefined}
532
+ */
533
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
534
+ /**
535
+ * @param {string} attributeName
536
+ * @returns {boolean}
537
+ */
538
+ isAttributeLoaded(attributeName: string): boolean;
539
+ /**
540
+ * @param {ModelValue | null | undefined} value
541
+ * @returns {boolean}
542
+ */
543
+ _isPresent(value: ModelValue | null | undefined): boolean;
544
+ /**
545
+ *
546
+ * @param {RelationshipLoadArgs} args
547
+ * @param {import("./collection.js").QueryArgsType} queryArgs
548
+ * @returns {Promise<BaseModel | null>}
549
+ */
550
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
551
+ /**
552
+ *
553
+ * @param {RelationshipLoadArgs} args
554
+ * @returns {BaseModel | null}
555
+ */
556
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
557
+ /**
558
+ *
559
+ * @param {RelationshipLoadArgs} args
560
+ * @param {import("./collection.js").QueryArgsType} queryArgs
561
+ * @returns {Promise<BaseModel[]>}
562
+ */
563
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
564
+ /**
565
+ *
566
+ * @param {RelationshipLoadArgs} args
567
+ * @param {import("./collection.js").QueryArgsType} queryArgs
568
+ * @returns {Promise<BaseModel | null>}
569
+ */
570
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
571
+ /**
572
+ *
573
+ * @param {RelationshipLoadArgs} args
574
+ * @returns {BaseModel | null}
575
+ */
576
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
577
+ /**
578
+ * @param {BaseModelArgsObject} [args]
579
+ * @returns {void}
580
+ */
581
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
582
+ /**
583
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
584
+ * @returns {void}
585
+ */
586
+ _readPreloadedRelationships(preloaded: {
587
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
588
+ }): void;
589
+ /** @returns {number | string} */
590
+ primaryKey(): number | string;
591
+ }[] | null;
592
+ export type LoadedRelationshipMap = Record<string, LoadedRelationshipValue>;
593
+ export type ReflectionMacro = import("./base-model/reflection.js").ReflectionMacro;
594
+ export type RawDataInput = FormData | HTMLFormElement | ModelDataMap;
595
+ export type ValidationResponseErrors = Record<string, string | string[] | undefined>;
596
+ export type RelationshipDataType = {
597
+ collectionName: string;
598
+ foreignKey?: string;
599
+ macro: ReflectionMacro;
600
+ name: string;
601
+ resource_name: string;
602
+ through?: string;
603
+ };
604
+ export type ScopeDataType = {
605
+ name: string;
606
+ };
2
607
  export type ModelClassDataType = {
3
608
  attributes: Record<string, import("./base-model/attribute.js").AttributeArgType>;
4
609
  camelizedLower: string;
@@ -11,30 +616,52 @@ export type ModelClassDataType = {
11
616
  paramKey: string;
12
617
  pluralName: string;
13
618
  primaryKey: string;
14
- ransackable_associations: Array<Record<string, any>>;
619
+ ransackable_associations: RelationshipDataType[];
15
620
  ransackable_attributes: import("./base-model/attribute.js").AttributeArgType[];
16
- ransackable_scopes: Array<Record<string, any>>;
17
- relationships: Array<Record<string, any>>;
621
+ ransackable_scopes: ScopeDataType[];
622
+ relationships: RelationshipDataType[];
18
623
  };
19
624
  export type ParseValidationErrorsOptions = {
20
- form?: object;
625
+ form?: HTMLFormElement;
21
626
  throwValidationError?: boolean;
22
627
  };
23
- export type BaseModelClassType = {
24
- new (...args: Array<any>): {
25
- changes: {};
628
+ export type LoadedModelDataType = {
629
+ a?: ModelDataMap;
630
+ b?: ModelAbilityMap;
631
+ r?: PreloadedRelationshipMap;
632
+ };
633
+ export type BaseModelArgsObject = {
634
+ a?: ModelDataMap;
635
+ b?: ModelAbilityMap;
636
+ collection?: Collection<any>;
637
+ data?: LoadedModelDataType;
638
+ isNewRecord?: boolean;
639
+ };
640
+ export type BaseModelArgs = BaseModelArgsObject | ModelDataMap;
641
+ export type BaseModelStaticMethods = {
642
+ apiMakerType: string;
643
+ all: () => Collection<any>;
644
+ attributes: () => Attribute[];
645
+ find: (id: ModelIdentifier) => Promise<{
646
+ abilities: ModelAbilityMap;
647
+ changes: ModelDataMap;
648
+ collection: Collection<any>;
649
+ _identifierKey: string | number;
650
+ _markedForDestruction: boolean;
651
+ modelData: ModelDataMap;
26
652
  newRecord: boolean;
27
- relationshipsCache: {};
28
- relationships: {};
29
- abilities: Record<string, any>;
30
- modelData: {};
653
+ previousModelData: any;
654
+ preloadedRelationships: PreloadedRelationshipMap;
655
+ relationshipsCache: LoadedRelationshipMap;
656
+ relationships: LoadedRelationshipMap;
657
+ uniqueKeyValue: number;
31
658
  /**
32
- * @param {Record<string, any>} newAttributes
659
+ * @param {ModelDataMap} newAttributes
33
660
  * @returns {void}
34
661
  */
35
- assignAttributes(newAttributes: Record<string, any>): void;
36
- /** @returns {Record<string, any>} */
37
- attributes(): Record<string, any>;
662
+ assignAttributes(newAttributes: ModelDataMap): void;
663
+ /** @returns {ModelDataMap} */
664
+ attributes(): ModelDataMap;
38
665
  /**
39
666
  * @param {string} givenAbilityName
40
667
  * @returns {boolean}
@@ -49,45 +676,45 @@ export type BaseModelClassType = {
49
676
  /** @returns {string} */
50
677
  fullCacheKey(): string;
51
678
  /**
52
- * @param {Record<string, any>} [attributes]
53
- * @param {object} [options]
679
+ * @param {ModelDataMap} [attributes]
680
+ * @param {ParseValidationErrorsOptions} [options]
54
681
  * @returns {Promise<{
55
682
  * model: BaseModel,
56
- * response: object
683
+ * response: ModelCommandResponse
57
684
  * }>}
58
685
  */
59
- create(attributes?: Record<string, any>, options?: object): Promise<{
686
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
60
687
  model: /*elided*/ any;
61
- response: object;
688
+ response: ModelCommandResponse;
62
689
  }>;
63
690
  /**
64
- * @param {FormData | Record<string, any>} rawData
65
- * @param {object} [options]
691
+ * @param {RawDataInput} rawData
692
+ * @param {ParseValidationErrorsOptions} [options]
693
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
66
694
  */
67
- createRaw(rawData: FormData | Record<string, any>, options?: object): Promise<{
695
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
68
696
  model: /*elided*/ any;
69
- response: any;
697
+ response: ModelCommandResponse;
70
698
  }>;
71
- /** @returns {Promise<{model: BaseModel, response: object}>} */
699
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
72
700
  destroy(): Promise<{
73
701
  model: /*elided*/ any;
74
- response: object;
702
+ response: ModelCommandResponse;
75
703
  }>;
76
704
  /**
77
705
  * @param {string[]} listOfAbilities
78
706
  * @returns {Promise<void>}
79
707
  */
80
708
  ensureAbilities(listOfAbilities: string[]): Promise<void>;
81
- /** @returns {Record<string, any>} */
82
- getAttributes(): Record<string, any>;
709
+ /** @returns {ModelDataMap} */
710
+ getAttributes(): ModelDataMap;
83
711
  /**
84
- * @param {object} response
712
+ * @param {ModelCommandResponse} response
85
713
  * @returns {never}
86
714
  */
87
- handleResponseError(response: object): never;
715
+ handleResponseError(response: ModelCommandResponse): never;
88
716
  /** @returns {number | string} */
89
717
  identifierKey(): number | string;
90
- _identifierKey: string | number;
91
718
  /**
92
719
  * @param {string} associationName
93
720
  * @returns {boolean}
@@ -105,14 +732,14 @@ export type BaseModelClassType = {
105
732
  isAssociationPresent(associationName: string): boolean;
106
733
  /**
107
734
  * @param {string} associationName
108
- * @returns {Promise<any>}
735
+ * @returns {Promise<LoadedRelationshipValue>}
109
736
  */
110
- ensureAssociationLoaded(associationName: string): Promise<any>;
737
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
111
738
  /**
112
739
  * @param {string} associationNameUnderscore
113
- * @returns {Promise<any>}
740
+ * @returns {Promise<LoadedRelationshipValue>}
114
741
  */
115
- ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<any>;
742
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
116
743
  /**
117
744
  * @param {string} attributeName
118
745
  * @returns {boolean}
@@ -139,25 +766,24 @@ export type BaseModelClassType = {
139
766
  * @returns {void}
140
767
  */
141
768
  setNewModelData(model: /*elided*/ any): void;
142
- previousModelData: any;
143
769
  /**
144
- * @param {any} oldValue
145
- * @param {any} newValue
770
+ * @param {ModelValue | null | undefined} oldValue
771
+ * @param {ModelValue | null | undefined} newValue
146
772
  * @returns {boolean | void}
147
773
  */
148
- _isDateChanged(oldValue: any, newValue: any): boolean | void;
774
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
149
775
  /**
150
- * @param {any} oldValue
151
- * @param {any} newValue
776
+ * @param {ModelValue | null | undefined} oldValue
777
+ * @param {ModelValue | null | undefined} newValue
152
778
  * @returns {boolean | void}
153
779
  */
154
- _isIntegerChanged(oldValue: any, newValue: any): boolean | void;
780
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
155
781
  /**
156
- * @param {any} oldValue
157
- * @param {any} newValue
782
+ * @param {ModelValue | null | undefined} oldValue
783
+ * @param {ModelValue | null | undefined} newValue
158
784
  * @returns {boolean | void}
159
785
  */
160
- _isStringChanged(oldValue: any, newValue: any): boolean | void;
786
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
161
787
  /** @returns {ModelClassDataType} */
162
788
  modelClassData(): ModelClassDataType;
163
789
  /** @returns {Promise<void>} */
@@ -167,53 +793,59 @@ export type BaseModelClassType = {
167
793
  model: /*elided*/ any;
168
794
  response?: object;
169
795
  }>;
170
- /** @returns {Promise<{model: BaseModel, response: object}>} */
171
- saveRaw(rawData: any, options?: {}): Promise<{
796
+ /**
797
+ * @param {RawDataInput} rawData
798
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
799
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
800
+ */
801
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
802
+ simpleModelErrors?: boolean;
803
+ }): Promise<{
172
804
  model: /*elided*/ any;
173
- response: object;
805
+ response: ModelCommandResponse;
174
806
  }>;
175
807
  /**
176
- * @param {Record<string, any>} [newAttributes]
808
+ * @param {ModelDataMap} [newAttributes]
177
809
  * @param {ParseValidationErrorsOptions} [options]
178
810
  * @returns {Promise<{
179
811
  * model: BaseModel,
180
812
  * response?: object
181
813
  * }>}
182
814
  */
183
- update(newAttributes?: Record<string, any>, options?: ParseValidationErrorsOptions): Promise<{
815
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
184
816
  model: /*elided*/ any;
185
817
  response?: object;
186
818
  }>;
187
819
  /**
188
- * @param {object} response
820
+ * @param {ModelCommandResponse} response
189
821
  * @returns {void}
190
822
  */
191
- _refreshModelFromResponse(response: object): void;
823
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
192
824
  /**
193
- * @param {object} response
825
+ * @param {ModelCommandResponse} response
194
826
  * @returns {void}
195
827
  */
196
- _refreshModelDataFromResponse(response: object): void;
828
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
197
829
  /**
198
- * @param {FormData | Record<string, any>} rawData
830
+ * @param {RawDataInput} rawData
199
831
  * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
200
- * @returns {Promise<{response: object, model: BaseModel}>}
832
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
201
833
  */
202
- updateRaw(rawData: FormData | Record<string, any>, options?: ParseValidationErrorsOptions & {
834
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
203
835
  simpleModelErrors?: boolean;
204
836
  }): Promise<{
205
- response: object;
837
+ response: ModelCommandResponse;
206
838
  model: /*elided*/ any;
207
839
  }>;
208
840
  /** @returns {never} */
209
841
  isValid(): never;
210
- /** @returns {Promise<{valid: boolean, errors: Record<string, any>}>} */
842
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
211
843
  isValidOnServer(): Promise<{
212
844
  valid: boolean;
213
- errors: Record<string, any>;
845
+ errors: ValidationResponseErrors;
214
846
  }>;
215
- /** @returns {Record<string, any>} */
216
- modelClass(): Record<string, any>;
847
+ /** @returns {BaseModelClassType} */
848
+ modelClass(): BaseModelClassType;
217
849
  /**
218
850
  * @param {string} relationshipName
219
851
  * @param {BaseModel | BaseModel[] | null} model
@@ -222,93 +854,366 @@ export type BaseModelClassType = {
222
854
  preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
223
855
  /** @returns {void} */
224
856
  markForDestruction(): void;
225
- _markedForDestruction: boolean;
226
857
  /** @returns {boolean} */
227
858
  markedForDestruction(): boolean;
228
859
  /** @returns {number} */
229
860
  uniqueKey(): number;
230
- uniqueKeyValue: number;
231
861
  /**
232
- * @param {Record<string, any>} args
233
- * @param {Record<string, any>} commandArgs
234
- * @returns {Promise<object>}
862
+ * @param {ModelCommandDescriptor} args
863
+ * @param {ModelCommandOptions} commandArgs
864
+ * @returns {import("./command-execution.js").default}
235
865
  */
236
- _callMemberCommand(args: Record<string, any>, commandArgs: Record<string, any>): Promise<object>;
866
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
237
867
  /**
238
868
  * @param {string} attributeName
239
- * @returns {any}
869
+ * @returns {ModelValue | null | undefined}
240
870
  */
241
- readAttribute(attributeName: string): any;
871
+ readAttribute(attributeName: string): ModelValue | null | undefined;
242
872
  /**
243
873
  * @param {string} attributeName
244
- * @returns {any}
874
+ * @returns {ModelValue | null | undefined}
245
875
  */
246
- readAttributeUnderscore(attributeName: string): any;
247
- /** @returns {boolean} */
248
- isAttributeLoaded(attributeName: any): boolean;
876
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
877
+ /**
878
+ * @param {string} attributeName
879
+ * @returns {boolean}
880
+ */
881
+ isAttributeLoaded(attributeName: string): boolean;
249
882
  /**
250
- * @param {any} value
883
+ * @param {ModelValue | null | undefined} value
251
884
  * @returns {boolean}
252
885
  */
253
- _isPresent(value: any): boolean;
886
+ _isPresent(value: ModelValue | null | undefined): boolean;
254
887
  /**
255
888
  *
256
- * @param {import("./collection.js").CollectionArgsType<any>} args
889
+ * @param {RelationshipLoadArgs} args
257
890
  * @param {import("./collection.js").QueryArgsType} queryArgs
258
- * @returns {Promise<any | null>}
891
+ * @returns {Promise<BaseModel | null>}
259
892
  */
260
- _loadBelongsToReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any | null>;
893
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
261
894
  /**
262
895
  *
263
- * @param {{modelClass: any, reflectionName: string}} args
264
- * @returns {any | null}
896
+ * @param {RelationshipLoadArgs} args
897
+ * @returns {BaseModel | null}
265
898
  */
266
- _readBelongsToReflection({ reflectionName }: {
267
- modelClass: any;
268
- reflectionName: string;
269
- }): any | null;
899
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
270
900
  /**
271
901
  *
272
- * @param {import("./collection.js").CollectionArgsType<any>} args
902
+ * @param {RelationshipLoadArgs} args
273
903
  * @param {import("./collection.js").QueryArgsType} queryArgs
274
- * @returns {Promise<Array<any>>}
904
+ * @returns {Promise<BaseModel[]>}
275
905
  */
276
- _loadHasManyReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<Array<any>>;
906
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
277
907
  /**
278
908
  *
279
- * @param {import("./collection.js").CollectionArgsType<any>} args
909
+ * @param {RelationshipLoadArgs} args
280
910
  * @param {import("./collection.js").QueryArgsType} queryArgs
281
- * @returns {Promise<any>}
911
+ * @returns {Promise<BaseModel | null>}
282
912
  */
283
- _loadHasOneReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any>;
913
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
284
914
  /**
285
915
  *
286
- * @param {{modelClass: any, reflectionName: string}} args
287
- * @returns {any | null}
916
+ * @param {RelationshipLoadArgs} args
917
+ * @returns {BaseModel | null}
918
+ */
919
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
920
+ /**
921
+ * @param {BaseModelArgsObject} [args]
922
+ * @returns {void}
288
923
  */
289
- _readHasOneReflection({ reflectionName }: {
290
- modelClass: any;
291
- reflectionName: string;
292
- }): any | null;
924
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
293
925
  /**
294
- * @param {object} [args]
295
- * @param {object} [args.data]
296
- * @param {Record<string, any>} [args.data.b]
297
- * @param {Record<string, any>} [args.data.a]
298
- * @param {any} [args.data.r]
299
- * @param {Collection<any>} [args.collection]
926
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
300
927
  * @returns {void}
301
928
  */
302
- _readModelDataFromArgs(args?: {
303
- data?: {
304
- b?: Record<string, any>;
305
- a?: Record<string, any>;
306
- r?: any;
307
- };
308
- collection?: Collection<any>;
929
+ _readPreloadedRelationships(preloaded: {
930
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
309
931
  }): void;
932
+ /** @returns {number | string} */
933
+ primaryKey(): number | string;
934
+ }>;
935
+ findOrCreateBy: (findOrCreateByArgs: ModelDataMap, args?: {
936
+ additionalData?: ModelDataMap;
937
+ }) => Promise<{
938
+ abilities: ModelAbilityMap;
939
+ changes: ModelDataMap;
310
940
  collection: Collection<any>;
311
- preloadedRelationships: any;
941
+ _identifierKey: string | number;
942
+ _markedForDestruction: boolean;
943
+ modelData: ModelDataMap;
944
+ newRecord: boolean;
945
+ previousModelData: any;
946
+ preloadedRelationships: PreloadedRelationshipMap;
947
+ relationshipsCache: LoadedRelationshipMap;
948
+ relationships: LoadedRelationshipMap;
949
+ uniqueKeyValue: number;
950
+ /**
951
+ * @param {ModelDataMap} newAttributes
952
+ * @returns {void}
953
+ */
954
+ assignAttributes(newAttributes: ModelDataMap): void;
955
+ /** @returns {ModelDataMap} */
956
+ attributes(): ModelDataMap;
957
+ /**
958
+ * @param {string} givenAbilityName
959
+ * @returns {boolean}
960
+ */
961
+ can(givenAbilityName: string): boolean;
962
+ /** @returns {BaseModel} */
963
+ clone(): /*elided*/ any;
964
+ /** @returns {number | string} */
965
+ cacheKey(): number | string;
966
+ /** @returns {string} */
967
+ localCacheKey(): string;
968
+ /** @returns {string} */
969
+ fullCacheKey(): string;
970
+ /**
971
+ * @param {ModelDataMap} [attributes]
972
+ * @param {ParseValidationErrorsOptions} [options]
973
+ * @returns {Promise<{
974
+ * model: BaseModel,
975
+ * response: ModelCommandResponse
976
+ * }>}
977
+ */
978
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
979
+ model: /*elided*/ any;
980
+ response: ModelCommandResponse;
981
+ }>;
982
+ /**
983
+ * @param {RawDataInput} rawData
984
+ * @param {ParseValidationErrorsOptions} [options]
985
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
986
+ */
987
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
988
+ model: /*elided*/ any;
989
+ response: ModelCommandResponse;
990
+ }>;
991
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
992
+ destroy(): Promise<{
993
+ model: /*elided*/ any;
994
+ response: ModelCommandResponse;
995
+ }>;
996
+ /**
997
+ * @param {string[]} listOfAbilities
998
+ * @returns {Promise<void>}
999
+ */
1000
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
1001
+ /** @returns {ModelDataMap} */
1002
+ getAttributes(): ModelDataMap;
1003
+ /**
1004
+ * @param {ModelCommandResponse} response
1005
+ * @returns {never}
1006
+ */
1007
+ handleResponseError(response: ModelCommandResponse): never;
1008
+ /** @returns {number | string} */
1009
+ identifierKey(): number | string;
1010
+ /**
1011
+ * @param {string} associationName
1012
+ * @returns {boolean}
1013
+ */
1014
+ isAssociationLoaded(associationName: string): boolean;
1015
+ /**
1016
+ * @param {string} associationNameUnderscore
1017
+ * @returns {boolean}
1018
+ */
1019
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
1020
+ /**
1021
+ * @param {string} associationName
1022
+ * @returns {boolean}
1023
+ */
1024
+ isAssociationPresent(associationName: string): boolean;
1025
+ /**
1026
+ * @param {string} associationName
1027
+ * @returns {Promise<LoadedRelationshipValue>}
1028
+ */
1029
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
1030
+ /**
1031
+ * @param {string} associationNameUnderscore
1032
+ * @returns {Promise<LoadedRelationshipValue>}
1033
+ */
1034
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
1035
+ /**
1036
+ * @param {string} attributeName
1037
+ * @returns {boolean}
1038
+ */
1039
+ isAttributeChanged(attributeName: string): boolean;
1040
+ /** @returns {boolean} */
1041
+ isChanged(): boolean;
1042
+ /** @returns {boolean} */
1043
+ isNewRecord(): boolean;
1044
+ /** @returns {boolean} */
1045
+ isPersisted(): boolean;
1046
+ /**
1047
+ * @param {string} attributeName
1048
+ * @returns {boolean}
1049
+ */
1050
+ savedChangeToAttribute(attributeName: string): boolean;
1051
+ /**
1052
+ * @param {BaseModel} model
1053
+ * @returns {void}
1054
+ */
1055
+ setNewModel(model: /*elided*/ any): void;
1056
+ /**
1057
+ * @param {BaseModel} model
1058
+ * @returns {void}
1059
+ */
1060
+ setNewModelData(model: /*elided*/ any): void;
1061
+ /**
1062
+ * @param {ModelValue | null | undefined} oldValue
1063
+ * @param {ModelValue | null | undefined} newValue
1064
+ * @returns {boolean | void}
1065
+ */
1066
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1067
+ /**
1068
+ * @param {ModelValue | null | undefined} oldValue
1069
+ * @param {ModelValue | null | undefined} newValue
1070
+ * @returns {boolean | void}
1071
+ */
1072
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1073
+ /**
1074
+ * @param {ModelValue | null | undefined} oldValue
1075
+ * @param {ModelValue | null | undefined} newValue
1076
+ * @returns {boolean | void}
1077
+ */
1078
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1079
+ /** @returns {ModelClassDataType} */
1080
+ modelClassData(): ModelClassDataType;
1081
+ /** @returns {Promise<void>} */
1082
+ reload(): Promise<void>;
1083
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
1084
+ save(): Promise<{
1085
+ model: /*elided*/ any;
1086
+ response?: object;
1087
+ }>;
1088
+ /**
1089
+ * @param {RawDataInput} rawData
1090
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
1091
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
1092
+ */
1093
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
1094
+ simpleModelErrors?: boolean;
1095
+ }): Promise<{
1096
+ model: /*elided*/ any;
1097
+ response: ModelCommandResponse;
1098
+ }>;
1099
+ /**
1100
+ * @param {ModelDataMap} [newAttributes]
1101
+ * @param {ParseValidationErrorsOptions} [options]
1102
+ * @returns {Promise<{
1103
+ * model: BaseModel,
1104
+ * response?: object
1105
+ * }>}
1106
+ */
1107
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
1108
+ model: /*elided*/ any;
1109
+ response?: object;
1110
+ }>;
1111
+ /**
1112
+ * @param {ModelCommandResponse} response
1113
+ * @returns {void}
1114
+ */
1115
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
1116
+ /**
1117
+ * @param {ModelCommandResponse} response
1118
+ * @returns {void}
1119
+ */
1120
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
1121
+ /**
1122
+ * @param {RawDataInput} rawData
1123
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
1124
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
1125
+ */
1126
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
1127
+ simpleModelErrors?: boolean;
1128
+ }): Promise<{
1129
+ response: ModelCommandResponse;
1130
+ model: /*elided*/ any;
1131
+ }>;
1132
+ /** @returns {never} */
1133
+ isValid(): never;
1134
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
1135
+ isValidOnServer(): Promise<{
1136
+ valid: boolean;
1137
+ errors: ValidationResponseErrors;
1138
+ }>;
1139
+ /** @returns {BaseModelClassType} */
1140
+ modelClass(): BaseModelClassType;
1141
+ /**
1142
+ * @param {string} relationshipName
1143
+ * @param {BaseModel | BaseModel[] | null} model
1144
+ * @returns {void}
1145
+ */
1146
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
1147
+ /** @returns {void} */
1148
+ markForDestruction(): void;
1149
+ /** @returns {boolean} */
1150
+ markedForDestruction(): boolean;
1151
+ /** @returns {number} */
1152
+ uniqueKey(): number;
1153
+ /**
1154
+ * @param {ModelCommandDescriptor} args
1155
+ * @param {ModelCommandOptions} commandArgs
1156
+ * @returns {import("./command-execution.js").default}
1157
+ */
1158
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
1159
+ /**
1160
+ * @param {string} attributeName
1161
+ * @returns {ModelValue | null | undefined}
1162
+ */
1163
+ readAttribute(attributeName: string): ModelValue | null | undefined;
1164
+ /**
1165
+ * @param {string} attributeName
1166
+ * @returns {ModelValue | null | undefined}
1167
+ */
1168
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
1169
+ /**
1170
+ * @param {string} attributeName
1171
+ * @returns {boolean}
1172
+ */
1173
+ isAttributeLoaded(attributeName: string): boolean;
1174
+ /**
1175
+ * @param {ModelValue | null | undefined} value
1176
+ * @returns {boolean}
1177
+ */
1178
+ _isPresent(value: ModelValue | null | undefined): boolean;
1179
+ /**
1180
+ *
1181
+ * @param {RelationshipLoadArgs} args
1182
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1183
+ * @returns {Promise<BaseModel | null>}
1184
+ */
1185
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
1186
+ /**
1187
+ *
1188
+ * @param {RelationshipLoadArgs} args
1189
+ * @returns {BaseModel | null}
1190
+ */
1191
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
1192
+ /**
1193
+ *
1194
+ * @param {RelationshipLoadArgs} args
1195
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1196
+ * @returns {Promise<BaseModel[]>}
1197
+ */
1198
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
1199
+ /**
1200
+ *
1201
+ * @param {RelationshipLoadArgs} args
1202
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1203
+ * @returns {Promise<BaseModel | null>}
1204
+ */
1205
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
1206
+ /**
1207
+ *
1208
+ * @param {RelationshipLoadArgs} args
1209
+ * @returns {BaseModel | null}
1210
+ */
1211
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
1212
+ /**
1213
+ * @param {BaseModelArgsObject} [args]
1214
+ * @returns {void}
1215
+ */
1216
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
312
1217
  /**
313
1218
  * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
314
1219
  * @returns {void}
@@ -316,13 +1221,2792 @@ export type BaseModelClassType = {
316
1221
  _readPreloadedRelationships(preloaded: {
317
1222
  getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
318
1223
  }): void;
319
- /** @returns {number|string} */
1224
+ /** @returns {number | string} */
320
1225
  primaryKey(): number | string;
1226
+ }>;
1227
+ createLink?: (args: ModelDataMap) => import("./command-execution.js").default;
1228
+ destroyLinks?: (args: ModelDataMap) => import("./command-execution.js").default;
1229
+ hasAttribute: (attributeName: string) => boolean;
1230
+ humanAttributeName: (attributeName: string) => string;
1231
+ linkFor?: (args: ModelDataMap) => Promise<{
1232
+ link?: {
1233
+ abilities: ModelAbilityMap;
1234
+ changes: ModelDataMap;
1235
+ collection: Collection<any>;
1236
+ _identifierKey: string | number;
1237
+ _markedForDestruction: boolean;
1238
+ modelData: ModelDataMap;
1239
+ newRecord: boolean;
1240
+ previousModelData: any;
1241
+ preloadedRelationships: PreloadedRelationshipMap;
1242
+ relationshipsCache: LoadedRelationshipMap;
1243
+ relationships: LoadedRelationshipMap;
1244
+ uniqueKeyValue: number;
1245
+ /**
1246
+ * @param {ModelDataMap} newAttributes
1247
+ * @returns {void}
1248
+ */
1249
+ assignAttributes(newAttributes: ModelDataMap): void;
1250
+ /** @returns {ModelDataMap} */
1251
+ attributes(): ModelDataMap;
1252
+ /**
1253
+ * @param {string} givenAbilityName
1254
+ * @returns {boolean}
1255
+ */
1256
+ can(givenAbilityName: string): boolean;
1257
+ /** @returns {BaseModel} */
1258
+ clone(): /*elided*/ any;
1259
+ /** @returns {number | string} */
1260
+ cacheKey(): number | string;
1261
+ /** @returns {string} */
1262
+ localCacheKey(): string;
1263
+ /** @returns {string} */
1264
+ fullCacheKey(): string;
1265
+ /**
1266
+ * @param {ModelDataMap} [attributes]
1267
+ * @param {ParseValidationErrorsOptions} [options]
1268
+ * @returns {Promise<{
1269
+ * model: BaseModel,
1270
+ * response: ModelCommandResponse
1271
+ * }>}
1272
+ */
1273
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
1274
+ model: /*elided*/ any;
1275
+ response: ModelCommandResponse;
1276
+ }>;
1277
+ /**
1278
+ * @param {RawDataInput} rawData
1279
+ * @param {ParseValidationErrorsOptions} [options]
1280
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
1281
+ */
1282
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
1283
+ model: /*elided*/ any;
1284
+ response: ModelCommandResponse;
1285
+ }>;
1286
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
1287
+ destroy(): Promise<{
1288
+ model: /*elided*/ any;
1289
+ response: ModelCommandResponse;
1290
+ }>;
1291
+ /**
1292
+ * @param {string[]} listOfAbilities
1293
+ * @returns {Promise<void>}
1294
+ */
1295
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
1296
+ /** @returns {ModelDataMap} */
1297
+ getAttributes(): ModelDataMap;
1298
+ /**
1299
+ * @param {ModelCommandResponse} response
1300
+ * @returns {never}
1301
+ */
1302
+ handleResponseError(response: ModelCommandResponse): never;
1303
+ /** @returns {number | string} */
1304
+ identifierKey(): number | string;
1305
+ /**
1306
+ * @param {string} associationName
1307
+ * @returns {boolean}
1308
+ */
1309
+ isAssociationLoaded(associationName: string): boolean;
1310
+ /**
1311
+ * @param {string} associationNameUnderscore
1312
+ * @returns {boolean}
1313
+ */
1314
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
1315
+ /**
1316
+ * @param {string} associationName
1317
+ * @returns {boolean}
1318
+ */
1319
+ isAssociationPresent(associationName: string): boolean;
1320
+ /**
1321
+ * @param {string} associationName
1322
+ * @returns {Promise<LoadedRelationshipValue>}
1323
+ */
1324
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
1325
+ /**
1326
+ * @param {string} associationNameUnderscore
1327
+ * @returns {Promise<LoadedRelationshipValue>}
1328
+ */
1329
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
1330
+ /**
1331
+ * @param {string} attributeName
1332
+ * @returns {boolean}
1333
+ */
1334
+ isAttributeChanged(attributeName: string): boolean;
1335
+ /** @returns {boolean} */
1336
+ isChanged(): boolean;
1337
+ /** @returns {boolean} */
1338
+ isNewRecord(): boolean;
1339
+ /** @returns {boolean} */
1340
+ isPersisted(): boolean;
1341
+ /**
1342
+ * @param {string} attributeName
1343
+ * @returns {boolean}
1344
+ */
1345
+ savedChangeToAttribute(attributeName: string): boolean;
1346
+ /**
1347
+ * @param {BaseModel} model
1348
+ * @returns {void}
1349
+ */
1350
+ setNewModel(model: /*elided*/ any): void;
1351
+ /**
1352
+ * @param {BaseModel} model
1353
+ * @returns {void}
1354
+ */
1355
+ setNewModelData(model: /*elided*/ any): void;
1356
+ /**
1357
+ * @param {ModelValue | null | undefined} oldValue
1358
+ * @param {ModelValue | null | undefined} newValue
1359
+ * @returns {boolean | void}
1360
+ */
1361
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1362
+ /**
1363
+ * @param {ModelValue | null | undefined} oldValue
1364
+ * @param {ModelValue | null | undefined} newValue
1365
+ * @returns {boolean | void}
1366
+ */
1367
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1368
+ /**
1369
+ * @param {ModelValue | null | undefined} oldValue
1370
+ * @param {ModelValue | null | undefined} newValue
1371
+ * @returns {boolean | void}
1372
+ */
1373
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1374
+ /** @returns {ModelClassDataType} */
1375
+ modelClassData(): ModelClassDataType;
1376
+ /** @returns {Promise<void>} */
1377
+ reload(): Promise<void>;
1378
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
1379
+ save(): Promise<{
1380
+ model: /*elided*/ any;
1381
+ response?: object;
1382
+ }>;
1383
+ /**
1384
+ * @param {RawDataInput} rawData
1385
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
1386
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
1387
+ */
1388
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
1389
+ simpleModelErrors?: boolean;
1390
+ }): Promise<{
1391
+ model: /*elided*/ any;
1392
+ response: ModelCommandResponse;
1393
+ }>;
1394
+ /**
1395
+ * @param {ModelDataMap} [newAttributes]
1396
+ * @param {ParseValidationErrorsOptions} [options]
1397
+ * @returns {Promise<{
1398
+ * model: BaseModel,
1399
+ * response?: object
1400
+ * }>}
1401
+ */
1402
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
1403
+ model: /*elided*/ any;
1404
+ response?: object;
1405
+ }>;
1406
+ /**
1407
+ * @param {ModelCommandResponse} response
1408
+ * @returns {void}
1409
+ */
1410
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
1411
+ /**
1412
+ * @param {ModelCommandResponse} response
1413
+ * @returns {void}
1414
+ */
1415
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
1416
+ /**
1417
+ * @param {RawDataInput} rawData
1418
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
1419
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
1420
+ */
1421
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
1422
+ simpleModelErrors?: boolean;
1423
+ }): Promise<{
1424
+ response: ModelCommandResponse;
1425
+ model: /*elided*/ any;
1426
+ }>;
1427
+ /** @returns {never} */
1428
+ isValid(): never;
1429
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
1430
+ isValidOnServer(): Promise<{
1431
+ valid: boolean;
1432
+ errors: ValidationResponseErrors;
1433
+ }>;
1434
+ /** @returns {BaseModelClassType} */
1435
+ modelClass(): BaseModelClassType;
1436
+ /**
1437
+ * @param {string} relationshipName
1438
+ * @param {BaseModel | BaseModel[] | null} model
1439
+ * @returns {void}
1440
+ */
1441
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
1442
+ /** @returns {void} */
1443
+ markForDestruction(): void;
1444
+ /** @returns {boolean} */
1445
+ markedForDestruction(): boolean;
1446
+ /** @returns {number} */
1447
+ uniqueKey(): number;
1448
+ /**
1449
+ * @param {ModelCommandDescriptor} args
1450
+ * @param {ModelCommandOptions} commandArgs
1451
+ * @returns {import("./command-execution.js").default}
1452
+ */
1453
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
1454
+ /**
1455
+ * @param {string} attributeName
1456
+ * @returns {ModelValue | null | undefined}
1457
+ */
1458
+ readAttribute(attributeName: string): ModelValue | null | undefined;
1459
+ /**
1460
+ * @param {string} attributeName
1461
+ * @returns {ModelValue | null | undefined}
1462
+ */
1463
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
1464
+ /**
1465
+ * @param {string} attributeName
1466
+ * @returns {boolean}
1467
+ */
1468
+ isAttributeLoaded(attributeName: string): boolean;
1469
+ /**
1470
+ * @param {ModelValue | null | undefined} value
1471
+ * @returns {boolean}
1472
+ */
1473
+ _isPresent(value: ModelValue | null | undefined): boolean;
1474
+ /**
1475
+ *
1476
+ * @param {RelationshipLoadArgs} args
1477
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1478
+ * @returns {Promise<BaseModel | null>}
1479
+ */
1480
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
1481
+ /**
1482
+ *
1483
+ * @param {RelationshipLoadArgs} args
1484
+ * @returns {BaseModel | null}
1485
+ */
1486
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
1487
+ /**
1488
+ *
1489
+ * @param {RelationshipLoadArgs} args
1490
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1491
+ * @returns {Promise<BaseModel[]>}
1492
+ */
1493
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
1494
+ /**
1495
+ *
1496
+ * @param {RelationshipLoadArgs} args
1497
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1498
+ * @returns {Promise<BaseModel | null>}
1499
+ */
1500
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
1501
+ /**
1502
+ *
1503
+ * @param {RelationshipLoadArgs} args
1504
+ * @returns {BaseModel | null}
1505
+ */
1506
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
1507
+ /**
1508
+ * @param {BaseModelArgsObject} [args]
1509
+ * @returns {void}
1510
+ */
1511
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
1512
+ /**
1513
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
1514
+ * @returns {void}
1515
+ */
1516
+ _readPreloadedRelationships(preloaded: {
1517
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
1518
+ }): void;
1519
+ /** @returns {number | string} */
1520
+ primaryKey(): number | string;
1521
+ } | null;
1522
+ }>;
1523
+ modelClassData: () => ModelClassDataType;
1524
+ modelName: () => ModelName;
1525
+ primaryKey: () => string;
1526
+ current?: () => Promise<{
1527
+ current?: {
1528
+ abilities: ModelAbilityMap;
1529
+ changes: ModelDataMap;
1530
+ collection: Collection<any>;
1531
+ _identifierKey: string | number;
1532
+ _markedForDestruction: boolean;
1533
+ modelData: ModelDataMap;
1534
+ newRecord: boolean;
1535
+ previousModelData: any;
1536
+ preloadedRelationships: PreloadedRelationshipMap;
1537
+ relationshipsCache: LoadedRelationshipMap;
1538
+ relationships: LoadedRelationshipMap;
1539
+ uniqueKeyValue: number;
1540
+ /**
1541
+ * @param {ModelDataMap} newAttributes
1542
+ * @returns {void}
1543
+ */
1544
+ assignAttributes(newAttributes: ModelDataMap): void;
1545
+ /** @returns {ModelDataMap} */
1546
+ attributes(): ModelDataMap;
1547
+ /**
1548
+ * @param {string} givenAbilityName
1549
+ * @returns {boolean}
1550
+ */
1551
+ can(givenAbilityName: string): boolean;
1552
+ /** @returns {BaseModel} */
1553
+ clone(): /*elided*/ any;
1554
+ /** @returns {number | string} */
1555
+ cacheKey(): number | string;
1556
+ /** @returns {string} */
1557
+ localCacheKey(): string;
1558
+ /** @returns {string} */
1559
+ fullCacheKey(): string;
1560
+ /**
1561
+ * @param {ModelDataMap} [attributes]
1562
+ * @param {ParseValidationErrorsOptions} [options]
1563
+ * @returns {Promise<{
1564
+ * model: BaseModel,
1565
+ * response: ModelCommandResponse
1566
+ * }>}
1567
+ */
1568
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
1569
+ model: /*elided*/ any;
1570
+ response: ModelCommandResponse;
1571
+ }>;
1572
+ /**
1573
+ * @param {RawDataInput} rawData
1574
+ * @param {ParseValidationErrorsOptions} [options]
1575
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
1576
+ */
1577
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
1578
+ model: /*elided*/ any;
1579
+ response: ModelCommandResponse;
1580
+ }>;
1581
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
1582
+ destroy(): Promise<{
1583
+ model: /*elided*/ any;
1584
+ response: ModelCommandResponse;
1585
+ }>;
1586
+ /**
1587
+ * @param {string[]} listOfAbilities
1588
+ * @returns {Promise<void>}
1589
+ */
1590
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
1591
+ /** @returns {ModelDataMap} */
1592
+ getAttributes(): ModelDataMap;
1593
+ /**
1594
+ * @param {ModelCommandResponse} response
1595
+ * @returns {never}
1596
+ */
1597
+ handleResponseError(response: ModelCommandResponse): never;
1598
+ /** @returns {number | string} */
1599
+ identifierKey(): number | string;
1600
+ /**
1601
+ * @param {string} associationName
1602
+ * @returns {boolean}
1603
+ */
1604
+ isAssociationLoaded(associationName: string): boolean;
1605
+ /**
1606
+ * @param {string} associationNameUnderscore
1607
+ * @returns {boolean}
1608
+ */
1609
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
1610
+ /**
1611
+ * @param {string} associationName
1612
+ * @returns {boolean}
1613
+ */
1614
+ isAssociationPresent(associationName: string): boolean;
1615
+ /**
1616
+ * @param {string} associationName
1617
+ * @returns {Promise<LoadedRelationshipValue>}
1618
+ */
1619
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
1620
+ /**
1621
+ * @param {string} associationNameUnderscore
1622
+ * @returns {Promise<LoadedRelationshipValue>}
1623
+ */
1624
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
1625
+ /**
1626
+ * @param {string} attributeName
1627
+ * @returns {boolean}
1628
+ */
1629
+ isAttributeChanged(attributeName: string): boolean;
1630
+ /** @returns {boolean} */
1631
+ isChanged(): boolean;
1632
+ /** @returns {boolean} */
1633
+ isNewRecord(): boolean;
1634
+ /** @returns {boolean} */
1635
+ isPersisted(): boolean;
1636
+ /**
1637
+ * @param {string} attributeName
1638
+ * @returns {boolean}
1639
+ */
1640
+ savedChangeToAttribute(attributeName: string): boolean;
1641
+ /**
1642
+ * @param {BaseModel} model
1643
+ * @returns {void}
1644
+ */
1645
+ setNewModel(model: /*elided*/ any): void;
1646
+ /**
1647
+ * @param {BaseModel} model
1648
+ * @returns {void}
1649
+ */
1650
+ setNewModelData(model: /*elided*/ any): void;
1651
+ /**
1652
+ * @param {ModelValue | null | undefined} oldValue
1653
+ * @param {ModelValue | null | undefined} newValue
1654
+ * @returns {boolean | void}
1655
+ */
1656
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1657
+ /**
1658
+ * @param {ModelValue | null | undefined} oldValue
1659
+ * @param {ModelValue | null | undefined} newValue
1660
+ * @returns {boolean | void}
1661
+ */
1662
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1663
+ /**
1664
+ * @param {ModelValue | null | undefined} oldValue
1665
+ * @param {ModelValue | null | undefined} newValue
1666
+ * @returns {boolean | void}
1667
+ */
1668
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1669
+ /** @returns {ModelClassDataType} */
1670
+ modelClassData(): ModelClassDataType;
1671
+ /** @returns {Promise<void>} */
1672
+ reload(): Promise<void>;
1673
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
1674
+ save(): Promise<{
1675
+ model: /*elided*/ any;
1676
+ response?: object;
1677
+ }>;
1678
+ /**
1679
+ * @param {RawDataInput} rawData
1680
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
1681
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
1682
+ */
1683
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
1684
+ simpleModelErrors?: boolean;
1685
+ }): Promise<{
1686
+ model: /*elided*/ any;
1687
+ response: ModelCommandResponse;
1688
+ }>;
1689
+ /**
1690
+ * @param {ModelDataMap} [newAttributes]
1691
+ * @param {ParseValidationErrorsOptions} [options]
1692
+ * @returns {Promise<{
1693
+ * model: BaseModel,
1694
+ * response?: object
1695
+ * }>}
1696
+ */
1697
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
1698
+ model: /*elided*/ any;
1699
+ response?: object;
1700
+ }>;
1701
+ /**
1702
+ * @param {ModelCommandResponse} response
1703
+ * @returns {void}
1704
+ */
1705
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
1706
+ /**
1707
+ * @param {ModelCommandResponse} response
1708
+ * @returns {void}
1709
+ */
1710
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
1711
+ /**
1712
+ * @param {RawDataInput} rawData
1713
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
1714
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
1715
+ */
1716
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
1717
+ simpleModelErrors?: boolean;
1718
+ }): Promise<{
1719
+ response: ModelCommandResponse;
1720
+ model: /*elided*/ any;
1721
+ }>;
1722
+ /** @returns {never} */
1723
+ isValid(): never;
1724
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
1725
+ isValidOnServer(): Promise<{
1726
+ valid: boolean;
1727
+ errors: ValidationResponseErrors;
1728
+ }>;
1729
+ /** @returns {BaseModelClassType} */
1730
+ modelClass(): BaseModelClassType;
1731
+ /**
1732
+ * @param {string} relationshipName
1733
+ * @param {BaseModel | BaseModel[] | null} model
1734
+ * @returns {void}
1735
+ */
1736
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
1737
+ /** @returns {void} */
1738
+ markForDestruction(): void;
1739
+ /** @returns {boolean} */
1740
+ markedForDestruction(): boolean;
1741
+ /** @returns {number} */
1742
+ uniqueKey(): number;
1743
+ /**
1744
+ * @param {ModelCommandDescriptor} args
1745
+ * @param {ModelCommandOptions} commandArgs
1746
+ * @returns {import("./command-execution.js").default}
1747
+ */
1748
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
1749
+ /**
1750
+ * @param {string} attributeName
1751
+ * @returns {ModelValue | null | undefined}
1752
+ */
1753
+ readAttribute(attributeName: string): ModelValue | null | undefined;
1754
+ /**
1755
+ * @param {string} attributeName
1756
+ * @returns {ModelValue | null | undefined}
1757
+ */
1758
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
1759
+ /**
1760
+ * @param {string} attributeName
1761
+ * @returns {boolean}
1762
+ */
1763
+ isAttributeLoaded(attributeName: string): boolean;
1764
+ /**
1765
+ * @param {ModelValue | null | undefined} value
1766
+ * @returns {boolean}
1767
+ */
1768
+ _isPresent(value: ModelValue | null | undefined): boolean;
1769
+ /**
1770
+ *
1771
+ * @param {RelationshipLoadArgs} args
1772
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1773
+ * @returns {Promise<BaseModel | null>}
1774
+ */
1775
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
1776
+ /**
1777
+ *
1778
+ * @param {RelationshipLoadArgs} args
1779
+ * @returns {BaseModel | null}
1780
+ */
1781
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
1782
+ /**
1783
+ *
1784
+ * @param {RelationshipLoadArgs} args
1785
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1786
+ * @returns {Promise<BaseModel[]>}
1787
+ */
1788
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
1789
+ /**
1790
+ *
1791
+ * @param {RelationshipLoadArgs} args
1792
+ * @param {import("./collection.js").QueryArgsType} queryArgs
1793
+ * @returns {Promise<BaseModel | null>}
1794
+ */
1795
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
1796
+ /**
1797
+ *
1798
+ * @param {RelationshipLoadArgs} args
1799
+ * @returns {BaseModel | null}
1800
+ */
1801
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
1802
+ /**
1803
+ * @param {BaseModelArgsObject} [args]
1804
+ * @returns {void}
1805
+ */
1806
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
1807
+ /**
1808
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
1809
+ * @returns {void}
1810
+ */
1811
+ _readPreloadedRelationships(preloaded: {
1812
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
1813
+ }): void;
1814
+ /** @returns {number | string} */
1815
+ primaryKey(): number | string;
1816
+ }[];
1817
+ }>;
1818
+ ransack: (query?: import("./collection.js").CollectionRansackParams) => Collection<any>;
1819
+ resourceData?: () => {
1820
+ name?: string;
321
1821
  };
322
- apiMakerType: string;
323
- } & Record<string, any>;
324
- /** BaseModel. */
325
- /** @type {BaseModelClassType} */
326
- declare const BaseModel: BaseModelClassType;
1822
+ reflections: () => Reflection[];
1823
+ reflection: (name: string) => Reflection;
1824
+ ransackableAssociations: () => Reflection[];
1825
+ ransackableAttributes: () => Attribute[];
1826
+ ransackableScopes: () => Scope[];
1827
+ select: (select?: Record<string, string[]>) => Collection<any>;
1828
+ snakeCase: (attributeName: string) => string;
1829
+ };
1830
+ export type BaseModelClassType = typeof import("./base-model.js").default & BaseModelStaticMethods;
1831
+ export type ModelCommandDescriptor = {
1832
+ args?: ModelDataMap | FormData | HTMLFormElement;
1833
+ collectionName: string;
1834
+ command: string;
1835
+ primaryKey?: ModelIdentifier;
1836
+ type: string;
1837
+ };
1838
+ export type ModelCommandOptions = {
1839
+ cacheResponse?: boolean;
1840
+ forceHttp?: boolean;
1841
+ form?: HTMLFormElement;
1842
+ instant?: boolean;
1843
+ };
1844
+ export type ModelCommandResponse = {
1845
+ errors?: ValidationResponseErrors;
1846
+ model?: {
1847
+ abilities: ModelAbilityMap;
1848
+ changes: ModelDataMap;
1849
+ collection: Collection<any>;
1850
+ _identifierKey: string | number;
1851
+ _markedForDestruction: boolean;
1852
+ modelData: ModelDataMap;
1853
+ newRecord: boolean;
1854
+ previousModelData: any;
1855
+ preloadedRelationships: PreloadedRelationshipMap;
1856
+ relationshipsCache: LoadedRelationshipMap;
1857
+ relationships: LoadedRelationshipMap;
1858
+ uniqueKeyValue: number;
1859
+ /**
1860
+ * @param {ModelDataMap} newAttributes
1861
+ * @returns {void}
1862
+ */
1863
+ assignAttributes(newAttributes: ModelDataMap): void;
1864
+ /** @returns {ModelDataMap} */
1865
+ attributes(): ModelDataMap;
1866
+ /**
1867
+ * @param {string} givenAbilityName
1868
+ * @returns {boolean}
1869
+ */
1870
+ can(givenAbilityName: string): boolean;
1871
+ /** @returns {BaseModel} */
1872
+ clone(): /*elided*/ any;
1873
+ /** @returns {number | string} */
1874
+ cacheKey(): number | string;
1875
+ /** @returns {string} */
1876
+ localCacheKey(): string;
1877
+ /** @returns {string} */
1878
+ fullCacheKey(): string;
1879
+ /**
1880
+ * @param {ModelDataMap} [attributes]
1881
+ * @param {ParseValidationErrorsOptions} [options]
1882
+ * @returns {Promise<{
1883
+ * model: BaseModel,
1884
+ * response: ModelCommandResponse
1885
+ * }>}
1886
+ */
1887
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
1888
+ model: /*elided*/ any;
1889
+ response: ModelCommandResponse;
1890
+ }>;
1891
+ /**
1892
+ * @param {RawDataInput} rawData
1893
+ * @param {ParseValidationErrorsOptions} [options]
1894
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
1895
+ */
1896
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
1897
+ model: /*elided*/ any;
1898
+ response: ModelCommandResponse;
1899
+ }>;
1900
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
1901
+ destroy(): Promise<{
1902
+ model: /*elided*/ any;
1903
+ response: ModelCommandResponse;
1904
+ }>;
1905
+ /**
1906
+ * @param {string[]} listOfAbilities
1907
+ * @returns {Promise<void>}
1908
+ */
1909
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
1910
+ /** @returns {ModelDataMap} */
1911
+ getAttributes(): ModelDataMap;
1912
+ /**
1913
+ * @param {ModelCommandResponse} response
1914
+ * @returns {never}
1915
+ */
1916
+ handleResponseError(response: ModelCommandResponse): never;
1917
+ /** @returns {number | string} */
1918
+ identifierKey(): number | string;
1919
+ /**
1920
+ * @param {string} associationName
1921
+ * @returns {boolean}
1922
+ */
1923
+ isAssociationLoaded(associationName: string): boolean;
1924
+ /**
1925
+ * @param {string} associationNameUnderscore
1926
+ * @returns {boolean}
1927
+ */
1928
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
1929
+ /**
1930
+ * @param {string} associationName
1931
+ * @returns {boolean}
1932
+ */
1933
+ isAssociationPresent(associationName: string): boolean;
1934
+ /**
1935
+ * @param {string} associationName
1936
+ * @returns {Promise<LoadedRelationshipValue>}
1937
+ */
1938
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
1939
+ /**
1940
+ * @param {string} associationNameUnderscore
1941
+ * @returns {Promise<LoadedRelationshipValue>}
1942
+ */
1943
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
1944
+ /**
1945
+ * @param {string} attributeName
1946
+ * @returns {boolean}
1947
+ */
1948
+ isAttributeChanged(attributeName: string): boolean;
1949
+ /** @returns {boolean} */
1950
+ isChanged(): boolean;
1951
+ /** @returns {boolean} */
1952
+ isNewRecord(): boolean;
1953
+ /** @returns {boolean} */
1954
+ isPersisted(): boolean;
1955
+ /**
1956
+ * @param {string} attributeName
1957
+ * @returns {boolean}
1958
+ */
1959
+ savedChangeToAttribute(attributeName: string): boolean;
1960
+ /**
1961
+ * @param {BaseModel} model
1962
+ * @returns {void}
1963
+ */
1964
+ setNewModel(model: /*elided*/ any): void;
1965
+ /**
1966
+ * @param {BaseModel} model
1967
+ * @returns {void}
1968
+ */
1969
+ setNewModelData(model: /*elided*/ any): void;
1970
+ /**
1971
+ * @param {ModelValue | null | undefined} oldValue
1972
+ * @param {ModelValue | null | undefined} newValue
1973
+ * @returns {boolean | void}
1974
+ */
1975
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1976
+ /**
1977
+ * @param {ModelValue | null | undefined} oldValue
1978
+ * @param {ModelValue | null | undefined} newValue
1979
+ * @returns {boolean | void}
1980
+ */
1981
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1982
+ /**
1983
+ * @param {ModelValue | null | undefined} oldValue
1984
+ * @param {ModelValue | null | undefined} newValue
1985
+ * @returns {boolean | void}
1986
+ */
1987
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
1988
+ /** @returns {ModelClassDataType} */
1989
+ modelClassData(): ModelClassDataType;
1990
+ /** @returns {Promise<void>} */
1991
+ reload(): Promise<void>;
1992
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
1993
+ save(): Promise<{
1994
+ model: /*elided*/ any;
1995
+ response?: object;
1996
+ }>;
1997
+ /**
1998
+ * @param {RawDataInput} rawData
1999
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
2000
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
2001
+ */
2002
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
2003
+ simpleModelErrors?: boolean;
2004
+ }): Promise<{
2005
+ model: /*elided*/ any;
2006
+ response: ModelCommandResponse;
2007
+ }>;
2008
+ /**
2009
+ * @param {ModelDataMap} [newAttributes]
2010
+ * @param {ParseValidationErrorsOptions} [options]
2011
+ * @returns {Promise<{
2012
+ * model: BaseModel,
2013
+ * response?: object
2014
+ * }>}
2015
+ */
2016
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
2017
+ model: /*elided*/ any;
2018
+ response?: object;
2019
+ }>;
2020
+ /**
2021
+ * @param {ModelCommandResponse} response
2022
+ * @returns {void}
2023
+ */
2024
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
2025
+ /**
2026
+ * @param {ModelCommandResponse} response
2027
+ * @returns {void}
2028
+ */
2029
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
2030
+ /**
2031
+ * @param {RawDataInput} rawData
2032
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
2033
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
2034
+ */
2035
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
2036
+ simpleModelErrors?: boolean;
2037
+ }): Promise<{
2038
+ response: ModelCommandResponse;
2039
+ model: /*elided*/ any;
2040
+ }>;
2041
+ /** @returns {never} */
2042
+ isValid(): never;
2043
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
2044
+ isValidOnServer(): Promise<{
2045
+ valid: boolean;
2046
+ errors: ValidationResponseErrors;
2047
+ }>;
2048
+ /** @returns {BaseModelClassType} */
2049
+ modelClass(): BaseModelClassType;
2050
+ /**
2051
+ * @param {string} relationshipName
2052
+ * @param {BaseModel | BaseModel[] | null} model
2053
+ * @returns {void}
2054
+ */
2055
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
2056
+ /** @returns {void} */
2057
+ markForDestruction(): void;
2058
+ /** @returns {boolean} */
2059
+ markedForDestruction(): boolean;
2060
+ /** @returns {number} */
2061
+ uniqueKey(): number;
2062
+ /**
2063
+ * @param {ModelCommandDescriptor} args
2064
+ * @param {ModelCommandOptions} commandArgs
2065
+ * @returns {import("./command-execution.js").default}
2066
+ */
2067
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
2068
+ /**
2069
+ * @param {string} attributeName
2070
+ * @returns {ModelValue | null | undefined}
2071
+ */
2072
+ readAttribute(attributeName: string): ModelValue | null | undefined;
2073
+ /**
2074
+ * @param {string} attributeName
2075
+ * @returns {ModelValue | null | undefined}
2076
+ */
2077
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
2078
+ /**
2079
+ * @param {string} attributeName
2080
+ * @returns {boolean}
2081
+ */
2082
+ isAttributeLoaded(attributeName: string): boolean;
2083
+ /**
2084
+ * @param {ModelValue | null | undefined} value
2085
+ * @returns {boolean}
2086
+ */
2087
+ _isPresent(value: ModelValue | null | undefined): boolean;
2088
+ /**
2089
+ *
2090
+ * @param {RelationshipLoadArgs} args
2091
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2092
+ * @returns {Promise<BaseModel | null>}
2093
+ */
2094
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
2095
+ /**
2096
+ *
2097
+ * @param {RelationshipLoadArgs} args
2098
+ * @returns {BaseModel | null}
2099
+ */
2100
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
2101
+ /**
2102
+ *
2103
+ * @param {RelationshipLoadArgs} args
2104
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2105
+ * @returns {Promise<BaseModel[]>}
2106
+ */
2107
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
2108
+ /**
2109
+ *
2110
+ * @param {RelationshipLoadArgs} args
2111
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2112
+ * @returns {Promise<BaseModel | null>}
2113
+ */
2114
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
2115
+ /**
2116
+ *
2117
+ * @param {RelationshipLoadArgs} args
2118
+ * @returns {BaseModel | null}
2119
+ */
2120
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
2121
+ /**
2122
+ * @param {BaseModelArgsObject} [args]
2123
+ * @returns {void}
2124
+ */
2125
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
2126
+ /**
2127
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
2128
+ * @returns {void}
2129
+ */
2130
+ _readPreloadedRelationships(preloaded: {
2131
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
2132
+ }): void;
2133
+ /** @returns {number | string} */
2134
+ primaryKey(): number | string;
2135
+ } | {
2136
+ abilities: ModelAbilityMap;
2137
+ changes: ModelDataMap;
2138
+ collection: Collection<any>;
2139
+ _identifierKey: string | number;
2140
+ _markedForDestruction: boolean;
2141
+ modelData: ModelDataMap;
2142
+ newRecord: boolean;
2143
+ previousModelData: any;
2144
+ preloadedRelationships: PreloadedRelationshipMap;
2145
+ relationshipsCache: LoadedRelationshipMap;
2146
+ relationships: LoadedRelationshipMap;
2147
+ uniqueKeyValue: number;
2148
+ /**
2149
+ * @param {ModelDataMap} newAttributes
2150
+ * @returns {void}
2151
+ */
2152
+ assignAttributes(newAttributes: ModelDataMap): void;
2153
+ /** @returns {ModelDataMap} */
2154
+ attributes(): ModelDataMap;
2155
+ /**
2156
+ * @param {string} givenAbilityName
2157
+ * @returns {boolean}
2158
+ */
2159
+ can(givenAbilityName: string): boolean;
2160
+ /** @returns {BaseModel} */
2161
+ clone(): /*elided*/ any;
2162
+ /** @returns {number | string} */
2163
+ cacheKey(): number | string;
2164
+ /** @returns {string} */
2165
+ localCacheKey(): string;
2166
+ /** @returns {string} */
2167
+ fullCacheKey(): string;
2168
+ /**
2169
+ * @param {ModelDataMap} [attributes]
2170
+ * @param {ParseValidationErrorsOptions} [options]
2171
+ * @returns {Promise<{
2172
+ * model: BaseModel,
2173
+ * response: ModelCommandResponse
2174
+ * }>}
2175
+ */
2176
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
2177
+ model: /*elided*/ any;
2178
+ response: ModelCommandResponse;
2179
+ }>;
2180
+ /**
2181
+ * @param {RawDataInput} rawData
2182
+ * @param {ParseValidationErrorsOptions} [options]
2183
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
2184
+ */
2185
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
2186
+ model: /*elided*/ any;
2187
+ response: ModelCommandResponse;
2188
+ }>;
2189
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
2190
+ destroy(): Promise<{
2191
+ model: /*elided*/ any;
2192
+ response: ModelCommandResponse;
2193
+ }>;
2194
+ /**
2195
+ * @param {string[]} listOfAbilities
2196
+ * @returns {Promise<void>}
2197
+ */
2198
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
2199
+ /** @returns {ModelDataMap} */
2200
+ getAttributes(): ModelDataMap;
2201
+ /**
2202
+ * @param {ModelCommandResponse} response
2203
+ * @returns {never}
2204
+ */
2205
+ handleResponseError(response: ModelCommandResponse): never;
2206
+ /** @returns {number | string} */
2207
+ identifierKey(): number | string;
2208
+ /**
2209
+ * @param {string} associationName
2210
+ * @returns {boolean}
2211
+ */
2212
+ isAssociationLoaded(associationName: string): boolean;
2213
+ /**
2214
+ * @param {string} associationNameUnderscore
2215
+ * @returns {boolean}
2216
+ */
2217
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
2218
+ /**
2219
+ * @param {string} associationName
2220
+ * @returns {boolean}
2221
+ */
2222
+ isAssociationPresent(associationName: string): boolean;
2223
+ /**
2224
+ * @param {string} associationName
2225
+ * @returns {Promise<LoadedRelationshipValue>}
2226
+ */
2227
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
2228
+ /**
2229
+ * @param {string} associationNameUnderscore
2230
+ * @returns {Promise<LoadedRelationshipValue>}
2231
+ */
2232
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
2233
+ /**
2234
+ * @param {string} attributeName
2235
+ * @returns {boolean}
2236
+ */
2237
+ isAttributeChanged(attributeName: string): boolean;
2238
+ /** @returns {boolean} */
2239
+ isChanged(): boolean;
2240
+ /** @returns {boolean} */
2241
+ isNewRecord(): boolean;
2242
+ /** @returns {boolean} */
2243
+ isPersisted(): boolean;
2244
+ /**
2245
+ * @param {string} attributeName
2246
+ * @returns {boolean}
2247
+ */
2248
+ savedChangeToAttribute(attributeName: string): boolean;
2249
+ /**
2250
+ * @param {BaseModel} model
2251
+ * @returns {void}
2252
+ */
2253
+ setNewModel(model: /*elided*/ any): void;
2254
+ /**
2255
+ * @param {BaseModel} model
2256
+ * @returns {void}
2257
+ */
2258
+ setNewModelData(model: /*elided*/ any): void;
2259
+ /**
2260
+ * @param {ModelValue | null | undefined} oldValue
2261
+ * @param {ModelValue | null | undefined} newValue
2262
+ * @returns {boolean | void}
2263
+ */
2264
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2265
+ /**
2266
+ * @param {ModelValue | null | undefined} oldValue
2267
+ * @param {ModelValue | null | undefined} newValue
2268
+ * @returns {boolean | void}
2269
+ */
2270
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2271
+ /**
2272
+ * @param {ModelValue | null | undefined} oldValue
2273
+ * @param {ModelValue | null | undefined} newValue
2274
+ * @returns {boolean | void}
2275
+ */
2276
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2277
+ /** @returns {ModelClassDataType} */
2278
+ modelClassData(): ModelClassDataType;
2279
+ /** @returns {Promise<void>} */
2280
+ reload(): Promise<void>;
2281
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
2282
+ save(): Promise<{
2283
+ model: /*elided*/ any;
2284
+ response?: object;
2285
+ }>;
2286
+ /**
2287
+ * @param {RawDataInput} rawData
2288
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
2289
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
2290
+ */
2291
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
2292
+ simpleModelErrors?: boolean;
2293
+ }): Promise<{
2294
+ model: /*elided*/ any;
2295
+ response: ModelCommandResponse;
2296
+ }>;
2297
+ /**
2298
+ * @param {ModelDataMap} [newAttributes]
2299
+ * @param {ParseValidationErrorsOptions} [options]
2300
+ * @returns {Promise<{
2301
+ * model: BaseModel,
2302
+ * response?: object
2303
+ * }>}
2304
+ */
2305
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
2306
+ model: /*elided*/ any;
2307
+ response?: object;
2308
+ }>;
2309
+ /**
2310
+ * @param {ModelCommandResponse} response
2311
+ * @returns {void}
2312
+ */
2313
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
2314
+ /**
2315
+ * @param {ModelCommandResponse} response
2316
+ * @returns {void}
2317
+ */
2318
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
2319
+ /**
2320
+ * @param {RawDataInput} rawData
2321
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
2322
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
2323
+ */
2324
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
2325
+ simpleModelErrors?: boolean;
2326
+ }): Promise<{
2327
+ response: ModelCommandResponse;
2328
+ model: /*elided*/ any;
2329
+ }>;
2330
+ /** @returns {never} */
2331
+ isValid(): never;
2332
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
2333
+ isValidOnServer(): Promise<{
2334
+ valid: boolean;
2335
+ errors: ValidationResponseErrors;
2336
+ }>;
2337
+ /** @returns {BaseModelClassType} */
2338
+ modelClass(): BaseModelClassType;
2339
+ /**
2340
+ * @param {string} relationshipName
2341
+ * @param {BaseModel | BaseModel[] | null} model
2342
+ * @returns {void}
2343
+ */
2344
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
2345
+ /** @returns {void} */
2346
+ markForDestruction(): void;
2347
+ /** @returns {boolean} */
2348
+ markedForDestruction(): boolean;
2349
+ /** @returns {number} */
2350
+ uniqueKey(): number;
2351
+ /**
2352
+ * @param {ModelCommandDescriptor} args
2353
+ * @param {ModelCommandOptions} commandArgs
2354
+ * @returns {import("./command-execution.js").default}
2355
+ */
2356
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
2357
+ /**
2358
+ * @param {string} attributeName
2359
+ * @returns {ModelValue | null | undefined}
2360
+ */
2361
+ readAttribute(attributeName: string): ModelValue | null | undefined;
2362
+ /**
2363
+ * @param {string} attributeName
2364
+ * @returns {ModelValue | null | undefined}
2365
+ */
2366
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
2367
+ /**
2368
+ * @param {string} attributeName
2369
+ * @returns {boolean}
2370
+ */
2371
+ isAttributeLoaded(attributeName: string): boolean;
2372
+ /**
2373
+ * @param {ModelValue | null | undefined} value
2374
+ * @returns {boolean}
2375
+ */
2376
+ _isPresent(value: ModelValue | null | undefined): boolean;
2377
+ /**
2378
+ *
2379
+ * @param {RelationshipLoadArgs} args
2380
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2381
+ * @returns {Promise<BaseModel | null>}
2382
+ */
2383
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
2384
+ /**
2385
+ *
2386
+ * @param {RelationshipLoadArgs} args
2387
+ * @returns {BaseModel | null}
2388
+ */
2389
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
2390
+ /**
2391
+ *
2392
+ * @param {RelationshipLoadArgs} args
2393
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2394
+ * @returns {Promise<BaseModel[]>}
2395
+ */
2396
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
2397
+ /**
2398
+ *
2399
+ * @param {RelationshipLoadArgs} args
2400
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2401
+ * @returns {Promise<BaseModel | null>}
2402
+ */
2403
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
2404
+ /**
2405
+ *
2406
+ * @param {RelationshipLoadArgs} args
2407
+ * @returns {BaseModel | null}
2408
+ */
2409
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
2410
+ /**
2411
+ * @param {BaseModelArgsObject} [args]
2412
+ * @returns {void}
2413
+ */
2414
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
2415
+ /**
2416
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
2417
+ * @returns {void}
2418
+ */
2419
+ _readPreloadedRelationships(preloaded: {
2420
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
2421
+ }): void;
2422
+ /** @returns {number | string} */
2423
+ primaryKey(): number | string;
2424
+ }[];
2425
+ success?: boolean;
2426
+ valid?: boolean;
2427
+ };
2428
+ export type ValidationErrorWithResponse = {
2429
+ args?: {
2430
+ response?: {
2431
+ validation_errors?: import("./validation-errors.js").ValidationErrorEntryArgs[];
2432
+ };
2433
+ };
2434
+ };
2435
+ export type RelationshipLoadArgs = {
2436
+ model?: {
2437
+ abilities: ModelAbilityMap;
2438
+ changes: ModelDataMap;
2439
+ collection: Collection<any>;
2440
+ _identifierKey: string | number;
2441
+ _markedForDestruction: boolean;
2442
+ modelData: ModelDataMap;
2443
+ newRecord: boolean;
2444
+ previousModelData: any;
2445
+ preloadedRelationships: PreloadedRelationshipMap;
2446
+ relationshipsCache: LoadedRelationshipMap;
2447
+ relationships: LoadedRelationshipMap;
2448
+ uniqueKeyValue: number;
2449
+ /**
2450
+ * @param {ModelDataMap} newAttributes
2451
+ * @returns {void}
2452
+ */
2453
+ assignAttributes(newAttributes: ModelDataMap): void;
2454
+ /** @returns {ModelDataMap} */
2455
+ attributes(): ModelDataMap;
2456
+ /**
2457
+ * @param {string} givenAbilityName
2458
+ * @returns {boolean}
2459
+ */
2460
+ can(givenAbilityName: string): boolean;
2461
+ /** @returns {BaseModel} */
2462
+ clone(): /*elided*/ any;
2463
+ /** @returns {number | string} */
2464
+ cacheKey(): number | string;
2465
+ /** @returns {string} */
2466
+ localCacheKey(): string;
2467
+ /** @returns {string} */
2468
+ fullCacheKey(): string;
2469
+ /**
2470
+ * @param {ModelDataMap} [attributes]
2471
+ * @param {ParseValidationErrorsOptions} [options]
2472
+ * @returns {Promise<{
2473
+ * model: BaseModel,
2474
+ * response: ModelCommandResponse
2475
+ * }>}
2476
+ */
2477
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
2478
+ model: /*elided*/ any;
2479
+ response: ModelCommandResponse;
2480
+ }>;
2481
+ /**
2482
+ * @param {RawDataInput} rawData
2483
+ * @param {ParseValidationErrorsOptions} [options]
2484
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
2485
+ */
2486
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
2487
+ model: /*elided*/ any;
2488
+ response: ModelCommandResponse;
2489
+ }>;
2490
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
2491
+ destroy(): Promise<{
2492
+ model: /*elided*/ any;
2493
+ response: ModelCommandResponse;
2494
+ }>;
2495
+ /**
2496
+ * @param {string[]} listOfAbilities
2497
+ * @returns {Promise<void>}
2498
+ */
2499
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
2500
+ /** @returns {ModelDataMap} */
2501
+ getAttributes(): ModelDataMap;
2502
+ /**
2503
+ * @param {ModelCommandResponse} response
2504
+ * @returns {never}
2505
+ */
2506
+ handleResponseError(response: ModelCommandResponse): never;
2507
+ /** @returns {number | string} */
2508
+ identifierKey(): number | string;
2509
+ /**
2510
+ * @param {string} associationName
2511
+ * @returns {boolean}
2512
+ */
2513
+ isAssociationLoaded(associationName: string): boolean;
2514
+ /**
2515
+ * @param {string} associationNameUnderscore
2516
+ * @returns {boolean}
2517
+ */
2518
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
2519
+ /**
2520
+ * @param {string} associationName
2521
+ * @returns {boolean}
2522
+ */
2523
+ isAssociationPresent(associationName: string): boolean;
2524
+ /**
2525
+ * @param {string} associationName
2526
+ * @returns {Promise<LoadedRelationshipValue>}
2527
+ */
2528
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
2529
+ /**
2530
+ * @param {string} associationNameUnderscore
2531
+ * @returns {Promise<LoadedRelationshipValue>}
2532
+ */
2533
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
2534
+ /**
2535
+ * @param {string} attributeName
2536
+ * @returns {boolean}
2537
+ */
2538
+ isAttributeChanged(attributeName: string): boolean;
2539
+ /** @returns {boolean} */
2540
+ isChanged(): boolean;
2541
+ /** @returns {boolean} */
2542
+ isNewRecord(): boolean;
2543
+ /** @returns {boolean} */
2544
+ isPersisted(): boolean;
2545
+ /**
2546
+ * @param {string} attributeName
2547
+ * @returns {boolean}
2548
+ */
2549
+ savedChangeToAttribute(attributeName: string): boolean;
2550
+ /**
2551
+ * @param {BaseModel} model
2552
+ * @returns {void}
2553
+ */
2554
+ setNewModel(model: /*elided*/ any): void;
2555
+ /**
2556
+ * @param {BaseModel} model
2557
+ * @returns {void}
2558
+ */
2559
+ setNewModelData(model: /*elided*/ any): void;
2560
+ /**
2561
+ * @param {ModelValue | null | undefined} oldValue
2562
+ * @param {ModelValue | null | undefined} newValue
2563
+ * @returns {boolean | void}
2564
+ */
2565
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2566
+ /**
2567
+ * @param {ModelValue | null | undefined} oldValue
2568
+ * @param {ModelValue | null | undefined} newValue
2569
+ * @returns {boolean | void}
2570
+ */
2571
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2572
+ /**
2573
+ * @param {ModelValue | null | undefined} oldValue
2574
+ * @param {ModelValue | null | undefined} newValue
2575
+ * @returns {boolean | void}
2576
+ */
2577
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2578
+ /** @returns {ModelClassDataType} */
2579
+ modelClassData(): ModelClassDataType;
2580
+ /** @returns {Promise<void>} */
2581
+ reload(): Promise<void>;
2582
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
2583
+ save(): Promise<{
2584
+ model: /*elided*/ any;
2585
+ response?: object;
2586
+ }>;
2587
+ /**
2588
+ * @param {RawDataInput} rawData
2589
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
2590
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
2591
+ */
2592
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
2593
+ simpleModelErrors?: boolean;
2594
+ }): Promise<{
2595
+ model: /*elided*/ any;
2596
+ response: ModelCommandResponse;
2597
+ }>;
2598
+ /**
2599
+ * @param {ModelDataMap} [newAttributes]
2600
+ * @param {ParseValidationErrorsOptions} [options]
2601
+ * @returns {Promise<{
2602
+ * model: BaseModel,
2603
+ * response?: object
2604
+ * }>}
2605
+ */
2606
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
2607
+ model: /*elided*/ any;
2608
+ response?: object;
2609
+ }>;
2610
+ /**
2611
+ * @param {ModelCommandResponse} response
2612
+ * @returns {void}
2613
+ */
2614
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
2615
+ /**
2616
+ * @param {ModelCommandResponse} response
2617
+ * @returns {void}
2618
+ */
2619
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
2620
+ /**
2621
+ * @param {RawDataInput} rawData
2622
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
2623
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
2624
+ */
2625
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
2626
+ simpleModelErrors?: boolean;
2627
+ }): Promise<{
2628
+ response: ModelCommandResponse;
2629
+ model: /*elided*/ any;
2630
+ }>;
2631
+ /** @returns {never} */
2632
+ isValid(): never;
2633
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
2634
+ isValidOnServer(): Promise<{
2635
+ valid: boolean;
2636
+ errors: ValidationResponseErrors;
2637
+ }>;
2638
+ /** @returns {BaseModelClassType} */
2639
+ modelClass(): BaseModelClassType;
2640
+ /**
2641
+ * @param {string} relationshipName
2642
+ * @param {BaseModel | BaseModel[] | null} model
2643
+ * @returns {void}
2644
+ */
2645
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
2646
+ /** @returns {void} */
2647
+ markForDestruction(): void;
2648
+ /** @returns {boolean} */
2649
+ markedForDestruction(): boolean;
2650
+ /** @returns {number} */
2651
+ uniqueKey(): number;
2652
+ /**
2653
+ * @param {ModelCommandDescriptor} args
2654
+ * @param {ModelCommandOptions} commandArgs
2655
+ * @returns {import("./command-execution.js").default}
2656
+ */
2657
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
2658
+ /**
2659
+ * @param {string} attributeName
2660
+ * @returns {ModelValue | null | undefined}
2661
+ */
2662
+ readAttribute(attributeName: string): ModelValue | null | undefined;
2663
+ /**
2664
+ * @param {string} attributeName
2665
+ * @returns {ModelValue | null | undefined}
2666
+ */
2667
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
2668
+ /**
2669
+ * @param {string} attributeName
2670
+ * @returns {boolean}
2671
+ */
2672
+ isAttributeLoaded(attributeName: string): boolean;
2673
+ /**
2674
+ * @param {ModelValue | null | undefined} value
2675
+ * @returns {boolean}
2676
+ */
2677
+ _isPresent(value: ModelValue | null | undefined): boolean;
2678
+ /**
2679
+ *
2680
+ * @param {RelationshipLoadArgs} args
2681
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2682
+ * @returns {Promise<BaseModel | null>}
2683
+ */
2684
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
2685
+ /**
2686
+ *
2687
+ * @param {RelationshipLoadArgs} args
2688
+ * @returns {BaseModel | null}
2689
+ */
2690
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
2691
+ /**
2692
+ *
2693
+ * @param {RelationshipLoadArgs} args
2694
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2695
+ * @returns {Promise<BaseModel[]>}
2696
+ */
2697
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
2698
+ /**
2699
+ *
2700
+ * @param {RelationshipLoadArgs} args
2701
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2702
+ * @returns {Promise<BaseModel | null>}
2703
+ */
2704
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
2705
+ /**
2706
+ *
2707
+ * @param {RelationshipLoadArgs} args
2708
+ * @returns {BaseModel | null}
2709
+ */
2710
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
2711
+ /**
2712
+ * @param {BaseModelArgsObject} [args]
2713
+ * @returns {void}
2714
+ */
2715
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
2716
+ /**
2717
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
2718
+ * @returns {void}
2719
+ */
2720
+ _readPreloadedRelationships(preloaded: {
2721
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
2722
+ }): void;
2723
+ /** @returns {number | string} */
2724
+ primaryKey(): number | string;
2725
+ };
2726
+ modelClass?: typeof import("./base-model.js").default;
2727
+ reflectionName: string;
2728
+ };
2729
+ /** BaseModel. */
2730
+ declare const BaseModel: {
2731
+ new (args?: BaseModelArgs): {
2732
+ abilities: ModelAbilityMap;
2733
+ changes: ModelDataMap;
2734
+ collection: Collection<any>;
2735
+ _identifierKey: string | number;
2736
+ _markedForDestruction: boolean;
2737
+ modelData: ModelDataMap;
2738
+ newRecord: boolean;
2739
+ previousModelData: any;
2740
+ preloadedRelationships: PreloadedRelationshipMap;
2741
+ relationshipsCache: LoadedRelationshipMap;
2742
+ relationships: LoadedRelationshipMap;
2743
+ uniqueKeyValue: number;
2744
+ /**
2745
+ * @param {ModelDataMap} newAttributes
2746
+ * @returns {void}
2747
+ */
2748
+ assignAttributes(newAttributes: ModelDataMap): void;
2749
+ /** @returns {ModelDataMap} */
2750
+ attributes(): ModelDataMap;
2751
+ /**
2752
+ * @param {string} givenAbilityName
2753
+ * @returns {boolean}
2754
+ */
2755
+ can(givenAbilityName: string): boolean;
2756
+ /** @returns {BaseModel} */
2757
+ clone(): /*elided*/ any;
2758
+ /** @returns {number | string} */
2759
+ cacheKey(): number | string;
2760
+ /** @returns {string} */
2761
+ localCacheKey(): string;
2762
+ /** @returns {string} */
2763
+ fullCacheKey(): string;
2764
+ /**
2765
+ * @param {ModelDataMap} [attributes]
2766
+ * @param {ParseValidationErrorsOptions} [options]
2767
+ * @returns {Promise<{
2768
+ * model: BaseModel,
2769
+ * response: ModelCommandResponse
2770
+ * }>}
2771
+ */
2772
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
2773
+ model: /*elided*/ any;
2774
+ response: ModelCommandResponse;
2775
+ }>;
2776
+ /**
2777
+ * @param {RawDataInput} rawData
2778
+ * @param {ParseValidationErrorsOptions} [options]
2779
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
2780
+ */
2781
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
2782
+ model: /*elided*/ any;
2783
+ response: ModelCommandResponse;
2784
+ }>;
2785
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
2786
+ destroy(): Promise<{
2787
+ model: /*elided*/ any;
2788
+ response: ModelCommandResponse;
2789
+ }>;
2790
+ /**
2791
+ * @param {string[]} listOfAbilities
2792
+ * @returns {Promise<void>}
2793
+ */
2794
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
2795
+ /** @returns {ModelDataMap} */
2796
+ getAttributes(): ModelDataMap;
2797
+ /**
2798
+ * @param {ModelCommandResponse} response
2799
+ * @returns {never}
2800
+ */
2801
+ handleResponseError(response: ModelCommandResponse): never;
2802
+ /** @returns {number | string} */
2803
+ identifierKey(): number | string;
2804
+ /**
2805
+ * @param {string} associationName
2806
+ * @returns {boolean}
2807
+ */
2808
+ isAssociationLoaded(associationName: string): boolean;
2809
+ /**
2810
+ * @param {string} associationNameUnderscore
2811
+ * @returns {boolean}
2812
+ */
2813
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
2814
+ /**
2815
+ * @param {string} associationName
2816
+ * @returns {boolean}
2817
+ */
2818
+ isAssociationPresent(associationName: string): boolean;
2819
+ /**
2820
+ * @param {string} associationName
2821
+ * @returns {Promise<LoadedRelationshipValue>}
2822
+ */
2823
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
2824
+ /**
2825
+ * @param {string} associationNameUnderscore
2826
+ * @returns {Promise<LoadedRelationshipValue>}
2827
+ */
2828
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
2829
+ /**
2830
+ * @param {string} attributeName
2831
+ * @returns {boolean}
2832
+ */
2833
+ isAttributeChanged(attributeName: string): boolean;
2834
+ /** @returns {boolean} */
2835
+ isChanged(): boolean;
2836
+ /** @returns {boolean} */
2837
+ isNewRecord(): boolean;
2838
+ /** @returns {boolean} */
2839
+ isPersisted(): boolean;
2840
+ /**
2841
+ * @param {string} attributeName
2842
+ * @returns {boolean}
2843
+ */
2844
+ savedChangeToAttribute(attributeName: string): boolean;
2845
+ /**
2846
+ * @param {BaseModel} model
2847
+ * @returns {void}
2848
+ */
2849
+ setNewModel(model: /*elided*/ any): void;
2850
+ /**
2851
+ * @param {BaseModel} model
2852
+ * @returns {void}
2853
+ */
2854
+ setNewModelData(model: /*elided*/ any): void;
2855
+ /**
2856
+ * @param {ModelValue | null | undefined} oldValue
2857
+ * @param {ModelValue | null | undefined} newValue
2858
+ * @returns {boolean | void}
2859
+ */
2860
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2861
+ /**
2862
+ * @param {ModelValue | null | undefined} oldValue
2863
+ * @param {ModelValue | null | undefined} newValue
2864
+ * @returns {boolean | void}
2865
+ */
2866
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2867
+ /**
2868
+ * @param {ModelValue | null | undefined} oldValue
2869
+ * @param {ModelValue | null | undefined} newValue
2870
+ * @returns {boolean | void}
2871
+ */
2872
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
2873
+ /** @returns {ModelClassDataType} */
2874
+ modelClassData(): ModelClassDataType;
2875
+ /** @returns {Promise<void>} */
2876
+ reload(): Promise<void>;
2877
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
2878
+ save(): Promise<{
2879
+ model: /*elided*/ any;
2880
+ response?: object;
2881
+ }>;
2882
+ /**
2883
+ * @param {RawDataInput} rawData
2884
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
2885
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
2886
+ */
2887
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
2888
+ simpleModelErrors?: boolean;
2889
+ }): Promise<{
2890
+ model: /*elided*/ any;
2891
+ response: ModelCommandResponse;
2892
+ }>;
2893
+ /**
2894
+ * @param {ModelDataMap} [newAttributes]
2895
+ * @param {ParseValidationErrorsOptions} [options]
2896
+ * @returns {Promise<{
2897
+ * model: BaseModel,
2898
+ * response?: object
2899
+ * }>}
2900
+ */
2901
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
2902
+ model: /*elided*/ any;
2903
+ response?: object;
2904
+ }>;
2905
+ /**
2906
+ * @param {ModelCommandResponse} response
2907
+ * @returns {void}
2908
+ */
2909
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
2910
+ /**
2911
+ * @param {ModelCommandResponse} response
2912
+ * @returns {void}
2913
+ */
2914
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
2915
+ /**
2916
+ * @param {RawDataInput} rawData
2917
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
2918
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
2919
+ */
2920
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
2921
+ simpleModelErrors?: boolean;
2922
+ }): Promise<{
2923
+ response: ModelCommandResponse;
2924
+ model: /*elided*/ any;
2925
+ }>;
2926
+ /** @returns {never} */
2927
+ isValid(): never;
2928
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
2929
+ isValidOnServer(): Promise<{
2930
+ valid: boolean;
2931
+ errors: ValidationResponseErrors;
2932
+ }>;
2933
+ /** @returns {BaseModelClassType} */
2934
+ modelClass(): BaseModelClassType;
2935
+ /**
2936
+ * @param {string} relationshipName
2937
+ * @param {BaseModel | BaseModel[] | null} model
2938
+ * @returns {void}
2939
+ */
2940
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
2941
+ /** @returns {void} */
2942
+ markForDestruction(): void;
2943
+ /** @returns {boolean} */
2944
+ markedForDestruction(): boolean;
2945
+ /** @returns {number} */
2946
+ uniqueKey(): number;
2947
+ /**
2948
+ * @param {ModelCommandDescriptor} args
2949
+ * @param {ModelCommandOptions} commandArgs
2950
+ * @returns {import("./command-execution.js").default}
2951
+ */
2952
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
2953
+ /**
2954
+ * @param {string} attributeName
2955
+ * @returns {ModelValue | null | undefined}
2956
+ */
2957
+ readAttribute(attributeName: string): ModelValue | null | undefined;
2958
+ /**
2959
+ * @param {string} attributeName
2960
+ * @returns {ModelValue | null | undefined}
2961
+ */
2962
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
2963
+ /**
2964
+ * @param {string} attributeName
2965
+ * @returns {boolean}
2966
+ */
2967
+ isAttributeLoaded(attributeName: string): boolean;
2968
+ /**
2969
+ * @param {ModelValue | null | undefined} value
2970
+ * @returns {boolean}
2971
+ */
2972
+ _isPresent(value: ModelValue | null | undefined): boolean;
2973
+ /**
2974
+ *
2975
+ * @param {RelationshipLoadArgs} args
2976
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2977
+ * @returns {Promise<BaseModel | null>}
2978
+ */
2979
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
2980
+ /**
2981
+ *
2982
+ * @param {RelationshipLoadArgs} args
2983
+ * @returns {BaseModel | null}
2984
+ */
2985
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
2986
+ /**
2987
+ *
2988
+ * @param {RelationshipLoadArgs} args
2989
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2990
+ * @returns {Promise<BaseModel[]>}
2991
+ */
2992
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
2993
+ /**
2994
+ *
2995
+ * @param {RelationshipLoadArgs} args
2996
+ * @param {import("./collection.js").QueryArgsType} queryArgs
2997
+ * @returns {Promise<BaseModel | null>}
2998
+ */
2999
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
3000
+ /**
3001
+ *
3002
+ * @param {RelationshipLoadArgs} args
3003
+ * @returns {BaseModel | null}
3004
+ */
3005
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
3006
+ /**
3007
+ * @param {BaseModelArgsObject} [args]
3008
+ * @returns {void}
3009
+ */
3010
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
3011
+ /**
3012
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
3013
+ * @returns {void}
3014
+ */
3015
+ _readPreloadedRelationships(preloaded: {
3016
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
3017
+ }): void;
3018
+ /** @returns {number | string} */
3019
+ primaryKey(): number | string;
3020
+ };
3021
+ apiMakerType: string;
3022
+ /** @returns {Attribute[]} */
3023
+ attributes(): Attribute[];
3024
+ /**
3025
+ * @param {string} attributeName
3026
+ * @returns {boolean}
3027
+ */
3028
+ hasAttribute(attributeName: string): boolean;
3029
+ /**
3030
+ * @interface
3031
+ * @returns {ModelClassDataType}
3032
+ */
3033
+ modelClassData(): ModelClassDataType;
3034
+ /**
3035
+ * @param {ValidationErrors} validationErrors
3036
+ * @returns {CustomEvent}
3037
+ */
3038
+ newCustomEvent(validationErrors: ValidationErrors): CustomEvent;
3039
+ /**
3040
+ * @param {ValidationErrors} validationErrors
3041
+ * @param {object} [options]
3042
+ * @param {object} [options.form]
3043
+ * @param {boolean} [options.throwValidationError]
3044
+ */
3045
+ sendValidationErrorsEvent(validationErrors: ValidationErrors, options?: {
3046
+ form?: object;
3047
+ throwValidationError?: boolean;
3048
+ }): void;
3049
+ /**
3050
+ * @param {number | string} id
3051
+ * @returns {Promise<BaseModel>}
3052
+ */
3053
+ find(id: number | string): Promise<{
3054
+ abilities: ModelAbilityMap;
3055
+ changes: ModelDataMap;
3056
+ collection: Collection<any>;
3057
+ _identifierKey: string | number;
3058
+ _markedForDestruction: boolean;
3059
+ modelData: ModelDataMap;
3060
+ newRecord: boolean;
3061
+ previousModelData: any;
3062
+ preloadedRelationships: PreloadedRelationshipMap;
3063
+ relationshipsCache: LoadedRelationshipMap;
3064
+ relationships: LoadedRelationshipMap;
3065
+ uniqueKeyValue: number;
3066
+ /**
3067
+ * @param {ModelDataMap} newAttributes
3068
+ * @returns {void}
3069
+ */
3070
+ assignAttributes(newAttributes: ModelDataMap): void;
3071
+ /** @returns {ModelDataMap} */
3072
+ attributes(): ModelDataMap;
3073
+ /**
3074
+ * @param {string} givenAbilityName
3075
+ * @returns {boolean}
3076
+ */
3077
+ can(givenAbilityName: string): boolean;
3078
+ /** @returns {BaseModel} */
3079
+ clone(): /*elided*/ any;
3080
+ /** @returns {number | string} */
3081
+ cacheKey(): number | string;
3082
+ /** @returns {string} */
3083
+ localCacheKey(): string;
3084
+ /** @returns {string} */
3085
+ fullCacheKey(): string;
3086
+ /**
3087
+ * @param {ModelDataMap} [attributes]
3088
+ * @param {ParseValidationErrorsOptions} [options]
3089
+ * @returns {Promise<{
3090
+ * model: BaseModel,
3091
+ * response: ModelCommandResponse
3092
+ * }>}
3093
+ */
3094
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
3095
+ model: /*elided*/ any;
3096
+ response: ModelCommandResponse;
3097
+ }>;
3098
+ /**
3099
+ * @param {RawDataInput} rawData
3100
+ * @param {ParseValidationErrorsOptions} [options]
3101
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
3102
+ */
3103
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
3104
+ model: /*elided*/ any;
3105
+ response: ModelCommandResponse;
3106
+ }>;
3107
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
3108
+ destroy(): Promise<{
3109
+ model: /*elided*/ any;
3110
+ response: ModelCommandResponse;
3111
+ }>;
3112
+ /**
3113
+ * @param {string[]} listOfAbilities
3114
+ * @returns {Promise<void>}
3115
+ */
3116
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
3117
+ /** @returns {ModelDataMap} */
3118
+ getAttributes(): ModelDataMap;
3119
+ /**
3120
+ * @param {ModelCommandResponse} response
3121
+ * @returns {never}
3122
+ */
3123
+ handleResponseError(response: ModelCommandResponse): never;
3124
+ /** @returns {number | string} */
3125
+ identifierKey(): number | string;
3126
+ /**
3127
+ * @param {string} associationName
3128
+ * @returns {boolean}
3129
+ */
3130
+ isAssociationLoaded(associationName: string): boolean;
3131
+ /**
3132
+ * @param {string} associationNameUnderscore
3133
+ * @returns {boolean}
3134
+ */
3135
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
3136
+ /**
3137
+ * @param {string} associationName
3138
+ * @returns {boolean}
3139
+ */
3140
+ isAssociationPresent(associationName: string): boolean;
3141
+ /**
3142
+ * @param {string} associationName
3143
+ * @returns {Promise<LoadedRelationshipValue>}
3144
+ */
3145
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
3146
+ /**
3147
+ * @param {string} associationNameUnderscore
3148
+ * @returns {Promise<LoadedRelationshipValue>}
3149
+ */
3150
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
3151
+ /**
3152
+ * @param {string} attributeName
3153
+ * @returns {boolean}
3154
+ */
3155
+ isAttributeChanged(attributeName: string): boolean;
3156
+ /** @returns {boolean} */
3157
+ isChanged(): boolean;
3158
+ /** @returns {boolean} */
3159
+ isNewRecord(): boolean;
3160
+ /** @returns {boolean} */
3161
+ isPersisted(): boolean;
3162
+ /**
3163
+ * @param {string} attributeName
3164
+ * @returns {boolean}
3165
+ */
3166
+ savedChangeToAttribute(attributeName: string): boolean;
3167
+ /**
3168
+ * @param {BaseModel} model
3169
+ * @returns {void}
3170
+ */
3171
+ setNewModel(model: /*elided*/ any): void;
3172
+ /**
3173
+ * @param {BaseModel} model
3174
+ * @returns {void}
3175
+ */
3176
+ setNewModelData(model: /*elided*/ any): void;
3177
+ /**
3178
+ * @param {ModelValue | null | undefined} oldValue
3179
+ * @param {ModelValue | null | undefined} newValue
3180
+ * @returns {boolean | void}
3181
+ */
3182
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3183
+ /**
3184
+ * @param {ModelValue | null | undefined} oldValue
3185
+ * @param {ModelValue | null | undefined} newValue
3186
+ * @returns {boolean | void}
3187
+ */
3188
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3189
+ /**
3190
+ * @param {ModelValue | null | undefined} oldValue
3191
+ * @param {ModelValue | null | undefined} newValue
3192
+ * @returns {boolean | void}
3193
+ */
3194
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3195
+ /** @returns {ModelClassDataType} */
3196
+ modelClassData(): ModelClassDataType;
3197
+ /** @returns {Promise<void>} */
3198
+ reload(): Promise<void>;
3199
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
3200
+ save(): Promise<{
3201
+ model: /*elided*/ any;
3202
+ response?: object;
3203
+ }>;
3204
+ /**
3205
+ * @param {RawDataInput} rawData
3206
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
3207
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
3208
+ */
3209
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
3210
+ simpleModelErrors?: boolean;
3211
+ }): Promise<{
3212
+ model: /*elided*/ any;
3213
+ response: ModelCommandResponse;
3214
+ }>;
3215
+ /**
3216
+ * @param {ModelDataMap} [newAttributes]
3217
+ * @param {ParseValidationErrorsOptions} [options]
3218
+ * @returns {Promise<{
3219
+ * model: BaseModel,
3220
+ * response?: object
3221
+ * }>}
3222
+ */
3223
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
3224
+ model: /*elided*/ any;
3225
+ response?: object;
3226
+ }>;
3227
+ /**
3228
+ * @param {ModelCommandResponse} response
3229
+ * @returns {void}
3230
+ */
3231
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
3232
+ /**
3233
+ * @param {ModelCommandResponse} response
3234
+ * @returns {void}
3235
+ */
3236
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
3237
+ /**
3238
+ * @param {RawDataInput} rawData
3239
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
3240
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
3241
+ */
3242
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
3243
+ simpleModelErrors?: boolean;
3244
+ }): Promise<{
3245
+ response: ModelCommandResponse;
3246
+ model: /*elided*/ any;
3247
+ }>;
3248
+ /** @returns {never} */
3249
+ isValid(): never;
3250
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
3251
+ isValidOnServer(): Promise<{
3252
+ valid: boolean;
3253
+ errors: ValidationResponseErrors;
3254
+ }>;
3255
+ /** @returns {BaseModelClassType} */
3256
+ modelClass(): BaseModelClassType;
3257
+ /**
3258
+ * @param {string} relationshipName
3259
+ * @param {BaseModel | BaseModel[] | null} model
3260
+ * @returns {void}
3261
+ */
3262
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
3263
+ /** @returns {void} */
3264
+ markForDestruction(): void;
3265
+ /** @returns {boolean} */
3266
+ markedForDestruction(): boolean;
3267
+ /** @returns {number} */
3268
+ uniqueKey(): number;
3269
+ /**
3270
+ * @param {ModelCommandDescriptor} args
3271
+ * @param {ModelCommandOptions} commandArgs
3272
+ * @returns {import("./command-execution.js").default}
3273
+ */
3274
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
3275
+ /**
3276
+ * @param {string} attributeName
3277
+ * @returns {ModelValue | null | undefined}
3278
+ */
3279
+ readAttribute(attributeName: string): ModelValue | null | undefined;
3280
+ /**
3281
+ * @param {string} attributeName
3282
+ * @returns {ModelValue | null | undefined}
3283
+ */
3284
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
3285
+ /**
3286
+ * @param {string} attributeName
3287
+ * @returns {boolean}
3288
+ */
3289
+ isAttributeLoaded(attributeName: string): boolean;
3290
+ /**
3291
+ * @param {ModelValue | null | undefined} value
3292
+ * @returns {boolean}
3293
+ */
3294
+ _isPresent(value: ModelValue | null | undefined): boolean;
3295
+ /**
3296
+ *
3297
+ * @param {RelationshipLoadArgs} args
3298
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3299
+ * @returns {Promise<BaseModel | null>}
3300
+ */
3301
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
3302
+ /**
3303
+ *
3304
+ * @param {RelationshipLoadArgs} args
3305
+ * @returns {BaseModel | null}
3306
+ */
3307
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
3308
+ /**
3309
+ *
3310
+ * @param {RelationshipLoadArgs} args
3311
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3312
+ * @returns {Promise<BaseModel[]>}
3313
+ */
3314
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
3315
+ /**
3316
+ *
3317
+ * @param {RelationshipLoadArgs} args
3318
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3319
+ * @returns {Promise<BaseModel | null>}
3320
+ */
3321
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
3322
+ /**
3323
+ *
3324
+ * @param {RelationshipLoadArgs} args
3325
+ * @returns {BaseModel | null}
3326
+ */
3327
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
3328
+ /**
3329
+ * @param {BaseModelArgsObject} [args]
3330
+ * @returns {void}
3331
+ */
3332
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
3333
+ /**
3334
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
3335
+ * @returns {void}
3336
+ */
3337
+ _readPreloadedRelationships(preloaded: {
3338
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
3339
+ }): void;
3340
+ /** @returns {number | string} */
3341
+ primaryKey(): number | string;
3342
+ }>;
3343
+ /**
3344
+ * @param {ModelDataMap} findOrCreateByArgs
3345
+ * @param {object} [args]
3346
+ * @param {ModelDataMap} [args.additionalData]
3347
+ * @returns {Promise<BaseModel>}
3348
+ */
3349
+ findOrCreateBy(findOrCreateByArgs: ModelDataMap, args?: {
3350
+ additionalData?: ModelDataMap;
3351
+ }): Promise<{
3352
+ abilities: ModelAbilityMap;
3353
+ changes: ModelDataMap;
3354
+ collection: Collection<any>;
3355
+ _identifierKey: string | number;
3356
+ _markedForDestruction: boolean;
3357
+ modelData: ModelDataMap;
3358
+ newRecord: boolean;
3359
+ previousModelData: any;
3360
+ preloadedRelationships: PreloadedRelationshipMap;
3361
+ relationshipsCache: LoadedRelationshipMap;
3362
+ relationships: LoadedRelationshipMap;
3363
+ uniqueKeyValue: number;
3364
+ /**
3365
+ * @param {ModelDataMap} newAttributes
3366
+ * @returns {void}
3367
+ */
3368
+ assignAttributes(newAttributes: ModelDataMap): void;
3369
+ /** @returns {ModelDataMap} */
3370
+ attributes(): ModelDataMap;
3371
+ /**
3372
+ * @param {string} givenAbilityName
3373
+ * @returns {boolean}
3374
+ */
3375
+ can(givenAbilityName: string): boolean;
3376
+ /** @returns {BaseModel} */
3377
+ clone(): /*elided*/ any;
3378
+ /** @returns {number | string} */
3379
+ cacheKey(): number | string;
3380
+ /** @returns {string} */
3381
+ localCacheKey(): string;
3382
+ /** @returns {string} */
3383
+ fullCacheKey(): string;
3384
+ /**
3385
+ * @param {ModelDataMap} [attributes]
3386
+ * @param {ParseValidationErrorsOptions} [options]
3387
+ * @returns {Promise<{
3388
+ * model: BaseModel,
3389
+ * response: ModelCommandResponse
3390
+ * }>}
3391
+ */
3392
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
3393
+ model: /*elided*/ any;
3394
+ response: ModelCommandResponse;
3395
+ }>;
3396
+ /**
3397
+ * @param {RawDataInput} rawData
3398
+ * @param {ParseValidationErrorsOptions} [options]
3399
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
3400
+ */
3401
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
3402
+ model: /*elided*/ any;
3403
+ response: ModelCommandResponse;
3404
+ }>;
3405
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
3406
+ destroy(): Promise<{
3407
+ model: /*elided*/ any;
3408
+ response: ModelCommandResponse;
3409
+ }>;
3410
+ /**
3411
+ * @param {string[]} listOfAbilities
3412
+ * @returns {Promise<void>}
3413
+ */
3414
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
3415
+ /** @returns {ModelDataMap} */
3416
+ getAttributes(): ModelDataMap;
3417
+ /**
3418
+ * @param {ModelCommandResponse} response
3419
+ * @returns {never}
3420
+ */
3421
+ handleResponseError(response: ModelCommandResponse): never;
3422
+ /** @returns {number | string} */
3423
+ identifierKey(): number | string;
3424
+ /**
3425
+ * @param {string} associationName
3426
+ * @returns {boolean}
3427
+ */
3428
+ isAssociationLoaded(associationName: string): boolean;
3429
+ /**
3430
+ * @param {string} associationNameUnderscore
3431
+ * @returns {boolean}
3432
+ */
3433
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
3434
+ /**
3435
+ * @param {string} associationName
3436
+ * @returns {boolean}
3437
+ */
3438
+ isAssociationPresent(associationName: string): boolean;
3439
+ /**
3440
+ * @param {string} associationName
3441
+ * @returns {Promise<LoadedRelationshipValue>}
3442
+ */
3443
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
3444
+ /**
3445
+ * @param {string} associationNameUnderscore
3446
+ * @returns {Promise<LoadedRelationshipValue>}
3447
+ */
3448
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
3449
+ /**
3450
+ * @param {string} attributeName
3451
+ * @returns {boolean}
3452
+ */
3453
+ isAttributeChanged(attributeName: string): boolean;
3454
+ /** @returns {boolean} */
3455
+ isChanged(): boolean;
3456
+ /** @returns {boolean} */
3457
+ isNewRecord(): boolean;
3458
+ /** @returns {boolean} */
3459
+ isPersisted(): boolean;
3460
+ /**
3461
+ * @param {string} attributeName
3462
+ * @returns {boolean}
3463
+ */
3464
+ savedChangeToAttribute(attributeName: string): boolean;
3465
+ /**
3466
+ * @param {BaseModel} model
3467
+ * @returns {void}
3468
+ */
3469
+ setNewModel(model: /*elided*/ any): void;
3470
+ /**
3471
+ * @param {BaseModel} model
3472
+ * @returns {void}
3473
+ */
3474
+ setNewModelData(model: /*elided*/ any): void;
3475
+ /**
3476
+ * @param {ModelValue | null | undefined} oldValue
3477
+ * @param {ModelValue | null | undefined} newValue
3478
+ * @returns {boolean | void}
3479
+ */
3480
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3481
+ /**
3482
+ * @param {ModelValue | null | undefined} oldValue
3483
+ * @param {ModelValue | null | undefined} newValue
3484
+ * @returns {boolean | void}
3485
+ */
3486
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3487
+ /**
3488
+ * @param {ModelValue | null | undefined} oldValue
3489
+ * @param {ModelValue | null | undefined} newValue
3490
+ * @returns {boolean | void}
3491
+ */
3492
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3493
+ /** @returns {ModelClassDataType} */
3494
+ modelClassData(): ModelClassDataType;
3495
+ /** @returns {Promise<void>} */
3496
+ reload(): Promise<void>;
3497
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
3498
+ save(): Promise<{
3499
+ model: /*elided*/ any;
3500
+ response?: object;
3501
+ }>;
3502
+ /**
3503
+ * @param {RawDataInput} rawData
3504
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
3505
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
3506
+ */
3507
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
3508
+ simpleModelErrors?: boolean;
3509
+ }): Promise<{
3510
+ model: /*elided*/ any;
3511
+ response: ModelCommandResponse;
3512
+ }>;
3513
+ /**
3514
+ * @param {ModelDataMap} [newAttributes]
3515
+ * @param {ParseValidationErrorsOptions} [options]
3516
+ * @returns {Promise<{
3517
+ * model: BaseModel,
3518
+ * response?: object
3519
+ * }>}
3520
+ */
3521
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
3522
+ model: /*elided*/ any;
3523
+ response?: object;
3524
+ }>;
3525
+ /**
3526
+ * @param {ModelCommandResponse} response
3527
+ * @returns {void}
3528
+ */
3529
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
3530
+ /**
3531
+ * @param {ModelCommandResponse} response
3532
+ * @returns {void}
3533
+ */
3534
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
3535
+ /**
3536
+ * @param {RawDataInput} rawData
3537
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
3538
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
3539
+ */
3540
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
3541
+ simpleModelErrors?: boolean;
3542
+ }): Promise<{
3543
+ response: ModelCommandResponse;
3544
+ model: /*elided*/ any;
3545
+ }>;
3546
+ /** @returns {never} */
3547
+ isValid(): never;
3548
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
3549
+ isValidOnServer(): Promise<{
3550
+ valid: boolean;
3551
+ errors: ValidationResponseErrors;
3552
+ }>;
3553
+ /** @returns {BaseModelClassType} */
3554
+ modelClass(): BaseModelClassType;
3555
+ /**
3556
+ * @param {string} relationshipName
3557
+ * @param {BaseModel | BaseModel[] | null} model
3558
+ * @returns {void}
3559
+ */
3560
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
3561
+ /** @returns {void} */
3562
+ markForDestruction(): void;
3563
+ /** @returns {boolean} */
3564
+ markedForDestruction(): boolean;
3565
+ /** @returns {number} */
3566
+ uniqueKey(): number;
3567
+ /**
3568
+ * @param {ModelCommandDescriptor} args
3569
+ * @param {ModelCommandOptions} commandArgs
3570
+ * @returns {import("./command-execution.js").default}
3571
+ */
3572
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
3573
+ /**
3574
+ * @param {string} attributeName
3575
+ * @returns {ModelValue | null | undefined}
3576
+ */
3577
+ readAttribute(attributeName: string): ModelValue | null | undefined;
3578
+ /**
3579
+ * @param {string} attributeName
3580
+ * @returns {ModelValue | null | undefined}
3581
+ */
3582
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
3583
+ /**
3584
+ * @param {string} attributeName
3585
+ * @returns {boolean}
3586
+ */
3587
+ isAttributeLoaded(attributeName: string): boolean;
3588
+ /**
3589
+ * @param {ModelValue | null | undefined} value
3590
+ * @returns {boolean}
3591
+ */
3592
+ _isPresent(value: ModelValue | null | undefined): boolean;
3593
+ /**
3594
+ *
3595
+ * @param {RelationshipLoadArgs} args
3596
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3597
+ * @returns {Promise<BaseModel | null>}
3598
+ */
3599
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
3600
+ /**
3601
+ *
3602
+ * @param {RelationshipLoadArgs} args
3603
+ * @returns {BaseModel | null}
3604
+ */
3605
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
3606
+ /**
3607
+ *
3608
+ * @param {RelationshipLoadArgs} args
3609
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3610
+ * @returns {Promise<BaseModel[]>}
3611
+ */
3612
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
3613
+ /**
3614
+ *
3615
+ * @param {RelationshipLoadArgs} args
3616
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3617
+ * @returns {Promise<BaseModel | null>}
3618
+ */
3619
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
3620
+ /**
3621
+ *
3622
+ * @param {RelationshipLoadArgs} args
3623
+ * @returns {BaseModel | null}
3624
+ */
3625
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
3626
+ /**
3627
+ * @param {BaseModelArgsObject} [args]
3628
+ * @returns {void}
3629
+ */
3630
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
3631
+ /**
3632
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
3633
+ * @returns {void}
3634
+ */
3635
+ _readPreloadedRelationships(preloaded: {
3636
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
3637
+ }): void;
3638
+ /** @returns {number | string} */
3639
+ primaryKey(): number | string;
3640
+ }>;
3641
+ /** @returns {ModelName} */
3642
+ modelName(): ModelName;
3643
+ /** @returns {string} */
3644
+ primaryKey(): string;
3645
+ /**
3646
+ * @param {import("./collection.js").CollectionRansackParams} [query]
3647
+ * @returns {import("./collection.js").default}
3648
+ */
3649
+ ransack(query?: import("./collection.js").CollectionRansackParams): Collection<any>;
3650
+ /**
3651
+ * @param {Record<string, string[]>} [select]
3652
+ * @returns {import("./collection.js").default}
3653
+ */
3654
+ select(select?: Record<string, string[]>): Collection<any>;
3655
+ /** @returns {Reflection[]} */
3656
+ ransackableAssociations(): Reflection[];
3657
+ /** @returns {Attribute[]} */
3658
+ ransackableAttributes(): Attribute[];
3659
+ /** @returns {Scope[]} */
3660
+ ransackableScopes(): Scope[];
3661
+ /** @returns {Reflection[]} */
3662
+ reflections(): Reflection[];
3663
+ /**
3664
+ * @param {string} name
3665
+ * @returns {Reflection}
3666
+ */
3667
+ reflection(name: string): Reflection;
3668
+ /** @returns {string | undefined} */
3669
+ _token(): string | undefined;
3670
+ /** @returns {import("./collection.js").default} */
3671
+ all(): Collection<any>;
3672
+ /**
3673
+ * @param {object} args
3674
+ * @param {ValidationError | Error | ValidationErrorWithResponse} args.error
3675
+ * @param {BaseModel} [args.model]
3676
+ * @param {ParseValidationErrorsOptions} [args.options]
3677
+ */
3678
+ parseValidationErrors({ error, model, options }: {
3679
+ error: ValidationError | Error | ValidationErrorWithResponse;
3680
+ model?: {
3681
+ abilities: ModelAbilityMap;
3682
+ changes: ModelDataMap;
3683
+ collection: Collection<any>;
3684
+ _identifierKey: string | number;
3685
+ _markedForDestruction: boolean;
3686
+ modelData: ModelDataMap;
3687
+ newRecord: boolean;
3688
+ previousModelData: any;
3689
+ preloadedRelationships: PreloadedRelationshipMap;
3690
+ relationshipsCache: LoadedRelationshipMap;
3691
+ relationships: LoadedRelationshipMap;
3692
+ uniqueKeyValue: number;
3693
+ /**
3694
+ * @param {ModelDataMap} newAttributes
3695
+ * @returns {void}
3696
+ */
3697
+ assignAttributes(newAttributes: ModelDataMap): void;
3698
+ /** @returns {ModelDataMap} */
3699
+ attributes(): ModelDataMap;
3700
+ /**
3701
+ * @param {string} givenAbilityName
3702
+ * @returns {boolean}
3703
+ */
3704
+ can(givenAbilityName: string): boolean;
3705
+ /** @returns {BaseModel} */
3706
+ clone(): /*elided*/ any;
3707
+ /** @returns {number | string} */
3708
+ cacheKey(): number | string;
3709
+ /** @returns {string} */
3710
+ localCacheKey(): string;
3711
+ /** @returns {string} */
3712
+ fullCacheKey(): string;
3713
+ /**
3714
+ * @param {ModelDataMap} [attributes]
3715
+ * @param {ParseValidationErrorsOptions} [options]
3716
+ * @returns {Promise<{
3717
+ * model: BaseModel,
3718
+ * response: ModelCommandResponse
3719
+ * }>}
3720
+ */
3721
+ create(attributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
3722
+ model: /*elided*/ any;
3723
+ response: ModelCommandResponse;
3724
+ }>;
3725
+ /**
3726
+ * @param {RawDataInput} rawData
3727
+ * @param {ParseValidationErrorsOptions} [options]
3728
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
3729
+ */
3730
+ createRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions): Promise<{
3731
+ model: /*elided*/ any;
3732
+ response: ModelCommandResponse;
3733
+ }>;
3734
+ /** @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>} */
3735
+ destroy(): Promise<{
3736
+ model: /*elided*/ any;
3737
+ response: ModelCommandResponse;
3738
+ }>;
3739
+ /**
3740
+ * @param {string[]} listOfAbilities
3741
+ * @returns {Promise<void>}
3742
+ */
3743
+ ensureAbilities(listOfAbilities: string[]): Promise<void>;
3744
+ /** @returns {ModelDataMap} */
3745
+ getAttributes(): ModelDataMap;
3746
+ /**
3747
+ * @param {ModelCommandResponse} response
3748
+ * @returns {never}
3749
+ */
3750
+ handleResponseError(response: ModelCommandResponse): never;
3751
+ /** @returns {number | string} */
3752
+ identifierKey(): number | string;
3753
+ /**
3754
+ * @param {string} associationName
3755
+ * @returns {boolean}
3756
+ */
3757
+ isAssociationLoaded(associationName: string): boolean;
3758
+ /**
3759
+ * @param {string} associationNameUnderscore
3760
+ * @returns {boolean}
3761
+ */
3762
+ isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
3763
+ /**
3764
+ * @param {string} associationName
3765
+ * @returns {boolean}
3766
+ */
3767
+ isAssociationPresent(associationName: string): boolean;
3768
+ /**
3769
+ * @param {string} associationName
3770
+ * @returns {Promise<LoadedRelationshipValue>}
3771
+ */
3772
+ ensureAssociationLoaded(associationName: string): Promise<LoadedRelationshipValue>;
3773
+ /**
3774
+ * @param {string} associationNameUnderscore
3775
+ * @returns {Promise<LoadedRelationshipValue>}
3776
+ */
3777
+ ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<LoadedRelationshipValue>;
3778
+ /**
3779
+ * @param {string} attributeName
3780
+ * @returns {boolean}
3781
+ */
3782
+ isAttributeChanged(attributeName: string): boolean;
3783
+ /** @returns {boolean} */
3784
+ isChanged(): boolean;
3785
+ /** @returns {boolean} */
3786
+ isNewRecord(): boolean;
3787
+ /** @returns {boolean} */
3788
+ isPersisted(): boolean;
3789
+ /**
3790
+ * @param {string} attributeName
3791
+ * @returns {boolean}
3792
+ */
3793
+ savedChangeToAttribute(attributeName: string): boolean;
3794
+ /**
3795
+ * @param {BaseModel} model
3796
+ * @returns {void}
3797
+ */
3798
+ setNewModel(model: /*elided*/ any): void;
3799
+ /**
3800
+ * @param {BaseModel} model
3801
+ * @returns {void}
3802
+ */
3803
+ setNewModelData(model: /*elided*/ any): void;
3804
+ /**
3805
+ * @param {ModelValue | null | undefined} oldValue
3806
+ * @param {ModelValue | null | undefined} newValue
3807
+ * @returns {boolean | void}
3808
+ */
3809
+ _isDateChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3810
+ /**
3811
+ * @param {ModelValue | null | undefined} oldValue
3812
+ * @param {ModelValue | null | undefined} newValue
3813
+ * @returns {boolean | void}
3814
+ */
3815
+ _isIntegerChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3816
+ /**
3817
+ * @param {ModelValue | null | undefined} oldValue
3818
+ * @param {ModelValue | null | undefined} newValue
3819
+ * @returns {boolean | void}
3820
+ */
3821
+ _isStringChanged(oldValue: ModelValue | null | undefined, newValue: ModelValue | null | undefined): boolean | void;
3822
+ /** @returns {ModelClassDataType} */
3823
+ modelClassData(): ModelClassDataType;
3824
+ /** @returns {Promise<void>} */
3825
+ reload(): Promise<void>;
3826
+ /** @returns {Promise<{model: BaseModel, response?: object}>} */
3827
+ save(): Promise<{
3828
+ model: /*elided*/ any;
3829
+ response?: object;
3830
+ }>;
3831
+ /**
3832
+ * @param {RawDataInput} rawData
3833
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
3834
+ * @returns {Promise<{model: BaseModel, response: ModelCommandResponse}>}
3835
+ */
3836
+ saveRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
3837
+ simpleModelErrors?: boolean;
3838
+ }): Promise<{
3839
+ model: /*elided*/ any;
3840
+ response: ModelCommandResponse;
3841
+ }>;
3842
+ /**
3843
+ * @param {ModelDataMap} [newAttributes]
3844
+ * @param {ParseValidationErrorsOptions} [options]
3845
+ * @returns {Promise<{
3846
+ * model: BaseModel,
3847
+ * response?: object
3848
+ * }>}
3849
+ */
3850
+ update(newAttributes?: ModelDataMap, options?: ParseValidationErrorsOptions): Promise<{
3851
+ model: /*elided*/ any;
3852
+ response?: object;
3853
+ }>;
3854
+ /**
3855
+ * @param {ModelCommandResponse} response
3856
+ * @returns {void}
3857
+ */
3858
+ _refreshModelFromResponse(response: ModelCommandResponse): void;
3859
+ /**
3860
+ * @param {ModelCommandResponse} response
3861
+ * @returns {void}
3862
+ */
3863
+ _refreshModelDataFromResponse(response: ModelCommandResponse): void;
3864
+ /**
3865
+ * @param {RawDataInput} rawData
3866
+ * @param {ParseValidationErrorsOptions & {simpleModelErrors?: boolean}} [options]
3867
+ * @returns {Promise<{response: ModelCommandResponse, model: BaseModel}>}
3868
+ */
3869
+ updateRaw(rawData: RawDataInput, options?: ParseValidationErrorsOptions & {
3870
+ simpleModelErrors?: boolean;
3871
+ }): Promise<{
3872
+ response: ModelCommandResponse;
3873
+ model: /*elided*/ any;
3874
+ }>;
3875
+ /** @returns {never} */
3876
+ isValid(): never;
3877
+ /** @returns {Promise<{valid: boolean, errors: ValidationResponseErrors}>} */
3878
+ isValidOnServer(): Promise<{
3879
+ valid: boolean;
3880
+ errors: ValidationResponseErrors;
3881
+ }>;
3882
+ /** @returns {BaseModelClassType} */
3883
+ modelClass(): BaseModelClassType;
3884
+ /**
3885
+ * @param {string} relationshipName
3886
+ * @param {BaseModel | BaseModel[] | null} model
3887
+ * @returns {void}
3888
+ */
3889
+ preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
3890
+ /** @returns {void} */
3891
+ markForDestruction(): void;
3892
+ /** @returns {boolean} */
3893
+ markedForDestruction(): boolean;
3894
+ /** @returns {number} */
3895
+ uniqueKey(): number;
3896
+ /**
3897
+ * @param {ModelCommandDescriptor} args
3898
+ * @param {ModelCommandOptions} commandArgs
3899
+ * @returns {import("./command-execution.js").default}
3900
+ */
3901
+ _callMemberCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): import("./command-execution.js").default;
3902
+ /**
3903
+ * @param {string} attributeName
3904
+ * @returns {ModelValue | null | undefined}
3905
+ */
3906
+ readAttribute(attributeName: string): ModelValue | null | undefined;
3907
+ /**
3908
+ * @param {string} attributeName
3909
+ * @returns {ModelValue | null | undefined}
3910
+ */
3911
+ readAttributeUnderscore(attributeName: string): ModelValue | null | undefined;
3912
+ /**
3913
+ * @param {string} attributeName
3914
+ * @returns {boolean}
3915
+ */
3916
+ isAttributeLoaded(attributeName: string): boolean;
3917
+ /**
3918
+ * @param {ModelValue | null | undefined} value
3919
+ * @returns {boolean}
3920
+ */
3921
+ _isPresent(value: ModelValue | null | undefined): boolean;
3922
+ /**
3923
+ *
3924
+ * @param {RelationshipLoadArgs} args
3925
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3926
+ * @returns {Promise<BaseModel | null>}
3927
+ */
3928
+ _loadBelongsToReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
3929
+ /**
3930
+ *
3931
+ * @param {RelationshipLoadArgs} args
3932
+ * @returns {BaseModel | null}
3933
+ */
3934
+ _readBelongsToReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
3935
+ /**
3936
+ *
3937
+ * @param {RelationshipLoadArgs} args
3938
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3939
+ * @returns {Promise<BaseModel[]>}
3940
+ */
3941
+ _loadHasManyReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any[]>;
3942
+ /**
3943
+ *
3944
+ * @param {RelationshipLoadArgs} args
3945
+ * @param {import("./collection.js").QueryArgsType} queryArgs
3946
+ * @returns {Promise<BaseModel | null>}
3947
+ */
3948
+ _loadHasOneReflection(args: RelationshipLoadArgs, queryArgs?: import("./collection.js").QueryArgsType): Promise</*elided*/ any | null>;
3949
+ /**
3950
+ *
3951
+ * @param {RelationshipLoadArgs} args
3952
+ * @returns {BaseModel | null}
3953
+ */
3954
+ _readHasOneReflection({ reflectionName }: RelationshipLoadArgs): /*elided*/ any | null;
3955
+ /**
3956
+ * @param {BaseModelArgsObject} [args]
3957
+ * @returns {void}
3958
+ */
3959
+ _readModelDataFromArgs(args?: BaseModelArgsObject): void;
3960
+ /**
3961
+ * @param {{getModel: (relationshipType: string, relationshipId: number | string) => BaseModel}} preloaded
3962
+ * @returns {void}
3963
+ */
3964
+ _readPreloadedRelationships(preloaded: {
3965
+ getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
3966
+ }): void;
3967
+ /** @returns {number | string} */
3968
+ primaryKey(): number | string;
3969
+ };
3970
+ options?: ParseValidationErrorsOptions;
3971
+ }): void;
3972
+ /**
3973
+ * @param {string} attributeName
3974
+ * @returns {string}
3975
+ */
3976
+ humanAttributeName(attributeName: string): string;
3977
+ /**
3978
+ * @param {string} string
3979
+ * @returns {string}
3980
+ */
3981
+ snakeCase(string: string): string;
3982
+ /**
3983
+ * @param {RawDataInput} rawData
3984
+ * @param {object} options
3985
+ * @returns {ModelDataMap}
3986
+ */
3987
+ _objectDataFromGivenRawData(rawData: RawDataInput, options: object): ModelDataMap;
3988
+ /**
3989
+ * @param {RawDataInput | ModelValue} value
3990
+ * @returns {value is HTMLFormElement}
3991
+ */
3992
+ _isFormElement(value: RawDataInput | ModelValue): value is HTMLFormElement;
3993
+ /**
3994
+ * @param {ModelCommandDescriptor} args
3995
+ * @param {ModelCommandOptions} commandArgs
3996
+ * @returns {Promise<ModelCommandResponse>}
3997
+ */
3998
+ _callCollectionCommand(args: ModelCommandDescriptor, commandArgs: ModelCommandOptions): Promise<ModelCommandResponse>;
3999
+ /**
4000
+ * @param {FormData | ModelDataMap} [args]
4001
+ * @returns {FormData}
4002
+ */
4003
+ _postDataFromArgs(args?: FormData | ModelDataMap): FormData;
4004
+ };
327
4005
  import Collection from "./collection.js";
4006
+ import Attribute from "./base-model/attribute.js";
4007
+ import ModelName from "./model-name.js";
4008
+ import Reflection from "./base-model/reflection.js";
4009
+ import Scope from "./base-model/scope.js";
4010
+ import { ValidationErrors } from "./validation-errors.js";
4011
+ import ValidationError from "./validation-error.js";
328
4012
  //# sourceMappingURL=base-model.d.ts.map