@warp-drive/core 5.6.0-alpha.5 → 5.6.0-beta.1

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 (219) hide show
  1. package/README.md +8 -7
  2. package/cjs-dist/addon-shim.cjs +1 -0
  3. package/cjs-dist/cjs-set-config.cjs +1 -0
  4. package/declarations/build-config/babel-macros.d.ts +1 -0
  5. package/declarations/build-config/canary-features.d.ts +1 -0
  6. package/declarations/build-config/debugging.d.ts +1 -0
  7. package/declarations/build-config/deprecations.d.ts +1 -0
  8. package/declarations/build-config/env.d.ts +1 -0
  9. package/declarations/build-config/macros.d.ts +1 -0
  10. package/declarations/build-config.d.ts +1 -0
  11. package/declarations/configure.d.ts +7 -0
  12. package/declarations/graph/-private/-diff.d.ts +32 -0
  13. package/declarations/graph/-private/-edge-definition.d.ts +148 -0
  14. package/declarations/graph/-private/-state.d.ts +96 -0
  15. package/declarations/graph/-private/-utils.d.ts +31 -0
  16. package/declarations/graph/-private/coerce-id.d.ts +10 -0
  17. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +18 -0
  18. package/declarations/graph/-private/edges/collection.d.ts +39 -0
  19. package/declarations/graph/-private/edges/implicit.d.ts +43 -0
  20. package/declarations/graph/-private/edges/resource.d.ts +24 -0
  21. package/declarations/graph/-private/graph.d.ts +90 -0
  22. package/declarations/graph/-private/normalize-link.d.ts +8 -0
  23. package/declarations/graph/-private/operations/add-to-related-records.d.ts +4 -0
  24. package/declarations/graph/-private/operations/merge-identifier.d.ts +3 -0
  25. package/declarations/graph/-private/operations/remove-from-related-records.d.ts +4 -0
  26. package/declarations/graph/-private/operations/replace-related-record.d.ts +3 -0
  27. package/declarations/graph/-private/operations/replace-related-records.d.ts +62 -0
  28. package/declarations/graph/-private/operations/update-relationship.d.ts +13 -0
  29. package/declarations/graph/-private.d.ts +13 -0
  30. package/declarations/index.d.ts +14 -3
  31. package/declarations/reactive/-private/document.d.ts +146 -0
  32. package/declarations/reactive/-private/fields/compute.d.ts +43 -0
  33. package/declarations/reactive/-private/fields/extension.d.ts +8 -0
  34. package/declarations/reactive/-private/fields/managed-array.d.ts +22 -0
  35. package/declarations/reactive/-private/fields/managed-object.d.ts +21 -0
  36. package/declarations/reactive/-private/fields/many-array-manager.d.ts +19 -0
  37. package/declarations/reactive/-private/hooks.d.ts +5 -0
  38. package/declarations/reactive/-private/record.d.ts +64 -0
  39. package/declarations/reactive/-private/schema.d.ts +271 -0
  40. package/declarations/reactive/-private/symbols.d.ts +36 -0
  41. package/declarations/reactive/-private.d.ts +1 -0
  42. package/declarations/reactive.d.ts +4 -0
  43. package/declarations/request/-private/context.d.ts +34 -35
  44. package/declarations/request/-private/debug.d.ts +2 -3
  45. package/declarations/request/-private/fetch.d.ts +24 -36
  46. package/declarations/request/-private/future.d.ts +3 -4
  47. package/declarations/request/-private/manager.d.ts +159 -132
  48. package/declarations/request/-private/promise-cache.d.ts +21 -13
  49. package/declarations/request/-private/types.d.ts +124 -123
  50. package/declarations/request/-private/utils.d.ts +8 -9
  51. package/declarations/request.d.ts +5 -433
  52. package/declarations/store/-private/cache-handler/handler.d.ts +62 -0
  53. package/declarations/store/-private/cache-handler/types.d.ts +98 -0
  54. package/declarations/store/-private/cache-handler/utils.d.ts +32 -0
  55. package/declarations/store/-private/caches/cache-utils.d.ts +12 -0
  56. package/declarations/store/-private/caches/identifier-cache.d.ts +304 -0
  57. package/declarations/store/-private/caches/instance-cache.d.ts +65 -0
  58. package/declarations/store/-private/caches/resource-utils.d.ts +9 -0
  59. package/declarations/store/-private/debug/utils.d.ts +6 -0
  60. package/declarations/store/-private/default-cache-policy.d.ts +384 -0
  61. package/declarations/store/-private/legacy-model-support/record-reference.d.ts +159 -0
  62. package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +17 -0
  63. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +25 -0
  64. package/declarations/store/-private/managers/cache-manager.d.ts +443 -0
  65. package/declarations/store/-private/managers/notification-manager.d.ts +98 -0
  66. package/declarations/store/-private/managers/record-array-manager.d.ts +97 -0
  67. package/declarations/store/-private/network/request-cache.d.ts +107 -0
  68. package/declarations/store/-private/new-core-tmp/promise-state.d.ts +263 -0
  69. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +176 -0
  70. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +169 -0
  71. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +35 -0
  72. package/declarations/store/-private/new-core-tmp/request-state.d.ts +277 -0
  73. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +261 -0
  74. package/declarations/store/-private/record-arrays/identifier-array.d.ts +147 -0
  75. package/declarations/store/-private/record-arrays/many-array.d.ts +197 -0
  76. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +126 -0
  77. package/declarations/store/-private/store-service.d.ts +1605 -0
  78. package/declarations/store/-private/utils/coerce-id.d.ts +10 -0
  79. package/declarations/store/-private/utils/construct-resource.d.ts +6 -0
  80. package/declarations/store/-private/utils/is-non-empty-string.d.ts +1 -0
  81. package/declarations/store/-private/utils/normalize-model-name.d.ts +1 -0
  82. package/declarations/store/-private/utils/uuid-polyfill.d.ts +1 -0
  83. package/declarations/store/-private.d.ts +31 -0
  84. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +99 -0
  85. package/declarations/store/-types/q/ds-model.d.ts +21 -0
  86. package/declarations/store/-types/q/identifier.d.ts +20 -0
  87. package/declarations/store/-types/q/record-instance.d.ts +23 -0
  88. package/declarations/store/-types/q/schema-service.d.ts +354 -0
  89. package/declarations/store/-types/q/store.d.ts +32 -0
  90. package/declarations/store.d.ts +1 -0
  91. package/declarations/types/-private.d.ts +16 -8
  92. package/declarations/types/cache/aliases.d.ts +11 -1
  93. package/declarations/types/cache/change.d.ts +4 -5
  94. package/declarations/types/cache/mutations.d.ts +51 -28
  95. package/declarations/types/cache/operations.d.ts +60 -47
  96. package/declarations/types/cache/relationship.d.ts +11 -9
  97. package/declarations/types/cache.d.ts +495 -484
  98. package/declarations/types/graph.d.ts +31 -40
  99. package/declarations/types/identifier.d.ts +83 -82
  100. package/declarations/types/json/raw.d.ts +1 -2
  101. package/declarations/types/params.d.ts +4 -5
  102. package/declarations/types/record.d.ts +117 -76
  103. package/declarations/types/request.d.ts +289 -266
  104. package/declarations/types/runtime.d.ts +8 -9
  105. package/declarations/types/schema/concepts.d.ts +19 -13
  106. package/declarations/types/schema/fields.d.ts +1712 -1741
  107. package/declarations/types/schema/fields.type-test.d.ts +0 -1
  108. package/declarations/types/spec/document.d.ts +28 -22
  109. package/declarations/types/spec/error.d.ts +16 -17
  110. package/declarations/types/spec/json-api-raw.d.ts +102 -102
  111. package/declarations/types/symbols.d.ts +74 -75
  112. package/declarations/types/utils.d.ts +5 -5
  113. package/declarations/types.d.ts +10 -7
  114. package/declarations/utils/string.d.ts +48 -0
  115. package/dist/build-config/babel-macros.js +1 -0
  116. package/dist/build-config/canary-features.js +1 -0
  117. package/dist/build-config/debugging.js +1 -0
  118. package/dist/build-config/deprecations.js +1 -0
  119. package/dist/build-config/env.js +1 -0
  120. package/dist/build-config/macros.js +1 -0
  121. package/dist/build-config.js +1 -0
  122. package/dist/configure-B48bFHOl.js +181 -0
  123. package/dist/configure.js +1 -0
  124. package/dist/{context-DE5sFezZ.js → context-COmAnXUQ.js} +2 -2
  125. package/dist/graph/-private.js +3372 -0
  126. package/dist/handler-C2T-IyJK.js +339 -0
  127. package/dist/index.js +37 -104
  128. package/dist/reactive/-private.js +1 -0
  129. package/dist/reactive.js +1988 -0
  130. package/dist/request-state-CjLph1LP.js +8139 -0
  131. package/dist/request.js +1 -1
  132. package/dist/store/-private.js +3 -0
  133. package/dist/store.js +545 -0
  134. package/dist/symbols-SIstXMLI.js +44 -0
  135. package/dist/types/-private.js +3 -3
  136. package/dist/types/record.js +1 -1
  137. package/dist/types/request.js +2 -2
  138. package/dist/types/runtime.js +1 -1
  139. package/dist/types/schema/fields.js +8 -41
  140. package/dist/types/symbols.js +3 -3
  141. package/dist/utils/string.js +92 -0
  142. package/logos/NCC-1701-a-blue.svg +4 -0
  143. package/logos/NCC-1701-a-gold.svg +4 -0
  144. package/logos/NCC-1701-a-gold_100.svg +1 -0
  145. package/logos/NCC-1701-a-gold_base-64.txt +1 -0
  146. package/logos/NCC-1701-a.svg +4 -0
  147. package/logos/README.md +4 -0
  148. package/logos/docs-badge.svg +2 -0
  149. package/logos/ember-data-logo-dark.svg +12 -0
  150. package/logos/ember-data-logo-light.svg +12 -0
  151. package/logos/github-header.svg +444 -0
  152. package/logos/social1.png +0 -0
  153. package/logos/social2.png +0 -0
  154. package/logos/warp-drive-logo-dark.svg +4 -0
  155. package/logos/warp-drive-logo-gold.svg +4 -0
  156. package/package.json +11 -8
  157. package/declarations/index.d.ts.map +0 -1
  158. package/declarations/request/-private/context.d.ts.map +0 -1
  159. package/declarations/request/-private/debug.d.ts.map +0 -1
  160. package/declarations/request/-private/fetch.d.ts.map +0 -1
  161. package/declarations/request/-private/future.d.ts.map +0 -1
  162. package/declarations/request/-private/manager.d.ts.map +0 -1
  163. package/declarations/request/-private/promise-cache.d.ts.map +0 -1
  164. package/declarations/request/-private/types.d.ts.map +0 -1
  165. package/declarations/request/-private/utils.d.ts.map +0 -1
  166. package/declarations/request.d.ts.map +0 -1
  167. package/declarations/types/-private.d.ts.map +0 -1
  168. package/declarations/types/cache/aliases.d.ts.map +0 -1
  169. package/declarations/types/cache/change.d.ts.map +0 -1
  170. package/declarations/types/cache/mutations.d.ts.map +0 -1
  171. package/declarations/types/cache/operations.d.ts.map +0 -1
  172. package/declarations/types/cache/relationship.d.ts.map +0 -1
  173. package/declarations/types/cache.d.ts.map +0 -1
  174. package/declarations/types/graph.d.ts.map +0 -1
  175. package/declarations/types/identifier.d.ts.map +0 -1
  176. package/declarations/types/json/raw.d.ts.map +0 -1
  177. package/declarations/types/params.d.ts.map +0 -1
  178. package/declarations/types/record.d.ts.map +0 -1
  179. package/declarations/types/record.type-test.d.ts +0 -2
  180. package/declarations/types/record.type-test.d.ts.map +0 -1
  181. package/declarations/types/request.d.ts.map +0 -1
  182. package/declarations/types/request.type-test.d.ts +0 -2
  183. package/declarations/types/request.type-test.d.ts.map +0 -1
  184. package/declarations/types/runtime.d.ts.map +0 -1
  185. package/declarations/types/schema/concepts.d.ts.map +0 -1
  186. package/declarations/types/schema/fields.d.ts.map +0 -1
  187. package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
  188. package/declarations/types/spec/document.d.ts.map +0 -1
  189. package/declarations/types/spec/error.d.ts.map +0 -1
  190. package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
  191. package/declarations/types/symbols.d.ts.map +0 -1
  192. package/declarations/types/utils.d.ts.map +0 -1
  193. package/declarations/types.d.ts.map +0 -1
  194. package/dist/context-DE5sFezZ.js.map +0 -1
  195. package/dist/index.js.map +0 -1
  196. package/dist/request.js.map +0 -1
  197. package/dist/types/-private.js.map +0 -1
  198. package/dist/types/cache/aliases.js.map +0 -1
  199. package/dist/types/cache/change.js.map +0 -1
  200. package/dist/types/cache/mutations.js.map +0 -1
  201. package/dist/types/cache/operations.js.map +0 -1
  202. package/dist/types/cache/relationship.js.map +0 -1
  203. package/dist/types/cache.js.map +0 -1
  204. package/dist/types/graph.js.map +0 -1
  205. package/dist/types/identifier.js.map +0 -1
  206. package/dist/types/json/raw.js.map +0 -1
  207. package/dist/types/params.js.map +0 -1
  208. package/dist/types/record.js.map +0 -1
  209. package/dist/types/request.js.map +0 -1
  210. package/dist/types/runtime.js.map +0 -1
  211. package/dist/types/schema/concepts.js.map +0 -1
  212. package/dist/types/schema/fields.js.map +0 -1
  213. package/dist/types/schema/fields.type-test.js.map +0 -1
  214. package/dist/types/spec/document.js.map +0 -1
  215. package/dist/types/spec/error.js.map +0 -1
  216. package/dist/types/spec/json-api-raw.js.map +0 -1
  217. package/dist/types/symbols.js.map +0 -1
  218. package/dist/types/utils.js.map +0 -1
  219. package/dist/types.js.map +0 -1
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=fields.type-test.d.ts.map
@@ -1,31 +1,37 @@
1
- import type { StableExistingRecordIdentifier } from '../identifier.ts';
2
- import type { ApiError } from './error.ts';
3
- import type { Links, Meta, PaginationLinks } from './json-api-raw.ts';
1
+ import type { StableExistingRecordIdentifier } from "../identifier.js";
2
+ import type { ApiError } from "./error.js";
3
+ import type { Links, Meta, PaginationLinks } from "./json-api-raw.js";
4
4
  export interface ResourceMetaDocument {
5
- lid?: string;
6
- meta: Meta;
7
- links?: Links | PaginationLinks;
5
+ // the url or cache-key associated with the structured document
6
+ lid?: string;
7
+ meta: Meta;
8
+ links?: Links | PaginationLinks;
8
9
  }
