@warp-drive/core 5.7.0-alpha.3 → 5.7.0-alpha.30

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.
Files changed (115) hide show
  1. package/declarations/graph/-private/-diff.d.ts +7 -20
  2. package/declarations/graph/-private/-edge-definition.d.ts +3 -12
  3. package/declarations/graph/-private/-state.d.ts +2 -2
  4. package/declarations/graph/-private/-utils.d.ts +5 -5
  5. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +3 -3
  6. package/declarations/graph/-private/edges/collection.d.ts +10 -10
  7. package/declarations/graph/-private/edges/implicit.d.ts +5 -5
  8. package/declarations/graph/-private/edges/resource.d.ts +6 -7
  9. package/declarations/graph/-private/graph.d.ts +17 -15
  10. package/declarations/graph/-private/operations/replace-related-records.d.ts +4 -4
  11. package/declarations/graph/-private/operations/update-relationship.d.ts +3 -3
  12. package/declarations/index.d.ts +1 -1
  13. package/declarations/reactive/-private/default-mode.d.ts +73 -0
  14. package/declarations/reactive/-private/document.d.ts +11 -21
  15. package/declarations/reactive/-private/fields/get-field-key.d.ts +8 -0
  16. package/declarations/reactive/-private/fields/managed-array.d.ts +7 -10
  17. package/declarations/reactive/-private/fields/managed-object.d.ts +7 -9
  18. package/declarations/reactive/-private/fields/many-array-manager.d.ts +2 -2
  19. package/declarations/reactive/-private/hooks.d.ts +2 -2
  20. package/declarations/reactive/-private/kind/alias-field.d.ts +4 -0
  21. package/declarations/reactive/-private/kind/array-field.d.ts +4 -0
  22. package/declarations/reactive/-private/kind/attribute-field.d.ts +4 -0
  23. package/declarations/reactive/-private/kind/belongs-to-field.d.ts +4 -0
  24. package/declarations/reactive/-private/kind/collection-field.d.ts +4 -0
  25. package/declarations/reactive/-private/kind/derived-field.d.ts +4 -0
  26. package/declarations/reactive/-private/kind/generic-field.d.ts +4 -0
  27. package/declarations/reactive/-private/kind/has-many-field.d.ts +4 -0
  28. package/declarations/reactive/-private/kind/hash-field.d.ts +4 -0
  29. package/declarations/reactive/-private/kind/identity-field.d.ts +4 -0
  30. package/declarations/reactive/-private/kind/local-field.d.ts +4 -0
  31. package/declarations/reactive/-private/kind/object-field.d.ts +4 -0
  32. package/declarations/reactive/-private/kind/resource-field.d.ts +4 -0
  33. package/declarations/reactive/-private/kind/schema-array-field.d.ts +4 -0
  34. package/declarations/reactive/-private/kind/schema-object-field.d.ts +4 -0
  35. package/declarations/reactive/-private/record.d.ts +44 -33
  36. package/declarations/reactive/-private/schema.d.ts +16 -72
  37. package/declarations/reactive/-private/symbols.d.ts +2 -7
  38. package/declarations/reactive/-private.d.ts +1 -1
  39. package/declarations/reactive.d.ts +278 -1
  40. package/declarations/request/-private/context.d.ts +3 -3
  41. package/declarations/request/-private/fetch.d.ts +2 -0
  42. package/declarations/request/-private/manager.d.ts +24 -28
  43. package/declarations/request/-private/types.d.ts +22 -23
  44. package/declarations/request/-private/utils.d.ts +44 -2
  45. package/declarations/store/-private/cache-handler/handler.d.ts +2 -8
  46. package/declarations/store/-private/cache-handler/types.d.ts +10 -10
  47. package/declarations/store/-private/cache-handler/utils.d.ts +4 -4
  48. package/declarations/store/-private/caches/instance-cache.d.ts +21 -19
  49. package/declarations/store/-private/default-cache-policy.d.ts +25 -38
  50. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +24 -15
  51. package/declarations/store/-private/{caches/identifier-cache.d.ts → managers/cache-key-manager.d.ts} +38 -52
  52. package/declarations/store/-private/managers/cache-manager.d.ts +47 -95
  53. package/declarations/store/-private/managers/notification-manager.d.ts +30 -42
  54. package/declarations/store/-private/managers/record-array-manager.d.ts +45 -41
  55. package/declarations/store/-private/network/request-cache.d.ts +21 -21
  56. package/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +24 -0
  57. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +3 -41
  58. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +12 -29
  59. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +23 -3
  60. package/declarations/store/-private/new-core-tmp/request-state.d.ts +129 -22
  61. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +52 -121
  62. package/declarations/store/-private/record-arrays/-utils.d.ts +80 -0
  63. package/declarations/store/-private/record-arrays/legacy-live-array.d.ts +81 -0
  64. package/declarations/store/-private/record-arrays/legacy-many-array.d.ts +133 -0
  65. package/declarations/store/-private/record-arrays/legacy-query.d.ts +81 -0
  66. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +1 -124
  67. package/declarations/store/-private/record-arrays/resource-array.d.ts +75 -0
  68. package/declarations/store/-private/store-service.d.ts +156 -101
  69. package/declarations/store/-private.d.ts +10 -7
  70. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +15 -24
  71. package/declarations/store/-types/q/identifier.d.ts +9 -6
  72. package/declarations/store/-types/q/record-instance.d.ts +0 -1
  73. package/declarations/store/-types/q/schema-service.d.ts +28 -40
  74. package/declarations/store/-types/q/store.d.ts +6 -7
  75. package/declarations/store/deprecated/-private.d.ts +12 -23
  76. package/declarations/store/deprecated/store.d.ts +11 -12
  77. package/declarations/types/-private.d.ts +1 -1
  78. package/declarations/types/cache/aliases.d.ts +2 -2
  79. package/declarations/types/cache/change.d.ts +2 -2
  80. package/declarations/types/cache/mutations.d.ts +13 -13
  81. package/declarations/types/cache/operations.d.ts +115 -32
  82. package/declarations/types/cache/relationship.d.ts +4 -4
  83. package/declarations/types/cache.d.ts +51 -113
  84. package/declarations/types/graph.d.ts +12 -12
  85. package/declarations/types/identifier.d.ts +52 -76
  86. package/declarations/types/params.d.ts +2 -3
  87. package/declarations/types/request.d.ts +69 -42
  88. package/declarations/types/schema/concepts.d.ts +2 -2
  89. package/declarations/types/schema/fields.d.ts +378 -14
  90. package/declarations/types/spec/document.d.ts +6 -6
  91. package/declarations/types/spec/json-api-raw.d.ts +6 -8
  92. package/declarations/utils/string.d.ts +2 -2
  93. package/dist/{configure-B48bFHOl.js → configure-CiFDHArV.js} +4 -4
  94. package/dist/configure.js +1 -1
  95. package/dist/{context-COmAnXUQ.js → context-Bh-MA_tH.js} +40 -6
  96. package/dist/graph/-private.js +137 -144
  97. package/dist/index.js +25 -14
  98. package/dist/reactive/-private.js +1 -1
  99. package/dist/reactive.js +202 -1411
  100. package/dist/{request-state-CejVJgdj.js → request-state-B908BvPK.js} +5186 -2549
  101. package/dist/request.js +1 -1
  102. package/dist/store/-private.js +2 -3
  103. package/dist/store.js +32 -44
  104. package/dist/{symbols-SIstXMLI.js → symbols-sql1_mdx.js} +3 -8
  105. package/dist/types/-private.js +1 -1
  106. package/dist/types/identifier.js +19 -45
  107. package/dist/types/request.js +45 -3
  108. package/dist/types/schema/fields.js +23 -2
  109. package/dist/utils/string.js +2 -2
  110. package/package.json +10 -10
  111. package/declarations/reactive/-private/fields/compute.d.ts +0 -43
  112. package/declarations/store/-private/caches/cache-utils.d.ts +0 -12
  113. package/declarations/store/-private/record-arrays/identifier-array.d.ts +0 -147
  114. package/declarations/store/-private/record-arrays/many-array.d.ts +0 -197
  115. package/dist/handler-D2jjnIA-.js +0 -339
