@warp-drive/legacy 5.8.0-alpha.9 → 5.8.0-beta.1

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 (200) 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 +2 -2
  4. package/declarations/adapter/rest.d.ts +21 -104
  5. package/declarations/adapter.d.ts +2 -2
  6. package/declarations/compat/builders/find-all.d.ts +6 -6
  7. package/declarations/compat/builders/find-record.d.ts +8 -8
  8. package/declarations/compat/builders/query.d.ts +12 -12
  9. package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +16 -24
  10. package/declarations/compat/utils.d.ts +13 -13
  11. package/declarations/compat.d.ts +31 -5
  12. package/declarations/index.d.ts +25 -8
  13. package/declarations/model/-private/legacy-relationships-support.d.ts +2 -2
  14. package/declarations/model/-private/model.d.ts +10 -51
  15. package/declarations/model/-private/promise-many-array.d.ts +0 -18
  16. package/declarations/model/-private/references/belongs-to.d.ts +18 -28
  17. package/declarations/model/-private/references/has-many.d.ts +13 -15
  18. package/declarations/model/migration-support.d.ts +42 -19
  19. package/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
  20. package/declarations/model-fragments/extensions/fragment.d.ts +15 -0
  21. package/declarations/model-fragments/hooks/model-for.d.ts +20 -0
  22. package/declarations/model-fragments/index.d.ts +5 -0
  23. package/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
  24. package/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
  25. package/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
  26. package/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
  27. package/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
  28. package/declarations/model-fragments.d.ts +9 -0
  29. package/declarations/model.d.ts +2 -2
  30. package/declarations/serializer/-private/embedded-records-mixin.d.ts +1 -1
  31. package/declarations/serializer/json-api.d.ts +7 -6
  32. package/declarations/serializer/json.d.ts +3 -3
  33. package/declarations/serializer.d.ts +5 -6
  34. package/dist/{-private-B1pSSN52.js → -private-BG3bMiKp.js} +2 -1
  35. package/dist/adapter/-private.js +1 -1
  36. package/dist/adapter/error.js +9 -9
  37. package/dist/adapter/json-api.js +1 -1
  38. package/dist/adapter/rest.js +33 -117
  39. package/dist/adapter.js +2 -2
  40. package/dist/compat/-private.js +1 -1
  41. package/dist/compat/builders.js +26 -26
  42. package/dist/compat/utils.js +13 -14
  43. package/dist/compat.js +28 -8
  44. package/dist/{errors-COviC59J.js → errors-Cz5KrzBk.js} +113 -120
  45. package/dist/{hooks-Bp8SIQBU.js → hooks-D6diaM34.js} +1 -1
  46. package/dist/index.js +25 -8
  47. package/dist/{json-ksWOHRfq.js → json-ChdEfB0X.js} +12 -27
  48. package/dist/model/-private.js +1 -1
  49. package/dist/model/migration-support.js +55 -25
  50. package/dist/model-for-CqXsIKws.js +221 -0
  51. package/dist/model-fragments.js +76 -0
  52. package/dist/model.js +3 -3
  53. package/dist/{schema-provider-JlCneqZH.js → schema-provider-DJCV_6AF.js} +44 -87
  54. package/dist/{serialize-into-hash-BnYvPex3.js → serialize-into-hash-DPZYoF-i.js} +1 -1
  55. package/dist/serializer/json-api.js +18 -45
  56. package/dist/serializer/json.js +1 -1
  57. package/dist/serializer/rest.js +10 -10
  58. package/dist/serializer.js +5 -6
  59. package/dist/store.js +2 -1
  60. package/dist/unpkg/dev/-private-DtjBbEgy.js +1206 -0
  61. package/dist/unpkg/dev/adapter/-private.js +1 -0
  62. package/dist/unpkg/dev/adapter/error.js +335 -0
  63. package/dist/unpkg/dev/adapter/json-api.js +271 -0
  64. package/dist/unpkg/dev/adapter/rest.js +1171 -0
  65. package/dist/unpkg/dev/adapter.js +1252 -0
  66. package/dist/unpkg/dev/compat/-private.js +1 -0
  67. package/dist/unpkg/dev/compat/builders.js +275 -0
  68. package/dist/unpkg/dev/compat/extensions.js +242 -0
  69. package/dist/unpkg/dev/compat/utils.js +223 -0
  70. package/dist/unpkg/dev/compat.js +1147 -0
  71. package/dist/unpkg/dev/errors-DmGGJr3T.js +2562 -0
  72. package/dist/unpkg/dev/hooks-CkYiE6Ud.js +73 -0
  73. package/dist/unpkg/dev/index.js +197 -0
  74. package/dist/unpkg/dev/json-Cu1LNgmQ.js +1256 -0
  75. package/dist/unpkg/dev/model/-private.js +1 -0
  76. package/dist/unpkg/dev/model/migration-support.js +553 -0
  77. package/dist/unpkg/dev/model-for-CqXsIKws.js +221 -0
  78. package/dist/unpkg/dev/model-fragments.js +76 -0
  79. package/dist/unpkg/dev/model.js +678 -0
  80. package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  81. package/dist/unpkg/dev/schema-provider-DDVYxmUV.js +2186 -0
  82. package/dist/unpkg/dev/serialize-into-hash-B2xDbuo5.js +259 -0
  83. package/dist/unpkg/dev/serializer/json-api.js +649 -0
  84. package/dist/unpkg/dev/serializer/json.js +4 -0
  85. package/dist/unpkg/dev/serializer/rest.js +1242 -0
  86. package/dist/unpkg/dev/serializer/transform.js +278 -0
  87. package/dist/unpkg/dev/serializer.js +248 -0
  88. package/dist/unpkg/dev/store.js +637 -0
  89. package/dist/unpkg/dev/util-DvanW33H.js +20 -0
  90. package/dist/unpkg/dev/utils-BhvS1iTS.js +8 -0
  91. package/dist/unpkg/dev-deprecated/-private-DtjBbEgy.js +1206 -0
  92. package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -0
  93. package/dist/unpkg/dev-deprecated/adapter/error.js +335 -0
  94. package/dist/unpkg/dev-deprecated/adapter/json-api.js +271 -0
  95. package/dist/unpkg/dev-deprecated/adapter/rest.js +1171 -0
  96. package/dist/unpkg/dev-deprecated/adapter.js +1252 -0
  97. package/dist/unpkg/dev-deprecated/compat/-private.js +1 -0
  98. package/dist/unpkg/dev-deprecated/compat/builders.js +275 -0
  99. package/dist/unpkg/dev-deprecated/compat/extensions.js +242 -0
  100. package/dist/unpkg/dev-deprecated/compat/utils.js +223 -0
  101. package/dist/unpkg/dev-deprecated/compat.js +1147 -0
  102. package/dist/unpkg/dev-deprecated/errors-Spt6ubMd.js +2565 -0
  103. package/dist/unpkg/dev-deprecated/hooks-DOXegvhL.js +73 -0
  104. package/dist/unpkg/dev-deprecated/index.js +196 -0
  105. package/dist/unpkg/dev-deprecated/json-Cu1LNgmQ.js +1256 -0
  106. package/dist/unpkg/dev-deprecated/model/-private.js +1 -0
  107. package/dist/unpkg/dev-deprecated/model/migration-support.js +570 -0
  108. package/dist/unpkg/dev-deprecated/model-for-CqXsIKws.js +221 -0
  109. package/dist/unpkg/dev-deprecated/model-fragments.js +76 -0
  110. package/dist/unpkg/dev-deprecated/model.js +682 -0
  111. package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  112. package/dist/unpkg/dev-deprecated/schema-provider-BP6_8N-V.js +2211 -0
  113. package/dist/unpkg/dev-deprecated/serialize-into-hash-B2xDbuo5.js +259 -0
  114. package/dist/unpkg/dev-deprecated/serializer/json-api.js +649 -0
  115. package/dist/unpkg/dev-deprecated/serializer/json.js +4 -0
  116. package/dist/unpkg/dev-deprecated/serializer/rest.js +1242 -0
  117. package/dist/unpkg/dev-deprecated/serializer/transform.js +278 -0
  118. package/dist/unpkg/dev-deprecated/serializer.js +248 -0
  119. package/dist/unpkg/dev-deprecated/store.js +637 -0
  120. package/dist/unpkg/dev-deprecated/util-CWr5WQOT.js +24 -0
  121. package/dist/unpkg/dev-deprecated/utils-C9PJehtL.js +12 -0
  122. package/dist/unpkg/prod/-private-BdyZaGEh.js +971 -0
  123. package/dist/unpkg/prod/adapter/-private.js +1 -0
  124. package/dist/unpkg/prod/adapter/error.js +330 -0
  125. package/dist/unpkg/prod/adapter/json-api.js +266 -0
  126. package/dist/unpkg/prod/adapter/rest.js +1134 -0
  127. package/dist/unpkg/prod/adapter.js +1219 -0
  128. package/dist/unpkg/prod/compat/-private.js +1 -0
  129. package/dist/unpkg/prod/compat/builders.js +210 -0
  130. package/dist/unpkg/prod/compat/extensions.js +232 -0
  131. package/dist/unpkg/prod/compat/utils.js +218 -0
  132. package/dist/unpkg/prod/compat.js +727 -0
  133. package/dist/unpkg/prod/errors-BGVFCBmi.js +2314 -0
  134. package/dist/unpkg/prod/hooks-BztVA_x0.js +41 -0
  135. package/dist/unpkg/prod/index.js +151 -0
  136. package/dist/unpkg/prod/json-BWrZ5546.js +1243 -0
  137. package/dist/unpkg/prod/model/-private.js +1 -0
  138. package/dist/unpkg/prod/model/migration-support.js +546 -0
  139. package/dist/unpkg/prod/model-for-CqXsIKws.js +221 -0
  140. package/dist/unpkg/prod/model-fragments.js +76 -0
  141. package/dist/unpkg/prod/model.js +593 -0
  142. package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  143. package/dist/unpkg/prod/schema-provider-DJtD_8jZ.js +1861 -0
  144. package/dist/unpkg/prod/serialize-into-hash-DGlzQteF.js +215 -0
  145. package/dist/unpkg/prod/serializer/json-api.js +592 -0
  146. package/dist/unpkg/prod/serializer/json.js +4 -0
  147. package/dist/unpkg/prod/serializer/rest.js +1210 -0
  148. package/dist/unpkg/prod/serializer/transform.js +278 -0
  149. package/dist/unpkg/prod/serializer.js +248 -0
  150. package/dist/unpkg/prod/store.js +505 -0
  151. package/dist/unpkg/prod/util-DvanW33H.js +20 -0
  152. package/dist/unpkg/prod/utils-BhvS1iTS.js +8 -0
  153. package/dist/unpkg/prod-deprecated/-private-BdyZaGEh.js +971 -0
  154. package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -0
  155. package/dist/unpkg/prod-deprecated/adapter/error.js +330 -0
  156. package/dist/unpkg/prod-deprecated/adapter/json-api.js +266 -0
  157. package/dist/unpkg/prod-deprecated/adapter/rest.js +1134 -0
  158. package/dist/unpkg/prod-deprecated/adapter.js +1219 -0
  159. package/dist/unpkg/prod-deprecated/compat/-private.js +1 -0
  160. package/dist/unpkg/prod-deprecated/compat/builders.js +210 -0
  161. package/dist/unpkg/prod-deprecated/compat/extensions.js +232 -0
  162. package/dist/unpkg/prod-deprecated/compat/utils.js +218 -0
  163. package/dist/unpkg/prod-deprecated/compat.js +727 -0
  164. package/dist/unpkg/prod-deprecated/errors-CdDaK81x.js +2317 -0
  165. package/dist/unpkg/prod-deprecated/hooks-yId87yyG.js +41 -0
  166. package/dist/unpkg/prod-deprecated/index.js +150 -0
  167. package/dist/unpkg/prod-deprecated/json-BWrZ5546.js +1243 -0
  168. package/dist/unpkg/prod-deprecated/model/-private.js +1 -0
  169. package/dist/unpkg/prod-deprecated/model/migration-support.js +563 -0
  170. package/dist/unpkg/prod-deprecated/model-for-CqXsIKws.js +221 -0
  171. package/dist/unpkg/prod-deprecated/model-fragments.js +76 -0
  172. package/dist/unpkg/prod-deprecated/model.js +596 -0
  173. package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
  174. package/dist/unpkg/prod-deprecated/schema-provider-CjX55uSY.js +1904 -0
  175. package/dist/unpkg/prod-deprecated/serialize-into-hash-DGlzQteF.js +215 -0
  176. package/dist/unpkg/prod-deprecated/serializer/json-api.js +592 -0
  177. package/dist/unpkg/prod-deprecated/serializer/json.js +4 -0
  178. package/dist/unpkg/prod-deprecated/serializer/rest.js +1210 -0
  179. package/dist/unpkg/prod-deprecated/serializer/transform.js +278 -0
  180. package/dist/unpkg/prod-deprecated/serializer.js +248 -0
  181. package/dist/unpkg/prod-deprecated/store.js +505 -0
  182. package/dist/unpkg/prod-deprecated/util-B6cn-i93.js +23 -0
  183. package/dist/unpkg/prod-deprecated/utils-BUWwQwCh.js +11 -0
  184. package/logos/README.md +2 -2
  185. package/logos/logo-yellow-slab.svg +1 -0
  186. package/logos/word-mark-black.svg +1 -0
  187. package/logos/word-mark-white.svg +1 -0
  188. package/package.json +14 -6
  189. package/logos/NCC-1701-a-blue.svg +0 -4
  190. package/logos/NCC-1701-a-gold.svg +0 -4
  191. package/logos/NCC-1701-a-gold_100.svg +0 -1
  192. package/logos/NCC-1701-a-gold_base-64.txt +0 -1
  193. package/logos/NCC-1701-a.svg +0 -4
  194. package/logos/docs-badge.svg +0 -2
  195. package/logos/ember-data-logo-dark.svg +0 -12
  196. package/logos/ember-data-logo-light.svg +0 -12
  197. package/logos/social1.png +0 -0
  198. package/logos/social2.png +0 -0
  199. package/logos/warp-drive-logo-dark.svg +0 -4
  200. package/logos/warp-drive-logo-gold.svg +0 -4
