@warp-drive/legacy 5.10.0-alpha.2 → 5.10.0-alpha.21

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 (413) hide show
  1. package/README.md +91 -8
  2. package/blueprints/adapter/files/__root__/__path__/__name__.js +1 -0
  3. package/blueprints/adapter/index.js +27 -0
  4. package/blueprints/adapter-test/index.js +33 -0
  5. package/blueprints/adapter-test/qunit-files/__root__/__path__/__test__.js +1 -0
  6. package/blueprints/model/HELP.md +26 -0
  7. package/blueprints/model/files/__root__/__path__/__name__.js +1 -0
  8. package/blueprints/model/index.js +27 -0
  9. package/blueprints/model-test/index.js +33 -0
  10. package/blueprints/model-test/qunit-files/__root__/__path__/__test__.js +1 -0
  11. package/blueprints/serializer/files/__root__/__path__/__name__.js +1 -0
  12. package/blueprints/serializer/index.js +27 -0
  13. package/blueprints/serializer-test/index.js +33 -0
  14. package/blueprints/serializer-test/qunit-files/__root__/__path__/__test__.js +1 -0
  15. package/blueprints/transform/files/__root__/__path__/__name__.js +1 -0
  16. package/blueprints/transform/index.js +17 -0
  17. package/blueprints/transform-test/index.js +33 -0
  18. package/blueprints/transform-test/qunit-files/__root__/__path__/__test__.js +1 -0
  19. package/dist/{-private-DccRZQsm.js → -private-0_Oc-M3x.js} +10 -17
  20. package/dist/-private-0_Oc-M3x.js.map +1 -0
  21. package/dist/{-private-DQ6Iap2t.js → -private-L2BtGGYa.js} +8 -14
  22. package/dist/{-private-DQ6Iap2t.js.map → -private-L2BtGGYa.js.map} +1 -1
  23. package/dist/adapter/-private.d.ts +2 -12
  24. package/dist/adapter/-private.d.ts.map +1 -1
  25. package/dist/adapter/-private.js +1 -1
  26. package/dist/adapter/error.d.ts +1 -1
  27. package/dist/adapter/error.js +54 -2
  28. package/dist/adapter/error.js.map +1 -1
  29. package/dist/adapter/json-api.d.ts +5 -5
  30. package/dist/adapter/json-api.d.ts.map +1 -1
  31. package/dist/adapter/json-api.js +10 -4
  32. package/dist/adapter/json-api.js.map +1 -1
  33. package/dist/adapter/rest.d.ts +1 -1
  34. package/dist/adapter/rest.js +23 -5
  35. package/dist/adapter/rest.js.map +1 -1
  36. package/dist/{adapter-eYo2pIuM.js → adapter-AwGvdMSZ.js} +45 -6
  37. package/dist/adapter-AwGvdMSZ.js.map +1 -0
  38. package/dist/{adapter-CARrK3-8.d.ts → adapter-DvDVeaCc.d.ts} +9 -6
  39. package/dist/adapter-DvDVeaCc.d.ts.map +1 -0
  40. package/dist/adapter.d.ts +1 -1
  41. package/dist/adapter.js +1 -1
  42. package/dist/compat/-private.d.ts +1 -1
  43. package/dist/compat/-private.js +1 -1
  44. package/dist/compat/builders.d.ts +10 -8
  45. package/dist/compat/builders.d.ts.map +1 -1
  46. package/dist/compat/builders.js +15 -9
  47. package/dist/compat/builders.js.map +1 -1
  48. package/dist/compat/extensions.d.ts +1 -1
  49. package/dist/compat/extensions.js +23 -2
  50. package/dist/compat/extensions.js.map +1 -1
  51. package/dist/compat/utils.d.ts +17 -2
  52. package/dist/compat/utils.d.ts.map +1 -1
  53. package/dist/compat/utils.js +19 -2
  54. package/dist/compat/utils.js.map +1 -1
  55. package/dist/{compat-DcHVxuuZ.js → compat-C-yQnbkF.js} +61 -8
  56. package/dist/compat-C-yQnbkF.js.map +1 -0
  57. package/dist/{compat-BbNNmTM-.d.ts → compat-DoWEarkU.d.ts} +30 -17
  58. package/dist/compat-DoWEarkU.d.ts.map +1 -0
  59. package/dist/compat.d.ts +1 -1
  60. package/dist/compat.js +1 -1
  61. package/dist/{error-CzkyXr1Q.d.ts → error-798wGD3r.d.ts} +49 -3
  62. package/dist/error-798wGD3r.d.ts.map +1 -0
  63. package/dist/{errors-CS110tMl.js → errors-BEExAZtv.js} +42 -32
  64. package/dist/errors-BEExAZtv.js.map +1 -0
  65. package/dist/{extensions-DumNm4dA.d.ts → extensions-DcEz1lKv.d.ts} +18 -3
  66. package/dist/extensions-DcEz1lKv.d.ts.map +1 -0
  67. package/dist/index.d.ts +17 -2
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +25 -7
  70. package/dist/index.js.map +1 -1
  71. package/dist/{json-BXNPTlcH.js → json-Baaga4BP.js} +10 -5
  72. package/dist/json-Baaga4BP.js.map +1 -0
  73. package/dist/model/-private.d.ts +1 -1
  74. package/dist/model/-private.js +1 -1
  75. package/dist/model/migration-support.d.ts +19 -4
  76. package/dist/model/migration-support.d.ts.map +1 -1
  77. package/dist/model/migration-support.js +25 -7
  78. package/dist/model/migration-support.js.map +1 -1
  79. package/dist/{model-DWH9f__L.js → model-Be-e84FX.js} +19 -12
  80. package/dist/model-Be-e84FX.js.map +1 -0
  81. package/dist/{model-62hn5_PD.d.ts → model-DAdY1ibr.d.ts} +13 -26
  82. package/dist/model-DAdY1ibr.d.ts.map +1 -0
  83. package/dist/{unpkg/dev-deprecated/model-fragments-DSqu0ptR.js → model-fragments-DCHMDr5f.js} +32 -18
  84. package/dist/model-fragments-DCHMDr5f.js.map +1 -0
  85. package/dist/model-fragments.d.ts +31 -19
  86. package/dist/model-fragments.d.ts.map +1 -1
  87. package/dist/model-fragments.js +1 -1
  88. package/dist/model.d.ts +12 -11
  89. package/dist/model.d.ts.map +1 -1
  90. package/dist/model.js +2 -2
  91. package/dist/{rest-0NhtexIq.d.ts → rest-CmFneLJH.d.ts} +18 -8
  92. package/dist/rest-CmFneLJH.d.ts.map +1 -0
  93. package/dist/{runtime--fcdnjmJ-DMTJ0Kb3.js → runtime--fcdnjmJ-5yaSpa-d.js} +2 -3
  94. package/dist/{runtime--fcdnjmJ-DMTJ0Kb3.js.map → runtime--fcdnjmJ-5yaSpa-d.js.map} +1 -1
  95. package/dist/{schema-provider-DguGmQDS.js → schema-provider-BAB8DyMr.js} +22 -21
  96. package/dist/schema-provider-BAB8DyMr.js.map +1 -0
  97. package/dist/serializer/json-api.d.ts +1 -2
  98. package/dist/serializer/json-api.d.ts.map +1 -1
  99. package/dist/serializer/json-api.js +7 -3
  100. package/dist/serializer/json-api.js.map +1 -1
  101. package/dist/serializer/json.d.ts +2 -2
  102. package/dist/serializer/json.d.ts.map +1 -1
  103. package/dist/serializer/json.js +1 -1
  104. package/dist/serializer/rest.d.ts +4 -4
  105. package/dist/serializer/rest.d.ts.map +1 -1
  106. package/dist/serializer/rest.js +12 -5
  107. package/dist/serializer/rest.js.map +1 -1
  108. package/dist/serializer/transform.d.ts +9 -10
  109. package/dist/serializer/transform.d.ts.map +1 -1
  110. package/dist/serializer/transform.js +14 -10
  111. package/dist/serializer/transform.js.map +1 -1
  112. package/dist/serializer.d.ts +2 -2
  113. package/dist/serializer.d.ts.map +1 -1
  114. package/dist/serializer.js +42 -3
  115. package/dist/serializer.js.map +1 -1
  116. package/dist/{store-C4qYzXei.js → store-BLKEsJyw.js} +13 -7
  117. package/dist/store-BLKEsJyw.js.map +1 -0
  118. package/dist/store.d.ts +3 -2
  119. package/dist/store.d.ts.map +1 -1
  120. package/dist/store.js +1 -1
  121. package/dist/unpkg/dev/{-private-CrEyBE-B.js → -private-BprUAEe_.js} +8 -14
  122. package/dist/unpkg/{dev-deprecated/-private-CrEyBE-B.js.map → dev/-private-BprUAEe_.js.map} +1 -1
  123. package/dist/unpkg/dev/{-private-vOhxVExH.js → -private-Dch4SxkU.js} +10 -17
  124. package/dist/unpkg/dev/-private-Dch4SxkU.js.map +1 -0
  125. package/dist/unpkg/dev/adapter/-private.js +1 -1
  126. package/dist/unpkg/dev/adapter/error.js +54 -2
  127. package/dist/unpkg/dev/adapter/error.js.map +1 -1
  128. package/dist/unpkg/dev/adapter/json-api.js +10 -4
  129. package/dist/unpkg/dev/adapter/json-api.js.map +1 -1
  130. package/dist/unpkg/dev/adapter/rest.js +23 -5
  131. package/dist/unpkg/dev/adapter/rest.js.map +1 -1
  132. package/dist/unpkg/dev/{adapter-oLwyr47q.js → adapter-BAn4SeUA.js} +45 -6
  133. package/dist/unpkg/dev/adapter-BAn4SeUA.js.map +1 -0
  134. package/dist/unpkg/dev/adapter.js +1 -1
  135. package/dist/unpkg/dev/compat/-private.js +1 -1
  136. package/dist/unpkg/dev/compat/builders.js +15 -9
  137. package/dist/unpkg/dev/compat/builders.js.map +1 -1
  138. package/dist/unpkg/dev/compat/extensions.js +23 -2
  139. package/dist/unpkg/dev/compat/extensions.js.map +1 -1
  140. package/dist/unpkg/dev/compat/utils.js +19 -2
  141. package/dist/unpkg/dev/compat/utils.js.map +1 -1
  142. package/dist/unpkg/dev/{compat-DNQT2TQx.js → compat-BdovRRzQ.js} +62 -10
  143. package/dist/unpkg/dev/compat-BdovRRzQ.js.map +1 -0
  144. package/dist/unpkg/dev/compat.js +1 -1
  145. package/dist/unpkg/dev/{errors-DnzvLM2A.js → errors-CGvbM6WH.js} +42 -32
  146. package/dist/unpkg/dev/errors-CGvbM6WH.js.map +1 -0
  147. package/dist/unpkg/dev/index.js +25 -7
  148. package/dist/unpkg/dev/index.js.map +1 -1
  149. package/dist/unpkg/{dev-deprecated/json-DDJji3V3.js → dev/json-BlSBe84o.js} +10 -5
  150. package/dist/unpkg/dev/json-BlSBe84o.js.map +1 -0
  151. package/dist/unpkg/dev/model/-private.js +1 -1
  152. package/dist/unpkg/dev/model/migration-support.js +24 -6
  153. package/dist/unpkg/dev/model/migration-support.js.map +1 -1
  154. package/dist/unpkg/dev/{model-BxPIR7m2.js → model-QCZr8eec.js} +19 -12
  155. package/dist/unpkg/dev/model-QCZr8eec.js.map +1 -0
  156. package/dist/{model-fragments-DSqu0ptR.js → unpkg/dev/model-fragments-DCHMDr5f.js} +32 -18
  157. package/dist/unpkg/dev/model-fragments-DCHMDr5f.js.map +1 -0
  158. package/dist/unpkg/dev/model-fragments.js +1 -1
  159. package/dist/unpkg/dev/model.js +2 -2
  160. package/dist/unpkg/dev/{runtime--fcdnjmJ-DMTJ0Kb3.js → runtime--fcdnjmJ-5yaSpa-d.js} +2 -3
  161. package/dist/unpkg/dev/{runtime--fcdnjmJ-DMTJ0Kb3.js.map → runtime--fcdnjmJ-5yaSpa-d.js.map} +1 -1
  162. package/dist/unpkg/dev/{schema-provider-CI_a48ja.js → schema-provider-IMFO9Kgw.js} +18 -17
  163. package/dist/unpkg/dev/schema-provider-IMFO9Kgw.js.map +1 -0
  164. package/dist/unpkg/dev/serializer/json-api.js +7 -3
  165. package/dist/unpkg/dev/serializer/json-api.js.map +1 -1
  166. package/dist/unpkg/dev/serializer/json.js +1 -1
  167. package/dist/unpkg/dev/serializer/rest.js +12 -5
  168. package/dist/unpkg/dev/serializer/rest.js.map +1 -1
  169. package/dist/unpkg/dev/serializer/transform.js +14 -10
  170. package/dist/unpkg/dev/serializer/transform.js.map +1 -1
  171. package/dist/unpkg/dev/serializer.js +42 -3
  172. package/dist/unpkg/dev/serializer.js.map +1 -1
  173. package/dist/unpkg/dev/{store-D_V8-HQl.js → store-BiXsLLAu.js} +13 -7
  174. package/dist/unpkg/dev/store-BiXsLLAu.js.map +1 -0
  175. package/dist/unpkg/dev/store.js +1 -1
  176. package/dist/unpkg/dev/{util-dSKEgQDp.js → util-CI7b4vAE.js} +2 -3
  177. package/dist/unpkg/dev/{util-dSKEgQDp.js.map → util-CI7b4vAE.js.map} +1 -1
  178. package/dist/unpkg/{prod/utils-DYC9utVJ.js → dev/utils-_O0MjUTU.js} +2 -3
  179. package/dist/unpkg/dev/{utils-DYC9utVJ.js.map → utils-_O0MjUTU.js.map} +1 -1
  180. package/dist/unpkg/dev-deprecated/{-private-CrEyBE-B.js → -private-BprUAEe_.js} +8 -14
  181. package/dist/unpkg/{dev/-private-CrEyBE-B.js.map → dev-deprecated/-private-BprUAEe_.js.map} +1 -1
  182. package/dist/unpkg/dev-deprecated/{-private-vOhxVExH.js → -private-Dch4SxkU.js} +10 -17
  183. package/dist/unpkg/dev-deprecated/-private-Dch4SxkU.js.map +1 -0
  184. package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -1
  185. package/dist/unpkg/dev-deprecated/adapter/error.js +54 -2
  186. package/dist/unpkg/dev-deprecated/adapter/error.js.map +1 -1
  187. package/dist/unpkg/dev-deprecated/adapter/json-api.js +10 -4
  188. package/dist/unpkg/dev-deprecated/adapter/json-api.js.map +1 -1
  189. package/dist/unpkg/dev-deprecated/adapter/rest.js +23 -5
  190. package/dist/unpkg/dev-deprecated/adapter/rest.js.map +1 -1
  191. package/dist/unpkg/dev-deprecated/{adapter-oLwyr47q.js → adapter-BAn4SeUA.js} +45 -6
  192. package/dist/unpkg/dev-deprecated/adapter-BAn4SeUA.js.map +1 -0
  193. package/dist/unpkg/dev-deprecated/adapter.js +1 -1
  194. package/dist/unpkg/dev-deprecated/compat/-private.js +1 -1
  195. package/dist/unpkg/dev-deprecated/compat/builders.js +15 -9
  196. package/dist/unpkg/dev-deprecated/compat/builders.js.map +1 -1
  197. package/dist/unpkg/dev-deprecated/compat/extensions.js +23 -2
  198. package/dist/unpkg/dev-deprecated/compat/extensions.js.map +1 -1
  199. package/dist/unpkg/dev-deprecated/compat/utils.js +19 -2
  200. package/dist/unpkg/dev-deprecated/compat/utils.js.map +1 -1
  201. package/dist/unpkg/dev-deprecated/{compat-CeT0PnVX.js → compat-CPVriwH0.js} +62 -10
  202. package/dist/unpkg/dev-deprecated/compat-CPVriwH0.js.map +1 -0
  203. package/dist/unpkg/dev-deprecated/compat.js +1 -1
  204. package/dist/unpkg/dev-deprecated/{errors-jHQESeNQ.js → errors-yPc7D7r3.js} +42 -32
  205. package/dist/unpkg/dev-deprecated/errors-yPc7D7r3.js.map +1 -0
  206. package/dist/unpkg/dev-deprecated/index.js +25 -7
  207. package/dist/unpkg/dev-deprecated/index.js.map +1 -1
  208. package/dist/unpkg/{dev/json-DDJji3V3.js → dev-deprecated/json-BlSBe84o.js} +10 -5
  209. package/dist/unpkg/dev-deprecated/json-BlSBe84o.js.map +1 -0
  210. package/dist/unpkg/dev-deprecated/model/-private.js +1 -1
  211. package/dist/unpkg/dev-deprecated/model/migration-support.js +24 -6
  212. package/dist/unpkg/dev-deprecated/model/migration-support.js.map +1 -1
  213. package/dist/unpkg/dev-deprecated/{model-BeGORt6h.js → model-B0ZNLaHO.js} +19 -12
  214. package/dist/unpkg/dev-deprecated/model-B0ZNLaHO.js.map +1 -0
  215. package/dist/unpkg/{prod-deprecated/model-fragments-DSqu0ptR.js → dev-deprecated/model-fragments-DCHMDr5f.js} +32 -18
  216. package/dist/unpkg/dev-deprecated/model-fragments-DCHMDr5f.js.map +1 -0
  217. package/dist/unpkg/dev-deprecated/model-fragments.js +1 -1
  218. package/dist/unpkg/dev-deprecated/model.js +2 -2
  219. package/dist/unpkg/dev-deprecated/{runtime--fcdnjmJ-DMTJ0Kb3.js → runtime--fcdnjmJ-5yaSpa-d.js} +2 -3
  220. package/dist/unpkg/dev-deprecated/{runtime--fcdnjmJ-DMTJ0Kb3.js.map → runtime--fcdnjmJ-5yaSpa-d.js.map} +1 -1
  221. package/dist/unpkg/dev-deprecated/{schema-provider-NmtdR4n_.js → schema-provider-DGWYnFno.js} +18 -17
  222. package/dist/unpkg/dev-deprecated/schema-provider-DGWYnFno.js.map +1 -0
  223. package/dist/unpkg/dev-deprecated/serializer/json-api.js +7 -3
  224. package/dist/unpkg/dev-deprecated/serializer/json-api.js.map +1 -1
  225. package/dist/unpkg/dev-deprecated/serializer/json.js +1 -1
  226. package/dist/unpkg/dev-deprecated/serializer/rest.js +12 -5
  227. package/dist/unpkg/dev-deprecated/serializer/rest.js.map +1 -1
  228. package/dist/unpkg/dev-deprecated/serializer/transform.js +14 -10
  229. package/dist/unpkg/dev-deprecated/serializer/transform.js.map +1 -1
  230. package/dist/unpkg/dev-deprecated/serializer.js +42 -3
  231. package/dist/unpkg/dev-deprecated/serializer.js.map +1 -1
  232. package/dist/unpkg/dev-deprecated/{store-BCOLSC6z.js → store-Ci8k7Lh6.js} +13 -7
  233. package/dist/unpkg/dev-deprecated/store-Ci8k7Lh6.js.map +1 -0
  234. package/dist/unpkg/dev-deprecated/store.js +1 -1
  235. package/dist/unpkg/dev-deprecated/{util-CXA3RNYH.js → util-DL_8JecH.js} +2 -3
  236. package/dist/unpkg/dev-deprecated/{util-CXA3RNYH.js.map → util-DL_8JecH.js.map} +1 -1
  237. package/dist/unpkg/dev-deprecated/{utils-DQkMqhDv.js → utils-DyGjRZ14.js} +2 -3
  238. package/dist/unpkg/dev-deprecated/{utils-DQkMqhDv.js.map → utils-DyGjRZ14.js.map} +1 -1
  239. package/dist/unpkg/{prod-deprecated/-private-B4bxoTuK.js → prod/-private-Dc9yg98O.js} +8 -14
  240. package/dist/unpkg/{prod-deprecated/-private-B4bxoTuK.js.map → prod/-private-Dc9yg98O.js.map} +1 -1
  241. package/dist/unpkg/prod/{-private-SfXkkHKd.js → -private-DuRzYAyW.js} +9 -15
  242. package/dist/unpkg/prod/-private-DuRzYAyW.js.map +1 -0
  243. package/dist/unpkg/prod/adapter/-private.js +1 -1
  244. package/dist/unpkg/prod/adapter/error.js +54 -2
  245. package/dist/unpkg/prod/adapter/error.js.map +1 -1
  246. package/dist/unpkg/prod/adapter/json-api.js +10 -4
  247. package/dist/unpkg/prod/adapter/json-api.js.map +1 -1
  248. package/dist/unpkg/prod/adapter/rest.js +23 -5
  249. package/dist/unpkg/prod/adapter/rest.js.map +1 -1
  250. package/dist/unpkg/prod/{adapter-DQ9UA7FC.js → adapter-D0HCLrwm.js} +45 -6
  251. package/dist/unpkg/prod/adapter-D0HCLrwm.js.map +1 -0
  252. package/dist/unpkg/prod/adapter.js +1 -1
  253. package/dist/unpkg/prod/compat/-private.js +1 -1
  254. package/dist/unpkg/prod/compat/builders.js +15 -9
  255. package/dist/unpkg/prod/compat/builders.js.map +1 -1
  256. package/dist/unpkg/prod/compat/extensions.js +23 -2
  257. package/dist/unpkg/prod/compat/extensions.js.map +1 -1
  258. package/dist/unpkg/prod/compat/utils.js +19 -2
  259. package/dist/unpkg/prod/compat/utils.js.map +1 -1
  260. package/dist/unpkg/{prod-deprecated/compat-DxiVkCUb.js → prod/compat-PrUuencH.js} +62 -10
  261. package/dist/unpkg/prod/compat-PrUuencH.js.map +1 -0
  262. package/dist/unpkg/prod/compat.js +1 -1
  263. package/dist/unpkg/prod/{errors-DQDfNqVx.js → errors-Bw8niCo8.js} +38 -27
  264. package/dist/unpkg/prod/errors-Bw8niCo8.js.map +1 -0
  265. package/dist/unpkg/prod/index.js +25 -7
  266. package/dist/unpkg/prod/index.js.map +1 -1
  267. package/dist/unpkg/prod/{json-BD1kRTfB.js → json-D1bH8enA.js} +10 -5
  268. package/dist/unpkg/prod/json-D1bH8enA.js.map +1 -0
  269. package/dist/unpkg/prod/model/-private.js +1 -1
  270. package/dist/unpkg/prod/model/migration-support.js +24 -6
  271. package/dist/unpkg/prod/model/migration-support.js.map +1 -1
  272. package/dist/unpkg/prod/{model-CYMA-e_S.js → model-QtC0IWbE.js} +19 -12
  273. package/dist/unpkg/prod/model-QtC0IWbE.js.map +1 -0
  274. package/dist/unpkg/prod/model-fragments-DCHMDr5f.js +348 -0
  275. package/dist/unpkg/prod/model-fragments-DCHMDr5f.js.map +1 -0
  276. package/dist/unpkg/prod/model-fragments.js +1 -1
  277. package/dist/unpkg/prod/model.js +2 -2
  278. package/dist/unpkg/prod/runtime--fcdnjmJ-5yaSpa-d.js +52 -0
  279. package/dist/unpkg/prod/{runtime--fcdnjmJ-DMTJ0Kb3.js.map → runtime--fcdnjmJ-5yaSpa-d.js.map} +1 -1
  280. package/dist/unpkg/prod/{schema-provider-05U1H-Kl.js → schema-provider-DPOzTa8e.js} +18 -17
  281. package/dist/unpkg/prod/schema-provider-DPOzTa8e.js.map +1 -0
  282. package/dist/unpkg/prod/serializer/json-api.js +7 -3
  283. package/dist/unpkg/prod/serializer/json-api.js.map +1 -1
  284. package/dist/unpkg/prod/serializer/json.js +1 -1
  285. package/dist/unpkg/prod/serializer/rest.js +12 -5
  286. package/dist/unpkg/prod/serializer/rest.js.map +1 -1
  287. package/dist/unpkg/prod/serializer/transform.js +14 -10
  288. package/dist/unpkg/prod/serializer/transform.js.map +1 -1
  289. package/dist/unpkg/prod/serializer.js +42 -3
  290. package/dist/unpkg/prod/serializer.js.map +1 -1
  291. package/dist/unpkg/{prod-deprecated/store-0L2CkYzh.js → prod/store-BsSkzWgk.js} +13 -7
  292. package/dist/unpkg/{prod-deprecated/store-0L2CkYzh.js.map → prod/store-BsSkzWgk.js.map} +1 -1
  293. package/dist/unpkg/prod/store.js +1 -1
  294. package/dist/unpkg/prod/{util-dSKEgQDp.js → util-CI7b4vAE.js} +2 -3
  295. package/dist/unpkg/prod/{util-dSKEgQDp.js.map → util-CI7b4vAE.js.map} +1 -1
  296. package/dist/unpkg/{dev/utils-DYC9utVJ.js → prod/utils-_O0MjUTU.js} +2 -3
  297. package/dist/unpkg/prod/{utils-DYC9utVJ.js.map → utils-_O0MjUTU.js.map} +1 -1
  298. package/dist/unpkg/{prod/-private-B4bxoTuK.js → prod-deprecated/-private-Dc9yg98O.js} +8 -14
  299. package/dist/unpkg/{prod/-private-B4bxoTuK.js.map → prod-deprecated/-private-Dc9yg98O.js.map} +1 -1
  300. package/dist/unpkg/prod-deprecated/{-private-SfXkkHKd.js → -private-DuRzYAyW.js} +9 -15
  301. package/dist/unpkg/prod-deprecated/-private-DuRzYAyW.js.map +1 -0
  302. package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -1
  303. package/dist/unpkg/prod-deprecated/adapter/error.js +54 -2
  304. package/dist/unpkg/prod-deprecated/adapter/error.js.map +1 -1
  305. package/dist/unpkg/prod-deprecated/adapter/json-api.js +10 -4
  306. package/dist/unpkg/prod-deprecated/adapter/json-api.js.map +1 -1
  307. package/dist/unpkg/prod-deprecated/adapter/rest.js +23 -5
  308. package/dist/unpkg/prod-deprecated/adapter/rest.js.map +1 -1
  309. package/dist/unpkg/prod-deprecated/{adapter-DQ9UA7FC.js → adapter-D0HCLrwm.js} +45 -6
  310. package/dist/unpkg/prod-deprecated/adapter-D0HCLrwm.js.map +1 -0
  311. package/dist/unpkg/prod-deprecated/adapter.js +1 -1
  312. package/dist/unpkg/prod-deprecated/compat/-private.js +1 -1
  313. package/dist/unpkg/prod-deprecated/compat/builders.js +15 -9
  314. package/dist/unpkg/prod-deprecated/compat/builders.js.map +1 -1
  315. package/dist/unpkg/prod-deprecated/compat/extensions.js +23 -2
  316. package/dist/unpkg/prod-deprecated/compat/extensions.js.map +1 -1
  317. package/dist/unpkg/prod-deprecated/compat/utils.js +19 -2
  318. package/dist/unpkg/prod-deprecated/compat/utils.js.map +1 -1
  319. package/dist/unpkg/{prod/compat-DxiVkCUb.js → prod-deprecated/compat-PrUuencH.js} +62 -10
  320. package/dist/unpkg/prod-deprecated/compat-PrUuencH.js.map +1 -0
  321. package/dist/unpkg/prod-deprecated/compat.js +1 -1
  322. package/dist/unpkg/prod-deprecated/{errors-ii4L43_1.js → errors-D20lKboZ.js} +38 -27
  323. package/dist/unpkg/prod-deprecated/errors-D20lKboZ.js.map +1 -0
  324. package/dist/unpkg/prod-deprecated/index.js +25 -7
  325. package/dist/unpkg/prod-deprecated/index.js.map +1 -1
  326. package/dist/unpkg/prod-deprecated/{json-BD1kRTfB.js → json-D1bH8enA.js} +10 -5
  327. package/dist/unpkg/prod-deprecated/json-D1bH8enA.js.map +1 -0
  328. package/dist/unpkg/prod-deprecated/model/-private.js +1 -1
  329. package/dist/unpkg/prod-deprecated/model/migration-support.js +24 -6
  330. package/dist/unpkg/prod-deprecated/model/migration-support.js.map +1 -1
  331. package/dist/unpkg/prod-deprecated/{model-D3oCPHtM.js → model-B946S2pl.js} +19 -12
  332. package/dist/unpkg/prod-deprecated/model-B946S2pl.js.map +1 -0
  333. package/dist/unpkg/{dev/model-fragments-DSqu0ptR.js → prod-deprecated/model-fragments-DCHMDr5f.js} +32 -18
  334. package/dist/unpkg/prod-deprecated/model-fragments-DCHMDr5f.js.map +1 -0
  335. package/dist/unpkg/prod-deprecated/model-fragments.js +1 -1
  336. package/dist/unpkg/prod-deprecated/model.js +2 -2
  337. package/dist/unpkg/prod-deprecated/{runtime--fcdnjmJ-DMTJ0Kb3.js → runtime--fcdnjmJ-5yaSpa-d.js} +2 -3
  338. package/dist/unpkg/prod-deprecated/{runtime--fcdnjmJ-DMTJ0Kb3.js.map → runtime--fcdnjmJ-5yaSpa-d.js.map} +1 -1
  339. package/dist/unpkg/prod-deprecated/{schema-provider-CKH_bnnS.js → schema-provider-xcaytn9y.js} +18 -17
  340. package/dist/unpkg/prod-deprecated/schema-provider-xcaytn9y.js.map +1 -0
  341. package/dist/unpkg/prod-deprecated/serializer/json-api.js +7 -3
  342. package/dist/unpkg/prod-deprecated/serializer/json-api.js.map +1 -1
  343. package/dist/unpkg/prod-deprecated/serializer/json.js +1 -1
  344. package/dist/unpkg/prod-deprecated/serializer/rest.js +12 -5
  345. package/dist/unpkg/prod-deprecated/serializer/rest.js.map +1 -1
  346. package/dist/unpkg/prod-deprecated/serializer/transform.js +14 -10
  347. package/dist/unpkg/prod-deprecated/serializer/transform.js.map +1 -1
  348. package/dist/unpkg/prod-deprecated/serializer.js +42 -3
  349. package/dist/unpkg/prod-deprecated/serializer.js.map +1 -1
  350. package/dist/unpkg/{prod/store-RGGc1ilN.js → prod-deprecated/store-Dsw2f4s-.js} +13 -7
  351. package/dist/unpkg/{prod/store-RGGc1ilN.js.map → prod-deprecated/store-Dsw2f4s-.js.map} +1 -1
  352. package/dist/unpkg/prod-deprecated/store.js +1 -1
  353. package/dist/unpkg/prod-deprecated/{util-CQQdHX3n.js → util-CVu5_VeN.js} +2 -3
  354. package/dist/unpkg/prod-deprecated/{util-CQQdHX3n.js.map → util-CVu5_VeN.js.map} +1 -1
  355. package/dist/unpkg/prod-deprecated/{utils-BMI_JwFP.js → utils-z1h-zTls.js} +2 -3
  356. package/dist/unpkg/prod-deprecated/{utils-BMI_JwFP.js.map → utils-z1h-zTls.js.map} +1 -1
  357. package/dist/{util-Bnx8nm-D.js → util-fMuLguoj.js} +2 -3
  358. package/dist/{util-Bnx8nm-D.js.map → util-fMuLguoj.js.map} +1 -1
  359. package/dist/{utils-ZAytYep8.js → utils-UqBsN9IU.js} +2 -3
  360. package/dist/{utils-ZAytYep8.js.map → utils-UqBsN9IU.js.map} +1 -1
  361. package/logos/README.md +1 -1
  362. package/package.json +17 -12
  363. package/dist/-private-DccRZQsm.js.map +0 -1
  364. package/dist/adapter-CARrK3-8.d.ts.map +0 -1
  365. package/dist/adapter-eYo2pIuM.js.map +0 -1
  366. package/dist/compat-BbNNmTM-.d.ts.map +0 -1
  367. package/dist/compat-DcHVxuuZ.js.map +0 -1
  368. package/dist/error-CzkyXr1Q.d.ts.map +0 -1
  369. package/dist/errors-CS110tMl.js.map +0 -1
  370. package/dist/extensions-DumNm4dA.d.ts.map +0 -1
  371. package/dist/json-BXNPTlcH.js.map +0 -1
  372. package/dist/model-62hn5_PD.d.ts.map +0 -1
  373. package/dist/model-DWH9f__L.js.map +0 -1
  374. package/dist/model-fragments-DSqu0ptR.js.map +0 -1
  375. package/dist/rest-0NhtexIq.d.ts.map +0 -1
  376. package/dist/schema-provider-DguGmQDS.js.map +0 -1
  377. package/dist/store-C4qYzXei.js.map +0 -1
  378. package/dist/unpkg/dev/-private-vOhxVExH.js.map +0 -1
  379. package/dist/unpkg/dev/adapter-oLwyr47q.js.map +0 -1
  380. package/dist/unpkg/dev/compat-DNQT2TQx.js.map +0 -1
  381. package/dist/unpkg/dev/errors-DnzvLM2A.js.map +0 -1
  382. package/dist/unpkg/dev/json-DDJji3V3.js.map +0 -1
  383. package/dist/unpkg/dev/model-BxPIR7m2.js.map +0 -1
  384. package/dist/unpkg/dev/model-fragments-DSqu0ptR.js.map +0 -1
  385. package/dist/unpkg/dev/schema-provider-CI_a48ja.js.map +0 -1
  386. package/dist/unpkg/dev/store-D_V8-HQl.js.map +0 -1
  387. package/dist/unpkg/dev-deprecated/-private-vOhxVExH.js.map +0 -1
  388. package/dist/unpkg/dev-deprecated/adapter-oLwyr47q.js.map +0 -1
  389. package/dist/unpkg/dev-deprecated/compat-CeT0PnVX.js.map +0 -1
  390. package/dist/unpkg/dev-deprecated/errors-jHQESeNQ.js.map +0 -1
  391. package/dist/unpkg/dev-deprecated/json-DDJji3V3.js.map +0 -1
  392. package/dist/unpkg/dev-deprecated/model-BeGORt6h.js.map +0 -1
  393. package/dist/unpkg/dev-deprecated/model-fragments-DSqu0ptR.js.map +0 -1
  394. package/dist/unpkg/dev-deprecated/schema-provider-NmtdR4n_.js.map +0 -1
  395. package/dist/unpkg/dev-deprecated/store-BCOLSC6z.js.map +0 -1
  396. package/dist/unpkg/prod/-private-SfXkkHKd.js.map +0 -1
  397. package/dist/unpkg/prod/adapter-DQ9UA7FC.js.map +0 -1
  398. package/dist/unpkg/prod/compat-DxiVkCUb.js.map +0 -1
  399. package/dist/unpkg/prod/errors-DQDfNqVx.js.map +0 -1
  400. package/dist/unpkg/prod/json-BD1kRTfB.js.map +0 -1
  401. package/dist/unpkg/prod/model-CYMA-e_S.js.map +0 -1
  402. package/dist/unpkg/prod/model-fragments-DSqu0ptR.js +0 -334
  403. package/dist/unpkg/prod/model-fragments-DSqu0ptR.js.map +0 -1
  404. package/dist/unpkg/prod/runtime--fcdnjmJ-DMTJ0Kb3.js +0 -53
  405. package/dist/unpkg/prod/schema-provider-05U1H-Kl.js.map +0 -1
  406. package/dist/unpkg/prod-deprecated/-private-SfXkkHKd.js.map +0 -1
  407. package/dist/unpkg/prod-deprecated/adapter-DQ9UA7FC.js.map +0 -1
  408. package/dist/unpkg/prod-deprecated/compat-DxiVkCUb.js.map +0 -1
  409. package/dist/unpkg/prod-deprecated/errors-ii4L43_1.js.map +0 -1
  410. package/dist/unpkg/prod-deprecated/json-BD1kRTfB.js.map +0 -1
  411. package/dist/unpkg/prod-deprecated/model-D3oCPHtM.js.map +0 -1
  412. package/dist/unpkg/prod-deprecated/model-fragments-DSqu0ptR.js.map +0 -1
  413. package/dist/unpkg/prod-deprecated/schema-provider-CKH_bnnS.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.js","names":["EmberObject","s","g","i","service","inject","Serializer","prototype","store","normalize","_typeClass","hash"],"sources":["../../../src/serializer.ts"],"sourcesContent":["/**\n ## Overview\n\n :::danger\n ⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new serializer, consider writing a\n {@link Handler} instead to be used with the {@link RequestManager}\n :::\n\n In order to properly manage and present your data, WarpDrive\n needs to understand the structure of data it receives.\n\n `Serializers` convert data between the server's API format and\n the format WarpDrive understands.\n\n Data received from an API response is **normalized** into\n [{json:api}](https://jsonapi.org/) (the format used internally\n by WarpDrive), while data sent to an API is **serialized**\n into the format the API expects.\n\n ### Implementing a Serializer\n\n There are only two required serializer methods, one for\n normalizing data from the server API format into {json:api}, and\n another for serializing records via `Snapshots` into the expected\n server API format.\n\n To implement a serializer, export a class that conforms to the structure\n described by {@link MinimumSerializerInterface}\n from the `app/serializers/` directory. An example is below.\n\n ```ts\n import EmberObject from '@ember/object';\n\n export default class ApplicationSerializer extends EmberObject {\n normalizeResponse(store, schema, rawPayload) {\n return rawPayload;\n }\n\n serialize(snapshot, options) {\n const serializedResource = {\n id: snapshot.id,\n type: snapshot.modelName,\n attributes: snapshot.attributes()\n };\n\n return serializedResource;\n }\n }\n ```\n\n\n ### Serializer Resolution\n\n `store.serializerFor(name)` will lookup serializers defined in\n `app/serializers/` and return an instance. If no serializer is found, an\n error will be thrown.\n\n `serializerFor` first attempts to find a serializer with an exact match on `name`,\n then falls back to checking for the presence of a serializer named `application`.\n\n ```ts\n store.serializerFor('author');\n\n // lookup paths (in order) =>\n // app/serializers/author.js\n // app/serializers/application.js\n ```\n\n Most requests in `@warp-drive/legacy` are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n Typically `serializerFor` will be used to find a serializer with a name matching that of the primary\n resource `type` for the request, falling back to the `application` serializer for those types that\n do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy\n for defining serializers. However, because APIs rarely format payloads per-type but rather\n per-API-version, this may not be a desired strategy.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible.\n\n If you have multiple API formats and the per-type strategy is not viable, one strategy is to\n write an `application` adapter and serializer that make use of `options` to specify the desired\n format when making a request.\n\n ### Using a Serializer\n\n Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.\n\n ### Default Serializers\n\n For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**\n format the `@warp-drive/legacy/serializer` package contains implementations these applications can\n extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.\n\n Many applications will find writing their own serializer to be more performant and less\n complex than extending these classes even when their API format is very close to that expected\n by these serializers.\n\n It is recommended that apps write their own serializer to best suit the needs of their API and\n application.\n\n @module\n*/\nimport EmberObject from '@ember/object';\nimport * as s from '@ember/service';\n\n// oxlint-disable-next-line no-unused-vars\nimport type { RequestManager, Store } from '@warp-drive/core';\n// oxlint-disable-next-line no-unused-vars\nimport type { Handler } from '@warp-drive/core/request';\nimport type { ModelSchema } from '@warp-drive/core/types';\nimport type { EmptyResourceDocument, SingleResourceDocument } from '@warp-drive/core/types/spec/json-api-raw';\n\n// oxlint-disable-next-line no-unused-vars\nimport type { MinimumSerializerInterface } from './compat';\n// oxlint-disable-next-line no-unused-vars\nimport type { JSONSerializer } from './serializer/json';\n\nconst service = s.service ?? s.inject;\n\n/**\n > ⚠️ CAUTION you likely want the docs for {@link MinimumSerializerInterface}\n > as extending this abstract class is unnecessary.\n\n `Serializer` is an abstract base class that you may override in your\n application to customize it for your backend. The minimum set of methods\n that you should implement is:\n\n * `normalizeResponse()`\n * `serialize()`\n\n And you can optionally override the following methods:\n\n * `normalize()`\n\n For an example implementation, see the included {@link JSONSerializer}.\n\n @class Serializer\n @public\n*/\n\nexport class Serializer extends EmberObject {\n /**\n The `store` property is the application's `store` that contains\n all records. It can be used to look up serializers for other model\n types that may be nested inside the payload response.\n\n Example:\n\n ```js\n Serializer.extend({\n extractRelationship(relationshipModelName, relationshipHash) {\n let modelClass = this.store.modelFor(relationshipModelName);\n let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n return relationshipSerializer.normalize(modelClass, relationshipHash);\n }\n });\n ```\n\n @public\n */\n @service declare store: Store;\n\n /**\n The `normalizeResponse` method is used to normalize a payload from the\n server to a JSON-API Document.\n\n http://jsonapi.org/format/#document-structure\n\n Example:\n\n ```js\n Serializer.extend({\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n if (requestType === 'findRecord') {\n return this.normalize(primaryModelClass, payload);\n } else {\n return payload.reduce(function(documentHash, item) {\n let { data, included } = this.normalize(primaryModelClass, item);\n documentHash.included.push(...included);\n documentHash.data.push(data);\n return documentHash;\n }, { data: [], included: [] })\n }\n }\n });\n ```\n\n @since 1.13.0\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n\n /**\n The `serialize` method is used when a record is saved in order to convert\n the record into the form that your external data source expects.\n\n `serialize` takes an optional `options` hash with a single option:\n\n - `includeId`: If this is `true`, `serialize` should include the ID\n in the serialized object it builds.\n\n Example:\n\n ```js\n Serializer.extend({\n serialize(snapshot, options) {\n let json = {\n id: snapshot.id\n };\n\n snapshot.eachAttribute((key, attribute) => {\n json[key] = snapshot.attr(key);\n });\n\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n json[key] = snapshot.belongsTo(key, { id: true });\n } else if (relationship.kind === 'hasMany') {\n json[key] = snapshot.hasMany(key, { ids: true });\n }\n });\n\n return json;\n },\n });\n ```\n\n @public\n @param {Snapshot} snapshot\n @param {Object} [options]\n @return {Object}\n */\n\n /**\n The `normalize` method is used to convert a payload received from your\n external data source into the normalized form `store.push()` expects. You\n should override this method, munge the hash and return the normalized\n payload.\n\n Example:\n\n ```js\n Serializer.extend({\n normalize(modelClass, resourceHash) {\n let data = {\n id: resourceHash.id,\n type: modelClass.modelName,\n attributes: resourceHash\n };\n return { data: data };\n }\n })\n ```\n\n @public\n @param _typeClass - the model class the hash is being normalized for\n @param hash - the raw payload hash to normalize\n @return the normalized resource document\n */\n normalize(_typeClass: ModelSchema, hash: Record<string, unknown>): SingleResourceDocument | EmptyResourceDocument {\n return hash as unknown as SingleResourceDocument;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwHA,MAAMI,UAAUH,EAAEG,WAAWH,EAAEI;;;;;;;;;;;;;;;;;;;;;AAuB/B,IAAaC,aAAb,cAAgCN,YAAY;CAAA;EAAAE,gBAAA,KAAAK,WAAA,SAAA,CAoBzCH,OAAO,CAAA;CAAA;CAAA,UAAAD,4BAAA,MAAA,OAAA,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwGRM,UAAUC,YAAyBC,MAA+E;EAChH,OAAOA;CACT;AACF"}