@@ -1,126 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /*
3
- We redefine Proxy because the native Proxy type treats the `target` and
4
- `receiver` as the same type incorrectly.
5
-
6
- We ported this from Typescript's own Proxy types on 3/10/2024.
7
- */
8
- interface ProxyHandler<T extends object> {
9
- /**
10
- * A trap method for a function call.
11
- * @param target The original callable object which is being proxied.
12
- * @internal
13
- */
14
- apply?(target: T, thisArg: any, argArray: any[]): any;
15
- /**
16
- * A trap for the `new` operator.
17
- * @param target The original object which is being proxied.
18
- * @param newTarget The constructor that was originally called.
19
- * @internal
20
- */
21
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
22
- construct?(target: T, argArray: any[], newTarget: Function): object;
23
- /**
24
- * A trap for `Object.defineProperty()`.
25
- * @param target The original object which is being proxied.
26
- * @return A `Boolean` indicating whether or not the property has been defined.
27
- * @internal
28
- */
29
- defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
30
- /**
31
- * A trap for the `delete` operator.
32
- * @param target The original object which is being proxied.
33
- * @param p The name or `Symbol` of the property to delete.
34
- * @return A `Boolean` indicating whether or not the property was deleted.
35
- * @internal
36
- */
37
- deleteProperty?(target: T, p: string | symbol): boolean;
38
- /**
39
- * A trap for getting a property value.
40
- * @param target The original object which is being proxied.
41
- * @param p The name or `Symbol` of the property to get.
42
- * @param receiver The proxy or an object that inherits from the proxy.
43
- * @internal
44
- */
45
- get?(target: T, p: string | symbol, receiver: any): any;
46
- /**
47
- * A trap for `Object.getOwnPropertyDescriptor()`.
48
- * @param target The original object which is being proxied.
49
- * @param p The name of the property whose description should be retrieved.
50
- * @internal
51
- */
52
- getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
53
- /**
54
- * A trap for the `[[GetPrototypeOf]]` internal method.
55
- * @param target The original object which is being proxied.
56
- * @internal
57
- */
58
- getPrototypeOf?(target: T): object | null;
59
- /**
60
- * A trap for the `in` operator.
61
- * @param target The original object which is being proxied.
62
- * @param p The name or `Symbol` of the property to check for existence.
63
- * @internal
64
- */
65
- has?(target: T, p: string | symbol): boolean;
66
- /**
67
- * A trap for `Object.isExtensible()`.
68
- * @param target The original object which is being proxied.
69
- * @internal
70
- */
71
- isExtensible?(target: T): boolean;
72
- /**
73
- * A trap for `Reflect.ownKeys()`.
74
- * @param target The original object which is being proxied.
75
- * @internal
76
- */
77
- ownKeys?(target: T): ArrayLike<string | symbol>;
78
- /**
79
- * A trap for `Object.preventExtensions()`.
80
- * @param target The original object which is being proxied.
81
- * @internal
82
- */
83
- preventExtensions?(target: T): boolean;
84
- /**
85
- * A trap for setting a property value.
86
- * @param target The original object which is being proxied.
87
- * @param p The name or `Symbol` of the property to set.
88
- * @param receiver The object to which the assignment was originally directed.
89
- * @return A `Boolean` indicating whether or not the property was set.
90
- * @internal
91
- */
92
- set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
93
- /**
94
- * A trap for `Object.setPrototypeOf()`.
95
- * @param target The original object which is being proxied.
96
- * @param newPrototype The object's new prototype or `null`.
97
- * @internal
98
- */
99
- setPrototypeOf?(target: T, v: object | null): boolean;
100
- }
101
- interface ProxyConstructor {
102
- /**
103
- * Creates a revocable Proxy object.
104
- * @param target A target object to wrap with Proxy.
105
- * @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
106
- * @internal
107
- */
108
- revocable<T extends object>(target: T, handler: ProxyHandler<T>): {
109
- proxy: T;
110
- revoke: () => void;
111
- };
112
- /**
113
- * Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
114
- * original object, but which may redefine fundamental Object operations like getting, setting, and defining
115
- * properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
116
- * @param target A target object to wrap with Proxy.
117
- * @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
118
- * @internal
119
- */
120
- new <
121
- TSource extends object,
122
- TTarget extends object
123
- >(target: TSource, handler: ProxyHandler<TSource>): TTarget;
124
- }
1
+ interface ProxyConstructor {}
125
2
  export declare const NativeProxy: ProxyConstructor;
