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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/README.md +7 -8
  2. package/declarations/index.d.ts +3 -14
  3. package/declarations/index.d.ts.map +1 -0
  4. package/declarations/request/-private/context.d.ts +35 -34
  5. package/declarations/request/-private/context.d.ts.map +1 -0
  6. package/declarations/request/-private/debug.d.ts +3 -2
  7. package/declarations/request/-private/debug.d.ts.map +1 -0
  8. package/declarations/request/-private/fetch.d.ts +36 -24
  9. package/declarations/request/-private/fetch.d.ts.map +1 -0
  10. package/declarations/request/-private/future.d.ts +4 -3
  11. package/declarations/request/-private/future.d.ts.map +1 -0
  12. package/declarations/request/-private/manager.d.ts +132 -159
  13. package/declarations/request/-private/manager.d.ts.map +1 -0
  14. package/declarations/request/-private/promise-cache.d.ts +13 -21
  15. package/declarations/request/-private/promise-cache.d.ts.map +1 -0
  16. package/declarations/request/-private/types.d.ts +123 -124
  17. package/declarations/request/-private/types.d.ts.map +1 -0
  18. package/declarations/request/-private/utils.d.ts +9 -8
  19. package/declarations/request/-private/utils.d.ts.map +1 -0
  20. package/declarations/request.d.ts +433 -5
  21. package/declarations/request.d.ts.map +1 -0
  22. package/declarations/types/-private.d.ts +8 -16
  23. package/declarations/types/-private.d.ts.map +1 -0
  24. package/declarations/types/cache/aliases.d.ts +1 -11
  25. package/declarations/types/cache/aliases.d.ts.map +1 -0
  26. package/declarations/types/cache/change.d.ts +5 -4
  27. package/declarations/types/cache/change.d.ts.map +1 -0
  28. package/declarations/types/cache/mutations.d.ts +28 -51
  29. package/declarations/types/cache/mutations.d.ts.map +1 -0
  30. package/declarations/types/cache/operations.d.ts +47 -60
  31. package/declarations/types/cache/operations.d.ts.map +1 -0
  32. package/declarations/types/cache/relationship.d.ts +9 -11
  33. package/declarations/types/cache/relationship.d.ts.map +1 -0
  34. package/declarations/types/cache.d.ts +484 -495
  35. package/declarations/types/cache.d.ts.map +1 -0
  36. package/declarations/types/graph.d.ts +40 -31
  37. package/declarations/types/graph.d.ts.map +1 -0
  38. package/declarations/types/identifier.d.ts +82 -83
  39. package/declarations/types/identifier.d.ts.map +1 -0
  40. package/declarations/types/json/raw.d.ts +2 -1
  41. package/declarations/types/json/raw.d.ts.map +1 -0
  42. package/declarations/types/params.d.ts +5 -4
  43. package/declarations/types/params.d.ts.map +1 -0
  44. package/declarations/types/record.d.ts +76 -117
  45. package/declarations/types/record.d.ts.map +1 -0
  46. package/declarations/types/record.type-test.d.ts +2 -0
  47. package/declarations/types/record.type-test.d.ts.map +1 -0
  48. package/declarations/types/request.d.ts +266 -289
  49. package/declarations/types/request.d.ts.map +1 -0
  50. package/declarations/types/request.type-test.d.ts +2 -0
  51. package/declarations/types/request.type-test.d.ts.map +1 -0
  52. package/declarations/types/runtime.d.ts +9 -8
  53. package/declarations/types/runtime.d.ts.map +1 -0
  54. package/declarations/types/schema/concepts.d.ts +13 -19
  55. package/declarations/types/schema/concepts.d.ts.map +1 -0
  56. package/declarations/types/schema/fields.d.ts +1741 -1712
  57. package/declarations/types/schema/fields.d.ts.map +1 -0
  58. package/declarations/types/schema/fields.type-test.d.ts +1 -0
  59. package/declarations/types/schema/fields.type-test.d.ts.map +1 -0
  60. package/declarations/types/spec/document.d.ts +22 -28
  61. package/declarations/types/spec/document.d.ts.map +1 -0
  62. package/declarations/types/spec/error.d.ts +17 -16
  63. package/declarations/types/spec/error.d.ts.map +1 -0
  64. package/declarations/types/spec/json-api-raw.d.ts +102 -102
  65. package/declarations/types/spec/json-api-raw.d.ts.map +1 -0
  66. package/declarations/types/symbols.d.ts +75 -74
  67. package/declarations/types/symbols.d.ts.map +1 -0
  68. package/declarations/types/utils.d.ts +5 -5
  69. package/declarations/types/utils.d.ts.map +1 -0
  70. package/declarations/types.d.ts +7 -10
  71. package/declarations/types.d.ts.map +1 -0
  72. package/dist/{context-COmAnXUQ.js → context-DE5sFezZ.js} +2 -2
  73. package/dist/context-DE5sFezZ.js.map +1 -0
  74. package/dist/index.js +104 -37
  75. package/dist/index.js.map +1 -0
  76. package/dist/request.js +1 -1
  77. package/dist/request.js.map +1 -0
  78. package/dist/types/-private.js +3 -3
  79. package/dist/types/-private.js.map +1 -0
  80. package/dist/types/cache/aliases.js.map +1 -0
  81. package/dist/types/cache/change.js.map +1 -0
  82. package/dist/types/cache/mutations.js.map +1 -0
  83. package/dist/types/cache/operations.js.map +1 -0
  84. package/dist/types/cache/relationship.js.map +1 -0
  85. package/dist/types/cache.js.map +1 -0
  86. package/dist/types/graph.js.map +1 -0
  87. package/dist/types/identifier.js.map +1 -0
  88. package/dist/types/json/raw.js.map +1 -0
  89. package/dist/types/params.js.map +1 -0
  90. package/dist/types/record.js +1 -1
  91. package/dist/types/record.js.map +1 -0
  92. package/dist/types/request.js +2 -2
  93. package/dist/types/request.js.map +1 -0
  94. package/dist/types/runtime.js +1 -1
  95. package/dist/types/runtime.js.map +1 -0
  96. package/dist/types/schema/concepts.js.map +1 -0
  97. package/dist/types/schema/fields.js +41 -8
  98. package/dist/types/schema/fields.js.map +1 -0
  99. package/dist/types/schema/fields.type-test.js.map +1 -0
  100. package/dist/types/spec/document.js.map +1 -0
  101. package/dist/types/spec/error.js.map +1 -0
  102. package/dist/types/spec/json-api-raw.js.map +1 -0
  103. package/dist/types/symbols.js +3 -3
  104. package/dist/types/symbols.js.map +1 -0
  105. package/dist/types/utils.js.map +1 -0
  106. package/dist/types.js.map +1 -0
  107. package/package.json +8 -11
  108. package/cjs-dist/addon-shim.cjs +0 -1
  109. package/cjs-dist/cjs-set-config.cjs +0 -1
  110. package/declarations/build-config/babel-macros.d.ts +0 -1
  111. package/declarations/build-config/canary-features.d.ts +0 -1
  112. package/declarations/build-config/debugging.d.ts +0 -1
  113. package/declarations/build-config/deprecations.d.ts +0 -1
  114. package/declarations/build-config/env.d.ts +0 -1
  115. package/declarations/build-config/macros.d.ts +0 -1
  116. package/declarations/build-config.d.ts +0 -1
  117. package/declarations/configure.d.ts +0 -7
  118. package/declarations/graph/-private/-diff.d.ts +0 -32
  119. package/declarations/graph/-private/-edge-definition.d.ts +0 -148
  120. package/declarations/graph/-private/-state.d.ts +0 -96
  121. package/declarations/graph/-private/-utils.d.ts +0 -31
  122. package/declarations/graph/-private/coerce-id.d.ts +0 -10
  123. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +0 -18
  124. package/declarations/graph/-private/edges/collection.d.ts +0 -39
  125. package/declarations/graph/-private/edges/implicit.d.ts +0 -43
  126. package/declarations/graph/-private/edges/resource.d.ts +0 -24
  127. package/declarations/graph/-private/graph.d.ts +0 -90
  128. package/declarations/graph/-private/normalize-link.d.ts +0 -8
  129. package/declarations/graph/-private/operations/add-to-related-records.d.ts +0 -4
  130. package/declarations/graph/-private/operations/merge-identifier.d.ts +0 -3
  131. package/declarations/graph/-private/operations/remove-from-related-records.d.ts +0 -4
  132. package/declarations/graph/-private/operations/replace-related-record.d.ts +0 -3
  133. package/declarations/graph/-private/operations/replace-related-records.d.ts +0 -62
  134. package/declarations/graph/-private/operations/update-relationship.d.ts +0 -13
  135. package/declarations/graph/-private.d.ts +0 -13
  136. package/declarations/reactive/-private/document.d.ts +0 -146
  137. package/declarations/reactive/-private/fields/compute.d.ts +0 -43
  138. package/declarations/reactive/-private/fields/extension.d.ts +0 -8
  139. package/declarations/reactive/-private/fields/managed-array.d.ts +0 -22
  140. package/declarations/reactive/-private/fields/managed-object.d.ts +0 -21
  141. package/declarations/reactive/-private/fields/many-array-manager.d.ts +0 -19
  142. package/declarations/reactive/-private/hooks.d.ts +0 -5
  143. package/declarations/reactive/-private/record.d.ts +0 -64
  144. package/declarations/reactive/-private/schema.d.ts +0 -271
  145. package/declarations/reactive/-private/symbols.d.ts +0 -36
  146. package/declarations/reactive/-private.d.ts +0 -1
  147. package/declarations/reactive.d.ts +0 -4
  148. package/declarations/store/-private/cache-handler/handler.d.ts +0 -62
  149. package/declarations/store/-private/cache-handler/types.d.ts +0 -98
  150. package/declarations/store/-private/cache-handler/utils.d.ts +0 -32
  151. package/declarations/store/-private/caches/cache-utils.d.ts +0 -12
  152. package/declarations/store/-private/caches/identifier-cache.d.ts +0 -304
  153. package/declarations/store/-private/caches/instance-cache.d.ts +0 -65
  154. package/declarations/store/-private/caches/resource-utils.d.ts +0 -9
  155. package/declarations/store/-private/debug/utils.d.ts +0 -6
  156. package/declarations/store/-private/default-cache-policy.d.ts +0 -384
  157. package/declarations/store/-private/legacy-model-support/record-reference.d.ts +0 -159
  158. package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +0 -17
  159. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +0 -25
  160. package/declarations/store/-private/managers/cache-manager.d.ts +0 -443
  161. package/declarations/store/-private/managers/notification-manager.d.ts +0 -98
  162. package/declarations/store/-private/managers/record-array-manager.d.ts +0 -97
  163. package/declarations/store/-private/network/request-cache.d.ts +0 -107
  164. package/declarations/store/-private/new-core-tmp/promise-state.d.ts +0 -263
  165. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +0 -176
  166. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +0 -169
  167. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +0 -35
  168. package/declarations/store/-private/new-core-tmp/request-state.d.ts +0 -277
  169. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +0 -261
  170. package/declarations/store/-private/record-arrays/identifier-array.d.ts +0 -147
  171. package/declarations/store/-private/record-arrays/many-array.d.ts +0 -197
  172. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +0 -126
  173. package/declarations/store/-private/store-service.d.ts +0 -1605
  174. package/declarations/store/-private/utils/coerce-id.d.ts +0 -10
  175. package/declarations/store/-private/utils/construct-resource.d.ts +0 -6
  176. package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
  177. package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
  178. package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
  179. package/declarations/store/-private.d.ts +0 -31
  180. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +0 -99
  181. package/declarations/store/-types/q/ds-model.d.ts +0 -21
  182. package/declarations/store/-types/q/identifier.d.ts +0 -20
  183. package/declarations/store/-types/q/record-instance.d.ts +0 -23
  184. package/declarations/store/-types/q/schema-service.d.ts +0 -354
  185. package/declarations/store/-types/q/store.d.ts +0 -32
  186. package/declarations/store.d.ts +0 -1
  187. package/declarations/utils/string.d.ts +0 -48
  188. package/dist/build-config/babel-macros.js +0 -1
  189. package/dist/build-config/canary-features.js +0 -1
  190. package/dist/build-config/debugging.js +0 -1
  191. package/dist/build-config/deprecations.js +0 -1
  192. package/dist/build-config/env.js +0 -1
  193. package/dist/build-config/macros.js +0 -1
  194. package/dist/build-config.js +0 -1
  195. package/dist/configure-B48bFHOl.js +0 -181
  196. package/dist/configure.js +0 -1
  197. package/dist/graph/-private.js +0 -3372
  198. package/dist/handler-C2T-IyJK.js +0 -339
  199. package/dist/reactive/-private.js +0 -1
  200. package/dist/reactive.js +0 -1988
  201. package/dist/request-state-CjLph1LP.js +0 -8139
  202. package/dist/store/-private.js +0 -3
  203. package/dist/store.js +0 -545
  204. package/dist/symbols-SIstXMLI.js +0 -44
  205. package/dist/utils/string.js +0 -92
  206. package/logos/NCC-1701-a-blue.svg +0 -4
  207. package/logos/NCC-1701-a-gold.svg +0 -4
  208. package/logos/NCC-1701-a-gold_100.svg +0 -1
  209. package/logos/NCC-1701-a-gold_base-64.txt +0 -1
  210. package/logos/NCC-1701-a.svg +0 -4
  211. package/logos/README.md +0 -4
  212. package/logos/docs-badge.svg +0 -2
  213. package/logos/ember-data-logo-dark.svg +0 -12
  214. package/logos/ember-data-logo-light.svg +0 -12
  215. package/logos/github-header.svg +0 -444
  216. package/logos/social1.png +0 -0
  217. package/logos/social2.png +0 -0
  218. package/logos/warp-drive-logo-dark.svg +0 -4
  219. package/logos/warp-drive-logo-gold.svg +0 -4