@@ -1,6 +1,6 @@
1
1
  import { warn } from '@ember/debug';
2
2
  import { camelize, dasherize, singularize } from '@warp-drive/utilities/string';
3
- import { J as JSONSerializer, c as coerceId } from "../json-ksWOHRfq.js";
3
+ import { J as JSONSerializer, c as coerceId } from "../json-ChdEfB0X.js";
4
4
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
5
5
  import Mixin from '@ember/object/mixin';
6
6
 
@@ -25,7 +25,7 @@ import Mixin from '@ember/object/mixin';
25
25
  Below is an example of a per-type serializer (`post` type).
26
26
 
27
27
  ```js [app/serializers/post.js]
28
- import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
28
+ import RESTSerializer, { EmbeddedRecordsMixin } from '@warp-drive/legacy/serializer/rest';
29
29
 
30
30
  export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {
31
31
  attrs = {
@@ -140,7 +140,7 @@ const EmbeddedRecordsMixin = Mixin.create({
140
140
  Serialize `belongsTo` relationship when it is configured as an embedded object.
141
141
  This example of an author model belongs to a post model:
142
142
  ```js
143
- import Model, { attr, belongsTo } from '@ember-data/model';
143
+ import Model, { attr, belongsTo } from '@warp-drive/legacy/model';
144
144
  Post = Model.extend({
145
145
  title: attr('string'),
146
146
  body: attr('string'),
@@ -153,7 +153,7 @@ const EmbeddedRecordsMixin = Mixin.create({
153
153
  ```
154
154
  Use a custom (type) serializer for the post model to configure embedded author
155
155
  ```js [app/serializers/post.js]
156
- import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
156
+ import RESTSerializer, { EmbeddedRecordsMixin } from '@warp-drive/legacy/serializer/rest';
157
157
  export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {
158
158
  attrs = {
159
159
  author: { embedded: 'always' }
@@ -229,7 +229,7 @@ const EmbeddedRecordsMixin = Mixin.create({
229
229
  Serializes `hasMany` relationships when it is configured as embedded objects.
230
230
  This example of a post model has many comments:
231
231
  ```js
232
- import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
232
+ import Model, { attr, belongsTo, hasMany } from '@warp-drive/legacy/model';
233
233
  Post = Model.extend({
234
234
  title: attr('string'),
235
235
  body: attr('string'),
@@ -242,7 +242,7 @@ const EmbeddedRecordsMixin = Mixin.create({
242
242
  ```
243
243
  Use a custom (type) serializer for the post model to configure embedded comments
244
244
  ```js [app/serializers/post.js]
245
- import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
245
+ import RESTSerializer, { EmbeddedRecordsMixin } from '@warp-drive/legacy/serializer/rest';
246
246
  export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {
247
247
  attrs = {
248
248
  comments: { embedded: 'always' }
@@ -274,7 +274,7 @@ const EmbeddedRecordsMixin = Mixin.create({
274
274
  `{ serialize: 'records', deserialize: 'records' }`
275
275
  To embed the `ids` for a related object (using a hasMany relationship):
276
276
  ```js [app/serializers/post.js]
277
- import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
277
+ import RESTSerializer, { EmbeddedRecordsMixin } from '@warp-drive/legacy/serializer/rest';
278
278
  export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {
279
279
  attrs = {
280
280
  comments: { serialize: 'ids', deserialize: 'records' }
@@ -312,7 +312,7 @@ const EmbeddedRecordsMixin = Mixin.create({
312
312
  });
313
313
  ```
314
314
  ```js [app/serializers/user.js]
315
- import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
315
+ import RESTSerializer, { EmbeddedRecordsMixin } from '@warp-drive/legacy/serializer/rest';
316
316
  export default class UserSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {
317
317
  attrs = {
318
318
  pets: { serialize: 'ids-and-types', deserialize: 'records' }
@@ -951,7 +951,7 @@ const RESTSerializer = JSONSerializer.extend({
951
951
  the name of the model in your app. Let's take a look at an example model,
952
952
  and an example payload:
953
953
  ```js [app/models/post.js]
954
- import Model from '@ember-data/model';
954
+ import Model from '@warp-drive/legacy/model';
955
955
  export default class Post extends Model {}
956
956
  ```
957
957
  ```javascript
@@ -1000,7 +1000,7 @@ const RESTSerializer = JSONSerializer.extend({
1000
1000
  each attribute and belongsTo relationship.
1001
1001
  For example, consider this model:
1002
1002
  ```js [app/models/comment.js]
1003
- import Model, { attr, belongsTo } from '@ember-data/model';
1003
+ import Model, { attr, belongsTo } from '@warp-drive/legacy/model';
1004
1004
  export default class Comment extends Model {
1005
1005
  @attr title
1006
1006
  @attr body
@@ -18,14 +18,14 @@ import { a as decorateFieldV2, i as initializeDeferredDecorator } from "./runtim
18
18
  the format WarpDrive understands.
19
19
 
20
20
  Data received from an API response is **normalized** into
21
- [JSON:API](https://jsonapi.org/) (the format used internally
21
+ [{json:api}](https://jsonapi.org/) (the format used internally
22
22
  by WarpDrive), while data sent to an API is **serialized**
23
23
  into the format the API expects.
24
24
 
25
25
  ### Implementing a Serializer
26
26
 
27
27
  There are only two required serializer methods, one for
28
- normalizing data from the server API format into JSON:API, and
28
+ normalizing data from the server API format into {json:api}, and
29
29
  another for serializing records via `Snapshots` into the expected
30
30
  server API format.
31
31
 
@@ -71,7 +71,7 @@ import { a as decorateFieldV2, i as initializeDeferredDecorator } from "./runtim
71
71
  // app/serializers/application.js
72
72
  ```
73
73
 
74
- Most requests in @warp-drive/legacy are made with respect to a particular `type` (or `modelName`)
74
+ Most requests in `@warp-drive/legacy` are made with respect to a particular `type` (or `modelName`)
75
75
  (e.g., "get me the full collection of **books**" or "get me the **employee** whose id is 37"). We
76
76
  refer to this as the **primary** resource `type`.
77
77
 
@@ -95,7 +95,7 @@ import { a as decorateFieldV2, i as initializeDeferredDecorator } from "./runtim
95
95
  ### Default Serializers
96
96
 
97
97
  For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**
98
- format the `@ember-data/serializer` package contains implementations these applications can
98
+ format the `@warp-drive/legacy/serializer` package contains implementations these applications can
99
99
  extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.
100
100
 
101
101
  Many applications will find writing their own serializer to be more performant and less
@@ -124,8 +124,7 @@ const service = s.service ?? s.inject;
124
124
 
125
125
  * `normalize()`
126
126
 
127
- For an example implementation, see
128
- [JSONSerializer](JSONSerializer), the included JSON serializer.
127
+ For an example implementation, see the included {@link JSONSerializer}.
129
128
 
130
129
  @class Serializer
131
130
  @public
package/dist/store.js CHANGED
@@ -1,7 +1,8 @@
1
- import { defineSignal, assertPrivateStore, ensureStringId, recordIdentifierFor, constructResource, storeFor } from '@warp-drive/core/store/-private';
1
+ import { assertPrivateStore, ensureStringId, recordIdentifierFor, constructResource, storeFor } from '@warp-drive/core/store/-private';
2
2
  import { SkipCache } from '@warp-drive/core/types/request';
3
3
  import { i as isMaybeIdentifier } from "./utils-Cqw9eRj5.js";
4
4
  import { n as normalizeModelName } from "./util-Dul6TZts.js";
5
+ import { defineSignal } from '@warp-drive/core/signals/-leaked';
5
6
  import { getOrSetGlobal } from '@warp-drive/core/types/-private';
6
7
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
7
8