@warp-drive/legacy 5.8.0-alpha.4 → 5.8.0-alpha.41

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 (214) hide show
  1. package/README.md +14 -27
  2. package/declarations/adapter/error.d.ts +7 -7
  3. package/declarations/adapter/json-api.d.ts +6 -8
  4. package/declarations/adapter/rest.d.ts +26 -112
  5. package/declarations/adapter.d.ts +6 -8
  6. package/declarations/compat/-private.d.ts +1 -1
  7. package/declarations/compat/builders/find-all.d.ts +6 -6
  8. package/declarations/compat/builders/find-record.d.ts +8 -8
  9. package/declarations/compat/builders/query.d.ts +12 -12
  10. package/declarations/compat/extensions.d.ts +1 -1
  11. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +7 -9
  12. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +20 -30
  13. package/declarations/compat/utils.d.ts +17 -17
  14. package/declarations/compat.d.ts +35 -11
  15. package/declarations/index.d.ts +70 -0
  16. package/declarations/model/-private/attr.d.ts +5 -6
  17. package/declarations/model/-private/belongs-to.d.ts +4 -5
  18. package/declarations/model/-private/has-many.d.ts +4 -5
  19. package/declarations/model/-private/hooks.d.ts +1 -1
  20. package/declarations/model/-private/legacy-relationships-support.d.ts +2 -2
  21. package/declarations/model/-private/model.d.ts +18 -59
  22. package/declarations/model/-private/promise-many-array.d.ts +0 -18
  23. package/declarations/model/-private/record-state.d.ts +1 -1
  24. package/declarations/model/-private/references/belongs-to.d.ts +19 -29
  25. package/declarations/model/-private/references/has-many.d.ts +14 -16
  26. package/declarations/model/migration-support.d.ts +46 -21
  27. package/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
  28. package/declarations/model-fragments/extensions/fragment.d.ts +15 -0
  29. package/declarations/model-fragments/hooks/model-for.d.ts +20 -0
  30. package/declarations/model-fragments/index.d.ts +5 -0
  31. package/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
  32. package/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
  33. package/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
  34. package/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
  35. package/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
  36. package/declarations/model-fragments.d.ts +9 -0
  37. package/declarations/model.d.ts +2 -2
  38. package/declarations/serializer/-private/embedded-records-mixin.d.ts +1 -6
  39. package/declarations/serializer/-private/transforms/boolean.d.ts +2 -2
  40. package/declarations/serializer/-private/transforms/date.d.ts +2 -2
  41. package/declarations/serializer/-private/transforms/number.d.ts +1 -1
  42. package/declarations/serializer/-private/transforms/string.d.ts +1 -1
  43. package/declarations/serializer/json-api.d.ts +11 -12
  44. package/declarations/serializer/json.d.ts +9 -11
  45. package/declarations/serializer/rest.d.ts +4 -6
  46. package/declarations/serializer.d.ts +9 -12
  47. package/dist/{-private-8UmnAf9J.js → -private-BG3bMiKp.js} +3 -2
  48. package/dist/adapter/-private.js +1 -1
  49. package/dist/adapter/error.js +14 -15
  50. package/dist/adapter/json-api.js +4 -1
  51. package/dist/adapter/rest.js +38 -125
  52. package/dist/adapter.js +6 -8
  53. package/dist/compat/-private.js +1 -1
  54. package/dist/compat/builders.js +26 -26
  55. package/dist/compat/utils.js +17 -18
  56. package/dist/compat.js +61 -43
  57. package/dist/{errors-8kD2mSe_.js → errors-Cz5KrzBk.js} +115 -122
  58. package/dist/hooks-D6diaM34.js +74 -0
  59. package/dist/index.js +195 -0
  60. package/dist/{json-DziiodPf.js → json-ChdEfB0X.js} +18 -35
  61. package/dist/model/-private.js +1 -1
  62. package/dist/model/migration-support.js +57 -25
  63. package/dist/model-for-CqXsIKws.js +221 -0
  64. package/dist/model-fragments.js +76 -0
  65. package/dist/model.js +18 -90
  66. package/dist/{schema-provider-DQu4Rjco.js → schema-provider-DJCV_6AF.js} +50 -95
  67. package/dist/{serialize-into-hash-CS0MIv4F.js → serialize-into-hash-DPZYoF-i.js} +1 -1
  68. package/dist/serializer/json-api.js +18 -45
  69. package/dist/serializer/json.js +1 -1
  70. package/dist/serializer/rest.js +14 -21
  71. package/dist/serializer/transform.js +15 -6
  72. package/dist/serializer.js +9 -13
  73. package/dist/store.js +5 -1
  74. package/dist/unpkg/dev/-private-DtjBbEgy.js +1206 -0
  75. package/dist/unpkg/dev/adapter/-private.js +1 -0
  76. package/dist/unpkg/dev/adapter/error.js +335 -0
  77. package/dist/unpkg/dev/adapter/json-api.js +271 -0
  78. package/dist/unpkg/dev/adapter/rest.js +1171 -0
  79. package/dist/unpkg/dev/adapter.js +1252 -0
  80. package/dist/unpkg/dev/compat/-private.js +1 -0
  81. package/dist/unpkg/dev/compat/builders.js +275 -0
  82. package/dist/unpkg/dev/compat/extensions.js +242 -0
  83. package/dist/unpkg/dev/compat/utils.js +223 -0
  84. package/dist/unpkg/dev/compat.js +1147 -0
  85. package/dist/unpkg/dev/errors-DmGGJr3T.js +2562 -0
  86. package/dist/unpkg/dev/hooks-CkYiE6Ud.js +73 -0
  87. package/dist/unpkg/dev/index.js +197 -0
  88. package/dist/unpkg/dev/json-Cu1LNgmQ.js +1256 -0
  89. package/dist/unpkg/dev/model/-private.js +1 -0
  90. package/dist/unpkg/dev/model/migration-support.js +553 -0
  91. package/dist/unpkg/dev/model-for-CqXsIKws.js +221 -0
  92. package/dist/unpkg/dev/model-fragments.js +76 -0
  93. package/dist/unpkg/dev/model.js +678 -0
  94. package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  95. package/dist/unpkg/dev/schema-provider-DDVYxmUV.js +2186 -0
  96. package/dist/unpkg/dev/serialize-into-hash-B2xDbuo5.js +259 -0
  97. package/dist/unpkg/dev/serializer/json-api.js +649 -0
  98. package/dist/unpkg/dev/serializer/json.js +4 -0
  99. package/dist/unpkg/dev/serializer/rest.js +1242 -0
  100. package/dist/unpkg/dev/serializer/transform.js +278 -0
  101. package/dist/unpkg/dev/serializer.js +248 -0
  102. package/dist/unpkg/dev/store.js +637 -0
  103. package/dist/unpkg/dev/util-DvanW33H.js +20 -0
  104. package/dist/unpkg/dev/utils-BhvS1iTS.js +8 -0
  105. package/dist/unpkg/dev-deprecated/-private-DtjBbEgy.js +1206 -0
  106. package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -0
  107. package/dist/unpkg/dev-deprecated/adapter/error.js +335 -0
  108. package/dist/unpkg/dev-deprecated/adapter/json-api.js +271 -0
  109. package/dist/unpkg/dev-deprecated/adapter/rest.js +1171 -0
  110. package/dist/unpkg/dev-deprecated/adapter.js +1252 -0
  111. package/dist/unpkg/dev-deprecated/compat/-private.js +1 -0
  112. package/dist/unpkg/dev-deprecated/compat/builders.js +275 -0
  113. package/dist/unpkg/dev-deprecated/compat/extensions.js +242 -0
  114. package/dist/unpkg/dev-deprecated/compat/utils.js +223 -0
  115. package/dist/unpkg/dev-deprecated/compat.js +1147 -0
  116. package/dist/unpkg/dev-deprecated/errors-Spt6ubMd.js +2565 -0
  117. package/dist/unpkg/dev-deprecated/hooks-DOXegvhL.js +73 -0
  118. package/dist/unpkg/dev-deprecated/index.js +196 -0
  119. package/dist/unpkg/dev-deprecated/json-Cu1LNgmQ.js +1256 -0
  120. package/dist/unpkg/dev-deprecated/model/-private.js +1 -0
  121. package/dist/unpkg/dev-deprecated/model/migration-support.js +570 -0
  122. package/dist/unpkg/dev-deprecated/model-for-CqXsIKws.js +221 -0
  123. package/dist/unpkg/dev-deprecated/model-fragments.js +76 -0
  124. package/dist/unpkg/dev-deprecated/model.js +682 -0
  125. package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  126. package/dist/unpkg/dev-deprecated/schema-provider-BP6_8N-V.js +2211 -0
  127. package/dist/unpkg/dev-deprecated/serialize-into-hash-B2xDbuo5.js +259 -0
  128. package/dist/unpkg/dev-deprecated/serializer/json-api.js +649 -0
  129. package/dist/unpkg/dev-deprecated/serializer/json.js +4 -0
  130. package/dist/unpkg/dev-deprecated/serializer/rest.js +1242 -0
  131. package/dist/unpkg/dev-deprecated/serializer/transform.js +278 -0
  132. package/dist/unpkg/dev-deprecated/serializer.js +248 -0
  133. package/dist/unpkg/dev-deprecated/store.js +637 -0
  134. package/dist/unpkg/dev-deprecated/util-CWr5WQOT.js +24 -0
  135. package/dist/unpkg/dev-deprecated/utils-C9PJehtL.js +12 -0
  136. package/dist/unpkg/prod/-private-BdyZaGEh.js +971 -0
  137. package/dist/unpkg/prod/adapter/-private.js +1 -0
  138. package/dist/unpkg/prod/adapter/error.js +330 -0
  139. package/dist/unpkg/prod/adapter/json-api.js +266 -0
  140. package/dist/unpkg/prod/adapter/rest.js +1134 -0
  141. package/dist/unpkg/prod/adapter.js +1219 -0
  142. package/dist/unpkg/prod/compat/-private.js +1 -0
  143. package/dist/unpkg/prod/compat/builders.js +210 -0
  144. package/dist/unpkg/prod/compat/extensions.js +232 -0
  145. package/dist/unpkg/prod/compat/utils.js +218 -0
  146. package/dist/unpkg/prod/compat.js +727 -0
  147. package/dist/unpkg/prod/errors-BGVFCBmi.js +2314 -0
  148. package/dist/unpkg/prod/hooks-BztVA_x0.js +41 -0
  149. package/dist/unpkg/prod/index.js +151 -0
  150. package/dist/unpkg/prod/json-BWrZ5546.js +1243 -0
  151. package/dist/unpkg/prod/model/-private.js +1 -0
  152. package/dist/unpkg/prod/model/migration-support.js +546 -0
  153. package/dist/unpkg/prod/model-for-CqXsIKws.js +221 -0
  154. package/dist/unpkg/prod/model-fragments.js +76 -0
  155. package/dist/unpkg/prod/model.js +593 -0
  156. package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  157. package/dist/unpkg/prod/schema-provider-DJtD_8jZ.js +1861 -0
  158. package/dist/unpkg/prod/serialize-into-hash-DGlzQteF.js +215 -0
  159. package/dist/unpkg/prod/serializer/json-api.js +592 -0
  160. package/dist/unpkg/prod/serializer/json.js +4 -0
  161. package/dist/unpkg/prod/serializer/rest.js +1210 -0
  162. package/dist/unpkg/prod/serializer/transform.js +278 -0
  163. package/dist/unpkg/prod/serializer.js +248 -0
  164. package/dist/unpkg/prod/store.js +505 -0
  165. package/dist/unpkg/prod/util-DvanW33H.js +20 -0
  166. package/dist/unpkg/prod/utils-BhvS1iTS.js +8 -0
  167. package/dist/unpkg/prod-deprecated/-private-BdyZaGEh.js +971 -0
  168. package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -0
  169. package/dist/unpkg/prod-deprecated/adapter/error.js +330 -0
  170. package/dist/unpkg/prod-deprecated/adapter/json-api.js +266 -0
  171. package/dist/unpkg/prod-deprecated/adapter/rest.js +1134 -0
  172. package/dist/unpkg/prod-deprecated/adapter.js +1219 -0
  173. package/dist/unpkg/prod-deprecated/compat/-private.js +1 -0
  174. package/dist/unpkg/prod-deprecated/compat/builders.js +210 -0
  175. package/dist/unpkg/prod-deprecated/compat/extensions.js +232 -0
  176. package/dist/unpkg/prod-deprecated/compat/utils.js +218 -0
  177. package/dist/unpkg/prod-deprecated/compat.js +727 -0
  178. package/dist/unpkg/prod-deprecated/errors-CdDaK81x.js +2317 -0
  179. package/dist/unpkg/prod-deprecated/hooks-yId87yyG.js +41 -0
  180. package/dist/unpkg/prod-deprecated/index.js +150 -0
  181. package/dist/unpkg/prod-deprecated/json-BWrZ5546.js +1243 -0
  182. package/dist/unpkg/prod-deprecated/model/-private.js +1 -0
  183. package/dist/unpkg/prod-deprecated/model/migration-support.js +563 -0
  184. package/dist/unpkg/prod-deprecated/model-for-CqXsIKws.js +221 -0
  185. package/dist/unpkg/prod-deprecated/model-fragments.js +76 -0
  186. package/dist/unpkg/prod-deprecated/model.js +596 -0
  187. package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  188. package/dist/unpkg/prod-deprecated/schema-provider-CjX55uSY.js +1904 -0
  189. package/dist/unpkg/prod-deprecated/serialize-into-hash-DGlzQteF.js +215 -0
  190. package/dist/unpkg/prod-deprecated/serializer/json-api.js +592 -0
  191. package/dist/unpkg/prod-deprecated/serializer/json.js +4 -0
  192. package/dist/unpkg/prod-deprecated/serializer/rest.js +1210 -0
  193. package/dist/unpkg/prod-deprecated/serializer/transform.js +278 -0
  194. package/dist/unpkg/prod-deprecated/serializer.js +248 -0
  195. package/dist/unpkg/prod-deprecated/store.js +505 -0
  196. package/dist/unpkg/prod-deprecated/util-B6cn-i93.js +23 -0
  197. package/dist/unpkg/prod-deprecated/utils-BUWwQwCh.js +11 -0
  198. package/logos/README.md +2 -2
  199. package/logos/logo-yellow-slab.svg +1 -0
  200. package/logos/word-mark-black.svg +1 -0
  201. package/logos/word-mark-white.svg +1 -0
  202. package/package.json +14 -6
  203. package/logos/NCC-1701-a-blue.svg +0 -4
  204. package/logos/NCC-1701-a-gold.svg +0 -4
  205. package/logos/NCC-1701-a-gold_100.svg +0 -1
  206. package/logos/NCC-1701-a-gold_base-64.txt +0 -1
  207. package/logos/NCC-1701-a.svg +0 -4
  208. package/logos/docs-badge.svg +0 -2
  209. package/logos/ember-data-logo-dark.svg +0 -12
  210. package/logos/ember-data-logo-light.svg +0 -12
  211. package/logos/social1.png +0 -0
  212. package/logos/social2.png +0 -0
  213. package/logos/warp-drive-logo-dark.svg +0 -4
  214. package/logos/warp-drive-logo-gold.svg +0 -4
