@warp-drive/core 5.6.0-alpha.5 → 5.6.0-beta.0
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 +8 -7
- package/cjs-dist/addon-shim.cjs +1 -0
- package/cjs-dist/cjs-set-config.cjs +1 -0
- package/declarations/build-config/babel-macros.d.ts +1 -0
- package/declarations/build-config/canary-features.d.ts +1 -0
- package/declarations/build-config/debugging.d.ts +1 -0
- package/declarations/build-config/deprecations.d.ts +1 -0
- package/declarations/build-config/env.d.ts +1 -0
- package/declarations/build-config/macros.d.ts +1 -0
- package/declarations/build-config.d.ts +1 -0
- package/declarations/configure.d.ts +7 -0
- package/declarations/graph/-private/-diff.d.ts +32 -0
- package/declarations/graph/-private/-edge-definition.d.ts +148 -0
- package/declarations/graph/-private/-state.d.ts +96 -0
- package/declarations/graph/-private/-utils.d.ts +31 -0
- package/declarations/graph/-private/coerce-id.d.ts +10 -0
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +18 -0
- package/declarations/graph/-private/edges/collection.d.ts +39 -0
- package/declarations/graph/-private/edges/implicit.d.ts +43 -0
- package/declarations/graph/-private/edges/resource.d.ts +24 -0
- package/declarations/graph/-private/graph.d.ts +90 -0
- package/declarations/graph/-private/normalize-link.d.ts +8 -0
- package/declarations/graph/-private/operations/add-to-related-records.d.ts +4 -0
- package/declarations/graph/-private/operations/merge-identifier.d.ts +3 -0
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts +4 -0
- package/declarations/graph/-private/operations/replace-related-record.d.ts +3 -0
- package/declarations/graph/-private/operations/replace-related-records.d.ts +62 -0
- package/declarations/graph/-private/operations/update-relationship.d.ts +13 -0
- package/declarations/graph/-private.d.ts +13 -0
- package/declarations/index.d.ts +14 -3
- package/declarations/reactive/-private/document.d.ts +146 -0
- package/declarations/reactive/-private/fields/compute.d.ts +43 -0
- package/declarations/reactive/-private/fields/extension.d.ts +8 -0
- package/declarations/reactive/-private/fields/managed-array.d.ts +22 -0
- package/declarations/reactive/-private/fields/managed-object.d.ts +21 -0
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +19 -0
- package/declarations/reactive/-private/hooks.d.ts +5 -0
- package/declarations/reactive/-private/record.d.ts +64 -0
- package/declarations/reactive/-private/schema.d.ts +271 -0
- package/declarations/reactive/-private/symbols.d.ts +36 -0
- package/declarations/reactive/-private.d.ts +1 -0
- package/declarations/reactive.d.ts +4 -0
- package/declarations/request/-private/context.d.ts +34 -35
- package/declarations/request/-private/debug.d.ts +2 -3
- package/declarations/request/-private/fetch.d.ts +24 -36
- package/declarations/request/-private/future.d.ts +3 -4
- package/declarations/request/-private/manager.d.ts +159 -132
- package/declarations/request/-private/promise-cache.d.ts +21 -13
- package/declarations/request/-private/types.d.ts +124 -123
- package/declarations/request/-private/utils.d.ts +8 -9
- package/declarations/request.d.ts +5 -433
- package/declarations/store/-private/cache-handler/handler.d.ts +62 -0
- package/declarations/store/-private/cache-handler/types.d.ts +98 -0
- package/declarations/store/-private/cache-handler/utils.d.ts +32 -0
- package/declarations/store/-private/caches/cache-utils.d.ts +12 -0
- package/declarations/store/-private/caches/identifier-cache.d.ts +304 -0
- package/declarations/store/-private/caches/instance-cache.d.ts +65 -0
- package/declarations/store/-private/caches/resource-utils.d.ts +9 -0
- package/declarations/store/-private/debug/utils.d.ts +6 -0
- package/declarations/store/-private/default-cache-policy.d.ts +384 -0
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts +159 -0
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +17 -0
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +25 -0
- package/declarations/store/-private/managers/cache-manager.d.ts +443 -0
- package/declarations/store/-private/managers/notification-manager.d.ts +98 -0
- package/declarations/store/-private/managers/record-array-manager.d.ts +97 -0
- package/declarations/store/-private/network/request-cache.d.ts +107 -0
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts +263 -0
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +176 -0
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +169 -0
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +35 -0
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +277 -0
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +261 -0
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +147 -0
- package/declarations/store/-private/record-arrays/many-array.d.ts +197 -0
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +126 -0
- package/declarations/store/-private/store-service.d.ts +1605 -0
- package/declarations/store/-private/utils/coerce-id.d.ts +10 -0
- package/declarations/store/-private/utils/construct-resource.d.ts +6 -0
- package/declarations/store/-private/utils/is-non-empty-string.d.ts +1 -0
- package/declarations/store/-private/utils/normalize-model-name.d.ts +1 -0
- package/declarations/store/-private/utils/uuid-polyfill.d.ts +1 -0
- package/declarations/store/-private.d.ts +31 -0
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +99 -0
- package/declarations/store/-types/q/ds-model.d.ts +21 -0
- package/declarations/store/-types/q/identifier.d.ts +20 -0
- package/declarations/store/-types/q/record-instance.d.ts +23 -0
- package/declarations/store/-types/q/schema-service.d.ts +354 -0
- package/declarations/store/-types/q/store.d.ts +32 -0
- package/declarations/store.d.ts +1 -0
- package/declarations/types/-private.d.ts +16 -8
- package/declarations/types/cache/aliases.d.ts +11 -1
- package/declarations/types/cache/change.d.ts +4 -5
- package/declarations/types/cache/mutations.d.ts +51 -28
- package/declarations/types/cache/operations.d.ts +60 -47
- package/declarations/types/cache/relationship.d.ts +11 -9
- package/declarations/types/cache.d.ts +495 -484
- package/declarations/types/graph.d.ts +31 -40
- package/declarations/types/identifier.d.ts +83 -82
- package/declarations/types/json/raw.d.ts +1 -2
- package/declarations/types/params.d.ts +4 -5
- package/declarations/types/record.d.ts +117 -76
- package/declarations/types/request.d.ts +289 -266
- package/declarations/types/runtime.d.ts +8 -9
- package/declarations/types/schema/concepts.d.ts +19 -13
- package/declarations/types/schema/fields.d.ts +1712 -1741
- package/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/declarations/types/spec/document.d.ts +28 -22
- package/declarations/types/spec/error.d.ts +16 -17
- package/declarations/types/spec/json-api-raw.d.ts +102 -102
- package/declarations/types/symbols.d.ts +74 -75
- package/declarations/types/utils.d.ts +5 -5
- package/declarations/types.d.ts +10 -7
- package/declarations/utils/string.d.ts +48 -0
- package/dist/build-config/babel-macros.js +1 -0
- package/dist/build-config/canary-features.js +1 -0
- package/dist/build-config/debugging.js +1 -0
- package/dist/build-config/deprecations.js +1 -0
- package/dist/build-config/env.js +1 -0
- package/dist/build-config/macros.js +1 -0
- package/dist/build-config.js +1 -0
- package/dist/configure-B48bFHOl.js +181 -0
- package/dist/configure.js +1 -0
- package/dist/{context-DE5sFezZ.js → context-COmAnXUQ.js} +2 -2
- package/dist/graph/-private.js +3372 -0
- package/dist/handler-C2T-IyJK.js +339 -0
- package/dist/index.js +37 -104
- package/dist/reactive/-private.js +1 -0
- package/dist/reactive.js +1988 -0
- package/dist/request-state-CjLph1LP.js +8139 -0
- package/dist/request.js +1 -1
- package/dist/store/-private.js +3 -0
- package/dist/store.js +545 -0
- package/dist/symbols-SIstXMLI.js +44 -0
- package/dist/types/-private.js +3 -3
- package/dist/types/record.js +1 -1
- package/dist/types/request.js +2 -2
- package/dist/types/runtime.js +1 -1
- package/dist/types/schema/fields.js +8 -41
- package/dist/types/symbols.js +3 -3
- package/dist/utils/string.js +92 -0
- package/logos/NCC-1701-a-blue.svg +4 -0
- package/logos/NCC-1701-a-gold.svg +4 -0
- package/logos/NCC-1701-a-gold_100.svg +1 -0
- package/logos/NCC-1701-a-gold_base-64.txt +1 -0
- package/logos/NCC-1701-a.svg +4 -0
- package/logos/README.md +4 -0
- package/logos/docs-badge.svg +2 -0
- package/logos/ember-data-logo-dark.svg +12 -0
- package/logos/ember-data-logo-light.svg +12 -0
- package/logos/github-header.svg +444 -0
- package/logos/social1.png +0 -0
- package/logos/social2.png +0 -0
- package/logos/warp-drive-logo-dark.svg +4 -0
- package/logos/warp-drive-logo-gold.svg +4 -0
- package/package.json +11 -8
- package/declarations/index.d.ts.map +0 -1
- package/declarations/request/-private/context.d.ts.map +0 -1
- package/declarations/request/-private/debug.d.ts.map +0 -1
- package/declarations/request/-private/fetch.d.ts.map +0 -1
- package/declarations/request/-private/future.d.ts.map +0 -1
- package/declarations/request/-private/manager.d.ts.map +0 -1
- package/declarations/request/-private/promise-cache.d.ts.map +0 -1
- package/declarations/request/-private/types.d.ts.map +0 -1
- package/declarations/request/-private/utils.d.ts.map +0 -1
- package/declarations/request.d.ts.map +0 -1
- package/declarations/types/-private.d.ts.map +0 -1
- package/declarations/types/cache/aliases.d.ts.map +0 -1
- package/declarations/types/cache/change.d.ts.map +0 -1
- package/declarations/types/cache/mutations.d.ts.map +0 -1
- package/declarations/types/cache/operations.d.ts.map +0 -1
- package/declarations/types/cache/relationship.d.ts.map +0 -1
- package/declarations/types/cache.d.ts.map +0 -1
- package/declarations/types/graph.d.ts.map +0 -1
- package/declarations/types/identifier.d.ts.map +0 -1
- package/declarations/types/json/raw.d.ts.map +0 -1
- package/declarations/types/params.d.ts.map +0 -1
- package/declarations/types/record.d.ts.map +0 -1
- package/declarations/types/record.type-test.d.ts +0 -2
- package/declarations/types/record.type-test.d.ts.map +0 -1
- package/declarations/types/request.d.ts.map +0 -1
- package/declarations/types/request.type-test.d.ts +0 -2
- package/declarations/types/request.type-test.d.ts.map +0 -1
- package/declarations/types/runtime.d.ts.map +0 -1
- package/declarations/types/schema/concepts.d.ts.map +0 -1
- package/declarations/types/schema/fields.d.ts.map +0 -1
- package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
- package/declarations/types/spec/document.d.ts.map +0 -1
- package/declarations/types/spec/error.d.ts.map +0 -1
- package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
- package/declarations/types/symbols.d.ts.map +0 -1
- package/declarations/types/utils.d.ts.map +0 -1
- package/declarations/types.d.ts.map +0 -1
- package/dist/context-DE5sFezZ.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/request.js.map +0 -1
- package/dist/types/-private.js.map +0 -1
- package/dist/types/cache/aliases.js.map +0 -1
- package/dist/types/cache/change.js.map +0 -1
- package/dist/types/cache/mutations.js.map +0 -1
- package/dist/types/cache/operations.js.map +0 -1
- package/dist/types/cache/relationship.js.map +0 -1
- package/dist/types/cache.js.map +0 -1
- package/dist/types/graph.js.map +0 -1
- package/dist/types/identifier.js.map +0 -1
- package/dist/types/json/raw.js.map +0 -1
- package/dist/types/params.js.map +0 -1
- package/dist/types/record.js.map +0 -1
- package/dist/types/request.js.map +0 -1
- package/dist/types/runtime.js.map +0 -1
- package/dist/types/schema/concepts.js.map +0 -1
- package/dist/types/schema/fields.js.map +0 -1
- package/dist/types/schema/fields.type-test.js.map +0 -1
- package/dist/types/spec/document.js.map +0 -1
- package/dist/types/spec/error.js.map +0 -1
- package/dist/types/spec/json-api-raw.js.map +0 -1
- package/dist/types/symbols.js.map +0 -1
- package/dist/types/utils.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import type { StableExistingRecordIdentifier } from
|
|
2
|
-
import type { ApiError } from
|
|
3
|
-
import type { Links, Meta, PaginationLinks } from
|
|
1
|
+
import type { StableExistingRecordIdentifier } from "../identifier.js";
|
|
2
|
+
import type { ApiError } from "./error.js";
|
|
3
|
+
import type { Links, Meta, PaginationLinks } from "./json-api-raw.js";
|
|
4
4
|
export interface ResourceMetaDocument {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// the url or cache-key associated with the structured document
|
|
6
|
+
lid?: string;
|
|
7
|
+
meta: Meta;
|
|
8
|
+
links?: Links | PaginationLinks;
|
|
8
9
|
}
|
|
9
|
-
export interface SingleResourceDataDocument<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export interface SingleResourceDataDocument<
|
|
11
|
+
T = StableExistingRecordIdentifier,
|
|
12
|
+
R = StableExistingRecordIdentifier
|
|
13
|
+
> {
|
|
14
|
+
// the url or cache-key associated with the structured document
|
|
15
|
+
lid?: string;
|
|
16
|
+
links?: Links | PaginationLinks;
|
|
17
|
+
meta?: Meta;
|
|
18
|
+
data: T | null;
|
|
19
|
+
included?: R[];
|
|
15
20
|
}
|
|
16
21
|
export interface CollectionResourceDataDocument<T = StableExistingRecordIdentifier> {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
// the url or cache-key associated with the structured document
|
|
23
|
+
lid?: string;
|
|
24
|
+
links?: Links | PaginationLinks;
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
data: T[];
|
|
27
|
+
included?: T[];
|
|
22
28
|
}
|
|
23
29
|
export type ResourceDataDocument<T = StableExistingRecordIdentifier> = SingleResourceDataDocument<T> | CollectionResourceDataDocument<T>;
|
|
24
30
|
export interface ResourceErrorDocument {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
// the url or cache-key associated with the structured document
|
|
32
|
+
lid?: string;
|
|
33
|
+
links?: Links | PaginationLinks;
|
|
34
|
+
meta?: Meta;
|
|
35
|
+
errors: ApiError[];
|
|
29
36
|
}
|
|
30
37
|
export type ResourceDocument<T = StableExistingRecordIdentifier> = ResourceMetaDocument | SingleResourceDataDocument<T> | CollectionResourceDataDocument<T> | ResourceErrorDocument;
|
|
31
|
-
//# sourceMappingURL=document.d.ts.map
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import type { Link, Meta } from
|
|
1
|
+
import type { Link, Meta } from "./json-api-raw.js";
|
|
2
2
|
export interface ApiError {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
detail?: string;
|
|
6
|
+
links?: {
|
|
7
|
+
about?: Link;
|
|
8
|
+
type?: Link;
|
|
9
|
+
};
|
|
10
|
+
status?: string;
|
|
11
|
+
code?: string;
|
|
12
|
+
source?: {
|
|
13
|
+
pointer: string;
|
|
14
|
+
parameter?: string;
|
|
15
|
+
header?: string;
|
|
16
|
+
};
|
|
17
|
+
meta?: Meta;
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
import type { ArrayValue, ObjectValue } from
|
|
1
|
+
import type { ArrayValue, ObjectValue } from "../json/raw.js";
|
|
2
2
|
export type Meta = ObjectValue;
|
|
3
3
|
export type LinkObject = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
href: string;
|
|
5
|
+
meta?: Meta;
|
|
6
6
|
};
|
|
7
7
|
export type Link = string | LinkObject;
|
|
8
8
|
export interface Links {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
related?: Link | null;
|
|
10
|
+
self?: Link | null;
|
|
11
11
|
}
|
|
12
12
|
export interface PaginationLinks extends Links {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
first?: Link | null;
|
|
14
|
+
last?: Link | null;
|
|
15
|
+
prev?: Link | null;
|
|
16
|
+
next?: Link | null;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
* Serves as a reference to a `Resource` but does not contain
|
|
20
|
+
* any data itself.
|
|
21
|
+
*
|
|
22
|
+
* Used to establish relationship linkages between `Resources` and
|
|
23
|
+
* to address data that may not be available synchronously.
|
|
24
|
+
*
|
|
25
|
+
* [JSON:API Spec](https://jsonapi.org/format/#document-resource-identifier-objects)
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
28
|
export interface ExistingResourceIdentifierObject<T extends string = string> {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
id: string;
|
|
30
|
+
type: T;
|
|
31
|
+
/**
|
|
32
|
+
* While not officially part of the `JSON:API` spec,
|
|
33
|
+
* `ember-data` allows the use of `lid` as a local
|
|
34
|
+
* identifier for a `Resource`.
|
|
35
|
+
*
|
|
36
|
+
* @recommended It is best to include the lid used when creating
|
|
37
|
+
* a new resource if this is the response to a new resource creation,
|
|
38
|
+
* also recommended if this resource type uses secondary indexes.
|
|
39
|
+
*
|
|
40
|
+
* Once a `ResourceIdentifierObject` has been seen by the cache, `lid`
|
|
41
|
+
* should always be present. Only when inbound from the an `API` response
|
|
42
|
+
* is `lid` considered optional.
|
|
43
|
+
*
|
|
44
|
+
* [Identifiers RFC](https://github.com/emberjs/rfcs/blob/main/text/0403-ember-data-identifiers.md#ember-data--identifiers)
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
lid?: string;
|
|
48
|
+
/**
|
|
49
|
+
* While valid in the `JSON:API` spec,
|
|
50
|
+
* `ember-data` ignores `meta` on `ResourceIdentifierObjects`
|
|
51
|
+
*
|
|
52
|
+
* @ignored this property goes un-utilized and will be lost
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
meta?: Meta;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
* Serves as a reference to a resource created on the client
|
|
59
|
+
* but not yet persisted.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
63
|
export interface NewResourceIdentifierObject<T extends string = string> {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Resources newly created on the client _may_
|
|
66
|
+
* not have an `id` available to them prior
|
|
67
|
+
* to completion of their first successful `save`.
|
|
68
|
+
*
|
|
69
|
+
* `id` will be `null` in this case.
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
id: string | null;
|
|
74
|
+
type: T;
|
|
75
|
+
/**
|
|
76
|
+
* Resources newly created on the client _will always_
|
|
77
|
+
* have an `lid` assigned immediately and available.
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
lid: string;
|
|
81
81
|
}
|
|
82
82
|
export interface ResourceIdentifier {
|
|
83
|
-
|
|
83
|
+
lid: string;
|
|
84
84
|
}
|
|
85
85
|
export type ResourceIdentifierObject<T extends string = string> = ResourceIdentifier | ExistingResourceIdentifierObject<T> | NewResourceIdentifierObject<T>;
|
|
86
|
+
// TODO disallow NewResource, make narrowable
|
|
86
87
|
export interface SingleResourceRelationship<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
data?: T | null;
|
|
89
|
+
meta?: Meta;
|
|
90
|
+
links?: Links;
|
|
90
91
|
}
|
|
91
92
|
export interface CollectionResourceRelationship<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
data?: T[];
|
|
94
|
+
meta?: Meta;
|
|
95
|
+
links?: PaginationLinks;
|
|
95
96
|
}
|
|
96
97
|
export type InnerRelationshipDocument<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> = SingleResourceRelationship<T> | CollectionResourceRelationship<T>;
|
|
97
98
|
export type ResourceRelationshipsObject<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> = Record<string, InnerRelationshipDocument<T>>;
|
|
98
99
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
* Contains the data for an existing resource in JSON:API format
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
102
103
|
export interface ExistingResourceObject<T extends string = string> extends ExistingResourceIdentifierObject<T> {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
meta?: Meta;
|
|
105
|
+
attributes?: ObjectValue;
|
|
106
|
+
relationships?: ResourceRelationshipsObject<ExistingResourceIdentifierObject>;
|
|
107
|
+
links?: Links;
|
|
107
108
|
}
|
|
108
109
|
export type NewResourceObject<T extends string = string> = NewResourceIdentifierObject<T> & {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
meta?: Meta;
|
|
111
|
+
attributes?: ObjectValue;
|
|
112
|
+
relationships?: ResourceRelationshipsObject;
|
|
113
|
+
links?: Links;
|
|
113
114
|
};
|
|
114
115
|
export type ResourceObject<T extends string = string> = ExistingResourceObject<T> | NewResourceObject<T>;
|
|
115
116
|
type Document = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
lid?: string;
|
|
118
|
+
meta?: Meta;
|
|
119
|
+
included?: ExistingResourceObject[];
|
|
120
|
+
jsonapi?: ObjectValue;
|
|
121
|
+
links?: Links | PaginationLinks;
|
|
122
|
+
errors?: ArrayValue;
|
|
122
123
|
};
|
|
123
124
|
export type EmptyResourceDocument = Document & {
|
|
124
|
-
|
|
125
|
+
data: null;
|
|
125
126
|
};
|
|
126
127
|
export type SingleResourceDocument<T extends string = string> = Document & {
|
|
127
|
-
|
|
128
|
+
data: ExistingResourceObject<T>;
|
|
128
129
|
};
|
|
129
130
|
export type CollectionResourceDocument<T extends string = string> = Document & {
|
|
130
|
-
|
|
131
|
+
data: ExistingResourceObject<T>[];
|
|
131
132
|
};
|
|
132
133
|
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
* A (RAW) JSON:API Formatted Document.
|
|
135
|
+
*
|
|
136
|
+
* These documents should follow the JSON:API spec but do not
|
|
137
|
+
* have the same level of guarantees as their `spec` counterparts.
|
|
138
|
+
*
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
140
141
|
export type JsonApiDocument<T extends string = string> = EmptyResourceDocument | SingleResourceDocument<T> | CollectionResourceDocument<T>;
|
|
141
142
|
export {};
|
|
142
|
-
//# sourceMappingURL=json-api-raw.d.ts.map
|
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
export declare const RecordStore:
|
|
1
|
+
export declare const RecordStore: "___(unique) Symbol(Store)";
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export declare const Type:
|
|
3
|
+
* Symbol for the name of a resource, transformation
|
|
4
|
+
* or derivation.
|
|
5
|
+
*
|
|
6
|
+
* ### With Resources
|
|
7
|
+
*
|
|
8
|
+
* This is an optional feature that can be used by
|
|
9
|
+
* record implementations to provide a typescript
|
|
10
|
+
* hint for the type of the resource.
|
|
11
|
+
*
|
|
12
|
+
* When used, EmberData/WarpDrive APIs can
|
|
13
|
+
* take advantage of this to provide better type
|
|
14
|
+
* safety and intellisense.
|
|
15
|
+
*
|
|
16
|
+
* ### With Derivations
|
|
17
|
+
*
|
|
18
|
+
* Required for derivations registered with
|
|
19
|
+
* `store.registerDerivation(derivation)`.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* function concat(record: object, options: ObjectValue | null, prop: string): string {}
|
|
23
|
+
* concat[Name] = 'concat';
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ### With Transforms
|
|
27
|
+
*
|
|
28
|
+
* Required for new-style transformations registered
|
|
29
|
+
* with `store.registerTransform(transform)`.
|
|
30
|
+
*
|
|
31
|
+
* For legacy transforms, if not used,
|
|
32
|
+
* `attr<Transform>('name')` will allow any string name.
|
|
33
|
+
* `attr('name')` will always allow any string name.
|
|
34
|
+
*
|
|
35
|
+
* If used, `attr<Transform>('name')` will enforce
|
|
36
|
+
* that the name is the same as the transform name.
|
|
37
|
+
*
|
|
38
|
+
* @type {Symbol}
|
|
39
|
+
*/
|
|
40
|
+
export declare const Type: "___(unique) Symbol($type)";
|
|
41
41
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export declare const ResourceType:
|
|
42
|
+
* Symbol for the type of a resource.
|
|
43
|
+
*
|
|
44
|
+
* This is an optional feature that can be used by
|
|
45
|
+
* record implementations to provide a typescript
|
|
46
|
+
* hint for the type of the resource.
|
|
47
|
+
*
|
|
48
|
+
* When used, EmberData/WarpDrive APIs can
|
|
49
|
+
* take advantage of this to provide better type
|
|
50
|
+
* safety and intellisense.
|
|
51
|
+
*
|
|
52
|
+
* @type {Symbol}
|
|
53
|
+
*/
|
|
54
|
+
export declare const ResourceType: "___(unique) Symbol($type)";
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export declare const TransformName:
|
|
56
|
+
* Symbol for the name of a transform.
|
|
57
|
+
*
|
|
58
|
+
* This is an optional feature that can be used by
|
|
59
|
+
* transform implementations to provide a typescript
|
|
60
|
+
* hint for the name of the transform.
|
|
61
|
+
*
|
|
62
|
+
* If not used, `attr<Transform>('name')` will
|
|
63
|
+
* allow any string name. `attr('name')` will always
|
|
64
|
+
* allow any string name.
|
|
65
|
+
*
|
|
66
|
+
* If used, `attr<Transform>('name')` will enforce
|
|
67
|
+
* that the name is the same as the transform name.
|
|
68
|
+
*
|
|
69
|
+
* @type {Symbol}
|
|
70
|
+
*/
|
|
71
|
+
export declare const TransformName: "___(unique) Symbol($type)";
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export declare const RequestSignature:
|
|
79
|
-
//# sourceMappingURL=symbols.d.ts.map
|
|
73
|
+
* Symbol for use by builders to indicate the return type
|
|
74
|
+
* generic to use for store.request()
|
|
75
|
+
*
|
|
76
|
+
* @type {Symbol}
|
|
77
|
+
*/
|
|
78
|
+
export declare const RequestSignature: "___(unique) Symbol(RequestSignature)";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type WithPartial<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export type WithPartial<
|
|
2
|
+
T,
|
|
3
|
+
K extends keyof T
|
|
4
|
+
> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
5
|
+
export type Mutable<T> = { -readonly [P in keyof T] : T[P] };
|
package/declarations/types.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type { StableRecordIdentifier, ResourceKey } from
|
|
8
|
-
|
|
2
|
+
* This package provides core types, type-utilities, symbols
|
|
3
|
+
* and constants used across the WarpDrive ecosystem.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
export type { StableRecordIdentifier, ResourceKey } from "./types/identifier.js";
|
|
8
|
+
export type { CacheCapabilitiesManager } from "./store/-types/q/cache-capabilities-manager.js";
|
|
9
|
+
export type { ModelSchema } from "./store/-types/q/ds-model.js";
|
|
10
|
+
export type { SchemaService } from "./store/-types/q/schema-service.js";
|
|
11
|
+
export type { BaseFinderOptions, FindRecordOptions, LegacyResourceQuery, QueryOptions, FindAllOptions } from "./store/-types/q/store.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An LRUCache implementation with upsert semantics.
|
|
3
|
+
*
|
|
4
|
+
* This implementation is *not* generic, but focuses on
|
|
5
|
+
* performance tuning for the string transformation cases
|
|
6
|
+
* where the key maps to the value very simply.
|
|
7
|
+
*
|
|
8
|
+
* It takes a work function that should generate a new value
|
|
9
|
+
* for a given key when called. It will be called when the key
|
|
10
|
+
* is not found in the cache.
|
|
11
|
+
*
|
|
12
|
+
* It keeps track of the number of hits, misses, and ejections
|
|
13
|
+
* in DEBUG envs, which is useful for tuning the cache size.
|
|
14
|
+
*
|
|
15
|
+
* This is an internal utility class for use by this module
|
|
16
|
+
* and by `@warp-drive/utilities/string`. It is not intended
|
|
17
|
+
* for use outside of these modules at this time.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare class LRUCache<
|
|
22
|
+
T,
|
|
23
|
+
V
|
|
24
|
+
> {
|
|
25
|
+
size: number;
|
|
26
|
+
state: Map<T, V>;
|
|
27
|
+
doWork: (k: T) => V;
|
|
28
|
+
// debug stats
|
|
29
|
+
_hits: number;
|
|
30
|
+
_misses: number;
|
|
31
|
+
_ejected: number;
|
|
32
|
+
constructor(doWork: (k: T) => V, size?: number);
|
|
33
|
+
get(key: T): V;
|
|
34
|
+
set(key: T, value: V): void;
|
|
35
|
+
clear(): void;
|
|
36
|
+
}
|
|
37
|
+
export declare const STRING_DASHERIZE_CACHE: LRUCache<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* This is an internal utility function that converts a string
|
|
40
|
+
* to a dasherized format. Library consumers should use the
|
|
41
|
+
* re-exported version from `@warp-drive/utilities/string` instead.
|
|
42
|
+
*
|
|
43
|
+
* This version is only in this location to support a deprecated
|
|
44
|
+
* behavior in the core package and will be removed in a future.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare function dasherize(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { macros } from '@warp-drive/build-config/babel-macros';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@warp-drive/build-config/canary-features';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@warp-drive/build-config/debugging';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@warp-drive/build-config/deprecations';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DEBUG, IS_CI, IS_RECORDING, PRODUCTION, SHOULD_RECORD, TESTING } from '@warp-drive/build-config/env';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { assert } from '@warp-drive/build-config/macros';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setConfig } from '@warp-drive/build-config';
|