@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.
- package/declarations/adapter/error.d.ts +2 -2
- package/declarations/adapter/rest.d.ts +21 -104
- package/declarations/adapter.d.ts +2 -2
- package/declarations/model/-private/model.d.ts +10 -51
- package/declarations/model/-private/promise-many-array.d.ts +0 -18
- package/declarations/model/-private/references/belongs-to.d.ts +14 -24
- package/declarations/model/-private/references/has-many.d.ts +11 -13
- package/declarations/serializer/json-api.d.ts +4 -3
- package/declarations/serializer/json.d.ts +2 -2
- package/dist/{-private-B1pSSN52.js → -private-BG3bMiKp.js} +2 -1
- package/dist/adapter/-private.js +1 -1
- package/dist/adapter/error.js +2 -2
- package/dist/adapter/json-api.js +1 -1
- package/dist/adapter/rest.js +33 -117
- package/dist/adapter.js +2 -2
- package/dist/compat/-private.js +1 -1
- package/dist/compat.js +4 -3
- package/dist/{errors-CIGPcDvd.js → errors-Cz5KrzBk.js} +29 -58
- package/dist/{hooks-QqRnX108.js → hooks-D6diaM34.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{json-BNrV8EYG.js → json-ChdEfB0X.js} +6 -19
- package/dist/model/-private.js +1 -1
- package/dist/model/migration-support.js +7 -5
- package/dist/model.js +3 -3
- package/dist/{schema-provider-g5MfTj8n.js → schema-provider-DJCV_6AF.js} +34 -77
- package/dist/{serialize-into-hash-BnYvPex3.js → serialize-into-hash-DPZYoF-i.js} +1 -1
- package/dist/serializer/json-api.js +2 -2
- package/dist/serializer/json.js +1 -1
- package/dist/serializer/rest.js +1 -1
- package/dist/store.js +2 -1
- package/dist/unpkg/{dev-deprecated/-private-DbaSCSym.js → dev/-private-DtjBbEgy.js} +2 -1
- package/dist/unpkg/dev/adapter/-private.js +1 -1
- package/dist/unpkg/dev/adapter/error.js +2 -2
- package/dist/unpkg/dev/adapter/json-api.js +1 -1
- package/dist/unpkg/dev/adapter/rest.js +33 -117
- package/dist/unpkg/dev/adapter.js +2 -2
- package/dist/unpkg/dev/compat/-private.js +1 -1
- package/dist/unpkg/dev/compat.js +4 -3
- package/dist/unpkg/dev/{errors-DD96TBEs.js → errors-DmGGJr3T.js} +29 -58
- package/dist/unpkg/dev/{hooks-CqWjNWeL.js → hooks-CkYiE6Ud.js} +1 -1
- package/dist/unpkg/dev/index.js +3 -3
- package/dist/unpkg/{dev-deprecated/json-CCU-ZQ4b.js → dev/json-Cu1LNgmQ.js} +6 -19
- package/dist/unpkg/dev/model/-private.js +1 -1
- package/dist/unpkg/dev/model/migration-support.js +7 -5
- package/dist/unpkg/dev/model.js +3 -3
- package/dist/unpkg/dev/{schema-provider-B8jiJOYC.js → schema-provider-DDVYxmUV.js} +34 -77
- package/dist/unpkg/dev/{serialize-into-hash-CPAZXrQU.js → serialize-into-hash-B2xDbuo5.js} +1 -1
- package/dist/unpkg/dev/serializer/json-api.js +6 -5
- package/dist/unpkg/dev/serializer/json.js +1 -1
- package/dist/unpkg/dev/serializer/rest.js +1 -1
- package/dist/unpkg/dev/store.js +2 -1
- package/dist/unpkg/{dev/-private-DbaSCSym.js → dev-deprecated/-private-DtjBbEgy.js} +2 -1
- package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/adapter/error.js +2 -2
- package/dist/unpkg/dev-deprecated/adapter/json-api.js +1 -1
- package/dist/unpkg/dev-deprecated/adapter/rest.js +33 -117
- package/dist/unpkg/dev-deprecated/adapter.js +2 -2
- package/dist/unpkg/dev-deprecated/compat/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/compat.js +4 -3
- package/dist/unpkg/dev-deprecated/{errors-DEnabIZj.js → errors-Spt6ubMd.js} +29 -58
- package/dist/unpkg/dev-deprecated/{hooks-CAll-Ets.js → hooks-DOXegvhL.js} +1 -1
- package/dist/unpkg/dev-deprecated/index.js +3 -3
- package/dist/unpkg/{dev/json-CCU-ZQ4b.js → dev-deprecated/json-Cu1LNgmQ.js} +6 -19
- package/dist/unpkg/dev-deprecated/model/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/model/migration-support.js +7 -5
- package/dist/unpkg/dev-deprecated/model.js +3 -3
- package/dist/unpkg/dev-deprecated/{schema-provider-k2qXQTBg.js → schema-provider-BP6_8N-V.js} +34 -77
- package/dist/unpkg/dev-deprecated/{serialize-into-hash-CPAZXrQU.js → serialize-into-hash-B2xDbuo5.js} +1 -1
- package/dist/unpkg/dev-deprecated/serializer/json-api.js +6 -5
- package/dist/unpkg/dev-deprecated/serializer/json.js +1 -1
- package/dist/unpkg/dev-deprecated/serializer/rest.js +1 -1
- package/dist/unpkg/dev-deprecated/store.js +2 -1
- package/dist/unpkg/{prod-deprecated/-private-Cvf_97EG.js → prod/-private-BdyZaGEh.js} +1 -0
- package/dist/unpkg/prod/adapter/-private.js +1 -1
- package/dist/unpkg/prod/adapter/error.js +2 -2
- package/dist/unpkg/prod/adapter/json-api.js +1 -1
- package/dist/unpkg/prod/adapter/rest.js +33 -117
- package/dist/unpkg/prod/adapter.js +2 -2
- package/dist/unpkg/prod/compat/-private.js +1 -1
- package/dist/unpkg/prod/compat.js +2 -1
- package/dist/unpkg/prod/{errors-CXnfnBfQ.js → errors-BGVFCBmi.js} +29 -58
- package/dist/unpkg/prod/{hooks-DvyWhLNg.js → hooks-BztVA_x0.js} +1 -1
- package/dist/unpkg/prod/index.js +3 -3
- package/dist/unpkg/prod/{json-BYrUP8ao.js → json-BWrZ5546.js} +6 -19
- package/dist/unpkg/prod/model/-private.js +1 -1
- package/dist/unpkg/prod/model/migration-support.js +7 -5
- package/dist/unpkg/prod/model.js +3 -3
- package/dist/unpkg/prod/{schema-provider-CHujJvA9.js → schema-provider-DJtD_8jZ.js} +34 -77
- package/dist/unpkg/{prod-deprecated/serialize-into-hash-DYU2egXl.js → prod/serialize-into-hash-DGlzQteF.js} +1 -1
- package/dist/unpkg/prod/serializer/json-api.js +6 -5
- package/dist/unpkg/prod/serializer/json.js +1 -1
- package/dist/unpkg/prod/serializer/rest.js +1 -1
- package/dist/unpkg/prod/store.js +2 -1
- package/dist/unpkg/{prod/-private-Cvf_97EG.js → prod-deprecated/-private-BdyZaGEh.js} +1 -0
- package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/adapter/error.js +2 -2
- package/dist/unpkg/prod-deprecated/adapter/json-api.js +1 -1
- package/dist/unpkg/prod-deprecated/adapter/rest.js +33 -117
- package/dist/unpkg/prod-deprecated/adapter.js +2 -2
- package/dist/unpkg/prod-deprecated/compat/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/compat.js +2 -1
- package/dist/unpkg/prod-deprecated/{errors-CG1SPYVg.js → errors-CdDaK81x.js} +29 -58
- package/dist/unpkg/prod-deprecated/{hooks-BIUBiNGR.js → hooks-yId87yyG.js} +1 -1
- package/dist/unpkg/prod-deprecated/index.js +3 -3
- package/dist/unpkg/prod-deprecated/{json-BYrUP8ao.js → json-BWrZ5546.js} +6 -19
- package/dist/unpkg/prod-deprecated/model/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/model/migration-support.js +7 -5
- package/dist/unpkg/prod-deprecated/model.js +3 -3
- package/dist/unpkg/prod-deprecated/{schema-provider-BJ4TWnZf.js → schema-provider-CjX55uSY.js} +34 -77
- package/dist/unpkg/{prod/serialize-into-hash-DYU2egXl.js → prod-deprecated/serialize-into-hash-DGlzQteF.js} +1 -1
- package/dist/unpkg/prod-deprecated/serializer/json-api.js +6 -5
- package/dist/unpkg/prod-deprecated/serializer/json.js +1 -1
- package/dist/unpkg/prod-deprecated/serializer/rest.js +1 -1
- package/dist/unpkg/prod-deprecated/store.js +2 -1
- package/package.json +6 -6
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { getOwner } from '@ember/application';
|
|
2
2
|
import EmberObject from '@ember/object';
|
|
3
3
|
import { recordIdentifierFor, storeFor } from '@warp-drive/core';
|
|
4
|
-
import {
|
|
4
|
+
import { notifyInternalSignal, peekInternalSignal, withSignalStore, gate, memoized, defineSignal, entangleSignal, defineGate } from '@warp-drive/core/signals/-leaked';
|
|
5
|
+
import { assertPrivateStore, recordIdentifierFor as recordIdentifierFor$1, coerceId } from '@warp-drive/core/store/-private';
|
|
5
6
|
import { RecordStore } from '@warp-drive/core/types/symbols';
|
|
6
|
-
import { l as lookupLegacySupport, L as LEGACY_SUPPORT, E as Errors } from "./errors-
|
|
7
|
-
import { u as upgradeStore, F as FetchManager } from "./-private-
|
|
7
|
+
import { l as lookupLegacySupport, L as LEGACY_SUPPORT, E as Errors } from "./errors-DmGGJr3T.js";
|
|
8
|
+
import { u as upgradeStore, F as FetchManager } from "./-private-DtjBbEgy.js";
|
|
8
9
|
import { cacheFor } from '@ember/object/internals';
|
|
9
10
|
import { Context } from '@warp-drive/core/reactive/-private';
|
|
10
11
|
import { d as decorateMethodV2 } from "./runtime-BPCpkOf1-BKOwiRJp.js";
|
|
@@ -737,9 +738,7 @@ class Model extends EmberObject {
|
|
|
737
738
|
the server or the `created` state if the record is created on the
|
|
738
739
|
client. A record can also enter the empty state if the adapter is
|
|
739
740
|
unable to locate the record.
|
|
740
|
-
@
|
|
741
|
-
@public
|
|
742
|
-
@readonly
|
|
741
|
+
@public
|
|
743
742
|
*/
|
|
744
743
|
get isEmpty() {
|
|
745
744
|
return this.currentState.isEmpty;
|
|
@@ -750,9 +749,7 @@ class Model extends EmberObject {
|
|
|
750
749
|
record enters this state when the store asks the adapter for its
|
|
751
750
|
data. It remains in this state until the adapter provides the
|
|
752
751
|
requested data.
|
|
753
|
-
@
|
|
754
|
-
@public
|
|
755
|
-
@readonly
|
|
752
|
+
@public
|
|
756
753
|
*/
|
|
757
754
|
static {
|
|
758
755
|
decorateMethodV2(this.prototype, "isEmpty", [memoized]);
|
|
@@ -773,9 +770,7 @@ class Model extends EmberObject {
|
|
|
773
770
|
const { content: { data: model } } = await store.request(findRecord({ type: 'model', id: '1' }));
|
|
774
771
|
model.isLoaded;
|
|
775
772
|
```
|
|
776
|
-
@
|
|
777
|
-
@public
|
|
778
|
-
@readonly
|
|
773
|
+
@public
|
|
779
774
|
*/
|
|
780
775
|
static {
|
|
781
776
|
decorateMethodV2(this.prototype, "isLoading", [memoized]);
|
|
@@ -799,9 +794,7 @@ class Model extends EmberObject {
|
|
|
799
794
|
model.hasDirtyAttributes; // true
|
|
800
795
|
```
|
|
801
796
|
@since 1.13.0
|
|
802
|
-
@property hasDirtyAttributes
|
|
803
797
|
@public
|
|
804
|
-
@readonly
|
|
805
798
|
*/
|
|
806
799
|
static {
|
|
807
800
|
decorateMethodV2(this.prototype, "isLoaded", [memoized]);
|
|
@@ -825,9 +818,7 @@ class Model extends EmberObject {
|
|
|
825
818
|
record.isSaving; // false
|
|
826
819
|
});
|
|
827
820
|
```
|
|
828
|
-
@
|
|
829
|
-
@public
|
|
830
|
-
@readonly
|
|
821
|
+
@public
|
|
831
822
|
*/
|
|
832
823
|
static {
|
|
833
824
|
decorateMethodV2(this.prototype, "hasDirtyAttributes", [memoized]);
|
|
@@ -863,9 +854,7 @@ class Model extends EmberObject {
|
|
|
863
854
|
record.hasDirtyAttributes; // false
|
|
864
855
|
});
|
|
865
856
|
```
|
|
866
|
-
@
|
|
867
|
-
@public
|
|
868
|
-
@readonly
|
|
857
|
+
@public
|
|
869
858
|
*/
|
|
870
859
|
static {
|
|
871
860
|
decorateMethodV2(this.prototype, "isSaving", [memoized]);
|
|
@@ -887,9 +876,7 @@ class Model extends EmberObject {
|
|
|
887
876
|
model.isNew; // false
|
|
888
877
|
});
|
|
889
878
|
```
|
|
890
|
-
@
|
|
891
|
-
@public
|
|
892
|
-
@readonly
|
|
879
|
+
@public
|
|
893
880
|
*/
|
|
894
881
|
static {
|
|
895
882
|
decorateMethodV2(this.prototype, "isDeleted", [memoized]);
|
|
@@ -902,9 +889,7 @@ class Model extends EmberObject {
|
|
|
902
889
|
If this property is `true` the record is in the `valid` state.
|
|
903
890
|
A record will be in the `valid` state when the adapter did not report any
|
|
904
891
|
server-side validation failures.
|
|
905
|
-
@
|
|
906
|
-
@public
|
|
907
|
-
@readonly
|
|
892
|
+
@public
|
|
908
893
|
*/
|
|
909
894
|
static {
|
|
910
895
|
decorateMethodV2(this.prototype, "isNew", [memoized]);
|
|
@@ -925,9 +910,7 @@ class Model extends EmberObject {
|
|
|
925
910
|
let record = store.createRecord('model');
|
|
926
911
|
record.dirtyType; // 'created'
|
|
927
912
|
```
|
|
928
|
-
@
|
|
929
|
-
@public
|
|
930
|
-
@readonly
|
|
913
|
+
@public
|
|
931
914
|
*/
|
|
932
915
|
static {
|
|
933
916
|
decorateMethodV2(this.prototype, "isValid", [memoized]);
|
|
@@ -948,9 +931,7 @@ class Model extends EmberObject {
|
|
|
948
931
|
record.isError; // true
|
|
949
932
|
});
|
|
950
933
|
```
|
|
951
|
-
@
|
|
952
|
-
@public
|
|
953
|
-
@readonly
|
|
934
|
+
@public
|
|
954
935
|
*/
|
|
955
936
|
static {
|
|
956
937
|
decorateMethodV2(this.prototype, "dirtyType", [memoized]);
|
|
@@ -975,9 +956,7 @@ class Model extends EmberObject {
|
|
|
975
956
|
record.reload();
|
|
976
957
|
record.isReloading; // true
|
|
977
958
|
```
|
|
978
|
-
@
|
|
979
|
-
@public
|
|
980
|
-
@readonly
|
|
959
|
+
@public
|
|
981
960
|
*/
|
|
982
961
|
|
|
983
962
|
/**
|
|
@@ -992,8 +971,7 @@ class Model extends EmberObject {
|
|
|
992
971
|
const { content: { data: model } } = await store.request(findRecord({ type: 'model', id: '1' }));
|
|
993
972
|
model.id; // '1'
|
|
994
973
|
```
|
|
995
|
-
@
|
|
996
|
-
@public
|
|
974
|
+
@public
|
|
997
975
|
*/
|
|
998
976
|
get id() {
|
|
999
977
|
// this guard exists, because some dev-only deprecation code
|
|
@@ -1031,7 +1009,6 @@ class Model extends EmberObject {
|
|
|
1031
1009
|
}
|
|
1032
1010
|
|
|
1033
1011
|
/**
|
|
1034
|
-
@property currentState
|
|
1035
1012
|
@private
|
|
1036
1013
|
*/
|
|
1037
1014
|
// TODO we can probably make this a computeOnce
|
|
@@ -1053,8 +1030,7 @@ class Model extends EmberObject {
|
|
|
1053
1030
|
|
|
1054
1031
|
/**
|
|
1055
1032
|
The store service instance which created this record instance
|
|
1056
|
-
|
|
1057
|
-
@public
|
|
1033
|
+
@public
|
|
1058
1034
|
*/
|
|
1059
1035
|
|
|
1060
1036
|
/**
|
|
@@ -1097,8 +1073,7 @@ class Model extends EmberObject {
|
|
|
1097
1073
|
</div>
|
|
1098
1074
|
{{/each}}
|
|
1099
1075
|
```
|
|
1100
|
-
@
|
|
1101
|
-
@public
|
|
1076
|
+
@public
|
|
1102
1077
|
*/
|
|
1103
1078
|
get errors() {
|
|
1104
1079
|
const errors = Errors.create({
|
|
@@ -1111,8 +1086,7 @@ class Model extends EmberObject {
|
|
|
1111
1086
|
/**
|
|
1112
1087
|
This property holds the `AdapterError` object with which
|
|
1113
1088
|
last adapter operation was rejected.
|
|
1114
|
-
@
|
|
1115
|
-
@public
|
|
1089
|
+
@public
|
|
1116
1090
|
*/
|
|
1117
1091
|
static {
|
|
1118
1092
|
decorateMethodV2(this.prototype, "errors", [computeOnce]);
|
|
@@ -1228,9 +1202,7 @@ class Model extends EmberObject {
|
|
|
1228
1202
|
}
|
|
1229
1203
|
});
|
|
1230
1204
|
```
|
|
1231
|
-
|
|
1232
|
-
@public
|
|
1233
|
-
@readonly
|
|
1205
|
+
@public
|
|
1234
1206
|
*/
|
|
1235
1207
|
static modelName = null;
|
|
1236
1208
|
|
|
@@ -1396,11 +1368,8 @@ class Model extends EmberObject {
|
|
|
1396
1368
|
relationships.post;
|
|
1397
1369
|
//=> [ { name: 'posts', kind: 'hasMany' } ]
|
|
1398
1370
|
```
|
|
1399
|
-
|
|
1400
|
-
@public
|
|
1401
|
-
@readonly
|
|
1371
|
+
@public
|
|
1402
1372
|
*/
|
|
1403
|
-
|
|
1404
1373
|
static get relationships() {
|
|
1405
1374
|
(test => {
|
|
1406
1375
|
if (!test) {
|
|
@@ -1444,9 +1413,7 @@ class Model extends EmberObject {
|
|
|
1444
1413
|
relationshipNames.belongsTo;
|
|
1445
1414
|
//=> ['owner']
|
|
1446
1415
|
```
|
|
1447
|
-
|
|
1448
|
-
@public
|
|
1449
|
-
@readonly
|
|
1416
|
+
@public
|
|
1450
1417
|
*/
|
|
1451
1418
|
static {
|
|
1452
1419
|
decorateMethodV2(this, "relationships", [computeOnce]);
|
|
@@ -1488,9 +1455,7 @@ class Model extends EmberObject {
|
|
|
1488
1455
|
let relatedTypes = Blog.relatedTypes');
|
|
1489
1456
|
//=> ['user', 'post']
|
|
1490
1457
|
```
|
|
1491
|
-
@
|
|
1492
|
-
@public
|
|
1493
|
-
@readonly
|
|
1458
|
+
@public
|
|
1494
1459
|
*/
|
|
1495
1460
|
static {
|
|
1496
1461
|
decorateMethodV2(this, "relationshipNames", [computeOnce]);
|
|
@@ -1540,9 +1505,7 @@ class Model extends EmberObject {
|
|
|
1540
1505
|
relationshipsByName.owner;
|
|
1541
1506
|
//=> { name: 'owner', kind: 'belongsTo', type: 'user', options: Object }
|
|
1542
1507
|
```
|
|
1543
|
-
|
|
1544
|
-
@public
|
|
1545
|
-
@readonly
|
|
1508
|
+
@public
|
|
1546
1509
|
*/
|
|
1547
1510
|
static {
|
|
1548
1511
|
decorateMethodV2(this, "relatedTypes", [computeOnce]);
|
|
@@ -1622,9 +1585,7 @@ class Model extends EmberObject {
|
|
|
1622
1585
|
// posts, hasMany
|
|
1623
1586
|
// title, attribute
|
|
1624
1587
|
```
|
|
1625
|
-
|
|
1626
|
-
@public
|
|
1627
|
-
@readonly
|
|
1588
|
+
@public
|
|
1628
1589
|
*/
|
|
1629
1590
|
static {
|
|
1630
1591
|
decorateMethodV2(this, "relationshipsObject", [computeOnce]);
|
|
@@ -1651,8 +1612,8 @@ class Model extends EmberObject {
|
|
|
1651
1612
|
invoking the callback with the name of each relationship and its relationship
|
|
1652
1613
|
descriptor.
|
|
1653
1614
|
@public
|
|
1654
|
-
@param
|
|
1655
|
-
@param
|
|
1615
|
+
@param callback the callback to invoke
|
|
1616
|
+
@param binding the value to which the callback's `this` should be bound
|
|
1656
1617
|
*/
|
|
1657
1618
|
static {
|
|
1658
1619
|
decorateMethodV2(this, "fields", [computeOnce]);
|
|
@@ -1674,8 +1635,8 @@ class Model extends EmberObject {
|
|
|
1674
1635
|
returned just once, regardless of how many different relationships it has
|
|
1675
1636
|
with a model.
|
|
1676
1637
|
@public
|
|
1677
|
-
@param
|
|
1678
|
-
@param
|
|
1638
|
+
@param callback the callback to invoke
|
|
1639
|
+
@param binding the value to which the callback's `this` should be bound
|
|
1679
1640
|
*/
|
|
1680
1641
|
static eachRelatedType(callback, binding) {
|
|
1681
1642
|
(test => {
|
|
@@ -1743,9 +1704,7 @@ class Model extends EmberObject {
|
|
|
1743
1704
|
// lastName {type: "string", kind: 'attribute', options: Object, parentType: function, name: "lastName"}
|
|
1744
1705
|
// birthday {type: "date", kind: 'attribute', options: Object, parentType: function, name: "birthday"}
|
|
1745
1706
|
```
|
|
1746
|
-
|
|
1747
|
-
@public
|
|
1748
|
-
@readonly
|
|
1707
|
+
@public
|
|
1749
1708
|
*/
|
|
1750
1709
|
static get attributes() {
|
|
1751
1710
|
(test => {
|
|
@@ -1795,9 +1754,7 @@ class Model extends EmberObject {
|
|
|
1795
1754
|
// lastName string
|
|
1796
1755
|
// birthday date
|
|
1797
1756
|
```
|
|
1798
|
-
|
|
1799
|
-
@public
|
|
1800
|
-
@readonly
|
|
1757
|
+
@public
|
|
1801
1758
|
*/
|
|
1802
1759
|
static {
|
|
1803
1760
|
decorateMethodV2(this, "attributes", [computeOnce]);
|
|
@@ -1846,8 +1803,8 @@ class Model extends EmberObject {
|
|
|
1846
1803
|
// birthday {type: "date", kind: 'attribute', options: Object, parentType: function, name: "birthday"}
|
|
1847
1804
|
```
|
|
1848
1805
|
@public
|
|
1849
|
-
@param
|
|
1850
|
-
@param
|
|
1806
|
+
@param callback The callback to execute
|
|
1807
|
+
@param binding [optional] the value to which the callback's `this` should be bound
|
|
1851
1808
|
*/
|
|
1852
1809
|
static {
|
|
1853
1810
|
decorateMethodV2(this, "transformedAttributes", [computeOnce]);
|
|
@@ -1893,8 +1850,8 @@ class Model extends EmberObject {
|
|
|
1893
1850
|
// birthday date
|
|
1894
1851
|
```
|
|
1895
1852
|
@public
|
|
1896
|
-
@param
|
|
1897
|
-
@param
|
|
1853
|
+
@param callback The callback to execute
|
|
1854
|
+
@param binding [optional] the value to which the callback's `this` should be bound
|
|
1898
1855
|
*/
|
|
1899
1856
|
static eachTransformedAttribute(callback, binding) {
|
|
1900
1857
|
(test => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dasherize, pluralize, singularize } from '@warp-drive/utilities/string';
|
|
2
|
-
import { J as JSONSerializer } from "../json-
|
|
2
|
+
import { J as JSONSerializer } from "../json-Cu1LNgmQ.js";
|
|
3
3
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
@@ -19,8 +19,9 @@ import { J as JSONSerializer } from "../json-CCU-ZQ4b.js";
|
|
|
19
19
|
This process involves normalizing property names, transforming
|
|
20
20
|
attribute values and serializing relationships.
|
|
21
21
|
|
|
22
|
-
`JSONAPISerializer` supports the http://jsonapi.org/ spec
|
|
23
|
-
|
|
22
|
+
`JSONAPISerializer` supports the http://jsonapi.org/ spec, though
|
|
23
|
+
even compliant {json:api} servers may find writing an application
|
|
24
|
+
specific serializer better suited to their needs and more performant.
|
|
24
25
|
|
|
25
26
|
This serializer normalizes a JSON API payload that looks like:
|
|
26
27
|
|
|
@@ -89,7 +90,7 @@ import { J as JSONSerializer } from "../json-CCU-ZQ4b.js";
|
|
|
89
90
|
}
|
|
90
91
|
```
|
|
91
92
|
|
|
92
|
-
to the format that the
|
|
93
|
+
to the format that the JSONAPICache expects.
|
|
93
94
|
|
|
94
95
|
### Customizing meta
|
|
95
96
|
|
|
@@ -300,7 +301,7 @@ const JSONAPISerializer = JSONSerializer.extend({
|
|
|
300
301
|
},
|
|
301
302
|
/**
|
|
302
303
|
Dasherizes and singularizes the model name in the payload to match
|
|
303
|
-
the
|
|
304
|
+
the common convention for model names.
|
|
304
305
|
For example the key `posts` would be converted to `post` and the
|
|
305
306
|
key `studentAssesments` would be converted to `student-assesment`.
|
|
306
307
|
@public
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { camelize, dasherize, singularize } from '@warp-drive/utilities/string';
|
|
2
|
-
import { J as JSONSerializer, c as coerceId } from "../json-
|
|
2
|
+
import { J as JSONSerializer, c as coerceId } from "../json-Cu1LNgmQ.js";
|
|
3
3
|
import Mixin from '@ember/object/mixin';
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
package/dist/unpkg/dev/store.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
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-BhvS1iTS.js";
|
|
4
4
|
import { n as normalizeModelName } from "./util-DvanW33H.js";
|
|
5
|
+
import { defineSignal } from '@warp-drive/core/signals/-leaked';
|
|
5
6
|
import { getOrSetGlobal } from '@warp-drive/core/types/-private';
|
|
6
7
|
|
|
7
8
|
/*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Context } from '@warp-drive/core/reactive/-private';
|
|
2
2
|
import { createDeferred } from '@warp-drive/core/request';
|
|
3
|
-
import {
|
|
3
|
+
import { waitFor } from '@warp-drive/core/signals/-leaked';
|
|
4
|
+
import { assertPrivateStore, coerceId } from '@warp-drive/core/store/-private';
|
|
4
5
|
import { getOrSetGlobal } from '@warp-drive/core/types/-private';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { d as determineBodyPromise, g as fetch, p as parseResponseHeaders, b as serializeIntoHash, s as serializeQueryParams, a as setupFastboot } from "../serialize-into-hash-
|
|
1
|
+
export { d as determineBodyPromise, g as fetch, p as parseResponseHeaders, b as serializeIntoHash, s as serializeQueryParams, a as setupFastboot } from "../serialize-into-hash-B2xDbuo5.js";
|
|
@@ -124,8 +124,8 @@ function extend(ParentErrorClass, defaultMessage) {
|
|
|
124
124
|
transition to the `invalid` state and the errors will be set to the
|
|
125
125
|
`errors` property on the record.
|
|
126
126
|
|
|
127
|
-
For
|
|
128
|
-
properties on the model,
|
|
127
|
+
For WarpDrive to correctly map errors to their corresponding
|
|
128
|
+
properties on the model, WarpDrive expects each error to be
|
|
129
129
|
a valid JSON-API error object with a `source/pointer` that matches
|
|
130
130
|
the property name. For example, if you had a Post model that
|
|
131
131
|
looked like this.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dasherize, pluralize } from '@warp-drive/utilities/string';
|
|
2
|
-
import { b as serializeIntoHash } from "../serialize-into-hash-
|
|
2
|
+
import { b as serializeIntoHash } from "../serialize-into-hash-B2xDbuo5.js";
|
|
3
3
|
import { RESTAdapter } from './rest.js';
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|