@@ -3,17 +3,16 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
3
3
 
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
5
5
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
6
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
7
 
7
8
  /**
8
9
  ## Overview
9
10
 
10
- <blockquote style="margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;">
11
- <p>
12
- ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
11
+ :::danger
12
+ ⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
13
13
  If starting a new app or thinking of implementing a new adapter, consider writing a
14
- <a href="/ember-data/release/classes/%3CInterface%3E%20Handler">Handler</a> instead to be used with the <a href="https://github.com/warp-drive-data/warp-drive/tree/main/packages/request#readme">RequestManager</a>
15
- </p>
16
- </blockquote>
14
+ {@link Handler} instead to be used with the {@link RequestManager}
15
+ :::
17
16
 
18
17
  An `AdapterError` is used by an adapter to signal that an error occurred
19
18
  during a request to an external API. It indicates a generic error, and
@@ -25,7 +24,7 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
25
24
  it was closed for maintenance:
26
25
 
27
26
  ```js [app/adapters/maintenance-error.js]
28
- import AdapterError from '@ember-data/adapter/error';
27
+ import AdapterError from '@warp-drive/legacy/adapter/error';
29
28
 
30
29
  export default AdapterError.extend({ message: "Down for maintenance." });
31
30
  ```
@@ -33,7 +32,7 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
33
32
  This error would then be returned by an adapter's `handleResponse` method:
34
33
 
35
34
  ```js [app/adapters/application.js]
36
- import JSONAPIAdapter from '@ember-data/adapter/json-api';
35
+ import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
37
36
  import MaintenanceError from './maintenance-error';
38
37
 
39
38
  export default class ApplicationAdapter extends JSONAPIAdapter {
@@ -126,8 +125,8 @@ function extend(ParentErrorClass, defaultMessage) {
126
125
  transition to the `invalid` state and the errors will be set to the
127
126
  `errors` property on the record.
128
127
 
129
- For Ember Data to correctly map errors to their corresponding
130
- properties on the model, Ember Data expects each error to be
128
+ For WarpDrive to correctly map errors to their corresponding
129
+ properties on the model, WarpDrive expects each error to be
131
130
  a valid JSON-API error object with a `source/pointer` that matches
132
131
  the property name. For example, if you had a Post model that
133
132
  looked like this.
@@ -147,8 +146,8 @@ function extend(ParentErrorClass, defaultMessage) {
147
146
 
148
147
  ```js [app/adapters/post.js]
149
148
  import RSVP from 'RSVP';
150
- import RESTAdapter from '@ember-data/adapter/rest';
151
- import { InvalidError } from '@ember-data/adapter/error';
149
+ import RESTAdapter from '@warp-drive/legacy/adapter/rest';
150
+ import { InvalidError } from '@warp-drive/legacy/adapter/error';
152
151
 
153
152
  export default class ApplicationAdapter extends RESTAdapter {
154
153
  updateRecord() {
@@ -190,7 +189,7 @@ InvalidError.prototype.code = 'InvalidError';
190
189
  connection if an adapter operation has timed out:
191
190
 
192
191
  ```js [app/routes/application.js]
193
- import { TimeoutError } from '@ember-data/adapter/error';
192
+ import { TimeoutError } from '@warp-drive/legacy/adapter/error';
194
193
 
195
194
  export default class ApplicationRoute extends Route {
196
195
  @action
@@ -236,7 +235,7 @@ AbortError.prototype.code = 'AbortError';
236
235
  request is unauthorized:
237
236
 
238
237
  ```js [app/routes/application.js]
239
- import { UnauthorizedError } from '@ember-data/adapter/error';
238
+ import { UnauthorizedError } from '@warp-drive/legacy/adapter/error';
240
239
 
241
240
  export default class ApplicationRoute extends Route {
242
241
  @action
@@ -282,7 +281,7 @@ ForbiddenError.prototype.code = 'ForbiddenError';
282
281
  for a specific model that does not exist. For example:
283
282
 
284
283
  ```js [app/routes/post.js]
285
- import { NotFoundError } from '@ember-data/adapter/error';
284
+ import { NotFoundError } from '@warp-drive/legacy/adapter/error';
286
285
 
287
286
  export default class PostRoute extends Route {
288
287
  @service store;
@@ -1,8 +1,11 @@
1
1
  import { dasherize, pluralize } from '@warp-drive/utilities/string';
2
2
  import '@ember/debug';
3
3
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
4
- import { b as serializeIntoHash } from "../serialize-into-hash-CS0MIv4F.js";
4
+ import { b as serializeIntoHash } from "../serialize-into-hash-DPZYoF-i.js";
5
5
  import { RESTAdapter } from './rest.js';
6
+
7
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
+
6
9
  class JSONAPIAdapter extends RESTAdapter {
7
10
  _defaultContentType = 'application/vnd.api+json';
8
11
 
@@ -2,7 +2,7 @@ import { getOwner } from '@ember/application';
2
2
  import { warn } from '@ember/debug';
3
3
  import { computed } from '@ember/object';
4
4
  import { Adapter, BuildURLMixin } from '../adapter.js';
5
- import { b as serializeIntoHash, d as determineBodyPromise, g as getFetchFunction, s as serializeQueryParams, p as parseResponseHeaders } from "../serialize-into-hash-CS0MIv4F.js";
5
+ import { b as serializeIntoHash, d as determineBodyPromise, g as getFetchFunction, s as serializeQueryParams, p as parseResponseHeaders } from "../serialize-into-hash-DPZYoF-i.js";
6
6
  import { InvalidError, ServerError, ConflictError, NotFoundError, ForbiddenError, UnauthorizedError, AdapterError, TimeoutError, AbortError } from './error.js';
7
7
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
8
8
  import { d as decorateMethodV2 } from "../runtime-BPCpkOf1-BKOwiRJp.js";
@@ -14,13 +14,11 @@ import { d as decorateMethodV2 } from "../runtime-BPCpkOf1-BKOwiRJp.js";
14
14
  const AdapterWithBuildURLMixin = Adapter.extend(BuildURLMixin);
15
15
 
16
16
  /**
17
- * <blockquote style="margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;">
18
- <p>
19
- ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
17
+ * :::danger
18
+ ⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
20
19
  If starting a new app or thinking of implementing a new adapter, consider writing a
21
- <a href="/ember-data/release/classes/%3CInterface%3E%20Handler">Handler</a> instead to be used with the <a href="https://github.com/warp-drive-data/warp-drive/tree/main/packages/request#readme">RequestManager</a>
22
- </p>
23
- </blockquote>
20
+ {@link Handler} instead to be used with the {@link RequestManager}
21
+ :::
24
22
 
25
23
  The REST adapter allows your store to communicate with an HTTP server by
26
24
  transmitting JSON via XHR.
@@ -91,7 +89,7 @@ const AdapterWithBuildURLMixin = Adapter.extend(BuildURLMixin);
91
89
  Note that the object root can be pluralized for both a single-object response
92
90
  and an array response: the REST adapter is not strict on this. Further, if the
93
91
  HTTP server responds to a `GET` request to `/posts/1` (e.g. the response to a
94
- `findRecord` query) with more than one object in the array, Ember Data will
92
+ `findRecord` query) with more than one object in the array, WarpDrive will
95
93
  only display the object with the matching ID.
96
94
 
97
95
  ### Conventional Names
@@ -152,7 +150,7 @@ const AdapterWithBuildURLMixin = Adapter.extend(BuildURLMixin);
152
150
 
153
151
  If the records in the relationship are not known when the response
154
152
  is serialized it's also possible to represent the relationship as a
155
- URL using the `links` key in the response. Ember Data will fetch
153
+ URL using the `links` key in the response. WarpDrive will fetch
156
154
  this URL to resolve the relationship when it is accessed for the
157
155
  first time.
158
156
 
@@ -235,17 +233,12 @@ const AdapterWithBuildURLMixin = Adapter.extend(BuildURLMixin);
235
233
  }
236
234
  ```
237
235
 
238
- @class RESTAdapter
239
236
  @public
240
- @constructor
241
- @uses BuildURLMixin
242
237
  */
