@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.
- package/README.md +14 -27
- package/declarations/adapter/error.d.ts +7 -7
- package/declarations/adapter/json-api.d.ts +2 -2
- package/declarations/adapter/rest.d.ts +21 -104
- package/declarations/adapter.d.ts +2 -2
- package/declarations/compat/builders/find-all.d.ts +6 -6
- package/declarations/compat/builders/find-record.d.ts +8 -8
- package/declarations/compat/builders/query.d.ts +12 -12
- package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +16 -24
- package/declarations/compat/utils.d.ts +13 -13
- package/declarations/compat.d.ts +31 -5
- package/declarations/index.d.ts +25 -8
- package/declarations/model/-private/legacy-relationships-support.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 +18 -28
- package/declarations/model/-private/references/has-many.d.ts +13 -15
- package/declarations/model/migration-support.d.ts +42 -19
- package/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
- package/declarations/model-fragments/extensions/fragment.d.ts +15 -0
- package/declarations/model-fragments/hooks/model-for.d.ts +20 -0
- package/declarations/model-fragments/index.d.ts +5 -0
- package/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
- package/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
- package/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
- package/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
- package/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
- package/declarations/model-fragments.d.ts +9 -0
- package/declarations/model.d.ts +2 -2
- package/declarations/serializer/-private/embedded-records-mixin.d.ts +1 -1
- package/declarations/serializer/json-api.d.ts +7 -6
- package/declarations/serializer/json.d.ts +3 -3
- package/declarations/serializer.d.ts +5 -6
- package/dist/{-private-B1pSSN52.js → -private-BG3bMiKp.js} +2 -1
- package/dist/adapter/-private.js +1 -1
- package/dist/adapter/error.js +9 -9
- 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/builders.js +26 -26
- package/dist/compat/utils.js +13 -14
- package/dist/compat.js +28 -8
- package/dist/{errors-COviC59J.js → errors-Cz5KrzBk.js} +113 -120
- package/dist/{hooks-Bp8SIQBU.js → hooks-D6diaM34.js} +1 -1
- package/dist/index.js +25 -8
- package/dist/{json-ksWOHRfq.js → json-ChdEfB0X.js} +12 -27
- package/dist/model/-private.js +1 -1
- package/dist/model/migration-support.js +55 -25
- package/dist/model-for-CqXsIKws.js +221 -0
- package/dist/model-fragments.js +76 -0
- package/dist/model.js +3 -3
- package/dist/{schema-provider-JlCneqZH.js → schema-provider-DJCV_6AF.js} +44 -87
- package/dist/{serialize-into-hash-BnYvPex3.js → serialize-into-hash-DPZYoF-i.js} +1 -1
- package/dist/serializer/json-api.js +18 -45
- package/dist/serializer/json.js +1 -1
- package/dist/serializer/rest.js +10 -10
- package/dist/serializer.js +5 -6
- package/dist/store.js +2 -1
- package/dist/unpkg/dev/-private-DtjBbEgy.js +1206 -0
- package/dist/unpkg/dev/adapter/-private.js +1 -0
- package/dist/unpkg/dev/adapter/error.js +335 -0
- package/dist/unpkg/dev/adapter/json-api.js +271 -0
- package/dist/unpkg/dev/adapter/rest.js +1171 -0
- package/dist/unpkg/dev/adapter.js +1252 -0
- package/dist/unpkg/dev/compat/-private.js +1 -0
- package/dist/unpkg/dev/compat/builders.js +275 -0
- package/dist/unpkg/dev/compat/extensions.js +242 -0
- package/dist/unpkg/dev/compat/utils.js +223 -0
- package/dist/unpkg/dev/compat.js +1147 -0
- package/dist/unpkg/dev/errors-DmGGJr3T.js +2562 -0
- package/dist/unpkg/dev/hooks-CkYiE6Ud.js +73 -0
- package/dist/unpkg/dev/index.js +197 -0
- package/dist/unpkg/dev/json-Cu1LNgmQ.js +1256 -0
- package/dist/unpkg/dev/model/-private.js +1 -0
- package/dist/unpkg/dev/model/migration-support.js +553 -0
- package/dist/unpkg/dev/model-for-CqXsIKws.js +221 -0
- package/dist/unpkg/dev/model-fragments.js +76 -0
- package/dist/unpkg/dev/model.js +678 -0
- package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
- package/dist/unpkg/dev/schema-provider-DDVYxmUV.js +2186 -0
- package/dist/unpkg/dev/serialize-into-hash-B2xDbuo5.js +259 -0
- package/dist/unpkg/dev/serializer/json-api.js +649 -0
- package/dist/unpkg/dev/serializer/json.js +4 -0
- package/dist/unpkg/dev/serializer/rest.js +1242 -0
- package/dist/unpkg/dev/serializer/transform.js +278 -0
- package/dist/unpkg/dev/serializer.js +248 -0
- package/dist/unpkg/dev/store.js +637 -0
- package/dist/unpkg/dev/util-DvanW33H.js +20 -0
- package/dist/unpkg/dev/utils-BhvS1iTS.js +8 -0
- package/dist/unpkg/dev-deprecated/-private-DtjBbEgy.js +1206 -0
- package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -0
- package/dist/unpkg/dev-deprecated/adapter/error.js +335 -0
- package/dist/unpkg/dev-deprecated/adapter/json-api.js +271 -0
- package/dist/unpkg/dev-deprecated/adapter/rest.js +1171 -0
- package/dist/unpkg/dev-deprecated/adapter.js +1252 -0
- package/dist/unpkg/dev-deprecated/compat/-private.js +1 -0
- package/dist/unpkg/dev-deprecated/compat/builders.js +275 -0
- package/dist/unpkg/dev-deprecated/compat/extensions.js +242 -0
- package/dist/unpkg/dev-deprecated/compat/utils.js +223 -0
- package/dist/unpkg/dev-deprecated/compat.js +1147 -0
- package/dist/unpkg/dev-deprecated/errors-Spt6ubMd.js +2565 -0
- package/dist/unpkg/dev-deprecated/hooks-DOXegvhL.js +73 -0
- package/dist/unpkg/dev-deprecated/index.js +196 -0
- package/dist/unpkg/dev-deprecated/json-Cu1LNgmQ.js +1256 -0
- package/dist/unpkg/dev-deprecated/model/-private.js +1 -0
- package/dist/unpkg/dev-deprecated/model/migration-support.js +570 -0
- package/dist/unpkg/dev-deprecated/model-for-CqXsIKws.js +221 -0
- package/dist/unpkg/dev-deprecated/model-fragments.js +76 -0
- package/dist/unpkg/dev-deprecated/model.js +682 -0
- package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
- package/dist/unpkg/dev-deprecated/schema-provider-BP6_8N-V.js +2211 -0
- package/dist/unpkg/dev-deprecated/serialize-into-hash-B2xDbuo5.js +259 -0
- package/dist/unpkg/dev-deprecated/serializer/json-api.js +649 -0
- package/dist/unpkg/dev-deprecated/serializer/json.js +4 -0
- package/dist/unpkg/dev-deprecated/serializer/rest.js +1242 -0
- package/dist/unpkg/dev-deprecated/serializer/transform.js +278 -0
- package/dist/unpkg/dev-deprecated/serializer.js +248 -0
- package/dist/unpkg/dev-deprecated/store.js +637 -0
- package/dist/unpkg/dev-deprecated/util-CWr5WQOT.js +24 -0
- package/dist/unpkg/dev-deprecated/utils-C9PJehtL.js +12 -0
- package/dist/unpkg/prod/-private-BdyZaGEh.js +971 -0
- package/dist/unpkg/prod/adapter/-private.js +1 -0
- package/dist/unpkg/prod/adapter/error.js +330 -0
- package/dist/unpkg/prod/adapter/json-api.js +266 -0
- package/dist/unpkg/prod/adapter/rest.js +1134 -0
- package/dist/unpkg/prod/adapter.js +1219 -0
- package/dist/unpkg/prod/compat/-private.js +1 -0
- package/dist/unpkg/prod/compat/builders.js +210 -0
- package/dist/unpkg/prod/compat/extensions.js +232 -0
- package/dist/unpkg/prod/compat/utils.js +218 -0
- package/dist/unpkg/prod/compat.js +727 -0
- package/dist/unpkg/prod/errors-BGVFCBmi.js +2314 -0
- package/dist/unpkg/prod/hooks-BztVA_x0.js +41 -0
- package/dist/unpkg/prod/index.js +151 -0
- package/dist/unpkg/prod/json-BWrZ5546.js +1243 -0
- package/dist/unpkg/prod/model/-private.js +1 -0
- package/dist/unpkg/prod/model/migration-support.js +546 -0
- package/dist/unpkg/prod/model-for-CqXsIKws.js +221 -0
- package/dist/unpkg/prod/model-fragments.js +76 -0
- package/dist/unpkg/prod/model.js +593 -0
- package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
- package/dist/unpkg/prod/schema-provider-DJtD_8jZ.js +1861 -0
- package/dist/unpkg/prod/serialize-into-hash-DGlzQteF.js +215 -0
- package/dist/unpkg/prod/serializer/json-api.js +592 -0
- package/dist/unpkg/prod/serializer/json.js +4 -0
- package/dist/unpkg/prod/serializer/rest.js +1210 -0
- package/dist/unpkg/prod/serializer/transform.js +278 -0
- package/dist/unpkg/prod/serializer.js +248 -0
- package/dist/unpkg/prod/store.js +505 -0
- package/dist/unpkg/prod/util-DvanW33H.js +20 -0
- package/dist/unpkg/prod/utils-BhvS1iTS.js +8 -0
- package/dist/unpkg/prod-deprecated/-private-BdyZaGEh.js +971 -0
- package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -0
- package/dist/unpkg/prod-deprecated/adapter/error.js +330 -0
- package/dist/unpkg/prod-deprecated/adapter/json-api.js +266 -0
- package/dist/unpkg/prod-deprecated/adapter/rest.js +1134 -0
- package/dist/unpkg/prod-deprecated/adapter.js +1219 -0
- package/dist/unpkg/prod-deprecated/compat/-private.js +1 -0
- package/dist/unpkg/prod-deprecated/compat/builders.js +210 -0
- package/dist/unpkg/prod-deprecated/compat/extensions.js +232 -0
- package/dist/unpkg/prod-deprecated/compat/utils.js +218 -0
- package/dist/unpkg/prod-deprecated/compat.js +727 -0
- package/dist/unpkg/prod-deprecated/errors-CdDaK81x.js +2317 -0
- package/dist/unpkg/prod-deprecated/hooks-yId87yyG.js +41 -0
- package/dist/unpkg/prod-deprecated/index.js +150 -0
- package/dist/unpkg/prod-deprecated/json-BWrZ5546.js +1243 -0
- package/dist/unpkg/prod-deprecated/model/-private.js +1 -0
- package/dist/unpkg/prod-deprecated/model/migration-support.js +563 -0
- package/dist/unpkg/prod-deprecated/model-for-CqXsIKws.js +221 -0
- package/dist/unpkg/prod-deprecated/model-fragments.js +76 -0
- package/dist/unpkg/prod-deprecated/model.js +596 -0
- package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
- package/dist/unpkg/prod-deprecated/schema-provider-CjX55uSY.js +1904 -0
- package/dist/unpkg/prod-deprecated/serialize-into-hash-DGlzQteF.js +215 -0
- package/dist/unpkg/prod-deprecated/serializer/json-api.js +592 -0
- package/dist/unpkg/prod-deprecated/serializer/json.js +4 -0
- package/dist/unpkg/prod-deprecated/serializer/rest.js +1210 -0
- package/dist/unpkg/prod-deprecated/serializer/transform.js +278 -0
- package/dist/unpkg/prod-deprecated/serializer.js +248 -0
- package/dist/unpkg/prod-deprecated/store.js +505 -0
- package/dist/unpkg/prod-deprecated/util-B6cn-i93.js +23 -0
- package/dist/unpkg/prod-deprecated/utils-BUWwQwCh.js +11 -0
- package/logos/README.md +2 -2
- package/logos/logo-yellow-slab.svg +1 -0
- package/logos/word-mark-black.svg +1 -0
- package/logos/word-mark-white.svg +1 -0
- package/package.json +14 -6
- package/logos/NCC-1701-a-blue.svg +0 -4
- package/logos/NCC-1701-a-gold.svg +0 -4
- package/logos/NCC-1701-a-gold_100.svg +0 -1
- package/logos/NCC-1701-a-gold_base-64.txt +0 -1
- package/logos/NCC-1701-a.svg +0 -4
- package/logos/docs-badge.svg +0 -2
- package/logos/ember-data-logo-dark.svg +0 -12
- package/logos/ember-data-logo-light.svg +0 -12
- package/logos/social1.png +0 -0
- package/logos/social2.png +0 -0
- package/logos/warp-drive-logo-dark.svg +0 -4
- package/logos/warp-drive-logo-gold.svg +0 -4
|
@@ -21,7 +21,6 @@ application might expect these methods to be called.
|
|
|
21
21
|
|
|
22
22
|
Methods that are not required are marked as **optional**.
|
|
23
23
|
|
|
24
|
-
@class (Interface) Serializer
|
|
25
24
|
@public
|
|
26
25
|
*/
|
|
27
26
|
export interface MinimumSerializerInterface {
|
|
@@ -41,23 +40,22 @@ export interface MinimumSerializerInterface {
|
|
|
41
40
|
* and [Resource Identifier Objects](https://jsonapi.org/format/#document-resource-identifier-objects)
|
|
42
41
|
*
|
|
43
42
|
* @public
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
43
|
+
* @param store The store service that initiated the request being normalized
|
|
44
|
+
* @param schema An object with methods for accessing information about
|
|
46
45
|
* the type, attributes and relationships of the primary type associated with the request.
|
|
47
|
-
* @param
|
|
46
|
+
* @param rawPayload The raw JSON response data returned from an API request.
|
|
48
47
|
* This correlates to the value the promise returned by the adapter method that performed
|
|
49
48
|
* the request resolved to.
|
|
50
|
-
* @param
|
|
49
|
+
* @param id For a findRecord request, this is the id initially provided
|
|
51
50
|
* in the call to store.findRecord. Else this value is null.
|
|
52
|
-
* @param
|
|
53
|
-
* type of request the Adapter had been asked to perform.
|
|
51
|
+
* @param requestType The type of request the Adapter had been asked to perform.
|
|
54
52
|
*
|
|
55
|
-
* @return
|
|
53
|
+
* @return a document following the structure of a [{json:api} Document](https://jsonapi.org/format/#document-structure).
|
|
56
54
|
*/
|
|
57
55
|
normalizeResponse(store: Store, schema: ModelSchema, rawPayload: AdapterPayload, id: string | null, requestType: "findRecord" | "queryRecord" | "findAll" | "findBelongsTo" | "findHasMany" | "findMany" | "query" | "createRecord" | "deleteRecord" | "updateRecord"): JsonApiDocument;
|
|
58
56
|
/**
|
|
59
57
|
* This method is responsible for serializing an individual record
|
|
60
|
-
* via a
|
|
58
|
+
* via a {@link Snapshot} into the format expected by the API.
|
|
61
59
|
*
|
|
62
60
|
* This method is called by `snapshot.serialize()`.
|
|
63
61
|
*
|
|
@@ -68,8 +66,7 @@ export interface MinimumSerializerInterface {
|
|
|
68
66
|
* is not implemented.
|
|
69
67
|
*
|
|
70
68
|
* @public
|
|
71
|
-
* @param
|
|
72
|
-
* @param {Object} [options]
|
|
69
|
+
* @param snapshot A Snapshot for the record to serialize
|
|
73
70
|
*/
|
|
74
71
|
serialize(snapshot: Snapshot, options?: SerializerOptions): ObjectValue;
|
|
75
72
|
/**
|
|
@@ -116,14 +113,12 @@ export interface MinimumSerializerInterface {
|
|
|
116
113
|
*
|
|
117
114
|
* @public
|
|
118
115
|
* @optional
|
|
119
|
-
* @param
|
|
116
|
+
* @param schema An object with methods for accessing information about
|
|
120
117
|
* the type, attributes and relationships of the primary type associated with the request.
|
|
121
|
-
* @param
|
|
122
|
-
* @param
|
|
118
|
+
* @param rawPayload Some raw JSON data to be normalized into a JSON:API Resource.
|
|
119
|
+
* @param prop When called by the EmbeddedRecordsMixin this param will be the
|
|
123
120
|
* property at which the object provided as rawPayload was found.
|
|
124
|
-
* @return
|
|
125
|
-
* containing a single JSON:API Resource
|
|
126
|
-
* as its primary data.
|
|
121
|
+
* @return A JSON:API Document containing a single JSON:API Resource as its primary data.
|
|
127
122
|
*/
|
|
128
123
|
normalize?(schema: ModelSchema, rawPayload: ObjectValue, prop?: string): SingleResourceDocument;
|
|
129
124
|
/**
|
|
@@ -159,11 +154,9 @@ export interface MinimumSerializerInterface {
|
|
|
159
154
|
* @optional
|
|
160
155
|
* @param hash A top most object of the request payload onto
|
|
161
156
|
* which to append the serialized record
|
|
162
|
-
* @param
|
|
157
|
+
* @param schema An object with methods for accessing information about
|
|
163
158
|
* the type, attributes and relationships of the primary type associated with the request.
|
|
164
|
-
* @param
|
|
165
|
-
* @param [options]
|
|
166
|
-
* @return {void}
|
|
159
|
+
* @param snapshot A Snapshot for the record to serialize
|
|
167
160
|
*/
|
|
168
161
|
serializeIntoHash?(hash: object, schema: ModelSchema, snapshot: Snapshot, options?: SerializerOptions): void;
|
|
169
162
|
/**
|
|
@@ -202,10 +195,9 @@ export interface MinimumSerializerInterface {
|
|
|
202
195
|
*
|
|
203
196
|
* @public
|
|
204
197
|
* @optional
|
|
205
|
-
* @param
|
|
206
|
-
* @param
|
|
198
|
+
* @param store The store service that initiated the request being normalized
|
|
199
|
+
* @param rawPayload The raw JSON response data returned from an API request.
|
|
207
200
|
* This JSON should be in the API format expected by the serializer.
|
|
208
|
-
* @return {void}
|
|
209
201
|
*/
|
|
210
202
|
pushPayload?(store: Store, rawPayload: ObjectValue): void;
|
|
211
203
|
/**
|
|
@@ -4,7 +4,7 @@ type Reporter = (type: "formatted-id" | "formatted-type", actual: unknown, expec
|
|
|
4
4
|
* changes during normalization. This is useful for instrumenting
|
|
5
5
|
* to discover places where usage in the app is not consistent.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
7
|
+
* @param fn - a function which takes a mismatch-type ('formatted-id' | 'formatted-type'), actual, and expected value
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
10
|
export declare function configureMismatchReporter(fn: Reporter): void;
|
|
@@ -13,7 +13,7 @@ export declare function configureMismatchReporter(fn: Reporter): void;
|
|
|
13
13
|
* fails validation. This is useful for instrumenting
|
|
14
14
|
* to discover places where usage in the app is not consistent.
|
|
15
15
|
*
|
|
16
|
-
* @param
|
|
16
|
+
* @param fn - a function which takes a message and a condition
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
19
|
export declare function configureAssertFn(fn: (message: string, condition: unknown) => void): void;
|
|
@@ -27,7 +27,7 @@ export declare function configureAssertFn(fn: (message: string, condition: unkno
|
|
|
27
27
|
* the configured mismatch reporter and assert functions will
|
|
28
28
|
* be called.
|
|
29
29
|
*
|
|
30
|
-
* @param
|
|
30
|
+
* @param fn - a function which takes a string and returns a string
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
33
|
export declare function configureTypeNormalization(fn: (type: string) => string): void;
|
|
@@ -56,8 +56,8 @@ export declare function configureTypeNormalization(fn: (type: string) => string)
|
|
|
56
56
|
* formattedType('PostComment'); // => 'post-comment'
|
|
57
57
|
* ```
|
|
58
58
|
*
|
|
59
|
-
* @param
|
|
60
|
-
* @return
|
|
59
|
+
* @param type the potentially un-normalized type
|
|
60
|
+
* @return the normalized type
|
|
61
61
|
* @public
|
|
62
62
|
*/
|
|
63
63
|
export declare function formattedType<T extends string>(type: T | string): T;
|
|
@@ -77,8 +77,8 @@ export declare function formattedType<T extends string>(type: T | string): T;
|
|
|
77
77
|
* formattedId(null); // => null
|
|
78
78
|
* ```
|
|
79
79
|
*
|
|
80
|
-
* @param
|
|
81
|
-
* @return
|
|
80
|
+
* @param id the potentially un-normalized id
|
|
81
|
+
* @return the normalized id
|
|
82
82
|
* @public
|
|
83
83
|
*/
|
|
84
84
|
export declare function formattedId(id: string | number): string;
|
|
@@ -106,9 +106,9 @@ export declare function expectId(id: null): never;
|
|
|
106
106
|
* isEquivType('posts', null); // false
|
|
107
107
|
* ```
|
|
108
108
|
*
|
|
109
|
-
* @param
|
|
110
|
-
* @param
|
|
111
|
-
* @return
|
|
109
|
+
* @param expected a potentially unnormalized type to match against
|
|
110
|
+
* @param actual a potentially unnormalized type to match against
|
|
111
|
+
* @return true if the types are equivalent
|
|
112
112
|
* @public
|
|
113
113
|
*/
|
|
114
114
|
export declare function isEquivType(expected: string, actual: string): boolean;
|
|
@@ -128,9 +128,9 @@ export declare function isEquivType(expected: string, actual: string): boolean;
|
|
|
128
128
|
* isEquivId(1, null); // false
|
|
129
129
|
* ```
|
|
130
130
|
*
|
|
131
|
-
* @param
|
|
132
|
-
* @param
|
|
133
|
-
* @return
|
|
131
|
+
* @param expected a potentially un-normalized id to match against
|
|
132
|
+
* @param actual a potentially un-normalized id to match against
|
|
133
|
+
* @return true if the ids are equivalent
|
|
134
134
|
* @public
|
|
135
135
|
*/
|
|
136
136
|
export declare function isEquivId(expected: string | number, actual: string | number | null): boolean;
|
package/declarations/compat.d.ts
CHANGED
|
@@ -6,7 +6,18 @@ import type { AdapterPayload, MinimumAdapterInterface } from "./compat/legacy-ne
|
|
|
6
6
|
import type { MinimumSerializerInterface, SerializerOptions } from "./compat/legacy-network-handler/minimum-serializer-interface.js";
|
|
7
7
|
export { LegacyNetworkHandler } from "./compat/legacy-network-handler/legacy-network-handler.js";
|
|
8
8
|
export type { MinimumAdapterInterface, MinimumSerializerInterface, SerializerOptions, AdapterPayload };
|
|
9
|
+
/**
|
|
10
|
+
* Extends the signature of {@link Store} with additional
|
|
11
|
+
* methods available when using the legacy network layer.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
* @noInheritDoc
|
|
15
|
+
* @legacy
|
|
16
|
+
*/
|
|
9
17
|
export interface LegacyStoreCompat extends Store {
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
10
21
|
_fetchManager: FetchManager;
|
|
11
22
|
adapterFor(this: Store, modelName: string): MinimumAdapterInterface;
|
|
12
23
|
adapterFor(this: Store, modelName: string, _allowMissing: true): MinimumAdapterInterface | undefined;
|
|
@@ -14,13 +25,22 @@ export interface LegacyStoreCompat extends Store {
|
|
|
14
25
|
normalize(modelName: string, payload: ObjectValue): ObjectValue;
|
|
15
26
|
pushPayload(modelName: string, payload: ObjectValue): void;
|
|
16
27
|
serializeRecord(record: unknown, options?: SerializerOptions): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
17
31
|
_adapterCache: Record<string, MinimumAdapterInterface & {
|
|
18
32
|
store: Store;
|
|
19
33
|
}>;
|
|
34
|
+
/**
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
20
37
|
_serializerCache: Record<string, MinimumSerializerInterface & {
|
|
21
38
|
store: Store;
|
|
22
39
|
}>;
|
|
23
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated - use {@link LegacyStoreCompat} instead
|
|
43
|
+
*/
|
|
24
44
|
export type CompatStore = LegacyStoreCompat;
|
|
25
45
|
/**
|
|
26
46
|
Returns an instance of the adapter for a given type. For
|
|
@@ -53,8 +73,13 @@ to an instance of `JSONSerializer`.
|
|
|
53
73
|
*/
|
|
54
74
|
export declare function serializerFor(this: Store, modelName: string): MinimumSerializerInterface | null;
|
|
55
75
|
/**
|
|
56
|
-
`normalize` converts a json payload into the normalized form
|
|
57
|
-
|
|
76
|
+
`normalize` converts a json payload into the normalized form expected by
|
|
77
|
+
{@link Store.push | push} using the serializer specified by `modelName`
|
|
78
|
+
|
|
79
|
+
:::warning
|
|
80
|
+
Generally it would be better to invoke the serializer yourself directly,
|
|
81
|
+
or write a more specialized normalization utility.
|
|
82
|
+
:::
|
|
58
83
|
|
|
59
84
|
Example
|
|
60
85
|
|
|
@@ -66,6 +91,7 @@ store.push(store.normalize(modelName, data));
|
|
|
66
91
|
});
|
|
67
92
|
```
|
|
68
93
|
|
|
94
|
+
@legacy
|
|
69
95
|
@public
|
|
70
96
|
@param modelName The name of the model type for this payload
|
|
71
97
|
@return The normalized payload
|
|
@@ -81,7 +107,7 @@ All objects should be in the format expected by the
|
|
|
81
107
|
serializer.
|
|
82
108
|
|
|
83
109
|
```js [app/serializers/application.js]
|
|
84
|
-
import RESTSerializer from '@
|
|
110
|
+
import RESTSerializer from '@warp-drive/legacy/serializer/rest';
|
|
85
111
|
|
|
86
112
|
export default class ApplicationSerializer extends RESTSerializer;
|
|
87
113
|
```
|
|
@@ -106,13 +132,13 @@ Alternatively, `pushPayload` will accept a model type which
|
|
|
106
132
|
will determine which serializer will process the payload.
|
|
107
133
|
|
|
108
134
|
```js [app/serializers/application.js]
|
|
109
|
-
import RESTSerializer from '@
|
|
135
|
+
import RESTSerializer from '@warp-drive/legacy/serializer/rest';
|
|
110
136
|
|
|
111
137
|
export default class ApplicationSerializer extends RESTSerializer;
|
|
112
138
|
```
|
|
113
139
|
|
|
114
140
|
```js [app/serializers/post.js]
|
|
115
|
-
import JSONSerializer from '@
|
|
141
|
+
import JSONSerializer from '@warp-drive/legacy/serializer/json';
|
|
116
142
|
|
|
117
143
|
export default JSONSerializer;
|
|
118
144
|
```
|
package/declarations/index.d.ts
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
* @mergeModuleWith <project>
|
|
4
4
|
*/
|
|
5
5
|
import { Store, type StoreSetupOptions } from "@warp-drive/core";
|
|
6
|
+
import type { CacheCapabilitiesManager } from "@warp-drive/core/types";
|
|
7
|
+
import type { Cache } from "@warp-drive/core/types/cache";
|
|
6
8
|
import type { ObjectSchema, ResourceSchema } from "@warp-drive/core/types/schema/fields";
|
|
7
|
-
interface _LegacyStoreSetupOptions extends Omit<StoreSetupOptions
|
|
9
|
+
interface _LegacyStoreSetupOptions<T extends Cache> extends Omit<StoreSetupOptions<T>, "schemas"> {
|
|
8
10
|
schemas?: Array<ResourceSchema | ObjectSchema>;
|
|
11
|
+
/**
|
|
12
|
+
* Whether to include support for ModelFragments migrations.
|
|
13
|
+
*/
|
|
14
|
+
modelFragments?: boolean;
|
|
9
15
|
}
|
|
10
|
-
interface LegacyModelStoreSetupOptions extends _LegacyStoreSetupOptions {
|
|
16
|
+
export interface LegacyModelStoreSetupOptions<T extends Cache> extends _LegacyStoreSetupOptions<T> {
|
|
11
17
|
/**
|
|
12
18
|
* If true, it is presumed that no requests require use of the LegacyNetworkHandler
|
|
13
19
|
* and associated adapters/serializer methods.
|
|
@@ -19,7 +25,7 @@ interface LegacyModelStoreSetupOptions extends _LegacyStoreSetupOptions {
|
|
|
19
25
|
*/
|
|
20
26
|
legacyRequests?: false;
|
|
21
27
|
}
|
|
22
|
-
interface LegacyModelAndNetworkStoreSetupOptions extends _LegacyStoreSetupOptions {
|
|
28
|
+
export interface LegacyModelAndNetworkStoreSetupOptions<T extends Cache> extends _LegacyStoreSetupOptions<T> {
|
|
23
29
|
/**
|
|
24
30
|
* If true, it is presumed that no requests require use of the LegacyNetworkHandler
|
|
25
31
|
* and associated adapters/serializer methods.
|
|
@@ -31,7 +37,7 @@ interface LegacyModelAndNetworkStoreSetupOptions extends _LegacyStoreSetupOption
|
|
|
31
37
|
*/
|
|
32
38
|
legacyRequests?: false;
|
|
33
39
|
}
|
|
34
|
-
interface LegacyModelAndNetworkAndRequestStoreSetupOptions extends _LegacyStoreSetupOptions {
|
|
40
|
+
export interface LegacyModelAndNetworkAndRequestStoreSetupOptions<T extends Cache> extends _LegacyStoreSetupOptions<T> {
|
|
35
41
|
/**
|
|
36
42
|
* If true, it is presumed that no requests require use of the LegacyNetworkHandler
|
|
37
43
|
* and associated adapters/serializer methods.
|
|
@@ -43,11 +49,22 @@ interface LegacyModelAndNetworkAndRequestStoreSetupOptions extends _LegacyStoreS
|
|
|
43
49
|
*/
|
|
44
50
|
legacyRequests: true;
|
|
45
51
|
}
|
|
46
|
-
export type LegacyStoreSetupOptions = LegacyModelStoreSetupOptions | LegacyModelAndNetworkStoreSetupOptions | LegacyModelAndNetworkAndRequestStoreSetupOptions
|
|
52
|
+
export type LegacyStoreSetupOptions<T extends Cache = Cache> = LegacyModelStoreSetupOptions<T> | LegacyModelAndNetworkStoreSetupOptions<T> | LegacyModelAndNetworkAndRequestStoreSetupOptions<T>;
|
|
53
|
+
export declare class ConfiguredStore<T extends {
|
|
54
|
+
cache: Cache;
|
|
55
|
+
}> extends Store {
|
|
56
|
+
createCache(capabilities: CacheCapabilitiesManager): T["cache"];
|
|
57
|
+
}
|
|
47
58
|
/**
|
|
48
59
|
* Use the legacy store with the given options.
|
|
49
60
|
*/
|
|
50
|
-
export declare function useLegacyStore(options: LegacyModelStoreSetupOptions
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
export declare function useLegacyStore<T extends Cache>(options: LegacyModelStoreSetupOptions<T>, StoreKlass?: typeof Store): typeof ConfiguredStore<{
|
|
62
|
+
cache: T;
|
|
63
|
+
}>;
|
|
64
|
+
export declare function useLegacyStore<T extends Cache>(options: LegacyModelAndNetworkStoreSetupOptions<T>, StoreKlass?: typeof Store): typeof ConfiguredStore<{
|
|
65
|
+
cache: T;
|
|
66
|
+
}>;
|
|
67
|
+
export declare function useLegacyStore<T extends Cache>(options: LegacyModelAndNetworkAndRequestStoreSetupOptions<T>, StoreKlass?: typeof Store): typeof ConfiguredStore<{
|
|
68
|
+
cache: T;
|
|
69
|
+
}>;
|
|
53
70
|
export {};
|
|
@@ -38,8 +38,8 @@ export declare class LegacySupport {
|
|
|
38
38
|
_updatePromiseProxyFor(kind: "belongsTo", key: string, args: {
|
|
39
39
|
promise: Promise<OpaqueRecordInstance | null>;
|
|
40
40
|
}): PromiseBelongsTo;
|
|
41
|
-
referenceFor(kind: "belongsTo",
|
|
42
|
-
referenceFor(kind: "hasMany",
|
|
41
|
+
referenceFor(kind: "belongsTo", key: string): BelongsToReference;
|
|
42
|
+
referenceFor(kind: "hasMany", key: string): HasManyReference;
|
|
43
43
|
_findHasManyByJsonApiResource(resource: CollectionResourceRelationship, parentIdentifier: ResourceKey, relationship: CollectionEdge, options?: BaseFinderOptions): Promise<void | unknown[]> | void;
|
|
44
44
|
_findBelongsToByJsonApiResource(resource: SingleResourceRelationship, parentIdentifier: ResourceKey, relationship: ResourceEdge, options?: BaseFinderOptions): Promise<ResourceKey | null>;
|
|
45
45
|
destroy(): void;
|
|
@@ -428,9 +428,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
428
428
|
client. A record can also enter the empty state if the adapter is
|
|
429
429
|
unable to locate the record.
|
|
430
430
|
|
|
431
|
-
@property isEmpty
|
|
432
431
|
@public
|
|
433
|
-
@readonly
|
|
434
432
|
*/
|
|
435
433
|
get isEmpty(): boolean;
|
|
436
434
|
/**
|
|
@@ -439,9 +437,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
439
437
|
data. It remains in this state until the adapter provides the
|
|
440
438
|
requested data.
|
|
441
439
|
|
|
442
|
-
@property isLoading
|
|
443
440
|
@public
|
|
444
|
-
@readonly
|
|
445
441
|
*/
|
|
446
442
|
get isLoading(): boolean;
|
|
447
443
|
/**
|
|
@@ -460,9 +456,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
460
456
|
model.isLoaded;
|
|
461
457
|
```
|
|
462
458
|
|
|
463
|
-
@property isLoaded
|
|
464
459
|
@public
|
|
465
|
-
@readonly
|
|
466
460
|
*/
|
|
467
461
|
get isLoaded(): boolean;
|
|
468
462
|
/**
|
|
@@ -485,9 +479,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
485
479
|
```
|
|
486
480
|
|
|
487
481
|
@since 1.13.0
|
|
488
|
-
@property hasDirtyAttributes
|
|
489
482
|
@public
|
|
490
|
-
@readonly
|
|
491
483
|
*/
|
|
492
484
|
get hasDirtyAttributes(): boolean;
|
|
493
485
|
/**
|
|
@@ -508,9 +500,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
508
500
|
});
|
|
509
501
|
```
|
|
510
502
|
|
|
511
|
-
@property isSaving
|
|
512
503
|
@public
|
|
513
|
-
@readonly
|
|
514
504
|
*/
|
|
515
505
|
get isSaving(): boolean;
|
|
516
506
|
/**
|
|
@@ -546,9 +536,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
546
536
|
});
|
|
547
537
|
```
|
|
548
538
|
|
|
549
|
-
@property isDeleted
|
|
550
539
|
@public
|
|
551
|
-
@readonly
|
|
552
540
|
*/
|
|
553
541
|
get isDeleted(): boolean;
|
|
554
542
|
/**
|
|
@@ -568,9 +556,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
568
556
|
});
|
|
569
557
|
```
|
|
570
558
|
|
|
571
|
-
@property isNew
|
|
572
559
|
@public
|
|
573
|
-
@readonly
|
|
574
560
|
*/
|
|
575
561
|
get isNew(): boolean;
|
|
576
562
|
/**
|
|
@@ -579,9 +565,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
579
565
|
A record will be in the `valid` state when the adapter did not report any
|
|
580
566
|
server-side validation failures.
|
|
581
567
|
|
|
582
|
-
@property isValid
|
|
583
568
|
@public
|
|
584
|
-
@readonly
|
|
585
569
|
*/
|
|
586
570
|
get isValid(): boolean;
|
|
587
571
|
/**
|
|
@@ -600,9 +584,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
600
584
|
record.dirtyType; // 'created'
|
|
601
585
|
```
|
|
602
586
|
|
|
603
|
-
@property dirtyType
|
|
604
587
|
@public
|
|
605
|
-
@readonly
|
|
606
588
|
*/
|
|
607
589
|
get dirtyType(): "created" | "updated" | "deleted" | "";
|
|
608
590
|
/**
|
|
@@ -620,9 +602,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
620
602
|
});
|
|
621
603
|
```
|
|
622
604
|
|
|
623
|
-
@property isError
|
|
624
605
|
@public
|
|
625
|
-
@readonly
|
|
626
606
|
*/
|
|
627
607
|
get isError(): boolean;
|
|
628
608
|
set isError(v: boolean);
|
|
@@ -637,9 +617,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
637
617
|
record.isReloading; // true
|
|
638
618
|
```
|
|
639
619
|
|
|
640
|
-
@property isReloading
|
|
641
620
|
@public
|
|
642
|
-
@readonly
|
|
643
621
|
*/
|
|
644
622
|
isReloading: boolean;
|
|
645
623
|
/**
|
|
@@ -657,14 +635,12 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
657
635
|
model.id; // '1'
|
|
658
636
|
```
|
|
659
637
|
|
|
660
|
-
@property id
|
|
661
638
|
@public
|
|
662
639
|
*/
|
|
663
640
|
get id(): string | null;
|
|
664
641
|
set id(id: string | null);
|
|
665
642
|
toString(): string;
|
|
666
643
|
/**
|
|
667
|
-
@property currentState
|
|
668
644
|
@private
|
|
669
645
|
*/
|
|
670
646
|
get currentState(): RecordState;
|
|
@@ -672,9 +648,9 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
672
648
|
/**
|
|
673
649
|
The store service instance which created this record instance
|
|
674
650
|
|
|
675
|
-
@property store
|
|
676
651
|
@public
|
|
677
652
|
*/
|
|
653
|
+
store: Store;
|
|
678
654
|
/**
|
|
679
655
|
When the record is in the `invalid` state this object will contain
|
|
680
656
|
any errors returned by the adapter. When present the errors hash
|
|
@@ -723,7 +699,6 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
723
699
|
{{/each}}
|
|
724
700
|
```
|
|
725
701
|
|
|
726
|
-
@property errors
|
|
727
702
|
@public
|
|
728
703
|
*/
|
|
729
704
|
get errors(): Errors;
|
|
@@ -731,7 +706,6 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
731
706
|
This property holds the `AdapterError` object with which
|
|
732
707
|
last adapter operation was rejected.
|
|
733
708
|
|
|
734
|
-
@property adapterError
|
|
735
709
|
@public
|
|
736
710
|
*/
|
|
737
711
|
get adapterError(): unknown;
|
|
@@ -818,9 +792,8 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
818
792
|
}
|
|
819
793
|
});
|
|
820
794
|
```
|
|
821
|
-
|
|
795
|
+
|
|
822
796
|
@public
|
|
823
|
-
@readonly
|
|
824
797
|
*/
|
|
825
798
|
static modelName: string;
|
|
826
799
|
/**
|
|
@@ -912,9 +885,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
912
885
|
//=> [ { name: 'posts', kind: 'hasMany' } ]
|
|
913
886
|
```
|
|
914
887
|
|
|
915
|
-
@property relationships
|
|
916
888
|
@public
|
|
917
|
-
@readonly
|
|
918
889
|
*/
|
|
919
890
|
static get relationships(): Map<string, LegacyRelationshipField[]>;
|
|
920
891
|
/**
|
|
@@ -945,9 +916,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
945
916
|
//=> ['owner']
|
|
946
917
|
```
|
|
947
918
|
|
|
948
|
-
@property relationshipNames
|
|
949
919
|
@public
|
|
950
|
-
@readonly
|
|
951
920
|
*/
|
|
952
921
|
static get relationshipNames(): {
|
|
953
922
|
hasMany: string[];
|
|
@@ -980,9 +949,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
980
949
|
//=> ['user', 'post']
|
|
981
950
|
```
|
|
982
951
|
|
|
983
|
-
@property relatedTypes
|
|
984
952
|
@public
|
|
985
|
-
@readonly
|
|
986
953
|
*/
|
|
987
954
|
static get relatedTypes(): string[];
|
|
988
955
|
/**
|
|
@@ -1015,9 +982,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
1015
982
|
//=> { name: 'owner', kind: 'belongsTo', type: 'user', options: Object }
|
|
1016
983
|
```
|
|
1017
984
|
|
|
1018
|
-
@property relationshipsByName
|
|
1019
985
|
@public
|
|
1020
|
-
@readonly
|
|
1021
986
|
*/
|
|
1022
987
|
static get relationshipsByName(): Map<string, LegacyRelationshipField>;
|
|
1023
988
|
static get relationshipsObject(): Record<string, LegacyRelationshipField>;
|
|
@@ -1056,9 +1021,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
1056
1021
|
// title, attribute
|
|
1057
1022
|
```
|
|
1058
1023
|
|
|
1059
|
-
@property fields
|
|
1060
1024
|
@public
|
|
1061
|
-
@readonly
|
|
1062
1025
|
*/
|
|
1063
1026
|
static get fields(): Map<string, "attribute" | "belongsTo" | "hasMany">;
|
|
1064
1027
|
/**
|
|
@@ -1067,8 +1030,8 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
1067
1030
|
descriptor.
|
|
1068
1031
|
|
|
1069
1032
|
@public
|
|
1070
|
-
@param
|
|
1071
|
-
@param
|
|
1033
|
+
@param callback the callback to invoke
|
|
1034
|
+
@param binding the value to which the callback's `this` should be bound
|
|
1072
1035
|
*/
|
|
1073
1036
|
static eachRelationship<
|
|
1074
1037
|
T,
|
|
@@ -1081,8 +1044,8 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
1081
1044
|
with a model.
|
|
1082
1045
|
|
|
1083
1046
|
@public
|
|
1084
|
-
@param
|
|
1085
|
-
@param
|
|
1047
|
+
@param callback the callback to invoke
|
|
1048
|
+
@param binding the value to which the callback's `this` should be bound
|
|
1086
1049
|
*/
|
|
1087
1050
|
static eachRelatedType<T>(callback: (this: T | undefined, type: string) => void, binding?: T): void;
|
|
1088
1051
|
/**
|
|
@@ -1123,9 +1086,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
1123
1086
|
// birthday {type: "date", kind: 'attribute', options: Object, parentType: function, name: "birthday"}
|
|
1124
1087
|
```
|
|
1125
1088
|
|
|
1126
|
-
@property attributes
|
|
1127
1089
|
@public
|
|
1128
|
-
@readonly
|
|
1129
1090
|
*/
|
|
1130
1091
|
static get attributes(): Map<string, LegacyAttributeField>;
|
|
1131
1092
|
/**
|
|
@@ -1160,9 +1121,7 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
1160
1121
|
// birthday date
|
|
1161
1122
|
```
|
|
1162
1123
|
|
|
1163
|
-
@property transformedAttributes
|
|
1164
1124
|
@public
|
|
1165
|
-
@readonly
|
|
1166
1125
|
*/
|
|
1167
1126
|
static get transformedAttributes(): Map<string, string>;
|
|
1168
1127
|
/**
|
|
@@ -1204,8 +1163,8 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
1204
1163
|
```
|
|
1205
1164
|
|
|
1206
1165
|
@public
|
|
1207
|
-
@param
|
|
1208
|
-
@param
|
|
1166
|
+
@param callback The callback to execute
|
|
1167
|
+
@param binding [optional] the value to which the callback's `this` should be bound
|
|
1209
1168
|
*/
|
|
1210
1169
|
static eachAttribute<
|
|
1211
1170
|
T,
|
|
@@ -1251,8 +1210,8 @@ declare class Model extends EmberObject implements MinimalLegacyRecord {
|
|
|
1251
1210
|
```
|
|
1252
1211
|
|
|
1253
1212
|
@public
|
|
1254
|
-
@param
|
|
1255
|
-
@param
|
|
1213
|
+
@param callback The callback to execute
|
|
1214
|
+
@param binding [optional] the value to which the callback's `this` should be bound
|
|
1256
1215
|
*/
|
|
1257
1216
|
static eachTransformedAttribute<
|
|
1258
1217
|
T,
|
|
@@ -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;
|