@warp-drive/legacy 5.8.0-alpha.40 → 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 (115) hide show
  1. package/declarations/adapter/error.d.ts +2 -2
  2. package/declarations/adapter/rest.d.ts +21 -104
  3. package/declarations/adapter.d.ts +2 -2
  4. package/declarations/model/-private/model.d.ts +10 -51
  5. package/declarations/model/-private/promise-many-array.d.ts +0 -18
  6. package/declarations/model/-private/references/belongs-to.d.ts +14 -24
  7. package/declarations/model/-private/references/has-many.d.ts +11 -13
  8. package/declarations/serializer/json-api.d.ts +4 -3
  9. package/declarations/serializer/json.d.ts +2 -2
  10. package/dist/{-private-B1pSSN52.js → -private-BG3bMiKp.js} +2 -1
  11. package/dist/adapter/-private.js +1 -1
  12. package/dist/adapter/error.js +2 -2
  13. package/dist/adapter/json-api.js +1 -1
  14. package/dist/adapter/rest.js +33 -117
  15. package/dist/adapter.js +2 -2
  16. package/dist/compat/-private.js +1 -1
  17. package/dist/compat.js +4 -3
  18. package/dist/{errors-CIGPcDvd.js → errors-Cz5KrzBk.js} +29 -58
  19. package/dist/{hooks-QqRnX108.js → hooks-D6diaM34.js} +1 -1
  20. package/dist/index.js +3 -3
  21. package/dist/{json-BNrV8EYG.js → json-ChdEfB0X.js} +6 -19
  22. package/dist/model/-private.js +1 -1
  23. package/dist/model/migration-support.js +7 -5
  24. package/dist/model.js +3 -3
  25. package/dist/{schema-provider-g5MfTj8n.js → schema-provider-DJCV_6AF.js} +34 -77
  26. package/dist/{serialize-into-hash-BnYvPex3.js → serialize-into-hash-DPZYoF-i.js} +1 -1
  27. package/dist/serializer/json-api.js +2 -2
  28. package/dist/serializer/json.js +1 -1
  29. package/dist/serializer/rest.js +1 -1
  30. package/dist/store.js +2 -1
  31. package/dist/unpkg/{dev-deprecated/-private-DbaSCSym.js → dev/-private-DtjBbEgy.js} +2 -1
  32. package/dist/unpkg/dev/adapter/-private.js +1 -1
  33. package/dist/unpkg/dev/adapter/error.js +2 -2
  34. package/dist/unpkg/dev/adapter/json-api.js +1 -1
  35. package/dist/unpkg/dev/adapter/rest.js +33 -117
  36. package/dist/unpkg/dev/adapter.js +2 -2
  37. package/dist/unpkg/dev/compat/-private.js +1 -1
  38. package/dist/unpkg/dev/compat.js +4 -3
  39. package/dist/unpkg/dev/{errors-DD96TBEs.js → errors-DmGGJr3T.js} +29 -58
  40. package/dist/unpkg/dev/{hooks-CqWjNWeL.js → hooks-CkYiE6Ud.js} +1 -1
  41. package/dist/unpkg/dev/index.js +3 -3
  42. package/dist/unpkg/{dev-deprecated/json-CCU-ZQ4b.js → dev/json-Cu1LNgmQ.js} +6 -19
  43. package/dist/unpkg/dev/model/-private.js +1 -1
  44. package/dist/unpkg/dev/model/migration-support.js +7 -5
  45. package/dist/unpkg/dev/model.js +3 -3
  46. package/dist/unpkg/dev/{schema-provider-B8jiJOYC.js → schema-provider-DDVYxmUV.js} +34 -77
  47. package/dist/unpkg/dev/{serialize-into-hash-CPAZXrQU.js → serialize-into-hash-B2xDbuo5.js} +1 -1
  48. package/dist/unpkg/dev/serializer/json-api.js +6 -5
  49. package/dist/unpkg/dev/serializer/json.js +1 -1
  50. package/dist/unpkg/dev/serializer/rest.js +1 -1
  51. package/dist/unpkg/dev/store.js +2 -1
  52. package/dist/unpkg/{dev/-private-DbaSCSym.js → dev-deprecated/-private-DtjBbEgy.js} +2 -1
  53. package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -1
  54. package/dist/unpkg/dev-deprecated/adapter/error.js +2 -2
  55. package/dist/unpkg/dev-deprecated/adapter/json-api.js +1 -1
  56. package/dist/unpkg/dev-deprecated/adapter/rest.js +33 -117
  57. package/dist/unpkg/dev-deprecated/adapter.js +2 -2
  58. package/dist/unpkg/dev-deprecated/compat/-private.js +1 -1
  59. package/dist/unpkg/dev-deprecated/compat.js +4 -3
  60. package/dist/unpkg/dev-deprecated/{errors-DEnabIZj.js → errors-Spt6ubMd.js} +29 -58
  61. package/dist/unpkg/dev-deprecated/{hooks-CAll-Ets.js → hooks-DOXegvhL.js} +1 -1
  62. package/dist/unpkg/dev-deprecated/index.js +3 -3
  63. package/dist/unpkg/{dev/json-CCU-ZQ4b.js → dev-deprecated/json-Cu1LNgmQ.js} +6 -19
  64. package/dist/unpkg/dev-deprecated/model/-private.js +1 -1
  65. package/dist/unpkg/dev-deprecated/model/migration-support.js +7 -5
  66. package/dist/unpkg/dev-deprecated/model.js +3 -3
  67. package/dist/unpkg/dev-deprecated/{schema-provider-k2qXQTBg.js → schema-provider-BP6_8N-V.js} +34 -77
  68. package/dist/unpkg/dev-deprecated/{serialize-into-hash-CPAZXrQU.js → serialize-into-hash-B2xDbuo5.js} +1 -1
  69. package/dist/unpkg/dev-deprecated/serializer/json-api.js +6 -5
  70. package/dist/unpkg/dev-deprecated/serializer/json.js +1 -1
  71. package/dist/unpkg/dev-deprecated/serializer/rest.js +1 -1
  72. package/dist/unpkg/dev-deprecated/store.js +2 -1
  73. package/dist/unpkg/{prod-deprecated/-private-Cvf_97EG.js → prod/-private-BdyZaGEh.js} +1 -0
  74. package/dist/unpkg/prod/adapter/-private.js +1 -1
  75. package/dist/unpkg/prod/adapter/error.js +2 -2
  76. package/dist/unpkg/prod/adapter/json-api.js +1 -1
  77. package/dist/unpkg/prod/adapter/rest.js +33 -117
  78. package/dist/unpkg/prod/adapter.js +2 -2
  79. package/dist/unpkg/prod/compat/-private.js +1 -1
  80. package/dist/unpkg/prod/compat.js +2 -1
  81. package/dist/unpkg/prod/{errors-CXnfnBfQ.js → errors-BGVFCBmi.js} +29 -58
  82. package/dist/unpkg/prod/{hooks-DvyWhLNg.js → hooks-BztVA_x0.js} +1 -1
  83. package/dist/unpkg/prod/index.js +3 -3
  84. package/dist/unpkg/prod/{json-BYrUP8ao.js → json-BWrZ5546.js} +6 -19
  85. package/dist/unpkg/prod/model/-private.js +1 -1
  86. package/dist/unpkg/prod/model/migration-support.js +7 -5
  87. package/dist/unpkg/prod/model.js +3 -3
  88. package/dist/unpkg/prod/{schema-provider-CHujJvA9.js → schema-provider-DJtD_8jZ.js} +34 -77
  89. package/dist/unpkg/{prod-deprecated/serialize-into-hash-DYU2egXl.js → prod/serialize-into-hash-DGlzQteF.js} +1 -1
  90. package/dist/unpkg/prod/serializer/json-api.js +6 -5
  91. package/dist/unpkg/prod/serializer/json.js +1 -1
  92. package/dist/unpkg/prod/serializer/rest.js +1 -1
  93. package/dist/unpkg/prod/store.js +2 -1
  94. package/dist/unpkg/{prod/-private-Cvf_97EG.js → prod-deprecated/-private-BdyZaGEh.js} +1 -0
  95. package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -1
  96. package/dist/unpkg/prod-deprecated/adapter/error.js +2 -2
  97. package/dist/unpkg/prod-deprecated/adapter/json-api.js +1 -1
  98. package/dist/unpkg/prod-deprecated/adapter/rest.js +33 -117
  99. package/dist/unpkg/prod-deprecated/adapter.js +2 -2
  100. package/dist/unpkg/prod-deprecated/compat/-private.js +1 -1
  101. package/dist/unpkg/prod-deprecated/compat.js +2 -1
  102. package/dist/unpkg/prod-deprecated/{errors-CG1SPYVg.js → errors-CdDaK81x.js} +29 -58
  103. package/dist/unpkg/prod-deprecated/{hooks-BIUBiNGR.js → hooks-yId87yyG.js} +1 -1
  104. package/dist/unpkg/prod-deprecated/index.js +3 -3
  105. package/dist/unpkg/prod-deprecated/{json-BYrUP8ao.js → json-BWrZ5546.js} +6 -19
  106. package/dist/unpkg/prod-deprecated/model/-private.js +1 -1
  107. package/dist/unpkg/prod-deprecated/model/migration-support.js +7 -5
  108. package/dist/unpkg/prod-deprecated/model.js +3 -3
  109. package/dist/unpkg/prod-deprecated/{schema-provider-BJ4TWnZf.js → schema-provider-CjX55uSY.js} +34 -77
  110. package/dist/unpkg/{prod/serialize-into-hash-DYU2egXl.js → prod-deprecated/serialize-into-hash-DGlzQteF.js} +1 -1
  111. package/dist/unpkg/prod-deprecated/serializer/json-api.js +6 -5
  112. package/dist/unpkg/prod-deprecated/serializer/json.js +1 -1
  113. package/dist/unpkg/prod-deprecated/serializer/rest.js +1 -1
  114. package/dist/unpkg/prod-deprecated/store.js +2 -1
  115. package/package.json +6 -6
