@warp-drive-mirror/core 5.10.0-alpha.12 → 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 +32 -0
- 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-CnlWuUd5.d.ts → fields-D6173Q_a.d.ts} +126 -5
- 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-DBnp5uP6.d.ts → internal-CgOlgOt3.d.ts} +496 -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-B9WcEdYg.js → src-DlNeupkA.js} +221 -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-CkkrRFE1.js → src-FSk0Z_Lp.js} +212 -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-oz6OaQXu.js → src-Isk_Je7q.js} +214 -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-BGKCOL5L.js → src-CoSpuocQ.js} +212 -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-CGypdIsf.js → src-FK_rMde5.js} +214 -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-CnlWuUd5.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-DBnp5uP6.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-B9WcEdYg.js.map +0 -1
- package/dist/store-DNF9Rgoh.js.map +0 -1
- package/dist/symbols-DjRDCeX0.d.ts.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-CkkrRFE1.js.map +0 -1
- package/dist/unpkg/dev/store-BIFNM_fB.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-oz6OaQXu.js.map +0 -1
- package/dist/unpkg/dev-deprecated/store-X1WN7P_O.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-BGKCOL5L.js.map +0 -1
- package/dist/unpkg/prod/store-BWhmb7Ob.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-CGypdIsf.js.map +0 -1
- package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +0 -1
- package/dist/utils-BtURiy8l.d.ts.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { c as RequestKey, l as ResourceKey, n as CacheKeyType, s as PersistedResourceKey } from "./identifier-
|
|
2
|
-
import { t as QueryParamsSerializationOptions } from "./params-
|
|
3
|
-
import { a as Type, n as RequestSignature } from "./symbols-
|
|
4
|
-
import { c as TypedRecordInstance, i as OpaqueRecordInstance$1, o as TypeFromInstance, s as TypeFromInstanceOrString } from "./record-
|
|
5
|
-
import { i as Value, n as ObjectValue } from "./raw-
|
|
6
|
-
import { a as ExistingResourceObject, d as Meta, g as ResourceIdentifierObject, i as ExistingResourceIdentifierObject, m as PaginationLinks, r as EmptyResourceDocument, s as JsonApiDocument, t as CollectionResourceDocument, u as Links, y as SingleResourceDocument } from "./json-api-raw-
|
|
7
|
-
import { A as ResourceField, C as ObjectField, F as Trait, M as Schema, N as SchemaArrayField, O as PolarisResourceSchema, P as SchemaObjectField, T as ObjectSchema, a as DerivedField, b as LinksModeHasManyField, c as HashField, d as LegacyAttributeField, f as LegacyBelongsToField, g as LegacyRelationshipField, i as CollectionField, j as ResourceSchema, l as IdentityField, m as LegacyHasManyField, o as FieldSchema, r as CacheableFieldSchema, s as GenericField, t as ArrayField } from "./fields-
|
|
8
|
-
import { n as HashFn, r as Transformation$1, t as Derivation } from "./concepts-
|
|
9
|
-
import { n as WithPartial } from "./utils-
|
|
10
|
-
import { t as ResourceBlob } from "./aliases-
|
|
11
|
-
import { t as Change } from "./change-
|
|
12
|
-
import { n as Mutation } from "./mutations-
|
|
13
|
-
import { r as ResourceRelationship, t as CollectionRelationship } from "./relationship-
|
|
14
|
-
import { i as MergeOperation, o as Operation$1 } from "./operations-
|
|
15
|
-
import { t as ApiError } from "./error-
|
|
16
|
-
import { o as SingleResourceDataDocument, r as ResourceDocument, t as CollectionResourceDataDocument } from "./document-
|
|
17
|
-
import { i as RemoteRelationshipOperation, n as LocalRelationshipOperation, t as DeleteRecordOperation } from "./graph-
|
|
18
|
-
import { i as SignalRef, t as ARRAY_SIGNAL } from "./configure-
|
|
1
|
+
import { c as RequestKey, l as ResourceKey, n as CacheKeyType, s as PersistedResourceKey } from "./identifier-B_tK3FUw.js";
|
|
2
|
+
import { t as QueryParamsSerializationOptions } from "./params-dbHiSOMF.js";
|
|
3
|
+
import { a as Type, n as RequestSignature } from "./symbols-Cu9un1NR.js";
|
|
4
|
+
import { c as TypedRecordInstance, i as OpaqueRecordInstance$1, o as TypeFromInstance, s as TypeFromInstanceOrString } from "./record-DDxPtzcY.js";
|
|
5
|
+
import { i as Value, n as ObjectValue } from "./raw-CiC64nCY.js";
|
|
6
|
+
import { a as ExistingResourceObject, d as Meta, g as ResourceIdentifierObject, i as ExistingResourceIdentifierObject, m as PaginationLinks, r as EmptyResourceDocument, s as JsonApiDocument, t as CollectionResourceDocument, u as Links, y as SingleResourceDocument } from "./json-api-raw-BxzNsCg0.js";
|
|
7
|
+
import { A as ResourceField, C as ObjectField, F as Trait, M as Schema, N as SchemaArrayField, O as PolarisResourceSchema, P as SchemaObjectField, T as ObjectSchema, a as DerivedField, b as LinksModeHasManyField, c as HashField, d as LegacyAttributeField, f as LegacyBelongsToField, g as LegacyRelationshipField, i as CollectionField, j as ResourceSchema, l as IdentityField, m as LegacyHasManyField, o as FieldSchema, r as CacheableFieldSchema, s as GenericField, t as ArrayField } from "./fields-D6173Q_a.js";
|
|
8
|
+
import { n as HashFn, r as Transformation$1, t as Derivation } from "./concepts-DzuY5M1K.js";
|
|
9
|
+
import { n as WithPartial } from "./utils-CNmQoKm8.js";
|
|
10
|
+
import { t as ResourceBlob } from "./aliases-BQmAxXmb.js";
|
|
11
|
+
import { t as Change } from "./change-DClXcHvr.js";
|
|
12
|
+
import { n as Mutation } from "./mutations-C81gbYjB.js";
|
|
13
|
+
import { r as ResourceRelationship, t as CollectionRelationship } from "./relationship-BlGIXgj4.js";
|
|
14
|
+
import { i as MergeOperation, o as Operation$1 } from "./operations-B4pQM7D6.js";
|
|
15
|
+
import { t as ApiError } from "./error-APuUdUGk.js";
|
|
16
|
+
import { o as SingleResourceDataDocument, r as ResourceDocument, t as CollectionResourceDataDocument } from "./document-Ni8Ns26t.js";
|
|
17
|
+
import { i as RemoteRelationshipOperation, n as LocalRelationshipOperation, t as DeleteRecordOperation } from "./graph-rjTyJ-gd.js";
|
|
18
|
+
import { i as SignalRef, t as ARRAY_SIGNAL } from "./configure-CjsojjiI.js";
|
|
19
19
|
//#region src/request/-private/manager.d.ts
|
|
20
20
|
/**
|
|
21
21
|
* ## Import
|
|
@@ -24,7 +24,8 @@ import { i as SignalRef, t as ARRAY_SIGNAL } from "./configure-B_F639tN.js";
|
|
|
24
24
|
* import { RequestManager } from '@warp-drive-mirror/core';
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
|
-
* For complete usage guide see
|
|
27
|
+
* For a complete usage guide see [Making Requests](/guides/the-manual/requests/), and
|
|
28
|
+
* [Handlers](/guides/the-manual/requests/handlers) for writing the handlers it runs.
|
|
28
29
|
*
|
|
29
30
|
* ## How It Works
|
|
30
31
|
*
|
|
@@ -47,11 +48,28 @@ import { i as SignalRef, t as ARRAY_SIGNAL } from "./configure-B_F639tN.js";
|
|
|
47
48
|
* ```ts [Setup.ts]
|
|
48
49
|
* import { RequestManager, Fetch } from '@warp-drive-mirror/core';
|
|
49
50
|
* import { AutoCompress } from '@warp-drive-mirror/utilities/handlers';
|
|
50
|
-
* import
|
|
51
|
+
* import { AuthHandler } from './auth-handler';
|
|
51
52
|
*
|
|
52
53
|
* // ... create manager
|
|
53
54
|
* const manager = new RequestManager()
|
|
54
|
-
* .use([
|
|
55
|
+
* .use([AuthHandler, new AutoCompress(), Fetch]); // [!code focus]
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* ```ts [auth-handler.ts]
|
|
59
|
+
* import type { Handler, NextFn } from '@warp-drive-mirror/core/request';
|
|
60
|
+
* import type { RequestContext } from '@warp-drive-mirror/core/types/request';
|
|
61
|
+
*
|
|
62
|
+
* const token = '<token>';
|
|
63
|
+
*
|
|
64
|
+
* // adds a bearer token to every request, then passes it along
|
|
65
|
+
* export const AuthHandler: Handler = {
|
|
66
|
+
* request<T>(context: RequestContext, next: NextFn<T>) {
|
|
67
|
+
* const headers = new Headers(context.request.headers);
|
|
68
|
+
* headers.append('Authorization', `Bearer ${token}`);
|
|
69
|
+
*
|
|
70
|
+
* return next(Object.assign({}, context.request, { headers }));
|
|
71
|
+
* },
|
|
72
|
+
* };
|
|
55
73
|
* ```
|
|
56
74
|
*
|
|
57
75
|
* ```ts [Usage.ts]
|
|
@@ -67,6 +85,20 @@ import { i as SignalRef, t as ARRAY_SIGNAL } from "./configure-B_F639tN.js";
|
|
|
67
85
|
*
|
|
68
86
|
* :::
|
|
69
87
|
*
|
|
88
|
+
* ### RequestManager vs {@link Store.request}
|
|
89
|
+
*
|
|
90
|
+
* A bare `RequestManager` is the low-level primitive: it runs a request through the configured
|
|
91
|
+
* {@link Handler | handler chain} and settles with the raw {@link StructuredDocument}. It has no
|
|
92
|
+
* cache and does not hydrate {@link ReactiveDocument | ReactiveDocuments} unless you register a
|
|
93
|
+
* cache handler yourself via {@link RequestManager.useCache} and the request opts in.
|
|
94
|
+
*
|
|
95
|
+
* {@link Store.request} issues requests through this same `RequestManager`, but with the Store's
|
|
96
|
+
* cache handler and hydration already wired up — inserting the response into the Store's cache
|
|
97
|
+
* and resolving with a `ReactiveDocument` instead. Use `store.request` for anything the Store's
|
|
98
|
+
* cache should own, which is nearly all app code. Reach for `requestManager.request` directly
|
|
99
|
+
* only when there is no {@link Store} involved, or you specifically want the unprocessed
|
|
100
|
+
* `StructuredDocument`.
|
|
101
|
+
*
|
|
70
102
|
* ### Futures
|
|
71
103
|
*
|
|
72
104
|
* The return value of `manager.request` is a `Future`, which allows
|
|
@@ -135,7 +167,23 @@ declare class RequestManager {
|
|
|
135
167
|
/**
|
|
136
168
|
* Issue a Request.
|
|
137
169
|
*
|
|
138
|
-
*
|
|
170
|
+
* Runs `request` through the configured {@link Handler | handler chain} and settles with the
|
|
171
|
+
* {@link StructuredDocument} the chain produces — a plain `{ request, response, content }`
|
|
172
|
+
* object, not a {@link ReactiveDocument}. Caching and hydration only happen if a cache handler
|
|
173
|
+
* has been registered via {@link RequestManager.useCache} and the request opts in; a
|
|
174
|
+
* `RequestManager` created on its own has neither.
|
|
175
|
+
*
|
|
176
|
+
* Most app code should use {@link Store.request} instead, which calls this same method with
|
|
177
|
+
* the Store's cache handler and hydration already configured. Reach for `requestManager.request`
|
|
178
|
+
* directly when there is no {@link Store} involved, or when you want the unprocessed
|
|
179
|
+
* `StructuredDocument`. The `<RT>` generic can be set explicitly or inferred from a request
|
|
180
|
+
* built with {@link withResponseType} or {@link withReactiveResponse} — see
|
|
181
|
+
* [Typing Requests](/guides/the-manual/requests/typing-requests.md).
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* const { content } = await requestManager.request({ url: '/users' });
|
|
186
|
+
* ```
|
|
139
187
|
*
|
|
140
188
|
* @public
|
|
141
189
|
*/
|
|
@@ -188,6 +236,8 @@ interface GodContext {
|
|
|
188
236
|
* allowing the promise to be created before the work that will settle it
|
|
189
237
|
* has begun. See {@link createDeferred}.
|
|
190
238
|
*
|
|
239
|
+
* @summary A promise bundled with the `resolve` and `reject` callbacks that settle it, as returned by
|
|
240
|
+
* `createDeferred`.
|
|
191
241
|
* @public
|
|
192
242
|
*/
|
|
193
243
|
type Deferred<T> = {
|
|
@@ -204,6 +254,8 @@ type Deferred<T> = {
|
|
|
204
254
|
* background reload that other requests may dedupe against without
|
|
205
255
|
* waiting on it.
|
|
206
256
|
*
|
|
257
|
+
* @summary Marks whether a deduped managed request blocks its caller's promise or runs as a
|
|
258
|
+
* non-blocking background reload.
|
|
207
259
|
* @public
|
|
208
260
|
*/
|
|
209
261
|
type ManagedRequestPriority = {
|
|
@@ -222,6 +274,11 @@ type DeferredStream = {
|
|
|
222
274
|
* while providing the ability to {@link Future.abort | abort} the underlying request, and
|
|
223
275
|
* {@link Future.getStream | access the response stream} before the outer promise resolves;
|
|
224
276
|
*
|
|
277
|
+
* The [Using The Response](/guides/the-manual/requests/using-the-response) guide shows
|
|
278
|
+
* how to work with one.
|
|
279
|
+
*
|
|
280
|
+
* @summary The promise returned for every request, resolving with the response document and able to
|
|
281
|
+
* abort the request or expose its response stream early.
|
|
225
282
|
* @public
|
|
226
283
|
*/
|
|
227
284
|
interface Future<T> extends Promise<StructuredDataDocument<T>> {
|
|
@@ -279,6 +336,10 @@ interface Future<T> extends Promise<StructuredDataDocument<T>> {
|
|
|
279
336
|
* used to forward a request to the next handler in the chain. Resolves to a
|
|
280
337
|
* {@link Future} carrying the downstream response.
|
|
281
338
|
*
|
|
339
|
+
* The [Handlers](/guides/the-manual/requests/handlers) guide shows a handler calling it.
|
|
340
|
+
*
|
|
341
|
+
* @summary The function a request handler calls to pass a request to the next handler in the chain,
|
|
342
|
+
* returning a `Future` for its response.
|
|
282
343
|
* @public
|
|
283
344
|
*/
|
|
284
345
|
type NextFn<P = unknown> = (req: RequestInfo) => Future<P>;
|
|
@@ -287,6 +348,8 @@ type NextFn<P = unknown> = (req: RequestInfo) => Future<P>;
|
|
|
287
348
|
as well as a `next` function with which to pass along a request to the next
|
|
288
349
|
handler if it so chooses.
|
|
289
350
|
|
|
351
|
+
The [Handlers](/guides/the-manual/requests/handlers) guide walks through writing one.
|
|
352
|
+
|
|
290
353
|
A handler may be any object with a `request` method. This allows both stateful and non-stateful
|
|
291
354
|
handlers to be utilized.
|
|
292
355
|
|
|
@@ -389,6 +452,8 @@ const manager = new RequestManager()
|
|
|
389
452
|
|
|
390
453
|
Handlers will be invoked in the order they are registered ("fifo", first-in first-out), and may only be registered up until the first request is made. It is recommended but not required to register all handlers at one time in order to ensure explicitly visible handler ordering.
|
|
391
454
|
|
|
455
|
+
@summary An object with a `request` method that a RequestManager calls to fulfill a request, either
|
|
456
|
+
itself or by calling `next` to pass it along.
|
|
392
457
|
@public
|
|
393
458
|
*/
|
|
394
459
|
interface Handler {
|
|
@@ -409,6 +474,8 @@ interface Handler {
|
|
|
409
474
|
* A RequestManager may only have one CacheHandler, registered via
|
|
410
475
|
* `manager.useCache(CacheHandler)`.
|
|
411
476
|
*
|
|
477
|
+
* @summary The single handler a RequestManager runs before all others via `useCache`, which may return
|
|
478
|
+
* a result synchronously.
|
|
412
479
|
* @public
|
|
413
480
|
*/
|
|
414
481
|
interface CacheHandler$1 {
|
|
@@ -453,6 +520,8 @@ declare class ContextOwner {
|
|
|
453
520
|
* {@link StructuredDataDocument} that will ultimately be returned by the
|
|
454
521
|
* {@link RequestManager}.
|
|
455
522
|
*
|
|
523
|
+
* @summary The per-request object passed to each handler, exposing the immutable request plus methods to
|
|
524
|
+
* set the response, stream, and request key.
|
|
456
525
|
* @public
|
|
457
526
|
*/
|
|
458
527
|
declare class Context$1 {
|
|
@@ -518,6 +587,9 @@ declare const IS_CACHE_HANDLER: "___(unique) Symbol(IS_CACHE_HANDLER)";
|
|
|
518
587
|
* Else it extends from {@link AggregateError} if the
|
|
519
588
|
* response includes an array of errors, falling back
|
|
520
589
|
* to {@link Error} as its base.
|
|
590
|
+
*
|
|
591
|
+
* @summary The shape of errors thrown by the Fetch handler for failed, aborted, or network-errored
|
|
592
|
+
* requests, carrying the HTTP `status` and `statusText`.
|
|
521
593
|
*/
|
|
522
594
|
interface FetchError extends DOMException {
|
|
523
595
|
/**
|
|
@@ -563,12 +635,18 @@ interface FetchError extends DOMException {
|
|
|
563
635
|
* A {@link RequestInfo.cacheOptions | cacheOptions} flag which, when set,
|
|
564
636
|
* signals that a request should never be handled by the cache-manager and
|
|
565
637
|
* thus will never resolve from cache nor update the cache.
|
|
638
|
+
*
|
|
639
|
+
* @summary Symbol key for a request's `cacheOptions` that, when true, makes the request bypass the CacheHandler so it
|
|
640
|
+
* neither resolves from nor updates the cache.
|
|
566
641
|
*/
|
|
567
642
|
declare const SkipCache: "___(unique) Symbol(SkipCache)";
|
|
568
643
|
/**
|
|
569
644
|
* A {@link RequestInfo} flag which, when set, signals to the store's
|
|
570
645
|
* `instantiateRecord` hook that the resolved content should be hydrated
|
|
571
646
|
* into reactive records rather than returned as raw data.
|
|
647
|
+
*
|
|
648
|
+
* @summary Symbol flag on a request that makes the CacheHandler return reactive records instead of raw cache
|
|
649
|
+
* documents; `store.request` sets it automatically.
|
|
572
650
|
*/
|
|
573
651
|
declare const EnableHydration: "___(unique) Symbol(EnableHydration)";
|
|
574
652
|
/**
|
|
@@ -581,12 +659,16 @@ declare const IS_FUTURE: "___(unique) Symbol(IS_FUTURE)";
|
|
|
581
659
|
declare const STRUCTURED: "___(unique) Symbol(DOC)";
|
|
582
660
|
/**
|
|
583
661
|
* The HTTP methods WarpDrive's request layer supports.
|
|
662
|
+
*
|
|
663
|
+
* @summary Union of the HTTP method strings, including `QUERY`, that a WarpDrive request's `method` may be set to.
|
|
584
664
|
*/
|
|
585
665
|
type HTTPMethod = "QUERY" | "GET" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "CONNECT" | "TRACE";
|
|
586
666
|
/**
|
|
587
667
|
* Use these options to adjust {@link CacheHandler} behavior for a request
|
|
588
668
|
* via {@link RequestInfo.cacheOptions}.
|
|
589
669
|
*
|
|
670
|
+
* @summary Per-request settings on `cacheOptions` that control the cache key, forced or background reloads,
|
|
671
|
+
* invalidation by resource type, and cache bypass.
|
|
590
672
|
*/
|
|
591
673
|
interface CacheOptions {
|
|
592
674
|
/**
|
|
@@ -636,6 +718,9 @@ interface CacheOptions {
|
|
|
636
718
|
/**
|
|
637
719
|
* The request shape produced by the `findRecord` request builders, for
|
|
638
720
|
* use with {@link Store.request}.
|
|
721
|
+
*
|
|
722
|
+
* @summary Shape of the `GET` request object that `findRecord` builders return for `store.request`, carrying the url,
|
|
723
|
+
* headers, and requested resource identifier.
|
|
639
724
|
*/
|
|
640
725
|
type FindRecordRequestOptions<RT = unknown, T = unknown> = {
|
|
641
726
|
/**
|
|
@@ -670,6 +755,9 @@ type FindRecordRequestOptions<RT = unknown, T = unknown> = {
|
|
|
670
755
|
/**
|
|
671
756
|
* The request shape produced by the `query` request builders, for
|
|
672
757
|
* use with {@link Store.request}.
|
|
758
|
+
*
|
|
759
|
+
* @summary Shape of the `GET` request object that `query` builders return for `store.request`, carrying the url,
|
|
760
|
+
* headers, and cache options.
|
|
673
761
|
*/
|
|
674
762
|
type QueryRequestOptions<RT = unknown> = {
|
|
675
763
|
/**
|
|
@@ -700,6 +788,9 @@ type QueryRequestOptions<RT = unknown> = {
|
|
|
700
788
|
/**
|
|
701
789
|
* The request shape produced by the `postQuery` request builders, for
|
|
702
790
|
* use with {@link Store.request}.
|
|
791
|
+
*
|
|
792
|
+
* @summary Shape of the `POST` or `QUERY` request object that `postQuery` builders return, with a body and a required
|
|
793
|
+
* cache key since the url cannot serve as one.
|
|
703
794
|
*/
|
|
704
795
|
type PostQueryRequestOptions<RT = unknown> = {
|
|
705
796
|
/**
|
|
@@ -740,6 +831,9 @@ type PostQueryRequestOptions<RT = unknown> = {
|
|
|
740
831
|
/**
|
|
741
832
|
* The request shape produced by the `deleteRecord` request builders, for
|
|
742
833
|
* use with {@link Store.request}.
|
|
834
|
+
*
|
|
835
|
+
* @summary Shape of the `DELETE` request object that `deleteRecord` builders return for `store.request`, identifying
|
|
836
|
+
* the resource being deleted.
|
|
743
837
|
*/
|
|
744
838
|
type DeleteRequestOptions<RT = unknown, T = unknown> = {
|
|
745
839
|
/**
|
|
@@ -787,6 +881,9 @@ type ImmutableRequest<T> = Readonly<T> & {
|
|
|
787
881
|
/**
|
|
788
882
|
* The request shape produced by the `updateRecord` request builders, for
|
|
789
883
|
* use with {@link Store.request}.
|
|
884
|
+
*
|
|
885
|
+
* @summary Shape of the `PATCH` or `PUT` request object that `updateRecord` builders return for `store.request`,
|
|
886
|
+
* identifying the resource being saved.
|
|
790
887
|
*/
|
|
791
888
|
type UpdateRequestOptions<RT = unknown, T = unknown> = {
|
|
792
889
|
/**
|
|
@@ -830,6 +927,9 @@ type UpdateRequestOptions<RT = unknown, T = unknown> = {
|
|
|
830
927
|
/**
|
|
831
928
|
* The request shape produced by the `createRecord` request builders, for
|
|
832
929
|
* use with {@link Store.request}.
|
|
930
|
+
*
|
|
931
|
+
* @summary Shape of the `POST` request object that `createRecord` builders return for `store.request`, identifying the
|
|
932
|
+
* new resource being saved.
|
|
833
933
|
*/
|
|
834
934
|
type CreateRequestOptions<RT = unknown, T = unknown> = {
|
|
835
935
|
/**
|
|
@@ -872,19 +972,31 @@ type CreateRequestOptions<RT = unknown, T = unknown> = {
|
|
|
872
972
|
};
|
|
873
973
|
/**
|
|
874
974
|
* The immutable, handler-facing form of {@link DeleteRequestOptions}.
|
|
975
|
+
*
|
|
976
|
+
* @summary Read-only view of a `deleteRecord` request as a handler receives it, with immutable headers and `records`
|
|
977
|
+
* as resource keys.
|
|
875
978
|
*/
|
|
876
979
|
type ImmutableDeleteRequestOptions = ImmutableRequest<DeleteRequestOptions>;
|
|
877
980
|
/**
|
|
878
981
|
* The immutable, handler-facing form of {@link UpdateRequestOptions}.
|
|
982
|
+
*
|
|
983
|
+
* @summary Read-only view of an `updateRecord` request as a handler receives it, with immutable headers and `records`
|
|
984
|
+
* as resource keys.
|
|
879
985
|
*/
|
|
880
986
|
type ImmutableUpdateRequestOptions = ImmutableRequest<UpdateRequestOptions>;
|
|
881
987
|
/**
|
|
882
988
|
* The immutable, handler-facing form of {@link CreateRequestOptions}.
|
|
989
|
+
*
|
|
990
|
+
* @summary Read-only view of a `createRecord` request as a handler receives it, with immutable headers and `records`
|
|
991
|
+
* as resource keys.
|
|
883
992
|
*/
|
|
884
993
|
type ImmutableCreateRequestOptions = ImmutableRequest<CreateRequestOptions>;
|
|
885
994
|
/**
|
|
886
995
|
* A minimal reference to a resource sufficient to build a URL for it,
|
|
887
996
|
* as accepted by the request builders.
|
|
997
|
+
*
|
|
998
|
+
* @summary A resource reference with a persisted `id` and `type` and an optional `lid`, which is enough for request
|
|
999
|
+
* builders to construct its url.
|
|
888
1000
|
*/
|
|
889
1001
|
type RemotelyAccessibleIdentifier<T extends string = string> = {
|
|
890
1002
|
/**
|
|
@@ -903,6 +1015,9 @@ type RemotelyAccessibleIdentifier<T extends string = string> = {
|
|
|
903
1015
|
/**
|
|
904
1016
|
* Options accepted by the request builders for constraining how a
|
|
905
1017
|
* request's url is constructed and how the request interacts with the cache.
|
|
1018
|
+
*
|
|
1019
|
+
* @summary Options the request builders accept to set reload behavior and override the url's host, namespace, resource
|
|
1020
|
+
* path, and query param serialization.
|
|
906
1021
|
*/
|
|
907
1022
|
interface ConstrainedRequestOptions {
|
|
908
1023
|
/**
|
|
@@ -937,6 +1052,9 @@ interface ConstrainedRequestOptions {
|
|
|
937
1052
|
}
|
|
938
1053
|
/**
|
|
939
1054
|
* Options accepted by the `findRecord` request builders.
|
|
1055
|
+
*
|
|
1056
|
+
* @summary Options the `findRecord` request builders accept: the shared url and reload options plus the relationship
|
|
1057
|
+
* paths to `include`.
|
|
940
1058
|
*/
|
|
941
1059
|
interface FindRecordOptions$2 extends ConstrainedRequestOptions {
|
|
942
1060
|
/**
|
|
@@ -949,6 +1067,9 @@ interface FindRecordOptions$2 extends ConstrainedRequestOptions {
|
|
|
949
1067
|
* containing the original {@link RequestInfo | request},
|
|
950
1068
|
* the {@link Response | response} set by the handler chain (if any), and
|
|
951
1069
|
* the processed content.
|
|
1070
|
+
*
|
|
1071
|
+
* @summary The `{ request, response, content }` object that a request's `Future` resolves with when the request
|
|
1072
|
+
* succeeds.
|
|
952
1073
|
*/
|
|
953
1074
|
interface StructuredDataDocument<T> {
|
|
954
1075
|
/**
|
|
@@ -976,6 +1097,9 @@ interface StructuredDataDocument<T> {
|
|
|
976
1097
|
*
|
|
977
1098
|
* If using the error originates from the {@link Fetch | Fetch Handler}
|
|
978
1099
|
* the error will be a {@link FetchError}
|
|
1100
|
+
*
|
|
1101
|
+
* @summary The Error a request's `Future` rejects with when the request fails, carrying the `request`, `response`,
|
|
1102
|
+
* `error`, and any `content` received.
|
|
979
1103
|
*/
|
|
980
1104
|
interface StructuredErrorDocument<T = unknown> extends Error {
|
|
981
1105
|
/**
|
|
@@ -1003,11 +1127,16 @@ interface StructuredErrorDocument<T = unknown> extends Error {
|
|
|
1003
1127
|
* A union of the resolve/reject data types for the {@link Future}
|
|
1004
1128
|
* returned by {@link Store.request | request}
|
|
1005
1129
|
*
|
|
1130
|
+
* The [Using The Response](/guides/the-manual/requests/using-the-response) guide shows
|
|
1131
|
+
* how to read one.
|
|
1132
|
+
*
|
|
1006
1133
|
* See also the docs for:
|
|
1007
1134
|
*
|
|
1008
1135
|
* - {@link Future}
|
|
1009
1136
|
* - {@link StructuredDataDocument} (resolved/successful requests)
|
|
1010
1137
|
* - {@link StructuredErrorDocument} (rejected/failed requests)
|
|
1138
|
+
*
|
|
1139
|
+
* @summary Union of the success and error documents that a request's `Future` resolves or rejects with.
|
|
1011
1140
|
*/
|
|
1012
1141
|
type StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument<T>;
|
|
1013
1142
|
/**
|
|
@@ -1083,6 +1212,9 @@ interface NativeRequestInit {
|
|
|
1083
1212
|
/**
|
|
1084
1213
|
* A read-only {@link Headers} instance, as passed to {@link Handler | Handlers}
|
|
1085
1214
|
* via {@link ImmutableRequestInfo.headers}.
|
|
1215
|
+
*
|
|
1216
|
+
* @summary Read-only `Headers` that handlers see on a request, adding `toJSON` to serialize them as `[key, value]`
|
|
1217
|
+
* pairs and an optional mutable `clone`.
|
|
1086
1218
|
*/
|
|
1087
1219
|
interface ImmutableHeaders extends Headers {
|
|
1088
1220
|
/**
|
|
@@ -1101,6 +1233,11 @@ interface ImmutableHeaders extends Headers {
|
|
|
1101
1233
|
* This interface is used to define the shape of a request that can be made via
|
|
1102
1234
|
* either the {@link RequestManager.request} or {@link Store.request} methods.
|
|
1103
1235
|
*
|
|
1236
|
+
* The [Making Requests](/guides/the-manual/requests/#request-options) guide explains
|
|
1237
|
+
* its options.
|
|
1238
|
+
*
|
|
1239
|
+
* @summary Describes a request for `store.request` or `RequestManager.request`: native fetch options plus cache
|
|
1240
|
+
* options, operation name, records, data, and the store.
|
|
1104
1241
|
* @privateRemarks
|
|
1105
1242
|
* - [MDN Reference (fetch)](https://developer.mozilla.org/docs/Web/API/Window/fetch)
|
|
1106
1243
|
* - [MDN Reference (RequestInit)](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit)
|
|
@@ -1192,6 +1329,8 @@ interface RequestInfo<RT = unknown> extends NativeRequestInit {
|
|
|
1192
1329
|
/**
|
|
1193
1330
|
* Immutable version of {@link RequestInfo}. This is what is passed to handlers.
|
|
1194
1331
|
*
|
|
1332
|
+
* @summary Read-only form of a request as handlers receive it, with frozen headers, data, options, and cache options
|
|
1333
|
+
* and no `controller`.
|
|
1195
1334
|
*/
|
|
1196
1335
|
type ImmutableRequestInfo<RT = unknown> = Readonly<Omit<RequestInfo<RT>, "controller">> & {
|
|
1197
1336
|
/**
|
|
@@ -1217,6 +1356,9 @@ type ImmutableRequestInfo<RT = unknown> = Readonly<Omit<RequestInfo<RT>, "contro
|
|
|
1217
1356
|
/**
|
|
1218
1357
|
* An immutable, JSON-serializable subset of the native {@link Response}
|
|
1219
1358
|
* interface.
|
|
1359
|
+
*
|
|
1360
|
+
* @summary Immutable, JSON-serializable snapshot of a fetch `Response`'s headers, status, url, and type, usable in
|
|
1361
|
+
* place of a `Response` in request results.
|
|
1220
1362
|
*/
|
|
1221
1363
|
interface ResponseInfo {
|
|
1222
1364
|
/**
|
|
@@ -1252,6 +1394,11 @@ interface ResponseInfo {
|
|
|
1252
1394
|
* The object a {@link Handler} uses to fulfill a request: it provides a
|
|
1253
1395
|
* readonly view of the {@link RequestContext.request | request} and methods
|
|
1254
1396
|
* for supplying the {@link Future}'s stream and final response.
|
|
1397
|
+
*
|
|
1398
|
+
* The [Handlers](/guides/the-manual/requests/handlers) guide shows a handler using it.
|
|
1399
|
+
*
|
|
1400
|
+
* @summary Object passed to each request handler with the immutable request, a request id, and methods for setting the
|
|
1401
|
+
* response stream and the response.
|
|
1255
1402
|
*/
|
|
1256
1403
|
interface RequestContext {
|
|
1257
1404
|
/**
|
|
@@ -1336,6 +1483,8 @@ type KeyOrString<T> = keyof T & string extends never ? string : keyof T & string
|
|
|
1336
1483
|
* for @warp-drive-mirror/legacy/model or when wrapping schema for legacy
|
|
1337
1484
|
* Adapters/Serializers.
|
|
1338
1485
|
*
|
|
1486
|
+
* @summary Legacy shape of a Model class's static schema API (fields, attributes, relationships, iterators) used
|
|
1487
|
+
* by the legacy schema service and Adapters/Serializers.
|
|
1339
1488
|
*/
|
|
1340
1489
|
interface ModelSchema<T = unknown> {
|
|
1341
1490
|
/**
|
|
@@ -1533,6 +1682,9 @@ declare class RecordReference {
|
|
|
1533
1682
|
* Options shared by {@link FindRecordOptions} and {@link FindAllOptions}
|
|
1534
1683
|
* for controlling reload behavior and adapter/serializer specific
|
|
1535
1684
|
* configuration when using the legacy Adapter/Serializer network layer.
|
|
1685
|
+
*
|
|
1686
|
+
* @summary Legacy reload, background-reload, include, and adapterOptions settings shared by `store.findRecord` and
|
|
1687
|
+
* `store.findAll`.
|
|
1536
1688
|
*/
|
|
1537
1689
|
interface BaseFinderOptions {
|
|
1538
1690
|
/**
|
|
@@ -1564,6 +1716,9 @@ interface BaseFinderOptions {
|
|
|
1564
1716
|
}
|
|
1565
1717
|
/**
|
|
1566
1718
|
* Options for `store.findRecord()`.
|
|
1719
|
+
*
|
|
1720
|
+
* @summary Legacy options for `store.findRecord`, adding a discouraged `preload` of field values to the shared
|
|
1721
|
+
* reload and adapter settings.
|
|
1567
1722
|
*/
|
|
1568
1723
|
interface FindRecordOptions extends BaseFinderOptions {
|
|
1569
1724
|
/**
|
|
@@ -1588,16 +1743,24 @@ interface FindRecordOptions extends BaseFinderOptions {
|
|
|
1588
1743
|
* {@link LegacyResourceQuery}, these options are not sent to the server;
|
|
1589
1744
|
* only `adapterOptions` is recognized by the store, and it is passed
|
|
1590
1745
|
* through to `adapter.query`/`adapter.queryRecord` via the request snapshot.
|
|
1746
|
+
*
|
|
1747
|
+
* @summary Legacy options for `store.query` and `store.queryRecord`, of which only `adapterOptions` is used, passed
|
|
1748
|
+
* to the adapter rather than the server.
|
|
1591
1749
|
*/
|
|
1592
1750
|
type QueryOptions = { [K in string | "adapterOptions"]?: K extends "adapterOptions" ? Record<string, unknown> : unknown; };
|
|
1593
1751
|
/**
|
|
1594
1752
|
* Options for `store.findAll()`.
|
|
1753
|
+
*
|
|
1754
|
+
* @summary Legacy reload, background-reload, include, and adapterOptions settings for `store.findAll`.
|
|
1595
1755
|
*/
|
|
1596
1756
|
type FindAllOptions = BaseFinderOptions;
|
|
1597
1757
|
/**
|
|
1598
1758
|
* An opaque query object for `store.query()` and `store.queryRecord()`
|
|
1599
1759
|
* that is passed as-is to the adapter, which is responsible for turning
|
|
1600
1760
|
* it into request query parameters.
|
|
1761
|
+
*
|
|
1762
|
+
* @summary Legacy query object for `store.query` and `store.queryRecord` that the adapter turns into request query
|
|
1763
|
+
* params, with an optional `include`.
|
|
1601
1764
|
*/
|
|
1602
1765
|
type LegacyResourceQuery = {
|
|
1603
1766
|
/**
|
|
@@ -1617,6 +1780,9 @@ type LegacyResourceQuery = {
|
|
|
1617
1780
|
* This should only be used for temporary migration purposes
|
|
1618
1781
|
* to the new schema system when migrating from either Model
|
|
1619
1782
|
* or ModelFragments.
|
|
1783
|
+
*
|
|
1784
|
+
* @summary Registers named methods, getters, and values to add to ReactiveResources, ReactiveObjects,
|
|
1785
|
+
* or ReactiveArrays; meant only as a temporary aid when migrating from Model or ModelFragments.
|
|
1620
1786
|
*/
|
|
1621
1787
|
interface CAUTION_MEGA_DANGER_ZONE_Extension {
|
|
1622
1788
|
/**
|
|
@@ -1713,6 +1879,9 @@ interface CAUTION_MEGA_DANGER_ZONE_Extension {
|
|
|
1713
1879
|
* Describes one feature added to a resource by a schema extension, as
|
|
1714
1880
|
* classified by {@link processExtension} from the property descriptor it
|
|
1715
1881
|
* was declared with (a method, a plain value, or a getter/setter pair).
|
|
1882
|
+
*
|
|
1883
|
+
* @summary One normalized feature of a schema extension, tagged by kind as a method, a readonly or
|
|
1884
|
+
* mutable value, or a getter/setter accessor.
|
|
1716
1885
|
*/
|
|
1717
1886
|
type ExtensionDef = {
|
|
1718
1887
|
/** A callable feature, installed as a method. */
|
|
@@ -1751,6 +1920,9 @@ type ExtensionDef = {
|
|
|
1751
1920
|
* The result of {@link processExtension} normalizing a
|
|
1752
1921
|
* {@link CAUTION_MEGA_DANGER_ZONE_Extension} into a lookup of its features
|
|
1753
1922
|
* by name.
|
|
1923
|
+
*
|
|
1924
|
+
* @summary A registered schema extension normalized into its kind, name, and a map of its features
|
|
1925
|
+
* keyed by property name.
|
|
1754
1926
|
*/
|
|
1755
1927
|
interface ProcessedExtension {
|
|
1756
1928
|
/** Whether this extension applies to objects/resources or to arrays. */
|
|
@@ -1780,14 +1952,19 @@ interface ExtensibleField {
|
|
|
1780
1952
|
* Utility for constructing a ResourceSchema with the recommended
|
|
1781
1953
|
* fields for the PolarisMode experience.
|
|
1782
1954
|
*
|
|
1955
|
+
* The [ResourceSchemas](/guides/the-manual/schemas/resources/) guide shows how to
|
|
1956
|
+
* create a schema with it.
|
|
1957
|
+
*
|
|
1783
1958
|
* Using this requires registering the PolarisMode derivations
|
|
1784
1959
|
*
|
|
1785
1960
|
* ```ts
|
|
1786
|
-
* import { registerDerivations } from '@warp-drive-mirror/
|
|
1961
|
+
* import { registerDerivations } from '@warp-drive-mirror/core/reactive';
|
|
1787
1962
|
*
|
|
1788
1963
|
* registerDerivations(schema);
|
|
1789
1964
|
* ```
|
|
1790
1965
|
*
|
|
1966
|
+
* @summary Adds the default `id` identity plus `$key`, `$type`, and `constructor` derived fields to a
|
|
1967
|
+
* PolarisMode resource schema.
|
|
1791
1968
|
* @public
|
|
1792
1969
|
* @param schema
|
|
1793
1970
|
* @return {PolarisResourceSchema}
|
|
@@ -1830,6 +2007,8 @@ interface FromIdentityDerivation {
|
|
|
1830
2007
|
*
|
|
1831
2008
|
* `^` returns the entire identifier object.
|
|
1832
2009
|
*
|
|
2010
|
+
* @summary The `@identity` derivation, which reads a record's `id`, `lid`, `type`, or whole resource key
|
|
2011
|
+
* for use in derived fields.
|
|
1833
2012
|
* @public
|
|
1834
2013
|
*/
|
|
1835
2014
|
declare const fromIdentity: FromIdentityDerivation;
|
|
@@ -1838,9 +2017,14 @@ declare const fromIdentity: FromIdentityDerivation;
|
|
|
1838
2017
|
* to use the PolarisMode defaults provided by
|
|
1839
2018
|
*
|
|
1840
2019
|
* ```ts
|
|
1841
|
-
* import { withDefaults } from '@warp-drive-mirror/
|
|
2020
|
+
* import { withDefaults } from '@warp-drive-mirror/core/reactive';
|
|
1842
2021
|
* ```
|
|
1843
2022
|
*
|
|
2023
|
+
* The [Derivations](/guides/the-manual/schemas/derivations#about-built-in-derivations)
|
|
2024
|
+
* guide explains when you need to call it.
|
|
2025
|
+
*
|
|
2026
|
+
* @summary Registers the `@identity` and `@constructor` derivations that schemas built with
|
|
2027
|
+
* `withDefaults` depend on.
|
|
1844
2028
|
* @public
|
|
1845
2029
|
*/
|
|
1846
2030
|
declare function registerDerivations(schema: SchemaService): void;
|
|
@@ -1857,6 +2041,9 @@ interface InternalSchema {
|
|
|
1857
2041
|
* Defines how to convert a `GenericField`, `ObjectField`, or `ArrayField`
|
|
1858
2042
|
* between the raw value `T` stored in the cache and the presentation value
|
|
1859
2043
|
* `PT` exposed on the record.
|
|
2044
|
+
*
|
|
2045
|
+
* @summary A registered converter between a field's raw cache value and the value exposed on the
|
|
2046
|
+
* record, with optional default.
|
|
1860
2047
|
*/
|
|
1861
2048
|
type Transformation<T extends Value = Value, PT = unknown> = {
|
|
1862
2049
|
/** Converts the presentation value into the raw value to store in the cache. */
|
|
@@ -1880,6 +2067,12 @@ interface SchemaService$1 {
|
|
|
1880
2067
|
/**
|
|
1881
2068
|
* A SchemaService designed to work with dynamically registered schemas.
|
|
1882
2069
|
*
|
|
2070
|
+
* The [Schemas](/guides/the-manual/schemas/) guide shows how to register schemas
|
|
2071
|
+
* with it, and [Advanced Store Configuration](/guides/configuration/advanced#add-a-source-for-schema-for-your-data)
|
|
2072
|
+
* shows how to give a store one.
|
|
2073
|
+
*
|
|
2074
|
+
* @summary The default schema service, which stores resource and object schemas, traits, derivations,
|
|
2075
|
+
* transformations, hash functions and extensions registered at runtime.
|
|
1883
2076
|
* @public
|
|
1884
2077
|
*/
|
|
1885
2078
|
declare class SchemaService$1 implements SchemaService {
|
|
@@ -1968,6 +2161,8 @@ declare class SchemaService$1 implements SchemaService {
|
|
|
1968
2161
|
* attribute name, as returned by the deprecated
|
|
1969
2162
|
* {@link SchemaService.attributesDefinitionFor | attributesDefinitionFor} hook.
|
|
1970
2163
|
*
|
|
2164
|
+
* @summary Legacy attribute field definitions keyed by attribute name, returned by the deprecated
|
|
2165
|
+
* `attributesDefinitionFor` schema hook.
|
|
1971
2166
|
* @public
|
|
1972
2167
|
*/
|
|
1973
2168
|
type AttributesSchema = Record<string, LegacyAttributeField>;
|
|
@@ -1976,6 +2171,8 @@ type AttributesSchema = Record<string, LegacyAttributeField>;
|
|
|
1976
2171
|
* relationship name, as returned by the deprecated
|
|
1977
2172
|
* {@link SchemaService.relationshipsDefinitionFor | relationshipsDefinitionFor} hook.
|
|
1978
2173
|
*
|
|
2174
|
+
* @summary Legacy relationship field definitions keyed by relationship name, returned by the deprecated
|
|
2175
|
+
* `relationshipsDefinitionFor` schema hook.
|
|
1979
2176
|
* @public
|
|
1980
2177
|
*/
|
|
1981
2178
|
type RelationshipsSchema = Record<string, LegacyRelationshipField>;
|
|
@@ -1986,6 +2183,10 @@ interface ObjectWithStringTypeProperty {
|
|
|
1986
2183
|
* The SchemaService provides the ability to query for information about the structure
|
|
1987
2184
|
* of any resource type.
|
|
1988
2185
|
*
|
|
2186
|
+
* The [Schemas](/guides/the-manual/schemas/) guide shows how to register schemas
|
|
2187
|
+
* with it, and [Advanced Store Configuration](/guides/configuration/advanced#add-a-source-for-schema-for-your-data)
|
|
2188
|
+
* shows how to give a store one.
|
|
2189
|
+
*
|
|
1989
2190
|
* Applications can provide any implementation of the SchemaService they please so long
|
|
1990
2191
|
* as it conforms to this interface.
|
|
1991
2192
|
*
|
|
@@ -2030,6 +2231,8 @@ interface ObjectWithStringTypeProperty {
|
|
|
2030
2231
|
* }
|
|
2031
2232
|
* ```
|
|
2032
2233
|
*
|
|
2234
|
+
* @summary The contract a store's schema service implements to answer which resource types, traits, fields,
|
|
2235
|
+
* transformations, and derivations exist.
|
|
2033
2236
|
* @public
|
|
2034
2237
|
*/
|
|
2035
2238
|
interface SchemaService {
|
|
@@ -2471,6 +2674,8 @@ implement this hook.
|
|
|
2471
2674
|
|
|
2472
2675
|
⚠️ Caution: Requests that do not have a `method` assigned are assumed to be `GET`
|
|
2473
2676
|
|
|
2677
|
+
@summary Overrides how the store generates `lid` cache keys for resources and documents; must be set
|
|
2678
|
+
before the store is created.
|
|
2474
2679
|
@public
|
|
2475
2680
|
*/
|
|
2476
2681
|
declare function setIdentifierGenerationMethod(method: GenerationMethod | null): void;
|
|
@@ -2503,6 +2708,8 @@ prior to this `UpdateMethod` being called; however, calls to the parent method
|
|
|
2503
2708
|
`updateRecordIdentifier` that attempt to change the `id` or calling update
|
|
2504
2709
|
without providing an `id` when one is missing will throw an error.
|
|
2505
2710
|
|
|
2711
|
+
@summary Registers a callback run when an existing resource key receives new data, for updating your
|
|
2712
|
+
own secondary lookup tables.
|
|
2506
2713
|
@public
|
|
2507
2714
|
*/
|
|
2508
2715
|
declare function setIdentifierUpdateMethod(method: UpdateMethod | null): void;
|
|
@@ -2518,6 +2725,8 @@ import { setIdentifierForgetMethod } from '@warp-drive-mirror/core';
|
|
|
2518
2725
|
Takes method which can expect to receive an existing `Identifier` that should be eliminated
|
|
2519
2726
|
from any secondary lookup tables or caches that the user has populated for it.
|
|
2520
2727
|
|
|
2728
|
+
@summary Registers a callback run when the store releases a resource key, for cleaning up your own
|
|
2729
|
+
lookup tables.
|
|
2521
2730
|
@public
|
|
2522
2731
|
*/
|
|
2523
2732
|
declare function setIdentifierForgetMethod(method: ForgetMethod | null): void;
|
|
@@ -2535,6 +2744,8 @@ Takes a method which can expect to be called when the parent application is dest
|
|
|
2535
2744
|
If you have properly used a WeakMap to encapsulate the state of your customization
|
|
2536
2745
|
to the application instance, you may not need to implement the `resetMethod`.
|
|
2537
2746
|
|
|
2747
|
+
@summary Registers a callback run when the store's key cache is torn down, for resetting any custom
|
|
2748
|
+
key-generation state.
|
|
2538
2749
|
@public
|
|
2539
2750
|
*/
|
|
2540
2751
|
declare function setIdentifierResetMethod(method: ResetMethod | null): void;
|
|
@@ -2551,6 +2762,8 @@ This configuration MUST occur prior to the store instance being created.
|
|
|
2551
2762
|
import { setKeyInfoForResource } from '@warp-drive-mirror/core';
|
|
2552
2763
|
```
|
|
2553
2764
|
|
|
2765
|
+
@summary Overrides how the store derives the `type` and `id` of a new `ResourceKey` from resource data;
|
|
2766
|
+
must be set before the store is created.
|
|
2554
2767
|
@public
|
|
2555
2768
|
*/
|
|
2556
2769
|
declare function setKeyInfoForResource(method: KeyInfoMethod | null): void;
|
|
@@ -2685,15 +2898,24 @@ interface PrivateCacheKeyManager extends CacheKeyManager {
|
|
|
2685
2898
|
type UnsubscribeToken$1 = object;
|
|
2686
2899
|
/**
|
|
2687
2900
|
* The kinds of change notifications the {@link NotificationManager} can emit for a resource.
|
|
2901
|
+
*
|
|
2902
|
+
* @summary The lifecycle notification kinds sent to resource subscribers: `added`, `removed`, `updated`,
|
|
2903
|
+
* or `state`.
|
|
2688
2904
|
*/
|
|
2689
2905
|
type CacheOperation$1 = "added" | "removed" | "updated" | "state";
|
|
2690
2906
|
/**
|
|
2691
2907
|
* The kinds of change notifications the {@link NotificationManager} can emit for a request document.
|
|
2908
|
+
*
|
|
2909
|
+
* @summary The notification kinds sent to request document subscribers, such as `updated` or
|
|
2910
|
+
* `invalidated`.
|
|
2692
2911
|
*/
|
|
2693
2912
|
type DocumentCacheOperation$1 = "invalidated" | "added" | "removed" | "updated" | "state";
|
|
2694
2913
|
/**
|
|
2695
2914
|
* The full set of notification kinds the {@link NotificationManager} can emit for a resource,
|
|
2696
2915
|
* including both {@link CacheOperation}s and finer-grained field-level change notifications.
|
|
2916
|
+
*
|
|
2917
|
+
* @summary Every notification kind a resource subscriber can receive, from lifecycle operations to
|
|
2918
|
+
* `attributes`, `relationships`, `errors`, `meta`, and `identity` changes.
|
|
2697
2919
|
*/
|
|
2698
2920
|
type NotificationType = "attributes" | "relationships" | "identity" | "errors" | "meta" | CacheOperation$1;
|
|
2699
2921
|
/**
|
|
@@ -2702,6 +2924,8 @@ type NotificationType = "attributes" | "relationships" | "identity" | "errors" |
|
|
|
2702
2924
|
* the `'attributes'` or `'relationships'` namespaces in a single call
|
|
2703
2925
|
* instead of once per key.
|
|
2704
2926
|
*
|
|
2927
|
+
* @summary A set of field names passed to `notify` or `notifyChange` to report many `attributes` or
|
|
2928
|
+
* `relationships` changes in one call.
|
|
2705
2929
|
* @since 5.9.0
|
|
2706
2930
|
* @public
|
|
2707
2931
|
*/
|
|
@@ -2737,6 +2961,8 @@ type NotifyKeys = Set<string>;
|
|
|
2737
2961
|
* `DocumentCacheOperation` values) are never filtered by channel since they
|
|
2738
2962
|
* have no local/remote duality.
|
|
2739
2963
|
*
|
|
2964
|
+
* @summary Scopes an `attributes` or `relationships` notification to a resource's local (editable) or
|
|
2965
|
+
* remote (persisted) view so only matching subscribers hear it.
|
|
2740
2966
|
* @public
|
|
2741
2967
|
*/
|
|
2742
2968
|
type NotificationChannel = "local" | "remote";
|
|
@@ -2758,6 +2984,8 @@ interface DocumentOperationCallback$1 {
|
|
|
2758
2984
|
* This Feature is what allows WarpDrive to create subscriptions that
|
|
2759
2985
|
* work with any framework or change-notification system.
|
|
2760
2986
|
*
|
|
2987
|
+
* @summary The store service that lets code subscribe to and batch-deliver change notifications for
|
|
2988
|
+
* cached resources and request documents.
|
|
2761
2989
|
* @hideconstructor
|
|
2762
2990
|
* @public
|
|
2763
2991
|
*/
|
|
@@ -2865,6 +3093,8 @@ interface PrivateNotificationManager extends NotificationManager$1 {
|
|
|
2865
3093
|
*
|
|
2866
3094
|
* This class cannot be directly instantiated.
|
|
2867
3095
|
*
|
|
3096
|
+
* @summary The narrow slice of Store API handed to a Cache via `createCache`, for key lookup, schema access, record
|
|
3097
|
+
* id updates, and change notifications.
|
|
2868
3098
|
* @public
|
|
2869
3099
|
*/
|
|
2870
3100
|
type CacheCapabilitiesManager$1 = {
|
|
@@ -3026,12 +3256,16 @@ type OpaqueRecordInstance = unknown;
|
|
|
3026
3256
|
* A hash of changed attributes with the key being the attribute name and the value being an
|
|
3027
3257
|
* array of `[oldValue, newValue]`.
|
|
3028
3258
|
*
|
|
3259
|
+
* @summary Map of attribute name to `[oldValue, newValue]` for a resource's uncommitted attribute changes, as
|
|
3260
|
+
* returned by `cache.changedAttrs`.
|
|
3029
3261
|
*/
|
|
3030
3262
|
type ChangedAttributesHash = Record<string, [Value | undefined, Value]>;
|
|
3031
3263
|
/**
|
|
3032
3264
|
* Describes the local (uncommitted) changes to a single relationship,
|
|
3033
3265
|
* as returned by {@link Cache.changedRelationships}.
|
|
3034
3266
|
*
|
|
3267
|
+
* @summary Remote versus local state of one relationship, with additions, removals, and reordering for to-many,
|
|
3268
|
+
* as returned by `cache.changedRelationships`.
|
|
3035
3269
|
* @example
|
|
3036
3270
|
* ```ts
|
|
3037
3271
|
* const diff: RelationshipDiff = {
|
|
@@ -3089,6 +3323,11 @@ type RelationshipDiff = {
|
|
|
3089
3323
|
* A Cache handles in-memory storage of Document and Resource
|
|
3090
3324
|
* data.
|
|
3091
3325
|
*
|
|
3326
|
+
* The [Caching](/guides/the-manual/caching/#how-the-cache-works) guide explains how
|
|
3327
|
+
* the cache stores that data.
|
|
3328
|
+
*
|
|
3329
|
+
* @summary Contract a Cache implementation fulfills to store, patch, mutate, and read document and resource data
|
|
3330
|
+
* for the Store, including local changes, errors, and SSR hydration.
|
|
3092
3331
|
* @public
|
|
3093
3332
|
*/
|
|
3094
3333
|
interface Cache {
|
|
@@ -4017,6 +4256,8 @@ declare function graphFor(store: CacheCapabilitiesManager$1 | Store$1): Graph;
|
|
|
4017
4256
|
* callbacks that settle it, so the promise can be handed out before the
|
|
4018
4257
|
* work that will settle it has started.
|
|
4019
4258
|
*
|
|
4259
|
+
* @summary Creates a promise together with its `resolve` and `reject` callbacks so it can be handed out
|
|
4260
|
+
* before it is settled.
|
|
4020
4261
|
* @public
|
|
4021
4262
|
*/
|
|
4022
4263
|
declare function createDeferred<T>(): Deferred<T>;
|
|
@@ -4035,6 +4276,8 @@ type CacheResult<T = unknown, E = unknown> = {
|
|
|
4035
4276
|
* (and by `getPromiseState`). Anything that is at least `then`/`catch`/`finally`
|
|
4036
4277
|
* "shaped" (including a real `Promise` or {@link Future}) satisfies this.
|
|
4037
4278
|
*
|
|
4279
|
+
* @summary Any promise-like value with `then`, `catch`, and `finally`, as accepted by the promise-result
|
|
4280
|
+
* cache and `getPromiseState`.
|
|
4038
4281
|
* @public
|
|
4039
4282
|
*/
|
|
4040
4283
|
type Awaitable<T = unknown, E = unknown> = {
|
|
@@ -4062,6 +4305,8 @@ type Awaitable<T = unknown, E = unknown> = {
|
|
|
4062
4305
|
* outcome can be synchronously read later via {@link getPromiseResult},
|
|
4063
4306
|
* without needing to await it again.
|
|
4064
4307
|
*
|
|
4308
|
+
* @summary Records a promise's settled value or error so it can later be read synchronously with
|
|
4309
|
+
* `getPromiseResult`.
|
|
4065
4310
|
* @public
|
|
4066
4311
|
*/
|
|
4067
4312
|
declare function setPromiseResult(promise: Promise<unknown> | Awaitable, result: CacheResult): void;
|
|
@@ -4069,6 +4314,8 @@ declare function setPromiseResult(promise: Promise<unknown> | Awaitable, result:
|
|
|
4069
4314
|
* Synchronously read the settled result (or error) previously recorded for
|
|
4070
4315
|
* a promise-like value via {@link setPromiseResult}, if any.
|
|
4071
4316
|
*
|
|
4317
|
+
* @summary Synchronously returns the settled value or error previously recorded for a promise, or
|
|
4318
|
+
* `undefined` if none was recorded.
|
|
4072
4319
|
* @public
|
|
4073
4320
|
*/
|
|
4074
4321
|
declare function getPromiseResult<T, E>(promise: Promise<T> | Awaitable<T, E>): CacheResult<T, E> | undefined;
|
|
@@ -4077,6 +4324,9 @@ declare function getPromiseResult<T, E>(promise: Promise<T> | Awaitable<T, E>):
|
|
|
4077
4324
|
/**
|
|
4078
4325
|
* Brands the supplied object with the supplied response type.
|
|
4079
4326
|
*
|
|
4327
|
+
* The [Typing Requests](/guides/the-manual/requests/typing-requests) guide shows how
|
|
4328
|
+
* to use it.
|
|
4329
|
+
*
|
|
4080
4330
|
* ```ts
|
|
4081
4331
|
* import type { ReactiveDataDocument } from '@warp-drive-mirror/core/reactive';
|
|
4082
4332
|
* import { withResponseType } from '@warp-drive-mirror/core/request';
|
|
@@ -4089,6 +4339,8 @@ declare function getPromiseResult<T, E>(promise: Promise<T> | Awaitable<T, E>):
|
|
|
4089
4339
|
* result.content.data; // will have type User
|
|
4090
4340
|
* ```
|
|
4091
4341
|
*
|
|
4342
|
+
* @summary Types a request object with the response type that `store.request` or `RequestManager.request`
|
|
4343
|
+
* should resolve with; no runtime effect.
|
|
4092
4344
|
*/
|
|
4093
4345
|
declare function withResponseType<T>(obj: RequestInfo): RequestInfo<T> & {
|
|
4094
4346
|
/** The branded response type. Present only at the type level; carries no runtime value. */
|
|
@@ -4099,6 +4351,9 @@ declare function withResponseType<T>(obj: RequestInfo): RequestInfo<T> & {
|
|
|
4099
4351
|
* wrapped in {@link ReactiveDataDocument}. This is a convenience for
|
|
4100
4352
|
* the common case of using {@link withResponseType} with `ReactiveDataDocument`.
|
|
4101
4353
|
*
|
|
4354
|
+
* The [Typing Requests](/guides/the-manual/requests/typing-requests#typing-reactive-responses)
|
|
4355
|
+
* guide shows how to use it.
|
|
4356
|
+
*
|
|
4102
4357
|
* ```ts
|
|
4103
4358
|
* import { withReactiveResponse } from '@warp-drive-mirror/core/request';
|
|
4104
4359
|
* import type { User } from '#/data/user.ts'
|
|
@@ -4122,6 +4377,8 @@ declare function withResponseType<T>(obj: RequestInfo): RequestInfo<T> & {
|
|
|
4122
4377
|
* result.content.meta?.total; // number | undefined
|
|
4123
4378
|
* ```
|
|
4124
4379
|
*
|
|
4380
|
+
* @summary Types a request object so its response resolves as a `ReactiveDataDocument` of the given
|
|
4381
|
+
* data and meta types; no runtime effect.
|
|
4125
4382
|
* @public
|
|
4126
4383
|
*/
|
|
4127
4384
|
declare function withReactiveResponse<T, M extends Meta | undefined = Meta | undefined, E extends object = object, EM extends Meta | undefined = M>(obj: RequestInfo): RequestInfo<ReactiveDataDocument<T, M, E, EM>> & {
|
|
@@ -4129,6 +4386,8 @@ declare function withReactiveResponse<T, M extends Meta | undefined = Meta | und
|
|
|
4129
4386
|
[RequestSignature]: ReactiveDataDocument<T, M, E, EM>;
|
|
4130
4387
|
};
|
|
4131
4388
|
/**
|
|
4389
|
+
* @summary Deprecated alias for `withResponseType`, which types a request object with its expected
|
|
4390
|
+
* response type.
|
|
4132
4391
|
* @deprecated use {@link withResponseType} instead
|
|
4133
4392
|
*/
|
|
4134
4393
|
declare const withBrand: typeof withResponseType;
|
|
@@ -4141,6 +4400,9 @@ type LooseStoreRequestInfo<RT = unknown> = Omit<ImmutableRequestInfo<RT>, "recor
|
|
|
4141
4400
|
/**
|
|
4142
4401
|
* The request shape accepted by {@link Store.request}, either a fully-formed
|
|
4143
4402
|
* {@link ImmutableRequestInfo} or the looser {@link LooseStoreRequestInfo}.
|
|
4403
|
+
*
|
|
4404
|
+
* @summary The request object `store.request` accepts, either a full immutable request info or a looser
|
|
4405
|
+
* form with plain `records` and `headers`.
|
|
4144
4406
|
*/
|
|
4145
4407
|
type StoreRequestInput<RT = unknown> = ImmutableRequestInfo<RT> | LooseStoreRequestInfo<RT>;
|
|
4146
4408
|
interface StoreRequestContext extends RequestContext {
|
|
@@ -4152,6 +4414,9 @@ interface StoreRequestContext extends RequestContext {
|
|
|
4152
4414
|
/**
|
|
4153
4415
|
* A CacheHandler that adds support for using an WarpDrive Cache with a RequestManager.
|
|
4154
4416
|
*
|
|
4417
|
+
* The [Caching](/guides/the-manual/caching/) guide explains how it decides whether a
|
|
4418
|
+
* request can use the cache.
|
|
4419
|
+
*
|
|
4155
4420
|
* This handler will only run when a request has supplied a `store` instance. Requests
|
|
4156
4421
|
* issued by the store via `store.request()` will automatically have the `store` instance
|
|
4157
4422
|
* attached to the request.
|
|
@@ -4187,7 +4452,10 @@ interface StoreRequestContext extends RequestContext {
|
|
|
4187
4452
|
* method: 'GET',
|
|
4188
4453
|
* [EnableHydration]: true
|
|
4189
4454
|
* });
|
|
4455
|
+
* ```
|
|
4190
4456
|
*
|
|
4457
|
+
* @summary The RequestManager cache handler that serves, dedupes, and caches store requests and returns
|
|
4458
|
+
* reactive documents when hydration is enabled.
|
|
4191
4459
|
*/
|
|
4192
4460
|
declare const CacheHandler: CacheHandler$1;
|
|
4193
4461
|
//#endregion
|
|
@@ -4197,12 +4465,18 @@ declare const CacheHandler: CacheHandler$1;
|
|
|
4197
4465
|
* the store's `lifetimes` property to configure the behavior
|
|
4198
4466
|
* of the CacheHandler.
|
|
4199
4467
|
*
|
|
4468
|
+
* The [Advanced Store Configuration](/guides/configuration/advanced#decide-how-long-requests-are-valid-for-with-a-cachepolicy)
|
|
4469
|
+
* guide shows how to configure one, and [Caching](/guides/the-manual/caching/) explains
|
|
4470
|
+
* where the CacheHandler consults it.
|
|
4471
|
+
*
|
|
4200
4472
|
* The default behavior for request lifetimes is to never expire
|
|
4201
4473
|
* unless manually refreshed via `cacheOptions.reload` or `cacheOptions.backgroundReload`.
|
|
4202
4474
|
*
|
|
4203
4475
|
* Implementing this service allows you to programatically define
|
|
4204
4476
|
* when a request should be considered expired.
|
|
4205
4477
|
*
|
|
4478
|
+
* @summary The interface a store's `lifetimes` service implements to decide when cached requests are
|
|
4479
|
+
* hard or soft expired and should be refetched.
|
|
4206
4480
|
* @public
|
|
4207
4481
|
*/
|
|
4208
4482
|
interface CachePolicy {
|
|
@@ -4396,6 +4670,8 @@ type DocumentMeta<M extends Meta | undefined> = undefined extends M ? {
|
|
|
4396
4670
|
* The variant of {@link ReactiveDocument} returned for a request whose
|
|
4397
4671
|
* response contained no primary data, e.g. an error response.
|
|
4398
4672
|
*
|
|
4673
|
+
* @summary The shape of a reactive response document that carries `errors` and no primary `data`,
|
|
4674
|
+
* such as the result of a failed request.
|
|
4399
4675
|
* @public
|
|
4400
4676
|
*/
|
|
4401
4677
|
type ReactiveErrorDocument<T, EM extends Meta | undefined = Meta | undefined, E extends object = object, M extends Meta | undefined = EM> = ReactiveDocumentBase<T, M, E, EM> & DocumentMeta<EM> & {
|
|
@@ -4426,6 +4702,8 @@ type ReactiveErrorDocument<T, EM extends Meta | undefined = Meta | undefined, E
|
|
|
4426
4702
|
* The variant of {@link ReactiveDocument} returned for a request whose
|
|
4427
4703
|
* response contained primary data.
|
|
4428
4704
|
*
|
|
4705
|
+
* @summary The shape of a reactive response document whose `data` holds the request's primary
|
|
4706
|
+
* records, with no `errors`.
|
|
4429
4707
|
* @public
|
|
4430
4708
|
*/
|
|
4431
4709
|
type ReactiveDataDocument<T, M extends Meta | undefined = Meta | undefined, E extends object = object, EM extends Meta | undefined = M> = ReactiveDocumentBase<T, M, E, EM> & DocumentMeta<M> & {
|
|
@@ -4453,10 +4731,15 @@ type ReactiveDataDocument<T, M extends Meta | undefined = Meta | undefined, E ex
|
|
|
4453
4731
|
* returned by `Cache.put` or `Cache.peek`, converting ResourceKeys into
|
|
4454
4732
|
* ReactiveResource instances.
|
|
4455
4733
|
*
|
|
4734
|
+
* The [Using The Response](/guides/the-manual/requests/using-the-response) guide
|
|
4735
|
+
* shows when a request's content is a ReactiveDocument.
|
|
4736
|
+
*
|
|
4456
4737
|
* It is not directly instantiated by the user, and its properties should not
|
|
4457
4738
|
* be directly modified. Whether individual properties are mutable or not is
|
|
4458
4739
|
* determined by the record instance itself.
|
|
4459
4740
|
*
|
|
4741
|
+
* @summary The reactive wrapper around a request's response document that exposes its data or errors
|
|
4742
|
+
* as live records, plus meta, links, and pagination helpers.
|
|
4460
4743
|
* @public
|
|
4461
4744
|
*/
|
|
4462
4745
|
type ReactiveDocument<T, M extends Meta | undefined = Meta | undefined, E extends object = object, EM extends Meta | undefined = M> = ReactiveDataDocument<T, M, E, EM> | ReactiveErrorDocument<T, EM, E, M>;
|
|
@@ -4871,6 +5154,7 @@ const identifier = recordIdentifierFor(record);
|
|
|
4871
5154
|
const { id, type, lid } = identifier;
|
|
4872
5155
|
```
|
|
4873
5156
|
|
|
5157
|
+
@summary Returns the stable `ResourceKey` (type, id, and lid) the store assigned to a record instance.
|
|
4874
5158
|
@public
|
|
4875
5159
|
@param record a record instance previously obstained from the store.
|
|
4876
5160
|
*/
|
|
@@ -4988,6 +5272,8 @@ declare const SOURCE: "___(unique) Symbol(SOURCE)";
|
|
|
4988
5272
|
* Symbol for the method used to request a mutable copy of an otherwise
|
|
4989
5273
|
* immutable {@link ReactiveResource}.
|
|
4990
5274
|
*
|
|
5275
|
+
* @summary Deprecated symbol-keyed method on a ReactiveResource that resolves with an editable copy;
|
|
5276
|
+
* use `checkout` instead.
|
|
4991
5277
|
* @deprecated use the {@link checkout} utility function instead.
|
|
4992
5278
|
*/
|
|
4993
5279
|
declare const Checkout: "___(unique) Symbol(Checkout)";
|
|
@@ -5041,10 +5327,15 @@ interface ReactiveResourceArrayContext extends ReactiveResourceArrayCreateOption
|
|
|
5041
5327
|
* as the base for relationship and legacy record-array types such as
|
|
5042
5328
|
* {@link LegacyLiveArray}, {@link LegacyQueryArray} and {@link LegacyManyArray}.
|
|
5043
5329
|
*
|
|
5330
|
+
* The [Key Terminology](/guides/the-manual/caching/key-terms#resources) guide explains
|
|
5331
|
+
* how it relates to resources.
|
|
5332
|
+
*
|
|
5044
5333
|
* Behaves like a native Array: `Array.isArray(arr)` and `arr instanceof Array`
|
|
5045
5334
|
* both report `true`. The array stays in sync with the cache, updating
|
|
5046
5335
|
* reactively as the underlying {@link ResourceKey}s change.
|
|
5047
5336
|
*
|
|
5337
|
+
* @summary Native-Array-compatible reactive list of records backed by cache keys, returned for collection responses
|
|
5338
|
+
* and underlying relationship and legacy record arrays.
|
|
5048
5339
|
* @public
|
|
5049
5340
|
*/
|
|
5050
5341
|
interface ReactiveResourceArray<T = unknown> extends Omit<Array<T>, "[]"> {}
|
|
@@ -5197,6 +5488,8 @@ interface MinimumManager {
|
|
|
5197
5488
|
* and "bmw" will have populated LiveArrays, but the LiveArray for "car"
|
|
5198
5489
|
* would be empty.
|
|
5199
5490
|
*
|
|
5491
|
+
* @summary Legacy reactive array of every record of one type in the store, returned by `store.peekAll` and
|
|
5492
|
+
* `store.findAll`.
|
|
5200
5493
|
* @legacy we recommend againt using LiveArrays. Use {@link Store.request} instead
|
|
5201
5494
|
*/
|
|
5202
5495
|
interface LegacyLiveArray<T = unknown> extends LegacyArray<T> {
|
|
@@ -5293,6 +5586,8 @@ interface LegacyLiveArrayCreateOptions {
|
|
|
5293
5586
|
* from the cache, but it does remove the array as well as the overhead it requires
|
|
5294
5587
|
* from the store for book-keeping.
|
|
5295
5588
|
*
|
|
5589
|
+
* @summary Legacy immutable reactive array of the primary records returned by `store.query`, refreshable with
|
|
5590
|
+
* `update()` and released with `destroy()`.
|
|
5296
5591
|
* @legacy we recommend againt using QueryArrays. Use {@link Store.request} instead
|
|
5297
5592
|
*/
|
|
5298
5593
|
interface LegacyQueryArray<T = unknown> extends LegacyLiveArray<T> {
|
|
@@ -5591,6 +5886,26 @@ interface Store$1 {
|
|
|
5591
5886
|
* mechanism of presenting cache data to the ui for access
|
|
5592
5887
|
* mutation, and interaction.
|
|
5593
5888
|
*
|
|
5889
|
+
* The Store treats whatever this hook returns as opaque, so a record can be
|
|
5890
|
+
* anything from a fairly simple object to a robust proxy that links together
|
|
5891
|
+
* associated records through relationships.
|
|
5892
|
+
*
|
|
5893
|
+
* That also lets a record implementation separate edit flows from create flows
|
|
5894
|
+
* entirely. A [ReactiveResource](/api/@warp-drive-mirror/core/reactive/types/ReactiveResource)
|
|
5895
|
+
* is not editable by default; calling
|
|
5896
|
+
* [checkout](/api/@warp-drive-mirror/core/reactive/functions/checkout) on it gives access to
|
|
5897
|
+
* an editable copy while the original stays read-only.
|
|
5898
|
+
*
|
|
5899
|
+
* Because records are created here and read their data from the {@link Store.cache | cache},
|
|
5900
|
+
* record implementations should be able to interoperate both with each other and with
|
|
5901
|
+
* any Cache. An app can therefore use more than one record implementation, either to give
|
|
5902
|
+
* only some resource types enhanced features or to migrate from one implementation to
|
|
5903
|
+
* another incrementally. The Store that
|
|
5904
|
+
* [useLegacyStore](/api/@warp-drive-mirror/legacy/functions/useLegacyStore) produces does this:
|
|
5905
|
+
* its hook creates a legacy `Model` for each resource type that only has a Model schema,
|
|
5906
|
+
* and a ReactiveResource for every other type. Each Store creates one Cache, so an
|
|
5907
|
+
* app that needs more than one Cache implementation uses more than one Store.
|
|
5908
|
+
*
|
|
5594
5909
|
* @param identifier - The Resource CacheKey
|
|
5595
5910
|
* @param createRecordArgs - An object containing any properties passed to `store.createRecord`
|
|
5596
5911
|
* @return A record instance
|
|
@@ -6570,6 +6885,10 @@ interface Store$1 {
|
|
|
6570
6885
|
* The `Store` is the central piece of the ***Warp*Drive** experience. It connects
|
|
6571
6886
|
* requests for data with schemas, caching and reactivity.
|
|
6572
6887
|
*
|
|
6888
|
+
* The [Setup](/guides/configuration/#configure-the-store) guide shows how to configure
|
|
6889
|
+
* one, and [Making Requests](/guides/the-manual/requests/) shows how to request data
|
|
6890
|
+
* through it.
|
|
6891
|
+
*
|
|
6573
6892
|
* While it's easy to use ***just*** ***Warp*Drive**'s request management, most projects will find they
|
|
6574
6893
|
* require far more than basic fetch management. For this reason it's often best to start with a `Store`
|
|
6575
6894
|
* even when you aren't sure yet.
|
|
@@ -6577,6 +6896,7 @@ interface Store$1 {
|
|
|
6577
6896
|
* Most projects will only have a single `Store`, though using multiple distinct stores
|
|
6578
6897
|
* is possible.
|
|
6579
6898
|
*
|
|
6899
|
+
* @summary Central coordinator that connects requests for data with schemas, the cache and reactivity.
|
|
6580
6900
|
* @public
|
|
6581
6901
|
* @hideconstructor
|
|
6582
6902
|
*/
|
|
@@ -6685,12 +7005,25 @@ declare class Store$1 extends BaseClass {
|
|
|
6685
7005
|
*/
|
|
6686
7006
|
getRequestStateService(): RequestStateService;
|
|
6687
7007
|
/**
|
|
6688
|
-
* ::: tip 💡 For a more complete overview see the [Request Guide](/guides/
|
|
7008
|
+
* ::: tip 💡 For a more complete overview see the [Request Guide](/guides/the-manual/requests/)
|
|
6689
7009
|
* :::
|
|
6690
7010
|
*
|
|
6691
7011
|
* Issue a request via the configured {@link RequestManager},
|
|
6692
7012
|
* inserting the response into the {@link Store.cache | cache} and handing
|
|
6693
|
-
* back a {@link Future} which resolves to a {@link ReactiveDocument | ReactiveDocument}
|
|
7013
|
+
* back a {@link Future} which resolves to a {@link ReactiveDocument | ReactiveDocument}.
|
|
7014
|
+
* Use `store.request` for anything the Store's cache should own, which is nearly all app
|
|
7015
|
+
* code; reach for {@link RequestManager.request | requestManager.request} directly only when
|
|
7016
|
+
* there is no `Store` involved, or you specifically want the unprocessed
|
|
7017
|
+
* {@link StructuredDocument}.
|
|
7018
|
+
*
|
|
7019
|
+
* #### Building Requests
|
|
7020
|
+
*
|
|
7021
|
+
* `requestConfig` can be written by hand, but for anything reused more than once prefer a
|
|
7022
|
+
* request builder — a plain function that returns the right shape for `store.request`. This
|
|
7023
|
+
* repo ships builders for common operations (`findRecord`, `query`, `createRecord`, and more)
|
|
7024
|
+
* for {json:api}, REST, and ActiveRecord-style APIs in `@warp-drive-mirror/utilities`; each builder's
|
|
7025
|
+
* return value also carries its own response type, so `RT` below is inferred automatically
|
|
7026
|
+
* instead of being written by hand. See [Builders](/guides/the-manual/requests/builders.md).
|
|
6694
7027
|
*
|
|
6695
7028
|
* #### Request Cache Keys
|
|
6696
7029
|
*
|
|
@@ -6735,6 +7068,29 @@ declare class Store$1 extends BaseClass {
|
|
|
6735
7068
|
* is that `store.request` will convert the response into a {@link ReactiveDocument}
|
|
6736
7069
|
* containing {@link Store.instantiateRecord | ReactiveResources}.
|
|
6737
7070
|
*
|
|
7071
|
+
* A {@link ReactiveDocument} is either a {@link ReactiveDataDocument} (`content.data` holds
|
|
7072
|
+
* the resource(s)) or a {@link ReactiveErrorDocument} (`content.errors` holds the API's error
|
|
7073
|
+
* objects), depending on whether the `Future` resolves or rejects; both carry the response's
|
|
7074
|
+
* `content.meta`. Read either state reactively with {@link getRequestState} or the
|
|
7075
|
+
* `<Request />` component instead of always `await`-ing the `Future` directly — see
|
|
7076
|
+
* [Using the Response](/guides/the-manual/requests/using-the-response.md).
|
|
7077
|
+
*
|
|
7078
|
+
* #### Typing The Response
|
|
7079
|
+
*
|
|
7080
|
+
* `request<RT>` accepts an explicit type argument, but the more common path is to let it be
|
|
7081
|
+
* inferred: build the request with {@link withResponseType} (or {@link withReactiveResponse}
|
|
7082
|
+
* for the common reactive-document case), or with a builder from `@warp-drive-mirror/utilities` as
|
|
7083
|
+
* described above, and `RT` is inferred from the request object itself. See
|
|
7084
|
+
* [Typing Requests](/guides/the-manual/requests/typing-requests.md) for the full mechanism.
|
|
7085
|
+
*
|
|
7086
|
+
* @example
|
|
7087
|
+
* ```ts
|
|
7088
|
+
* import { findRecord } from '@warp-drive-mirror/utilities/json-api';
|
|
7089
|
+
*
|
|
7090
|
+
* const { content } = await store.request(findRecord('user', '1'));
|
|
7091
|
+
* content.data; // ReactiveResource, typed from the builder's response type
|
|
7092
|
+
* ```
|
|
7093
|
+
*
|
|
6738
7094
|
* @public
|
|
6739
7095
|
*/
|
|
6740
7096
|
request<RT>(requestConfig: StoreRequestInput<RT>): Future<RT>;
|
|
@@ -7281,6 +7637,7 @@ the has-many.
|
|
|
7281
7637
|
We call the record to which a relationship belongs-to the
|
|
7282
7638
|
relationship's _owner_.
|
|
7283
7639
|
|
|
7640
|
+
@summary Legacy mutable reactive array holding the related records of a legacy or linksMode has-many relationship.
|
|
7284
7641
|
@public
|
|
7285
7642
|
*/
|
|
7286
7643
|
interface LegacyManyArray<T = unknown> extends ReactiveResourceArray<T> {
|
|
@@ -7547,10 +7904,14 @@ interface PrivateReactiveResource extends ReactiveResource {
|
|
|
7547
7904
|
* and a ResourceKey to transform data from the cache into a rich, reactive
|
|
7548
7905
|
* object.
|
|
7549
7906
|
*
|
|
7907
|
+
* The [ResourceSchemas](/guides/the-manual/schemas/resources/) guide shows how to
|
|
7908
|
+
* define the schema it reads.
|
|
7909
|
+
*
|
|
7550
7910
|
* This class is not directly instantiable. To use it, you should
|
|
7551
7911
|
* configure the store's `instantiateRecord` and `teardownRecord` hooks
|
|
7552
7912
|
* with the matching hooks provided by this package.
|
|
7553
7913
|
*
|
|
7914
|
+
* @summary The rich, reactive record object that presents a resource's cached data through its `ResourceSchema`.
|
|
7554
7915
|
* @hideconstructor
|
|
7555
7916
|
* @public
|
|
7556
7917
|
*/
|
|
@@ -7576,6 +7937,8 @@ declare class ReactiveResource {
|
|
|
7576
7937
|
* Edits to editable resources will be automatically committed if a new
|
|
7577
7938
|
* payload from the cache matches their existing value.
|
|
7578
7939
|
*
|
|
7940
|
+
* @summary Resolves with an editable copy of an immutable `ReactiveResource` so its fields can be
|
|
7941
|
+
* changed locally.
|
|
7579
7942
|
* @public
|
|
7580
7943
|
*
|
|
7581
7944
|
* @returns a promise that resolves to the editable resource
|
|
@@ -7590,6 +7953,8 @@ declare function checkout<T>(resource: unknown): Promise<T & ReactiveResource>;
|
|
|
7590
7953
|
* approach is for either the API or a Handler to reflect saved
|
|
7591
7954
|
* changes back to update the cache.
|
|
7592
7955
|
*
|
|
7956
|
+
* @summary Forcibly makes an editable resource's local changes its new remote (immutable) state,
|
|
7957
|
+
* bypassing a save round-trip.
|
|
7593
7958
|
* @public
|
|
7594
7959
|
*/
|
|
7595
7960
|
declare function commit(record: ReactiveResource): Promise<void>;
|
|
@@ -7604,6 +7969,8 @@ declare function commit(record: ReactiveResource): Promise<void>;
|
|
|
7604
7969
|
* schema is `legacy`, matching the historical behavior of assigning initial
|
|
7605
7970
|
* properties when creating a new legacy record.
|
|
7606
7971
|
*
|
|
7972
|
+
* @summary Default store `instantiateRecord` hook that creates a `ReactiveResource` for a resource key
|
|
7973
|
+
* from its registered schema.
|
|
7607
7974
|
* @public
|
|
7608
7975
|
*/
|
|
7609
7976
|
declare function instantiateRecord(store: Store$1, identifier: ResourceKey, createArgs?: Record<string, unknown>): ReactiveResource;
|
|
@@ -7612,6 +7979,8 @@ declare function instantiateRecord(store: Store$1, identifier: ResourceKey, crea
|
|
|
7612
7979
|
* that `record` is a {@link ReactiveResource} and invokes its `Destroy`
|
|
7613
7980
|
* behavior.
|
|
7614
7981
|
*
|
|
7982
|
+
* @summary Default store `teardownRecord` hook that destroys a `ReactiveResource` when the store
|
|
7983
|
+
* releases it.
|
|
7615
7984
|
* @public
|
|
7616
7985
|
*/
|
|
7617
7986
|
declare function teardownRecord(record: unknown): void;
|
|
@@ -7625,6 +7994,9 @@ declare function teardownRecord(record: unknown): void;
|
|
|
7625
7994
|
* A basic Fetch Handler which converts a request into a
|
|
7626
7995
|
* `fetch` call presuming the response to be `json`.
|
|
7627
7996
|
*
|
|
7997
|
+
* The [Making Requests](/guides/the-manual/requests/#requests-do-not-need-to-use-fetch)
|
|
7998
|
+
* guide shows where it sits in the handler chain.
|
|
7999
|
+
*
|
|
7628
8000
|
* ```ts
|
|
7629
8001
|
* import { RequestManager, Fetch } from '@warp-drive-mirror/core';
|
|
7630
8002
|
*
|
|
@@ -7632,6 +8004,8 @@ declare function teardownRecord(record: unknown): void;
|
|
|
7632
8004
|
* .use([Fetch]);
|
|
7633
8005
|
* ```
|
|
7634
8006
|
*
|
|
8007
|
+
* @summary Terminal request handler that sends the request with native `fetch` and resolves with the
|
|
8008
|
+
* parsed JSON body, turning HTTP failures into errors.
|
|
7635
8009
|
* @public
|
|
7636
8010
|
* @badge Handler
|
|
7637
8011
|
*/
|
|
@@ -7677,6 +8051,9 @@ type Store = {
|
|
|
7677
8051
|
* Interface of a parsed Cache-Control header value.
|
|
7678
8052
|
*
|
|
7679
8053
|
* - [MDN Cache-Control Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control)
|
|
8054
|
+
*
|
|
8055
|
+
* @summary The directives of a `Cache-Control` header as an object of flags and second counts, as
|
|
8056
|
+
* returned by `parseCacheControl`.
|
|
7680
8057
|
*/
|
|
7681
8058
|
interface CacheControlValue {
|
|
7682
8059
|
/** Indicates the response will never change; parsed but not currently used by this cache policy's expiration logic. */
|
|
@@ -7732,6 +8109,8 @@ interface CacheControlValue {
|
|
|
7732
8109
|
*
|
|
7733
8110
|
* See also {@link CacheControlValue} and [Response Directives](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control#response_directives)
|
|
7734
8111
|
*
|
|
8112
|
+
* @summary Parses a `Cache-Control` header string into a `CacheControlValue` object, caching results
|
|
8113
|
+
* per header string.
|
|
7735
8114
|
* @public
|
|
7736
8115
|
*/
|
|
7737
8116
|
declare function parseCacheControl(header: string): CacheControlValue;
|
|
@@ -7794,6 +8173,9 @@ interface PolicyConfigConstraints {
|
|
|
7794
8173
|
/**
|
|
7795
8174
|
* The configuration options for the {@link DefaultCachePolicy}
|
|
7796
8175
|
*
|
|
8176
|
+
* The [Advanced Store Configuration](/guides/configuration/advanced#decide-how-long-requests-are-valid-for-with-a-cachepolicy)
|
|
8177
|
+
* guide shows a policy configured with them.
|
|
8178
|
+
*
|
|
7797
8179
|
* ```ts [app/services/store.ts]
|
|
7798
8180
|
* import { Store } from '@warp-drive-mirror/core';
|
|
7799
8181
|
* import { DefaultCachePolicy } from '@warp-drive-mirror/core/store'; // [!code focus]
|
|
@@ -7805,6 +8187,8 @@ interface PolicyConfigConstraints {
|
|
|
7805
8187
|
* }
|
|
7806
8188
|
* ```
|
|
7807
8189
|
*
|
|
8190
|
+
* @summary Options for `DefaultCachePolicy`: soft and hard expiration times, header-based expiration
|
|
8191
|
+
* constraints, and test-mode behavior.
|
|
7808
8192
|
*/
|
|
7809
8193
|
interface PolicyConfig {
|
|
7810
8194
|
/**
|
|
@@ -7885,6 +8269,9 @@ interface PolicyConfig {
|
|
|
7885
8269
|
/**
|
|
7886
8270
|
* A basic {@link CachePolicy} that can be added to the Store service.
|
|
7887
8271
|
*
|
|
8272
|
+
* The [Advanced Store Configuration](/guides/configuration/advanced#decide-how-long-requests-are-valid-for-with-a-cachepolicy)
|
|
8273
|
+
* guide shows how to configure it.
|
|
8274
|
+
*
|
|
7888
8275
|
* ```ts [app/services/store.ts]
|
|
7889
8276
|
* import { Store } from '@warp-drive-mirror/core';
|
|
7890
8277
|
* import { DefaultCachePolicy } from '@warp-drive-mirror/core/store'; // [!code focus]
|
|
@@ -7962,6 +8349,8 @@ interface PolicyConfig {
|
|
|
7962
8349
|
* This behavior can be opted out of by setting `disableTestOptimization = true`
|
|
7963
8350
|
* in the policy config.
|
|
7964
8351
|
*
|
|
8352
|
+
* @summary The built-in cache policy, which expires cached requests using expiration headers or time
|
|
8353
|
+
* since the response `date`, and invalidates queries after matching creates.
|
|
7965
8354
|
* @public
|
|
7966
8355
|
*/
|
|
7967
8356
|
declare class DefaultCachePolicy implements CachePolicy {
|
|
@@ -8044,11 +8433,15 @@ declare class DefaultCachePolicy implements CachePolicy {
|
|
|
8044
8433
|
//#endregion
|
|
8045
8434
|
//#region src/index.d.ts
|
|
8046
8435
|
/**
|
|
8436
|
+
* @summary Deprecated alias for `ReactiveDocument`, the reactive wrapper around a request's response document.
|
|
8047
8437
|
* @deprecated use {@link ReactiveDocument} instead
|
|
8048
8438
|
*/
|
|
8049
8439
|
type Document<T, M extends Meta | undefined = Meta | undefined, E extends object = object, EM extends Meta | undefined = M> = ReactiveDocument<T, M, E, EM>;
|
|
8050
8440
|
/**
|
|
8051
8441
|
* Options for setting up a Store instance with `useRecommendedStore`.
|
|
8442
|
+
*
|
|
8443
|
+
* @summary Configures the cache, cache policy, request handlers, schemas, and schema extensions that
|
|
8444
|
+
* `useRecommendedStore` wires into a Store class.
|
|
8052
8445
|
*/
|
|
8053
8446
|
interface StoreSetupOptions<T extends Cache = Cache> {
|
|
8054
8447
|
/**
|
|
@@ -8133,6 +8526,9 @@ declare class ConfiguredStore<T extends {
|
|
|
8133
8526
|
* Creates a configured Store class with recommended defaults
|
|
8134
8527
|
* for schema handling, reactivity, caching, and request management.
|
|
8135
8528
|
*
|
|
8529
|
+
* The [Setup](/guides/configuration/#configure-the-store) guide walks through
|
|
8530
|
+
* configuring the store with it.
|
|
8531
|
+
*
|
|
8136
8532
|
* ```ts
|
|
8137
8533
|
* import { useRecommendedStore } from '@warp-drive-mirror/core';
|
|
8138
8534
|
* import { JSONAPICache } from '@warp-drive-mirror/json-api';
|
|
@@ -8235,6 +8631,9 @@ declare class ConfiguredStore<T extends {
|
|
|
8235
8631
|
* {@link RequestManager} won't have it set unless the caller supplies it
|
|
8236
8632
|
* explicitly, so a handler relying on it should treat it as optional (as
|
|
8237
8633
|
* `LoggingHandler` does above).
|
|
8634
|
+
*
|
|
8635
|
+
* @summary Builds a Store subclass preconfigured with the given cache, schemas, and handlers, plus
|
|
8636
|
+
* `Fetch`, `CacheHandler`, and a default cache policy.
|
|
8238
8637
|
*/
|
|
8239
8638
|
declare function useRecommendedStore<T extends Cache, Policy extends CachePolicy>(options: StoreSetupOptions<T> & {
|
|
8240
8639
|
policy: Policy;
|
|
@@ -8255,6 +8654,8 @@ declare function useRecommendedStore<T extends Cache>(options: StoreSetupOptions
|
|
|
8255
8654
|
* The state of a promise in the "pending"
|
|
8256
8655
|
* state. This is the default initial state.
|
|
8257
8656
|
*
|
|
8657
|
+
* @summary The `getPromiseState` state for a promise that has not yet settled, with `isPending` true and
|
|
8658
|
+
* no value or reason.
|
|
8258
8659
|
*/
|
|
8259
8660
|
interface PendingPromise {
|
|
8260
8661
|
/**
|
|
@@ -8318,6 +8719,8 @@ interface PendingPromise {
|
|
|
8318
8719
|
* This is the state of a promise that has resolved
|
|
8319
8720
|
* successfully.
|
|
8320
8721
|
*
|
|
8722
|
+
* @summary The `getPromiseState` state for a promise that resolved, with `isSuccess` true and the
|
|
8723
|
+
* resolved `value`.
|
|
8321
8724
|
*/
|
|
8322
8725
|
interface ResolvedPromise<T> {
|
|
8323
8726
|
/**
|
|
@@ -8381,6 +8784,8 @@ interface ResolvedPromise<T> {
|
|
|
8381
8784
|
* This is the state of a promise that has rejected
|
|
8382
8785
|
* with an error.
|
|
8383
8786
|
*
|
|
8787
|
+
* @summary The `getPromiseState` state for a promise that rejected, with `isError` true and the
|
|
8788
|
+
* rejection `reason`.
|
|
8384
8789
|
*/
|
|
8385
8790
|
interface RejectedPromise<E> {
|
|
8386
8791
|
/**
|
|
@@ -8448,11 +8853,16 @@ interface RejectedPromise<E> {
|
|
|
8448
8853
|
* - {@link ResolvedPromise}
|
|
8449
8854
|
* - {@link RejectedPromise}
|
|
8450
8855
|
*
|
|
8856
|
+
* @summary The reactive pending, fulfilled, or rejected state of a promise, as returned by
|
|
8857
|
+
* `getPromiseState`.
|
|
8451
8858
|
*/
|
|
8452
8859
|
type PromiseState<T = unknown, E = unknown> = PendingPromise | ResolvedPromise<T> | RejectedPromise<E>;
|
|
8453
8860
|
/**
|
|
8454
8861
|
* Returns a reactive state-machine for the provided promise or awaitable.
|
|
8455
8862
|
*
|
|
8863
|
+
* The [Async as Reactive State](/guides/the-manual/reactivity/derivation) guide shows
|
|
8864
|
+
* how to use it in place of tracked loading and error state.
|
|
8865
|
+
*
|
|
8456
8866
|
* Repeat calls to `getPromiseState` with the same promise will return the same state object
|
|
8457
8867
|
* making is safe and easy to use in templates and JavaScript code to produce reactive
|
|
8458
8868
|
* behaviors around promises.
|
|
@@ -8502,6 +8912,9 @@ type PromiseState<T = unknown, E = unknown> = PendingPromise | ResolvedPromise<T
|
|
|
8502
8912
|
* If looking to use in a template, consider also the `<Await />` component.
|
|
8503
8913
|
*
|
|
8504
8914
|
* See also {@link PromiseState}
|
|
8915
|
+
*
|
|
8916
|
+
* @summary Returns a cached, reactive state object tracking whether a promise is pending, fulfilled, or
|
|
8917
|
+
* rejected, for use in JS or templates.
|
|
8505
8918
|
*/
|
|
8506
8919
|
declare function getPromiseState<T = unknown, E = unknown>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
8507
8920
|
//#endregion
|
|
@@ -8511,6 +8924,8 @@ declare function getPromiseState<T = unknown, E = unknown>(promise: Promise<T> |
|
|
|
8511
8924
|
* reactive properties that can be used to build UIs that respond
|
|
8512
8925
|
* to the progress of a request.
|
|
8513
8926
|
*
|
|
8927
|
+
* @summary Reactive download progress for a request, such as bytes loaded and timing, built by lazily
|
|
8928
|
+
* reading its response stream.
|
|
8514
8929
|
* @hideconstructor
|
|
8515
8930
|
*/
|
|
8516
8931
|
declare class RequestLoadingState {
|
|
@@ -8730,9 +9145,11 @@ interface RejectedRequest<RT, E extends StructuredErrorDocument = StructuredErro
|
|
|
8730
9145
|
response: Response | ResponseInfo | null;
|
|
8731
9146
|
}
|
|
8732
9147
|
/**
|
|
8733
|
-
* The state of a request
|
|
8734
|
-
*
|
|
8735
|
-
* cancelled
|
|
9148
|
+
* The state of a request that was aborted before it settled.
|
|
9149
|
+
*
|
|
9150
|
+
* A cancelled request has `status: 'cancelled'` and its `reason` is an
|
|
9151
|
+
* `AbortError`. `isError` is also `true`, as for a {@link RejectedRequest},
|
|
9152
|
+
* so check `status` or `isCancelled` to tell the two apart.
|
|
8736
9153
|
*
|
|
8737
9154
|
*/
|
|
8738
9155
|
interface CancelledRequest<RT, E extends StructuredErrorDocument = StructuredErrorDocument> {
|
|
@@ -8866,11 +9283,33 @@ interface CancelledRequest<RT, E extends StructuredErrorDocument = StructuredErr
|
|
|
8866
9283
|
* - {@link RejectedRequest}
|
|
8867
9284
|
* - {@link CancelledRequest}
|
|
8868
9285
|
*
|
|
9286
|
+
* @summary The reactive pending, fulfilled, rejected, or cancelled state of a request `Future`, as
|
|
9287
|
+
* returned by `getRequestState`.
|
|
8869
9288
|
*/
|
|
8870
9289
|
type RequestState<RT = unknown, E extends StructuredErrorDocument = StructuredErrorDocument> = PendingRequest | ResolvedRequest<RT> | RejectedRequest<RT, E> | CancelledRequest<RT, E>;
|
|
8871
9290
|
/**
|
|
8872
9291
|
* `getRequestState` can be used in both JavaScript and Template contexts.
|
|
8873
9292
|
*
|
|
9293
|
+
* It returns a {@link RequestState}: a reactive object that updates as the
|
|
9294
|
+
* request advances. Calling it again with the same {@link Future} returns the
|
|
9295
|
+
* same object. Check `status` to narrow it to one of four states:
|
|
9296
|
+
*
|
|
9297
|
+
* - {@link PendingRequest} (`'pending'`) is the initial state, before the
|
|
9298
|
+
* request settles.
|
|
9299
|
+
* - {@link ResolvedRequest} (`'fulfilled'`) holds the response content on `value`.
|
|
9300
|
+
* - {@link RejectedRequest} (`'rejected'`) holds the error on `reason`.
|
|
9301
|
+
* - {@link CancelledRequest} (`'cancelled'`) is a request that was aborted.
|
|
9302
|
+
* `isError` is also `true` for a cancelled request, so check `status` or
|
|
9303
|
+
* `isCancelled` rather than `isError` if you handle it differently.
|
|
9304
|
+
*
|
|
9305
|
+
* Every state also exposes a {@link RequestLoadingState} on `loadingState`
|
|
9306
|
+
* for tracking the progress of the response stream.
|
|
9307
|
+
*
|
|
9308
|
+
* The [Reactive Control Flow](/guides/the-manual/reactivity/control-flow) guide shows
|
|
9309
|
+
* how to render request states with it, and
|
|
9310
|
+
* [Using The Response](/guides/the-manual/requests/using-the-response) covers the
|
|
9311
|
+
* `Future` it reads.
|
|
9312
|
+
*
|
|
8874
9313
|
* ```ts
|
|
8875
9314
|
* import { getRequestState } from '@warp-drive-mirror/ember';
|
|
8876
9315
|
*
|
|
@@ -8917,6 +9356,10 @@ type RequestState<RT = unknown, E extends StructuredErrorDocument = StructuredEr
|
|
|
8917
9356
|
* which offers a number of additional capabilities for requests *beyond* what
|
|
8918
9357
|
* `RequestState` provides.
|
|
8919
9358
|
*
|
|
9359
|
+
* @param future - the request {@link Future} to track, as returned by `store.request` or `requestManager.request`
|
|
9360
|
+
* @return the cached {@link RequestState} for `future`
|
|
9361
|
+
* @summary Returns a cached, reactive state object tracking a request `Future` through pending, success,
|
|
9362
|
+
* error, and cancellation.
|
|
8920
9363
|
*/
|
|
8921
9364
|
declare function getRequestState<RT, E>(future: Future<RT>): Readonly<RequestState<RT, StructuredErrorDocument<E>>>;
|
|
8922
9365
|
//#endregion
|
|
@@ -8929,16 +9372,25 @@ declare const DISPOSE: "(symbol) dispose";
|
|
|
8929
9372
|
/**
|
|
8930
9373
|
* The individual autorefresh strategies a {@link RequestSubscription}
|
|
8931
9374
|
* may combine, see {@link AutorefreshBehaviorCombos}.
|
|
9375
|
+
*
|
|
9376
|
+
* @summary One autorefresh trigger for a request subscription: on reconnecting (`online`), on a timer
|
|
9377
|
+
* (`interval`), or on store invalidation (`invalid`).
|
|
8932
9378
|
*/
|
|
8933
9379
|
type AutorefreshBehaviorType = "online" | "interval" | "invalid";
|
|
8934
9380
|
/**
|
|
8935
9381
|
* The value accepted by {@link SubscriptionArgs.autorefresh}: either a
|
|
8936
9382
|
* boolean, a single {@link AutorefreshBehaviorType}, or a comma-separated
|
|
8937
9383
|
* combination of up to three of them.
|
|
9384
|
+
*
|
|
9385
|
+
* @summary The accepted values for a request subscription's `autorefresh` option: a boolean or a
|
|
9386
|
+
* comma-separated mix of `online`, `interval`, and `invalid`.
|
|
8938
9387
|
*/
|
|
8939
9388
|
type AutorefreshBehaviorCombos = boolean | AutorefreshBehaviorType | `${AutorefreshBehaviorType},${AutorefreshBehaviorType}` | `${AutorefreshBehaviorType},${AutorefreshBehaviorType},${AutorefreshBehaviorType}`;
|
|
8940
9389
|
/**
|
|
8941
9390
|
* Utilities to assist in recovering from the error.
|
|
9391
|
+
*
|
|
9392
|
+
* @summary The online and visibility state plus a `retry` function that a request subscription exposes
|
|
9393
|
+
* for recovering from a failed request.
|
|
8942
9394
|
*/
|
|
8943
9395
|
interface RecoveryFeatures {
|
|
8944
9396
|
/**
|
|
@@ -8956,6 +9408,9 @@ interface RecoveryFeatures {
|
|
|
8956
9408
|
}
|
|
8957
9409
|
/**
|
|
8958
9410
|
* Utilities for keeping the request fresh
|
|
9411
|
+
*
|
|
9412
|
+
* @summary The online, visibility, and refreshing state plus `refresh`, `reload`, and `abort` functions a
|
|
9413
|
+
* request subscription exposes alongside successful content.
|
|
8959
9414
|
*/
|
|
8960
9415
|
interface ContentFeatures<RT> {
|
|
8961
9416
|
/**
|
|
@@ -8989,6 +9444,9 @@ interface ContentFeatures<RT> {
|
|
|
8989
9444
|
}
|
|
8990
9445
|
/**
|
|
8991
9446
|
* The args accepted by the `<Request />` component.
|
|
9447
|
+
*
|
|
9448
|
+
* @summary The arguments of the `<Request />` component: the request or query to run, autorefresh
|
|
9449
|
+
* options, and an optional store or subscription.
|
|
8992
9450
|
*/
|
|
8993
9451
|
interface RequestArgs<RT, E> extends SubscriptionArgs<RT, E> {
|
|
8994
9452
|
/**
|
|
@@ -9007,6 +9465,8 @@ interface RequestArgs<RT, E> extends SubscriptionArgs<RT, E> {
|
|
|
9007
9465
|
}
|
|
9008
9466
|
/**
|
|
9009
9467
|
* The args accepted by a {@link RequestSubscription}.
|
|
9468
|
+
*
|
|
9469
|
+
* @summary Options for a request subscription: the request or query to monitor and its autorefresh settings.
|
|
9010
9470
|
*/
|
|
9011
9471
|
interface SubscriptionArgs<RT, E> {
|
|
9012
9472
|
/**
|
|
@@ -9071,6 +9531,8 @@ interface RequestSubscription<RT, E> {
|
|
|
9071
9531
|
/**
|
|
9072
9532
|
* A reactive class
|
|
9073
9533
|
*
|
|
9534
|
+
* @summary Reactive subscription that monitors a request or query, tracking online, visibility and refresh state and
|
|
9535
|
+
* handling autorefresh, reload and retry.
|
|
9074
9536
|
* @hideconstructor
|
|
9075
9537
|
*/
|
|
9076
9538
|
declare class RequestSubscription<RT, E> {
|
|
@@ -9135,6 +9597,9 @@ declare class RequestSubscription<RT, E> {
|
|
|
9135
9597
|
/**
|
|
9136
9598
|
* Creates a {@link RequestSubscription}, the reactive class powering the
|
|
9137
9599
|
* `<Request />` component's autorefresh, retry, and refresh behaviors.
|
|
9600
|
+
*
|
|
9601
|
+
* @summary Creates a reactive subscription to a request or query that tracks its state and handles
|
|
9602
|
+
* autorefresh, retry, and refresh.
|
|
9138
9603
|
*/
|
|
9139
9604
|
declare function createRequestSubscription<RT, E>(store: Store$1 | RequestManager, args: SubscriptionArgs<RT, E>): RequestSubscription<RT, E>;
|
|
9140
9605
|
//#endregion
|
|
@@ -9261,5 +9726,5 @@ declare function peekInternalSignal(signals: SignalStore | undefined, key: strin
|
|
|
9261
9726
|
*/
|
|
9262
9727
|
declare function notifyInternalSignal(signal: WarpDriveSignal | undefined): void;
|
|
9263
9728
|
//#endregion
|
|
9264
|
-
export {
|
|
9265
|
-
//# sourceMappingURL=internal-
|
|
9729
|
+
export { PrivateStore as $, STRUCTURED as $n, CacheCapabilitiesManager$1 as $t, Document as A, LegacyResourceQuery as An, CachePolicy as At, PrivateReactiveResource as B, HTTPMethod as Bn, createDeferred as Bt, getRequestState as C, Transformation as Cn, setRecordIdentifier as Ct, ResolvedPromise as D, BaseFinderOptions as Dn, ReactiveDataDocument as Dt, RejectedPromise as E, withDefaults as En, assertPrivateCapabilities as Et, PolicyConfig as F, CreateRequestOptions as Fn, withReactiveResponse as Ft, logGroup as G, ImmutableRequestInfo as Gn, GraphEdge as Gt, checkout as H, ImmutableCreateRequestOptions as Hn, peekGraph as Ht, parseCacheControl as I, DeleteRequestOptions as In, withResponseType as It, normalizeModelName as J, QueryRequestOptions as Jn, CollectionEdge as Jt, LegacyManyArray as K, ImmutableUpdateRequestOptions as Kn, ResourceEdge as Kt, Fetch as L, EnableHydration as Ln, Awaitable as Lt, useRecommendedStore as M, ModelSchema as Mn, StoreRequestContext as Mt, CacheControlValue as N, CacheOptions as Nn, StoreRequestInput as Nt, getPromiseState as O, FindAllOptions as On, ReactiveDocument as Ot, DefaultCachePolicy as P, ConstrainedRequestOptions as Pn, withBrand as Pt, CreateRecordProperties as Q, ResponseInfo as Qn, RelationshipDiff as Qt, instantiateRecord as R, FindRecordOptions$2 as Rn, getPromiseResult as Rt, ResolvedRequest as S, SchemaService$1 as Sn, recordIdentifierFor as St, PromiseState as T, registerDerivations as Tn, PrivateCacheCapabilitiesManager as Tt, commit as U, ImmutableDeleteRequestOptions as Un, isBelongsTo as Ut, ReactiveResource as V, IS_FUTURE as Vn, graphFor as Vt, log as W, ImmutableHeaders as Wn, Graph as Wt, ensureStringId as X, RequestContext as Xn, Cache as Xt, coerceId as Y, RemotelyAccessibleIdentifier as Yn, UpgradedMeta as Yt, constructResource as Z, RequestInfo as Zn, ChangedAttributesHash as Zt, CancelledRequest as _, SchemaService as _n, Context as _t, notifyInternalSignal as a, NotifyKeys as an, FetchError as ar, Request$1 as at, RequestLoadingState as b, ExtensionDef as bn, StoreMap as bt, AutorefreshBehaviorCombos as c, isRequestKey as cn, Deferred as cr, SaveRecordMutation as ct, DISPOSE as d, setIdentifierGenerationMethod as dn, ManagedRequestPriority as dr, LegacyQueryArray as dt, CacheOperation$1 as en, SkipCache as er, Store$1 as et, RecoveryFeatures as f, setIdentifierResetMethod as fn, NextFn as fr, LegacyLiveArray as ft, createRequestSubscription as g, RelationshipsSchema as gn, Checkout as gt, SubscriptionArgs as h, AttributesSchema as hn, ManagedArray as ht, makeInitializer as i, NotificationType as in, UpdateRequestOptions as ir, PrivateRequestStateService as it, StoreSetupOptions as j, QueryOptions as jn, CacheHandler as jt, ConfiguredStore as k, FindRecordOptions as kn, ReactiveErrorDocument as kt, AutorefreshBehaviorType as l, isResourceKey as ln, Future as lr, RecordArrayManager as lt, RequestSubscription as m, setKeyInfoForResource as mn, ReactiveResourceArray as mt, WarpDriveSignal as n, NotificationChannel as nn, StructuredDocument as nr, isPrivateStore as nt, peekInternalSignal as o, FieldValueIdentity as on, Context$1 as or, RequestCacheRequestState as ot, RequestArgs as p, setIdentifierUpdateMethod as pn, RequestManager as pr, PrivateReactiveResourceArray as pt, createLegacyManyArray as q, PostQueryRequestOptions as qn, ImplicitEdge as qt, getOrCreateInternalSignal as r, NotificationManager$1 as rn, StructuredErrorDocument as rr, FindRecordQuery as rt, withSignalStore as s, fieldValueIdentity as sn, CacheHandler$1 as sr, RequestStateService as st, SignalStore as t, DocumentCacheOperation$1 as tn, StructuredDataDocument as tr, assertPrivateStore as tt, ContentFeatures as u, setIdentifierForgetMethod as un, Handler as ur, fastPush as ut, PendingRequest as v, CAUTION_MEGA_DANGER_ZONE_Extension as vn, NativeProxy as vt, PendingPromise as w, fromIdentity as wn, storeFor as wt, RequestState as x, ProcessedExtension as xn, _clearCaches as xt, RejectedRequest as y, ExtensibleField as yn, InstanceCache as yt, teardownRecord as z, FindRecordRequestOptions as zn, setPromiseResult as zt };
|
|
9730
|
+
//# sourceMappingURL=internal-CgOlgOt3.d.ts.map
|