@warp-drive/core 5.6.0-alpha.14 → 5.6.0-alpha.17

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 (287) 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 +8 -0
  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 -58
  36. package/declarations/reactive/-private/schema.d.ts +256 -165
  37. package/declarations/reactive/-private/symbols.d.ts +27 -2
  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 +155 -72
  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 +261 -0
  71. package/declarations/store/-private/record-arrays/identifier-array.d.ts +125 -119
  72. package/declarations/store/-private/record-arrays/many-array.d.ts +180 -182
  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 -27
  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 -323
  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 -1587
  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/{configure-BgaZESRo.js → configure-B48bFHOl.js} +38 -2
  113. package/dist/configure.js +1 -1
  114. package/dist/graph/-private.js +2 -2
  115. package/dist/{handler-cHghx9Y9.js → handler-C2T-IyJK.js} +1 -1
  116. package/dist/index.js +3 -3
  117. package/dist/reactive/-private.js +1 -1
  118. package/dist/reactive.js +287 -101
  119. package/dist/{request-state-DgwTEXLU.js → request-state-CjLph1LP.js} +1030 -249
  120. package/dist/store/-private.js +3 -3
  121. package/dist/{symbols-BmDcn6hS.js → symbols-SIstXMLI.js} +3 -3
  122. package/dist/types/-private.js +1 -1
  123. package/dist/types/schema/fields.js +4 -4
  124. package/package.json +4 -4
  125. package/declarations/build-config/babel-macros.d.ts.map +0 -1
  126. package/declarations/build-config/canary-features.d.ts.map +0 -1
  127. package/declarations/build-config/debugging.d.ts.map +0 -1
  128. package/declarations/build-config/deprecations.d.ts.map +0 -1
  129. package/declarations/build-config/env.d.ts.map +0 -1
  130. package/declarations/build-config/macros.d.ts.map +0 -1
  131. package/declarations/build-config.d.ts.map +0 -1
  132. package/declarations/configure.d.ts.map +0 -1
  133. package/declarations/graph/-private/-diff.d.ts.map +0 -1
  134. package/declarations/graph/-private/-edge-definition.d.ts.map +0 -1
  135. package/declarations/graph/-private/-state.d.ts.map +0 -1
  136. package/declarations/graph/-private/-utils.d.ts.map +0 -1
  137. package/declarations/graph/-private/coerce-id.d.ts.map +0 -1
  138. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts.map +0 -1
  139. package/declarations/graph/-private/edges/collection.d.ts.map +0 -1
  140. package/declarations/graph/-private/edges/implicit.d.ts.map +0 -1
  141. package/declarations/graph/-private/edges/resource.d.ts.map +0 -1
  142. package/declarations/graph/-private/graph.d.ts.map +0 -1
  143. package/declarations/graph/-private/normalize-link.d.ts.map +0 -1
  144. package/declarations/graph/-private/operations/add-to-related-records.d.ts.map +0 -1
  145. package/declarations/graph/-private/operations/merge-identifier.d.ts.map +0 -1
  146. package/declarations/graph/-private/operations/remove-from-related-records.d.ts.map +0 -1
  147. package/declarations/graph/-private/operations/replace-related-record.d.ts.map +0 -1
  148. package/declarations/graph/-private/operations/replace-related-records.d.ts.map +0 -1
  149. package/declarations/graph/-private/operations/update-relationship.d.ts.map +0 -1
  150. package/declarations/graph/-private.d.ts.map +0 -1
  151. package/declarations/index.d.ts.map +0 -1
  152. package/declarations/reactive/-private/document.d.ts.map +0 -1
  153. package/declarations/reactive/-private/fields/compute.d.ts.map +0 -1
  154. package/declarations/reactive/-private/fields/managed-array.d.ts.map +0 -1
  155. package/declarations/reactive/-private/fields/managed-object.d.ts.map +0 -1
  156. package/declarations/reactive/-private/fields/many-array-manager.d.ts.map +0 -1
  157. package/declarations/reactive/-private/hooks.d.ts.map +0 -1
  158. package/declarations/reactive/-private/record.d.ts.map +0 -1
  159. package/declarations/reactive/-private/schema.d.ts.map +0 -1
  160. package/declarations/reactive/-private/symbols.d.ts.map +0 -1
  161. package/declarations/reactive/-private.d.ts.map +0 -1
  162. package/declarations/reactive.d.ts.map +0 -1
  163. package/declarations/request/-private/context.d.ts.map +0 -1
  164. package/declarations/request/-private/debug.d.ts.map +0 -1
  165. package/declarations/request/-private/fetch.d.ts.map +0 -1
  166. package/declarations/request/-private/future.d.ts.map +0 -1
  167. package/declarations/request/-private/manager.d.ts.map +0 -1
  168. package/declarations/request/-private/promise-cache.d.ts.map +0 -1
  169. package/declarations/request/-private/types.d.ts.map +0 -1
  170. package/declarations/request/-private/utils.d.ts.map +0 -1
  171. package/declarations/request.d.ts.map +0 -1
  172. package/declarations/store/-private/cache-handler/handler.d.ts.map +0 -1
  173. package/declarations/store/-private/cache-handler/types.d.ts.map +0 -1
  174. package/declarations/store/-private/cache-handler/utils.d.ts.map +0 -1
  175. package/declarations/store/-private/caches/cache-utils.d.ts.map +0 -1
  176. package/declarations/store/-private/caches/identifier-cache.d.ts.map +0 -1
  177. package/declarations/store/-private/caches/instance-cache.d.ts.map +0 -1
  178. package/declarations/store/-private/caches/resource-utils.d.ts.map +0 -1
  179. package/declarations/store/-private/debug/utils.d.ts.map +0 -1
  180. package/declarations/store/-private/default-cache-policy.d.ts.map +0 -1
  181. package/declarations/store/-private/legacy-model-support/record-reference.d.ts.map +0 -1
  182. package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
  183. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
  184. package/declarations/store/-private/managers/cache-manager.d.ts.map +0 -1
  185. package/declarations/store/-private/managers/notification-manager.d.ts.map +0 -1
  186. package/declarations/store/-private/managers/record-array-manager.d.ts.map +0 -1
  187. package/declarations/store/-private/network/request-cache.d.ts.map +0 -1
  188. package/declarations/store/-private/new-core-tmp/promise-state.d.ts.map +0 -1
  189. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
  190. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
  191. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
  192. package/declarations/store/-private/new-core-tmp/request-state.d.ts.map +0 -1
  193. package/declarations/store/-private/record-arrays/identifier-array.d.ts.map +0 -1
  194. package/declarations/store/-private/record-arrays/many-array.d.ts.map +0 -1
  195. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
  196. package/declarations/store/-private/store-service.d.ts.map +0 -1
  197. package/declarations/store/-private/store-service.type-test.d.ts +0 -2
  198. package/declarations/store/-private/store-service.type-test.d.ts.map +0 -1
  199. package/declarations/store/-private/utils/coerce-id.d.ts.map +0 -1
  200. package/declarations/store/-private/utils/construct-resource.d.ts.map +0 -1
  201. package/declarations/store/-private/utils/is-non-empty-string.d.ts.map +0 -1
  202. package/declarations/store/-private/utils/normalize-model-name.d.ts.map +0 -1
  203. package/declarations/store/-private/utils/uuid-polyfill.d.ts.map +0 -1
  204. package/declarations/store/-private.d.ts.map +0 -1
  205. package/declarations/store/-types/q/cache-capabilities-manager.d.ts.map +0 -1
  206. package/declarations/store/-types/q/ds-model.d.ts.map +0 -1
  207. package/declarations/store/-types/q/identifier.d.ts.map +0 -1
  208. package/declarations/store/-types/q/promise-proxies.d.ts +0 -2
  209. package/declarations/store/-types/q/promise-proxies.d.ts.map +0 -1
  210. package/declarations/store/-types/q/record-data-json-api.d.ts +0 -31
  211. package/declarations/store/-types/q/record-data-json-api.d.ts.map +0 -1
  212. package/declarations/store/-types/q/record-instance.d.ts.map +0 -1
  213. package/declarations/store/-types/q/schema-service.d.ts.map +0 -1
  214. package/declarations/store/-types/q/store.d.ts.map +0 -1
  215. package/declarations/store.d.ts.map +0 -1
  216. package/declarations/types/-private.d.ts.map +0 -1
  217. package/declarations/types/cache/aliases.d.ts.map +0 -1
  218. package/declarations/types/cache/change.d.ts.map +0 -1
  219. package/declarations/types/cache/mutations.d.ts.map +0 -1
  220. package/declarations/types/cache/operations.d.ts.map +0 -1
  221. package/declarations/types/cache/relationship.d.ts.map +0 -1
  222. package/declarations/types/cache.d.ts.map +0 -1
  223. package/declarations/types/graph.d.ts.map +0 -1
  224. package/declarations/types/identifier.d.ts.map +0 -1
  225. package/declarations/types/json/raw.d.ts.map +0 -1
  226. package/declarations/types/params.d.ts.map +0 -1
  227. package/declarations/types/record.d.ts.map +0 -1
  228. package/declarations/types/record.type-test.d.ts +0 -2
  229. package/declarations/types/record.type-test.d.ts.map +0 -1
  230. package/declarations/types/request.d.ts.map +0 -1
  231. package/declarations/types/request.type-test.d.ts +0 -2
  232. package/declarations/types/request.type-test.d.ts.map +0 -1
  233. package/declarations/types/runtime.d.ts.map +0 -1
  234. package/declarations/types/schema/concepts.d.ts.map +0 -1
  235. package/declarations/types/schema/fields.d.ts.map +0 -1
  236. package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
  237. package/declarations/types/spec/document.d.ts.map +0 -1
  238. package/declarations/types/spec/error.d.ts.map +0 -1
  239. package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
  240. package/declarations/types/symbols.d.ts.map +0 -1
  241. package/declarations/types/utils.d.ts.map +0 -1
  242. package/declarations/types.d.ts.map +0 -1
  243. package/declarations/utils/string.d.ts.map +0 -1
  244. package/dist/build-config/babel-macros.js.map +0 -1
  245. package/dist/build-config/canary-features.js.map +0 -1
  246. package/dist/build-config/debugging.js.map +0 -1
  247. package/dist/build-config/deprecations.js.map +0 -1
  248. package/dist/build-config/env.js.map +0 -1
  249. package/dist/build-config/macros.js.map +0 -1
  250. package/dist/build-config.js.map +0 -1
  251. package/dist/configure-BgaZESRo.js.map +0 -1
  252. package/dist/configure.js.map +0 -1
  253. package/dist/context-COmAnXUQ.js.map +0 -1
  254. package/dist/graph/-private.js.map +0 -1
  255. package/dist/handler-cHghx9Y9.js.map +0 -1
  256. package/dist/index.js.map +0 -1
  257. package/dist/reactive/-private.js.map +0 -1
  258. package/dist/reactive.js.map +0 -1
  259. package/dist/request-state-DgwTEXLU.js.map +0 -1
  260. package/dist/request.js.map +0 -1
  261. package/dist/store/-private.js.map +0 -1
  262. package/dist/store.js.map +0 -1
  263. package/dist/symbols-BmDcn6hS.js.map +0 -1
  264. package/dist/types/-private.js.map +0 -1
  265. package/dist/types/cache/aliases.js.map +0 -1
  266. package/dist/types/cache/change.js.map +0 -1
  267. package/dist/types/cache/mutations.js.map +0 -1
  268. package/dist/types/cache/operations.js.map +0 -1
  269. package/dist/types/cache/relationship.js.map +0 -1
  270. package/dist/types/cache.js.map +0 -1
  271. package/dist/types/graph.js.map +0 -1
  272. package/dist/types/identifier.js.map +0 -1
  273. package/dist/types/json/raw.js.map +0 -1
  274. package/dist/types/params.js.map +0 -1
  275. package/dist/types/record.js.map +0 -1
  276. package/dist/types/request.js.map +0 -1
  277. package/dist/types/runtime.js.map +0 -1
  278. package/dist/types/schema/concepts.js.map +0 -1
  279. package/dist/types/schema/fields.js.map +0 -1
  280. package/dist/types/schema/fields.type-test.js.map +0 -1
  281. package/dist/types/spec/document.js.map +0 -1
  282. package/dist/types/spec/error.js.map +0 -1
  283. package/dist/types/spec/json-api-raw.js.map +0 -1
  284. package/dist/types/symbols.js.map +0 -1
  285. package/dist/types/utils.js.map +0 -1
  286. package/dist/types.js.map +0 -1
  287. package/dist/utils/string.js.map +0 -1