243
238
  class RESTAdapter extends AdapterWithBuildURLMixin {
244
239
  /**
245
240
  This property allows ajax to still be used instead when `false`.
246
- @property useFetch
247
- @type {Boolean}
248
- @default true
241
+ @default true
249
242
  @public
250
243
  */
251
244
  useFetch = true;
@@ -293,9 +286,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
293
286
  }
294
287
  }
295
288
  ```
296
- @param {Object} obj
297
- @return {Object}
298
- @public
289
+ @public
299
290
  */
300
291
  sortQueryParams(obj) {
301
292
  const keys = Object.keys(obj);
@@ -344,9 +335,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
344
335
  will also send a request to: `GET /comments?ids[]=1&ids[]=2`
345
336
  Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app
346
337
  `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.
347
- @property coalesceFindRequests
348
- @public
349
- @type {Boolean}
338
+ @public
350
339
  */
351
340
  get coalesceFindRequests() {
352
341
  const coalesceFindRequests = this._coalesceFindRequests;
@@ -369,9 +358,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
369
358
  }
370
359
  ```
371
360
  Requests for the `Post` model would now target `/api/1/post/`.
372
- @property namespace
373
- @public
374
- @type {String}
361
+ @public
375
362
  */
376
363
 
377
364
  /**
@@ -383,17 +370,14 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
383
370
  }
384
371
  ```
