@warp-drive/legacy 5.8.0-alpha.40 → 5.8.0-alpha.42
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/index.d.ts +32 -0
- 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
|
@@ -22,7 +22,6 @@ In your JS code you should resolve the promise first.
|
|
|
22
22
|
const comments = await post.comments;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
@class PromiseManyArray
|
|
26
25
|
@public
|
|
27
26
|
*/
|
|
28
27
|
export declare class PromiseManyArray<T = unknown> {
|
|
@@ -32,7 +31,6 @@ export declare class PromiseManyArray<T = unknown> {
|
|
|
32
31
|
constructor(promise: Promise<ManyArray<T>>, content?: ManyArray<T>);
|
|
33
32
|
/**
|
|
34
33
|
* Retrieve the length of the content
|
|
35
|
-
* @property length
|
|
36
34
|
* @public
|
|
37
35
|
*/
|
|
38
36
|
get length(): number;
|
|
@@ -50,39 +48,29 @@ export declare class PromiseManyArray<T = unknown> {
|
|
|
50
48
|
/**
|
|
51
49
|
* Reload the relationship
|
|
52
50
|
* @public
|
|
53
|
-
* @param options
|
|
54
|
-
* @return
|
|
55
51
|
*/
|
|
56
52
|
reload(options: Omit<BaseFinderOptions, "">): this;
|
|
57
53
|
/**
|
|
58
54
|
* Whether the loading promise is still pending
|
|
59
55
|
*
|
|
60
|
-
* @property isPending
|
|
61
|
-
* @type {Boolean}
|
|
62
56
|
* @public
|
|
63
57
|
*/
|
|
64
58
|
isPending: boolean;
|
|
65
59
|
/**
|
|
66
60
|
* Whether the loading promise rejected
|
|
67
61
|
*
|
|
68
|
-
* @property isRejected
|
|
69
|
-
* @type {Boolean}
|
|
70
62
|
* @public
|
|
71
63
|
*/
|
|
72
64
|
isRejected: boolean;
|
|
73
65
|
/**
|
|
74
66
|
* Whether the loading promise succeeded
|
|
75
67
|
*
|
|
76
|
-
* @property isFulfilled
|
|
77
|
-
* @type {Boolean}
|
|
78
68
|
* @public
|
|
79
69
|
*/
|
|
80
70
|
isFulfilled: boolean;
|
|
81
71
|
/**
|
|
82
72
|
* Whether the loading promise completed (resolved or rejected)
|
|
83
73
|
*
|
|
84
|
-
* @property isSettled
|
|
85
|
-
* @type {Boolean}
|
|
86
74
|
* @public
|
|
87
75
|
*/
|
|
88
76
|
isSettled: boolean;
|
|
@@ -95,28 +83,22 @@ export declare class PromiseManyArray<T = unknown> {
|
|
|
95
83
|
/**
|
|
96
84
|
* catch errors thrown by this promise
|
|
97
85
|
* @public
|
|
98
|
-
* @param callback
|
|
99
|
-
* @return {Promise}
|
|
100
86
|
*/
|
|
101
87
|
catch(cb: Parameters<Promise<ManyArray<T>>["catch"]>[0]): Promise<unknown>;
|
|
102
88
|
/**
|
|
103
89
|
* run cleanup after this promise completes
|
|
104
90
|
*
|
|
105
91
|
* @public
|
|
106
|
-
* @param callback
|
|
107
|
-
* @return {Promise}
|
|
108
92
|
*/
|
|
109
93
|
finally(cb: Parameters<Promise<ManyArray<T>>["finally"]>[0]): Promise<unknown>;
|
|
110
94
|
destroy(): void;
|
|
111
95
|
/**
|
|
112
96
|
* Retrieve the links for this relationship
|
|
113
|
-
* @property links
|
|
114
97
|
* @public
|
|
115
98
|
*/
|
|
116
99
|
get links(): Links | null | undefined;
|
|
117
100
|
/**
|
|
118
101
|
* Retrieve the meta for this relationship
|
|
119
|
-
* @property meta
|
|
120
102
|
* @public
|
|
121
103
|
*/
|
|
122
104
|
get meta(): Record<string, unknown> | null | undefined;
|
|
@@ -30,7 +30,6 @@ invalidate if the relationship state changes.
|
|
|
30
30
|
References are "stable", meaning that multiple calls to retrieve the reference
|
|
31
31
|
for a given relationship will always return the same HasManyReference.
|
|
32
32
|
|
|
33
|
-
@class BelongsToReference
|
|
34
33
|
@public
|
|
35
34
|
*/
|
|
36
35
|
export default class BelongsToReference<
|
|
@@ -44,17 +43,11 @@ export default class BelongsToReference<
|
|
|
44
43
|
/**
|
|
45
44
|
* The field name on the parent record for this has-many relationship.
|
|
46
45
|
*
|
|
47
|
-
* @property key
|
|
48
|
-
* @type {String}
|
|
49
|
-
* @public
|
|
50
46
|
*/
|
|
51
47
|
key: K;
|
|
52
48
|
/**
|
|
53
49
|
* The type of resource this relationship will contain.
|
|
54
50
|
*
|
|
55
|
-
* @property type
|
|
56
|
-
* @type {String}
|
|
57
|
-
* @public
|
|
58
51
|
*/
|
|
59
52
|
type: TypeFromInstanceOrString<Related>;
|
|
60
53
|
___token: object;
|
|
@@ -67,9 +60,6 @@ export default class BelongsToReference<
|
|
|
67
60
|
* The identifier of the record that this reference refers to.
|
|
68
61
|
* `null` if no related record is known.
|
|
69
62
|
*
|
|
70
|
-
* @property identifier
|
|
71
|
-
* @type {ResourceKey | null}
|
|
72
|
-
* @public
|
|
73
63
|
*/
|
|
74
64
|
get identifier(): ResourceKey<TypeFromInstanceOrString<Related>> | null;
|
|
75
65
|
/**
|
|
@@ -109,11 +99,11 @@ export default class BelongsToReference<
|
|
|
109
99
|
```
|
|
110
100
|
|
|
111
101
|
@public
|
|
112
|
-
@return
|
|
102
|
+
@return The id of the record in this belongsTo relationship.
|
|
113
103
|
*/
|
|
114
104
|
id(): string | null;
|
|
115
105
|
/**
|
|
116
|
-
The link
|
|
106
|
+
The link WarpDrive will use to fetch or reload this belongs-to
|
|
117
107
|
relationship. By default it uses only the "related" resource linkage.
|
|
118
108
|
|
|
119
109
|
Example
|
|
@@ -147,7 +137,7 @@ export default class BelongsToReference<
|
|
|
147
137
|
```
|
|
148
138
|
|
|
149
139
|
@public
|
|
150
|
-
@return
|
|
140
|
+
@return The link WarpDrive will use to fetch or reload this belongs-to relationship.
|
|
151
141
|
*/
|
|
152
142
|
link(): string | null;
|
|
153
143
|
/**
|
|
@@ -194,7 +184,7 @@ export default class BelongsToReference<
|
|
|
194
184
|
```
|
|
195
185
|
|
|
196
186
|
@public
|
|
197
|
-
@return
|
|
187
|
+
@return The meta information for the belongs-to relationship.
|
|
198
188
|
*/
|
|
199
189
|
meta(): Meta | null;
|
|
200
190
|
_resource(): SingleResourceRelationship<ResourceKey<TypeFromInstance<Related>>>;
|
|
@@ -237,7 +227,7 @@ export default class BelongsToReference<
|
|
|
237
227
|
```
|
|
238
228
|
|
|
239
229
|
@public
|
|
240
|
-
@return
|
|
230
|
+
@return The name of the remote type. This should either be `link` or `id`
|
|
241
231
|
*/
|
|
242
232
|
remoteType(): "link" | "id";
|
|
243
233
|
/**
|
|
@@ -328,9 +318,9 @@ export default class BelongsToReference<
|
|
|
328
318
|
forcing the load of all of the associated record.
|
|
329
319
|
|
|
330
320
|
@public
|
|
331
|
-
@param
|
|
332
|
-
@param
|
|
333
|
-
@return
|
|
321
|
+
@param doc a JSONAPI document object describing the new value of this relationship.
|
|
322
|
+
@param skipFetch [optional] if `true`, do not attempt to fetch unloaded records
|
|
323
|
+
@return a promise that resolves with the record in this belongs-to relationship after the push has completed.
|
|
334
324
|
*/
|
|
335
325
|
push(doc: SingleResourceDocument, skipFetch?: boolean): Promise<Related | null | void>;
|
|
336
326
|
/**
|
|
@@ -380,7 +370,7 @@ export default class BelongsToReference<
|
|
|
380
370
|
```
|
|
381
371
|
|
|
382
372
|
@public
|
|
383
|
-
@return
|
|
373
|
+
@return the record in this relationship
|
|
384
374
|
*/
|
|
385
375
|
value(): Related | null;
|
|
386
376
|
/**
|
|
@@ -441,13 +431,13 @@ export default class BelongsToReference<
|
|
|
441
431
|
```
|
|
442
432
|
|
|
443
433
|
@public
|
|
444
|
-
@param
|
|
445
|
-
@return
|
|
434
|
+
@param options the options to pass in.
|
|
435
|
+
@return a promise that resolves with the record in this belongs-to relationship.
|
|
446
436
|
*/
|
|
447
437
|
load(options?: Record<string, unknown>): Promise<Related | null>;
|
|
448
438
|
/**
|
|
449
439
|
Triggers a reload of the value in this relationship. If the
|
|
450
|
-
remoteType is `"link"`
|
|
440
|
+
remoteType is `"link"` WarpDrive will use the relationship link to
|
|
451
441
|
reload the relationship. Otherwise it will reload the record by its
|
|
452
442
|
id.
|
|
453
443
|
|
|
@@ -491,8 +481,8 @@ export default class BelongsToReference<
|
|
|
491
481
|
```
|
|
492
482
|
|
|
493
483
|
@public
|
|
494
|
-
@param
|
|
495
|
-
@return
|
|
484
|
+
@param options the options to pass in.
|
|
485
|
+
@return a promise that resolves with the record in this belongs-to relationship after the reload has completed.
|
|
496
486
|
*/
|
|
497
487
|
reload(options?: Record<string, unknown>): Promise<Related | null>;
|
|
498
488
|
}
|
|
@@ -119,7 +119,7 @@ export default class HasManyReference<
|
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
@public
|
|
122
|
-
@return
|
|
122
|
+
@return The name of the remote type. This should either be `link` or `ids`
|
|
123
123
|
*/
|
|
124
124
|
remoteType(): "link" | "ids";
|
|
125
125
|
/**
|
|
@@ -154,11 +154,11 @@ export default class HasManyReference<
|
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
@public
|
|
157
|
-
@return
|
|
157
|
+
@return The ids in this has-many relationship
|
|
158
158
|
*/
|
|
159
159
|
ids(): Array<string | null>;
|
|
160
160
|
/**
|
|
161
|
-
The link
|
|
161
|
+
The link WarpDrive will use to fetch or reload this belongs-to
|
|
162
162
|
relationship. By default it uses only the "related" resource linkage.
|
|
163
163
|
|
|
164
164
|
Example
|
|
@@ -192,7 +192,7 @@ export default class HasManyReference<
|
|
|
192
192
|
```
|
|
193
193
|
|
|
194
194
|
@public
|
|
195
|
-
@return
|
|
195
|
+
@return The link WarpDrive will use to fetch or reload this belongs-to relationship.
|
|
196
196
|
*/
|
|
197
197
|
link(): string | null;
|
|
198
198
|
/**
|
|
@@ -239,7 +239,7 @@ export default class HasManyReference<
|
|
|
239
239
|
```
|
|
240
240
|
|
|
241
241
|
@public
|
|
242
|
-
@return
|
|
242
|
+
@return The meta information for the belongs-to relationship.
|
|
243
243
|
*/
|
|
244
244
|
meta(): Meta | null;
|
|
245
245
|
/**
|
|
@@ -335,9 +335,8 @@ export default class HasManyReference<
|
|
|
335
335
|
forcing the load of all of the associated records.
|
|
336
336
|
|
|
337
337
|
@public
|
|
338
|
-
@param
|
|
339
|
-
@param
|
|
340
|
-
@return {Promise<ManyArray | void>}
|
|
338
|
+
@param doc a JSONAPI document object describing the new value of this relationship.
|
|
339
|
+
@param skipFetch [optional] if `true`, do not attempt to fetch unloaded records
|
|
341
340
|
*/
|
|
342
341
|
push(doc: ExistingResourceObject[] | CollectionResourceDocument, skipFetch?: boolean): Promise<ManyArray<Related> | void>;
|
|
343
342
|
_isLoaded(): boolean;
|
|
@@ -379,7 +378,6 @@ export default class HasManyReference<
|
|
|
379
378
|
```
|
|
380
379
|
|
|
381
380
|
@public
|
|
382
|
-
@return {ManyArray}
|
|
383
381
|
*/
|
|
384
382
|
value(): ManyArray<Related> | null;
|
|
385
383
|
/**
|
|
@@ -441,8 +439,8 @@ export default class HasManyReference<
|
|
|
441
439
|
```
|
|
442
440
|
|
|
443
441
|
@public
|
|
444
|
-
@param
|
|
445
|
-
@return
|
|
442
|
+
@param options the options to pass in.
|
|
443
|
+
@return a promise that resolves with the ManyArray in
|
|
446
444
|
this has-many relationship.
|
|
447
445
|
*/
|
|
448
446
|
load(options?: BaseFinderOptions): Promise<ManyArray<Related>>;
|
|
@@ -492,8 +490,8 @@ export default class HasManyReference<
|
|
|
492
490
|
```
|
|
493
491
|
|
|
494
492
|
@public
|
|
495
|
-
@param
|
|
496
|
-
@return
|
|
493
|
+
@param options the options to pass in.
|
|
494
|
+
@return a promise that resolves with the ManyArray in this has-many relationship.
|
|
497
495
|
*/
|
|
498
496
|
reload(options?: BaseFinderOptions): Promise<ManyArray<Related>>;
|
|
499
497
|
}
|
|
@@ -10,8 +10,9 @@ records when they are transferred in and out of an external source.
|
|
|
10
10
|
This process involves normalizing property names, transforming
|
|
11
11
|
attribute values and serializing relationships.
|
|
12
12
|
|
|
13
|
-
`JSONAPISerializer` supports the http://jsonapi.org/ spec
|
|
14
|
-
|
|
13
|
+
`JSONAPISerializer` supports the http://jsonapi.org/ spec, though
|
|
14
|
+
even compliant {json:api} servers may find writing an application
|
|
15
|
+
specific serializer better suited to their needs and more performant.
|
|
15
16
|
|
|
16
17
|
This serializer normalizes a JSON API payload that looks like:
|
|
17
18
|
|
|
@@ -80,7 +81,7 @@ export default class Club extends Model {
|
|
|
80
81
|
}
|
|
81
82
|
```
|
|
82
83
|
|
|
83
|
-
to the format that the
|
|
84
|
+
to the format that the JSONAPICache expects.
|
|
84
85
|
|
|
85
86
|
### Customizing meta
|
|
86
87
|
|
|
@@ -39,8 +39,8 @@ house: '/houses/lefkada'
|
|
|
39
39
|
}
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
`JSONSerializer` will normalize the JSON payload to the
|
|
43
|
-
|
|
42
|
+
`JSONSerializer` will normalize the JSON payload to the {json:api} format that the
|
|
43
|
+
JSONAPICache uses to cache data in the Store.
|
|
44
44
|
|
|
45
45
|
You can customize how JSONSerializer processes its payload by passing options in
|
|
46
46
|
the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Context } from '@warp-drive/core/reactive/-private';
|
|
2
2
|
import { warn } from '@ember/debug';
|
|
3
3
|
import { createDeferred } from '@warp-drive/core/request';
|
|
4
|
-
import {
|
|
4
|
+
import { waitFor } from '@warp-drive/core/signals/-leaked';
|
|
5
|
+
import { assertPrivateStore, coerceId } from '@warp-drive/core/store/-private';
|
|
5
6
|
import { getOrSetGlobal } from '@warp-drive/core/types/-private';
|
|
6
7
|
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
7
8
|
|
package/dist/adapter/-private.js
CHANGED
|
@@ -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-DPZYoF-i.js";
|
package/dist/adapter/error.js
CHANGED
|
@@ -125,8 +125,8 @@ function extend(ParentErrorClass, defaultMessage) {
|
|
|
125
125
|
transition to the `invalid` state and the errors will be set to the
|
|
126
126
|
`errors` property on the record.
|
|
127
127
|
|
|
128
|
-
For
|
|
129
|
-
properties on the model,
|
|
128
|
+
For WarpDrive to correctly map errors to their corresponding
|
|
129
|
+
properties on the model, WarpDrive expects each error to be
|
|
130
130
|
a valid JSON-API error object with a `source/pointer` that matches
|
|
131
131
|
the property name. For example, if you had a Post model that
|
|
132
132
|
looked like this.
|
package/dist/adapter/json-api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
4
|
+
import { b as serializeIntoHash } from "../serialize-into-hash-DPZYoF-i.js";
|
|
5
5
|
import { RESTAdapter } from './rest.js';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|