@warp-drive/legacy 5.8.0-alpha.4 → 5.8.0-alpha.40
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 +5 -5
- package/declarations/adapter/json-api.d.ts +6 -8
- package/declarations/adapter/rest.d.ts +5 -8
- package/declarations/adapter.d.ts +4 -6
- package/declarations/compat/-private.d.ts +1 -1
- 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/extensions.d.ts +1 -1
- package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +7 -9
- package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +20 -30
- package/declarations/compat/utils.d.ts +17 -17
- package/declarations/compat.d.ts +35 -11
- package/declarations/index.d.ts +70 -0
- package/declarations/model/-private/attr.d.ts +5 -6
- package/declarations/model/-private/belongs-to.d.ts +4 -5
- package/declarations/model/-private/has-many.d.ts +4 -5
- package/declarations/model/-private/hooks.d.ts +1 -1
- package/declarations/model/-private/legacy-relationships-support.d.ts +2 -2
- package/declarations/model/-private/model.d.ts +8 -8
- package/declarations/model/-private/record-state.d.ts +1 -1
- package/declarations/model/-private/references/belongs-to.d.ts +5 -5
- package/declarations/model/-private/references/has-many.d.ts +3 -3
- package/declarations/model/migration-support.d.ts +46 -21
- 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 -6
- package/declarations/serializer/-private/transforms/boolean.d.ts +2 -2
- package/declarations/serializer/-private/transforms/date.d.ts +2 -2
- package/declarations/serializer/-private/transforms/number.d.ts +1 -1
- package/declarations/serializer/-private/transforms/string.d.ts +1 -1
- package/declarations/serializer/json-api.d.ts +7 -9
- package/declarations/serializer/json.d.ts +7 -9
- package/declarations/serializer/rest.d.ts +4 -6
- package/declarations/serializer.d.ts +9 -12
- package/dist/{-private-8UmnAf9J.js → -private-B1pSSN52.js} +1 -1
- package/dist/adapter/-private.js +1 -1
- package/dist/adapter/error.js +12 -13
- package/dist/adapter/json-api.js +4 -1
- package/dist/adapter/rest.js +6 -9
- package/dist/adapter.js +4 -6
- package/dist/compat/-private.js +1 -1
- package/dist/compat/builders.js +26 -26
- package/dist/compat/utils.js +17 -18
- package/dist/compat.js +58 -41
- package/dist/{errors-8kD2mSe_.js → errors-CIGPcDvd.js} +87 -65
- package/dist/hooks-QqRnX108.js +74 -0
- package/dist/index.js +195 -0
- package/dist/{json-DziiodPf.js → json-BNrV8EYG.js} +12 -16
- package/dist/model/-private.js +1 -1
- package/dist/model/migration-support.js +54 -24
- package/dist/model-for-CqXsIKws.js +221 -0
- package/dist/model-fragments.js +76 -0
- package/dist/model.js +18 -90
- package/dist/{schema-provider-DQu4Rjco.js → schema-provider-g5MfTj8n.js} +18 -20
- package/dist/{serialize-into-hash-CS0MIv4F.js → serialize-into-hash-BnYvPex3.js} +1 -1
- package/dist/serializer/json-api.js +17 -44
- package/dist/serializer/json.js +1 -1
- package/dist/serializer/rest.js +14 -21
- package/dist/serializer/transform.js +15 -6
- package/dist/serializer.js +9 -13
- package/dist/store.js +3 -0
- package/dist/unpkg/dev/-private-DbaSCSym.js +1205 -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 +1255 -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 +1146 -0
- package/dist/unpkg/dev/errors-DD96TBEs.js +2591 -0
- package/dist/unpkg/dev/hooks-CqWjNWeL.js +73 -0
- package/dist/unpkg/dev/index.js +197 -0
- package/dist/unpkg/dev/json-CCU-ZQ4b.js +1269 -0
- package/dist/unpkg/dev/model/-private.js +1 -0
- package/dist/unpkg/dev/model/migration-support.js +551 -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-B8jiJOYC.js +2229 -0
- package/dist/unpkg/dev/serialize-into-hash-CPAZXrQU.js +259 -0
- package/dist/unpkg/dev/serializer/json-api.js +648 -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 +636 -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-DbaSCSym.js +1205 -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 +1255 -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 +1146 -0
- package/dist/unpkg/dev-deprecated/errors-DEnabIZj.js +2594 -0
- package/dist/unpkg/dev-deprecated/hooks-CAll-Ets.js +73 -0
- package/dist/unpkg/dev-deprecated/index.js +196 -0
- package/dist/unpkg/dev-deprecated/json-CCU-ZQ4b.js +1269 -0
- package/dist/unpkg/dev-deprecated/model/-private.js +1 -0
- package/dist/unpkg/dev-deprecated/model/migration-support.js +568 -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-k2qXQTBg.js +2254 -0
- package/dist/unpkg/dev-deprecated/serialize-into-hash-CPAZXrQU.js +259 -0
- package/dist/unpkg/dev-deprecated/serializer/json-api.js +648 -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 +636 -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-Cvf_97EG.js +970 -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 +1218 -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 +726 -0
- package/dist/unpkg/prod/errors-CXnfnBfQ.js +2343 -0
- package/dist/unpkg/prod/hooks-DvyWhLNg.js +41 -0
- package/dist/unpkg/prod/index.js +151 -0
- package/dist/unpkg/prod/json-BYrUP8ao.js +1256 -0
- package/dist/unpkg/prod/model/-private.js +1 -0
- package/dist/unpkg/prod/model/migration-support.js +544 -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-CHujJvA9.js +1904 -0
- package/dist/unpkg/prod/serialize-into-hash-DYU2egXl.js +215 -0
- package/dist/unpkg/prod/serializer/json-api.js +591 -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 +504 -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-Cvf_97EG.js +970 -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 +1218 -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 +726 -0
- package/dist/unpkg/prod-deprecated/errors-CG1SPYVg.js +2346 -0
- package/dist/unpkg/prod-deprecated/hooks-BIUBiNGR.js +41 -0
- package/dist/unpkg/prod-deprecated/index.js +150 -0
- package/dist/unpkg/prod-deprecated/json-BYrUP8ao.js +1256 -0
- package/dist/unpkg/prod-deprecated/model/-private.js +1 -0
- package/dist/unpkg/prod-deprecated/model/migration-support.js +561 -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-BJ4TWnZf.js +1947 -0
- package/dist/unpkg/prod-deprecated/serialize-into-hash-DYU2egXl.js +215 -0
- package/dist/unpkg/prod-deprecated/serializer/json-api.js +591 -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 +504 -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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used as a helper to setup the relevant parts of an array
|
|
3
|
+
* schema and add extensions etc.
|
|
4
|
+
*
|
|
5
|
+
* @param arrayName The name of the array
|
|
6
|
+
* @returns The schema for an array
|
|
7
|
+
*/
|
|
8
|
+
export declare function withArrayDefaults<ArrayName extends string>(arrayName: ArrayName): {
|
|
9
|
+
kind: "array";
|
|
10
|
+
name: ArrayName;
|
|
11
|
+
type: `array:${string}`;
|
|
12
|
+
options: {
|
|
13
|
+
arrayExtensions: string[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used as a helper to setup the relevant parts of a fragment-array
|
|
3
|
+
* schema and add extensions etc.
|
|
4
|
+
*
|
|
5
|
+
* @param fragmentArrayType The type of the fragment-array
|
|
6
|
+
* @param fragmentArrayName The name of the fragment-array
|
|
7
|
+
* @returns The schema for a fragment-array
|
|
8
|
+
*/
|
|
9
|
+
export declare function withFragmentArrayDefaults<
|
|
10
|
+
FragmentArrayType extends string,
|
|
11
|
+
FragmentArrayName extends string
|
|
12
|
+
>(fragmentArrayType: FragmentArrayType, fragmentArrayName?: FragmentArrayName): {
|
|
13
|
+
kind: "schema-array";
|
|
14
|
+
type: `fragment:${string}`;
|
|
15
|
+
name: string;
|
|
16
|
+
options: {
|
|
17
|
+
arrayExtensions: string[];
|
|
18
|
+
defaultValue: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used as a helper to setup the relevant parts of a fragment schema
|
|
3
|
+
* and add extensions etc.
|
|
4
|
+
*
|
|
5
|
+
* @param fragmentType The type of the fragment
|
|
6
|
+
* @param fragmentName The optional name of the fragment. If not provided, it will default to the fragmentType.
|
|
7
|
+
* @returns The schema for a fragment
|
|
8
|
+
*/
|
|
9
|
+
export declare function withFragmentDefaults<
|
|
10
|
+
FragmentType extends string,
|
|
11
|
+
FragmentName extends string
|
|
12
|
+
>(fragmentType: FragmentType, fragmentName?: FragmentName): {
|
|
13
|
+
kind: "schema-object";
|
|
14
|
+
type: `fragment:${FragmentType}`;
|
|
15
|
+
name: FragmentType | FragmentName;
|
|
16
|
+
options: {
|
|
17
|
+
objectExtensions: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LegacyResourceSchema, ResourceSchema } from "@warp-drive/core/types/schema/fields";
|
|
2
|
+
import type { WithPartial } from "@warp-drive/core/types/utils";
|
|
3
|
+
export declare function withLegacy(schema: WithPartial<LegacyResourceSchema, "legacy" | "identity">): ResourceSchema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { withArrayDefaults } from "./model-fragments/utilities/with-array-defaults.js";
|
|
2
|
+
export { withFragmentDefaults } from "./model-fragments/utilities/with-fragment-defaults.js";
|
|
3
|
+
export { withFragmentArrayDefaults } from "./model-fragments/utilities/with-fragment-array-defaults.js";
|
|
4
|
+
export { withLegacy } from "./model-fragments/utilities/with-legacy.js";
|
|
5
|
+
export { registerFragmentExtensions } from "./model-fragments/instance-initializers/fragment-extensions.js";
|
|
6
|
+
export { modelFor } from "./model-fragments/hooks/model-for.js";
|
|
7
|
+
export { FragmentArray, FragmentArrayExtension } from "./model-fragments/extensions/fragment-array.js";
|
|
8
|
+
export { Fragment, FragmentExtension } from "./model-fragments/extensions/fragment.js";
|
|
9
|
+
export type { WithFragment, WithFragmentArray } from "./model-fragments/index.js";
|
package/declarations/model.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This package provides a Presentation Model for resource data in an WarpDrive Cache.
|
|
3
3
|
*
|
|
4
|
-
* Models are defined as classes extending from `import Model from '@
|
|
4
|
+
* Models are defined as classes extending from `import Model from '@warp-drive/legacy/model';` and the
|
|
5
5
|
* attributes and relationships on these classes are parsed at runtime to supply static "schema"
|
|
6
6
|
* to WarpDrive's SchemaService.
|
|
7
7
|
*
|
|
@@ -17,7 +17,7 @@ the resource data for a given `type` and `id`.
|
|
|
17
17
|
### Defining a Model
|
|
18
18
|
|
|
19
19
|
```js [app/models/person.js]
|
|
20
|
-
import Model, { attr, belongsTo, hasMany } from '@
|
|
20
|
+
import Model, { attr, belongsTo, hasMany } from '@warp-drive/legacy/model';
|
|
21
21
|
|
|
22
22
|
export default class PersonModel extends Model {
|
|
23
23
|
@attr name;
|
|
@@ -14,7 +14,7 @@ Note also that this mixin does not work with JSONAPISerializer because the JSON:
|
|
|
14
14
|
Below is an example of a per-type serializer (`post` type).
|
|
15
15
|
|
|
16
16
|
```js [app/serializers/post.js]
|
|
17
|
-
import RESTSerializer, { EmbeddedRecordsMixin } from '@
|
|
17
|
+
import RESTSerializer, { EmbeddedRecordsMixin } from '@warp-drive/legacy/serializer/rest';
|
|
18
18
|
|
|
19
19
|
export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {
|
|
20
20
|
attrs = {
|
|
@@ -85,11 +85,6 @@ instances must have an `id` property to be used with Ember Data.
|
|
|
85
85
|
are. Please read the docs for the methods this mixin provides, in case you need
|
|
86
86
|
to modify it to fit your specific needs.**
|
|
87
87
|
|
|
88
|
-
For example, review the docs for each method of this mixin:
|
|
89
|
-
* [normalize](/ember-data/release/classes/EmbeddedRecordsMixin/methods/normalize?anchor=normalize)
|
|
90
|
-
* [serializeBelongsTo](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeBelongsTo?anchor=serializeBelongsTo)
|
|
91
|
-
* [serializeHasMany](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeHasMany?anchor=serializeHasMany)
|
|
92
|
-
|
|
93
88
|
@class EmbeddedRecordsMixin
|
|
94
89
|
@public
|
|
95
90
|
*/
|
|
@@ -5,8 +5,8 @@ export interface BooleanTransform {
|
|
|
5
5
|
/**
|
|
6
6
|
The `BooleanTransform` class is used to serialize and deserialize
|
|
7
7
|
boolean attributes on Ember Data record objects. This transform is
|
|
8
|
-
used when `boolean` is passed as the type parameter to the
|
|
9
|
-
|
|
8
|
+
used when `'boolean'` is passed as the type parameter to the
|
|
9
|
+
{@link attr}function.
|
|
10
10
|
|
|
11
11
|
Usage
|
|
12
12
|
|
|
@@ -5,8 +5,8 @@ export interface DateTransform {
|
|
|
5
5
|
/**
|
|
6
6
|
The `DateTransform` class is used to serialize and deserialize
|
|
7
7
|
date attributes on Ember Data record objects. This transform is used
|
|
8
|
-
when `date` is passed as the type parameter to the
|
|
9
|
-
|
|
8
|
+
when `'date'` is passed as the type parameter to the
|
|
9
|
+
{@link attr} function. It uses the [`ISO 8601`](https://en.wikipedia.org/wiki/ISO_8601)
|
|
10
10
|
standard.
|
|
11
11
|
|
|
12
12
|
```js [app/models/score.js]
|
|
@@ -6,7 +6,7 @@ export interface NumberTransform {
|
|
|
6
6
|
The `NumberTransform` class is used to serialize and deserialize
|
|
7
7
|
numeric attributes on Ember Data record objects. This transform is
|
|
8
8
|
used when `number` is passed as the type parameter to the
|
|
9
|
-
|
|
9
|
+
{@link attr} function.
|
|
10
10
|
|
|
11
11
|
Usage
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ export interface StringTransform {
|
|
|
6
6
|
The `StringTransform` class is used to serialize and deserialize
|
|
7
7
|
string attributes on Ember Data record objects. This transform is
|
|
8
8
|
used when `string` is passed as the type parameter to the
|
|
9
|
-
|
|
9
|
+
{@link attr} function.
|
|
10
10
|
|
|
11
11
|
Usage
|
|
12
12
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
<p>
|
|
2
|
+
* :::danger
|
|
4
3
|
⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
|
|
5
4
|
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</blockquote>
|
|
5
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
6
|
+
:::
|
|
9
7
|
|
|
10
|
-
In
|
|
8
|
+
In WarpDrive a Serializer is used to serialize and deserialize
|
|
11
9
|
records when they are transferred in and out of an external source.
|
|
12
10
|
This process involves normalizing property names, transforming
|
|
13
11
|
attribute values and serializing relationships.
|
|
@@ -18,7 +16,7 @@ serializer recommended by Ember Data.
|
|
|
18
16
|
This serializer normalizes a JSON API payload that looks like:
|
|
19
17
|
|
|
20
18
|
```js [app/models/player.js]
|
|
21
|
-
import Model, { attr, belongsTo } from '@
|
|
19
|
+
import Model, { attr, belongsTo } from '@warp-drive/legacy/model';
|
|
22
20
|
|
|
23
21
|
export default class Player extends Model {
|
|
24
22
|
@attr('string') name;
|
|
@@ -29,7 +27,7 @@ export default class Player extends Model {
|
|
|
29
27
|
```
|
|
30
28
|
|
|
31
29
|
```js [app/models/club.js]
|
|
32
|
-
import Model, { attr, hasMany } from '@
|
|
30
|
+
import Model, { attr, hasMany } from '@warp-drive/legacy/model';
|
|
33
31
|
|
|
34
32
|
export default class Club extends Model {
|
|
35
33
|
@attr('string') name;
|
|
@@ -94,7 +92,7 @@ below shows how this could be done using `normalizeArrayResponse` and
|
|
|
94
92
|
`extractRelationship`.
|
|
95
93
|
|
|
96
94
|
```js [app/serializers/application.js]
|
|
97
|
-
import JSONAPISerializer from '@
|
|
95
|
+
import JSONAPISerializer from '@warp-drive/legacy/serializer/json-api';
|
|
98
96
|
|
|
99
97
|
export default class ApplicationSerializer extends JSONAPISerializer {
|
|
100
98
|
normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
|
|
2
|
+
* :::danger
|
|
3
|
+
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
5
4
|
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</blockquote>
|
|
5
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
6
|
+
:::
|
|
9
7
|
|
|
10
|
-
In
|
|
8
|
+
In WarpDrive a Serializer is used to serialize and deserialize
|
|
11
9
|
records when they are transferred in and out of an external source.
|
|
12
10
|
This process involves normalizing property names, transforming
|
|
13
11
|
attribute values and serializing relationships.
|
|
14
12
|
|
|
15
|
-
By default,
|
|
13
|
+
By default, WarpDrive uses and recommends the `JSONAPISerializer`.
|
|
16
14
|
|
|
17
15
|
`JSONSerializer` is useful for simpler or legacy backends that may
|
|
18
16
|
not support the http://jsonapi.org/ spec.
|
|
@@ -20,7 +18,7 @@ not support the http://jsonapi.org/ spec.
|
|
|
20
18
|
For example, given the following `User` model and JSON payload:
|
|
21
19
|
|
|
22
20
|
```js [app/models/user.js]
|
|
23
|
-
import Model, { attr, belongsTo, hasMany } from '@
|
|
21
|
+
import Model, { attr, belongsTo, hasMany } from '@warp-drive/legacy/model';
|
|
24
22
|
|
|
25
23
|
export default class UserModel extends Model {
|
|
26
24
|
@hasMany('user') friends;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
|
|
2
|
+
* :::danger
|
|
3
|
+
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
5
4
|
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</blockquote>
|
|
5
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
6
|
+
:::
|
|
9
7
|
|
|
10
8
|
Normally, applications will use the `RESTSerializer` by implementing
|
|
11
9
|
the `normalize` method.
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
## Overview
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
|
|
4
|
+
:::danger
|
|
5
|
+
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
7
6
|
If starting a new app or thinking of implementing a new serializer, consider writing a
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</blockquote>
|
|
7
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
8
|
+
:::
|
|
11
9
|
|
|
12
10
|
In order to properly manage and present your data, WarpDrive
|
|
13
11
|
needs to understand the structure of data it receives.
|
|
@@ -16,14 +14,14 @@ needs to understand the structure of data it receives.
|
|
|
16
14
|
the format WarpDrive understands.
|
|
17
15
|
|
|
18
16
|
Data received from an API response is **normalized** into
|
|
19
|
-
[
|
|
17
|
+
[{json:api}](https://jsonapi.org/) (the format used internally
|
|
20
18
|
by WarpDrive), while data sent to an API is **serialized**
|
|
21
19
|
into the format the API expects.
|
|
22
20
|
|
|
23
21
|
### Implementing a Serializer
|
|
24
22
|
|
|
25
23
|
There are only two required serializer methods, one for
|
|
26
|
-
normalizing data from the server API format into
|
|
24
|
+
normalizing data from the server API format into {json:api}, and
|
|
27
25
|
another for serializing records via `Snapshots` into the expected
|
|
28
26
|
server API format.
|
|
29
27
|
|
|
@@ -69,7 +67,7 @@ store.serializerFor('author');
|
|
|
69
67
|
// app/serializers/application.js
|
|
70
68
|
```
|
|
71
69
|
|
|
72
|
-
Most requests in
|
|
70
|
+
Most requests in `@warp-drive/legacy` are made with respect to a particular `type` (or `modelName`)
|
|
73
71
|
(e.g., "get me the full collection of **books**" or "get me the **employee** whose id is 37"). We
|
|
74
72
|
refer to this as the **primary** resource `type`.
|
|
75
73
|
|
|
@@ -93,7 +91,7 @@ Any serializer in `app/serializers/` can be looked up by `name` using `store.ser
|
|
|
93
91
|
### Default Serializers
|
|
94
92
|
|
|
95
93
|
For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**
|
|
96
|
-
format the `@
|
|
94
|
+
format the `@warp-drive/legacy/serializer` package contains implementations these applications can
|
|
97
95
|
extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.
|
|
98
96
|
|
|
99
97
|
Many applications will find writing their own serializer to be more performant and less
|
|
@@ -124,8 +122,7 @@ And you can optionally override the following methods:
|
|
|
124
122
|
|
|
125
123
|
* `normalize()`
|
|
126
124
|
|
|
127
|
-
For an example implementation, see
|
|
128
|
-
[JSONSerializer](JSONSerializer), the included JSON serializer.
|
|
125
|
+
For an example implementation, see the included {@link JSONSerializer}.
|
|
129
126
|
|
|
130
127
|
@class Serializer
|
|
131
128
|
@public
|
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-BnYvPex3.js";
|
package/dist/adapter/error.js
CHANGED
|
@@ -3,17 +3,16 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
|
3
3
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
## Overview
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
|
|
11
|
+
:::danger
|
|
12
|
+
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
13
13
|
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</blockquote>
|
|
14
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
15
|
+
:::
|
|
17
16
|
|
|
18
17
|
An `AdapterError` is used by an adapter to signal that an error occurred
|
|
19
18
|
during a request to an external API. It indicates a generic error, and
|
|
@@ -25,7 +24,7 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
|
25
24
|
it was closed for maintenance:
|
|
26
25
|
|
|
27
26
|
```js [app/adapters/maintenance-error.js]
|
|
28
|
-
import AdapterError from '@
|
|
27
|
+
import AdapterError from '@warp-drive/legacy/adapter/error';
|
|
29
28
|
|
|
30
29
|
export default AdapterError.extend({ message: "Down for maintenance." });
|
|
31
30
|
```
|
|
@@ -33,7 +32,7 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
|
33
32
|
This error would then be returned by an adapter's `handleResponse` method:
|
|
34
33
|
|
|
35
34
|
```js [app/adapters/application.js]
|
|
36
|
-
import JSONAPIAdapter from '@
|
|
35
|
+
import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
|
|
37
36
|
import MaintenanceError from './maintenance-error';
|
|
38
37
|
|
|
39
38
|
export default class ApplicationAdapter extends JSONAPIAdapter {
|
|
@@ -147,8 +146,8 @@ function extend(ParentErrorClass, defaultMessage) {
|
|
|
147
146
|
|
|
148
147
|
```js [app/adapters/post.js]
|
|
149
148
|
import RSVP from 'RSVP';
|
|
150
|
-
import RESTAdapter from '@
|
|
151
|
-
import { InvalidError } from '@
|
|
149
|
+
import RESTAdapter from '@warp-drive/legacy/adapter/rest';
|
|
150
|
+
import { InvalidError } from '@warp-drive/legacy/adapter/error';
|
|
152
151
|
|
|
153
152
|
export default class ApplicationAdapter extends RESTAdapter {
|
|
154
153
|
updateRecord() {
|
|
@@ -190,7 +189,7 @@ InvalidError.prototype.code = 'InvalidError';
|
|
|
190
189
|
connection if an adapter operation has timed out:
|
|
191
190
|
|
|
192
191
|
```js [app/routes/application.js]
|
|
193
|
-
import { TimeoutError } from '@
|
|
192
|
+
import { TimeoutError } from '@warp-drive/legacy/adapter/error';
|
|
194
193
|
|
|
195
194
|
export default class ApplicationRoute extends Route {
|
|
196
195
|
@action
|
|
@@ -236,7 +235,7 @@ AbortError.prototype.code = 'AbortError';
|
|
|
236
235
|
request is unauthorized:
|
|
237
236
|
|
|
238
237
|
```js [app/routes/application.js]
|
|
239
|
-
import { UnauthorizedError } from '@
|
|
238
|
+
import { UnauthorizedError } from '@warp-drive/legacy/adapter/error';
|
|
240
239
|
|
|
241
240
|
export default class ApplicationRoute extends Route {
|
|
242
241
|
@action
|
|
@@ -282,7 +281,7 @@ ForbiddenError.prototype.code = 'ForbiddenError';
|
|
|
282
281
|
for a specific model that does not exist. For example:
|
|
283
282
|
|
|
284
283
|
```js [app/routes/post.js]
|
|
285
|
-
import { NotFoundError } from '@
|
|
284
|
+
import { NotFoundError } from '@warp-drive/legacy/adapter/error';
|
|
286
285
|
|
|
287
286
|
export default class PostRoute extends Route {
|
|
288
287
|
@service store;
|
package/dist/adapter/json-api.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
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-BnYvPex3.js";
|
|
5
5
|
import { RESTAdapter } from './rest.js';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
+
|
|
6
9
|
class JSONAPIAdapter extends RESTAdapter {
|
|
7
10
|
_defaultContentType = 'application/vnd.api+json';
|
|
8
11
|
|
package/dist/adapter/rest.js
CHANGED
|
@@ -2,7 +2,7 @@ import { getOwner } from '@ember/application';
|
|
|
2
2
|
import { warn } from '@ember/debug';
|
|
3
3
|
import { computed } from '@ember/object';
|
|
4
4
|
import { Adapter, BuildURLMixin } from '../adapter.js';
|
|
5
|
-
import { b as serializeIntoHash, d as determineBodyPromise, g as getFetchFunction, s as serializeQueryParams, p as parseResponseHeaders } from "../serialize-into-hash-
|
|
5
|
+
import { b as serializeIntoHash, d as determineBodyPromise, g as getFetchFunction, s as serializeQueryParams, p as parseResponseHeaders } from "../serialize-into-hash-BnYvPex3.js";
|
|
6
6
|
import { InvalidError, ServerError, ConflictError, NotFoundError, ForbiddenError, UnauthorizedError, AdapterError, TimeoutError, AbortError } from './error.js';
|
|
7
7
|
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
8
8
|
import { d as decorateMethodV2 } from "../runtime-BPCpkOf1-BKOwiRJp.js";
|
|
@@ -14,13 +14,11 @@ import { d as decorateMethodV2 } from "../runtime-BPCpkOf1-BKOwiRJp.js";
|
|
|
14
14
|
const AdapterWithBuildURLMixin = Adapter.extend(BuildURLMixin);
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
|
|
17
|
+
* :::danger
|
|
18
|
+
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
20
19
|
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</blockquote>
|
|
20
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
21
|
+
:::
|
|
24
22
|
|
|
25
23
|
The REST adapter allows your store to communicate with an HTTP server by
|
|
26
24
|
transmitting JSON via XHR.
|
|
@@ -392,8 +390,7 @@ class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
392
390
|
Some APIs require HTTP headers, e.g. to provide an API
|
|
393
391
|
key. Arbitrary headers can be set as key/value pairs on the
|
|
394
392
|
`RESTAdapter`'s `headers` object and Ember Data will send them
|
|
395
|
-
along with each ajax request
|
|
396
|
-
customization](/ember-data/release/classes/RESTAdapter).
|
|
393
|
+
along with each ajax request..
|
|
397
394
|
```js [app/adapters/application.js]
|
|
398
395
|
import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';
|
|
399
396
|
export default class ApplicationAdapter extends RESTAdapter {
|
package/dist/adapter.js
CHANGED
|
@@ -496,13 +496,11 @@ const BuildURLMixin = Mixin.create(mixinProps);
|
|
|
496
496
|
/**
|
|
497
497
|
* ## Overview
|
|
498
498
|
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
* ⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
|
|
499
|
+
* :::danger
|
|
500
|
+
* ⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
502
501
|
* If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
* </blockquote>
|
|
502
|
+
* {@link Handler} instead to be used with the {@link RequestManager}
|
|
503
|
+
* ::::
|
|
506
504
|
*
|
|
507
505
|
* In order to properly fetch and update data, @warp-drive/legacy
|
|
508
506
|
* needs to understand how to connect to your API.
|
package/dist/compat/-private.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as FetchManager, S as SaveOp, c as Snapshot, b as SnapshotRecordArray, u as upgradeStore } from "../-private-
|
|
1
|
+
export { F as FetchManager, S as SaveOp, c as Snapshot, b as SnapshotRecordArray, u as upgradeStore } from "../-private-B1pSSN52.js";
|
package/dist/compat/builders.js
CHANGED
|
@@ -9,16 +9,16 @@ import { storeFor, recordIdentifierFor } from '@warp-drive/core';
|
|
|
9
9
|
When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.
|
|
10
10
|
Additionally, it takes the same options as `store.findAll`.
|
|
11
11
|
|
|
12
|
-
All `@
|
|
12
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
13
13
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
14
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
14
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
15
15
|
|
|
16
16
|
@deprecated
|
|
17
17
|
@public
|
|
18
|
-
@param
|
|
19
|
-
@param
|
|
20
|
-
@param
|
|
21
|
-
@return
|
|
18
|
+
@param type the name of the resource
|
|
19
|
+
@param query a query to be used by the adapter
|
|
20
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.findAll
|
|
21
|
+
@return request config
|
|
22
22
|
*/
|
|
23
23
|
function findAllBuilder(type, options = {}) {
|
|
24
24
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
@@ -51,7 +51,7 @@ function findAllBuilder(type, options = {}) {
|
|
|
51
51
|
**Example 1**
|
|
52
52
|
|
|
53
53
|
```ts
|
|
54
|
-
import { findRecord } from '@
|
|
54
|
+
import { findRecord } from '@warp-drive/legacy/compat/builders';
|
|
55
55
|
const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -62,20 +62,20 @@ function findAllBuilder(type, options = {}) {
|
|
|
62
62
|
the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)
|
|
63
63
|
|
|
64
64
|
```ts
|
|
65
|
-
import { findRecord } from '@
|
|
65
|
+
import { findRecord } from '@warp-drive/legacy/compat/builders';
|
|
66
66
|
const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
All `@
|
|
69
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
70
70
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
71
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
71
|
+
To that end, these builders are deprecated and will be removed in a future version of Warp Drive.
|
|
72
72
|
|
|
73
73
|
@deprecated
|
|
74
74
|
@public
|
|
75
|
-
@param
|
|
76
|
-
@param
|
|
77
|
-
@param
|
|
78
|
-
@return
|
|
75
|
+
@param resource - either a string representing the name of the resource or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record
|
|
76
|
+
@param id - optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved
|
|
77
|
+
@param options - if the first param is a string this will be the optional options for the request. See examples for available options.
|
|
78
|
+
@return request config
|
|
79
79
|
*/
|
|
80
80
|
function findRecordBuilder(resource, idOrOptions, options) {
|
|
81
81
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
@@ -118,16 +118,16 @@ function findRecordBuilder(resource, idOrOptions, options) {
|
|
|
118
118
|
When passed to `store.request`, this config will result in the same behavior as a `store.query` request.
|
|
119
119
|
Additionally, it takes the same options as `store.query`.
|
|
120
120
|
|
|
121
|
-
All `@
|
|
121
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
122
122
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
123
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
123
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
124
124
|
|
|
125
125
|
@deprecated
|
|
126
126
|
@public
|
|
127
|
-
@param
|
|
128
|
-
@param
|
|
129
|
-
@param
|
|
130
|
-
@return
|
|
127
|
+
@param type the name of the resource
|
|
128
|
+
@param query a query to be used by the adapter
|
|
129
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.query
|
|
130
|
+
@return request config
|
|
131
131
|
*/
|
|
132
132
|
function queryBuilder(type, query, options = {}) {
|
|
133
133
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
@@ -163,16 +163,16 @@ function queryBuilder(type, query, options = {}) {
|
|
|
163
163
|
When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.
|
|
164
164
|
Additionally, it takes the same options as `store.queryRecord`.
|
|
165
165
|
|
|
166
|
-
All `@
|
|
166
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
167
167
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
168
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
168
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
169
169
|
|
|
170
170
|
@deprecated
|
|
171
171
|
@public
|
|
172
|
-
@param
|
|
173
|
-
@param
|
|
174
|
-
@param
|
|
175
|
-
@return
|
|
172
|
+
@param type the name of the resource
|
|
173
|
+
@param query a query to be used by the adapter
|
|
174
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.query
|
|
175
|
+
@return request config
|
|
176
176
|
*/
|
|
177
177
|
|
|
178
178
|
function queryRecordBuilder(type, query, options) {
|