@warp-drive/legacy 5.6.0-alpha.11

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 (211) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE.md +23 -0
  3. package/README.md +54 -0
  4. package/addon-main.cjs +5 -0
  5. package/declarations/adapter/-private/build-url-mixin.d.ts +34 -0
  6. package/declarations/adapter/-private/build-url-mixin.d.ts.map +1 -0
  7. package/declarations/adapter/-private/fastboot-interface.d.ts +9 -0
  8. package/declarations/adapter/-private/fastboot-interface.d.ts.map +1 -0
  9. package/declarations/adapter/-private/utils/continue-on-reject.d.ts +8 -0
  10. package/declarations/adapter/-private/utils/continue-on-reject.d.ts.map +1 -0
  11. package/declarations/adapter/-private/utils/determine-body-promise.d.ts +5 -0
  12. package/declarations/adapter/-private/utils/determine-body-promise.d.ts.map +1 -0
  13. package/declarations/adapter/-private/utils/fetch.d.ts +9 -0
  14. package/declarations/adapter/-private/utils/fetch.d.ts.map +1 -0
  15. package/declarations/adapter/-private/utils/parse-response-headers.d.ts +2 -0
  16. package/declarations/adapter/-private/utils/parse-response-headers.d.ts.map +1 -0
  17. package/declarations/adapter/-private/utils/serialize-into-hash.d.ts +7 -0
  18. package/declarations/adapter/-private/utils/serialize-into-hash.d.ts.map +1 -0
  19. package/declarations/adapter/-private/utils/serialize-query-params.d.ts +6 -0
  20. package/declarations/adapter/-private/utils/serialize-query-params.d.ts.map +1 -0
  21. package/declarations/adapter/-private.d.ts +6 -0
  22. package/declarations/adapter/-private.d.ts.map +1 -0
  23. package/declarations/adapter/error.d.ts +188 -0
  24. package/declarations/adapter/error.d.ts.map +1 -0
  25. package/declarations/adapter/json-api.d.ts +234 -0
  26. package/declarations/adapter/json-api.d.ts.map +1 -0
  27. package/declarations/adapter/rest.d.ts +823 -0
  28. package/declarations/adapter/rest.d.ts.map +1 -0
  29. package/declarations/adapter.d.ts +801 -0
  30. package/declarations/adapter.d.ts.map +1 -0
  31. package/declarations/compat/-private.d.ts +14 -0
  32. package/declarations/compat/-private.d.ts.map +1 -0
  33. package/declarations/compat/builders/find-all.d.ts +33 -0
  34. package/declarations/compat/builders/find-all.d.ts.map +1 -0
  35. package/declarations/compat/builders/find-record.d.ts +54 -0
  36. package/declarations/compat/builders/find-record.d.ts.map +1 -0
  37. package/declarations/compat/builders/query.d.ts +61 -0
  38. package/declarations/compat/builders/query.d.ts.map +1 -0
  39. package/declarations/compat/builders/save-record.d.ts +32 -0
  40. package/declarations/compat/builders/save-record.d.ts.map +1 -0
  41. package/declarations/compat/builders/utils.d.ts +4 -0
  42. package/declarations/compat/builders/utils.d.ts.map +1 -0
  43. package/declarations/compat/builders.d.ts +15 -0
  44. package/declarations/compat/builders.d.ts.map +1 -0
  45. package/declarations/compat/legacy-network-handler/fetch-manager.d.ts +47 -0
  46. package/declarations/compat/legacy-network-handler/fetch-manager.d.ts.map +1 -0
  47. package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +3 -0
  48. package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts.map +1 -0
  49. package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +12 -0
  50. package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts.map +1 -0
  51. package/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +6 -0
  52. package/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts.map +1 -0
  53. package/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +3 -0
  54. package/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts.map +1 -0
  55. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +527 -0
  56. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts.map +1 -0
  57. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +224 -0
  58. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts.map +1 -0
  59. package/declarations/compat/legacy-network-handler/serializer-response.d.ts +7 -0
  60. package/declarations/compat/legacy-network-handler/serializer-response.d.ts.map +1 -0
  61. package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +89 -0
  62. package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts.map +1 -0
  63. package/declarations/compat/legacy-network-handler/snapshot.d.ts +237 -0
  64. package/declarations/compat/legacy-network-handler/snapshot.d.ts.map +1 -0
  65. package/declarations/compat/utils.d.ts +138 -0
  66. package/declarations/compat/utils.d.ts.map +1 -0
  67. package/declarations/compat.d.ts +134 -0
  68. package/declarations/compat.d.ts.map +1 -0
  69. package/declarations/model/-private/attr.d.ts +165 -0
  70. package/declarations/model/-private/attr.d.ts.map +1 -0
  71. package/declarations/model/-private/attr.type-test.d.ts +2 -0
  72. package/declarations/model/-private/attr.type-test.d.ts.map +1 -0
  73. package/declarations/model/-private/belongs-to.d.ts +173 -0
  74. package/declarations/model/-private/belongs-to.d.ts.map +1 -0
  75. package/declarations/model/-private/belongs-to.type-test.d.ts +2 -0
  76. package/declarations/model/-private/belongs-to.type-test.d.ts.map +1 -0
  77. package/declarations/model/-private/debug/assert-polymorphic-type.d.ts +6 -0
  78. package/declarations/model/-private/debug/assert-polymorphic-type.d.ts.map +1 -0
  79. package/declarations/model/-private/errors.d.ts +290 -0
  80. package/declarations/model/-private/errors.d.ts.map +1 -0
  81. package/declarations/model/-private/has-many.d.ts +164 -0
  82. package/declarations/model/-private/has-many.d.ts.map +1 -0
  83. package/declarations/model/-private/has-many.type-test.d.ts +2 -0
  84. package/declarations/model/-private/has-many.type-test.d.ts.map +1 -0
  85. package/declarations/model/-private/hooks.d.ts +11 -0
  86. package/declarations/model/-private/hooks.d.ts.map +1 -0
  87. package/declarations/model/-private/legacy-relationships-support.d.ts +57 -0
  88. package/declarations/model/-private/legacy-relationships-support.d.ts.map +1 -0
  89. package/declarations/model/-private/model-for-mixin.d.ts +4 -0
  90. package/declarations/model/-private/model-for-mixin.d.ts.map +1 -0
  91. package/declarations/model/-private/model-methods.d.ts +35 -0
  92. package/declarations/model/-private/model-methods.d.ts.map +1 -0
  93. package/declarations/model/-private/model.d.ts +1270 -0
  94. package/declarations/model/-private/model.d.ts.map +1 -0
  95. package/declarations/model/-private/model.type-test.d.ts +2 -0
  96. package/declarations/model/-private/model.type-test.d.ts.map +1 -0
  97. package/declarations/model/-private/notify-changes.d.ts +5 -0
  98. package/declarations/model/-private/notify-changes.d.ts.map +1 -0
  99. package/declarations/model/-private/promise-belongs-to.d.ts +40 -0
  100. package/declarations/model/-private/promise-belongs-to.d.ts.map +1 -0
  101. package/declarations/model/-private/promise-many-array.d.ts +126 -0
  102. package/declarations/model/-private/promise-many-array.d.ts.map +1 -0
  103. package/declarations/model/-private/promise-proxy-base.d.ts +3 -0
  104. package/declarations/model/-private/promise-proxy-base.d.ts.map +1 -0
  105. package/declarations/model/-private/record-state.d.ts +78 -0
  106. package/declarations/model/-private/record-state.d.ts.map +1 -0
  107. package/declarations/model/-private/references/belongs-to.d.ts +495 -0
  108. package/declarations/model/-private/references/belongs-to.d.ts.map +1 -0
  109. package/declarations/model/-private/references/has-many.d.ts +504 -0
  110. package/declarations/model/-private/references/has-many.d.ts.map +1 -0
  111. package/declarations/model/-private/schema-provider.d.ts +63 -0
  112. package/declarations/model/-private/schema-provider.d.ts.map +1 -0
  113. package/declarations/model/-private/type-utils.d.ts +57 -0
  114. package/declarations/model/-private/type-utils.d.ts.map +1 -0
  115. package/declarations/model/-private/util.d.ts +6 -0
  116. package/declarations/model/-private/util.d.ts.map +1 -0
  117. package/declarations/model/-private.d.ts +8 -0
  118. package/declarations/model/-private.d.ts.map +1 -0
  119. package/declarations/model/migration-support.d.ts +287 -0
  120. package/declarations/model/migration-support.d.ts.map +1 -0
  121. package/declarations/model/migration-support.type-test.d.ts +2 -0
  122. package/declarations/model/migration-support.type-test.d.ts.map +1 -0
  123. package/declarations/model.d.ts +50 -0
  124. package/declarations/model.d.ts.map +1 -0
  125. package/declarations/serializer/-private/embedded-records-mixin.d.ts +97 -0
  126. package/declarations/serializer/-private/embedded-records-mixin.d.ts.map +1 -0
  127. package/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
  128. package/declarations/serializer/-private/transforms/boolean.d.ts.map +1 -0
  129. package/declarations/serializer/-private/transforms/boolean.type-test.d.ts +2 -0
  130. package/declarations/serializer/-private/transforms/boolean.type-test.d.ts.map +1 -0
  131. package/declarations/serializer/-private/transforms/date.d.ts +28 -0
  132. package/declarations/serializer/-private/transforms/date.d.ts.map +1 -0
  133. package/declarations/serializer/-private/transforms/number.d.ts +29 -0
  134. package/declarations/serializer/-private/transforms/number.d.ts.map +1 -0
  135. package/declarations/serializer/-private/transforms/string.d.ts +29 -0
  136. package/declarations/serializer/-private/transforms/string.d.ts.map +1 -0
  137. package/declarations/serializer/-private/transforms/transform.d.ts +119 -0
  138. package/declarations/serializer/-private/transforms/transform.d.ts.map +1 -0
  139. package/declarations/serializer/-private/utils.d.ts +4 -0
  140. package/declarations/serializer/-private/utils.d.ts.map +1 -0
  141. package/declarations/serializer/json-api.d.ts +496 -0
  142. package/declarations/serializer/json-api.d.ts.map +1 -0
  143. package/declarations/serializer/json.d.ts +1047 -0
  144. package/declarations/serializer/json.d.ts.map +1 -0
  145. package/declarations/serializer/rest.d.ts +554 -0
  146. package/declarations/serializer/rest.d.ts.map +1 -0
  147. package/declarations/serializer/transform.d.ts +6 -0
  148. package/declarations/serializer/transform.d.ts.map +1 -0
  149. package/declarations/serializer.d.ts +258 -0
  150. package/declarations/serializer.d.ts.map +1 -0
  151. package/dist/-private-DFfBszo5.js +1182 -0
  152. package/dist/-private-DFfBszo5.js.map +1 -0
  153. package/dist/adapter/-private.js +1 -0
  154. package/dist/adapter/-private.js.map +1 -0
  155. package/dist/adapter/error.js +254 -0
  156. package/dist/adapter/error.js.map +1 -0
  157. package/dist/adapter/json-api.js +129 -0
  158. package/dist/adapter/json-api.js.map +1 -0
  159. package/dist/adapter/rest.js +1262 -0
  160. package/dist/adapter/rest.js.map +1 -0
  161. package/dist/adapter.js +1284 -0
  162. package/dist/adapter.js.map +1 -0
  163. package/dist/compat/-private.js +1 -0
  164. package/dist/compat/-private.js.map +1 -0
  165. package/dist/compat/builders.js +292 -0
  166. package/dist/compat/builders.js.map +1 -0
  167. package/dist/compat/utils.js +225 -0
  168. package/dist/compat/utils.js.map +1 -0
  169. package/dist/compat.js +999 -0
  170. package/dist/compat.js.map +1 -0
  171. package/dist/errors-D74uk36r.js +2541 -0
  172. package/dist/errors-D74uk36r.js.map +1 -0
  173. package/dist/json-BCH3fil7.js +1349 -0
  174. package/dist/json-BCH3fil7.js.map +1 -0
  175. package/dist/model/-private.js +2 -0
  176. package/dist/model/-private.js.map +1 -0
  177. package/dist/model/migration-support.js +453 -0
  178. package/dist/model/migration-support.js.map +1 -0
  179. package/dist/model.js +736 -0
  180. package/dist/model.js.map +1 -0
  181. package/dist/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  182. package/dist/runtime-BPCpkOf1-BKOwiRJp.js.map +1 -0
  183. package/dist/schema-provider-CXFLTMjg.js +2228 -0
  184. package/dist/schema-provider-CXFLTMjg.js.map +1 -0
  185. package/dist/serialize-into-hash-BxfqWC8u.js +260 -0
  186. package/dist/serialize-into-hash-BxfqWC8u.js.map +1 -0
  187. package/dist/serializer/json-api.js +514 -0
  188. package/dist/serializer/json-api.js.map +1 -0
  189. package/dist/serializer/json.js +6 -0
  190. package/dist/serializer/json.js.map +1 -0
  191. package/dist/serializer/rest.js +1245 -0
  192. package/dist/serializer/rest.js.map +1 -0
  193. package/dist/serializer/transform.js +313 -0
  194. package/dist/serializer/transform.js.map +1 -0
  195. package/dist/serializer.js +252 -0
  196. package/dist/serializer.js.map +1 -0
  197. package/logos/NCC-1701-a-blue.svg +4 -0
  198. package/logos/NCC-1701-a-gold.svg +4 -0
  199. package/logos/NCC-1701-a-gold_100.svg +1 -0
  200. package/logos/NCC-1701-a-gold_base-64.txt +1 -0
  201. package/logos/NCC-1701-a.svg +4 -0
  202. package/logos/README.md +4 -0
  203. package/logos/docs-badge.svg +2 -0
  204. package/logos/ember-data-logo-dark.svg +12 -0
  205. package/logos/ember-data-logo-light.svg +12 -0
  206. package/logos/github-header.svg +444 -0
  207. package/logos/social1.png +0 -0
  208. package/logos/social2.png +0 -0
  209. package/logos/warp-drive-logo-dark.svg +4 -0
  210. package/logos/warp-drive-logo-gold.svg +4 -0
  211. package/package.json +72 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ # @warp-drive/legacy changelog