9
- export interface SingleResourceDataDocument<T = StableExistingRecordIdentifier, R = StableExistingRecordIdentifier> {
10
- lid?: string;
11
- links?: Links | PaginationLinks;
12
- meta?: Meta;
13
- data: T | null;
14
- included?: R[];
10
+ export interface SingleResourceDataDocument<
11
+ T = StableExistingRecordIdentifier,
12
+ R = StableExistingRecordIdentifier
13
+ > {
14
+ // the url or cache-key associated with the structured document
15
+ lid?: string;
16
+ links?: Links | PaginationLinks;
17
+ meta?: Meta;
18
+ data: T | null;
19
+ included?: R[];
15
20
  }
16
21
  export interface CollectionResourceDataDocument<T = StableExistingRecordIdentifier> {
17
- lid?: string;
18
- links?: Links | PaginationLinks;
19
- meta?: Meta;
20
- data: T[];
21
- included?: T[];
22
+ // the url or cache-key associated with the structured document
23
+ lid?: string;
24
+ links?: Links | PaginationLinks;
25
+ meta?: Meta;
26
+ data: T[];
27
+ included?: T[];
22
28
  }
23
29
  export type ResourceDataDocument<T = StableExistingRecordIdentifier> = SingleResourceDataDocument<T> | CollectionResourceDataDocument<T>;
24
30
  export interface ResourceErrorDocument {
25
- lid?: string;
26
- links?: Links | PaginationLinks;
27
- meta?: Meta;
28
- errors: ApiError[];
31
+ // the url or cache-key associated with the structured document
32
+ lid?: string;
33
+ links?: Links | PaginationLinks;
34
+ meta?: Meta;
35
+ errors: ApiError[];
29
36
  }
30
37
  export type ResourceDocument<T = StableExistingRecordIdentifier> = ResourceMetaDocument | SingleResourceDataDocument<T> | CollectionResourceDataDocument<T> | ResourceErrorDocument;
31
- //# sourceMappingURL=document.d.ts.map
@@ -1,19 +1,18 @@
1
- import type { Link, Meta } from './json-api-raw.ts';
1
+ import type { Link, Meta } from "./json-api-raw.js";
2
2
  export interface ApiError {
3
- id?: string;
4
- title?: string;
5
- detail?: string;
6
- links?: {
7
- about?: Link;
8
- type?: Link;
9
- };
10
- status?: string;
11
- code?: string;
12
- source?: {
13
- pointer: string;
14
- parameter?: string;
15
- header?: string;
16
- };
17
- meta?: Meta;
3
+ id?: string;
4
+ title?: string;
5
+ detail?: string;
6
+ links?: {
7
+ about?: Link;
8
+ type?: Link;
9
+ };
10
+ status?: string;
11
+ code?: string;
12
+ source?: {
13
+ pointer: string;
14
+ parameter?: string;
15
+ header?: string;
16
+ };
17
+ meta?: Meta;
18
18
  }
19
- //# sourceMappingURL=error.d.ts.map
@@ -1,142 +1,142 @@
1
- import type { ArrayValue, ObjectValue } from '../json/raw.ts';
1
+ import type { ArrayValue, ObjectValue } from "../json/raw.js";
2
2
  export type Meta = ObjectValue;
3
3
  export type LinkObject = {
4
- href: string;
5
- meta?: Meta;
4
+ href: string;
5
+ meta?: Meta;
6
6
  };
7
7
  export type Link = string | LinkObject;
8
8
  export interface Links {
9
- related?: Link | null;
10
- self?: Link | null;
9
+ related?: Link | null;
10
+ self?: Link | null;
11
11
  }
12
12
  export interface PaginationLinks extends Links {
13
- first?: Link | null;
14
- last?: Link | null;
15
- prev?: Link | null;
16
- next?: Link | null;
13
+ first?: Link | null;
14
+ last?: Link | null;
15
+ prev?: Link | null;
16
+ next?: Link | null;
17
17
  }
18
18
  /**
19
- * Serves as a reference to a `Resource` but does not contain
20
- * any data itself.
21
- *
22
- * Used to establish relationship linkages between `Resources` and
23
- * to address data that may not be available synchronously.
24
- *
25
- * [JSON:API Spec](https://jsonapi.org/format/#document-resource-identifier-objects)
26
- * @internal
27
- */
19
+ * Serves as a reference to a `Resource` but does not contain
20
+ * any data itself.
21
+ *
22
+ * Used to establish relationship linkages between `Resources` and
23
+ * to address data that may not be available synchronously.
24
+ *
25
+ * [JSON:API Spec](https://jsonapi.org/format/#document-resource-identifier-objects)
26
+ * @internal
27
+ */
28
28
  export interface ExistingResourceIdentifierObject<T extends string = string> {
29
- id: string;
30
- type: T;
31
- /**
32
- * While not officially part of the `JSON:API` spec,
33
- * `ember-data` allows the use of `lid` as a local
34
- * identifier for a `Resource`.
35
- *
36
- * @recommended It is best to include the lid used when creating
37
- * a new resource if this is the response to a new resource creation,
38
- * also recommended if this resource type uses secondary indexes.
39
- *
40
- * Once a `ResourceIdentifierObject` has been seen by the cache, `lid`
41
- * should always be present. Only when inbound from the an `API` response
42
- * is `lid` considered optional.
43
- *
44
- * [Identifiers RFC](https://github.com/emberjs/rfcs/blob/main/text/0403-ember-data-identifiers.md#ember-data--identifiers)
45
- * @internal
46
- */
47
- lid?: string;
48
- /**
49
- * While valid in the `JSON:API` spec,
50
- * `ember-data` ignores `meta` on `ResourceIdentifierObjects`
51
- *
52
- * @ignored this property goes un-utilized and will be lost
53
- * @internal
54
- */
55
- meta?: Meta;
29
+ id: string;
30
+ type: T;
31
+ /**
32
+ * While not officially part of the `JSON:API` spec,
33
+ * `ember-data` allows the use of `lid` as a local
34
+ * identifier for a `Resource`.
35
+ *
36
+ * @recommended It is best to include the lid used when creating
37
+ * a new resource if this is the response to a new resource creation,
38
+ * also recommended if this resource type uses secondary indexes.
39
+ *
40
+ * Once a `ResourceIdentifierObject` has been seen by the cache, `lid`
41
+ * should always be present. Only when inbound from the an `API` response
42
+ * is `lid` considered optional.
43
+ *
44
+ * [Identifiers RFC](https://github.com/emberjs/rfcs/blob/main/text/0403-ember-data-identifiers.md#ember-data--identifiers)
45
+ * @internal
46
+ */
47
+ lid?: string;
48
+ /**
49
+ * While valid in the `JSON:API` spec,
50
+ * `ember-data` ignores `meta` on `ResourceIdentifierObjects`
51
+ *
52
+ * @ignored this property goes un-utilized and will be lost
53
+ * @internal
54
+ */
55
+ meta?: Meta;
56
56
  }
57
57
  /**
58
- * Serves as a reference to a resource created on the client
59
- * but not yet persisted.
60
- *
61
- * @internal
62
- */
58
+ * Serves as a reference to a resource created on the client
59
+ * but not yet persisted.
60
+ *
61
+ * @internal
62
+ */
63
63
  export interface NewResourceIdentifierObject<T extends string = string> {
64
- /**
65
- * Resources newly created on the client _may_
66
- * not have an `id` available to them prior
67
- * to completion of their first successful `save`.
68
- *
69
- * `id` will be `null` in this case.
70
- *
71
- * @internal
72
- */
73
- id: string | null;
74
- type: T;
75
- /**
76
- * Resources newly created on the client _will always_
77
- * have an `lid` assigned immediately and available.
78
- * @internal
79
- */
80
- lid: string;
64
+ /**
65
+ * Resources newly created on the client _may_
66
+ * not have an `id` available to them prior
67
+ * to completion of their first successful `save`.
68
+ *
69
+ * `id` will be `null` in this case.
70
+ *
71
+ * @internal
72
+ */
73
+ id: string | null;
74
+ type: T;
75
+ /**
76
+ * Resources newly created on the client _will always_
77
+ * have an `lid` assigned immediately and available.
78
+ * @internal
79
+ */
80
+ lid: string;
81
81
  }
82
82
  export interface ResourceIdentifier {
83
- lid: string;
83
+ lid: string;
84
84
  }
85
85
  export type ResourceIdentifierObject<T extends string = string> = ResourceIdentifier | ExistingResourceIdentifierObject<T> | NewResourceIdentifierObject<T>;
86
+ // TODO disallow NewResource, make narrowable
86
87
  export interface SingleResourceRelationship<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> {
87
- data?: T | null;
88
- meta?: Meta;
89
- links?: Links;
88
+ data?: T | null;
89
+ meta?: Meta;
90
+ links?: Links;
90
91
  }
91
92
  export interface CollectionResourceRelationship<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> {
92
- data?: T[];
93
- meta?: Meta;
94
- links?: PaginationLinks;
93
+ data?: T[];
94
+ meta?: Meta;
95
+ links?: PaginationLinks;
95
96
  }
96
97
  export type InnerRelationshipDocument<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> = SingleResourceRelationship<T> | CollectionResourceRelationship<T>;
97
98
  export type ResourceRelationshipsObject<T = ExistingResourceIdentifierObject | NewResourceIdentifierObject> = Record<string, InnerRelationshipDocument<T>>;
98
99
  /**
99
- * Contains the data for an existing resource in JSON:API format
100
- * @internal
101
- */
100
+ * Contains the data for an existing resource in JSON:API format
101
+ * @internal
102
+ */
102
103
  export interface ExistingResourceObject<T extends string = string> extends ExistingResourceIdentifierObject<T> {
103
- meta?: Meta;
104
- attributes?: ObjectValue;
105
- relationships?: ResourceRelationshipsObject<ExistingResourceIdentifierObject>;
106
- links?: Links;
104
+ meta?: Meta;
105
+ attributes?: ObjectValue;
106
+ relationships?: ResourceRelationshipsObject<ExistingResourceIdentifierObject>;
107
+ links?: Links;
107
108
  }
108
109
  export type NewResourceObject<T extends string = string> = NewResourceIdentifierObject<T> & {
109
- meta?: Meta;
110
- attributes?: ObjectValue;
111
- relationships?: ResourceRelationshipsObject;
112
- links?: Links;
110
+ meta?: Meta;
111
+ attributes?: ObjectValue;
112
+ relationships?: ResourceRelationshipsObject;
113
+ links?: Links;
113
114
  };
114
115
  export type ResourceObject<T extends string = string> = ExistingResourceObject<T> | NewResourceObject<T>;
115
116
  type Document = {
116
- lid?: string;
117
- meta?: Meta;
118
- included?: ExistingResourceObject[];
119
- jsonapi?: ObjectValue;
120
- links?: Links | PaginationLinks;
121
- errors?: ArrayValue;
117
+ lid?: string;
118
+ meta?: Meta;
119
+ included?: ExistingResourceObject[];
120
+ jsonapi?: ObjectValue;
121
+ links?: Links | PaginationLinks;
122
+ errors?: ArrayValue;
122
123
  };
123
124
  export type EmptyResourceDocument = Document & {
124
- data: null;
125
+ data: null;
125
126
  };
126
127
  export type SingleResourceDocument<T extends string = string> = Document & {
127
- data: ExistingResourceObject<T>;
128
+ data: ExistingResourceObject<T>;
128
129
  };
129
130
  export type CollectionResourceDocument<T extends string = string> = Document & {
130
- data: ExistingResourceObject<T>[];
131
+ data: ExistingResourceObject<T>[];
131
132
  };
132
133
  /**
133
- * A (RAW) JSON:API Formatted Document.
134
- *
135
- * These documents should follow the JSON:API spec but do not
136
- * have the same level of guarantees as their `spec` counterparts.
137
- *
138
- * @internal
139
- */
134
+ * A (RAW) JSON:API Formatted Document.
135
+ *
136
+ * These documents should follow the JSON:API spec but do not
137
+ * have the same level of guarantees as their `spec` counterparts.
138
+ *
139
+ * @internal
140
+ */
140
141
  export type JsonApiDocument<T extends string = string> = EmptyResourceDocument | SingleResourceDocument<T> | CollectionResourceDocument<T>;
141
142
  export {};
142
- //# sourceMappingURL=json-api-raw.d.ts.map
@@ -1,79 +1,78 @@
1
- export declare const RecordStore: '___(unique) Symbol(Store)';
1
+ export declare const RecordStore: "___(unique) Symbol(Store)";
2
2
  /**
3
- * Symbol for the name of a resource, transformation
4
- * or derivation.
5
- *
6
- * ### With Resources
7
- *
8
- * This is an optional feature that can be used by
9
- * record implementations to provide a typescript
10
- * hint for the type of the resource.
11
- *
12
- * When used, EmberData and WarpDrive APIs can
13
- * take advantage of this to provide better type
14
- * safety and intellisense.
15
- *
16
- * ### With Derivations
17
- *
18
- * Required for derivations registered with
19
- * `store.registerDerivation(derivation)`.
20
- *
21
- * ```ts
22
- * function concat(record: object, options: ObjectValue | null, prop: string): string {}
23
- * concat[Name] = 'concat';
24
- * ```
25
- *
26
- * ### With Transforms
27
- *
28
- * Required for new-style transformations registered
29
- * with `store.registerTransform(transform)`.
30
- *
31
- * For legacy transforms, if not used,
32
- * `attr<Transform>('name')` will allow any string name.
33
- * `attr('name')` will always allow any string name.
34
- *
35
- * If used, `attr<Transform>('name')` will enforce
36
- * that the name is the same as the transform name.
37
- *
38
- * @type {Symbol}
39
- */
40
- export declare const Type: '___(unique) Symbol($type)';
3
+ * Symbol for the name of a resource, transformation
4
+ * or derivation.
5
+ *
6
+ * ### With Resources
7
+ *
8
+ * This is an optional feature that can be used by
9
+ * record implementations to provide a typescript
10
+ * hint for the type of the resource.
11
+ *
12
+ * When used, EmberData/WarpDrive APIs can
13
+ * take advantage of this to provide better type
14
+ * safety and intellisense.
15
+ *
16
+ * ### With Derivations
17
+ *
18
+ * Required for derivations registered with
19
+ * `store.registerDerivation(derivation)`.
20
+ *
21
+ * ```ts
22
+ * function concat(record: object, options: ObjectValue | null, prop: string): string {}
23
+ * concat[Name] = 'concat';
24
+ * ```
25
+ *
26
+ * ### With Transforms
27
+ *
28
+ * Required for new-style transformations registered
29
+ * with `store.registerTransform(transform)`.
30
+ *
31
+ * For legacy transforms, if not used,
32
+ * `attr<Transform>('name')` will allow any string name.
33
+ * `attr('name')` will always allow any string name.
34
+ *
35
+ * If used, `attr<Transform>('name')` will enforce
36
+ * that the name is the same as the transform name.
37
+ *
38
+ * @type {Symbol}
39
+ */
40
+ export declare const Type: "___(unique) Symbol($type)";
41
41
  /**
42
- * Symbol for the type of a resource.
43
- *
44
- * This is an optional feature that can be used by
45
- * record implementations to provide a typescript
46
- * hint for the type of the resource.
47
- *
48
- * When used, EmberData and WarpDrive APIs can
49
- * take advantage of this to provide better type
50
- * safety and intellisense.
51
- *
52
- * @type {Symbol}
53
- */
54
- export declare const ResourceType: '___(unique) Symbol($type)';
42
+ * Symbol for the type of a resource.
43
+ *
44
+ * This is an optional feature that can be used by
45
+ * record implementations to provide a typescript
46
+ * hint for the type of the resource.
47
+ *
48
+ * When used, EmberData/WarpDrive APIs can
49
+ * take advantage of this to provide better type
50
+ * safety and intellisense.
51
+ *
52
+ * @type {Symbol}
53
+ */
54
+ export declare const ResourceType: "___(unique) Symbol($type)";
55
55
  /**
56
- * Symbol for the name of a transform.
57
- *
58
- * This is an optional feature that can be used by
59
- * transform implementations to provide a typescript
60
- * hint for the name of the transform.
61
- *
62
- * If not used, `attr<Transform>('name')` will
63
- * allow any string name. `attr('name')` will always
64
- * allow any string name.
65
- *
66
- * If used, `attr<Transform>('name')` will enforce
67
- * that the name is the same as the transform name.
68
- *
69
- * @type {Symbol}
70
- */
71
- export declare const TransformName: '___(unique) Symbol($type)';
56
+ * Symbol for the name of a transform.
57
+ *
58
+ * This is an optional feature that can be used by
59
+ * transform implementations to provide a typescript
60
+ * hint for the name of the transform.
61
+ *
62
+ * If not used, `attr<Transform>('name')` will
63
+ * allow any string name. `attr('name')` will always
64
+ * allow any string name.
65
+ *
66
+ * If used, `attr<Transform>('name')` will enforce
67
+ * that the name is the same as the transform name.
68
+ *
69
+ * @type {Symbol}
70
+ */
71
+ export declare const TransformName: "___(unique) Symbol($type)";
72
72
  /**
73
- * Symbol for use by builders to indicate the return type
74
- * generic to use for store.request()
75
- *
76
- * @type {Symbol}
77
- */
78
- export declare const RequestSignature: '___(unique) Symbol(RequestSignature)';
79
- //# sourceMappingURL=symbols.d.ts.map
73
+ * Symbol for use by builders to indicate the return type
74
+ * generic to use for store.request()
75
+ *
76
+ * @type {Symbol}
77
+ */
78
+ export declare const RequestSignature: "___(unique) Symbol(RequestSignature)";
@@ -1,5 +1,5 @@
1
- export type WithPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
2
- export type Mutable<T> = {
3
- -readonly [P in keyof T]: T[P];
4
- };
5
- //# sourceMappingURL=utils.d.ts.map
1
+ export type WithPartial<
2
+ T,
3
+ K extends keyof T
4
+ > = Omit<T, K> & Partial<Pick<T, K>>;
5
+ export type Mutable<T> = { -readonly [P in keyof T] : T[P] };
@@ -1,8 +1,11 @@
1
1
  /**
2
- * This package provides core types, type-utilities, symbols
3
- * and constants used across the WarpDrive ecosystem.
4
- *
5
- * @module
6
- */
7
- export type { StableRecordIdentifier, ResourceKey } from './types/identifier.ts';
8
- //# sourceMappingURL=types.d.ts.map
2
+ * This package provides core types, type-utilities, symbols
3
+ * and constants used across the WarpDrive ecosystem.
4
+ *
5
+ * @module
6
+ */
7
+ export type { StableRecordIdentifier, ResourceKey } from "./types/identifier.js";
8
+ export type { CacheCapabilitiesManager } from "./store/-types/q/cache-capabilities-manager.js";
9
+ export type { ModelSchema } from "./store/-types/q/ds-model.js";
10
+ export type { SchemaService } from "./store/-types/q/schema-service.js";
11
+ export type { BaseFinderOptions, FindRecordOptions, LegacyResourceQuery, QueryOptions, FindAllOptions } from "./store/-types/q/store.js";
@@ -0,0 +1,48 @@
1
+ /**
2
+ * An LRUCache implementation with upsert semantics.
3
+ *
4
+ * This implementation is *not* generic, but focuses on
5
+ * performance tuning for the string transformation cases
6
+ * where the key maps to the value very simply.
7
+ *
8
+ * It takes a work function that should generate a new value
9
+ * for a given key when called. It will be called when the key
10
+ * is not found in the cache.
11
+ *
12
+ * It keeps track of the number of hits, misses, and ejections
13
+ * in DEBUG envs, which is useful for tuning the cache size.
14
+ *
15
+ * This is an internal utility class for use by this module
16
+ * and by `@warp-drive/utilities/string`. It is not intended
17
+ * for use outside of these modules at this time.
18
+ *
19
+ * @internal
20
+ */
21
+ export declare class LRUCache<
22
+ T,
23
+ V
24
+ > {
25
+ size: number;
26
+ state: Map<T, V>;
27
+ doWork: (k: T) => V;
28
+ // debug stats
29
+ _hits: number;
30
+ _misses: number;
31
+ _ejected: number;
32
+ constructor(doWork: (k: T) => V, size?: number);
33
+ get(key: T): V;
34
+ set(key: T, value: V): void;
35
+ clear(): void;
36
+ }
37
+ export declare const STRING_DASHERIZE_CACHE: LRUCache<string, string>;
38
+ /**
39
+ * This is an internal utility function that converts a string
40
+ * to a dasherized format. Library consumers should use the
41
+ * re-exported version from `@warp-drive/utilities/string` instead.
42
+ *
43
+ * This version is only in this location to support a deprecated
44
+ * behavior in the core package and will be removed in a future.
45
+ *
46
+ * @internal
47
+ */
48
+ export declare function dasherize(str: string): string;
@@ -0,0 +1 @@
1
+ export { macros } from '@warp-drive/build-config/babel-macros';
@@ -0,0 +1 @@
1
+ export * from '@warp-drive/build-config/canary-features';
@@ -0,0 +1 @@
1
+ export * from '@warp-drive/build-config/debugging';
@@ -0,0 +1 @@
1
+ export * from '@warp-drive/build-config/deprecations';
@@ -0,0 +1 @@
1
+ export { DEBUG, IS_CI, IS_RECORDING, PRODUCTION, SHOULD_RECORD, TESTING } from '@warp-drive/build-config/env';
@@ -0,0 +1 @@
1
+ export { assert } from '@warp-drive/build-config/macros';
@@ -0,0 +1 @@
1
+ export { setConfig } from '@warp-drive/build-config';