1
+ {"version":3,"file":"serializer.js","names":["EmberObject","s","g","i","service","inject","Serializer","prototype","store","normalize","_typeClass","hash","i"],"sources":["../../../src/serializer.ts"],"sourcesContent":["/**\n ## Overview\n\n :::danger\n ⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new serializer, consider writing a\n {@link Handler} instead to be used with the {@link RequestManager}\n :::\n\n In order to properly manage and present your data, WarpDrive\n needs to understand the structure of data it receives.\n\n `Serializers` convert data between the server's API format and\n the format WarpDrive understands.\n\n Data received from an API response is **normalized** into\n [{json:api}](https://jsonapi.org/) (the format used internally\n by WarpDrive), while data sent to an API is **serialized**\n into the format the API expects.\n\n ### Why It's Legacy\n\n The Serializer pattern was designed to transform data between your API's format and the\n {json:api} format the legacy store works with:\n\n - `store.serializerFor` resolves a serializer by resource type at runtime, looking up\n `serializer:<type>` and then `serializer:application` through Ember's owner, though an\n API's format more often varies per API version than per resource type (see Serializer\n Resolution below).\n - Every response is converted into {json:api} before it reaches the cache, whatever format\n the API actually uses.\n - The provided serializer classes extend `EmberObject`, which, together with the owner\n lookup, ties the pattern to Ember.\n\n ### Modern Alternative\n\n Use [Handlers](/api/@warp-drive/core/request/types/Handler) with the {@link RequestManager}.\n Modern ***Warp*Drive**:\n\n - normalizes a payload inside a handler when it needs transforming, using plain functions\n and helpers such as `dasherize` and `singularize` from `@warp-drive/utilities/string`\n - lets you pick a cache that understands your API's format natively, such as `JSONAPICache`\n from `@warp-drive/json-api` for {json:api}, or write your own that implements the Cache\n interface\n\n For an alternative modern pattern to Serializers, see the\n [Request Handlers Guide](/guides/the-manual/requests/handlers).\n\n ### Setup\n\n Serializers run inside the `LegacyNetworkHandler` from\n [`@warp-drive/legacy/compat`](/api/@warp-drive/legacy/compat/). A store created with\n `useLegacyStore` adds it unless `linksMode` is `true`; a store you build yourself must add it\n to its `RequestManager`, as shown in\n [Configure the Store](/guides/configuration/legacy-package-setup/setup/universal.md#configure-the-store).\n\n ### Implementing a Serializer\n\n There are only two required serializer methods, one for\n normalizing data from the server API format into {json:api}, and\n another for serializing records via `Snapshots` into the expected\n server API format.\n\n To implement a serializer, export a class that conforms to the structure\n described by {@link MinimumSerializerInterface}\n from the `app/serializers/` directory. An example is below.\n\n ```ts\n import EmberObject from '@ember/object';\n\n export default class ApplicationSerializer extends EmberObject {\n normalizeResponse(store, schema, rawPayload) {\n return rawPayload;\n }\n\n serialize(snapshot, options) {\n const serializedResource = {\n id: snapshot.id,\n type: snapshot.modelName,\n attributes: snapshot.attributes()\n };\n\n return serializedResource;\n }\n }\n ```\n\n\n ### Serializer Resolution\n\n `store.serializerFor(name)` will lookup serializers defined in\n `app/serializers/` and return an instance. If no serializer is found, an\n error will be thrown.\n\n `serializerFor` first attempts to find a serializer with an exact match on `name`,\n then falls back to checking for the presence of a serializer named `application`.\n\n ```ts\n store.serializerFor('author');\n\n // lookup paths (in order) =>\n // app/serializers/author.js\n // app/serializers/application.js\n ```\n\n Most requests in `@warp-drive/legacy` are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n Typically `serializerFor` will be used to find a serializer with a name matching that of the primary\n resource `type` for the request, falling back to the `application` serializer for those types that\n do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy\n for defining serializers. However, because APIs rarely format payloads per-type but rather\n per-API-version, this may not be a desired strategy.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible.\n\n If you have multiple API formats and the per-type strategy is not viable, one strategy is to\n write an `application` adapter and serializer that make use of `options` to specify the desired\n format when making a request.\n\n ### Using a Serializer\n\n Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.\n\n ### Default Serializers\n\n For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**\n format the `@warp-drive/legacy/serializer` package contains implementations these applications can\n extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.\n\n Many applications will find writing their own serializer to be more performant and less\n complex than extending these classes even when their API format is very close to that expected\n by these serializers.\n\n It is recommended that apps write their own serializer to best suit the needs of their API and\n application.\n\n @summary Legacy serializer layer that converts data between an API's format and JSON:API for the adapter-based\n request flow.\n @module\n*/\nimport EmberObject from '@ember/object';\nimport * as s from '@ember/service';\n\n// oxlint-disable-next-line no-unused-vars\nimport type { RequestManager, Store } from '@warp-drive/core';\n// oxlint-disable-next-line no-unused-vars\nimport type { Handler } from '@warp-drive/core/request';\nimport type { ModelSchema } from '@warp-drive/core/types';\nimport type { EmptyResourceDocument, SingleResourceDocument } from '@warp-drive/core/types/spec/json-api-raw';\n\n// oxlint-disable-next-line no-unused-vars\nimport type { MinimumSerializerInterface } from './compat';\n// oxlint-disable-next-line no-unused-vars\nimport type { JSONSerializer } from './serializer/json';\n\nconst service = s.service ?? s.inject;\n\n/**\n > ⚠️ CAUTION you likely want the docs for {@link MinimumSerializerInterface}\n > as extending this abstract class is unnecessary.\n\n `Serializer` is an abstract base class that you may override in your\n application to customize it for your backend. The minimum set of methods\n that you should implement is:\n\n * `normalizeResponse()`\n * `serialize()`\n\n And you can optionally override the following methods:\n\n * `normalize()`\n\n For an example implementation, see the included {@link JSONSerializer}.\n\n @summary Legacy abstract base class for serializers that normalize API responses into JSON:API and serialize\n records into the API's request format.\n @class Serializer\n @public\n*/\n\nexport class Serializer extends EmberObject {\n /**\n The `store` property is the application's `store` that contains\n all records. It can be used to look up serializers for other model\n types that may be nested inside the payload response.\n\n Example:\n\n ```js\n Serializer.extend({\n extractRelationship(relationshipModelName, relationshipHash) {\n let modelClass = this.store.modelFor(relationshipModelName);\n let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n return relationshipSerializer.normalize(modelClass, relationshipHash);\n }\n });\n ```\n\n @public\n */\n @service declare store: Store;\n\n /**\n The `normalizeResponse` method is used to normalize a payload from the\n server to a JSON-API Document.\n\n http://jsonapi.org/format/#document-structure\n\n Example:\n\n ```js\n Serializer.extend({\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n if (requestType === 'findRecord') {\n return this.normalize(primaryModelClass, payload);\n } else {\n return payload.reduce(function(documentHash, item) {\n let { data, included } = this.normalize(primaryModelClass, item);\n documentHash.included.push(...included);\n documentHash.data.push(data);\n return documentHash;\n }, { data: [], included: [] })\n }\n }\n });\n ```\n\n @since 1.13.0\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n\n /**\n The `serialize` method is used when a record is saved in order to convert\n the record into the form that your external data source expects.\n\n `serialize` takes an optional `options` hash with a single option:\n\n - `includeId`: If this is `true`, `serialize` should include the ID\n in the serialized object it builds.\n\n Example:\n\n ```js\n Serializer.extend({\n serialize(snapshot, options) {\n let json = {\n id: snapshot.id\n };\n\n snapshot.eachAttribute((key, attribute) => {\n json[key] = snapshot.attr(key);\n });\n\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n json[key] = snapshot.belongsTo(key, { id: true });\n } else if (relationship.kind === 'hasMany') {\n json[key] = snapshot.hasMany(key, { ids: true });\n }\n });\n\n return json;\n },\n });\n ```\n\n @public\n @param {Snapshot} snapshot\n @param {Object} [options]\n @return {Object}\n */\n\n /**\n The `normalize` method is used to convert a payload received from your\n external data source into the normalized form `store.push()` expects. You\n should override this method, munge the hash and return the normalized\n payload.\n\n Example:\n\n ```js\n Serializer.extend({\n normalize(modelClass, resourceHash) {\n let data = {\n id: resourceHash.id,\n type: modelClass.modelName,\n attributes: resourceHash\n };\n return { data: data };\n }\n })\n ```\n\n @public\n @param _typeClass - the model class the hash is being normalized for\n @param hash - the raw payload hash to normalize\n @return the normalized resource document\n */\n normalize(_typeClass: ModelSchema, hash: Record<string, unknown>): SingleResourceDocument | EmptyResourceDocument {\n return hash as unknown as SingleResourceDocument;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8JA,MAAMI,UAAUH,EAAEG,WAAWH,EAAEI;;;;;;;;;;;;;;;;;;;;;;;AAyB/B,IAAaC,aAAb,cAAgCN,YAAY;CAAA;EAAAE,gBAAA,KAAAK,WAAA,SAAA,CAoBzCH,OAAO,CAAA;CAAA;CAAA,UAAAD,4BAAA,MAAA,OAAA,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwGRM,UAAUC,YAAyBC,MAA+E;EAChH,OAAOA;CACT;AACF"}
@@ -1,11 +1,11 @@
1
- import { n as normalizeModelName } from "./util-CXA3RNYH.js";
2
- import { t as isMaybeIdentifier } from "./utils-DQkMqhDv.js";
1
+ import { n as normalizeModelName } from "./util-DL_8JecH.js";
2
+ import { t as isMaybeIdentifier } from "./utils-DyGjRZ14.js";
3
3
  import { assertPrivateStore, constructResource, ensureStringId, recordIdentifierFor, storeFor } from "@warp-drive/core/store/-private";
4
4
  import { defineSignal } from "@warp-drive/core/signals/-leaked";
5
5
  import { getOrSetGlobal } from "@warp-drive/core/types/-private";
6
6
  import { SkipCache } from "@warp-drive/core/types/request";
7
7
 
8
- //#region src/store/-private.ts
8
+ // src/store/-private.ts
9
9
  function preloadData(store, identifier, preload) {
10
10
  const jsonPayload = {};
11
11
  const fields = store.schema.fields(identifier);
@@ -283,14 +283,21 @@ var ShimModelClass = class {
283
283
  }
284
284
  };
285
285
 
286
- //#endregion
287
- //#region src/store.ts
286
+ // src/store.ts
287
+ /**
288
+ * @module
289
+ * @summary Legacy `restoreDeprecatedStoreBehaviors`, which restores the adapter-based `findRecord`, `findAll`, `query`,
290
+ * `saveRecord` and related methods onto a `Store` class.
291
+ */
288
292
  /**
289
293
  * Restores the deprecated `findRecord`/`findAll`/`query`/`queryRecord`/
290
294
  * `findBelongsTo`/`findHasMany`/`createRecord`/`deleteRecord`/`saveRecord`
291
295
  * legacy-network-layer implementations of these methods onto the given
292
296
  * `Store` subclass, for apps that have not yet migrated to the
293
297
  * `RequestManager`-based equivalents.
298
+ *
299
+ * @summary Legacy opt-in that restores the adapter-based `findRecord`, `findAll`, `query`, `saveRecord`, and related
300
+ * methods onto a `Store` class.
294
301
  */
295
302
  function restoreDeprecatedStoreBehaviors(StoreKlass) {
296
303
  StoreKlass.prototype.findRecord = function(resource, id, options) {
@@ -467,6 +474,5 @@ function upgradeInstanceCaches(cache) {
467
474
  return withReferences;
468
475
  }
469
476
 
470
- //#endregion
471
477
  export { restoreDeprecatedStoreBehaviors as t };
472
- //# sourceMappingURL=store-BCOLSC6z.js.map
478
+ //# sourceMappingURL=store-Ci8k7Lh6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-Ci8k7Lh6.js","names":["defineSignal","assertPrivateStore","ensureStringId","recordIdentifierFor","getOrSetGlobal","preloadData","store","identifier","preload","jsonPayload","schemas","schema","fields","Object","keys","forEach","key","preloadValue","field","get","kind","relationships","preloadRelationship","attributes","cache","hasRecord","Boolean","_instanceCache","peek","upsert","relatedType","type","test","Error","Array","isArray","data","map","value","_convertPreloadRelationshipToJSON","id","_resourceIsFullDeleted","isDeletionCommitted","isNew","isDeleted","resourceIsFullyDeleted","instanceCache","RecordReference","___token","___identifier","constructor","notifications","subscribe","_","bucket","notifiedKey","_ref","destroy","unsubscribe","remoteType","push","objectOrPromise","Promise","resolve","then","peekRecord","load","findRecord","reload","prototype","AvailableShims","WeakMap","getShimClass","modelName","shims","create","set","shim","undefined","ShimModelClass","__store","Map","fieldSchemas","attrs","relationshipsByName","rels","eachAttribute","callback","binding","call","eachRelationship","eachTransformedAttribute","assertPrivateStore","constructResource","ensureStringId","recordIdentifierFor","storeFor","SkipCache","isMaybeIdentifier","normalizeModelName","getShimClass","preloadData","RecordReference","resourceIsFullyDeleted","restoreDeprecatedStoreBehaviors","StoreKlass","prototype","findRecord","resource","id","options","test","Error","isDestroying","isDestroyed","type","normalizedId","identifier","cacheKeyManager","getOrCreateRecordIdentifier","preload","_instanceCache","recordIsLoaded","reload","_join","promise","request","op","data","record","cacheOptions","then","document","content","findAll","query","queryRecord","getReference","resourceIdentifier","arguments","length","cache","upgradeInstanceCaches","__instances","reference","get","set","modelFor","schema","hasResource","saveRecord","Promise","reject","lid","resolve","operation","isNew","isDeleted","records","withReferences","WeakMap"],"sources":["../../../src/store/-private.ts","../../../src/store.ts"],"sourcesContent":["import type { NotificationType } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport { defineSignal } from '@warp-drive/core/signals/-leaked';\nimport {\n assertPrivateStore,\n ensureStringId,\n type InstanceCache,\n recordIdentifierFor,\n} from '@warp-drive/core/store/-private';\nimport { getOrSetGlobal } from '@warp-drive/core/types/-private';\nimport type { Cache } from '@warp-drive/core/types/cache';\nimport type { NewResourceKey, ResourceKey } from '@warp-drive/core/types/identifier';\nimport type { Value } from '@warp-drive/core/types/json/raw';\nimport type { OpaqueRecordInstance, TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport type {\n LegacyAttributeField,\n LegacyRelationshipField,\n LegacyRelationshipField as RelationshipSchema,\n} from '@warp-drive/core/types/schema/fields';\nimport type {\n ExistingResourceIdentifierObject,\n ExistingResourceObject,\n InnerRelationshipDocument,\n SingleResourceDocument,\n} from '@warp-drive/core/types/spec/json-api-raw';\n\nimport type { Store } from '../store.ts';\n\n/*\n When a find request is triggered on the store, the user can optionally pass in\n attributes and relationships to be preloaded. These are meant to behave as if they\n came back from the server, except the user obtained them out of band and is informing\n the store of their existence. The most common use case is for supporting client side\n nested URLs, such as `/posts/1/comments/2` so the user can do\n `store.findRecord('comment', 2, { preload: { post: 1 } })` without having to fetch the post.\n\n Preloaded data can be attributes and relationships passed in either as IDs or as actual\n models.\n */\ntype PreloadRelationshipValue = OpaqueRecordInstance | string;\nexport function preloadData(store: Store, identifier: NewResourceKey, preload: Record<string, Value>): void {\n const jsonPayload: Partial<ExistingResourceObject> = {};\n //TODO(Igor) consider the polymorphic case\n const schemas = store.schema;\n const fields = schemas.fields(identifier);\n Object.keys(preload).forEach((key) => {\n const preloadValue = preload[key];\n\n const field = fields.get(key);\n if (field && (field.kind === 'hasMany' || field.kind === 'belongsTo')) {\n if (!jsonPayload.relationships) {\n jsonPayload.relationships = {};\n }\n jsonPayload.relationships[key] = preloadRelationship(field, preloadValue);\n } else {\n if (!jsonPayload.attributes) {\n jsonPayload.attributes = {};\n }\n jsonPayload.attributes[key] = preloadValue;\n }\n });\n const cache = store.cache;\n assertPrivateStore(store);\n const hasRecord = Boolean(store._instanceCache.peek(identifier));\n cache.upsert(identifier, jsonPayload, hasRecord);\n}\n\nfunction preloadRelationship(\n schema: RelationshipSchema,\n preloadValue: PreloadRelationshipValue | null | Array<PreloadRelationshipValue>\n): InnerRelationshipDocument<ExistingResourceIdentifierObject> {\n const relatedType = schema.type;\n\n if (schema.kind === 'hasMany') {\n assert('You need to pass in an array to set a hasMany property on a record', Array.isArray(preloadValue));\n return { data: preloadValue.map((value) => _convertPreloadRelationshipToJSON(value, relatedType)) };\n }\n\n assert('You should not pass in an array to set a belongsTo property on a record', !Array.isArray(preloadValue));\n return { data: preloadValue ? _convertPreloadRelationshipToJSON(preloadValue, relatedType) : null };\n}\n\n/*\n findRecord('user', '1', { preload: { friends: ['1'] }});\n findRecord('user', '1', { preload: { friends: [record] }});\n*/\nfunction _convertPreloadRelationshipToJSON(\n value: OpaqueRecordInstance | string,\n type: string\n): ExistingResourceIdentifierObject {\n if (typeof value === 'string' || typeof value === 'number') {\n return { type, id: ensureStringId(value) };\n }\n // TODO if not a record instance assert it's an identifier\n // and allow identifiers to be used\n return recordIdentifierFor(value) as ExistingResourceIdentifierObject;\n}\n\nexport interface BaseFinderOptions {\n reload?: boolean;\n backgroundReload?: boolean;\n include?: string | string[];\n adapterOptions?: Record<string, unknown>;\n}\nexport interface FindRecordOptions extends BaseFinderOptions {\n /**\n * Data to preload into the store before the request is made.\n * This feature is *highly* discouraged and has no corresponding\n * feature when using builders and handlers.\n *\n * Excepting relationships: the data should be in the form of a\n * JSON object where the keys are fields on the record and the value\n * is the raw value to be added to the cache.\n *\n * Relationships can either be provided as string IDs from which\n * an identifier will be built base upon the relationship's expected\n * resource type, or be record instances from which the identifier\n * will be extracted.\n *\n */\n preload?: Record<string, Value>;\n}\n\nexport type QueryOptions = {\n [K in string | 'adapterOptions']?: K extends 'adapterOptions' ? Record<string, unknown> : unknown;\n};\n\nexport type FindAllOptions = BaseFinderOptions;\nexport type LegacyResourceQuery = {\n include?: string | string[];\n [key: string]: Value | undefined;\n};\n\nexport type KeyOrString<T> = keyof T & string extends never ? string : keyof T & string;\n\n/**\n * Minimum subset of static schema methods and properties on the\n * \"model\" class.\n *\n * Only used when using the legacy schema-service implementation\n * for @ember-data/model or when wrapping schema for legacy\n * Adapters/Serializers.\n *\n */\nexport interface ModelSchema<T = unknown> {\n modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;\n fields: Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'>;\n attributes: Map<KeyOrString<T>, LegacyAttributeField>;\n relationshipsByName: Map<KeyOrString<T>, LegacyRelationshipField>;\n eachAttribute<K extends KeyOrString<T>>(\n callback: (this: ModelSchema<T>, key: K, attribute: LegacyAttributeField) => void,\n binding?: T\n ): void;\n eachRelationship<K extends KeyOrString<T>>(\n callback: (this: ModelSchema<T>, key: K, relationship: LegacyRelationshipField) => void,\n binding?: T\n ): void;\n eachTransformedAttribute<K extends KeyOrString<T>>(\n callback: (this: ModelSchema<T>, key: K, type: string | null) => void,\n binding?: T\n ): void;\n}\n\nfunction _resourceIsFullDeleted(identifier: ResourceKey, cache: Cache): boolean {\n return cache.isDeletionCommitted(identifier) || (cache.isNew(identifier) && cache.isDeleted(identifier));\n}\n\nexport function resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: ResourceKey): boolean {\n const cache = instanceCache.cache;\n return !cache || _resourceIsFullDeleted(identifier, cache);\n}\n\n/**\n A `RecordReference` is a low-level API that allows users and\n addon authors to perform meta-operations on a record.\n\n @hideconstructor\n @public\n*/\nexport class RecordReference {\n /** @internal */\n declare private store: Store;\n // unsubscribe token given to us by the notification manager\n /** @internal */\n private ___token!: object;\n /** @internal */\n private ___identifier: ResourceKey;\n /** @internal */\n declare private _ref: number;\n\n constructor(store: Store, identifier: ResourceKey) {\n this.store = store;\n this.___identifier = identifier;\n this.___token = store.notifications.subscribe(\n identifier,\n (_: ResourceKey, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'identity' || (bucket === 'attributes' && notifiedKey === 'id')) {\n this._ref++;\n }\n }\n );\n }\n\n /** @internal */\n destroy(): void {\n this.store.notifications.unsubscribe(this.___token);\n }\n\n get type(): string {\n return this.identifier().type;\n }\n\n /**\n The `id` of the record that this reference refers to.\n\n Together, the `type` and `id` properties form a composite key for\n the identity map.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n userRef.id(); // '1'\n ```\n\n @public\n @return The id of the record.\n */\n id(): string | null {\n // oxlint-disable-next-line no-unused-expressions\n this._ref; // consume the tracked prop\n return this.___identifier.id;\n }\n\n /**\n The `identifier` of the record that this reference refers to.\n\n Together, the `type` and `id` properties form a composite key for\n the identity map.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n userRef.identifier(); // '1'\n ```\n\n @public\n @return The identifier of the record.\n */\n identifier(): ResourceKey {\n return this.___identifier;\n }\n\n /**\n How the reference will be looked up when it is loaded. Currently\n this always returns `identity` to signify that a record will be\n loaded by its `type` and `id`.\n\n Example\n\n ```javascript\n const userRef = store.getReference('user', 1);\n\n userRef.remoteType(); // 'identity'\n ```\n\n @public\n */\n remoteType(): 'identity' {\n return 'identity';\n }\n\n /**\n This API allows you to provide a reference with new data. The\n simplest usage of this API is similar to `store.push`: you provide a\n normalized hash of data and the object represented by the reference\n will update.\n\n If you pass a promise to `push`, WarpDrive will not ask the adapter\n for the data if another attempt to fetch it is made in the\n interim. When the promise resolves, the underlying object is updated\n with the new data, and the promise returned by *this function* is resolved\n with that object.\n\n For example, `recordReference.push(promise)` will be resolved with a\n record.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n // provide data for reference\n userRef.push({\n data: {\n id: \"1\",\n type: \"user\",\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value() === user;\n });\n ```\n\n @public\n @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one\n @return a promise for the value (record or relationship)\n */\n push(objectOrPromise: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<OpaqueRecordInstance> {\n // TODO @deprecate pushing unresolved payloads\n return Promise.resolve(objectOrPromise).then((data) => {\n return this.store.push(data);\n });\n }\n\n /**\n If the entity referred to by the reference is already loaded, it is\n present as `reference.value`. Otherwise the value returned by this function\n is `null`.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n userRef.value(); // user\n ```\n\n @public\n @return the record for this RecordReference\n */\n value(): OpaqueRecordInstance | null {\n return this.store.peekRecord(this.___identifier);\n }\n\n /**\n Triggers a fetch for the backing entity based on its `remoteType`\n (see `remoteType` definitions per reference type).\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n // load user (via store.find)\n userRef.load().then(...)\n ```\n\n @public\n @return the record for this RecordReference\n */\n load(): Promise<unknown> {\n const id = this.id();\n if (id !== null) {\n return this.store.findRecord(this.type, id);\n }\n assert(`Unable to fetch record of type ${this.type} without an id`);\n }\n\n /**\n Reloads the record if it is already loaded. If the record is not\n loaded it will load the record via `store.findRecord`\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n // or trigger a reload\n userRef.reload().then(...)\n ```\n\n @public\n @return the record for this RecordReference\n */\n reload(): Promise<unknown> {\n const id = this.id();\n if (id !== null) {\n return this.store.findRecord(this.type, id, { reload: true });\n }\n assert(`Unable to fetch record of type ${this.type} without an id`);\n }\n}\n\ndefineSignal(RecordReference.prototype, '_ref');\n\n// if modelFor turns out to be a bottleneck we should replace with a Map\n// and clear it during store teardown.\nconst AvailableShims = getOrSetGlobal('AvailableShims', new WeakMap<Store, Record<string, ShimModelClass>>());\n\nexport function getShimClass<T>(\n store: Store,\n modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string\n): ShimModelClass<T> {\n let shims = AvailableShims.get(store);\n\n if (!shims) {\n shims = Object.create(null) as Record<string, ShimModelClass>;\n AvailableShims.set(store, shims);\n }\n\n let shim = shims[modelName];\n if (shim === undefined) {\n shim = shims[modelName] = new ShimModelClass<unknown>(store, modelName);\n }\n\n return shim;\n}\n\n// Mimics the static apis of @ember-data/model\nexport class ShimModelClass<T = unknown> implements ModelSchema<T> {\n declare __store: Store;\n declare modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;\n constructor(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string) {\n this.__store = store;\n this.modelName = modelName;\n }\n\n get fields(): Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'> {\n const fields = new Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'>();\n const fieldSchemas = this.__store.schema.fields({ type: this.modelName });\n\n fieldSchemas.forEach((schema, key) => {\n if (schema.kind === 'attribute' || schema.kind === 'belongsTo' || schema.kind === 'hasMany') {\n fields.set(key as KeyOrString<T>, schema.kind);\n }\n });\n\n return fields;\n }\n\n get attributes(): Map<KeyOrString<T>, LegacyAttributeField> {\n const attrs = new Map<KeyOrString<T>, LegacyAttributeField>();\n const fields = this.__store.schema.fields({ type: this.modelName });\n\n fields.forEach((schema, key) => {\n if (schema.kind === 'attribute') {\n attrs.set(key as KeyOrString<T>, schema);\n }\n });\n\n return attrs;\n }\n\n get relationshipsByName(): Map<KeyOrString<T>, LegacyRelationshipField> {\n const rels = new Map<KeyOrString<T>, LegacyRelationshipField>();\n const fields = this.__store.schema.fields({ type: this.modelName });\n\n fields.forEach((schema, key) => {\n if (schema.kind === 'belongsTo' || schema.kind === 'hasMany') {\n rels.set(key as KeyOrString<T>, schema);\n }\n });\n\n return rels;\n }\n\n eachAttribute<K extends KeyOrString<T>>(\n callback: (key: K, attribute: LegacyAttributeField) => void,\n binding?: T\n ): void {\n this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {\n if (schema.kind === 'attribute') {\n callback.call(binding, key as K, schema);\n }\n });\n }\n\n eachRelationship<K extends KeyOrString<T>>(\n callback: (key: K, relationship: LegacyRelationshipField) => void,\n binding?: T\n ): void {\n this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {\n if (schema.kind === 'belongsTo' || schema.kind === 'hasMany') {\n callback.call(binding, key as K, schema);\n }\n });\n }\n\n eachTransformedAttribute<K extends KeyOrString<T>>(\n callback: (key: K, type: string | null) => void,\n binding?: T\n ): void {\n this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {\n if (schema.kind === 'attribute') {\n const type = schema.type;\n if (type) callback.call(binding, key as K, type);\n }\n });\n }\n}\n","/**\n * @module\n * @summary Legacy `restoreDeprecatedStoreBehaviors`, which restores the adapter-based `findRecord`, `findAll`, `query`,\n * `saveRecord` and related methods onto a `Store` class.\n */\n\nimport type { Store } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { LegacyLiveArray, LegacyQueryArray, PrivateStore } from '@warp-drive/core/store/-private';\nimport {\n assertPrivateStore,\n constructResource,\n ensureStringId,\n recordIdentifierFor,\n storeFor,\n} from '@warp-drive/core/store/-private';\nimport type { ResourceKey } from '@warp-drive/core/types/identifier';\nimport type { OpaqueRecordInstance, TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport { SkipCache } from '@warp-drive/core/types/request';\nimport type { ResourceIdentifierObject } from '@warp-drive/core/types/spec/json-api-raw';\n\nimport { isMaybeIdentifier } from './compat/builders/utils.ts';\nimport { normalizeModelName } from './model/-private/util.ts';\nimport type {\n FindAllOptions,\n FindRecordOptions,\n LegacyResourceQuery,\n ModelSchema,\n QueryOptions,\n} from './store/-private.ts';\nimport { getShimClass, preloadData, RecordReference, resourceIsFullyDeleted } from './store/-private.ts';\n\n/**\n * Restores the deprecated `findRecord`/`findAll`/`query`/`queryRecord`/\n * `findBelongsTo`/`findHasMany`/`createRecord`/`deleteRecord`/`saveRecord`\n * legacy-network-layer implementations of these methods onto the given\n * `Store` subclass, for apps that have not yet migrated to the\n * `RequestManager`-based equivalents.\n *\n * @summary Legacy opt-in that restores the adapter-based `findRecord`, `findAll`, `query`, `saveRecord`, and related\n * methods onto a `Store` class.\n */\nexport function restoreDeprecatedStoreBehaviors(StoreKlass: typeof Store): void {\n StoreKlass.prototype.findRecord = function (\n resource: string | ResourceIdentifierObject,\n id?: string | number | FindRecordOptions,\n options?: FindRecordOptions\n ): Promise<unknown> {\n assert(\n `Attempted to call store.findRecord(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n\n assert(\n `You need to pass a modelName or resource identifier as the first argument to the store's findRecord method`,\n resource\n );\n if (isMaybeIdentifier(resource)) {\n options = id as FindRecordOptions;\n } else {\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${resource}`,\n typeof resource === 'string'\n );\n const type = normalizeModelName(resource);\n const normalizedId = ensureStringId(id as string | number);\n resource = constructResource(type, normalizedId);\n }\n\n const identifier = this.cacheKeyManager.getOrCreateRecordIdentifier(resource);\n options = options || {};\n assertPrivateStore(this);\n\n if (options.preload) {\n // force reload if we preload to ensure we don't resolve the promise\n // until we are complete, else we will end up background-reloading\n // even for initial load.\n if (!this._instanceCache.recordIsLoaded(identifier)) {\n options.reload = true;\n }\n this._join(() => {\n preloadData(this, identifier, options.preload!);\n });\n }\n\n const promise = this.request<OpaqueRecordInstance>({\n op: 'findRecord',\n data: {\n record: identifier,\n options,\n },\n cacheOptions: { [SkipCache]: true },\n });\n\n return promise.then((document) => {\n return document.content;\n });\n };\n\n StoreKlass.prototype.findAll = function <T>(\n type: TypeFromInstance<T> | string,\n options: FindAllOptions = {}\n ): Promise<LegacyLiveArray<T>> {\n assert(\n `Attempted to call store.findAll(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n assert(`You need to pass a model name to the store's findAll method`, type);\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n const promise = this.request<LegacyLiveArray<T>>({\n op: 'findAll',\n data: {\n type: normalizeModelName(type),\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n });\n\n return promise.then((document) => document.content);\n };\n\n StoreKlass.prototype.query = function (\n type: string,\n query: LegacyResourceQuery,\n options: QueryOptions = {}\n ): Promise<LegacyQueryArray> {\n assert(\n `Attempted to call store.query(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n assert(`You need to pass a model name to the store's query method`, type);\n assert(`You need to pass a query hash to the store's query method`, query);\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n const promise = this.request<LegacyQueryArray>({\n op: 'query',\n data: {\n type: normalizeModelName(type),\n query,\n options: options,\n },\n cacheOptions: { [SkipCache]: true },\n });\n\n return promise.then((document) => document.content);\n };\n\n StoreKlass.prototype.queryRecord = function (\n type: string,\n query: Record<string, unknown>,\n options?: QueryOptions\n ): Promise<OpaqueRecordInstance | null> {\n assert(\n `Attempted to call store.queryRecord(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n assert(`You need to pass a model name to the store's queryRecord method`, type);\n assert(`You need to pass a query hash to the store's queryRecord method`, query);\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n const promise = this.request<OpaqueRecordInstance | null>({\n op: 'queryRecord',\n data: {\n type: normalizeModelName(type),\n query,\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n });\n\n return promise.then((document) => document.content);\n };\n\n // do not put a ts-expect-error here, because typedoc will fail to\n // build due to this error only occurring when references are in use in the editor.\n // The return statement below casts to `PrivateStore['getReference']`'s return\n // type rather than annotating this function `: RecordReference` directly,\n // since this package's `RecordReference` and core's `deprecated/-private.ts`\n // copy are structurally identical but nominally distinct classes (TS treats\n // their private fields as separate brands); casting only the return value\n // (instead of the whole function) keeps `this` contextually typed from the\n // assignment target below.\n StoreKlass.prototype.getReference = function (resource: string | ResourceIdentifierObject, id: string | number) {\n assert(\n `Attempted to call store.getReference(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n\n let resourceIdentifier: ResourceIdentifierObject;\n if (arguments.length === 1 && isMaybeIdentifier(resource)) {\n resourceIdentifier = resource;\n } else {\n const type = normalizeModelName(resource as string);\n const normalizedId = ensureStringId(id);\n resourceIdentifier = constructResource(type, normalizedId);\n }\n\n assert(\n 'getReference expected to receive either a resource identifier or type and id as arguments',\n isMaybeIdentifier(resourceIdentifier)\n );\n\n const identifier: ResourceKey = this.cacheKeyManager.getOrCreateRecordIdentifier(resourceIdentifier);\n assertPrivateStore(this);\n\n const cache = upgradeInstanceCaches(this._instanceCache.__instances).reference;\n let reference = cache.get(identifier);\n\n if (!reference) {\n reference = new RecordReference(this, identifier);\n cache.set(identifier, reference);\n }\n return reference;\n };\n\n StoreKlass.prototype.modelFor = function <T>(\n type: T extends TypedRecordInstance ? TypeFromInstance<T> : string\n ): ModelSchema<T> {\n assert(`Attempted to call store.modelFor(), but the store instance has already been destroyed.`, !this.isDestroyed);\n assert(`You need to pass <type> to the store's modelFor method`, typeof type === 'string' && type.length);\n assert(`No model was found for '${type}' and no schema handles the type`, this.schema.hasResource({ type }));\n\n return getShimClass<T>(this, type);\n };\n\n StoreKlass.prototype.saveRecord = function <T>(record: T, options: Record<string, unknown> = {}): Promise<T> {\n assert(\n `Attempted to call store.saveRecord(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n assert(`Unable to initiate save for a record in a disconnected state`, storeFor(record, true));\n const identifier = recordIdentifierFor(record);\n const cache = this.cache;\n\n if (!identifier) {\n // this commonly means we're disconnected\n // but just in case we reject here to prevent bad things.\n return Promise.reject(new Error(`Record Is Disconnected`));\n }\n assertPrivateStore(this);\n assert(\n `Cannot initiate a save request for an unloaded record: ${identifier.lid}`,\n this._instanceCache.recordIsLoaded(identifier)\n );\n if (resourceIsFullyDeleted(this._instanceCache, identifier)) {\n return Promise.resolve(record);\n }\n\n if (!options) {\n options = {};\n }\n let operation: 'createRecord' | 'deleteRecord' | 'updateRecord' = 'updateRecord';\n\n if (cache.isNew(identifier)) {\n operation = 'createRecord';\n } else if (cache.isDeleted(identifier)) {\n operation = 'deleteRecord';\n }\n\n const request = {\n op: operation,\n data: {\n options,\n record: identifier,\n },\n records: [identifier],\n cacheOptions: { [SkipCache]: true },\n };\n\n return this.request<T>(request).then((document) => document.content);\n };\n}\n\nexport type { Store };\n\ntype Caches = PrivateStore['_instanceCache']['__instances'];\nfunction upgradeInstanceCaches(cache: Caches): Caches & { reference: WeakMap<ResourceKey, RecordReference> } {\n const withReferences = cache as Caches & { reference: WeakMap<ResourceKey, RecordReference> };\n if (!withReferences.reference) {\n withReferences.reference = new WeakMap();\n }\n\n return withReferences;\n}\n"],"mappings":";;;;;;;;AAwCA,SAAgBK,YAAYC,OAAcC,YAA4BC,SAAsC;CAC1G,MAAMC,cAA+C,CAAC;CAGtD,MAAMG,SADUN,MAAMK,OACCC,OAAOL,UAAU;CACxCM,OAAOC,KAAKN,OAAO,CAAC,CAACO,SAASC,QAAQ;EACpC,MAAMC,eAAeT,QAAQQ;EAE7B,MAAME,QAAQN,OAAOO,IAAIH,GAAG;EAC5B,IAAIE,UAAUA,MAAME,SAAS,aAAaF,MAAME,SAAS,cAAc;GACrE,IAAI,CAACX,YAAYY,eACfZ,YAAYY,gBAAgB,CAAC;GAE/BZ,YAAYY,cAAcL,OAAOM,oBAAoBJ,OAAOD,YAAY;EAC1E,OAAO;GACL,IAAI,CAACR,YAAYc,YACfd,YAAYc,aAAa,CAAC;GAE5Bd,YAAYc,WAAWP,OAAOC;EAChC;CACF,CAAC;CACD,MAAMO,QAAQlB,MAAMkB;CACpBvB,mBAAmBK,KAAK;CACxB,MAAMmB,YAAYC,QAAQpB,MAAMqB,eAAeC,KAAKrB,UAAU,CAAC;CAC/DiB,MAAMK,OAAOtB,YAAYE,aAAagB,SAAS;AACjD;AAEA,SAASH,oBACPX,QACAM,cAC6D;CAC7D,MAAMa,cAAcnB,OAAOoB;CAE3B,IAAIpB,OAAOS,SAAS,WAAW;EAC7B,EAAAY,SAAA;GAAA,IAAA,CAAAA,MAAA,MAAA,IAAAC,MAAO,oEAAoE;EAAA,EAAA,CAAEC,MAAMC,QAAQlB,YAAY,CAAC;EACxG,OAAO,EAAEmB,MAAMnB,aAAaoB,KAAKC,UAAUC,kCAAk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lB;CACvB,IAAI,CAACkB,eAAef,WAClBe,eAAef,4BAAY,IAAIgB,QAAQ;CAGzC,OAAOD;AACT"}
@@ -1,3 +1,3 @@
1
- import { t as restoreDeprecatedStoreBehaviors } from "./store-BCOLSC6z.js";
1
+ import { t as restoreDeprecatedStoreBehaviors } from "./store-Ci8k7Lh6.js";
2
2
 
3
3
  export { restoreDeprecatedStoreBehaviors };
@@ -1,6 +1,6 @@
1
1
  import { dasherize } from "@warp-drive/utilities/string";
2
2
 
3
- //#region src/model/-private/util.ts
3
+ // src/model/-private/util.ts
4
4
  function isElementDescriptor(args) {
5
5
  const [maybeTarget, maybeKey, maybeDesc] = args;
6
6
  return args.length === 3 && (typeof maybeTarget === "function" || typeof maybeTarget === "object" && maybeTarget !== null) && typeof maybeKey === "string" && (typeof maybeDesc === "object" && maybeDesc !== null && "enumerable" in maybeDesc && "configurable" in maybeDesc || maybeDesc === void 0);
@@ -13,6 +13,5 @@ function normalizeModelName(type) {
13
13
  }
14
14
  }
15
15
 
16
- //#endregion
17
16
  export { normalizeModelName as n, isElementDescriptor as t };
18
- //# sourceMappingURL=util-CXA3RNYH.js.map
17
+ //# sourceMappingURL=util-DL_8JecH.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"util-CXA3RNYH.js","names":["dasherize","isElementDescriptor","args","maybeTarget","maybeKey","maybeDesc","length","undefined","normalizeModelName","type","result","console","warn"],"sources":["../../../src/model/-private/util.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { DEPRECATE_NON_STRICT_TYPES } from '@warp-drive/core/build-config/deprecations';\nimport { dasherize } from '@warp-drive/utilities/string';\n\nexport type DecoratorPropertyDescriptor = (PropertyDescriptor & { initializer?: () => unknown }) | undefined;\n\nexport function isElementDescriptor(args: unknown[]): args is [object, string, DecoratorPropertyDescriptor] {\n const [maybeTarget, maybeKey, maybeDesc] = args;\n\n return (\n // Ensure we have the right number of args\n args.length === 3 &&\n // Make sure the target is a class or object (prototype)\n (typeof maybeTarget === 'function' || (typeof maybeTarget === 'object' && maybeTarget !== null)) &&\n // Make sure the key is a string\n typeof maybeKey === 'string' &&\n // Make sure the descriptor is the right shape\n ((typeof maybeDesc === 'object' &&\n maybeDesc !== null &&\n 'enumerable' in maybeDesc &&\n 'configurable' in maybeDesc) ||\n // TS compatibility\n maybeDesc === undefined)\n );\n}\n\nexport function normalizeModelName(type: string): string {\n if (DEPRECATE_NON_STRICT_TYPES) {\n const result = dasherize(type);\n\n deprecate(\n `The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`,\n result === type,\n {\n id: 'ember-data:deprecate-non-strict-types',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '4.13',\n enabled: '5.3',\n },\n }\n );\n\n return result;\n }\n\n return type;\n}\n"],"mappings":";;;AAOA,SAAgBC,oBAAoBC,MAAwE;CAC1G,MAAM,CAACC,aAAaC,UAAUC,aAAaH;CAE3C,OAEEA,KAAKI,WAAW,MAEf,OAAOH,gBAAgB,cAAe,OAAOA,gBAAgB,YAAYA,gBAAgB,SAE1F,OAAOC,aAAa,aAElB,OAAOC,cAAc,YACrBA,cAAc,QACd,gBAAgBA,aAChB,kBAAkBA,aAElBA,cAAcE;AAEpB;AAEA,SAAgBC,mBAAmBC,MAAsB;CACvB;EAC9B,MAAMC,SAASV,UAAUS,IAAI;EAAE,AAI7BC,WAAWD,QAAIE,QAAAC,KADf,sBAAsBH,KAAI,4DAA6DC,OAAM,gBAAiBD,KAAI,GAAI;EAaxH,OAAOC;CACT;AAGF"}
1
+ {"version":3,"file":"util-DL_8JecH.js","names":["dasherize","isElementDescriptor","args","maybeTarget","maybeKey","maybeDesc","length","undefined","normalizeModelName","type","result","console","warn"],"sources":["../../../src/model/-private/util.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { DEPRECATE_NON_STRICT_TYPES } from '@warp-drive/core/build-config/deprecations';\nimport { dasherize } from '@warp-drive/utilities/string';\n\nexport type DecoratorPropertyDescriptor = (PropertyDescriptor & { initializer?: () => unknown }) | undefined;\n\nexport function isElementDescriptor(args: unknown[]): args is [object, string, DecoratorPropertyDescriptor] {\n const [maybeTarget, maybeKey, maybeDesc] = args;\n\n return (\n // Ensure we have the right number of args\n args.length === 3 &&\n // Make sure the target is a class or object (prototype)\n (typeof maybeTarget === 'function' || (typeof maybeTarget === 'object' && maybeTarget !== null)) &&\n // Make sure the key is a string\n typeof maybeKey === 'string' &&\n // Make sure the descriptor is the right shape\n ((typeof maybeDesc === 'object' &&\n maybeDesc !== null &&\n 'enumerable' in maybeDesc &&\n 'configurable' in maybeDesc) ||\n // TS compatibility\n maybeDesc === undefined)\n );\n}\n\nexport function normalizeModelName(type: string): string {\n if (DEPRECATE_NON_STRICT_TYPES) {\n const result = dasherize(type);\n\n deprecate(\n `The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`,\n result === type,\n {\n id: 'ember-data:deprecate-non-strict-types',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '4.13',\n enabled: '5.3',\n },\n }\n );\n\n return result;\n }\n\n return type;\n}\n"],"mappings":";;;AAOA,SAAgBC,oBAAoBC,MAAwE;CAC1G,MAAM,CAACC,aAAaC,UAAUC,aAAaH;CAE3C,OAEEA,KAAKI,WAAW,MAEf,OAAOH,gBAAgB,cAAe,OAAOA,gBAAgB,YAAYA,gBAAgB,SAE1F,OAAOC,aAAa,aAElB,OAAOC,cAAc,YACrBA,cAAc,QACd,gBAAgBA,aAChB,kBAAkBA,aAElBA,cAAcE;AAEpB;AAEA,SAAgBC,mBAAmBC,MAAsB;CACvB;EAC9B,MAAMC,SAASV,UAAUS,IAAI;EAAE,AAI7BC,WAAWD,QAAIE,QAAAC,KADf,sBAAsBH,KAAI,4DAA6DC,OAAM,gBAAiBD,KAAI,GAAI;EAaxH,OAAOC;CACT;AAGF"}
@@ -1,6 +1,6 @@
1
1
  import { dasherize } from "@warp-drive/utilities/string";
2
2
 
3
- //#region src/compat/builders/utils.ts
3
+ // src/compat/builders/utils.ts
4
4
  function isMaybeIdentifier(maybeIdentifier) {
5
5
  return Boolean(maybeIdentifier !== null && typeof maybeIdentifier === "object" && ("id" in maybeIdentifier && "type" in maybeIdentifier && maybeIdentifier.id && maybeIdentifier.type || maybeIdentifier.lid));
6
6
  }
@@ -12,6 +12,5 @@ function normalizeModelName(type) {
12
12
  }
13
13
  }
14
14
 
15
- //#endregion
16
15
  export { normalizeModelName as n, isMaybeIdentifier as t };
17
- //# sourceMappingURL=utils-DQkMqhDv.js.map
16
+ //# sourceMappingURL=utils-DyGjRZ14.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-DQkMqhDv.js","names":["dasherize","isMaybeIdentifier","maybeIdentifier","Boolean","id","type","lid","normalizeModelName","result","console","warn"],"sources":["../../../src/compat/builders/utils.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { DEPRECATE_NON_STRICT_TYPES } from '@warp-drive/core/build-config/deprecations';\nimport type { ResourceIdentifierObject } from '@warp-drive/core/types/spec/json-api-raw';\nimport { dasherize } from '@warp-drive/utilities/string';\n\nexport function isMaybeIdentifier(\n maybeIdentifier: string | ResourceIdentifierObject\n): maybeIdentifier is ResourceIdentifierObject {\n return Boolean(\n maybeIdentifier !== null &&\n typeof maybeIdentifier === 'object' &&\n (('id' in maybeIdentifier && 'type' in maybeIdentifier && maybeIdentifier.id && maybeIdentifier.type) ||\n maybeIdentifier.lid)\n );\n}\n\nexport function normalizeModelName(type: string): string {\n if (DEPRECATE_NON_STRICT_TYPES) {\n const result = dasherize(type);\n\n deprecate(\n `The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`,\n result === type,\n {\n id: 'ember-data:deprecate-non-strict-types',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '4.13',\n enabled: '5.3',\n },\n }\n );\n\n return result;\n }\n\n return type;\n}\n"],"mappings":";;;AAMA,SAAgBC,kBACdC,iBAC6C;CAC7C,OAAOC,QACLD,oBAAoB,QACpB,OAAOA,oBAAoB,aACzB,QAAQA,mBAAmB,UAAUA,mBAAmBA,gBAAgBE,MAAMF,gBAAgBG,QAC9FH,gBAAgBI,IACpB;AACF;AAEA,SAAgBC,mBAAmBF,MAAsB;CACvB;EAC9B,MAAMG,SAASR,UAAUK,IAAI;EAAE,AAI7BG,WAAWH,QAAII,QAAAC,KADf,sBAAsBL,KAAI,4DAA6DG,OAAM,gBAAiBH,KAAI,GAAI;EAaxH,OAAOG;CACT;AAGF"}
1
+ {"version":3,"file":"utils-DyGjRZ14.js","names":["dasherize","isMaybeIdentifier","maybeIdentifier","Boolean","id","type","lid","normalizeModelName","result","console","warn"],"sources":["../../../src/compat/builders/utils.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { DEPRECATE_NON_STRICT_TYPES } from '@warp-drive/core/build-config/deprecations';\nimport type { ResourceIdentifierObject } from '@warp-drive/core/types/spec/json-api-raw';\nimport { dasherize } from '@warp-drive/utilities/string';\n\nexport function isMaybeIdentifier(\n maybeIdentifier: string | ResourceIdentifierObject\n): maybeIdentifier is ResourceIdentifierObject {\n return Boolean(\n maybeIdentifier !== null &&\n typeof maybeIdentifier === 'object' &&\n (('id' in maybeIdentifier && 'type' in maybeIdentifier && maybeIdentifier.id && maybeIdentifier.type) ||\n maybeIdentifier.lid)\n );\n}\n\nexport function normalizeModelName(type: string): string {\n if (DEPRECATE_NON_STRICT_TYPES) {\n const result = dasherize(type);\n\n deprecate(\n `The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`,\n result === type,\n {\n id: 'ember-data:deprecate-non-strict-types',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '4.13',\n enabled: '5.3',\n },\n }\n );\n\n return result;\n }\n\n return type;\n}\n"],"mappings":";;;AAMA,SAAgBC,kBACdC,iBAC6C;CAC7C,OAAOC,QACLD,oBAAoB,QACpB,OAAOA,oBAAoB,aACzB,QAAQA,mBAAmB,UAAUA,mBAAmBA,gBAAgBE,MAAMF,gBAAgBG,QAC9FH,gBAAgBI,IACpB;AACF;AAEA,SAAgBC,mBAAmBF,MAAsB;CACvB;EAC9B,MAAMG,SAASR,UAAUK,IAAI;EAAE,AAI7BG,WAAWH,QAAII,QAAAC,KADf,sBAAsBL,KAAI,4DAA6DG,OAAM,gBAAiBH,KAAI,GAAI;EAaxH,OAAOG;CACT;AAGF"}
@@ -1,6 +1,6 @@
1
- import { t as upgradeStore } from "./-private-SfXkkHKd.js";
1
+ import { t as upgradeStore } from "./-private-DuRzYAyW.js";
2
2
 
3
- //#region src/adapter/-private/utils/parse-response-headers.ts
3
+ // src/adapter/-private/utils/parse-response-headers.ts
4
4
  const newline = /\r?\n/;
5
5
  function parseResponseHeaders(headersString) {
6
6
  const headers = Object.create(null);
@@ -26,8 +26,7 @@ function parseResponseHeaders(headersString) {
26
26
  return headers;
27
27
  }
28
28
 
29
- //#endregion
30
- //#region src/adapter/-private/utils/continue-on-reject.ts
29
+ // src/adapter/-private/utils/continue-on-reject.ts
31
30
  /**
32
31
  * A utility function that returns a promise that resolves
33
32
  * even when the source promise rejects.
@@ -38,8 +37,7 @@ function continueOnReject(promise) {
38
37
  return Promise.resolve(promise).catch((e) => e);
39
38
  }
40
39
 
41
- //#endregion
42
- //#region src/adapter/-private/utils/determine-body-promise.ts
40
+ // src/adapter/-private/utils/determine-body-promise.ts
43
41
  function _determineContent(response, requestData, payload) {
44
42
  let ret = payload;
45
43
  let error = null;
@@ -62,8 +60,7 @@ function determineBodyPromise(response, requestData) {
62
60
  return continueOnReject(response.text()).then((payload) => _determineContent(response, requestData, payload));
63
61
  }
64
62
 
65
- //#endregion
66
- //#region src/adapter/-private/utils/serialize-query-params.ts
63
+ // src/adapter/-private/utils/serialize-query-params.ts
67
64
  const RBRACKET = /\[\]$/;
68
65
  function isPlainObject(obj) {
69
66
  return Object.prototype.toString.call(obj) === "[object Object]";
@@ -95,8 +92,7 @@ function add(s, k, v) {
95
92
  s[s.length] = `${encodeURIComponent(k)}=${encodeURIComponent(v)}`;
96
93
  }
97
94
 
98
- //#endregion
99
- //#region src/adapter/-private/utils/fetch.ts
95
+ // src/adapter/-private/utils/fetch.ts
100
96
  let _fetch = null;
101
97
  let REQUEST = null;
102
98
  function getFetchFunction() {
@@ -142,8 +138,7 @@ function setupFastboot(fastBootRequest) {
142
138
  REQUEST = fastBootRequest;
143
139
  }
144
140
 
145
- //#endregion
146
- //#region src/adapter/-private/utils/serialize-into-hash.ts
141
+ // src/adapter/-private/utils/serialize-into-hash.ts
147
142
  function serializeIntoHash(store, modelClass, snapshot, options = { includeId: true }) {
148
143
  /* @__PURE__ */ upgradeStore(store);
149
144
  const serializer = store.serializerFor(modelClass.modelName);
@@ -155,6 +150,5 @@ function serializeIntoHash(store, modelClass, snapshot, options = { includeId: t
155
150
  return serializer.serialize(snapshot, options);
156
151
  }
157
152
 
158
- //#endregion
159
153
  export { determineBodyPromise as a, serializeQueryParams as i, getFetchFunction as n, parseResponseHeaders as o, setupFastboot as r, serializeIntoHash as t };
160
- //# sourceMappingURL=-private-B4bxoTuK.js.map
154
+ //# sourceMappingURL=-private-Dc9yg98O.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"-private-B4bxoTuK.js","names":["continueOnReject","_determineContent","response","requestData","payload","ret","error","ok","status","payloadIsEmpty","statusIndicatesEmptyResponse","method","JSON","parse","e","SyntaxError","determineBodyPromise","text","then","RBRACKET","isPlainObject","obj","Object","prototype","toString","call","isPrimitiveArray","Array","isArray","isParamsArray","buildParams","prefix","s","i","len","key","length","test","add","name","value","serializeQueryParams","queryParamsObject","join","k","v","undefined","encodeURIComponent","_fetch","REQUEST","getFetchFunction","fetch","FastBoot","nodeFetch","require","httpRegex","protocolRelativeRegex","parseRequest","request","Error","protocol","get","buildAbsoluteUrl","url","test","host","patchedFetch","input","options","href","info","Object","assign","setupFastboot","fastBootRequest","upgradeStore","serializeIntoHash","store","modelClass","snapshot","options","includeId","serializer","serializerFor","modelName","data","serialize"],"sources":["../../../src/adapter/-private/utils/parse-response-headers.ts","../../../src/adapter/-private/utils/continue-on-reject.ts","../../../src/adapter/-private/utils/determine-body-promise.ts","../../../src/adapter/-private/utils/serialize-query-params.ts","../../../src/adapter/-private/utils/fetch.ts","../../../src/adapter/-private/utils/serialize-into-hash.ts"],"sourcesContent":["const newline = /\\r?\\n/;\n\nexport function parseResponseHeaders(headersString: string): Record<string, string> {\n const headers = Object.create(null) as Record<string, string>;\n\n if (!headersString) {\n return headers;\n }\n\n const headerPairs: string[] = headersString.split(newline);\n\n for (let i = 0; i < headerPairs.length; i++) {\n const header = headerPairs[i];\n let j = 0;\n let foundSep = false;\n\n for (; j < header.length; j++) {\n if (header.charCodeAt(j) === 58 /* ':' */) {\n foundSep = true;\n break;\n }\n }\n\n if (foundSep === false) {\n continue;\n }\n\n const field = header.substring(0, j).trim();\n const value = header.substring(j + 1, header.length).trim();\n\n if (value) {\n const lowerCasedField = field.toLowerCase();\n\n headers[lowerCasedField] = value;\n headers[field] = value;\n }\n }\n\n return headers;\n}\n","/**\n * A utility function that returns a promise that resolves\n * even when the source promise rejects.\n *\n * @internal\n */\nexport function continueOnReject<T>(promise: Promise<T>): Promise<T> {\n return Promise.resolve(promise).catch((e) => e as T);\n}\n","import { warn } from '@ember/debug';\n\nimport { DEBUG } from '@warp-drive/core/build-config/env';\n\nimport type { RequestData } from '../../rest.ts';\nimport { continueOnReject } from './continue-on-reject.ts';\n\ntype Payload = Error | Record<string, unknown> | unknown[] | string | undefined;\n\ninterface CustomSyntaxError extends SyntaxError {\n payload: Payload;\n}\n\n/*\n * Function that always attempts to parse the response as json, and if an error is thrown,\n * returns `undefined` if the response is successful and has a status code of 204 (No Content),\n * or 205 (Reset Content) or if the request method was 'HEAD', and the plain payload otherwise.\n */\nfunction _determineContent(response: Response, requestData: JQueryAjaxSettings, payload: Payload): Payload {\n let ret: Payload = payload;\n let error: Error | null = null;\n\n if (!response.ok) {\n return payload;\n }\n\n const status = response.status;\n const payloadIsEmpty = payload === '' || payload === null;\n const statusIndicatesEmptyResponse = status === 204 || status === 205 || requestData.method === 'HEAD';\n\n if (DEBUG) {\n if (payloadIsEmpty && !statusIndicatesEmptyResponse) {\n const message = `The server returned an empty string for ${requestData.method} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n if (payload === '') {\n warn(message, {\n id: 'ds.adapter.returned-empty-string-as-JSON',\n });\n }\n }\n }\n\n if (response.ok && (statusIndicatesEmptyResponse || payloadIsEmpty)) {\n return;\n }\n\n try {\n ret = JSON.parse(payload as string) as Payload;\n } catch (e) {\n if (!(e instanceof SyntaxError)) {\n return e as Error;\n }\n (e as CustomSyntaxError).payload = payload;\n error = e;\n }\n\n if (error) {\n if (DEBUG) {\n // oxlint-disable-next-line no-console\n console.warn('This response was unable to be parsed as json.', payload);\n }\n return error;\n }\n\n return ret;\n}\n\nexport function determineBodyPromise(response: Response, requestData: RequestData): Promise<Payload> {\n // response.text() may resolve or reject\n // it is a native promise, may not have finally\n return continueOnReject(response.text()).then((payload) => _determineContent(response, requestData, payload));\n}\n","import { assert } from '@warp-drive/core/build-config/macros';\n\nconst RBRACKET = /\\[\\]$/;\n\ninterface PlainObject {\n [key: string]: string | PlainObject | PlainObject[] | string[];\n}\ntype ParamObject = { name: string; value: string };\n\nfunction isPlainObject<T>(obj: unknown): obj is T {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nfunction isPrimitiveArray(obj: unknown): obj is Array<PlainObject | string> {\n return Array.isArray(obj);\n}\n\nfunction isParamsArray(obj: unknown): obj is ParamObject[] {\n return Array.isArray(obj);\n}\n\nfunction buildParams<T extends PlainObject>(\n prefix: string,\n obj: ParamObject | ParamObject[] | Array<T | string> | T | string,\n s: string[]\n) {\n let i: number, len: number, key: keyof T & string;\n\n if (prefix) {\n if (isPrimitiveArray(obj)) {\n for (i = 0, len = obj.length; i < len; i++) {\n if (RBRACKET.test(prefix)) {\n add(s, prefix, obj[i] as string);\n } else {\n buildParams(prefix + '[' + (typeof obj[i] === 'object' && obj[i] !== null ? i : '') + ']', obj[i], s);\n }\n }\n } else if (isPlainObject<T>(obj)) {\n for (key in obj) {\n buildParams(prefix + '[' + key + ']', obj[key], s);\n }\n } else {\n assert(\n `query params cannot be a { name, value } pair if prefix is present`,\n obj === null || typeof obj !== 'object'\n );\n add(s, prefix, obj);\n }\n } else if (isParamsArray(obj)) {\n for (i = 0, len = obj.length; i < len; i++) {\n add(s, obj[i].name, obj[i].value);\n }\n } else {\n assert(`query params cannot be a string if no prefix is present`, typeof obj !== 'string');\n assert(`query params should not be an array if no prefix is present`, !Array.isArray(obj));\n assert(`query params should not be a { name, value } pair if no prefix is present`, isPlainObject<T>(obj));\n for (key in obj) {\n buildParams(key, obj[key], s);\n }\n }\n return s;\n}\n\n/*\n * Helper function that turns the data/body of a request into a query param string.\n * This is directly copied from jQuery.param.\n */\nexport function serializeQueryParams(queryParamsObject: PlainObject | string): string {\n return buildParams('', queryParamsObject, []).join('&');\n}\n\n/*\n * Part of the `serializeQueryParams` helper function.\n */\nfunction add(s: string[], k: string, v?: string | (() => string)) {\n // Strip out keys with undefined value and replace null values with\n // empty strings (mimics jQuery.ajax)\n if (v === undefined) {\n return;\n } else if (v === null) {\n v = '';\n }\n\n v = typeof v === 'function' ? v() : v;\n s[s.length] = `${encodeURIComponent(k)}=${encodeURIComponent(v)}`;\n}\n","import { assert } from '@warp-drive/core/build-config/macros';\n\ntype FetchFunction = (input: RequestInfo, init?: RequestInit) => Promise<Response>;\n\nlet _fetch: (() => FetchFunction) | null = null;\ntype MockRequest = { protocol?: string; get(key: string): string | undefined };\nlet REQUEST: MockRequest = null as unknown as MockRequest;\n\nexport function getFetchFunction(): FetchFunction {\n // return cached fetch function\n if (_fetch !== null) {\n return _fetch();\n }\n\n // grab browser native fetch if available, or global fetch if otherwise configured\n if (typeof fetch === 'function') {\n // fallback to using global fetch\n _fetch = () => fetch;\n\n /* global FastBoot */\n // grab fetch from node-fetch\n } else if (typeof FastBoot !== 'undefined') {\n try {\n const nodeFetch = FastBoot.require('node-fetch') as typeof fetch;\n\n const httpRegex = /^https?:\\/\\//;\n const protocolRelativeRegex = /^\\/\\//;\n\n function parseRequest(request: MockRequest) {\n if (request === null) {\n throw new Error(\n \"Trying to fetch with relative url but the application hasn't finished loading FastBootInfo, see details at https://github.com/ember-cli/ember-fetch#relative-url\"\n );\n }\n // Old Prember version is not sending protocol\n const protocol = request.protocol === 'undefined:' ? 'http:' : request.protocol;\n return [request.get('host'), protocol];\n }\n\n function buildAbsoluteUrl(url: string) {\n if (protocolRelativeRegex.test(url)) {\n const [host] = parseRequest(REQUEST);\n url = host + url;\n } else if (!httpRegex.test(url)) {\n const [host, protocol] = parseRequest(REQUEST);\n url = protocol + '//' + host + url;\n }\n return url;\n }\n\n function patchedFetch(input: string | { href: string } | RequestInfo, options?: RequestInit) {\n if (input && typeof input === 'object' && 'href' in input) {\n const url = buildAbsoluteUrl(input.href);\n const info = Object.assign({}, input, { url }) as unknown as RequestInfo;\n return nodeFetch(info, options);\n } else if (typeof input === 'string') {\n const url = buildAbsoluteUrl(input);\n return nodeFetch(url, options);\n }\n\n return nodeFetch(input, options);\n }\n\n _fetch = () => patchedFetch;\n } catch {\n throw new Error(`Unable to create a compatible 'fetch' for FastBoot with node-fetch`);\n }\n }\n\n assert(`Cannot find a 'fetch' global and did not detect FastBoot.`, _fetch);\n\n return _fetch();\n}\n\nexport function setupFastboot(fastBootRequest: MockRequest): void {\n REQUEST = fastBootRequest;\n}\n","import type { Store } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { ModelSchema } from '@warp-drive/core/types';\n\nimport type { MinimumSerializerInterface, SerializerOptions } from '../../../compat.ts';\nimport { type Snapshot, upgradeStore } from '../../../compat/-private.ts';\n\ntype SerializerWithSerializeIntoHash = MinimumSerializerInterface & {\n serializeIntoHash?(hash: object, modelClass: ModelSchema, snapshot: Snapshot, options?: SerializerOptions): void;\n};\n\nexport function serializeIntoHash(\n store: Store,\n modelClass: ModelSchema,\n snapshot: Snapshot,\n options: { includeId?: boolean } = { includeId: true }\n): object {\n upgradeStore(store);\n const serializer: SerializerWithSerializeIntoHash | null = store.serializerFor(modelClass.modelName);\n\n assert(`Cannot serialize record, no serializer defined`, serializer);\n\n if (typeof serializer.serializeIntoHash === 'function') {\n const data = {};\n serializer.serializeIntoHash(data, modelClass, snapshot, options);\n return data;\n }\n\n return serializer.serialize(snapshot, options);\n}\n"],"mappings":";;;AAAA,MAAM,UAAU;AAEhB,SAAgB,qBAAqB,eAA+C;CAClF,MAAM,UAAU,OAAO,OAAO,IAAI;CAElC,IAAI,CAAC,eACH,OAAO;CAGT,MAAM,cAAwB,cAAc,MAAM,OAAO;CAEzD,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;EAC3C,MAAM,SAAS,YAAY;EAC3B,IAAI,IAAI;EACR,IAAI,WAAW;EAEf,OAAO,IAAI,OAAO,QAAQ,KACxB,IAAI,OAAO,WAAW,CAAC,MAAM,IAAc;GACzC,WAAW;GACX;EACF;EAGF,IAAI,aAAa,OACf;EAGF,MAAM,QAAQ,OAAO,UAAU,GAAG,CAAC,CAAC,CAAC,KAAK;EAC1C,MAAM,QAAQ,OAAO,UAAU,IAAI,GAAG,OAAO,MAAM,CAAC,CAAC,KAAK;EAE1D,IAAI,OAAO;GACT,MAAM,kBAAkB,MAAM,YAAY;GAE1C,QAAQ,mBAAmB;GAC3B,QAAQ,SAAS;EACnB;CACF;CAEA,OAAO;AACT;;;;;;;;;;ACjCA,SAAgB,iBAAoB,SAAiC;CACnE,OAAO,QAAQ,QAAQ,OAAO,CAAC,CAAC,OAAO,MAAM,CAAM;AACrD;;;;ACUA,SAASC,kBAAkBC,UAAoBC,aAAiCC,SAA2B;CACzG,IAAIC,MAAeD;CACnB,IAAIE,QAAsB;CAE1B,IAAI,CAACJ,SAASK,IACZ,OAAOH;CAGT,MAAMI,SAASN,SAASM;CACxB,MAAMC,iBAAiBL,YAAY,MAAMA,YAAY;CACrD,MAAMM,+BAA+BF,WAAW,O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;IAC7Cc,MAAMH,WAAW,OAAOK,OAAOF;GACjC;GACA,OAAOA;EACT;EAEA,SAASG,aAAaC,OAAgDC,SAAuB;GAC3F,IAAID,SAAS,OAAOA,UAAU,YAAY,UAAUA,OAAO;IACzD,MAAMJ,MAAMD,iBAAiBK,MAAME,IAAI;IACvC,MAAMC,OAAOC,OAAOC,OAAO,CAAC,GAAGL,OAAO,EAAEJ,IAAI,CAAC;IAC7C,OAAOV,UAAUiB,MAAMF,OAAO;GAChC,OAAO,IAAI,OAAOD,UAAU,UAAU;IACpC,MAAMJ,MAAMD,iBAAiBK,KAAK;IAClC,OAAOd,UAAUU,KAAKK,OAAO;GAC/B;GAEA,OAAOf,UAAUc,OAAOC,OAAO;EACjC;EAEApB,eAAekB;CACjB,QAAQ;EACN,MAAM,IAAIP,MAAM,oEAAoE;CACtF;CAKF,OAAOX,OAAO;AAChB;AAEA,SAAgByB,cAAcC,iBAAoC;CAChEzB,UAAUyB;AACZ;;;;ACjEA,SAAgBE,kBACdC,OACAC,YACAC,UACAC,UAAmC,EAAEC,WAAW,KAAK,GAC7C;CACRN,6BAAaE,KAAK;CAClB,MAAMK,aAAqDL,MAAMM,cAAcL,WAAWM,SAAS;CAInG,IAAI,OAAOF,WAAWN,sBAAsB,YAAY;EACtD,MAAMS,OAAO,CAAC;EACdH,WAAWN,kBAAkBS,MAAMP,YAAYC,UAAUC,OAAO;EAChE,OAAOK;CACT;CAEA,OAAOH,WAAWI,UAAUP,UAAUC,OAAO;AAC/C"}
1
+ {"version":3,"file":"-private-Dc9yg98O.js","names":["continueOnReject","_determineContent","response","requestData","payload","ret","error","ok","status","payloadIsEmpty","statusIndicatesEmptyResponse","method","JSON","parse","e","SyntaxError","determineBodyPromise","text","then","RBRACKET","isPlainObject","obj","Object","prototype","toString","call","isPrimitiveArray","Array","isArray","isParamsArray","buildParams","prefix","s","i","len","key","length","test","add","name","value","serializeQueryParams","queryParamsObject","join","k","v","undefined","encodeURIComponent","_fetch","REQUEST","getFetchFunction","fetch","FastBoot","nodeFetch","require","httpRegex","protocolRelativeRegex","parseRequest","request","Error","protocol","get","buildAbsoluteUrl","url","test","host","patchedFetch","input","options","href","info","Object","assign","setupFastboot","fastBootRequest","upgradeStore","serializeIntoHash","store","modelClass","snapshot","options","includeId","serializer","serializerFor","modelName","data","serialize"],"sources":["../../../src/adapter/-private/utils/parse-response-headers.ts","../../../src/adapter/-private/utils/continue-on-reject.ts","../../../src/adapter/-private/utils/determine-body-promise.ts","../../../src/adapter/-private/utils/serialize-query-params.ts","../../../src/adapter/-private/utils/fetch.ts","../../../src/adapter/-private/utils/serialize-into-hash.ts"],"sourcesContent":["const newline = /\\r?\\n/;\n\nexport function parseResponseHeaders(headersString: string): Record<string, string> {\n const headers = Object.create(null) as Record<string, string>;\n\n if (!headersString) {\n return headers;\n }\n\n const headerPairs: string[] = headersString.split(newline);\n\n for (let i = 0; i < headerPairs.length; i++) {\n const header = headerPairs[i];\n let j = 0;\n let foundSep = false;\n\n for (; j < header.length; j++) {\n if (header.charCodeAt(j) === 58 /* ':' */) {\n foundSep = true;\n break;\n }\n }\n\n if (foundSep === false) {\n continue;\n }\n\n const field = header.substring(0, j).trim();\n const value = header.substring(j + 1, header.length).trim();\n\n if (value) {\n const lowerCasedField = field.toLowerCase();\n\n headers[lowerCasedField] = value;\n headers[field] = value;\n }\n }\n\n return headers;\n}\n","/**\n * A utility function that returns a promise that resolves\n * even when the source promise rejects.\n *\n * @internal\n */\nexport function continueOnReject<T>(promise: Promise<T>): Promise<T> {\n return Promise.resolve(promise).catch((e) => e as T);\n}\n","import { warn } from '@ember/debug';\n\nimport { DEBUG } from '@warp-drive/core/build-config/env';\n\nimport type { RequestData } from '../../rest.ts';\nimport { continueOnReject } from './continue-on-reject.ts';\n\ntype Payload = Error | Record<string, unknown> | unknown[] | string | undefined;\n\ninterface CustomSyntaxError extends SyntaxError {\n payload: Payload;\n}\n\n/*\n * Function that always attempts to parse the response as json, and if an error is thrown,\n * returns `undefined` if the response is successful and has a status code of 204 (No Content),\n * or 205 (Reset Content) or if the request method was 'HEAD', and the plain payload otherwise.\n */\nfunction _determineContent(response: Response, requestData: JQueryAjaxSettings, payload: Payload): Payload {\n let ret: Payload = payload;\n let error: Error | null = null;\n\n if (!response.ok) {\n return payload;\n }\n\n const status = response.status;\n const payloadIsEmpty = payload === '' || payload === null;\n const statusIndicatesEmptyResponse = status === 204 || status === 205 || requestData.method === 'HEAD';\n\n if (DEBUG) {\n if (payloadIsEmpty && !statusIndicatesEmptyResponse) {\n const message = `The server returned an empty string for ${requestData.method} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n if (payload === '') {\n warn(message, {\n id: 'ds.adapter.returned-empty-string-as-JSON',\n });\n }\n }\n }\n\n if (response.ok && (statusIndicatesEmptyResponse || payloadIsEmpty)) {\n return;\n }\n\n try {\n ret = JSON.parse(payload as string) as Payload;\n } catch (e) {\n if (!(e instanceof SyntaxError)) {\n return e as Error;\n }\n (e as CustomSyntaxError).payload = payload;\n error = e;\n }\n\n if (error) {\n if (DEBUG) {\n // oxlint-disable-next-line no-console\n console.warn('This response was unable to be parsed as json.', payload);\n }\n return error;\n }\n\n return ret;\n}\n\nexport function determineBodyPromise(response: Response, requestData: RequestData): Promise<Payload> {\n // response.text() may resolve or reject\n // it is a native promise, may not have finally\n return continueOnReject(response.text()).then((payload) => _determineContent(response, requestData, payload));\n}\n","import { assert } from '@warp-drive/core/build-config/macros';\n\nconst RBRACKET = /\\[\\]$/;\n\ninterface PlainObject {\n [key: string]: string | PlainObject | PlainObject[] | string[];\n}\ntype ParamObject = { name: string; value: string };\n\nfunction isPlainObject<T>(obj: unknown): obj is T {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nfunction isPrimitiveArray(obj: unknown): obj is Array<PlainObject | string> {\n return Array.isArray(obj);\n}\n\nfunction isParamsArray(obj: unknown): obj is ParamObject[] {\n return Array.isArray(obj);\n}\n\nfunction buildParams<T extends PlainObject>(\n prefix: string,\n obj: ParamObject | ParamObject[] | Array<T | string> | T | string,\n s: string[]\n) {\n let i: number, len: number, key: keyof T & string;\n\n if (prefix) {\n if (isPrimitiveArray(obj)) {\n for (i = 0, len = obj.length; i < len; i++) {\n if (RBRACKET.test(prefix)) {\n add(s, prefix, obj[i] as string);\n } else {\n buildParams(prefix + '[' + (typeof obj[i] === 'object' && obj[i] !== null ? i : '') + ']', obj[i], s);\n }\n }\n } else if (isPlainObject<T>(obj)) {\n for (key in obj) {\n buildParams(prefix + '[' + key + ']', obj[key], s);\n }\n } else {\n assert(\n `query params cannot be a { name, value } pair if prefix is present`,\n obj === null || typeof obj !== 'object'\n );\n add(s, prefix, obj);\n }\n } else if (isParamsArray(obj)) {\n for (i = 0, len = obj.length; i < len; i++) {\n add(s, obj[i].name, obj[i].value);\n }\n } else {\n assert(`query params cannot be a string if no prefix is present`, typeof obj !== 'string');\n assert(`query params should not be an array if no prefix is present`, !Array.isArray(obj));\n assert(`query params should not be a { name, value } pair if no prefix is present`, isPlainObject<T>(obj));\n for (key in obj) {\n buildParams(key, obj[key], s);\n }\n }\n return s;\n}\n\n/*\n * Helper function that turns the data/body of a request into a query param string.\n * This is directly copied from jQuery.param.\n */\nexport function serializeQueryParams(queryParamsObject: PlainObject | string): string {\n return buildParams('', queryParamsObject, []).join('&');\n}\n\n/*\n * Part of the `serializeQueryParams` helper function.\n */\nfunction add(s: string[], k: string, v?: string | (() => string)) {\n // Strip out keys with undefined value and replace null values with\n // empty strings (mimics jQuery.ajax)\n if (v === undefined) {\n return;\n } else if (v === null) {\n v = '';\n }\n\n v = typeof v === 'function' ? v() : v;\n s[s.length] = `${encodeURIComponent(k)}=${encodeURIComponent(v)}`;\n}\n","import { assert } from '@warp-drive/core/build-config/macros';\n\ntype FetchFunction = (input: RequestInfo, init?: RequestInit) => Promise<Response>;\n\nlet _fetch: (() => FetchFunction) | null = null;\ntype MockRequest = { protocol?: string; get(key: string): string | undefined };\nlet REQUEST: MockRequest = null as unknown as MockRequest;\n\nexport function getFetchFunction(): FetchFunction {\n // return cached fetch function\n if (_fetch !== null) {\n return _fetch();\n }\n\n // grab browser native fetch if available, or global fetch if otherwise configured\n if (typeof fetch === 'function') {\n // fallback to using global fetch\n _fetch = () => fetch;\n\n /* global FastBoot */\n // grab fetch from node-fetch\n } else if (typeof FastBoot !== 'undefined') {\n try {\n const nodeFetch = FastBoot.require('node-fetch') as typeof fetch;\n\n const httpRegex = /^https?:\\/\\//;\n const protocolRelativeRegex = /^\\/\\//;\n\n function parseRequest(request: MockRequest) {\n if (request === null) {\n throw new Error(\n \"Trying to fetch with relative url but the application hasn't finished loading FastBootInfo, see details at https://github.com/ember-cli/ember-fetch#relative-url\"\n );\n }\n // Old Prember version is not sending protocol\n const protocol = request.protocol === 'undefined:' ? 'http:' : request.protocol;\n return [request.get('host'), protocol];\n }\n\n function buildAbsoluteUrl(url: string) {\n if (protocolRelativeRegex.test(url)) {\n const [host] = parseRequest(REQUEST);\n url = host + url;\n } else if (!httpRegex.test(url)) {\n const [host, protocol] = parseRequest(REQUEST);\n url = protocol + '//' + host + url;\n }\n return url;\n }\n\n function patchedFetch(input: string | { href: string } | RequestInfo, options?: RequestInit) {\n if (input && typeof input === 'object' && 'href' in input) {\n const url = buildAbsoluteUrl(input.href);\n const info = Object.assign({}, input, { url }) as unknown as RequestInfo;\n return nodeFetch(info, options);\n } else if (typeof input === 'string') {\n const url = buildAbsoluteUrl(input);\n return nodeFetch(url, options);\n }\n\n return nodeFetch(input, options);\n }\n\n _fetch = () => patchedFetch;\n } catch {\n throw new Error(`Unable to create a compatible 'fetch' for FastBoot with node-fetch`);\n }\n }\n\n assert(`Cannot find a 'fetch' global and did not detect FastBoot.`, _fetch);\n\n return _fetch();\n}\n\nexport function setupFastboot(fastBootRequest: MockRequest): void {\n REQUEST = fastBootRequest;\n}\n","import type { Store } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { ModelSchema } from '@warp-drive/core/types';\n\nimport type { MinimumSerializerInterface, SerializerOptions } from '../../../compat.ts';\nimport { type Snapshot, upgradeStore } from '../../../compat/-private.ts';\n\ntype SerializerWithSerializeIntoHash = MinimumSerializerInterface & {\n serializeIntoHash?(hash: object, modelClass: ModelSchema, snapshot: Snapshot, options?: SerializerOptions): void;\n};\n\nexport function serializeIntoHash(\n store: Store,\n modelClass: ModelSchema,\n snapshot: Snapshot,\n options: { includeId?: boolean } = { includeId: true }\n): object {\n upgradeStore(store);\n const serializer: SerializerWithSerializeIntoHash | null = store.serializerFor(modelClass.modelName);\n\n assert(`Cannot serialize record, no serializer defined`, serializer);\n\n if (typeof serializer.serializeIntoHash === 'function') {\n const data = {};\n serializer.serializeIntoHash(data, modelClass, snapshot, options);\n return data;\n }\n\n return serializer.serialize(snapshot, options);\n}\n"],"mappings":";;;AAAA,MAAM,UAAU;AAEhB,SAAgB,qBAAqB,eAA+C;CAClF,MAAM,UAAU,OAAO,OAAO,IAAI;CAElC,IAAI,CAAC,eACH,OAAO;CAGT,MAAM,cAAwB,cAAc,MAAM,OAAO;CAEzD,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;EAC3C,MAAM,SAAS,YAAY;EAC3B,IAAI,IAAI;EACR,IAAI,WAAW;EAEf,OAAO,IAAI,OAAO,QAAQ,KACxB,IAAI,OAAO,WAAW,CAAC,MAAM,IAAc;GACzC,WAAW;GACX;EACF;EAGF,IAAI,aAAa,OACf;EAGF,MAAM,QAAQ,OAAO,UAAU,GAAG,CAAC,CAAC,CAAC,KAAK;EAC1C,MAAM,QAAQ,OAAO,UAAU,IAAI,GAAG,OAAO,MAAM,CAAC,CAAC,KAAK;EAE1D,IAAI,OAAO;GACT,MAAM,kBAAkB,MAAM,YAAY;GAE1C,QAAQ,mBAAmB;GAC3B,QAAQ,SAAS;EACnB;CACF;CAEA,OAAO;AACT;;;;;;;;;ACjCA,SAAgB,iBAAoB,SAAiC;CACnE,OAAO,QAAQ,QAAQ,OAAO,CAAC,CAAC,OAAO,M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eferred } from "@warp-drive/core/request";
4
4
  import { getOrSetGlobal } from "@warp-drive/core/types/-private";
5
5
 
6
- //#region src/compat/legacy-network-handler/snapshot-record-array.ts
6
+ // src/compat/legacy-network-handler/snapshot-record-array.ts
7
7
  /**
8
8
  SnapshotRecordArray is not directly instantiable.
9
9
  Instances are provided to consuming application's
@@ -122,18 +122,15 @@ var SnapshotRecordArray = class {
122
122
  }
123
123
  };
124
124
 
125
- //#endregion
126
- //#region src/compat/legacy-network-handler/identifier-has-id.ts
125
+ // src/compat/legacy-network-handler/identifier-has-id.ts
127
126
  function assertIdentifierHasId(identifier) {}
128
127
 
129
- //#endregion
130
- //#region src/compat/legacy-network-handler/serializer-response.ts
128
+ // src/compat/legacy-network-handler/serializer-response.ts
131
129
  function normalizeResponseHelper(serializer, store, modelClass, payload, id, requestType) {
132
130
  return serializer ? serializer.normalizeResponse(store, modelClass, payload, id, requestType) : payload;
133
131
  }
134
132
 
135
- //#endregion
136
- //#region src/compat/legacy-network-handler/snapshot.ts
133
+ // src/compat/legacy-network-handler/snapshot.ts
137
134
  /**
138
135
  Snapshot is not directly instantiable.
139
136
  Instances are provided to a consuming application's
@@ -441,8 +438,7 @@ var Snapshot = class {
441
438
  }
442
439
  };
443
440
 
444
- //#endregion
445
- //#region src/compat/legacy-network-handler/fetch-manager.ts
441
+ // src/compat/legacy-network-handler/fetch-manager.ts
446
442
  const SaveOp = getOrSetGlobal("SaveOp", Symbol("SaveOp"));
447
443
  /**
448
444
  * @private
@@ -602,8 +598,8 @@ function _isLoading(cache, identifier) {
602
598
  function includesSatisfies(current, existing) {
603
599
  if (!current?.length) return true;
604
600
  if (!existing?.length) return false;
605
- const arrCurrent = (Array.isArray(current) ? current : current.split(",")).sort();
606
- const arrExisting = (Array.isArray(existing) ? existing : existing.split(",")).sort();
601
+ const arrCurrent = Array.isArray(current) ? current.toSorted() : current.split(",").sort();
602
+ const arrExisting = Array.isArray(existing) ? existing.toSorted() : existing.split(",").sort();
607
603
  if (arrCurrent.join(",") === arrExisting.join(",")) return true;
608
604
  for (let i = 0; i < arrCurrent.length; i++) if (!arrExisting.includes(arrCurrent[i])) return false;
609
605
  return true;
@@ -736,10 +732,8 @@ function _flushPendingSave(store, pending) {
736
732
  resolver.resolve(promise);
737
733
  }
738
734
 
739
- //#endregion
740
- //#region src/compat/-private.ts
735
+ // src/compat/-private.ts
741
736
  function upgradeStore(store) {}
742
737
 
743
- //#endregion
744
738
  export { normalizeResponseHelper as a, Snapshot as i, FetchManager as n, assertIdentifierHasId as o, SaveOp as r, SnapshotRecordArray as s, upgradeStore as t };
745
- //# sourceMappingURL=-private-SfXkkHKd.js.map
739
+ //# sourceMappingURL=-private-DuRzYAyW.js.map