@@ -1,91 +1,89 @@
1
- /* eslint-disable no-irregular-whitespace */
2
- import type { StableDocumentIdentifier } from "../../types/identifier.js";
3
- import type { IS_FUTURE, RequestContext, RequestInfo, ResponseInfo, StructuredDataDocument } from "../../types/request.js";
1
+ import type { StableDocumentIdentifier } from '../../types/identifier';
2
+ import type { IS_FUTURE, RequestContext, RequestInfo, ResponseInfo, StructuredDataDocument } from '../../types/request';
4
3
  export interface GodContext {
5
- controller: AbortController;
6
- response: ResponseInfo | null;
7
- stream: ReadableStream | Promise<ReadableStream | null> | null;
8
- hasRequestedStream: boolean;
9
- id: number;
10
- identifier: StableDocumentIdentifier | null;
4
+ controller: AbortController;
5
+ response: ResponseInfo | null;
6
+ stream: ReadableStream | Promise<ReadableStream | null> | null;
7
+ hasRequestedStream: boolean;
8
+ id: number;
9
+ identifier: StableDocumentIdentifier | null;
11
10
  }
12
11
  export type Deferred<T> = {
13
- resolve(v: T): void;
14
- reject(v: unknown): void;
15
- promise: Promise<T>;
12
+ resolve(v: T): void;
13
+ reject(v: unknown): void;
14
+ promise: Promise<T>;
16
15
  };
