@warp-drive/core 5.6.0-alpha.15 → 5.6.0-alpha.18

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 (286) hide show
  1. package/declarations/build-config/babel-macros.d.ts +1 -2
  2. package/declarations/build-config/canary-features.d.ts +1 -2
  3. package/declarations/build-config/debugging.d.ts +1 -2
  4. package/declarations/build-config/deprecations.d.ts +1 -2
  5. package/declarations/build-config/env.d.ts +1 -2
  6. package/declarations/build-config/macros.d.ts +1 -2
  7. package/declarations/build-config.d.ts +1 -2
  8. package/declarations/configure.d.ts +6 -7
  9. package/declarations/graph/-private/-diff.d.ts +21 -22
  10. package/declarations/graph/-private/-edge-definition.d.ts +134 -135
  11. package/declarations/graph/-private/-state.d.ts +93 -7
  12. package/declarations/graph/-private/-utils.d.ts +18 -13
  13. package/declarations/graph/-private/coerce-id.d.ts +6 -1
  14. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +15 -4
  15. package/declarations/graph/-private/edges/collection.d.ts +35 -36
  16. package/declarations/graph/-private/edges/implicit.d.ts +28 -29
  17. package/declarations/graph/-private/edges/resource.d.ts +19 -20
  18. package/declarations/graph/-private/graph.d.ts +83 -48
  19. package/declarations/graph/-private/normalize-link.d.ts +7 -2
  20. package/declarations/graph/-private/operations/add-to-related-records.d.ts +3 -4
  21. package/declarations/graph/-private/operations/merge-identifier.d.ts +2 -3
  22. package/declarations/graph/-private/operations/remove-from-related-records.d.ts +3 -4
  23. package/declarations/graph/-private/operations/replace-related-record.d.ts +2 -3
  24. package/declarations/graph/-private/operations/replace-related-records.d.ts +58 -4
  25. package/declarations/graph/-private/operations/update-relationship.d.ts +11 -9
  26. package/declarations/graph/-private.d.ts +9 -10
  27. package/declarations/index.d.ts +11 -12
  28. package/declarations/reactive/-private/document.d.ts +143 -144
  29. package/declarations/reactive/-private/fields/compute.d.ts +31 -28
  30. package/declarations/reactive/-private/fields/extension.d.ts +2 -3
  31. package/declarations/reactive/-private/fields/managed-array.d.ts +19 -20
  32. package/declarations/reactive/-private/fields/managed-object.d.ts +16 -16
  33. package/declarations/reactive/-private/fields/many-array-manager.d.ts +15 -16
  34. package/declarations/reactive/-private/hooks.d.ts +3 -4
  35. package/declarations/reactive/-private/record.d.ts +61 -59
  36. package/declarations/reactive/-private/schema.d.ts +242 -224
  37. package/declarations/reactive/-private/symbols.d.ts +26 -1
  38. package/declarations/reactive/-private.d.ts +1 -2
  39. package/declarations/reactive.d.ts +4 -5
  40. package/declarations/request/-private/context.d.ts +34 -35
  41. package/declarations/request/-private/debug.d.ts +2 -3
  42. package/declarations/request/-private/fetch.d.ts +23 -24
  43. package/declarations/request/-private/future.d.ts +3 -4
  44. package/declarations/request/-private/manager.d.ts +159 -157
  45. package/declarations/request/-private/promise-cache.d.ts +21 -13
  46. package/declarations/request/-private/types.d.ts +124 -124
  47. package/declarations/request/-private/utils.d.ts +8 -9
  48. package/declarations/request.d.ts +5 -6
  49. package/declarations/store/-private/cache-handler/handler.d.ts +57 -52
  50. package/declarations/store/-private/cache-handler/types.d.ts +95 -96
  51. package/declarations/store/-private/cache-handler/utils.d.ts +16 -16
  52. package/declarations/store/-private/caches/cache-utils.d.ts +7 -4
  53. package/declarations/store/-private/caches/identifier-cache.d.ts +234 -246
  54. package/declarations/store/-private/caches/instance-cache.d.ts +47 -47
  55. package/declarations/store/-private/caches/resource-utils.d.ts +3 -4
  56. package/declarations/store/-private/debug/utils.d.ts +6 -7
  57. package/declarations/store/-private/default-cache-policy.d.ts +362 -361
  58. package/declarations/store/-private/legacy-model-support/record-reference.d.ts +154 -159
  59. package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +14 -14
  60. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +21 -22
  61. package/declarations/store/-private/managers/cache-manager.d.ts +440 -425
  62. package/declarations/store/-private/managers/notification-manager.d.ts +88 -83
  63. package/declarations/store/-private/managers/record-array-manager.d.ts +89 -90
  64. package/declarations/store/-private/network/request-cache.d.ts +86 -83
  65. package/declarations/store/-private/new-core-tmp/promise-state.d.ts +252 -244
  66. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +154 -155
  67. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +148 -149
  68. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +28 -23
  69. package/declarations/store/-private/new-core-tmp/request-state.d.ts +263 -241
  70. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +253 -223
  71. package/declarations/store/-private/record-arrays/identifier-array.d.ts +125 -121
  72. package/declarations/store/-private/record-arrays/many-array.d.ts +180 -184
  73. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +120 -110
  74. package/declarations/store/-private/store-service.d.ts +1594 -1586
  75. package/declarations/store/-private/utils/coerce-id.d.ts +6 -1
  76. package/declarations/store/-private/utils/construct-resource.d.ts +1 -2
  77. package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
  78. package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
  79. package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
  80. package/declarations/store/-private.d.ts +31 -28
  81. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +96 -97
  82. package/declarations/store/-types/q/ds-model.d.ts +17 -18
  83. package/declarations/store/-types/q/identifier.d.ts +11 -12
  84. package/declarations/store/-types/q/record-instance.d.ts +16 -17
  85. package/declarations/store/-types/q/schema-service.d.ts +346 -343
  86. package/declarations/store/-types/q/store.d.ts +25 -28
  87. package/declarations/store.d.ts +1 -2
  88. package/declarations/types/-private.d.ts +16 -8
  89. package/declarations/types/cache/aliases.d.ts +11 -1
  90. package/declarations/types/cache/change.d.ts +4 -5
  91. package/declarations/types/cache/mutations.d.ts +51 -28
  92. package/declarations/types/cache/operations.d.ts +60 -47
  93. package/declarations/types/cache/relationship.d.ts +11 -9
  94. package/declarations/types/cache.d.ts +495 -484
  95. package/declarations/types/graph.d.ts +31 -32
  96. package/declarations/types/identifier.d.ts +83 -82
  97. package/declarations/types/json/raw.d.ts +1 -2
  98. package/declarations/types/params.d.ts +4 -5
  99. package/declarations/types/record.d.ts +117 -76
  100. package/declarations/types/request.d.ts +289 -266
  101. package/declarations/types/runtime.d.ts +8 -9
  102. package/declarations/types/schema/concepts.d.ts +19 -13
  103. package/declarations/types/schema/fields.d.ts +1712 -1713
  104. package/declarations/types/schema/fields.type-test.d.ts +0 -1
  105. package/declarations/types/spec/document.d.ts +28 -22
  106. package/declarations/types/spec/error.d.ts +16 -17
  107. package/declarations/types/spec/json-api-raw.d.ts +102 -102
  108. package/declarations/types/symbols.d.ts +74 -75
  109. package/declarations/types/utils.d.ts +5 -5
  110. package/declarations/types.d.ts +10 -11
  111. package/declarations/utils/string.d.ts +43 -40
  112. package/dist/graph/-private.js +1 -1
  113. package/dist/{handler-D1C3Innj.js → handler-C2T-IyJK.js} +1 -1
  114. package/dist/index.js +2 -2
  115. package/dist/reactive/-private.js +1 -1
  116. package/dist/reactive.js +42 -73
  117. package/dist/{request-state-CCOJIj5i.js → request-state-CjLph1LP.js} +275 -261
  118. package/dist/store/-private.js +2 -2
  119. package/dist/{symbols-epHW0Vm9.js → symbols-SIstXMLI.js} +1 -1
  120. package/dist/types/-private.js +1 -1
  121. package/package.json +4 -4
  122. package/declarations/build-config/babel-macros.d.ts.map +0 -1
  123. package/declarations/build-config/canary-features.d.ts.map +0 -1
  124. package/declarations/build-config/debugging.d.ts.map +0 -1
  125. package/declarations/build-config/deprecations.d.ts.map +0 -1
  126. package/declarations/build-config/env.d.ts.map +0 -1
  127. package/declarations/build-config/macros.d.ts.map +0 -1
  128. package/declarations/build-config.d.ts.map +0 -1
  129. package/declarations/configure.d.ts.map +0 -1
  130. package/declarations/graph/-private/-diff.d.ts.map +0 -1
  131. package/declarations/graph/-private/-edge-definition.d.ts.map +0 -1
  132. package/declarations/graph/-private/-state.d.ts.map +0 -1
  133. package/declarations/graph/-private/-utils.d.ts.map +0 -1
  134. package/declarations/graph/-private/coerce-id.d.ts.map +0 -1
  135. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts.map +0 -1
  136. package/declarations/graph/-private/edges/collection.d.ts.map +0 -1
  137. package/declarations/graph/-private/edges/implicit.d.ts.map +0 -1
  138. package/declarations/graph/-private/edges/resource.d.ts.map +0 -1
  139. package/declarations/graph/-private/graph.d.ts.map +0 -1
  140. package/declarations/graph/-private/normalize-link.d.ts.map +0 -1
  141. package/declarations/graph/-private/operations/add-to-related-records.d.ts.map +0 -1
  142. package/declarations/graph/-private/operations/merge-identifier.d.ts.map +0 -1
  143. package/declarations/graph/-private/operations/remove-from-related-records.d.ts.map +0 -1
  144. package/declarations/graph/-private/operations/replace-related-record.d.ts.map +0 -1
  145. package/declarations/graph/-private/operations/replace-related-records.d.ts.map +0 -1
  146. package/declarations/graph/-private/operations/update-relationship.d.ts.map +0 -1
  147. package/declarations/graph/-private.d.ts.map +0 -1
  148. package/declarations/index.d.ts.map +0 -1
  149. package/declarations/reactive/-private/document.d.ts.map +0 -1
  150. package/declarations/reactive/-private/fields/compute.d.ts.map +0 -1
  151. package/declarations/reactive/-private/fields/extension.d.ts.map +0 -1
  152. package/declarations/reactive/-private/fields/managed-array.d.ts.map +0 -1
  153. package/declarations/reactive/-private/fields/managed-object.d.ts.map +0 -1
  154. package/declarations/reactive/-private/fields/many-array-manager.d.ts.map +0 -1
  155. package/declarations/reactive/-private/hooks.d.ts.map +0 -1
  156. package/declarations/reactive/-private/record.d.ts.map +0 -1
  157. package/declarations/reactive/-private/schema.d.ts.map +0 -1
  158. package/declarations/reactive/-private/symbols.d.ts.map +0 -1
  159. package/declarations/reactive/-private.d.ts.map +0 -1
  160. package/declarations/reactive.d.ts.map +0 -1
  161. package/declarations/request/-private/context.d.ts.map +0 -1
  162. package/declarations/request/-private/debug.d.ts.map +0 -1
  163. package/declarations/request/-private/fetch.d.ts.map +0 -1
  164. package/declarations/request/-private/future.d.ts.map +0 -1
  165. package/declarations/request/-private/manager.d.ts.map +0 -1
  166. package/declarations/request/-private/promise-cache.d.ts.map +0 -1
  167. package/declarations/request/-private/types.d.ts.map +0 -1
  168. package/declarations/request/-private/utils.d.ts.map +0 -1
  169. package/declarations/request.d.ts.map +0 -1
  170. package/declarations/store/-private/cache-handler/handler.d.ts.map +0 -1
  171. package/declarations/store/-private/cache-handler/types.d.ts.map +0 -1
  172. package/declarations/store/-private/cache-handler/utils.d.ts.map +0 -1
  173. package/declarations/store/-private/caches/cache-utils.d.ts.map +0 -1
  174. package/declarations/store/-private/caches/identifier-cache.d.ts.map +0 -1
  175. package/declarations/store/-private/caches/instance-cache.d.ts.map +0 -1
  176. package/declarations/store/-private/caches/resource-utils.d.ts.map +0 -1
  177. package/declarations/store/-private/debug/utils.d.ts.map +0 -1
  178. package/declarations/store/-private/default-cache-policy.d.ts.map +0 -1
  179. package/declarations/store/-private/legacy-model-support/record-reference.d.ts.map +0 -1
  180. package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
  181. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
  182. package/declarations/store/-private/managers/cache-manager.d.ts.map +0 -1
  183. package/declarations/store/-private/managers/notification-manager.d.ts.map +0 -1
  184. package/declarations/store/-private/managers/record-array-manager.d.ts.map +0 -1
  185. package/declarations/store/-private/network/request-cache.d.ts.map +0 -1
  186. package/declarations/store/-private/new-core-tmp/promise-state.d.ts.map +0 -1
  187. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
  188. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
  189. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
  190. package/declarations/store/-private/new-core-tmp/request-state.d.ts.map +0 -1
  191. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts.map +0 -1
  192. package/declarations/store/-private/record-arrays/identifier-array.d.ts.map +0 -1
  193. package/declarations/store/-private/record-arrays/many-array.d.ts.map +0 -1
  194. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
  195. package/declarations/store/-private/store-service.d.ts.map +0 -1
  196. package/declarations/store/-private/store-service.type-test.d.ts +0 -2
  197. package/declarations/store/-private/store-service.type-test.d.ts.map +0 -1
  198. package/declarations/store/-private/utils/coerce-id.d.ts.map +0 -1
  199. package/declarations/store/-private/utils/construct-resource.d.ts.map +0 -1
  200. package/declarations/store/-private/utils/is-non-empty-string.d.ts.map +0 -1
  201. package/declarations/store/-private/utils/normalize-model-name.d.ts.map +0 -1
  202. package/declarations/store/-private/utils/uuid-polyfill.d.ts.map +0 -1
  203. package/declarations/store/-private.d.ts.map +0 -1
  204. package/declarations/store/-types/q/cache-capabilities-manager.d.ts.map +0 -1
  205. package/declarations/store/-types/q/ds-model.d.ts.map +0 -1
  206. package/declarations/store/-types/q/identifier.d.ts.map +0 -1
  207. package/declarations/store/-types/q/promise-proxies.d.ts +0 -2
  208. package/declarations/store/-types/q/promise-proxies.d.ts.map +0 -1
  209. package/declarations/store/-types/q/record-data-json-api.d.ts +0 -31
  210. package/declarations/store/-types/q/record-data-json-api.d.ts.map +0 -1
  211. package/declarations/store/-types/q/record-instance.d.ts.map +0 -1
  212. package/declarations/store/-types/q/schema-service.d.ts.map +0 -1
  213. package/declarations/store/-types/q/store.d.ts.map +0 -1
  214. package/declarations/store.d.ts.map +0 -1
  215. package/declarations/types/-private.d.ts.map +0 -1
  216. package/declarations/types/cache/aliases.d.ts.map +0 -1
  217. package/declarations/types/cache/change.d.ts.map +0 -1
  218. package/declarations/types/cache/mutations.d.ts.map +0 -1
  219. package/declarations/types/cache/operations.d.ts.map +0 -1
  220. package/declarations/types/cache/relationship.d.ts.map +0 -1
  221. package/declarations/types/cache.d.ts.map +0 -1
  222. package/declarations/types/graph.d.ts.map +0 -1
  223. package/declarations/types/identifier.d.ts.map +0 -1
  224. package/declarations/types/json/raw.d.ts.map +0 -1
  225. package/declarations/types/params.d.ts.map +0 -1
  226. package/declarations/types/record.d.ts.map +0 -1
  227. package/declarations/types/record.type-test.d.ts +0 -2
  228. package/declarations/types/record.type-test.d.ts.map +0 -1
  229. package/declarations/types/request.d.ts.map +0 -1
  230. package/declarations/types/request.type-test.d.ts +0 -2
  231. package/declarations/types/request.type-test.d.ts.map +0 -1
  232. package/declarations/types/runtime.d.ts.map +0 -1
  233. package/declarations/types/schema/concepts.d.ts.map +0 -1
  234. package/declarations/types/schema/fields.d.ts.map +0 -1
  235. package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
  236. package/declarations/types/spec/document.d.ts.map +0 -1
  237. package/declarations/types/spec/error.d.ts.map +0 -1
  238. package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
  239. package/declarations/types/symbols.d.ts.map +0 -1
  240. package/declarations/types/utils.d.ts.map +0 -1
  241. package/declarations/types.d.ts.map +0 -1
  242. package/declarations/utils/string.d.ts.map +0 -1
  243. package/dist/build-config/babel-macros.js.map +0 -1
  244. package/dist/build-config/canary-features.js.map +0 -1
  245. package/dist/build-config/debugging.js.map +0 -1
  246. package/dist/build-config/deprecations.js.map +0 -1
  247. package/dist/build-config/env.js.map +0 -1
  248. package/dist/build-config/macros.js.map +0 -1
  249. package/dist/build-config.js.map +0 -1
  250. package/dist/configure-B48bFHOl.js.map +0 -1
  251. package/dist/configure.js.map +0 -1
  252. package/dist/context-COmAnXUQ.js.map +0 -1
  253. package/dist/graph/-private.js.map +0 -1
  254. package/dist/handler-D1C3Innj.js.map +0 -1
  255. package/dist/index.js.map +0 -1
  256. package/dist/reactive/-private.js.map +0 -1
  257. package/dist/reactive.js.map +0 -1
  258. package/dist/request-state-CCOJIj5i.js.map +0 -1
  259. package/dist/request.js.map +0 -1
  260. package/dist/store/-private.js.map +0 -1
  261. package/dist/store.js.map +0 -1
  262. package/dist/symbols-epHW0Vm9.js.map +0 -1
  263. package/dist/types/-private.js.map +0 -1
  264. package/dist/types/cache/aliases.js.map +0 -1
  265. package/dist/types/cache/change.js.map +0 -1
  266. package/dist/types/cache/mutations.js.map +0 -1
  267. package/dist/types/cache/operations.js.map +0 -1
  268. package/dist/types/cache/relationship.js.map +0 -1
  269. package/dist/types/cache.js.map +0 -1
  270. package/dist/types/graph.js.map +0 -1
  271. package/dist/types/identifier.js.map +0 -1
  272. package/dist/types/json/raw.js.map +0 -1
  273. package/dist/types/params.js.map +0 -1
  274. package/dist/types/record.js.map +0 -1
  275. package/dist/types/request.js.map +0 -1
  276. package/dist/types/runtime.js.map +0 -1
  277. package/dist/types/schema/concepts.js.map +0 -1
  278. package/dist/types/schema/fields.js.map +0 -1
  279. package/dist/types/schema/fields.type-test.js.map +0 -1
  280. package/dist/types/spec/document.js.map +0 -1
  281. package/dist/types/spec/error.js.map +0 -1
  282. package/dist/types/spec/json-api-raw.js.map +0 -1
  283. package/dist/types/symbols.js.map +0 -1
  284. package/dist/types/utils.js.map +0 -1
  285. package/dist/types.js.map +0 -1
  286. package/dist/utils/string.js.map +0 -1
