@warp-drive-mirror/core 5.10.0-alpha.10 → 5.10.0-alpha.13
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/README.md +116 -6
- package/dist/{-private-CjK1Dmuh.js → -private-BpyvBYFj.js} +508 -144
- package/dist/-private-BpyvBYFj.js.map +1 -0
- package/dist/{unpkg/dev/-private-Dtj8O5W7.js → -private-CmNOwhK0.js} +3 -1
- package/dist/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
- package/dist/{aliases-BWYW5EhX.d.ts → aliases-BQmAxXmb.d.ts} +4 -1
- package/dist/aliases-BQmAxXmb.d.ts.map +1 -0
- package/dist/{change-C7kqv2kW.d.ts → change-DClXcHvr.d.ts} +4 -2
- package/dist/change-DClXcHvr.d.ts.map +1 -0
- package/dist/{concepts-DFldVwEM.d.ts → concepts-DzuY5M1K.d.ts} +14 -5
- package/dist/concepts-DzuY5M1K.d.ts.map +1 -0
- package/dist/{configure-B_F639tN.d.ts → configure-CjsojjiI.d.ts} +7 -1
- package/dist/configure-CjsojjiI.d.ts.map +1 -0
- package/dist/configure.d.ts +1 -1
- package/dist/configure.js +1 -1
- package/dist/{document-Ca4ZZBd9.d.ts → document-Ni8Ns26t.d.ts} +22 -4
- package/dist/document-Ni8Ns26t.d.ts.map +1 -0
- package/dist/{error-0uD6GkNX.d.ts → error-APuUdUGk.d.ts} +4 -2
- package/dist/error-APuUdUGk.d.ts.map +1 -0
- package/dist/{fields-FM7peCiM.d.ts → fields-D6173Q_a.d.ts} +134 -7
- package/dist/fields-D6173Q_a.d.ts.map +1 -0
- package/dist/graph/-private.d.ts +1 -1
- package/dist/graph/-private.js +2 -0
- package/dist/graph/-private.js.map +1 -1
- package/dist/{graph-DLqYXP2z.d.ts → graph-rjTyJ-gd.d.ts} +25 -5
- package/dist/graph-rjTyJ-gd.d.ts.map +1 -0
- package/dist/{identifier-DQnqOSJK.d.ts → identifier-B_tK3FUw.d.ts} +29 -4
- package/dist/identifier-B_tK3FUw.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{internal-9XuWZdDv.d.ts → internal-CgOlgOt3.d.ts} +497 -31
- package/dist/internal-CgOlgOt3.d.ts.map +1 -0
- package/dist/{json-api-raw-C5APJHHB.d.ts → json-api-raw-BxzNsCg0.d.ts} +44 -2
- package/dist/json-api-raw-BxzNsCg0.d.ts.map +1 -0
- package/dist/{mutations-CqtoGB4t.d.ts → mutations-C81gbYjB.d.ts} +18 -2
- package/dist/mutations-C81gbYjB.d.ts.map +1 -0
- package/dist/{operations-D1qA6r0_.d.ts → operations-B4pQM7D6.d.ts} +39 -5
- package/dist/operations-B4pQM7D6.d.ts.map +1 -0
- package/dist/{params-DrEx3bf8.d.ts → params-dbHiSOMF.d.ts} +11 -1
- package/dist/params-dbHiSOMF.d.ts.map +1 -0
- package/dist/{raw-D5hnjiq7.d.ts → raw-CiC64nCY.d.ts} +10 -1
- package/dist/raw-CiC64nCY.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 +2 -2
- package/dist/reactive.js +3 -3
- package/dist/{record-D3QQcaIR.d.ts → record-DDxPtzcY.d.ts} +22 -2
- package/dist/record-DDxPtzcY.d.ts.map +1 -0
- package/dist/{relationship-CmHzMPKf.d.ts → relationship-BlGIXgj4.d.ts} +10 -3
- package/dist/relationship-BlGIXgj4.d.ts.map +1 -0
- package/dist/{request-Di274pQz.js → request-MiwUbGdT.js} +26 -1
- package/dist/request-MiwUbGdT.js.map +1 -0
- package/dist/request.d.ts +1 -1
- package/dist/request.js +1 -1
- package/dist/signals/-leaked.d.ts +86 -4
- package/dist/signals/-leaked.d.ts.map +1 -1
- package/dist/signals/-leaked.js +1 -1
- package/dist/{src-TlQlgL5V.js → src-DlNeupkA.js} +222 -20
- package/dist/src-DlNeupkA.js.map +1 -0
- package/dist/store/-private.d.ts +1 -1
- package/dist/store/-private.js +1 -1
- package/dist/{store-DNF9Rgoh.js → store-lcyaxrpj.js} +16 -1
- package/dist/store-lcyaxrpj.js.map +1 -0
- package/dist/store.d.ts +1 -1
- package/dist/store.js +1 -1
- package/dist/{symbols-DjRDCeX0.d.ts → symbols-Cu9un1NR.d.ts} +10 -1
- package/dist/symbols-Cu9un1NR.d.ts.map +1 -0
- package/dist/types/-private.js +1 -1
- package/dist/types/cache/aliases.d.ts +1 -1
- package/dist/types/cache/change.d.ts +1 -1
- package/dist/types/cache/mutations.d.ts +1 -1
- package/dist/types/cache/operations.d.ts +1 -1
- package/dist/types/cache/relationship.d.ts +1 -1
- package/dist/types/cache.d.ts +1 -1
- package/dist/types/graph.d.ts +1 -1
- package/dist/types/identifier.d.ts +1 -1
- package/dist/types/identifier.js +33 -3
- package/dist/types/identifier.js.map +1 -1
- package/dist/types/json/raw.d.ts +1 -1
- package/dist/types/params.d.ts +1 -1
- package/dist/types/record.d.ts +1 -1
- package/dist/types/record.js +25 -0
- package/dist/types/record.js.map +1 -1
- package/dist/types/request.d.ts +1 -1
- package/dist/types/request.js +80 -0
- package/dist/types/request.js.map +1 -1
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/types/schema/concepts.d.ts +1 -1
- package/dist/types/schema/fields.d.ts +1 -1
- package/dist/types/schema/fields.js +132 -3
- package/dist/types/schema/fields.js.map +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/spec/json-api-raw.d.ts +1 -1
- package/dist/types/symbols.d.ts +1 -1
- package/dist/types/symbols.js +14 -0
- package/dist/types/symbols.js.map +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/unpkg/{dev-deprecated/-private-DrQgwtNS.js → dev/-private-BH4O810v.js} +508 -144
- package/dist/unpkg/dev/-private-BH4O810v.js.map +1 -0
- package/dist/{-private-Dtj8O5W7.js → unpkg/dev/-private-CmNOwhK0.js} +3 -1
- package/dist/unpkg/dev/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
- package/dist/unpkg/dev/configure.js +1 -1
- package/dist/unpkg/dev/graph/-private.js +2 -0
- package/dist/unpkg/dev/graph/-private.js.map +1 -1
- 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-nAaeDlS9.js → dev/request-Fe-vpe-u.js} +26 -1
- package/dist/unpkg/dev/request-Fe-vpe-u.js.map +1 -0
- package/dist/unpkg/dev/request.js +1 -1
- package/dist/unpkg/dev/signals/-leaked.js +1 -1
- package/dist/unpkg/dev/{src-D8uKAIUN.js → src-FSk0Z_Lp.js} +213 -13
- package/dist/unpkg/dev/src-FSk0Z_Lp.js.map +1 -0
- package/dist/unpkg/dev/store/-private.js +1 -1
- package/dist/unpkg/dev/{store-BIFNM_fB.js → store-BUV8Pfi7.js} +16 -1
- package/dist/unpkg/dev/store-BUV8Pfi7.js.map +1 -0
- package/dist/unpkg/dev/store.js +1 -1
- package/dist/unpkg/dev/types/-private.js +1 -1
- package/dist/unpkg/dev/types/identifier.js +33 -3
- package/dist/unpkg/dev/types/identifier.js.map +1 -1
- package/dist/unpkg/dev/types/record.js +25 -0
- package/dist/unpkg/dev/types/record.js.map +1 -1
- package/dist/unpkg/dev/types/request.js +80 -0
- package/dist/unpkg/dev/types/request.js.map +1 -1
- package/dist/unpkg/dev/types/schema/fields.js +132 -3
- package/dist/unpkg/dev/types/schema/fields.js.map +1 -1
- package/dist/unpkg/dev/types/symbols.js +14 -0
- package/dist/unpkg/dev/types/symbols.js.map +1 -1
- package/dist/unpkg/{dev/-private-DrQgwtNS.js → dev-deprecated/-private-BH4O810v.js} +508 -144
- package/dist/unpkg/dev-deprecated/-private-BH4O810v.js.map +1 -0
- package/dist/unpkg/{prod-deprecated/-private-Dtj8O5W7.js → dev-deprecated/-private-CmNOwhK0.js} +3 -1
- package/dist/unpkg/dev-deprecated/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/configure.js +1 -1
- package/dist/unpkg/dev-deprecated/graph/-private.js +2 -0
- 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-nAaeDlS9.js → dev-deprecated/request-Fe-vpe-u.js} +26 -1
- package/dist/unpkg/dev-deprecated/request-Fe-vpe-u.js.map +1 -0
- package/dist/unpkg/dev-deprecated/request.js +1 -1
- package/dist/unpkg/dev-deprecated/signals/-leaked.js +1 -1
- package/dist/unpkg/dev-deprecated/{src-BlewXGbB.js → src-Isk_Je7q.js} +215 -13
- package/dist/unpkg/dev-deprecated/src-Isk_Je7q.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/{store-X1WN7P_O.js → store-CCZBSe0p.js} +16 -1
- package/dist/unpkg/dev-deprecated/store-CCZBSe0p.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store.js +1 -1
- package/dist/unpkg/dev-deprecated/types/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/types/identifier.js +33 -3
- package/dist/unpkg/dev-deprecated/types/identifier.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/record.js +25 -0
- package/dist/unpkg/dev-deprecated/types/record.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/request.js +80 -0
- package/dist/unpkg/dev-deprecated/types/request.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/schema/fields.js +132 -3
- package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/symbols.js +14 -0
- package/dist/unpkg/dev-deprecated/types/symbols.js.map +1 -1
- package/dist/unpkg/prod/-private-CmNOwhK0.js +24 -0
- package/dist/unpkg/prod/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
- package/dist/unpkg/prod/{-private-Dg1vsF-H.js → -private-DKVDMUfT.js} +481 -138
- package/dist/unpkg/prod/-private-DKVDMUfT.js.map +1 -0
- package/dist/unpkg/prod/configure.js +1 -1
- package/dist/unpkg/prod/graph/-private.js +2 -0
- package/dist/unpkg/prod/graph/-private.js.map +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/{request-DK7nNaAf.js → request-ndw2Fy91.js} +26 -1
- package/dist/unpkg/prod/request-ndw2Fy91.js.map +1 -0
- package/dist/unpkg/prod/request.js +1 -1
- package/dist/unpkg/prod/signals/-leaked.js +1 -1
- package/dist/unpkg/prod/{src-DGB6WvXW.js → src-CoSpuocQ.js} +213 -13
- package/dist/unpkg/prod/src-CoSpuocQ.js.map +1 -0
- package/dist/unpkg/prod/store/-private.js +1 -1
- package/dist/unpkg/{prod-deprecated/store-BWhmb7Ob.js → prod/store-CQOsqdST.js} +16 -1
- package/dist/unpkg/prod/store-CQOsqdST.js.map +1 -0
- package/dist/unpkg/prod/store.js +1 -1
- package/dist/unpkg/prod/types/-private.js +1 -1
- package/dist/unpkg/prod/types/identifier.js +33 -3
- package/dist/unpkg/prod/types/identifier.js.map +1 -1
- package/dist/unpkg/prod/types/record.js +25 -0
- package/dist/unpkg/prod/types/record.js.map +1 -1
- package/dist/unpkg/prod/types/request.js +80 -0
- package/dist/unpkg/prod/types/request.js.map +1 -1
- package/dist/unpkg/prod/types/schema/fields.js +132 -3
- package/dist/unpkg/prod/types/schema/fields.js.map +1 -1
- package/dist/unpkg/prod/types/symbols.js +14 -0
- package/dist/unpkg/prod/types/symbols.js.map +1 -1
- package/dist/unpkg/{dev-deprecated/-private-Dtj8O5W7.js → prod-deprecated/-private-CmNOwhK0.js} +3 -1
- package/dist/unpkg/prod-deprecated/{-private-Dtj8O5W7.js.map → -private-CmNOwhK0.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/{-private-Dg1vsF-H.js → -private-DKVDMUfT.js} +481 -138
- package/dist/unpkg/prod-deprecated/-private-DKVDMUfT.js.map +1 -0
- package/dist/unpkg/prod-deprecated/configure.js +1 -1
- package/dist/unpkg/prod-deprecated/graph/-private.js +2 -0
- package/dist/unpkg/prod-deprecated/graph/-private.js.map +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-deprecated/{request-DK7nNaAf.js → request-ndw2Fy91.js} +26 -1
- package/dist/unpkg/prod-deprecated/request-ndw2Fy91.js.map +1 -0
- 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-B9AnmJPz.js → src-FK_rMde5.js} +215 -13
- package/dist/unpkg/prod-deprecated/src-FK_rMde5.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store/-private.js +1 -1
- package/dist/unpkg/{prod/store-BWhmb7Ob.js → prod-deprecated/store-CQOsqdST.js} +16 -1
- package/dist/unpkg/prod-deprecated/store-CQOsqdST.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store.js +1 -1
- package/dist/unpkg/prod-deprecated/types/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/types/identifier.js +33 -3
- package/dist/unpkg/prod-deprecated/types/identifier.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/record.js +25 -0
- package/dist/unpkg/prod-deprecated/types/record.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/request.js +80 -0
- package/dist/unpkg/prod-deprecated/types/request.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/schema/fields.js +132 -3
- package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/symbols.js +14 -0
- package/dist/unpkg/prod-deprecated/types/symbols.js.map +1 -1
- package/dist/{utils-BtURiy8l.d.ts → utils-CNmQoKm8.d.ts} +8 -1
- package/dist/utils-CNmQoKm8.d.ts.map +1 -0
- package/package.json +5 -5
- package/dist/-private-CjK1Dmuh.js.map +0 -1
- package/dist/aliases-BWYW5EhX.d.ts.map +0 -1
- package/dist/change-C7kqv2kW.d.ts.map +0 -1
- package/dist/concepts-DFldVwEM.d.ts.map +0 -1
- package/dist/configure-B_F639tN.d.ts.map +0 -1
- package/dist/document-Ca4ZZBd9.d.ts.map +0 -1
- package/dist/error-0uD6GkNX.d.ts.map +0 -1
- package/dist/fields-FM7peCiM.d.ts.map +0 -1
- package/dist/graph-DLqYXP2z.d.ts.map +0 -1
- package/dist/identifier-DQnqOSJK.d.ts.map +0 -1
- package/dist/internal-9XuWZdDv.d.ts.map +0 -1
- package/dist/json-api-raw-C5APJHHB.d.ts.map +0 -1
- package/dist/mutations-CqtoGB4t.d.ts.map +0 -1
- package/dist/operations-D1qA6r0_.d.ts.map +0 -1
- package/dist/params-DrEx3bf8.d.ts.map +0 -1
- package/dist/raw-D5hnjiq7.d.ts.map +0 -1
- package/dist/record-D3QQcaIR.d.ts.map +0 -1
- package/dist/relationship-CmHzMPKf.d.ts.map +0 -1
- package/dist/request-Di274pQz.js.map +0 -1
- package/dist/src-TlQlgL5V.js.map +0 -1
- package/dist/store-DNF9Rgoh.js.map +0 -1
- package/dist/symbols-DjRDCeX0.d.ts.map +0 -1
- package/dist/types/schema/fields.type-test.d.ts +0 -1
- package/dist/types/schema/fields.type-test.js +0 -79
- package/dist/types/schema/fields.type-test.js.map +0 -1
- package/dist/unpkg/dev/-private-DrQgwtNS.js.map +0 -1
- package/dist/unpkg/dev/request-nAaeDlS9.js.map +0 -1
- package/dist/unpkg/dev/src-D8uKAIUN.js.map +0 -1
- package/dist/unpkg/dev/store-BIFNM_fB.js.map +0 -1
- package/dist/unpkg/dev/types/schema/fields.type-test.js +0 -79
- package/dist/unpkg/dev/types/schema/fields.type-test.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-DrQgwtNS.js.map +0 -1
- package/dist/unpkg/dev-deprecated/request-nAaeDlS9.js.map +0 -1
- package/dist/unpkg/dev-deprecated/src-BlewXGbB.js.map +0 -1
- package/dist/unpkg/dev-deprecated/store-X1WN7P_O.js.map +0 -1
- package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js +0 -79
- package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js.map +0 -1
- package/dist/unpkg/prod/-private-Dg1vsF-H.js.map +0 -1
- package/dist/unpkg/prod/-private-Dtj8O5W7.js +0 -22
- package/dist/unpkg/prod/request-DK7nNaAf.js.map +0 -1
- package/dist/unpkg/prod/src-DGB6WvXW.js.map +0 -1
- package/dist/unpkg/prod/store-BWhmb7Ob.js.map +0 -1
- package/dist/unpkg/prod/types/schema/fields.type-test.js +0 -79
- package/dist/unpkg/prod/types/schema/fields.type-test.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-Dg1vsF-H.js.map +0 -1
- package/dist/unpkg/prod-deprecated/request-DK7nNaAf.js.map +0 -1
- package/dist/unpkg/prod-deprecated/src-B9AnmJPz.js.map +0 -1
- package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +0 -1
- package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js +0 -79
- package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js.map +0 -1
- package/dist/utils-BtURiy8l.d.ts.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { getOrSetGlobal, peekTransient, peekUniversalTransient, setTransient, setUniversalTransient } from "./types/-private.js";
|
|
2
|
-
import { A as ARRAY_SIGNAL, C as createInternalMemo, D as notifyInternalSignal, N as waitFor, 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-
|
|
2
|
+
import { A as ARRAY_SIGNAL, C as createInternalMemo, D as notifyInternalSignal, N as waitFor, 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-BH4O810v.js";
|
|
3
3
|
import { EnableHydration, STRUCTURED, SkipCache } from "./types/request.js";
|
|
4
4
|
import { CACHE_OWNER, DEBUG_CLIENT_ORIGINATED, DEBUG_KEY_TYPE, DEBUG_STALE_CACHE_OWNER } from "./types/identifier.js";
|
|
5
|
-
import { a as upgradePromise, c as executeNextHandler, d as getRequestResult, f as setPromiseResult, l as clearRequestResult, m as assertValidRequest, o as DOMError, p as cloneResponseProperties, s as IS_CACHE_HANDLER, t as withBrand } from "./request-
|
|
5
|
+
import { a as upgradePromise, c as executeNextHandler, d as getRequestResult, f as setPromiseResult, l as clearRequestResult, m as assertValidRequest, o as DOMError, p as cloneResponseProperties, s as IS_CACHE_HANDLER, t as withBrand } from "./request-Fe-vpe-u.js";
|
|
6
6
|
import { getRuntimeConfig, setIsMaybeMirage, setLogging } from "./types/runtime.js";
|
|
7
|
-
import { a as SOURCE, i as Destroy, n as Commit, r as Context, t as Checkout } from "./-private-
|
|
7
|
+
import { a as SOURCE, i as Destroy, n as Commit, r as Context, t as Checkout } from "./-private-CmNOwhK0.js";
|
|
8
8
|
import { dasherize } from "./utils/string.js";
|
|
9
9
|
import { t as getGlobalConfig } from "./runtime-e4oZ_UWz.js";
|
|
10
10
|
import { RecordStore, Type } from "./types/symbols.js";
|
|
11
11
|
import { isResourceSchema } from "./types/schema/fields.js";
|
|
12
|
-
import { t as DefaultCachePolicy } from "./store-
|
|
12
|
+
import { t as DefaultCachePolicy } from "./store-CCZBSe0p.js";
|
|
13
13
|
import * as _importSync20 from "@ember/object";
|
|
14
14
|
|
|
15
15
|
//#region src/reactive/-private/document.ts
|
|
@@ -22,10 +22,15 @@ function urlFromLink(link) {
|
|
|
22
22
|
* returned by `Cache.put` or `Cache.peek`, converting ResourceKeys into
|
|
23
23
|
* ReactiveResource instances.
|
|
24
24
|
*
|
|
25
|
+
* The [Using The Response](/guides/the-manual/requests/using-the-response) guide
|
|
26
|
+
* shows when a request's content is a ReactiveDocument.
|
|
27
|
+
*
|
|
25
28
|
* It is not directly instantiated by the user, and its properties should not
|
|
26
29
|
* be directly modified. Whether individual properties are mutable or not is
|
|
27
30
|
* determined by the record instance itself.
|
|
28
31
|
*
|
|
32
|
+
* @summary The reactive wrapper around a request's response document that exposes its data or errors
|
|
33
|
+
* as live records, plus meta, links, and pagination helpers.
|
|
29
34
|
* @public
|
|
30
35
|
*/
|
|
31
36
|
const ReactiveDocumentProto = {
|
|
@@ -600,6 +605,8 @@ implement this hook.
|
|
|
600
605
|
|
|
601
606
|
⚠️ Caution: Requests that do not have a `method` assigned are assumed to be `GET`
|
|
602
607
|
|
|
608
|
+
@summary Overrides how the store generates `lid` cache keys for resources and documents; must be set
|
|
609
|
+
before the store is created.
|
|
603
610
|
@public
|
|
604
611
|
*/
|
|
605
612
|
function setIdentifierGenerationMethod(method) {
|
|
@@ -634,6 +641,8 @@ prior to this `UpdateMethod` being called; however, calls to the parent method
|
|
|
634
641
|
`updateRecordIdentifier` that attempt to change the `id` or calling update
|
|
635
642
|
without providing an `id` when one is missing will throw an error.
|
|
636
643
|
|
|
644
|
+
@summary Registers a callback run when an existing resource key receives new data, for updating your
|
|
645
|
+
own secondary lookup tables.
|
|
637
646
|
@public
|
|
638
647
|
*/
|
|
639
648
|
function setIdentifierUpdateMethod(method) {
|
|
@@ -651,6 +660,8 @@ import { setIdentifierForgetMethod } from '@warp-drive-mirror/core';
|
|
|
651
660
|
Takes method which can expect to receive an existing `Identifier` that should be eliminated
|
|
652
661
|
from any secondary lookup tables or caches that the user has populated for it.
|
|
653
662
|
|
|
663
|
+
@summary Registers a callback run when the store releases a resource key, for cleaning up your own
|
|
664
|
+
lookup tables.
|
|
654
665
|
@public
|
|
655
666
|
*/
|
|
656
667
|
function setIdentifierForgetMethod(method) {
|
|
@@ -670,6 +681,8 @@ Takes a method which can expect to be called when the parent application is dest
|
|
|
670
681
|
If you have properly used a WeakMap to encapsulate the state of your customization
|
|
671
682
|
to the application instance, you may not need to implement the `resetMethod`.
|
|
672
683
|
|
|
684
|
+
@summary Registers a callback run when the store's key cache is torn down, for resetting any custom
|
|
685
|
+
key-generation state.
|
|
673
686
|
@public
|
|
674
687
|
*/
|
|
675
688
|
function setIdentifierResetMethod(method) {
|
|
@@ -688,6 +701,8 @@ This configuration MUST occur prior to the store instance being created.
|
|
|
688
701
|
import { setKeyInfoForResource } from '@warp-drive-mirror/core';
|
|
689
702
|
```
|
|
690
703
|
|
|
704
|
+
@summary Overrides how the store derives the `type` and `id` of a new `ResourceKey` from resource data;
|
|
705
|
+
must be set before the store is created.
|
|
691
706
|
@public
|
|
692
707
|
*/
|
|
693
708
|
function setKeyInfoForResource(method) {
|
|
@@ -1267,6 +1282,7 @@ const identifier = recordIdentifierFor(record);
|
|
|
1267
1282
|
const { id, type, lid } = identifier;
|
|
1268
1283
|
```
|
|
1269
1284
|
|
|
1285
|
+
@summary Returns the stable `ResourceKey` (type, id, and lid) the store assigned to a record instance.
|
|
1270
1286
|
@public
|
|
1271
1287
|
@param record a record instance previously obstained from the store.
|
|
1272
1288
|
*/
|
|
@@ -1924,9 +1940,15 @@ var CacheManager = class {
|
|
|
1924
1940
|
//#region src/store/-private/managers/notification-manager.ts
|
|
1925
1941
|
/**
|
|
1926
1942
|
* The kinds of change notifications the {@link NotificationManager} can emit for a resource.
|
|
1943
|
+
*
|
|
1944
|
+
* @summary The lifecycle notification kinds sent to resource subscribers: `added`, `removed`, `updated`,
|
|
1945
|
+
* or `state`.
|
|
1927
1946
|
*/
|
|
1928
1947
|
/**
|
|
1929
1948
|
* The kinds of change notifications the {@link NotificationManager} can emit for a request document.
|
|
1949
|
+
*
|
|
1950
|
+
* @summary The notification kinds sent to request document subscribers, such as `updated` or
|
|
1951
|
+
* `invalidated`.
|
|
1930
1952
|
*/
|
|
1931
1953
|
function isCacheOperationValue(value) {
|
|
1932
1954
|
return value === "added" || value === "state" || value === "updated" || value === "removed" || value === "invalidated";
|
|
@@ -1934,6 +1956,9 @@ function isCacheOperationValue(value) {
|
|
|
1934
1956
|
/**
|
|
1935
1957
|
* The full set of notification kinds the {@link NotificationManager} can emit for a resource,
|
|
1936
1958
|
* including both {@link CacheOperation}s and finer-grained field-level change notifications.
|
|
1959
|
+
*
|
|
1960
|
+
* @summary Every notification kind a resource subscriber can receive, from lifecycle operations to
|
|
1961
|
+
* `attributes`, `relationships`, `errors`, `meta`, and `identity` changes.
|
|
1937
1962
|
*/
|
|
1938
1963
|
/**
|
|
1939
1964
|
* The shape accepted by {@link NotificationManager.notify} and
|
|
@@ -1941,6 +1966,8 @@ function isCacheOperationValue(value) {
|
|
|
1941
1966
|
* the `'attributes'` or `'relationships'` namespaces in a single call
|
|
1942
1967
|
* instead of once per key.
|
|
1943
1968
|
*
|
|
1969
|
+
* @summary A set of field names passed to `notify` or `notifyChange` to report many `attributes` or
|
|
1970
|
+
* `relationships` changes in one call.
|
|
1944
1971
|
* @since 5.9.0
|
|
1945
1972
|
* @public
|
|
1946
1973
|
*/
|
|
@@ -1975,6 +2002,8 @@ function isCacheOperationValue(value) {
|
|
|
1975
2002
|
* `DocumentCacheOperation` values) are never filtered by channel since they
|
|
1976
2003
|
* have no local/remote duality.
|
|
1977
2004
|
*
|
|
2005
|
+
* @summary Scopes an `attributes` or `relationships` notification to a resource's local (editable) or
|
|
2006
|
+
* remote (persisted) view so only matching subscribers hear it.
|
|
1978
2007
|
* @public
|
|
1979
2008
|
*/
|
|
1980
2009
|
/**
|
|
@@ -2111,6 +2140,8 @@ function _unsubscribe(token, cache) {
|
|
|
2111
2140
|
* This Feature is what allows WarpDrive to create subscriptions that
|
|
2112
2141
|
* work with any framework or change-notification system.
|
|
2113
2142
|
*
|
|
2143
|
+
* @summary The store service that lets code subscribe to and batch-deliver change notifications for
|
|
2144
|
+
* cached resources and request documents.
|
|
2114
2145
|
* @hideconstructor
|
|
2115
2146
|
* @public
|
|
2116
2147
|
*/
|
|
@@ -2533,10 +2564,15 @@ const MUTABLE_PROPS = [
|
|
|
2533
2564
|
* as the base for relationship and legacy record-array types such as
|
|
2534
2565
|
* {@link LegacyLiveArray}, {@link LegacyQueryArray} and {@link LegacyManyArray}.
|
|
2535
2566
|
*
|
|
2567
|
+
* The [Key Terminology](/guides/the-manual/caching/key-terms#resources) guide explains
|
|
2568
|
+
* how it relates to resources.
|
|
2569
|
+
*
|
|
2536
2570
|
* Behaves like a native Array: `Array.isArray(arr)` and `arr instanceof Array`
|
|
2537
2571
|
* both report `true`. The array stays in sync with the cache, updating
|
|
2538
2572
|
* reactively as the underlying {@link ResourceKey}s change.
|
|
2539
2573
|
*
|
|
2574
|
+
* @summary Native-Array-compatible reactive list of records backed by cache keys, returned for collection responses
|
|
2575
|
+
* and underlying relationship and legacy record arrays.
|
|
2540
2576
|
* @public
|
|
2541
2577
|
*/
|
|
2542
2578
|
/**
|
|
@@ -2857,6 +2893,8 @@ function createRequestCollection(config) {
|
|
|
2857
2893
|
* and "bmw" will have populated LiveArrays, but the LiveArray for "car"
|
|
2858
2894
|
* would be empty.
|
|
2859
2895
|
*
|
|
2896
|
+
* @summary Legacy reactive array of every record of one type in the store, returned by `store.peekAll` and
|
|
2897
|
+
* `store.findAll`.
|
|
2860
2898
|
* @legacy we recommend againt using LiveArrays. Use {@link Store.request} instead
|
|
2861
2899
|
*/
|
|
2862
2900
|
/**
|
|
@@ -2972,6 +3010,8 @@ function _updateLiveArray() {
|
|
|
2972
3010
|
* from the cache, but it does remove the array as well as the overhead it requires
|
|
2973
3011
|
* from the store for book-keeping.
|
|
2974
3012
|
*
|
|
3013
|
+
* @summary Legacy immutable reactive array of the primary records returned by `store.query`, refreshable with
|
|
3014
|
+
* `update()` and released with `destroy()`.
|
|
2975
3015
|
* @legacy we recommend againt using QueryArrays. Use {@link Store.request} instead
|
|
2976
3016
|
*/
|
|
2977
3017
|
/**
|
|
@@ -3788,6 +3828,10 @@ const app = new EmberApp(defaults, {
|
|
|
3788
3828
|
* The `Store` is the central piece of the ***Warp*Drive** experience. It connects
|
|
3789
3829
|
* requests for data with schemas, caching and reactivity.
|
|
3790
3830
|
*
|
|
3831
|
+
* The [Setup](/guides/configuration/#configure-the-store) guide shows how to configure
|
|
3832
|
+
* one, and [Making Requests](/guides/the-manual/requests/) shows how to request data
|
|
3833
|
+
* through it.
|
|
3834
|
+
*
|
|
3791
3835
|
* While it's easy to use ***just*** ***Warp*Drive**'s request management, most projects will find they
|
|
3792
3836
|
* require far more than basic fetch management. For this reason it's often best to start with a `Store`
|
|
3793
3837
|
* even when you aren't sure yet.
|
|
@@ -3795,6 +3839,7 @@ const app = new EmberApp(defaults, {
|
|
|
3795
3839
|
* Most projects will only have a single `Store`, though using multiple distinct stores
|
|
3796
3840
|
* is possible.
|
|
3797
3841
|
*
|
|
3842
|
+
* @summary Central coordinator that connects requests for data with schemas, the cache and reactivity.
|
|
3798
3843
|
* @public
|
|
3799
3844
|
* @hideconstructor
|
|
3800
3845
|
*/
|
|
@@ -4002,12 +4047,25 @@ var Store = class extends BaseClass {
|
|
|
4002
4047
|
}
|
|
4003
4048
|
}
|
|
4004
4049
|
/**
|
|
4005
|
-
* ::: tip 💡 For a more complete overview see the [Request Guide](/guides/
|
|
4050
|
+
* ::: tip 💡 For a more complete overview see the [Request Guide](/guides/the-manual/requests/)
|
|
4006
4051
|
* :::
|
|
4007
4052
|
*
|
|
4008
4053
|
* Issue a request via the configured {@link RequestManager},
|
|
4009
4054
|
* inserting the response into the {@link Store.cache | cache} and handing
|
|
4010
|
-
* back a {@link Future} which resolves to a {@link ReactiveDocument | ReactiveDocument}
|
|
4055
|
+
* back a {@link Future} which resolves to a {@link ReactiveDocument | ReactiveDocument}.
|
|
4056
|
+
* Use `store.request` for anything the Store's cache should own, which is nearly all app
|
|
4057
|
+
* code; reach for {@link RequestManager.request | requestManager.request} directly only when
|
|
4058
|
+
* there is no `Store` involved, or you specifically want the unprocessed
|
|
4059
|
+
* {@link StructuredDocument}.
|
|
4060
|
+
*
|
|
4061
|
+
* #### Building Requests
|
|
4062
|
+
*
|
|
4063
|
+
* `requestConfig` can be written by hand, but for anything reused more than once prefer a
|
|
4064
|
+
* request builder — a plain function that returns the right shape for `store.request`. This
|
|
4065
|
+
* repo ships builders for common operations (`findRecord`, `query`, `createRecord`, and more)
|
|
4066
|
+
* for {json:api}, REST, and ActiveRecord-style APIs in `@warp-drive-mirror/utilities`; each builder's
|
|
4067
|
+
* return value also carries its own response type, so `RT` below is inferred automatically
|
|
4068
|
+
* instead of being written by hand. See [Builders](/guides/the-manual/requests/builders.md).
|
|
4011
4069
|
*
|
|
4012
4070
|
* #### Request Cache Keys
|
|
4013
4071
|
*
|
|
@@ -4052,6 +4110,29 @@ var Store = class extends BaseClass {
|
|
|
4052
4110
|
* is that `store.request` will convert the response into a {@link ReactiveDocument}
|
|
4053
4111
|
* containing {@link Store.instantiateRecord | ReactiveResources}.
|
|
4054
4112
|
*
|
|
4113
|
+
* A {@link ReactiveDocument} is either a {@link ReactiveDataDocument} (`content.data` holds
|
|
4114
|
+
* the resource(s)) or a {@link ReactiveErrorDocument} (`content.errors` holds the API's error
|
|
4115
|
+
* objects), depending on whether the `Future` resolves or rejects; both carry the response's
|
|
4116
|
+
* `content.meta`. Read either state reactively with {@link getRequestState} or the
|
|
4117
|
+
* `<Request />` component instead of always `await`-ing the `Future` directly — see
|
|
4118
|
+
* [Using the Response](/guides/the-manual/requests/using-the-response.md).
|
|
4119
|
+
*
|
|
4120
|
+
* #### Typing The Response
|
|
4121
|
+
*
|
|
4122
|
+
* `request<RT>` accepts an explicit type argument, but the more common path is to let it be
|
|
4123
|
+
* inferred: build the request with {@link withResponseType} (or {@link withReactiveResponse}
|
|
4124
|
+
* for the common reactive-document case), or with a builder from `@warp-drive-mirror/utilities` as
|
|
4125
|
+
* described above, and `RT` is inferred from the request object itself. See
|
|
4126
|
+
* [Typing Requests](/guides/the-manual/requests/typing-requests.md) for the full mechanism.
|
|
4127
|
+
*
|
|
4128
|
+
* @example
|
|
4129
|
+
* ```ts
|
|
4130
|
+
* import { findRecord } from '@warp-drive-mirror/utilities/json-api';
|
|
4131
|
+
*
|
|
4132
|
+
* const { content } = await store.request(findRecord('user', '1'));
|
|
4133
|
+
* content.data; // ReactiveResource, typed from the builder's response type
|
|
4134
|
+
* ```
|
|
4135
|
+
*
|
|
4055
4136
|
* @public
|
|
4056
4137
|
*/
|
|
4057
4138
|
request(requestConfig) {
|
|
@@ -4653,6 +4734,8 @@ function _convertPreloadRelationshipToJSON(value, type) {
|
|
|
4653
4734
|
* for @warp-drive-mirror/legacy/model or when wrapping schema for legacy
|
|
4654
4735
|
* Adapters/Serializers.
|
|
4655
4736
|
*
|
|
4737
|
+
* @summary Legacy shape of a Model class's static schema API (fields, attributes, relationships, iterators) used
|
|
4738
|
+
* by the legacy schema service and Adapters/Serializers.
|
|
4656
4739
|
*/
|
|
4657
4740
|
function _resourceIsFullDeleted(identifier, cache) {
|
|
4658
4741
|
return cache.isDeletionCommitted(identifier) || cache.isNew(identifier) && cache.isDeleted(identifier);
|
|
@@ -5108,10 +5191,16 @@ function getPriority(identifier, deduped, priority) {
|
|
|
5108
5191
|
/**
|
|
5109
5192
|
* The request shape accepted by {@link Store.request}, either a fully-formed
|
|
5110
5193
|
* {@link ImmutableRequestInfo} or the looser {@link LooseStoreRequestInfo}.
|
|
5194
|
+
*
|
|
5195
|
+
* @summary The request object `store.request` accepts, either a full immutable request info or a looser
|
|
5196
|
+
* form with plain `records` and `headers`.
|
|
5111
5197
|
*/
|
|
5112
5198
|
/**
|
|
5113
5199
|
* A CacheHandler that adds support for using an WarpDrive Cache with a RequestManager.
|
|
5114
5200
|
*
|
|
5201
|
+
* The [Caching](/guides/the-manual/caching/) guide explains how it decides whether a
|
|
5202
|
+
* request can use the cache.
|
|
5203
|
+
*
|
|
5115
5204
|
* This handler will only run when a request has supplied a `store` instance. Requests
|
|
5116
5205
|
* issued by the store via `store.request()` will automatically have the `store` instance
|
|
5117
5206
|
* attached to the request.
|
|
@@ -5147,7 +5236,10 @@ function getPriority(identifier, deduped, priority) {
|
|
|
5147
5236
|
* method: 'GET',
|
|
5148
5237
|
* [EnableHydration]: true
|
|
5149
5238
|
* });
|
|
5239
|
+
* ```
|
|
5150
5240
|
*
|
|
5241
|
+
* @summary The RequestManager cache handler that serves, dedupes, and caches store requests and returns
|
|
5242
|
+
* reactive documents when hydration is enabled.
|
|
5151
5243
|
*/
|
|
5152
5244
|
const CacheHandler = { request(context, next) {
|
|
5153
5245
|
if (!context.request.store || context.request.cacheOptions?.[SkipCache]) return next(context.request);
|
|
@@ -5441,6 +5533,7 @@ the has-many.
|
|
|
5441
5533
|
We call the record to which a relationship belongs-to the
|
|
5442
5534
|
relationship's _owner_.
|
|
5443
5535
|
|
|
5536
|
+
@summary Legacy mutable reactive array holding the related records of a legacy or linksMode has-many relationship.
|
|
5444
5537
|
@public
|
|
5445
5538
|
*/
|
|
5446
5539
|
/**
|
|
@@ -6764,10 +6857,14 @@ const Editables = /* @__PURE__ */ new Map();
|
|
|
6764
6857
|
* and a ResourceKey to transform data from the cache into a rich, reactive
|
|
6765
6858
|
* object.
|
|
6766
6859
|
*
|
|
6860
|
+
* The [ResourceSchemas](/guides/the-manual/schemas/resources/) guide shows how to
|
|
6861
|
+
* define the schema it reads.
|
|
6862
|
+
*
|
|
6767
6863
|
* This class is not directly instantiable. To use it, you should
|
|
6768
6864
|
* configure the store's `instantiateRecord` and `teardownRecord` hooks
|
|
6769
6865
|
* with the matching hooks provided by this package.
|
|
6770
6866
|
*
|
|
6867
|
+
* @summary The rich, reactive record object that presents a resource's cached data through its `ResourceSchema`.
|
|
6771
6868
|
* @hideconstructor
|
|
6772
6869
|
* @public
|
|
6773
6870
|
*/
|
|
@@ -7221,6 +7318,8 @@ function assertNeverField(identifier, field, path) {
|
|
|
7221
7318
|
* Edits to editable resources will be automatically committed if a new
|
|
7222
7319
|
* payload from the cache matches their existing value.
|
|
7223
7320
|
*
|
|
7321
|
+
* @summary Resolves with an editable copy of an immutable `ReactiveResource` so its fields can be
|
|
7322
|
+
* changed locally.
|
|
7224
7323
|
* @public
|
|
7225
7324
|
*
|
|
7226
7325
|
* @returns a promise that resolves to the editable resource
|
|
@@ -7237,6 +7336,8 @@ function checkout(resource) {
|
|
|
7237
7336
|
* approach is for either the API or a Handler to reflect saved
|
|
7238
7337
|
* changes back to update the cache.
|
|
7239
7338
|
*
|
|
7339
|
+
* @summary Forcibly makes an editable resource's local changes its new remote (immutable) state,
|
|
7340
|
+
* bypassing a save round-trip.
|
|
7240
7341
|
* @public
|
|
7241
7342
|
*/
|
|
7242
7343
|
function commit(record) {
|
|
@@ -7254,6 +7355,8 @@ function commit(record) {
|
|
|
7254
7355
|
* schema is `legacy`, matching the historical behavior of assigning initial
|
|
7255
7356
|
* properties when creating a new legacy record.
|
|
7256
7357
|
*
|
|
7358
|
+
* @summary Default store `instantiateRecord` hook that creates a `ReactiveResource` for a resource key
|
|
7359
|
+
* from its registered schema.
|
|
7257
7360
|
* @public
|
|
7258
7361
|
*/
|
|
7259
7362
|
function instantiateRecord(store, identifier, createArgs) {
|
|
@@ -7286,6 +7389,8 @@ function assertReactiveResource(record) {
|
|
|
7286
7389
|
* that `record` is a {@link ReactiveResource} and invokes its `Destroy`
|
|
7287
7390
|
* behavior.
|
|
7288
7391
|
*
|
|
7392
|
+
* @summary Default store `teardownRecord` hook that destroys a `ReactiveResource` when the store
|
|
7393
|
+
* releases it.
|
|
7289
7394
|
* @public
|
|
7290
7395
|
*/
|
|
7291
7396
|
function teardownRecord(record) {
|
|
@@ -7340,16 +7445,25 @@ _constructor[Type] = "@constructor";
|
|
|
7340
7445
|
* This should only be used for temporary migration purposes
|
|
7341
7446
|
* to the new schema system when migrating from either Model
|
|
7342
7447
|
* or ModelFragments.
|
|
7448
|
+
*
|
|
7449
|
+
* @summary Registers named methods, getters, and values to add to ReactiveResources, ReactiveObjects,
|
|
7450
|
+
* or ReactiveArrays; meant only as a temporary aid when migrating from Model or ModelFragments.
|
|
7343
7451
|
*/
|
|
7344
7452
|
/**
|
|
7345
7453
|
* Describes one feature added to a resource by a schema extension, as
|
|
7346
7454
|
* classified by {@link processExtension} from the property descriptor it
|
|
7347
7455
|
* was declared with (a method, a plain value, or a getter/setter pair).
|
|
7456
|
+
*
|
|
7457
|
+
* @summary One normalized feature of a schema extension, tagged by kind as a method, a readonly or
|
|
7458
|
+
* mutable value, or a getter/setter accessor.
|
|
7348
7459
|
*/
|
|
7349
7460
|
/**
|
|
7350
7461
|
* The result of {@link processExtension} normalizing a
|
|
7351
7462
|
* {@link CAUTION_MEGA_DANGER_ZONE_Extension} into a lookup of its features
|
|
7352
7463
|
* by name.
|
|
7464
|
+
*
|
|
7465
|
+
* @summary A registered schema extension normalized into its kind, name, and a map of its features
|
|
7466
|
+
* keyed by property name.
|
|
7353
7467
|
*/
|
|
7354
7468
|
const BannedKeys = ["constructor", "__proto__"];
|
|
7355
7469
|
function processExtension(extension) {
|
|
@@ -7449,14 +7563,19 @@ function processExtensions(schema, field, scenario, resolvedType) {
|
|
|
7449
7563
|
* Utility for constructing a ResourceSchema with the recommended
|
|
7450
7564
|
* fields for the PolarisMode experience.
|
|
7451
7565
|
*
|
|
7566
|
+
* The [ResourceSchemas](/guides/the-manual/schemas/resources/) guide shows how to
|
|
7567
|
+
* create a schema with it.
|
|
7568
|
+
*
|
|
7452
7569
|
* Using this requires registering the PolarisMode derivations
|
|
7453
7570
|
*
|
|
7454
7571
|
* ```ts
|
|
7455
|
-
* import { registerDerivations } from '@warp-drive-mirror/
|
|
7572
|
+
* import { registerDerivations } from '@warp-drive-mirror/core/reactive';
|
|
7456
7573
|
*
|
|
7457
7574
|
* registerDerivations(schema);
|
|
7458
7575
|
* ```
|
|
7459
7576
|
*
|
|
7577
|
+
* @summary Adds the default `id` identity plus `$key`, `$type`, and `constructor` derived fields to a
|
|
7578
|
+
* PolarisMode resource schema.
|
|
7460
7579
|
* @public
|
|
7461
7580
|
* @param schema
|
|
7462
7581
|
* @return {PolarisResourceSchema}
|
|
@@ -7487,6 +7606,8 @@ function withDefaults(schema) {
|
|
|
7487
7606
|
*
|
|
7488
7607
|
* `^` returns the entire identifier object.
|
|
7489
7608
|
*
|
|
7609
|
+
* @summary The `@identity` derivation, which reads a record's `id`, `lid`, `type`, or whole resource key
|
|
7610
|
+
* for use in derived fields.
|
|
7490
7611
|
* @public
|
|
7491
7612
|
*/
|
|
7492
7613
|
const fromIdentity = (record, options, key) => {
|
|
@@ -7510,9 +7631,14 @@ fromIdentity[Type] = "@identity";
|
|
|
7510
7631
|
* to use the PolarisMode defaults provided by
|
|
7511
7632
|
*
|
|
7512
7633
|
* ```ts
|
|
7513
|
-
* import { withDefaults } from '@warp-drive-mirror/
|
|
7634
|
+
* import { withDefaults } from '@warp-drive-mirror/core/reactive';
|
|
7514
7635
|
* ```
|
|
7515
7636
|
*
|
|
7637
|
+
* The [Derivations](/guides/the-manual/schemas/derivations#about-built-in-derivations)
|
|
7638
|
+
* guide explains when you need to call it.
|
|
7639
|
+
*
|
|
7640
|
+
* @summary Registers the `@identity` and `@constructor` derivations that schemas built with
|
|
7641
|
+
* `withDefaults` depend on.
|
|
7516
7642
|
* @public
|
|
7517
7643
|
*/
|
|
7518
7644
|
function registerDerivations(schema) {
|
|
@@ -7588,6 +7714,9 @@ function assertConsistentAbstractFieldShape(abstractType, fieldName, existing, i
|
|
|
7588
7714
|
* Defines how to convert a `GenericField`, `ObjectField`, or `ArrayField`
|
|
7589
7715
|
* between the raw value `T` stored in the cache and the presentation value
|
|
7590
7716
|
* `PT` exposed on the record.
|
|
7717
|
+
*
|
|
7718
|
+
* @summary A registered converter between a field's raw cache value and the value exposed on the
|
|
7719
|
+
* record, with optional default.
|
|
7591
7720
|
*/
|
|
7592
7721
|
/**
|
|
7593
7722
|
* Wraps a derivation in a new function with Derivation signature but that looks
|
|
@@ -7610,6 +7739,12 @@ function makeCachedDerivation(derivation) {
|
|
|
7610
7739
|
/**
|
|
7611
7740
|
* A SchemaService designed to work with dynamically registered schemas.
|
|
7612
7741
|
*
|
|
7742
|
+
* The [Schemas](/guides/the-manual/schemas/) guide shows how to register schemas
|
|
7743
|
+
* with it, and [Advanced Store Configuration](/guides/configuration/advanced#add-a-source-for-schema-for-your-data)
|
|
7744
|
+
* shows how to give a store one.
|
|
7745
|
+
*
|
|
7746
|
+
* @summary The default schema service, which stores resource and object schemas, traits, derivations,
|
|
7747
|
+
* transformations, hash functions and extensions registered at runtime.
|
|
7613
7748
|
* @public
|
|
7614
7749
|
*/
|
|
7615
7750
|
var SchemaService = class {
|
|
@@ -8288,6 +8423,8 @@ function mergeMap(base, toApply) {
|
|
|
8288
8423
|
* - {@link LegacyModeFieldSchema}
|
|
8289
8424
|
* - {@link PolarisModeFieldSchema}
|
|
8290
8425
|
*
|
|
8426
|
+
* @summary Schema-driven reactive records, arrays, and documents the store builds from cached data, plus the
|
|
8427
|
+
* `SchemaService` and schema types that define them.
|
|
8291
8428
|
* @module
|
|
8292
8429
|
*/
|
|
8293
8430
|
|
|
@@ -8370,6 +8507,9 @@ const ERROR_STATUS_CODE_FOR = /* @__PURE__ */ new Map([
|
|
|
8370
8507
|
* A basic Fetch Handler which converts a request into a
|
|
8371
8508
|
* `fetch` call presuming the response to be `json`.
|
|
8372
8509
|
*
|
|
8510
|
+
* The [Making Requests](/guides/the-manual/requests/#requests-do-not-need-to-use-fetch)
|
|
8511
|
+
* guide shows where it sits in the handler chain.
|
|
8512
|
+
*
|
|
8373
8513
|
* ```ts
|
|
8374
8514
|
* import { RequestManager, Fetch } from '@warp-drive-mirror/core';
|
|
8375
8515
|
*
|
|
@@ -8377,6 +8517,8 @@ const ERROR_STATUS_CODE_FOR = /* @__PURE__ */ new Map([
|
|
|
8377
8517
|
* .use([Fetch]);
|
|
8378
8518
|
* ```
|
|
8379
8519
|
*
|
|
8520
|
+
* @summary Terminal request handler that sends the request with native `fetch` and resolves with the
|
|
8521
|
+
* parsed JSON body, turning HTTP failures into errors.
|
|
8380
8522
|
* @public
|
|
8381
8523
|
* @badge Handler
|
|
8382
8524
|
*/
|
|
@@ -8506,7 +8648,8 @@ function isDict(v) {
|
|
|
8506
8648
|
* import { RequestManager } from '@warp-drive-mirror/core';
|
|
8507
8649
|
* ```
|
|
8508
8650
|
*
|
|
8509
|
-
* For complete usage guide see
|
|
8651
|
+
* For a complete usage guide see [Making Requests](/guides/the-manual/requests/), and
|
|
8652
|
+
* [Handlers](/guides/the-manual/requests/handlers) for writing the handlers it runs.
|
|
8510
8653
|
*
|
|
8511
8654
|
* ## How It Works
|
|
8512
8655
|
*
|
|
@@ -8529,11 +8672,28 @@ function isDict(v) {
|
|
|
8529
8672
|
* ```ts [Setup.ts]
|
|
8530
8673
|
* import { RequestManager, Fetch } from '@warp-drive-mirror/core';
|
|
8531
8674
|
* import { AutoCompress } from '@warp-drive-mirror/utilities/handlers';
|
|
8532
|
-
* import
|
|
8675
|
+
* import { AuthHandler } from './auth-handler';
|
|
8533
8676
|
*
|
|
8534
8677
|
* // ... create manager
|
|
8535
8678
|
* const manager = new RequestManager()
|
|
8536
|
-
* .use([
|
|
8679
|
+
* .use([AuthHandler, new AutoCompress(), Fetch]); // [!code focus]
|
|
8680
|
+
* ```
|
|
8681
|
+
*
|
|
8682
|
+
* ```ts [auth-handler.ts]
|
|
8683
|
+
* import type { Handler, NextFn } from '@warp-drive-mirror/core/request';
|
|
8684
|
+
* import type { RequestContext } from '@warp-drive-mirror/core/types/request';
|
|
8685
|
+
*
|
|
8686
|
+
* const token = '<token>';
|
|
8687
|
+
*
|
|
8688
|
+
* // adds a bearer token to every request, then passes it along
|
|
8689
|
+
* export const AuthHandler: Handler = {
|
|
8690
|
+
* request<T>(context: RequestContext, next: NextFn<T>) {
|
|
8691
|
+
* const headers = new Headers(context.request.headers);
|
|
8692
|
+
* headers.append('Authorization', `Bearer ${token}`);
|
|
8693
|
+
*
|
|
8694
|
+
* return next(Object.assign({}, context.request, { headers }));
|
|
8695
|
+
* },
|
|
8696
|
+
* };
|
|
8537
8697
|
* ```
|
|
8538
8698
|
*
|
|
8539
8699
|
* ```ts [Usage.ts]
|
|
@@ -8549,6 +8709,20 @@ function isDict(v) {
|
|
|
8549
8709
|
*
|
|
8550
8710
|
* :::
|
|
8551
8711
|
*
|
|
8712
|
+
* ### RequestManager vs {@link Store.request}
|
|
8713
|
+
*
|
|
8714
|
+
* A bare `RequestManager` is the low-level primitive: it runs a request through the configured
|
|
8715
|
+
* {@link Handler | handler chain} and settles with the raw {@link StructuredDocument}. It has no
|
|
8716
|
+
* cache and does not hydrate {@link ReactiveDocument | ReactiveDocuments} unless you register a
|
|
8717
|
+
* cache handler yourself via {@link RequestManager.useCache} and the request opts in.
|
|
8718
|
+
*
|
|
8719
|
+
* {@link Store.request} issues requests through this same `RequestManager`, but with the Store's
|
|
8720
|
+
* cache handler and hydration already wired up — inserting the response into the Store's cache
|
|
8721
|
+
* and resolving with a `ReactiveDocument` instead. Use `store.request` for anything the Store's
|
|
8722
|
+
* cache should own, which is nearly all app code. Reach for `requestManager.request` directly
|
|
8723
|
+
* only when there is no {@link Store} involved, or you specifically want the unprocessed
|
|
8724
|
+
* `StructuredDocument`.
|
|
8725
|
+
*
|
|
8552
8726
|
* ### Futures
|
|
8553
8727
|
*
|
|
8554
8728
|
* The return value of `manager.request` is a `Future`, which allows
|
|
@@ -8587,6 +8761,7 @@ function isDict(v) {
|
|
|
8587
8761
|
* type StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument;
|
|
8588
8762
|
* ```
|
|
8589
8763
|
*
|
|
8764
|
+
* @summary Runs each request through a chain of handlers that can fulfill, modify, or pass it along, and returns a `Future` for the response.
|
|
8590
8765
|
* @public
|
|
8591
8766
|
*/
|
|
8592
8767
|
var RequestManager = class {
|
|
@@ -8646,7 +8821,23 @@ var RequestManager = class {
|
|
|
8646
8821
|
/**
|
|
8647
8822
|
* Issue a Request.
|
|
8648
8823
|
*
|
|
8649
|
-
*
|
|
8824
|
+
* Runs `request` through the configured {@link Handler | handler chain} and settles with the
|
|
8825
|
+
* {@link StructuredDocument} the chain produces — a plain `{ request, response, content }`
|
|
8826
|
+
* object, not a {@link ReactiveDocument}. Caching and hydration only happen if a cache handler
|
|
8827
|
+
* has been registered via {@link RequestManager.useCache} and the request opts in; a
|
|
8828
|
+
* `RequestManager` created on its own has neither.
|
|
8829
|
+
*
|
|
8830
|
+
* Most app code should use {@link Store.request} instead, which calls this same method with
|
|
8831
|
+
* the Store's cache handler and hydration already configured. Reach for `requestManager.request`
|
|
8832
|
+
* directly when there is no {@link Store} involved, or when you want the unprocessed
|
|
8833
|
+
* `StructuredDocument`. The `<RT>` generic can be set explicitly or inferred from a request
|
|
8834
|
+
* built with {@link withResponseType} or {@link withReactiveResponse} — see
|
|
8835
|
+
* [Typing Requests](/guides/the-manual/requests/typing-requests.md).
|
|
8836
|
+
*
|
|
8837
|
+
* @example
|
|
8838
|
+
* ```ts
|
|
8839
|
+
* const { content } = await requestManager.request({ url: '/users' });
|
|
8840
|
+
* ```
|
|
8650
8841
|
*
|
|
8651
8842
|
* @public
|
|
8652
8843
|
*/
|
|
@@ -8730,6 +8921,8 @@ var RequestManager = class {
|
|
|
8730
8921
|
//#endregion
|
|
8731
8922
|
//#region src/index.ts
|
|
8732
8923
|
/**
|
|
8924
|
+
* @summary Main entry point for WarpDrive: the `Store`, `RequestManager`, `Fetch` handler, `CacheHandler`, and
|
|
8925
|
+
* `useRecommendedStore` for building a configured store.
|
|
8733
8926
|
* @module
|
|
8734
8927
|
* @mergeModuleWith <project>
|
|
8735
8928
|
*/
|
|
@@ -8738,11 +8931,17 @@ globalThis.getWarpDriveRuntimeConfig = getRuntimeConfig;
|
|
|
8738
8931
|
globalThis.setWarpDriveIsMaybeMirage = setIsMaybeMirage;
|
|
8739
8932
|
/**
|
|
8740
8933
|
* Options for setting up a Store instance with `useRecommendedStore`.
|
|
8934
|
+
*
|
|
8935
|
+
* @summary Configures the cache, cache policy, request handlers, schemas, and schema extensions that
|
|
8936
|
+
* `useRecommendedStore` wires into a Store class.
|
|
8741
8937
|
*/
|
|
8742
8938
|
/**
|
|
8743
8939
|
* Creates a configured Store class with recommended defaults
|
|
8744
8940
|
* for schema handling, reactivity, caching, and request management.
|
|
8745
8941
|
*
|
|
8942
|
+
* The [Setup](/guides/configuration/#configure-the-store) guide walks through
|
|
8943
|
+
* configuring the store with it.
|
|
8944
|
+
*
|
|
8746
8945
|
* ```ts
|
|
8747
8946
|
* import { useRecommendedStore } from '@warp-drive-mirror/core';
|
|
8748
8947
|
* import { JSONAPICache } from '@warp-drive-mirror/json-api';
|
|
@@ -8845,6 +9044,9 @@ globalThis.setWarpDriveIsMaybeMirage = setIsMaybeMirage;
|
|
|
8845
9044
|
* {@link RequestManager} won't have it set unless the caller supplies it
|
|
8846
9045
|
* explicitly, so a handler relying on it should treat it as optional (as
|
|
8847
9046
|
* `LoggingHandler` does above).
|
|
9047
|
+
*
|
|
9048
|
+
* @summary Builds a Store subclass preconfigured with the given cache, schemas, and handlers, plus
|
|
9049
|
+
* `Fetch`, `CacheHandler`, and a default cache policy.
|
|
8848
9050
|
*/
|
|
8849
9051
|
function useRecommendedStore(options, StoreKlass = Store) {
|
|
8850
9052
|
return class AppStore extends StoreKlass {
|
|
@@ -8900,4 +9102,4 @@ function useRecommendedStore(options, StoreKlass = Store) {
|
|
|
8900
9102
|
|
|
8901
9103
|
//#endregion
|
|
8902
9104
|
export { setIdentifierGenerationMethod as A, setRecordIdentifier as C, isRequestKey as D, fieldValueIdentity as E, coerceId as F, ensureStringId as I, log as L, setIdentifierUpdateMethod as M, setKeyInfoForResource as N, isResourceKey as O, normalizeModelName as P, logGroup as R, recordIdentifierFor as S, assertPrivateCapabilities as T, isPrivateStore as _, fromIdentity as a, StoreMap as b, instantiateRecord as c, commit as d, createLegacyManyArray as f, assertPrivateStore as g, Store as h, SchemaService as i, setIdentifierResetMethod as j, setIdentifierForgetMethod as k, teardownRecord as l, CacheHandler as m, RequestManager as n, registerDerivations as o, constructResource as p, Fetch as r, withDefaults as s, useRecommendedStore as t, checkout as u, RecordArrayManager as v, storeFor as w, _clearCaches as x, fastPush as y };
|
|
8903
|
-
//# sourceMappingURL=src-
|
|
9105
|
+
//# sourceMappingURL=src-Isk_Je7q.js.map
|