17
16
  export type ManagedRequestPriority = {
18
- blocking: boolean;
17
+ blocking: boolean;
19
18
  };
20
19
  export type DeferredStream = {
21
- resolve(v: ReadableStream | null): void;
22
- reject(v: unknown): void;
23
- promise: Promise<ReadableStream | null> & {
24
- sizeHint?: number;
25
- };
20
+ resolve(v: ReadableStream | null): void;
21
+ reject(v: unknown): void;
22
+ promise: Promise<ReadableStream | null> & {
23
+ sizeHint?: number;
24
+ };
26
25
  };
27
26
  /**
28
- * A Future is a {@link Promise} which resolves to a {@link StructuredDataDocument | StructuredDocument}
29
- * while providing the ability to {@link Future.abort | abort} the underlying request, and
30
- * {@link Future.getStream | access the response stream} before the outer promise resolves;
31
- *
32
- * @public
33
- */
27
+ * A Future is a Promise which resolves to a StructuredDocument
28
+ * while providing the ability to `abort` the underlying request,
29
+ * `getStream` the response before the outer promise resolves;
30
+ *
31
+ * @class Future
32
+ * @public
33
+ */
34
34
  export interface Future<T> extends Promise<StructuredDataDocument<T>> {
35
- [IS_FUTURE]: true;
36
- /**
37
- * Cancel this request by firing the {@link AbortController}'s signal.
38
- *
39
- * @privateRemarks
40
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
41
- *
42
- * @param reason optional reason for aborting the request
43
- * @public
44
- */
45
- abort(reason?: string): void;
46
- /**
47
- * Get the response stream, if any, once made available.
48
- *
49
- * @public
50
- * @return {Promise<ReadableStream | null>}
51
- */
52
- getStream(): Promise<ReadableStream | null>;
53
- /**
54
- * Run a callback when this request completes. Use sparingly,
55
- * mostly useful for instrumentation and infrastructure.
56
- *
57
- * @param cb the callback to run
58
- * @public
59
- * @return {void}
60
- */
61
- onFinalize(cb: () => void): void;
62
- /**
63
- * The identifier of the associated request, if any, as
64
- * assigned by the CacheHandler.
65
- *
66
- * @property lid
67
- * @type {StableDocumentIdentifier | null}
68
- * @public
69
- */
70
- lid: StableDocumentIdentifier | null;
71
- /**
72
- * The id of the associated request, if any, as assigned
73
- * by the RequestManager
74
- *
75
- * @property id
76
- * @type {Number}
77
- * @public
78
- */
79
- id: number;
35
+ [IS_FUTURE]: true;
36
+ /**
37
+ * Cancel this request by firing the AbortController's signal.
38
+ *
39
+ * @param {String} [reason] optional reason for aborting the request
40
+ * @public
41
+ * @return {void}
42
+ */
43
+ abort(reason?: string): void;
44
+ /**
45
+ * Get the response stream, if any, once made available.
46
+ *
47
+ * @public
48
+ * @return {Promise<ReadableStream | null>}
49
+ */
50
+ getStream(): Promise<ReadableStream | null>;
51
+ /**
52
+ * Run a callback when this request completes. Use sparingly,
53
+ * mostly useful for instrumentation and infrastructure.
54
+ *
55
+ * @param cb the callback to run
56
+ * @public
57
+ * @return {void}
58
+ */
59
+ onFinalize(cb: () => void): void;
60
+ /**
61
+ * The identifier of the associated request, if any, as
62
+ * assigned by the CacheHandler.
63
+ *
64
+ * @property lid
65
+ * @type {StableDocumentIdentifier | null}
66
+ * @public
67
+ */
68
+ lid: StableDocumentIdentifier | null;
69
+ /**
70
+ * The id of the associated request, if any, as assigned
71
+ * by the RequestManager
72
+ *
73
+ * @property id
74
+ * @type {Number}
75
+ * @public
76
+ */
77
+ id: number;
80
78
  }
