@warp-drive/core 5.6.0-alpha.15 → 5.6.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/build-config/babel-macros.d.ts +1 -2
- package/declarations/build-config/canary-features.d.ts +1 -2
- package/declarations/build-config/debugging.d.ts +1 -2
- package/declarations/build-config/deprecations.d.ts +1 -2
- package/declarations/build-config/env.d.ts +1 -2
- package/declarations/build-config/macros.d.ts +1 -2
- package/declarations/build-config.d.ts +1 -2
- package/declarations/configure.d.ts +6 -7
- package/declarations/graph/-private/-diff.d.ts +21 -22
- package/declarations/graph/-private/-edge-definition.d.ts +134 -135
- package/declarations/graph/-private/-state.d.ts +93 -7
- package/declarations/graph/-private/-utils.d.ts +18 -13
- package/declarations/graph/-private/coerce-id.d.ts +6 -1
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +15 -4
- package/declarations/graph/-private/edges/collection.d.ts +35 -36
- package/declarations/graph/-private/edges/implicit.d.ts +28 -29
- package/declarations/graph/-private/edges/resource.d.ts +19 -20
- package/declarations/graph/-private/graph.d.ts +83 -48
- package/declarations/graph/-private/normalize-link.d.ts +7 -2
- package/declarations/graph/-private/operations/add-to-related-records.d.ts +3 -4
- package/declarations/graph/-private/operations/merge-identifier.d.ts +2 -3
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts +3 -4
- package/declarations/graph/-private/operations/replace-related-record.d.ts +2 -3
- package/declarations/graph/-private/operations/replace-related-records.d.ts +58 -4
- package/declarations/graph/-private/operations/update-relationship.d.ts +11 -9
- package/declarations/graph/-private.d.ts +9 -10
- package/declarations/index.d.ts +11 -12
- package/declarations/reactive/-private/document.d.ts +143 -144
- package/declarations/reactive/-private/fields/compute.d.ts +31 -28
- package/declarations/reactive/-private/fields/extension.d.ts +2 -3
- package/declarations/reactive/-private/fields/managed-array.d.ts +19 -20
- package/declarations/reactive/-private/fields/managed-object.d.ts +16 -16
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +15 -16
- package/declarations/reactive/-private/hooks.d.ts +3 -4
- package/declarations/reactive/-private/record.d.ts +61 -59
- package/declarations/reactive/-private/schema.d.ts +242 -224
- package/declarations/reactive/-private/symbols.d.ts +26 -1
- package/declarations/reactive/-private.d.ts +1 -2
- package/declarations/reactive.d.ts +4 -5
- 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 +23 -24
- package/declarations/request/-private/future.d.ts +3 -4
- package/declarations/request/-private/manager.d.ts +159 -157
- package/declarations/request/-private/promise-cache.d.ts +21 -13
- package/declarations/request/-private/types.d.ts +124 -124
- package/declarations/request/-private/utils.d.ts +8 -9
- package/declarations/request.d.ts +5 -6
- package/declarations/store/-private/cache-handler/handler.d.ts +57 -52
- package/declarations/store/-private/cache-handler/types.d.ts +95 -96
- package/declarations/store/-private/cache-handler/utils.d.ts +16 -16
- package/declarations/store/-private/caches/cache-utils.d.ts +7 -4
- package/declarations/store/-private/caches/identifier-cache.d.ts +234 -246
- package/declarations/store/-private/caches/instance-cache.d.ts +47 -47
- package/declarations/store/-private/caches/resource-utils.d.ts +3 -4
- package/declarations/store/-private/debug/utils.d.ts +6 -7
- package/declarations/store/-private/default-cache-policy.d.ts +362 -361
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts +154 -159
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +14 -14
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +21 -22
- package/declarations/store/-private/managers/cache-manager.d.ts +440 -425
- package/declarations/store/-private/managers/notification-manager.d.ts +88 -83
- package/declarations/store/-private/managers/record-array-manager.d.ts +89 -90
- package/declarations/store/-private/network/request-cache.d.ts +86 -83
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts +252 -244
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +154 -155
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +148 -149
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +28 -23
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +263 -241
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +253 -223
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +125 -121
- package/declarations/store/-private/record-arrays/many-array.d.ts +180 -184
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +120 -110
- package/declarations/store/-private/store-service.d.ts +1594 -1586
- package/declarations/store/-private/utils/coerce-id.d.ts +6 -1
- package/declarations/store/-private/utils/construct-resource.d.ts +1 -2
- package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/declarations/store/-private.d.ts +31 -28
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +96 -97
- package/declarations/store/-types/q/ds-model.d.ts +17 -18
- package/declarations/store/-types/q/identifier.d.ts +11 -12
- package/declarations/store/-types/q/record-instance.d.ts +16 -17
- package/declarations/store/-types/q/schema-service.d.ts +346 -343
- package/declarations/store/-types/q/store.d.ts +25 -28
- package/declarations/store.d.ts +1 -2
- 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 -32
- 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 -1713
- 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 -11
- package/declarations/utils/string.d.ts +43 -40
- package/dist/graph/-private.js +1 -1
- package/dist/{handler-D1C3Innj.js → handler-C2T-IyJK.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.js +42 -73
- package/dist/{request-state-CCOJIj5i.js → request-state-CjLph1LP.js} +275 -261
- package/dist/store/-private.js +2 -2
- package/dist/{symbols-epHW0Vm9.js → symbols-SIstXMLI.js} +1 -1
- package/dist/types/-private.js +1 -1
- package/package.json +4 -4
- package/declarations/build-config/babel-macros.d.ts.map +0 -1
- package/declarations/build-config/canary-features.d.ts.map +0 -1
- package/declarations/build-config/debugging.d.ts.map +0 -1
- package/declarations/build-config/deprecations.d.ts.map +0 -1
- package/declarations/build-config/env.d.ts.map +0 -1
- package/declarations/build-config/macros.d.ts.map +0 -1
- package/declarations/build-config.d.ts.map +0 -1
- package/declarations/configure.d.ts.map +0 -1
- package/declarations/graph/-private/-diff.d.ts.map +0 -1
- package/declarations/graph/-private/-edge-definition.d.ts.map +0 -1
- package/declarations/graph/-private/-state.d.ts.map +0 -1
- package/declarations/graph/-private/-utils.d.ts.map +0 -1
- package/declarations/graph/-private/coerce-id.d.ts.map +0 -1
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts.map +0 -1
- package/declarations/graph/-private/edges/collection.d.ts.map +0 -1
- package/declarations/graph/-private/edges/implicit.d.ts.map +0 -1
- package/declarations/graph/-private/edges/resource.d.ts.map +0 -1
- package/declarations/graph/-private/graph.d.ts.map +0 -1
- package/declarations/graph/-private/normalize-link.d.ts.map +0 -1
- package/declarations/graph/-private/operations/add-to-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/merge-identifier.d.ts.map +0 -1
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/replace-related-record.d.ts.map +0 -1
- package/declarations/graph/-private/operations/replace-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/update-relationship.d.ts.map +0 -1
- package/declarations/graph/-private.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/reactive/-private/document.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/compute.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/extension.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/managed-array.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/managed-object.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/many-array-manager.d.ts.map +0 -1
- package/declarations/reactive/-private/hooks.d.ts.map +0 -1
- package/declarations/reactive/-private/record.d.ts.map +0 -1
- package/declarations/reactive/-private/schema.d.ts.map +0 -1
- package/declarations/reactive/-private/symbols.d.ts.map +0 -1
- package/declarations/reactive/-private.d.ts.map +0 -1
- package/declarations/reactive.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/store/-private/cache-handler/handler.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/types.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/utils.d.ts.map +0 -1
- package/declarations/store/-private/caches/cache-utils.d.ts.map +0 -1
- package/declarations/store/-private/caches/identifier-cache.d.ts.map +0 -1
- package/declarations/store/-private/caches/instance-cache.d.ts.map +0 -1
- package/declarations/store/-private/caches/resource-utils.d.ts.map +0 -1
- package/declarations/store/-private/debug/utils.d.ts.map +0 -1
- package/declarations/store/-private/default-cache-policy.d.ts.map +0 -1
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts.map +0 -1
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/cache-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/notification-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/record-array-manager.d.ts.map +0 -1
- package/declarations/store/-private/network/request-cache.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/request-state.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/identifier-array.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/many-array.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
- package/declarations/store/-private/store-service.d.ts.map +0 -1
- package/declarations/store/-private/store-service.type-test.d.ts +0 -2
- package/declarations/store/-private/store-service.type-test.d.ts.map +0 -1
- package/declarations/store/-private/utils/coerce-id.d.ts.map +0 -1
- package/declarations/store/-private/utils/construct-resource.d.ts.map +0 -1
- package/declarations/store/-private/utils/is-non-empty-string.d.ts.map +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts.map +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts.map +0 -1
- package/declarations/store/-private.d.ts.map +0 -1
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts.map +0 -1
- package/declarations/store/-types/q/ds-model.d.ts.map +0 -1
- package/declarations/store/-types/q/identifier.d.ts.map +0 -1
- package/declarations/store/-types/q/promise-proxies.d.ts +0 -2
- package/declarations/store/-types/q/promise-proxies.d.ts.map +0 -1
- package/declarations/store/-types/q/record-data-json-api.d.ts +0 -31
- package/declarations/store/-types/q/record-data-json-api.d.ts.map +0 -1
- package/declarations/store/-types/q/record-instance.d.ts.map +0 -1
- package/declarations/store/-types/q/schema-service.d.ts.map +0 -1
- package/declarations/store/-types/q/store.d.ts.map +0 -1
- package/declarations/store.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/declarations/utils/string.d.ts.map +0 -1
- package/dist/build-config/babel-macros.js.map +0 -1
- package/dist/build-config/canary-features.js.map +0 -1
- package/dist/build-config/debugging.js.map +0 -1
- package/dist/build-config/deprecations.js.map +0 -1
- package/dist/build-config/env.js.map +0 -1
- package/dist/build-config/macros.js.map +0 -1
- package/dist/build-config.js.map +0 -1
- package/dist/configure-B48bFHOl.js.map +0 -1
- package/dist/configure.js.map +0 -1
- package/dist/context-COmAnXUQ.js.map +0 -1
- package/dist/graph/-private.js.map +0 -1
- package/dist/handler-D1C3Innj.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/reactive/-private.js.map +0 -1
- package/dist/reactive.js.map +0 -1
- package/dist/request-state-CCOJIj5i.js.map +0 -1
- package/dist/request.js.map +0 -1
- package/dist/store/-private.js.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/symbols-epHW0Vm9.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
- package/dist/utils/string.js.map +0 -1
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { macros } from
|
|
2
|
-
//# sourceMappingURL=babel-macros.d.ts.map
|
|
1
|
+
export { macros } from "@warp-drive/build-config/babel-macros";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
//# sourceMappingURL=canary-features.d.ts.map
|
|
1
|
+
export * from "@warp-drive/build-config/canary-features";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
//# sourceMappingURL=debugging.d.ts.map
|
|
1
|
+
export * from "@warp-drive/build-config/debugging";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
//# sourceMappingURL=deprecations.d.ts.map
|
|
1
|
+
export * from "@warp-drive/build-config/deprecations";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { DEBUG, PRODUCTION, IS_CI, IS_RECORDING, SHOULD_RECORD, TESTING } from
|
|
2
|
-
//# sourceMappingURL=env.d.ts.map
|
|
1
|
+
export { DEBUG, PRODUCTION, IS_CI, IS_RECORDING, SHOULD_RECORD, TESTING } from "@warp-drive/build-config/env";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { assert } from
|
|
2
|
-
//# sourceMappingURL=macros.d.ts.map
|
|
1
|
+
export { assert } from "@warp-drive/build-config/macros";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { setConfig } from
|
|
2
|
-
//# sourceMappingURL=build-config.d.ts.map
|
|
1
|
+
export { setConfig } from "@warp-drive/build-config";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { setupSignals, type HooksOptions, type SignalHooks } from
|
|
8
|
-
//# sourceMappingURL=configure.d.ts.map
|
|
2
|
+
* Provides a configuration API for the reactivity system
|
|
3
|
+
* that WarpDrive should use.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
export { setupSignals, type HooksOptions, type SignalHooks } from "./store/-private/new-core-tmp/reactivity/configure.js";
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import type { StableRecordIdentifier } from
|
|
2
|
-
import type { CollectionEdge } from
|
|
3
|
-
import type { ResourceEdge } from
|
|
4
|
-
import type { Graph } from
|
|
1
|
+
import type { StableRecordIdentifier } from "../../types/identifier.js";
|
|
2
|
+
import type { CollectionEdge } from "./edges/collection.js";
|
|
3
|
+
import type { ResourceEdge } from "./edges/resource.js";
|
|
4
|
+
import type { Graph } from "./graph.js";
|
|
5
5
|
type Diff<T> = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
add: Set<T>;
|
|
7
|
+
del: Set<T>;
|
|
8
|
+
finalState: T[];
|
|
9
|
+
finalSet: Set<T>;
|
|
10
|
+
changed: boolean;
|
|
11
|
+
remoteOrderChanged: boolean;
|
|
12
12
|
};
|
|
13
13
|
export declare function diffCollection(finalState: StableRecordIdentifier[], relationship: CollectionEdge, onAdd: (v: StableRecordIdentifier) => void, onDel: (v: StableRecordIdentifier) => void): Diff<StableRecordIdentifier>;
|
|
14
14
|
export declare function computeLocalState(storage: CollectionEdge): StableRecordIdentifier[];
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
* A function which attempts to add a value to the local state of a collection
|
|
17
|
+
* relationship, and returns true if the value was added, or false if it was
|
|
18
|
+
* already present.
|
|
19
|
+
*
|
|
20
|
+
* It will not generate a notification, will not update the relationships to dirty,
|
|
21
|
+
* and will not update the inverse relationships, making it suitable for use as
|
|
22
|
+
* an internal util to perform the just the addition to a specific side of a
|
|
23
|
+
* relationship.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
27
|
export declare function _add(graph: Graph, record: StableRecordIdentifier, relationship: CollectionEdge, value: StableRecordIdentifier, index: number | null, isRemote: boolean): boolean;
|
|
28
28
|
export declare function _remove(graph: Graph, record: StableRecordIdentifier, relationship: CollectionEdge, value: StableRecordIdentifier, index: number | null, isRemote: boolean): boolean;
|
|
29
29
|
export declare function _removeLocal(relationship: CollectionEdge, value: StableRecordIdentifier): boolean;
|
|
30
30
|
export declare function _removeRemote(relationship: CollectionEdge, value: StableRecordIdentifier): boolean;
|
|
31
31
|
export declare function rollbackRelationship(graph: Graph, identifier: StableRecordIdentifier, field: string, relationship: CollectionEdge | ResourceEdge): void;
|
|
32
32
|
export {};
|
|
33
|
-
//# sourceMappingURL=-diff.d.ts.map
|
|
@@ -1,149 +1,148 @@
|
|
|
1
|
-
import type { StableRecordIdentifier } from
|
|
2
|
-
import type { CollectionField, FieldSchema, LegacyBelongsToField, LegacyHasManyField, ResourceField } from
|
|
3
|
-
import type { Graph } from
|
|
1
|
+
import type { StableRecordIdentifier } from "../../types.js";
|
|
2
|
+
import type { CollectionField, FieldSchema, LegacyBelongsToField, LegacyHasManyField, ResourceField } from "../../types/schema/fields.js";
|
|
3
|
+
import type { Graph } from "./graph.js";
|
|
4
4
|
export type EdgeCache = Record<string, Record<string, EdgeDefinition | null>>;
|
|
5
5
|
export type RelationshipField = LegacyBelongsToField | LegacyHasManyField | ResourceField | CollectionField;
|
|
6
|
-
export type RelationshipFieldKind = RelationshipField[
|
|
7
|
-
export type CollectionKind =
|
|
8
|
-
export type ResourceKind =
|
|
6
|
+
export type RelationshipFieldKind = RelationshipField["kind"];
|
|
7
|
+
export type CollectionKind = "hasMany" | "collection";
|
|
8
|
+
export type ResourceKind = "belongsTo" | "resource";
|
|
9
9
|
export declare const RELATIONSHIP_KINDS: string[];
|
|
10
10
|
export declare function isLegacyField(field: FieldSchema): field is LegacyBelongsToField | LegacyHasManyField;
|
|
11
11
|
export declare function isRelationshipField(field: FieldSchema): field is RelationshipField;
|
|
12
12
|
export declare function temporaryConvertToLegacy(field: ResourceField | CollectionField): LegacyBelongsToField | LegacyHasManyField;
|
|
13
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
14
|
+
*
|
|
15
|
+
* Given RHS (Right Hand Side)
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* class User extends Model {
|
|
19
|
+
* @hasMany('animal', { async: false, inverse: 'owner' }) pets;
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Given LHS (Left Hand Side)
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* class Animal extends Model {
|
|
27
|
+
* @belongsTo('user', { async: false, inverse: 'pets' }) owner;
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* The UpgradedMeta for the RHS would be:
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* {
|
|
35
|
+
* kind: 'hasMany',
|
|
36
|
+
* key: 'pets',
|
|
37
|
+
* type: 'animal',
|
|
38
|
+
* isAsync: false,
|
|
39
|
+
* isImplicit: false,
|
|
40
|
+
* isCollection: true,
|
|
41
|
+
* isPolymorphic: false,
|
|
42
|
+
* inverseKind: 'belongsTo',
|
|
43
|
+
* inverseKey: 'owner',
|
|
44
|
+
* inverseType: 'user',
|
|
45
|
+
* inverseIsAsync: false,
|
|
46
|
+
* inverseIsImplicit: false,
|
|
47
|
+
* inverseIsCollection: false,
|
|
48
|
+
* inverseIsPolymorphic: false,
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* The UpgradeMeta for the LHS would be:
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* {
|
|
56
|
+
* kind: 'belongsTo',
|
|
57
|
+
* key: 'owner',
|
|
58
|
+
* type: 'user',
|
|
59
|
+
* isAsync: false,
|
|
60
|
+
* isImplicit: false,
|
|
61
|
+
* isCollection: false,
|
|
62
|
+
* isPolymorphic: false,
|
|
63
|
+
* inverseKind: 'hasMany',
|
|
64
|
+
* inverseKey: 'pets',
|
|
65
|
+
* inverseType: 'animal',
|
|
66
|
+
* inverseIsAsync: false,
|
|
67
|
+
* inverseIsImplicit: false,
|
|
68
|
+
* inverseIsCollection: true,
|
|
69
|
+
* inverseIsPolymorphic: false,
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
*
|
|
74
|
+
* @class UpgradedMeta
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
77
|
export interface UpgradedMeta {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
78
|
+
kind: "implicit" | RelationshipFieldKind;
|
|
79
|
+
/**
|
|
80
|
+
* The field name on `this` record
|
|
81
|
+
*
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
key: string;
|
|
85
|
+
/**
|
|
86
|
+
* The `type` of the related record
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
type: string;
|
|
91
|
+
isAsync: boolean;
|
|
92
|
+
isImplicit: boolean;
|
|
93
|
+
isCollection: boolean;
|
|
94
|
+
isPolymorphic: boolean;
|
|
95
|
+
resetOnRemoteUpdate: boolean;
|
|
96
|
+
isLinksMode: boolean;
|
|
97
|
+
inverseKind: "implicit" | RelationshipFieldKind;
|
|
98
|
+
/**
|
|
99
|
+
* The field name on the opposing record
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
inverseKey: string;
|
|
103
|
+
/**
|
|
104
|
+
* The `type` of `this` record
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
inverseType: string;
|
|
108
|
+
inverseIsAsync: boolean;
|
|
109
|
+
inverseIsImplicit: boolean;
|
|
110
|
+
inverseIsCollection: boolean;
|
|
111
|
+
inverseIsPolymorphic: boolean;
|
|
112
|
+
inverseIsLinksMode: boolean;
|
|
113
113
|
}
|
|
114
114
|
export interface EdgeDefinition {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
115
|
+
lhs_key: string;
|
|
116
|
+
lhs_modelNames: string[];
|
|
117
|
+
lhs_baseModelName: string;
|
|
118
|
+
lhs_relationshipName: string;
|
|
119
|
+
lhs_definition: UpgradedMeta;
|
|
120
|
+
lhs_isPolymorphic: boolean;
|
|
121
|
+
rhs_key: string;
|
|
122
|
+
rhs_modelNames: string[];
|
|
123
|
+
rhs_baseModelName: string;
|
|
124
|
+
rhs_relationshipName: string;
|
|
125
|
+
rhs_definition: UpgradedMeta | null;
|
|
126
|
+
rhs_isPolymorphic: boolean;
|
|
127
|
+
hasInverse: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether this relationship points back at the same type.
|
|
130
|
+
*
|
|
131
|
+
* If the relationship is polymorphic, this will be true if
|
|
132
|
+
* it points back at the same abstract type.
|
|
133
|
+
*
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
isSelfReferential: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* If this is a reflexive relationship, this is true
|
|
139
|
+
* if the relationship also points back at the same
|
|
140
|
+
* field.
|
|
141
|
+
*
|
|
142
|
+
* @internal
|
|
143
|
+
*/
|
|
144
|
+
isReflexive: boolean;
|
|
145
145
|
}
|
|
146
146
|
export declare function isLHS(info: EdgeDefinition, type: string, key: string): boolean;
|
|
147
147
|
export declare function isRHS(info: EdgeDefinition, type: string, key: string): boolean;
|
|
148
148
|
export declare function upgradeDefinition(graph: Graph, identifier: StableRecordIdentifier, propertyName: string, isImplicit?: boolean): EdgeDefinition | null;
|
|
149
|
-
//# sourceMappingURL=-edge-definition.d.ts.map
|
|
@@ -1,10 +1,96 @@
|
|
|
1
1
|
export interface RelationshipState {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
/*
|
|
3
|
+
This flag indicates whether we should consider the content
|
|
4
|
+
of this relationship "known".
|
|
5
|
+
|
|
6
|
+
If we have no relationship knowledge, and the relationship
|
|
7
|
+
is `async`, we will attempt to fetch the relationship on
|
|
8
|
+
access if it is also stale.
|
|
9
|
+
|
|
10
|
+
Snapshot uses this to tell the difference between unknown
|
|
11
|
+
(`undefined`) or empty (`null`). The reason for this is that
|
|
12
|
+
we wouldn't want to serialize unknown relationships as `null`
|
|
13
|
+
as that might overwrite remote state.
|
|
14
|
+
|
|
15
|
+
All relationships for a newly created (`store.createRecord()`) are
|
|
16
|
+
considered known (`hasReceivedData === true`).
|
|
17
|
+
|
|
18
|
+
true when
|
|
19
|
+
=> we receive a push with either new data or explicit empty (`[]` or `null`)
|
|
20
|
+
=> the relationship is a belongsTo and we have received data from
|
|
21
|
+
the other side.
|
|
22
|
+
|
|
23
|
+
false when
|
|
24
|
+
=> we have received no signal about what data belongs in this relationship
|
|
25
|
+
=> the relationship is a hasMany and we have only received data from
|
|
26
|
+
the other side.
|
|
27
|
+
*/
|
|
28
|
+
hasReceivedData: boolean;
|
|
29
|
+
/*
|
|
30
|
+
Flag that indicates whether an empty relationship is explicitly empty
|
|
31
|
+
(signaled by push giving us an empty array or null relationship)
|
|
32
|
+
e.g. an API response has told us that this relationship is empty.
|
|
33
|
+
|
|
34
|
+
Thus far, it does not appear that we actually need this flag; however,
|
|
35
|
+
@runspired has found it invaluable when debugging relationship tests
|
|
36
|
+
to determine whether (and why if so) we are in an incorrect state.
|
|
37
|
+
|
|
38
|
+
true when
|
|
39
|
+
=> we receive a push with explicit empty (`[]` or `null`)
|
|
40
|
+
=> we have received no signal about what data belongs in this relationship
|
|
41
|
+
=> on initial create (as no signal is known yet)
|
|
42
|
+
|
|
43
|
+
false at all other times
|
|
44
|
+
*/
|
|
45
|
+
isEmpty: boolean;
|
|
46
|
+
/*
|
|
47
|
+
This flag indicates whether we should
|
|
48
|
+
re-fetch the relationship the next time
|
|
49
|
+
it is accessed.
|
|
50
|
+
|
|
51
|
+
The difference between this flag and `shouldForceReload`
|
|
52
|
+
is in how we treat the presence of partially missing data:
|
|
53
|
+
- for a forced reload, we will reload the link or EVERY record
|
|
54
|
+
- for a stale reload, we will reload the link (if present) else only MISSING records
|
|
55
|
+
|
|
56
|
+
Ideally these flags could be merged, but because we don't give the
|
|
57
|
+
request layer the option of deciding how to resolve the data being queried
|
|
58
|
+
we are forced to differentiate for now.
|
|
59
|
+
|
|
60
|
+
It is also possible for a relationship to remain stale after a forced reload; however,
|
|
61
|
+
in this case `state.hasFailedLoadAttempt` ought to be `true`.
|
|
62
|
+
|
|
63
|
+
false when
|
|
64
|
+
=> cache.isNew(identifier) on initial setup
|
|
65
|
+
=> a previously triggered request has resolved
|
|
66
|
+
=> we get relationship data via push
|
|
67
|
+
|
|
68
|
+
true when
|
|
69
|
+
=> !cache.isNew(identifier) on initial setup
|
|
70
|
+
=> an inverse has been unloaded
|
|
71
|
+
=> we get a new link for the relationship
|
|
72
|
+
|
|
73
|
+
TODO @runspired unskip the acceptance tests and fix these flags
|
|
74
|
+
*/
|
|
75
|
+
isStale: boolean;
|
|
76
|
+
hasFailedLoadAttempt: boolean;
|
|
77
|
+
/*
|
|
78
|
+
This flag forces fetch. `true` for a single request once `reload()`
|
|
79
|
+
has been called `false` at all other times.
|
|
80
|
+
*/
|
|
81
|
+
shouldForceReload: boolean;
|
|
82
|
+
/*
|
|
83
|
+
This flag indicates whether we should
|
|
84
|
+
**partially** re-fetch the relationship the
|
|
85
|
+
next time it is accessed.
|
|
86
|
+
|
|
87
|
+
false when
|
|
88
|
+
=> initial setup
|
|
89
|
+
=> a previously triggered request has resolved
|
|
90
|
+
|
|
91
|
+
true when
|
|
92
|
+
=> an inverse has been unloaded
|
|
93
|
+
*/
|
|
94
|
+
hasDematerializedInverse: boolean;
|
|
8
95
|
}
|
|
9
96
|
export declare function createState(): RelationshipState;
|
|
10
|
-
//# sourceMappingURL=-state.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { Store } from
|
|
2
|
-
import type { CacheCapabilitiesManager } from
|
|
3
|
-
import type { UpdateResourceRelationshipOperation } from
|
|
4
|
-
import type { UpdateRelationshipOperation } from
|
|
5
|
-
import type { StableRecordIdentifier } from
|
|
6
|
-
import type { ResourceIdentifierObject } from
|
|
7
|
-
import type { UpgradedMeta } from
|
|
8
|
-
import type { CollectionEdge } from
|
|
9
|
-
import type { ImplicitEdge } from
|
|
10
|
-
import type { ResourceEdge } from
|
|
11
|
-
import type { Graph, GraphEdge } from
|
|
1
|
+
import type { Store } from "../../store/-private.js";
|
|
2
|
+
import type { CacheCapabilitiesManager } from "../../types.js";
|
|
3
|
+
import type { UpdateResourceRelationshipOperation } from "../../types/cache/operations.js";
|
|
4
|
+
import type { UpdateRelationshipOperation } from "../../types/graph.js";
|
|
5
|
+
import type { StableRecordIdentifier } from "../../types/identifier.js";
|
|
6
|
+
import type { ResourceIdentifierObject } from "../../types/spec/json-api-raw.js";
|
|
7
|
+
import type { UpgradedMeta } from "./-edge-definition.js";
|
|
8
|
+
import type { CollectionEdge } from "./edges/collection.js";
|
|
9
|
+
import type { ImplicitEdge } from "./edges/implicit.js";
|
|
10
|
+
import type { ResourceEdge } from "./edges/resource.js";
|
|
11
|
+
import type { Graph, GraphEdge } from "./graph.js";
|
|
12
12
|
export declare function getStore(wrapper: CacheCapabilitiesManager | {
|
|
13
|
-
|
|
13
|
+
_store: Store;
|
|
14
14
|
}): Store;
|
|
15
15
|
export declare function expandingGet<T>(cache: Record<string, Record<string, T>>, key1: string, key2: string): T | undefined;
|
|
16
16
|
export declare function expandingSet<T>(cache: Record<string, Record<string, T>>, key1: string, key2: string, value: T): void;
|
|
@@ -20,7 +20,12 @@ export declare function isBelongsTo(relationship: GraphEdge): relationship is Re
|
|
|
20
20
|
export declare function isImplicit(relationship: GraphEdge): relationship is ImplicitEdge;
|
|
21
21
|
export declare function isHasMany(relationship: GraphEdge): relationship is CollectionEdge;
|
|
22
22
|
export declare function forAllRelatedIdentifiers(rel: GraphEdge, cb: (identifier: StableRecordIdentifier) => void): void;
|
|
23
|
+
/*
|
|
24
|
+
Removes the given identifier from BOTH remote AND local state.
|
|
25
|
+
|
|
26
|
+
This method is useful when either a deletion or a rollback on a new record
|
|
27
|
+
needs to entirely purge itself from an inverse relationship.
|
|
28
|
+
*/
|
|
23
29
|
export declare function removeIdentifierCompletelyFromRelationship(graph: Graph, relationship: GraphEdge, value: StableRecordIdentifier, silenceNotifications?: boolean): void;
|
|
24
30
|
export declare function notifyChange(graph: Graph, relationship: CollectionEdge | ResourceEdge): void;
|
|
25
31
|
export declare function assertRelationshipData(store: Store, identifier: StableRecordIdentifier, data: ResourceIdentifierObject, meta: UpgradedMeta): void;
|
|
26
|
-
//# sourceMappingURL=-utils.d.ts.map
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
// Used by the store to normalize IDs entering the store. Despite the fact
|
|
2
|
+
// that developers may provide IDs as numbers (e.g., `store.findRecord('person', 1)`),
|
|
3
|
+
// it is important that internally we use strings, since IDs may be serialized
|
|
4
|
+
// and lose type information. For example, Ember's router may put a record's
|
|
5
|
+
// ID into the URL, and if we later try to deserialize that URL and find the
|
|
6
|
+
// corresponding record, we will not know if it is a string or a number.
|
|
1
7
|
type Coercable = string | number | boolean | null | undefined | symbol;
|
|
2
8
|
export declare function coerceId(id: Coercable): string | null;
|
|
3
9
|
export declare function ensureStringId(id: Coercable): string;
|
|
4
10
|
export {};
|
|
5
|
-
//# sourceMappingURL=coerce-id.d.ts.map
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import type { CacheCapabilitiesManager } from
|
|
2
|
-
import type { StableRecordIdentifier } from
|
|
3
|
-
import { type UpgradedMeta } from
|
|
1
|
+
import type { CacheCapabilitiesManager } from "../../../types.js";
|
|
2
|
+
import type { StableRecordIdentifier } from "../../../types/identifier.js";
|
|
3
|
+
import { type UpgradedMeta } from "../-edge-definition.js";
|
|
4
|
+
/*
|
|
5
|
+
Assert that `addedRecord` has a valid type so it can be added to the
|
|
6
|
+
relationship of the `record`.
|
|
7
|
+
|
|
8
|
+
The assert basically checks if the `addedRecord` can be added to the
|
|
9
|
+
relationship (specified via `relationshipMeta`) of the `record`.
|
|
10
|
+
|
|
11
|
+
This utility should only be used internally, as both record parameters must
|
|
12
|
+
be stable record identifiers and the `relationshipMeta` needs to be the meta
|
|
13
|
+
information about the relationship, retrieved via
|
|
14
|
+
`record.relationshipFor(key)`.
|
|
15
|
+
*/
|
|
4
16
|
declare let assertPolymorphicType: (parentIdentifier: StableRecordIdentifier, parentDefinition: UpgradedMeta, addedIdentifier: StableRecordIdentifier, store: CacheCapabilitiesManager) => void;
|
|
5
17
|
declare let assertInheritedSchema: (definition: UpgradedMeta, type: string) => void;
|
|
6
18
|
export { assertPolymorphicType, assertInheritedSchema };
|
|
7
|
-
//# sourceMappingURL=assert-polymorphic-type.d.ts.map
|