@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,35 +1,32 @@
|
|
|
1
|
-
import type { Value } from
|
|
2
|
-
import type { Includes, TypedRecordInstance } from
|
|
1
|
+
import type { Value } from "../../../types/json/raw.js";
|
|
2
|
+
import type { Includes, TypedRecordInstance } from "../../../types/record.js";
|
|
3
3
|
export interface BaseFinderOptions<T = unknown> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
reload?: boolean;
|
|
5
|
+
backgroundReload?: boolean;
|
|
6
|
+
include?: T extends TypedRecordInstance ? Includes<T>[] : string | string[];
|
|
7
|
+
adapterOptions?: Record<string, unknown>;
|
|
8
8
|
}
|
|
9
9
|
export interface FindRecordOptions<T = unknown> extends BaseFinderOptions<T> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Data to preload into the store before the request is made.
|
|
12
|
+
* This feature is *highly* discouraged and has no corresponding
|
|
13
|
+
* feature when using builders and handlers.
|
|
14
|
+
*
|
|
15
|
+
* Excepting relationships: the data should be in the form of a
|
|
16
|
+
* JSON object where the keys are fields on the record and the value
|
|
17
|
+
* is the raw value to be added to the cache.
|
|
18
|
+
*
|
|
19
|
+
* Relationships can either be provided as string IDs from which
|
|
20
|
+
* an identifier will be built base upon the relationship's expected
|
|
21
|
+
* resource type, or be record instances from which the identifier
|
|
22
|
+
* will be extracted.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
preload?: Record<string, Value>;
|
|
26
26
|
}
|
|
27
|
-
export type QueryOptions = {
|
|
28
|
-
[K in string | 'adapterOptions']?: K extends 'adapterOptions' ? Record<string, unknown> : unknown;
|
|
29
|
-
};
|
|
27
|
+
export type QueryOptions = { [K in string | "adapterOptions"]? : K extends "adapterOptions" ? Record<string, unknown> : unknown };
|
|
30
28
|
export type FindAllOptions<T = unknown> = BaseFinderOptions<T>;
|
|
31
29
|
export type LegacyResourceQuery<T = unknown> = {
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
include?: T extends TypedRecordInstance ? Includes<T>[] : string | string[];
|
|
31
|
+
[key: string]: Value | undefined;
|
|
34
32
|
};
|
|
35
|
-
//# sourceMappingURL=store.d.ts.map
|
package/declarations/store.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { DefaultCachePolicy, type PolicyConfig, type CacheControlValue, parseCacheControl
|
|
2
|
-
//# sourceMappingURL=store.d.ts.map
|
|
1
|
+
export { DefaultCachePolicy, type PolicyConfig, type CacheControlValue, parseCacheControl } from "./store/-private/default-cache-policy.js";
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
type UniversalTransientKey =
|
|
2
|
-
type UniversalKey = `(transient) ${UniversalTransientKey}` |
|
|
3
|
-
type TransientKey =
|
|
4
|
-
type GlobalKey = `(transient) ${TransientKey}` |
|
|
1
|
+
type UniversalTransientKey = "REQ_ID";
|
|
2
|
+
type UniversalKey = `(transient) ${UniversalTransientKey}` | "RequestMap" | "PromiseCache" | "RequestCache" | "SkipCache" | "EnableHydration" | "WarpDriveRuntimeConfig";
|
|
3
|
+
type TransientKey = "transactionRef" | "configuredGenerationMethod" | "configuredUpdateMethod" | "configuredForgetMethod" | "configuredResetMethod" | "configuredKeyInfoMethod" | "signalHooks";
|
|
4
|
+
type GlobalKey = `(transient) ${TransientKey}` | "AdapterError" | "InvalidError" | "TimeoutError" | "AbortError" | "UnauthorizedError" | "ForbiddenError" | "NotFoundError" | "ConflictError" | "ServerError" | "#{}" | "#[]" | "Signals" | "AvailableShims" | "FAKE_ARR" | "#source" | "#update" | "#notify" | "IS_COLLECTION" | "Touching" | "RequestPromise" | "SaveOp" | "LEGACY_SUPPORT" | "LegacySupport" | "Graphs" | "IS_FROZEN" | "IS_CACHE_HANDLER" | "CONFIG" | "DEBUG_MAP" | "IDENTIFIERS" | "DOCUMENTS" | "CacheForIdentifierCache" | "RecordCache" | "StoreMap" | "Store" | "$type" | "TransformName" | "RequestSignature" | "IS_FUTURE" | "DOC" | "ManagedArrayMap" | "ManagedObjectMap" | "Support" | "SOURCE" | "MUTATE" | "Destroy" | "Identifier" | "Editable" | "EmbeddedPath" | "EmbeddedField" | "Parent" | "Checkout" | "Legacy";
|
|
5
5
|
type UniqueSymbol<T extends string> = `___(unique) Symbol(${T})`;
|
|
6
|
-
type UniqueSymbolOr<
|
|
7
|
-
|
|
6
|
+
type UniqueSymbolOr<
|
|
7
|
+
T,
|
|
8
|
+
K extends string
|
|
9
|
+
> = T extends symbol ? UniqueSymbol<K> : T;
|
|
10
|
+
export declare function getOrSetGlobal<
|
|
11
|
+
T,
|
|
12
|
+
K extends GlobalKey
|
|
13
|
+
>(key: K, value: T): UniqueSymbolOr<T, K>;
|
|
8
14
|
export declare function peekTransient<T>(key: TransientKey): T | null;
|
|
9
15
|
export declare function setTransient<T>(key: TransientKey, value: T): T;
|
|
10
|
-
export declare function getOrSetUniversal<
|
|
16
|
+
export declare function getOrSetUniversal<
|
|
17
|
+
T,
|
|
18
|
+
K extends UniversalKey
|
|
19
|
+
>(key: K, value: T): UniqueSymbolOr<T, K>;
|
|
11
20
|
export declare function peekUniversalTransient<T>(key: UniversalTransientKey): T | null;
|
|
12
21
|
export declare function setUniversalTransient<T>(key: UniversalTransientKey, value: T): T;
|
|
13
22
|
export {};
|
|
14
|
-
//# sourceMappingURL=-private.d.ts.map
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
// The ResourceBlob is an opaque type that must
|
|
2
|
+
// satisfy two constraints.
|
|
3
|
+
// (1) it should be possible for the IdentifierCache
|
|
4
|
+
// to be able to generate a RecordIdentifier for it
|
|
5
|
+
// whether by default or due to configuration.
|
|
6
|
+
// (2) it should be in a format expected by the Cache.
|
|
7
|
+
// This format is Cache declared.
|
|
8
|
+
//
|
|
9
|
+
// this Opaqueness allows arbitrary storage of any
|
|
10
|
+
// serializable / transferable state including such things
|
|
11
|
+
// as Buffers and Strings.
|
|
1
12
|
export type ResourceBlob = unknown;
|
|
2
|
-
//# sourceMappingURL=aliases.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { StableDocumentIdentifier, StableRecordIdentifier } from
|
|
1
|
+
import type { StableDocumentIdentifier, StableRecordIdentifier } from "../identifier.js";
|
|
2
2
|
export interface Change {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
identifier: StableRecordIdentifier | StableDocumentIdentifier;
|
|
4
|
+
op: "upsert" | "remove";
|
|
5
|
+
patch?: unknown;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=change.d.ts.map
|
|
@@ -1,39 +1,62 @@
|
|
|
1
|
-
import type { StableRecordIdentifier } from
|
|
1
|
+
import type { StableRecordIdentifier } from "../identifier.js";
|
|
2
2
|
export interface AddToResourceRelationshipMutation {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
op: "add";
|
|
4
|
+
record: StableRecordIdentifier;
|
|
5
|
+
field: string;
|
|
6
|
+
value: StableRecordIdentifier | StableRecordIdentifier[];
|
|
7
|
+
index?: number;
|
|
8
8
|
}
|
|
9
9
|
export interface RemoveFromResourceRelationshipMutation {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
op: "remove";
|
|
11
|
+
record: StableRecordIdentifier;
|
|
12
|
+
field: string;
|
|
13
|
+
value: StableRecordIdentifier | StableRecordIdentifier[];
|
|
14
|
+
index?: number;
|
|
15
15
|
}
|
|
16
16
|
export interface ReplaceRelatedRecordMutation {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
op: "replaceRelatedRecord";
|
|
18
|
+
record: StableRecordIdentifier;
|
|
19
|
+
field: string;
|
|
20
|
+
// never null if field is a collection
|
|
21
|
+
value: StableRecordIdentifier | null;
|
|
22
|
+
// if field is a collection,
|
|
23
|
+
// the value we are swapping with
|
|
24
|
+
prior?: StableRecordIdentifier;
|
|
25
|
+
index?: number;
|
|
23
26
|
}
|
|
24
27
|
export interface ReplaceRelatedRecordsMutation {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
op: "replaceRelatedRecords";
|
|
29
|
+
record: StableRecordIdentifier;
|
|
30
|
+
field: string;
|
|
31
|
+
// the records to add. If no prior/index
|
|
32
|
+
// specified all existing should be removed
|
|
33
|
+
value: StableRecordIdentifier[];
|
|
34
|
+
// if this is a "splice" the
|
|
35
|
+
// records we expect to be removed
|
|
36
|
+
prior?: StableRecordIdentifier[];
|
|
37
|
+
// if this is a "splice" the
|
|
38
|
+
// index to start from
|
|
39
|
+
index?: number;
|
|
31
40
|
}
|
|
32
41
|
export interface SortRelatedRecordsMutation {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
op: "sortRelatedRecords";
|
|
43
|
+
record: StableRecordIdentifier;
|
|
44
|
+
field: string;
|
|
45
|
+
value: StableRecordIdentifier[];
|
|
37
46
|
}
|
|
47
|
+
// A Mutation is an action that updates
|
|
48
|
+
// the local state of the Cache in some
|
|
49
|
+
// manner.
|
|
50
|
+
// Most Mutations are in theory also
|
|
51
|
+
// Operations; with the difference being
|
|
52
|
+
// that the change should be applied as
|
|
53
|
+
// "local" or "dirty" state instead of
|
|
54
|
+
// as "remote" or "clean" state.
|
|
55
|
+
//
|
|
56
|
+
// Note: this RFC does not publicly surface
|
|
57
|
+
// any of the mutations listed here as
|
|
58
|
+
// "operations", though the (private) Graph
|
|
59
|
+
// already expects and utilizes these.
|
|
60
|
+
// and we look forward to an RFC that makes
|
|
61
|
+
// the Graph a fully public API.
|
|
38
62
|
export type Mutation = ReplaceRelatedRecordsMutation | ReplaceRelatedRecordMutation | RemoveFromResourceRelationshipMutation | AddToResourceRelationshipMutation | SortRelatedRecordsMutation;
|
|
39
|
-
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -1,72 +1,85 @@
|
|
|
1
|
-
import type { StableDocumentIdentifier, StableExistingRecordIdentifier, StableRecordIdentifier } from
|
|
2
|
-
import type { Value } from
|
|
3
|
-
import type { ExistingResourceObject } from
|
|
4
|
-
import type { Relationship } from
|
|
1
|
+
import type { StableDocumentIdentifier, StableExistingRecordIdentifier, StableRecordIdentifier } from "../identifier.js";
|
|
2
|
+
import type { Value } from "../json/raw.js";
|
|
3
|
+
import type { ExistingResourceObject } from "../spec/json-api-raw.js";
|
|
4
|
+
import type { Relationship } from "./relationship.js";
|
|
5
5
|
export interface Op {
|
|
6
|
-
|
|
6
|
+
op: string;
|
|
7
7
|
}
|
|
8
|
+
// Occasionally the IdentifierCache
|
|
9
|
+
// discovers that two previously thought
|
|
10
|
+
// to be distinct Identifiers refer to
|
|
11
|
+
// the same ResourceBlob. This Operation
|
|
12
|
+
// will be performed giving the Cache the
|
|
13
|
+
// change to cleanup and merge internal
|
|
14
|
+
// state as desired when this discovery
|
|
15
|
+
// is made.
|
|
8
16
|
export interface MergeOperation extends Op {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
op: "mergeIdentifiers";
|
|
18
|
+
// existing
|
|
19
|
+
record: StableRecordIdentifier;
|
|
20
|
+
// new
|
|
21
|
+
value: StableRecordIdentifier;
|
|
12
22
|
}
|
|
13
23
|
export interface RemoveDocumentOperation extends Op {
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
op: "remove";
|
|
25
|
+
record: StableDocumentIdentifier;
|
|
16
26
|
}
|
|
17
27
|
export interface RemoveResourceOperation extends Op {
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
op: "remove";
|
|
29
|
+
record: StableExistingRecordIdentifier;
|
|
20
30
|
}
|
|
21
31
|
export interface AddResourceOperation extends Op {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
op: "add";
|
|
33
|
+
record: StableExistingRecordIdentifier;
|
|
34
|
+
value: ExistingResourceObject;
|
|
25
35
|
}
|
|
26
36
|
export interface UpdateResourceOperation extends Op {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
op: "update";
|
|
38
|
+
record: StableExistingRecordIdentifier;
|
|
39
|
+
value: ExistingResourceObject;
|
|
30
40
|
}
|
|
31
41
|
export interface UpdateResourceFieldOperation extends Op {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
op: "update";
|
|
43
|
+
record: StableExistingRecordIdentifier;
|
|
44
|
+
field: string;
|
|
45
|
+
value: Value;
|
|
36
46
|
}
|
|
37
47
|
export interface UpdateResourceRelationshipOperation extends Op {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
op: "update";
|
|
49
|
+
record: StableExistingRecordIdentifier;
|
|
50
|
+
field: string;
|
|
51
|
+
value: Relationship<StableExistingRecordIdentifier>;
|
|
42
52
|
}
|
|
43
53
|
export interface AddToDocumentOperation extends Op {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
op: "add";
|
|
55
|
+
record: StableDocumentIdentifier;
|
|
56
|
+
field: "data" | "included";
|
|
57
|
+
value: StableExistingRecordIdentifier | StableExistingRecordIdentifier[];
|
|
58
|
+
index?: number;
|
|
49
59
|
}
|
|
50
60
|
export interface AddToResourceRelationshipOperation extends Op {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
op: "add";
|
|
62
|
+
record: StableExistingRecordIdentifier;
|
|
63
|
+
field: string;
|
|
64
|
+
value: StableExistingRecordIdentifier | StableExistingRecordIdentifier[];
|
|
65
|
+
index?: number;
|
|
56
66
|
}
|
|
57
67
|
export interface RemoveFromResourceRelationshipOperation extends Op {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
op: "remove";
|
|
69
|
+
record: StableExistingRecordIdentifier;
|
|
70
|
+
field: string;
|
|
71
|
+
value: StableExistingRecordIdentifier | StableExistingRecordIdentifier[];
|
|
72
|
+
index?: number;
|
|
63
73
|
}
|
|
64
74
|
export interface RemoveFromDocumentOperation extends Op {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
op: "remove";
|
|
76
|
+
record: StableDocumentIdentifier;
|
|
77
|
+
field: "data" | "included";
|
|
78
|
+
value: StableExistingRecordIdentifier | StableExistingRecordIdentifier[];
|
|
79
|
+
index?: number;
|
|
70
80
|
}
|
|
81
|
+
// An Operation is an action that updates
|
|
82
|
+
// the remote state of the Cache in some
|
|
83
|
+
// manner. Additional Operations will be
|
|
84
|
+
// added in the future.
|
|
71
85
|
export type Operation = MergeOperation | RemoveResourceOperation | RemoveDocumentOperation | AddResourceOperation | UpdateResourceOperation | UpdateResourceFieldOperation | AddToResourceRelationshipOperation | RemoveFromResourceRelationshipOperation | AddToDocumentOperation | RemoveFromDocumentOperation;
|
|
72
|
-
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import type { StableRecordIdentifier } from
|
|
2
|
-
import type { Links, Meta, PaginationLinks } from
|
|
1
|
+
import type { StableRecordIdentifier } from "../identifier.js";
|
|
2
|
+
import type { Links, Meta, PaginationLinks } from "../spec/json-api-raw.js";
|
|
3
|
+
// we request that it be in the stable form already.
|
|
3
4
|
export interface ResourceRelationship<T = StableRecordIdentifier> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
data?: T | null;
|
|
6
|
+
meta?: Meta;
|
|
7
|
+
links?: Links;
|
|
7
8
|
}
|
|
9
|
+
// Note: in v1 data could be a ResourceIdentifier, now
|
|
10
|
+
// we request that it be in the stable form already.
|
|
8
11
|
export interface CollectionRelationship<T = StableRecordIdentifier> {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
data?: T[];
|
|
13
|
+
meta?: Meta;
|
|
14
|
+
links?: PaginationLinks;
|
|
12
15
|
}
|
|
13
16
|
export type Relationship<T = StableRecordIdentifier> = ResourceRelationship<T> | CollectionRelationship<T>;
|
|
14
|
-
//# sourceMappingURL=relationship.d.ts.map
|