81
79
  export type DeferredFuture<T> = {
82
- resolve(v: StructuredDataDocument<T>): void;
83
- reject(v: unknown): void;
84
- promise: Future<T>;
80
+ resolve(v: StructuredDataDocument<T>): void;
81
+ reject(v: unknown): void;
82
+ promise: Future<T>;
85
83
  };
86
84
  export type NextFn<P = unknown> = (req: RequestInfo) => Future<P>;
87
85
  /**
88
- * Requests are fulfilled by handlers. A handler receives the request context
86
+ * Requests are fulfilled by handlers. A handler receives the request context
89
87
  as well as a `next` function with which to pass along a request to the next
90
88
  handler if it so chooses.
91
89
 
@@ -99,7 +97,7 @@ that it can then compose how it sees fit with its own response.
99
97
  type NextFn<P> = (req: RequestInfo) => Future<P>;
100
98
 
101
99
  interface Handler {
102
- async request<T>(context: RequestContext, next: NextFn<P>): T;
100
+ async request<T>(context: RequestContext, next: NextFn<P>): T;
103
101
  }
104
102
  ```
105
103
 
@@ -107,10 +105,10 @@ async request<T>(context: RequestContext, next: NextFn<P>): T;
107
105
 
108
106
  ```ts
109
107
  interface RequestContext<T> {
110
- readonly request: RequestInfo;
108
+ readonly request: RequestInfo;
111
109
 
112
- setStream(stream: ReadableStream | Promise<ReadableStream>): void;
113
- setResponse(response: Response | ResponseInfo): void;
110
+ setStream(stream: ReadableStream | Promise<ReadableStream>): void;
111
+ setResponse(response: Response | ResponseInfo): void;
114
112
  }
115
113
  ```
116
114
 
@@ -123,13 +121,13 @@ response content before passing along the chunk downstream.
123
121
 
124
122
  ```ts
125
123
  const FetchHandler = {
126
- async request(context) {
127
- const response = await fetch(context.request);
128
- context.setResponse(reponse);
129
- context.setStream(response.clone().body);
124
+ async request(context) {
125
+ const response = await fetch(context.request);
126
+ context.setResponse(reponse);
127
+ context.setStream(response.clone().body);
130
128
 
131
- return response.json();
132
- }
129
+ return response.json();
130
+ }
133
131
  }
134
132
  ```
135
133
 
@@ -140,13 +138,13 @@ return response.json();
140
138
  For context, it helps to understand a few of the use-cases that RequestManager
141
139
  is intended to allow.
142
140
 
143
- - to manage and return streaming content (such as video files)
144
- - to fulfill a request from multiple sources or by splitting one request into multiple requests
145
- - for instance one API call for a user and another for the user's friends
146
- - or e.g. fulfilling part of the request from one source (one API, in-memory, localStorage, IndexedDB etc.) and the rest from another source (a different API, a WebWorker, etc.)
147
- - to coalesce multiple requests
148
- - to decorate a request with additional info
149
- - e.g. an Auth handler that ensures the correct tokens or headers or cookies are attached.
141
+ - to manage and return streaming content (such as video files)
142
+ - to fulfill a request from multiple sources or by splitting one request into multiple requests
143
+ - for instance one API call for a user and another for the user's friends
144
+ - or e.g. fulfilling part of the request from one source (one API, in-memory, localStorage, IndexedDB etc.) and the rest from another source (a different API, a WebWorker, etc.)
145
+ - to coalesce multiple requests
146
+ - to decorate a request with additional info
147
+ - e.g. an Auth handler that ensures the correct tokens or headers or cookies are attached.
150
148
 
151
149
  ----
152
150
 
@@ -186,51 +184,52 @@ Request handlers are registered by configuring the manager via `use`
186
184
 
187
185
  ```ts
188
186
  const manager = new RequestManager()
189
- .use([Handler1, Handler2]);
187
+ .use([Handler1, Handler2]);
190
188
  ```
191
189
 
192
190
  Handlers will be invoked in the order they are registered ("fifo", first-in first-out), and may only be registered up until the first request is made. It is recommended but not required to register all handlers at one time in order to ensure explicitly visible handler ordering.
193
191
 
194
192
 
195
- @class (Interface) Handler
196
- @public
193
+ @class (Interface) Handler
194
+ @public
197
195
  */
