@warp-drive/core 5.8.0-alpha.0 → 5.8.0-alpha.10

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 (44) hide show
  1. package/README.md +6 -3
  2. package/declarations/build-config.d.ts +18 -1
  3. package/declarations/index.d.ts +80 -3
  4. package/declarations/reactive/-private/document.d.ts +58 -46
  5. package/declarations/reactive/-private/schema.d.ts +77 -4
  6. package/declarations/reactive.d.ts +13 -7
  7. package/declarations/request/-private/types.d.ts +1 -1
  8. package/declarations/request.d.ts +47 -0
  9. package/declarations/store/-private/caches/instance-cache.d.ts +4 -5
  10. package/declarations/store/-private/default-cache-policy.d.ts +147 -129
  11. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +1 -1
  12. package/declarations/store/-private/managers/cache-key-manager.d.ts +26 -8
  13. package/declarations/store/-private/managers/cache-manager.d.ts +6 -4
  14. package/declarations/store/-private/managers/notification-manager.d.ts +1 -1
  15. package/declarations/store/-private/new-core-tmp/promise-state.d.ts +1 -0
  16. package/declarations/store/-private/store-service.d.ts +43 -64
  17. package/declarations/store/-private.d.ts +0 -1
  18. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +1 -1
  19. package/declarations/store/deprecated/store.d.ts +33 -32
  20. package/declarations/store.d.ts +1 -0
  21. package/declarations/types/cache.d.ts +8 -6
  22. package/declarations/types/request.d.ts +26 -14
  23. package/declarations/types/schema/fields.d.ts +15 -4
  24. package/declarations/{store/-types/q → types/schema}/schema-service.d.ts +11 -9
  25. package/declarations/types/spec/document.d.ts +34 -0
  26. package/declarations/types/symbols.d.ts +2 -2
  27. package/declarations/types.d.ts +1 -1
  28. package/dist/build-config.js +1 -1
  29. package/dist/default-cache-policy-D7_u4YRH.js +572 -0
  30. package/dist/graph/-private.js +1 -1
  31. package/dist/{request-state-C955e0AL.js → index-D-cCuZLH.js} +10010 -8858
  32. package/dist/index.js +6 -382
  33. package/dist/reactive.js +4 -778
  34. package/dist/{context-C_7OLieY.js → request-oqoLC9rz.js} +219 -172
  35. package/dist/request.js +1 -1
  36. package/dist/store/-private.js +1 -1
  37. package/dist/store.js +1 -533
  38. package/dist/types/-private.js +1 -1
  39. package/dist/types/request.js +14 -12
  40. package/dist/types/runtime.js +1 -1
  41. package/dist/types/schema/fields.js +14 -0
  42. package/dist/types/schema/schema-service.js +0 -0
  43. package/dist/types/symbols.js +2 -2
  44. package/package.json +4 -4
@@ -1,9 +1,9 @@
1
- import type { CAUTION_MEGA_DANGER_ZONE_Extension, ProcessedExtension } from "../../../reactive.js";
2
- import type { ExtensibleField } from "../../../reactive/-private/schema.js";
3
- import type { ResourceKey } from "../../../types/identifier.js";
4
- import type { ObjectValue } from "../../../types/json/raw.js";
5
- import type { Derivation, HashFn, Transformation } from "../../../types/schema/concepts.js";
6
- import type { ArrayField, CacheableFieldSchema, DerivedField, FieldSchema, GenericField, HashField, IdentityField, LegacyAttributeField, LegacyRelationshipField, ObjectField, Schema, Trait } from "../../../types/schema/fields.js";
1
+ import type { CAUTION_MEGA_DANGER_ZONE_Extension, ProcessedExtension } from "../../reactive.js";
2
+ import type { ExtensibleField } from "../../reactive/-private/schema.js";
3
+ import type { ResourceKey } from "../identifier.js";
4
+ import type { ObjectValue } from "../json/raw.js";
5
+ import type { Derivation, HashFn, Transformation } from "./concepts.js";
6
+ import type { ArrayField, CacheableFieldSchema, DerivedField, FieldSchema, GenericField, HashField, IdentityField, LegacyAttributeField, LegacyRelationshipField, ObjectField, Schema, Trait } from "./fields.js";
7
7
  export type AttributesSchema = Record<string, LegacyAttributeField>;
8
8
  export type RelationshipsSchema = Record<string, LegacyRelationshipField>;