126
3
  export {};
@@ -0,0 +1,75 @@
1
+ import type { ExtensionDef } from "../../../reactive.js";
2
+ import { Context } from "../../../reactive/-private.js";
3
+ import type { RequestKey, ResourceKey } from "../../../types/identifier.js";
4
+ import type { ObjectValue } from "../../../types/json/raw.js";
5
+ import type { CollectionField } from "../../../types/schema/fields.js";
6
+ import type { SignalStore, WarpDriveSignal } from "../new-core-tmp/reactivity/internal.js";
7
+ import type { Store } from "../store-service.js";
8
+ import type { KeyType, MinimumManager } from "./-utils.js";
9
+ import { NativeProxy } from "./native-proxy-type-fix.js";
10
+ declare const IS_COLLECTION: "___(unique) Symbol(IS_COLLECTION)";
11
+ type ProxiedMethod = (...args: unknown[]) => unknown;
12
+ interface ReactiveResourceArrayCreateOptions {
13
+ // passed in
14
+ store: Store;
15
+ manager: MinimumManager;
16
+ editable: boolean;
17
+ source: ResourceKey[];
18
+ // reactive, passed in
19
+ data: ObjectValue | null;
20
+ // non-reactive, passed in
21
+ features: Record<string | symbol, unknown> | null;
22
+ extensions: Map<string | symbol, ExtensionDef> | null;
23
+ // not-accessible except by the context
24
+ options: Record<string, unknown> | null;
25
+ destroy: null | ((this: ReactiveResourceArray, clear: boolean) => void);
26
+ mutate: null | ((target: ResourceKey[], receiver: typeof NativeProxy<ResourceKey[], unknown[]>, prop: string, args: unknown[], _SIGNAL: WarpDriveSignal) => unknown);
27
+ }
28
+ interface ReactiveResourceArrayContext extends ReactiveResourceArrayCreateOptions {
29
+ destroy: (this: ReactiveResourceArray, clear: boolean) => void;
30
+ mutate: (target: ResourceKey[], receiver: typeof NativeProxy<ResourceKey[], unknown[]>, prop: string, args: unknown[], _SIGNAL: WarpDriveSignal) => unknown;
31
+ // generated
32
+ signals: SignalStore;
33
+ signal: WarpDriveSignal;
34
+ isDestroying: boolean;
35
+ isDestroyed: boolean;
36
+ transaction: boolean;
37
+ boundFns: Map<KeyType, ProxiedMethod>;
38
+ }
39
+ export interface ReactiveResourceArray<T = unknown> extends Omit<Array<T>, "[]"> {}
40
+ export interface PrivateReactiveResourceArray<T = unknown> extends Omit<Array<T>, "[]"> {
41
+ isDestroying: boolean;
42
+ isDestroyed: boolean;
43
+ destroy: (this: ReactiveResourceArray, clear: boolean) => void;
44
+ [IS_COLLECTION]: boolean;
45
+ [Context]: ReactiveResourceArrayContext;
46
+ }
47
+ export interface TargetArray extends Array<ResourceKey> {}
48
+ export declare function createReactiveResourceArray<T>(options: ReactiveResourceArrayCreateOptions): ReactiveResourceArray<T>;
49
+ export declare function destroy(this: ReactiveResourceArray, clear: boolean): void;
50
+ export interface ReactiveRequestCollectionCreateArgs {
51
+ // passed in
52
+ store: Store;
53
+ manager: MinimumManager;
54
+ source: ResourceKey[];
55
+ options: {
56
+ requestKey: RequestKey;
57
+ } | null;
58
+ }
59
+ export declare function createRequestCollection(config: ReactiveRequestCollectionCreateArgs): ReactiveResourceArray;
60
+ export interface ReactiveRelatedCollectionCreateArgs {
61
+ // passed in
62
+ store: Store;
63
+ manager: MinimumManager;
64
+ source: ResourceKey[];
65
+ // not-accessible except by the context
66
+ options: {
67
+ resourceKey: ResourceKey;
68
+ path: string[];
69
+ field: CollectionField;
70
+ };
71
+ editable: boolean;
72
+ extensions: Map<string | symbol, ExtensionDef> | null;
73
+ }
74
+ export declare function createRelatedCollection(config: ReactiveRelatedCollectionCreateArgs): ReactiveResourceArray;
75
+ export {};
@@ -1,8 +1,8 @@
1
1
  import type { Graph } from "../../graph/-private.js";