package/LICENSE.md ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017-2025 Ember.js and contributors
4
+ Copyright (c) 2011-2017 Tilde, Inc. and contributors
5
+ Copyright (c) 2011 LivingSocial Inc.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ <h1 align="center">
2
+ <img
3
+ class="project-logo"
4
+ src="./logos/github-header.svg#gh-light-mode-only"
5
+ alt="WarpDrive | Boldly go where no app has gone before"
6
+ title="WarpDrive | Boldly go where no app has gone before"
7
+ />
8
+ <img
9
+ class="project-logo"
10
+ src="./logos/github-header.svg#gh-dark-mode-only"
11
+ alt="WarpDrive | Boldly go where no app has gone before"
12
+ title="WarpDrive | Boldly go where no app has gone before"
13
+ />
14
+ </h1>
15
+
16
+ ![NPM Stable Version](https://img.shields.io/npm/v/ember-data/latest?label=version&style=flat&color=FFC474)
17
+ ![NPM Downloads](https://img.shields.io/npm/dm/ember-data.svg?style=flat&color=FFC474)
18
+ ![License](https://img.shields.io/github/license/emberjs/data.svg?style=flat&color=FFC474)
19
+ [![Docs](./logos/docs-badge.svg)](https://docs.warp-drive.io)
20
+ [![Discord Community Server](https://img.shields.io/badge/Discord-grey?logo=discord&logoColor=FFC474)](https://discord.gg/zT3asNS
21
+ )
22
+
23
+ <br>
24
+
25
+ <p align="center">
26
+ Decommissioned Packages for <em>Warp</em><strong>Drive</strong> that your App may want to continue using for a little while longer.
27
+ </p>
28
+
29
+ <br>
30
+
31
+ ## Installation
32
+
33
+ ```sh
34
+ pnpm add -E @warp-drive/legacy
35
+ ```
36
+
37
+ <br>
38
+
39
+ ## Documentation
40
+
41
+ *Get Started* → [Guides](https://docs.warp-drive.io)
42
+
43
+
44
+ <br>
45
+
46
+ ## Code of Conduct
47
+
48
+ Refer to the [Code of Conduct](https://github.com/emberjs/data/blob/main/CODE_OF_CONDUCT.md) for community guidelines and inclusivity.
49
+
50
+ <br>
51
+
52
+ ### License
53
+
54
+ This project is licensed under the [MIT License](LICENSE.md).
package/addon-main.cjs ADDED
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const { addonShim } = require('@warp-drive/core/addon-shim.cjs');
4
+
5
+ module.exports = addonShim(__dirname);
@@ -0,0 +1,34 @@
1
+ import Mixin from '@ember/object/mixin';
2
+ import type { Snapshot, SnapshotRecordArray } from '../../compat/-private.ts';
3
+ export interface BuildURLMixin {
4
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: 'findRecord'): string;
5
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: null, snapshot: SnapshotRecordArray, requestType: 'findAll'): string;
6
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: null, snapshot: null, requestType: 'query', query: Record<string, unknown>): string;
7
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: null, snapshot: null, requestType: 'queryRecord', query: Record<string, unknown>): string;
8
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: string[], snapshot: Snapshot[], requestType: 'findMany'): string;
9
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: 'findHasMany'): string;
10
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: 'findBelongsTo'): string;
11
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: string | null, snapshot: Snapshot, requestType: 'createRecord'): string;
12
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: 'updateRecord'): string;
13
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: 'deleteRecord'): string;
14
+ buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot): string;
15
+ _buildURL(this: MixtBuildURLMixin, modelName: string | null | undefined, id?: string | null): string;
16
+ urlForFindRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
17
+ urlForFindAll(this: MixtBuildURLMixin, modelName: string, snapshots: SnapshotRecordArray): string;
18
+ urlForQueryRecord(this: MixtBuildURLMixin, query: Record<string, unknown>, modelName: string): string;
19
+ urlForQuery(this: MixtBuildURLMixin, query: Record<string, unknown>, modelName: string): string;
20
+ urlForFindMany(this: MixtBuildURLMixin, ids: string[], modelName: string, snapshots: Snapshot[]): string;
21
+ urlForFindHasMany(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
22
+ urlForFindBelongsTo(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
23
+ urlForCreateRecord(this: MixtBuildURLMixin, modelName: string, snapshot: Snapshot): string;
24
+ urlForUpdateRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
25
+ urlForDeleteRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
26
+ urlPrefix(this: MixtBuildURLMixin, path?: string | null, parentURL?: string): string;
27
+ pathForType(this: MixtBuildURLMixin, modelName: string): string;
28
+ }
29
+ export interface MixtBuildURLMixin extends BuildURLMixin {
30
+ host: string | null;
31
+ namespace: string | null;
32
+ }
33
+ export declare const BuildURLMixin: Mixin;
34
+ //# sourceMappingURL=build-url-mixin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-url-mixin.d.ts","sourceRoot":"","sources":["../../../src/adapter/-private/build-url-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAIxC,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAY9E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CACN,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,YAAY,GACxB,MAAM,CAAC;IACV,QAAQ,CACN,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,IAAI,EACR,QAAQ,EAAE,mBAAmB,EAC7B,WAAW,EAAE,SAAS,GACrB,MAAM,CAAC;IACV,QAAQ,CACN,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,IAAI,EACR,QAAQ,EAAE,IAAI,EACd,WAAW,EAAE,OAAO,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAAC;IACV,QAAQ,CACN,IAAI,EAAE,iBAA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,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IACvG,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IACvG,SAAS,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrF,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACjE;AAKD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAojBD,eAAO,MAAM,aAAa,OAA2B,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface Request {
2
+ protocol: string;
3
+ host: string;
4
+ }
5
+ export interface FastBoot {
6
+ isFastBoot: boolean;
7
+ request: Request;
8
+ }
9
+ //# sourceMappingURL=fastboot-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fastboot-interface.d.ts","sourceRoot":"","sources":["../../../src/adapter/-private/fastboot-interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A utility function that returns a promise that resolves
3
+ * even when the source promise rejects.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare function continueOnReject<T>(promise: Promise<T>): Promise<T>;
8
+ //# sourceMappingURL=continue-on-reject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continue-on-reject.d.ts","sourceRoot":"","sources":["../../../../src/adapter/-private/utils/continue-on-reject.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEnE"}
@@ -0,0 +1,5 @@
1
+ import type { RequestData } from '../../rest.ts';
2
+ type Payload = Error | Record<string, unknown> | unknown[] | string | undefined;
3
+ export declare function determineBodyPromise(response: Response, requestData: RequestData): Promise<Payload>;
4
+ export {};
5
+ //# sourceMappingURL=determine-body-promise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"determine-body-promise.d.ts","sourceRoot":"","sources":["../../../../src/adapter/-private/utils/determine-body-promise.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,KAAK,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;AA2DhF,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAInG"}
@@ -0,0 +1,9 @@
1
+ type FetchFunction = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
2
+ type MockRequest = {
3
+ protocol?: string;
4
+ get(key: string): string | undefined;
5
+ };
6
+ export declare function getFetchFunction(): FetchFunction;
7
+ export declare function setupFastboot(fastBootRequest: MockRequest): void;
8
+ export {};
9
+ //# sourceMappingURL=fetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/adapter/-private/utils/fetch.ts"],"names":[],"mappings":"AAEA,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAGnF,KAAK,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAG/E,wBAAgB,gBAAgB,IAAI,aAAa,CAgEhD;AAED,wBAAgB,aAAa,CAAC,eAAe,EAAE,WAAW,QAEzD"}
@@ -0,0 +1,2 @@
1
+ export declare function parseResponseHeaders(headersString: string): Record<string, string>;
2
+ //# sourceMappingURL=parse-response-headers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-response-headers.d.ts","sourceRoot":"","sources":["../../../../src/adapter/-private/utils/parse-response-headers.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqClF"}
@@ -0,0 +1,7 @@
1
+ import type { Store } from '@warp-drive/core';
2
+ import type { ModelSchema } from '@warp-drive/core/types';
3
+ import { type Snapshot } from '../../../compat/-private.ts';
4
+ export declare function serializeIntoHash(store: Store, modelClass: ModelSchema, snapshot: Snapshot, options?: {
5
+ includeId?: boolean;
6
+ }): {};
7
+ //# sourceMappingURL=serialize-into-hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize-into-hash.d.ts","sourceRoot":"","sources":["../../../../src/adapter/-private/utils/serialize-into-hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,6BAA6B,CAAC;AAM1E,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,WAAW,EACvB,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAwB,MAcvD"}
@@ -0,0 +1,6 @@
1
+ interface PlainObject {
2
+ [key: string]: string | PlainObject | PlainObject[] | string[];
3
+ }
4
+ export declare function serializeQueryParams(queryParamsObject: PlainObject | string): string;
5
+ export {};
6
+ //# sourceMappingURL=serialize-query-params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize-query-params.d.ts","sourceRoot":"","sources":["../../../../src/adapter/-private/utils/serialize-query-params.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,EAAE,GAAG,MAAM,EAAE,CAAC;CAChE;AA6DD,wBAAgB,oBAAoB,CAAC,iBAAiB,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CAEpF"}
@@ -0,0 +1,6 @@
1
+ export { parseResponseHeaders } from './-private/utils/parse-response-headers.ts';
2
+ export { determineBodyPromise } from './-private/utils/determine-body-promise.ts';
3
+ export { serializeQueryParams } from './-private/utils/serialize-query-params.ts';
4
+ export { getFetchFunction as fetch, setupFastboot } from './-private/utils/fetch.ts';
5
+ export { serializeIntoHash } from './-private/utils/serialize-into-hash.ts';
6
+ //# sourceMappingURL=-private.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"-private.d.ts","sourceRoot":"","sources":["../../src/adapter/-private.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,gBAAgB,IAAI,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC"}
@@ -0,0 +1,188 @@
1
+ export const AdapterError: typeof _AdapterError;
2
+ export class InvalidError {
3
+ private constructor();
4
+ code: string;
5
+ }
6
+ export class TimeoutError {
7
+ private constructor();
8
+ code: string;
9
+ }
10
+ export class AbortError {
11
+ private constructor();
12
+ code: string;
13
+ }
14
+ export class UnauthorizedError {
15
+ private constructor();
16
+ code: string;
17
+ }
18
+ export class ForbiddenError {
19
+ private constructor();
20
+ code: string;
21
+ }
22
+ export class NotFoundError {
23
+ private constructor();
24
+ code: string;
25
+ }
26
+ export class ConflictError {
27
+ private constructor();
28
+ code: string;
29
+ }
30
+ export class ServerError {
31
+ private constructor();
32
+ code: string;
33
+ }
34
+ /**
35
+ ## Overview
36
+
37
+ <blockquote style="margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;">
38
+ <p>
39
+ ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
40
+ If starting a new app or thinking of implementing a new adapter, consider writing a
41
+ <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>
42
+ </p>
43
+ </blockquote>
44
+
45
+ An `AdapterError` is used by an adapter to signal that an error occurred
46
+ during a request to an external API. It indicates a generic error, and
47
+ subclasses are used to indicate specific error states.
48
+
49
+ To create a custom error to signal a specific error state in communicating
50
+ with an external API, extend the `AdapterError`. For example, if the
51
+ external API exclusively used HTTP `503 Service Unavailable` to indicate
52
+ it was closed for maintenance:
53
+
54
+ ```js [app/adapters/maintenance-error.js]
55
+ import AdapterError from '@ember-data/adapter/error';
56
+
57
+ export default AdapterError.extend({ message: "Down for maintenance." });
58
+ ```
59
+
60
+ This error would then be returned by an adapter's `handleResponse` method:
61
+
62
+ ```js [app/adapters/application.js]
63
+ import JSONAPIAdapter from '@ember-data/adapter/json-api';
64
+ import MaintenanceError from './maintenance-error';
65
+
66
+ export default class ApplicationAdapter extends JSONAPIAdapter {
67
+ handleResponse(status) {
68
+ if (503 === status) {
69
+ return new MaintenanceError();
70
+ }
71
+
72
+ return super.handleResponse(...arguments);
73
+ }
74
+ }
75
+ ```
76
+
77
+ And can then be detected in an application and used to send the user to an
78
+ `under-maintenance` route:
79
+
80
+ ```js [app/routes/application.js]
81
+ import MaintenanceError from '../adapters/maintenance-error';
82
+
83
+ export default class ApplicationRoute extends Route {
84
+ actions: {
85
+ error(error, transition) {
86
+ if (error instanceof MaintenanceError) {
87
+ this.transitionTo('under-maintenance');
88
+ return;
89
+ }
90
+
91
+ // ...other error handling logic
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ @class AdapterError
98
+ @public
99
+ */
100
+ declare function _AdapterError(errors: any, message?: string): void;
101
+ declare class _AdapterError {
102
+ /**
103
+ ## Overview
104
+
105
+ <blockquote style="margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;">
106
+ <p>
107
+ ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
108
+ If starting a new app or thinking of implementing a new adapter, consider writing a
109
+ <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>
110
+ </p>
111
+ </blockquote>
112
+
113
+ An `AdapterError` is used by an adapter to signal that an error occurred
114
+ during a request to an external API. It indicates a generic error, and
115
+ subclasses are used to indicate specific error states.
116
+
117
+ To create a custom error to signal a specific error state in communicating
118
+ with an external API, extend the `AdapterError`. For example, if the
119
+ external API exclusively used HTTP `503 Service Unavailable` to indicate
120
+ it was closed for maintenance:
121
+
122
+ ```js [app/adapters/maintenance-error.js]
123
+ import AdapterError from '@ember-data/adapter/error';
124
+
125
+ export default AdapterError.extend({ message: "Down for maintenance." });
126
+ ```
127
+
128
+ This error would then be returned by an adapter's `handleResponse` method:
129
+
130
+ ```js [app/adapters/application.js]
131
+ import JSONAPIAdapter from '@ember-data/adapter/json-api';
132
+ import MaintenanceError from './maintenance-error';
133
+
134
+ export default class ApplicationAdapter extends JSONAPIAdapter {
135
+ handleResponse(status) {
136
+ if (503 === status) {
137
+ return new MaintenanceError();
138
+ }
139
+
140
+ return super.handleResponse(...arguments);
141
+ }
142
+ }
143
+ ```
144
+
145
+ And can then be detected in an application and used to send the user to an
146
+ `under-maintenance` route:
147
+
148
+ ```js [app/routes/application.js]
149
+ import MaintenanceError from '../adapters/maintenance-error';
150
+
151
+ export default class ApplicationRoute extends Route {
152
+ actions: {
153
+ error(error, transition) {
154
+ if (error instanceof MaintenanceError) {
155
+ this.transitionTo('under-maintenance');
156
+ return;
157
+ }
158
+
159
+ // ...other error handling logic
160
+ }
161
+ }
162
+ }
163
+ ```
164
+
165
+ @class AdapterError
166
+ @public
167
+ */
168
+ constructor(errors: any, message?: string);
169
+ isAdapterError: boolean;
170
+ stack: string | undefined;
171
+ description: any;
172
+ fileName: any;
173
+ lineNumber: any;
174
+ message: string | undefined;
175
+ name: string | undefined;
176
+ number: any;
177
+ errors: any;
178
+ code: string;
179
+ }
180
+ declare namespace _AdapterError {
181
+ function extend({ message: defaultMessage }?: {}): {
182
+ (errors: any, message: any): void;
183
+ prototype: any;
184
+ extend: ({ message: defaultMessage }?: {}) => /*elided*/ any;
185
+ };
186
+ }
187
+ export {};
188
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/adapter/error.js"],"names":[],"mappings":"AA+FA,gDAA0E;;;IAmF1E,aAA2B;;;;IA+B3B,aAA2B;;;;IAY3B,aAAyB;;;;IAmCzB,aAAgC;;;;IAgBhC,aAA6B;;;;IAsC7B,aAA4B;;;;IAgB5B,aAA4B;;;;IAc5B,aAA0B;;AAjV1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEE;AACF,oEAoBC;;IAtFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiEE;IACF,2CAoBC;IAnBC,wBAA0B;IAIxB,0BAAwB;IACxB,iBAAoC;IACpC,cAA8B;IAC9B,gBAAkC;IAClC,4BAA4B;IAC5B,yBAAsB;IACtB,YAA0B;IAG5B,YAKC;IAIH,aAA4B;;;IAMnB;;;;MAEN"}
@@ -0,0 +1,234 @@
1
+ import type { Store } from '@warp-drive/core';
2
+ import type { ModelSchema } from '@warp-drive/core/types';
3
+ import type { HTTPMethod } from '@warp-drive/core/types/request';
4
+ import type { AdapterPayload } from '../compat.ts';
5
+ import type { Snapshot, SnapshotRecordArray } from '../compat/-private.ts';
6
+ import type { FetchRequestInit, JQueryRequestInit, QueryState } from './rest.ts';
7
+ import { RESTAdapter } from './rest.ts';
8
+ /**
9
+ ## Overview
10
+
11
+ <blockquote style="margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;">
12
+ <p>
13
+ ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
14
+ If starting a new app or thinking of implementing a new adapter, consider writing a
15
+ <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>
16
+ </p>
17
+ </blockquote>
18
+
19
+ The `JSONAPIAdapter` is an adapter whichtransforms the store's
20
+ requests into HTTP requests that follow the [JSON API format](http://jsonapi.org/format/).
21
+
22
+ ## JSON API Conventions
23
+
24
+ The JSONAPIAdapter uses JSON API conventions for building the URL
25
+ for a record and selecting the HTTP verb to use with a request. The
26
+ actions you can take on a record map onto the following URLs in the
27
+ JSON API adapter:
28
+
29
+ <table>
30
+ <tr>
31
+ <th>
32
+ Action
33
+ </th>
34
+ <th>
35
+ HTTP Verb
36
+ </th>
37
+ <th>
38
+ URL
39
+ </th>
40
+ </tr>
41
+ <tr>
42
+ <th>
43
+ `store.findRecord('post', 123)`
44
+ </th>
45
+ <td>
46
+ GET
47
+ </td>
48
+ <td>
49
+ /posts/123
50
+ </td>
51
+ </tr>
52
+ <tr>
53
+ <th>
54
+ `store.findAll('post')`
55
+ </th>
56
+ <td>
57
+ GET
58
+ </td>
59
+ <td>
60
+ /posts
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <th>
65
+ Update `postRecord.save()`
66
+ </th>
67
+ <td>
68
+ PATCH
69
+ </td>
70
+ <td>
71
+ /posts/123
72
+ </td>
73
+ </tr>
74
+ <tr>
75
+ <th>
76
+ Create `store.createRecord('post').save()`
77
+ </th>
78
+ <td>
79
+ POST
80
+ </td>
81
+ <td>
82
+ /posts
83
+ </td>
84
+ </tr>
85
+ <tr>
86
+ <th>
87
+ Delete `postRecord.destroyRecord()`
88
+ </th>
89
+ <td>
90
+ DELETE
91
+ </td>
92
+ <td>
93
+ /posts/123
94
+ </td>
95
+ </tr>
96
+ </table>
97
+
98
+ ## Success and failure
99
+
100
+ The JSONAPIAdapter will consider a success any response with a
101
+ status code of the 2xx family ("Success"), as well as 304 ("Not
102
+ Modified"). Any other status code will be considered a failure.
103
+
104
+ On success, the request promise will be resolved with the full
105
+ response payload.
106
+
107
+ Failed responses with status code 422 ("Unprocessable Entity") will
108
+ be considered "invalid". The response will be discarded, except for
109
+ the `errors` key. The request promise will be rejected with a
110
+ `InvalidError`. This error object will encapsulate the saved
111
+ `errors` value.
112
+
113
+ Any other status codes will be treated as an adapter error. The
114
+ request promise will be rejected, similarly to the invalid case,
115
+ but with an instance of `AdapterError` instead.
116
+
117
+ ### Endpoint path customization
118
+
119
+ Endpoint paths can be prefixed with a `namespace` by setting the
120
+ namespace property on the adapter:
121
+
122
+ ```js [app/adapters/application.js]
123
+ import JSONAPIAdapter from '@ember-data/adapter/json-api';
124
+
125
+ export default class ApplicationAdapter extends JSONAPIAdapter {
126
+ namespace = 'api/1';
127
+ }
128
+ ```
129
+ Requests for the `person` model would now target `/api/1/people/1`.
130
+
131
+ ### Host customization
132
+
133
+ An adapter can target other hosts by setting the `host` property.
134
+
135
+ ```js [app/adapters/application.js]
136
+ import JSONAPIAdapter from '@ember-data/adapter/json-api';
137
+
138
+ export default class ApplicationAdapter extends JSONAPIAdapter {
139
+ host = 'https://api.example.com';
140
+ }
141
+ ```
142
+
143
+ Requests for the `person` model would now target
144
+ `https://api.example.com/people/1`.
145
+
146
+ @since 1.13.0
147
+ @class JSONAPIAdapter
148
+ @public
149
+ @constructor
150
+ */
151
+ declare class JSONAPIAdapter extends RESTAdapter {
152
+ _defaultContentType: string;
153
+ /**
154
+ @private
155
+ @param {String} url
156
+ @param {String} type The request type GET, POST, PUT, DELETE etc.
157
+ @param {Object} options
158
+ @return {Object}
159
+ */
160
+ ajaxOptions(url: string, type: HTTPMethod, options?: JQueryAjaxSettings | RequestInit): JQueryRequestInit | FetchRequestInit;
161
+ /**
162
+ By default the JSONAPIAdapter will send each find request coming from a `store.find`
163
+ or from accessing a relationship separately to the server. If your server supports passing
164
+ ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests
165
+ within a single runloop.
166
+
167
+ For example, if you have an initial payload of:
168
+
169
+ ```javascript
170
+ {
171
+ data: {
172
+ id: 1,
173
+ type: 'post',
174
+ relationship: {
175
+ comments: {
176
+ data: [
177
+ { id: 1, type: 'comment' },
178
+ { id: 2, type: 'comment' }
179
+ ]
180
+ }
181
+ }
182
+ }
183
+ }
184
+ ```
185
+
186
+ By default calling `post.comments` will trigger the following requests(assuming the
187
+ comments haven't been loaded before):
188
+
189
+ ```
190
+ GET /comments/1
191
+ GET /comments/2
192
+ ```
193
+
194
+ If you set coalesceFindRequests to `true` it will instead trigger the following request:
195
+
196
+ ```
197
+ GET /comments?filter[id]=1,2
198
+ ```
199
+
200
+ Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`
201
+ relationships accessed within the same runloop. If you set `coalesceFindRequests: true`
202
+
203
+ ```javascript
204
+ store.findRecord('comment', 1);
205
+ store.findRecord('comment', 2);
206
+ ```
207
+
208
+ will also send a request to: `GET /comments?filter[id]=1,2`
209
+
210
+ Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app
211
+ `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.
212
+
213
+ @property coalesceFindRequests
214
+ @public
215
+ @type {Boolean}
216
+ */
217
+ get coalesceFindRequests(): boolean;
218
+ set coalesceFindRequests(value: boolean);
219
+ findMany(store: Store, type: ModelSchema, ids: string[], snapshots: Snapshot[]): Promise<AdapterPayload>;
220
+ pathForType(modelName: string): string;
221
+ updateRecord(store: Store, schema: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload>;
222
+ /**
223
+ Used by `findAll` and `findRecord` to build the query's `data` hash
224
+ supplied to the ajax method.
225
+
226
+ @since 2.5.0
227
+ @public
228
+ @param {Snapshot} snapshot
229
+ @return {Object}
230
+ */
231
+ buildQuery(snapshot: Snapshot | SnapshotRecordArray): QueryState;
232
+ }
233
+ export { JSONAPIAdapter };
234
+ //# sourceMappingURL=json-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-api.d.ts","sourceRoot":"","sources":["../../src/adapter/json-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAGjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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