@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,15 +1,15 @@
|
|
|
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-
|
|
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
|
-
import { t as getGlobalConfig } from "./runtime-
|
|
9
|
+
import { t as getGlobalConfig } from "./runtime-e4oZ_UWz.js";
|
|
10
10
|
import { RecordStore, Type } from "./types/symbols.js";
|
|
11
11
|
import { isResourceSchema } from "./types/schema/fields.js";
|
|
12
|
-
import { t as DefaultCachePolicy } from "./store-
|
|
12
|
+
import { t as DefaultCachePolicy } from "./store-X1WN7P_O.js";
|
|
13
13
|
import * as _importSync20 from "@ember/object";
|
|
14
14
|
|
|
15
15
|
//#region src/reactive/-private/document.ts
|
|
@@ -410,7 +410,7 @@ function coerceId(id) {
|
|
|
410
410
|
let normalized;
|
|
411
411
|
if (id === null || id === void 0 || id === "") normalized = null;
|
|
412
412
|
else normalized = String(id);
|
|
413
|
-
|
|
413
|
+
normalized !== id && console.warn(`The resource id '<${typeof id}> ${String(id)} ' is not normalized. Update your application code to use '${JSON.stringify(normalized)}' instead.`);
|
|
414
414
|
return normalized;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
@@ -448,7 +448,7 @@ function ensureStringId(id) {
|
|
|
448
448
|
function normalizeModelName(type) {
|
|
449
449
|
{
|
|
450
450
|
const result = dasherize(type);
|
|
451
|
-
|
|
451
|
+
result !== type && console.warn(`The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`);
|
|
452
452
|
return result;
|
|
453
453
|
}
|
|
454
454
|
}
|
|
@@ -469,6 +469,57 @@ function isResourceKey(identifier) {
|
|
|
469
469
|
function isRequestKey(identifier) {
|
|
470
470
|
return !!identifier && typeof identifier === "object" && "type" in identifier && !("id" in identifier) && identifier.type === "@document" && identifier[CACHE_OWNER] !== void 0;
|
|
471
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
* The identity of a field's value, as returned by {@link fieldValueIdentity}.
|
|
474
|
+
* Today only schema-object values (a `schema-object` field, or one element of
|
|
475
|
+
* a `schema-array`) have one: the concrete schema-object type the value
|
|
476
|
+
* resolves to, and the identity hash that type's `ObjectSchema` declares for
|
|
477
|
+
* it, or `null` when the schema declares `identity: null`.
|
|
478
|
+
*/
|
|
479
|
+
/**
|
|
480
|
+
* The identity of `value` as a value of `field`, when the field kind has one.
|
|
481
|
+
*
|
|
482
|
+
* A `schema-object` value, or one element of a `schema-array`, resolves to its
|
|
483
|
+
* concrete schema-object type and the identity hash that type's `ObjectSchema`
|
|
484
|
+
* declares (`null` when the schema declares `identity: null`). A
|
|
485
|
+
* non-polymorphic field names the type directly; a polymorphic field reads it
|
|
486
|
+
* off the value at `options.type` (default `'type'`), or computes it with the
|
|
487
|
+
* hash function named by `field.type` when `options.type` is `'@hash'`.
|
|
488
|
+
*
|
|
489
|
+
* Every other field kind, and any non-object value, has no identity and
|
|
490
|
+
* returns `null`.
|
|
491
|
+
*/
|
|
492
|
+
function fieldValueIdentity(schema, field, value) {
|
|
493
|
+
if (field.kind !== "schema-object" && field.kind !== "schema-array") return null;
|
|
494
|
+
if (!value || typeof value !== "object") return null;
|
|
495
|
+
const rawValue = value;
|
|
496
|
+
let type;
|
|
497
|
+
if (field.options?.polymorphic) {
|
|
498
|
+
const typePath = field.options.type ?? "type";
|
|
499
|
+
if (typePath === "@hash") {
|
|
500
|
+
((test) => {
|
|
501
|
+
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
502
|
+
})(field.type);
|
|
503
|
+
type = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
504
|
+
} else {
|
|
505
|
+
type = rawValue[typePath];
|
|
506
|
+
((test) => {
|
|
507
|
+
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
508
|
+
})(typePath && type && typeof type === "string");
|
|
509
|
+
}
|
|
510
|
+
} else {
|
|
511
|
+
((test) => {
|
|
512
|
+
if (!test) throw new Error(`A non-polymorphic ${field.kind} field must provide a SchemaObject type in its definition`);
|
|
513
|
+
})(field.type);
|
|
514
|
+
type = field.type;
|
|
515
|
+
}
|
|
516
|
+
const hashField = schema.resource({ type }).identity;
|
|
517
|
+
const hash = hashField && hashField.kind === "@hash" ? schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name) : null;
|
|
518
|
+
return {
|
|
519
|
+
type,
|
|
520
|
+
hash
|
|
521
|
+
};
|
|
522
|
+
}
|
|
472
523
|
const _crypto = typeof FastBoot !== "undefined" ? FastBoot.require("crypto") : globalThis.crypto;
|
|
473
524
|
function uuidv4() {
|
|
474
525
|
((test) => {
|
|
@@ -1566,7 +1617,8 @@ var CacheManager = class {
|
|
|
1566
1617
|
* Push resource data from a remote source into the cache for this ResourceKey
|
|
1567
1618
|
*
|
|
1568
1619
|
* @public
|
|
1569
|
-
* @return
|
|
1620
|
+
* @return when `hasRecord` is true, the names of the attributes whose persisted value
|
|
1621
|
+
* this push changed, or `undefined` when none did. Otherwise `void`.
|
|
1570
1622
|
*/
|
|
1571
1623
|
upsert(key, data, hasRecord) {
|
|
1572
1624
|
return this.___cache.upsert(key, data, hasRecord);
|
|
@@ -3615,7 +3667,7 @@ var RequestStateService = class {
|
|
|
3615
3667
|
* @private
|
|
3616
3668
|
*/
|
|
3617
3669
|
//#endregion
|
|
3618
|
-
//#region ../../node_modules/.pnpm/@embroider+macros@1.
|
|
3670
|
+
//#region ../../node_modules/.pnpm/@embroider+macros@1.21.1/node_modules/@embroider/macros/src/addon/es-compat2.js
|
|
3619
3671
|
function esCompat(m) {
|
|
3620
3672
|
return m?.__esModule ? m : {
|
|
3621
3673
|
default: m,
|
|
@@ -5781,31 +5833,11 @@ var ManagedArray = class {
|
|
|
5781
5833
|
if (field.type) return schema.transformation(field).hydrate(rawValue, field.options ?? null, self.owner);
|
|
5782
5834
|
return rawValue;
|
|
5783
5835
|
}
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
let objectType;
|
|
5790
|
-
if (field.options?.polymorphic) {
|
|
5791
|
-
const typePath = field.options.type ?? "type";
|
|
5792
|
-
if (typePath === "@hash") {
|
|
5793
|
-
((test) => {
|
|
5794
|
-
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
5795
|
-
})(field.type);
|
|
5796
|
-
objectType = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
5797
|
-
} else {
|
|
5798
|
-
objectType = rawValue[typePath];
|
|
5799
|
-
((test) => {
|
|
5800
|
-
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
5801
|
-
})(typePath && objectType && typeof objectType === "string");
|
|
5802
|
-
}
|
|
5803
|
-
} else {
|
|
5804
|
-
((test) => {
|
|
5805
|
-
if (!test) throw new Error(`A non-polymorphic SchemaArrayField must provide a SchemaObject type in its definition`);
|
|
5806
|
-
})(field.type);
|
|
5807
|
-
objectType = field.type;
|
|
5808
|
-
}
|
|
5836
|
+
const identity = fieldValueIdentity(schema, field, rawValue);
|
|
5837
|
+
((test) => {
|
|
5838
|
+
if (!test) throw new Error(`Expected a schema-array element to resolve to a schema-object identity`);
|
|
5839
|
+
})(identity !== null);
|
|
5840
|
+
const { type: objectType, hash } = identity;
|
|
5809
5841
|
/**
|
|
5810
5842
|
* When KeyMode=@hash the ReactiveResource is keyed into
|
|
5811
5843
|
* ManagedRecordRefs by the return value of @hash on the rawValue.
|
|
@@ -5815,8 +5847,10 @@ var ManagedArray = class {
|
|
|
5815
5847
|
*/
|
|
5816
5848
|
let schemaObjectKeyValue;
|
|
5817
5849
|
if (KeyMode === "@hash") {
|
|
5818
|
-
|
|
5819
|
-
|
|
5850
|
+
((test) => {
|
|
5851
|
+
if (!test) throw new Error(`Expected the '${objectType}' schema to declare an identity hash for key: '@hash'`);
|
|
5852
|
+
})(hash !== null);
|
|
5853
|
+
schemaObjectKeyValue = hash;
|
|
5820
5854
|
} else {
|
|
5821
5855
|
if (KeyMode !== "@identity" && KeyMode !== "@index") {
|
|
5822
5856
|
((test) => {
|
|
@@ -6529,29 +6563,12 @@ function getSchemaObjectField(context) {
|
|
|
6529
6563
|
}
|
|
6530
6564
|
return null;
|
|
6531
6565
|
}
|
|
6532
|
-
const
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
if (!test) throw new Error(`Expected the field to define a hashFn as its type`);
|
|
6539
|
-
})(field.type);
|
|
6540
|
-
objectType = schema.hashFn({ type: field.type })(rawValue, null, null);
|
|
6541
|
-
} else {
|
|
6542
|
-
objectType = rawValue[typePath];
|
|
6543
|
-
((test) => {
|
|
6544
|
-
if (!test) throw new Error(`Expected the type path for the field to be a value on the raw object`);
|
|
6545
|
-
})(typePath && objectType && typeof objectType === "string");
|
|
6546
|
-
}
|
|
6547
|
-
} else {
|
|
6548
|
-
((test) => {
|
|
6549
|
-
if (!test) throw new Error(`A non-polymorphic SchemaObjectField must provide a SchemaObject type in its definition`);
|
|
6550
|
-
})(field.type);
|
|
6551
|
-
objectType = field.type;
|
|
6552
|
-
}
|
|
6553
|
-
const hashField = schema.resource({ type: objectType }).identity;
|
|
6554
|
-
const identity = hashField ? schema.hashFn(hashField)(rawValue, hashField.options ?? null, hashField.name) : field.name;
|
|
6566
|
+
const resolved = fieldValueIdentity(store.schema, field, rawValue);
|
|
6567
|
+
((test) => {
|
|
6568
|
+
if (!test) throw new Error(`Expected a schema-object value to resolve to a schema-object identity`);
|
|
6569
|
+
})(resolved !== null);
|
|
6570
|
+
const { type: objectType, hash } = resolved;
|
|
6571
|
+
const identity = hash ?? field.name;
|
|
6555
6572
|
const cachedSchemaObject = signal.value;
|
|
6556
6573
|
if (cachedSchemaObject) {
|
|
6557
6574
|
if (cachedSchemaObject.type === objectType && cachedSchemaObject.identity === identity) return cachedSchemaObject.value;
|
|
@@ -6721,6 +6738,8 @@ const IgnoredGlobalFields = /* @__PURE__ */ new Set([
|
|
|
6721
6738
|
"then",
|
|
6722
6739
|
"setInterval",
|
|
6723
6740
|
"document",
|
|
6741
|
+
"unknownProperty",
|
|
6742
|
+
"size",
|
|
6724
6743
|
STRUCTURED
|
|
6725
6744
|
]);
|
|
6726
6745
|
const RecordSymbols = /* @__PURE__ */ new Set([
|
|
@@ -8880,5 +8899,5 @@ function useRecommendedStore(options, StoreKlass = Store) {
|
|
|
8880
8899
|
}
|
|
8881
8900
|
|
|
8882
8901
|
//#endregion
|
|
8883
|
-
export {
|
|
8884
|
-
//# sourceMappingURL=src-
|
|
8902
|
+
export { setIdentifierGenerationMethod as A, setRecordIdentifier as C, isRequestKey as D, fieldValueIdentity as E, coerceId as F, ensureStringId as I, log as L, setIdentifierUpdateMethod as M, setKeyInfoForResource as N, isResourceKey as O, normalizeModelName as P, logGroup as R, recordIdentifierFor as S, assertPrivateCapabilities as T, isPrivateStore as _, fromIdentity as a, StoreMap as b, instantiateRecord as c, commit as d, createLegacyManyArray as f, assertPrivateStore as g, Store as h, SchemaService as i, setIdentifierResetMethod as j, setIdentifierForgetMethod as k, teardownRecord as l, CacheHandler as m, RequestManager as n, registerDerivations as o, constructResource as p, Fetch as r, withDefaults as s, useRecommendedStore as t, checkout as u, RecordArrayManager as v, storeFor as w, _clearCaches as x, fastPush as y };
|
|
8903
|
+
//# sourceMappingURL=src-BlewXGbB.js.map
|