@@ -1,428 +1,443 @@
1
- import type { Cache, ChangedAttributesHash, RelationshipDiff } from '../../../types/cache.ts';
2
- import type { Change } from '../../../types/cache/change.ts';
3
- import type { MergeOperation } from '../../../types/cache/operations.ts';
4
- import type { CollectionRelationship, ResourceRelationship } from '../../../types/cache/relationship.ts';
5
- import type { LocalRelationshipOperation } from '../../../types/graph.ts';
6
- import type { StableDocumentIdentifier, StableRecordIdentifier } from '../../../types/identifier.ts';
7
- import type { Value } from '../../../types/json/raw.ts';
8
- import type { StructuredDataDocument, StructuredDocument } from '../../../types/request.ts';
9
- import type { ResourceDocument, SingleResourceDataDocument } from '../../../types/spec/document.ts';
10
- import type { ApiError } from '../../../types/spec/error.ts';
11
- import type { StoreRequestContext } from '../cache-handler/handler.ts';
1
+ import type { Cache, ChangedAttributesHash, RelationshipDiff } from "../../../types/cache.js";
2
+ import type { Change } from "../../../types/cache/change.js";
3
+ import type { MergeOperation } from "../../../types/cache/operations.js";
4
+ import type { CollectionRelationship, ResourceRelationship } from "../../../types/cache/relationship.js";
5
+ import type { LocalRelationshipOperation } from "../../../types/graph.js";
6
+ import type { StableDocumentIdentifier, StableRecordIdentifier } from "../../../types/identifier.js";
7
+ import type { Value } from "../../../types/json/raw.js";
8
+ import type { StructuredDataDocument, StructuredDocument } from "../../../types/request.js";
9
+ import type { ResourceDocument, SingleResourceDataDocument } from "../../../types/spec/document.js";
10
+ import type { ApiError } from "../../../types/spec/error.js";
11
+ import type { StoreRequestContext } from "../cache-handler/handler.js";
12
12
  /**
13
- * The CacheManager wraps a Cache enforcing that only
14
- * the public API surface area is exposed.
15
- *
16
- * Hence, it is the value of `Store.cache`, wrapping
17
- * the cache instance returned by `Store.createCache`.
18
- *
19
- * It handles translating between cache versions when
20
- * necessary, for instance when a Store is configured
21
- * to use both a v1 and a v2 cache depending on some
22
- * heuristic.
23
- *
24
- * Starting with the v2 spec, the cache is designed such
25
- * that it must be implemented as a singleton.
26
- *
27
- * @class CacheManager
28
- * @public
29
- */
13
+ * The CacheManager wraps a Cache enforcing that only
14
+ * the public API surface area is exposed.
15
+ *
16
+ * Hence, it is the value of `Store.cache`, wrapping
17
+ * the cache instance returned by `Store.createCache`.
18
+ *
19
+ * It handles translating between cache versions when
20
+ * necessary, for instance when a Store is configured
21
+ * to use both a v1 and a v2 cache depending on some
22
+ * heuristic.
23
+ *
24
+ * Starting with the v2 spec, the cache is designed such
25
+ * that it must be implemented as a singleton.
26
+ *
27
+ * @class CacheManager
28
+ * @public
29
+ */
30
30
  export declare class CacheManager implements Cache {
31
- #private;
32
- version: "2";
33
- constructor(cache: Cache);
34
- /**
35
- * Cache the response to a request
36
- *
37
- * Unlike `store.push` which has UPSERT
38
- * semantics, `put` has `replace` semantics similar to
39
- * the `http` method `PUT`
40
- *
41
- * the individually cacheable
42
- * e resource data it may contain
43
- * should upsert, but the document data surrounding it should
44
- * fully replace any existing information
45
- *
46
- * Note that in order to support inserting arbitrary data
47
- * to the cache that did not originate from a request `put`
48
- * should expect to sometimes encounter a document with only
49
- * a `content` member and therefor must not assume the existence
50
- * of `request` and `response` on the document.
51
- *
52
- * @param {StructuredDocument} doc
53
- * @return {ResourceDocument}
54
- * @public
55
- */
56
- put<T>(doc: StructuredDocument<T> | {
57
- content: T;
58
- }): ResourceDocument;
59
- /**
60
- * Perform an operation on the cache to update the remote state.
61
- *
62
- * Note: currently the only valid operation is a MergeOperation
63
- * which occurs when a collision of identifiers is detected.
64
- *
65
- * @public
66
- * @param op the operation to perform
67
- * @return {void}
68
- */
69
- patch(op: MergeOperation): void;
70
- /**
71
- * Update resource data with a local mutation. Currently supports operations
72
- * on relationships only.
73
- *
74
- * @public
75
- * @param mutation
76
- */
77
- mutate(mutation: LocalRelationshipOperation): void;
78
- /**
79
- * Peek resource data from the Cache.
80
- *
81
- * In development, if the return value
82
- * is JSON the return value
83
- * will be deep-cloned and deep-frozen
84
- * to prevent mutation thereby enforcing cache
85
- * Immutability.
86
- *
87
- * This form of peek is useful for implementations
88
- * that want to feed raw-data from cache to the UI
89
- * or which want to interact with a blob of data
90
- * directly from the presentation cache.
91
- *
92
- * An implementation might want to do this because
93
- * de-referencing records which read from their own
94
- * blob is generally safer because the record does
95
- * not require retaining connections to the Store
96
- * and Cache to present data on a per-field basis.
97
- *
98
- * This generally takes the place of `getAttr` as
99
- * an API and may even take the place of `getRelationship`
100
- * depending on implementation specifics, though this
101
- * latter usage is less recommended due to the advantages
102
- * of the Graph handling necessary entanglements and
103
- * notifications for relational data.
104
- *
105
- * @public
106
- * @param {StableRecordIdentifier | StableDocumentIdentifier} identifier
107
- * @return {ResourceDocument | ResourceBlob | null} the known resource data
108
- */
109
- peek(identifier: StableRecordIdentifier): unknown;
110
- peek(identifier: StableDocumentIdentifier): ResourceDocument | null;
111
- peekRemoteState(identifier: StableRecordIdentifier): unknown;
112
- peekRemoteState(identifier: StableDocumentIdentifier): ResourceDocument | null;
113
- /**
114
- * Peek the Cache for the existing request data associated with
115
- * a cacheable request
116
- *
117
- * @param {StableDocumentIdentifier}
118
- * @return {StableDocumentIdentifier | null}
119
- * @public
120
- */
121
- peekRequest(identifier: StableDocumentIdentifier): StructuredDocument<ResourceDocument> | null;
122
- /**
123
- * Push resource data from a remote source into the cache for this identifier
124
- *
125
- * @public
126
- * @param identifier
127
- * @param data
128
- * @param hasRecord
129
- * @return {void | string[]} if `hasRecord` is true then calculated key changes should be returned
130
- */
131
- upsert(identifier: StableRecordIdentifier, data: unknown, hasRecord: boolean): void | string[];
132
- /**
133
- * Create a fork of the cache from the current state.
134
- *
135
- * Applications should typically not call this method themselves,
136
- * preferring instead to fork at the Store level, which will
137
- * utilize this method to fork the cache.
138
- *
139
- * @public
140
- * @return {Promise<Cache>}
141
- */
142
- fork(): Promise<Cache>;
143
- /**
144
- * Merge a fork back into a parent Cache.
145
- *
146
- * Applications should typically not call this method themselves,
147
- * preferring instead to merge at the Store level, which will
148
- * utilize this method to merge the caches.
149
- *
150
- * @param {Cache} cache
151
- * @public
152
- * @return {Promise<void>}
153
- */
154
- merge(cache: Cache): Promise<void>;
155
- /**
156
- * Generate the list of changes applied to all
157
- * record in the store.
158
- *
159
- * Each individual resource or document that has
160
- * been mutated should be described as an individual
161
- * `Change` entry in the returned array.
162
- *
163
- * A `Change` is described by an object containing up to
164
- * three properties: (1) the `identifier` of the entity that
165
- * changed; (2) the `op` code of that change being one of
166
- * `upsert` or `remove`, and if the op is `upsert` a `patch`
167
- * containing the data to merge into the cache for the given
168
- * entity.
169
- *
170
- * This `patch` is opaque to the Store but should be understood
171
- * by the Cache and may expect to be utilized by an Adapter
172
- * when generating data during a `save` operation.
173
- *
174
- * It is generally recommended that the `patch` contain only
175
- * the updated state, ignoring fields that are unchanged
176
- *
177
- * ```ts
178
- * interface Change {
179
- * identifier: StableRecordIdentifier | StableDocumentIdentifier;
180
- * op: 'upsert' | 'remove';
181
- * patch?: unknown;
182
- * }
183
- * ```
184
- *
185
- * @public
186
- */
187
- diff(): Promise<Change[]>;
188
- /**
189
- * Serialize the entire contents of the Cache into a Stream
190
- * which may be fed back into a new instance of the same Cache
191
- * via `cache.hydrate`.
192
- *
193
- * @return {Promise<ReadableStream>}
194
- * @public
195
- */
196
- dump(): Promise<ReadableStream<unknown>>;
197
- /**
198
- * hydrate a Cache from a Stream with content previously serialized
199
- * from another instance of the same Cache, resolving when hydration
200
- * is complete.
201
- *
202
- * This method should expect to be called both in the context of restoring
203
- * the Cache during application rehydration after SSR **AND** at unknown
204
- * times during the lifetime of an already booted application when it is
205
- * desired to bulk-load additional information into the cache. This latter
206
- * behavior supports optimizing pre/fetching of data for route transitions
207
- * via data-only SSR modes.
208
- *
209
- * @param {ReadableStream} stream
210
- * @return {Promise<void>}
211
- * @public
212
- */
213
- hydrate(stream: ReadableStream<unknown>): Promise<void>;
214
- /**
215
- * [LIFECYCLE] Signal to the cache that a new record has been instantiated on the client
216
- *
217
- * It returns properties from options that should be set on the record during the create
218
- * process. This return value behavior is deprecated.
219
- *
220
- * @public
221
- * @param identifier
222
- * @param options
223
- */
224
- clientDidCreate(identifier: StableRecordIdentifier, options?: Record<string, unknown>): Record<string, unknown>;
225
- /**
226
- * [LIFECYCLE] Signals to the cache that a resource
227
- * will be part of a save transaction.
228
- *
229
- * @public
230
- * @param identifier
231
- */
232
- willCommit(identifier: StableRecordIdentifier, context: StoreRequestContext): void;
233
- /**
234
- * [LIFECYCLE] Signals to the cache that a resource
235
- * was successfully updated as part of a save transaction.
236
- *
237
- * @public
238
- * @param identifier
239
- * @param data
240
- */
241
- didCommit(identifier: StableRecordIdentifier, result: StructuredDataDocument<unknown>): SingleResourceDataDocument;
242
- /**
243
- * [LIFECYCLE] Signals to the cache that a resource
244
- * was update via a save transaction failed.
245
- *
246
- * @public
247
- * @param identifier
248
- * @param errors
249
- */
250
- commitWasRejected(identifier: StableRecordIdentifier, errors?: ApiError[]): void;
251
- /**
252
- * [LIFECYCLE] Signals to the cache that all data for a resource
253
- * should be cleared.
254
- *
255
- * @public
256
- * @param identifier
257
- */
258
- unloadRecord(identifier: StableRecordIdentifier): void;
259
- /**
260
- * Retrieve the data for an attribute from the cache
261
- *
262
- * @public
263
- * @param identifier
264
- * @param propertyName
265
- * @return {unknown}
266
- */
267
- getAttr(identifier: StableRecordIdentifier, propertyName: string): Value | undefined;
268
- /**
269
- * Retrieve the remote state for an attribute from the cache
270
- *
271
- * @public
272
- * @param identifier
273
- * @param propertyName
274
- * @return {unknown}
275
- */
276
- getRemoteAttr(identifier: StableRecordIdentifier, propertyName: string): Value | undefined;
277
- /**
278
- * Mutate the data for an attribute in the cache
279
- *
280
- * @public
281
- * @param identifier
282
- * @param propertyName
283
- * @param value
284
- */
285
- setAttr(identifier: StableRecordIdentifier, propertyName: string, value: Value): void;
286
- /**
287
- * Query the cache for the changed attributes of a resource.
288
- *
289
- * @public
290
- * @param identifier
291
- * @return
292
- */
293
- changedAttrs(identifier: StableRecordIdentifier): ChangedAttributesHash;
294
- /**
295
- * Query the cache for whether any mutated attributes exist
296
- *
297
- * @public
298
- * @param identifier
299
- * @return {Boolean}
300
- */
301
- hasChangedAttrs(identifier: StableRecordIdentifier): boolean;
302
- /**
303
- * Tell the cache to discard any uncommitted mutations to attributes
304
- *
305
- * @public
306
- * @param identifier
307
- * @return the names of attributes that were restored
308
- */
309
- rollbackAttrs(identifier: StableRecordIdentifier): string[];
310
- /**
311
- * Query the cache for the changes to relationships of a resource.
312
- *
313
- * Returns a map of relationship names to RelationshipDiff objects.
314
- *
315
- * ```ts
316
- * type RelationshipDiff =
317
- | {
318
- kind: 'collection';
319
- remoteState: StableRecordIdentifier[];
320
- additions: Set<StableRecordIdentifier>;
321
- removals: Set<StableRecordIdentifier>;
322
- localState: StableRecordIdentifier[];
323
- reordered: boolean;
324
- }
325
- | {
326
- kind: 'resource';
327
- remoteState: StableRecordIdentifier | null;
328
- localState: StableRecordIdentifier | null;
329
- };
330
- ```
331
- *
332
- * @public
333
- * @param {StableRecordIdentifier} identifier
334
- * @return {Map<string, RelationshipDiff>}
335
- */
336
- changedRelationships(identifier: StableRecordIdentifier): Map<string, RelationshipDiff>;
337
- /**
338
- * Query the cache for whether any mutated attributes exist
339
- *
340
- * @public
341
- * @param {StableRecordIdentifier} identifier
342
- * @return {Boolean}
343
- */
344
- hasChangedRelationships(identifier: StableRecordIdentifier): boolean;
345
- /**
346
- * Tell the cache to discard any uncommitted mutations to relationships.
347
- *
348
- * This will also discard the change on any appropriate inverses.
349
- *
350
- * This method is a candidate to become a mutation
351
- *
352
- * @public
353
- * @param {StableRecordIdentifier} identifier
354
- * @return {String[]} the names of relationships that were restored
355
- */
356
- rollbackRelationships(identifier: StableRecordIdentifier): string[];
357
- /**
358
- * Query the cache for the current state of a relationship property
359
- *
360
- * @public
361
- * @param identifier
362
- * @param propertyName
363
- * @return resource relationship object
364
- */
365
- getRelationship(identifier: StableRecordIdentifier, propertyName: string): ResourceRelationship | CollectionRelationship;
366
- /**
367
- * Query the cache for the remote state of a relationship property
368
- *
369
- * @public
370
- * @param identifier
371
- * @param propertyName
372
- * @return resource relationship object
373
- */
374
- getRemoteRelationship(identifier: StableRecordIdentifier, propertyName: string): ResourceRelationship | CollectionRelationship;
375
- /**
376
- * Update the cache state for the given resource to be marked as locally deleted,
377
- * or remove such a mark.
378
- *
379
- * @public
380
- * @param identifier
381
- * @param isDeleted
382
- */
383
- setIsDeleted(identifier: StableRecordIdentifier, isDeleted: boolean): void;
384
- /**
385
- * Query the cache for any validation errors applicable to the given resource.
386
- *
387
- * @public
388
- * @param identifier
389
- * @return
390
- */
391
- getErrors(identifier: StableRecordIdentifier): ApiError[];
392
- /**
393
- * Query the cache for whether a given resource has any available data
394
- *
395
- * @public
396
- * @param identifier
397
- * @return {Boolean}
398
- */
399
- isEmpty(identifier: StableRecordIdentifier): boolean;
400
- /**
401
- * Query the cache for whether a given resource was created locally and not
402
- * yet persisted.
403
- *
404
- * @public
405
- * @param identifier
406
- * @return {Boolean}
407
- */
408
- isNew(identifier: StableRecordIdentifier): boolean;
409
- /**
410
- * Query the cache for whether a given resource is marked as deleted (but not
411
- * necessarily persisted yet).
412
- *
413
- * @public
414
- * @param identifier
415
- * @return {Boolean}
416
- */
417
- isDeleted(identifier: StableRecordIdentifier): boolean;
418
- /**
419
- * Query the cache for whether a given resource has been deleted and that deletion
420
- * has also been persisted.
421
- *
422
- * @public
423
- * @param identifier
424
- * @return {Boolean}
425
- */
426
- isDeletionCommitted(identifier: StableRecordIdentifier): boolean;
31
+ #private;
32
+ version: "2";
33
+ constructor(cache: Cache);
34
+ // Cache Management
35
+ // ================
36
+ /**
37
+ * Cache the response to a request
38
+ *
39
+ * Unlike `store.push` which has UPSERT
40
+ * semantics, `put` has `replace` semantics similar to
41
+ * the `http` method `PUT`
42
+ *
43
+ * the individually cacheable
44
+ * e resource data it may contain
45
+ * should upsert, but the document data surrounding it should
46
+ * fully replace any existing information
47
+ *
48
+ * Note that in order to support inserting arbitrary data
49
+ * to the cache that did not originate from a request `put`
50
+ * should expect to sometimes encounter a document with only
51
+ * a `content` member and therefor must not assume the existence
52
+ * of `request` and `response` on the document.
53
+ *
54
+ * @param {StructuredDocument} doc
55
+ * @return {ResourceDocument}
56
+ * @public
57
+ */
58
+ put<T>(doc: StructuredDocument<T> | {
59
+ content: T;
60
+ }): ResourceDocument;
61
+ /**
62
+ * Perform an operation on the cache to update the remote state.
63
+ *
64
+ * Note: currently the only valid operation is a MergeOperation
65
+ * which occurs when a collision of identifiers is detected.
66
+ *
67
+ * @public
68
+ * @param op the operation to perform
69
+ * @return {void}
70
+ */
71
+ patch(op: MergeOperation): void;
72
+ /**
73
+ * Update resource data with a local mutation. Currently supports operations
74
+ * on relationships only.
75
+ *
76
+ * @public
77
+ * @param mutation
78
+ */
79
+ mutate(mutation: LocalRelationshipOperation): void;
80
+ /**
81
+ * Peek resource data from the Cache.
82
+ *
83
+ * In development, if the return value
84
+ * is JSON the return value
85
+ * will be deep-cloned and deep-frozen
86
+ * to prevent mutation thereby enforcing cache
87
+ * Immutability.
88
+ *
89
+ * This form of peek is useful for implementations
90
+ * that want to feed raw-data from cache to the UI
91
+ * or which want to interact with a blob of data
92
+ * directly from the presentation cache.
93
+ *
94
+ * An implementation might want to do this because
95
+ * de-referencing records which read from their own
96
+ * blob is generally safer because the record does
97
+ * not require retaining connections to the Store
98
+ * and Cache to present data on a per-field basis.
99
+ *
100
+ * This generally takes the place of `getAttr` as
101
+ * an API and may even take the place of `getRelationship`
102
+ * depending on implementation specifics, though this
103
+ * latter usage is less recommended due to the advantages
104
+ * of the Graph handling necessary entanglements and
105
+ * notifications for relational data.
106
+ *
107
+ * @public
108
+ * @param {StableRecordIdentifier | StableDocumentIdentifier} identifier
109
+ * @return {ResourceDocument | ResourceBlob | null} the known resource data
110
+ */
111
+ peek(identifier: StableRecordIdentifier): unknown;
112
+ peek(identifier: StableDocumentIdentifier): ResourceDocument | null;
113
+ peekRemoteState(identifier: StableRecordIdentifier): unknown;
114
+ peekRemoteState(identifier: StableDocumentIdentifier): ResourceDocument | null;
115
+ /**
116
+ * Peek the Cache for the existing request data associated with
117
+ * a cacheable request
118
+ *
119
+ * @param {StableDocumentIdentifier}
120
+ * @return {StableDocumentIdentifier | null}
121
+ * @public
122
+ */
123
+ peekRequest(identifier: StableDocumentIdentifier): StructuredDocument<ResourceDocument> | null;
124
+ /**
125
+ * Push resource data from a remote source into the cache for this identifier
126
+ *
127
+ * @public
128
+ * @param identifier
129
+ * @param data
130
+ * @param hasRecord
131
+ * @return {void | string[]} if `hasRecord` is true then calculated key changes should be returned
132
+ */
133
+ upsert(identifier: StableRecordIdentifier, data: unknown, hasRecord: boolean): void | string[];
134
+ // Cache Forking Support
135
+ // =====================
136
+ /**
137
+ * Create a fork of the cache from the current state.
138
+ *
139
+ * Applications should typically not call this method themselves,
140
+ * preferring instead to fork at the Store level, which will
141
+ * utilize this method to fork the cache.
142
+ *
143
+ * @public
144
+ * @return {Promise<Cache>}
145
+ */
146
+ fork(): Promise<Cache>;
147
+ /**
148
+ * Merge a fork back into a parent Cache.
149
+ *
150
+ * Applications should typically not call this method themselves,
151
+ * preferring instead to merge at the Store level, which will
152
+ * utilize this method to merge the caches.
153
+ *
154
+ * @param {Cache} cache
155
+ * @public
156
+ * @return {Promise<void>}
157
+ */
158
+ merge(cache: Cache): Promise<void>;
159
+ /**
160
+ * Generate the list of changes applied to all
161
+ * record in the store.
162
+ *
163
+ * Each individual resource or document that has
164
+ * been mutated should be described as an individual
165
+ * `Change` entry in the returned array.
166
+ *
167
+ * A `Change` is described by an object containing up to
168
+ * three properties: (1) the `identifier` of the entity that
169
+ * changed; (2) the `op` code of that change being one of
170
+ * `upsert` or `remove`, and if the op is `upsert` a `patch`
171
+ * containing the data to merge into the cache for the given
172
+ * entity.
173
+ *
174
+ * This `patch` is opaque to the Store but should be understood
175
+ * by the Cache and may expect to be utilized by an Adapter
176
+ * when generating data during a `save` operation.
177
+ *
178
+ * It is generally recommended that the `patch` contain only
179
+ * the updated state, ignoring fields that are unchanged
180
+ *
181
+ * ```ts
182
+ * interface Change {
183
+ * identifier: StableRecordIdentifier | StableDocumentIdentifier;
184
+ * op: 'upsert' | 'remove';
185
+ * patch?: unknown;
186
+ * }
187
+ * ```
188
+ *
189
+ * @public
190
+ */
191
+ diff(): Promise<Change[]>;
192
+ // SSR Support
193
+ // ===========
194
+ /**
195
+ * Serialize the entire contents of the Cache into a Stream
196
+ * which may be fed back into a new instance of the same Cache
197
+ * via `cache.hydrate`.
198
+ *
199
+ * @return {Promise<ReadableStream>}
200
+ * @public
201
+ */
202
+ dump(): Promise<ReadableStream<unknown>>;
203
+ /**
204
+ * hydrate a Cache from a Stream with content previously serialized
205
+ * from another instance of the same Cache, resolving when hydration
206
+ * is complete.
207
+ *
208
+ * This method should expect to be called both in the context of restoring
209
+ * the Cache during application rehydration after SSR **AND** at unknown
210
+ * times during the lifetime of an already booted application when it is
211
+ * desired to bulk-load additional information into the cache. This latter
212
+ * behavior supports optimizing pre/fetching of data for route transitions
213
+ * via data-only SSR modes.
214
+ *
215
+ * @param {ReadableStream} stream
216
+ * @return {Promise<void>}
217
+ * @public
218
+ */
219
+ hydrate(stream: ReadableStream<unknown>): Promise<void>;
220
+ // Cache
221
+ // =====
222
+ // Resource Support
223
+ // ================
224
+ /**
225
+ * [LIFECYCLE] Signal to the cache that a new record has been instantiated on the client
226
+ *
227
+ * It returns properties from options that should be set on the record during the create
228
+ * process. This return value behavior is deprecated.
229
+ *
230
+ * @public
231
+ * @param identifier
232
+ * @param options
233
+ */
234
+ clientDidCreate(identifier: StableRecordIdentifier, options?: Record<string, unknown>): Record<string, unknown>;
235
+ /**
236
+ * [LIFECYCLE] Signals to the cache that a resource
237
+ * will be part of a save transaction.
238
+ *
239
+ * @public
240
+ * @param identifier
241
+ */
242
+ willCommit(identifier: StableRecordIdentifier, context: StoreRequestContext): void;
243
+ /**
244
+ * [LIFECYCLE] Signals to the cache that a resource
245
+ * was successfully updated as part of a save transaction.
246
+ *
247
+ * @public
248
+ * @param identifier
249
+ * @param data
250
+ */
251
+ didCommit(identifier: StableRecordIdentifier, result: StructuredDataDocument<unknown>): SingleResourceDataDocument;
252
+ /**
253
+ * [LIFECYCLE] Signals to the cache that a resource
254
+ * was update via a save transaction failed.
255
+ *
256
+ * @public
257
+ * @param identifier
258
+ * @param errors
259
+ */
260
+ commitWasRejected(identifier: StableRecordIdentifier, errors?: ApiError[]): void;
261
+ /**
262
+ * [LIFECYCLE] Signals to the cache that all data for a resource
263
+ * should be cleared.
264
+ *
265
+ * @public
266
+ * @param identifier
267
+ */
268
+ unloadRecord(identifier: StableRecordIdentifier): void;
269
+ // Granular Resource Data APIs
270
+ // ===========================
271
+ /**
272
+ * Retrieve the data for an attribute from the cache
273
+ *
274
+ * @public
275
+ * @param identifier
276
+ * @param propertyName
277
+ * @return {unknown}
278
+ */
279
+ getAttr(identifier: StableRecordIdentifier, propertyName: string): Value | undefined;
280
+ /**
281
+ * Retrieve the remote state for an attribute from the cache
282
+ *
283
+ * @public
284
+ * @param identifier
285
+ * @param propertyName
286
+ * @return {unknown}
287
+ */
288
+ getRemoteAttr(identifier: StableRecordIdentifier, propertyName: string): Value | undefined;
289
+ /**
290
+ * Mutate the data for an attribute in the cache
291
+ *
292
+ * @public
293
+ * @param identifier
294
+ * @param propertyName
295
+ * @param value
296
+ */
297
+ setAttr(identifier: StableRecordIdentifier, propertyName: string, value: Value): void;
298
+ /**
299
+ * Query the cache for the changed attributes of a resource.
300
+ *
301
+ * @public
302
+ * @param identifier
303
+ * @return
304
+ */
305
+ changedAttrs(identifier: StableRecordIdentifier): ChangedAttributesHash;
306
+ /**
307
+ * Query the cache for whether any mutated attributes exist
308
+ *
309
+ * @public
310
+ * @param identifier
311
+ * @return {Boolean}
312
+ */
313
+ hasChangedAttrs(identifier: StableRecordIdentifier): boolean;
314
+ /**
315
+ * Tell the cache to discard any uncommitted mutations to attributes
316
+ *
317
+ * @public
318
+ * @param identifier
319
+ * @return the names of attributes that were restored
320
+ */
321
+ rollbackAttrs(identifier: StableRecordIdentifier): string[];
322
+ // Relationships
323
+ // =============
324
+ /**
325
+ * Query the cache for the changes to relationships of a resource.
326
+ *
327
+ * Returns a map of relationship names to RelationshipDiff objects.
328
+ *
329
+ * ```ts
330
+ * type RelationshipDiff =
331
+ | {
332
+ kind: 'collection';
333
+ remoteState: StableRecordIdentifier[];
334
+ additions: Set<StableRecordIdentifier>;
335
+ removals: Set<StableRecordIdentifier>;
336
+ localState: StableRecordIdentifier[];
337
+ reordered: boolean;
338
+ }
339
+ | {
340
+ kind: 'resource';
341
+ remoteState: StableRecordIdentifier | null;
342
+ localState: StableRecordIdentifier | null;
343
+ };
344
+ ```
345
+ *
346
+ * @public
347
+ * @param {StableRecordIdentifier} identifier
348
+ * @return {Map<string, RelationshipDiff>}
349
+ */
350
+ changedRelationships(identifier: StableRecordIdentifier): Map<string, RelationshipDiff>;
351
+ /**
352
+ * Query the cache for whether any mutated attributes exist
353
+ *
354
+ * @public
355
+ * @param {StableRecordIdentifier} identifier
356
+ * @return {Boolean}
357
+ */
358
+ hasChangedRelationships(identifier: StableRecordIdentifier): boolean;
359
+ /**
360
+ * Tell the cache to discard any uncommitted mutations to relationships.
361
+ *
362
+ * This will also discard the change on any appropriate inverses.
363
+ *
364
+ * This method is a candidate to become a mutation
365
+ *
366
+ * @public
367
+ * @param {StableRecordIdentifier} identifier
368
+ * @return {String[]} the names of relationships that were restored
369
+ */
370
+ rollbackRelationships(identifier: StableRecordIdentifier): string[];
371
+ /**
372
+ * Query the cache for the current state of a relationship property
373
+ *
374
+ * @public
375
+ * @param identifier
376
+ * @param propertyName
377
+ * @return resource relationship object
378
+ */
379
+ getRelationship(identifier: StableRecordIdentifier, propertyName: string): ResourceRelationship | CollectionRelationship;
380
+ /**
381
+ * Query the cache for the remote state of a relationship property
382
+ *
383
+ * @public
384
+ * @param identifier
385
+ * @param propertyName
386
+ * @return resource relationship object
387
+ */
388
+ getRemoteRelationship(identifier: StableRecordIdentifier, propertyName: string): ResourceRelationship | CollectionRelationship;
389
+ // Resource State
390
+ // ===============
391
+ /**
392
+ * Update the cache state for the given resource to be marked as locally deleted,
393
+ * or remove such a mark.
394
+ *
395
+ * @public
396
+ * @param identifier
397
+ * @param isDeleted
398
+ */
399
+ setIsDeleted(identifier: StableRecordIdentifier, isDeleted: boolean): void;
400
+ /**
401
+ * Query the cache for any validation errors applicable to the given resource.
402
+ *
403
+ * @public
404
+ * @param identifier
405
+ * @return
406
+ */
407
+ getErrors(identifier: StableRecordIdentifier): ApiError[];
408
+ /**
409
+ * Query the cache for whether a given resource has any available data
410
+ *
411
+ * @public
412
+ * @param identifier
413
+ * @return {Boolean}
414
+ */
415
+ isEmpty(identifier: StableRecordIdentifier): boolean;
416
+ /**
417
+ * Query the cache for whether a given resource was created locally and not
418
+ * yet persisted.
419
+ *
420
+ * @public
421
+ * @param identifier
422
+ * @return {Boolean}
423
+ */
424
+ isNew(identifier: StableRecordIdentifier): boolean;
425
+ /**
426
+ * Query the cache for whether a given resource is marked as deleted (but not
427
+ * necessarily persisted yet).
428
+ *
429
+ * @public
430
+ * @param identifier
431
+ * @return {Boolean}
432
+ */
433
+ isDeleted(identifier: StableRecordIdentifier): boolean;
434
+ /**
435
+ * Query the cache for whether a given resource has been deleted and that deletion
436
+ * has also been persisted.
437
+ *
438
+ * @public
439
+ * @param identifier
440
+ * @return {Boolean}
441
+ */
442
+ isDeletionCommitted(identifier: StableRecordIdentifier): boolean;
427
443
  }
428
- //# sourceMappingURL=cache-manager.d.ts.map