@warp-drive/legacy 5.8.0-beta.0 → 5.8.0-beta.2
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 +16 -26
- package/declarations/adapter/error.d.ts +7 -7
- package/declarations/adapter/json-api.d.ts +6 -8
- package/declarations/adapter/rest.d.ts +26 -112
- package/declarations/adapter.d.ts +6 -8
- 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 +102 -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 +18 -59
- package/declarations/model/-private/promise-many-array.d.ts +0 -18
- package/declarations/model/-private/record-state.d.ts +1 -1
- package/declarations/model/-private/references/belongs-to.d.ts +19 -29
- package/declarations/model/-private/references/has-many.d.ts +14 -16
- 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 +11 -12
- package/declarations/serializer/json.d.ts +9 -11
- package/declarations/serializer/rest.d.ts +4 -6
- package/declarations/serializer.d.ts +9 -12
- package/dist/{-private-8UmnAf9J.js → -private-BG3bMiKp.js} +3 -2
- package/dist/adapter/-private.js +1 -1
- package/dist/adapter/error.js +14 -15
- package/dist/adapter/json-api.js +4 -1
- package/dist/adapter/rest.js +38 -125
- package/dist/adapter.js +6 -8
- 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 +61 -43
- package/dist/{errors-8kD2mSe_.js → errors-Cz5KrzBk.js} +115 -122
- package/dist/hooks-D6diaM34.js +74 -0
- package/dist/index.js +195 -0
- package/dist/{json-Et4mt_LM.js → json-ChdEfB0X.js} +18 -35
- package/dist/model/-private.js +1 -1
- package/dist/model/migration-support.js +59 -27
- 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-DJCV_6AF.js} +50 -95
- package/dist/{serialize-into-hash-CS0MIv4F.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 +14 -21
- package/dist/serializer/transform.js +15 -6
- package/dist/serializer.js +9 -13
- package/dist/store.js +5 -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 +15 -7
- 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
package/README.md
CHANGED
|
@@ -1,41 +1,31 @@
|
|
|
1
|
-
<
|
|
2
|
-
<img
|
|
3
|
-
class="project-logo"
|
|
4
|
-
src="./logos/github-header.svg#gh-light-mode-only"
|
|
5
|
-
alt="WarpDrive | Boldly go where no app has gone before"
|
|
6
|
-
title="WarpDrive | Boldly go where no app has gone before"
|
|
7
|
-
/>
|
|
1
|
+
<p align="center">
|
|
8
2
|
<img
|
|
9
3
|
class="project-logo"
|
|
10
|
-
src="./logos/
|
|
11
|
-
alt="WarpDrive
|
|
12
|
-
|
|
4
|
+
src="./logos/logo-yellow-slab.svg"
|
|
5
|
+
alt="WarpDrive"
|
|
6
|
+
width="180px"
|
|
7
|
+
title="WarpDrive"
|
|
13
8
|
/>
|
|
14
|
-
</
|
|
9
|
+
</p>
|
|
15
10
|
|
|
16
|
-

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+
[](https://discord.gg/zT3asNS
|
|
15
|
+
)
|
|
16
|
+
[](https://discord.gg/PHBbnWJx5S
|
|
21
17
|
)
|
|
22
18
|
|
|
19
|
+
# @warp-drive/legacy
|
|
20
|
+
|
|
23
21
|
<br>
|
|
24
22
|
|
|
25
23
|
<p align="center">
|
|
26
|
-
Decommissioned
|
|
24
|
+
Decommissioned Features from <em>Warp</em><strong>Drive</strong> that your App may want to continue using for a little while longer.
|
|
27
25
|
</p>
|
|
28
26
|
|
|
29
27
|
<br>
|
|
30
28
|
|
|
31
|
-
## Installation
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
pnpm add -E @warp-drive/legacy
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
<br>
|
|
38
|
-
|
|
39
29
|
## Documentation
|
|
40
30
|
|
|
41
31
|
*Get Started* → [Guides](https://docs.warp-drive.io)
|
|
@@ -45,7 +35,7 @@ pnpm add -E @warp-drive/legacy
|
|
|
45
35
|
|
|
46
36
|
## Code of Conduct
|
|
47
37
|
|
|
48
|
-
Refer to the [Code of Conduct](https://github.com/
|
|
38
|
+
Refer to the [Code of Conduct](https://github.com/warp-drive-data/warp-drive/blob/main/CODE_OF_CONDUCT.md) for community guidelines and inclusivity.
|
|
49
39
|
|
|
50
40
|
<br>
|
|
51
41
|
|
|
@@ -21,8 +21,8 @@ from an adapter is rejected with a `InvalidError` the record will
|
|
|
21
21
|
transition to the `invalid` state and the errors will be set to the
|
|
22
22
|
`errors` property on the record.
|
|
23
23
|
|
|
24
|
-
For
|
|
25
|
-
properties on the model,
|
|
24
|
+
For WarpDrive to correctly map errors to their corresponding
|
|
25
|
+
properties on the model, WarpDrive expects each error to be
|
|
26
26
|
a valid JSON-API error object with a `source/pointer` that matches
|
|
27
27
|
the property name. For example, if you had a Post model that
|
|
28
28
|
looked like this.
|
|
@@ -42,8 +42,8 @@ rejects with a `InvalidError` object that looks like this:
|
|
|
42
42
|
|
|
43
43
|
```js [app/adapters/post.js]
|
|
44
44
|
import RSVP from 'RSVP';
|
|
45
|
-
import RESTAdapter from '@
|
|
46
|
-
import { InvalidError } from '@
|
|
45
|
+
import RESTAdapter from '@warp-drive/legacy/adapter/rest';
|
|
46
|
+
import { InvalidError } from '@warp-drive/legacy/adapter/error';
|
|
47
47
|
|
|
48
48
|
export default class ApplicationAdapter extends RESTAdapter {
|
|
49
49
|
updateRecord() {
|
|
@@ -82,7 +82,7 @@ An example use case would be to warn the user to check their internet
|
|
|
82
82
|
connection if an adapter operation has timed out:
|
|
83
83
|
|
|
84
84
|
```js [app/routes/application.js]
|
|
85
|
-
import { TimeoutError } from '@
|
|
85
|
+
import { TimeoutError } from '@warp-drive/legacy/adapter/error';
|
|
86
86
|
|
|
87
87
|
export default class ApplicationRoute extends Route {
|
|
88
88
|
@action
|
|
@@ -124,7 +124,7 @@ An example use case would be to redirect the user to a login route if a
|
|
|
124
124
|
request is unauthorized:
|
|
125
125
|
|
|
126
126
|
```js [app/routes/application.js]
|
|
127
|
-
import { UnauthorizedError } from '@
|
|
127
|
+
import { UnauthorizedError } from '@warp-drive/legacy/adapter/error';
|
|
128
128
|
|
|
129
129
|
export default class ApplicationRoute extends Route {
|
|
130
130
|
@action
|
|
@@ -166,7 +166,7 @@ An example use case would be to detect if the user has entered a route
|
|
|
166
166
|
for a specific model that does not exist. For example:
|
|
167
167
|
|
|
168
168
|
```js [app/routes/post.js]
|
|
169
|
-
import { NotFoundError } from '@
|
|
169
|
+
import { NotFoundError } from '@warp-drive/legacy/adapter/error';
|
|
170
170
|
|
|
171
171
|
export default class PostRoute extends Route {
|
|
172
172
|
@service store;
|
|
@@ -8,13 +8,11 @@ import { RESTAdapter } from "./rest.js";
|
|
|
8
8
|
/**
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
⚠️ <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.
|
|
14
13
|
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</blockquote>
|
|
14
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
15
|
+
:::
|
|
18
16
|
|
|
19
17
|
The `JSONAPIAdapter` is an adapter whichtransforms the store's
|
|
20
18
|
requests into HTTP requests that follow the [JSON API format](http://jsonapi.org/format/).
|
|
@@ -120,7 +118,7 @@ Endpoint paths can be prefixed with a `namespace` by setting the
|
|
|
120
118
|
namespace property on the adapter:
|
|
121
119
|
|
|
122
120
|
```js [app/adapters/application.js]
|
|
123
|
-
import JSONAPIAdapter from '@
|
|
121
|
+
import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
|
|
124
122
|
|
|
125
123
|
export default class ApplicationAdapter extends JSONAPIAdapter {
|
|
126
124
|
namespace = 'api/1';
|
|
@@ -133,7 +131,7 @@ Requests for the `person` model would now target `/api/1/people/1`.
|
|
|
133
131
|
An adapter can target other hosts by setting the `host` property.
|
|
134
132
|
|
|
135
133
|
```js [app/adapters/application.js]
|
|
136
|
-
import JSONAPIAdapter from '@
|
|
134
|
+
import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
|
|
137
135
|
|
|
138
136
|
export default class ApplicationAdapter extends JSONAPIAdapter {
|
|
139
137
|
host = 'https://api.example.com';
|
|
@@ -31,13 +31,11 @@ export type RequestData = {
|
|
|
31
31
|
};
|
|
32
32
|
declare const AdapterWithBuildURLMixin: Readonly<typeof Adapter> & (new (owner?: Owner) => Adapter) & Mixin;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
⚠️ <strong>This is LEGACY documentation</strong> for a feature that is no longer encouraged to be used.
|
|
34
|
+
* :::danger
|
|
35
|
+
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
37
36
|
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</blockquote>
|
|
37
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
38
|
+
:::
|
|
41
39
|
|
|
42
40
|
The REST adapter allows your store to communicate with an HTTP server by
|
|
43
41
|
transmitting JSON via XHR.
|
|
@@ -108,7 +106,7 @@ look like this:
|
|
|
108
106
|
Note that the object root can be pluralized for both a single-object response
|
|
109
107
|
and an array response: the REST adapter is not strict on this. Further, if the
|
|
110
108
|
HTTP server responds to a `GET` request to `/posts/1` (e.g. the response to a
|
|
111
|
-
`findRecord` query) with more than one object in the array,
|
|
109
|
+
`findRecord` query) with more than one object in the array, WarpDrive will
|
|
112
110
|
only display the object with the matching ID.
|
|
113
111
|
|
|
114
112
|
### Conventional Names
|
|
@@ -169,7 +167,7 @@ response under a key for the type.
|
|
|
169
167
|
|
|
170
168
|
If the records in the relationship are not known when the response
|
|
171
169
|
is serialized it's also possible to represent the relationship as a
|
|
172
|
-
URL using the `links` key in the response.
|
|
170
|
+
URL using the `links` key in the response. WarpDrive will fetch
|
|
173
171
|
this URL to resolve the relationship when it is accessed for the
|
|
174
172
|
first time.
|
|
175
173
|
|
|
@@ -252,10 +250,7 @@ return {
|
|
|
252
250
|
}
|
|
253
251
|
```
|
|
254
252
|
|
|
255
|
-
@class RESTAdapter
|
|
256
253
|
@public
|
|
257
|
-
@constructor
|
|
258
|
-
@uses BuildURLMixin
|
|
259
254
|
*/
|
|
260
255
|
declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
261
256
|
_fastboot: FastBoot;
|
|
@@ -265,8 +260,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
265
260
|
/**
|
|
266
261
|
This property allows ajax to still be used instead when `false`.
|
|
267
262
|
|
|
268
|
-
@property useFetch
|
|
269
|
-
@type {Boolean}
|
|
270
263
|
@default true
|
|
271
264
|
@public
|
|
272
265
|
*/
|
|
@@ -312,8 +305,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
312
305
|
}
|
|
313
306
|
```
|
|
314
307
|
|
|
315
|
-
@param {Object} obj
|
|
316
|
-
@return {Object}
|
|
317
308
|
@public
|
|
318
309
|
*/
|
|
319
310
|
sortQueryParams(obj: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -361,9 +352,7 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
361
352
|
Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app
|
|
362
353
|
`groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.
|
|
363
354
|
|
|
364
|
-
@property coalesceFindRequests
|
|
365
355
|
@public
|
|
366
|
-
@type {Boolean}
|
|
367
356
|
*/
|
|
368
357
|
get coalesceFindRequests(): boolean;
|
|
369
358
|
set coalesceFindRequests(value: boolean);
|
|
@@ -381,9 +370,7 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
381
370
|
|
|
382
371
|
Requests for the `Post` model would now target `/api/1/post/`.
|
|
383
372
|
|
|
384
|
-
@property namespace
|
|
385
373
|
@public
|
|
386
|
-
@type {String}
|
|
387
374
|
*/
|
|
388
375
|
/**
|
|
389
376
|
An adapter can target other hosts by setting the `host` property.
|
|
@@ -398,16 +385,13 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
398
385
|
|
|
399
386
|
Requests for the `Post` model would now target `https://api.example.com/post/`.
|
|
400
387
|
|
|
401
|
-
@property host
|
|
402
388
|
@public
|
|
403
|
-
@type {String}
|
|
404
389
|
*/
|
|
405
390
|
/**
|
|
406
391
|
Some APIs require HTTP headers, e.g. to provide an API
|
|
407
392
|
key. Arbitrary headers can be set as key/value pairs on the
|
|
408
|
-
`RESTAdapter`'s `headers` object and
|
|
409
|
-
along with each ajax request
|
|
410
|
-
customization](/ember-data/release/classes/RESTAdapter).
|
|
393
|
+
`RESTAdapter`'s `headers` object and WarpDrive will send them
|
|
394
|
+
along with each ajax request..
|
|
411
395
|
|
|
412
396
|
```js [app/adapters/application.js]
|
|
413
397
|
import { RESTAdapter } from '@warp-drive/legacy/adapter/rest';
|
|
@@ -422,9 +406,7 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
422
406
|
}
|
|
423
407
|
```
|
|
424
408
|
|
|
425
|
-
@property headers
|
|
426
409
|
@public
|
|
427
|
-
@type {Object}
|
|
428
410
|
*/
|
|
429
411
|
headers: Record<string, unknown> | undefined;
|
|
430
412
|
/**
|
|
@@ -438,11 +420,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
438
420
|
|
|
439
421
|
@since 1.13.0
|
|
440
422
|
@public
|
|
441
|
-
@param {Store} store
|
|
442
|
-
@param {Model} type
|
|
443
|
-
@param {String} id
|
|
444
|
-
@param {Snapshot} snapshot
|
|
445
|
-
@return {Promise} promise
|
|
446
423
|
*/
|
|
447
424
|
findRecord(store: Store, type: ModelSchema, id: string, snapshot: Snapshot): Promise<AdapterPayload>;
|
|
448
425
|
/**
|
|
@@ -453,13 +430,8 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
453
430
|
promise for the resulting payload.
|
|
454
431
|
|
|
455
432
|
@public
|
|
456
|
-
@param {Store} store
|
|
457
|
-
@param {Model} type
|
|
458
|
-
@param {undefined} neverSet a value is never provided to this argument
|
|
459
|
-
@param {SnapshotRecordArray} snapshotRecordArray
|
|
460
|
-
@return {Promise} promise
|
|
461
433
|
*/
|
|
462
|
-
findAll(store: Store, type: ModelSchema,
|
|
434
|
+
findAll(store: Store, type: ModelSchema, neverUsed: null, snapshotRecordArray: SnapshotRecordArray): Promise<AdapterPayload>;
|
|
463
435
|
/**
|
|
464
436
|
Called by the store in order to fetch a JSON array for
|
|
465
437
|
the records that match a particular query.
|
|
@@ -472,12 +444,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
472
444
|
to the server as parameters.
|
|
473
445
|
|
|
474
446
|
@public
|
|
475
|
-
@param {Store} store
|
|
476
|
-
@param {Model} type
|
|
477
|
-
@param {Object} query
|
|
478
|
-
@param {Collection} recordArray
|
|
479
|
-
@param {Object} adapterOptions
|
|
480
|
-
@return {Promise} promise
|
|
481
447
|
*/
|
|
482
448
|
query(store: Store, type: ModelSchema, query: Record<string, unknown>): Promise<AdapterPayload>;
|
|
483
449
|
/**
|
|
@@ -493,11 +459,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
493
459
|
|
|
494
460
|
@since 1.13.0
|
|
495
461
|
@public
|
|
496
|
-
@param {Store} store
|
|
497
|
-
@param {Model} type
|
|
498
|
-
@param {Object} query
|
|
499
|
-
@param {Object} adapterOptions
|
|
500
|
-
@return {Promise} promise
|
|
501
462
|
*/
|
|
502
463
|
queryRecord(store: Store, type: ModelSchema, query: Record<string, unknown>, adapterOptions: Record<string, unknown>): Promise<AdapterPayload>;
|
|
503
464
|
/**
|
|
@@ -527,11 +488,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
527
488
|
promise for the resulting payload.
|
|
528
489
|
|
|
529
490
|
@public
|
|
530
|
-
@param {Store} store
|
|
531
|
-
@param {Model} type
|
|
532
|
-
@param {Array} ids
|
|
533
|
-
@param {Array} snapshots
|
|
534
|
-
@return {Promise} promise
|
|
535
491
|
*/
|
|
536
492
|
findMany(store: Store, type: ModelSchema, ids: string[], snapshots: Snapshot[]): Promise<AdapterPayload>;
|
|
537
493
|
/**
|
|
@@ -564,11 +520,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
564
520
|
* Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.
|
|
565
521
|
|
|
566
522
|
@public
|
|
567
|
-
@param {Store} store
|
|
568
|
-
@param {Snapshot} snapshot
|
|
569
|
-
@param {String} url
|
|
570
|
-
@param {Object} relationship meta object describing the relationship
|
|
571
|
-
@return {Promise} promise
|
|
572
523
|
*/
|
|
573
524
|
findHasMany(store: Store, snapshot: Snapshot, url: string, relationship: Record<string, unknown>): Promise<AdapterPayload>;
|
|
574
525
|
/**
|
|
@@ -614,10 +565,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
614
565
|
of a record.
|
|
615
566
|
|
|
616
567
|
@public
|
|
617
|
-
@param {Store} store
|
|
618
|
-
@param {Model} type
|
|
619
|
-
@param {Snapshot} snapshot
|
|
620
|
-
@return {Promise} promise
|
|
621
568
|
*/
|
|
622
569
|
createRecord(store: Store, type: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload>;
|
|
623
570
|
/**
|
|
@@ -631,10 +578,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
631
578
|
of a record.
|
|
632
579
|
|
|
633
580
|
@public
|
|
634
|
-
@param {Store} store
|
|
635
|
-
@param {Model} schema
|
|
636
|
-
@param {Snapshot} snapshot
|
|
637
|
-
@return {Promise} promise
|
|
638
581
|
*/
|
|
639
582
|
updateRecord(store: Store, schema: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload>;
|
|
640
583
|
/**
|
|
@@ -643,12 +586,11 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
643
586
|
The `deleteRecord` method makes an Ajax (HTTP DELETE) request to a URL computed by `buildURL`.
|
|
644
587
|
|
|
645
588
|
@public
|
|
646
|
-
@param {Store} store
|
|
647
|
-
@param {Model} type
|
|
648
|
-
@param {Snapshot} snapshot
|
|
649
|
-
@return {Promise} promise
|
|
650
589
|
*/
|
|
651
590
|
deleteRecord(store: Store, schema: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload>;
|
|
591
|
+
/**
|
|
592
|
+
@private
|
|
593
|
+
*/
|
|
652
594
|
_stripIDFromURL(store: Store, snapshot: Snapshot): string;
|
|
653
595
|
maxURLLength: number;
|
|
654
596
|
/**
|
|
@@ -668,9 +610,7 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
668
610
|
and `/posts/2/comments/3`
|
|
669
611
|
|
|
670
612
|
@public
|
|
671
|
-
@
|
|
672
|
-
@param {Array} snapshots
|
|
673
|
-
@return {Array} an array of arrays of records, each of which is to be
|
|
613
|
+
@return an array of arrays of records, each of which is to be
|
|
674
614
|
loaded separately by `findMany`.
|
|
675
615
|
*/
|
|
676
616
|
groupRecordsForFindMany(store: Store, snapshots: Snapshot[]): Snapshot[][];
|
|
@@ -697,11 +637,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
697
637
|
|
|
698
638
|
@since 1.13.0
|
|
699
639
|
@public
|
|
700
|
-
@param {Number} status
|
|
701
|
-
@param {Object} headers
|
|
702
|
-
@param {Object} payload
|
|
703
|
-
@param {Object} requestData - the original request information
|
|
704
|
-
@return {Object | AdapterError} response
|
|
705
640
|
*/
|
|
706
641
|
handleResponse(status: number, headers: Record<string, string>, payload: Payload, requestData: RequestData): Payload | typeof AdapterError;
|
|
707
642
|
/**
|
|
@@ -710,10 +645,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
710
645
|
|
|
711
646
|
@since 1.13.0
|
|
712
647
|
@public
|
|
713
|
-
@param {Number} status
|
|
714
|
-
@param {Object} headers
|
|
715
|
-
@param {Object} payload
|
|
716
|
-
@return {Boolean}
|
|
717
648
|
*/
|
|
718
649
|
isSuccess(status: number, _headers: Record<string, unknown>, _payload: Payload): boolean;
|
|
719
650
|
/**
|
|
@@ -722,17 +653,13 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
722
653
|
|
|
723
654
|
@since 1.13.0
|
|
724
655
|
@public
|
|
725
|
-
@param {Number} status
|
|
726
|
-
@param {Object} headers
|
|
727
|
-
@param {Object} payload
|
|
728
|
-
@return {Boolean}
|
|
729
656
|
*/
|
|
730
657
|
isInvalid(status: number, _headers: Record<string, unknown>, _payload: Payload): boolean;
|
|
731
658
|
/**
|
|
732
659
|
Takes a URL, an HTTP method and a hash of data, and makes an
|
|
733
660
|
HTTP request.
|
|
734
661
|
|
|
735
|
-
When the server responds with a payload,
|
|
662
|
+
When the server responds with a payload, WarpDrive will call into `extractSingle`
|
|
736
663
|
or `extractArray` (depending on whether the original query was for one record or
|
|
737
664
|
many records).
|
|
738
665
|
|
|
@@ -746,40 +673,36 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
746
673
|
* Registers success and failure handlers.
|
|
747
674
|
|
|
748
675
|
@private
|
|
749
|
-
@param {String} url
|
|
750
|
-
@param {String} type The request type GET, POST, PUT, DELETE etc.
|
|
751
|
-
@param {Object} options
|
|
752
|
-
@return {Promise} promise
|
|
753
676
|
*/
|
|
754
677
|
ajax(url: string, type: HTTPMethod, options?: JQueryAjaxSettings | RequestInit): Promise<AdapterPayload>;
|
|
755
678
|
/**
|
|
756
679
|
@private
|
|
757
|
-
@param
|
|
680
|
+
@param options jQuery ajax options to be used for the ajax request
|
|
758
681
|
*/
|
|
759
682
|
_ajaxRequest(options: JQueryRequestInit): void;
|
|
683
|
+
/**
|
|
684
|
+
@private
|
|
685
|
+
*/
|
|
760
686
|
_fetchRequest(options: FetchRequestInit): Promise<Response>;
|
|
687
|
+
/**
|
|
688
|
+
@private
|
|
689
|
+
*/
|
|
761
690
|
_ajax(options: FetchRequestInit | JQueryRequestInit): void;
|
|
762
691
|
/**
|
|
763
692
|
@private
|
|
764
|
-
@param {String} url
|
|
765
|
-
@param {String} type The request type GET, POST, PUT, DELETE etc.
|
|
766
|
-
@param {Object} options
|
|
767
|
-
@return {Object}
|
|
768
693
|
*/
|
|
769
694
|
ajaxOptions(url: string, method: HTTPMethod, options: JQueryAjaxSettings | RequestInit): JQueryRequestInit | FetchRequestInit;
|
|
695
|
+
/**
|
|
696
|
+
* @private
|
|
697
|
+
*/
|
|
770
698
|
_ajaxURL(url: string): string;
|
|
771
699
|
/**
|
|
772
700
|
@private
|
|
773
|
-
@param {String} responseText
|
|
774
|
-
@return {Object}
|
|
775
701
|
*/
|
|
776
702
|
parseErrorResponse(responseText: string): Record<string, unknown> | string;
|
|
777
703
|
/**
|
|
778
704
|
@private
|
|
779
|
-
@
|
|
780
|
-
@param {Object} headers
|
|
781
|
-
@param {Object} payload
|
|
782
|
-
@return {Array} errors payload
|
|
705
|
+
@return errors payload
|
|
783
706
|
*/
|
|
784
707
|
normalizeErrorResponse(status: number, _headers: Record<string, unknown>, payload: Payload): Record<string, unknown>[];
|
|
785
708
|
/**
|
|
@@ -787,11 +710,7 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
787
710
|
of information for debugging (good luck!)
|
|
788
711
|
|
|
789
712
|
@private
|
|
790
|
-
@
|
|
791
|
-
@param {Object} headers
|
|
792
|
-
@param {Object} payload
|
|
793
|
-
@param {Object} requestData
|
|
794
|
-
@return {String} detailed error message
|
|
713
|
+
@return detailed error message
|
|
795
714
|
*/
|
|
796
715
|
generatedDetailedMessage(status: number, headers: Record<string, string>, payload: Payload, requestData: RequestData): string;
|
|
797
716
|
/**
|
|
@@ -800,8 +719,6 @@ declare class RESTAdapter extends AdapterWithBuildURLMixin {
|
|
|
800
719
|
|
|
801
720
|
@since 2.5.0
|
|
802
721
|
@public
|
|
803
|
-
@param {Snapshot} snapshot
|
|
804
|
-
@return {Object}
|
|
805
722
|
*/
|
|
806
723
|
buildQuery(snapshot: Snapshot | SnapshotRecordArray): QueryState;
|
|
807
724
|
}
|
|
@@ -809,10 +726,7 @@ interface RESTAdapter extends MixtBuildURLMixin {}
|
|
|
809
726
|
/**
|
|
810
727
|
* Helper function that translates the options passed to `jQuery.ajax` into a format that `fetch` expects.
|
|
811
728
|
*
|
|
812
|
-
* @param {Object} _options
|
|
813
|
-
* @param {Adapter} adapter
|
|
814
729
|
* @private
|
|
815
|
-
* @return {Object}
|
|
816
730
|
*/
|
|
817
731
|
export declare function fetchOptions(options: JQueryRequestInit & Partial<FetchRequestInit>, adapter: RESTAdapter): FetchRequestInit;
|
|
818
732
|
export { RESTAdapter };
|
|
@@ -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 adapter, 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 fetch and update data, @warp-drive/legacy
|
|
13
11
|
* needs to understand how to connect to your API.
|
|
@@ -455,10 +453,10 @@ export declare class Adapter extends EmberObject implements MinimumAdapterInterf
|
|
|
455
453
|
|
|
456
454
|
The updateRecord method is expected to return a promise that will
|
|
457
455
|
resolve with the serialized record. This allows the backend to
|
|
458
|
-
inform the
|
|
456
|
+
inform the WarpDrive store the current state of this record after
|
|
459
457
|
the update. If it is not possible to return a serialized record
|
|
460
458
|
the updateRecord promise can also resolve with `undefined` and the
|
|
461
|
-
|
|
459
|
+
WarpDrive store will assume all of the updates were successfully
|
|
462
460
|
applied on the backend.
|
|
463
461
|
|
|
464
462
|
Example
|
|
@@ -19,16 +19,16 @@ This function builds a request config to perform a `findAll` request for the giv
|
|
|
19
19
|
When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.
|
|
20
20
|
Additionally, it takes the same options as `store.findAll`.
|
|
21
21
|
|
|
22
|
-
All `@
|
|
22
|
+
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.
|
|
23
23
|
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.
|
|
24
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
24
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
25
25
|
|
|
26
26
|
@deprecated
|
|
27
27
|
@public
|
|
28
|
-
@param
|
|
29
|
-
@param
|
|
30
|
-
@param
|
|
31
|
-
@return
|
|
28
|
+
@param type the name of the resource
|
|
29
|
+
@param query a query to be used by the adapter
|
|
30
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.findAll
|
|
31
|
+
@return request config
|
|
32
32
|
*/
|
|
33
33
|
export declare function findAllBuilder<T extends TypedRecordInstance>(type: TypeFromInstance<T>, options?: FindAllBuilderOptions): FindAllRequestInput<TypeFromInstance<T>, T[]>;
|
|
34
34
|
export declare function findAllBuilder(type: string, options?: FindAllBuilderOptions): FindAllRequestInput;
|
|
@@ -23,7 +23,7 @@ Additionally, it takes the same options as `store.findRecord`, with the exceptio
|
|
|
23
23
|
**Example 1**
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
import { findRecord } from '@
|
|
26
|
+
import { findRecord } from '@warp-drive/legacy/compat/builders';
|
|
27
27
|
const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -34,20 +34,20 @@ of `type` (modelName) and `id` as separate arguments. You may recognize this com
|
|
|
34
34
|
the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)
|
|
35
35
|
|
|
36
36
|
```ts
|
|
37
|
-
import { findRecord } from '@
|
|
37
|
+
import { findRecord } from '@warp-drive/legacy/compat/builders';
|
|
38
38
|
const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
All `@
|
|
41
|
+
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.
|
|
42
42
|
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.
|
|
43
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
43
|
+
To that end, these builders are deprecated and will be removed in a future version of Warp Drive.
|
|
44
44
|
|
|
45
45
|
@deprecated
|
|
46
46
|
@public
|
|
47
|
-
@param
|
|
48
|
-
@param
|
|
49
|
-
@param
|
|
50
|
-
@return
|
|
47
|
+
@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
|
|
48
|
+
@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
|
|
49
|
+
@param options - if the first param is a string this will be the optional options for the request. See examples for available options.
|
|
50
|
+
@return request config
|
|
51
51
|
*/
|
|
52
52
|
export declare function findRecordBuilder<T extends TypedRecordInstance>(type: TypeFromInstance<T>, id: string, options?: FindRecordBuilderOptions): FindRecordRequestInput<TypeFromInstance<T>, T>;
|
|
53
53
|
export declare function findRecordBuilder(type: string, id: string, options?: FindRecordBuilderOptions): FindRecordRequestInput;
|
|
@@ -20,16 +20,16 @@ This function builds a request config for a given type and query object.
|
|
|
20
20
|
When passed to `store.request`, this config will result in the same behavior as a `store.query` request.
|
|
21
21
|
Additionally, it takes the same options as `store.query`.
|
|
22
22
|
|
|
23
|
-
All `@
|
|
23
|
+
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.
|
|
24
24
|
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.
|
|
25
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
25
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
26
26
|
|
|
27
27
|
@deprecated
|
|
28
28
|
@public
|
|
29
|
-
@param
|
|
30
|
-
@param
|
|
31
|
-
@param
|
|
32
|
-
@return
|
|
29
|
+
@param type the name of the resource
|
|
30
|
+
@param query a query to be used by the adapter
|
|
31
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.query
|
|
32
|
+
@return request config
|
|
33
33
|
*/
|
|
34
34
|
export declare function queryBuilder<T extends TypedRecordInstance>(type: TypeFromInstance<T>, query: LegacyResourceQuery, options?: QueryBuilderOptions): QueryRequestInput<TypeFromInstance<T>, T[]>;
|
|
35
35
|
export declare function queryBuilder(type: string, query: LegacyResourceQuery, options?: QueryBuilderOptions): QueryRequestInput;
|
|
@@ -50,16 +50,16 @@ This function builds a request config for a given type and query object.
|
|
|
50
50
|
When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.
|
|
51
51
|
Additionally, it takes the same options as `store.queryRecord`.
|
|
52
52
|
|
|
53
|
-
All `@
|
|
53
|
+
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.
|
|
54
54
|
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.
|
|
55
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
55
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
56
56
|
|
|
57
57
|
@deprecated
|
|
58
58
|
@public
|
|
59
|
-
@param
|
|
60
|
-
@param
|
|
61
|
-
@param
|
|
62
|
-
@return
|
|
59
|
+
@param type the name of the resource
|
|
60
|
+
@param query a query to be used by the adapter
|
|
61
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.query
|
|
62
|
+
@return request config
|
|
63
63
|
*/
|
|
64
64
|
export declare function queryRecordBuilder<T extends TypedRecordInstance>(type: TypeFromInstance<T>, query: LegacyResourceQuery, options?: QueryBuilderOptions): QueryRecordRequestInput<TypeFromInstance<T>, T | null>;
|
|
65
65
|
export declare function queryRecordBuilder(type: string, query: LegacyResourceQuery, options?: QueryBuilderOptions): QueryRecordRequestInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type default as EmberObject } from "@ember/object";
|
|
2
|
-
import type { CAUTION_MEGA_DANGER_ZONE_Extension } from "@warp-drive/core/reactive
|
|
2
|
+
import type { CAUTION_MEGA_DANGER_ZONE_Extension } from "@warp-drive/core/reactive";
|
|
3
3
|
declare const EmberObjectMethods: readonly ["addObserver", "cacheFor", "decrementProperty", "get", "getProperties", "incrementProperty", "notifyPropertyChange", "removeObserver", "set", "setProperties", "toggleProperty"];
|
|
4
4
|
export declare const EmberObjectArrayExtension: CAUTION_MEGA_DANGER_ZONE_Extension;
|
|
5
5
|
export declare const EmberObjectExtension: CAUTION_MEGA_DANGER_ZONE_Extension;
|