@warp-drive/legacy 5.6.0-alpha.15 → 5.6.0-alpha.18

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 (193) hide show
  1. package/declarations/adapter/-private/build-url-mixin.d.ts +41 -29
  2. package/declarations/adapter/-private/fastboot-interface.d.ts +4 -5
  3. package/declarations/adapter/-private/utils/continue-on-reject.d.ts +5 -6
  4. package/declarations/adapter/-private/utils/determine-body-promise.d.ts +1 -2
  5. package/declarations/adapter/-private/utils/fetch.d.ts +2 -3
  6. package/declarations/adapter/-private/utils/parse-response-headers.d.ts +0 -1
  7. package/declarations/adapter/-private/utils/serialize-into-hash.d.ts +5 -6
  8. package/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -2
  9. package/declarations/adapter/-private.d.ts +5 -6
  10. package/declarations/adapter/error.d.ts +206 -178
  11. package/declarations/adapter/json-api.d.ts +206 -207
  12. package/declarations/adapter/rest.d.ts +805 -808
  13. package/declarations/adapter.d.ts +742 -766
  14. package/declarations/compat/-private.d.ts +10 -11
  15. package/declarations/compat/builders/find-all.d.ts +26 -24
  16. package/declarations/compat/builders/find-record.d.ts +41 -39
  17. package/declarations/compat/builders/query.d.ts +50 -45
  18. package/declarations/compat/builders/save-record.d.ts +26 -24
  19. package/declarations/compat/builders/utils.d.ts +1 -2
  20. package/declarations/compat/builders.d.ts +10 -11
  21. package/declarations/compat/extensions.d.ts +52 -106
  22. package/declarations/compat/legacy-network-handler/fetch-manager.d.ts +39 -38
  23. package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +1 -2
  24. package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +9 -10
  25. package/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +1 -2
  26. package/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +1 -2
  27. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +521 -517
  28. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +214 -215
  29. package/declarations/compat/legacy-network-handler/serializer-response.d.ts +5 -6
  30. package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +83 -84
  31. package/declarations/compat/legacy-network-handler/snapshot.d.ts +228 -229
  32. package/declarations/compat/utils.d.ts +118 -119
  33. package/declarations/compat.d.ts +106 -104
  34. package/declarations/model/-private/attr.d.ts +164 -145
  35. package/declarations/model/-private/belongs-to.d.ts +135 -122
  36. package/declarations/model/-private/debug/assert-polymorphic-type.d.ts +15 -4
  37. package/declarations/model/-private/errors.d.ts +272 -267
  38. package/declarations/model/-private/has-many.d.ts +119 -116
  39. package/declarations/model/-private/hooks.d.ts +5 -6
  40. package/declarations/model/-private/legacy-relationships-support.d.ts +51 -52
  41. package/declarations/model/-private/model-for-mixin.d.ts +18 -3
  42. package/declarations/model/-private/model-methods.d.ts +29 -24
  43. package/declarations/model/-private/model.d.ts +1306 -1254
  44. package/declarations/model/-private/notify-changes.d.ts +3 -4
  45. package/declarations/model/-private/promise-belongs-to.d.ts +33 -27
  46. package/declarations/model/-private/promise-many-array.d.ts +125 -116
  47. package/declarations/model/-private/record-state.d.ts +63 -60
  48. package/declarations/model/-private/references/belongs-to.d.ts +491 -487
  49. package/declarations/model/-private/references/has-many.d.ts +495 -492
  50. package/declarations/model/-private/schema-provider.d.ts +53 -56
  51. package/declarations/model/-private/type-utils.d.ts +41 -41
  52. package/declarations/model/-private/util.d.ts +1 -2
  53. package/declarations/model/-private.d.ts +8 -8
  54. package/declarations/model/migration-support.d.ts +281 -279
  55. package/declarations/model.d.ts +48 -49
  56. package/declarations/serializer/-private/embedded-records-mixin.d.ts +70 -71
  57. package/declarations/serializer/-private/transforms/boolean.d.ts +37 -37
  58. package/declarations/serializer/-private/transforms/date.d.ts +22 -22
  59. package/declarations/serializer/-private/transforms/number.d.ts +22 -22
  60. package/declarations/serializer/-private/transforms/string.d.ts +22 -22
  61. package/declarations/serializer/-private/transforms/transform.d.ts +109 -110
  62. package/declarations/serializer/-private/utils.d.ts +0 -1
  63. package/declarations/serializer/json-api.d.ts +124 -494
  64. package/declarations/serializer/json.d.ts +62 -1031
  65. package/declarations/serializer/rest.d.ts +52 -552
  66. package/declarations/serializer/transform.d.ts +5 -6
  67. package/declarations/serializer.d.ts +217 -218
  68. package/dist/{-private-DFfBszo5.js → -private-CKrP0ogQ.js} +1 -1
  69. package/dist/adapter/-private.js +1 -1
  70. package/dist/adapter/error.js +17 -0
  71. package/dist/adapter/json-api.js +1 -1
  72. package/dist/adapter/rest.js +5 -7
  73. package/dist/adapter.js +6 -35
  74. package/dist/compat/-private.js +1 -1
  75. package/dist/compat/extensions.js +0 -2
  76. package/dist/compat.js +3 -4
  77. package/dist/{errors-_QQ7xpSn.js → errors-BX5wowuz.js} +11 -10
  78. package/dist/{json-DSOlH9A8.js → json-Et4mt_LM.js} +84 -157
  79. package/dist/model/-private.js +1 -1
  80. package/dist/model/migration-support.js +3 -4
  81. package/dist/model.js +3 -3
  82. package/dist/{schema-provider-D_P8ReX6.js → schema-provider-BdQhkT-Q.js} +20 -13
  83. package/dist/{serialize-into-hash-BxfqWC8u.js → serialize-into-hash-Bp58npke.js} +1 -1
  84. package/dist/serializer/json-api.js +42 -2
  85. package/dist/serializer/json.js +1 -1
  86. package/dist/serializer/rest.js +46 -41
  87. package/dist/serializer/transform.js +0 -44
  88. package/package.json +7 -7
  89. package/declarations/adapter/-private/build-url-mixin.d.ts.map +0 -1
  90. package/declarations/adapter/-private/fastboot-interface.d.ts.map +0 -1
  91. package/declarations/adapter/-private/utils/continue-on-reject.d.ts.map +0 -1
  92. package/declarations/adapter/-private/utils/determine-body-promise.d.ts.map +0 -1
  93. package/declarations/adapter/-private/utils/fetch.d.ts.map +0 -1
  94. package/declarations/adapter/-private/utils/parse-response-headers.d.ts.map +0 -1
  95. package/declarations/adapter/-private/utils/serialize-into-hash.d.ts.map +0 -1
  96. package/declarations/adapter/-private/utils/serialize-query-params.d.ts.map +0 -1
  97. package/declarations/adapter/-private.d.ts.map +0 -1
  98. package/declarations/adapter/error.d.ts.map +0 -1
  99. package/declarations/adapter/json-api.d.ts.map +0 -1
  100. package/declarations/adapter/rest.d.ts.map +0 -1
  101. package/declarations/adapter.d.ts.map +0 -1
  102. package/declarations/compat/-private.d.ts.map +0 -1
  103. package/declarations/compat/builders/find-all.d.ts.map +0 -1
  104. package/declarations/compat/builders/find-record.d.ts.map +0 -1
  105. package/declarations/compat/builders/query.d.ts.map +0 -1
  106. package/declarations/compat/builders/save-record.d.ts.map +0 -1
  107. package/declarations/compat/builders/utils.d.ts.map +0 -1
  108. package/declarations/compat/builders.d.ts.map +0 -1
  109. package/declarations/compat/extensions.d.ts.map +0 -1
  110. package/declarations/compat/legacy-network-handler/fetch-manager.d.ts.map +0 -1
  111. package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts.map +0 -1
  112. package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts.map +0 -1
  113. package/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts.map +0 -1
  114. package/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts.map +0 -1
  115. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts.map +0 -1
  116. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts.map +0 -1
  117. package/declarations/compat/legacy-network-handler/serializer-response.d.ts.map +0 -1
  118. package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts.map +0 -1
  119. package/declarations/compat/legacy-network-handler/snapshot.d.ts.map +0 -1
  120. package/declarations/compat/utils.d.ts.map +0 -1
  121. package/declarations/compat.d.ts.map +0 -1
  122. package/declarations/model/-private/attr.d.ts.map +0 -1
  123. package/declarations/model/-private/attr.type-test.d.ts +0 -2
  124. package/declarations/model/-private/attr.type-test.d.ts.map +0 -1
  125. package/declarations/model/-private/belongs-to.d.ts.map +0 -1
  126. package/declarations/model/-private/belongs-to.type-test.d.ts +0 -2
  127. package/declarations/model/-private/belongs-to.type-test.d.ts.map +0 -1
  128. package/declarations/model/-private/debug/assert-polymorphic-type.d.ts.map +0 -1
  129. package/declarations/model/-private/errors.d.ts.map +0 -1
  130. package/declarations/model/-private/has-many.d.ts.map +0 -1
  131. package/declarations/model/-private/has-many.type-test.d.ts +0 -2
  132. package/declarations/model/-private/has-many.type-test.d.ts.map +0 -1
  133. package/declarations/model/-private/hooks.d.ts.map +0 -1
  134. package/declarations/model/-private/legacy-relationships-support.d.ts.map +0 -1
  135. package/declarations/model/-private/model-for-mixin.d.ts.map +0 -1
  136. package/declarations/model/-private/model-methods.d.ts.map +0 -1
  137. package/declarations/model/-private/model.d.ts.map +0 -1
  138. package/declarations/model/-private/model.type-test.d.ts +0 -2
  139. package/declarations/model/-private/model.type-test.d.ts.map +0 -1
  140. package/declarations/model/-private/notify-changes.d.ts.map +0 -1
  141. package/declarations/model/-private/promise-belongs-to.d.ts.map +0 -1
  142. package/declarations/model/-private/promise-many-array.d.ts.map +0 -1
  143. package/declarations/model/-private/promise-proxy-base.d.ts +0 -3
  144. package/declarations/model/-private/promise-proxy-base.d.ts.map +0 -1
  145. package/declarations/model/-private/record-state.d.ts.map +0 -1
  146. package/declarations/model/-private/references/belongs-to.d.ts.map +0 -1
  147. package/declarations/model/-private/references/has-many.d.ts.map +0 -1
  148. package/declarations/model/-private/schema-provider.d.ts.map +0 -1
  149. package/declarations/model/-private/type-utils.d.ts.map +0 -1
  150. package/declarations/model/-private/util.d.ts.map +0 -1
  151. package/declarations/model/-private.d.ts.map +0 -1
  152. package/declarations/model/migration-support.d.ts.map +0 -1
  153. package/declarations/model/migration-support.type-test.d.ts +0 -2
  154. package/declarations/model/migration-support.type-test.d.ts.map +0 -1
  155. package/declarations/model.d.ts.map +0 -1
  156. package/declarations/serializer/-private/embedded-records-mixin.d.ts.map +0 -1
  157. package/declarations/serializer/-private/transforms/boolean.d.ts.map +0 -1
  158. package/declarations/serializer/-private/transforms/boolean.type-test.d.ts +0 -2
  159. package/declarations/serializer/-private/transforms/boolean.type-test.d.ts.map +0 -1
  160. package/declarations/serializer/-private/transforms/date.d.ts.map +0 -1
  161. package/declarations/serializer/-private/transforms/number.d.ts.map +0 -1
  162. package/declarations/serializer/-private/transforms/string.d.ts.map +0 -1
  163. package/declarations/serializer/-private/transforms/transform.d.ts.map +0 -1
  164. package/declarations/serializer/-private/utils.d.ts.map +0 -1
  165. package/declarations/serializer/json-api.d.ts.map +0 -1
  166. package/declarations/serializer/json.d.ts.map +0 -1
  167. package/declarations/serializer/rest.d.ts.map +0 -1
  168. package/declarations/serializer/transform.d.ts.map +0 -1
  169. package/declarations/serializer.d.ts.map +0 -1
  170. package/dist/-private-DFfBszo5.js.map +0 -1
  171. package/dist/adapter/-private.js.map +0 -1
  172. package/dist/adapter/error.js.map +0 -1
  173. package/dist/adapter/json-api.js.map +0 -1
  174. package/dist/adapter/rest.js.map +0 -1
  175. package/dist/adapter.js.map +0 -1
  176. package/dist/compat/-private.js.map +0 -1
  177. package/dist/compat/builders.js.map +0 -1
  178. package/dist/compat/extensions.js.map +0 -1
  179. package/dist/compat/utils.js.map +0 -1
  180. package/dist/compat.js.map +0 -1
  181. package/dist/errors-_QQ7xpSn.js.map +0 -1
  182. package/dist/json-DSOlH9A8.js.map +0 -1
  183. package/dist/model/-private.js.map +0 -1
  184. package/dist/model/migration-support.js.map +0 -1
  185. package/dist/model.js.map +0 -1
  186. package/dist/runtime-BPCpkOf1-BKOwiRJp.js.map +0 -1
  187. package/dist/schema-provider-D_P8ReX6.js.map +0 -1
  188. package/dist/serialize-into-hash-BxfqWC8u.js.map +0 -1
  189. package/dist/serializer/json-api.js.map +0 -1
  190. package/dist/serializer/json.js.map +0 -1
  191. package/dist/serializer/rest.js.map +0 -1
  192. package/dist/serializer/transform.js.map +0 -1
  193. package/dist/serializer.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../../src/serializer/-private/transforms/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,qBAAa,aAAa;IACxB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAoBlF,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IASxE,CAAC,aAAa,CAAC,EAAG,MAAM,CAAU;IAElC,MAAM,CAAC,MAAM;CAGd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../../src/serializer/-private/transforms/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAM/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAe;IAC1B,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAU9G,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAU9G,CAAC,aAAa,CAAC,EAAG,QAAQ,CAAU;IAEpC,MAAM,CAAC,MAAM;CAGd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../src/serializer/-private/transforms/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAe;IAC1B,WAAW,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAGnF,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAInF,CAAC,aAAa,CAAC,EAAG,QAAQ,CAAU;IAEpC,MAAM,CAAC,MAAM;CAGd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../src/serializer/-private/transforms/transform.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH;;;;;;;;;;;;;;;;EAgBE;AACF;;;;;;;;;;;;;;;;EAgBE;AACF,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;IAC7E,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;CAChF;AACD,eAAO,MAAM,SAAS,oBAAc,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/serializer/-private/utils.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvE,wBAAgB,QAAQ,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAUrD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-api.d.ts","sourceRoot":"","sources":["../../src/ser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;IAruBx5rB;;;;;;;;;;;;;;;;;;;;;;;;MAwBE;;IAOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiEE;IAEF;;;;;;;;;;MAUE;2BANQ,KAAK;;IA8Cf;;;;;;;;;MASE;8BARQ,KAAK,qBACL,KAAK,oBAEL,eAAa;;IA2IvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8BE;uBAFQ,KAAK;IAkCf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwDE;;IAOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuJE;wBAHQ,QAAQ;IAQlB;;;;;;;;;;;;;;;;;;;;;;;;;MAyBE;4CAHQ,KAAK,YACL,QAAQ;IAQlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6CE;;IAKF;;;;;;;;;MASE;uCAHQ,QAAQ;IAgBlB;;;;;;;;;OASG;;EAkCF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/serializer/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GE;AAEF,OAAO,WAAW,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAO9G;;;;;;;;;;;;;;;;;;;;EAoBE;AAEF,qBAAa,UAAW,SAAQ,WAAW;IACxB,KAAK,EAAE,KAAK,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;MAoBE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiCE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuCE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;MAyBE;IACF,SAAS,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,sBAAsB,GAAG,qBAAqB;CAGlH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"-private-DFfBszo5.js","sources":["../src/compat/legacy-network-handler/snapshot-record-array.ts","../src/compat/legacy-network-handler/identifier-has-id.ts","../src/compat/legacy-network-handler/legacy-data-utils.ts","../src/compat/legacy-network-handler/serializer-response.ts","../src/compat/legacy-network-handler/snapshot.ts","../src/compat/legacy-network-handler/fetch-manager.ts","../src/compat/-private.ts"],"sourcesContent":["import type { Store } from '@warp-drive/core';\nimport type { LiveArray } from '@warp-drive/core/store/-private';\nimport { SOURCE } from '@warp-drive/core/store/-private';\nimport type { FindAllOptions, ModelSchema } from '@warp-drive/core/types';\nimport type { StableRecordIdentifier } from '@warp-drive/core/types/identifier';\n\nimport { upgradeStore } from '../-private.ts';\nimport type { Snapshot } from './snapshot.ts';\n/**\n SnapshotRecordArray is not directly instantiable.\n Instances are provided to consuming application's\n adapters for certain `findAll` requests.\n\n @class SnapshotRecordArray\n @public\n*/\nexport class SnapshotRecordArray {\n declare _snapshots: Snapshot[] | null;\n declare _type: ModelSchema | null;\n declare modelName: string;\n declare __store: Store;\n\n declare adapterOptions?: Record<string, unknown>;\n declare include?: string | string[];\n\n /**\n SnapshotRecordArray is not directly instantiable.\n Instances are provided to consuming application's\n adapters and serializers for certain requests.\n\n @private\n @constructor\n @param {Store} store\n @param {String} type\n @param options\n */\n constructor(store: Store, type: string, options: FindAllOptions = {}) {\n this.__store = store;\n /**\n An array of snapshots\n @private\n @property _snapshots\n @type {Array}\n */\n this._snapshots = null;\n\n /**\n The modelName of the underlying records for the snapshots in the array, as a Model\n @property modelName\n @public\n @type {Model}\n */\n this.modelName = type;\n\n /**\n A hash of adapter options passed into the store method for this request.\n\n Example\n\n ```js [app/adapters/post.js]\n import MyCustomAdapter from './custom-adapter';\n\n export default class PostAdapter extends MyCustomAdapter {\n findAll(store, type, sinceToken, snapshotRecordArray) {\n if (snapshotRecordArray.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n\n @property adapterOptions\n @public\n @type {Object}\n */\n this.adapterOptions = options.adapterOptions;\n\n /**\n The relationships to include for this request.\n\n Example\n\n ```js [app/adapters/application.js]\n import Adapter from '@ember-data/adapter';\n\n export default class ApplicationAdapter extends Adapter {\n findAll(store, type, snapshotRecordArray) {\n let url = `/${type.modelName}?include=${encodeURIComponent(snapshotRecordArray.include)}`;\n\n return fetch(url).then((response) => response.json())\n }\n }\n ```\n\n @property include\n @public\n @type {String|Array}\n */\n this.include = options.include;\n }\n\n /**\n An array of records\n\n @property _recordArray\n @private\n @type {Array}\n */\n get _recordArray(): LiveArray {\n return this.__store.peekAll(this.modelName);\n }\n\n /**\n Number of records in the array\n\n Example\n\n ```js [app/adapters/post.js]\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class PostAdapter extends JSONAPIAdapter {\n shouldReloadAll(store, snapshotRecordArray) {\n return !snapshotRecordArray.length;\n }\n });\n ```\n\n @property length\n @public\n @type {Number}\n */\n get length(): number {\n return this._recordArray.length;\n }\n\n /**\n Get snapshots of the underlying record array\n\n Example\n\n ```js [app/adapters/post.js]\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class PostAdapter extends JSONAPIAdapter {\n shouldReloadAll(store, snapshotArray) {\n let snapshots = snapshotArray.snapshots();\n\n return snapshots.any(function(ticketSnapshot) {\n let timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt'), 'minutes');\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n });\n }\n }\n ```\n\n @public\n @return {Array} Array of snapshots\n */\n snapshots() {\n if (this._snapshots !== null) {\n return this._snapshots;\n }\n upgradeStore(this.__store);\n\n const { _fetchManager } = this.__store;\n this._snapshots = this._recordArray[SOURCE].map((identifier: StableRecordIdentifier) =>\n _fetchManager.createSnapshot(identifier)\n );\n\n return this._snapshots;\n }\n}\n","import { assert } from '@warp-drive/core/build-config/macros';\nimport type { StableExistingRecordIdentifier } from '@warp-drive/core/types/identifier';\n\nexport function assertIdentifierHasId(identifier: unknown): asserts identifier is StableExistingRecordIdentifier {\n assert(\n `Attempted to schedule a fetch for a record without an id.`,\n identifier && (identifier as StableExistingRecordIdentifier).id !== null\n );\n}\n","import type { AdapterPayload } from './minimum-adapter-interface.ts';\n\ntype IteratorCB<T> = ((o: T, index: number) => T) | ((o: T) => T);\n\nexport function iterateData<T>(data: T[] | T, fn: IteratorCB<T>) {\n if (Array.isArray(data)) {\n return data.map(fn);\n } else {\n return fn(data, 0);\n }\n}\n\nexport function payloadIsNotBlank<T>(adapterPayload: T | AdapterPayload): adapterPayload is AdapterPayload {\n if (Array.isArray(adapterPayload)) {\n return true;\n } else {\n return Object.keys(adapterPayload || {}).length !== 0;\n }\n}\n","import type { Store } from '@warp-drive/core';\nimport { DEBUG } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { ModelSchema } from '@warp-drive/core/types';\nimport type { JsonApiDocument } from '@warp-drive/core/types/spec/json-api-raw';\n\nimport type { AdapterPayload } from './minimum-adapter-interface.ts';\nimport type { MinimumSerializerInterface, RequestType } from './minimum-serializer-interface.ts';\n\n/**\n This is a helper method that validates a JSON API top-level document\n\n The format of a document is described here:\n http://jsonapi.org/format/#document-top-level\n\n @internal\n*/\nfunction validateDocumentStructure(doc?: AdapterPayload | JsonApiDocument): asserts doc is JsonApiDocument {\n if (DEBUG) {\n const errors: string[] = [];\n if (!doc || typeof doc !== 'object') {\n errors.push('Top level of a JSON API document must be an object');\n } else {\n if (!('data' in doc) && !('errors' in doc) && !('meta' in doc)) {\n errors.push('One or more of the following keys must be present: \"data\", \"errors\", \"meta\".');\n } else {\n if ('data' in doc && 'errors' in doc) {\n errors.push('Top level keys \"errors\" and \"data\" cannot both be present in a JSON API document');\n }\n }\n if ('data' in doc) {\n if (!(doc.data === null || Array.isArray(doc.data) || typeof doc.data === 'object')) {\n errors.push('data must be null, an object, or an array');\n }\n }\n if ('meta' in doc) {\n if (typeof doc.meta !== 'object') {\n errors.push('meta must be an object');\n }\n }\n if ('errors' in doc) {\n if (!Array.isArray(doc.errors)) {\n errors.push('errors must be an array');\n }\n }\n if ('links' in doc) {\n if (typeof doc.links !== 'object') {\n errors.push('links must be an object');\n }\n }\n if ('jsonapi' in doc) {\n if (typeof doc.jsonapi !== 'object') {\n errors.push('jsonapi must be an object');\n }\n }\n if ('included' in doc) {\n if (typeof doc.included !== 'object') {\n errors.push('included must be an array');\n }\n }\n }\n\n assert(\n `Response must be normalized to a valid JSON API document:\\n\\t* ${errors.join('\\n\\t* ')}`,\n errors.length === 0\n );\n }\n}\n\nexport function normalizeResponseHelper(\n serializer: MinimumSerializerInterface | null,\n store: Store,\n modelClass: ModelSchema,\n payload: AdapterPayload,\n id: string | null,\n requestType: RequestType\n): JsonApiDocument {\n const normalizedResponse = serializer\n ? serializer.normalizeResponse(store, modelClass, payload, id, requestType)\n : payload;\n\n validateDocumentStructure(normalizedResponse);\n\n return normalizedResponse;\n}\n","import type { Store } from '@warp-drive/core';\nimport { DEBUG } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { FindRecordOptions } from '@warp-drive/core/types';\nimport type { ChangedAttributesHash } from '@warp-drive/core/types/cache';\nimport type { CollectionRelationship } from '@warp-drive/core/types/cache/relationship';\nimport type { StableRecordIdentifier } from '@warp-drive/core/types/identifier';\nimport type { Value } from '@warp-drive/core/types/json/raw';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport type { LegacyAttributeField, LegacyRelationshipField } from '@warp-drive/core/types/schema/fields';\n\nimport { upgradeStore } from '../-private';\nimport type { SerializerOptions } from './minimum-serializer-interface';\n\ntype RecordId = string | null;\n\n/**\n Snapshot is not directly instantiable.\n Instances are provided to a consuming application's\n adapters and serializers for certain requests.\n\n Snapshots are only available when using `@ember-data/legacy-compat`\n for legacy compatibility with adapters and serializers.\n\n @class Snapshot\n @public\n*/\nexport class Snapshot<R = unknown> {\n declare __attributes: Record<keyof R & string, unknown> | null;\n declare _belongsToRelationships: Record<string, Snapshot>;\n declare _belongsToIds: Record<string, RecordId>;\n declare _hasManyRelationships: Record<string, Snapshot[]>;\n declare _hasManyIds: Record<string, RecordId[]>;\n declare _changedAttributes: ChangedAttributesHash;\n\n declare identifier: StableRecordIdentifier<R extends TypedRecordInstance ? TypeFromInstance<R> : string>;\n declare modelName: R extends TypedRecordInstance ? TypeFromInstance<R> : string;\n declare id: string | null;\n declare include?: string | string[];\n declare adapterOptions?: Record<string, unknown>;\n declare _store: Store;\n\n /**\n * @constructor\n * @private\n * @param options\n * @param identifier\n * @param _store\n */\n constructor(\n options: FindRecordOptions,\n identifier: StableRecordIdentifier<R extends TypedRecordInstance ? TypeFromInstance<R> : string>,\n store: Store\n ) {\n this._store = store;\n\n this.__attributes = null;\n this._belongsToRelationships = Object.create(null) as Record<string, Snapshot>;\n this._belongsToIds = Object.create(null) as Record<string, RecordId>;\n this._hasManyRelationships = Object.create(null) as Record<string, Snapshot[]>;\n this._hasManyIds = Object.create(null) as Record<string, RecordId[]>;\n\n const hasRecord = !!store._instanceCache.peek(identifier);\n this.modelName = identifier.type;\n\n /**\n The unique RecordIdentifier associated with this Snapshot.\n\n @property identifier\n @public\n @type {StableRecordIdentifier}\n */\n this.identifier = identifier;\n\n /*\n If the we do not yet have a record, then we are\n likely a snapshot being provided to a find request, so we\n populate __attributes lazily. Else, to preserve the \"moment\n in time\" in which a snapshot is created, we greedily grab\n the values.\n */\n if (hasRecord) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n this._attributes;\n }\n\n /**\n The id of the snapshot's underlying record\n\n Example\n\n ```javascript\n // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n postSnapshot.id; // => '1'\n ```\n\n @property id\n @type {String}\n @public\n */\n this.id = identifier.id;\n\n /**\n A hash of adapter options\n @property adapterOptions\n @type {Object}\n @public\n */\n this.adapterOptions = options.adapterOptions;\n\n /**\n If `include` was passed to the options hash for the request, the value\n would be available here.\n\n @property include\n @type {String|Array}\n @public\n */\n this.include = options.include;\n\n /**\n The name of the type of the underlying record for this snapshot, as a string.\n\n @property modelName\n @type {String}\n @public\n */\n this.modelName = identifier.type;\n if (hasRecord) {\n const cache = this._store.cache;\n this._changedAttributes = cache.changedAttrs(identifier);\n }\n }\n\n /**\n The underlying record for this snapshot. Can be used to access methods and\n properties defined on the record.\n\n Example\n\n ```javascript\n let json = snapshot.record.toJSON();\n ```\n\n @property record\n @type {Model}\n @public\n */\n get record(): R | null {\n const record = this._store.peekRecord<R>(this.identifier);\n assert(\n `Record ${this.identifier.type} ${this.identifier.id} (${this.identifier.lid}) is not yet loaded and thus cannot be accessed from the Snapshot during serialization`,\n record !== null\n );\n return record;\n }\n\n get _attributes(): Record<keyof R & string, unknown> {\n if (this.__attributes !== null) {\n return this.__attributes;\n }\n const attributes = (this.__attributes = Object.create(null) as Record<string, unknown>);\n const { identifier } = this;\n const attrs = this._store.schema.fields(identifier);\n const cache = this._store.cache;\n\n attrs.forEach((field, keyName) => {\n if (field.kind === 'attribute') {\n attributes[keyName] = cache.getAttr(identifier, keyName);\n }\n });\n\n return attributes;\n }\n\n get isNew(): boolean {\n const cache = this._store.cache;\n return cache?.isNew(this.identifier) || false;\n }\n\n /**\n Returns the value of an attribute.\n\n Example\n\n ```javascript\n // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n postSnapshot.attr('author'); // => 'Tomster'\n postSnapshot.attr('title'); // => 'Ember.js rocks'\n ```\n\n Note: Values are loaded eagerly and cached when the snapshot is created.\n\n @param {String} keyName\n @return {Object} The attribute value or undefined\n @public\n */\n attr(keyName: keyof R & string): unknown {\n if (keyName in this._attributes) {\n return this._attributes[keyName];\n }\n assert(`Model '${this.identifier.lid}' has no attribute named '${keyName}' defined.`, false);\n }\n\n /**\n Returns all attributes and their corresponding values.\n\n Example\n\n ```javascript\n // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n postSnapshot.attributes(); // => { author: 'Tomster', title: 'Ember.js rocks' }\n ```\n\n @return {Object} All attributes of the current snapshot\n @public\n */\n attributes(): Record<keyof R & string, unknown> {\n return { ...this._attributes };\n }\n\n /**\n Returns all changed attributes and their old and new values.\n\n Example\n\n ```javascript\n // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n postModel.set('title', 'Ember.js rocks!');\n postSnapshot.changedAttributes(); // => { title: ['Ember.js rocks', 'Ember.js rocks!'] }\n ```\n\n @return {Object} All changed attributes of the current snapshot\n @public\n */\n changedAttributes(): ChangedAttributesHash {\n const changedAttributes = Object.create(null) as ChangedAttributesHash;\n if (!this._changedAttributes) {\n return changedAttributes;\n }\n\n const changedAttributeKeys = Object.keys(this._changedAttributes);\n\n for (let i = 0, length = changedAttributeKeys.length; i < length; i++) {\n const key = changedAttributeKeys[i];\n changedAttributes[key] = this._changedAttributes[key].slice() as [Value | undefined, Value];\n }\n\n return changedAttributes;\n }\n\n /**\n Returns the current value of a belongsTo relationship.\n\n `belongsTo` takes an optional hash of options as a second parameter,\n currently supported options are:\n\n - `id`: set to `true` if you only want the ID of the related record to be\n returned.\n\n Example\n\n ```javascript\n // store.push('post', { id: 1, title: 'Hello World' });\n // store.createRecord('comment', { body: 'Lorem ipsum', post: post });\n commentSnapshot.belongsTo('post'); // => Snapshot\n commentSnapshot.belongsTo('post', { id: true }); // => '1'\n\n // store.push('comment', { id: 1, body: 'Lorem ipsum' });\n commentSnapshot.belongsTo('post'); // => undefined\n ```\n\n Calling `belongsTo` will return a new Snapshot as long as there's any known\n data for the relationship available, such as an ID. If the relationship is\n known but unset, `belongsTo` will return `null`. If the contents of the\n relationship is unknown `belongsTo` will return `undefined`.\n\n Note: Relationships are loaded lazily and cached upon first access.\n\n @param {String} keyName\n @param {Object} [options]\n @public\n @return {(Snapshot|String|null|undefined)} A snapshot or ID of a known\n relationship or null if the relationship is known but unset. undefined\n will be returned if the contents of the relationship is unknown.\n */\n belongsTo(keyName: string, options?: { id?: boolean }): Snapshot | RecordId | undefined {\n const returnModeIsId = !!(options && options.id);\n let result: Snapshot | RecordId | undefined;\n const store = this._store;\n\n if (returnModeIsId === true && keyName in this._belongsToIds) {\n return this._belongsToIds[keyName];\n }\n\n if (returnModeIsId === false && keyName in this._belongsToRelationships) {\n return this._belongsToRelationships[keyName];\n }\n\n const relationshipMeta = store.schema.fields({ type: this.modelName }).get(keyName);\n assert(\n `Model '${this.identifier.lid}' has no belongsTo relationship named '${keyName}' defined.`,\n relationshipMeta && relationshipMeta.kind === 'belongsTo'\n );\n\n assert(`snapshot.belongsTo only supported when using a cache that supports the graph`, this._store._graph);\n\n const { identifier } = this;\n\n if (DEBUG) {\n const relationship = this._store.schema.fields(identifier)?.get(keyName);\n assert(\n `You looked up the ${keyName} belongsTo relationship for { type: ${identifier.type}, id: ${\n identifier.id || ''\n }, lid: ${identifier.lid} but no such relationship was found.`,\n relationship\n );\n assert(\n `You looked up the ${keyName} belongsTo relationship for { type: ${identifier.type}, id: ${\n identifier.id || ''\n }, lid: ${identifier.lid} but that relationship is a hasMany.`,\n relationship.kind === 'belongsTo'\n );\n }\n\n const value = this._store.cache.getRelationship(identifier, keyName);\n const data = value && value.data;\n upgradeStore(store);\n\n const inverseIdentifier = data ? store.identifierCache.getOrCreateRecordIdentifier(data) : null;\n\n if (value && value.data !== undefined) {\n const cache = store.cache;\n\n if (inverseIdentifier && !cache.isDeleted(inverseIdentifier)) {\n if (returnModeIsId) {\n result = inverseIdentifier.id;\n } else {\n result = store._fetchManager.createSnapshot(inverseIdentifier);\n }\n } else {\n result = null;\n }\n }\n\n if (returnModeIsId) {\n this._belongsToIds[keyName] = result as RecordId;\n } else {\n this._belongsToRelationships[keyName] = result as Snapshot;\n }\n\n return result;\n }\n\n /**\n Returns the current value of a hasMany relationship.\n\n `hasMany` takes an optional hash of options as a second parameter,\n currently supported options are:\n\n - `ids`: set to `true` if you only want the IDs of the related records to be\n returned.\n\n Example\n\n ```javascript\n // store.push('post', { id: 1, title: 'Hello World', comments: [2, 3] });\n postSnapshot.hasMany('comments'); // => [Snapshot, Snapshot]\n postSnapshot.hasMany('comments', { ids: true }); // => ['2', '3']\n\n // store.push('post', { id: 1, title: 'Hello World' });\n postSnapshot.hasMany('comments'); // => undefined\n ```\n\n Note: Relationships are loaded lazily and cached upon first access.\n\n @param {String} keyName\n @param {Object} [options]\n @public\n @return {(Array|undefined)} An array of snapshots or IDs of a known\n relationship or an empty array if the relationship is known but unset.\n undefined will be returned if the contents of the relationship is unknown.\n */\n hasMany(keyName: string, options?: { ids?: boolean }): RecordId[] | Snapshot[] | undefined {\n const returnModeIsIds = !!(options && options.ids);\n let results: RecordId[] | Snapshot[] | undefined;\n const cachedIds: RecordId[] | undefined = this._hasManyIds[keyName];\n const cachedSnapshots: Snapshot[] | undefined = this._hasManyRelationships[keyName];\n\n if (returnModeIsIds === true && keyName in this._hasManyIds) {\n return cachedIds;\n }\n\n if (returnModeIsIds === false && keyName in this._hasManyRelationships) {\n return cachedSnapshots;\n }\n\n const store = this._store;\n upgradeStore(store);\n const relationshipMeta = store.schema.fields({ type: this.modelName }).get(keyName);\n assert(\n `Model '${this.identifier.lid}' has no hasMany relationship named '${keyName}' defined.`,\n relationshipMeta && relationshipMeta.kind === 'hasMany'\n );\n\n // TODO @runspired it seems this code branch would not work with CUSTOM_MODEL_CLASSes\n // this check is not a regression in behavior because relationships don't currently\n // function without access to intimate API contracts between RecordData and Model.\n // This is a requirement we should fix as soon as the relationship layer does not require\n // this intimate API usage.\n assert(`snapshot.hasMany only supported when using a cache that supports the graph`, this._store._graph);\n\n const { identifier } = this;\n if (DEBUG) {\n const relationship = this._store.schema.fields(identifier)?.get(keyName);\n assert(\n `You looked up the ${keyName} hasMany relationship for { type: ${identifier.type}, id: ${\n identifier.id || ''\n }, lid: ${identifier.lid} but no such relationship was found.`,\n relationship\n );\n assert(\n `You looked up the ${keyName} hasMany relationship for { type: ${identifier.type}, id: ${\n identifier.id || ''\n }, lid: ${identifier.lid} but that relationship is a belongsTo.`,\n relationship.kind === 'hasMany'\n );\n }\n\n const value = this._store.cache.getRelationship(identifier, keyName) as CollectionRelationship;\n\n if (value.data) {\n results = [];\n value.data.forEach((member) => {\n const inverseIdentifier = store.identifierCache.getOrCreateRecordIdentifier(member);\n const cache = store.cache;\n\n if (!cache.isDeleted(inverseIdentifier)) {\n if (returnModeIsIds) {\n (results as RecordId[]).push(inverseIdentifier.id);\n } else {\n (results as Snapshot[]).push(store._fetchManager.createSnapshot(inverseIdentifier));\n }\n }\n });\n }\n\n // we assign even if `undefined` so that we don't reprocess the relationship\n // on next access. This works with the `keyName in` checks above.\n if (returnModeIsIds) {\n this._hasManyIds[keyName] = results as RecordId[];\n } else {\n this._hasManyRelationships[keyName] = results as Snapshot[];\n }\n\n return results;\n }\n\n /**\n Iterates through all the attributes of the model, calling the passed\n function on each attribute.\n\n Example\n\n ```javascript\n snapshot.eachAttribute(function(name, meta) {\n // ...\n });\n ```\n\n @param {Function} callback the callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @public\n */\n eachAttribute(callback: (key: string, meta: LegacyAttributeField) => void, binding?: unknown): void {\n const fields = this._store.schema.fields(this.identifier);\n fields.forEach((field, key) => {\n if (field.kind === 'attribute') {\n callback.call(binding, key, field);\n }\n });\n }\n\n /**\n Iterates through all the relationships of the model, calling the passed\n function on each relationship.\n\n Example\n\n ```javascript\n snapshot.eachRelationship(function(name, relationship) {\n // ...\n });\n ```\n\n @param {Function} callback the callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @public\n */\n eachRelationship(callback: (key: string, meta: LegacyRelationshipField) => void, binding?: unknown): void {\n const fields = this._store.schema.fields(this.identifier);\n fields.forEach((field, key) => {\n if (field.kind === 'belongsTo' || field.kind === 'hasMany') {\n callback.call(binding, key, field);\n }\n });\n }\n\n /**\n Serializes the snapshot using the serializer for the model.\n\n Example\n\n ```js [app/adapters/application.js]\n import Adapter from '@ember-data/adapter';\n\n export default Adapter.extend({\n createRecord(store, type, snapshot) {\n let data = snapshot.serialize({ includeId: true });\n let url = `/${type.modelName}`;\n\n return fetch(url, {\n method: 'POST',\n body: data,\n }).then((response) => response.json())\n }\n });\n ```\n\n @param {Object} options\n @return {Object} an object whose values are primitive JSON values only\n @public\n */\n serialize(options?: SerializerOptions): unknown {\n upgradeStore(this._store);\n const serializer = this._store.serializerFor(this.modelName);\n assert(`Cannot serialize record, no serializer found`, serializer);\n return serializer.serialize(this, options);\n }\n}\n","import { warn } from '@ember/debug';\n\nimport type { Store } from '@warp-drive/core';\nimport { DEBUG, TESTING } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport { createDeferred } from '@warp-drive/core/request';\nimport type {\n FindRecordQuery,\n InstanceCache,\n Request,\n RequestStateService,\n SaveRecordMutation,\n} from '@warp-drive/core/store/-private';\nimport { coerceId, waitFor } from '@warp-drive/core/store/-private';\nimport type { FindRecordOptions, ModelSchema } from '@warp-drive/core/types';\nimport { getOrSetGlobal } from '@warp-drive/core/types/-private';\nimport type { StableExistingRecordIdentifier, StableRecordIdentifier } from '@warp-drive/core/types/identifier';\nimport type { TypeFromInstance } from '@warp-drive/core/types/record';\nimport type { ImmutableRequestInfo } from '@warp-drive/core/types/request';\nimport type { CollectionResourceDocument, SingleResourceDocument } from '@warp-drive/core/types/spec/json-api-raw';\n\nimport { upgradeStore } from '../-private.ts';\nimport { assertIdentifierHasId } from './identifier-has-id.ts';\nimport { payloadIsNotBlank } from './legacy-data-utils.ts';\nimport type { AdapterPayload, MinimumAdapterInterface } from './minimum-adapter-interface.ts';\nimport type { MinimumSerializerInterface } from './minimum-serializer-interface.ts';\nimport { normalizeResponseHelper } from './serializer-response.ts';\nimport { Snapshot } from './snapshot.ts';\n\ntype Deferred<T> = ReturnType<typeof createDeferred<T>>;\ntype AdapterErrors = Error & { errors?: string[]; isAdapterError?: true };\ntype SerializerWithParseErrors = MinimumSerializerInterface & {\n extractErrors?(store: Store, modelClass: ModelSchema, error: AdapterErrors, recordId: string | null): unknown;\n};\n\nexport const SaveOp = getOrSetGlobal('SaveOp', Symbol('SaveOp'));\n\nexport type FetchMutationOptions = FindRecordOptions & { [SaveOp]: 'createRecord' | 'deleteRecord' | 'updateRecord' };\n\ninterface PendingFetchItem {\n identifier: StableExistingRecordIdentifier;\n queryRequest: Request;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n resolver: Deferred<any>;\n options: FindRecordOptions;\n trace?: unknown;\n promise: Promise<StableExistingRecordIdentifier>;\n}\n\ninterface PendingSaveItem {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n resolver: Deferred<any>;\n snapshot: Snapshot;\n identifier: StableRecordIdentifier;\n options: FetchMutationOptions;\n queryRequest: Request;\n}\n\nexport class FetchManager {\n declare isDestroyed: boolean;\n declare requestCache: RequestStateService;\n // fetches pending in the runloop, waiting to be coalesced\n declare _pendingFetch: Map<string, Map<StableExistingRecordIdentifier, PendingFetchItem[]>>;\n declare _store: Store;\n\n constructor(store: Store) {\n this._store = store;\n // used to keep track of all the find requests that need to be coalesced\n this._pendingFetch = new Map();\n this.requestCache = store.getRequestStateService();\n this.isDestroyed = false;\n }\n\n createSnapshot<T>(identifier: StableRecordIdentifier<TypeFromInstance<T>>, options?: FindRecordOptions): Snapshot<T>;\n createSnapshot(identifier: StableRecordIdentifier, options?: FindRecordOptions): Snapshot;\n createSnapshot(identifier: StableRecordIdentifier, options: FindRecordOptions = {}): Snapshot {\n return new Snapshot(options, identifier, this._store);\n }\n\n /**\n This method is called by `record.save`, and gets passed a\n resolver for the promise that `record.save` returns.\n\n It schedules saving to happen at the end of the run loop.\n\n @internal\n */\n scheduleSave(\n identifier: StableRecordIdentifier,\n options: FetchMutationOptions\n ): Promise<null | SingleResourceDocument> {\n const resolver = createDeferred<SingleResourceDocument | null>();\n const query: SaveRecordMutation = {\n op: 'saveRecord',\n recordIdentifier: identifier,\n options,\n };\n\n const queryRequest: Request = {\n data: [query],\n };\n\n const snapshot = this.createSnapshot(identifier, options);\n const pendingSaveItem: PendingSaveItem = {\n snapshot: snapshot,\n resolver: resolver,\n identifier,\n options,\n queryRequest,\n };\n\n const monitored = this.requestCache._enqueue(resolver.promise, pendingSaveItem.queryRequest);\n _flushPendingSave(this._store, pendingSaveItem);\n\n return monitored;\n }\n\n scheduleFetch(\n identifier: StableExistingRecordIdentifier,\n options: FindRecordOptions,\n request: ImmutableRequestInfo\n ): Promise<StableExistingRecordIdentifier> {\n const query: FindRecordQuery = {\n op: 'findRecord',\n recordIdentifier: identifier,\n options,\n };\n\n const queryRequest: Request = {\n data: [query],\n };\n\n const pendingFetch = this.getPendingFetch(identifier, options);\n if (pendingFetch) {\n return pendingFetch;\n }\n\n const modelName = identifier.type;\n\n const resolver = createDeferred<SingleResourceDocument>();\n const pendingFetchItem: PendingFetchItem = {\n identifier,\n resolver,\n options,\n queryRequest,\n } as PendingFetchItem;\n\n const resolverPromise = resolver.promise;\n const store = this._store;\n const isInitialLoad = !store._instanceCache.recordIsLoaded(identifier); // we don't use isLoading directly because we are the request\n\n const monitored = this.requestCache._enqueue(resolverPromise, pendingFetchItem.queryRequest);\n let promise = monitored.then(\n (payload) => {\n // ensure that regardless of id returned we assign to the correct record\n if (payload.data && !Array.isArray(payload.data)) {\n payload.data.lid = identifier.lid;\n }\n\n // additional data received in the payload\n // may result in the merging of identifiers (and thus records)\n const potentiallyNewIm = store._push(payload, options.reload);\n if (potentiallyNewIm && !Array.isArray(potentiallyNewIm)) {\n return potentiallyNewIm;\n }\n\n return identifier;\n },\n (error) => {\n assert(`Async Leak Detected: Expected the store to not be destroyed`, !store.isDestroyed);\n const cache = store.cache;\n if (!cache || cache.isEmpty(identifier) || isInitialLoad) {\n let isReleasable = true;\n if (store._graph) {\n const graph = store._graph;\n if (!cache) {\n isReleasable = graph.isReleasable(identifier);\n if (!isReleasable) {\n graph.unload(identifier, true);\n }\n }\n }\n if (cache || isReleasable) {\n store._enableAsyncFlush = true;\n store._instanceCache.unloadRecord(identifier);\n store._enableAsyncFlush = null;\n }\n }\n throw error;\n }\n );\n\n if (this._pendingFetch.size === 0) {\n void new Promise((resolve) => setTimeout(resolve, 0)).then(() => {\n this.flushAllPendingFetches();\n });\n }\n\n const fetchesByType = this._pendingFetch;\n let fetchesById = fetchesByType.get(modelName);\n\n if (!fetchesById) {\n fetchesById = new Map();\n fetchesByType.set(modelName, fetchesById);\n }\n\n let requestsForIdentifier = fetchesById.get(identifier);\n if (!requestsForIdentifier) {\n requestsForIdentifier = [];\n fetchesById.set(identifier, requestsForIdentifier);\n }\n\n requestsForIdentifier.push(pendingFetchItem);\n\n if (TESTING) {\n if (!request.disableTestWaiter) {\n promise = waitFor(promise);\n }\n }\n\n pendingFetchItem.promise = promise;\n return promise;\n }\n\n getPendingFetch(identifier: StableExistingRecordIdentifier, options: FindRecordOptions) {\n const pendingFetches = this._pendingFetch.get(identifier.type)?.get(identifier);\n\n // We already have a pending fetch for this\n if (pendingFetches) {\n const matchingPendingFetch = pendingFetches.find((fetch) => isSameRequest(options, fetch.options));\n if (matchingPendingFetch) {\n return matchingPendingFetch.promise;\n }\n }\n }\n\n flushAllPendingFetches() {\n if (this.isDestroyed) {\n return;\n }\n\n const store = this._store;\n this._pendingFetch.forEach((fetchItem, type) => _flushPendingFetchForType(store, fetchItem, type));\n this._pendingFetch.clear();\n }\n\n fetchDataIfNeededForIdentifier(\n identifier: StableExistingRecordIdentifier,\n options: FindRecordOptions = {},\n request: ImmutableRequestInfo\n ): Promise<StableExistingRecordIdentifier> {\n // pre-loading will change the isEmpty value\n const isEmpty = _isEmpty(this._store._instanceCache, identifier);\n const isLoading = _isLoading(this._store._instanceCache, identifier);\n\n let promise: Promise<StableExistingRecordIdentifier>;\n if (isEmpty) {\n assertIdentifierHasId(identifier);\n\n if (DEBUG) {\n promise = this.scheduleFetch(identifier, Object.assign({}, options, { reload: true }), request);\n } else {\n options.reload = true;\n promise = this.scheduleFetch(identifier, options, request);\n }\n } else if (isLoading) {\n promise = this.getPendingFetch(identifier, options)!;\n assert(`Expected to find a pending request for a record in the loading state, but found none`, promise);\n } else {\n promise = Promise.resolve(identifier);\n }\n\n return promise;\n }\n\n destroy() {\n this.isDestroyed = true;\n }\n}\n\nfunction _isEmpty(instanceCache: InstanceCache, identifier: StableRecordIdentifier): boolean {\n const cache = instanceCache.cache;\n if (!cache) {\n return true;\n }\n const isNew = cache.isNew(identifier);\n const isDeleted = cache.isDeleted(identifier);\n const isEmpty = cache.isEmpty(identifier);\n\n return (!isNew || isDeleted) && isEmpty;\n}\n\nfunction _isLoading(cache: InstanceCache, identifier: StableRecordIdentifier): boolean {\n const req = cache.store.getRequestStateService();\n // const fulfilled = req.getLastRequestForRecord(identifier);\n const isLoaded = cache.recordIsLoaded(identifier);\n\n return (\n !isLoaded &&\n // fulfilled === null &&\n req.getPendingRequestsForRecord(identifier).some((r) => r.type === 'query')\n );\n}\n\nfunction includesSatisfies(current: undefined | string | string[], existing: undefined | string | string[]): boolean {\n // if we have no includes we are good\n if (!current?.length) {\n return true;\n }\n\n // if we are here we have includes,\n // and if existing has no includes then we will need a new request\n if (!existing?.length) {\n return false;\n }\n\n const arrCurrent = (Array.isArray(current) ? current : current.split(',')).sort();\n const arrExisting = (Array.isArray(existing) ? existing : existing.split(',')).sort();\n\n // includes are identical\n if (arrCurrent.join(',') === arrExisting.join(',')) {\n return true;\n }\n\n // if all of current includes are in existing includes then we are good\n // so if we find one that is not in existing then we need a new request\n for (let i = 0; i < arrCurrent.length; i++) {\n if (!arrExisting.includes(arrCurrent[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction optionsSatisfies(current: object | undefined, existing: object | undefined): boolean {\n return !current || current === existing || Object.keys(current).length === 0;\n}\n\n// this function helps resolve whether we have a pending request that we should use instead\nfunction isSameRequest(options: FindRecordOptions = {}, existingOptions: FindRecordOptions = {}) {\n return (\n optionsSatisfies(options.adapterOptions, existingOptions.adapterOptions) &&\n includesSatisfies(options.include, existingOptions.include)\n );\n}\n\nfunction _findMany(\n store: Store,\n adapter: MinimumAdapterInterface,\n modelName: string,\n snapshots: Snapshot[]\n): Promise<CollectionResourceDocument> {\n const modelClass = store.modelFor(modelName); // `adapter.findMany` gets the modelClass still\n const promise = Promise.resolve().then(() => {\n const ids = snapshots.map((s) => s.id!);\n assert(\n `Cannot fetch a record without an id`,\n ids.every((v) => v !== null)\n );\n // eslint-disable-next-line @typescript-eslint/unbound-method\n assert(`Expected this adapter to implement findMany for coalescing`, adapter.findMany);\n const ret = adapter.findMany(store, modelClass, ids, snapshots);\n assert('adapter.findMany returned undefined, this was very likely a mistake', ret !== undefined);\n return ret;\n });\n upgradeStore(store);\n\n return promise.then((adapterPayload) => {\n assert(\n `You made a 'findMany' request for '${modelName}' records with ids '[${snapshots\n .map((s) => s.id!)\n .join(',')}]', but the adapter's response did not have any data`,\n !!payloadIsNotBlank(adapterPayload)\n );\n const serializer = store.serializerFor(modelName);\n const payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findMany');\n return payload as CollectionResourceDocument;\n });\n}\n\nfunction rejectFetchedItems(fetchMap: Map<Snapshot, PendingFetchItem>, snapshots: Snapshot[], error?: Error) {\n for (let i = 0, l = snapshots.length; i < l; i++) {\n const snapshot = snapshots[i];\n const pair = fetchMap.get(snapshot);\n\n if (pair) {\n pair.resolver.reject(\n error ||\n new Error(\n `Expected: '<${\n snapshot.modelName\n }:${snapshot.id!}>' to be present in the adapter provided payload, but it was not found.`\n )\n );\n }\n }\n}\n\nfunction handleFoundRecords(\n store: Store,\n fetchMap: Map<Snapshot, PendingFetchItem>,\n snapshots: Snapshot[],\n coalescedPayload: CollectionResourceDocument\n) {\n /*\n It is possible that the same ID is included multiple times\n via multiple snapshots. This happens when more than one\n options hash was supplied, each of which must be uniquely\n accounted for.\n\n However, since we can't map from response to a specific\n options object, we resolve all snapshots by id with\n the first response we see.\n */\n const snapshotsById = new Map<string, Snapshot[]>();\n for (let i = 0; i < snapshots.length; i++) {\n const id = snapshots[i].id!;\n let snapshotGroup = snapshotsById.get(id);\n if (!snapshotGroup) {\n snapshotGroup = [];\n snapshotsById.set(id, snapshotGroup);\n }\n snapshotGroup.push(snapshots[i]);\n }\n\n const included = Array.isArray(coalescedPayload.included) ? coalescedPayload.included : [];\n\n // resolve found records\n const resources = coalescedPayload.data;\n for (let i = 0, l = resources.length; i < l; i++) {\n const resource = resources[i];\n const snapshotGroup = snapshotsById.get(resource.id);\n snapshotsById.delete(resource.id);\n\n if (!snapshotGroup) {\n // TODO consider whether this should be a deprecation/assertion\n included.push(resource);\n } else {\n snapshotGroup.forEach((snapshot) => {\n const pair = fetchMap.get(snapshot)!;\n const resolver = pair.resolver;\n resolver.resolve({ data: resource });\n });\n }\n }\n\n if (included.length > 0) {\n store._push({ data: null, included }, true);\n }\n\n if (snapshotsById.size === 0) {\n return;\n }\n\n // reject missing records\n const rejected: Snapshot[] = [];\n snapshotsById.forEach((snapshotArray) => {\n rejected.push(...snapshotArray);\n });\n warn(\n 'Ember Data expected to find records with the following ids in the adapter response from findMany but they were missing: [ \"' +\n [...snapshotsById.values()].map((r) => r[0].id).join('\", \"') +\n '\" ]',\n {\n id: 'ds.store.missing-records-from-adapter',\n }\n );\n\n rejectFetchedItems(fetchMap, rejected);\n}\n\nfunction _fetchRecord(store: Store, adapter: MinimumAdapterInterface, fetchItem: PendingFetchItem) {\n upgradeStore(store);\n const identifier = fetchItem.identifier;\n const modelName = identifier.type;\n\n assert(`You tried to find a record but you have no adapter (for ${modelName})`, adapter);\n assert(\n `You tried to find a record but your adapter (for ${modelName}) does not implement 'findRecord'`,\n typeof adapter.findRecord === 'function'\n );\n\n const snapshot = store._fetchManager.createSnapshot(identifier, fetchItem.options);\n const klass = store.modelFor(identifier.type);\n const id = identifier.id;\n\n let promise = Promise.resolve().then(() => {\n return adapter.findRecord(store, klass, identifier.id, snapshot);\n });\n\n promise = promise.then((adapterPayload) => {\n assert(`Async Leak Detected: Expected the store to not be destroyed`, !(store.isDestroyed || store.isDestroying));\n assert(\n `You made a 'findRecord' request for a '${modelName}' with id '${id}', but the adapter's response did not have any data`,\n !!payloadIsNotBlank(adapterPayload)\n );\n const serializer = store.serializerFor(modelName);\n const payload = normalizeResponseHelper(serializer, store, klass, adapterPayload, id, 'findRecord');\n assert(\n `Ember Data expected the primary data returned from a 'findRecord' response to be an object but instead it found an array.`,\n !Array.isArray(payload.data)\n );\n assert(\n `The 'findRecord' request for ${modelName}:${id} resolved indicating success but contained no primary data. To indicate a 404 not found you should either reject the promise returned by the adapter's findRecord method or throw a NotFoundError.`,\n 'data' in payload && payload.data !== null && typeof payload.data === 'object'\n );\n\n warn(\n `You requested a record of type '${modelName}' with id '${id}' but the adapter returned a payload with primary data having an id of '${payload.data.id}'. Use 'store.findRecord()' when the requested id is the same as the one returned by the adapter. In other cases use 'store.queryRecord()' instead.`,\n coerceId(payload.data.id) === coerceId(id),\n {\n id: 'ds.store.findRecord.id-mismatch',\n }\n );\n\n return payload;\n }) as Promise<AdapterPayload>;\n\n fetchItem.resolver.resolve(promise);\n}\n\nfunction _processCoalescedGroup(\n store: Store,\n fetchMap: Map<Snapshot, PendingFetchItem>,\n group: Snapshot[],\n adapter: MinimumAdapterInterface,\n modelName: string\n) {\n if (group.length > 1) {\n _findMany(store, adapter, modelName, group)\n .then((payloads: CollectionResourceDocument) => {\n handleFoundRecords(store, fetchMap, group, payloads);\n })\n .catch((error: Error) => {\n rejectFetchedItems(fetchMap, group, error);\n });\n } else if (group.length === 1) {\n _fetchRecord(store, adapter, fetchMap.get(group[0])!);\n } else {\n assert(\"You cannot return an empty array from adapter's method groupRecordsForFindMany\", false);\n }\n}\n\nfunction _flushPendingFetchForType(\n store: Store,\n pendingFetchMap: Map<StableExistingRecordIdentifier, PendingFetchItem[]>,\n modelName: string\n) {\n upgradeStore(store);\n const adapter = store.adapterFor(modelName);\n const shouldCoalesce = !!adapter.findMany && adapter.coalesceFindRequests;\n\n if (shouldCoalesce) {\n const pendingFetchItems: PendingFetchItem[] = [];\n pendingFetchMap.forEach((requestsForIdentifier, identifier) => {\n if (requestsForIdentifier.length > 1) {\n return;\n }\n\n // remove this entry from the map so it's not processed again\n pendingFetchMap.delete(identifier);\n pendingFetchItems.push(requestsForIdentifier[0]);\n });\n\n const totalItems = pendingFetchItems.length;\n\n if (totalItems > 1) {\n const snapshots = new Array<Snapshot>(totalItems);\n const fetchMap = new Map<Snapshot, PendingFetchItem>();\n for (let i = 0; i < totalItems; i++) {\n const fetchItem = pendingFetchItems[i];\n snapshots[i] = store._fetchManager.createSnapshot(fetchItem.identifier, fetchItem.options);\n fetchMap.set(snapshots[i], fetchItem);\n }\n\n let groups: Snapshot[][];\n if (adapter.groupRecordsForFindMany) {\n groups = adapter.groupRecordsForFindMany(store, snapshots);\n } else {\n groups = [snapshots];\n }\n\n for (let i = 0, l = groups.length; i < l; i++) {\n _processCoalescedGroup(store, fetchMap, groups[i], adapter, modelName);\n }\n } else if (totalItems === 1) {\n _fetchRecord(store, adapter, pendingFetchItems[0]);\n }\n }\n\n pendingFetchMap.forEach((pendingFetchItems) => {\n pendingFetchItems.forEach((pendingFetchItem) => {\n _fetchRecord(store, adapter, pendingFetchItem);\n });\n });\n}\n\nfunction _flushPendingSave(store: Store, pending: PendingSaveItem) {\n const { snapshot, resolver, identifier, options } = pending;\n upgradeStore(store);\n const adapter = store.adapterFor(identifier.type);\n const operation = options[SaveOp];\n\n const modelName = snapshot.modelName;\n const modelClass = store.modelFor(modelName);\n\n assert(`You tried to update a record but you have no adapter (for ${modelName})`, adapter);\n assert(\n `You tried to update a record but your adapter (for ${modelName}) does not implement '${operation}'`,\n typeof adapter[operation] === 'function'\n );\n\n let promise: Promise<AdapterPayload> = Promise.resolve().then(() => adapter[operation](store, modelClass, snapshot));\n const serializer: SerializerWithParseErrors | null = store.serializerFor(modelName);\n\n assert(\n `Your adapter's '${operation}' method must return a value, but it returned 'undefined'`,\n promise !== undefined\n );\n\n promise = promise.then((adapterPayload) => {\n if (adapterPayload) {\n return normalizeResponseHelper(serializer, store, modelClass, adapterPayload, snapshot.id, operation);\n }\n }) as Promise<AdapterPayload>;\n\n resolver.resolve(promise);\n}\n","import type { Store } from '@warp-drive/core';\n\nimport type { CompatStore } from '../compat.ts';\n\n/**\n * Utilities - often temporary - for maintaining backwards compatibility with\n * older parts of EmberData.\n *\n @module\n*/\nexport { SnapshotRecordArray } from './legacy-network-handler/snapshot-record-array.ts';\nexport { SaveOp } from './legacy-network-handler/fetch-manager.ts';\nexport { FetchManager } from './legacy-network-handler/fetch-manager.ts';\nexport { Snapshot } from './legacy-network-handler/snapshot.ts';\n\nexport function upgradeStore(store: Store): asserts store is CompatStore {}\n"],"names":["SnapshotRecordArray","constructor","store","type","options","__store","_snapshots","modelName","adapterOptions","include","_recordArray","peekAll","length","snapshots","upgradeStore","_fetchManager","SOURCE","map","identifier","createSnapshot","assertIdentifierHasId","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","id","iterateData","data","fn","Array","isArray","payloadIsNotBlank","adapterPayload","Object","keys","validateDocumentStructure","doc","errors","push","meta","links","jsonapi","included","join","normalizeResponseHelper","serializer","modelClass","payload","requestType","normalizedResponse","normalizeResponse","Snapshot","_store","__attributes","_belongsToRelationships","create","_belongsToIds","_hasManyRelationships","_hasManyIds","hasRecord","_instanceCache","peek","_attributes","cache","_changedAttributes","changedAttrs","record","peekRecord","lid","attributes","attrs","schema","fields","forEach","field","keyName","kind","getAttr","isNew","attr","changedAttributes","changedAttributeKeys","i","key","slice","belongsTo","returnModeIsId","result","relationshipMeta","get","_graph","relationship","value","getRelationship","inverseIdentifier","identifierCache","getOrCreateRecordIdentifier","undefined","isDeleted","hasMany","returnModeIsIds","ids","results","cachedIds","cachedSnapshots","member","eachAttribute","callback","binding","call","eachRelationship","serialize","serializerFor","SaveOp","getOrSetGlobal","Symbol","FetchManager","_pendingFetch","Map","requestCache","getRequestStateService","isDestroyed","scheduleSave","resolver","createDeferred","query","op","recordIdentifier","queryRequest","snapshot","pendingSaveItem","monitored","_enqueue","promise","_flushPendingSave","scheduleFetch","request","pendingFetch","getPendingFetch","pendingFetchItem","resolverPromise","isInitialLoad","recordIsLoaded","then","potentiallyNewIm","_push","reload","error","isEmpty","isReleasable","graph","unload","_enableAsyncFlush","unloadRecord","size","Promise","resolve","setTimeout","flushAllPendingFetches","fetchesByType","fetchesById","set","requestsForIdentifier","TESTING","disableTestWaiter","waitFor","pendingFetches","matchingPendingFetch","find","fetch","isSameRequest","fetchItem","_flushPendingFetchForType","clear","fetchDataIfNeededForIdentifier","_isEmpty","isLoading","_isLoading","assign","destroy","instanceCache","req","isLoaded","getPendingRequestsForRecord","some","r","includesSatisfies","current","existing","arrCurrent","split","sort","arrExisting","includes","optionsSatisfies","existingOptions","_findMany","adapter","modelFor","s","every","v","findMany","ret","rejectFetchedItems","fetchMap","l","pair","reject","handleFoundRecords","coalescedPayload","snapshotsById","snapshotGroup","resources","resource","delete","rejected","snapshotArray","warn","values","_fetchRecord","findRecord","klass","isDestroying","coerceId","_processCoalescedGroup","group","payloads","catch","pendingFetchMap","adapterFor","shouldCoalesce","coalesceFindRequests","pendingFetchItems","totalItems","groups","groupRecordsForFindMany","pending","operation"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,MAAMA,mBAAmB,CAAC;AAS/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAEEC,WAAWA,CAACC,KAAY,EAAEC,IAAY,EAAEC,OAAuB,GAAG,EAAE,EAAE;IACpE,IAAI,CAACC,OAAO,GAAGH,KAAK;AACpB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACI,UAAU,GAAG,IAAI;;AAEtB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,SAAS,GAAGJ,IAAI;;AAErB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKI,IAAA,IAAI,CAACK,cAAc,GAAGJ,OAAO,CAACI,cAAc;;AAE5C;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMI,IAAA,IAAI,CAACC,OAAO,GAAGL,OAAO,CAACK,OAAO;AAChC;;AAEA;AACF;AACA;AACA;AACA;AACA;EAEE,IAAIC,YAAYA,GAAc;IAC5B,OAAO,IAAI,CAACL,OAAO,CAACM,OAAO,CAAC,IAAI,CAACJ,SAAS,CAAC;AAC7C;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAKE,IAAIK,MAAMA,GAAW;AACnB,IAAA,OAAO,IAAI,CAACF,YAAY,CAACE,MAAM;AACjC;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA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EAAyB0O,SAAS,CAAG,CAAA,CAAA,CAAA;AAAA;AAAA,GAAA,EACpG,OAAOzC,OAAO,CAACyC,SAAS,CAAC,KAAK,UAAU,CAAA,GAAA,EAAA;EAG1C,IAAIzG,OAAgC,GAAGsB,OAAO,CAACC,OAAO,EAAE,CAACb,IAAI,CAAC,MAAMsD,OAAO,CAACyC,SAAS,CAAC,CAAC/O,KAAK,EAAE+C,UAAU,EAAEmF,QAAQ,CAAC,CAAC;AACpH,EAAA,MAAMpF,UAA4C,GAAG9C,KAAK,CAACiH,aAAa,CAAC5G,SAAS,CAAC;EAEnFc,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAA,GAAA,CAAAC,IAAA,IAAA;AAAA,IAAA,IAAA,CAAAA,IAAA,EAAA;AAAA,MAAA,MAAA,IAAAC,KAAA,CACE,CAAmBsN,gBAAAA,EAAAA,SAAS,CAA2D,yDAAA,CAAA,CAAA;AAAA;GACvFzG,EAAAA,OAAO,KAAKpC,SAAS,CAAA,GAAA,EAAA;AAGvBoC,EAAAA,OAAO,GAAGA,OAAO,CAACU,IAAI,CAAE/G,cAAc,IAAK;AACzC,IAAA,IAAIA,cAAc,EAAE;AAClB,MAAA,OAAOY,uBAAuB,CAACC,UAAU,EAAE9C,KAAK,EAAE+C,UAAU,EAAEd,cAAc,EAAEiG,QAAQ,CAACxG,EAAE,EAAEqN,SAAS,CAAC;AACvG;AACF,GAAC,CAA4B;AAE7BnH,EAAAA,QAAQ,CAACiC,OAAO,CAACvB,OAAO,CAAC;AAC3B;;AChnBA;AACA;AACA;AACA;AACA;AACA;AAMO,SAAS1H,YAAYA,CAACZ,KAAY,EAAgC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sources":["../../src/adapter/error.js"],"sourcesContent":["import { assert } from '@warp-drive/core/build-config/macros';\nimport { getOrSetGlobal } from '@warp-drive/core/types/-private';\n\n/**\n ## Overview\n\n <blockquote style=\"margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;\">\n <p>\n ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n <a href=\"/ember-data/release/classes/%3CInterface%3E%20Handler\">Handler</a> instead to be used with the <a href=\"https://github.com/emberjs/data/tree/main/packages/request#readme\">RequestManager</a>\n </p>\n </blockquote>\n\n An `AdapterError` is used by an adapter to signal that an error occurred\n during a request to an external API. It indicates a generic error, and\n subclasses are used to indicate specific error states.\n\n To create a custom error to signal a specific error state in communicating\n with an external API, extend the `AdapterError`. For example, if the\n external API exclusively used HTTP `503 Service Unavailable` to indicate\n it was closed for maintenance:\n\n ```js [app/adapters/maintenance-error.js]\n import AdapterError from '@ember-data/adapter/error';\n\n export default AdapterError.extend({ message: \"Down for maintenance.\" });\n ```\n\n This error would then be returned by an adapter's `handleResponse` method:\n\n ```js [app/adapters/application.js]\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n import MaintenanceError from './maintenance-error';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n handleResponse(status) {\n if (503 === status) {\n return new MaintenanceError();\n }\n\n return super.handleResponse(...arguments);\n }\n }\n ```\n\n And can then be detected in an application and used to send the user to an\n `under-maintenance` route:\n\n ```js [app/routes/application.js]\n import MaintenanceError from '../adapters/maintenance-error';\n\n export default class ApplicationRoute extends Route {\n actions: {\n error(error, transition) {\n if (error instanceof MaintenanceError) {\n this.transitionTo('under-maintenance');\n return;\n }\n\n // ...other error handling logic\n }\n }\n }\n ```\n\n @class AdapterError\n @public\n*/\nfunction _AdapterError(errors, message = 'Adapter operation failed') {\n this.isAdapterError = true;\n const error = Error.call(this, message);\n\n if (error) {\n this.stack = error.stack;\n this.description = error.description;\n this.fileName = error.fileName;\n this.lineNumber = error.lineNumber;\n this.message = error.message;\n this.name = error.name;\n this.number = error.number;\n }\n\n this.errors = errors || [\n {\n title: 'Adapter Error',\n detail: message,\n },\n ];\n}\n\n_AdapterError.prototype = Object.create(Error.prototype);\n_AdapterError.prototype.code = 'AdapterError';\n_AdapterError.extend = extendFn(_AdapterError);\n\nexport const AdapterError = getOrSetGlobal('AdapterError', _AdapterError);\n\nfunction extendFn(ErrorClass) {\n return function ({ message: defaultMessage } = {}) {\n return extend(ErrorClass, defaultMessage);\n };\n}\n\nfunction extend(ParentErrorClass, defaultMessage) {\n const ErrorClass = function (errors, message) {\n assert('`AdapterError` expects json-api formatted errors array.', Array.isArray(errors || []));\n ParentErrorClass.call(this, errors, message || defaultMessage);\n };\n ErrorClass.prototype = Object.create(ParentErrorClass.prototype);\n ErrorClass.extend = extendFn(ErrorClass);\n\n return ErrorClass;\n}\n\n/**\n A `InvalidError` is used by an adapter to signal the external API\n was unable to process a request because the content was not\n semantically correct or meaningful per the API. Usually, this means a\n record failed some form of server-side validation. When a promise\n from an adapter is rejected with a `InvalidError` the record will\n transition to the `invalid` state and the errors will be set to the\n `errors` property on the record.\n\n For Ember Data to correctly map errors to their corresponding\n properties on the model, Ember Data expects each error to be\n a valid JSON-API error object with a `source/pointer` that matches\n the property name. For example, if you had a Post model that\n looked like this.\n\n ```js [app/models/post.js]\n import { Model, attr } from '@warp-drive/legacy/model';\n\n export default class PostModel extends Model {\n @attr('string') title;\n @attr('string') content;\n }\n ```\n\n To show an error from the server related to the `title` and\n `content` properties your adapter could return a promise that\n rejects with a `InvalidError` object that looks like this:\n\n ```js [app/adapters/post.js]\n import RSVP from 'RSVP';\n import RESTAdapter from '@ember-data/adapter/rest';\n import { InvalidError } from '@ember-data/adapter/error';\n\n export default class ApplicationAdapter extends RESTAdapter {\n updateRecord() {\n // Fictional adapter that always rejects\n return RSVP.reject(new InvalidError([\n {\n detail: 'Must be unique',\n source: { pointer: '/data/attributes/title' }\n },\n {\n detail: 'Must not be blank',\n source: { pointer: '/data/attributes/content'}\n }\n ]));\n }\n }\n ```\n\n Your backend may use different property names for your records the\n store will attempt to extract and normalize the errors using the\n serializer's `extractErrors` method before the errors get added to\n the model. As a result, it is safe for the `InvalidError` to\n wrap the error payload unaltered.\n\n @class InvalidError\n @public\n*/\n// TODO @deprecate extractError documentation\nexport const InvalidError = getOrSetGlobal(\n 'InvalidError',\n extend(AdapterError, 'The adapter rejected the commit because it was invalid')\n);\nInvalidError.prototype.code = 'InvalidError';\n\n/**\n A `TimeoutError` is used by an adapter to signal that a request\n to the external API has timed out. I.e. no response was received from\n the external API within an allowed time period.\n\n An example use case would be to warn the user to check their internet\n connection if an adapter operation has timed out:\n\n ```js [app/routes/application.js]\n import { TimeoutError } from '@ember-data/adapter/error';\n\n export default class ApplicationRoute extends Route {\n @action\n error(error, transition) {\n if (error instanceof TimeoutError) {\n // alert the user\n alert('Are you still connected to the Internet?');\n return;\n }\n\n // ...other error handling logic\n }\n }\n ```\n\n @class TimeoutError\n @public\n*/\nexport const TimeoutError = getOrSetGlobal('TimeoutError', extend(AdapterError, 'The adapter operation timed out'));\nTimeoutError.prototype.code = 'TimeoutError';\n\n/**\n A `AbortError` is used by an adapter to signal that a request to\n the external API was aborted. For example, this can occur if the user\n navigates away from the current page after a request to the external API\n has been initiated but before a response has been received.\n\n @class AbortError\n @public\n*/\nexport const AbortError = getOrSetGlobal('AbortError', extend(AdapterError, 'The adapter operation was aborted'));\nAbortError.prototype.code = 'AbortError';\n\n/**\n A `UnauthorizedError` equates to a HTTP `401 Unauthorized` response\n status. It is used by an adapter to signal that a request to the external\n API was rejected because authorization is required and has failed or has not\n yet been provided.\n\n An example use case would be to redirect the user to a login route if a\n request is unauthorized:\n\n ```js [app/routes/application.js]\n import { UnauthorizedError } from '@ember-data/adapter/error';\n\n export default class ApplicationRoute extends Route {\n @action\n error(error, transition) {\n if (error instanceof UnauthorizedError) {\n // go to the login route\n this.transitionTo('login');\n return;\n }\n\n // ...other error handling logic\n }\n }\n ```\n\n @class UnauthorizedError\n @public\n*/\nexport const UnauthorizedError = getOrSetGlobal(\n 'UnauthorizedError',\n extend(AdapterError, 'The adapter operation is unauthorized')\n);\nUnauthorizedError.prototype.code = 'UnauthorizedError';\n\n/**\n A `ForbiddenError` equates to a HTTP `403 Forbidden` response status.\n It is used by an adapter to signal that a request to the external API was\n valid but the server is refusing to respond to it. If authorization was\n provided and is valid, then the authenticated user does not have the\n necessary permissions for the request.\n\n @class ForbiddenError\n @public\n*/\nexport const ForbiddenError = getOrSetGlobal(\n 'ForbiddenError',\n extend(AdapterError, 'The adapter operation is forbidden')\n);\nForbiddenError.prototype.code = 'ForbiddenError';\n\n/**\n A `NotFoundError` equates to a HTTP `404 Not Found` response status.\n It is used by an adapter to signal that a request to the external API\n was rejected because the resource could not be found on the API.\n\n An example use case would be to detect if the user has entered a route\n for a specific model that does not exist. For example:\n\n ```js [app/routes/post.js]\n import { NotFoundError } from '@ember-data/adapter/error';\n\n export default class PostRoute extends Route {\n @service store;\n model(params) {\n return this.store.findRecord('post', params.post_id);\n }\n @action\n error(error, transition) {\n if (error instanceof NotFoundError) {\n // redirect to a list of all posts instead\n this.transitionTo('posts');\n } else {\n // otherwise let the error bubble\n return true;\n }\n }\n }\n ```\n\n @class NotFoundError\n @public\n*/\nexport const NotFoundError = getOrSetGlobal(\n 'NotFoundError',\n extend(AdapterError, 'The adapter could not find the resource')\n);\nNotFoundError.prototype.code = 'NotFoundError';\n\n/**\n A `ConflictError` equates to a HTTP `409 Conflict` response status.\n It is used by an adapter to indicate that the request could not be processed\n because of a conflict in the request. An example scenario would be when\n creating a record with a client-generated ID but that ID is already known\n to the external API.\n\n @class ConflictError\n @public\n*/\nexport const ConflictError = getOrSetGlobal(\n 'ConflictError',\n extend(AdapterError, 'The adapter operation failed due to a conflict')\n);\nConflictError.prototype.code = 'ConflictError';\n\n/**\n A `ServerError` equates to a HTTP `500 Internal Server Error` response\n status. It is used by the adapter to indicate that a request has failed\n because of an error in the external API.\n\n @class ServerError\n @public\n*/\nexport const ServerError = getOrSetGlobal(\n 'ServerError',\n extend(AdapterError, 'The adapter operation failed due to a server error')\n);\nServerError.prototype.code = 'ServerError';\n"],"names":["_AdapterError","errors","message","isAdapterError","error","Error","call","stack","description","fileName","lineNumber","name","number","title","detail","prototype","Object","create","code","extend","extendFn","AdapterError","getOrSetGlobal","ErrorClass","defaultMessage","ParentErrorClass","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Array","isArray","InvalidError","TimeoutError","AbortError","UnauthorizedError","ForbiddenError","NotFoundError","ConflictError","ServerError"],"mappings":";;;AAqEA,SAASA,aAAaA,CAACC,MAAM,EAAEC,OAAO,GAAG,0BAA0B,EAAE;EACnE,IAAI,CAACC,cAAc,GAAG,IAAI;EAC1B,MAAMC,KAAK,GAAGC,KAAK,CAACC,IAAI,CAAC,IAAI,EAAEJ,OAAO,CAAC;AAEvC,EAAA,IAAIE,KAAK,EAAE;AACT,IAAA,IAAI,CAACG,KAAK,GAAGH,KAAK,CAACG,KAAK;AACxB,IAAA,IAAI,CAACC,WAAW,GAAGJ,KAAK,CAACI,WAAW;AACpC,IAAA,IAAI,CAACC,QAAQ,GAAGL,KAAK,CAACK,QAAQ;AAC9B,IAAA,IAAI,CAACC,UAAU,GAAGN,KAAK,CAACM,UAAU;AAClC,IAAA,IAAI,CAACR,OAAO,GAAGE,KAAK,CAACF,OAAO;AAC5B,IAAA,IAAI,CAACS,IAAI,GAAGP,KAAK,CAACO,IAAI;AACtB,IAAA,IAAI,CAACC,MAAM,GAAGR,KAAK,CAACQ,MAAM;AAC5B;AAEA,EAAA,IAAI,CAACX,MAAM,GAAGA,MAAM,IAAI,CACtB;AACEY,IAAAA,KAAK,EAAE,eAAe;AACtBC,IAAAA,MAAM,EAAEZ;AACV,GAAC,CACF;AACH;AAEAF,aAAa,CAACe,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACZ,KAAK,CAACU,SAAS,CAAC;AACxDf,aAAa,CAACe,SAAS,CAACG,IAAI,GAAG,cAAc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A;AACA;AACA;;AAEA;AACA;AACA;AACA;AACaW,MAAAA,YAAY,GAAGZ,cAAc,CACxC,cAAc,EACdH,MAAM,CAACE,YAAY,EAAE,wDAAwD,CAC/E;AACAa,YAAY,CAACnB,SAAS,CAACG,IAAI,GAAG,cAAc;;AAE5C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACaiB,MAAAA,YAAY,GAAGb,cAAc,CAAC,cAAc,EAAEH,MAAM,CAACE,YAAY,EAAE,iCAAiC,CAAC;AAClHc,YAAY,CAACpB,SAAS,CAACG,IAAI,GAAG,cAAc;;AAE5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACakB,MAAAA,UAAU,GAAGd,cAAc,CAAC,YAAY,EAAEH,MAAM,CAACE,YAAY,EAAE,mCAAmC,CAAC;AAChHe,UAAU,CAACrB,SAAS,CAACG,IAAI,GAAG,YAAY;;AAExC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACamB,MAAAA,iBAAiB,GAAGf,cAAc,CAC7C,mBAAmB,EACnBH,MAAM,CAACE,YAAY,EAAE,uCAAuC,CAC9D;AACAgB,iBAAiB,CAACtB,SAAS,CAACG,IAAI,GAAG,mBAAmB;;AAEtD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACaoB,MAAAA,cAAc,GAAGhB,cAAc,CAC1C,gBAAgB,EAChBH,MAAM,CAACE,YAAY,EAAE,oCAAoC,CAC3D;AACAiB,cAAc,CAACvB,SAAS,CAACG,IAAI,GAAG,gBAAgB;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACaqB,MAAAA,aAAa,GAAGjB,cAAc,CACzC,eAAe,EACfH,MAAM,CAACE,YAAY,EAAE,yCAAyC,CAChE;AACAkB,aAAa,CAACxB,SAAS,CAACG,IAAI,GAAG,eAAe;;AAE9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACasB,MAAAA,aAAa,GAAGlB,cAAc,CACzC,eAAe,EACfH,MAAM,CAACE,YAAY,EAAE,gDAAgD,CACvE;AACAmB,aAAa,CAACzB,SAAS,CAACG,IAAI,GAAG,eAAe;;AAE9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACauB,MAAAA,WAAW,GAAGnB,cAAc,CACvC,aAAa,EACbH,MAAM,CAACE,YAAY,EAAE,oDAAoD,CAC3E;AACAoB,WAAW,CAAC1B,SAAS,CAACG,IAAI,GAAG,aAAa;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-api.js","sources":["../../src/adapter/json-api.ts"],"sourcesContent":["import type { Store } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { ModelSchema } from '@warp-drive/core/types';\nimport type { HTTPMethod } from '@warp-drive/core/types/request';\nimport { dasherize, pluralize } from '@warp-drive/utilities/string';\n\nimport type { AdapterPayload } from '../compat.ts';\nimport type { Snapshot, SnapshotRecordArray } from '../compat/-private.ts';\nimport { serializeIntoHash } from './-private.ts';\nimport type { FetchRequestInit, JQueryRequestInit, QueryState } from './rest.ts';\nimport { RESTAdapter } from './rest.ts';\n\n/**\n ## Overview\n\n <blockquote style=\"margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;\">\n <p>\n ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n <a href=\"/ember-data/release/classes/%3CInterface%3E%20Handler\">Handler</a> instead to be used with the <a href=\"https://github.com/emberjs/data/tree/main/packages/request#readme\">RequestManager</a>\n </p>\n </blockquote>\n\n The `JSONAPIAdapter` is an adapter whichtransforms the store's\n requests into HTTP requests that follow the [JSON API format](http://jsonapi.org/format/).\n\n ## JSON API Conventions\n\n The JSONAPIAdapter uses JSON API conventions for building the URL\n for a record and selecting the HTTP verb to use with a request. The\n actions you can take on a record map onto the following URLs in the\n JSON API adapter:\n\n<table>\n <tr>\n <th>\n Action\n </th>\n <th>\n HTTP Verb\n </th>\n <th>\n URL\n </th>\n </tr>\n <tr>\n <th>\n `store.findRecord('post', 123)`\n </th>\n <td>\n GET\n </td>\n <td>\n /posts/123\n </td>\n </tr>\n <tr>\n <th>\n `store.findAll('post')`\n </th>\n <td>\n GET\n </td>\n <td>\n /posts\n </td>\n </tr>\n <tr>\n <th>\n Update `postRecord.save()`\n </th>\n <td>\n PATCH\n </td>\n <td>\n /posts/123\n </td>\n </tr>\n <tr>\n <th>\n Create `store.createRecord('post').save()`\n </th>\n <td>\n POST\n </td>\n <td>\n /posts\n </td>\n </tr>\n <tr>\n <th>\n Delete `postRecord.destroyRecord()`\n </th>\n <td>\n DELETE\n </td>\n <td>\n /posts/123\n </td>\n </tr>\n</table>\n\n ## Success and failure\n\n The JSONAPIAdapter will consider a success any response with a\n status code of the 2xx family (\"Success\"), as well as 304 (\"Not\n Modified\"). Any other status code will be considered a failure.\n\n On success, the request promise will be resolved with the full\n response payload.\n\n Failed responses with status code 422 (\"Unprocessable Entity\") will\n be considered \"invalid\". The response will be discarded, except for\n the `errors` key. The request promise will be rejected with a\n `InvalidError`. This error object will encapsulate the saved\n `errors` value.\n\n Any other status codes will be treated as an adapter error. The\n request promise will be rejected, similarly to the invalid case,\n but with an instance of `AdapterError` instead.\n\n ### Endpoint path customization\n\n Endpoint paths can be prefixed with a `namespace` by setting the\n namespace property on the adapter:\n\n ```js [app/adapters/application.js]\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n namespace = 'api/1';\n }\n ```\n Requests for the `person` model would now target `/api/1/people/1`.\n\n ### Host customization\n\n An adapter can target other hosts by setting the `host` property.\n\n ```js [app/adapters/application.js]\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n host = 'https://api.example.com';\n }\n ```\n\n Requests for the `person` model would now target\n `https://api.example.com/people/1`.\n\n @since 1.13.0\n @class JSONAPIAdapter\n @public\n @constructor\n*/\nclass JSONAPIAdapter extends RESTAdapter {\n _defaultContentType = 'application/vnd.api+json';\n\n /**\n @private\n @param {String} url\n @param {String} type The request type GET, POST, PUT, DELETE etc.\n @param {Object} options\n @return {Object}\n */\n ajaxOptions(\n url: string,\n type: HTTPMethod,\n options: JQueryAjaxSettings | RequestInit = {}\n ): JQueryRequestInit | FetchRequestInit {\n const hash = super.ajaxOptions(url, type, options) as FetchRequestInit;\n const headers: HeadersInit = (hash.headers = hash.headers || {});\n headers['Accept'] = (headers['Accept'] as string) || 'application/vnd.api+json';\n\n return hash;\n }\n\n /**\n By default the JSONAPIAdapter will send each find request coming from a `store.find`\n or from accessing a relationship separately to the server. If your server supports passing\n ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\n within a single runloop.\n\n For example, if you have an initial payload of:\n\n ```javascript\n {\n data: {\n id: 1,\n type: 'post',\n relationship: {\n comments: {\n data: [\n { id: 1, type: 'comment' },\n { id: 2, type: 'comment' }\n ]\n }\n }\n }\n }\n ```\n\n By default calling `post.comments` will trigger the following requests(assuming the\n comments haven't been loaded before):\n\n ```\n GET /comments/1\n GET /comments/2\n ```\n\n If you set coalesceFindRequests to `true` it will instead trigger the following request:\n\n ```\n GET /comments?filter[id]=1,2\n ```\n\n Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\n relationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n\n ```javascript\n store.findRecord('comment', 1);\n store.findRecord('comment', 2);\n ```\n\n will also send a request to: `GET /comments?filter[id]=1,2`\n\n Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.\n\n @property coalesceFindRequests\n @public\n @type {Boolean}\n */\n get coalesceFindRequests() {\n const coalesceFindRequests = this._coalesceFindRequests;\n if (typeof coalesceFindRequests === 'boolean') {\n return coalesceFindRequests;\n }\n return (this._coalesceFindRequests = false);\n }\n\n set coalesceFindRequests(value: boolean) {\n this._coalesceFindRequests = value;\n }\n\n findMany(store: Store, type: ModelSchema, ids: string[], snapshots: Snapshot[]): Promise<AdapterPayload> {\n const url = this.buildURL(type.modelName, ids, snapshots, 'findMany');\n return this.ajax(url, 'GET', { data: { filter: { id: ids.join(',') } } });\n }\n\n pathForType(modelName: string): string {\n const dasherized = dasherize(modelName);\n return pluralize(dasherized);\n }\n\n updateRecord(store: Store, schema: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload> {\n const data = serializeIntoHash(store, schema, snapshot);\n const type = snapshot.modelName;\n const id = snapshot.id;\n assert(`Attempted to update the ${type} record, but the record has no id`, typeof id === 'string' && id.length > 0);\n\n const url = this.buildURL(type, id, snapshot, 'updateRecord');\n\n return this.ajax(url, 'PATCH', { data: data });\n }\n\n /**\n Used by `findAll` and `findRecord` to build the query's `data` hash\n supplied to the ajax method.\n\n @since 2.5.0\n @public\n @param {Snapshot} snapshot\n @return {Object}\n */\n buildQuery(snapshot: Snapshot | SnapshotRecordArray): QueryState {\n const query: QueryState = {};\n\n if (snapshot) {\n const { include } = snapshot;\n const normalizedInclude = Array.isArray(include) ? include.join(',') : include;\n\n if (normalizedInclude) {\n query.include = normalizedInclude;\n }\n }\n\n return query;\n }\n}\n\nexport { JSONAPIAdapter };\n"],"names":["JSONAPIAdapter","RESTAdapter","_defaultContentType","ajaxOptions","url","type","options","hash","headers","coalesceFindRequests","_coalesceFindRequests","value","findMany","store","ids","snapshots","buildURL","modelName","ajax","data","filter","id","join","pathForType","dasherized","dasherize","pluralize","updateRecord","schema","snapshot","serializeIntoHash","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","length","buildQuery","query","include","normalizedInclude","Array","isArray"],"mappings":";;;;;;AA2JA,MAAMA,cAAc,SAASC,WAAW,CAAC;AACvCC,EAAAA,mBAAmB,GAAG,0BAA0B;;AAEhD;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CACTC,GAAW,EACXC,IAAgB,EAChBC,OAAyC,GAAG,EAAE,EACR;IACtC,MAAMC,IAAI,GAAG,KAAK,CAACJ,WAAW,CAACC,GAAG,EAAEC,IAAI,EAAEC,OAAO,CAAqB;IACtE,MAAME,OAAoB,GAAID,IAAI,CAACC,OAAO,GAAGD,IAAI,CAACC,OAAO,IAAI,EAAG;IAChEA,OAAO,CAAC,QAAQ,CAAC,GAAIA,OAAO,CAAC,QAAQ,CAAC,IAAe,0BAA0B;AAE/E,IAAA,OAAOD,IAAI;AACb;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAYE,IAAIE,oBAAoBA,GAAG;AACzB,IAAA,MAAMA,oBAAoB,GAAG,IAAI,CAACC,qBAAqB;AACvD,IAAA,IAAI,OAAOD,oBAAoB,KAAK,SAAS,EAAE;AAC7C,MAAA,OAAOA,oBAAoB;AAC7B;AACA,IAAA,OAAQ,IAAI,CAACC,qBAAqB,GAAG,KAAK;AAC5C;EAEA,IAAID,oBAAoBA,CAACE,KAAc,EAAE;IACvC,IAAI,CAACD,qBAAqB,GAAGC,KAAK;AACpC;EAEAC,QAAQA,CAACC,KAAY,EAAER,IAAiB,EAAES,GAAa,EAAEC,SAAqB,EAA2B;AACvG,IAAA,MAAMX,GAAG,GAAG,IAAI,CAACY,QAAQ,CAACX,IAAI,CAACY,SAAS,EAAEH,GAAG,EAAEC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A;AACA;AACA;AACA;EAEEoB,UAAUA,CAACV,QAAwC,EAAc;IAC/D,MAAMW,KAAiB,GAAG,EAAE;AAE5B,IAAA,IAAIX,QAAQ,EAAE;MACZ,MAAM;AAAEY,QAAAA;AAAQ,OAAC,GAAGZ,QAAQ;AAC5B,MAAA,MAAMa,iBAAiB,GAAGC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,GAAGA,OAAO,CAACnB,IAAI,CAAC,GAAG,CAAC,GAAGmB,OAAO;AAE9E,MAAA,IAAIC,iBAAiB,EAAE;QACrBF,KAAK,CAACC,OAAO,GAAGC,iBAAiB;AACnC;AACF;AAEA,IAAA,OAAOF,KAAK;AACd;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rest.js","sources":["../../src/adapter/rest.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n\nimport { getOwner } from '@ember/application';\nimport { warn } from '@ember/debug';\nimport { computed } from '@ember/object';\n\nimport type { Store } from '@warp-drive/core';\nimport { DEBUG } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { ModelSchema } from '@warp-drive/core/types';\nimport type { HTTPMethod } from '@warp-drive/core/types/request';\n\nimport { Adapter, BuildURLMixin } from '../adapter.ts';\nimport type { AdapterPayload } from '../compat.ts';\nimport type { Snapshot, SnapshotRecordArray } from '../compat/-private.ts';\nimport {\n determineBodyPromise,\n fetch,\n parseResponseHeaders,\n serializeIntoHash,\n serializeQueryParams,\n} from './-private.ts';\nimport type { MixtBuildURLMixin } from './-private/build-url-mixin.ts';\nimport type { FastBoot } from './-private/fastboot-interface.ts';\nimport {\n AbortError,\n AdapterError,\n ConflictError,\n ForbiddenError,\n InvalidError,\n NotFoundError,\n ServerError,\n TimeoutError,\n UnauthorizedError,\n} from './error.js';\n\ntype Payload = Error | Record<string, unknown> | unknown[] | string | undefined;\n\nexport type QueryState = {\n include?: unknown;\n since?: unknown;\n};\n\nexport interface FetchRequestInit extends RequestInit {\n url: string;\n method: HTTPMethod;\n type: HTTPMethod;\n}\n\nexport interface JQueryRequestInit extends JQueryAjaxSettings {\n url: string;\n method: HTTPMethod;\n type: HTTPMethod;\n}\n\nexport type RequestData = {\n url: string;\n method: HTTPMethod;\n [key: string]: unknown;\n};\n\ntype ResponseData = {\n status: number;\n textStatus: string;\n headers: Record<string, string>;\n errorThrown?: Error | string;\n};\n\ndeclare const jQuery: JQueryStatic | undefined;\n\n/**\n * <blockquote style=\"margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;\">\n <p>\n ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n <a href=\"/ember-data/release/classes/%3CInterface%3E%20Handler\">Handler</a> instead to be used with the <a href=\"https://github.com/emberjs/data/tree/main/packages/request#readme\">RequestManager</a>\n </p>\n </blockquote>\n\n The REST adapter allows your store to communicate with an HTTP server by\n transmitting JSON via XHR.\n\n This adapter is designed around the idea that the JSON exchanged with\n the server should be conventional. It builds URLs in a manner that follows\n the structure of most common REST-style web services.\n\n ## Success and failure\n\n The REST adapter will consider a success any response with a status code\n of the 2xx family (\"Success\"), as well as 304 (\"Not Modified\"). Any other\n status code will be considered a failure.\n\n On success, the request promise will be resolved with the full response\n payload.\n\n Failed responses with status code 422 (\"Unprocessable Entity\") will be\n considered \"invalid\". The response will be discarded, except for the\n `errors` key. The request promise will be rejected with a `InvalidError`.\n This error object will encapsulate the saved `errors` value.\n\n Any other status codes will be treated as an \"adapter error\". The request\n promise will be rejected, similarly to the \"invalid\" case, but with\n an instance of `AdapterError` instead.\n\n ## JSON Structure\n\n The REST adapter expects the JSON returned from your server to follow\n these conventions.\n\n ### Object Root\n\n The JSON payload should be an object that contains the record inside a\n root property. For example, in response to a `GET` request for\n `/posts/1`, the JSON should look like this:\n\n ```js\n {\n \"posts\": {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C\",\n \"author\": \"Yehuda Katz\"\n }\n }\n ```\n\n Similarly, in response to a `GET` request for `/posts`, the JSON should\n look like this:\n\n ```js\n {\n \"posts\": [\n {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C\",\n \"author\": \"Yehuda Katz\"\n },\n {\n \"id\": 2,\n \"title\": \"Rails is omakase\",\n \"author\": \"D2H\"\n }\n ]\n }\n ```\n\n Note that the object root can be pluralized for both a single-object response\n and an array response: the REST adapter is not strict on this. Further, if the\n HTTP server responds to a `GET` request to `/posts/1` (e.g. the response to a\n `findRecord` query) with more than one object in the array, Ember Data will\n only display the object with the matching ID.\n\n ### Conventional Names\n\n Attribute names in your JSON payload should be the camelCased versions of\n the attributes in your Ember.js models.\n\n For example, if you have a `Person` model:\n\n ```js [app/models/person.js]\n import { Model, attr } from '@warp-drive/legacy/model';\n\n export default Model.extend({\n firstName: attr('string'),\n lastName: attr('string'),\n occupation: attr('string')\n });\n ```\n\n The JSON returned should look like this:\n\n ```js\n {\n \"people\": {\n \"id\": 5,\n \"firstName\": \"Zaphod\",\n \"lastName\": \"Beeblebrox\",\n \"occupation\": \"President\"\n }\n }\n ```\n\n #### Relationships\n\n Relationships are usually represented by ids to the record in the\n relationship. The related records can then be sideloaded in the\n response under a key for the type.\n\n ```js\n {\n \"posts\": {\n \"id\": 5,\n \"title\": \"I'm Running to Reform the W3C\",\n \"author\": \"Yehuda Katz\",\n \"comments\": [1, 2]\n },\n \"comments\": [{\n \"id\": 1,\n \"author\": \"User 1\",\n \"message\": \"First!\",\n }, {\n \"id\": 2,\n \"author\": \"User 2\",\n \"message\": \"Good Luck!\",\n }]\n }\n ```\n\n If the records in the relationship are not known when the response\n is serialized it's also possible to represent the relationship as a\n URL using the `links` key in the response. Ember Data will fetch\n this URL to resolve the relationship when it is accessed for the\n first time.\n\n ```js\n {\n \"posts\": {\n \"id\": 5,\n \"title\": \"I'm Running to Reform the W3C\",\n \"author\": \"Yehuda Katz\",\n \"links\": {\n \"comments\": \"/posts/5/comments\"\n }\n }\n }\n ```\n\n ### Errors\n\n If a response is considered a failure, the JSON payload is expected to include\n a top-level key `errors`, detailing any specific issues. For example:\n\n ```js\n {\n \"errors\": {\n \"msg\": \"Something went wrong\"\n }\n }\n ```\n\n This adapter does not make any assumptions as to the format of the `errors`\n object. It will simply be passed along as is, wrapped in an instance\n of `InvalidError` or `AdapterError`. The serializer can interpret it\n afterwards.\n\n ## Customization\n\n ### Endpoint path customization\n\n Endpoint paths can be prefixed with a `namespace` by setting the namespace\n property on the adapter:\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n namespace = 'api/1';\n }\n ```\n Requests for the `Person` model would now target `/api/1/people/1`.\n\n ### Host customization\n\n An adapter can target other hosts by setting the `host` property.\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.example.com';\n }\n ```\n\n ### Headers customization\n\n Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary\n headers can be set as key/value pairs on the `RESTAdapter`'s `headers`\n object and WarpDrive will send them along with each ajax request.\n\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n get headers() {\n return {\n 'API_KEY': 'secret key',\n 'ANOTHER_HEADER': 'Some header value'\n };\n }\n }\n ```\n\n @class RESTAdapter\n @public\n @constructor\n @uses BuildURLMixin\n*/\nclass RESTAdapter extends Adapter.extend(BuildURLMixin) {\n declare _fastboot: FastBoot;\n declare _coalesceFindRequests: boolean;\n declare host: string | null;\n declare namespace: string | null;\n\n /**\n This property allows ajax to still be used instead when `false`.\n\n @property useFetch\n @type {Boolean}\n @default true\n @public\n */\n useFetch = true;\n\n _defaultContentType = 'application/json; charset=utf-8';\n\n @computed()\n get fastboot() {\n // Avoid computed property override deprecation in fastboot as suggested by:\n // https://deprecations.emberjs.com/v3.x/#toc_computed-property-override\n const fastboot = this._fastboot;\n if (fastboot) {\n return fastboot;\n }\n return (this._fastboot = getOwner(this)!.lookup('service:fastboot') as FastBoot);\n }\n\n set fastboot(value: FastBoot) {\n this._fastboot = value;\n }\n\n /**\n By default, the RESTAdapter will send the query params sorted alphabetically to the\n server.\n\n For example:\n\n ```js\n store.query('posts', { sort: 'price', category: 'pets' });\n ```\n\n will generate a requests like this `/posts?category=pets&sort=price`, even if the\n parameters were specified in a different order.\n\n That way the generated URL will be deterministic and that simplifies caching mechanisms\n in the backend.\n\n Setting `sortQueryParams` to a falsey value will respect the original order.\n\n In case you want to sort the query parameters with a different criteria, set\n `sortQueryParams` to your custom sort function.\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n sortQueryParams(params) {\n let sortedKeys = Object.keys(params).sort().reverse();\n let len = sortedKeys.length, newParams = {};\n\n for (let i = 0; i < len; i++) {\n newParams[sortedKeys[i]] = params[sortedKeys[i]];\n }\n\n return newParams;\n }\n }\n ```\n\n @param {Object} obj\n @return {Object}\n @public\n */\n sortQueryParams(obj: Record<string, unknown>): Record<string, unknown> {\n const keys = Object.keys(obj);\n const len = keys.length;\n if (len < 2) {\n return obj;\n }\n const newQueryParams: Record<string, unknown> = {};\n const sortedKeys = keys.sort();\n\n for (let i = 0; i < len; i++) {\n newQueryParams[sortedKeys[i]] = obj[sortedKeys[i]];\n }\n return newQueryParams;\n }\n\n /**\n By default the RESTAdapter will send each find request coming from a `store.find`\n or from accessing a relationship separately to the server. If your server supports passing\n ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\n within a single runloop.\n\n For example, if you have an initial payload of:\n\n ```javascript\n {\n post: {\n id: 1,\n comments: [1, 2]\n }\n }\n ```\n\n By default calling `post.comments` will trigger the following requests(assuming the\n comments haven't been loaded before):\n\n ```\n GET /comments/1\n GET /comments/2\n ```\n\n If you set coalesceFindRequests to `true` it will instead trigger the following request:\n\n ```\n GET /comments?ids[]=1&ids[]=2\n ```\n\n Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\n relationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n\n ```javascript\n store.findRecord('comment', 1);\n store.findRecord('comment', 2);\n ```\n\n will also send a request to: `GET /comments?ids[]=1&ids[]=2`\n\n Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.\n\n @property coalesceFindRequests\n @public\n @type {Boolean}\n */\n get coalesceFindRequests() {\n const coalesceFindRequests = this._coalesceFindRequests;\n if (typeof coalesceFindRequests === 'boolean') {\n return coalesceFindRequests;\n }\n return (this._coalesceFindRequests = false);\n }\n\n set coalesceFindRequests(value: boolean) {\n this._coalesceFindRequests = value;\n }\n\n /**\n Endpoint paths can be prefixed with a `namespace` by setting the namespace\n property on the adapter:\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n namespace = 'api/1';\n }\n ```\n\n Requests for the `Post` model would now target `/api/1/post/`.\n\n @property namespace\n @public\n @type {String}\n */\n\n /**\n An adapter can target other hosts by setting the `host` property.\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.example.com';\n }\n ```\n\n Requests for the `Post` model would now target `https://api.example.com/post/`.\n\n @property host\n @public\n @type {String}\n */\n\n /**\n Some APIs require HTTP headers, e.g. to provide an API\n key. Arbitrary headers can be set as key/value pairs on the\n `RESTAdapter`'s `headers` object and Ember Data will send them\n along with each ajax request. For dynamic headers see [headers\n customization](/ember-data/release/classes/RESTAdapter).\n\n ```js [app/adapters/application.js]\n import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n get headers() {\n return {\n 'API_KEY': 'secret key',\n 'ANOTHER_HEADER': 'Some header value'\n };\n }\n }\n ```\n\n @property headers\n @public\n @type {Object}\n */\n declare headers: Record<string, unknown> | undefined;\n\n /**\n Called by the store in order to fetch the JSON for a given\n type and ID.\n\n The `findRecord` method makes an Ajax request to a URL computed by\n `buildURL`, and returns a promise for the resulting payload.\n\n This method performs an HTTP `GET` request with the id provided as part of the query string.\n\n @since 1.13.0\n @public\n @param {Store} store\n @param {Model} type\n @param {String} id\n @param {Snapshot} snapshot\n @return {Promise} promise\n */\n findRecord(store: Store, type: ModelSchema, id: string, snapshot: Snapshot): Promise<AdapterPayload> {\n const url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n const query: QueryState = this.buildQuery(snapshot);\n\n return this.ajax(url, 'GET', { data: query });\n }\n\n /**\n Called by the store in order to fetch a JSON array for all\n of the records for a given type.\n\n The `findAll` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\n promise for the resulting payload.\n\n @public\n @param {Store} store\n @param {Model} type\n @param {undefined} neverSet a value is never provided to this argument\n @param {SnapshotRecordArray} snapshotRecordArray\n @return {Promise} promise\n */\n findAll(\n store: Store,\n type: ModelSchema,\n sinceToken: null,\n snapshotRecordArray: SnapshotRecordArray\n ): Promise<AdapterPayload> {\n const query: QueryState = this.buildQuery(snapshotRecordArray);\n const url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');\n\n if (sinceToken) {\n query.since = sinceToken;\n }\n\n return this.ajax(url, 'GET', { data: query });\n }\n\n /**\n Called by the store in order to fetch a JSON array for\n the records that match a particular query.\n\n The `query` method makes an Ajax (HTTP GET) request to a URL\n computed by `buildURL`, and returns a promise for the resulting\n payload.\n\n The `query` argument is a simple JavaScript object that will be passed directly\n to the server as parameters.\n\n @public\n @param {Store} store\n @param {Model} type\n @param {Object} query\n @param {Collection} recordArray\n @param {Object} adapterOptions\n @return {Promise} promise\n */\n query(store: Store, type: ModelSchema, query: Record<string, unknown>): Promise<AdapterPayload> {\n const url = this.buildURL(type.modelName, null, null, 'query', query);\n\n if (this.sortQueryParams) {\n query = this.sortQueryParams(query);\n }\n\n return this.ajax(url, 'GET', { data: query });\n }\n\n /**\n Called by the store in order to fetch a JSON object for\n the record that matches a particular query.\n\n The `queryRecord` method makes an Ajax (HTTP GET) request to a URL\n computed by `buildURL`, and returns a promise for the resulting\n payload.\n\n The `query` argument is a simple JavaScript object that will be passed directly\n to the server as parameters.\n\n @since 1.13.0\n @public\n @param {Store} store\n @param {Model} type\n @param {Object} query\n @param {Object} adapterOptions\n @return {Promise} promise\n */\n queryRecord(\n store: Store,\n type: ModelSchema,\n query: Record<string, unknown>,\n adapterOptions: Record<string, unknown>\n ): Promise<AdapterPayload> {\n const url = this.buildURL(type.modelName, null, null, 'queryRecord', query);\n\n if (this.sortQueryParams) {\n query = this.sortQueryParams(query);\n }\n\n return this.ajax(url, 'GET', { data: query });\n }\n\n /**\n Called by the store in order to fetch several records together if `coalesceFindRequests` is true\n\n For example, if the original payload looks like:\n\n ```js\n {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"comments\": [ 1, 2, 3 ]\n }\n ```\n\n The IDs will be passed as a URL-encoded Array of IDs, in this form:\n\n ```\n ids[]=1&ids[]=2&ids[]=3\n ```\n\n Many servers, such as Rails and PHP, will automatically convert this URL-encoded array\n into an Array for you on the server-side. If you want to encode the\n IDs, differently, just override this (one-line) method.\n\n The `findMany` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\n promise for the resulting payload.\n\n @public\n @param {Store} store\n @param {Model} type\n @param {Array} ids\n @param {Array} snapshots\n @return {Promise} promise\n */\n findMany(store: Store, type: ModelSchema, ids: string[], snapshots: Snapshot[]): Promise<AdapterPayload> {\n const url = this.buildURL(type.modelName, ids, snapshots, 'findMany');\n return this.ajax(url, 'GET', { data: { ids: ids } });\n }\n\n /**\n Called by the store in order to fetch a JSON array for\n the unloaded records in a has-many relationship that were originally\n specified as a URL (inside of `links`).\n\n For example, if your original payload looks like this:\n\n ```js\n {\n \"post\": {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"links\": { \"comments\": \"/posts/1/comments\" }\n }\n }\n ```\n\n This method will be called with the parent record and `/posts/1/comments`.\n\n The `findHasMany` method will make an Ajax (HTTP GET) request to the originally specified URL.\n\n The format of your `links` value will influence the final request URL via the `urlPrefix` method:\n\n * Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n\n * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n\n * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.\n\n @public\n @param {Store} store\n @param {Snapshot} snapshot\n @param {String} url\n @param {Object} relationship meta object describing the relationship\n @return {Promise} promise\n */\n findHasMany(\n store: Store,\n snapshot: Snapshot,\n url: string,\n relationship: Record<string, unknown>\n ): Promise<AdapterPayload> {\n const id = snapshot.id;\n const type = snapshot.modelName;\n\n assert(\n `Attempted to fetch the hasMany relationship for ${type}, but the record has no id`,\n typeof id === 'string' && id.length > 0\n );\n url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findHasMany'));\n\n return this.ajax(url, 'GET');\n }\n\n /**\n Called by the store in order to fetch the JSON for the unloaded record in a\n belongs-to relationship that was originally specified as a URL (inside of\n `links`).\n\n For example, if your original payload looks like this:\n\n ```js\n {\n \"person\": {\n \"id\": 1,\n \"name\": \"Tom Dale\",\n \"links\": { \"group\": \"/people/1/group\" }\n }\n }\n ```\n\n This method will be called with the parent record and `/people/1/group`.\n\n The `findBelongsTo` method will make an Ajax (HTTP GET) request to the originally specified URL.\n\n The format of your `links` value will influence the final request URL via the `urlPrefix` method:\n\n * Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n\n * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n\n * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.\n\n @public\n @param {Store} store\n @param {Snapshot} snapshot\n @param {String} url\n @param {Object} relationship meta object describing the relationship\n @return {Promise} promise\n */\n findBelongsTo(store: Store, snapshot: Snapshot, url: string, relationship): Promise<AdapterPayload> {\n const id = snapshot.id;\n const type = snapshot.modelName;\n\n assert(\n `Attempted to fetch the belongsTo relationship for ${type}, but the record has no id`,\n typeof id === 'string' && id.length > 0\n );\n url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findBelongsTo'));\n return this.ajax(url, 'GET');\n }\n\n /**\n Called by the store when a newly created record is\n saved via the `save` method on a model record instance.\n\n The `createRecord` method serializes the record and makes an Ajax (HTTP POST) request\n to a URL computed by `buildURL`.\n\n See `serialize` for information on how to customize the serialized form\n of a record.\n\n @public\n @param {Store} store\n @param {Model} type\n @param {Snapshot} snapshot\n @return {Promise} promise\n */\n createRecord(store: Store, type: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload> {\n const url = this.buildURL(type.modelName, null, snapshot, 'createRecord');\n\n const data = serializeIntoHash(store, type, snapshot);\n\n return this.ajax(url, 'POST', { data });\n }\n\n /**\n Called by the store when an existing record is saved\n via the `save` method on a model record instance.\n\n The `updateRecord` method serializes the record and makes an Ajax (HTTP PUT) request\n to a URL computed by `buildURL`.\n\n See `serialize` for information on how to customize the serialized form\n of a record.\n\n @public\n @param {Store} store\n @param {Model} schema\n @param {Snapshot} snapshot\n @return {Promise} promise\n */\n updateRecord(store: Store, schema: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload> {\n const data = serializeIntoHash(store, schema, snapshot, {});\n const type = snapshot.modelName;\n const id = snapshot.id;\n assert(`Attempted to update the ${type} record, but the record has no id`, typeof id === 'string' && id.length > 0);\n const url = this.buildURL(type, id, snapshot, 'updateRecord');\n\n return this.ajax(url, 'PUT', { data });\n }\n\n /**\n Called by the store when a record is deleted.\n\n The `deleteRecord` method makes an Ajax (HTTP DELETE) request to a URL computed by `buildURL`.\n\n @public\n @param {Store} store\n @param {Model} type\n @param {Snapshot} snapshot\n @return {Promise} promise\n */\n deleteRecord(store: Store, schema: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload> {\n const type = snapshot.modelName;\n const id = snapshot.id;\n assert(`Attempted to delete the ${type} record, but the record has no id`, typeof id === 'string' && id.length > 0);\n\n return this.ajax(this.buildURL(type, id, snapshot, 'deleteRecord'), 'DELETE');\n }\n\n _stripIDFromURL(store: Store, snapshot: Snapshot): string {\n const type = snapshot.modelName;\n const id = snapshot.id;\n assert(\n `Attempted to strip the url from the ${type} record for coalescing, but the record has no id`,\n typeof id === 'string' && id.length > 0\n );\n\n const url = this.buildURL(type, id, snapshot);\n\n const expandedURL = url.split('/');\n // Case when the url is of the format ...something/:id\n // We are decodeURIComponent-ing the lastSegment because if it represents\n // the id, it has been encodeURIComponent-ified within `buildURL`. If we\n // don't do this, then records with id having special characters are not\n // coalesced correctly (see GH #4190 for the reported bug)\n const lastSegment: string = expandedURL[expandedURL.length - 1];\n if (decodeURIComponent(lastSegment) === id) {\n expandedURL[expandedURL.length - 1] = '';\n } else if (id && endsWith(lastSegment, '?id=' + id)) {\n //Case when the url is of the format ...something?id=:id\n expandedURL[expandedURL.length - 1] = lastSegment.substring(0, lastSegment.length - id.length - 1);\n }\n\n return expandedURL.join('/');\n }\n\n // http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers\n maxURLLength = 2048;\n\n /**\n Organize records into groups, each of which is to be passed to separate\n calls to `findMany`.\n\n This implementation groups together records that have the same base URL but\n differing ids. For example `/comments/1` and `/comments/2` will be grouped together\n because we know findMany can coalesce them together as `/comments?ids[]=1&ids[]=2`\n\n It also supports urls where ids are passed as a query param, such as `/comments?id=1`\n but not those where there is more than 1 query param such as `/comments?id=2&name=David`\n Currently only the query param of `id` is supported. If you need to support others, please\n override this or the `_stripIDFromURL` method.\n\n It does not group records that have differing base urls, such as for example: `/posts/1/comments/2`\n and `/posts/2/comments/3`\n\n @public\n @param {Store} store\n @param {Array} snapshots\n @return {Array} an array of arrays of records, each of which is to be\n loaded separately by `findMany`.\n */\n groupRecordsForFindMany(store: Store, snapshots: Snapshot[]): Snapshot[][] {\n const groups: Map<string, Snapshot[]> = new Map();\n const maxURLLength = this.maxURLLength;\n\n snapshots.forEach((snapshot) => {\n const baseUrl = this._stripIDFromURL(store, snapshot);\n if (!groups.has(baseUrl)) {\n groups.set(baseUrl, []);\n }\n\n groups.get(baseUrl)!.push(snapshot);\n });\n\n const groupsArray: Snapshot[][] = [];\n groups.forEach((group, key) => {\n const paramNameLength = '&ids%5B%5D='.length;\n const splitGroups = splitGroupToFitInUrl(store, this, group, maxURLLength, paramNameLength);\n\n splitGroups.forEach((splitGroup) => groupsArray.push(splitGroup));\n });\n\n return groupsArray;\n }\n\n /**\n Takes an ajax response, and returns the json payload or an error.\n\n By default this hook just returns the json payload passed to it.\n You might want to override it in two cases:\n\n 1. Your API might return useful results in the response headers.\n Response headers are passed in as the second argument.\n\n 2. Your API might return errors as successful responses with status code\n 200 and an Errors text or object. You can return a `InvalidError` or a\n `AdapterError` (or a sub class) from this hook and it will automatically\n reject the promise and put your record into the invalid or error state.\n\n Returning a `InvalidError` from this method will cause the\n record to transition into the `invalid` state and make the\n `errors` object available on the record. When returning an\n `InvalidError` the store will attempt to normalize the error data\n returned from the server using the serializer's `extractErrors`\n method.\n\n @since 1.13.0\n @public\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @param {Object} requestData - the original request information\n @return {Object | AdapterError} response\n */\n handleResponse(\n status: number,\n headers: Record<string, string>,\n payload: Payload,\n requestData: RequestData\n ): Payload | typeof AdapterError {\n if (this.isSuccess(status, headers, payload)) {\n return payload;\n } else if (this.isInvalid(status, headers, payload)) {\n return new InvalidError(typeof payload === 'object' && 'errors' in payload ? payload.errors : undefined);\n }\n\n const errors = this.normalizeErrorResponse(status, headers, payload);\n const detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);\n\n switch (status) {\n case 401:\n return new UnauthorizedError(errors, detailedMessage);\n case 403:\n return new ForbiddenError(errors, detailedMessage);\n case 404:\n return new NotFoundError(errors, detailedMessage);\n case 409:\n return new ConflictError(errors, detailedMessage);\n default:\n if (status >= 500) {\n return new ServerError(errors, detailedMessage);\n }\n }\n\n return new AdapterError(errors, detailedMessage) as unknown as typeof AdapterError;\n }\n\n /**\n Default `handleResponse` implementation uses this hook to decide if the\n response is a success.\n\n @since 1.13.0\n @public\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Boolean}\n */\n isSuccess(status: number, _headers: Record<string, unknown>, _payload: Payload): boolean {\n return (status >= 200 && status < 300) || status === 304;\n }\n\n /**\n Default `handleResponse` implementation uses this hook to decide if the\n response is an invalid error.\n\n @since 1.13.0\n @public\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Boolean}\n */\n isInvalid(status: number, _headers: Record<string, unknown>, _payload: Payload): boolean {\n return status === 422;\n }\n\n /**\n Takes a URL, an HTTP method and a hash of data, and makes an\n HTTP request.\n\n When the server responds with a payload, Ember Data will call into `extractSingle`\n or `extractArray` (depending on whether the original query was for one record or\n many records).\n\n By default, `ajax` method has the following behavior:\n\n * It sets the response `dataType` to `\"json\"`\n * If the HTTP method is not `\"GET\"`, it sets the `Content-Type` to be\n `application/json; charset=utf-8`\n * If the HTTP method is not `\"GET\"`, it stringifies the data passed in. The\n data is the serialized record in the case of a save.\n * Registers success and failure handlers.\n\n @private\n @param {String} url\n @param {String} type The request type GET, POST, PUT, DELETE etc.\n @param {Object} options\n @return {Promise} promise\n */\n async ajax(url: string, type: HTTPMethod, options: JQueryAjaxSettings | RequestInit = {}): Promise<AdapterPayload> {\n const requestData: RequestData = {\n url: url,\n method: type,\n };\n\n if (this.useFetch) {\n // @ts-expect-error poorly typed\n const hash: FetchRequestInit = this.ajaxOptions(url, type, options);\n const response = await this._fetchRequest(hash);\n const payload = await determineBodyPromise(response, requestData);\n\n if (response.ok && !(payload instanceof Error)) {\n return fetchSuccessHandler(this, payload, response, requestData);\n } else {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw fetchErrorHandler(this, payload, response, null, requestData);\n }\n } else {\n return execjQAjax(this, requestData, options as JQueryAjaxSettings);\n }\n }\n\n /**\n @private\n @param {Object} options jQuery ajax options to be used for the ajax request\n */\n _ajaxRequest(options: JQueryRequestInit): void {\n assert('You must install jQuery globally when `useFetch` is false', typeof jQuery !== 'undefined');\n void jQuery.ajax(options);\n }\n\n _fetchRequest(options: FetchRequestInit): Promise<Response> {\n const fetchFunction = fetch();\n\n return fetchFunction(options.url, options);\n }\n\n _ajax(options: FetchRequestInit | JQueryRequestInit): void {\n if (this.useFetch) {\n void this._fetchRequest(options as FetchRequestInit);\n } else {\n this._ajaxRequest(options as JQueryRequestInit);\n }\n }\n\n /**\n @private\n @param {String} url\n @param {String} type The request type GET, POST, PUT, DELETE etc.\n @param {Object} options\n @return {Object}\n */\n ajaxOptions(\n url: string,\n method: HTTPMethod,\n options: JQueryAjaxSettings | RequestInit\n ): JQueryRequestInit | FetchRequestInit {\n let reqOptions: JQueryRequestInit | FetchRequestInit = Object.assign(\n {\n url,\n method,\n type: method,\n },\n options\n );\n\n if (this.headers !== undefined) {\n // @ts-expect-error poorly typed\n reqOptions.headers = { ...this.headers, ...reqOptions.headers };\n } else if (!options.headers) {\n reqOptions.headers = {};\n }\n\n // @ts-expect-error poorly typed\n const contentType = reqOptions.contentType || this._defaultContentType;\n\n if (this.useFetch) {\n // @ts-expect-error poorly typed\n if (reqOptions.data && reqOptions.type !== 'GET' && reqOptions.headers) {\n if (!reqOptions.headers['Content-Type'] && !reqOptions.headers['content-type']) {\n reqOptions.headers['content-type'] = contentType;\n }\n }\n // @ts-expect-error poorly typed\n reqOptions = fetchOptions(reqOptions, this);\n } else {\n // GET requests without a body should not have a content-type header\n // and may be unexpected by a server\n // @ts-expect-error poorly typed\n if (reqOptions.data && reqOptions.type !== 'GET') {\n reqOptions = { ...reqOptions, contentType };\n }\n // @ts-expect-error poorly typed\n reqOptions = ajaxOptions(reqOptions, this);\n }\n\n reqOptions.url = this._ajaxURL(reqOptions.url);\n\n return reqOptions;\n }\n\n _ajaxURL(url: string): string {\n if (this.fastboot?.isFastBoot) {\n const httpRegex = /^https?:\\/\\//;\n const protocolRelativeRegex = /^\\/\\//;\n const protocol = this.fastboot.request.protocol;\n const host = this.fastboot.request.host;\n\n if (protocolRelativeRegex.test(url)) {\n return `${protocol}${url}`;\n } else if (!httpRegex.test(url)) {\n try {\n return `${protocol}//${host}${url}`;\n } catch (fbError) {\n throw new Error(\n 'You are using Ember Data with no host defined in your adapter. This will attempt to use the host of the FastBoot request, which is not configured for the current host of this request. Please set the hostWhitelist property for in your environment.js. FastBoot Error: ' +\n (fbError as Error).message\n );\n }\n }\n }\n\n return url;\n }\n\n /**\n @private\n @param {String} responseText\n @return {Object}\n */\n parseErrorResponse(responseText: string): Record<string, unknown> | string {\n let json: string = responseText;\n\n try {\n json = JSON.parse(responseText);\n } catch {\n // ignored\n }\n\n return json;\n }\n\n /**\n @private\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Array} errors payload\n */\n normalizeErrorResponse(\n status: number,\n _headers: Record<string, unknown>,\n payload: Payload\n ): Record<string, unknown>[] {\n if (payload && typeof payload === 'object' && 'errors' in payload && Array.isArray(payload.errors)) {\n return payload.errors;\n } else {\n return [\n {\n status: `${status}`, // Set to a string per the JSON API spec: https://jsonapi.org/format/#errors\n title: 'The backend responded with an error',\n // Detail is intended to be a string, but backends be non-compliant.\n // stringifying gives the user a more friendly error in this situation, whereas\n // they'd instead receive [object Object].\n // JSON.stringify will convert *anything* to a string without erroring.\n detail: typeof payload === 'string' ? payload : JSON.stringify(payload),\n },\n ];\n }\n }\n\n /**\n Generates a detailed (\"friendly\") error message, with plenty\n of information for debugging (good luck!)\n\n @private\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @param {Object} requestData\n @return {String} detailed error message\n */\n generatedDetailedMessage(\n status: number,\n headers: Record<string, string>,\n payload: Payload,\n requestData: RequestData\n ): string {\n let shortenedPayload;\n const payloadContentType = headers['content-type'] || 'Empty Content-Type';\n\n if (payloadContentType === 'text/html' && typeof payload === 'string' && payload.length > 250) {\n shortenedPayload = '[Omitted Lengthy HTML]';\n } else if (typeof payload === 'object' && payload !== null) {\n shortenedPayload = JSON.stringify(payload, null, 2);\n } else {\n shortenedPayload = payload;\n }\n\n const requestDescription = requestData.method + ' ' + requestData.url;\n const payloadDescription = 'Payload (' + payloadContentType + ')';\n\n return [\n 'Ember Data Request ' + requestDescription + ' returned a ' + status,\n payloadDescription,\n shortenedPayload,\n ].join('\\n');\n }\n\n /**\n Used by `findAll` and `findRecord` to build the query's `data` hash\n supplied to the ajax method.\n\n @since 2.5.0\n @public\n @param {Snapshot} snapshot\n @return {Object}\n */\n buildQuery(snapshot: Snapshot | SnapshotRecordArray): QueryState {\n const query: QueryState = {};\n\n if (snapshot) {\n const { include } = snapshot;\n\n if (include) {\n // note: if user passed in an array, this will serialize like `?include[]=foo&include[]=bar`\n // but if user passed in a string, this will serialize like `?include=foo,bar`\n // users that want consistent behavior should override this method\n query.include = include;\n }\n }\n\n return query;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface RESTAdapter extends MixtBuildURLMixin {}\n\nfunction ajaxSuccess(\n adapter: RESTAdapter,\n payload: Payload,\n requestData: RequestData,\n responseData: ResponseData\n): Promise<AdapterPayload> {\n let response;\n try {\n response = adapter.handleResponse(responseData.status, responseData.headers, payload, requestData);\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(error);\n }\n\n if (response && response.isAdapterError) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(response);\n } else {\n return response;\n }\n}\n\nfunction ajaxError(\n adapter: RESTAdapter,\n payload: Payload,\n requestData: RequestData,\n responseData: ResponseData\n): Error | TimeoutError | AbortError | Record<string, unknown> {\n let error;\n\n if (responseData.errorThrown instanceof Error && payload !== '') {\n error = responseData.errorThrown;\n } else if (responseData.textStatus === 'timeout') {\n error = new TimeoutError();\n } else if (responseData.textStatus === 'abort' || responseData.status === 0) {\n error = handleAbort(requestData, responseData);\n } else {\n try {\n error = adapter.handleResponse(\n responseData.status,\n responseData.headers,\n payload || responseData.errorThrown,\n requestData\n );\n } catch (e) {\n error = e;\n }\n }\n\n return error;\n}\n\n// Adapter abort error to include any relevent info, e.g. request/response:\nfunction handleAbort(requestData: RequestData, responseData: ResponseData): AbortError {\n const { method, url, errorThrown } = requestData;\n const { status } = responseData;\n const msg = `Request failed: ${method} ${url} ${String(errorThrown ?? '')}`;\n const errors = [{ title: 'Adapter Error', detail: msg.trim(), status }];\n return new AbortError(errors);\n}\n\n//From http://stackoverflow.com/questions/280634/endswith-in-javascript\nfunction endsWith(string: string, suffix: string): boolean {\n if (typeof String.prototype.endsWith !== 'function') {\n return string.includes(suffix, string.length - suffix.length);\n } else {\n return string.endsWith(suffix);\n }\n}\n\nfunction fetchSuccessHandler(\n adapter: RESTAdapter,\n payload: Payload,\n response: Response,\n requestData: RequestData\n): Promise<AdapterPayload> {\n const responseData = fetchResponseData(response);\n return ajaxSuccess(adapter, payload, requestData, responseData);\n}\n\nfunction fetchErrorHandler(\n adapter: RESTAdapter,\n payload: Payload,\n response: Response,\n errorThrown,\n requestData: RequestData\n): Error | TimeoutError | Record<string, unknown> {\n const responseData = fetchResponseData(response);\n\n if (responseData.status === 200 && payload instanceof Error) {\n responseData.errorThrown = payload;\n // @ts-expect-error poorly typed\n payload = responseData.errorThrown.payload;\n } else {\n responseData.errorThrown = errorThrown;\n if (typeof payload === 'string') {\n payload = adapter.parseErrorResponse(payload);\n }\n }\n return ajaxError(adapter, payload, requestData, responseData);\n}\n\nfunction ajaxSuccessHandler(\n adapter: RESTAdapter,\n payload: Payload,\n jqXHR: JQuery.jqXHR,\n requestData: RequestData\n): Promise<AdapterPayload> {\n const responseData = ajaxResponseData(jqXHR);\n return ajaxSuccess(adapter, payload, requestData, responseData);\n}\n\nfunction ajaxErrorHandler(\n adapter: RESTAdapter,\n jqXHR: JQuery.jqXHR,\n errorThrown: Error | string,\n requestData: RequestData\n) {\n const responseData = ajaxResponseData(jqXHR);\n responseData.errorThrown = errorThrown;\n const payload = adapter.parseErrorResponse(jqXHR.responseText);\n\n if (DEBUG) {\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 const validJSONString = !(responseData.textStatus === 'parsererror' && payload === '');\n warn(message, validJSONString, {\n id: 'ds.adapter.returned-empty-string-as-JSON',\n });\n }\n\n return ajaxError(adapter, payload, requestData, responseData);\n}\n\nfunction fetchResponseData(response: Response): ResponseData {\n return {\n status: response.status,\n textStatus: response.statusText,\n headers: headersToObject(response.headers),\n };\n}\n\nfunction ajaxResponseData(jqXHR: JQuery.jqXHR): ResponseData {\n return {\n status: jqXHR.status,\n textStatus: jqXHR.statusText,\n headers: parseResponseHeaders(jqXHR.getAllResponseHeaders()),\n };\n}\n\nfunction headersToObject(headers: Headers): Record<string, string> {\n const headersObject = {};\n\n if (headers) {\n headers.forEach((value, key) => (headersObject[key] = value));\n }\n\n return headersObject;\n}\n\n/**\n * Helper function that translates the options passed to `jQuery.ajax` into a format that `fetch` expects.\n *\n * @param {Object} _options\n * @param {Adapter} adapter\n * @private\n * @return {Object}\n */\nexport function fetchOptions(\n options: JQueryRequestInit & Partial<FetchRequestInit>,\n adapter: RESTAdapter\n): FetchRequestInit {\n options.credentials = options.credentials || 'same-origin';\n\n if (options.data) {\n // GET and HEAD requests can't have a `body`\n if (options.method === 'GET' || options.method === 'HEAD') {\n // If no options are passed, Ember Data sets `data` to an empty object, which we test for.\n if (Object.keys(options.data).length && options.url) {\n // Test if there are already query params in the url (mimics jQuey.ajax).\n const queryParamDelimiter = options.url.includes('?') ? '&' : '?';\n options.url += `${queryParamDelimiter}${serializeQueryParams(options.data)}`;\n }\n } else {\n // NOTE: a request's body cannot be an object, so we stringify it if it is.\n // JSON.stringify removes keys with values of `undefined` (mimics jQuery.ajax).\n // If the data is not a POJO (it's a String, FormData, etc), we just set it.\n // If the data is a string, we assume it's a stringified object.\n\n /* We check for Objects this way because we want the logic inside the consequent to run\n * if `options.data` is a POJO, not if it is a data structure whose `typeof` returns \"object\"\n * when it's not (Array, FormData, etc). The reason we don't use `options.data.constructor`\n * to check is in case `data` is an object with no prototype (e.g. created with null).\n */\n if (Object.prototype.toString.call(options.data) === '[object Object]') {\n options.body = JSON.stringify(options.data);\n } else {\n // @ts-expect-error poorly typed\n options.body = options.data;\n }\n }\n }\n\n return options;\n}\n\nfunction ajaxOptions(options: JQueryRequestInit, adapter: RESTAdapter): JQueryRequestInit {\n options.dataType = 'json';\n options.context = adapter;\n\n if (options.data && options.type !== 'GET') {\n options.data = JSON.stringify(options.data);\n }\n\n options.beforeSend = function (xhr) {\n if (options.headers) {\n Object.keys(options.headers).forEach((key) => {\n const headerValue = options.headers && options.headers[key];\n const isString = (value: unknown): value is string => typeof value === 'string';\n if (isString(headerValue)) {\n xhr.setRequestHeader(key, headerValue);\n }\n });\n }\n };\n\n return options;\n}\n\nfunction execjQAjax(\n adapter: RESTAdapter,\n requestData: RequestData,\n options: JQueryAjaxSettings\n): Promise<AdapterPayload> {\n const hash = adapter.ajaxOptions(requestData.url, requestData.method, options) as JQueryRequestInit;\n\n return new Promise((resolve, reject) => {\n hash.success = function (payload: Payload, textStatus, jqXHR) {\n const response = ajaxSuccessHandler(adapter, payload, jqXHR, requestData);\n resolve(response);\n };\n\n hash.error = function (jqXHR, textStatus, errorThrown: Error | string) {\n const error = ajaxErrorHandler(adapter, jqXHR, errorThrown, requestData);\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n reject(error);\n };\n\n adapter._ajax(hash);\n });\n}\n\nfunction splitGroupToFitInUrl(\n store: Store,\n adapter: RESTAdapter,\n group: Snapshot[],\n maxURLLength: number,\n paramNameLength: number\n) {\n let idsSize = 0;\n const baseUrl = adapter._stripIDFromURL(store, group[0]);\n const splitGroups: Snapshot[][] = [[]];\n\n group.forEach((snapshot) => {\n const additionalLength = encodeURIComponent(snapshot.id!).length + paramNameLength;\n if (baseUrl.length + idsSize + additionalLength >= maxURLLength) {\n idsSize = 0;\n splitGroups.push([]);\n }\n\n idsSize += additionalLength;\n\n const lastGroupIndex = splitGroups.length - 1;\n splitGroups[lastGroupIndex].push(snapshot);\n });\n\n return splitGroups;\n}\n\nexport { RESTAdapter };\n"],"names":["RESTAdapter","Adapter","extend","BuildURLMixin","useFetch","_defaultContentType","fastboot","_fastboot","getOwner","lookup","n","prototype","computed","value","sortQueryParams","obj","keys","Object","len","length","newQueryParams","sortedKeys","sort","i","coalesceFindRequests","_coalesceFindRequests","findRecord","store","type","id","snapshot","url","buildURL","modelName","query","buildQuery","ajax","data","findAll","sinceToken","snapshotRecordArray","since","queryRecord","adapterOptions","findMany","ids","snapshots","findHasMany","relationship","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","urlPrefix","findBelongsTo","createRecord","serializeIntoHash","updateRecord","schema","deleteRecord","_stripIDFromURL","expandedURL","split","lastSegment","decodeURIComponent","endsWith","substring","join","maxURLLength","groupRecordsForFindMany","groups","Map","forEach","baseUrl","has","set","get","push","groupsArray","group","key","paramNameLength","splitGroups","splitGroupToFitInUrl","splitGroup","handleResponse","status","headers","payload","requestData","isSuccess","isInvalid","InvalidError","errors","undefined","normalizeErrorResponse","detailedMessage","generatedDetailedMessage","UnauthorizedError","ForbiddenError","NotFoundError","ConflictError","ServerError","AdapterError","_headers","_payload","options","method","hash","ajaxOptions","response","_fetchRequest","determineBodyPromise","ok","fetchSuccessHandler","fetchErrorHandler","execjQAjax","_ajaxRequest","jQuery","fetchFunction","fetch","_ajax","reqOptions","assign","contentType","fetchOptions","_ajaxURL","isFastBoot","httpRegex","protocolRelativeRegex","protocol","request","host","fbError","message","parseErrorResponse","responseText","json","JSON","parse","Array","isArray","title","detail","stringify","shortenedPayload","payloadContentType","requestDescription","payloadDescription","include","ajaxSuccess","adapter","responseData","error","Promise","reject","isAdapterError","ajaxError","errorThrown","textStatus","TimeoutError","handleAbort","e","msg","String","trim","AbortError","string","suffix","includes","fetchResponseData","ajaxSuccessHandler","jqXHR","ajaxResponseData","ajaxErrorHandler","validJSONString","warn","statusText","headersToObject","parseResponseHeaders","getAllResponseHeaders","headersObject","credentials","queryParamDelimiter","serializeQueryParams","toString","call","body","dataType","context","beforeSend","xhr","headerValue","isString","setRequestHeader","resolve","success","idsSize","additionalLength","encodeURIComponent","lastGroupIndex"],"mappings":";;;;;;;;;AAAA;AACA;AACA;;AAsEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAE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EAAEA,CAAC,GAAGL,GAAG,EAAEK,CAAC,EAAE,EAAE;AAC5BH,MAAAA,cAAc,CAACC,UAAU,CAACE,CAAC,CAAC,CAAC,GAAGR,GAAG,CAACM,UAAU,CAACE,CAAC,CAAC,CAAC;AACpD;AACA,IAAA,OAAOH,cAAc;AACvB;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAYE,IAAII,oBAAoBA,GAAG;AACzB,IAAA,MAAMA,oBAAoB,GAAG,IAAI,CAACC,qBAAqB;AACvD,IAAA,IAAI,OAAOD,oBAAoB,KAAK,SAAS,EAAE;AAC7C,MAAA,OAAOA,oBAAoB;AAC7B;AACA,IAAA,OAAQ,IAAI,CAACC,qBAAqB,GAAG,KAAK;AAC5C;EAEA,IAAID,oBAAoBA,CAACX,KAAc,EAAE;IACvC,IAAI,CAACY,qBAAqB,GAAGZ,KAAK;AACpC;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAME;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAME;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAME;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAIEa,UAAUA,CAACC,KAAY,EAAEC,IAAiB,EAAEC,EAAU,EAAEC,QAAkB,EAA2B;AACnG,IAAA,MAAMC,GAAG,GAAG,IAAI,CAACC,QAAQ,CAACJ,IAAI,CAACK,SAAS,EAAEJ,EAAE,EAAEC,QAAQ,EAAE,YAAY,CAAC;AACrE,IAAA,MAAMI,KAAiB,GAAG,IAAI,C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