385
372
  Requests for the `Post` model would now target `https://api.example.com/post/`.
386
- @property host
387
- @public
388
- @type {String}
373
+ @public
389
374
  */
390
375
 
391
376
  /**
392
377
  Some APIs require HTTP headers, e.g. to provide an API
393
378
  key. Arbitrary headers can be set as key/value pairs on the
394
- `RESTAdapter`'s `headers` object and Ember Data will send them
395
- along with each ajax request. For dynamic headers see [headers
396
- customization](/ember-data/release/classes/RESTAdapter).
379
+ `RESTAdapter`'s `headers` object and WarpDrive will send them
380
+ along with each ajax request..
397
381
  ```js [app/adapters/application.js]
398
382
  import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';
399
383
  export default class ApplicationAdapter extends RESTAdapter {
@@ -405,9 +389,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
405
389
  }
406
390
  }
407
391
  ```
408
- @property headers
409
- @public
410
- @type {Object}
392
+ @public
411
393
  */
412
394
 
413
395
  /**
@@ -418,11 +400,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
418
400
  This method performs an HTTP `GET` request with the id provided as part of the query string.
419
401
  @since 1.13.0
420
402
  @public
421
- @param {Store} store
422
- @param {Model} type
423
- @param {String} id
424
- @param {Snapshot} snapshot
425
- @return {Promise} promise
426
403
  */