@@ -1,8 +1,9 @@
1
1
  import { Context } from '@warp-drive/core/reactive/-private';
2
- import { memoized, defineSignal, assertPrivateStore, defineNonEnumerableSignal, isResourceKey, recordIdentifierFor, isPrivateStore, storeFor, fastPush, createLegacyManyArray, notifyInternalSignal } from '@warp-drive/core/store/-private';
2
+ import { memoized, defineSignal, defineNonEnumerableSignal, notifyInternalSignal } from '@warp-drive/core/signals/-leaked';
3
+ import { assertPrivateStore, isResourceKey, recordIdentifierFor, isPrivateStore, storeFor, fastPush, createLegacyManyArray } from '@warp-drive/core/store/-private';
3
4
  import { getOrSetGlobal } from '@warp-drive/core/types/-private';
4
5
  import { EnableHydration } from '@warp-drive/core/types/request';
5
- import { u as upgradeStore } from "./-private-B1pSSN52.js";
6
+ import { u as upgradeStore } from "./-private-BG3bMiKp.js";
6
7
  import { computed, get } from '@ember/object';
7
8
  import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
8
9
  import ObjectProxy from '@ember/object/proxy';
@@ -87,7 +88,6 @@ PromiseBelongsTo.prototype[LegacyPromiseProxy] = true;
87
88
  const comments = await post.comments;
