@warp-drive/core 5.10.0-alpha.0 → 5.10.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{-private-DQW39hCl.js → -private-CjK1Dmuh.js} +3 -3
- package/dist/{-private-DQW39hCl.js.map → -private-CjK1Dmuh.js.map} +1 -1
- package/dist/{-private-BVx3LW79.js → -private-Dtj8O5W7.js} +2 -2
- package/dist/{-private-BVx3LW79.js.map → -private-Dtj8O5W7.js.map} +1 -1
- package/dist/configure.js +1 -1
- package/dist/{document-BEn91SwT.d.ts → document-Ca4ZZBd9.d.ts} +2 -2
- package/dist/{document-BEn91SwT.d.ts.map → document-Ca4ZZBd9.d.ts.map} +1 -1
- package/dist/{error-50OSEhsF.d.ts → error-0uD6GkNX.d.ts} +6 -2
- package/dist/error-0uD6GkNX.d.ts.map +1 -0
- package/dist/graph/-private.d.ts +1 -1
- package/dist/graph/-private.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{internal-DtWOpxrR.d.ts → internal-9XuWZdDv.d.ts} +840 -758
- package/dist/internal-9XuWZdDv.d.ts.map +1 -0
- package/dist/reactive/-private.d.ts +1 -1
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.d.ts +1 -1
- package/dist/reactive.js +3 -3
- package/dist/{request-CVg2OTfv.js → request-Di274pQz.js} +14 -2
- package/dist/{request-CVg2OTfv.js.map → request-Di274pQz.js.map} +1 -1
- package/dist/request.d.ts +1 -1
- package/dist/request.js +1 -1
- package/dist/signals/-leaked.d.ts +16 -16
- package/dist/signals/-leaked.d.ts.map +1 -1
- package/dist/signals/-leaked.js +1 -1
- package/dist/{src-BJWUE7e3.js → src-TlQlgL5V.js} +76 -57
- package/dist/src-TlQlgL5V.js.map +1 -0
- package/dist/store/-private.d.ts +2 -2
- package/dist/store/-private.js +2 -2
- package/dist/store.d.ts +1 -1
- package/dist/types/-private.d.ts +6 -7
- package/dist/types/-private.d.ts.map +1 -1
- package/dist/types/-private.js +116 -2
- package/dist/types/-private.js.map +1 -0
- package/dist/types/cache.d.ts +1 -1
- package/dist/types/request.d.ts +1 -1
- package/dist/types/request.js +1 -1
- package/dist/types/runtime.d.ts +3 -4
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/types/runtime.js +1 -1
- package/dist/types/schema/schema-service.d.ts +1 -1
- package/dist/types/spec/document.d.ts +1 -1
- package/dist/types/spec/error.d.ts +1 -1
- package/dist/types/symbols.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/unpkg/dev/{-private-B9s2h5b6.js → -private-DrQgwtNS.js} +3 -3
- package/dist/unpkg/{dev-deprecated/-private-B9s2h5b6.js.map → dev/-private-DrQgwtNS.js.map} +1 -1
- package/dist/unpkg/dev/{-private-DcPB5DHD.js → -private-Dtj8O5W7.js} +2 -2
- package/dist/unpkg/{prod/-private-BWNdDSOr.js.map → dev/-private-Dtj8O5W7.js.map} +1 -1
- package/dist/unpkg/dev/configure.js +1 -1
- package/dist/unpkg/dev/graph/-private.js +2 -2
- package/dist/unpkg/dev/index.js +1 -1
- package/dist/unpkg/dev/reactive/-private.js +1 -1
- package/dist/unpkg/dev/reactive.js +3 -3
- package/dist/unpkg/{dev-deprecated/request-DEdT4gST.js → dev/request-nAaeDlS9.js} +14 -2
- package/dist/unpkg/dev/{request-DEdT4gST.js.map → request-nAaeDlS9.js.map} +1 -1
- package/dist/unpkg/dev/request.js +1 -1
- package/dist/unpkg/dev/{runtime-FdPeCUwk.js → runtime-vtT5WRY_.js} +2 -2
- package/dist/unpkg/dev/{runtime-FdPeCUwk.js.map → runtime-vtT5WRY_.js.map} +1 -1
- package/dist/unpkg/dev/signals/-leaked.js +1 -1
- package/dist/unpkg/dev/{src-CdRGGxoN.js → src-D8uKAIUN.js} +78 -59
- package/dist/unpkg/dev/src-D8uKAIUN.js.map +1 -0
- package/dist/unpkg/dev/store/-private.js +2 -2
- package/dist/unpkg/dev/{store-BRZE8mQW.js → store-BIFNM_fB.js} +3 -3
- package/dist/unpkg/dev/{store-BRZE8mQW.js.map → store-BIFNM_fB.js.map} +1 -1
- package/dist/unpkg/dev/store.js +1 -1
- package/dist/unpkg/dev/types/-private.js +107 -2
- package/dist/unpkg/dev/types/-private.js.map +1 -0
- package/dist/unpkg/dev/types/request.js +1 -1
- package/dist/unpkg/dev/types/runtime.js +1 -1
- package/dist/unpkg/dev/types/symbols.js +1 -1
- package/dist/unpkg/dev-deprecated/{-private-B9s2h5b6.js → -private-DrQgwtNS.js} +3 -3
- package/dist/unpkg/{dev/-private-B9s2h5b6.js.map → dev-deprecated/-private-DrQgwtNS.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/{-private-DcPB5DHD.js → -private-Dtj8O5W7.js} +2 -2
- package/dist/unpkg/dev-deprecated/{-private-DcPB5DHD.js.map → -private-Dtj8O5W7.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/configure.js +1 -1
- package/dist/unpkg/dev-deprecated/graph/-private.js +3 -3
- package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -1
- package/dist/unpkg/dev-deprecated/index.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive.js +3 -3
- package/dist/unpkg/{dev/request-DEdT4gST.js → dev-deprecated/request-nAaeDlS9.js} +14 -2
- package/dist/unpkg/dev-deprecated/{request-DEdT4gST.js.map → request-nAaeDlS9.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/request.js +1 -1
- package/dist/unpkg/dev-deprecated/{runtime-Klu1azLv.js → runtime-e4oZ_UWz.js} +2 -2
- package/dist/unpkg/dev-deprecated/{runtime-Klu1azLv.js.map → runtime-e4oZ_UWz.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/signals/-leaked.js +1 -1
- package/dist/unpkg/dev-deprecated/{src-Dy15xjRt.js → src-BlewXGbB.js} +81 -62
- package/dist/unpkg/dev-deprecated/src-BlewXGbB.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store/-private.js +2 -2
- package/dist/unpkg/dev-deprecated/{store-C6m5EkF2.js → store-X1WN7P_O.js} +3 -3
- package/dist/unpkg/dev-deprecated/{store-C6m5EkF2.js.map → store-X1WN7P_O.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/store.js +1 -1
- package/dist/unpkg/dev-deprecated/types/-private.js +107 -2
- package/dist/unpkg/dev-deprecated/types/-private.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/request.js +1 -1
- package/dist/unpkg/dev-deprecated/types/runtime.js +1 -1
- package/dist/unpkg/dev-deprecated/types/symbols.js +1 -1
- package/dist/unpkg/prod/{-private-Da3Xoapd.js → -private-Dg1vsF-H.js} +3 -3
- package/dist/unpkg/prod/{-private-Da3Xoapd.js.map → -private-Dg1vsF-H.js.map} +1 -1
- package/dist/unpkg/prod/-private-Dtj8O5W7.js +22 -0
- package/dist/unpkg/{prod-deprecated/-private-BWNdDSOr.js.map → prod/-private-Dtj8O5W7.js.map} +1 -1
- package/dist/unpkg/prod/configure.js +1 -1
- package/dist/unpkg/prod/graph/-private.js +1 -1
- package/dist/unpkg/prod/index.js +1 -1
- package/dist/unpkg/prod/reactive/-private.js +1 -1
- package/dist/unpkg/prod/reactive.js +3 -3
- package/dist/unpkg/{prod-deprecated/request-BP3eOqZa.js → prod/request-DK7nNaAf.js} +14 -2
- package/dist/unpkg/prod/{request-BP3eOqZa.js.map → request-DK7nNaAf.js.map} +1 -1
- package/dist/unpkg/prod/request.js +1 -1
- package/dist/unpkg/prod/signals/-leaked.js +1 -1
- package/dist/unpkg/prod/{src-DZBa2djC.js → src-DGB6WvXW.js} +50 -30
- package/dist/unpkg/prod/src-DGB6WvXW.js.map +1 -0
- package/dist/unpkg/prod/store/-private.js +2 -2
- package/dist/unpkg/prod/types/-private.js +95 -2
- package/dist/unpkg/prod/types/-private.js.map +1 -0
- package/dist/unpkg/prod/types/request.js +1 -1
- package/dist/unpkg/prod/types/runtime.js +1 -1
- package/dist/unpkg/prod/types/symbols.js +1 -1
- package/dist/unpkg/prod-deprecated/{-private-Da3Xoapd.js → -private-Dg1vsF-H.js} +3 -3
- package/dist/unpkg/prod-deprecated/{-private-Da3Xoapd.js.map → -private-Dg1vsF-H.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/{-private-BWNdDSOr.js → -private-Dtj8O5W7.js} +2 -2
- package/dist/unpkg/{dev/-private-DcPB5DHD.js.map → prod-deprecated/-private-Dtj8O5W7.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/configure.js +1 -1
- package/dist/unpkg/prod-deprecated/graph/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/index.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive.js +3 -3
- package/dist/unpkg/{prod/request-BP3eOqZa.js → prod-deprecated/request-DK7nNaAf.js} +14 -2
- package/dist/unpkg/prod-deprecated/{request-BP3eOqZa.js.map → request-DK7nNaAf.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/request.js +1 -1
- package/dist/unpkg/prod-deprecated/signals/-leaked.js +1 -1
- package/dist/unpkg/prod-deprecated/{src-CXgpypVP.js → src-B9AnmJPz.js} +51 -31
- package/dist/unpkg/prod-deprecated/src-B9AnmJPz.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store/-private.js +2 -2
- package/dist/unpkg/prod-deprecated/types/-private.js +95 -2
- package/dist/unpkg/prod-deprecated/types/-private.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/request.js +1 -1
- package/dist/unpkg/prod-deprecated/types/runtime.js +1 -1
- package/dist/unpkg/prod-deprecated/types/symbols.js +1 -1
- package/dist/utils/string.d.ts +3 -4
- package/dist/utils/string.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/-private-do3tS7lK.js +0 -120
- package/dist/-private-do3tS7lK.js.map +0 -1
- package/dist/error-50OSEhsF.d.ts.map +0 -1
- package/dist/internal-DtWOpxrR.d.ts.map +0 -1
- package/dist/src-BJWUE7e3.js.map +0 -1
- package/dist/unpkg/dev/-private-9RWV1Vii.js +0 -111
- package/dist/unpkg/dev/-private-9RWV1Vii.js.map +0 -1
- package/dist/unpkg/dev/src-CdRGGxoN.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-9RWV1Vii.js +0 -111
- package/dist/unpkg/dev-deprecated/-private-9RWV1Vii.js.map +0 -1
- package/dist/unpkg/dev-deprecated/src-Dy15xjRt.js.map +0 -1
- package/dist/unpkg/prod/-private-BWNdDSOr.js +0 -22
- package/dist/unpkg/prod/-private-C2sWpOcv.js +0 -99
- package/dist/unpkg/prod/-private-C2sWpOcv.js.map +0 -1
- package/dist/unpkg/prod/src-DZBa2djC.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-C2sWpOcv.js +0 -99
- package/dist/unpkg/prod-deprecated/-private-C2sWpOcv.js.map +0 -1
- package/dist/unpkg/prod-deprecated/src-CXgpypVP.js.map +0 -1
package/dist/signals/-leaked.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { D as notifyInternalSignal, E as makeInitializer, N as waitFor, O as peekInternalSignal, T as getOrCreateInternalSignal, _ as entangleSignal, a as getPaginationState, b as signal, c as getPaginationCache, h as defineSignal, i as getPaginationLinks, k as withSignalStore, l as DISPOSE, m as defineNonEnumerableSignal, n as createPaginationLinksSubscription, o as clearPaginationCache, p as defineGate, r as createPaginationSubscription, s as defaultPageHints, v as gate, y as memoized } from "../-private-
|
|
1
|
+
import { D as notifyInternalSignal, E as makeInitializer, N as waitFor, O as peekInternalSignal, T as getOrCreateInternalSignal, _ as entangleSignal, a as getPaginationState, b as signal, c as getPaginationCache, h as defineSignal, i as getPaginationLinks, k as withSignalStore, l as DISPOSE, m as defineNonEnumerableSignal, n as createPaginationLinksSubscription, o as clearPaginationCache, p as defineGate, r as createPaginationSubscription, s as defaultPageHints, v as gate, y as memoized } from "../-private-CjK1Dmuh.js";
|
|
2
2
|
|
|
3
3
|
export { DISPOSE, clearPaginationCache, createPaginationLinksSubscription, createPaginationSubscription, defaultPageHints, defineGate, defineNonEnumerableSignal, defineSignal, entangleSignal, gate, getOrCreateInternalSignal, getPaginationCache, getPaginationLinks, getPaginationState, makeInitializer, memoized, notifyInternalSignal, peekInternalSignal, signal, waitFor, withSignalStore };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ARRAY_SIGNAL, C as createInternalMemo, D as notifyInternalSignal, N as waitFor, O as peekInternalSignal, P as willSyncFlushWatchers, S as consumeInternalSignal, T as getOrCreateInternalSignal, _ as entangleSignal, f as createSignalDescriptor, g as entangleInitiallyStaleSignal, h as defineSignal, j as OBJECT_SIGNAL, k as withSignalStore, p as defineGate, w as createInternalSignal, x as Signals } from "./-private-
|
|
1
|
+
import { getOrSetGlobal, peekTransient, peekUniversalTransient, setTransient, setUniversalTransient } from "./types/-private.js";
|
|
2
|
+
import { A as ARRAY_SIGNAL, C as createInternalMemo, D as notifyInternalSignal, N as waitFor, O as peekInternalSignal, P as willSyncFlushWatchers, S as consumeInternalSignal, T as getOrCreateInternalSignal, _ as entangleSignal, f as createSignalDescriptor, g as entangleInitiallyStaleSignal, h as defineSignal, j as OBJECT_SIGNAL, k as withSignalStore, p as defineGate, w as createInternalSignal, x as Signals } from "./-private-CjK1Dmuh.js";
|
|
3
3
|
import { EnableHydration, STRUCTURED, SkipCache } from "./types/request.js";
|
|
4
4
|
import { CACHE_OWNER, DEBUG_CLIENT_ORIGINATED, DEBUG_KEY_TYPE, DEBUG_STALE_CACHE_OWNER } from "./types/identifier.js";
|
|
5
|
-
import { a as upgradePromise, c as executeNextHandler, d as getRequestResult, f as setPromiseResult, l as clearRequestResult, m as assertValidRequest, o as DOMError, p as cloneResponseProperties, s as IS_CACHE_HANDLER, t as withBrand } from "./request-
|
|
5
|
+
import { a as upgradePromise, c as executeNextHandler, d as getRequestResult, f as setPromiseResult, l as clearRequestResult, m as assertValidRequest, o as DOMError, p as cloneResponseProperties, s as IS_CACHE_HANDLER, t as withBrand } from "./request-Di274pQz.js";
|
|
6
6
|
import { getRuntimeConfig, setIsMaybeMirage, setLogging } from "./types/runtime.js";
|
|
7
|
-
import { a as SOURCE, i as Destroy, n as Commit, r as Context, t as Checkout } from "./-private-
|
|
7
|
+
import { a as SOURCE, i as Destroy, n as Commit, r as Context, t as Checkout } from "./-private-Dtj8O5W7.js";
|
|
8
8
|
import { dasherize } from "./utils/string.js";
|
|
9
9
|
import { RecordStore, Type } from "./types/symbols.js";
|
|
10
10
|
import { isResourceSchema } from "./types/schema/fields.js";
|
|
@@ -539,6 +539,57 @@ function isRequestKey(identifier) {
|
|
|
539
539
|
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) return !!identifier && typeof identifier === "object" && "type" in identifier && !("id" in identifier) && identifier.type === "@document" && identifier[CACHE_OWNER] !== void 0;
|
|
540
540
|
else return identifier.type === "@document" && identifier[CACHE_OWNER] !== void 0;
|
|
541
541
|
}
|
|
542
|
+
/**
|
|
543
|
+
* The identity of a field's value, as returned by {@link fieldValueIdentity}.
|
|
544
|
+
* Today only schema-object values (a `schema-object` field, or one element of
|
|
545
|
+
* a `schema-array`) have one: the concrete schema-object type the value
|
|
546
|
+
* resolves to, and the identity hash that type's `ObjectSchema` declares for
|
|
547
|
+
* it, or `null` when the schema declares `identity: null`.
|
|
548
|
+
*/
|
|
549
|
+
/**
|
|
550
|
+
* The identity of `value` as a value of `field`, when the field kind has one.
|
|
551
|
+
*
|
|
552
|
+
* A `schema-object` value, or one element of a `schema-array`, resolves to its
|
|
553
|
+
* concrete schema-object type and the identity hash that type's `ObjectSchema`
|
|
554
|
+
* declares (`null` when the schema declares `identity: null`). A
|
|
555
|
+
* non-polymorphic field names the type directly; a polymorphic field reads it
|
|
556
|
+
* off the value at `options.type` (default `'type'`), or computes it with the
|
|
557
|
+
* hash function named by `field.type` when `options.type` is `'@hash'`.
|
|
558
|
+
*
|
|
559
|
+
* Every other field kind, and any non-object value, has no identity and
|
|
560
|
+
* returns `null`.
|
|
561
|
+
*/
|
|
562
|
+
function fieldValueIdentity(schema, field, value) {
|
|
563
|
+
if (field.kind !== "schema-object" && field.kind !== "schema-array") return null;
|
|
564
|
+
if (!value || typeof value !== "object") return null;
|
|
565
|
+
const rawValue = value;
|
|
566
|
+
let type;
|
|
567
|
+
if (field.options?.polymorphic) {
|
|
568
|
+
const typePath = field.options.type ?? "type";
|
|
569
|
+
if (typePath === "@hash") {
|
|
570
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
571
|
+
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
572
|
+
})(field.type);
|
|
573
|
+
type = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
574
|
+
} else {
|
|
575
|
+
type = rawValue[typePath];
|
|
576
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
577
|
+
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
578
|
+
})(typePath && type && typeof type === "string");
|
|
579
|
+
}
|
|
580
|
+
} else {
|
|
581
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
582
|
+
if (!test) throw new Error(`A non-polymorphic ${field.kind} field must provide a SchemaObject type in its definition`);
|
|
583
|
+
})(field.type);
|
|
584
|
+
type = field.type;
|
|
585
|
+
}
|
|
586
|
+
const hashField = schema.resource({ type }).identity;
|
|
587
|
+
const hash = hashField && hashField.kind === "@hash" ? schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name) : null;
|
|
588
|
+
return {
|
|
589
|
+
type,
|
|
590
|
+
hash
|
|
591
|
+
};
|
|
592
|
+
}
|
|
542
593
|
const _crypto = typeof FastBoot !== "undefined" ? FastBoot.require("crypto") : globalThis.crypto;
|
|
543
594
|
if (macroCondition(getGlobalConfig().WarpDrive.polyfillUUID)) installPolyfill();
|
|
544
595
|
function uuidv4() {
|
|
@@ -1693,7 +1744,8 @@ var CacheManager = class {
|
|
|
1693
1744
|
* Push resource data from a remote source into the cache for this ResourceKey
|
|
1694
1745
|
*
|
|
1695
1746
|
* @public
|
|
1696
|
-
* @return
|
|
1747
|
+
* @return when `hasRecord` is true, the names of the attributes whose persisted value
|
|
1748
|
+
* this push changed, or `undefined` when none did. Otherwise `void`.
|
|
1697
1749
|
*/
|
|
1698
1750
|
upsert(key, data, hasRecord) {
|
|
1699
1751
|
return this.___cache.upsert(key, data, hasRecord);
|
|
@@ -6076,31 +6128,11 @@ var ManagedArray = class {
|
|
|
6076
6128
|
if (field.type) return schema.transformation(field).hydrate(rawValue, field.options ?? null, self.owner);
|
|
6077
6129
|
return rawValue;
|
|
6078
6130
|
}
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
let objectType;
|
|
6085
|
-
if (field.options?.polymorphic) {
|
|
6086
|
-
const typePath = field.options.type ?? "type";
|
|
6087
|
-
if (typePath === "@hash") {
|
|
6088
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
6089
|
-
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
6090
|
-
})(field.type);
|
|
6091
|
-
objectType = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
6092
|
-
} else {
|
|
6093
|
-
objectType = rawValue[typePath];
|
|
6094
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
6095
|
-
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
6096
|
-
})(typePath && objectType && typeof objectType === "string");
|
|
6097
|
-
}
|
|
6098
|
-
} else {
|
|
6099
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
6100
|
-
if (!test) throw new Error(`A non-polymorphic SchemaArrayField must provide a SchemaObject type in its definition`);
|
|
6101
|
-
})(field.type);
|
|
6102
|
-
objectType = field.type;
|
|
6103
|
-
}
|
|
6131
|
+
const identity = fieldValueIdentity(schema, field, rawValue);
|
|
6132
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
6133
|
+
if (!test) throw new Error(`Expected a schema-array element to resolve to a schema-object identity`);
|
|
6134
|
+
})(identity !== null);
|
|
6135
|
+
const { type: objectType, hash } = identity;
|
|
6104
6136
|
/**
|
|
6105
6137
|
* When KeyMode=@hash the ReactiveResource is keyed into
|
|
6106
6138
|
* ManagedRecordRefs by the return value of @hash on the rawValue.
|
|
@@ -6110,8 +6142,10 @@ var ManagedArray = class {
|
|
|
6110
6142
|
*/
|
|
6111
6143
|
let schemaObjectKeyValue;
|
|
6112
6144
|
if (KeyMode === "@hash") {
|
|
6113
|
-
|
|
6114
|
-
|
|
6145
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
6146
|
+
if (!test) throw new Error(`Expected the '${objectType}' schema to declare an identity hash for key: '@hash'`);
|
|
6147
|
+
})(hash !== null);
|
|
6148
|
+
schemaObjectKeyValue = hash;
|
|
6115
6149
|
} else {
|
|
6116
6150
|
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
6117
6151
|
if (KeyMode !== "@identity" && KeyMode !== "@index") {
|
|
@@ -6831,29 +6865,12 @@ function getSchemaObjectField(context) {
|
|
|
6831
6865
|
}
|
|
6832
6866
|
return null;
|
|
6833
6867
|
}
|
|
6834
|
-
const
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
6841
|
-
})(field.type);
|
|
6842
|
-
objectType = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
6843
|
-
} else {
|
|
6844
|
-
objectType = rawValue[typePath];
|
|
6845
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
6846
|
-
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
6847
|
-
})(typePath && objectType && typeof objectType === "string");
|
|
6848
|
-
}
|
|
6849
|
-
} else {
|
|
6850
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
6851
|
-
if (!test) throw new Error(`A non-polymorphic SchemaObjectField must provide a SchemaObject type in its definition`);
|
|
6852
|
-
})(field.type);
|
|
6853
|
-
objectType = field.type;
|
|
6854
|
-
}
|
|
6855
|
-
const hashField = schema.resource({ type: objectType }).identity;
|
|
6856
|
-
const identity = hashField ? schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name) : field.name;
|
|
6868
|
+
const resolved = fieldValueIdentity(store.schema, field, rawValue);
|
|
6869
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => {
|
|
6870
|
+
if (!test) throw new Error(`Expected a schema-object value to resolve to a schema-object identity`);
|
|
6871
|
+
})(resolved !== null);
|
|
6872
|
+
const { type: objectType, hash } = resolved;
|
|
6873
|
+
const identity = hash ?? field.name;
|
|
6857
6874
|
const cachedSchemaObject = signal.value;
|
|
6858
6875
|
if (cachedSchemaObject) {
|
|
6859
6876
|
if (cachedSchemaObject.type === objectType && cachedSchemaObject.identity === identity) return cachedSchemaObject.value;
|
|
@@ -7023,6 +7040,8 @@ const IgnoredGlobalFields = /* @__PURE__ */ new Set([
|
|
|
7023
7040
|
"then",
|
|
7024
7041
|
"setInterval",
|
|
7025
7042
|
"document",
|
|
7043
|
+
"unknownProperty",
|
|
7044
|
+
"size",
|
|
7026
7045
|
STRUCTURED
|
|
7027
7046
|
]);
|
|
7028
7047
|
const RecordSymbols = /* @__PURE__ */ new Set([
|
|
@@ -9223,5 +9242,5 @@ function useRecommendedStore(options, StoreKlass = Store) {
|
|
|
9223
9242
|
}
|
|
9224
9243
|
|
|
9225
9244
|
//#endregion
|
|
9226
|
-
export {
|
|
9227
|
-
//# sourceMappingURL=src-
|
|
9245
|
+
export { setIdentifierGenerationMethod as A, setRecordIdentifier as C, isRequestKey as D, fieldValueIdentity as E, coerceId as F, ensureStringId as I, log as L, setIdentifierUpdateMethod as M, setKeyInfoForResource as N, isResourceKey as O, normalizeModelName as P, logGroup as R, recordIdentifierFor as S, assertPrivateCapabilities as T, isPrivateStore as _, fromIdentity as a, StoreMap as b, instantiateRecord as c, commit as d, createLegacyManyArray as f, assertPrivateStore as g, Store as h, SchemaService as i, setIdentifierResetMethod as j, setIdentifierForgetMethod as k, teardownRecord as l, CacheHandler as m, RequestManager as n, registerDerivations as o, constructResource as p, Fetch as r, withDefaults as s, useRecommendedStore as t, checkout as u, RecordArrayManager as v, storeFor as w, _clearCaches as x, fastPush as y };
|
|
9246
|
+
//# sourceMappingURL=src-TlQlgL5V.js.map
|