427
404
  findRecord(store, type, id, snapshot) {
428
405
  const url = this.buildURL(type.modelName, id, snapshot, 'findRecord');
@@ -438,18 +415,10 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
438
415
  The `findAll` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a
439
416
  promise for the resulting payload.
440
417
  @public
441
- @param {Store} store
442
- @param {Model} type
443
- @param {undefined} neverSet a value is never provided to this argument
444
- @param {SnapshotRecordArray} snapshotRecordArray
445
- @return {Promise} promise
446
418
  */
447
- findAll(store, type, sinceToken, snapshotRecordArray) {
419
+ findAll(store, type, neverUsed, snapshotRecordArray) {
448
420
  const query = this.buildQuery(snapshotRecordArray);
449
421
  const url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');
450
- if (sinceToken) {
451
- query.since = sinceToken;
452
- }
453
422
  return this.ajax(url, 'GET', {
454
423
  data: query
455
424
  });
@@ -464,12 +433,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
464
433
  The `query` argument is a simple JavaScript object that will be passed directly
465
434
  to the server as parameters.
466
435
  @public
467
- @param {Store} store
468
- @param {Model} type
469
- @param {Object} query
470
- @param {Collection} recordArray
471
- @param {Object} adapterOptions
472
- @return {Promise} promise
473
436
  */
474
437
  query(store, type, query) {
475
438
  const url = this.buildURL(type.modelName, null, null, 'query', query);
@@ -491,11 +454,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
491
454
  to the server as parameters.
492
455
  @since 1.13.0
493
456
  @public
494
- @param {Store} store
495
- @param {Model} type
496
- @param {Object} query
497
- @param {Object} adapterOptions
498
- @return {Promise} promise
499
457
  */
500
458
  queryRecord(store, type, query, adapterOptions) {
501
459
  const url = this.buildURL(type.modelName, null, null, 'queryRecord', query);
@@ -527,11 +485,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
527
485
  The `findMany` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a
528
486
  promise for the resulting payload.
529
487
  @public
530
- @param {Store} store
531
- @param {Model} type
532
- @param {Array} ids
533
- @param {Array} snapshots
534
- @return {Promise} promise
535
488
  */
536
489
  findMany(store, type, ids, snapshots) {
537
490
  const url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
@@ -563,11 +516,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
563
516
  * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.
564
517
  * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.
565
518
  @public
566
- @param {Store} store
567
- @param {Snapshot} snapshot
568
- @param {String} url
569
- @param {Object} relationship meta object describing the relationship
570
- @return {Promise} promise
571
519
  */
572
520
  findHasMany(store, snapshot, url, relationship) {
573
521
  const id = snapshot.id;
@@ -623,10 +571,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
623
571
  See `serialize` for information on how to customize the serialized form
624
572
  of a record.
625
573
  @public
626
- @param {Store} store
627
- @param {Model} type
628
- @param {Snapshot} snapshot
629
- @return {Promise} promise
630
574
  */
631
575
  createRecord(store, type, snapshot) {
632
576
  const url = this.buildURL(type.modelName, null, snapshot, 'createRecord');
@@ -644,10 +588,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
644
588
  See `serialize` for information on how to customize the serialized form
645
589
  of a record.
646
590
  @public
647
- @param {Store} store
648
- @param {Model} schema
649
- @param {Snapshot} snapshot
650
- @return {Promise} promise
651
591
  */
652
592
  updateRecord(store, schema, snapshot) {
653
593
  const data = serializeIntoHash(store, schema, snapshot, {});
@@ -668,10 +608,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
668
608
  Called by the store when a record is deleted.
669
609
  The `deleteRecord` method makes an Ajax (HTTP DELETE) request to a URL computed by `buildURL`.
670
610
  @public
671
- @param {Store} store
672
- @param {Model} type
673
- @param {Snapshot} snapshot
674
- @return {Promise} promise
675
611
  */
676
612
  deleteRecord(store, schema, snapshot) {
677
613
  const type = snapshot.modelName;
@@ -683,6 +619,10 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
683
619
  })(typeof id === 'string' && id.length > 0) : {};
684
620
  return this.ajax(this.buildURL(type, id, snapshot, 'deleteRecord'), 'DELETE');
685
621
  }
622
+
623
+ /**
624
+ @private
625
+ */
686
626
  _stripIDFromURL(store, snapshot) {
687
627
  const type = snapshot.modelName;
688
628
  const id = snapshot.id;
@@ -724,10 +664,8 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
724
664
  It does not group records that have differing base urls, such as for example: `/posts/1/comments/2`
725
665
  and `/posts/2/comments/3`
726
666
  @public
727
- @param {Store} store
728
- @param {Array} snapshots
729
- @return {Array} an array of arrays of records, each of which is to be
730
- loaded separately by `findMany`.
667
+ @return an array of arrays of records, each of which is to be
668
+ loaded separately by `findMany`.
731
669
  */
732
670
  groupRecordsForFindMany(store, snapshots) {
733
671
  const groups = new Map();
@@ -766,11 +704,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
766
704
  method.
767
705
  @since 1.13.0
768
706
  @public
769
- @param {Number} status
770
- @param {Object} headers
771
- @param {Object} payload
772
- @param {Object} requestData - the original request information
773
- @return {Object | AdapterError} response
774
707
  */
775
708
  handleResponse(status, headers, payload, requestData) {
776
709
  if (this.isSuccess(status, headers, payload)) {
@@ -803,10 +736,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
803
736
  response is a success.
804
737
  @since 1.13.0
805
738
  @public
806
- @param {Number} status
807
- @param {Object} headers
808
- @param {Object} payload
809
- @return {Boolean}
810
739
  */
811
740
  isSuccess(status, _headers, _payload) {
812
741
  return status >= 200 && status < 300 || status === 304;
@@ -817,10 +746,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
817
746
  response is an invalid error.
818
747
  @since 1.13.0
819
748
  @public
820
- @param {Number} status
821
- @param {Object} headers
822
- @param {Object} payload
823
- @return {Boolean}
824
749
  */
825
750
  isInvalid(status, _headers, _payload) {
826
751
  return status === 422;
@@ -829,7 +754,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
829
754
  /**
830
755
  Takes a URL, an HTTP method and a hash of data, and makes an
831
756
  HTTP request.
832
- When the server responds with a payload, Ember Data will call into `extractSingle`
757
+ When the server responds with a payload, WarpDrive will call into `extractSingle`
833
758
  or `extractArray` (depending on whether the original query was for one record or
834
759
  many records).
835
760
  By default, `ajax` method has the following behavior:
@@ -840,10 +765,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
840
765
  data is the serialized record in the case of a save.
841
766
  * Registers success and failure handlers.
842
767
  @private
843
- @param {String} url
844
- @param {String} type The request type GET, POST, PUT, DELETE etc.
845
- @param {Object} options
846
- @return {Promise} promise
847
768
  */
848
769
  async ajax(url, type, options = {}) {
849
770
  const requestData = {
@@ -868,7 +789,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
868
789
 
869
790
  /**
870
791
  @private
871
- @param {Object} options jQuery ajax options to be used for the ajax request
792
+ @param options jQuery ajax options to be used for the ajax request
872
793
  */
873
794
  _ajaxRequest(options) {
874
795
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -878,10 +799,16 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
878
799
  })(typeof jQuery !== 'undefined') : {};
879
800
  void jQuery.ajax(options);
880
801
  }
802
+ /**
803
+ @private
804
+ */
881
805
  _fetchRequest(options) {
882
806
  const fetchFunction = getFetchFunction();
883
807
  return fetchFunction(options.url, options);
884
808
  }
809
+ /**
810
+ @private
811
+ */
885
812
  _ajax(options) {
886
813
  if (this.useFetch) {
887
814
  void this._fetchRequest(options);
@@ -892,10 +819,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
892
819
 
893
820
  /**
894
821
  @private
895
- @param {String} url
896
- @param {String} type The request type GET, POST, PUT, DELETE etc.
897
- @param {Object} options
898
- @return {Object}
899
822
  */
900
823
  ajaxOptions(url, method, options) {
901
824
  let reqOptions = Object.assign({
@@ -940,6 +863,10 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
940
863
  reqOptions.url = this._ajaxURL(reqOptions.url);
941
864
  return reqOptions;
942
865
  }
866
+
867
+ /**
868
+ * @private
869
+ */
943
870
  _ajaxURL(url) {
944
871
  if (this.fastboot?.isFastBoot) {
945
872
  const httpRegex = /^https?:\/\//;
@@ -952,7 +879,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
952
879
  try {
953
880
  return `${protocol}//${host}${url}`;
954
881
  } catch (fbError) {
955
- throw new Error('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: ' + fbError.message);
882
+ throw new Error('You are using WarpDrive 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: ' + fbError.message);
956
883
  }
957
884
  }
958
885
  }
@@ -961,8 +888,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
961
888
 
962
889
  /**
963
890
  @private
964
- @param {String} responseText
965
- @return {Object}
966
891
  */
967
892
  parseErrorResponse(responseText) {
968
893
  let json = responseText;
@@ -976,10 +901,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
976
901
 
977
902
  /**
978
903
  @private
979
- @param {Number} status
980
- @param {Object} headers
981
- @param {Object} payload
982
- @return {Array} errors payload
904
+ @return errors payload
983
905
  */
984
906
  normalizeErrorResponse(status, _headers, payload) {
985
907
  if (payload && typeof payload === 'object' && 'errors' in payload && Array.isArray(payload.errors)) {
@@ -1002,11 +924,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
1002
924
  Generates a detailed ("friendly") error message, with plenty
1003
925
  of information for debugging (good luck!)
1004
926
  @private
1005
- @param {Number} status
1006
- @param {Object} headers
1007
- @param {Object} payload
1008
- @param {Object} requestData
1009
- @return {String} detailed error message
927
+ @return detailed error message
1010
928
  */
1011
929
  generatedDetailedMessage(status, headers, payload, requestData) {
1012
930
  let shortenedPayload;
@@ -1028,8 +946,6 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
1028
946
  supplied to the ajax method.
1029
947
  @since 2.5.0
1030
948
  @public
1031
- @param {Snapshot} snapshot
1032
- @return {Object}
1033
949
  */
1034
950
  buildQuery(snapshot) {
1035
951
  const query = {};
@@ -1170,17 +1086,14 @@ function headersToObject(headers) {
1170
1086
  /**
1171
1087
  * Helper function that translates the options passed to `jQuery.ajax` into a format that `fetch` expects.
1172
1088
  *
1173
- * @param {Object} _options
1174
- * @param {Adapter} adapter
1175
1089
  * @private
1176
- * @return {Object}
1177
1090
  */
1178
1091
  function fetchOptions(options, adapter) {
1179
1092
  options.credentials = options.credentials || 'same-origin';
1180
1093
  if (options.data) {
1181
1094
  // GET and HEAD requests can't have a `body`
1182
1095
  if (options.method === 'GET' || options.method === 'HEAD') {
1183
- // If no options are passed, Ember Data sets `data` to an empty object, which we test for.
1096
+ // If no options are passed, WarpDrive sets `data` to an empty object, which we test for.
1184
1097
  if (Object.keys(options.data).length && options.url) {
1185
1098
  // Test if there are already query params in the url (mimics jQuey.ajax).
1186
1099
  const queryParamDelimiter = options.url.includes('?') ? '&' : '?';
package/dist/adapter.js CHANGED
@@ -496,13 +496,11 @@ const BuildURLMixin = Mixin.create(mixinProps);
496
496
  /**
497
497
  * ## Overview
498
498
  *
499
- * <blockquote style="margin: 1em; padding: .1em 1em .1em 1em; border-left: solid 1em #E34C32; background: #e0e0e0;">
500
- * <p>
501
- * ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
499
+ * :::danger
500
+ * ⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
502
501
  * If starting a new app or thinking of implementing a new adapter, consider writing a
503
- * <a href="/ember-data/release/classes/%3CInterface%3E%20Handler">Handler</a> instead to be used with the <a href="https://github.com/warp-drive-data/warp-drive/tree/main/packages/request#readme">RequestManager</a>
504
- * </p>
505
- * </blockquote>
502
+ * {@link Handler} instead to be used with the {@link RequestManager}
503
+ * ::::
506
504
  *
507
505
  * In order to properly fetch and update data, @warp-drive/legacy
508
506
  * needs to understand how to connect to your API.
@@ -951,10 +949,10 @@ class Adapter extends EmberObject {
951
949
  Serializes the record update and sends it to the server.
952
950
  The updateRecord method is expected to return a promise that will
953
951
  resolve with the serialized record. This allows the backend to
954
- inform the Ember Data store the current state of this record after
952
+ inform the WarpDrive store the current state of this record after
955
953
  the update. If it is not possible to return a serialized record
956
954
  the updateRecord promise can also resolve with `undefined` and the
957
- Ember Data store will assume all of the updates were successfully
955
+ WarpDrive store will assume all of the updates were successfully
958
956
  applied on the backend.
959
957
  Example
960
958
  ```js [app/adapters/application.js]
@@ -1 +1 @@
1
- export { F as FetchManager, S as SaveOp, c as Snapshot, b as SnapshotRecordArray, u as upgradeStore } from "../-private-8UmnAf9J.js";
1
+ export { F as FetchManager, S as SaveOp, c as Snapshot, b as SnapshotRecordArray, u as upgradeStore } from "../-private-BG3bMiKp.js";