@warp-drive/core 5.7.0-alpha.37 → 5.7.0-alpha.39

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 (45) hide show
  1. package/declarations/graph/-private/-state.d.ts +0 -87
  2. package/declarations/graph/-private/-utils.d.ts +0 -6
  3. package/declarations/graph/-private/coerce-id.d.ts +0 -6
  4. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +0 -12
  5. package/declarations/graph/-private/graph.d.ts +0 -36
  6. package/declarations/graph/-private/normalize-link.d.ts +0 -6
  7. package/declarations/graph/-private/operations/replace-related-records.d.ts +0 -55
  8. package/declarations/graph/-private/operations/update-relationship.d.ts +0 -4
  9. package/declarations/reactive/-private/fields/managed-array.d.ts +0 -1
  10. package/declarations/reactive/-private/fields/managed-object.d.ts +0 -2
  11. package/declarations/reactive/-private/record.d.ts +0 -1
  12. package/declarations/reactive/-private/schema.d.ts +0 -2
  13. package/declarations/reactive/-private/symbols.d.ts +0 -26
  14. package/declarations/request/-private/types.d.ts +0 -1
  15. package/declarations/store/-private/cache-handler/utils.d.ts +0 -1
  16. package/declarations/store/-private/caches/instance-cache.d.ts +0 -1
  17. package/declarations/store/-private/default-cache-policy.d.ts +0 -2
  18. package/declarations/store/-private/managers/cache-key-manager.d.ts +0 -4
  19. package/declarations/store/-private/managers/cache-manager.d.ts +0 -16
  20. package/declarations/store/-private/managers/notification-manager.d.ts +0 -2
  21. package/declarations/store/-private/network/request-cache.d.ts +0 -1
  22. package/declarations/store/-private/new-core-tmp/request-state.d.ts +0 -1
  23. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +0 -2
  24. package/declarations/store/-private/record-arrays/resource-array.d.ts +0 -8
  25. package/declarations/store/-private/store-service.d.ts +0 -5
  26. package/declarations/store/-private/utils/coerce-id.d.ts +0 -6
  27. package/declarations/store/-private.d.ts +0 -5
  28. package/declarations/store/deprecated/-private.d.ts +0 -1
  29. package/declarations/store/deprecated/store.d.ts +0 -4
  30. package/declarations/types/cache/aliases.d.ts +0 -11
  31. package/declarations/types/cache/mutations.d.ts +0 -24
  32. package/declarations/types/cache/relationship.d.ts +0 -3
  33. package/declarations/types/cache.d.ts +0 -12
  34. package/declarations/types/identifier.d.ts +0 -2
  35. package/declarations/types/request.d.ts +0 -3
  36. package/declarations/types/spec/document.d.ts +0 -4
  37. package/declarations/types/spec/json-api-raw.d.ts +0 -1
  38. package/declarations/types.d.ts +0 -1
  39. package/declarations/utils/string.d.ts +0 -1
  40. package/dist/index.js +1 -1
  41. package/dist/reactive.js +2 -2
  42. package/dist/{request-subscription-CjHGziEX.js → request-state-C955e0AL.js} +984 -982
  43. package/dist/store/-private.js +1 -1
  44. package/dist/types/-private.js +1 -1
  45. package/package.json +6 -6
@@ -4,10 +4,6 @@ import type { LegacyLiveArray, LegacyQueryArray } from "../-private.js";
4
4
  import { Store } from "../-private/store-service.js";
5
5
  import type { FindAllOptions, FindRecordOptions, LegacyResourceQuery, ModelSchema, QueryOptions } from "./-private.js";
6
6
  import { RecordReference } from "./-private.js";