198
196
  export interface Handler {
199
- /**
200
- * Method to implement to handle requests. Receives the request
201
- * context and a nextFn to call to pass-along the request to
202
- * other handlers.
203
- *
204
- * @public
205
- * @param context
206
- * @param next
207
- */
208
- request<T = unknown>(context: RequestContext, next: NextFn<T>): Promise<T | StructuredDataDocument<T>> | Future<T>;
197
+ /**
198
+ * Method to implement to handle requests. Receives the request
199
+ * context and a nextFn to call to pass-along the request to
200
+ * other handlers.
201
+ *
202
+ * @public
203
+ * @param context
204
+ * @param next
205
+ */
206
+ request<T = unknown>(context: RequestContext, next: NextFn<T>): Promise<T | StructuredDataDocument<T>> | Future<T>;
209
207
  }
210
208
  /**
211
- * The CacheHandler is identical to other handlers ecxept that it
212
- * is allowed to return a value synchronously. This is useful for
213
- * features like reducing microtask queueing when de-duping.
214
- *
215
- * A RequestManager may only have one CacheHandler, registered via
216
- * `manager.useCache(CacheHandler)`.
217
- *
218
- * @class (Interface) CacheHandler
219
- * @public
220
- */
209
+ * The CacheHandler is identical to other handlers ecxept that it
210
+ * is allowed to return a value synchronously. This is useful for
211
+ * features like reducing microtask queueing when de-duping.
212
+ *
213
+ * A RequestManager may only have one CacheHandler, registered via
214
+ * `manager.useCache(CacheHandler)`.
215
+ *
216
+ * @class (Interface) CacheHandler
217
+ * @public
218
+ */
221
219
  export interface CacheHandler {
222
- /**
223
- * Method to implement to handle requests. Receives the request
224
- * context and a nextFn to call to pass-along the request to
225
- * other handlers.
226
- *
227
- * @public
228
- * @param context
229
- * @param next
230
- */
231
- request<T = unknown>(context: RequestContext, next: NextFn<T>): Promise<T | StructuredDataDocument<T>> | Future<T> | T;
220
+ /**
221
+ * Method to implement to handle requests. Receives the request
222
+ * context and a nextFn to call to pass-along the request to
223
+ * other handlers.
224
+ *
225
+ * @public
226
+ * @param context
227
+ * @param next
228
+ */
229
+ request<T = unknown>(context: RequestContext, next: NextFn<T>): Promise<T | StructuredDataDocument<T>> | Future<T> | T;
232
230
  }