2
2
  import type { Future } from "../../request.js";
3
- import type { RequestManager } from "../../request/-private/manager.js";
3
+ import type { PrivateRequestManager, RequestManager } from "../../request/-private/manager.js";
4
4
  import type { Cache } from "../../types/cache.js";
5
- import type { StableExistingRecordIdentifier, StableRecordIdentifier } from "../../types/identifier.js";
5
+ import type { PersistedResourceKey, ResourceKey } from "../../types/identifier.js";
6
6
  import type { TypedRecordInstance, TypeFromInstance } from "../../types/record.js";
7
7
  import type { CollectionResourceDocument, EmptyResourceDocument, JsonApiDocument, ResourceIdentifierObject, SingleResourceDocument } from "../../types/spec/json-api-raw.js";
8
8
  import type { Type } from "../../types/symbols.js";
@@ -11,12 +11,15 @@ import type { OpaqueRecordInstance } from "../-types/q/record-instance.js";
11
11
  import type { SchemaService } from "../-types/q/schema-service.js";
12
12
  import type { StoreRequestInput } from "./cache-handler/handler.js";
13
13
  import type { CachePolicy } from "./cache-handler/types.js";
14
- import { IdentifierCache } from "./caches/identifier-cache.js";
15
14
  import { InstanceCache, storeFor } from "./caches/instance-cache.js";
15
+ import type { PrivateCacheKeyManager } from "./managers/cache-key-manager.js";
16
+ import { CacheKeyManager } from "./managers/cache-key-manager.js";
17
+ import type { PrivateNotificationManager } from "./managers/notification-manager.js";
16
18
  import NotificationManager from "./managers/notification-manager.js";
17
- import { RecordArrayManager } from "./managers/record-array-manager.js";
19
+ import type { PrivateRecordArrayManager } from "./managers/record-array-manager.js";
20
+ import type { PrivateRequestStateService } from "./network/request-cache.js";
18
21
  import { RequestStateService } from "./network/request-cache.js";
19
- import type { IdentifierArray } from "./record-arrays/identifier-array.js";
22
+ import type { LegacyLiveArray } from "./record-arrays/legacy-live-array.js";
20
23
  export { storeFor };
21
24
  // We inline this list of methods to avoid importing EmberObject
22
25
  type EmberObjectKey = "_debugContainerKey" | "_super" | "addObserver" | "cacheFor" | "concatenatedProperties" | "decrementProperty" | "destroy" | "get" | "getProperties" | "incrementProperty" | "init" | "isDestroyed" | "isDestroying" | "mergedProperties" | "notifyPropertyChange" | "removeObserver" | "reopen" | "set" | "setProperties" | "toggleProperty" | "toString" | "willDestroy";