88
89
  ```
89
90
 
90
- @class PromiseManyArray
91
91
  @public
92
92
  */
93
93
  class PromiseManyArray {
@@ -99,7 +99,6 @@ class PromiseManyArray {
99
99
 
100
100
  /**
101
101
  * Retrieve the length of the content
102
- * @property length
103
102
  * @public
104
103
  */
105
104
  get length() {
@@ -148,8 +147,6 @@ class PromiseManyArray {
148
147
  /**
149
148
  * Reload the relationship
150
149
  * @public
151
- * @param options
152
- * @return
153
150
  */
154
151
  reload(options) {
155
152
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -166,32 +163,24 @@ class PromiseManyArray {
166
163
  /**
167
164
  * Whether the loading promise is still pending
168
165
  *
169
- * @property isPending
170
- * @type {Boolean}
171
166
  * @public
172
167
  */
173
168
 
174
169
  /**
175
170
  * Whether the loading promise rejected
176
171
  *
177
- * @property isRejected
178
- * @type {Boolean}
179
172
  * @public
180
173
  */
181
174
 
182
175
  /**
183
176
  * Whether the loading promise succeeded
184
177
  *
185
- * @property isFulfilled
186
- * @type {Boolean}
187
178
  * @public
188
179
  */
189
180
 
190
181
  /**
191
182
  * Whether the loading promise completed (resolved or rejected)
192
183
  *
193
- * @property isSettled
194
- * @type {Boolean}
195
184
  * @public
196
185
  */
197
186
 
@@ -207,8 +196,6 @@ class PromiseManyArray {
207
196
  /**
208
197
  * catch errors thrown by this promise
209
198
  * @public
210
- * @param callback
211
- * @return {Promise}
212
199
  */
213
200
  catch(cb) {
214
201
  return this.promise.catch(cb);
@@ -218,8 +205,6 @@ class PromiseManyArray {
218
205
  * run cleanup after this promise completes
219
206
  *
220
207
  * @public
221
- * @param callback
222
- * @return {Promise}
223
208
  */
224
209
  finally(cb) {
225
210
  return this.promise.finally(cb);
@@ -237,7 +222,6 @@ class PromiseManyArray {
237
222
 
238
223
  /**
239
224
  * Retrieve the links for this relationship
240
- * @property links
241
225
  * @public
242
226
  */
243
227
  get links() {
@@ -246,7 +230,6 @@ class PromiseManyArray {
246
230
 
247
231
  /**
248
232
  * Retrieve the meta for this relationship
249
- * @property meta
250
233
  * @public
251
234
  */
252
235
  static {
@@ -494,7 +477,7 @@ class HasManyReference {
494
477
  }
495
478
  ```