7
- /////////////// IMPORTANT ///////////////////
8
- ///// Move Module Augmentation Into The /////
9
- ///// Legacy Package Once Removed Here /////
10
- /////////////////////////////////////////////
11
7
  declare module "../-private/store-service" {
12
8
  interface Store {
13
9
  /**
@@ -1,12 +1 @@
1
- // The ResourceBlob is an opaque type that must
2
- // satisfy two constraints.
3
- // (1) it should be possible for the CacheKeyManager
4
- // to be able to generate a ResourceKey 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.
12
1
  export type ResourceBlob = unknown;
@@ -17,10 +17,7 @@ export interface ReplaceRelatedRecordMutation {
17
17
  op: "replaceRelatedRecord";
18
18
  record: ResourceKey;
19
19
  field: string;
20
- // never null if field is a collection
21
20
  value: ResourceKey | null;
22
- // if field is a collection,
23
- // the value we are swapping with
24
21
  prior?: ResourceKey;
25
22
  index?: number;
26
23
  }
@@ -28,14 +25,8 @@ export interface ReplaceRelatedRecordsMutation {
28
25
  op: "replaceRelatedRecords";
29
26
  record: ResourceKey;
30
27
  field: string;
31
- // the records to add. If no prior/index
32
- // specified all existing should be removed
33
28
  value: ResourceKey[];
34
- // if this is a "splice" the
35
- // records we expect to be removed
36
29
  prior?: ResourceKey[];
37
- // if this is a "splice" the
38
- // index to start from
39
30
  index?: number;
40
31
  }
41
32
  export interface SortRelatedRecordsMutation {
@@ -44,19 +35,4 @@ export interface SortRelatedRecordsMutation {
44
35
  field: string;
45
36
  value: ResourceKey[];
46
37
  }
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.
62
38
  export type Mutation = ReplaceRelatedRecordsMutation | ReplaceRelatedRecordMutation | RemoveFromResourceRelationshipMutation | AddToResourceRelationshipMutation | SortRelatedRecordsMutation;
@@ -1,13 +1,10 @@
1
1
  import type { ResourceKey } from "../identifier.js";
2
2
  import type { Links, Meta, PaginationLinks } from "../spec/json-api-raw.js";
3
- // we request that it be in the stable form already.
4
3
  export interface ResourceRelationship<T = ResourceKey> {
5
4
  data?: T | null;
6
5
  meta?: Meta;
7
6
  links?: Links;
8
7
  }
9
- // Note: in v1 data could be a ResourceIdentifier, now
10
- // we request that it be in the stable form already.
11
8
  export interface CollectionRelationship<T = ResourceKey> {
12
9
  data?: T[];
13
10
  meta?: Meta;
@@ -42,8 +42,6 @@ export interface Cache {
42
42
  * @public
43
43
  */
44
44
  version: "2";
45
- // Cache Management
46
- // ================
47
45
  /**
48
46
  * Cache the response to a request
49
47
  *
@@ -164,8 +162,6 @@ export interface Cache {
164
162
  * @return if `hasRecord` is true then calculated key changes should be returned
165
163
  */
166
164
  upsert(cacheKey: ResourceKey, data: ResourceBlob, hasRecord: boolean): void | string[];
167
- // Cache Forking Support
168
- // =====================
169
165
  /**
170
166
  * Create a fork of the cache from the current state.
171
167
  *
@@ -218,8 +214,6 @@ export interface Cache {
218
214
  * @public
219
215
  */
220
216
  diff(): Promise<Change[]>;
221
- // SSR Support
222
- // ===========
223
217
  /**
224
218
  * Serialize the entire contents of the Cache into a Stream
225
219
  * which may be fed back into a new instance of the same Cache
@@ -244,8 +238,6 @@ export interface Cache {
244
238
  * @public
245
239
  */
246
240
  hydrate(stream: ReadableStream<unknown>): Promise<void>;
247
- // Resource Support
248
- // ================
249
241
  /**
250
242
  * [LIFECYCLE] Signal to the cache that a new record has been instantiated on the client
251
243
  *
@@ -287,8 +279,6 @@ export interface Cache {
287
279
  * @public
288
280
  */
289
281
  unloadRecord(cacheKey: ResourceKey): void;
290
- // Granular Resource Data APIs
291
- // ===========================
292
282
  /**
293
283
  * Retrieve the data for an attribute from the cache
294
284
  *
@@ -392,8 +382,6 @@ export interface Cache {
392
382
  * @return resource relationship object
393
383
  */
394
384
  getRemoteRelationship(cacheKey: ResourceKey, field: string, isCollection?: boolean): ResourceRelationship | CollectionRelationship;
395
- // Resource State
396
- // ===============
397
385
  /**
398
386
  * Update the cache state for the given resource to be marked
399
387
  * as locally deleted, or remove such a mark.
@@ -1,8 +1,6 @@
1
- // provided for additional debuggability
2
1
  export declare const DEBUG_CLIENT_ORIGINATED: unique symbol;
3
2
  export declare const DEBUG_KEY_TYPE: unique symbol;
4
3
  export declare const DEBUG_STALE_CACHE_OWNER: unique symbol;
5
- // also present in production
6
4
  export declare const CACHE_OWNER: "__$co";
7
5
  export type CacheKeyType = "record" | "document";
8
6
  /**
@@ -47,9 +47,6 @@ export type CacheOptions = {
47
47
  * than to invalidate findRecord requests for one.
48
48
  *
49
49
  */
50
- // TODO: Ideally this would be T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];
51
- // but that leads to `Type instantiation is excessively deep and possibly infinite.`
52
- // issues when `T` has many properties.
53
50
  types?: string[];
54
51
  /**
55
52
  * If true, the request will never be handled by the cache-manager and thus
@@ -2,7 +2,6 @@ import type { PersistedResourceKey } from "../identifier.js";
2
2
  import type { ApiError } from "./error.js";
3
3
  import type { Links, Meta, PaginationLinks } from "./json-api-raw.js";
4
4
  export interface ResourceMetaDocument {
5
- // the url or cache-key associated with the structured document
6
5
  lid?: string;
7
6
  meta: Meta;
8
7
  links?: Links | PaginationLinks;
@@ -11,7 +10,6 @@ export interface SingleResourceDataDocument<
11
10
  T = PersistedResourceKey,
12
11
  R = PersistedResourceKey
13
12
  > {
14
- // the url or cache-key associated with the structured document
15
13
  lid?: string;
16
14
  links?: Links | PaginationLinks;
17
15
  meta?: Meta;
@@ -19,7 +17,6 @@ export interface SingleResourceDataDocument<
19
17
  included?: R[];
20
18
  }
21
19
  export interface CollectionResourceDataDocument<T = PersistedResourceKey> {
22
- // the url or cache-key associated with the structured document
23
20
  lid?: string;
24
21
  links?: Links | PaginationLinks;
25
22
  meta?: Meta;
@@ -28,7 +25,6 @@ export interface CollectionResourceDataDocument<T = PersistedResourceKey> {
28
25
  }
29
26
  export type ResourceDataDocument<T = PersistedResourceKey> = SingleResourceDataDocument<T> | CollectionResourceDataDocument<T>;
30
27
  export interface ResourceErrorDocument {
31
- // the url or cache-key associated with the structured document
32
28
  lid?: string;
33
29
  links?: Links | PaginationLinks;
34
30
  meta?: Meta;
@@ -82,7 +82,6 @@ export interface ResourceIdentifier {
82
82
  lid: string;
83
83
  }
84
84
  export type ResourceIdentifierObject<T extends string = string> = ResourceIdentifier | ExistingResourceIdentifierObject<T> | NewResourceIdentifierObject<T>;
85
- // TODO disallow NewResource, make narrowable
86
85
  export interface SingleResourceRelationship<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> {
87
86
  data?: T | null;
88
87
  meta?: Meta;
@@ -6,7 +6,6 @@
6
6
  */
7
7
  export type { StableRecordIdentifier, ResourceKey } from "./types/identifier.js";
8
8
  export type { CacheCapabilitiesManager } from "./store/-types/q/cache-capabilities-manager.js";
9
- // FIXME this should come from somewhere more intelligent
10
9
  export type { ModelSchema } from "./store/deprecated/-private.js";
11
10
  export type { SchemaService } from "./store/-types/q/schema-service.js";
12
11
  export type { BaseFinderOptions, FindRecordOptions, LegacyResourceQuery, QueryOptions, FindAllOptions } from "./store/-types/q/store.js";
@@ -25,7 +25,6 @@ export declare class LRUCache<
25
25
  size: number;
26
26
  state: Map<T, V>;
27
27
  doWork: (k: T) => V;
28
- // debug stats
29
28
  _hits: number;
30
29
  _misses: number;
31
30
  _ejected: number;
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
4
4
  import { w as waitFor } from "./configure-C3x8YXzL.js";
5
5
  import { peekUniversalTransient, setUniversalTransient } from './types/-private.js';
6
6
  import { EnableHydration } from './types/request.js';
7
- export { C as CacheHandler, S as Store, r as recordIdentifierFor, U as setIdentifierForgetMethod, Q as setIdentifierGenerationMethod, V as setIdentifierResetMethod, T as setIdentifierUpdateMethod, W as setKeyInfoForResource, s as storeFor } from "./request-subscription-CjHGziEX.js";
7
+ export { C as CacheHandler, S as Store, r as recordIdentifierFor, U as setIdentifierForgetMethod, Q as setIdentifierGenerationMethod, V as setIdentifierResetMethod, T as setIdentifierUpdateMethod, W as setKeyInfoForResource, s as storeFor } from "./request-state-C955e0AL.js";
8
8
  import '@ember/debug';
9
9
  import './utils/string.js';
10
10
  import "./symbols-sql1_mdx.js";
package/dist/reactive.js CHANGED
@@ -1,5 +1,5 @@
1
- import { L as ReactiveResource, M as isNonIdentityCacheableField, N as getFieldCacheKeyStrict, r as recordIdentifierFor, H as withSignalStore, G as createInternalMemo } from "./request-subscription-CjHGziEX.js";
2
- export { O as checkout, P as commit } from "./request-subscription-CjHGziEX.js";
1
+ import { L as ReactiveResource, M as isNonIdentityCacheableField, N as getFieldCacheKeyStrict, r as recordIdentifierFor, H as withSignalStore, G as createInternalMemo } from "./request-state-C955e0AL.js";
2
+ export { O as checkout, P as commit } from "./request-state-C955e0AL.js";
3
3
  import { isResourceSchema } from './types/schema/fields.js';
4
4
  import { D as Destroy, C as Context } from "./symbols-sql1_mdx.js";
5
5
  export { a as Checkout } from "./symbols-sql1_mdx.js";