@@ -1,308 +1,331 @@
1
- import type { StableRecordIdentifier } from './identifier.ts';
2
- import type { QueryParamsSerializationOptions } from './params.ts';
3
- import type { ExtractSuggestedCacheTypes, Includes, TypedRecordInstance, TypeFromInstanceOrString } from './record.ts';
4
- import type { ResourceIdentifierObject } from './spec/json-api-raw.ts';
5
- import type { RequestSignature } from './symbols.ts';
1
+ import type { StableRecordIdentifier } from "./identifier.js";
2
+ import type { QueryParamsSerializationOptions } from "./params.js";
3
+ import type { ExtractSuggestedCacheTypes, Includes, TypedRecordInstance, TypeFromInstanceOrString } from "./record.js";
4
+ import type { ResourceIdentifierObject } from "./spec/json-api-raw.js";
5
+ import type { RequestSignature } from "./symbols.js";
6
6
  type Store = unknown;
7
- export declare const SkipCache: '___(unique) Symbol(SkipCache)';
8
- export declare const EnableHydration: '___(unique) Symbol(EnableHydration)';
9
- export declare const IS_FUTURE: '___(unique) Symbol(IS_FUTURE)';
10
- export declare const STRUCTURED: '___(unique) Symbol(DOC)';
11
- export type HTTPMethod = 'QUERY' | 'GET' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'TRACE';
7
+ export declare const SkipCache: "___(unique) Symbol(SkipCache)";
8
+ export declare const EnableHydration: "___(unique) Symbol(EnableHydration)";
9
+ export declare const IS_FUTURE: "___(unique) Symbol(IS_FUTURE)";
10
+ export declare const STRUCTURED: "___(unique) Symbol(DOC)";
11
+ export type HTTPMethod = "QUERY" | "GET" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "CONNECT" | "TRACE";
12
12
  /**
13
- * Use these options to adjust CacheHandler behavior for a request.
14
- *
15
- */
13
+ * Use these options to adjust CacheHandler behavior for a request.
14
+ *
15
+ */
16
16
  export type CacheOptions<T = unknown> = {
17
- /**
18
- * A key that uniquely identifies this request. If not present, the url wil be used
19
- * as the key for any GET request, while all other requests will not be cached.
20
- *
21
- */
22
- key?: string;
23
- /**
24
- * If true, the request will be made even if a cached response is present
25
- * and not expired.
26
- *
27
- */
28
- reload?: boolean;
29
- /**
30
- * If true, and a cached response is present and not expired, the request
31
- * will be made in the background and the cached response will be returned.
32
- *
33
- */
34
- backgroundReload?: boolean;
35
- /**
36
- * Useful for metadata around when to invalidate the cache. Typically used
37
- * by strategies that invalidate requests by resource type when a new resource
38
- * of that type has been created. See the CachePolicy implementation
39
- * provided by `@ember-data/request-utils` for an example.
40
- *
41
- * It is recommended to only use this for query/queryRecord requests where
42
- * new records created later would affect the results, though using it for
43
- * findRecord requests is also supported if desired where it may be useful
44
- * when a create may affect the result of a sideloaded relationship.
45
- *
46
- * Generally it is better to patch the cache directly for relationship updates
47
- * than to invalidate findRecord requests for one.
48
- *
49
- */
50
- types?: T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];
51
- /**
52
- * If true, the request will never be handled by the cache-manager and thus
53
- * will never resolve from cache nor update the cache.
54
- *
55
- * Generally this is only used for legacy request that manage resource cache
56
- * updates in a non-standard way via the LegacyNetworkHandler.
57
- *
58
- */
59
- [SkipCache]?: boolean;
17
+ /**
18
+ * A key that uniquely identifies this request. If not present, the url wil be used
19
+ * as the key for any GET request, while all other requests will not be cached.
20
+ *
21
+ */
22
+ key?: string;
23
+ /**
24
+ * If true, the request will be made even if a cached response is present
25
+ * and not expired.
26
+ *
27
+ */
28
+ reload?: boolean;
29
+ /**
30
+ * If true, and a cached response is present and not expired, the request
31
+ * will be made in the background and the cached response will be returned.
32
+ *
33
+ */
34
+ backgroundReload?: boolean;
35
+ /**
36
+ * Useful for metadata around when to invalidate the cache. Typically used
37
+ * by strategies that invalidate requests by resource type when a new resource
38
+ * of that type has been created. See the CachePolicy implementation
39
+ * provided by `@ember-data/request-utils` for an example.
40
+ *
41
+ * It is recommended to only use this for query/queryRecord requests where
42
+ * new records created later would affect the results, though using it for
43
+ * findRecord requests is also supported if desired where it may be useful
44
+ * when a create may affect the result of a sideloaded relationship.
45
+ *
46
+ * Generally it is better to patch the cache directly for relationship updates
47
+ * than to invalidate findRecord requests for one.
48
+ *
49
+ */
50
+ types?: T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];
51
+ /**
52
+ * If true, the request will never be handled by the cache-manager and thus
53
+ * will never resolve from cache nor update the cache.
54
+ *
55
+ * Generally this is only used for legacy request that manage resource cache
56
+ * updates in a non-standard way via the LegacyNetworkHandler.
57
+ *
58
+ */
59
+ [SkipCache]?: boolean;
60
60
  };