496
479
  @public
497
- @return {String} The name of the remote type. This should either be `link` or `ids`
480
+ @return The name of the remote type. This should either be `link` or `ids`
498
481
  */
499
482
  remoteType() {
500
483
  const value = this._resource();
@@ -529,14 +512,14 @@ class HasManyReference {
529
512
  commentsRef.ids(); // ['1']
530
513
  ```
531
514
  @public
532
- @return {Array} The ids in this has-many relationship
515
+ @return The ids in this has-many relationship
533
516
  */
534
517
  ids() {
535
518
  return this.identifiers.map(identifier => identifier.id);
536
519
  }
537
520
 
538
521
  /**
539
- The link Ember Data will use to fetch or reload this belongs-to
522
+ The link WarpDrive will use to fetch or reload this belongs-to
540
523
  relationship. By default it uses only the "related" resource linkage.
541
524
  Example
542
525
  ```javascript
@@ -565,7 +548,7 @@ class HasManyReference {
565
548
  }
566
549
  ```
567
550
  @public
568
- @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.
551
+ @return The link WarpDrive will use to fetch or reload this belongs-to relationship.
569
552
  */
570
553
  link() {
571
554
  const resource = this._resource();
@@ -620,7 +603,7 @@ class HasManyReference {
620
603
  usersRef.meta() // { lastUpdated: 1458014400000 }
621
604
  ```
622
605
  @public
623
- @return {Object|null} The meta information for the belongs-to relationship.
606
+ @return The meta information for the belongs-to relationship.
624
607
  */
625
608
  meta() {
626
609
  let meta = null;
@@ -706,9 +689,8 @@ class HasManyReference {
706
689
  particularly useful if you want to update the state of the relationship without
707
690
  forcing the load of all of the associated records.
708
691
  @public
709
- @param {Array|Object} doc a JSONAPI document object describing the new value of this relationship.
710
- @param {Boolean} [skipFetch] if `true`, do not attempt to fetch unloaded records
711
- @return {Promise<ManyArray | void>}
692
+ @param doc a JSONAPI document object describing the new value of this relationship.
693
+ @param skipFetch [optional] if `true`, do not attempt to fetch unloaded records
712
694
  */
713
695
  async push(doc, skipFetch) {
714
696
  const {
@@ -800,7 +782,6 @@ class HasManyReference {
800
782
  })
801
783
  ```
802
784
  @public
803
- @return {ManyArray}
804
785
  */
805
786
  value() {
806
787
  const support = LEGACY_SUPPORT.get(this.___identifier);
@@ -860,8 +841,8 @@ class HasManyReference {
860
841
  });
861
842
  ```
862
843
  @public
863
- @param {Object} options the options to pass in.
864
- @return {Promise} a promise that resolves with the ManyArray in
844
+ @param options the options to pass in.
845
+ @return a promise that resolves with the ManyArray in
865
846
  this has-many relationship.
866
847
  */
867
848
  async load(options) {
@@ -908,9 +889,9 @@ class HasManyReference {
908
889
  ```javascript
909
890
  commentsRef.reload({ adapterOptions: { isPrivate: true } })
910
891
  ```
911
- @public
912
- @param {Object} options the options to pass in.
913
- @return {Promise} a promise that resolves with the ManyArray in this has-many relationship.
892
+ @public
893
+ @param options the options to pass in.
894
+ @return a promise that resolves with the ManyArray in this has-many relationship.
914
895
  */
915
896
  reload(options) {
916
897
  const support = LEGACY_SUPPORT.get(this.___identifier);
@@ -971,24 +952,17 @@ function isResourceIdentiferWithRelatedLinks(value) {
971
952
  References are "stable", meaning that multiple calls to retrieve the reference
972
953
  for a given relationship will always return the same HasManyReference.
973
954
 
974
- @class BelongsToReference
975
955
  @public
976
956
  */
977
957
  class BelongsToReference {
978
958
  /**
979
959
  * The field name on the parent record for this has-many relationship.
980
960
  *
981
- * @property key
982
- * @type {String}
983
- * @public
984
961
  */
985
962
 
986
963
  /**
987
964
  * The type of resource this relationship will contain.
988
965
  *
989
- * @property type
990
- * @type {String}
991
- * @public
992
966
  */
993
967
 
994
968
  // unsubscribe tokens given to us by the notification manager
@@ -1024,9 +998,6 @@ class BelongsToReference {
1024
998
  * The identifier of the record that this reference refers to.
1025
999
  * `null` if no related record is known.
1026
1000
  *
1027
- * @property identifier
1028
- * @type {ResourceKey | null}
1029
- * @public
1030
1001
  */
1031
1002
  get identifier() {
1032
1003
  if (this.___relatedToken) {
@@ -1077,7 +1048,7 @@ class BelongsToReference {
1077
1048
  }
1078
1049
  ```
1079
1050
  @public
1080
- @return {String} The id of the record in this belongsTo relationship.
1051
+ @return The id of the record in this belongsTo relationship.
1081
1052
  */
1082
1053
  static {
1083
1054
  decorateMethodV2(this.prototype, "identifier", [memoized]);
@@ -1087,7 +1058,7 @@ class BelongsToReference {
1087
1058
  }
1088
1059
 
1089
1060
  /**
1090
- The link Ember Data will use to fetch or reload this belongs-to
1061
+ The link WarpDrive will use to fetch or reload this belongs-to
1091
1062
  relationship. By default it uses only the "related" resource linkage.
1092
1063
  Example
1093
1064
  ```javascript
@@ -1116,7 +1087,7 @@ class BelongsToReference {
1116
1087
  }
1117
1088
  ```
1118
1089
  @public
1119
- @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.
1090
+ @return The link WarpDrive will use to fetch or reload this belongs-to relationship.
1120
1091
  */
1121
1092
  link() {
1122
1093
  const resource = this._resource();
@@ -1171,7 +1142,7 @@ class BelongsToReference {
1171
1142
  userRef.meta() // { lastUpdated: 1458014400000 }
1172
1143
  ```
1173
1144
  @public
1174
- @return {Object} The meta information for the belongs-to relationship.
1145
+ @return The meta information for the belongs-to relationship.
1175
1146
  */
1176
1147
  meta() {
1177
1148
  let meta = null;
@@ -1220,7 +1191,7 @@ class BelongsToReference {
1220
1191
  }
1221
1192
  ```
1222
1193
  @public
1223
- @return {String} The name of the remote type. This should either be `link` or `id`
1194
+ @return The name of the remote type. This should either be `link` or `id`
1224
1195
  */
1225
1196
  remoteType() {
1226
1197
  const value = this._resource();
@@ -1303,9 +1274,9 @@ class BelongsToReference {
1303
1274
  particularly useful if you want to update the state of the relationship without
1304
1275
  forcing the load of all of the associated record.
1305
1276
  @public
1306
- @param {Object} doc a JSONAPI document object describing the new value of this relationship.
1307
- @param {Boolean} [skipFetch] if `true`, do not attempt to fetch unloaded records
1308
- @return {Promise<OpaqueRecordInstance | null | void>}
1277
+ @param doc a JSONAPI document object describing the new value of this relationship.
1278
+ @param skipFetch [optional] if `true`, do not attempt to fetch unloaded records
1279
+ @return a promise that resolves with the record in this belongs-to relationship after the push has completed.
1309
1280
  */
1310
1281
  async push(doc, skipFetch) {
1311
1282
  const {
@@ -1385,7 +1356,7 @@ class BelongsToReference {
1385
1356
  });
1386
1357
  ```
1387
1358
  @public
1388
- @return {Model} the record in this relationship
1359
+ @return the record in this relationship
1389
1360
  */
1390
1361
  value() {
1391
1362
  const resource = this._resource();
@@ -1439,8 +1410,8 @@ class BelongsToReference {
1439
1410
  });
1440
1411
  ```
1441
1412
  @public
1442
- @param {Object} options the options to pass in.
1443
- @return {Promise} a promise that resolves with the record in this belongs-to relationship.
1413
+ @param options the options to pass in.
1414
+ @return a promise that resolves with the record in this belongs-to relationship.
1444
1415
  */
1445
1416
  async load(options) {
1446
1417
  const support = LEGACY_SUPPORT.get(this.___identifier);
@@ -1453,7 +1424,7 @@ class BelongsToReference {
1453
1424
 
1454
1425
  /**
1455
1426
  Triggers a reload of the value in this relationship. If the
1456
- remoteType is `"link"` Ember Data will use the relationship link to
1427
+ remoteType is `"link"` WarpDrive will use the relationship link to
1457
1428
  reload the relationship. Otherwise it will reload the record by its
1458
1429
  id.
1459
1430
  Example
@@ -1488,8 +1459,8 @@ class BelongsToReference {
1488
1459
  userRef.reload({ adapterOptions: { isPrivate: true } })
1489
1460
  ```
1490
1461
  @public
1491
- @param {Object} options the options to pass in.
1492
- @return {Promise} a promise that resolves with the record in this belongs-to relationship after the reload has completed.
1462
+ @param options the options to pass in.
1463
+ @return a promise that resolves with the record in this belongs-to relationship after the reload has completed.
1493
1464
  */
1494
1465
  reload(options) {
1495
1466
  const support = LEGACY_SUPPORT.get(this.___identifier);
@@ -1,6 +1,6 @@
1
1
  import { setOwner, getOwner } from '@ember/application';
2
2
  import { assertPrivateStore, setRecordIdentifier, StoreMap } from '@warp-drive/core/store/-private';
3
- import { g as getModelFactory } from "./schema-provider-g5MfTj8n.js";
3
+ import { g as getModelFactory } from "./schema-provider-DJCV_6AF.js";
4
4
  import { n as normalizeModelName } from "./util-Dul6TZts.js";
5
5
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
6
6
  function instantiateRecord(identifier, createRecordArgs) {
package/dist/index.js CHANGED
@@ -9,9 +9,9 @@ import '@ember/debug';
9
9
  import '@warp-drive/utilities/string';
10
10
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
11
11
  import '@warp-drive/core/store/-private';
12
- import "./errors-CIGPcDvd.js";
13
- import "./schema-provider-g5MfTj8n.js";
14
- import { i as instantiateRecord, t as teardownRecord, m as modelFor } from "./hooks-QqRnX108.js";
12
+ import "./errors-Cz5KrzBk.js";
13
+ import "./schema-provider-DJCV_6AF.js";
14
+ import { i as instantiateRecord, t as teardownRecord, m as modelFor } from "./hooks-D6diaM34.js";
15
15
  import { registerDerivations as registerDerivations$1, DelegatingSchemaService } from './model/migration-support.js';
16
16
  import { F as FragmentExtension, a as FragmentArrayExtension, f as fragmentsModelFor } from "./model-for-CqXsIKws.js";
17
17
  import { restoreDeprecatedStoreBehaviors } from './store.js';
@@ -65,8 +65,8 @@ const PRIMARY_ATTRIBUTE_KEY = 'base';
65
65
  }
66
66
  ```
67
67
 
68
- `JSONSerializer` will normalize the JSON payload to the JSON API format that the
69
- Ember Data store expects.
68
+ `JSONSerializer` will normalize the JSON payload to the {json:api} format that the
69
+ JSONAPICache uses to cache data in the Store.
70
70
 
71
71
  You can customize how JSONSerializer processes its payload by passing options in
72
72
  the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:
@@ -101,7 +101,7 @@ const PRIMARY_ATTRIBUTE_KEY = 'base';
101
101
  const JSONSerializer = Serializer.extend({
102
102
  /**
103
103
  The `primaryKey` is used when serializing and deserializing
104
- data. Ember Data always uses the `id` property to store the id of
104
+ data. WarpDrive always uses the `id` property to store the id of
105
105
  the record. The external source may not always follow this
106
106
  convention. In these cases it is useful to override the
107
107
  `primaryKey` property to match the `primaryKey` of your external
@@ -113,9 +113,7 @@ const JSONSerializer = Serializer.extend({
113
113
  primaryKey = '_id'
114
114
  }
115
115
  ```
116
- @property primaryKey
117
- @type {String}
118
- @public
116
+ @public
119
117
  @default 'id'
120
118
  */
121
119
  primaryKey: 'id',
@@ -453,9 +451,6 @@ const JSONSerializer = Serializer.extend({
453
451
  }
454
452
  ```
455
453
  @public
456
- @param {Model} typeClass
457
- @param {Object} hash
458
- @return {Object}
459
454
  */
460
455
  normalize(modelClass, resourceHash) {
461
456
  let data = null;
@@ -501,9 +496,6 @@ const JSONSerializer = Serializer.extend({
501
496
  Returns the resource's attributes formatted as a JSON-API "attributes object".
502
497
  http://jsonapi.org/format/#document-resource-object-attributes
503
498
  @public
504
- @param {Object} modelClass
505
- @param {Object} resourceHash
506
- @return {Object}
507
499
  */
508
500
  extractAttributes(modelClass, resourceHash) {
509
501
  let attributeKey;
@@ -644,8 +636,7 @@ const JSONSerializer = Serializer.extend({
644
636
  /**
645
637
  Dasherizes the model name in the payload
646
638
  @public
647
- @param {String} key
648
- @return {String} the model's modelName
639
+ @return the model's modelName
649
640
  */
650
641
  modelNameFromPayloadKey(key) {
651
642
  return dasherize(singularize(key));
@@ -1158,11 +1149,7 @@ const JSONSerializer = Serializer.extend({
1158
1149
  }
1159
1150
  ```
1160
1151
  @public
1161
- @param {Store} store
1162
- @param {Model} typeClass
1163
- @param {Object} payload
1164
- @param {(String|Number)} id
1165
- @return {Object} json The deserialized errors
1152
+ @return json The deserialized errors
1166
1153
  */
1167
1154
  extractErrors(store, typeClass, payload, id) {
1168
1155
  // @ts-expect-error
@@ -1 +1 @@
1
- export { E as Errors, L as LEGACY_SUPPORT, P as PromiseBelongsTo, a as PromiseManyArray, l as lookupLegacySupport } from "../errors-CIGPcDvd.js";
1
+ export { E as Errors, L as LEGACY_SUPPORT, P as PromiseBelongsTo, a as PromiseManyArray, l as lookupLegacySupport } from "../errors-Cz5KrzBk.js";
@@ -1,11 +1,12 @@
1
1
  import { deprecate } from '@ember/debug';
2
2
  import { recordIdentifierFor } from '@warp-drive/core';
3
3
  import { Context } from '@warp-drive/core/reactive/-private';
4
- import { notifyInternalSignal, assertPrivateStore } from '@warp-drive/core/store/-private';
4
+ import { notifyInternalSignal } from '@warp-drive/core/signals/-leaked';
5
+ import { assertPrivateStore } from '@warp-drive/core/store/-private';
5
6
  import { getOrSetGlobal } from '@warp-drive/core/types/-private';
6
7
  import { Type } from '@warp-drive/core/types/symbols';
7
- import { l as lookupLegacySupport, E as Errors } from "../errors-CIGPcDvd.js";
8
- import { b as buildSchema, u as unloadRecord, s as serialize, _ as _save, a as save, r as rollbackAttributes, c as _reload, d as reload, h as hasMany, e as _destroyRecord, f as destroyRecord, i as deleteRecord, R as RecordState, j as changedAttributes, k as belongsTo, l as createSnapshot } from "../schema-provider-g5MfTj8n.js";
8
+ import { l as lookupLegacySupport, E as Errors } from "../errors-Cz5KrzBk.js";
9
+ import { b as buildSchema, u as unloadRecord, s as serialize, _ as _save, a as save, r as rollbackAttributes, c as _reload, d as reload, h as hasMany, e as _destroyRecord, f as destroyRecord, i as deleteRecord, R as RecordState, j as changedAttributes, k as belongsTo, l as createSnapshot } from "../schema-provider-DJCV_6AF.js";
9
10
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
10
11
 
11
12
  /**
@@ -472,8 +473,9 @@ class DelegatingSchemaService {
472
473
  return this._secondary.fields(resource);
473
474
  }
474
475
  cacheFields(resource) {
475
- if (this._preferred.cacheFields?.(resource)) {
476
- return this._preferred.cacheFields(resource);
476
+ if (this._preferred.hasResource?.(resource)) {
477
+ // @ts-expect-error
478
+ return this._preferred.cacheFields?.(resource);
477
479
  }
478
480
 
479
481
  // @ts-expect-error
package/dist/model.js CHANGED
@@ -5,10 +5,10 @@ import { i as isElementDescriptor, n as normalizeModelName } from "./util-Dul6TZ
5
5
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
6
6
  import { warn, deprecate } from '@ember/debug';
7
7
  import { assertPrivateStore } from '@warp-drive/core/store/-private';
8
- import { l as lookupLegacySupport } from "./errors-CIGPcDvd.js";
8
+ import { l as lookupLegacySupport } from "./errors-Cz5KrzBk.js";
9
9
  import { singularize, dasherize } from '@warp-drive/utilities/string';
10
- export { M as Model, b as buildSchema, M as default, m as restoreDeprecatedModelRequestBehaviors } from "./schema-provider-g5MfTj8n.js";
11
- export { i as instantiateRecord, m as modelFor, t as teardownRecord } from "./hooks-QqRnX108.js";
10
+ export { M as Model, b as buildSchema, M as default, m as restoreDeprecatedModelRequestBehaviors } from "./schema-provider-DJCV_6AF.js";
11
+ export { i as instantiateRecord, m as modelFor, t as teardownRecord } from "./hooks-D6diaM34.js";
12
12
  function _attr(type, options) {
13
13
  if (typeof type === 'object') {
14
14
  options = type;