@warp-drive/core 5.10.0-alpha.0 → 5.10.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{-private-DQW39hCl.js → -private-CjK1Dmuh.js} +3 -3
- package/dist/{-private-DQW39hCl.js.map → -private-CjK1Dmuh.js.map} +1 -1
- package/dist/{-private-BVx3LW79.js → -private-Dtj8O5W7.js} +2 -2
- package/dist/{-private-BVx3LW79.js.map → -private-Dtj8O5W7.js.map} +1 -1
- package/dist/configure.js +1 -1
- package/dist/{document-BEn91SwT.d.ts → document-Ca4ZZBd9.d.ts} +2 -2
- package/dist/{document-BEn91SwT.d.ts.map → document-Ca4ZZBd9.d.ts.map} +1 -1
- package/dist/{error-50OSEhsF.d.ts → error-0uD6GkNX.d.ts} +6 -2
- package/dist/error-0uD6GkNX.d.ts.map +1 -0
- package/dist/graph/-private.d.ts +1 -1
- package/dist/graph/-private.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{internal-DtWOpxrR.d.ts → internal-9XuWZdDv.d.ts} +840 -758
- package/dist/internal-9XuWZdDv.d.ts.map +1 -0
- package/dist/reactive/-private.d.ts +1 -1
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.d.ts +1 -1
- package/dist/reactive.js +3 -3
- package/dist/{request-CVg2OTfv.js → request-Di274pQz.js} +14 -2
- package/dist/{request-CVg2OTfv.js.map → request-Di274pQz.js.map} +1 -1
- package/dist/request.d.ts +1 -1
- package/dist/request.js +1 -1
- package/dist/signals/-leaked.d.ts +16 -16
- package/dist/signals/-leaked.d.ts.map +1 -1
- package/dist/signals/-leaked.js +1 -1
- package/dist/{src-BJWUE7e3.js → src-TlQlgL5V.js} +76 -57
- package/dist/src-TlQlgL5V.js.map +1 -0
- package/dist/store/-private.d.ts +2 -2
- package/dist/store/-private.js +2 -2
- package/dist/store.d.ts +1 -1
- package/dist/types/-private.d.ts +6 -7
- package/dist/types/-private.d.ts.map +1 -1
- package/dist/types/-private.js +116 -2
- package/dist/types/-private.js.map +1 -0
- package/dist/types/cache.d.ts +1 -1
- package/dist/types/request.d.ts +1 -1
- package/dist/types/request.js +1 -1
- package/dist/types/runtime.d.ts +3 -4
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/types/runtime.js +1 -1
- package/dist/types/schema/schema-service.d.ts +1 -1
- package/dist/types/spec/document.d.ts +1 -1
- package/dist/types/spec/error.d.ts +1 -1
- package/dist/types/symbols.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/unpkg/dev/{-private-B9s2h5b6.js → -private-DrQgwtNS.js} +3 -3
- package/dist/unpkg/{dev-deprecated/-private-B9s2h5b6.js.map → dev/-private-DrQgwtNS.js.map} +1 -1
- package/dist/unpkg/dev/{-private-DcPB5DHD.js → -private-Dtj8O5W7.js} +2 -2
- package/dist/unpkg/{prod/-private-BWNdDSOr.js.map → dev/-private-Dtj8O5W7.js.map} +1 -1
- package/dist/unpkg/dev/configure.js +1 -1
- package/dist/unpkg/dev/graph/-private.js +2 -2
- package/dist/unpkg/dev/index.js +1 -1
- package/dist/unpkg/dev/reactive/-private.js +1 -1
- package/dist/unpkg/dev/reactive.js +3 -3
- package/dist/unpkg/{dev-deprecated/request-DEdT4gST.js → dev/request-nAaeDlS9.js} +14 -2
- package/dist/unpkg/dev/{request-DEdT4gST.js.map → request-nAaeDlS9.js.map} +1 -1
- package/dist/unpkg/dev/request.js +1 -1
- package/dist/unpkg/dev/{runtime-FdPeCUwk.js → runtime-vtT5WRY_.js} +2 -2
- package/dist/unpkg/dev/{runtime-FdPeCUwk.js.map → runtime-vtT5WRY_.js.map} +1 -1
- package/dist/unpkg/dev/signals/-leaked.js +1 -1
- package/dist/unpkg/dev/{src-CdRGGxoN.js → src-D8uKAIUN.js} +78 -59
- package/dist/unpkg/dev/src-D8uKAIUN.js.map +1 -0
- package/dist/unpkg/dev/store/-private.js +2 -2
- package/dist/unpkg/dev/{store-BRZE8mQW.js → store-BIFNM_fB.js} +3 -3
- package/dist/unpkg/dev/{store-BRZE8mQW.js.map → store-BIFNM_fB.js.map} +1 -1
- package/dist/unpkg/dev/store.js +1 -1
- package/dist/unpkg/dev/types/-private.js +107 -2
- package/dist/unpkg/dev/types/-private.js.map +1 -0
- package/dist/unpkg/dev/types/request.js +1 -1
- package/dist/unpkg/dev/types/runtime.js +1 -1
- package/dist/unpkg/dev/types/symbols.js +1 -1
- package/dist/unpkg/dev-deprecated/{-private-B9s2h5b6.js → -private-DrQgwtNS.js} +3 -3
- package/dist/unpkg/{dev/-private-B9s2h5b6.js.map → dev-deprecated/-private-DrQgwtNS.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/{-private-DcPB5DHD.js → -private-Dtj8O5W7.js} +2 -2
- package/dist/unpkg/dev-deprecated/{-private-DcPB5DHD.js.map → -private-Dtj8O5W7.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/configure.js +1 -1
- package/dist/unpkg/dev-deprecated/graph/-private.js +3 -3
- package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -1
- package/dist/unpkg/dev-deprecated/index.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive.js +3 -3
- package/dist/unpkg/{dev/request-DEdT4gST.js → dev-deprecated/request-nAaeDlS9.js} +14 -2
- package/dist/unpkg/dev-deprecated/{request-DEdT4gST.js.map → request-nAaeDlS9.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/request.js +1 -1
- package/dist/unpkg/dev-deprecated/{runtime-Klu1azLv.js → runtime-e4oZ_UWz.js} +2 -2
- package/dist/unpkg/dev-deprecated/{runtime-Klu1azLv.js.map → runtime-e4oZ_UWz.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/signals/-leaked.js +1 -1
- package/dist/unpkg/dev-deprecated/{src-Dy15xjRt.js → src-BlewXGbB.js} +81 -62
- package/dist/unpkg/dev-deprecated/src-BlewXGbB.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store/-private.js +2 -2
- package/dist/unpkg/dev-deprecated/{store-C6m5EkF2.js → store-X1WN7P_O.js} +3 -3
- package/dist/unpkg/dev-deprecated/{store-C6m5EkF2.js.map → store-X1WN7P_O.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/store.js +1 -1
- package/dist/unpkg/dev-deprecated/types/-private.js +107 -2
- package/dist/unpkg/dev-deprecated/types/-private.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/request.js +1 -1
- package/dist/unpkg/dev-deprecated/types/runtime.js +1 -1
- package/dist/unpkg/dev-deprecated/types/symbols.js +1 -1
- package/dist/unpkg/prod/{-private-Da3Xoapd.js → -private-Dg1vsF-H.js} +3 -3
- package/dist/unpkg/prod/{-private-Da3Xoapd.js.map → -private-Dg1vsF-H.js.map} +1 -1
- package/dist/unpkg/prod/-private-Dtj8O5W7.js +22 -0
- package/dist/unpkg/{prod-deprecated/-private-BWNdDSOr.js.map → prod/-private-Dtj8O5W7.js.map} +1 -1
- package/dist/unpkg/prod/configure.js +1 -1
- package/dist/unpkg/prod/graph/-private.js +1 -1
- package/dist/unpkg/prod/index.js +1 -1
- package/dist/unpkg/prod/reactive/-private.js +1 -1
- package/dist/unpkg/prod/reactive.js +3 -3
- package/dist/unpkg/{prod-deprecated/request-BP3eOqZa.js → prod/request-DK7nNaAf.js} +14 -2
- package/dist/unpkg/prod/{request-BP3eOqZa.js.map → request-DK7nNaAf.js.map} +1 -1
- package/dist/unpkg/prod/request.js +1 -1
- package/dist/unpkg/prod/signals/-leaked.js +1 -1
- package/dist/unpkg/prod/{src-DZBa2djC.js → src-DGB6WvXW.js} +50 -30
- package/dist/unpkg/prod/src-DGB6WvXW.js.map +1 -0
- package/dist/unpkg/prod/store/-private.js +2 -2
- package/dist/unpkg/prod/types/-private.js +95 -2
- package/dist/unpkg/prod/types/-private.js.map +1 -0
- package/dist/unpkg/prod/types/request.js +1 -1
- package/dist/unpkg/prod/types/runtime.js +1 -1
- package/dist/unpkg/prod/types/symbols.js +1 -1
- package/dist/unpkg/prod-deprecated/{-private-Da3Xoapd.js → -private-Dg1vsF-H.js} +3 -3
- package/dist/unpkg/prod-deprecated/{-private-Da3Xoapd.js.map → -private-Dg1vsF-H.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/{-private-BWNdDSOr.js → -private-Dtj8O5W7.js} +2 -2
- package/dist/unpkg/{dev/-private-DcPB5DHD.js.map → prod-deprecated/-private-Dtj8O5W7.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/configure.js +1 -1
- package/dist/unpkg/prod-deprecated/graph/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/index.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive.js +3 -3
- package/dist/unpkg/{prod/request-BP3eOqZa.js → prod-deprecated/request-DK7nNaAf.js} +14 -2
- package/dist/unpkg/prod-deprecated/{request-BP3eOqZa.js.map → request-DK7nNaAf.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/request.js +1 -1
- package/dist/unpkg/prod-deprecated/signals/-leaked.js +1 -1
- package/dist/unpkg/prod-deprecated/{src-CXgpypVP.js → src-B9AnmJPz.js} +51 -31
- package/dist/unpkg/prod-deprecated/src-B9AnmJPz.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store/-private.js +2 -2
- package/dist/unpkg/prod-deprecated/types/-private.js +95 -2
- package/dist/unpkg/prod-deprecated/types/-private.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/request.js +1 -1
- package/dist/unpkg/prod-deprecated/types/runtime.js +1 -1
- package/dist/unpkg/prod-deprecated/types/symbols.js +1 -1
- package/dist/utils/string.d.ts +3 -4
- package/dist/utils/string.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/-private-do3tS7lK.js +0 -120
- package/dist/-private-do3tS7lK.js.map +0 -1
- package/dist/error-50OSEhsF.d.ts.map +0 -1
- package/dist/internal-DtWOpxrR.d.ts.map +0 -1
- package/dist/src-BJWUE7e3.js.map +0 -1
- package/dist/unpkg/dev/-private-9RWV1Vii.js +0 -111
- package/dist/unpkg/dev/-private-9RWV1Vii.js.map +0 -1
- package/dist/unpkg/dev/src-CdRGGxoN.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-9RWV1Vii.js +0 -111
- package/dist/unpkg/dev-deprecated/-private-9RWV1Vii.js.map +0 -1
- package/dist/unpkg/dev-deprecated/src-Dy15xjRt.js.map +0 -1
- package/dist/unpkg/prod/-private-BWNdDSOr.js +0 -22
- package/dist/unpkg/prod/-private-C2sWpOcv.js +0 -99
- package/dist/unpkg/prod/-private-C2sWpOcv.js.map +0 -1
- package/dist/unpkg/prod/src-DZBa2djC.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-C2sWpOcv.js +0 -99
- package/dist/unpkg/prod-deprecated/-private-C2sWpOcv.js.map +0 -1
- package/dist/unpkg/prod-deprecated/src-CXgpypVP.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getOrSetGlobal } from "./types/-private.js";
|
|
2
|
+
|
|
3
|
+
//#region src/reactive/-private/symbols.ts
|
|
4
|
+
const SOURCE = getOrSetGlobal("SOURCE", Symbol("#source"));
|
|
5
|
+
const Destroy = getOrSetGlobal("Destroy", Symbol.dispose || Symbol.for("Dispose"));
|
|
6
|
+
/**
|
|
7
|
+
* Symbol for the method used to request a mutable copy of an otherwise
|
|
8
|
+
* immutable {@link ReactiveResource}.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated use the {@link checkout} utility function instead.
|
|
11
|
+
*/
|
|
12
|
+
const Checkout = getOrSetGlobal("Checkout", Symbol("Checkout"));
|
|
13
|
+
const Commit = getOrSetGlobal("Commit", Symbol("Commit"));
|
|
14
|
+
/**
|
|
15
|
+
* Symbol used to stash the internal field/resource context (schema, store,
|
|
16
|
+
* mutability, etc.) on a {@link ReactiveResource} or reactive field instance.
|
|
17
|
+
*/
|
|
18
|
+
const Context = getOrSetGlobal("Context", Symbol("Context"));
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { SOURCE as a, Destroy as i, Commit as n, Context as r, Checkout as t };
|
|
22
|
+
//# sourceMappingURL=-private-Dtj8O5W7.js.map
|
package/dist/unpkg/{prod-deprecated/-private-BWNdDSOr.js.map → prod/-private-Dtj8O5W7.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"-private-
|
|
1
|
+
{"version":3,"file":"-private-Dtj8O5W7.js","names":["getOrSetGlobal","SOURCE","Symbol","Destroy","dispose","for","Checkout","Commit","Context"],"sources":["../../../src/reactive/-private/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '../../types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE: '___(unique) Symbol(SOURCE)' = getOrSetGlobal('SOURCE', Symbol('#source'));\n\nexport const Destroy: '___(unique) Symbol(Destroy)' = getOrSetGlobal(\n 'Destroy',\n Symbol.dispose || Symbol.for('Dispose')\n);\n/**\n * Symbol for the method used to request a mutable copy of an otherwise\n * immutable {@link ReactiveResource}.\n *\n * @deprecated use the {@link checkout} utility function instead.\n */\nexport const Checkout: '___(unique) Symbol(Checkout)' = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Commit: '___(unique) Symbol(Commit)' = getOrSetGlobal('Commit', Symbol('Commit'));\n\n/**\n * Symbol used to stash the internal field/resource context (schema, store,\n * mutability, etc.) on a {@link ReactiveResource} or reactive field instance.\n */\nexport const Context: '___(unique) Symbol(Context)' = getOrSetGlobal('Context', Symbol('Context'));\n"],"mappings":";;;AAiCA,MAAaC,SAAuCD,eAAe,UAAUE,OAAO,SAAS,CAAC;AAE9F,MAAaC,UAAyCH,eACpD,WACAE,OAAOE,WAAWF,OAAOG,IAAI,SAAS,CACxC;;;;;;;AAOA,MAAaC,WAA2CN,eAAe,YAAYE,OAAO,UAAU,CAAC;AACrG,MAAaK,SAAuCP,eAAe,UAAUE,OAAO,QAAQ,CAAC;;;;;AAM7F,MAAaM,UAAyCR,eAAe,WAAWE,OAAO,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getOrSetGlobal, peekTransient, setTransient } from "../types/-private.js";
|
|
2
2
|
|
|
3
3
|
//#region src/graph/-private/-utils.ts
|
|
4
4
|
/** Retrieves the private {@link Store} instance from a capabilities manager (or any object exposing `_store`). */
|
package/dist/unpkg/prod/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { D as
|
|
1
|
+
import { D as setIdentifierResetMethod, E as setIdentifierGenerationMethod, F as recordIdentifierFor, L as storeFor, O as setIdentifierUpdateMethod, T as setIdentifierForgetMethod, _ as Store, g as CacheHandler, k as setKeyInfoForResource, n as RequestManager, r as Fetch, t as useRecommendedStore } from "./src-DGB6WvXW.js";
|
|
2
2
|
|
|
3
3
|
export { CacheHandler, Fetch, RequestManager, Store, recordIdentifierFor as cacheKeyFor, recordIdentifierFor, setIdentifierForgetMethod, setIdentifierGenerationMethod, setIdentifierResetMethod, setIdentifierUpdateMethod, setKeyInfoForResource, storeFor, useRecommendedStore };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as getRequestState, t as getPromiseState, u as createRequestSubscription } from "./-private-
|
|
2
|
-
import { t as Checkout } from "./-private-
|
|
3
|
-
import { a as fromIdentity, c as instantiateRecord, d as commit, i as SchemaService, l as teardownRecord, o as registerDerivations, s as withDefaults, u as checkout } from "./src-
|
|
1
|
+
import { d as getRequestState, t as getPromiseState, u as createRequestSubscription } from "./-private-Dg1vsF-H.js";
|
|
2
|
+
import { t as Checkout } from "./-private-Dtj8O5W7.js";
|
|
3
|
+
import { a as fromIdentity, c as instantiateRecord, d as commit, i as SchemaService, l as teardownRecord, o as registerDerivations, s as withDefaults, u as checkout } from "./src-DGB6WvXW.js";
|
|
4
4
|
|
|
5
5
|
export { Checkout, SchemaService, checkout, commit, createRequestSubscription, fromIdentity, getPromiseState, getRequestState, instantiateRecord, registerDerivations, teardownRecord, withDefaults };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getOrSetGlobal, getOrSetUniversal } from "./types/-private.js";
|
|
2
2
|
import { IS_FUTURE, STRUCTURED } from "./types/request.js";
|
|
3
3
|
|
|
4
4
|
//#region src/request/-private/context.ts
|
|
@@ -465,6 +465,18 @@ function withResponseType(obj) {
|
|
|
465
465
|
* result.content.data; // will have type User
|
|
466
466
|
* ```
|
|
467
467
|
*
|
|
468
|
+
* Pass a second type param to declare the `meta` the endpoint returns:
|
|
469
|
+
*
|
|
470
|
+
* ```ts
|
|
471
|
+
* type PageMeta = { page: { limit: number; offset: number }; total?: number };
|
|
472
|
+
*
|
|
473
|
+
* const result = await store.request(
|
|
474
|
+
* withReactiveResponse<User[], PageMeta>({ url: '/users' })
|
|
475
|
+
* );
|
|
476
|
+
*
|
|
477
|
+
* result.content.meta?.total; // number | undefined
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
468
480
|
* @public
|
|
469
481
|
*/
|
|
470
482
|
function withReactiveResponse(obj) {
|
|
@@ -477,4 +489,4 @@ const withBrand = withResponseType;
|
|
|
477
489
|
|
|
478
490
|
//#endregion
|
|
479
491
|
export { upgradePromise as a, executeNextHandler as c, getRequestResult as d, setPromiseResult as f, createDeferred as i, clearRequestResult as l, withReactiveResponse as n, DOMError as o, cloneResponseProperties as p, withResponseType as r, IS_CACHE_HANDLER as s, withBrand as t, getPromiseResult as u };
|
|
480
|
-
//# sourceMappingURL=request-
|
|
492
|
+
//# sourceMappingURL=request-DK7nNaAf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-BP3eOqZa.js","names":["SkipCache","deepFreeze","createDeferred","upgradeHeaders","headers","clone","Headers","toJSON","Array","from","cloneResponseProperties","response","ok","redirected","status","statusText","type","url","ContextOwner","hasSetStream","hasSetResponse","hasSubscribers","stream","nextCalled","constructor","request","god","isRoot","requestId","id","controller","promise","sizeHint","signal","addEventListener","abort","reason","enhancedRequest","Object","assign","then","hasRequestedStream","getResponse","getStream","hint","get","parseInt","setStream","Promise","resolve","resolveStream","setResponse","Response","responseData","Context","owner","isCacheHandler","___owner","_isCacheHandler","_finalized","setIdentifier","identifier","_finalize","getOrSetUniversal","PromiseCache","WeakMap","RequestMap","Map","setRequestResult","requestId","result","set","clearRequestResult","delete","getRequestResult","get","setPromiseResult","promise","getPromiseResult","getOrSetGlobal","STRUCTURED","Context","ContextOwner","assertValidRequest","createFuture","isFuture","setRequestResult","IS_CACHE_HANDLER","Symbol","DOMError","DOMException","Error","curryFuture","owner","inbound","outbound","setStream","getStream","then","doc","document","request","response","content","resolve","error","isDoc","god","stream","e","Object","assign","message","getResponse","reject","promise","ensureDoc","isError","enhanceReason","reason","name","handleOutcome","controller","signal","aborted","isCacheHandler","handler","index","Boolean","executeNextHandler","wares","i","next","r","nextCalled","_isCacheHandler","context","outcome","_finalize","Promise","requestId","result","future","IS_FUTURE","enhanceReason","isFuture","maybe","Boolean","Promise","createDeferred","resolve","reject","promise","res","rej","upgradePromise","future","getStream","abort","onFinalize","id","lid","requester","createFuture","owner","deferred","cbs","finally","resolveStream","forEach","cb","fn","push","reason","requestId","god","identifier","createDeferred","setPromiseResult","getPromiseResult","withResponseType","obj","withReactiveResponse","withBrand"],"sources":["../../../src/request/-private/context.ts","../../../src/request/-private/promise-cache.ts","../../../src/request/-private/utils.ts","../../../src/request/-private/future.ts","../../../src/request.ts"],"sourcesContent":["import { DEBUG } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\n\nimport type { RequestKey } from '../../types/identifier';\nimport type { ImmutableHeaders, ImmutableRequestInfo, RequestInfo, ResponseInfo } from '../../types/request';\nimport { SkipCache } from '../../types/request';\nimport { deepFreeze } from './debug';\nimport { createDeferred } from './future';\nimport type { DeferredStream, GodContext } from './types';\n\nexport function upgradeHeaders(headers: Headers | ImmutableHeaders): ImmutableHeaders {\n (headers as ImmutableHeaders).clone = () => {\n return new Headers(headers);\n };\n (headers as ImmutableHeaders).toJSON = () => {\n return Array.from(headers as unknown as Iterable<[string, string]>);\n };\n return headers as ImmutableHeaders;\n}\n\nexport function cloneResponseProperties(response: Response): ResponseInfo {\n const { headers, ok, redirected, status, statusText, type, url } = response;\n upgradeHeaders(headers);\n return {\n headers: headers as ImmutableHeaders,\n ok,\n redirected,\n status,\n statusText,\n type,\n url,\n };\n}\n\nexport class ContextOwner {\n hasSetStream = false;\n hasSetResponse = false;\n hasSubscribers = false;\n stream: DeferredStream = createDeferred<ReadableStream | null>();\n response: ResponseInfo | null = null;\n declare request: ImmutableRequestInfo;\n declare enhancedRequest: ImmutableRequestInfo;\n nextCalled = 0;\n declare god: GodContext;\n declare controller: AbortController;\n declare requestId: number;\n declare isRoot: boolean;\n\n constructor(request: RequestInfo, god: GodContext, isRoot = false) {\n this.isRoot = isRoot;\n this.requestId = god.id;\n this.controller = request.controller || god.controller;\n this.stream.promise.sizeHint = 0;\n\n if (request.controller) {\n if (request.controller !== god.controller) {\n god.controller.signal.addEventListener('abort', () => {\n this.controller.abort(god.controller.signal.reason);\n });\n }\n delete request.controller;\n }\n let enhancedRequest: ImmutableRequestInfo = Object.assign(\n { signal: this.controller.signal },\n request\n ) as ImmutableRequestInfo;\n if (DEBUG) {\n if (!request?.cacheOptions?.[SkipCache]) {\n request = deepFreeze(request);\n enhancedRequest = deepFreeze(enhancedRequest);\n }\n } else {\n if (request.headers) {\n upgradeHeaders(request.headers);\n }\n }\n this.enhancedRequest = enhancedRequest;\n this.request = request as ImmutableRequestInfo;\n this.god = god;\n this.stream.promise = this.stream.promise.then((stream: ReadableStream | null) => {\n if (this.god.stream === stream && this.hasSubscribers) {\n this.god.stream = null;\n }\n return stream;\n });\n }\n\n get hasRequestedStream(): boolean {\n return this.god.hasRequestedStream;\n }\n\n getResponse(): ResponseInfo | null {\n if (this.hasSetResponse) {\n return this.response;\n }\n if (this.nextCalled === 1) {\n return this.god.response;\n }\n return null;\n }\n getStream(): Promise<ReadableStream | null> {\n if (this.isRoot) {\n this.god.hasRequestedStream = true;\n }\n if (!this.hasSetResponse) {\n const hint = this.god.response?.headers?.get('content-length');\n this.stream.promise.sizeHint = hint ? parseInt(hint, 10) : 0;\n }\n this.hasSubscribers = true;\n return this.stream.promise;\n }\n abort(reason: DOMException): void {\n this.controller.abort(reason);\n }\n\n setStream(stream: ReadableStream | Promise<ReadableStream | null> | null): void {\n if (!this.hasSetStream) {\n this.hasSetStream = true;\n\n if (!(stream instanceof Promise)) {\n this.god.stream = stream;\n }\n // @ts-expect-error\n this.stream.resolve(stream);\n }\n }\n\n resolveStream(): void {\n this.setStream(this.nextCalled === 1 ? this.god.stream : null);\n }\n\n setResponse(response: ResponseInfo | Response | null): void {\n if (this.hasSetResponse) {\n if (DEBUG) {\n throw new Error(`Cannot setResponse when a response has already been set`);\n }\n return;\n }\n this.hasSetResponse = true;\n if (response instanceof Response) {\n // TODO potentially avoid cloning in prod\n let responseData = cloneResponseProperties(response);\n\n if (DEBUG) {\n responseData = deepFreeze(responseData);\n }\n this.response = responseData;\n this.god.response = responseData;\n const sizeHint = response.headers?.get('content-length');\n this.stream.promise.sizeHint = sizeHint ? parseInt(sizeHint, 10) : 0;\n } else {\n this.response = response;\n this.god.response = response;\n }\n }\n}\n\n/**\n * The context object given to each {@link Handler} (or {@link CacheHandler})\n * as it processes a request. It exposes the (immutable, enhanced) request\n * along with the methods a handler uses to build up the {@link Future} and\n * {@link StructuredDataDocument} that will ultimately be returned by the\n * {@link RequestManager}.\n *\n * @public\n */\nexport class Context {\n /** @internal */\n declare private ___owner: ContextOwner;\n /**\n * A readonly, immutable version of the request being handled, including\n * any defaults or enhancements applied by the {@link RequestManager}.\n *\n * @public\n */\n declare request: ImmutableRequestInfo;\n /**\n * The id of this request as assigned by the {@link RequestManager}. Not\n * unique across manager instances.\n *\n * @public\n */\n declare id: number;\n /** @internal */\n declare private _isCacheHandler: boolean;\n /** @internal */\n declare private _finalized: boolean;\n\n constructor(owner: ContextOwner, isCacheHandler: boolean) {\n this.id = owner.requestId;\n this.___owner = owner;\n this.request = owner.enhancedRequest;\n this._isCacheHandler = isCacheHandler;\n this._finalized = false;\n }\n /**\n * Set the response stream for this request. May be called at most once,\n * and may be called at any point up until the handler's `request` method\n * resolves.\n *\n * @public\n */\n setStream(stream: ReadableStream | Promise<ReadableStream | null>): void {\n this.___owner.setStream(stream);\n }\n /**\n * Set the {@link ResponseInfo} (or raw `Response`) associated with this\n * request. Used to populate the response information available on the\n * resulting {@link StructuredDataDocument}.\n *\n * @public\n */\n setResponse(response: ResponseInfo | Response | null): void {\n this.___owner.setResponse(response);\n }\n\n /**\n * Associate a {@link RequestKey} with this request. May only be called\n * synchronously from a {@link CacheHandler}.\n *\n * @public\n */\n setIdentifier(identifier: RequestKey): void {\n assert(\n `setIdentifier may only be used synchronously from a CacheHandler`,\n identifier && this._isCacheHandler && !this._finalized\n );\n this.___owner.god.identifier = identifier;\n }\n\n /**\n * Whether the application (or a downstream handler) has requested access\n * to the response stream via {@link Future.getStream}. Handlers can use\n * this to avoid the cost of streaming when nothing will consume it.\n *\n * @public\n */\n get hasRequestedStream(): boolean {\n return this.___owner.hasRequestedStream;\n }\n\n /** @private */\n _finalize(): void {\n this._finalized = true;\n }\n}\nexport type HandlerRequestContext = Context;\n","import { getOrSetUniversal } from '../../types/-private';\n\nexport type CacheResult<T = unknown, E = unknown> = { isError: true; result: E } | { isError: false; result: T };\n\n/**\n * The minimal, structural subset of the `Promise` interface required to be\n * cached and inspected by {@link setPromiseResult} / {@link getPromiseResult}\n * (and by `getPromiseState`). Anything that is at least `then`/`catch`/`finally`\n * \"shaped\" (including a real `Promise` or {@link Future}) satisfies this.\n *\n * @public\n */\nexport type Awaitable<T = unknown, E = unknown> = {\n /**\n * Registers fulfillment/rejection handlers, `Promise.prototype.then`-style.\n *\n * @public\n */\n then: (onFulfilled: (value: T) => unknown, onRejected: (reason: E) => unknown) => unknown;\n /**\n * Registers a rejection handler, `Promise.prototype.catch`-style.\n *\n * @public\n */\n catch: (onRejected: (reason: E) => unknown) => unknown;\n /**\n * Registers a handler run on settlement, `Promise.prototype.finally`-style.\n *\n * @public\n */\n finally: (onFinally: () => unknown) => unknown;\n};\n\nexport const PromiseCache: WeakMap<Awaitable, CacheResult> = getOrSetUniversal(\n 'PromiseCache',\n new WeakMap<Awaitable, CacheResult>()\n);\nexport const RequestMap: Map<number, CacheResult> = getOrSetUniversal('RequestMap', new Map<number, CacheResult>());\n\nexport function setRequestResult(requestId: number, result: CacheResult): void {\n RequestMap.set(requestId, result);\n}\nexport function clearRequestResult(requestId: number): void {\n RequestMap.delete(requestId);\n}\nexport function getRequestResult(requestId: number): CacheResult | undefined {\n return RequestMap.get(requestId);\n}\n\n/**\n * Cache the settled result (or error) of a promise-like value so that its\n * outcome can be synchronously read later via {@link getPromiseResult},\n * without needing to await it again.\n *\n * @public\n */\nexport function setPromiseResult(promise: Promise<unknown> | Awaitable, result: CacheResult): void {\n PromiseCache.set(promise, result);\n}\n\n/**\n * Synchronously read the settled result (or error) previously recorded for\n * a promise-like value via {@link setPromiseResult}, if any.\n *\n * @public\n */\nexport function getPromiseResult<T, E>(promise: Promise<T> | Awaitable<T, E>): CacheResult<T, E> | undefined {\n return PromiseCache.get(promise) as CacheResult<T, E> | undefined;\n}\n","import { DEBUG } from '@warp-drive/core/build-config/env';\n\nimport { getOrSetGlobal } from '../../types/-private';\nimport type {\n RequestInfo,\n StructuredDataDocument,\n StructuredDocument,\n StructuredErrorDocument,\n} from '../../types/request';\nimport { STRUCTURED } from '../../types/request';\nimport { Context, ContextOwner } from './context';\nimport { assertValidRequest } from './debug';\n// oxlint-disable-next-line no-unused-vars\nimport type { Fetch } from './fetch.ts';\nimport { createFuture, isFuture } from './future';\nimport { setRequestResult } from './promise-cache';\nimport type { DeferredFuture, Future, GodContext, Handler } from './types';\n\nexport const IS_CACHE_HANDLER: '___(unique) Symbol(IS_CACHE_HANDLER)' = getOrSetGlobal(\n 'IS_CACHE_HANDLER',\n Symbol('IS_CACHE_HANDLER')\n);\n\n/**\n * A ponyfill for the global {@link DOMException} constructor.\n *\n * Some non-DOM environments (e.g. React Native, some Node/worker\n * environments) don't provide `DOMException` as a global, which would\n * otherwise throw a `ReferenceError` the first time any code referenced it\n * (for instance when classifying an abort/network error). `DOMError` falls\n * back to the global {@link Error} constructor in that case so callers can\n * uniformly use `new DOMError(...)` / `error instanceof DOMError` without\n * guarding for the global's presence themselves.\n *\n * @internal\n */\nexport const DOMError: typeof DOMException =\n typeof DOMException !== 'undefined' ? DOMException : (Error as unknown as typeof DOMException);\nexport function curryFuture<T>(owner: ContextOwner, inbound: Future<T>, outbound: DeferredFuture<T>): Future<T> {\n owner.setStream(inbound.getStream());\n\n inbound.then(\n (doc: StructuredDataDocument<T>) => {\n const document = {\n [STRUCTURED]: true as const,\n request: owner.request,\n response: doc.response,\n content: doc.content,\n };\n outbound.resolve(document);\n },\n (error: Error & StructuredErrorDocument) => {\n if (isDoc(error)) {\n owner.setStream(owner.god.stream);\n }\n if (!error || !(error instanceof Error)) {\n try {\n throw new Error(error ? error : `Request Rejected with an Unknown Error`);\n } catch (e: unknown) {\n if (error && typeof error === 'object') {\n Object.assign(e as Error, error);\n (e as Error & StructuredErrorDocument).message =\n (error as Error).message || `Request Rejected with an Unknown Error`;\n }\n error = e as Error & StructuredErrorDocument;\n }\n }\n\n error[STRUCTURED] = true;\n error.request = owner.request;\n error.response = owner.getResponse();\n error.error = error.error || error.message;\n\n outbound.reject(error);\n }\n );\n return outbound.promise;\n}\n\nfunction isDoc<T>(doc: T | StructuredDataDocument<T>): doc is StructuredDataDocument<T> {\n return doc && (doc as StructuredDataDocument<T>)[STRUCTURED] === true;\n}\n\nfunction ensureDoc<T>(owner: ContextOwner, content: T | Error, isError: boolean): StructuredDocument<T> {\n if (isDoc(content)) {\n return content as StructuredDocument<T>;\n }\n\n if (isError) {\n return {\n [STRUCTURED]: true,\n request: owner.request,\n response: owner.getResponse(),\n error: content as Error,\n } as StructuredErrorDocument<T>;\n }\n\n return {\n [STRUCTURED]: true,\n request: owner.request,\n response: owner.getResponse(),\n content: content as T,\n };\n}\n\n/**\n * Additional properties exposed on errors thrown by the\n * {@link Fetch | Fetch Handler}.\n *\n * In the case of an Abort or system/browser level issue,\n * this extends {@link DOMException}.\n *\n * Else it extends from {@link AggregateError} if the\n * response includes an array of errors, falling back\n * to {@link Error} as its base.\n */\nexport interface FetchError extends DOMException {\n /**\n * Alias for {@link FetchError.status | status}.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status)\n */\n code: number;\n /**\n * The name associated to the {@link FetchError.status | status code}.\n *\n * Typically this will be of the formula `StatusTextError` for instance\n * a 404 status with status text of `Not Found` would have the name\n * `NotFoundError`.\n */\n name: string;\n /**\n * The http status code associated to the returned error.\n *\n * Browser/System level network errors will often have an error code of `0` or `5`.\n * Aborted requests will have an error code of `20`.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status)\n */\n status: number;\n /**\n * The Status Text associated to the {@link FetchError.status | status code}\n * for the error.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText)\n *\n */\n statusText: string;\n /**\n * A property signifying that an Error uses the {@link FetchError}\n * interface.\n */\n isRequestError: true;\n}\n\nexport function enhanceReason(reason?: string): DOMException {\n const error = new DOMError(reason || 'The user aborted a request.', 'AbortError');\n // `DOMError` may be the `Error` constructor as a fallback, whose\n // constructor doesn't accept a `name`, so set it explicitly in that case.\n // We can't unconditionally assign `error.name` here: when `DOMError` is\n // the real `DOMException`, `name` is already `'AbortError'` (set by its\n // constructor) *and* `DOMException.prototype.name` is a getter-only\n // accessor with no setter, so reassigning it throws a `TypeError` in\n // strict-mode JS (which is how our ES modules run) - even when assigning\n // the very same value it already holds.\n if (error.name !== 'AbortError') {\n (error as unknown as { name: string }).name = 'AbortError';\n }\n return error;\n}\n\nexport function handleOutcome<T>(\n owner: ContextOwner,\n inbound: Promise<T | StructuredDataDocument<T>>,\n outbound: DeferredFuture<T>\n): Future<T> {\n inbound.then(\n (content: T | StructuredDataDocument<T>) => {\n if (owner.controller.signal.aborted) {\n // the next function did not respect the signal, we handle it here\n outbound.reject(enhanceReason(owner.controller.signal.reason as string));\n return;\n }\n if (isDoc(content)) {\n owner.setStream(owner.god.stream);\n content = content.content;\n }\n const document = {\n [STRUCTURED]: true as const,\n request: owner.request,\n response: owner.getResponse(),\n content,\n };\n outbound.resolve(document);\n },\n (error: Error & StructuredErrorDocument) => {\n if (isDoc(error)) {\n owner.setStream(owner.god.stream);\n }\n if (!error || !(error instanceof Error)) {\n try {\n throw new Error(error ? error : `Request Rejected with an Unknown Error`);\n } catch (e: unknown) {\n if (error && typeof error === 'object') {\n Object.assign(e as Error, error);\n (e as Error & StructuredErrorDocument).message =\n (error as Error).message || `Request Rejected with an Unknown Error`;\n }\n error = e as Error & StructuredErrorDocument;\n }\n }\n\n error[STRUCTURED] = true;\n error.request = owner.request;\n error.response = owner.getResponse();\n error.error = error.error || error.message;\n outbound.reject(error);\n }\n );\n return outbound.promise;\n}\n\nfunction isCacheHandler(handler: Handler & { [IS_CACHE_HANDLER]?: boolean }, index: number): boolean {\n return index === 0 && Boolean(handler[IS_CACHE_HANDLER]);\n}\n\nexport function executeNextHandler<T>(\n wares: Readonly<Handler[]>,\n request: RequestInfo,\n i: number,\n god: GodContext\n): Future<T> {\n if (DEBUG) {\n if (i === wares.length) {\n throw new Error(`No handler was able to handle this request.`);\n }\n assertValidRequest(request, false);\n }\n const owner = new ContextOwner(request, god, i === 0);\n\n function next(r: RequestInfo): Future<T> {\n owner.nextCalled++;\n return executeNextHandler(wares, r, i + 1, god);\n }\n\n const _isCacheHandler = isCacheHandler(wares[i], i);\n const context = new Context(owner, _isCacheHandler);\n let outcome: Promise<T | StructuredDataDocument<T>> | Future<T>;\n try {\n outcome = wares[i].request<T>(context, next);\n if (_isCacheHandler) {\n context._finalize();\n }\n if (!!outcome && _isCacheHandler) {\n if (!(outcome instanceof Promise)) {\n setRequestResult(owner.requestId, { isError: false, result: ensureDoc(owner, outcome, false) });\n outcome = Promise.resolve(outcome);\n }\n } else if (DEBUG) {\n if (!outcome || (!(outcome instanceof Promise) && !(typeof outcome === 'object' && 'then' in outcome))) {\n // oxlint-disable-next-line no-console\n console.log({ request, handler: wares[i], outcome });\n if (outcome === undefined) {\n throw new Error(`Expected handler.request to return a promise, instead received undefined.`);\n }\n throw new Error(`Expected handler.request to return a promise, instead received a synchronous value.`);\n }\n }\n } catch (e) {\n if (_isCacheHandler) {\n setRequestResult(owner.requestId, { isError: true, result: ensureDoc(owner, e, true) });\n }\n // oxlint-disable-next-line typescript/prefer-promise-reject-errors\n outcome = Promise.reject<StructuredDataDocument<T>>(e);\n }\n const future = createFuture<T>(owner);\n\n if (isFuture<T>(outcome)) {\n return curryFuture(owner, outcome, future);\n }\n\n return handleOutcome(owner, outcome, future);\n}\n","import { DEBUG } from '@warp-drive/build-config/env';\n\nimport { IS_FUTURE, type StructuredDocument } from '../../types/request';\nimport type { ContextOwner } from './context';\nimport type { Deferred, DeferredFuture, Future } from './types';\nimport { enhanceReason } from './utils';\n\nexport function isFuture<T>(maybe: unknown): maybe is Future<T> {\n return Boolean(maybe && maybe instanceof Promise && (maybe as Future<T>)[IS_FUTURE] === true);\n}\n\n/**\n * Create a {@link Deferred}: a promise along with the `resolve`/`reject`\n * callbacks that settle it, so the promise can be handed out before the\n * work that will settle it has started.\n *\n * @public\n */\nexport function createDeferred<T>(): Deferred<T> {\n let resolve!: (v: T) => void;\n let reject!: (v: unknown) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { resolve, reject, promise };\n}\n\nexport function upgradePromise<T>(promise: Promise<StructuredDocument<T>>, future: Future<T>): Future<T> {\n (promise as Future<T>)[IS_FUTURE] = true;\n // oxlint-disable-next-line typescript/unbound-method\n (promise as Future<T>).getStream = future.getStream;\n // oxlint-disable-next-line typescript/unbound-method\n (promise as Future<T>).abort = future.abort;\n // oxlint-disable-next-line typescript/unbound-method\n (promise as Future<T>).onFinalize = future.onFinalize;\n (promise as Future<T>).id = future.id;\n (promise as Future<T>).lid = future.lid;\n (promise as Future<T>).requester = future.requester;\n\n if (DEBUG) {\n // @ts-expect-error\n promise.toJSON = () => {\n const id = 'Future<' + (promise as Future<T>).id + '>';\n if ((promise as Future<T>).lid) {\n return `${id} (${(promise as Future<T>).lid!.lid})`;\n }\n return id;\n };\n }\n\n return promise as Future<T>;\n}\n\nexport function createFuture<T>(owner: ContextOwner): DeferredFuture<T> {\n const deferred = createDeferred<T>() as unknown as DeferredFuture<T>;\n let { promise } = deferred;\n let cbs: Array<() => void> | undefined;\n promise = promise.finally(() => {\n owner.resolveStream();\n if (cbs) {\n cbs.forEach((cb) => cb());\n }\n }) as Future<T>;\n promise.onFinalize = (fn: () => void) => {\n cbs = cbs || [];\n cbs.push(fn);\n };\n promise[IS_FUTURE] = true;\n promise.getStream = () => {\n return owner.getStream();\n };\n promise.abort = (reason?: string) => {\n owner.abort(enhanceReason(reason));\n };\n promise.id = owner.requestId;\n promise.lid = owner.god.identifier;\n promise.requester = owner.god.requester;\n\n if (DEBUG) {\n // @ts-expect-error\n promise.toJSON = () => {\n const id = 'Future<' + promise.id + '>';\n if (promise.lid) {\n return `${id} (${promise.lid.lid})`;\n }\n return id;\n };\n }\n\n deferred.promise = promise;\n return deferred;\n}\n","import type { ReactiveDataDocument } from './reactive.ts';\nimport type { RequestInfo } from './types/request.ts';\nimport type { RequestSignature } from './types/symbols.ts';\n\nexport { createDeferred } from './request/-private/future.ts';\nexport type {\n Future,\n Handler,\n CacheHandler,\n NextFn,\n Deferred,\n ManagedRequestPriority,\n} from './request/-private/types.ts';\nexport { setPromiseResult, getPromiseResult } from './request/-private/promise-cache.ts';\nexport type { Awaitable } from './request/-private/promise-cache.ts';\nexport type { Context } from './request/-private/context.ts';\n\n/**\n * Brands the supplied object with the supplied response type.\n *\n * ```ts\n * import type { ReactiveDataDocument } from '@warp-drive/core/reactive';\n * import { withResponseType } from '@warp-drive/core/request';\n * import type { User } from '#/data/user.ts'\n *\n * const result = await store.request(\n * withResponseType<ReactiveDataDocument<User>>({ url: '/users/1' })\n * );\n *\n * result.content.data; // will have type User\n * ```\n *\n */\nexport function withResponseType<T>(obj: RequestInfo): RequestInfo<T> & {\n /** The branded response type. Present only at the type level; carries no runtime value. */\n [RequestSignature]: T;\n} {\n return obj as RequestInfo<T> & {\n [RequestSignature]: T;\n };\n}\n\n/**\n * Brands the supplied object with the supplied response type\n * wrapped in {@link ReactiveDataDocument}. This is a convenience for\n * the common case of using {@link withResponseType} with `ReactiveDataDocument`.\n *\n * ```ts\n * import { withReactiveResponse } from '@warp-drive/core/request';\n * import type { User } from '#/data/user.ts'\n *\n * const result = await store.request(\n * withReactiveResponse<User>({ url: '/users/1' })\n * );\n *\n * result.content.data; // will have type User\n * ```\n *\n * @public\n */\nexport function withReactiveResponse<T>(obj: RequestInfo): RequestInfo<ReactiveDataDocument<T>> & {\n /** The branded response type. Present only at the type level; carries no runtime value. */\n [RequestSignature]: ReactiveDataDocument<T>;\n} {\n return obj as RequestInfo<ReactiveDataDocument<T>> & {\n [RequestSignature]: ReactiveDataDocument<T>;\n };\n}\n\n/**\n * @deprecated use {@link withResponseType} instead\n */\nexport const withBrand: typeof withResponseType = withResponseType;\n"],"mappings":";;;;AAUA,SAAgBG,eAAeC,SAAuD;CACnFA,QAA6BC,cAAc;EAC1C,OAAO,IAAIC,QAAQF,OAAO;CAC5B;CACCA,QAA6BG,eAAe;EAC3C,OAAOC,MAAMC,KAAKL,OAAgD;CACpE;CACA,OAAOA;AACT;AAEA,SAAgBM,wBAAwBC,UAAkC;CACxE,MAAM,EAAEP,SAASQ,IAAIC,YAAYC,QAAQC,YAAYC,MAAMC,QAAQN;CACnER,eAAeC,OAAO;CACtB,OAAO;EACIA;EACTQ;EACAC;EACAC;EACAC;EACAC;EACAC;CACF;AACF;AAEA,IAAaC,eAAb,MAA0B;CACxBC,eAAe;CACfC,iBAAiB;CACjBC,iBAAiB;CACjBC,SAAyBpB,eAAsC;CAC/DS,WAAgC;CAGhCY,aAAa;CAMbC,YAAYC,SAAsBC,KAAiBC,SAAS,OAAO;EACjE,KAAKA,SAASA;EACd,KAAKC,YAAYF,IAAIG;EACrB,KAAKC,aAAaL,QAAQK,cAAcJ,IAAII;EAC5C,KAAKR,OAAOS,QAAQC,WAAW;EAE/B,IAAIP,QAAQK,YAAY;GACtB,IAAIL,QAAQK,eAAeJ,IAAII,YAC7BJ,IAAII,WAAWG,OAAOC,iBAAiB,eAAe;IACpD,KAAKJ,WAAWK,MAAMT,IAAII,WAAWG,OAAOG,MAAM;GACpD,CAAC;GAEH,OAAOX,QAAQK;EACjB;EACA,IAAIO,kBAAwCC,OAAOC,OACjD,EAAEN,QAAQ,KAAKH,WAAWG,OAAO,GACjCR,OACF;EAOE,IAAIA,QAAQrB,SACVD,eAAesB,QAAQrB,OAAO;EAGlC,KAAKiC,kBAAkBA;EACvB,KAAKZ,UAAUA;EACf,KAAKC,MAAMA;EACX,K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SAASG;CACX,CAAC;CACD,OAAO;EAAEJ;EAASC;EAAQC;CAAQ;AACpC;AAEA,SAAgBG,eAAkBH,SAAyCI,QAA8B;CACtGJ,QAAsBT,aAAa;CAEnCS,QAAsBK,YAAYD,OAAOC;CAEzCL,QAAsBM,QAAQF,OAAOE;CAErCN,QAAsBO,aAAaH,OAAOG;CAC1CP,QAAsBQ,KAAKJ,OAAOI;CAClCR,QAAsBS,MAAML,OAAOK;CACnCT,QAAsBU,YAAYN,OAAOM;CAa1C,OAAOV;AACT;AAEA,SAAgBW,aAAgBC,OAAwC;CACtE,MAAMC,WAAWhB,eAAkB;CACnC,IAAI,EAAEG,YAAYa;CAClB,IAAIC;CACJd,UAAUA,QAAQe,cAAc;EAC9BH,MAAMI,cAAc;EACpB,IAAIF,KACFA,IAAIG,SAASC,OAAOA,GAAG,CAAC;CAE5B,CAAC;CACDlB,QAAQO,cAAcY,OAAmB;EACvCL,MAAMA,OAAO,CAAA;EACbA,IAAIM,KAAKD,EAAE;CACb;CACAnB,QAAQT,aAAa;CACrBS,QAAQK,kBAAkB;EACxB,OAAOO,MAAMP,UAAU;CACzB;CACAL,QAAQM,SAASe,WAAoB;EACnCT,MAAMN,MAAMd,cAAc6B,MAAM,CAAC;CACnC;CACArB,QAAQQ,KAAKI,MAAMU;CACnBtB,QAAQS,MAAMG,MAAMW,IAAIC;CACxBxB,QAAQU,YAAYE,MAAMW,IAAIb;CAa9BG,SAASb,UAAUA;CACnB,OAAOa;AACT;;;;;;;;;;;;;;;;;;;;AC3DA,SAAgBe,iBAAoBC,KAGlC;CACA,OAAOA;AAGT;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBC,qBAAwBD,KAGtC;CACA,OAAOA;AAGT;;;;AAKA,MAAaE,YAAqCH"}
|
|
1
|
+
{"version":3,"file":"request-DK7nNaAf.js","names":["SkipCache","deepFreeze","createDeferred","upgradeHeaders","headers","clone","Headers","toJSON","Array","from","cloneResponseProperties","response","ok","redirected","status","statusText","type","url","ContextOwner","hasSetStream","hasSetResponse","hasSubscribers","stream","nextCalled","constructor","request","god","isRoot","requestId","id","controller","promise","sizeHint","signal","addEventListener","abort","reason","enhancedRequest","Object","assign","then","hasRequestedStream","getResponse","getStream","hint","get","parseInt","setStream","Promise","resolve","resolveStream","setResponse","Response","responseData","Context","owner","isCacheHandler","___owner","_isCacheHandler","_finalized","setIdentifier","identifier","_finalize","getOrSetUniversal","PromiseCache","WeakMap","RequestMap","Map","setRequestResult","requestId","result","set","clearRequestResult","delete","getRequestResult","get","setPromiseResult","promise","getPromiseResult","getOrSetGlobal","STRUCTURED","Context","ContextOwner","assertValidRequest","createFuture","isFuture","setRequestResult","IS_CACHE_HANDLER","Symbol","DOMError","DOMException","Error","curryFuture","owner","inbound","outbound","setStream","getStream","then","doc","document","request","response","content","resolve","error","isDoc","god","stream","e","Object","assign","message","getResponse","reject","promise","ensureDoc","isError","enhanceReason","reason","name","handleOutcome","controller","signal","aborted","isCacheHandler","handler","index","Boolean","executeNextHandler","wares","i","next","r","nextCalled","_isCacheHandler","context","outcome","_finalize","Promise","requestId","result","future","IS_FUTURE","enhanceReason","isFuture","maybe","Boolean","Promise","createDeferred","resolve","reject","promise","res","rej","upgradePromise","future","getStream","abort","onFinalize","id","lid","requester","createFuture","owner","deferred","cbs","finally","resolveStream","forEach","cb","fn","push","reason","requestId","god","identifier","createDeferred","setPromiseResult","getPromiseResult","withResponseType","obj","withReactiveResponse","withBrand"],"sources":["../../../src/request/-private/context.ts","../../../src/request/-private/promise-cache.ts","../../../src/request/-private/utils.ts","../../../src/request/-private/future.ts","../../../src/request.ts"],"sourcesContent":["import { DEBUG } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\n\nimport type { RequestKey } from '../../types/identifier';\nimport type { ImmutableHeaders, ImmutableRequestInfo, RequestInfo, ResponseInfo } from '../../types/request';\nimport { SkipCache } from '../../types/request';\nimport { deepFreeze } from './debug';\nimport { createDeferred } from './future';\nimport type { DeferredStream, GodContext } from './types';\n\nexport function upgradeHeaders(headers: Headers | ImmutableHeaders): ImmutableHeaders {\n (headers as ImmutableHeaders).clone = () => {\n return new Headers(headers);\n };\n (headers as ImmutableHeaders).toJSON = () => {\n return Array.from(headers as unknown as Iterable<[string, string]>);\n };\n return headers as ImmutableHeaders;\n}\n\nexport function cloneResponseProperties(response: Response): ResponseInfo {\n const { headers, ok, redirected, status, statusText, type, url } = response;\n upgradeHeaders(headers);\n return {\n headers: headers as ImmutableHeaders,\n ok,\n redirected,\n status,\n statusText,\n type,\n url,\n };\n}\n\nexport class ContextOwner {\n hasSetStream = false;\n hasSetResponse = false;\n hasSubscribers = false;\n stream: DeferredStream = createDeferred<ReadableStream | null>();\n response: ResponseInfo | null = null;\n declare request: ImmutableRequestInfo;\n declare enhancedRequest: ImmutableRequestInfo;\n nextCalled = 0;\n declare god: GodContext;\n declare controller: AbortController;\n declare requestId: number;\n declare isRoot: boolean;\n\n constructor(request: RequestInfo, god: GodContext, isRoot = false) {\n this.isRoot = isRoot;\n this.requestId = god.id;\n this.controller = request.controller || god.controller;\n this.stream.promise.sizeHint = 0;\n\n if (request.controller) {\n if (request.controller !== god.controller) {\n god.controller.signal.addEventListener('abort', () => {\n this.controller.abort(god.controller.signal.reason);\n });\n }\n delete request.controller;\n }\n let enhancedRequest: ImmutableRequestInfo = Object.assign(\n { signal: this.controller.signal },\n request\n ) as ImmutableRequestInfo;\n if (DEBUG) {\n if (!request?.cacheOptions?.[SkipCache]) {\n request = deepFreeze(request);\n enhancedRequest = deepFreeze(enhancedRequest);\n }\n } else {\n if (request.headers) {\n upgradeHeaders(request.headers);\n }\n }\n this.enhancedRequest = enhancedRequest;\n this.request = request as ImmutableRequestInfo;\n this.god = god;\n this.stream.promise = this.stream.promise.then((stream: ReadableStream | null) => {\n if (this.god.stream === stream && this.hasSubscribers) {\n this.god.stream = null;\n }\n return stream;\n });\n }\n\n get hasRequestedStream(): boolean {\n return this.god.hasRequestedStream;\n }\n\n getResponse(): ResponseInfo | null {\n if (this.hasSetResponse) {\n return this.response;\n }\n if (this.nextCalled === 1) {\n return this.god.response;\n }\n return null;\n }\n getStream(): Promise<ReadableStream | null> {\n if (this.isRoot) {\n this.god.hasRequestedStream = true;\n }\n if (!this.hasSetResponse) {\n const hint = this.god.response?.headers?.get('content-length');\n this.stream.promise.sizeHint = hint ? parseInt(hint, 10) : 0;\n }\n this.hasSubscribers = true;\n return this.stream.promise;\n }\n abort(reason: DOMException): void {\n this.controller.abort(reason);\n }\n\n setStream(stream: ReadableStream | Promise<ReadableStream | null> | null): void {\n if (!this.hasSetStream) {\n this.hasSetStream = true;\n\n if (!(stream instanceof Promise)) {\n this.god.stream = stream;\n }\n // @ts-expect-error\n this.stream.resolve(stream);\n }\n }\n\n resolveStream(): void {\n this.setStream(this.nextCalled === 1 ? this.god.stream : null);\n }\n\n setResponse(response: ResponseInfo | Response | null): void {\n if (this.hasSetResponse) {\n if (DEBUG) {\n throw new Error(`Cannot setResponse when a response has already been set`);\n }\n return;\n }\n this.hasSetResponse = true;\n if (response instanceof Response) {\n // TODO potentially avoid cloning in prod\n let responseData = cloneResponseProperties(response);\n\n if (DEBUG) {\n responseData = deepFreeze(responseData);\n }\n this.response = responseData;\n this.god.response = responseData;\n const sizeHint = response.headers?.get('content-length');\n this.stream.promise.sizeHint = sizeHint ? parseInt(sizeHint, 10) : 0;\n } else {\n this.response = response;\n this.god.response = response;\n }\n }\n}\n\n/**\n * The context object given to each {@link Handler} (or {@link CacheHandler})\n * as it processes a request. It exposes the (immutable, enhanced) request\n * along with the methods a handler uses to build up the {@link Future} and\n * {@link StructuredDataDocument} that will ultimately be returned by the\n * {@link RequestManager}.\n *\n * @public\n */\nexport class Context {\n /** @internal */\n declare private ___owner: ContextOwner;\n /**\n * A readonly, immutable version of the request being handled, including\n * any defaults or enhancements applied by the {@link RequestManager}.\n *\n * @public\n */\n declare request: ImmutableRequestInfo;\n /**\n * The id of this request as assigned by the {@link RequestManager}. Not\n * unique across manager instances.\n *\n * @public\n */\n declare id: number;\n /** @internal */\n declare private _isCacheHandler: boolean;\n /** @internal */\n declare private _finalized: boolean;\n\n constructor(owner: ContextOwner, isCacheHandler: boolean) {\n this.id = owner.requestId;\n this.___owner = owner;\n this.request = owner.enhancedRequest;\n this._isCacheHandler = isCacheHandler;\n this._finalized = false;\n }\n /**\n * Set the response stream for this request. May be called at most once,\n * and may be called at any point up until the handler's `request` method\n * resolves.\n *\n * @public\n */\n setStream(stream: ReadableStream | Promise<ReadableStream | null>): void {\n this.___owner.setStream(stream);\n }\n /**\n * Set the {@link ResponseInfo} (or raw `Response`) associated with this\n * request. Used to populate the response information available on the\n * resulting {@link StructuredDataDocument}.\n *\n * @public\n */\n setResponse(response: ResponseInfo | Response | null): void {\n this.___owner.setResponse(response);\n }\n\n /**\n * Associate a {@link RequestKey} with this request. May only be called\n * synchronously from a {@link CacheHandler}.\n *\n * @public\n */\n setIdentifier(identifier: RequestKey): void {\n assert(\n `setIdentifier may only be used synchronously from a CacheHandler`,\n identifier && this._isCacheHandler && !this._finalized\n );\n this.___owner.god.identifier = identifier;\n }\n\n /**\n * Whether the application (or a downstream handler) has requested access\n * to the response stream via {@link Future.getStream}. Handlers can use\n * this to avoid the cost of streaming when nothing will consume it.\n *\n * @public\n */\n get hasRequestedStream(): boolean {\n return this.___owner.hasRequestedStream;\n }\n\n /** @private */\n _finalize(): void {\n this._finalized = true;\n }\n}\nexport type HandlerRequestContext = Context;\n","import { getOrSetUniversal } from '../../types/-private';\n\nexport type CacheResult<T = unknown, E = unknown> = { isError: true; result: E } | { isError: false; result: T };\n\n/**\n * The minimal, structural subset of the `Promise` interface required to be\n * cached and inspected by {@link setPromiseResult} / {@link getPromiseResult}\n * (and by `getPromiseState`). Anything that is at least `then`/`catch`/`finally`\n * \"shaped\" (including a real `Promise` or {@link Future}) satisfies this.\n *\n * @public\n */\nexport type Awaitable<T = unknown, E = unknown> = {\n /**\n * Registers fulfillment/rejection handlers, `Promise.prototype.then`-style.\n *\n * @public\n */\n then: (onFulfilled: (value: T) => unknown, onRejected: (reason: E) => unknown) => unknown;\n /**\n * Registers a rejection handler, `Promise.prototype.catch`-style.\n *\n * @public\n */\n catch: (onRejected: (reason: E) => unknown) => unknown;\n /**\n * Registers a handler run on settlement, `Promise.prototype.finally`-style.\n *\n * @public\n */\n finally: (onFinally: () => unknown) => unknown;\n};\n\nexport const PromiseCache: WeakMap<Awaitable, CacheResult> = getOrSetUniversal(\n 'PromiseCache',\n new WeakMap<Awaitable, CacheResult>()\n);\nexport const RequestMap: Map<number, CacheResult> = getOrSetUniversal('RequestMap', new Map<number, CacheResult>());\n\nexport function setRequestResult(requestId: number, result: CacheResult): void {\n RequestMap.set(requestId, result);\n}\nexport function clearRequestResult(requestId: number): void {\n RequestMap.delete(requestId);\n}\nexport function getRequestResult(requestId: number): CacheResult | undefined {\n return RequestMap.get(requestId);\n}\n\n/**\n * Cache the settled result (or error) of a promise-like value so that its\n * outcome can be synchronously read later via {@link getPromiseResult},\n * without needing to await it again.\n *\n * @public\n */\nexport function setPromiseResult(promise: Promise<unknown> | Awaitable, result: CacheResult): void {\n PromiseCache.set(promise, result);\n}\n\n/**\n * Synchronously read the settled result (or error) previously recorded for\n * a promise-like value via {@link setPromiseResult}, if any.\n *\n * @public\n */\nexport function getPromiseResult<T, E>(promise: Promise<T> | Awaitable<T, E>): CacheResult<T, E> | undefined {\n return PromiseCache.get(promise) as CacheResult<T, E> | undefined;\n}\n","import { DEBUG } from '@warp-drive/core/build-config/env';\n\nimport { getOrSetGlobal } from '../../types/-private';\nimport type {\n RequestInfo,\n StructuredDataDocument,\n StructuredDocument,\n StructuredErrorDocument,\n} from '../../types/request';\nimport { STRUCTURED } from '../../types/request';\nimport { Context, ContextOwner } from './context';\nimport { assertValidRequest } from './debug';\n// oxlint-disable-next-line no-unused-vars\nimport type { Fetch } from './fetch.ts';\nimport { createFuture, isFuture } from './future';\nimport { setRequestResult } from './promise-cache';\nimport type { DeferredFuture, Future, GodContext, Handler } from './types';\n\nexport const IS_CACHE_HANDLER: '___(unique) Symbol(IS_CACHE_HANDLER)' = getOrSetGlobal(\n 'IS_CACHE_HANDLER',\n Symbol('IS_CACHE_HANDLER')\n);\n\n/**\n * A ponyfill for the global {@link DOMException} constructor.\n *\n * Some non-DOM environments (e.g. React Native, some Node/worker\n * environments) don't provide `DOMException` as a global, which would\n * otherwise throw a `ReferenceError` the first time any code referenced it\n * (for instance when classifying an abort/network error). `DOMError` falls\n * back to the global {@link Error} constructor in that case so callers can\n * uniformly use `new DOMError(...)` / `error instanceof DOMError` without\n * guarding for the global's presence themselves.\n *\n * @internal\n */\nexport const DOMError: typeof DOMException =\n typeof DOMException !== 'undefined' ? DOMException : (Error as unknown as typeof DOMException);\nexport function curryFuture<T>(owner: ContextOwner, inbound: Future<T>, outbound: DeferredFuture<T>): Future<T> {\n owner.setStream(inbound.getStream());\n\n inbound.then(\n (doc: StructuredDataDocument<T>) => {\n const document = {\n [STRUCTURED]: true as const,\n request: owner.request,\n response: doc.response,\n content: doc.content,\n };\n outbound.resolve(document);\n },\n (error: Error & StructuredErrorDocument) => {\n if (isDoc(error)) {\n owner.setStream(owner.god.stream);\n }\n if (!error || !(error instanceof Error)) {\n try {\n throw new Error(error ? error : `Request Rejected with an Unknown Error`);\n } catch (e: unknown) {\n if (error && typeof error === 'object') {\n Object.assign(e as Error, error);\n (e as Error & StructuredErrorDocument).message =\n (error as Error).message || `Request Rejected with an Unknown Error`;\n }\n error = e as Error & StructuredErrorDocument;\n }\n }\n\n error[STRUCTURED] = true;\n error.request = owner.request;\n error.response = owner.getResponse();\n error.error = error.error || error.message;\n\n outbound.reject(error);\n }\n );\n return outbound.promise;\n}\n\nfunction isDoc<T>(doc: T | StructuredDataDocument<T>): doc is StructuredDataDocument<T> {\n return doc && (doc as StructuredDataDocument<T>)[STRUCTURED] === true;\n}\n\nfunction ensureDoc<T>(owner: ContextOwner, content: T | Error, isError: boolean): StructuredDocument<T> {\n if (isDoc(content)) {\n return content as StructuredDocument<T>;\n }\n\n if (isError) {\n return {\n [STRUCTURED]: true,\n request: owner.request,\n response: owner.getResponse(),\n error: content as Error,\n } as StructuredErrorDocument<T>;\n }\n\n return {\n [STRUCTURED]: true,\n request: owner.request,\n response: owner.getResponse(),\n content: content as T,\n };\n}\n\n/**\n * Additional properties exposed on errors thrown by the\n * {@link Fetch | Fetch Handler}.\n *\n * In the case of an Abort or system/browser level issue,\n * this extends {@link DOMException}.\n *\n * Else it extends from {@link AggregateError} if the\n * response includes an array of errors, falling back\n * to {@link Error} as its base.\n */\nexport interface FetchError extends DOMException {\n /**\n * Alias for {@link FetchError.status | status}.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status)\n */\n code: number;\n /**\n * The name associated to the {@link FetchError.status | status code}.\n *\n * Typically this will be of the formula `StatusTextError` for instance\n * a 404 status with status text of `Not Found` would have the name\n * `NotFoundError`.\n */\n name: string;\n /**\n * The http status code associated to the returned error.\n *\n * Browser/System level network errors will often have an error code of `0` or `5`.\n * Aborted requests will have an error code of `20`.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status)\n */\n status: number;\n /**\n * The Status Text associated to the {@link FetchError.status | status code}\n * for the error.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText)\n *\n */\n statusText: string;\n /**\n * A property signifying that an Error uses the {@link FetchError}\n * interface.\n */\n isRequestError: true;\n}\n\nexport function enhanceReason(reason?: string): DOMException {\n const error = new DOMError(reason || 'The user aborted a request.', 'AbortError');\n // `DOMError` may be the `Error` constructor as a fallback, whose\n // constructor doesn't accept a `name`, so set it explicitly in that case.\n // We can't unconditionally assign `error.name` here: when `DOMError` is\n // the real `DOMException`, `name` is already `'AbortError'` (set by its\n // constructor) *and* `DOMException.prototype.name` is a getter-only\n // accessor with no setter, so reassigning it throws a `TypeError` in\n // strict-mode JS (which is how our ES modules run) - even when assigning\n // the very same value it already holds.\n if (error.name !== 'AbortError') {\n (error as unknown as { name: string }).name = 'AbortError';\n }\n return error;\n}\n\nexport function handleOutcome<T>(\n owner: ContextOwner,\n inbound: Promise<T | StructuredDataDocument<T>>,\n outbound: DeferredFuture<T>\n): Future<T> {\n inbound.then(\n (content: T | StructuredDataDocument<T>) => {\n if (owner.controller.signal.aborted) {\n // the next function did not respect the signal, we handle it here\n outbound.reject(enhanceReason(owner.controller.signal.reason as string));\n return;\n }\n if (isDoc(content)) {\n owner.setStream(owner.god.stream);\n content = content.content;\n }\n const document = {\n [STRUCTURED]: true as const,\n request: owner.request,\n response: owner.getResponse(),\n content,\n };\n outbound.resolve(document);\n },\n (error: Error & StructuredErrorDocument) => {\n if (isDoc(error)) {\n owner.setStream(owner.god.stream);\n }\n if (!error || !(error instanceof Error)) {\n try {\n throw new Error(error ? error : `Request Rejected with an Unknown Error`);\n } catch (e: unknown) {\n if (error && typeof error === 'object') {\n Object.assign(e as Error, error);\n (e as Error & StructuredErrorDocument).message =\n (error as Error).message || `Request Rejected with an Unknown Error`;\n }\n error = e as Error & StructuredErrorDocument;\n }\n }\n\n error[STRUCTURED] = true;\n error.request = owner.request;\n error.response = owner.getResponse();\n error.error = error.error || error.message;\n outbound.reject(error);\n }\n );\n return outbound.promise;\n}\n\nfunction isCacheHandler(handler: Handler & { [IS_CACHE_HANDLER]?: boolean }, index: number): boolean {\n return index === 0 && Boolean(handler[IS_CACHE_HANDLER]);\n}\n\nexport function executeNextHandler<T>(\n wares: Readonly<Handler[]>,\n request: RequestInfo,\n i: number,\n god: GodContext\n): Future<T> {\n if (DEBUG) {\n if (i === wares.length) {\n throw new Error(`No handler was able to handle this request.`);\n }\n assertValidRequest(request, false);\n }\n const owner = new ContextOwner(request, god, i === 0);\n\n function next(r: RequestInfo): Future<T> {\n owner.nextCalled++;\n return executeNextHandler(wares, r, i + 1, god);\n }\n\n const _isCacheHandler = isCacheHandler(wares[i], i);\n const context = new Context(owner, _isCacheHandler);\n let outcome: Promise<T | StructuredDataDocument<T>> | Future<T>;\n try {\n outcome = wares[i].request<T>(context, next);\n if (_isCacheHandler) {\n context._finalize();\n }\n if (!!outcome && _isCacheHandler) {\n if (!(outcome instanceof Promise)) {\n setRequestResult(owner.requestId, { isError: false, result: ensureDoc(owner, outcome, false) });\n outcome = Promise.resolve(outcome);\n }\n } else if (DEBUG) {\n if (!outcome || (!(outcome instanceof Promise) && !(typeof outcome === 'object' && 'then' in outcome))) {\n // oxlint-disable-next-line no-console\n console.log({ request, handler: wares[i], outcome });\n if (outcome === undefined) {\n throw new Error(`Expected handler.request to return a promise, instead received undefined.`);\n }\n throw new Error(`Expected handler.request to return a promise, instead received a synchronous value.`);\n }\n }\n } catch (e) {\n if (_isCacheHandler) {\n setRequestResult(owner.requestId, { isError: true, result: ensureDoc(owner, e, true) });\n }\n // oxlint-disable-next-line typescript/prefer-promise-reject-errors\n outcome = Promise.reject<StructuredDataDocument<T>>(e);\n }\n const future = createFuture<T>(owner);\n\n if (isFuture<T>(outcome)) {\n return curryFuture(owner, outcome, future);\n }\n\n return handleOutcome(owner, outcome, future);\n}\n","import { DEBUG } from '@warp-drive/build-config/env';\n\nimport { IS_FUTURE, type StructuredDocument } from '../../types/request';\nimport type { ContextOwner } from './context';\nimport type { Deferred, DeferredFuture, Future } from './types';\nimport { enhanceReason } from './utils';\n\nexport function isFuture<T>(maybe: unknown): maybe is Future<T> {\n return Boolean(maybe && maybe instanceof Promise && (maybe as Future<T>)[IS_FUTURE] === true);\n}\n\n/**\n * Create a {@link Deferred}: a promise along with the `resolve`/`reject`\n * callbacks that settle it, so the promise can be handed out before the\n * work that will settle it has started.\n *\n * @public\n */\nexport function createDeferred<T>(): Deferred<T> {\n let resolve!: (v: T) => void;\n let reject!: (v: unknown) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { resolve, reject, promise };\n}\n\nexport function upgradePromise<T>(promise: Promise<StructuredDocument<T>>, future: Future<T>): Future<T> {\n (promise as Future<T>)[IS_FUTURE] = true;\n // oxlint-disable-next-line typescript/unbound-method\n (promise as Future<T>).getStream = future.getStream;\n // oxlint-disable-next-line typescript/unbound-method\n (promise as Future<T>).abort = future.abort;\n // oxlint-disable-next-line typescript/unbound-method\n (promise as Future<T>).onFinalize = future.onFinalize;\n (promise as Future<T>).id = future.id;\n (promise as Future<T>).lid = future.lid;\n (promise as Future<T>).requester = future.requester;\n\n if (DEBUG) {\n // @ts-expect-error\n promise.toJSON = () => {\n const id = 'Future<' + (promise as Future<T>).id + '>';\n if ((promise as Future<T>).lid) {\n return `${id} (${(promise as Future<T>).lid!.lid})`;\n }\n return id;\n };\n }\n\n return promise as Future<T>;\n}\n\nexport function createFuture<T>(owner: ContextOwner): DeferredFuture<T> {\n const deferred = createDeferred<T>() as unknown as DeferredFuture<T>;\n let { promise } = deferred;\n let cbs: Array<() => void> | undefined;\n promise = promise.finally(() => {\n owner.resolveStream();\n if (cbs) {\n cbs.forEach((cb) => cb());\n }\n }) as Future<T>;\n promise.onFinalize = (fn: () => void) => {\n cbs = cbs || [];\n cbs.push(fn);\n };\n promise[IS_FUTURE] = true;\n promise.getStream = () => {\n return owner.getStream();\n };\n promise.abort = (reason?: string) => {\n owner.abort(enhanceReason(reason));\n };\n promise.id = owner.requestId;\n promise.lid = owner.god.identifier;\n promise.requester = owner.god.requester;\n\n if (DEBUG) {\n // @ts-expect-error\n promise.toJSON = () => {\n const id = 'Future<' + promise.id + '>';\n if (promise.lid) {\n return `${id} (${promise.lid.lid})`;\n }\n return id;\n };\n }\n\n deferred.promise = promise;\n return deferred;\n}\n","import type { ReactiveDataDocument } from './reactive.ts';\nimport type { RequestInfo } from './types/request.ts';\nimport type { Meta } from './types/spec/json-api-raw.ts';\nimport type { RequestSignature } from './types/symbols.ts';\n\nexport { createDeferred } from './request/-private/future.ts';\nexport type {\n Future,\n Handler,\n CacheHandler,\n NextFn,\n Deferred,\n ManagedRequestPriority,\n} from './request/-private/types.ts';\nexport { setPromiseResult, getPromiseResult } from './request/-private/promise-cache.ts';\nexport type { Awaitable } from './request/-private/promise-cache.ts';\nexport type { Context } from './request/-private/context.ts';\n\n/**\n * Brands the supplied object with the supplied response type.\n *\n * ```ts\n * import type { ReactiveDataDocument } from '@warp-drive/core/reactive';\n * import { withResponseType } from '@warp-drive/core/request';\n * import type { User } from '#/data/user.ts'\n *\n * const result = await store.request(\n * withResponseType<ReactiveDataDocument<User>>({ url: '/users/1' })\n * );\n *\n * result.content.data; // will have type User\n * ```\n *\n */\nexport function withResponseType<T>(obj: RequestInfo): RequestInfo<T> & {\n /** The branded response type. Present only at the type level; carries no runtime value. */\n [RequestSignature]: T;\n} {\n return obj as RequestInfo<T> & {\n [RequestSignature]: T;\n };\n}\n\n/**\n * Brands the supplied object with the supplied response type\n * wrapped in {@link ReactiveDataDocument}. This is a convenience for\n * the common case of using {@link withResponseType} with `ReactiveDataDocument`.\n *\n * ```ts\n * import { withReactiveResponse } from '@warp-drive/core/request';\n * import type { User } from '#/data/user.ts'\n *\n * const result = await store.request(\n * withReactiveResponse<User>({ url: '/users/1' })\n * );\n *\n * result.content.data; // will have type User\n * ```\n *\n * Pass a second type param to declare the `meta` the endpoint returns:\n *\n * ```ts\n * type PageMeta = { page: { limit: number; offset: number }; total?: number };\n *\n * const result = await store.request(\n * withReactiveResponse<User[], PageMeta>({ url: '/users' })\n * );\n *\n * result.content.meta?.total; // number | undefined\n * ```\n *\n * @public\n */\nexport function withReactiveResponse<\n T,\n M extends Meta | undefined = Meta | undefined,\n E extends object = object,\n EM extends Meta | undefined = M,\n>(\n obj: RequestInfo\n): RequestInfo<ReactiveDataDocument<T, M, E, EM>> & {\n /** The branded response type. Present only at the type level; carries no runtime value. */\n [RequestSignature]: ReactiveDataDocument<T, M, E, EM>;\n} {\n return obj as RequestInfo<ReactiveDataDocument<T, M, E, EM>> & {\n [RequestSignature]: ReactiveDataDocument<T, M, E, EM>;\n };\n}\n\n/**\n * @deprecated use {@link withResponseType} instead\n */\nexport const withBrand: typeof withResponseType = withResponseType;\n"],"mappings":";;;;AAUA,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AErCN,QAAsBO,aAAaH,OAAOG;CAC1CP,QAAsBQ,KAAKJ,OAAOI;CAClCR,QAAsBS,MAAML,OAAOK;CACnCT,QAAsBU,YAAYN,OAAOM;CAa1C,OAAOV;AACT;AAEA,SAAgBW,aAAgBC,OAAwC;CACtE,MAAMC,WAAWhB,eAAkB;CACnC,IAAI,EAAEG,YAAYa;CAClB,IAAIC;CACJd,UAAUA,QAAQe,cAAc;EAC9BH,MAAMI,cAAc;EACpB,IAAIF,KACFA,IAAIG,SAASC,OAAOA,GAAG,CAAC;CAE5B,CAAC;CACDlB,QAAQO,cAAcY,OAAmB;EACvCL,MAAMA,OAAO,CAAA;EACbA,IAAIM,KAAKD,EAAE;CACb;CACAnB,QAAQT,aAAa;CACrBS,QAAQK,kBAAkB;EACxB,OAAOO,MAAMP,UAAU;CACzB;CACAL,QAAQM,SAASe,WAAoB;EACnCT,MAAMN,MAAMd,cAAc6B,MAAM,CAAC;CACnC;CACArB,QAAQQ,KAAKI,MAAMU;CACnBtB,QAAQS,MAAMG,MAAMW,IAAIC;CACxBxB,QAAQU,YAAYE,MAAMW,IAAIb;CAa9BG,SAASb,UAAUA;CACnB,OAAOa;AACT;;;;;;;;;;;;;;;;;;;;AC1DA,SAAgBe,iBAAoBC,KAGlC;CACA,OAAOA;AAGT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgBC,qBAMdD,KAIA;CACA,OAAOA;AAGT;;;;AAKA,MAAaE,YAAqCH"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { f as setPromiseResult, i as createDeferred, n as withReactiveResponse, r as withResponseType, t as withBrand, u as getPromiseResult } from "./request-
|
|
1
|
+
import { f as setPromiseResult, i as createDeferred, n as withReactiveResponse, r as withResponseType, t as withBrand, u as getPromiseResult } from "./request-DK7nNaAf.js";
|
|
2
2
|
|
|
3
3
|
export { createDeferred, getPromiseResult, setPromiseResult, withBrand, withReactiveResponse, withResponseType };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { D as notifyInternalSignal, E as makeInitializer, N as waitFor, O as peekInternalSignal, T as getOrCreateInternalSignal, _ as entangleSignal, a as getPaginationState, b as signal, c as getPaginationCache, h as defineSignal, i as getPaginationLinks, k as withSignalStore, l as DISPOSE, m as defineNonEnumerableSignal, n as createPaginationLinksSubscription, o as clearPaginationCache, p as defineGate, r as createPaginationSubscription, s as defaultPageHints, v as gate, y as memoized } from "../-private-
|
|
1
|
+
import { D as notifyInternalSignal, E as makeInitializer, N as waitFor, O as peekInternalSignal, T as getOrCreateInternalSignal, _ as entangleSignal, a as getPaginationState, b as signal, c as getPaginationCache, h as defineSignal, i as getPaginationLinks, k as withSignalStore, l as DISPOSE, m as defineNonEnumerableSignal, n as createPaginationLinksSubscription, o as clearPaginationCache, p as defineGate, r as createPaginationSubscription, s as defaultPageHints, v as gate, y as memoized } from "../-private-Dg1vsF-H.js";
|
|
2
2
|
|
|
3
3
|
export { DISPOSE, clearPaginationCache, createPaginationLinksSubscription, createPaginationSubscription, defaultPageHints, defineGate, defineNonEnumerableSignal, defineSignal, entangleSignal, gate, getOrCreateInternalSignal, getPaginationCache, getPaginationLinks, getPaginationState, makeInitializer, memoized, notifyInternalSignal, peekInternalSignal, signal, waitFor, withSignalStore };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ARRAY_SIGNAL, C as createInternalMemo, D as notifyInternalSignal, O as peekInternalSignal, P as willSyncFlushWatchers, S as consumeInternalSignal, T as getOrCreateInternalSignal, _ as entangleSignal, f as createSignalDescriptor, g as entangleInitiallyStaleSignal, h as defineSignal, j as OBJECT_SIGNAL, k as withSignalStore, p as defineGate, w as createInternalSignal, x as Signals } from "./-private-
|
|
1
|
+
import { getOrSetGlobal, peekTransient, peekUniversalTransient, setTransient, setUniversalTransient } from "./types/-private.js";
|
|
2
|
+
import { A as ARRAY_SIGNAL, C as createInternalMemo, D as notifyInternalSignal, O as peekInternalSignal, P as willSyncFlushWatchers, S as consumeInternalSignal, T as getOrCreateInternalSignal, _ as entangleSignal, f as createSignalDescriptor, g as entangleInitiallyStaleSignal, h as defineSignal, j as OBJECT_SIGNAL, k as withSignalStore, p as defineGate, w as createInternalSignal, x as Signals } from "./-private-Dg1vsF-H.js";
|
|
3
3
|
import { EnableHydration, STRUCTURED, SkipCache } from "./types/request.js";
|
|
4
|
-
import { a as upgradePromise, c as executeNextHandler, d as getRequestResult, f as setPromiseResult, l as clearRequestResult, o as DOMError, p as cloneResponseProperties, s as IS_CACHE_HANDLER, t as withBrand } from "./request-
|
|
5
|
-
import { a as SOURCE, i as Destroy, n as Commit, r as Context, t as Checkout } from "./-private-
|
|
4
|
+
import { a as upgradePromise, c as executeNextHandler, d as getRequestResult, f as setPromiseResult, l as clearRequestResult, o as DOMError, p as cloneResponseProperties, s as IS_CACHE_HANDLER, t as withBrand } from "./request-DK7nNaAf.js";
|
|
5
|
+
import { a as SOURCE, i as Destroy, n as Commit, r as Context, t as Checkout } from "./-private-Dtj8O5W7.js";
|
|
6
6
|
import { CACHE_OWNER } from "./types/identifier.js";
|
|
7
7
|
import { RecordStore, Type } from "./types/symbols.js";
|
|
8
8
|
import { isResourceSchema } from "./types/schema/fields.js";
|
|
@@ -533,6 +533,43 @@ function isResourceKey(identifier) {
|
|
|
533
533
|
function isRequestKey(identifier) {
|
|
534
534
|
return identifier.type === "@document" && identifier[CACHE_OWNER] !== void 0;
|
|
535
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* The identity of a field's value, as returned by {@link fieldValueIdentity}.
|
|
538
|
+
* Today only schema-object values (a `schema-object` field, or one element of
|
|
539
|
+
* a `schema-array`) have one: the concrete schema-object type the value
|
|
540
|
+
* resolves to, and the identity hash that type's `ObjectSchema` declares for
|
|
541
|
+
* it, or `null` when the schema declares `identity: null`.
|
|
542
|
+
*/
|
|
543
|
+
/**
|
|
544
|
+
* The identity of `value` as a value of `field`, when the field kind has one.
|
|
545
|
+
*
|
|
546
|
+
* A `schema-object` value, or one element of a `schema-array`, resolves to its
|
|
547
|
+
* concrete schema-object type and the identity hash that type's `ObjectSchema`
|
|
548
|
+
* declares (`null` when the schema declares `identity: null`). A
|
|
549
|
+
* non-polymorphic field names the type directly; a polymorphic field reads it
|
|
550
|
+
* off the value at `options.type` (default `'type'`), or computes it with the
|
|
551
|
+
* hash function named by `field.type` when `options.type` is `'@hash'`.
|
|
552
|
+
*
|
|
553
|
+
* Every other field kind, and any non-object value, has no identity and
|
|
554
|
+
* returns `null`.
|
|
555
|
+
*/
|
|
556
|
+
function fieldValueIdentity(schema, field, value) {
|
|
557
|
+
if (field.kind !== "schema-object" && field.kind !== "schema-array") return null;
|
|
558
|
+
if (!value || typeof value !== "object") return null;
|
|
559
|
+
const rawValue = value;
|
|
560
|
+
let type;
|
|
561
|
+
if (field.options?.polymorphic) {
|
|
562
|
+
const typePath = field.options.type ?? "type";
|
|
563
|
+
if (typePath === "@hash") type = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
564
|
+
else type = rawValue[typePath];
|
|
565
|
+
} else type = field.type;
|
|
566
|
+
const hashField = schema.resource({ type }).identity;
|
|
567
|
+
const hash = hashField && hashField.kind === "@hash" ? schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name) : null;
|
|
568
|
+
return {
|
|
569
|
+
type,
|
|
570
|
+
hash
|
|
571
|
+
};
|
|
572
|
+
}
|
|
536
573
|
const _crypto = typeof FastBoot !== "undefined" ? FastBoot.require("crypto") : globalThis.crypto;
|
|
537
574
|
function uuidv4() {
|
|
538
575
|
return _crypto.randomUUID();
|
|
@@ -4252,17 +4289,7 @@ var ManagedArray = class {
|
|
|
4252
4289
|
if (field.type) return schema.transformation(field).hydrate(rawValue, field.options ?? null, self.owner);
|
|
4253
4290
|
return rawValue;
|
|
4254
4291
|
}
|
|
4255
|
-
|
|
4256
|
-
* When the array is polymorphic, we need to determine the real type
|
|
4257
|
-
* in order to apply the correct identity as schema-object identity
|
|
4258
|
-
* is only required to be unique by type
|
|
4259
|
-
*/
|
|
4260
|
-
let objectType;
|
|
4261
|
-
if (field.options?.polymorphic) {
|
|
4262
|
-
const typePath = field.options.type ?? "type";
|
|
4263
|
-
if (typePath === "@hash") objectType = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
4264
|
-
else objectType = rawValue[typePath];
|
|
4265
|
-
} else objectType = field.type;
|
|
4292
|
+
const { type: objectType, hash } = fieldValueIdentity(schema, field, rawValue);
|
|
4266
4293
|
/**
|
|
4267
4294
|
* When KeyMode=@hash the ReactiveResource is keyed into
|
|
4268
4295
|
* ManagedRecordRefs by the return value of @hash on the rawValue.
|
|
@@ -4271,10 +4298,8 @@ var ManagedArray = class {
|
|
|
4271
4298
|
* when ARRAY_SIGNAL is dirty if hash performance becomes a bottleneck.
|
|
4272
4299
|
*/
|
|
4273
4300
|
let schemaObjectKeyValue;
|
|
4274
|
-
if (KeyMode === "@hash")
|
|
4275
|
-
|
|
4276
|
-
schemaObjectKeyValue = schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name);
|
|
4277
|
-
} else schemaObjectKeyValue = KeyMode === "@identity" ? rawValue : KeyMode === "@index" ? index : rawValue[KeyMode];
|
|
4301
|
+
if (KeyMode === "@hash") schemaObjectKeyValue = hash;
|
|
4302
|
+
else schemaObjectKeyValue = KeyMode === "@identity" ? rawValue : KeyMode === "@index" ? index : rawValue[KeyMode];
|
|
4278
4303
|
if (!schemaObjectKeyValue && schemaObjectKeyValue !== 0) return;
|
|
4279
4304
|
const recordRef = ManagedRecordRefs.get(schemaObjectKeyValue);
|
|
4280
4305
|
const record = recordRef?.value.deref();
|
|
@@ -4908,15 +4933,8 @@ function getSchemaObjectField(context) {
|
|
|
4908
4933
|
}
|
|
4909
4934
|
return null;
|
|
4910
4935
|
}
|
|
4911
|
-
const {
|
|
4912
|
-
|
|
4913
|
-
if (field.options?.polymorphic) {
|
|
4914
|
-
const typePath = field.options.type ?? "type";
|
|
4915
|
-
if (typePath === "@hash") objectType = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
4916
|
-
else objectType = rawValue[typePath];
|
|
4917
|
-
} else objectType = field.type;
|
|
4918
|
-
const hashField = schema.resource({ type: objectType }).identity;
|
|
4919
|
-
const identity = hashField ? schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name) : field.name;
|
|
4936
|
+
const { type: objectType, hash } = fieldValueIdentity(store.schema, field, rawValue);
|
|
4937
|
+
const identity = hash ?? field.name;
|
|
4920
4938
|
const cachedSchemaObject = signal.value;
|
|
4921
4939
|
if (cachedSchemaObject) {
|
|
4922
4940
|
if (cachedSchemaObject.type === objectType && cachedSchemaObject.identity === identity) return cachedSchemaObject.value;
|
|
@@ -5078,6 +5096,8 @@ const IgnoredGlobalFields = /* @__PURE__ */ new Set([
|
|
|
5078
5096
|
"then",
|
|
5079
5097
|
"setInterval",
|
|
5080
5098
|
"document",
|
|
5099
|
+
"unknownProperty",
|
|
5100
|
+
"size",
|
|
5081
5101
|
STRUCTURED
|
|
5082
5102
|
]);
|
|
5083
5103
|
const RecordSymbols = /* @__PURE__ */ new Set([
|
|
@@ -6938,5 +6958,5 @@ function useRecommendedStore(options, StoreKlass = Store) {
|
|
|
6938
6958
|
}
|
|
6939
6959
|
|
|
6940
6960
|
//#endregion
|
|
6941
|
-
export {
|
|
6942
|
-
//# sourceMappingURL=src-
|
|
6961
|
+
export { normalizeModelName as A, isRequestKey as C, setIdentifierResetMethod as D, setIdentifierGenerationMethod as E, recordIdentifierFor as F, setRecordIdentifier as I, storeFor as L, ensureStringId as M, StoreMap as N, setIdentifierUpdateMethod as O, _clearCaches as P, assertPrivateCapabilities as R, fieldValueIdentity as S, setIdentifierForgetMethod as T, Store as _, fromIdentity as a, RecordArrayManager as b, instantiateRecord as c, commit as d, log as f, CacheHandler as g, constructResource as h, SchemaService as i, coerceId as j, setKeyInfoForResource as k, teardownRecord as l, createLegacyManyArray as m, RequestManager as n, registerDerivations as o, logGroup as p, Fetch as r, withDefaults as s, useRecommendedStore as t, checkout as u, assertPrivateStore as v, isResourceKey as w, fastPush as x, isPrivateStore as y };
|
|
6962
|
+
//# sourceMappingURL=src-DGB6WvXW.js.map
|