@warp-drive/legacy 5.9.0-alpha.21 → 5.9.0-alpha.22

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 (467) hide show
  1. package/dist/-private-DQ6Iap2t.js +193 -0
  2. package/dist/-private-DQ6Iap2t.js.map +1 -0
  3. package/dist/-private-DccRZQsm.js +904 -0
  4. package/dist/-private-DccRZQsm.js.map +1 -0
  5. package/dist/adapter/-private.d.ts +33 -0
  6. package/dist/adapter/-private.d.ts.map +1 -0
  7. package/dist/adapter/-private.js +3 -1
  8. package/dist/adapter/error.d.ts +2 -0
  9. package/dist/adapter/error.js +422 -453
  10. package/dist/adapter/error.js.map +1 -0
  11. package/{declarations → dist}/adapter/json-api.d.ts +30 -29
  12. package/dist/adapter/json-api.d.ts.map +1 -0
  13. package/dist/adapter/json-api.js +265 -143
  14. package/dist/adapter/json-api.js.map +1 -0
  15. package/dist/adapter/rest.d.ts +2 -0
  16. package/dist/adapter/rest.js +937 -1136
  17. package/dist/adapter/rest.js.map +1 -0
  18. package/dist/adapter-CARrK3-8.d.ts +784 -0
  19. package/dist/adapter-CARrK3-8.d.ts.map +1 -0
  20. package/dist/adapter-XgLAkYVs.js +1130 -0
  21. package/dist/adapter-XgLAkYVs.js.map +1 -0
  22. package/dist/adapter.d.ts +2 -0
  23. package/dist/adapter.js +1 -1248
  24. package/dist/compat/-private.d.ts +2 -0
  25. package/dist/compat/-private.js +3 -1
  26. package/dist/compat/builders.d.ts +169 -0
  27. package/dist/compat/builders.d.ts.map +1 -0
  28. package/dist/compat/builders.js +205 -245
  29. package/dist/compat/builders.js.map +1 -0
  30. package/dist/compat/extensions.d.ts +2 -0
  31. package/dist/compat/extensions.js +265 -304
  32. package/dist/compat/extensions.js.map +1 -0
  33. package/dist/compat/utils.d.ts +151 -0
  34. package/dist/compat/utils.d.ts.map +1 -0
  35. package/dist/compat/utils.js +187 -206
  36. package/dist/compat/utils.js.map +1 -0
  37. package/dist/compat-BbNNmTM-.d.ts +1386 -0
  38. package/dist/compat-BbNNmTM-.d.ts.map +1 -0
  39. package/dist/compat-g__Pfy2S.js +734 -0
  40. package/dist/compat-g__Pfy2S.js.map +1 -0
  41. package/dist/compat.d.ts +2 -0
  42. package/dist/compat.js +1 -1036
  43. package/dist/error-CzkyXr1Q.d.ts +435 -0
  44. package/dist/error-CzkyXr1Q.d.ts.map +1 -0
  45. package/dist/errors-LQhmDVdd.js +2134 -0
  46. package/dist/errors-LQhmDVdd.js.map +1 -0
  47. package/dist/extensions-DumNm4dA.d.ts +102 -0
  48. package/dist/extensions-DumNm4dA.d.ts.map +1 -0
  49. package/dist/index.d.ts +243 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +267 -339
  52. package/dist/index.js.map +1 -0
  53. package/dist/json-BXNPTlcH.js +1106 -0
  54. package/dist/json-BXNPTlcH.js.map +1 -0
  55. package/dist/model/-private.d.ts +3 -0
  56. package/dist/model/-private.js +3 -1
  57. package/dist/model/migration-support.d.ts +335 -0
  58. package/dist/model/migration-support.d.ts.map +1 -0
  59. package/dist/model/migration-support.js +504 -575
  60. package/dist/model/migration-support.js.map +1 -0
  61. package/dist/model-62hn5_PD.d.ts +3107 -0
  62. package/dist/model-62hn5_PD.d.ts.map +1 -0
  63. package/dist/model-BtIEHqYZ.js +683 -0
  64. package/dist/model-BtIEHqYZ.js.map +1 -0
  65. package/dist/model-fragments-Dpn9285r.js +334 -0
  66. package/dist/model-fragments-Dpn9285r.js.map +1 -0
  67. package/dist/model-fragments.d.ts +294 -0
  68. package/dist/model-fragments.d.ts.map +1 -0
  69. package/dist/model-fragments.js +2 -94
  70. package/dist/model.d.ts +404 -0
  71. package/dist/model.d.ts.map +1 -0
  72. package/dist/model.js +3 -670
  73. package/{declarations/adapter/rest.d.ts → dist/rest-0NhtexIq.d.ts} +183 -173
  74. package/dist/rest-0NhtexIq.d.ts.map +1 -0
  75. package/dist/runtime-BPCpkOf1-BgO3Lyjx.js +53 -0
  76. package/dist/runtime-BPCpkOf1-BgO3Lyjx.js.map +1 -0
  77. package/dist/schema-provider-DsKuB5Wb.js +1929 -0
  78. package/dist/schema-provider-DsKuB5Wb.js.map +1 -0
  79. package/{declarations → dist}/serializer/json-api.d.ts +3 -0
  80. package/dist/serializer/json-api.d.ts.map +1 -0
  81. package/dist/serializer/json-api.js +527 -519
  82. package/dist/serializer/json-api.js.map +1 -0
  83. package/{declarations → dist}/serializer/json.d.ts +3 -0
  84. package/dist/serializer/json.d.ts.map +1 -0
  85. package/dist/serializer/json.js +3 -6
  86. package/{declarations/serializer/-private/embedded-records-mixin.d.ts → dist/serializer/rest.d.ts} +56 -1
  87. package/dist/serializer/rest.d.ts.map +1 -0
  88. package/dist/serializer/rest.js +958 -1199
  89. package/dist/serializer/rest.js.map +1 -0
  90. package/dist/serializer/transform.d.ts +313 -0
  91. package/dist/serializer/transform.d.ts.map +1 -0
  92. package/dist/serializer/transform.js +283 -308
  93. package/dist/serializer/transform.js.map +1 -0
  94. package/dist/serializer.d.ts +151 -0
  95. package/dist/serializer.d.ts.map +1 -0
  96. package/dist/serializer.js +205 -205
  97. package/dist/serializer.js.map +1 -0
  98. package/dist/store-C4qYzXei.js +473 -0
  99. package/dist/store-C4qYzXei.js.map +1 -0
  100. package/dist/store.d.ts +13 -0
  101. package/dist/store.d.ts.map +1 -0
  102. package/dist/store.js +1 -641
  103. package/dist/unpkg/dev/-private-CrEyBE-B.js +189 -0
  104. package/dist/unpkg/dev/-private-CrEyBE-B.js.map +1 -0
  105. package/dist/unpkg/dev/-private-vOhxVExH.js +896 -0
  106. package/dist/unpkg/dev/-private-vOhxVExH.js.map +1 -0
  107. package/dist/unpkg/dev/adapter/-private.js +3 -1
  108. package/dist/unpkg/dev/adapter/error.js +421 -452
  109. package/dist/unpkg/dev/adapter/error.js.map +1 -0
  110. package/dist/unpkg/dev/adapter/json-api.js +239 -257
  111. package/dist/unpkg/dev/adapter/json-api.js.map +1 -0
  112. package/dist/unpkg/dev/adapter/rest.js +935 -1134
  113. package/dist/unpkg/dev/adapter/rest.js.map +1 -0
  114. package/dist/unpkg/dev/adapter-Cw0uSl8d.js +1129 -0
  115. package/dist/unpkg/dev/adapter-Cw0uSl8d.js.map +1 -0
  116. package/dist/unpkg/dev/adapter.js +1 -1247
  117. package/dist/unpkg/dev/compat/-private.js +3 -1
  118. package/dist/unpkg/dev/compat/builders.js +204 -247
  119. package/dist/unpkg/dev/compat/builders.js.map +1 -0
  120. package/dist/unpkg/dev/compat/extensions.js +264 -303
  121. package/dist/unpkg/dev/compat/extensions.js.map +1 -0
  122. package/dist/unpkg/dev/compat/utils.js +186 -205
  123. package/dist/unpkg/dev/compat/utils.js.map +1 -0
  124. package/dist/unpkg/dev/compat-CeyxXB7K.js +825 -0
  125. package/dist/unpkg/dev/compat-CeyxXB7K.js.map +1 -0
  126. package/dist/unpkg/dev/compat.js +1 -1178
  127. package/dist/unpkg/dev/errors-1javxsPo.js +2127 -0
  128. package/dist/unpkg/dev/errors-1javxsPo.js.map +1 -0
  129. package/dist/unpkg/dev/index.js +266 -344
  130. package/dist/unpkg/dev/index.js.map +1 -0
  131. package/dist/unpkg/dev/json-DDJji3V3.js +1104 -0
  132. package/dist/unpkg/dev/json-DDJji3V3.js.map +1 -0
  133. package/dist/unpkg/dev/model/-private.js +3 -1
  134. package/dist/unpkg/dev/model/migration-support.js +481 -549
  135. package/dist/unpkg/dev/model/migration-support.js.map +1 -0
  136. package/dist/unpkg/dev/model-C9Xb1R1x.js +655 -0
  137. package/dist/unpkg/dev/model-C9Xb1R1x.js.map +1 -0
  138. package/dist/unpkg/dev/model-fragments-Dpn9285r.js +334 -0
  139. package/dist/unpkg/dev/model-fragments-Dpn9285r.js.map +1 -0
  140. package/dist/unpkg/dev/model-fragments.js +2 -94
  141. package/dist/unpkg/dev/model.js +3 -681
  142. package/dist/unpkg/dev/runtime-BPCpkOf1-BgO3Lyjx.js +53 -0
  143. package/dist/unpkg/dev/runtime-BPCpkOf1-BgO3Lyjx.js.map +1 -0
  144. package/dist/unpkg/dev/schema-provider-Dy6c1J5f.js +1834 -0
  145. package/dist/unpkg/dev/schema-provider-Dy6c1J5f.js.map +1 -0
  146. package/dist/unpkg/dev/serializer/json-api.js +514 -634
  147. package/dist/unpkg/dev/serializer/json-api.js.map +1 -0
  148. package/dist/unpkg/dev/serializer/json.js +3 -4
  149. package/dist/unpkg/dev/serializer/rest.js +954 -1196
  150. package/dist/unpkg/dev/serializer/rest.js.map +1 -0
  151. package/dist/unpkg/dev/serializer/transform.js +283 -308
  152. package/dist/unpkg/dev/serializer/transform.js.map +1 -0
  153. package/dist/unpkg/dev/serializer.js +205 -205
  154. package/dist/unpkg/dev/serializer.js.map +1 -0
  155. package/dist/unpkg/dev/store-D_V8-HQl.js +472 -0
  156. package/dist/unpkg/dev/store-D_V8-HQl.js.map +1 -0
  157. package/dist/unpkg/dev/store.js +1 -649
  158. package/dist/unpkg/dev/util-dSKEgQDp.js +12 -0
  159. package/dist/unpkg/dev/util-dSKEgQDp.js.map +1 -0
  160. package/dist/unpkg/dev/utils-DYC9utVJ.js +11 -0
  161. package/dist/unpkg/dev/utils-DYC9utVJ.js.map +1 -0
  162. package/dist/unpkg/dev-deprecated/-private-CrEyBE-B.js +189 -0
  163. package/dist/unpkg/dev-deprecated/-private-CrEyBE-B.js.map +1 -0
  164. package/dist/unpkg/dev-deprecated/-private-vOhxVExH.js +896 -0
  165. package/dist/unpkg/dev-deprecated/-private-vOhxVExH.js.map +1 -0
  166. package/dist/unpkg/dev-deprecated/adapter/-private.js +3 -1
  167. package/dist/unpkg/dev-deprecated/adapter/error.js +421 -452
  168. package/dist/unpkg/dev-deprecated/adapter/error.js.map +1 -0
  169. package/dist/unpkg/dev-deprecated/adapter/json-api.js +239 -257
  170. package/dist/unpkg/dev-deprecated/adapter/json-api.js.map +1 -0
  171. package/dist/unpkg/dev-deprecated/adapter/rest.js +935 -1134
  172. package/dist/unpkg/dev-deprecated/adapter/rest.js.map +1 -0
  173. package/dist/unpkg/dev-deprecated/adapter-Cw0uSl8d.js +1129 -0
  174. package/dist/unpkg/dev-deprecated/adapter-Cw0uSl8d.js.map +1 -0
  175. package/dist/unpkg/dev-deprecated/adapter.js +1 -1247
  176. package/dist/unpkg/dev-deprecated/compat/-private.js +3 -1
  177. package/dist/unpkg/dev-deprecated/compat/builders.js +204 -247
  178. package/dist/unpkg/dev-deprecated/compat/builders.js.map +1 -0
  179. package/dist/unpkg/dev-deprecated/compat/extensions.js +264 -303
  180. package/dist/unpkg/dev-deprecated/compat/extensions.js.map +1 -0
  181. package/dist/unpkg/dev-deprecated/compat/utils.js +186 -205
  182. package/dist/unpkg/dev-deprecated/compat/utils.js.map +1 -0
  183. package/dist/unpkg/dev-deprecated/compat-DmAgB2NS.js +825 -0
  184. package/dist/unpkg/dev-deprecated/compat-DmAgB2NS.js.map +1 -0
  185. package/dist/unpkg/dev-deprecated/compat.js +1 -1178
  186. package/dist/unpkg/dev-deprecated/errors-C4_aOhY5.js +2128 -0
  187. package/dist/unpkg/dev-deprecated/errors-C4_aOhY5.js.map +1 -0
  188. package/dist/unpkg/dev-deprecated/index.js +266 -343
  189. package/dist/unpkg/dev-deprecated/index.js.map +1 -0
  190. package/dist/unpkg/dev-deprecated/json-DDJji3V3.js +1104 -0
  191. package/dist/unpkg/dev-deprecated/json-DDJji3V3.js.map +1 -0
  192. package/dist/unpkg/dev-deprecated/model/-private.js +3 -1
  193. package/dist/unpkg/dev-deprecated/model/migration-support.js +492 -566
  194. package/dist/unpkg/dev-deprecated/model/migration-support.js.map +1 -0
  195. package/dist/unpkg/dev-deprecated/model-CvSMYkgs.js +660 -0
  196. package/dist/unpkg/dev-deprecated/model-CvSMYkgs.js.map +1 -0
  197. package/dist/unpkg/dev-deprecated/model-fragments-Dpn9285r.js +334 -0
  198. package/dist/unpkg/dev-deprecated/model-fragments-Dpn9285r.js.map +1 -0
  199. package/dist/unpkg/dev-deprecated/model-fragments.js +2 -94
  200. package/dist/unpkg/dev-deprecated/model.js +3 -685
  201. package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BgO3Lyjx.js +53 -0
  202. package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BgO3Lyjx.js.map +1 -0
  203. package/dist/unpkg/dev-deprecated/schema-provider-Cqttza94.js +1835 -0
  204. package/dist/unpkg/dev-deprecated/schema-provider-Cqttza94.js.map +1 -0
  205. package/dist/unpkg/dev-deprecated/serializer/json-api.js +514 -634
  206. package/dist/unpkg/dev-deprecated/serializer/json-api.js.map +1 -0
  207. package/dist/unpkg/dev-deprecated/serializer/json.js +3 -4
  208. package/dist/unpkg/dev-deprecated/serializer/rest.js +954 -1196
  209. package/dist/unpkg/dev-deprecated/serializer/rest.js.map +1 -0
  210. package/dist/unpkg/dev-deprecated/serializer/transform.js +283 -308
  211. package/dist/unpkg/dev-deprecated/serializer/transform.js.map +1 -0
  212. package/dist/unpkg/dev-deprecated/serializer.js +205 -205
  213. package/dist/unpkg/dev-deprecated/serializer.js.map +1 -0
  214. package/dist/unpkg/dev-deprecated/store-BX7GvXC_.js +472 -0
  215. package/dist/unpkg/dev-deprecated/store-BX7GvXC_.js.map +1 -0
  216. package/dist/unpkg/dev-deprecated/store.js +1 -649
  217. package/dist/unpkg/dev-deprecated/util-9mgEBJ3W.js +18 -0
  218. package/dist/unpkg/dev-deprecated/util-9mgEBJ3W.js.map +1 -0
  219. package/dist/unpkg/dev-deprecated/utils-Cl86-e7F.js +17 -0
  220. package/dist/unpkg/dev-deprecated/utils-Cl86-e7F.js.map +1 -0
  221. package/dist/unpkg/prod/-private-B4bxoTuK.js +160 -0
  222. package/dist/unpkg/prod/-private-B4bxoTuK.js.map +1 -0
  223. package/dist/unpkg/prod/-private-SfXkkHKd.js +745 -0
  224. package/dist/unpkg/prod/-private-SfXkkHKd.js.map +1 -0
  225. package/dist/unpkg/prod/adapter/-private.js +3 -1
  226. package/dist/unpkg/prod/adapter/error.js +418 -447
  227. package/dist/unpkg/prod/adapter/error.js.map +1 -0
  228. package/dist/unpkg/prod/adapter/json-api.js +236 -252
  229. package/dist/unpkg/prod/adapter/json-api.js.map +1 -0
  230. package/dist/unpkg/prod/adapter/rest.js +911 -1097
  231. package/dist/unpkg/prod/adapter/rest.js.map +1 -0
  232. package/dist/unpkg/prod/adapter-Wnk7jizX.js +1111 -0
  233. package/dist/unpkg/prod/adapter-Wnk7jizX.js.map +1 -0
  234. package/dist/unpkg/prod/adapter.js +1 -1214
  235. package/dist/unpkg/prod/compat/-private.js +3 -1
  236. package/dist/unpkg/prod/compat/builders.js +165 -182
  237. package/dist/unpkg/prod/compat/builders.js.map +1 -0
  238. package/dist/unpkg/prod/compat/extensions.js +252 -283
  239. package/dist/unpkg/prod/compat/extensions.js.map +1 -0
  240. package/dist/unpkg/prod/compat/utils.js +183 -200
  241. package/dist/unpkg/prod/compat/utils.js.map +1 -0
  242. package/dist/unpkg/prod/compat-CJ87MzDn.js +547 -0
  243. package/dist/unpkg/prod/compat-CJ87MzDn.js.map +1 -0
  244. package/dist/unpkg/prod/compat.js +1 -742
  245. package/dist/unpkg/prod/errors-Co7YWHoA.js +1977 -0
  246. package/dist/unpkg/prod/errors-Co7YWHoA.js.map +1 -0
  247. package/dist/unpkg/prod/index.js +245 -308
  248. package/dist/unpkg/prod/index.js.map +1 -0
  249. package/dist/unpkg/prod/json-BD1kRTfB.js +1080 -0
  250. package/dist/unpkg/prod/json-BD1kRTfB.js.map +1 -0
  251. package/dist/unpkg/prod/model/-private.js +3 -1
  252. package/dist/unpkg/prod/model/migration-support.js +477 -542
  253. package/dist/unpkg/prod/model/migration-support.js.map +1 -0
  254. package/dist/unpkg/prod/model-BzoOmtka.js +603 -0
  255. package/dist/unpkg/prod/model-BzoOmtka.js.map +1 -0
  256. package/dist/unpkg/prod/model-fragments-Dpn9285r.js +334 -0
  257. package/dist/unpkg/prod/model-fragments-Dpn9285r.js.map +1 -0
  258. package/dist/unpkg/prod/model-fragments.js +2 -94
  259. package/dist/unpkg/prod/model.js +3 -596
  260. package/dist/unpkg/prod/runtime-BPCpkOf1-BgO3Lyjx.js +53 -0
  261. package/dist/unpkg/prod/runtime-BPCpkOf1-BgO3Lyjx.js.map +1 -0
  262. package/dist/unpkg/prod/schema-provider-CKZcqWyP.js +1622 -0
  263. package/dist/unpkg/prod/schema-provider-CKZcqWyP.js.map +1 -0
  264. package/dist/unpkg/prod/serializer/json-api.js +497 -592
  265. package/dist/unpkg/prod/serializer/json-api.js.map +1 -0
  266. package/dist/unpkg/prod/serializer/json.js +3 -4
  267. package/dist/unpkg/prod/serializer/rest.js +938 -1166
  268. package/dist/unpkg/prod/serializer/rest.js.map +1 -0
  269. package/dist/unpkg/prod/serializer/transform.js +283 -308
  270. package/dist/unpkg/prod/serializer/transform.js.map +1 -0
  271. package/dist/unpkg/prod/serializer.js +205 -205
  272. package/dist/unpkg/prod/serializer.js.map +1 -0
  273. package/dist/unpkg/prod/store-RGGc1ilN.js +392 -0
  274. package/dist/unpkg/prod/store-RGGc1ilN.js.map +1 -0
  275. package/dist/unpkg/prod/store.js +1 -517
  276. package/dist/unpkg/prod/util-dSKEgQDp.js +12 -0
  277. package/dist/unpkg/prod/util-dSKEgQDp.js.map +1 -0
  278. package/dist/unpkg/prod/utils-DYC9utVJ.js +11 -0
  279. package/dist/unpkg/prod/utils-DYC9utVJ.js.map +1 -0
  280. package/dist/unpkg/prod-deprecated/-private-B4bxoTuK.js +160 -0
  281. package/dist/unpkg/prod-deprecated/-private-B4bxoTuK.js.map +1 -0
  282. package/dist/unpkg/prod-deprecated/-private-SfXkkHKd.js +745 -0
  283. package/dist/unpkg/prod-deprecated/-private-SfXkkHKd.js.map +1 -0
  284. package/dist/unpkg/prod-deprecated/adapter/-private.js +3 -1
  285. package/dist/unpkg/prod-deprecated/adapter/error.js +418 -447
  286. package/dist/unpkg/prod-deprecated/adapter/error.js.map +1 -0
  287. package/dist/unpkg/prod-deprecated/adapter/json-api.js +236 -252
  288. package/dist/unpkg/prod-deprecated/adapter/json-api.js.map +1 -0
  289. package/dist/unpkg/prod-deprecated/adapter/rest.js +911 -1097
  290. package/dist/unpkg/prod-deprecated/adapter/rest.js.map +1 -0
  291. package/{declarations/adapter.d.ts → dist/unpkg/prod-deprecated/adapter-Wnk7jizX.js} +445 -110
  292. package/dist/unpkg/prod-deprecated/adapter-Wnk7jizX.js.map +1 -0
  293. package/dist/unpkg/prod-deprecated/adapter.js +1 -1214
  294. package/dist/unpkg/prod-deprecated/compat/-private.js +3 -1
  295. package/dist/unpkg/prod-deprecated/compat/builders.js +165 -182
  296. package/dist/unpkg/prod-deprecated/compat/builders.js.map +1 -0
  297. package/dist/unpkg/prod-deprecated/compat/extensions.js +252 -283
  298. package/dist/unpkg/prod-deprecated/compat/extensions.js.map +1 -0
  299. package/dist/unpkg/prod-deprecated/compat/utils.js +183 -200
  300. package/dist/unpkg/prod-deprecated/compat/utils.js.map +1 -0
  301. package/dist/unpkg/prod-deprecated/compat-CJ87MzDn.js +547 -0
  302. package/dist/unpkg/prod-deprecated/compat-CJ87MzDn.js.map +1 -0
  303. package/dist/unpkg/prod-deprecated/compat.js +1 -742
  304. package/dist/unpkg/prod-deprecated/errors-C-opde61.js +1978 -0
  305. package/dist/unpkg/prod-deprecated/errors-C-opde61.js.map +1 -0
  306. package/dist/unpkg/prod-deprecated/index.js +245 -307
  307. package/dist/unpkg/prod-deprecated/index.js.map +1 -0
  308. package/dist/unpkg/prod-deprecated/json-BD1kRTfB.js +1080 -0
  309. package/dist/unpkg/prod-deprecated/json-BD1kRTfB.js.map +1 -0
  310. package/dist/unpkg/prod-deprecated/model/-private.js +3 -1
  311. package/dist/unpkg/prod-deprecated/model/migration-support.js +488 -559
  312. package/dist/unpkg/prod-deprecated/model/migration-support.js.map +1 -0
  313. package/dist/unpkg/prod-deprecated/model-C0bTXzGn.js +604 -0
  314. package/dist/unpkg/prod-deprecated/model-C0bTXzGn.js.map +1 -0
  315. package/dist/unpkg/prod-deprecated/model-fragments-Dpn9285r.js +334 -0
  316. package/dist/unpkg/prod-deprecated/model-fragments-Dpn9285r.js.map +1 -0
  317. package/dist/unpkg/prod-deprecated/model-fragments.js +2 -94
  318. package/dist/unpkg/prod-deprecated/model.js +3 -599
  319. package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BgO3Lyjx.js +53 -0
  320. package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BgO3Lyjx.js.map +1 -0
  321. package/dist/unpkg/prod-deprecated/schema-provider-lH3qP5tw.js +1635 -0
  322. package/dist/unpkg/prod-deprecated/schema-provider-lH3qP5tw.js.map +1 -0
  323. package/dist/unpkg/prod-deprecated/serializer/json-api.js +497 -592
  324. package/dist/unpkg/prod-deprecated/serializer/json-api.js.map +1 -0
  325. package/dist/unpkg/prod-deprecated/serializer/json.js +3 -4
  326. package/dist/unpkg/prod-deprecated/serializer/rest.js +938 -1166
  327. package/dist/unpkg/prod-deprecated/serializer/rest.js.map +1 -0
  328. package/dist/unpkg/prod-deprecated/serializer/transform.js +283 -308
  329. package/dist/unpkg/prod-deprecated/serializer/transform.js.map +1 -0
  330. package/dist/unpkg/prod-deprecated/serializer.js +205 -205
  331. package/dist/unpkg/prod-deprecated/serializer.js.map +1 -0
  332. package/dist/unpkg/prod-deprecated/store-0L2CkYzh.js +392 -0
  333. package/dist/unpkg/prod-deprecated/store-0L2CkYzh.js.map +1 -0
  334. package/dist/unpkg/prod-deprecated/store.js +1 -517
  335. package/dist/unpkg/prod-deprecated/util-CQQdHX3n.js +14 -0
  336. package/dist/unpkg/prod-deprecated/util-CQQdHX3n.js.map +1 -0
  337. package/dist/unpkg/prod-deprecated/utils-BMI_JwFP.js +13 -0
  338. package/dist/unpkg/prod-deprecated/utils-BMI_JwFP.js.map +1 -0
  339. package/dist/util-Bnx8nm-D.js +29 -0
  340. package/dist/util-Bnx8nm-D.js.map +1 -0
  341. package/dist/utils-ZAytYep8.js +28 -0
  342. package/dist/utils-ZAytYep8.js.map +1 -0
  343. package/package.json +13 -13
  344. package/declarations/adapter/-private/build-url-mixin.d.ts +0 -189
  345. package/declarations/adapter/-private/fastboot-interface.d.ts +0 -8
  346. package/declarations/adapter/-private/utils/continue-on-reject.d.ts +0 -1
  347. package/declarations/adapter/-private/utils/determine-body-promise.d.ts +0 -4
  348. package/declarations/adapter/-private/utils/fetch.d.ts +0 -8
  349. package/declarations/adapter/-private/utils/parse-response-headers.d.ts +0 -1
  350. package/declarations/adapter/-private/utils/serialize-into-hash.d.ts +0 -6
  351. package/declarations/adapter/-private/utils/serialize-query-params.d.ts +0 -5
  352. package/declarations/adapter/-private.d.ts +0 -5
  353. package/declarations/adapter/error.d.ts +0 -431
  354. package/declarations/compat/-private.d.ts +0 -13
  355. package/declarations/compat/builders/find-all.d.ts +0 -34
  356. package/declarations/compat/builders/find-record.d.ts +0 -56
  357. package/declarations/compat/builders/query.d.ts +0 -66
  358. package/declarations/compat/builders/save-record.d.ts +0 -34
  359. package/declarations/compat/builders/utils.d.ts +0 -3
  360. package/declarations/compat/builders.d.ts +0 -14
  361. package/declarations/compat/extensions.d.ts +0 -99
  362. package/declarations/compat/legacy-network-handler/fetch-manager.d.ts +0 -55
  363. package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +0 -2
  364. package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +0 -11
  365. package/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +0 -5
  366. package/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +0 -9
  367. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +0 -528
  368. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +0 -220
  369. package/declarations/compat/legacy-network-handler/serializer-response.d.ts +0 -6
  370. package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +0 -110
  371. package/declarations/compat/legacy-network-handler/snapshot.d.ts +0 -255
  372. package/declarations/compat/utils.d.ts +0 -148
  373. package/declarations/compat.d.ts +0 -189
  374. package/declarations/index.d.ts +0 -244
  375. package/declarations/model/-private/attr.d.ts +0 -191
  376. package/declarations/model/-private/belongs-to.d.ts +0 -195
  377. package/declarations/model/-private/debug/assert-polymorphic-type.d.ts +0 -5
  378. package/declarations/model/-private/errors.d.ts +0 -289
  379. package/declarations/model/-private/has-many.d.ts +0 -162
  380. package/declarations/model/-private/hooks.d.ts +0 -36
  381. package/declarations/model/-private/legacy-relationships-support.d.ts +0 -47
  382. package/declarations/model/-private/model-for-mixin.d.ts +0 -3
  383. package/declarations/model/-private/model-methods.d.ts +0 -39
  384. package/declarations/model/-private/model.d.ts +0 -1279
  385. package/declarations/model/-private/notify-changes.d.ts +0 -4
  386. package/declarations/model/-private/promise-belongs-to.d.ts +0 -40
  387. package/declarations/model/-private/promise-many-array.d.ts +0 -130
  388. package/declarations/model/-private/record-state.d.ts +0 -58
  389. package/declarations/model/-private/references/belongs-to.d.ts +0 -488
  390. package/declarations/model/-private/references/has-many.d.ts +0 -498
  391. package/declarations/model/-private/schema-provider.d.ts +0 -66
  392. package/declarations/model/-private/type-utils.d.ts +0 -57
  393. package/declarations/model/-private/util.d.ts +0 -5
  394. package/declarations/model/-private.d.ts +0 -8
  395. package/declarations/model/migration-support.d.ts +0 -306
  396. package/declarations/model-fragments/extensions/fragment-array.d.ts +0 -54
  397. package/declarations/model-fragments/extensions/fragment.d.ts +0 -50
  398. package/declarations/model-fragments/hooks/model-for.d.ts +0 -27
  399. package/declarations/model-fragments/index.d.ts +0 -13
  400. package/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +0 -15
  401. package/declarations/model-fragments/utilities/with-array-defaults.d.ts +0 -56
  402. package/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +0 -38
  403. package/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +0 -34
  404. package/declarations/model-fragments/utilities/with-legacy.d.ts +0 -11
  405. package/declarations/model-fragments.d.ts +0 -9
  406. package/declarations/model.d.ts +0 -49
  407. package/declarations/serializer/-private/transforms/boolean.d.ts +0 -60
  408. package/declarations/serializer/-private/transforms/date.d.ts +0 -42
  409. package/declarations/serializer/-private/transforms/number.d.ts +0 -42
  410. package/declarations/serializer/-private/transforms/string.d.ts +0 -42
  411. package/declarations/serializer/-private/transforms/transform.d.ts +0 -118
  412. package/declarations/serializer/-private/utils.d.ts +0 -27
  413. package/declarations/serializer/rest.d.ts +0 -51
  414. package/declarations/serializer/transform.d.ts +0 -5
  415. package/declarations/serializer.d.ts +0 -252
  416. package/declarations/store/-private.d.ts +0 -223
  417. package/declarations/store.d.ts +0 -10
  418. package/dist/-private-BG3bMiKp.js +0 -1211
  419. package/dist/errors-DZKA206g.js +0 -2589
  420. package/dist/hooks-BvOqJBei.js +0 -105
  421. package/dist/json-DU8m1pGf.js +0 -1336
  422. package/dist/model-for-CXkJw59V.js +0 -297
  423. package/dist/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
  424. package/dist/schema-provider-DtPOp0d7.js +0 -2382
  425. package/dist/serialize-into-hash-DPZYoF-i.js +0 -261
  426. package/dist/unpkg/dev/-private-DtjBbEgy.js +0 -1206
  427. package/dist/unpkg/dev/errors-DngRU-If.js +0 -2585
  428. package/dist/unpkg/dev/hooks-UuiLxWxS.js +0 -104
  429. package/dist/unpkg/dev/json-K2Y9z6MN.js +0 -1333
  430. package/dist/unpkg/dev/model-for-CXkJw59V.js +0 -297
  431. package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
  432. package/dist/unpkg/dev/schema-provider-0D7f-QOn.js +0 -2272
  433. package/dist/unpkg/dev/serialize-into-hash-B2xDbuo5.js +0 -259
  434. package/dist/unpkg/dev/util-DvanW33H.js +0 -20
  435. package/dist/unpkg/dev/utils-BhvS1iTS.js +0 -8
  436. package/dist/unpkg/dev-deprecated/-private-DtjBbEgy.js +0 -1206
  437. package/dist/unpkg/dev-deprecated/errors-Bzidntpi.js +0 -2588
  438. package/dist/unpkg/dev-deprecated/hooks-DVXhMW14.js +0 -104
  439. package/dist/unpkg/dev-deprecated/json-K2Y9z6MN.js +0 -1333
  440. package/dist/unpkg/dev-deprecated/model-for-CXkJw59V.js +0 -297
  441. package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
  442. package/dist/unpkg/dev-deprecated/schema-provider-ZwO5_fZw.js +0 -2292
  443. package/dist/unpkg/dev-deprecated/serialize-into-hash-B2xDbuo5.js +0 -259
  444. package/dist/unpkg/dev-deprecated/util-CWr5WQOT.js +0 -24
  445. package/dist/unpkg/dev-deprecated/utils-C9PJehtL.js +0 -12
  446. package/dist/unpkg/prod/-private-BdyZaGEh.js +0 -971
  447. package/dist/unpkg/prod/errors-B-PWeYlW.js +0 -2337
  448. package/dist/unpkg/prod/hooks-Bx-zBziU.js +0 -72
  449. package/dist/unpkg/prod/json-Qewu-UN9.js +0 -1300
  450. package/dist/unpkg/prod/model-for-CXkJw59V.js +0 -297
  451. package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
  452. package/dist/unpkg/prod/schema-provider-BgRqk8i9.js +0 -1951
  453. package/dist/unpkg/prod/serialize-into-hash-DGlzQteF.js +0 -215
  454. package/dist/unpkg/prod/util-DvanW33H.js +0 -20
  455. package/dist/unpkg/prod/utils-BhvS1iTS.js +0 -8
  456. package/dist/unpkg/prod-deprecated/-private-BdyZaGEh.js +0 -971
  457. package/dist/unpkg/prod-deprecated/errors-Dl2J9d1D.js +0 -2340
  458. package/dist/unpkg/prod-deprecated/hooks-Cm60wWTf.js +0 -72
  459. package/dist/unpkg/prod-deprecated/json-Qewu-UN9.js +0 -1300
  460. package/dist/unpkg/prod-deprecated/model-for-CXkJw59V.js +0 -297
  461. package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
  462. package/dist/unpkg/prod-deprecated/schema-provider-Dh6tRqVI.js +0 -1980
  463. package/dist/unpkg/prod-deprecated/serialize-into-hash-DGlzQteF.js +0 -215
  464. package/dist/unpkg/prod-deprecated/util-B6cn-i93.js +0 -23
  465. package/dist/unpkg/prod-deprecated/utils-BUWwQwCh.js +0 -11
  466. package/dist/util-Dul6TZts.js +0 -35
  467. package/dist/utils-Cqw9eRj5.js +0 -23
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-provider-DsKuB5Wb.js","names":["deprecate","recordIdentifierFor","assertPrivateStore","RecordStore","FetchManager","upgradeStore","lookupLegacySupport","getGlobalConfig","macroCondition","rollbackAttributes","currentState","isNew","store","_join","cache","rollbackAttrs","errors","clear","cleanErrorRequests","unloadRecord","isDestroyed","isDestroying","belongsTo","prop","referenceFor","hasMany","reload","options","WarpDrive","deprecations","ENABLE_LEGACY_REQUEST_METHODS","message","env","DEBUG","test","Error","Promise","reject","id","until","for","url","since","enabled","available","_reload","call","isReloading","identifier","promise","request","op","data","record","cacheOptions","Symbol","then","finally","changedAttributes","changedAttrs","serialize","serializeRecord","deleteRecord","save","_save","isDeleted","resolve","saveRecord","destroyRecord","_destroyRecord","_","createSnapshot","_fetchManager","cacheFor","Context","notifyInternalSignal","peekInternalSignal","withSignalStore","LEGACY_SUPPORT","macroCondition","getGlobalConfig","notifyChanges","identifier","value","key","record","store","notifyAttribute","eachAttribute","name","meta","constructor","relationshipsByName","get","WarpDrive","env","DEBUG","test","Error","type","notifyRelationship","eachRelationship","kind","notifyPropertyChange","support","manyArray","_manyArrayCache","hasPromise","_relationshipPromisesCache","signal","options","async","currentValue","cache","getAttr","storeFor","defineSignal","gate","memoized","notifyInternalSignal","peekInternalSignal","withSignalStore","recordIdentifierFor","macroCondition","getGlobalConfig","n","SOURCE_POINTER_REGEXP","SOURCE_POINTER_PRIMARY_REGEXP","PRIMARY_ATTRIBUTE_KEY","isInvalidError","error","Error","isAdapterError","code","RecordState","constructor","record","store","identity","identifier","cache","pendingCount","fulfilledCount","rejectedCount","_errorRequests","_lastError","requests","getRequestStateService","notifications","handleRequest","req","type","state","isSaving","response","data","push","notifyErrorsStateChanged","notify","subscribeForRecord","lastRequest","getLastRequestForRecord","handler","subscribe","key","updateInvalidErrors","errors","destroy","unsubscribe","signals","signal","WarpDrive","env","DEBUG","test","lid","getErrors","jsonApiErrors","clear","i","length","source","pointer","keyMatch","match","search","errMsg","detail","title","add","cleanErrorRequests","isLoading","isLoaded","prototype","isNew","isEmpty","isSaved","rd","isDeleted","isDeletionCommitted","isValid","isDirty","hasChangedAttrs","isError","errorReq","adapterError","request","isPreloaded","stateName","dirtyType","deprecate","EmberObject","recordIdentifierFor","storeFor","defineGate","entangleSignal","gate","memoized","withSignalStore","assertPrivateStore","coerceId","RecordStore","Errors","LEGACY_SUPPORT","_destroyRecord","_reload","_save","belongsTo","changedAttributes","createSnapshot","deleteRecord","destroyRecord","hasMany","reload","rollbackAttributes","save","serialize","unloadRecord","notifyChanges","RecordState","getGlobalConfig","macroCondition","n","computeOnce","target","propertyName","desc","cache","WeakMap","getter","get","meta","hasComputed","value","undefined","set","call","Model","init","options","WarpDrive","env","DEBUG","_secretInit","_createProps","Error","createProps","store","identity","identifier","cb","___recordState","setProperties","notifications","___private_notifications","subscribe","type","field","destroy","unsubscribe","support","delete","isEmpty","currentState","prototype","isLoading","isLoaded","hasDirtyAttributes","isDirty","isSaving","isDeleted","isNew","isValid","dirtyType","isError","v","id","normalizedId","didChange","test","_instanceCache","setRecordId","notify","toString","constructor","modelName","_v","errors","create","__record","updateInvalidErrors","adapterError","notifyPropertyChange","prop","signals","attr","eachRelationship","callback","binding","relationshipFor","name","relationshipsByName","inverseFor","eachAttribute","isModel","typeForRelationship","relationship","modelFor","inverseMap","Object","inverse","_findInverseFor","length","schemaExists","schema","hasResource","inverseField","fields","kind","relationships","map","Map","forEach","has","push","relationshipNames","names","eachComputedProperty","isRelationshipSchema","relatedTypes","types","rels","relationshipsObject","keys","i","includes","key","as","isAttributeSchema","eachRelatedType","relationshipTypes","determineRelationshipType","knownSide","knownKey","knownKind","otherKind","attributes","transformedAttributes","eachTransformedAttribute","_createSnapshot","until","for","url","since","enabled","available","_isReloading","configurable","isLocal","restoreDeprecatedModelRequestBehaviors","ModelKlass","lookupDescriptor","obj","keyName","current","descriptor","getOwnPropertyDescriptor","getPrototypeOf","createArgs","ourDescriptor","theirDescriptor","realState","ID_DESCRIPTOR","idDesc","reopen","reopenClass","hasKind","getOwner","Model","modelForMixin","store","normalizedModelName","owner","MaybeMixin","factoryFor","mixin","class","ModelForMixin","extend","__isMixin","__mixin","register","getOwner","deprecate","_modelForMixin","normalizeModelName","getGlobalConfig","macroCondition","ModelSchemaProvider","constructor","store","_schemas","Map","_typeMisses","Set","resourceTypes","Array","from","keys","hasTrait","type","WarpDrive","env","DEBUG","test","Error","resourceHasTrait","resource","trait","transformation","field","derivation","hashFn","has","_loadModelSchema","get","schema","registerResources","schemas","registerResource","registerTransformation","transform","registerDerivation","registerHashFn","factory","getModelFactory","modelClass","class","attributeMap","attributes","Object","create","forEach","meta","name","relationships","relationshipsObject","fields","attr","values","set","rel","legacy","identity","kind","cacheFields","cacheKey","sourceKey","internalSchema","hasResource","exists","add","deprecations","ENABLE_LEGACY_SCHEMA_SERVICE","prototype","doesTypeExist","id","until","for","since","available","enabled","attributesDefinitionFor","relationshipsDefinitionFor","buildSchema","_modelFactoryCache","cache","owner","factoryFor","klass","isModel","hasOwnModelNameSet","modelName","hasOwnProperty","call","defineProperty","value"],"sources":["../src/model/-private/model-methods.ts","../src/model/-private/notify-changes.ts","../src/model/-private/record-state.ts","../src/model/-private/model.ts","../src/model/-private/model-for-mixin.ts","../src/model/-private/schema-provider.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport type { Store } from '@warp-drive/core';\nimport { recordIdentifierFor } from '@warp-drive/core';\nimport { ENABLE_LEGACY_REQUEST_METHODS } from '@warp-drive/core/build-config/deprecations';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport { assertPrivateStore } from '@warp-drive/core/store/-private';\nimport type { ChangedAttributesHash } from '@warp-drive/core/types/cache';\nimport { RecordStore } from '@warp-drive/core/types/symbols';\n\nimport type { Snapshot } from '../../compat/-private.ts';\nimport { FetchManager, upgradeStore } from '../../compat/-private.ts';\nimport type { Errors } from './errors.ts';\nimport { lookupLegacySupport } from './legacy-relationships-support.ts';\nimport type RecordState from './record-state.ts';\nimport type BelongsToReference from './references/belongs-to.ts';\nimport type HasManyReference from './references/has-many.ts';\nimport type { MaybeBelongsToFields, MaybeHasManyFields } from './type-utils.ts';\n\nexport interface MinimalLegacyRecord {\n errors: Errors;\n /** @internal */\n ___recordState: RecordState;\n currentState: RecordState;\n isDestroyed: boolean;\n isDestroying: boolean;\n isReloading: boolean;\n isValid: boolean;\n /** @internal */\n [RecordStore]: Store;\n\n deleteRecord(): void;\n unloadRecord(): void;\n save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<this>;\n destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<this>;\n}\n\nexport function rollbackAttributes<T extends MinimalLegacyRecord>(this: T): void {\n const { currentState } = this;\n const { isNew } = currentState;\n const store = this[RecordStore];\n assertPrivateStore(store);\n\n store._join(() => {\n store.cache.rollbackAttrs(recordIdentifierFor(this));\n this.errors.clear();\n currentState.cleanErrorRequests();\n if (isNew) {\n this.unloadRecord();\n }\n });\n}\n\nexport function unloadRecord<T extends MinimalLegacyRecord>(this: T): void {\n if (this.currentState.isNew && (this.isDestroyed || this.isDestroying)) {\n return;\n }\n this[RecordStore].unloadRecord(this);\n}\n\nexport function belongsTo<T extends MinimalLegacyRecord, K extends MaybeBelongsToFields<T>>(\n this: T,\n prop: K\n): BelongsToReference<T, K> {\n return lookupLegacySupport(this).referenceFor('belongsTo', prop) as BelongsToReference<T, K>;\n}\n\nexport function hasMany<T extends MinimalLegacyRecord, K extends MaybeHasManyFields<T>>(\n this: T,\n prop: K\n): HasManyReference<T, K> {\n return lookupLegacySupport(this).referenceFor('hasMany', prop) as HasManyReference<T, K>;\n}\n\nexport function reload<T extends MinimalLegacyRecord>(this: T, options: Record<string, unknown> = {}): Promise<T> {\n if (!ENABLE_LEGACY_REQUEST_METHODS) {\n const message = `You cannot use reload() on a record when ENABLE_LEGACY_REQUEST_METHODS is false.`;\n assert(message, false);\n return Promise.reject(new Error(message));\n } else {\n deprecate(`record.reload is deprecated, please use store.request to initiate a request instead.`, false, {\n id: 'warp-drive:deprecate-legacy-request-methods',\n until: '6.0',\n for: '@warp-drive/core',\n url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',\n since: {\n enabled: '5.7',\n available: '5.7',\n },\n });\n\n return _reload.call(this, options) as Promise<T>;\n }\n}\n\nexport function _reload<T extends MinimalLegacyRecord>(this: T, options: Record<string, unknown> = {}): Promise<T> {\n options.isReloading = true;\n options.reload = true;\n\n const identifier = recordIdentifierFor(this);\n assert(`You cannot reload a record without an ID`, identifier.id);\n\n this.isReloading = true;\n const promise = this[RecordStore].request({\n op: 'findRecord',\n data: {\n options,\n record: identifier,\n },\n cacheOptions: { [Symbol.for('wd:skip-cache')]: true },\n })\n .then(() => this)\n .finally(() => {\n this.isReloading = false;\n });\n\n return promise;\n}\n\nexport function changedAttributes<T extends MinimalLegacyRecord>(this: T): ChangedAttributesHash {\n return this[RecordStore].cache.changedAttrs(recordIdentifierFor(this));\n}\n\nexport function serialize<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): unknown {\n upgradeStore(this[RecordStore]);\n return this[RecordStore].serializeRecord(this, options);\n}\n\nexport function deleteRecord<T extends MinimalLegacyRecord>(this: T): void {\n // ensure we've populated currentState prior to deleting a new record\n if (this.currentState) {\n this[RecordStore].deleteRecord(this);\n }\n}\n\nexport function save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T> {\n if (!ENABLE_LEGACY_REQUEST_METHODS) {\n const message = `You cannot use save() on a record when ENABLE_LEGACY_REQUEST_METHODS is false.`;\n assert(message, false);\n return Promise.reject(new Error(message));\n } else {\n deprecate(`record.save is deprecated, please use store.request to initiate a request instead.`, false, {\n id: 'warp-drive:deprecate-legacy-request-methods',\n until: '6.0',\n for: '@warp-drive/core',\n url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',\n since: {\n enabled: '5.7',\n available: '5.7',\n },\n });\n\n return _save.call(this, options) as Promise<T>;\n }\n}\n\nexport function _save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T> {\n let promise: Promise<T>;\n\n if (this.currentState.isNew && this.currentState.isDeleted) {\n promise = Promise.resolve(this);\n } else {\n this.errors.clear();\n promise = this[RecordStore].saveRecord(this, options);\n }\n\n return promise;\n}\n\nexport function destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T> {\n if (!ENABLE_LEGACY_REQUEST_METHODS) {\n const message = `You cannot use destroyRecord() on a record when ENABLE_LEGACY_REQUEST_METHODS is false.`;\n assert(message, false);\n return Promise.reject(new Error(message));\n } else {\n deprecate(`record.destroyRecord is deprecated, please use store.request to initiate a request instead.`, false, {\n id: 'warp-drive:deprecate-legacy-request-methods',\n until: '6.0',\n for: '@warp-drive/core',\n url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',\n since: {\n enabled: '5.7',\n available: '5.7',\n },\n });\n\n return _destroyRecord.call(this, options) as Promise<T>;\n }\n}\n\nexport function _destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T> {\n const { isNew } = this.currentState;\n this.deleteRecord();\n if (isNew) {\n return Promise.resolve(this);\n }\n return this.save(options).then((_) => {\n this.unloadRecord();\n return this;\n });\n}\n\nexport function createSnapshot<T extends MinimalLegacyRecord>(this: T): Snapshot<T> {\n const store = this[RecordStore];\n\n upgradeStore(store);\n if (!store._fetchManager) {\n store._fetchManager = new FetchManager(store);\n }\n\n // @ts-expect-error Typescript isn't able to curry narrowed args that are divorced from each other.\n return store._fetchManager.createSnapshot<T>(recordIdentifierFor(this));\n}\n","import { cacheFor } from '@ember/object/internals';\n\nimport type { NotificationType, Store } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport { Context } from '@warp-drive/core/reactive/-private';\nimport { notifyInternalSignal, peekInternalSignal, withSignalStore } from '@warp-drive/core/signals/-leaked';\nimport type { PrivateReactiveResourceArray } from '@warp-drive/core/store/-private';\nimport type { ResourceKey } from '@warp-drive/core/types/identifier';\nimport type { LegacyRelationshipField as RelationshipSchema } from '@warp-drive/core/types/schema/fields';\n\nimport { LEGACY_SUPPORT } from './legacy-relationships-support.ts';\nimport type { Model } from './model.ts';\n\nexport default function notifyChanges(\n identifier: ResourceKey,\n value: NotificationType,\n key: string | undefined,\n record: Model,\n store: Store\n): void {\n switch (value) {\n case 'added':\n case 'attributes':\n if (key) {\n notifyAttribute(store, identifier, key, record);\n } else {\n record.eachAttribute((name) => {\n notifyAttribute(store, identifier, name, record);\n });\n }\n break;\n\n case 'relationships':\n if (key) {\n const meta = (record.constructor as typeof Model).relationshipsByName.get(key);\n assert(`Expected to find a relationship for ${key} on ${identifier.type}`, meta);\n notifyRelationship(identifier, key, record, meta);\n } else {\n record.eachRelationship((name, meta) => {\n notifyRelationship(identifier, name, record, meta);\n });\n }\n break;\n\n case 'identity':\n notifyInternalSignal(peekInternalSignal(withSignalStore(record), 'id'));\n break;\n }\n}\n\nfunction notifyRelationship(identifier: ResourceKey, key: string, record: Model, meta: RelationshipSchema) {\n if (meta.kind === 'belongsTo') {\n record.notifyPropertyChange(key);\n } else if (meta.kind === 'hasMany') {\n const support = LEGACY_SUPPORT.get(identifier);\n const manyArray = support && support._manyArrayCache[key];\n const hasPromise = support && support._relationshipPromisesCache[key];\n\n if (manyArray && hasPromise) {\n // do nothing, we will notify the ManyArray directly\n // once the fetch has completed.\n return;\n }\n\n if (manyArray) {\n notifyInternalSignal((manyArray as unknown as PrivateReactiveResourceArray)[Context].signal);\n\n //We need to notifyPropertyChange in the adding case because we need to make sure\n //we fetch the newly added record in case it is unloaded\n //TODO(Igor): Consider whether we could do this only if the record state is unloaded\n assert(`Expected options to exist on relationship meta`, meta.options);\n assert(`Expected async to exist on relationship meta options`, 'async' in meta.options);\n if (meta.options.async) {\n record.notifyPropertyChange(key);\n }\n }\n }\n}\n\nfunction notifyAttribute(store: Store, identifier: ResourceKey, key: string, record: Model) {\n const currentValue = cacheFor(record, key);\n const cache = store.cache;\n if (currentValue !== cache.getAttr(identifier, key)) {\n record.notifyPropertyChange(key);\n }\n}\n","import type { NotificationType, Store } from '@warp-drive/core';\nimport { storeFor } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport {\n defineSignal,\n gate,\n memoized,\n notifyInternalSignal,\n peekInternalSignal,\n withSignalStore,\n} from '@warp-drive/core/signals/-leaked';\nimport type { RequestCacheRequestState, RequestStateService } from '@warp-drive/core/store/-private';\nimport { recordIdentifierFor } from '@warp-drive/core/store/-private';\nimport type { Cache } from '@warp-drive/core/types/cache';\nimport type { ResourceKey } from '@warp-drive/core/types/identifier';\n\nimport type { Errors } from './errors';\nimport type { MinimalLegacyRecord } from './model-methods';\n\nconst SOURCE_POINTER_REGEXP = /^\\/?data\\/(attributes|relationships)\\/(.*)/;\nconst SOURCE_POINTER_PRIMARY_REGEXP = /^\\/?data/;\nconst PRIMARY_ATTRIBUTE_KEY = 'base';\nfunction isInvalidError(error: unknown): error is Error & { isAdapterError: true; code: 'InvalidError' } {\n return (\n !!error &&\n error instanceof Error &&\n 'isAdapterError' in error &&\n error.isAdapterError === true &&\n 'code' in error &&\n error.code === 'InvalidError'\n );\n}\n\n/**\nHistorically WarpDrive managed a state machine\nfor each record, the localState for which\nwas reflected onto Model.\n\nThis implements the flags and stateName for backwards compat\nwith the state tree that used to be possible (listed below).\n\nstateName and dirtyType are candidates for deprecation.\n\nroot\n empty\n deleted // hidden from stateName\n preloaded // hidden from stateName\n\n loading\n empty // hidden from stateName\n preloaded // hidden from stateName\n\n loaded\n saved\n updated\n uncommitted\n invalid\n inFlight\n created\n uncommitted\n invalid\n inFlight\n\n deleted\n saved\n new // hidden from stateName\n uncommitted\n invalid\n inFlight\n\n @hideconstructor\n @private\n*/\nexport default class RecordState {\n /** @internal */\n declare private store: Store;\n /** @internal */\n declare private identifier: ResourceKey;\n /** @internal */\n declare private record: MinimalLegacyRecord;\n /** @internal */\n declare private rs: RequestStateService;\n\n /** @internal */\n declare private pendingCount: number;\n /** @internal */\n declare private fulfilledCount: number;\n /** @internal */\n declare private rejectedCount: number;\n /** @internal */\n declare private cache: Cache;\n /** @internal */\n declare private _errorRequests: RequestCacheRequestState[];\n /** @internal */\n declare private _lastError: RequestCacheRequestState | null;\n /** @internal */\n declare private handler: object;\n\n constructor(record: MinimalLegacyRecord) {\n const store = storeFor(record, false)!;\n const identity = recordIdentifierFor(record);\n\n this.identifier = identity;\n this.record = record;\n this.cache = store.cache;\n\n this.pendingCount = 0;\n this.fulfilledCount = 0;\n this.rejectedCount = 0;\n this._errorRequests = [];\n this._lastError = null;\n\n const requests = store.getRequestStateService();\n const notifications = store.notifications;\n\n const handleRequest = (req: RequestCacheRequestState) => {\n if (req.type === 'mutation') {\n switch (req.state) {\n case 'pending':\n this.isSaving = true;\n break;\n case 'rejected':\n this.isSaving = false;\n this._lastError = req;\n if (!(req.response && isInvalidError(req.response.data))) {\n this._errorRequests.push(req);\n }\n\n notifyErrorsStateChanged(this);\n break;\n case 'fulfilled':\n this._errorRequests = [];\n this._lastError = null;\n this.isSaving = false;\n this.notify('isDirty');\n notifyErrorsStateChanged(this);\n break;\n }\n } else {\n switch (req.state) {\n case 'pending':\n this.pendingCount++;\n this.notify('isLoading');\n break;\n case 'rejected':\n this.pendingCount--;\n this._lastError = req;\n if (!(req.response && isInvalidError(req.response.data))) {\n this._errorRequests.push(req);\n }\n this.notify('isLoading');\n notifyErrorsStateChanged(this);\n break;\n case 'fulfilled':\n this.pendingCount--;\n this.fulfilledCount++;\n this.notify('isLoading');\n this.notify('isDirty');\n notifyErrorsStateChanged(this);\n this._errorRequests = [];\n this._lastError = null;\n break;\n }\n }\n };\n\n requests.subscribeForRecord(identity, handleRequest);\n\n // we instantiate lazily\n // so we grab anything we don't have yet\n const lastRequest = requests.getLastRequestForRecord(identity);\n if (lastRequest) {\n handleRequest(lastRequest);\n }\n\n this.handler = notifications.subscribe(\n identity,\n (identifier: ResourceKey, type: NotificationType, key?: string) => {\n switch (type) {\n case 'state':\n this.notify('isSaved');\n this.notify('isNew');\n this.notify('isDeleted');\n this.notify('isDirty');\n break;\n case 'attributes':\n this.notify('isEmpty');\n this.notify('isDirty');\n break;\n case 'errors':\n this.updateInvalidErrors(this.record.errors);\n this.notify('isValid');\n break;\n }\n }\n );\n }\n\n /** @internal */\n destroy(): void {\n storeFor(this.record, false)!.notifications.unsubscribe(this.handler);\n }\n\n /** @internal */\n notify(key: keyof this & string): void {\n const signals = withSignalStore(this);\n const signal = peekInternalSignal(signals, key);\n if (signal) {\n notifyInternalSignal(signal);\n }\n }\n\n /** @internal */\n updateInvalidErrors(errors: Errors): void {\n assert(\n `Expected the Cache instance for ${this.identifier.lid} to implement getErrors(identifier)`,\n typeof this.cache.getErrors === 'function'\n );\n const jsonApiErrors = this.cache.getErrors(this.identifier);\n\n errors.clear();\n\n for (let i = 0; i < jsonApiErrors.length; i++) {\n const error = jsonApiErrors[i];\n\n if (error.source && error.source.pointer) {\n const keyMatch = error.source.pointer.match(SOURCE_POINTER_REGEXP);\n let key: string | undefined;\n\n if (keyMatch) {\n key = keyMatch[2];\n } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {\n key = PRIMARY_ATTRIBUTE_KEY;\n }\n\n if (key) {\n const errMsg = error.detail || error.title;\n assert(`Expected field error to have a detail or title to use as the message`, errMsg);\n errors.add(key, errMsg);\n }\n }\n }\n }\n\n /** @internal */\n cleanErrorRequests(): void {\n this.notify('isValid');\n this.notify('isError');\n this.notify('adapterError');\n this._errorRequests = [];\n this._lastError = null;\n }\n\n declare isSaving: boolean;\n\n @gate\n get isLoading(): boolean {\n return !this.isLoaded && this.pendingCount > 0 && this.fulfilledCount === 0;\n }\n\n @gate\n get isLoaded(): boolean {\n if (this.isNew) {\n return true;\n }\n return this.fulfilledCount > 0 || !this.isEmpty;\n }\n\n @gate\n get isSaved(): boolean {\n const rd = this.cache;\n if (this.isDeleted) {\n assert(`Expected Cache to implement isDeletionCommitted()`, typeof rd.isDeletionCommitted === 'function');\n return rd.isDeletionCommitted(this.identifier);\n }\n if (this.isNew || this.isEmpty || !this.isValid || this.isDirty || this.isLoading) {\n return false;\n }\n return true;\n }\n\n @gate\n get isEmpty(): boolean {\n const rd = this.cache;\n // TODO this is not actually an RFC'd concept. Determine the\n // correct heuristic to replace this with.\n assert(`Expected Cache to implement isEmpty()`, typeof rd.isEmpty === 'function');\n return !this.isNew && rd.isEmpty(this.identifier);\n }\n\n @gate\n get isNew(): boolean {\n const rd = this.cache;\n assert(`Expected Cache to implement isNew()`, typeof rd.isNew === 'function');\n return rd.isNew(this.identifier);\n }\n\n @gate\n get isDeleted(): boolean {\n const rd = this.cache;\n assert(`Expected Cache to implement isDeleted()`, typeof rd.isDeleted === 'function');\n return rd.isDeleted(this.identifier);\n }\n\n @gate\n get isValid(): boolean {\n return this.record.errors.length === 0;\n }\n\n @gate\n get isDirty(): boolean {\n const rd = this.cache;\n if (this.isEmpty || rd.isDeletionCommitted(this.identifier) || (this.isDeleted && this.isNew)) {\n return false;\n }\n return this.isDeleted || this.isNew || rd.hasChangedAttrs(this.identifier);\n }\n\n @gate\n get isError(): boolean {\n const errorReq = this._errorRequests[this._errorRequests.length - 1];\n if (!errorReq) {\n return false;\n } else {\n return true;\n }\n }\n\n @gate\n get adapterError(): unknown {\n const request = this._lastError;\n if (!request) {\n return null;\n }\n return request.state === 'rejected' && request.response!.data;\n }\n\n @memoized\n get isPreloaded(): boolean {\n return !this.isEmpty && this.isLoading;\n }\n\n @memoized\n get stateName():\n | 'root.loading'\n | 'root.empty'\n | 'root.deleted.inFlight'\n | 'root.deleted.saved'\n | 'root.deleted.invalid'\n | 'root.deleted.uncommitted'\n | 'root.loaded.created.inFlight'\n | 'root.loaded.created.invalid'\n | 'root.loaded.created.uncommitted'\n | 'root.loaded.updated.inFlight'\n | 'root.loaded.updated.invalid'\n | 'root.loaded.updated.uncommitted'\n | 'root.loaded.saved' {\n // we might be empty while loading so check this first\n if (this.isLoading) {\n return 'root.loading';\n\n // got nothing yet or were unloaded\n } else if (this.isEmpty) {\n return 'root.empty';\n\n // deleted substates\n } else if (this.isDeleted) {\n if (this.isSaving) {\n return 'root.deleted.inFlight';\n } else if (this.isSaved) {\n // TODO ensure isSaved isn't true from previous requests\n return 'root.deleted.saved';\n } else if (!this.isValid) {\n return 'root.deleted.invalid';\n } else {\n return 'root.deleted.uncommitted';\n }\n\n // loaded.created substates\n } else if (this.isNew) {\n if (this.isSaving) {\n return 'root.loaded.created.inFlight';\n } else if (!this.isValid) {\n return 'root.loaded.created.invalid';\n }\n return 'root.loaded.created.uncommitted';\n\n // loaded.updated substates\n } else if (this.isSaving) {\n return 'root.loaded.updated.inFlight';\n } else if (!this.isValid) {\n return 'root.loaded.updated.invalid';\n } else if (this.isDirty) {\n return 'root.loaded.updated.uncommitted';\n\n // if nothing remains, we are loaded saved!\n } else {\n return 'root.loaded.saved';\n }\n }\n\n @memoized\n get dirtyType(): '' | 'deleted' | 'created' | 'updated' {\n // we might be empty while loading so check this first\n if (this.isLoading || this.isEmpty) {\n return '';\n\n // deleted substates\n } else if (this.isDirty && this.isDeleted) {\n return 'deleted';\n\n // loaded.created substates\n } else if (this.isNew) {\n return 'created';\n\n // loaded.updated substates\n } else if (this.isSaving || !this.isValid || this.isDirty) {\n return 'updated';\n\n // if nothing remains, we are loaded saved!\n } else {\n return '';\n }\n }\n}\ndefineSignal(RecordState.prototype, 'isSaving', false);\n\nfunction notifyErrorsStateChanged(state: RecordState) {\n state.notify('isValid');\n state.notify('isError');\n state.notify('adapterError');\n}\n","import { deprecate } from '@ember/debug';\nimport EmberObject from '@ember/object';\n\nimport type { NotificationType, Store } from '@warp-drive/core';\nimport { recordIdentifierFor, storeFor } from '@warp-drive/core';\nimport { DEBUG } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport { defineGate, entangleSignal, gate, memoized, withSignalStore } from '@warp-drive/core/signals/-leaked';\nimport { assertPrivateStore, coerceId } from '@warp-drive/core/store/-private';\nimport type { ModelSchema, ResourceKey } from '@warp-drive/core/types';\nimport type { ChangedAttributesHash } from '@warp-drive/core/types/cache';\nimport type { LegacyAttributeField, LegacyRelationshipField } from '@warp-drive/core/types/schema/fields';\nimport { RecordStore } from '@warp-drive/core/types/symbols';\n\nimport type { Snapshot } from '../../compat/-private.ts';\nimport { Errors } from './errors.ts';\nimport { LEGACY_SUPPORT } from './legacy-relationships-support.ts';\nimport type { MinimalLegacyRecord } from './model-methods.ts';\nimport {\n _destroyRecord,\n _reload,\n _save,\n belongsTo,\n changedAttributes,\n createSnapshot,\n deleteRecord,\n destroyRecord,\n hasMany,\n reload,\n rollbackAttributes,\n save,\n serialize,\n unloadRecord,\n} from './model-methods.ts';\nimport notifyChanges from './notify-changes.ts';\nimport RecordState from './record-state.ts';\nimport type BelongsToReference from './references/belongs-to.ts';\nimport type HasManyReference from './references/has-many.ts';\nimport type {\n _MaybeBelongsToFields,\n isSubClass,\n MaybeAttrFields,\n MaybeHasManyFields,\n MaybeRelationshipFields,\n} from './type-utils.ts';\n\nexport type ModelCreateArgs = {\n _createProps: Record<string, unknown>;\n // TODO @deprecate consider deprecating accessing record properties during init which the below is necessary for\n _secretInit: {\n identifier: ResourceKey;\n store: Store;\n cb: (record: Model, identifier: ResourceKey, store: Store) => void;\n };\n};\n\nexport type StaticModel = typeof Model & { create(options: ModelCreateArgs): Model };\nexport type ModelFactory = { class: StaticModel };\nexport type FactoryCache = Record<string, ModelFactory>;\n// we put this on the store for interop because it's used by modelFor and\n// instantiateRecord as well.\nexport type ModelStore = Store & { _modelFactoryCache: FactoryCache };\n\n/*\n * This decorator allows us to lazily compute\n * an expensive getter on first-access and thereafter\n * never recompute it.\n */\nfunction computeOnce(target: object, propertyName: string, desc: PropertyDescriptor) {\n const cache = new WeakMap<object, { hasComputed: boolean; value: unknown }>();\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const getter = desc.get;\n desc.get = function () {\n let meta = cache.get(this);\n\n if (!meta) {\n meta = { hasComputed: false, value: undefined };\n cache.set(this, meta);\n }\n\n if (!meta.hasComputed) {\n meta.value = (getter as () => unknown).call(this);\n meta.hasComputed = true;\n }\n\n return meta.value;\n };\n return desc;\n}\n\ninterface Model {\n // set during create by the store\n /**\n * The store service instance which created this record instance\n */\n store: Store;\n /** @internal */\n ___recordState: RecordState;\n /** @internal */\n ___private_notifications: object;\n /** @internal */\n _isReloading: boolean;\n /** @internal */\n [RecordStore]: Store;\n\n /**\n Create a JSON representation of the record, using the serialization\n strategy of the store's adapter.\n\n `serialize` takes an optional hash as a parameter, currently\n supported options are:\n\n - `includeId`: `true` if the record's ID should be included in the\n JSON representation.\n\n @public\n @param {Object} options\n @return {Object} an object whose values are primitive JSON values only\n */\n serialize<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): unknown;\n\n /**\n Same as `deleteRecord`, but saves the record immediately.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n delete = () => {\n this.args.model.destroyRecord().then(function() {\n this.transitionToRoute('model.index');\n });\n }\n }\n ```\n\n If you pass an object on the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot\n\n ```js\n record.destroyRecord({ adapterOptions: { subscribe: false } });\n ```\n\n ```js [app/adapters/post.js]\n import MyCustomAdapter from './custom-adapter';\n\n export default class PostAdapter extends MyCustomAdapter {\n deleteRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n\n @public\n @param options\n @return a promise that will be resolved when the adapter returns\n successfully or rejected if the adapter returns with an error.\n */\n destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<this>;\n\n /**\n Unloads the record from the store. This will not send a delete request\n to your server, it just unloads the record from memory.\n\n @public\n */\n unloadRecord<T extends MinimalLegacyRecord>(this: T): void;\n\n /**\n Returns an object, whose keys are changed properties, and value is\n an [oldProp, newProp] array.\n\n The array represents the diff of the canonical state with the local state\n of the model. Note: if the model is created locally, the canonical state is\n empty since the adapter hasn't acknowledged the attributes yet:\n\n Example\n\n ```js [app/models/mascot.js]\n import { Model, attr } from '@warp-drive/legacy/model';\n\n export default class MascotModel extends Model {\n @attr('string') name;\n @attr('boolean', {\n defaultValue: false\n })\n isAdmin;\n }\n ```\n\n ```javascript\n let mascot = store.createRecord('mascot');\n\n mascot.changedAttributes(); // {}\n\n mascot.set('name', 'Tomster');\n mascot.changedAttributes(); // { name: [undefined, 'Tomster'] }\n\n mascot.set('isAdmin', true);\n mascot.changedAttributes(); // { isAdmin: [undefined, true], name: [undefined, 'Tomster'] }\n\n mascot.save().then(function() {\n mascot.changedAttributes(); // {}\n\n mascot.set('isAdmin', false);\n mascot.changedAttributes(); // { isAdmin: [true, false] }\n });\n ```\n\n @public\n @return {Object} an object, whose keys are changed properties,\n and value is an [oldProp, newProp] array.\n */\n changedAttributes<T extends MinimalLegacyRecord>(this: T): ChangedAttributesHash;\n\n /**\n If the model `hasDirtyAttributes` this function will discard any unsaved\n changes. If the model `isNew` it will be removed from the store.\n\n Example\n\n ```javascript\n record.name; // 'Untitled Document'\n record.set('name', 'Doc 1');\n record.name; // 'Doc 1'\n record.rollbackAttributes();\n record.name; // 'Untitled Document'\n ```\n\n @since 1.13.0\n @public\n */\n rollbackAttributes<T extends MinimalLegacyRecord>(this: T): void;\n\n // TODO @deprecate in favor of a public API or examples of how to test successfully\n /**\n @private\n */\n _createSnapshot<T extends MinimalLegacyRecord>(this: T): Snapshot<T>;\n\n /**\n Save the record and persist any changes to the record to an\n external source via the adapter.\n\n Example\n\n ```javascript\n record.set('name', 'Tomster');\n record.save().then(function() {\n // Success callback\n }, function() {\n // Error callback\n });\n ```\n\n If you pass an object using the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot.\n\n ```js\n record.save({ adapterOptions: { subscribe: false } });\n ```\n\n ```js [app/adapters/post.js]\n import MyCustomAdapter from './custom-adapter';\n\n export default class PostAdapter extends MyCustomAdapter {\n updateRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n\n @deprecated use {@link Store.request} instead\n @public\n @return a promise that will be resolved when the adapter returns\n successfully or rejected if the adapter returns with an error.\n */\n save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<this>;\n\n /**\n Reload the record from the adapter.\n\n This will only work if the record has already finished loading.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n async reload = () => {\n await this.args.model.reload();\n // do something with the reloaded model\n }\n }\n ```\n\n @public\n @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter request\n\n @return {Promise} a promise that will be resolved with the record when the\n adapter returns successfully or rejected if the adapter returns\n with an error.\n */\n\n reload<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;\n\n // belongsTo<T extends MinimalLegacyRecord, K extends MaybeBelongsToFields<T>>(\n // this: T,\n // prop: K\n // ): BelongsToReference<T, K>;\n\n /**\n Get the reference for the specified belongsTo relationship.\n\n For instance, given the following model\n\n ```js [app/models/blog-post.js]\n import { Model, belongsTo } from '@warp-drive/legacy/model';\n\n export default class BlogPost extends Model {\n @belongsTo('user', { async: true, inverse: null }) author;\n }\n ```\n\n Then the reference for the author relationship would be\n retrieved from a record instance like so:\n\n ```js\n blogPost.belongsTo('author');\n ```\n\n A `BelongsToReference` is a low-level API that allows access\n and manipulation of a belongsTo relationship.\n\n It is especially useful when you're dealing with `async` relationships\n as it allows synchronous access to the relationship data if loaded, as\n well as APIs for loading, reloading the data or accessing available\n information without triggering a load.\n\n It may also be useful when using `sync` relationships that need to be\n loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @public\n @param prop - the name of the relationship\n @since 2.5.0\n @return reference for this relationship\n */\n belongsTo<T extends Model, K extends keyof T & string>(\n this: T,\n prop: K & (K extends _MaybeBelongsToFields<T> ? K : never)\n ): BelongsToReference<T, K>;\n\n /**\n Get the reference for the specified hasMany relationship.\n\n For instance, given the following model\n\n ```js [app/models/blog-post.js]\n import { Model, hasMany } from '@warp-drive/legacy/model';\n\n export default class BlogPost extends Model {\n @hasMany('comment', { async: true, inverse: null }) comments;\n }\n ```\n\n Then the reference for the comments relationship would be\n retrieved from a record instance like so:\n\n ```js\n blogPost.hasMany('comments');\n ```\n\n A `HasManyReference` is a low-level API that allows access\n and manipulation of a hasMany relationship.\n\n It is especially useful when you are dealing with `async` relationships\n as it allows synchronous access to the relationship data if loaded, as\n well as APIs for loading, reloading the data or accessing available\n information without triggering a load.\n\n It may also be useful when using `sync` relationships with `@ember-data/model`\n that need to be loaded/reloaded with more precise timing than marking the\n relationship as `async` and relying on autofetch would have allowed.\n\n However,keep in mind that marking a relationship as `async: false` will introduce\n bugs into your application if the data is not always guaranteed to be available\n by the time the relationship is accessed. Ergo, it is recommended when using this\n approach to utilize `links` for unloaded relationship state instead of identifiers.\n\n Reference APIs are entangled with the relationship's underlying state,\n thus any getters or cached properties that utilize these will properly\n invalidate if the relationship state changes.\n\n References are \"stable\", meaning that multiple calls to retrieve the reference\n for a given relationship will always return the same HasManyReference.\n\n @public\n @param prop - the name of the relationship\n @since 2.5.0\n @return reference for this relationship\n */\n hasMany<T extends MinimalLegacyRecord, K extends MaybeHasManyFields<T>>(this: T, prop: K): HasManyReference<T, K>;\n\n /**\n Marks the record as deleted but does not save it. You must call\n `save` afterwards if you want to persist it. You might use this\n method if you want to allow the user to still `rollbackAttributes()`\n after a delete was made.\n\n Example\n\n ```js\n import Component from '@glimmer/component';\n\n export default class extends Component {\n softDelete = () => {\n this.args.model.deleteRecord();\n }\n\n confirm = () => {\n this.args.model.save();\n }\n\n undo = () => {\n this.args.model.rollbackAttributes();\n }\n }\n ```\n\n @public\n */\n deleteRecord<T extends MinimalLegacyRecord>(this: T): void;\n}\n\n/**\n * Base class from which Models can be defined.\n *\n * ::: code-group\n *\n * ```js [app/models/user.js]\n * import { Model, attr, belongsTo, hasMany } from '@warp-drive/legacy/model';\n *\n * export default class User extends Model {\n * @attr name;\n * @attr('number') age;\n * @hasMany('post', { async: true, inverse: null }) posts;\n * @belongsTo('group', { async: false, inverse: 'users' }) group;\n * }\n * ```\n *\n * ```ts [app/models/user.ts]\n * import { Model, attr, belongsTo, hasMany, type AsyncHasMany } from '@warp-drive/legacy/model';\n * import type { NumberTransform } from '@ember-data/serializer/transform';\n * import type Group from './group';\n * import type Post from './post';\n *\n * export default class User extends Model {\n * @attr declare name: string;\n *\n * @attr<NumberTransform>('number')\n * declare age: number;\n *\n * @hasMany('post', { async: true, inverse: null })\n * declare posts: AsyncHasMany<Post>;\n *\n * @belongsTo('group', { async: false, inverse: 'users' })\n * declare group: Group | null;\n * }\n * ```\n *\n * :::\n *\n * Models both define the schema for a resource type and provide\n * the class to use as the reactive object for data of resource\n * of that type.\n *\n * @public\n * @noInheritDoc\n * @hideconstructor\n * @legacy\n */\nclass Model extends EmberObject implements MinimalLegacyRecord {\n /** @internal */\n init(options: ModelCreateArgs): void {\n if (DEBUG) {\n if (!options?._secretInit && !options?._createProps) {\n throw new Error(\n 'You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.'\n );\n }\n }\n const createProps = options._createProps;\n const _secretInit = options._secretInit;\n (options as Record<string, unknown>)._createProps = null;\n (options as Record<string, unknown>)._secretInit = null;\n\n const store = (this.store = _secretInit.store);\n super.init(options);\n\n this[RecordStore] = store;\n\n const identity = _secretInit.identifier;\n _secretInit.cb(this, identity, _secretInit.store);\n\n this.___recordState = DEBUG\n ? new RecordState(this as unknown as MinimalLegacyRecord)\n : (null as unknown as RecordState);\n\n this.setProperties(createProps);\n\n const notifications = store.notifications;\n this.___private_notifications = notifications.subscribe(\n identity,\n (identifier: ResourceKey, type: NotificationType, field?: string): void => {\n notifyChanges(identifier, type, field, this, store);\n }\n );\n }\n\n /** @private */\n // @ts-expect-error destroy should not return a value, but ember's types force it to\n destroy(): this {\n const identifier = recordIdentifierFor(this);\n this.___recordState?.destroy();\n const store = storeFor(this, false)!;\n store.notifications.unsubscribe(this.___private_notifications);\n\n const support = LEGACY_SUPPORT.get(identifier);\n if (support) {\n support.destroy();\n LEGACY_SUPPORT.delete(identifier);\n }\n\n super.destroy();\n }\n\n /**\n If this property is `true` the record is in the `empty`\n state. Empty is the first state all records enter after they have\n been created. Most records created by the store will quickly\n transition to the `loading` state if data needs to be fetched from\n the server or the `created` state if the record is created on the\n client. A record can also enter the empty state if the adapter is\n unable to locate the record.\n\n @public\n */\n @memoized\n get isEmpty(): boolean {\n return this.currentState.isEmpty;\n }\n\n /**\n If this property is `true` the record is in the `loading` state. A\n record enters this state when the store asks the adapter for its\n data. It remains in this state until the adapter provides the\n requested data.\n\n @public\n */\n @memoized\n get isLoading(): boolean {\n return this.currentState.isLoading;\n }\n\n /**\n If this property is `true` the record is in the `loaded` state. A\n record enters this state when its data is populated. Most of a\n record's lifecycle is spent inside substates of the `loaded`\n state.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isLoaded; // true\n\n const { content: { data: model } } = await store.request(findRecord({ type: 'model', id: '1' }));\n model.isLoaded;\n ```\n\n @public\n */\n @memoized\n get isLoaded(): boolean {\n return this.currentState.isLoaded;\n }\n\n /**\n If this property is `true` the record is in the `dirty` state. The\n record has local changes that have not yet been saved by the\n adapter. This includes records that have been created (but not yet\n saved) or deleted.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.hasDirtyAttributes; // true\n\n const { content: { data: model } } = await store.request(findRecord({ type: 'model', id: '1' }));\n\n model.hasDirtyAttributes; // false\n model.foo = 'some value';\n model.hasDirtyAttributes; // true\n ```\n\n @since 1.13.0\n @public\n */\n @memoized\n get hasDirtyAttributes(): boolean {\n return this.currentState.isDirty;\n }\n\n /**\n If this property is `true` the record is in the `saving` state. A\n record enters the saving state when `save` is called, but the\n adapter has not yet acknowledged that the changes have been\n persisted to the backend.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isSaving; // false\n let promise = record.save();\n record.isSaving; // true\n promise.then(function() {\n record.isSaving; // false\n });\n ```\n\n @public\n */\n @memoized\n get isSaving(): boolean {\n return this.currentState.isSaving;\n }\n\n /**\n If this property is `true` the record is in the `deleted` state\n and has been marked for deletion. When `isDeleted` is true and\n `hasDirtyAttributes` is true, the record is deleted locally but the deletion\n was not yet persisted. When `isSaving` is true, the change is\n in-flight. When both `hasDirtyAttributes` and `isSaving` are false, the\n change has persisted.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isDeleted; // false\n record.deleteRecord();\n\n // Locally deleted\n record.isDeleted; // true\n record.hasDirtyAttributes; // true\n record.isSaving; // false\n\n // Persisting the deletion\n let promise = record.save();\n record.isDeleted; // true\n record.isSaving; // true\n\n // Deletion Persisted\n promise.then(function() {\n record.isDeleted; // true\n record.isSaving; // false\n record.hasDirtyAttributes; // false\n });\n ```\n\n @public\n */\n @memoized\n get isDeleted(): boolean {\n return this.currentState.isDeleted;\n }\n\n /**\n If this property is `true` the record is in the `new` state. A\n record will be in the `new` state when it has been created on the\n client and the adapter has not yet report that it was successfully\n saved.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.isNew; // true\n\n record.save().then(function(model) {\n model.isNew; // false\n });\n ```\n\n @public\n */\n @memoized\n get isNew(): boolean {\n return this.currentState.isNew;\n }\n\n /**\n If this property is `true` the record is in the `valid` state.\n\n A record will be in the `valid` state when the adapter did not report any\n server-side validation failures.\n\n @public\n */\n @memoized\n get isValid(): boolean {\n return this.currentState.isValid;\n }\n\n /**\n If the record is in the dirty state this property will report what\n kind of change has caused it to move into the dirty\n state. Possible values are:\n\n - `created` The record has been created by the client and not yet saved to the adapter.\n - `updated` The record has been updated by the client and not yet saved to the adapter.\n - `deleted` The record has been deleted by the client and not yet saved to the adapter.\n\n Example\n\n ```javascript\n let record = store.createRecord('model');\n record.dirtyType; // 'created'\n ```\n\n @public\n */\n @memoized\n get dirtyType(): 'created' | 'updated' | 'deleted' | '' {\n return this.currentState.dirtyType;\n }\n\n /**\n If `true` the adapter reported that it was unable to save local\n changes to the backend for any reason other than a server-side\n validation error.\n\n Example\n\n ```javascript\n record.isError; // false\n record.set('foo', 'valid value');\n record.save().then(null, function() {\n record.isError; // true\n });\n ```\n\n @public\n */\n @memoized\n get isError(): boolean {\n return this.currentState.isError;\n }\n /**\n * `isError` is read-only and cannot be set directly.\n */\n set isError(v) {\n if (DEBUG) {\n throw new Error(`isError is not directly settable`);\n }\n }\n\n /**\n If `true` the store is attempting to reload the record from the adapter.\n\n Example\n\n ```javascript\n record.isReloading; // false\n record.reload();\n record.isReloading; // true\n ```\n\n @public\n */\n declare isReloading: boolean;\n\n /**\n All ember models have an id property. This is an identifier\n managed by an external source. These are always coerced to be\n strings before being used internally. Note when declaring the\n attributes for a model it is an error to declare an id\n attribute.\n\n ```javascript\n let record = store.createRecord('model');\n record.id; // null\n\n const { content: { data: model } } = await store.request(findRecord({ type: 'model', id: '1' }));\n model.id; // '1'\n ```\n\n @public\n */\n @gate\n get id(): string | null {\n // this guard exists, because some dev-only deprecation code\n // (addListener via validatePropertyInjections) invokes toString before the\n // object is real.\n if (DEBUG) {\n try {\n return recordIdentifierFor(this).id;\n } catch {\n return null;\n }\n }\n return recordIdentifierFor(this).id;\n }\n /**\n * Assigns the resource's primary key. Typically only used internally\n * when a client-created record is assigned an id upon being saved.\n */\n set id(id) {\n const normalizedId = coerceId(id);\n const identifier = recordIdentifierFor(this);\n const didChange = normalizedId !== identifier.id;\n assertPrivateStore(this.store);\n assert(\n `Cannot set ${identifier.type} record's id to ${id}, because id is already ${identifier.id}`,\n !didChange || identifier.id === null\n );\n\n if (normalizedId !== null && didChange) {\n this.store._instanceCache.setRecordId(identifier, normalizedId);\n this.store.notifications.notify(identifier, 'identity', null);\n }\n }\n\n toString() {\n return `<model::${(this.constructor as unknown as { modelName: string }).modelName}:${this.id}>`;\n }\n\n /**\n @private\n */\n // TODO we can probably make this a computeOnce\n // we likely do not need to notify the currentState root anymore\n @gate\n get currentState(): RecordState {\n // descriptors are called with the wrong `this` context during mergeMixins\n // when using legacy/classic ember classes. Basically: lazy in prod and eager in dev.\n // so we do this to try to steer folks to the nicer \"dont user currentState\"\n // error.\n if (!DEBUG) {\n if (!this.___recordState) {\n this.___recordState = new RecordState(this as unknown as MinimalLegacyRecord);\n }\n }\n return this.___recordState;\n }\n /**\n * `currentState` is read-only and cannot be set directly.\n */\n set currentState(_v) {\n throw new Error('cannot set currentState');\n }\n\n /**\n The store service instance which created this record instance\n\n @public\n */\n declare store: Store;\n\n /**\n When the record is in the `invalid` state this object will contain\n any errors returned by the adapter. When present the errors hash\n contains keys corresponding to the invalid property names\n and values which are arrays of Javascript objects with two keys:\n\n - `message` A string containing the error message from the backend\n - `attribute` The name of the property associated with this error message\n\n ```javascript\n record.errors.length; // 0\n record.set('foo', 'invalid value');\n record.save().catch(function() {\n record.errors.foo;\n // [{message: 'foo should be a number.', attribute: 'foo'}]\n });\n ```\n\n The `errors` property is useful for displaying error messages to\n the user.\n\n ```handlebars\n <label>Username: <Input @value={{@model.username}} /> </label>\n {{#each @model.errors.username as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n <label>Email: <Input @value={{@model.email}} /> </label>\n {{#each @model.errors.email as |error|}}\n <div class=\"error\">\n {{error.message}}\n </div>\n {{/each}}\n ```\n\n\n You can also access the special `messages` property on the error\n object to get an array of all the error strings.\n\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n <div class=\"error\">\n {{message}}\n </div>\n {{/each}}\n ```\n\n @public\n */\n @computeOnce\n get errors(): Errors {\n const errors = (Errors as unknown as { create(obj: object): Errors }).create({ __record: this });\n this.currentState.updateInvalidErrors(errors);\n return errors;\n }\n\n /**\n This property holds the `AdapterError` object with which\n last adapter operation was rejected.\n\n @public\n */\n @memoized\n get adapterError(): unknown {\n return this.currentState.adapterError;\n }\n /**\n * `adapterError` is read-only and cannot be set directly.\n */\n set adapterError(v) {\n throw new Error(`adapterError is not directly settable`);\n }\n\n /*\n We hook the default implementation to ensure\n our tagged properties are properly notified\n as well. We still super for everything because\n sync observers require a direct call occuring\n to trigger their flush. We wouldn't need to\n super in 4.0+ where sync observers are removed.\n */\n // @ts-expect-error no return is necessary, but Ember's types are forcing it\n notifyPropertyChange(prop: string): this {\n const signals = withSignalStore(this);\n entangleSignal(signals, this, prop, undefined);\n super.notifyPropertyChange(prop);\n }\n\n /** @internal */\n attr(): void {\n assert(\n 'The `attr` method is not available on Model, a Snapshot was probably expected. Are you passing a Model instead of a Snapshot to your serializer?',\n false\n );\n }\n\n /**\n Given a callback, iterates over each of the relationships in the model,\n invoking the callback with the name of each relationship and its relationship\n descriptor.\n\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, descriptor);\n ```\n\n - `name` the name of the current property in the iteration\n - `descriptor` the meta object that describes this relationship\n\n The relationship descriptor argument is an object with the following properties.\n\n - **name** <span class=\"type\">String</span> the name of this relationship on the Model\n - **kind** <span class=\"type\">String</span> \"hasMany\" or \"belongsTo\"\n - **options** <span class=\"type\">Object</span> the original options hash passed when the relationship was declared\n - **parentType** <span class=\"type\">Model</span> the type of the Model that owns this relationship\n - **type** <span class=\"type\">String</span> the type name of the related Model\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```js [app/serializers/application.js]\n import JSONSerializer from '@ember-data/serializer/json';\n\n export default class ApplicationSerializer extends JSONSerializer {\n serialize(record, options) {\n let json = {};\n\n record.eachRelationship(function(name, descriptor) {\n if (descriptor.kind === 'hasMany') {\n let serializedHasManyName = name.toUpperCase() + '_IDS';\n json[serializedHasManyName] = record.get(name).map(r => r.id);\n }\n });\n\n return json;\n }\n }\n ```\n\n @public\n @param callback the callback to invoke\n @param binding the value to which the callback's `this` should be bound\n */\n eachRelationship<T>(\n callback: (this: NoInfer<T> | undefined, key: MaybeRelationshipFields<this>, meta: LegacyRelationshipField) => void,\n binding?: T\n ): void {\n (this.constructor as typeof Model).eachRelationship<T, this>(callback, binding);\n }\n\n /**\n * Returns the relationship schema for the given relationship name, if any.\n */\n relationshipFor(name: string): LegacyRelationshipField | undefined {\n return (this.constructor as typeof Model).relationshipsByName.get(name);\n }\n\n /**\n * Returns the inverse relationship schema for the given relationship\n * name, if one exists. See {@link Model.inverseFor | the static inverseFor}.\n */\n inverseFor(name: string): LegacyRelationshipField | null {\n return (this.constructor as typeof Model).inverseFor(name, storeFor(this, false)!);\n }\n\n /**\n * Iterates over the attributes defined on this record's class, calling\n * `callback` for each one. See {@link Model.eachAttribute | the static eachAttribute}.\n *\n * @param callback the callback to invoke\n * @param binding the value to which the callback's `this` should be bound\n */\n eachAttribute<T>(\n callback: (\n this: NoInfer<T> | undefined,\n key: isSubClass<this> extends true ? MaybeAttrFields<this> : string,\n meta: LegacyAttributeField\n ) => void,\n binding?: T\n ): void {\n (this.constructor as typeof Model).eachAttribute<T, this>(callback, binding);\n }\n\n /**\n * @internal\n */\n static isModel = true;\n\n /**\n Represents the model's class name as a string. This can be used to look up the model's class name through\n `Store`'s modelFor method.\n\n `modelName` is generated for you by WarpDrive. It will be a lowercased, dasherized string.\n For example:\n\n ```javascript\n store.modelFor('post').modelName; // 'post'\n store.modelFor('blog-post').modelName; // 'blog-post'\n ```\n\n The most common place you'll want to access `modelName` is in your serializer's `payloadKeyFromModelName` method. For example, to change payload\n keys to underscore (instead of dasherized), you might use the following code:\n\n ```javascript\n import RESTSerializer from '@ember-data/serializer/rest';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default const PostSerializer = RESTSerializer.extend({\n payloadKeyFromModelName(modelName) {\n return underscore(modelName);\n }\n });\n ```\n\n @public\n */\n static modelName: string = null as unknown as string;\n\n /*\n These class methods below provide relationship\n introspection abilities about relationships.\n\n A note about the computed properties contained here:\n\n **These properties are effectively sealed once called for the first time.**\n To avoid repeatedly doing expensive iteration over a model's fields, these\n values are computed once and then cached for the remainder of the runtime of\n your application.\n\n If your application needs to modify a class after its initial definition\n (for example, using `reopen()` to add additional attributes), make sure you\n do it before using your model with the store, which uses these properties\n extensively.\n */\n\n /**\n For a given relationship name, returns the model type of the relationship.\n\n For example, if you define a model like this:\n\n ```js [app/models/post.js]\n import { Model, hasMany } from '@warp-drive/legacy/model';\n\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n\n Calling `store.modelFor('post').typeForRelationship('comments', store)` will return `Comment`.\n\n @public\n @param name the name of the relationship\n @param store an instance of Store\n @return the type of the relationship, or undefined\n */\n static typeForRelationship(name: string, store: Store): ModelSchema | undefined {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationship = this.relationshipsByName.get(name);\n return relationship && store.modelFor(relationship.type);\n }\n\n /**\n * A cache of resolved inverse relationships by name, populated lazily by\n * {@link Model.inverseFor | inverseFor}.\n */\n @computeOnce\n static get inverseMap(): Record<string, LegacyRelationshipField | null> {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n return Object.create(null) as Record<string, LegacyRelationshipField | null>;\n }\n\n /**\n Find the relationship which is the inverse of the one asked for.\n\n For example, if you define models like this:\n\n ```js [app/models/post.js]\n import { Model, hasMany } from '@warp-drive/legacy/model';\n\n export default class PostModel extends Model {\n @hasMany('message') comments;\n }\n ```\n\n ```js [app/models/message.js]\n import { Model, belongsTo } from '@warp-drive/legacy/model';\n\n export default class MessageModel extends Model {\n @belongsTo('post') owner;\n }\n ```\n\n ``` js\n store.modelFor('post').inverseFor('comments', store) // { type: 'message', name: 'owner', kind: 'belongsTo' }\n store.modelFor('message').inverseFor('owner', store) // { type: 'post', name: 'comments', kind: 'hasMany' }\n ```\n\n @public\n @param name the name of the relationship\n @param store\n @return the inverse relationship, or null\n */\n static inverseFor(name: string, store: Store): LegacyRelationshipField | null {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const inverseMap = this.inverseMap;\n if (inverseMap[name]) {\n return inverseMap[name];\n } else {\n const inverse = this._findInverseFor(name, store);\n inverseMap[name] = inverse;\n return inverse;\n }\n }\n\n /**\n * @private\n */\n //Calculate the inverse, ignoring the cache\n static _findInverseFor(name: string, store: Store): LegacyRelationshipField | null {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationship = this.relationshipsByName.get(name)!;\n assert(`No relationship named '${name}' on '${this.modelName}' exists.`, relationship);\n\n if (!relationship) {\n return null;\n }\n\n const { options } = relationship;\n assert(\n `Expected the relationship ${name} on ${this.modelName} to define an inverse.`,\n options.inverse === null || (typeof options.inverse === 'string' && options.inverse.length > 0)\n );\n\n if (options.inverse === null) {\n return null;\n }\n\n const schemaExists = store.schema.hasResource(relationship);\n\n assert(\n `No associated schema found for '${relationship.type}' while calculating the inverse of ${name} on ${this.modelName}`,\n schemaExists\n );\n\n if (!schemaExists) {\n return null;\n }\n\n const inverseField = store.schema.fields(relationship).get(options.inverse);\n assert(\n `No inverse relationship found for '${name}' on '${this.modelName}'`,\n inverseField && (inverseField.kind === 'belongsTo' || inverseField.kind === 'hasMany')\n );\n\n return inverseField || null;\n }\n\n /**\n The model's relationships as a map, keyed on the type of the\n relationship. The value of each entry is an array containing a descriptor\n for each relationship with that type, describing the name of the relationship\n as well as the type.\n\n For example, given the following model definition:\n\n ```js [app/models/blog.js]\n import { Model, belongsTo, hasMany } from '@warp-drive/legacy/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n @hasMany('post') posts;\n }\n ```\n\n This computed property would return a map describing these\n relationships, like this:\n\n ```javascript\n import Blog from 'app/models/blog';\n import User from 'app/models/user';\n import Post from 'app/models/post';\n\n let relationships = Blog.relationships;\n relationships.user;\n //=> [ { name: 'users', kind: 'hasMany' },\n // { name: 'owner', kind: 'belongsTo' } ]\n relationships.post;\n //=> [ { name: 'posts', kind: 'hasMany' } ]\n ```\n\n @public\n */\n @computeOnce\n static get relationships(): Map<string, LegacyRelationshipField[]> {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map<string, LegacyRelationshipField[]>();\n const relationshipsByName = this.relationshipsByName;\n\n // Loop through each computed property on the class\n relationshipsByName.forEach((desc) => {\n const { type } = desc;\n\n if (!map.has(type)) {\n map.set(type, []);\n }\n\n map.get(type)!.push(desc);\n });\n\n return map;\n }\n\n /**\n A hash containing lists of the model's relationships, grouped\n by the relationship kind. For example, given a model with this\n definition:\n\n ```js [app/models/blog.js]\n import { Model, belongsTo, hasMany } from '@warp-drive/legacy/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relationshipNames = Blog.relationshipNames;\n relationshipNames.hasMany;\n //=> ['users', 'posts']\n relationshipNames.belongsTo;\n //=> ['owner']\n ```\n\n @public\n */\n @computeOnce\n static get relationshipNames(): {\n /**\n * the names of the model's `hasMany` relationships\n */\n hasMany: string[];\n /**\n * the names of the model's `belongsTo` relationships\n */\n belongsTo: string[];\n } {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const names: { hasMany: string[]; belongsTo: string[] } = {\n hasMany: [],\n belongsTo: [],\n };\n\n this.eachComputedProperty((name, meta) => {\n if (isRelationshipSchema(meta)) {\n names[meta.kind].push(name);\n }\n });\n\n return names;\n }\n\n /**\n An array of types directly related to a model. Each type will be\n included once, regardless of the number of relationships it has with\n the model.\n\n For example, given a model with this definition:\n\n ```js [app/models/blog.js]\n import { Model, belongsTo, hasMany } from '@warp-drive/legacy/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relatedTypes = Blog.relatedTypes');\n //=> ['user', 'post']\n ```\n\n @public\n */\n @computeOnce\n static get relatedTypes(): string[] {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const types: string[] = [];\n\n const rels = this.relationshipsObject;\n const relationships = Object.keys(rels);\n\n // create an array of the unique types involved\n // in relationships\n for (let i = 0; i < relationships.length; i++) {\n const name = relationships[i];\n const meta = rels[name];\n const modelName = meta.type;\n\n if (!types.includes(modelName)) {\n types.push(modelName);\n }\n }\n\n return types;\n }\n\n /**\n A map whose keys are the relationships of a model and whose values are\n relationship descriptors.\n\n For example, given a model with this\n definition:\n\n ```js [app/models/blog.js]\n import { Model, belongsTo, hasMany } from '@warp-drive/legacy/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n }\n ```\n\n This property would contain the following:\n\n ```javascript\n import Blog from 'app/models/blog';\n\n let relationshipsByName = Blog.relationshipsByName;\n relationshipsByName.users;\n //=> { name: 'users', kind: 'hasMany', type: 'user', options: Object }\n relationshipsByName.owner;\n //=> { name: 'owner', kind: 'belongsTo', type: 'user', options: Object }\n ```\n\n @public\n */\n @computeOnce\n static get relationshipsByName(): Map<string, LegacyRelationshipField> {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const map = new Map();\n const rels = this.relationshipsObject;\n const relationships = Object.keys(rels);\n\n for (let i = 0; i < relationships.length; i++) {\n const name = relationships[i];\n const value = rels[name];\n\n map.set(value.name, value);\n }\n\n return map;\n }\n\n /**\n * A hash of the model's relationship schemas keyed by relationship name.\n * See also {@link Model.relationshipsByName | relationshipsByName}, which\n * provides the same information as a `Map`.\n */\n @computeOnce\n static get relationshipsObject(): Record<string, LegacyRelationshipField> {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationships = Object.create(null) as Record<string, LegacyRelationshipField>;\n const modelName = this.modelName;\n this.eachComputedProperty((name: string, meta: unknown) => {\n if (!isRelationshipSchema(meta)) {\n return;\n }\n // TODO deprecate key being here\n (meta as unknown as { key: string }).key = name;\n meta.name = name;\n relationships[name] = meta;\n\n assert(`Expected options in meta`, meta.options && typeof meta.options === 'object');\n assert(\n `You should not specify both options.as and options.inverse as null on ${modelName}.${meta.name}, as if there is no inverse field there is no abstract type to conform to. You may have intended for this relationship to be polymorphic, or you may have mistakenly set inverse to null.`,\n !(meta.options.inverse === null && meta.options.as?.length)\n );\n });\n return relationships;\n }\n\n /**\n A map whose keys are the fields of the model and whose values are strings\n describing the kind of the field. A model's fields are the union of all of its\n attributes and relationships.\n\n For example:\n\n ```js [app/models/blog.js]\n import { Model, attr, belongsTo, hasMany } from '@warp-drive/legacy/model';\n\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n\n @hasMany('post') posts;\n\n @attr('string') title;\n }\n ```\n\n ```js\n import Blog from 'app/models/blog'\n\n let fields = Blog.fields;\n fields.forEach(function(kind, field) {\n // do thing\n });\n\n // prints:\n // users, hasMany\n // owner, belongsTo\n // posts, hasMany\n // title, attribute\n ```\n\n @public\n */\n @computeOnce\n static get fields(): Map<string, 'attribute' | 'belongsTo' | 'hasMany'> {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n const map = new Map();\n\n this.eachComputedProperty((name, meta) => {\n if (isRelationshipSchema(meta)) {\n map.set(name, meta.kind);\n } else if (isAttributeSchema(meta)) {\n map.set(name, 'attribute');\n }\n });\n\n return map;\n }\n\n /**\n Given a callback, iterates over each of the relationships in the model,\n invoking the callback with the name of each relationship and its relationship\n descriptor.\n\n @public\n @param callback the callback to invoke\n @param binding the value to which the callback's `this` should be bound\n */\n static eachRelationship<T, Schema extends Model>(\n callback: (\n this: T | undefined,\n key: MaybeRelationshipFields<Schema>,\n relationship: LegacyRelationshipField\n ) => void,\n binding?: T\n ): void {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.relationshipsByName.forEach((relationship, name) => {\n callback.call(binding, name as MaybeRelationshipFields<Schema>, relationship);\n });\n }\n\n /**\n Given a callback, iterates over each of the types related to a model,\n invoking the callback with the related type's class. Each type will be\n returned just once, regardless of how many different relationships it has\n with a model.\n\n @public\n @param callback the callback to invoke\n @param binding the value to which the callback's `this` should be bound\n */\n static eachRelatedType<T>(callback: (this: T | undefined, type: string) => void, binding?: T): void {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const relationshipTypes = this.relatedTypes;\n\n for (let i = 0; i < relationshipTypes.length; i++) {\n const type = relationshipTypes[i];\n callback.call(binding, type);\n }\n }\n\n /**\n *\n * @private\n * @deprecated\n */\n static determineRelationshipType(\n knownSide: LegacyRelationshipField,\n store: Store\n ): 'oneToOne' | 'oneToMany' | 'manyToOne' | 'manyToMany' | 'oneToNone' | 'manyToNone' {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const knownKey = knownSide.name;\n const knownKind = knownSide.kind;\n const inverse = this.inverseFor(knownKey, store);\n // let key;\n\n if (!inverse) {\n return knownKind === 'belongsTo' ? 'oneToNone' : 'manyToNone';\n }\n\n // key = inverse.name;\n const otherKind = inverse.kind;\n\n if (otherKind === 'belongsTo') {\n return knownKind === 'belongsTo' ? 'oneToOne' : 'manyToOne';\n } else {\n return knownKind === 'belongsTo' ? 'oneToMany' : 'manyToMany';\n }\n }\n\n /**\n A map whose keys are the attributes of the model (properties\n described by attr) and whose values are the meta object for the\n property.\n\n Example\n\n ```js [app/models/person.js]\n import { Model, attr } from '@warp-drive/legacy/model';\n\n export default class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n ```\n\n ```javascript\n import Person from 'app/models/person'\n\n let attributes = Person.attributes\n\n attributes.forEach(function(meta, name) {\n // do thing\n });\n\n // prints:\n // firstName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", kind: 'attribute', options: Object, parentType: function, name: \"birthday\"}\n ```\n\n @public\n */\n @computeOnce\n static get attributes(): Map<string, LegacyAttributeField> {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map<string, LegacyAttributeField>();\n\n this.eachComputedProperty((name, meta) => {\n if (isAttributeSchema(meta)) {\n assert(\n \"You may not set 'id' as an attribute on your model. Please remove any lines that look like: `id: attr('<type>')` from \" +\n this.toString(),\n name !== 'id'\n );\n\n // TODO deprecate key being here\n (meta as unknown as { key: string }).key = name;\n meta.name = name;\n map.set(name, meta);\n }\n });\n\n return map;\n }\n\n /**\n A map whose keys are the attributes of the model (properties\n described by attr) and whose values are type of transformation\n applied to each attribute. This map does not include any\n attributes that do not have an transformation type.\n\n Example\n\n ```js [app/models/person.js]\n import { Model, attr } from '@warp-drive/legacy/model';\n\n export default class PersonModel extends Model {\n @attr firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n ```\n\n ```javascript\n import Person from 'app/models/person';\n\n let transformedAttributes = Person.transformedAttributes\n\n transformedAttributes.forEach(function(field, type) {\n // do thing\n });\n\n // prints:\n // lastName string\n // birthday date\n ```\n\n @public\n */\n @computeOnce\n static get transformedAttributes(): Map<string, string> {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n const map = new Map<string, string>();\n\n this.eachAttribute((name: string, meta: LegacyAttributeField) => {\n if (meta.type) {\n map.set(name, meta.type);\n }\n });\n\n return map;\n }\n\n /**\n Iterates through the attributes of the model, calling the passed function on each\n attribute.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, meta);\n ```\n\n - `name` the name of the current property in the iteration\n - `meta` the meta object for the attribute property in the iteration\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```javascript\n import { Model, attr } from '@warp-drive/legacy/model';\n\n class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n\n PersonModel.eachAttribute(function(name, meta) {\n // do thing\n });\n\n // prints:\n // firstName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", kind: 'attribute', options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", kind: 'attribute', options: Object, parentType: function, name: \"birthday\"}\n ```\n\n @public\n @param callback The callback to execute\n @param binding [optional] the value to which the callback's `this` should be bound\n */\n static eachAttribute<T, Schema extends Model>(\n callback: (this: T | undefined, key: MaybeAttrFields<Schema>, attribute: LegacyAttributeField) => void,\n binding?: T\n ): void {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.attributes.forEach((meta, name) => {\n callback.call(binding, name as MaybeAttrFields<Schema>, meta);\n });\n }\n\n /**\n Iterates through the transformedAttributes of the model, calling\n the passed function on each attribute. Note the callback will not be\n called for any attributes that do not have an transformation type.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(name, type);\n ```\n\n - `name` the name of the current property in the iteration\n - `type` a string containing the name of the type of transformed\n applied to the attribute\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n\n Example\n\n ```javascript\n import { Model, attr } from '@warp-drive/legacy/model';\n\n let Person = Model.extend({\n firstName: attr(),\n lastName: attr('string'),\n birthday: attr('date')\n });\n\n Person.eachTransformedAttribute(function(name, type) {\n // do thing\n });\n\n // prints:\n // lastName string\n // birthday date\n ```\n\n @public\n @param callback The callback to execute\n @param binding [optional] the value to which the callback's `this` should be bound\n */\n static eachTransformedAttribute<T, Schema extends Model>(\n callback: (this: T | undefined, key: Exclude<keyof Schema & string, keyof Model & string>, type: string) => void,\n binding?: T\n ): void {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n this.transformedAttributes.forEach((type: string, name) => {\n callback.call(binding, name as Exclude<keyof Schema & string, keyof Model & string>, type);\n });\n }\n\n /**\n Returns the name of the model class.\n\n @public\n */\n static toString() {\n assert(\n `Accessing schema information on Models without looking up the model via the store is disallowed.`,\n this.modelName\n );\n\n return `model:${this.modelName}`;\n }\n}\n\n// @ts-expect-error TS doesn't know how to do `this` function overloads\nModel.prototype.save = save;\n// @ts-expect-error TS doesn't know how to do `this` function overloads\nModel.prototype.destroyRecord = destroyRecord;\nModel.prototype.unloadRecord = unloadRecord;\nModel.prototype.hasMany = hasMany;\nModel.prototype.belongsTo = belongsTo;\nModel.prototype.serialize = serialize;\nModel.prototype._createSnapshot = createSnapshot;\nModel.prototype.deleteRecord = deleteRecord;\nModel.prototype.changedAttributes = changedAttributes;\nModel.prototype.rollbackAttributes = rollbackAttributes;\nModel.prototype.reload = reload;\n\ndefineGate(Model.prototype, 'isReloading', {\n get(this: Model): boolean {\n deprecate(\n `record.isReloading is deprecated, please use store.request and either <Request> or getRequuestState to keep track of the request state instead.`,\n false,\n {\n id: 'warp-drive:deprecate-legacy-request-methods',\n until: '6.0',\n for: '@warp-drive/core',\n url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',\n since: {\n enabled: '5.7',\n available: '5.7',\n },\n }\n );\n return this._isReloading ?? false;\n },\n set(this: Model, v: boolean) {\n this._isReloading = v;\n },\n configurable: true,\n // @ts-expect-error specially handled prop\n isLocal: true,\n});\n\n/**\n * Restores the pre-`RequestManager` implementations of `save`,\n * `destroyRecord`, and `reload` onto the given `Model` subclass, for\n * apps that have not yet migrated off of the deprecated\n * `ENABLE_LEGACY_REQUEST_METHODS` behaviors.\n */\nexport function restoreDeprecatedModelRequestBehaviors(ModelKlass: typeof Model): void {\n // @ts-expect-error TS doesn't know how to do `this` function overloads\n ModelKlass.prototype.save = _save;\n // @ts-expect-error TS doesn't know how to do `this` function overloads\n ModelKlass.prototype.destroyRecord = _destroyRecord;\n ModelKlass.prototype.reload = _reload;\n\n defineGate(Model.prototype, 'isReloading', {\n get(this: Model): boolean {\n return this._isReloading ?? false;\n },\n set(this: Model, v: boolean) {\n this._isReloading = v;\n },\n // @ts-expect-error specially handled prop\n isLocal: true,\n });\n}\n\n// this is required to prevent `init` from passing\n// the values initialized during create to `setUnknownProperty`\n(Model.prototype as unknown as { _createProps: null })._createProps = null;\n(Model.prototype as unknown as { _secretInit: null })._secretInit = null;\n\nif (DEBUG) {\n const lookupDescriptor = function lookupDescriptor(obj: object, keyName: string) {\n let current: object = obj;\n do {\n const descriptor = Object.getOwnPropertyDescriptor(current, keyName);\n if (descriptor !== undefined) {\n return descriptor;\n }\n current = Object.getPrototypeOf(current) as object;\n } while (current !== null);\n return null;\n };\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const init = Model.prototype.init;\n Model.prototype.init = function (createArgs: ModelCreateArgs) {\n init.call(this, createArgs);\n\n const ourDescriptor = lookupDescriptor(Model.prototype, 'currentState');\n const theirDescriptor = lookupDescriptor(this, 'currentState');\n\n if (!ourDescriptor || !theirDescriptor) {\n throw new Error(\n `Unable to determine if 'currentState' is a reserved property name on instances of classes extending Model. Please ensure that 'currentState' is not defined as a property on ${this.constructor.toString()}`\n );\n }\n\n const realState = this.___recordState;\n if (ourDescriptor.get !== theirDescriptor.get || realState !== this.currentState) {\n throw new Error(\n `'currentState' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`\n );\n }\n\n const ID_DESCRIPTOR = lookupDescriptor(Model.prototype, 'id');\n const idDesc = lookupDescriptor(this, 'id');\n\n if (!ID_DESCRIPTOR || !idDesc) {\n throw new Error(\n `Unable to determine if 'id' is a reserved property name on instances of classes extending Model. Please ensure that 'id' is not defined as a property on ${this.constructor.toString()}`\n );\n }\n\n if (idDesc.get !== ID_DESCRIPTOR.get) {\n throw new Error(\n `You may not set 'id' as an attribute on your model. Please remove any lines that look like: \\`id: attr('<type>')\\` from ${this.constructor.toString()}`\n );\n }\n };\n\n delete (Model as unknown as { reopen: unknown }).reopen;\n delete (Model as unknown as { reopenClass: unknown }).reopenClass;\n}\n\nexport { Model };\n\nfunction isRelationshipSchema(meta: unknown): meta is LegacyRelationshipField {\n const hasKind = typeof meta === 'object' && meta !== null && 'kind' in meta && 'options' in meta;\n return hasKind && (meta.kind === 'hasMany' || meta.kind === 'belongsTo');\n}\n\nfunction isAttributeSchema(meta: unknown): meta is LegacyAttributeField {\n return typeof meta === 'object' && meta !== null && 'kind' in meta && meta.kind === 'attribute';\n}\n","import { getOwner } from '@ember/application';\n\nimport type { Store } from '@warp-drive/core';\n\nimport { Model, type ModelFactory } from './model';\n\n/*\n In case someone defined a relationship to a mixin, for example:\n ```ts\n class CommentModel extends Model {\n @belongsTo('commentable', { polymorphic: true }) owner;\n }\n\n let Commentable = Mixin.create({\n @hasMany('comment') comments;\n });\n ```\n we want to look up a Commentable class which has all the necessary\n relationship meta data. Thus, we look up the mixin and create a mock\n Model, so we can access the relationship CPs of the mixin (`comments`)\n in this case\n */\nexport default function modelForMixin(store: Store, normalizedModelName: string): ModelFactory | undefined {\n const owner = getOwner(store)!;\n const MaybeMixin = owner.factoryFor(`mixin:${normalizedModelName}`);\n const mixin = MaybeMixin && MaybeMixin.class;\n if (mixin) {\n const ModelForMixin = Model.extend(mixin) as unknown as { __isMixin: boolean; __mixin: typeof mixin };\n ModelForMixin.__isMixin = true;\n ModelForMixin.__mixin = mixin;\n //Cache the class as a model\n owner.register(`model:${normalizedModelName}`, ModelForMixin);\n }\n return owner.factoryFor(`model:${normalizedModelName}`) as ModelFactory | undefined;\n}\n","import { getOwner } from '@ember/application';\nimport { deprecate } from '@ember/debug';\n\nimport type { Store } from '@warp-drive/core';\nimport { ENABLE_LEGACY_SCHEMA_SERVICE } from '@warp-drive/core/build-config/deprecations';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { SchemaService } from '@warp-drive/core/types';\nimport type { ResourceKey } from '@warp-drive/core/types/identifier';\nimport type { ObjectValue } from '@warp-drive/core/types/json/raw';\nimport type { Derivation, HashFn, Transformation } from '@warp-drive/core/types/schema/concepts';\nimport type {\n ArrayField,\n CacheableFieldSchema,\n DerivedField,\n GenericField,\n HashField,\n IdentityField,\n LegacyAttributeField,\n LegacyField,\n LegacyRelationshipField,\n ObjectField,\n ObjectSchema,\n ResourceSchema,\n} from '@warp-drive/core/types/schema/fields';\n\nimport type { FactoryCache, ModelFactory, ModelStore } from './model.ts';\nimport _modelForMixin from './model-for-mixin.ts';\nimport { normalizeModelName } from './util.ts';\n\ntype AttributesSchema = ReturnType<Exclude<SchemaService['attributesDefinitionFor'], undefined>>;\ntype RelationshipsSchema = ReturnType<Exclude<SchemaService['relationshipsDefinitionFor'], undefined>>;\n\ntype InternalSchema = {\n schema: ResourceSchema;\n fields: Map<string, LegacyAttributeField | LegacyRelationshipField>;\n cacheFields: Map<string, Exclude<CacheableFieldSchema, IdentityField>>;\n attributes: Record<string, LegacyAttributeField>;\n relationships: Record<string, LegacyRelationshipField>;\n};\n\nexport interface ModelSchemaProvider {\n attributesDefinitionFor(resource: ResourceKey | { type: string }): AttributesSchema;\n\n relationshipsDefinitionFor(resource: ResourceKey | { type: string }): RelationshipsSchema;\n\n doesTypeExist(type: string): boolean;\n}\nexport class ModelSchemaProvider implements SchemaService {\n /** @internal */\n declare private store: ModelStore;\n /** @internal */\n declare private _schemas: Map<string, InternalSchema>;\n /** @internal */\n declare private _typeMisses: Set<string>;\n\n constructor(store: ModelStore) {\n this.store = store;\n this._schemas = new Map();\n this._typeMisses = new Set();\n }\n\n resourceTypes(): Readonly<string[]> {\n return Array.from(this._schemas.keys());\n }\n\n hasTrait(type: string): boolean {\n assert(`hasTrait is not available with @warp-drive/legacy/model's SchemaService`);\n return false;\n }\n resourceHasTrait(resource: ResourceKey | { type: string }, trait: string): boolean {\n assert(`resourceHasTrait is not available with @warp-drive/legacy/model's SchemaService`);\n return false;\n }\n transformation(field: GenericField | ObjectField | ArrayField | { type: string }): Transformation {\n assert(`transformation is not available with @warp-drive/legacy/model's SchemaService`);\n }\n derivation(field: DerivedField | { type: string }): Derivation {\n assert(`derivation is not available with @warp-drive/legacy/model's SchemaService`);\n }\n hashFn(field: HashField | { type: string }): HashFn {\n assert(`hashFn is not available with @warp-drive/legacy/model's SchemaService`);\n }\n resource(resource: ResourceKey | { type: string }): ResourceSchema | ObjectSchema {\n const type = normalizeModelName(resource.type);\n\n if (!this._schemas.has(type)) {\n this._loadModelSchema(type);\n }\n\n return this._schemas.get(type)!.schema;\n }\n registerResources(schemas: Array<ResourceSchema | ObjectSchema>): void {\n assert(`registerResources is not available with @warp-drive/legacy/model's SchemaService`);\n }\n registerResource(schema: ResourceSchema | ObjectSchema): void {\n assert(`registerResource is not available with @warp-drive/legacy/model's SchemaService`);\n }\n registerTransformation(transform: Transformation): void {\n assert(`registerTransformation is not available with @warp-drive/legacy/model's SchemaService`);\n }\n registerDerivation<R, T, FM extends ObjectValue | null>(derivation: Derivation<R, T, FM>): void {\n assert(`registerDerivation is not available with @warp-drive/legacy/model's SchemaService`);\n }\n registerHashFn(hashFn: HashFn): void {\n assert(`registerHashFn is not available with @warp-drive/legacy/model's SchemaService`);\n }\n /** @internal */\n private _loadModelSchema(type: string): InternalSchema {\n const factory = getModelFactory(this.store, type);\n\n if (!factory) {\n throw new Error(`No model was found for '${type}'`);\n }\n\n const modelClass = factory.class;\n const attributeMap = modelClass.attributes;\n\n const attributes = Object.create(null) as AttributesSchema;\n attributeMap.forEach((meta, name) => (attributes[name] = meta));\n const relationships = modelClass.relationshipsObject || null;\n const fields = new Map<string, LegacyAttributeField | LegacyRelationshipField>();\n\n for (const attr of Object.values(attributes)) {\n fields.set(attr.name, attr);\n }\n\n for (const rel of Object.values(relationships)) {\n fields.set(rel.name, rel);\n }\n\n const schema: ResourceSchema = {\n legacy: true,\n identity: { name: 'id', kind: '@id' },\n type,\n fields: Array.from(fields.values()),\n };\n\n const cacheFields = new Map<string, Exclude<CacheableFieldSchema, IdentityField>>();\n for (const field of fields.values()) {\n const cacheKey = field.sourceKey ?? field.name;\n assert(\n `The sourceKey '${field.sourceKey}' for the field '${field.name}' on '${type}' is invalid because it matches the name of an existing field`,\n !field.sourceKey || field.sourceKey === field.name || !fields.has(field.sourceKey)\n );\n cacheFields.set(cacheKey, field);\n }\n\n const internalSchema: InternalSchema = {\n schema,\n attributes,\n relationships,\n fields,\n cacheFields,\n };\n\n this._schemas.set(type, internalSchema);\n\n return internalSchema;\n }\n\n fields(resource: ResourceKey | { type: string }): Map<string, LegacyField> {\n const type = normalizeModelName(resource.type);\n\n if (!this._schemas.has(type)) {\n this._loadModelSchema(type);\n }\n\n return this._schemas.get(type)!.fields;\n }\n\n cacheFields(resource: ResourceKey | { type: string }): Map<string, Exclude<CacheableFieldSchema, IdentityField>> {\n const type = normalizeModelName(resource.type);\n\n if (!this._schemas.has(type)) {\n this._loadModelSchema(type);\n }\n\n return this._schemas.get(type)!.cacheFields;\n }\n\n hasResource(resource: { type: string }): boolean {\n const type = normalizeModelName(resource.type);\n\n if (this._schemas.has(type)) {\n return true;\n }\n\n if (this._typeMisses.has(type)) {\n return false;\n }\n\n const factory = getModelFactory(this.store, type);\n const exists = factory !== null;\n\n if (!exists) {\n this._typeMisses.add(type);\n return false;\n }\n\n return true;\n }\n}\n\nif (ENABLE_LEGACY_SCHEMA_SERVICE) {\n ModelSchemaProvider.prototype.doesTypeExist = function (type: string): boolean {\n deprecate(`Use \\`schema.hasResource({ type })\\` instead of \\`schema.doesTypeExist(type)\\``, false, {\n id: 'ember-data:schema-service-updates',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '4.13',\n enabled: '5.4',\n },\n });\n return this.hasResource({ type });\n };\n\n ModelSchemaProvider.prototype.attributesDefinitionFor = function (\n resource: ResourceKey | { type: string }\n ): AttributesSchema {\n deprecate(`Use \\`schema.fields({ type })\\` instead of \\`schema.attributesDefinitionFor({ type })\\``, false, {\n id: 'ember-data:schema-service-updates',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '4.13',\n enabled: '5.4',\n },\n });\n const type = normalizeModelName(resource.type);\n\n // @ts-expect-error intentional use of internal API\n if (!this._schemas.has(type)) {\n // @ts-expect-error intentional use of internal API\n this._loadModelSchema(type);\n }\n\n // @ts-expect-error intentional use of internal API\n return this._schemas.get(type)!.attributes;\n };\n\n ModelSchemaProvider.prototype.relationshipsDefinitionFor = function (\n resource: ResourceKey | { type: string }\n ): RelationshipsSchema {\n deprecate(`Use \\`schema.fields({ type })\\` instead of \\`schema.relationshipsDefinitionFor({ type })\\``, false, {\n id: 'ember-data:schema-service-updates',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '4.13',\n enabled: '5.4',\n },\n });\n const type = normalizeModelName(resource.type);\n\n // @ts-expect-error intentional use of internal API\n if (!this._schemas.has(type)) {\n // @ts-expect-error intentional use of internal API\n this._loadModelSchema(type);\n }\n\n // @ts-expect-error intentional use of internal API\n return this._schemas.get(type)!.relationships;\n };\n}\n\n/**\n * The `createSchemaService` implementation for use with `Model`. Pass\n * the result of this to your store's `createSchemaService` method when\n * configuring the store to use `Model` for schema information.\n *\n * @public\n */\nexport function buildSchema(store: Store): SchemaService {\n return new ModelSchemaProvider(store as ModelStore);\n}\n\nexport function getModelFactory(store: ModelStore, type: string): ModelFactory | null {\n if (!store._modelFactoryCache) {\n store._modelFactoryCache = Object.create(null) as FactoryCache;\n }\n const cache = store._modelFactoryCache;\n let factory: ModelFactory | undefined = cache[type];\n\n if (!factory) {\n const owner = getOwner(store)!;\n factory = owner.factoryFor(`model:${type}`) as ModelFactory | undefined;\n\n if (!factory) {\n //Support looking up mixins as base types for polymorphic relationships\n factory = _modelForMixin(store, type);\n }\n\n if (!factory) {\n // we don't cache misses in case someone wants to register a missing model\n return null;\n }\n\n const klass = factory.class;\n\n if (klass.isModel) {\n const hasOwnModelNameSet = klass.modelName && Object.prototype.hasOwnProperty.call(klass, 'modelName');\n if (!hasOwnModelNameSet) {\n Object.defineProperty(klass, 'modelName', { value: type });\n }\n }\n\n cache[type] = factory;\n }\n\n return factory;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAgBS,qBAAiE;CAC/E,MAAM,EAAEC,iBAAiB;CACzB,MAAM,EAAEC,UAAUD;CAClB,MAAME,QAAQ,KAAKT;CACnBD,mBAAmBU,KAAK;CAExBA,MAAMC,YAAY;EAChBD,MAAME,MAAMC,cAAcd,oBAAoB,IAAI,CAAC;EACnD,KAAKe,OAAOC,MAAM;EAClBP,aAAaQ,mBAAmB;EAChC,IAAIP,OACF,KAAKQ,aAAa;CAEtB,CAAC;AACH;AAEA,SAAgBA,eAA2D;CACzE,IAAI,KAAKT,aAAaC,UAAU,KAAKS,eAAe,KAAKC,eACvD;CAEF,KAAKlB,YAAY,CAACgB,aAAa,IAAI;AACrC;AAEA,SAAgBG,UAEdC,MAC0B;CAC1B,OAAOjB,oBAAoB,IAAI,CAAC,CAACkB,aAAa,aAAaD,IAAI;AACjE;AAEA,SAAgBE,QAEdF,MACwB;CACxB,OAAOjB,oBAAoB,IAAI,CAAC,CAACkB,aAAa,WAAWD,IAAI;AAC/D;AAEA,SAAgBG,OAA+CC,UAAmC,CAAC,GAAe;CAChH,IAAAnB,eAAA,CAAAD,gBAAA,CAAA,CAAAqB,UAAAC,aAAAC,6BAAA,GAAoC;EAClC,MAAMC,UAAU;EAChBvB,eAAAD,gBAAA,CAAA,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,oBAAoBkE,UAAUS,6BAA6B,SACzDxD,UACqB;EACrBxB,UAAU,8FAA8F,OAAO;GAC7GyE,IAAI;GACJC,OAAO;GACPC,KAAK;GACLC,OAAO;IACLC,WAAW;IACXC,SAAS;GACX;EACF,CAAC;EACD,MAAM7D,OAAOf,mBAAmBsB,SAASP,IAAI;EAG7C,IAAI,CAAC,KAAKT,SAASsB,IAAIb,IAAI,GAEzB,KAAKc,iBAAiBd,IAAI;EAI5B,OAAO,KAAKT,SAASwB,IAAIf,IAAI,CAAC,CAAEmC;CAClC;AACF;;;;;;;;AASA,SAAgB6B,YAAY1E,OAA6B;CACvD,OAAO,IAAIF,oBAAoBE,KAAmB;AACpD;AAEA,SAAgBmC,gBAAgBnC,OAAmBU,MAAmC;CACpF,IAAI,CAACV,MAAM2E,oBACT3E,MAAM2E,qBAAqBnC,OAAOC,OAAO,IAAI;CAE/C,MAAMmC,QAAQ5E,MAAM2E;CACpB,IAAIzC,UAAoC0C,MAAMlE;CAE9C,IAAI,CAACwB,SAAS;EAEZA,UADc1C,SAASQ,KACb6E,CAAK,CAACC,WAAW,SAASpE,MAAM;EAE1C,IAAI,CAACwB,SAEHA,UAAUxC,cAAeM,OAAOU,IAAI;EAGtC,IAAI,CAACwB,SAEH,OAAO;EAGT,MAAM6C,QAAQ7C,QAAQG;EAEtB,IAAI0C,MAAMC,SAER;OAAI,EADuBD,MAAMG,aAAa1C,OAAOwB,UAAUmB,eAAeC,KAAKL,OAAO,WAAW,IAEnGvC,OAAO6C,eAAeN,OAAO,aAAa,EAAEO,OAAO5E,KAAK,CAAC;EAC3D;EAGFkE,MAAMlE,QAAQwB;CAChB;CAEA,OAAOA;AACT"}
@@ -1,3 +1,4 @@
1
+ //#region src/serializer/json-api.d.ts
1
2
  /**
2
3
  * :::danger
3
4
  ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
@@ -121,4 +122,6 @@ return normalizedRelationship;
121
122
  @public
122
123
  */
123
124
  declare const JSONAPISerializer: any;
125
+ //#endregion
124
126
  export { JSONAPISerializer };
127
+ //# sourceMappingURL=json-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-api.d.ts","names":[],"sources":["../../src/serializer/json-api.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6IM"}