233
231
  export interface RequestResponse<T> {
234
- result: T;
232
+ result: T;
235
233
  }
236
234
  export type GenericCreateArgs = Record<string | symbol, unknown>;
235
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/request/-private/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EA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AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,MAAM,EAAE,CAAC,CAAC;CACX;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC"}
@@ -1,15 +1,16 @@
1
- import type { RequestInfo, StructuredDataDocument } from "../../types/request.js";
2
- import { ContextOwner } from "./context.js";
3
- import type { DeferredFuture, Future, GodContext, Handler } from "./types.js";
1
+ import type { RequestInfo, StructuredDataDocument } from '../../types/request';
2
+ import { ContextOwner } from './context';
3
+ import type { DeferredFuture, Future, GodContext, Handler } from './types';
4
4
  export declare const IS_CACHE_HANDLER: "___(unique) Symbol(IS_CACHE_HANDLER)";
5
5
  export declare function curryFuture<T>(owner: ContextOwner, inbound: Future<T>, outbound: DeferredFuture<T>): Future<T>;
6
6
  export interface HttpErrorProps extends DOMException {
7
- code: number;
8
- name: string;
9
- status: number;
10
- statusText: string;
11
- isRequestError: boolean;
7
+ code: number;
8
+ name: string;
9
+ status: number;
10
+ statusText: string;
11
+ isRequestError: boolean;
12
12
  }
13
13
  export declare function enhanceReason(reason?: string): DOMException;
14
14
  export declare function handleOutcome<T>(owner: ContextOwner, inbound: Promise<T | StructuredDataDocument<T>>, outbound: DeferredFuture<T>): Future<T>;
15
15
  export declare function executeNextHandler<T>(wares: Readonly<Handler[]>, request: RequestInfo, i: number, god: GodContext): Future<T>;
16
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/request/-private/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EACX,sBAAsB,EAGvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAW,YAAY,EAAE,MAAM,WAAW,CAAC;AAIlD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3E,eAAO,MAAM,gBAAgB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