61
- export type FindRecordRequestOptions<RT = unknown, T = unknown> = {
62
- url: string;
63
- method: 'GET';
64
- headers: Headers;
65
- cacheOptions?: CacheOptions<T>;
66
- op: 'findRecord';
67
- records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
68
- [RequestSignature]?: RT;
61
+ export type FindRecordRequestOptions<
62
+ RT = unknown,
63
+ T = unknown
64
+ > = {
65
+ url: string;
66
+ method: "GET";
67
+ headers: Headers;
68
+ cacheOptions?: CacheOptions<T>;
69
+ op: "findRecord";
70
+ records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
71
+ [RequestSignature]?: RT;
69
72
  };
70
- export type QueryRequestOptions<RT = unknown, T = unknown> = {
71
- url: string;
72
- method: 'GET';
73
- headers: Headers;
74
- cacheOptions?: CacheOptions<T>;
75
- op: 'query';
76
- [RequestSignature]?: RT;
73
+ export type QueryRequestOptions<
74
+ RT = unknown,
75
+ T = unknown
76
+ > = {
77
+ url: string;
78
+ method: "GET";
79
+ headers: Headers;
80
+ cacheOptions?: CacheOptions<T>;
81
+ op: "query";
82
+ [RequestSignature]?: RT;
77
83
  };
78
- export type PostQueryRequestOptions<RT = unknown, T = unknown> = {
79
- url: string;
80
- method: 'POST' | 'QUERY';
81
- headers: Headers;
82
- body?: string | BodyInit | FormData;
83
- cacheOptions: CacheOptions<T> & {
84
- key: string;
85
- };
86
- op: 'query';
87
- [RequestSignature]?: RT;
84
+ export type PostQueryRequestOptions<
85
+ RT = unknown,
86
+ T = unknown
87
+ > = {
88
+ url: string;
89
+ method: "POST" | "QUERY";
90
+ headers: Headers;
91
+ body?: string | BodyInit | FormData;
92
+ cacheOptions: CacheOptions<T> & {
93
+ key: string;
94
+ };
95
+ op: "query";
96
+ [RequestSignature]?: RT;
88
97
  };
89
- export type DeleteRequestOptions<RT = unknown, T = unknown> = {
90
- url: string;
91
- method: 'DELETE';
92
- headers: Headers;
93
- op: 'deleteRecord';
94
- body?: string | BodyInit | FormData;
95
- data: {
96
- record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
97
- };
98
- records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
99
- [RequestSignature]?: RT;
98
+ export type DeleteRequestOptions<
99
+ RT = unknown,
100
+ T = unknown
101
+ > = {
102
+ url: string;
103
+ method: "DELETE";
104
+ headers: Headers;
105
+ op: "deleteRecord";
106
+ body?: string | BodyInit | FormData;
107
+ data: {
108
+ record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
109
+ };
110
+ records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
111
+ [RequestSignature]?: RT;
100
112
  };
101
113
  type ImmutableRequest<T> = Readonly<T> & {
102
- readonly headers: ImmutableHeaders;
103
- readonly records: [StableRecordIdentifier];
114
+ readonly headers: ImmutableHeaders;
115
+ readonly records: [StableRecordIdentifier];
104
116
  };
105
- export type UpdateRequestOptions<RT = unknown, T = unknown> = {
106
- url: string;
107
- method: 'PATCH' | 'PUT';
108
- headers: Headers;
109
- op: 'updateRecord';
110
- body?: string | BodyInit | FormData;
111
- data: {
112
- record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
113
- };
114
- records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
115
- [RequestSignature]?: RT;
117
+ export type UpdateRequestOptions<
118
+ RT = unknown,
119
+ T = unknown
120
+ > = {
121
+ url: string;
122
+ method: "PATCH" | "PUT";
123
+ headers: Headers;
124
+ op: "updateRecord";
125
+ body?: string | BodyInit | FormData;
126
+ data: {
127
+ record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
128
+ };
129
+ records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
130
+ [RequestSignature]?: RT;
116
131
  };
117
- export type CreateRequestOptions<RT = unknown, T = unknown> = {
118
- url: string;
119
- method: 'POST';
120
- headers: Headers;
121
- op: 'createRecord';
122
- body?: string | BodyInit | FormData;
123
- data: {
124
- record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
125
- };
126
- records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
127
- [RequestSignature]?: RT;
132
+ export type CreateRequestOptions<
133
+ RT = unknown,
134
+ T = unknown
135
+ > = {
136
+ url: string;
137
+ method: "POST";
138
+ headers: Headers;
139
+ op: "createRecord";
140
+ body?: string | BodyInit | FormData;
141
+ data: {
142
+ record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
143
+ };
144
+ records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
145
+ [RequestSignature]?: RT;
128
146
  };
129
147
  export type ImmutableDeleteRequestOptions = ImmutableRequest<DeleteRequestOptions>;
130
148
  export type ImmutableUpdateRequestOptions = ImmutableRequest<UpdateRequestOptions>;
131
149
  export type ImmutableCreateRequestOptions = ImmutableRequest<CreateRequestOptions>;
132
150
  export type RemotelyAccessibleIdentifier<T extends string = string> = {
133
- id: string;
134
- type: T;
135
- lid?: string;
151
+ id: string;
152
+ type: T;
153
+ lid?: string;
136
154
  };
137
155
  export type ConstrainedRequestOptions = {
138
- reload?: boolean;
139
- backgroundReload?: boolean;
140
- host?: string;
141
- namespace?: string;
142
- resourcePath?: string;
143
- urlParamsSettings?: QueryParamsSerializationOptions;
156
+ reload?: boolean;
157
+ backgroundReload?: boolean;
158
+ host?: string;
159
+ namespace?: string;
160
+ resourcePath?: string;
161
+ urlParamsSettings?: QueryParamsSerializationOptions;
144
162
  };
145
163
  export type FindRecordOptions<T = unknown> = ConstrainedRequestOptions & {
146
- include?: T extends TypedRecordInstance ? Includes<T>[] : string | string[];
164
+ include?: T extends TypedRecordInstance ? Includes<T>[] : string | string[];
147
165
  };
148
166
  export interface StructuredDataDocument<T> {
149
- [STRUCTURED]?: true;
150
- /**
151
- * @see {@link ImmutableRequestInfo}
152
- */
153
- request: ImmutableRequestInfo;
154
- response: Response | ResponseInfo | null;
155
- content: T;
167
+ [STRUCTURED]?: true;
168
+ /**
169
+ * @see {@link ImmutableRequestInfo}
170
+ */
171
+ request: ImmutableRequestInfo;
172
+ response: Response | ResponseInfo | null;
173
+ content: T;
156
174
  }
157
175
  export interface StructuredErrorDocument<T = unknown> extends Error {
158
- [STRUCTURED]?: true;
159
- request: ImmutableRequestInfo;
160
- response: Response | ResponseInfo | null;
161
- error: string | object;
162
- content?: T;
176
+ [STRUCTURED]?: true;
177
+ request: ImmutableRequestInfo;
178
+ response: Response | ResponseInfo | null;
179
+ error: string | object;
180
+ content?: T;
163
181
  }
164
182
  export type StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument<T>;
165
183
  /**
166
- * JavaScript's native Request class.
167
- *
168
- * WarpDrive provides our own typings due to incompleteness in the native typings.
169
- *
170
- */
184
+ * JavaScript's native Request class.
185
+ *
186
+ * WarpDrive provides our own typings due to incompleteness in the native typings.
187
+ *
188
+ */
171
189
  interface Request {
172
- /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
173
- */
174
- cache?: RequestCache;
175
- /** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.
176
- */
177
- credentials?: RequestCredentials;
178
- /** Returns the kind of resource requested by request, e.g., "document" or "script".
179
- */
180
- destination?: RequestDestination;
181
- /** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
182
- */
183
- headers?: Headers;
184
- /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
185
- */
186
- integrity?: string;
187
- /** Returns a boolean indicating whether or not request can outlive the global in which it was created.
188
- */
189
- keepalive?: boolean;
190
- /** Returns request's HTTP method, which is "GET" by default.
191
- */
192
- method?: HTTPMethod;
193
- /** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.
194
- *
195
- * `no-cors` is not allowed for streaming request bodies.
196
- *
197
- */
198
- mode?: RequestMode;
199
- /** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
200
- */
201
- redirect?: RequestRedirect;
202
- /** Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.
203
- */
204
- referrer?: string;
205
- /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
206
- */
207
- referrerPolicy?: ReferrerPolicy;
208
- /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
209
- */
210
- signal?: AbortSignal;
211
- /** Returns the URL of request as a string.
212
- */
213
- url?: string;
214
- /** Any body that you want to add to your request. Note that a GET or HEAD request may not have a body.
215
- */
216
- body?: BodyInit | null;
217
- /**
218
- * When sending a ReadableStream as the body of a request, 'half' must be
219
- * specified.
220
- *
221
- * [Half Duplex Further Reading](https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests#half_duplex)
222
- *
223
- */
224
- duplex?: 'half';
190
+ /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
191
+ */
192
+ cache?: RequestCache;
193
+ /** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.
194
+ */
195
+ credentials?: RequestCredentials;
196
+ /** Returns the kind of resource requested by request, e.g., "document" or "script".
197
+ */
198
+ destination?: RequestDestination;
199
+ /** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
200
+ */
201
+ headers?: Headers;
202
+ /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
203
+ */
204
+ integrity?: string;
205
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created.
206
+ */
207
+ keepalive?: boolean;
208
+ /** Returns request's HTTP method, which is "GET" by default.
209
+ */
210
+ method?: HTTPMethod;
211
+ /** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.
212
+ *
213
+ * `no-cors` is not allowed for streaming request bodies.
214
+ *
215
+ */
216
+ mode?: RequestMode;
217
+ /** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
218
+ */
219
+ redirect?: RequestRedirect;
220
+ /** Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.
221
+ */
222
+ referrer?: string;
223
+ /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
224
+ */
225
+ referrerPolicy?: ReferrerPolicy;
226
+ /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
227
+ */
228
+ signal?: AbortSignal;
229
+ /** Returns the URL of request as a string.
230
+ */
231
+ url?: string;
232
+ /** Any body that you want to add to your request. Note that a GET or HEAD request may not have a body.
233
+ */
234
+ body?: BodyInit | null;
235
+ /**
236
+ * When sending a ReadableStream as the body of a request, 'half' must be
237
+ * specified.
238
+ *
239
+ * [Half Duplex Further Reading](https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests#half_duplex)
240
+ *
241
+ */
242
+ duplex?: "half";
225
243
  }
226
244
  export interface ImmutableHeaders extends Headers {
227
- clone?(): Headers;
228
- toJSON(): [string, string][];
245
+ clone?(): Headers;
246
+ toJSON(): [string, string][];
229
247
  }
230
248
  /**
231
- * Extends JavaScript's native {@link Request} object with additional
232
- * properties specific to the RequestManager's capabilities.
233
- *
234
- */
235
- export interface RequestInfo<RT = unknown, T = unknown> extends Request {
236
- /**
237
- * If provided, used instead of the AbortController auto-configured for each request by the RequestManager
238
- *
239
- */
240
- controller?: AbortController;
241
- /**
242
- * @see {@link CacheOptions}
243
- */
244
- cacheOptions?: CacheOptions<T>;
245
- store?: Store;
246
- op?: string;
247
- /**
248
- * The identifiers of the primary resources involved in the request
249
- * (if any). This may be used by handlers to perform transactional
250
- * operations on the store.
251
- *
252
- */
253
- records?: StableRecordIdentifier[];
254
- disableTestWaiter?: boolean;
255
- /**
256
- * data that a handler should convert into
257
- * the query (GET) or body (POST).
258
- *
259
- * Note: It is recommended that builders set query params
260
- * and body directly in most scenarios.
261
- *
262
- */
263
- data?: Record<string, unknown>;
264
- /**
265
- * options specifically intended for handlers
266
- * to utilize to process the request
267
- *
268
- */
269
- options?: Record<string, unknown>;
270
- [RequestSignature]?: RT;
271
- [EnableHydration]?: boolean;
249
+ * Extends JavaScript's native {@link Request} object with additional
250
+ * properties specific to the RequestManager's capabilities.
251
+ *
252
+ */
253
+ export interface RequestInfo<
254
+ RT = unknown,
255
+ T = unknown
256
+ > extends Request {
257
+ /**
258
+ * If provided, used instead of the AbortController auto-configured for each request by the RequestManager
259
+ *
260
+ */
261
+ controller?: AbortController;
262
+ /**
263
+ * @see {@link CacheOptions}
264
+ */
265
+ cacheOptions?: CacheOptions<T>;
266
+ store?: Store;
267
+ op?: string;
268
+ /**
269
+ * The identifiers of the primary resources involved in the request
270
+ * (if any). This may be used by handlers to perform transactional
271
+ * operations on the store.
272
+ *
273
+ */
274
+ records?: StableRecordIdentifier[];
275
+ disableTestWaiter?: boolean;
276
+ /**
277
+ * data that a handler should convert into
278
+ * the query (GET) or body (POST).
279
+ *
280
+ * Note: It is recommended that builders set query params
281
+ * and body directly in most scenarios.
282
+ *
283
+ */
284
+ data?: Record<string, unknown>;
285
+ /**
286
+ * options specifically intended for handlers
287
+ * to utilize to process the request
288
+ *
289
+ */
290
+ options?: Record<string, unknown>;
291
+ [RequestSignature]?: RT;
292
+ [EnableHydration]?: boolean;
272
293
  }
273
294
  /**
274
- * Immutable version of {@link RequestInfo}. This is what is passed to handlers.
275
- *
276
- */
277
- export type ImmutableRequestInfo<RT = unknown, T = unknown> = Readonly<Omit<RequestInfo<RT, T>, 'controller'>> & {
278
- readonly cacheOptions?: Readonly<CacheOptions<T>>;
279
- readonly headers?: ImmutableHeaders;
280
- readonly data?: Readonly<Record<string, unknown>>;
281
- readonly options?: Readonly<Record<string, unknown>>;
282
- /** Whether the request body has been read.
283
- */
284
- readonly bodyUsed?: boolean;
295
+ * Immutable version of {@link RequestInfo}. This is what is passed to handlers.
296
+ *
297
+ */
298
+ export type ImmutableRequestInfo<
299
+ RT = unknown,
300
+ T = unknown
301
+ > = Readonly<Omit<RequestInfo<RT, T>, "controller">> & {
302
+ readonly cacheOptions?: Readonly<CacheOptions<T>>;
303
+ readonly headers?: ImmutableHeaders;
304
+ readonly data?: Readonly<Record<string, unknown>>;
305
+ readonly options?: Readonly<Record<string, unknown>>;
306
+ /** Whether the request body has been read.
307
+ */
308
+ readonly bodyUsed?: boolean;
285
309
  };
286
310
  export interface ResponseInfo {
287
- readonly headers: ImmutableHeaders;
288
- readonly ok: boolean;
289
- readonly redirected: boolean;
290
- readonly status: number;
291
- readonly statusText: string;
292
- readonly type: ResponseType;
293
- readonly url: string;
311
+ readonly headers: ImmutableHeaders;
312
+ readonly ok: boolean;
313
+ readonly redirected: boolean;
314
+ readonly status: number;
315
+ readonly statusText: string;
316
+ readonly type: ResponseType;
317
+ readonly url: string;
294
318
  }
295
319
  export interface RequestContext {
296
- /**
297
- * @see {@link ImmutableRequestInfo}
298
- */
299
- request: ImmutableRequestInfo;
300
- id: number;
301
- setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;
302
- setResponse(response: Response | ResponseInfo | null): void;
320
+ /**
321
+ * @see {@link ImmutableRequestInfo}
322
+ */
323
+ request: ImmutableRequestInfo;
324
+ id: number;
325
+ setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;
326
+ setResponse(response: Response | ResponseInfo | null): void;
303
327
  }
304
328
  export declare function withBrand<T>(obj: RequestInfo): RequestInfo<T> & {
305
- [RequestSignature]: T;
329
+ [RequestSignature]: T;
306
330
  };
307
331
  export {};
308
- //# sourceMappingURL=request.d.ts.map
@@ -1,15 +1,14 @@
1
- import type { LOG_CONFIG } from '@warp-drive/build-config/-private/utils/logging';
1
+ import type { LOG_CONFIG } from "@warp-drive/build-config/-private/utils/logging";
2
2
  declare const RuntimeConfig: {
3
- debug: Partial<LOG_CONFIG>;
3
+ debug: Partial<LOG_CONFIG>;
4
4
  };
5
5
  export declare function getRuntimeConfig(): typeof RuntimeConfig;
6
6
  /**
7
- * Upserts the specified logging configuration into the runtime
8
- * config.
9
- *
10
- * globalThis.setWarpDriveLogging({ LOG_CACHE: true } });
11
- *
12
- */
7
+ * Upserts the specified logging configuration into the runtime
8
+ * config.
9
+ *
10
+ * globalThis.setWarpDriveLogging({ LOG_CACHE: true } });
11
+ *
12
+ */
13
13
  export declare function setLogging(config: Partial<LOG_CONFIG>): void;
14
14
  export {};
15
- //# sourceMappingURL=runtime.d.ts.map