@@ -45,6 +48,9 @@ type MaybeHasId = {
45
48
  *
46
49
  */
47
50
  export type CreateRecordProperties<T = MaybeHasId & Record<string, unknown>> = T extends TypedRecordInstance ? Partial<FilteredKeys<T>> : T extends MaybeHasId ? MaybeHasId & Partial<FilteredKeys<T>> : MaybeHasId & Record<string, unknown>;
51
+ export interface CreateContext {
52
+ lid?: string;
53
+ }
48
54
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
55
  type ConstructorFunction = new (...args: any[]) => any;
50
56
  // eslint-disable-next-line @typescript-eslint/no-extraneous-class
@@ -76,7 +82,7 @@ export interface Store {
76
82
  * @public
77
83
  */
78
84
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
79
- instantiateRecord<T>(identifier: StableRecordIdentifier, createRecordArgs: {
85
+ instantiateRecord<T>(identifier: ResourceKey, createRecordArgs: {
80
86
  [key: string]: unknown;
81
87
  }): OpaqueRecordInstance;
82
88
  /**
@@ -144,7 +150,6 @@ export interface Store {
144
150
  * be sourced from directly registered schemas, then will fallback
145
151
  * to sourcing a schema from available models if no schema is found.
146
152
  *
147
- * @return {SchemaService}
148
153
  * @public
149
154
  */
150
155
  createSchemaService(): SchemaService;
@@ -190,11 +195,11 @@ export interface Store {
190
195
  * return this._schema.hasResource(resource);
191
196
  * }
192
197
  *
193
- * attributesDefinitionFor(identifier: RecordIdentifier | { type: string }): AttributesSchema {
198
+ * attributesDefinitionFor(identifier: ResourceKey | { type: string }): AttributesSchema {
194
199
  * return this._schema.attributesDefinitionFor(identifier);
195
200
  * }
196
201
  *
197
- * relationshipsDefinitionFor(identifier: RecordIdentifier | { type: string }): RelationshipsSchema {
202
+ * relationshipsDefinitionFor(identifier: ResourceKey | { type: string }): RelationshipsSchema {
198
203
  * const schema = AbstractSchemas.get(identifier.type);
199
204
  * return schema || this._schema.relationshipsDefinitionFor(identifier);
200
205
  * }
@@ -244,11 +249,11 @@ export interface Store {
244
249
  * return this._schema.hasResource(resource);
245
250
  * }
246
251
  *
247
- * attributesDefinitionFor(identifier: RecordIdentifier | { type: string }): AttributesSchema {
252
+ * attributesDefinitionFor(identifier: ResourceKey | { type: string }): AttributesSchema {
248
253
  * return this._schema.attributesDefinitionFor(identifier);
249
254
  * }
250
255
  *
251
- * relationshipsDefinitionFor(identifier: RecordIdentifier | { type: string }): RelationshipsSchema {
256
+ * relationshipsDefinitionFor(identifier: ResourceKey | { type: string }): RelationshipsSchema {
252
257
  * const schema = AbstractSchemas.get(identifier.type);
253
258
  * return schema || this._schema.relationshipsDefinitionFor(identifier);
254
259
  * }
@@ -289,8 +294,6 @@ export interface Store {
289
294
  * @hideconstructor
290
295
  */
291
296
  export declare class Store extends BaseClass {
292
- /** @internal */
293
- readonly recordArrayManager: RecordArrayManager;
294
297
  /**
295
298
  * Provides access to the NotificationManager associated
296
299
  * with this Store instance.
@@ -311,18 +314,17 @@ export declare class Store extends BaseClass {
311
314
  * @public
312
315
  */
313
316
  get schema(): ReturnType<this["createSchemaService"]>;
314
- /** @internal */
315
- _schema: SchemaService;
316
317
  /**
317
- * Provides access to the IdentifierCache instance
318
+ * Provides access to the CacheKeyManager
318
319
  * for this store.
319
320
  *
320
- * The IdentifierCache can be used to generate or
321
- * retrieve a stable unique identifier for any resource.
321
+ * The CacheKeyManager can be used to generate or
322
+ * retrieve a stable unique CacheKey for any resource
323
+ * or request.
322
324
  *
323
325
  * @public
324
326
  */
325
- readonly identifierCache: IdentifierCache;
327
+ readonly cacheKeyManager: CacheKeyManager;
326
328
  /**
327
329
  * Provides access to the requestManager instance associated
328
330
  * with this Store instance.
@@ -353,7 +355,7 @@ export declare class Store extends BaseClass {
353
355
  *
354
356
  * Note, when defined, these methods will only be invoked if a
355
357
  * cache key exists for the request, either because the request
356
- * contains `cacheOptions.key` or because the [IdentifierCache](/ember-data/release/classes/IdentifierCache)
358
+ * contains `cacheOptions.key` or because the [CacheKeyManager](/ember-data/release/classes/CacheKeyManager)
357
359
  * was able to generate a key for the request using the configured
358
360
  * [generation method](/ember-data/release/functions/@ember-data%2Fstore/setIdentifierGenerationMethod).
359
361
  *
@@ -362,12 +364,12 @@ export declare class Store extends BaseClass {
362
364
  * ```ts
363
365
  * store.lifetimes = {
364
366
  * // make the request and ignore the current cache state
365
- * isHardExpired(identifier: StableDocumentIdentifier): boolean {
367
+ * isHardExpired(key: RequestKey): boolean {
366
368
  * return false;
367
369
  * }
368
370
  *
369
371
  * // make the request in the background if true, return cache state
370
- * isSoftExpired(identifier: StableDocumentIdentifier): boolean {
372
+ * isSoftExpired(key: RequestKey): boolean {
371
373
  * return false;
372
374
  * }
373
375
  * }
@@ -376,65 +378,16 @@ export declare class Store extends BaseClass {
376
378
  * @public
377
379
  */
378
380
  lifetimes?: CachePolicy;
379
- // Private
380
- /** @internal */
381
- _graph?: Graph;
382
- /** @internal */
383
- _requestCache: RequestStateService;
384
- /** @internal */
385
- _instanceCache: InstanceCache;
386
- /** @internal */
387
- _cbs: {
388
- coalesce?: () => void;
389
- sync?: () => void;
390
- notify?: () => void;
391
- } | null;
392
- /** @internal */
393
- _forceShim: boolean;
394
- /**
395
- * Async flush buffers notifications until flushed
396
- * by finalization of a future configured by store.request
397
- *
398
- * This is useful for ensuring that notifications are delivered
399
- * prior to the promise resolving but without risk of promise
400
- * interleaving.
401
- *
402
- * @internal
403
- */
404
- _enableAsyncFlush: boolean | null;
405
- // DEBUG-only properties
406
- /** @internal */
407
- DISABLE_WAITER?: boolean;
408
- /** @internal */
409
- _isDestroying: boolean;
410
- /** @internal */
411
- _isDestroyed: boolean;
412
- /** @internal */
381
+ /** @private */
413
382
  get isDestroying(): boolean;
414
- /** @internal */
415
- set isDestroying(value: boolean);
416
- /** @internal */
383
+ /** @private */
417
384
  get isDestroyed(): boolean;
418
- /** @internal */
419
- set isDestroyed(value: boolean);
385
+ /** @deprecated use {@link Store.cacheKeyManager} */
386
+ get identifierCache(): CacheKeyManager;
420
387
  /**
421
388
  @private
422
389
  */
423
390
  constructor(createArgs?: unknown);
424
- /** @internal */
425
- _run(cb: () => void): void;
426
- /**
427
- * Executes the callback, ensurng that any work that calls
428
- * store._schedule is executed after in the right order.
429
- *
430
- * When queues already exist, scheduled callbacks will
431
- * join the existing queue.
432
- *
433
- * @internal
434
- */
435
- _join(cb: () => void): void;
436
- /** @internal */
437
- _schedule(name: "coalesce" | "sync" | "notify", cb: () => void): void;
438
391
  /**
439
392
  * Retrieve the RequestStateService instance
440
393
  * associated with this Store.
@@ -446,10 +399,6 @@ export declare class Store extends BaseClass {
446
399
  * @public
447
400
  */
448
401
  getRequestStateService(): RequestStateService;
449
- /** @internal */
450
- _getAllPending(): (Promise<unknown[]> & {
451
- length: number;
452
- }) | void;
453
402
  /**
454
403
  * ::: tip 💡 For a more complete overview see the [Request Guide](/guides/2-requests/1-overview)
455
404
  * :::
@@ -464,7 +413,7 @@ export declare class Store extends BaseClass {
464
413
  * {@link CacheOptions.key | cache key} will have the request result
465
414
  * and document cached.
466
415
  *
467
- * The cache key used is {@link RequestInfo.cacheOptions | RequestInfo.cacheOptions.key}
416
+ * The cache key used is {@link RequestInfo.cacheOptions.key | RequestInfo.cacheOptions.key}
468
417
  * if present, falling back to {@link RequestInfo.url}.
469
418
  *
470
419
  * Params are not serialized as part of the cache-key, so
@@ -503,40 +452,77 @@ export declare class Store extends BaseClass {
503
452
  *
504
453
  * @public
505
454
  */
506
- request<
507
- RT,
508
- T = unknown
509
- >(requestConfig: StoreRequestInput<RT, T>): Future<RT>;
455
+ request<RT>(requestConfig: StoreRequestInput<RT>): Future<RT>;
510
456
  /**
511
- Create a new record in the current store. The properties passed
512
- to this method are set on the newly created record.
457
+ Creates a new record in the current store.
513
458
 
514
- To create a new instance of a `Post`:
459
+ > [!CAUTION]
460
+ > This should not be used to mock records or to create
461
+ > a record representing data that could be fetched from
462
+ > the API.
463
+
464
+ The properties passed to this method are set on
465
+ the newly created record.
466
+
467
+ For instance: to create a new `post`:
515
468
 
516
469
  ```js
517
470
  store.createRecord('post', {
518
- title: 'Ember is awesome!'
471
+ title: 'WarpDrive is Stellar!'
519
472
  });
520
473
  ```
521
474
 
522
- To create a new instance of a `Post` that has a relationship with a `User` record:
475
+ Relationships can be set during create. For instance,
476
+ to create a new `post` that has an existing user as
477
+ it's author:
523
478
 
524
479
  ```js
525
- let user = this.store.peekRecord('user', '1');
480
+ const user = store.peekRecord('user', '1');
481
+
526
482
  store.createRecord('post', {
527
- title: 'Ember is awesome!',
483
+ title: 'WarpDrive is Stellar!',
528
484
  user: user
529
485
  });
530
486
  ```
531
487
 
488
+ ### lid handling
489
+
490
+ All new records are assigned an `lid` that can be used to handle
491
+ transactional saves of multiple records, or to link the data to
492
+ other data in scenarios involving eventual-consistency or remote
493
+ syncing.
494
+
495
+ ```ts
496
+ const post = store.createRecord('post', {
497
+ title: 'WarpDrive is Stellar!'
498
+ });
499
+ const { lid } = recordIdentifierFor(post);
500
+ ```
501
+
502
+ The `lid` defaults to a uuidv4 string.
503
+
504
+ In order to support receiving knowledge about unpersisted creates
505
+ from other sources (say a different tab in the same web-browser),
506
+ createRecord allows for the `lid` to be provided as part of an
507
+ optional third argument. **If this lid already exists in the store
508
+ an error will be thrown.**
509
+
510
+ ```ts
511
+ const post = store.createRecord(
512
+ 'post',
513
+ { title: 'WarpDrive is Stellar!' },
514
+ { lid: '4d47bb88-931f-496e-986d-c4888cef7373' }
515
+ );
516
+ ```
517
+
532
518
  @public
533
- @param {String} type the name of the resource
534
- @param {Object} inputProperties a hash of properties to set on the
519
+ @param type the name of the resource
520
+ @param inputProperties a hash of properties to set on the
535
521
  newly created record.
536
- @return {Model} record
522
+ @return a record in the "isNew" state
537
523
  */
538
- createRecord<T>(type: TypeFromInstance<T>, inputProperties: CreateRecordProperties<T>): T;
539
- createRecord(type: string, inputProperties: CreateRecordProperties): OpaqueRecordInstance;
524
+ createRecord<T>(type: TypeFromInstance<T>, inputProperties: CreateRecordProperties<T>, context?: CreateContext): T;
525
+ createRecord(type: string, inputProperties: CreateRecordProperties, context?: CreateContext): OpaqueRecordInstance;
540
526
  /**
541
527
  For symmetry, a record can be deleted via the store.
542
528
 
@@ -644,8 +630,8 @@ export declare class Store extends BaseClass {
644
630
  @param {String} type the name of the resource
645
631
  @return {RecordArray}
646
632
  */
647
- peekAll<T>(type: TypeFromInstance<T>): IdentifierArray<T>;
648
- peekAll(type: string): IdentifierArray;
633
+ peekAll<T>(type: TypeFromInstance<T>): LegacyLiveArray<T>;
634
+ peekAll(type: string): LegacyLiveArray;
649
635
  /**
650
636
  This method unloads all records in the store.
651
637
  It schedules unloading to happen during the next run loop.
@@ -823,9 +809,9 @@ export declare class Store extends BaseClass {
823
809
 
824
810
  @private
825
811
  @param {Object} jsonApiDoc
826
- @return {StableRecordIdentifier|Array<StableRecordIdentifier>|null} identifiers for the primary records that had data loaded
812
+ @return {ResourceKey|Array<ResourceKey>|null} identifiers for the primary records that had data loaded
827
813
  */
828
- _push(jsonApiDoc: JsonApiDocument, asyncFlush?: boolean): StableExistingRecordIdentifier | StableExistingRecordIdentifier[] | null;
814
+ _push(jsonApiDoc: JsonApiDocument, asyncFlush?: boolean): PersistedResourceKey | PersistedResourceKey[] | null;
829
815
  /**
830
816
  * Returns the cache instance associated to this Store, instantiates the Cache
831
817
  * if necessary via `Store.createCache`
@@ -833,7 +819,7 @@ export declare class Store extends BaseClass {
833
819
  * @public
834
820
  */
835
821
  get cache(): ReturnType<this["createCache"]>;
836
- /** @internal */
822
+ /** @private */
837
823
  destroy(): void;
838
824
  /**
839
825
  * This method
@@ -842,4 +828,73 @@ export declare class Store extends BaseClass {
842
828
  */
843
829
  static create(args?: Record<string, unknown>): Store;
844
830
  }
831
+ /**
832
+ * This type exists for internal use only for
833
+ * where intimate contracts still exist either for
834
+ * the Test Suite or for Legacy code.
835
+ *
836
+ * @private
837
+ */
838
+ export interface PrivateStore extends Store {
839
+ readonly recordArrayManager: PrivateRecordArrayManager;
840
+ notifications: PrivateNotificationManager;
841
+ requestManager: PrivateRequestManager;
842
+ cacheKeyManager: PrivateCacheKeyManager;
843
+ _schema: SchemaService;
844
+ _graph?: Graph;
845
+ _requestCache: PrivateRequestStateService;
846
+ getRequestStateService(): PrivateRequestStateService;
847
+ _instanceCache: InstanceCache;
848
+ _cbs: {
849
+ coalesce?: () => void;
850
+ sync?: () => void;
851
+ notify?: () => void;
852
+ } | null;
853
+ _forceShim: boolean;
854
+ /**
855
+ * Async flush buffers notifications until flushed
856
+ * by finalization of a future configured by store.request
857
+ *
858
+ * This is useful for ensuring that notifications are delivered
859
+ * prior to the promise resolving but without risk of promise
860
+ * interleaving.
861
+ */
862
+ _enableAsyncFlush: boolean | null;
863
+ /**
864
+ * Available in DEBUG Only
865
+ */
866
+ DISABLE_WAITER?: boolean;
867
+ _isDestroying: boolean;
868
+ _isDestroyed: boolean;
869
+ isDestroying: boolean;
870
+ isDestroyed: boolean;
871
+ _run(cb: () => void): void;
872
+ /**
873
+ * Executes the callback, ensurng that any work that calls
874
+ * store._schedule is executed after in the right order.
875
+ *
876
+ * When queues already exist, scheduled callbacks will
877
+ * join the existing queue.
878
+ *
879
+ */
880
+ _join(cb: () => void): void;
881
+ _schedule(name: "coalesce" | "sync" | "notify", cb: () => void): void;
882
+ _getAllPending(): (Promise<unknown[]> & {
883
+ length: number;
884
+ }) | void;
885
+ }
886
+ /**
887
+ * Upgrade the type for Store to PrivateStore, which will also
888
+ * upgrade any associated types to their private equivalents.
889
+ *
890
+ * @private
891
+ */
892
+ export declare function assertPrivateStore(store: unknown): asserts store is PrivateStore;
893
+ /**
894
+ * Upgrade the type for Store to PrivateStore, which will also
895
+ * upgrade any associated types to their private equivalents.
896
+ *
897
+ * @private
898
+ */
899
+ export declare function isPrivateStore(store: unknown): PrivateStore;
845
900
  export declare function isMaybeIdentifier(maybeIdentifier: string | ResourceIdentifierObject): maybeIdentifier is ResourceIdentifierObject;
@@ -3,7 +3,7 @@ export { storeFor } from "./-private/store-service.js";
3
3
  export { recordIdentifierFor } from "./-private/caches/instance-cache.js";
4
4
  export { CacheHandler, type StoreRequestContext } from "./-private/cache-handler/handler.js";
5
5
  export { type CachePolicy } from "./-private/cache-handler/types.js";
6
- export { isStableIdentifier, isDocumentIdentifier } from "./-private/caches/identifier-cache.js";
6
+ export { isResourceKey, isRequestKey } from "./-private/managers/cache-key-manager.js";
7
7
  export { constructResource } from "./-private/utils/construct-resource.js";
8
8
  export type { InstanceCache } from "./-private/caches/instance-cache.js";
9
9
  export type { FindRecordQuery, Request, SaveRecordMutation, RequestCacheRequestState, RequestStateService } from "./-private/network/request-cache.js";
@@ -12,21 +12,24 @@ export type { CreateRecordProperties } from "./-private/store-service.js";
12
12
  // to also eliminate
13
13
  export { coerceId, ensureStringId } from "./-private/utils/coerce-id.js";
14
14
  export type { NativeProxy } from "./-private/record-arrays/native-proxy-type-fix.js";
15
- export { IdentifierArray as LiveArray, Collection as CollectionRecordArray, SOURCE, MUTATE } from "./-private/record-arrays/identifier-array.js";
15
+ export { type ReactiveResourceArray, type PrivateReactiveResourceArray } from "./-private/record-arrays/resource-array.js";
16
+ export { type LegacyLiveArray, type LegacyLiveArray as LiveArray } from "./-private/record-arrays/legacy-live-array.js";
17
+ export { type LegacyQueryArray, type LegacyQueryArray as CollectionRecordArray } from "./-private/record-arrays/legacy-query.js";
16
18
  export { RecordArrayManager, fastPush } from "./-private/managers/record-array-manager.js";
19
+ // leaked for test/legacy use. You will get in trouble for this.
20
+ export { assertPrivateStore, isPrivateStore, type PrivateStore } from "./-private/store-service.js";
21
+ export { assertPrivateCapabilities, type PrivateCacheCapabilitiesManager } from "./-private/managers/cache-capabilities-manager.js";
17
22
  // leaked for private use / test use, should investigate removing
18
23
  export { _clearCaches } from "./-private/caches/instance-cache.js";
19
- export { peekCache, removeRecordDataFor } from "./-private/caches/cache-utils.js";
20
24
  // @ember-data/model needs these temporarily
21
25
  export { setRecordIdentifier, StoreMap } from "./-private/caches/instance-cache.js";
22
- export { setCacheFor } from "./-private/caches/cache-utils.js";
23
26
  export { normalizeModelName as _deprecatingNormalize } from "./-private/utils/normalize-model-name.js";
24
27
  export type { StoreRequestInput } from "./-private/cache-handler/handler.js";
25
- export { RelatedCollection } from "./-private/record-arrays/many-array.js";
28
+ export { type LegacyManyArray, type LegacyManyArray as RelatedCollection, createLegacyManyArray } from "./-private/record-arrays/legacy-many-array.js";
26
29
  export { log, logGroup } from "./-private/debug/utils.js";
27
30
  export { getPromiseState, type PromiseState } from "./-private/new-core-tmp/promise-state.js";
28
- export { DISPOSE, createRequestSubscription, type SubscriptionArgs, type RequestSubscription } from "./-private/new-core-tmp/request-subscription.js";
31
+ export { DISPOSE, createRequestSubscription, type RequestArgs, type SubscriptionArgs, type RequestComponentArgs, type RequestSubscription, type ContentFeatures, type RecoveryFeatures, type AutorefreshBehaviorCombos, type AutorefreshBehaviorType } from "./-private/new-core-tmp/request-subscription.js";
29
32
  export { getRequestState, type RequestLoadingState, type RequestCacheRequestState as RequestState } from "./-private/new-core-tmp/request-state.js";
30
33
  export { createMemo, type SignalHooks, waitFor } from "./-private/new-core-tmp/reactivity/configure.js";
31
- export { memoized, gate, entangleSignal, defineSignal, defineGate, defineNonEnumerableSignal } from "./-private/new-core-tmp/reactivity/signal.js";
34
+ export { signal, memoized, gate, entangleSignal, defineSignal, defineGate, defineNonEnumerableSignal } from "./-private/new-core-tmp/reactivity/signal.js";
32
35
  export { ARRAY_SIGNAL, OBJECT_SIGNAL, Signals, type WarpDriveSignal, peekInternalSignal, withSignalStore, notifyInternalSignal, consumeInternalSignal, getOrCreateInternalSignal } from "./-private/new-core-tmp/reactivity/internal.js";