9
9
  interface ObjectWithStringTypeProperty {
@@ -66,7 +66,7 @@ export interface SchemaService {
66
66
  * Queries whether the SchemaService recognizes `type` as a resource type
67
67
  *
68
68
  * @public
69
- * @deprecated
69
+ * @deprecated - use {@link SchemaService.hasResource | hasResource}
70
70
  */
71
71
  doesTypeExist?(type: string): boolean;
72
72
  /**
@@ -251,7 +251,7 @@ export interface SchemaService {
251
251
  * ```
252
252
  *
253
253
  * @public
254
- * @deprecated
254
+ * @deprecated - use {@link SchemaService.fields | fields}
255
255
  */
256
256
  attributesDefinitionFor?(key: ResourceKey | ObjectWithStringTypeProperty): AttributesSchema;
257
257
  /**
@@ -330,7 +330,7 @@ export interface SchemaService {
330
330
  * ```
331
331
  *
332
332
  * @public
333
- * @deprecated
333
+ * @deprecated - use {@link SchemaService.fields | fields}
334
334
  */
335
335
  relationshipsDefinitionFor?(key: ResourceKey | ObjectWithStringTypeProperty): RelationshipsSchema;
336
336
  /**
@@ -342,6 +342,8 @@ export interface SchemaService {
342
342
  /**
343
343
  * Register an extension for either objects or arrays
344
344
  *
345
+ * See also {@link CAUTION_MEGA_DANGER_ZONE_Extension}
346
+ *
345
347
  * @public
346
348
  */
347
349
  CAUTION_MEGA_DANGER_ZONE_registerExtension?(extension: CAUTION_MEGA_DANGER_ZONE_Extension): void;
@@ -1,11 +1,21 @@
1
1
  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
+ /**
5
+ * This type represents a raw {json:api} document for a meta-only
6
+ * document returned by a request intended to be inserted into the cache.
7
+ */
4
8
  export interface ResourceMetaDocument {
5
9
  lid?: string;
6
10
  meta: Meta;
7
11
  links?: Links | PaginationLinks;
8
12
  }
13
+ /**
14
+ * This type represents a raw {json:api} document for a single resource
15
+ * returned by a request intended to be inserted into the cache.
16
+ *
17
+ * For the Reactive value returned by a request using the store, use {@link ReactiveDataDocument} instead.
18
+ */
9
19
  export interface SingleResourceDataDocument<
10
20
  T = PersistedResourceKey,
11
21
  R = PersistedResourceKey
@@ -16,6 +26,12 @@ export interface SingleResourceDataDocument<
16
26
  data: T | null;
17
27
  included?: R[];
18
28
  }
29
+ /**
30
+ * This type represents a raw {json:api} document for a resource collection
31
+ * returned by a request intended to be inserted into the cache.
32
+ *
33
+ * For the Reactive value returned by a request using the store, use {@link ReactiveDataDocument} instead.
34
+ */
19
35
  export interface CollectionResourceDataDocument<T = PersistedResourceKey> {
20
36
  lid?: string;
21
37
  links?: Links | PaginationLinks;
@@ -23,11 +39,29 @@ export interface CollectionResourceDataDocument<T = PersistedResourceKey> {
23
39
  data: T[];
24
40
  included?: T[];
25
41
  }
42
+ /**
43
+ * A type useful for representing the raw {json:api} documents that
44
+ * the cache may use.
45
+ *
46
+ * For the Reactive value returned by a request using the store, use {@link ReactiveDataDocument} instead.
47
+ */
26
48
  export type ResourceDataDocument<T = PersistedResourceKey> = SingleResourceDataDocument<T> | CollectionResourceDataDocument<T>;
49
+ /**
50
+ * A type useful for representing the raw {json:api} Error documents that
51
+ * the cache may use.
52
+ *
53
+ * For the Reactive value returned by a request using the store, use {@link ReactiveErrorDocument} instead.
54
+ */
27
55
  export interface ResourceErrorDocument {
28
56
  lid?: string;
29
57
  links?: Links | PaginationLinks;
30
58
  meta?: Meta;
31
59
  errors: ApiError[];
32
60
  }
61
+ /**
62
+ * A type useful for representing the raw {json:api} documents that
63
+ * the cache may use.
64
+ *
65
+ * For the Reactive value returned by a request using the store, use {@link ReactiveDocument} instead.
66
+ */
33
67
  export type ResourceDocument<T = PersistedResourceKey> = ResourceMetaDocument | SingleResourceDataDocument<T> | CollectionResourceDataDocument<T> | ResourceErrorDocument;
@@ -9,7 +9,7 @@ export declare const RecordStore: "___(unique) Symbol(Store)";
9
9
  * record implementations to provide a typescript
10
10
  * hint for the type of the resource.
11
11
  *
12
- * When used, EmberData/WarpDrive APIs can
12
+ * When used, WarpDrive APIs can
13
13
  * take advantage of this to provide better type
14
14
  * safety and intellisense.
15
15
  *
@@ -45,7 +45,7 @@ export declare const Type: "___(unique) Symbol($type)";
45
45
  * record implementations to provide a typescript
46
46
  * hint for the type of the resource.
47
47
  *
48
- * When used, EmberData/WarpDrive APIs can
48
+ * When used, WarpDrive APIs can
49
49
  * take advantage of this to provide better type
50
50
  * safety and intellisense.
51
51
  *
@@ -7,5 +7,5 @@
7
7
  export type { StableRecordIdentifier, ResourceKey } from "./types/identifier.js";
8
8
  export type { CacheCapabilitiesManager } from "./store/-types/q/cache-capabilities-manager.js";
9
9
  export type { ModelSchema } from "./store/deprecated/-private.js";
10
- export type { SchemaService } from "./store/-types/q/schema-service.js";
10
+ export type { SchemaService } from "./types/schema/schema-service.js";
11
11
  export type { BaseFinderOptions, FindRecordOptions, LegacyResourceQuery, QueryOptions, FindAllOptions } from "./store/-types/q/store.js";
@@ -1 +1 @@
1
- export { setConfig } from '@warp-drive/build-config';
1
+ export { babelPlugin, setConfig } from '@warp-drive/build-config';