@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
|
@@ -1,14 +1,14 @@
|
|
|
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-DrQgwtNS.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-nAaeDlS9.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-
|
|
8
|
-
import { t as getGlobalConfig } from "./runtime-
|
|
7
|
+
import { a as SOURCE, i as Destroy, n as Commit, r as Context, t as Checkout } from "./-private-Dtj8O5W7.js";
|
|
8
|
+
import { t as getGlobalConfig } from "./runtime-vtT5WRY_.js";
|
|
9
9
|
import { RecordStore, Type } from "./types/symbols.js";
|
|
10
10
|
import { isResourceSchema } from "./types/schema/fields.js";
|
|
11
|
-
import { t as DefaultCachePolicy } from "./store-
|
|
11
|
+
import { t as DefaultCachePolicy } from "./store-BIFNM_fB.js";
|
|
12
12
|
|
|
13
13
|
//#region src/reactive/-private/document.ts
|
|
14
14
|
function urlFromLink(link) {
|
|
@@ -460,6 +460,57 @@ function isResourceKey(identifier) {
|
|
|
460
460
|
function isRequestKey(identifier) {
|
|
461
461
|
return !!identifier && typeof identifier === "object" && "type" in identifier && !("id" in identifier) && identifier.type === "@document" && identifier[CACHE_OWNER] !== void 0;
|
|
462
462
|
}
|
|
463
|
+
/**
|
|
464
|
+
* The identity of a field's value, as returned by {@link fieldValueIdentity}.
|
|
465
|
+
* Today only schema-object values (a `schema-object` field, or one element of
|
|
466
|
+
* a `schema-array`) have one: the concrete schema-object type the value
|
|
467
|
+
* resolves to, and the identity hash that type's `ObjectSchema` declares for
|
|
468
|
+
* it, or `null` when the schema declares `identity: null`.
|
|
469
|
+
*/
|
|
470
|
+
/**
|
|
471
|
+
* The identity of `value` as a value of `field`, when the field kind has one.
|
|
472
|
+
*
|
|
473
|
+
* A `schema-object` value, or one element of a `schema-array`, resolves to its
|
|
474
|
+
* concrete schema-object type and the identity hash that type's `ObjectSchema`
|
|
475
|
+
* declares (`null` when the schema declares `identity: null`). A
|
|
476
|
+
* non-polymorphic field names the type directly; a polymorphic field reads it
|
|
477
|
+
* off the value at `options.type` (default `'type'`), or computes it with the
|
|
478
|
+
* hash function named by `field.type` when `options.type` is `'@hash'`.
|
|
479
|
+
*
|
|
480
|
+
* Every other field kind, and any non-object value, has no identity and
|
|
481
|
+
* returns `null`.
|
|
482
|
+
*/
|
|
483
|
+
function fieldValueIdentity(schema, field, value) {
|
|
484
|
+
if (field.kind !== "schema-object" && field.kind !== "schema-array") return null;
|
|
485
|
+
if (!value || typeof value !== "object") return null;
|
|
486
|
+
const rawValue = value;
|
|
487
|
+
let type;
|
|
488
|
+
if (field.options?.polymorphic) {
|
|
489
|
+
const typePath = field.options.type ?? "type";
|
|
490
|
+
if (typePath === "@hash") {
|
|
491
|
+
((test) => {
|
|
492
|
+
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
493
|
+
})(field.type);
|
|
494
|
+
type = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
495
|
+
} else {
|
|
496
|
+
type = rawValue[typePath];
|
|
497
|
+
((test) => {
|
|
498
|
+
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
499
|
+
})(typePath && type && typeof type === "string");
|
|
500
|
+
}
|
|
501
|
+
} else {
|
|
502
|
+
((test) => {
|
|
503
|
+
if (!test) throw new Error(`A non-polymorphic ${field.kind} field must provide a SchemaObject type in its definition`);
|
|
504
|
+
})(field.type);
|
|
505
|
+
type = field.type;
|
|
506
|
+
}
|
|
507
|
+
const hashField = schema.resource({ type }).identity;
|
|
508
|
+
const hash = hashField && hashField.kind === "@hash" ? schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name) : null;
|
|
509
|
+
return {
|
|
510
|
+
type,
|
|
511
|
+
hash
|
|
512
|
+
};
|
|
513
|
+
}
|
|
463
514
|
const _crypto = typeof FastBoot !== "undefined" ? FastBoot.require("crypto") : globalThis.crypto;
|
|
464
515
|
function uuidv4() {
|
|
465
516
|
((test) => {
|
|
@@ -1561,7 +1612,8 @@ var CacheManager = class {
|
|
|
1561
1612
|
* Push resource data from a remote source into the cache for this ResourceKey
|
|
1562
1613
|
*
|
|
1563
1614
|
* @public
|
|
1564
|
-
* @return
|
|
1615
|
+
* @return when `hasRecord` is true, the names of the attributes whose persisted value
|
|
1616
|
+
* this push changed, or `undefined` when none did. Otherwise `void`.
|
|
1565
1617
|
*/
|
|
1566
1618
|
upsert(key, data, hasRecord) {
|
|
1567
1619
|
return this.___cache.upsert(key, data, hasRecord);
|
|
@@ -5246,31 +5298,11 @@ var ManagedArray = class {
|
|
|
5246
5298
|
if (field.type) return schema.transformation(field).hydrate(rawValue, field.options ?? null, self.owner);
|
|
5247
5299
|
return rawValue;
|
|
5248
5300
|
}
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
let objectType;
|
|
5255
|
-
if (field.options?.polymorphic) {
|
|
5256
|
-
const typePath = field.options.type ?? "type";
|
|
5257
|
-
if (typePath === "@hash") {
|
|
5258
|
-
((test) => {
|
|
5259
|
-
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
5260
|
-
})(field.type);
|
|
5261
|
-
objectType = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
5262
|
-
} else {
|
|
5263
|
-
objectType = rawValue[typePath];
|
|
5264
|
-
((test) => {
|
|
5265
|
-
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
5266
|
-
})(typePath && objectType && typeof objectType === "string");
|
|
5267
|
-
}
|
|
5268
|
-
} else {
|
|
5269
|
-
((test) => {
|
|
5270
|
-
if (!test) throw new Error(`A non-polymorphic SchemaArrayField must provide a SchemaObject type in its definition`);
|
|
5271
|
-
})(field.type);
|
|
5272
|
-
objectType = field.type;
|
|
5273
|
-
}
|
|
5301
|
+
const identity = fieldValueIdentity(schema, field, rawValue);
|
|
5302
|
+
((test) => {
|
|
5303
|
+
if (!test) throw new Error(`Expected a schema-array element to resolve to a schema-object identity`);
|
|
5304
|
+
})(identity !== null);
|
|
5305
|
+
const { type: objectType, hash } = identity;
|
|
5274
5306
|
/**
|
|
5275
5307
|
* When KeyMode=@hash the ReactiveResource is keyed into
|
|
5276
5308
|
* ManagedRecordRefs by the return value of @hash on the rawValue.
|
|
@@ -5280,8 +5312,10 @@ var ManagedArray = class {
|
|
|
5280
5312
|
*/
|
|
5281
5313
|
let schemaObjectKeyValue;
|
|
5282
5314
|
if (KeyMode === "@hash") {
|
|
5283
|
-
|
|
5284
|
-
|
|
5315
|
+
((test) => {
|
|
5316
|
+
if (!test) throw new Error(`Expected the '${objectType}' schema to declare an identity hash for key: '@hash'`);
|
|
5317
|
+
})(hash !== null);
|
|
5318
|
+
schemaObjectKeyValue = hash;
|
|
5285
5319
|
} else {
|
|
5286
5320
|
if (KeyMode !== "@identity" && KeyMode !== "@index") {
|
|
5287
5321
|
((test) => {
|
|
@@ -5992,29 +6026,12 @@ function getSchemaObjectField(context) {
|
|
|
5992
6026
|
}
|
|
5993
6027
|
return null;
|
|
5994
6028
|
}
|
|
5995
|
-
const
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
6002
|
-
})(field.type);
|
|
6003
|
-
objectType = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
6004
|
-
} else {
|
|
6005
|
-
objectType = rawValue[typePath];
|
|
6006
|
-
((test) => {
|
|
6007
|
-
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
6008
|
-
})(typePath && objectType && typeof objectType === "string");
|
|
6009
|
-
}
|
|
6010
|
-
} else {
|
|
6011
|
-
((test) => {
|
|
6012
|
-
if (!test) throw new Error(`A non-polymorphic SchemaObjectField must provide a SchemaObject type in its definition`);
|
|
6013
|
-
})(field.type);
|
|
6014
|
-
objectType = field.type;
|
|
6015
|
-
}
|
|
6016
|
-
const hashField = schema.resource({ type: objectType }).identity;
|
|
6017
|
-
const identity = hashField ? schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name) : field.name;
|
|
6029
|
+
const resolved = fieldValueIdentity(store.schema, field, rawValue);
|
|
6030
|
+
((test) => {
|
|
6031
|
+
if (!test) throw new Error(`Expected a schema-object value to resolve to a schema-object identity`);
|
|
6032
|
+
})(resolved !== null);
|
|
6033
|
+
const { type: objectType, hash } = resolved;
|
|
6034
|
+
const identity = hash ?? field.name;
|
|
6018
6035
|
const cachedSchemaObject = signal.value;
|
|
6019
6036
|
if (cachedSchemaObject) {
|
|
6020
6037
|
if (cachedSchemaObject.type === objectType && cachedSchemaObject.identity === identity) return cachedSchemaObject.value;
|
|
@@ -6184,6 +6201,8 @@ const IgnoredGlobalFields = /* @__PURE__ */ new Set([
|
|
|
6184
6201
|
"then",
|
|
6185
6202
|
"setInterval",
|
|
6186
6203
|
"document",
|
|
6204
|
+
"unknownProperty",
|
|
6205
|
+
"size",
|
|
6187
6206
|
STRUCTURED
|
|
6188
6207
|
]);
|
|
6189
6208
|
const RecordSymbols = /* @__PURE__ */ new Set([
|
|
@@ -8327,5 +8346,5 @@ function useRecommendedStore(options, StoreKlass = Store) {
|
|
|
8327
8346
|
}
|
|
8328
8347
|
|
|
8329
8348
|
//#endregion
|
|
8330
|
-
export {
|
|
8331
|
-
//# sourceMappingURL=src-
|
|
8349
|
+
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 };
|
|
8350
|
+
//# sourceMappingURL=src-D8uKAIUN.js.map
|