@warp-drive/core 5.6.0-alpha.14 → 5.6.0-alpha.17
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 +8 -0
- 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 -58
- package/declarations/reactive/-private/schema.d.ts +256 -165
- package/declarations/reactive/-private/symbols.d.ts +27 -2
- 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 +155 -72
- 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 +261 -0
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +125 -119
- package/declarations/store/-private/record-arrays/many-array.d.ts +180 -182
- 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 -27
- 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 -323
- 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 -1587
- 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/{configure-BgaZESRo.js → configure-B48bFHOl.js} +38 -2
- package/dist/configure.js +1 -1
- package/dist/graph/-private.js +2 -2
- package/dist/{handler-cHghx9Y9.js → handler-C2T-IyJK.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.js +287 -101
- package/dist/{request-state-DgwTEXLU.js → request-state-CjLph1LP.js} +1030 -249
- package/dist/store/-private.js +3 -3
- package/dist/{symbols-BmDcn6hS.js → symbols-SIstXMLI.js} +3 -3
- package/dist/types/-private.js +1 -1
- package/dist/types/schema/fields.js +4 -4
- 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/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/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-BgaZESRo.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-cHghx9Y9.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-DgwTEXLU.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-BmDcn6hS.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,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: unknown): string | null;
|
|
3
9
|
export declare function ensureStringId(id: Coercable): string;
|
|
4
10
|
export {};
|
|
5
|
-
//# sourceMappingURL=coerce-id.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ExistingResourceIdentifierObject, ResourceIdentifierObject } from
|
|
1
|
+
import type { ExistingResourceIdentifierObject, ResourceIdentifierObject } from "../../../types/spec/json-api-raw.js";
|
|
2
2
|
export declare function constructResource(type: ResourceIdentifierObject): ResourceIdentifierObject;
|
|
3
3
|
export declare function constructResource(type: string, id: string, lid: string): ExistingResourceIdentifierObject;
|
|
4
4
|
export declare function constructResource(type: string | undefined, id: null | undefined, lid: string): ExistingResourceIdentifierObject;
|
|
5
5
|
export declare function constructResource(type: string, id: string, lid?: string | null): ExistingResourceIdentifierObject;
|
|
6
6
|
export declare function constructResource(type: string, id?: string | number | null, lid?: string | null): ResourceIdentifierObject;
|
|
7
|
-
//# sourceMappingURL=construct-resource.d.ts.map
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
export { Store, storeFor } from
|
|
2
|
-
export { recordIdentifierFor } from
|
|
3
|
-
export { CacheHandler, type StoreRequestContext } from
|
|
4
|
-
export { type CachePolicy } from
|
|
5
|
-
export { isStableIdentifier, isDocumentIdentifier } from
|
|
6
|
-
export { constructResource } from
|
|
7
|
-
export type { InstanceCache } from
|
|
8
|
-
export type { FindRecordQuery, Request, SaveRecordMutation, RequestCacheRequestState, RequestStateService
|
|
9
|
-
export type { CreateRecordProperties } from
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
|
|
1
|
+
export { Store, storeFor } from "./-private/store-service.js";
|
|
2
|
+
export { recordIdentifierFor } from "./-private/caches/instance-cache.js";
|
|
3
|
+
export { CacheHandler, type StoreRequestContext } from "./-private/cache-handler/handler.js";
|
|
4
|
+
export { type CachePolicy } from "./-private/cache-handler/types.js";
|
|
5
|
+
export { isStableIdentifier, isDocumentIdentifier } from "./-private/caches/identifier-cache.js";
|
|
6
|
+
export { constructResource } from "./-private/utils/construct-resource.js";
|
|
7
|
+
export type { InstanceCache } from "./-private/caches/instance-cache.js";
|
|
8
|
+
export type { FindRecordQuery, Request, SaveRecordMutation, RequestCacheRequestState, RequestStateService } from "./-private/network/request-cache.js";
|
|
9
|
+
export type { CreateRecordProperties } from "./-private/store-service.js";
|
|
10
|
+
// TODO this should be a deprecated helper but we have so much usage of it
|
|
11
|
+
// to also eliminate
|
|
12
|
+
export { coerceId, ensureStringId } from "./-private/utils/coerce-id.js";
|
|
13
|
+
export type { NativeProxy } from "./-private/record-arrays/native-proxy-type-fix.js";
|
|
14
|
+
export { IdentifierArray as LiveArray, Collection as CollectionRecordArray, SOURCE, MUTATE } from "./-private/record-arrays/identifier-array.js";
|
|
15
|
+
export { RecordArrayManager, fastPush } from "./-private/managers/record-array-manager.js";
|
|
16
|
+
// leaked for private use / test use, should investigate removing
|
|
17
|
+
export { _clearCaches } from "./-private/caches/instance-cache.js";
|
|
18
|
+
export { peekCache, removeRecordDataFor } from "./-private/caches/cache-utils.js";
|
|
19
|
+
// @ember-data/model needs these temporarily
|
|
20
|
+
export { setRecordIdentifier, StoreMap } from "./-private/caches/instance-cache.js";
|
|
21
|
+
export { setCacheFor } from "./-private/caches/cache-utils.js";
|
|
22
|
+
export { normalizeModelName as _deprecatingNormalize } from "./-private/utils/normalize-model-name.js";
|
|
23
|
+
export type { StoreRequestInput } from "./-private/cache-handler/handler.js";
|
|
24
|
+
export { RelatedCollection } from "./-private/record-arrays/many-array.js";
|
|
25
|
+
export { log, logGroup } from "./-private/debug/utils.js";
|
|
26
|
+
export { getPromiseState, type PromiseState } from "./-private/new-core-tmp/promise-state.js";
|
|
27
|
+
export { DISPOSE, createRequestSubscription, type SubscriptionArgs, type RequestSubscription } from "./-private/new-core-tmp/request-subscription.js";
|
|
28
|
+
export { getRequestState, type RequestLoadingState, type RequestCacheRequestState as RequestState } from "./-private/new-core-tmp/request-state.js";
|
|
29
|
+
export { createMemo, type SignalHooks, waitFor } from "./-private/new-core-tmp/reactivity/configure.js";
|
|
30
|
+
export { memoized, gate, entangleSignal, defineSignal, defineNonEnumerableSignal } from "./-private/new-core-tmp/reactivity/signal.js";
|
|
31
|
+
export { ARRAY_SIGNAL, OBJECT_SIGNAL, Signals, type WarpDriveSignal, peekInternalSignal, withSignalStore, notifyInternalSignal, consumeInternalSignal, getOrCreateInternalSignal } from "./-private/new-core-tmp/reactivity/internal.js";
|
|
@@ -1,100 +1,99 @@
|
|
|
1
|
-
import type { StableDocumentIdentifier, StableRecordIdentifier } from
|
|
2
|
-
import type { IdentifierCache } from
|
|
3
|
-
import type { NotificationType } from
|
|
4
|
-
import type { SchemaService } from
|
|
1
|
+
import type { StableDocumentIdentifier, StableRecordIdentifier } from "../../../types/identifier.js";
|
|
2
|
+
import type { IdentifierCache } from "../../-private/caches/identifier-cache.js";
|
|
3
|
+
import type { NotificationType } from "../../-private/managers/notification-manager.js";
|
|
4
|
+
import type { SchemaService } from "./schema-service.js";
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
* CacheCapabilitiesManager provides encapsulated API access to the minimal
|
|
7
|
+
* subset of the Store's functionality that Cache implementations
|
|
8
|
+
* should interact with. It is provided to the Store's `createCache` hook.
|
|
9
|
+
*
|
|
10
|
+
* Cache implementations should not need more than this API provides.
|
|
11
|
+
*
|
|
12
|
+
* This class cannot be directly instantiated.
|
|
13
|
+
*
|
|
14
|
+
* @class CacheCapabilitiesManager
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
17
|
export type CacheCapabilitiesManager = {
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Provides access to the IdentifierCache instance
|
|
20
|
+
* for this Store instance.
|
|
21
|
+
*
|
|
22
|
+
* The IdentifierCache can be used to peek, generate or
|
|
23
|
+
* retrieve a stable unique identifier for any resource.
|
|
24
|
+
*
|
|
25
|
+
* @property identifierCache
|
|
26
|
+
* @type {IdentifierCache}
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
identifierCache: IdentifierCache;
|
|
30
|
+
/**
|
|
31
|
+
* DEPRECATED - use the schema property
|
|
32
|
+
*
|
|
33
|
+
* Provides access to the SchemaService instance
|
|
34
|
+
* for this Store instance.
|
|
35
|
+
*
|
|
36
|
+
* The SchemaService can be used to query for
|
|
37
|
+
* information about the schema of a resource.
|
|
38
|
+
*
|
|
39
|
+
* @deprecated
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
getSchemaDefinitionService(): SchemaService;
|
|
43
|
+
/**
|
|
44
|
+
* Provides access to the SchemaService instance
|
|
45
|
+
* for this Store instance.
|
|
46
|
+
*
|
|
47
|
+
* The SchemaService can be used to query for
|
|
48
|
+
* information about the schema of a resource.
|
|
49
|
+
*
|
|
50
|
+
* @property schema
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
schema: SchemaService;
|
|
54
|
+
/**
|
|
55
|
+
* Update the `id` for the record corresponding to the identifier
|
|
56
|
+
* This operation can only be done for records whose `id` is `null`.
|
|
57
|
+
*
|
|
58
|
+
* @param {StableRecordIdentifier} identifier;
|
|
59
|
+
* @param {String} id;
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
setRecordId(identifier: StableRecordIdentifier, id: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Signal to the store that the specified record may be considered fully
|
|
65
|
+
* removed from the cache. Generally this means that not only does no
|
|
66
|
+
* data exist for the identified resource, no known relationships still
|
|
67
|
+
* point to it either.
|
|
68
|
+
*
|
|
69
|
+
* @param {StableRecordIdentifier} identifier
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
disconnectRecord(identifier: StableRecordIdentifier): void;
|
|
73
|
+
/**
|
|
74
|
+
* Use this method to determine if the Store has an instantiated record associated
|
|
75
|
+
* with an identifier.
|
|
76
|
+
*
|
|
77
|
+
* @param identifier
|
|
78
|
+
* @return {Boolean}
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
hasRecord(identifier: StableRecordIdentifier): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Notify subscribers of the NotificationManager that cache state has changed.
|
|
84
|
+
*
|
|
85
|
+
* `attributes` and `relationships` do not require a key, but if one is specified it
|
|
86
|
+
* is assumed to be the name of the attribute or relationship that has been updated.
|
|
87
|
+
*
|
|
88
|
+
* No other namespaces currently expect the `key` argument.
|
|
89
|
+
*
|
|
90
|
+
* @param {StableRecordIdentifier} identifier
|
|
91
|
+
* @param {'attributes' | 'relationships' | 'identity' | 'errors' | 'meta' | 'state'} namespace
|
|
92
|
+
* @param {string|undefined} key
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
notifyChange(identifier: StableRecordIdentifier, namespace: "added" | "removed", key: null): void;
|
|
96
|
+
notifyChange(identifier: StableDocumentIdentifier, namespace: "added" | "updated" | "removed", key: null): void;
|
|
97
|
+
notifyChange(identifier: StableRecordIdentifier, namespace: NotificationType, key: string | null): void;
|
|
98
|
+
notifyChange(identifier: StableRecordIdentifier | StableDocumentIdentifier, namespace: NotificationType | "added" | "removed" | "updated", key: string | null): void;
|
|
99
99
|
};
|
|
100
|
-
//# sourceMappingURL=cache-capabilities-manager.d.ts.map
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import type { TypedRecordInstance, TypeFromInstance } from
|
|
2
|
-
import type { LegacyAttributeField, LegacyRelationshipField } from
|
|
1
|
+
import type { TypedRecordInstance, TypeFromInstance } from "../../../types/record.js";
|
|
2
|
+
import type { LegacyAttributeField, LegacyRelationshipField } from "../../../types/schema/fields.js";
|
|
3
3
|
export type KeyOrString<T> = keyof T & string extends never ? string : keyof T & string;
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
* Minimum subset of static schema methods and properties on the
|
|
6
|
+
* "model" class.
|
|
7
|
+
*
|
|
8
|
+
* Only used when using the legacy schema-service implementation
|
|
9
|
+
* for @ember-data/model or when wrapping schema for legacy
|
|
10
|
+
* Adapters/Serializers.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
13
|
export interface ModelSchema<T = unknown> {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
|
|
15
|
+
fields: Map<KeyOrString<T>, "attribute" | "belongsTo" | "hasMany">;
|
|
16
|
+
attributes: Map<KeyOrString<T>, LegacyAttributeField>;
|
|
17
|
+
relationshipsByName: Map<KeyOrString<T>, LegacyRelationshipField>;
|
|
18
|
+
eachAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, attribute: LegacyAttributeField) => void, binding?: T): void;
|
|
19
|
+
eachRelationship<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
|
|
20
|
+
eachTransformedAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, type: string | null) => void, binding?: T): void;
|
|
21
21
|
}
|
|
22
|
-
//# sourceMappingURL=ds-model.d.ts.map
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import type { IdentifierBucket, StableIdentifier, StableRecordIdentifier } from
|
|
2
|
-
import type { ImmutableRequestInfo } from
|
|
1
|
+
import type { IdentifierBucket, StableIdentifier, StableRecordIdentifier } from "../../../types/identifier.js";
|
|
2
|
+
import type { ImmutableRequestInfo } from "../../../types/request.js";
|
|
3
3
|
export interface GenerationMethod {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
(data: ImmutableRequestInfo, bucket: "document"): string | null;
|
|
5
|
+
(data: unknown | {
|
|
6
|
+
type: string;
|
|
7
|
+
}, bucket: "record"): string;
|
|
8
|
+
(data: unknown, bucket: IdentifierBucket): string | null;
|
|
9
9
|
}
|
|
10
10
|
export type UpdateMethod = {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
(identifier: StableRecordIdentifier, newData: unknown, bucket: "record"): void;
|
|
12
|
+
(identifier: StableIdentifier, newData: unknown, bucket: never): void;
|
|
13
13
|
};
|
|
14
14
|
export type ForgetMethod = (identifier: StableIdentifier | StableRecordIdentifier, bucket: IdentifierBucket) => void;
|
|
15
15
|
export type ResetMethod = () => void;
|
|
16
16
|
export type KeyInfo = {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
id: string | null;
|
|
18
|
+
type: string;
|
|
19
19
|
};
|
|
20
20
|
export type KeyInfoMethod = (resource: unknown, known: StableRecordIdentifier | null) => KeyInfo;
|
|
21
|
-
//# sourceMappingURL=identifier.d.ts.map
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
In WarpDrive, a "record instance" is a class instance used to present the data
|
|
3
|
+
for a single resource, transforming the resource's cached raw data into a form
|
|
4
|
+
that is useful for the application.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
Since every application's needs are different, WarpDrive does not assume to know
|
|
7
|
+
what the shape of the record instance should be. Instead, it provides a way to
|
|
8
|
+
define the record instance's via the `instantiateRecord` hook on the store.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
Thus for most purposes the `RecordInstance` type is "opaque" to WarpDrive, and
|
|
11
|
+
should be treated as "unknown" by the library.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
Wherever possible, if typing an API that is consumer facing, instead of using
|
|
14
|
+
OpaqueRecordInstance, we should prefer to use a generic and check if the generic
|
|
15
|
+
extends `TypedRecordInstance`. This allows consumers to define their own record
|
|
16
|
+
instance types and not only have their types flow through WarpDrive APIs, but
|
|
17
|
+
also allows WarpDrive to provide typechecking and intellisense for the record
|
|
18
|
+
based on a special symbol prsent on record instances that implement the
|
|
19
|
+
`TypedRecordInstance` interface.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
@internal
|
|
22
22
|
*/
|
|
23
23
|
export type OpaqueRecordInstance = unknown;
|
|
24
|
-
//# sourceMappingURL=record-instance.d.ts.map
|