@warp-drive/schema-record 0.0.0-alpha.93 → 0.0.0-alpha.95
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/record.js +89 -135
- package/dist/record.js.map +1 -1
- package/package.json +15 -15
- package/unstable-preview-types/-private/compute.d.ts +3 -3
- package/unstable-preview-types/-private/compute.d.ts.map +1 -1
- package/unstable-preview-types/-private/managed-array.d.ts +4 -2
- package/unstable-preview-types/-private/managed-array.d.ts.map +1 -1
- package/unstable-preview-types/-private/managed-object.d.ts +6 -6
- package/unstable-preview-types/-private/managed-object.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +3 -3
- package/unstable-preview-types/record.d.ts.map +1 -1
package/dist/record.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createSignal, subscribe, defineSignal, peekSignal, getSignal, Signals,
|
|
|
3
3
|
import { STRUCTURED } from '@warp-drive/core-types/request';
|
|
4
4
|
import { RecordStore } from '@warp-drive/core-types/symbols';
|
|
5
5
|
import { getOrSetGlobal } from '@warp-drive/core-types/-private';
|
|
6
|
-
import { S as SOURCE, A as ARRAY_SIGNAL,
|
|
6
|
+
import { S as SOURCE, A as ARRAY_SIGNAL, E as Editable, L as Legacy, I as Identifier, P as Parent, O as OBJECT_SIGNAL, a as EmbeddedPath, D as Destroy, C as Checkout, b as EmbeddedType } from "./symbols-DqoS4ybV.js";
|
|
7
7
|
const ARRAY_GETTER_METHODS = new Set([Symbol.iterator, 'concat', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'flat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'map', 'reduce', 'reduceRight', 'slice', 'some', 'values']);
|
|
8
8
|
// const ARRAY_SETTER_METHODS = new Set<KeyType>(['push', 'pop', 'unshift', 'shift', 'splice', 'sort']);
|
|
9
9
|
const SYNC_PROPS = new Set(['[]', 'length']);
|
|
@@ -48,11 +48,13 @@ function safeForEach(instance, arr, store, callback, target) {
|
|
|
48
48
|
}
|
|
49
49
|
class ManagedArray {
|
|
50
50
|
[SOURCE];
|
|
51
|
-
constructor(store, schema, cache, field, data, identifier, path, owner, isSchemaArray) {
|
|
51
|
+
constructor(store, schema, cache, field, data, identifier, path, owner, isSchemaArray, editable, legacy) {
|
|
52
52
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
53
53
|
const self = this;
|
|
54
54
|
this[SOURCE] = data?.slice();
|
|
55
55
|
this[ARRAY_SIGNAL] = createSignal(this, 'length');
|
|
56
|
+
this[Editable] = editable;
|
|
57
|
+
this[Legacy] = legacy;
|
|
56
58
|
const _SIGNAL = this[ARRAY_SIGNAL];
|
|
57
59
|
const boundFns = new Map();
|
|
58
60
|
this.identifier = identifier;
|
|
@@ -233,90 +235,43 @@ class ManagedArray {
|
|
|
233
235
|
return proxy;
|
|
234
236
|
}
|
|
235
237
|
}
|
|
236
|
-
const
|
|
238
|
+
const ObjectSymbols = new Set([OBJECT_SIGNAL, Parent, SOURCE, Editable, EmbeddedPath]);
|
|
239
|
+
|
|
240
|
+
// const ignoredGlobalFields = new Set<string>(['setInterval', 'nodeType', 'nodeName', 'length', 'document', STRUCTURED]);
|
|
241
|
+
|
|
237
242
|
class ManagedObject {
|
|
238
|
-
|
|
239
|
-
constructor(store, schema, cache, field, data, identifier, path, owner, isSchemaObject) {
|
|
243
|
+
constructor(schema, cache, field, data, identifier, path, owner, editable, legacy) {
|
|
240
244
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
241
245
|
const self = this;
|
|
242
246
|
this[SOURCE] = {
|
|
243
247
|
...data
|
|
244
248
|
};
|
|
245
249
|
this[OBJECT_SIGNAL] = createSignal(this, 'length');
|
|
250
|
+
this[Editable] = editable;
|
|
251
|
+
this[Legacy] = legacy;
|
|
252
|
+
this[Parent] = identifier;
|
|
253
|
+
this[EmbeddedPath] = path;
|
|
246
254
|
const _SIGNAL = this[OBJECT_SIGNAL];
|
|
247
|
-
// const boundFns = new Map<KeyType, ProxiedMethod>();
|
|
248
|
-
this.identifier = identifier;
|
|
249
|
-
this.path = path;
|
|
250
|
-
this.owner = owner;
|
|
251
255
|
const proxy = new Proxy(this[SOURCE], {
|
|
252
256
|
ownKeys() {
|
|
253
|
-
if (isSchemaObject) {
|
|
254
|
-
const fields = schema.fields({
|
|
255
|
-
type: field.type
|
|
256
|
-
});
|
|
257
|
-
return Array.from(fields.keys());
|
|
258
|
-
}
|
|
259
257
|
return Object.keys(self[SOURCE]);
|
|
260
258
|
},
|
|
261
259
|
has(target, prop) {
|
|
262
|
-
if (isSchemaObject) {
|
|
263
|
-
const fields = schema.fields({
|
|
264
|
-
type: field.type
|
|
265
|
-
});
|
|
266
|
-
return fields.has(prop);
|
|
267
|
-
}
|
|
268
260
|
return prop in self[SOURCE];
|
|
269
261
|
},
|
|
270
262
|
getOwnPropertyDescriptor(target, prop) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
const fields = schema.fields({
|
|
279
|
-
type: field.type
|
|
280
|
-
});
|
|
281
|
-
if (!fields.has(prop)) {
|
|
282
|
-
throw new Error(`No field named ${String(prop)} on ${field.type}`);
|
|
283
|
-
}
|
|
284
|
-
const schemaForField = fields.get(prop);
|
|
285
|
-
switch (schemaForField.kind) {
|
|
286
|
-
case 'derived':
|
|
287
|
-
return {
|
|
288
|
-
writable: false,
|
|
289
|
-
enumerable: true,
|
|
290
|
-
configurable: true
|
|
291
|
-
};
|
|
292
|
-
case '@local':
|
|
293
|
-
case 'field':
|
|
294
|
-
case 'attribute':
|
|
295
|
-
case 'resource':
|
|
296
|
-
case 'belongsTo':
|
|
297
|
-
case 'hasMany':
|
|
298
|
-
case 'collection':
|
|
299
|
-
case 'schema-array':
|
|
300
|
-
case 'array':
|
|
301
|
-
case 'schema-object':
|
|
302
|
-
case 'object':
|
|
303
|
-
return {
|
|
304
|
-
writable: false,
|
|
305
|
-
// IS_EDITABLE,
|
|
306
|
-
enumerable: true,
|
|
307
|
-
configurable: true
|
|
308
|
-
};
|
|
309
|
-
}
|
|
263
|
+
return {
|
|
264
|
+
writable: editable,
|
|
265
|
+
enumerable: true,
|
|
266
|
+
configurable: true
|
|
267
|
+
};
|
|
310
268
|
},
|
|
311
269
|
get(target, prop, receiver) {
|
|
312
|
-
if (prop
|
|
313
|
-
return
|
|
270
|
+
if (ObjectSymbols.has(prop)) {
|
|
271
|
+
return self[prop];
|
|
314
272
|
}
|
|
315
|
-
if (prop ===
|
|
316
|
-
return
|
|
317
|
-
}
|
|
318
|
-
if (prop === 'owner') {
|
|
319
|
-
return self.owner;
|
|
273
|
+
if (prop === Symbol.toPrimitive) {
|
|
274
|
+
return null;
|
|
320
275
|
}
|
|
321
276
|
if (prop === Symbol.toStringTag) {
|
|
322
277
|
return `ManagedObject<${identifier.type}:${identifier.id} (${identifier.lid})>`;
|
|
@@ -337,66 +292,42 @@ class ManagedObject {
|
|
|
337
292
|
if (_SIGNAL.shouldReset) {
|
|
338
293
|
_SIGNAL.t = false;
|
|
339
294
|
_SIGNAL.shouldReset = false;
|
|
340
|
-
let newData = cache.getAttr(
|
|
295
|
+
let newData = cache.getAttr(identifier, path);
|
|
341
296
|
if (newData && newData !== self[SOURCE]) {
|
|
342
|
-
if (
|
|
297
|
+
if (field.type) {
|
|
343
298
|
const transform = schema.transformation(field);
|
|
344
|
-
newData = transform.hydrate(newData, field.options ?? null,
|
|
299
|
+
newData = transform.hydrate(newData, field.options ?? null, owner);
|
|
345
300
|
}
|
|
346
301
|
self[SOURCE] = {
|
|
347
302
|
...newData
|
|
348
303
|
}; // Add type assertion for newData
|
|
349
304
|
}
|
|
350
305
|
}
|
|
351
|
-
if (isSchemaObject) {
|
|
352
|
-
const fields = schema.fields({
|
|
353
|
-
type: field.type
|
|
354
|
-
});
|
|
355
|
-
// TODO: is there a better way to do this?
|
|
356
|
-
if (typeof prop === 'string' && !ignoredGlobalFields.has(prop) && !fields.has(prop)) {
|
|
357
|
-
throw new Error(`Field ${prop} does not exist on schema object ${field.type}`);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
306
|
if (prop in self[SOURCE]) {
|
|
361
|
-
|
|
362
|
-
subscribe(_SIGNAL);
|
|
363
|
-
}
|
|
307
|
+
subscribe(_SIGNAL);
|
|
364
308
|
return self[SOURCE][prop];
|
|
365
309
|
}
|
|
366
310
|
return Reflect.get(target, prop, receiver);
|
|
367
311
|
},
|
|
368
312
|
set(target, prop, value, receiver) {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return true;
|
|
373
|
-
}
|
|
374
|
-
if (prop === 'owner') {
|
|
375
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
376
|
-
self.owner = value;
|
|
377
|
-
return true;
|
|
378
|
-
}
|
|
379
|
-
if (isSchemaObject) {
|
|
380
|
-
const fields = schema.fields({
|
|
381
|
-
type: field.type
|
|
382
|
-
});
|
|
383
|
-
if (typeof prop === 'string' && !ignoredGlobalFields.has(prop) && !fields.has(prop)) {
|
|
384
|
-
throw new Error(`Field ${prop} does not exist on schema object ${field.type}`);
|
|
313
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
314
|
+
if (!test) {
|
|
315
|
+
throw new Error(`Cannot set read-only property '${String(prop)}' on ManagedObject`);
|
|
385
316
|
}
|
|
386
|
-
}
|
|
317
|
+
})(editable) : {};
|
|
387
318
|
const reflect = Reflect.set(target, prop, value, receiver);
|
|
388
|
-
if (reflect) {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
319
|
+
if (!reflect) {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
if (!field.type) {
|
|
323
|
+
cache.setAttr(identifier, path, self[SOURCE]);
|
|
324
|
+
} else {
|
|
394
325
|
const transform = schema.transformation(field);
|
|
395
|
-
const val = transform.serialize(self[SOURCE], field.options ?? null,
|
|
396
|
-
cache.setAttr(
|
|
397
|
-
_SIGNAL.shouldReset = true;
|
|
326
|
+
const val = transform.serialize(self[SOURCE], field.options ?? null, owner);
|
|
327
|
+
cache.setAttr(identifier, path, val);
|
|
398
328
|
}
|
|
399
|
-
|
|
329
|
+
_SIGNAL.shouldReset = true;
|
|
330
|
+
return true;
|
|
400
331
|
}
|
|
401
332
|
});
|
|
402
333
|
return proxy;
|
|
@@ -432,7 +363,7 @@ function computeField(schema, cache, record, identifier, field, prop) {
|
|
|
432
363
|
const transform = schema.transformation(field);
|
|
433
364
|
return transform.hydrate(rawValue, field.options ?? null, record);
|
|
434
365
|
}
|
|
435
|
-
function computeArray(store, schema, cache, record, identifier, field, path, isSchemaArray) {
|
|
366
|
+
function computeArray(store, schema, cache, record, identifier, field, path, isSchemaArray, editable, legacy) {
|
|
436
367
|
// the thing we hand out needs to know its owner and path in a private manner
|
|
437
368
|
// its "address" is the parent identifier (identifier) + field name (field.name)
|
|
438
369
|
// in the nested object case field name here is the full dot path from root resource to this value
|
|
@@ -451,7 +382,7 @@ function computeArray(store, schema, cache, record, identifier, field, path, isS
|
|
|
451
382
|
if (!rawValue) {
|
|
452
383
|
return null;
|
|
453
384
|
}
|
|
454
|
-
managedArray = new ManagedArray(store, schema, cache, field, rawValue, identifier, path, record, isSchemaArray);
|
|
385
|
+
managedArray = new ManagedArray(store, schema, cache, field, rawValue, identifier, path, record, isSchemaArray, editable, legacy);
|
|
455
386
|
if (!managedArrayMapForRecord) {
|
|
456
387
|
ManagedArrayMap.set(record, new Map([[field, managedArray]]));
|
|
457
388
|
} else {
|
|
@@ -460,7 +391,7 @@ function computeArray(store, schema, cache, record, identifier, field, path, isS
|
|
|
460
391
|
}
|
|
461
392
|
return managedArray;
|
|
462
393
|
}
|
|
463
|
-
function computeObject(
|
|
394
|
+
function computeObject(schema, cache, record, identifier, field, path, editable, legacy) {
|
|
464
395
|
const managedObjectMapForRecord = ManagedObjectMap.get(record);
|
|
465
396
|
let managedObject;
|
|
466
397
|
if (managedObjectMapForRecord) {
|
|
@@ -473,18 +404,15 @@ function computeObject(store, schema, cache, record, identifier, field, path) {
|
|
|
473
404
|
if (!rawValue) {
|
|
474
405
|
return null;
|
|
475
406
|
}
|
|
476
|
-
if (field.
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
} else {
|
|
486
|
-
managedObjectMapForRecord.set(field, managedObject);
|
|
487
|
-
}
|
|
407
|
+
if (field.type) {
|
|
408
|
+
const transform = schema.transformation(field);
|
|
409
|
+
rawValue = transform.hydrate(rawValue, field.options ?? null, record);
|
|
410
|
+
}
|
|
411
|
+
managedObject = new ManagedObject(schema, cache, field, rawValue, identifier, path, record, editable, legacy);
|
|
412
|
+
if (!managedObjectMapForRecord) {
|
|
413
|
+
ManagedObjectMap.set(record, new Map([[field, managedObject]]));
|
|
414
|
+
} else {
|
|
415
|
+
managedObjectMapForRecord.set(field, managedObject);
|
|
488
416
|
}
|
|
489
417
|
}
|
|
490
418
|
return managedObject;
|
|
@@ -632,6 +560,7 @@ class SchemaRecord {
|
|
|
632
560
|
case 'field':
|
|
633
561
|
case 'attribute':
|
|
634
562
|
case 'resource':
|
|
563
|
+
case 'alias':
|
|
635
564
|
case 'belongsTo':
|
|
636
565
|
case 'hasMany':
|
|
637
566
|
case 'collection':
|
|
@@ -676,10 +605,8 @@ class SchemaRecord {
|
|
|
676
605
|
// for its own usage.
|
|
677
606
|
// _, @, $, *
|
|
678
607
|
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
const field = prop === identityField?.name ? identityField : fields.get(prop);
|
|
682
|
-
if (!field) {
|
|
608
|
+
const maybeField = prop === identityField?.name ? identityField : fields.get(prop);
|
|
609
|
+
if (!maybeField) {
|
|
683
610
|
if (IgnoredGlobalFields.has(prop)) {
|
|
684
611
|
return undefined;
|
|
685
612
|
}
|
|
@@ -696,6 +623,18 @@ class SchemaRecord {
|
|
|
696
623
|
}
|
|
697
624
|
throw new Error(`No field named ${String(prop)} on ${type}`);
|
|
698
625
|
}
|
|
626
|
+
const field = maybeField.kind === 'alias' ? maybeField.options : maybeField;
|
|
627
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
628
|
+
if (!test) {
|
|
629
|
+
throw new Error(`Alias fields cannot alias '@id' '@local' '@hash' or 'derived' fields`);
|
|
630
|
+
}
|
|
631
|
+
})(maybeField.kind !== 'alias' || !['@id', '@local', '@hash', 'derived'].includes(maybeField.options.kind)) : {};
|
|
632
|
+
const propArray = isEmbedded ? embeddedPath.slice() : [];
|
|
633
|
+
// we use the field.name instead of prop here because we want to use the cache-path not
|
|
634
|
+
// the record path.
|
|
635
|
+
propArray.push(field.name);
|
|
636
|
+
// propArray.push(prop as string);
|
|
637
|
+
|
|
699
638
|
switch (field.kind) {
|
|
700
639
|
case '@id':
|
|
701
640
|
entangleSignal(signals, receiver, '@identity');
|
|
@@ -732,7 +671,7 @@ class SchemaRecord {
|
|
|
732
671
|
return computeDerivation(schema, receiver, identifier, field, prop);
|
|
733
672
|
case 'schema-array':
|
|
734
673
|
entangleSignal(signals, receiver, field.name);
|
|
735
|
-
return computeArray(store, schema, cache, target, identifier, field, propArray, true);
|
|
674
|
+
return computeArray(store, schema, cache, target, identifier, field, propArray, true, Mode[Editable], Mode[Legacy]);
|
|
736
675
|
case 'array':
|
|
737
676
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
738
677
|
if (!test) {
|
|
@@ -740,7 +679,7 @@ class SchemaRecord {
|
|
|
740
679
|
}
|
|
741
680
|
})(!target[Legacy]) : {};
|
|
742
681
|
entangleSignal(signals, receiver, field.name);
|
|
743
|
-
return computeArray(store, schema, cache, target, identifier, field, propArray, false);
|
|
682
|
+
return computeArray(store, schema, cache, target, identifier, field, propArray, false, Mode[Editable], Mode[Legacy]);
|
|
744
683
|
case 'object':
|
|
745
684
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
746
685
|
if (!test) {
|
|
@@ -748,7 +687,7 @@ class SchemaRecord {
|
|
|
748
687
|
}
|
|
749
688
|
})(!target[Legacy]) : {};
|
|
750
689
|
entangleSignal(signals, receiver, field.name);
|
|
751
|
-
return computeObject(
|
|
690
|
+
return computeObject(schema, cache, target, identifier, field, propArray, Mode[Editable], Mode[Legacy]);
|
|
752
691
|
case 'schema-object':
|
|
753
692
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
754
693
|
if (!test) {
|
|
@@ -806,13 +745,23 @@ class SchemaRecord {
|
|
|
806
745
|
if (!IS_EDITABLE) {
|
|
807
746
|
throw new Error(`Cannot set ${String(prop)} on ${identifier.type} because the record is not editable`);
|
|
808
747
|
}
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
const field = prop === identityField?.name ? identityField : fields.get(prop);
|
|
812
|
-
if (!field) {
|
|
748
|
+
const maybeField = prop === identityField?.name ? identityField : fields.get(prop);
|
|
749
|
+
if (!maybeField) {
|
|
813
750
|
const type = isEmbedded ? embeddedType : identifier.type;
|
|
814
751
|
throw new Error(`There is no field named ${String(prop)} on ${type}`);
|
|
815
752
|
}
|
|
753
|
+
const field = maybeField.kind === 'alias' ? maybeField.options : maybeField;
|
|
754
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
755
|
+
if (!test) {
|
|
756
|
+
throw new Error(`Alias fields cannot alias '@id' '@local' '@hash' or 'derived' fields`);
|
|
757
|
+
}
|
|
758
|
+
})(maybeField.kind !== 'alias' || !['@id', '@local', '@hash', 'derived'].includes(maybeField.options.kind)) : {};
|
|
759
|
+
const propArray = isEmbedded ? embeddedPath.slice() : [];
|
|
760
|
+
// we use the field.name instead of prop here because we want to use the cache-path not
|
|
761
|
+
// the record path.
|
|
762
|
+
propArray.push(field.name);
|
|
763
|
+
// propArray.push(prop as string);
|
|
764
|
+
|
|
816
765
|
switch (field.kind) {
|
|
817
766
|
case '@id':
|
|
818
767
|
{
|
|
@@ -935,6 +884,11 @@ class SchemaRecord {
|
|
|
935
884
|
{
|
|
936
885
|
let newValue = value;
|
|
937
886
|
if (value !== null) {
|
|
887
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
888
|
+
if (!test) {
|
|
889
|
+
throw new Error(`Expected value to be an object`);
|
|
890
|
+
}
|
|
891
|
+
})(typeof value === 'object') : {};
|
|
938
892
|
newValue = {
|
|
939
893
|
...value
|
|
940
894
|
};
|
package/dist/record.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sources":["../src/-private/managed-array.ts","../src/-private/managed-object.ts","../src/-private/compute.ts","../src/record.ts"],"sourcesContent":["import type Store from '@ember-data/store';\nimport type { Signal } from '@ember-data/tracking/-private';\nimport { addToTransaction, createSignal, subscribe } from '@ember-data/tracking/-private';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { Cache } from '@warp-drive/core-types/cache';\nimport type { ArrayValue, ObjectValue, Value } from '@warp-drive/core-types/json/raw';\nimport type { OpaqueRecordInstance } from '@warp-drive/core-types/record';\nimport type { ArrayField, HashField, SchemaArrayField } from '@warp-drive/core-types/schema/fields';\n\nimport { SchemaRecord } from '../record';\nimport type { SchemaService } from '../schema';\nimport { ARRAY_SIGNAL, Editable, Identifier, Legacy, MUTATE, Parent, SOURCE } from '../symbols';\n\nexport function notifyArray(arr: ManagedArray) {\n addToTransaction(arr[ARRAY_SIGNAL]);\n}\n\ntype KeyType = string | symbol | number;\nconst ARRAY_GETTER_METHODS = new Set<KeyType>([\n Symbol.iterator,\n 'concat',\n 'entries',\n 'every',\n 'fill',\n 'filter',\n 'find',\n 'findIndex',\n 'flat',\n 'flatMap',\n 'forEach',\n 'includes',\n 'indexOf',\n 'join',\n 'keys',\n 'lastIndexOf',\n 'map',\n 'reduce',\n 'reduceRight',\n 'slice',\n 'some',\n 'values',\n]);\n// const ARRAY_SETTER_METHODS = new Set<KeyType>(['push', 'pop', 'unshift', 'shift', 'splice', 'sort']);\nconst SYNC_PROPS = new Set<KeyType>(['[]', 'length']);\nfunction isArrayGetter<T>(prop: KeyType): prop is keyof Array<T> {\n return ARRAY_GETTER_METHODS.has(prop);\n}\n// function isArraySetter<T>(prop: KeyType): prop is keyof Array<T> {\n// return ARRAY_SETTER_METHODS.has(prop);\n// }\n// function isSelfProp<T extends object>(self: T, prop: KeyType): prop is keyof T {\n// return prop in self;\n// }\n\nfunction convertToInt(prop: KeyType): number | null {\n if (typeof prop === 'symbol') return null;\n\n const num = Number(prop);\n\n if (isNaN(num)) return null;\n\n return num % 1 === 0 ? num : null;\n}\n\ntype ProxiedMethod = (...args: unknown[]) => unknown;\n\ntype ForEachCB = (record: OpaqueRecordInstance, index: number, context: typeof Proxy<unknown[]>) => void;\nfunction safeForEach(\n instance: typeof Proxy<unknown[]>,\n arr: unknown[],\n store: Store,\n callback: ForEachCB,\n target: unknown\n) {\n if (target === undefined) {\n target = null;\n }\n // clone to prevent mutation\n arr = arr.slice();\n assert('`forEach` expects a function as first argument.', typeof callback === 'function');\n\n // because we retrieveLatest above we need not worry if array is mutated during iteration\n // by unloadRecord/rollbackAttributes\n // push/add/removeObject may still be problematic\n // but this is a more traditionally expected forEach bug.\n const length = arr.length; // we need to access length to ensure we are consumed\n\n for (let index = 0; index < length; index++) {\n callback.call(target, arr[index], index, instance);\n }\n\n return instance;\n}\n\nexport interface ManagedArray extends Omit<Array<unknown>, '[]'> {\n [MUTATE]?(\n target: unknown[],\n receiver: typeof Proxy<unknown[]>,\n prop: string,\n args: unknown[],\n _SIGNAL: Signal\n ): unknown;\n}\n\nexport class ManagedArray {\n [SOURCE]: unknown[];\n declare identifier: StableRecordIdentifier;\n declare path: string[];\n declare owner: SchemaRecord;\n declare [ARRAY_SIGNAL]: Signal;\n\n constructor(\n store: Store,\n schema: SchemaService,\n cache: Cache,\n field: ArrayField | SchemaArrayField,\n data: unknown[],\n identifier: StableRecordIdentifier,\n path: string[],\n owner: SchemaRecord,\n isSchemaArray: boolean\n ) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this[SOURCE] = data?.slice();\n this[ARRAY_SIGNAL] = createSignal(this, 'length');\n const _SIGNAL = this[ARRAY_SIGNAL];\n const boundFns = new Map<KeyType, ProxiedMethod>();\n this.identifier = identifier;\n this.path = path;\n this.owner = owner;\n let transaction = false;\n type StorageKlass = typeof WeakMap<object, WeakRef<SchemaRecord>>;\n const mode = (field as SchemaArrayField).options?.key ?? '@identity';\n const RefStorage: StorageKlass =\n mode === '@identity'\n ? (WeakMap as unknown as StorageKlass)\n : // CAUTION CAUTION CAUTION\n // this is a pile of lies\n // the Map is Map<string, WeakRef<SchemaRecord>>\n // but TS does not understand how to juggle modes like this\n // internal to a method like ours without us duplicating the code\n // into two separate methods.\n Map<object, WeakRef<SchemaRecord>>;\n const ManagedRecordRefs = isSchemaArray ? new RefStorage() : null;\n const proxy = new Proxy(this[SOURCE], {\n get<R extends typeof Proxy<unknown[]>>(target: unknown[], prop: keyof R, receiver: R) {\n if (prop === ARRAY_SIGNAL) {\n return _SIGNAL;\n }\n if (prop === 'identifier') {\n return self.identifier;\n }\n if (prop === 'owner') {\n return self.owner;\n }\n\n const index = convertToInt(prop);\n if (_SIGNAL.shouldReset && (index !== null || SYNC_PROPS.has(prop) || isArrayGetter(prop))) {\n _SIGNAL.t = false;\n _SIGNAL.shouldReset = false;\n const newData = cache.getAttr(identifier, path);\n if (newData && newData !== self[SOURCE]) {\n self[SOURCE].length = 0;\n self[SOURCE].push(...(newData as ArrayValue));\n }\n }\n\n if (index !== null) {\n let val;\n if (mode === '@hash') {\n val = target[index];\n const hashField = schema.resource({ type: field.type! }).identity as HashField;\n const hashFn = schema.hashFn(hashField);\n val = hashFn(val as object, null, null);\n } else {\n // if mode is not @identity or @index, then access the key path.\n // we should assert that `mode` is a string\n // it should read directly from the cache value for that field (e.g. no derivation, no transformation)\n // and, we likely should lookup the associated field and throw an error IF\n // the given field does not exist OR\n // the field is anything other than a GenericField or LegacyAttributeField.\n if (mode !== '@identity' && mode !== '@index') {\n assert('mode must be a string', typeof mode === 'string');\n const modeField = schema.resource({ type: field.type! }).fields.find((f) => f.name === mode);\n assert('field must exist in schema', modeField);\n assert(\n 'field must be a GenericField or LegacyAttributeField',\n modeField.kind === 'field' || modeField.kind === 'attribute'\n );\n }\n val =\n mode === '@identity'\n ? target[index]\n : mode === '@index'\n ? '@index'\n : (target[index] as ObjectValue)[mode];\n }\n\n if (isSchemaArray) {\n if (!transaction) {\n subscribe(_SIGNAL);\n }\n\n if (val) {\n const recordRef = ManagedRecordRefs!.get(val);\n let record = recordRef?.deref();\n\n if (!record) {\n const recordPath = path.slice();\n // this is a dirty lie since path is string[] but really we\n // should change the types for paths to `Array<string | number>`\n // TODO we should allow the schema for the field to define a \"key\"\n // for stability. Default should be `@identity` which means that\n // same object reference from cache should result in same SchemaRecord\n // embedded object.\n recordPath.push(index as unknown as string);\n const recordIdentifier = self.owner[Identifier] || self.owner[Parent];\n\n record = new SchemaRecord(\n store,\n recordIdentifier,\n { [Editable]: self.owner[Editable], [Legacy]: self.owner[Legacy] },\n true,\n field.type,\n recordPath\n );\n // if mode is not @identity or @index, then access the key path now\n // to determine the key value.\n // chris says we can implement this as a special kind `@hash` which\n // would be a function that only has access to the cache value and not\n // the record itself, so derivation is possible but intentionally limited\n // and non-reactive?\n ManagedRecordRefs!.set(val, new WeakRef(record));\n } else {\n // TODO update embeddedPath if required\n }\n return record;\n }\n\n return val;\n }\n\n if (!transaction) {\n subscribe(_SIGNAL);\n }\n if (field.type) {\n const transform = schema.transformation(field);\n return transform.hydrate(val as Value, field.options ?? null, self.owner);\n }\n return val;\n }\n\n if (isArrayGetter(prop)) {\n let fn = boundFns.get(prop);\n\n if (fn === undefined) {\n if (prop === 'forEach') {\n fn = function () {\n subscribe(_SIGNAL);\n transaction = true;\n const result = safeForEach(receiver, target, store, arguments[0] as ForEachCB, arguments[1]);\n transaction = false;\n return result;\n };\n } else {\n fn = function () {\n subscribe(_SIGNAL);\n // array functions must run through Reflect to work properly\n // binding via other means will not work.\n transaction = true;\n const result = Reflect.apply(target[prop] as ProxiedMethod, receiver, arguments) as unknown;\n transaction = false;\n return result;\n };\n }\n boundFns.set(prop, fn);\n }\n return fn;\n }\n\n return Reflect.get(target, prop, receiver);\n },\n set(target, prop: KeyType, value, receiver) {\n if (prop === 'identifier') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n self.identifier = value;\n return true;\n }\n if (prop === 'owner') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n self.owner = value;\n return true;\n }\n const reflect = Reflect.set(target, prop, value, receiver);\n\n if (reflect) {\n if (!field.type) {\n cache.setAttr(identifier, path, self[SOURCE] as Value);\n _SIGNAL.shouldReset = true;\n return true;\n }\n\n let rawValue = self[SOURCE] as ArrayValue;\n if (!isSchemaArray) {\n const transform = schema.transformation(field);\n if (!transform) {\n throw new Error(`No '${field.type}' transform defined for use by ${identifier.type}.${String(prop)}`);\n }\n rawValue = (self[SOURCE] as ArrayValue).map((item) =>\n transform.serialize(item, field.options ?? null, self.owner)\n );\n }\n cache.setAttr(identifier, path, rawValue as Value);\n _SIGNAL.shouldReset = true;\n }\n return reflect;\n },\n }) as ManagedArray;\n\n return proxy;\n }\n}\n","import type Store from '@ember-data/store';\nimport type { Signal } from '@ember-data/tracking/-private';\nimport { addToTransaction, createSignal, subscribe } from '@ember-data/tracking/-private';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { Cache } from '@warp-drive/core-types/cache';\nimport type { ObjectValue, Value } from '@warp-drive/core-types/json/raw';\nimport { STRUCTURED } from '@warp-drive/core-types/request';\nimport type { ObjectField, SchemaObjectField } from '@warp-drive/core-types/schema/fields';\n\nimport type { SchemaRecord } from '../record';\nimport type { SchemaService } from '../schema';\nimport { MUTATE, OBJECT_SIGNAL, SOURCE } from '../symbols';\n\nexport function notifyObject(obj: ManagedObject) {\n addToTransaction(obj[OBJECT_SIGNAL]);\n}\n\ntype KeyType = string | symbol | number;\nconst ignoredGlobalFields = new Set<string>(['setInterval', 'nodeType', 'nodeName', 'length', 'document', STRUCTURED]);\nexport interface ManagedObject {\n [MUTATE]?(\n target: unknown[],\n receiver: typeof Proxy<unknown[]>,\n prop: string,\n args: unknown[],\n _SIGNAL: Signal\n ): unknown;\n}\n\nexport class ManagedObject {\n [SOURCE]: object;\n declare identifier: StableRecordIdentifier;\n declare path: string[];\n declare owner: SchemaRecord;\n declare [OBJECT_SIGNAL]: Signal;\n\n constructor(\n store: Store,\n schema: SchemaService,\n cache: Cache,\n field: ObjectField | SchemaObjectField,\n data: object,\n identifier: StableRecordIdentifier,\n path: string[],\n owner: SchemaRecord,\n isSchemaObject: boolean\n ) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this[SOURCE] = { ...data };\n this[OBJECT_SIGNAL] = createSignal(this, 'length');\n const _SIGNAL = this[OBJECT_SIGNAL];\n // const boundFns = new Map<KeyType, ProxiedMethod>();\n this.identifier = identifier;\n this.path = path;\n this.owner = owner;\n const transaction = false;\n\n const proxy = new Proxy(this[SOURCE], {\n ownKeys() {\n if (isSchemaObject) {\n const fields = schema.fields({ type: field.type! });\n return Array.from(fields.keys());\n }\n\n return Object.keys(self[SOURCE]);\n },\n\n has(target: unknown, prop: string | number | symbol) {\n if (isSchemaObject) {\n const fields = schema.fields({ type: field.type! });\n return fields.has(prop as string);\n }\n\n return prop in self[SOURCE];\n },\n\n getOwnPropertyDescriptor(target, prop) {\n if (!isSchemaObject) {\n return {\n writable: false,\n enumerable: true,\n configurable: true,\n };\n }\n const fields = schema.fields({ type: field.type! });\n if (!fields.has(prop as string)) {\n throw new Error(`No field named ${String(prop)} on ${field.type}`);\n }\n const schemaForField = fields.get(prop as string)!;\n switch (schemaForField.kind) {\n case 'derived':\n return {\n writable: false,\n enumerable: true,\n configurable: true,\n };\n case '@local':\n case 'field':\n case 'attribute':\n case 'resource':\n case 'belongsTo':\n case 'hasMany':\n case 'collection':\n case 'schema-array':\n case 'array':\n case 'schema-object':\n case 'object':\n return {\n writable: false, // IS_EDITABLE,\n enumerable: true,\n configurable: true,\n };\n }\n },\n\n get<R extends typeof Proxy<object>>(target: object, prop: keyof R, receiver: R) {\n if (prop === OBJECT_SIGNAL) {\n return _SIGNAL;\n }\n if (prop === 'identifier') {\n return self.identifier;\n }\n if (prop === 'owner') {\n return self.owner;\n }\n if (prop === Symbol.toStringTag) {\n return `ManagedObject<${identifier.type}:${identifier.id} (${identifier.lid})>`;\n }\n if (prop === 'constructor') {\n return Object;\n }\n\n if (prop === 'toString') {\n return function () {\n return `ManagedObject<${identifier.type}:${identifier.id} (${identifier.lid})>`;\n };\n }\n\n if (prop === 'toHTML') {\n return function () {\n return '<div>ManagedObject</div>';\n };\n }\n if (_SIGNAL.shouldReset) {\n _SIGNAL.t = false;\n _SIGNAL.shouldReset = false;\n let newData = cache.getAttr(self.identifier, self.path);\n if (newData && newData !== self[SOURCE]) {\n if (!isSchemaObject && field.type) {\n const transform = schema.transformation(field);\n newData = transform.hydrate(newData as ObjectValue, field.options ?? null, self.owner) as ObjectValue;\n }\n self[SOURCE] = { ...(newData as ObjectValue) }; // Add type assertion for newData\n }\n }\n\n if (isSchemaObject) {\n const fields = schema.fields({ type: field.type! });\n // TODO: is there a better way to do this?\n if (typeof prop === 'string' && !ignoredGlobalFields.has(prop) && !fields.has(prop)) {\n throw new Error(`Field ${prop} does not exist on schema object ${field.type}`);\n }\n }\n\n if (prop in self[SOURCE]) {\n if (!transaction) {\n subscribe(_SIGNAL);\n }\n\n return (self[SOURCE] as R)[prop];\n }\n return Reflect.get(target, prop, receiver) as R;\n },\n\n set(target, prop: KeyType, value, receiver) {\n if (prop === 'identifier') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n self.identifier = value;\n return true;\n }\n if (prop === 'owner') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n self.owner = value;\n return true;\n }\n if (isSchemaObject) {\n const fields = schema.fields({ type: field.type! });\n if (typeof prop === 'string' && !ignoredGlobalFields.has(prop) && !fields.has(prop)) {\n throw new Error(`Field ${prop} does not exist on schema object ${field.type}`);\n }\n }\n const reflect = Reflect.set(target, prop, value, receiver);\n\n if (reflect) {\n if (isSchemaObject || !field.type) {\n cache.setAttr(self.identifier, self.path, self[SOURCE] as Value);\n _SIGNAL.shouldReset = true;\n return true;\n }\n\n const transform = schema.transformation(field);\n const val = transform.serialize(self[SOURCE], field.options ?? null, self.owner);\n cache.setAttr(self.identifier, self.path, val);\n _SIGNAL.shouldReset = true;\n }\n return reflect;\n },\n }) as ManagedObject;\n\n return proxy;\n }\n}\n","import type { Future } from '@ember-data/request';\nimport type Store from '@ember-data/store';\nimport type { StoreRequestInput } from '@ember-data/store';\nimport { defineSignal, getSignal, peekSignal } from '@ember-data/tracking/-private';\nimport { DEBUG } from '@warp-drive/build-config/env';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport { getOrSetGlobal } from '@warp-drive/core-types/-private';\nimport type { Cache } from '@warp-drive/core-types/cache';\nimport type { ResourceRelationship as SingleResourceRelationship } from '@warp-drive/core-types/cache/relationship';\nimport type { ObjectValue } from '@warp-drive/core-types/json/raw';\nimport type {\n ArrayField,\n DerivedField,\n FieldSchema,\n GenericField,\n LocalField,\n ObjectField,\n SchemaArrayField,\n SchemaObjectField,\n} from '@warp-drive/core-types/schema/fields';\nimport type { Link, Links } from '@warp-drive/core-types/spec/json-api-raw';\nimport { RecordStore } from '@warp-drive/core-types/symbols';\n\nimport { SchemaRecord } from '../record';\nimport type { SchemaService } from '../schema';\nimport { Editable, Identifier, Legacy, Parent } from '../symbols';\nimport { ManagedArray } from './managed-array';\nimport { ManagedObject } from './managed-object';\n\nexport const ManagedArrayMap = getOrSetGlobal(\n 'ManagedArrayMap',\n new Map<SchemaRecord, Map<FieldSchema, ManagedArray>>()\n);\nexport const ManagedObjectMap = getOrSetGlobal(\n 'ManagedObjectMap',\n new Map<SchemaRecord, Map<FieldSchema, ManagedObject | SchemaRecord>>()\n);\n\nexport function computeLocal(record: typeof Proxy<SchemaRecord>, field: LocalField, prop: string): unknown {\n let signal = peekSignal(record, prop);\n\n if (!signal) {\n signal = getSignal(record, prop, false);\n signal.lastValue = field.options?.defaultValue ?? null;\n }\n\n return signal.lastValue;\n}\n\nexport function peekManagedArray(record: SchemaRecord, field: FieldSchema): ManagedArray | undefined {\n const managedArrayMapForRecord = ManagedArrayMap.get(record);\n if (managedArrayMapForRecord) {\n return managedArrayMapForRecord.get(field);\n }\n}\n\nexport function peekManagedObject(record: SchemaRecord, field: ObjectField): ManagedObject | undefined;\nexport function peekManagedObject(record: SchemaRecord, field: SchemaObjectField): SchemaRecord | undefined;\nexport function peekManagedObject(\n record: SchemaRecord,\n field: ObjectField | SchemaObjectField\n): ManagedObject | SchemaRecord | undefined {\n const managedObjectMapForRecord = ManagedObjectMap.get(record);\n if (managedObjectMapForRecord) {\n return managedObjectMapForRecord.get(field);\n }\n}\n\nexport function computeField(\n schema: SchemaService,\n cache: Cache,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: GenericField,\n prop: string | string[]\n): unknown {\n const rawValue = cache.getAttr(identifier, prop);\n if (!field.type) {\n return rawValue;\n }\n const transform = schema.transformation(field);\n return transform.hydrate(rawValue, field.options ?? null, record);\n}\n\nexport function computeArray(\n store: Store,\n schema: SchemaService,\n cache: Cache,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: ArrayField | SchemaArrayField,\n path: string[],\n isSchemaArray: boolean\n) {\n // the thing we hand out needs to know its owner and path in a private manner\n // its \"address\" is the parent identifier (identifier) + field name (field.name)\n // in the nested object case field name here is the full dot path from root resource to this value\n // its \"key\" is the field on the parent record\n // its \"owner\" is the parent record\n\n const managedArrayMapForRecord = ManagedArrayMap.get(record);\n let managedArray;\n if (managedArrayMapForRecord) {\n managedArray = managedArrayMapForRecord.get(field);\n }\n if (managedArray) {\n return managedArray;\n } else {\n const rawValue = cache.getAttr(identifier, path) as unknown[];\n if (!rawValue) {\n return null;\n }\n managedArray = new ManagedArray(store, schema, cache, field, rawValue, identifier, path, record, isSchemaArray);\n if (!managedArrayMapForRecord) {\n ManagedArrayMap.set(record, new Map([[field, managedArray]]));\n } else {\n managedArrayMapForRecord.set(field, managedArray);\n }\n }\n return managedArray;\n}\n\nexport function computeObject(\n store: Store,\n schema: SchemaService,\n cache: Cache,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: ObjectField | SchemaObjectField,\n path: string[]\n) {\n const managedObjectMapForRecord = ManagedObjectMap.get(record);\n let managedObject;\n if (managedObjectMapForRecord) {\n managedObject = managedObjectMapForRecord.get(field);\n }\n if (managedObject) {\n return managedObject;\n } else {\n let rawValue = cache.getAttr(identifier, path) as object;\n if (!rawValue) {\n return null;\n }\n if (field.kind === 'object') {\n if (field.type) {\n const transform = schema.transformation(field);\n rawValue = transform.hydrate(rawValue as ObjectValue, field.options ?? null, record) as object;\n }\n // for schema-object, this should likely be an embedded SchemaRecord now\n managedObject = new ManagedObject(store, schema, cache, field, rawValue, identifier, path, record, false);\n if (!managedObjectMapForRecord) {\n ManagedObjectMap.set(record, new Map([[field, managedObject]]));\n } else {\n managedObjectMapForRecord.set(field, managedObject);\n }\n }\n }\n return managedObject;\n}\n\nexport function computeSchemaObject(\n store: Store,\n cache: Cache,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: ObjectField | SchemaObjectField,\n path: string[],\n legacy: boolean,\n editable: boolean\n) {\n const schemaObjectMapForRecord = ManagedObjectMap.get(record);\n let schemaObject;\n if (schemaObjectMapForRecord) {\n schemaObject = schemaObjectMapForRecord.get(field);\n }\n if (schemaObject) {\n return schemaObject;\n } else {\n const rawValue = cache.getAttr(identifier, path) as object;\n if (!rawValue) {\n return null;\n }\n const embeddedPath = path.slice();\n schemaObject = new SchemaRecord(\n store,\n identifier,\n {\n [Editable]: editable,\n [Legacy]: legacy,\n },\n true,\n field.type,\n embeddedPath\n );\n }\n if (!schemaObjectMapForRecord) {\n ManagedObjectMap.set(record, new Map([[field, schemaObject]]));\n } else {\n schemaObjectMapForRecord.set(field, schemaObject);\n }\n return schemaObject;\n}\n\nexport function computeAttribute(cache: Cache, identifier: StableRecordIdentifier, prop: string): unknown {\n return cache.getAttr(identifier, prop);\n}\n\nexport function computeDerivation(\n schema: SchemaService,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: DerivedField,\n prop: string\n): unknown {\n return schema.derivation(field)(record, field.options ?? null, prop);\n}\n\n// TODO probably this should just be a Document\n// but its separate until we work out the lid situation\nclass ResourceRelationship<T extends SchemaRecord = SchemaRecord> {\n declare lid: string;\n declare [Parent]: SchemaRecord;\n declare [RecordStore]: Store;\n declare name: string;\n\n declare data: T | null;\n declare links: Links;\n declare meta: Record<string, unknown>;\n\n constructor(\n store: Store,\n cache: Cache,\n parent: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: FieldSchema,\n name: string\n ) {\n const rawValue = cache.getRelationship(identifier, name) as SingleResourceRelationship;\n\n // TODO setup true lids for relationship documents\n // @ts-expect-error we need to give relationship documents a lid\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.lid = rawValue.lid ?? rawValue.links?.self ?? `relationship:${identifier.lid}.${name}`;\n this.data = rawValue.data ? store.peekRecord<T>(rawValue.data) : null;\n this.name = name;\n\n if (DEBUG) {\n this.links = Object.freeze(Object.assign({}, rawValue.links));\n this.meta = Object.freeze(Object.assign({}, rawValue.meta));\n } else {\n this.links = rawValue.links ?? {};\n this.meta = rawValue.meta ?? {};\n }\n\n this[RecordStore] = store;\n this[Parent] = parent;\n }\n\n fetch(options?: StoreRequestInput<T, T>): Future<T> {\n const url = options?.url ?? getHref(this.links.related) ?? getHref(this.links.self) ?? null;\n\n if (!url) {\n throw new Error(\n `Cannot ${options?.method ?? 'fetch'} ${this[Parent][Identifier].type}.${String(\n this.name\n )} because it has no related link`\n );\n }\n const request = Object.assign(\n {\n url,\n method: 'GET',\n },\n options\n );\n\n return this[RecordStore].request<T>(request);\n }\n}\n\ndefineSignal(ResourceRelationship.prototype, 'data');\ndefineSignal(ResourceRelationship.prototype, 'links');\ndefineSignal(ResourceRelationship.prototype, 'meta');\n\nfunction getHref(link?: Link | null): string | null {\n if (!link) {\n return null;\n }\n if (typeof link === 'string') {\n return link;\n }\n return link.href;\n}\n\nexport function computeResource<T extends SchemaRecord>(\n store: Store,\n cache: Cache,\n parent: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: FieldSchema,\n prop: string\n): ResourceRelationship<T> {\n if (field.kind !== 'resource') {\n throw new Error(`The schema for ${identifier.type}.${String(prop)} is not a resource relationship`);\n }\n\n return new ResourceRelationship<T>(store, cache, parent, identifier, field, prop);\n}\n","import { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\n\nimport type { MinimalLegacyRecord } from '@ember-data/model/-private/model-methods';\nimport type Store from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store';\nimport { addToTransaction, entangleSignal, getSignal, type Signal, Signals } from '@ember-data/tracking/-private';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { ArrayValue, ObjectValue, Value } from '@warp-drive/core-types/json/raw';\nimport { STRUCTURED } from '@warp-drive/core-types/request';\nimport type { FieldSchema } from '@warp-drive/core-types/schema/fields';\nimport { RecordStore } from '@warp-drive/core-types/symbols';\n\nimport {\n computeArray,\n computeAttribute,\n computeDerivation,\n computeField,\n computeLocal,\n computeObject,\n computeResource,\n computeSchemaObject,\n ManagedArrayMap,\n ManagedObjectMap,\n peekManagedArray,\n peekManagedObject,\n} from './-private/compute';\nimport type { SchemaService } from './schema';\nimport {\n ARRAY_SIGNAL,\n Checkout,\n Destroy,\n Editable,\n EmbeddedPath,\n EmbeddedType,\n Identifier,\n Legacy,\n OBJECT_SIGNAL,\n Parent,\n} from './symbols';\n\nconst HAS_MODEL_PACKAGE = dependencySatisfies('@ember-data/model', '*');\nconst getLegacySupport = macroCondition(dependencySatisfies('@ember-data/model', '*'))\n ? (importSync('@ember-data/model/-private') as typeof import('@ember-data/model/-private')).lookupLegacySupport\n : null;\n\nexport { Editable, Legacy } from './symbols';\nconst IgnoredGlobalFields = new Set<string>(['length', 'nodeType', 'then', 'setInterval', 'document', STRUCTURED]);\nconst symbolList = [\n Destroy,\n RecordStore,\n Identifier,\n Editable,\n Parent,\n Checkout,\n Legacy,\n Signals,\n EmbeddedPath,\n EmbeddedType,\n];\nconst RecordSymbols = new Set(symbolList);\n\ntype RecordSymbol = (typeof symbolList)[number];\n\nfunction isPathMatch(a: string[], b: string[]) {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n}\n\nexport class SchemaRecord {\n declare [RecordStore]: Store;\n declare [Identifier]: StableRecordIdentifier;\n declare [Parent]: StableRecordIdentifier;\n declare [EmbeddedType]: string | null;\n declare [EmbeddedPath]: string[] | null;\n declare [Editable]: boolean;\n declare [Legacy]: boolean;\n declare [Signals]: Map<string, Signal>;\n declare [Symbol.toStringTag]: `SchemaRecord<${string}>`;\n declare ___notifications: object;\n\n constructor(\n store: Store,\n identifier: StableRecordIdentifier,\n Mode: { [Editable]: boolean; [Legacy]: boolean },\n isEmbedded = false,\n embeddedType: string | null = null,\n embeddedPath: string[] | null = null\n ) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this[RecordStore] = store;\n if (isEmbedded) {\n this[Parent] = identifier;\n } else {\n this[Identifier] = identifier;\n }\n const IS_EDITABLE = (this[Editable] = Mode[Editable] ?? false);\n this[Legacy] = Mode[Legacy] ?? false;\n\n const schema = store.schema as unknown as SchemaService;\n const cache = store.cache;\n const identityField = schema.resource(identifier).identity;\n\n this[EmbeddedType] = embeddedType;\n this[EmbeddedPath] = embeddedPath;\n\n let fields: Map<string, FieldSchema>;\n if (isEmbedded) {\n fields = schema.fields({ type: embeddedType as string });\n } else {\n fields = schema.fields(identifier);\n }\n\n const signals: Map<string, Signal> = new Map();\n this[Signals] = signals;\n\n const proxy = new Proxy(this, {\n ownKeys() {\n return Array.from(fields.keys());\n },\n\n has(target: SchemaRecord, prop: string | number | symbol) {\n return fields.has(prop as string);\n },\n\n getOwnPropertyDescriptor(target, prop) {\n if (!fields.has(prop as string)) {\n throw new Error(`No field named ${String(prop)} on ${identifier.type}`);\n }\n const schemaForField = fields.get(prop as string)!;\n switch (schemaForField.kind) {\n case 'derived':\n return {\n writable: false,\n enumerable: true,\n configurable: true,\n };\n case '@local':\n case 'field':\n case 'attribute':\n case 'resource':\n case 'belongsTo':\n case 'hasMany':\n case 'collection':\n case 'schema-array':\n case 'array':\n case 'schema-object':\n case 'object':\n return {\n writable: IS_EDITABLE,\n enumerable: true,\n configurable: true,\n };\n }\n },\n\n get(target: SchemaRecord, prop: string | number | symbol, receiver: typeof Proxy<SchemaRecord>) {\n if (RecordSymbols.has(prop as RecordSymbol)) {\n return target[prop as keyof SchemaRecord];\n }\n\n if (prop === Symbol.toStringTag) {\n return `SchemaRecord<${identifier.type}:${identifier.id} (${identifier.lid})>`;\n }\n\n if (prop === 'toString') {\n return function () {\n return `SchemaRecord<${identifier.type}:${identifier.id} (${identifier.lid})>`;\n };\n }\n\n if (prop === 'toHTML') {\n return function () {\n return `<div>SchemaRecord<${identifier.type}:${identifier.id} (${identifier.lid})></div>`;\n };\n }\n\n if (prop === Symbol.toPrimitive) {\n return null;\n }\n\n // TODO make this a symbol\n if (prop === '___notifications') {\n return target.___notifications;\n }\n\n // SchemaRecord reserves use of keys that begin with these characters\n // for its own usage.\n // _, @, $, *\n\n const propArray = isEmbedded ? embeddedPath!.slice() : [];\n propArray.push(prop as string);\n\n const field = prop === identityField?.name ? identityField : fields.get(prop as string);\n if (!field) {\n if (IgnoredGlobalFields.has(prop as string)) {\n return undefined;\n }\n if (prop === 'constructor') {\n return SchemaRecord;\n }\n // too many things check for random symbols\n if (typeof prop === 'symbol') {\n return undefined;\n }\n let type = identifier.type;\n if (isEmbedded) {\n type = embeddedType!;\n }\n\n throw new Error(`No field named ${String(prop)} on ${type}`);\n }\n\n switch (field.kind) {\n case '@id':\n entangleSignal(signals, receiver, '@identity');\n return identifier.id;\n case '@hash':\n // TODO pass actual cache value not {}\n return schema.hashFn(field)({}, field.options ?? null, field.name ?? null);\n case '@local': {\n const lastValue = computeLocal(receiver, field, prop as string);\n entangleSignal(signals, receiver, prop as string);\n return lastValue;\n }\n case 'field':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n return computeField(schema, cache, target, identifier, field, propArray);\n case 'attribute':\n entangleSignal(signals, receiver, field.name);\n return computeAttribute(cache, identifier, prop as string);\n case 'resource':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n return computeResource(store, cache, target, identifier, field, prop as string);\n case 'derived':\n return computeDerivation(schema, receiver as unknown as SchemaRecord, identifier, field, prop as string);\n case 'schema-array':\n entangleSignal(signals, receiver, field.name);\n return computeArray(store, schema, cache, target, identifier, field, propArray, true);\n case 'array':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n return computeArray(store, schema, cache, target, identifier, field, propArray, false);\n case 'object':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n return computeObject(store, schema, cache, target, identifier, field, propArray);\n case 'schema-object':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n // run transform, then use that value as the object to manage\n return computeSchemaObject(\n store,\n cache,\n target,\n identifier,\n field,\n propArray,\n Mode[Legacy],\n Mode[Editable]\n );\n case 'belongsTo':\n if (!HAS_MODEL_PACKAGE) {\n assert(\n `Cannot use belongsTo fields in your schema unless @ember-data/model is installed to provide legacy model support. ${field.name} should likely be migrated to be a resource field.`\n );\n }\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use belongsTo fields when the resource is in legacy mode`, Mode[Legacy]);\n entangleSignal(signals, receiver, field.name);\n return getLegacySupport(receiver as unknown as MinimalLegacyRecord).getBelongsTo(field.name);\n case 'hasMany':\n if (!HAS_MODEL_PACKAGE) {\n assert(\n `Cannot use hasMany fields in your schema unless @ember-data/model is installed to provide legacy model support. ${field.name} should likely be migrated to be a collection field.`\n );\n }\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use hasMany fields when the resource is in legacy mode`, Mode[Legacy]);\n entangleSignal(signals, receiver, field.name);\n return getLegacySupport(receiver as unknown as MinimalLegacyRecord).getHasMany(field.name);\n default:\n throw new Error(`Field '${String(prop)}' on '${identifier.type}' has the unknown kind '${field.kind}'`);\n }\n },\n set(target: SchemaRecord, prop: string | number | symbol, value: unknown, receiver: typeof Proxy<SchemaRecord>) {\n if (!IS_EDITABLE) {\n throw new Error(`Cannot set ${String(prop)} on ${identifier.type} because the record is not editable`);\n }\n\n const propArray = isEmbedded ? embeddedPath!.slice() : [];\n propArray.push(prop as string);\n\n const field = prop === identityField?.name ? identityField : fields.get(prop as string);\n if (!field) {\n const type = isEmbedded ? embeddedType! : identifier.type;\n throw new Error(`There is no field named ${String(prop)} on ${type}`);\n }\n\n switch (field.kind) {\n case '@id': {\n assert(`Expected to receive a string id`, typeof value === 'string' && value.length);\n const normalizedId = String(value);\n const didChange = normalizedId !== identifier.id;\n assert(\n `Cannot set ${identifier.type} record's id to ${normalizedId}, because id is already ${identifier.id}`,\n !didChange || identifier.id === null\n );\n\n if (normalizedId !== null && didChange) {\n store._instanceCache.setRecordId(identifier, normalizedId);\n store.notifications.notify(identifier, 'identity');\n }\n return true;\n }\n case '@local': {\n const signal = getSignal(receiver, prop as string, true);\n if (signal.lastValue !== value) {\n signal.lastValue = value;\n addToTransaction(signal);\n }\n return true;\n }\n case 'field': {\n if (!field.type) {\n cache.setAttr(identifier, propArray, value as Value);\n return true;\n }\n const transform = schema.transformation(field);\n const rawValue = transform.serialize(value, field.options ?? null, target);\n cache.setAttr(identifier, propArray, rawValue);\n return true;\n }\n case 'attribute': {\n cache.setAttr(identifier, propArray, value as Value);\n return true;\n }\n case 'array': {\n if (!field.type) {\n cache.setAttr(identifier, propArray, (value as ArrayValue)?.slice());\n const peeked = peekManagedArray(self, field);\n if (peeked) {\n const arrSignal = peeked[ARRAY_SIGNAL];\n arrSignal.shouldReset = true;\n }\n if (!Array.isArray(value)) {\n ManagedArrayMap.delete(target);\n }\n return true;\n }\n\n const transform = schema.transformation(field);\n const rawValue = (value as ArrayValue).map((item) =>\n transform.serialize(item, field.options ?? null, target)\n );\n cache.setAttr(identifier, propArray, rawValue);\n const peeked = peekManagedArray(self, field);\n if (peeked) {\n const arrSignal = peeked[ARRAY_SIGNAL];\n arrSignal.shouldReset = true;\n }\n return true;\n }\n case 'schema-array': {\n const arrayValue = (value as ArrayValue)?.slice();\n if (!Array.isArray(arrayValue)) {\n ManagedArrayMap.delete(target);\n }\n cache.setAttr(identifier, propArray, arrayValue);\n const peeked = peekManagedArray(self, field);\n if (peeked) {\n const arrSignal = peeked[ARRAY_SIGNAL];\n arrSignal.shouldReset = true;\n }\n if (!Array.isArray(value)) {\n ManagedArrayMap.delete(target);\n }\n return true;\n }\n case 'object': {\n if (!field.type) {\n let newValue = value;\n if (value !== null) {\n newValue = { ...(value as ObjectValue) };\n } else {\n ManagedObjectMap.delete(target);\n }\n\n cache.setAttr(identifier, propArray, newValue as Value);\n\n const peeked = peekManagedObject(self, field);\n if (peeked) {\n const objSignal = peeked[OBJECT_SIGNAL];\n objSignal.shouldReset = true;\n }\n return true;\n }\n\n const transform = schema.transformation(field);\n const rawValue = transform.serialize({ ...(value as ObjectValue) }, field.options ?? null, target);\n\n cache.setAttr(identifier, propArray, rawValue);\n const peeked = peekManagedObject(self, field);\n if (peeked) {\n const objSignal = peeked[OBJECT_SIGNAL];\n objSignal.shouldReset = true;\n }\n return true;\n }\n case 'schema-object': {\n let newValue = value;\n if (value !== null) {\n newValue = { ...(value as ObjectValue) };\n const schemaFields = schema.fields({ type: field.type });\n for (const key of Object.keys(newValue as ObjectValue)) {\n if (!schemaFields.has(key)) {\n throw new Error(`Field ${key} does not exist on schema object ${field.type}`);\n }\n }\n } else {\n ManagedObjectMap.delete(target);\n }\n cache.setAttr(identifier, propArray, newValue as Value);\n // const peeked = peekManagedObject(self, field);\n // if (peeked) {\n // const objSignal = peeked[OBJECT_SIGNAL];\n // objSignal.shouldReset = true;\n // }\n return true;\n }\n case 'derived': {\n throw new Error(`Cannot set ${String(prop)} on ${identifier.type} because it is derived`);\n }\n case 'belongsTo':\n if (!HAS_MODEL_PACKAGE) {\n assert(\n `Cannot use belongsTo fields in your schema unless @ember-data/model is installed to provide legacy model support. ${field.name} should likely be migrated to be a resource field.`\n );\n }\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use belongsTo fields when the resource is in legacy mode`, Mode[Legacy]);\n store._join(() => {\n getLegacySupport(receiver as unknown as MinimalLegacyRecord).setDirtyBelongsTo(field.name, value);\n });\n return true;\n case 'hasMany':\n if (!HAS_MODEL_PACKAGE) {\n assert(\n `Cannot use hasMany fields in your schema unless @ember-data/model is installed to provide legacy model support. ${field.name} should likely be migrated to be a collection field.`\n );\n }\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use hasMany fields when the resource is in legacy mode`, Mode[Legacy]);\n assert(`You must pass an array of records to set a hasMany relationship`, Array.isArray(value));\n store._join(() => {\n const support = getLegacySupport(receiver as unknown as MinimalLegacyRecord);\n const manyArray = support.getManyArray(field.name);\n\n manyArray.splice(0, manyArray.length, ...(value as unknown[]));\n });\n return true;\n\n default:\n throw new Error(`Unknown field kind ${field.kind}`);\n }\n },\n });\n\n // what signal do we need for embedded record?\n this.___notifications = store.notifications.subscribe(\n identifier,\n (_: StableRecordIdentifier, type: NotificationType, key?: string | string[]) => {\n switch (type) {\n case 'identity': {\n if (isEmbedded || !identityField) return; // base paths never apply to embedded records\n\n if (identityField.name && identityField.kind === '@id') {\n const signal = signals.get('@identity');\n if (signal) {\n addToTransaction(signal);\n }\n }\n break;\n }\n case 'attributes':\n if (key) {\n if (Array.isArray(key)) {\n if (!isEmbedded) return; // deep paths will be handled by embedded records\n // TODO we should have the notification manager\n // ensure it is safe for each callback to mutate this array\n if (isPathMatch(embeddedPath!, key)) {\n // handle the notification\n // TODO we should likely handle this notification here\n // also we should add a LOGGING flag\n // eslint-disable-next-line no-console\n console.warn(`Notification unhandled for ${key.join(',')} on ${identifier.type}`, self);\n return;\n }\n\n // TODO we should add a LOGGING flag\n // console.log(`Deep notification skipped for ${key.join('.')} on ${identifier.type}`, self);\n // deep notify the key path\n } else {\n if (isEmbedded) return; // base paths never apply to embedded records\n\n // TODO determine what LOGGING flag to wrap this in if any\n // console.log(`Notification for ${key} on ${identifier.type}`, self);\n const signal = signals.get(key);\n if (signal) {\n addToTransaction(signal);\n }\n const field = fields.get(key);\n if (field?.kind === 'array' || field?.kind === 'schema-array') {\n const peeked = peekManagedArray(self, field);\n if (peeked) {\n const arrSignal = peeked[ARRAY_SIGNAL];\n arrSignal.shouldReset = true;\n addToTransaction(arrSignal);\n }\n }\n if (field?.kind === 'object') {\n const peeked = peekManagedObject(self, field);\n if (peeked) {\n const objSignal = peeked[OBJECT_SIGNAL];\n objSignal.shouldReset = true;\n addToTransaction(objSignal);\n }\n }\n }\n }\n break;\n case 'relationships':\n if (key) {\n if (Array.isArray(key)) {\n // FIXME\n } else {\n if (isEmbedded) return; // base paths never apply to embedded records\n\n const field = fields.get(key);\n assert(`Expected relationshp ${key} to be the name of a field`, field);\n if (field.kind === 'belongsTo') {\n // TODO determine what LOGGING flag to wrap this in if any\n // console.log(`Notification for ${key} on ${identifier.type}`, self);\n const signal = signals.get(key);\n if (signal) {\n addToTransaction(signal);\n }\n // FIXME\n } else if (field.kind === 'resource') {\n // FIXME\n } else if (field.kind === 'hasMany') {\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use hasMany fields when the resource is in legacy mode`, Mode[Legacy]);\n\n const support = getLegacySupport(proxy as unknown as MinimalLegacyRecord);\n const manyArray = support && support._manyArrayCache[key];\n const hasPromise =\n support && (support._relationshipPromisesCache[key] as Promise<unknown> | undefined);\n\n if (manyArray && hasPromise) {\n // do nothing, we will notify the ManyArray directly\n // once the fetch has completed.\n return;\n }\n\n if (manyArray) {\n manyArray.notify();\n\n assert(`Expected options to exist on relationship meta`, field.options);\n assert(`Expected async to exist on relationship meta options`, 'async' in field.options);\n if (field.options.async) {\n const signal = signals.get(key);\n if (signal) {\n addToTransaction(signal);\n }\n }\n }\n } else if (field.kind === 'collection') {\n // FIXME\n }\n }\n }\n\n break;\n }\n }\n );\n\n return proxy;\n }\n\n [Destroy](): void {\n if (this[Legacy]) {\n // @ts-expect-error\n this.isDestroying = true;\n // @ts-expect-error\n this.isDestroyed = true;\n }\n this[RecordStore].notifications.unsubscribe(this.___notifications);\n }\n [Checkout](): Promise<SchemaRecord> {\n return Promise.resolve(this);\n }\n}\n"],"names":["ARRAY_GETTER_METHODS","Set","Symbol","iterator","SYNC_PROPS","isArrayGetter","prop","has","convertToInt","num","Number","isNaN","safeForEach","instance","arr","store","callback","target","undefined","slice","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","length","index","call","ManagedArray","SOURCE","constructor","schema","cache","field","data","identifier","path","owner","isSchemaArray","self","ARRAY_SIGNAL","createSignal","_SIGNAL","boundFns","Map","transaction","mode","options","key","RefStorage","WeakMap","ManagedRecordRefs","proxy","Proxy","get","receiver","shouldReset","t","newData","getAttr","push","val","hashField","resource","type","identity","hashFn","modeField","fields","find","f","name","kind","subscribe","recordRef","record","deref","recordPath","recordIdentifier","Identifier","Parent","SchemaRecord","Editable","Legacy","set","WeakRef","transform","transformation","hydrate","fn","result","arguments","Reflect","apply","value","reflect","setAttr","rawValue","String","map","item","serialize","ignoredGlobalFields","STRUCTURED","ManagedObject","isSchemaObject","OBJECT_SIGNAL","ownKeys","Array","from","keys","Object","getOwnPropertyDescriptor","writable","enumerable","configurable","schemaForField","toStringTag","id","lid","ManagedArrayMap","getOrSetGlobal","ManagedObjectMap","computeLocal","signal","peekSignal","getSignal","lastValue","defaultValue","peekManagedArray","managedArrayMapForRecord","peekManagedObject","managedObjectMapForRecord","computeField","computeArray","managedArray","computeObject","managedObject","computeSchemaObject","legacy","editable","schemaObjectMapForRecord","schemaObject","embeddedPath","computeAttribute","computeDerivation","derivation","ResourceRelationship","parent","getRelationship","links","peekRecord","freeze","assign","meta","RecordStore","fetch","url","getHref","related","method","request","defineSignal","prototype","link","href","computeResource","HAS_MODEL_PACKAGE","dependencySatisfies","getLegacySupport","importSync","lookupLegacySupport","IgnoredGlobalFields","symbolList","Destroy","Checkout","Signals","EmbeddedPath","EmbeddedType","RecordSymbols","isPathMatch","a","b","every","v","i","Mode","isEmbedded","embeddedType","IS_EDITABLE","identityField","signals","toPrimitive","___notifications","propArray","entangleSignal","getBelongsTo","getHasMany","normalizedId","didChange","_instanceCache","setRecordId","notifications","notify","addToTransaction","peeked","arrSignal","isArray","delete","arrayValue","newValue","objSignal","schemaFields","_join","setDirtyBelongsTo","support","manyArray","getManyArray","splice","_","console","warn","join","_manyArrayCache","hasPromise","_relationshipPromisesCache","async","isDestroying","isDestroyed","unsubscribe","Promise","resolve"],"mappings":";;;;;;;AAmBA,MAAMA,oBAAoB,GAAG,IAAIC,GAAG,CAAU,CAC5CC,MAAM,CAACC,QAAQ,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,WAAW,EACX,MAAM,EACN,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,M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gB,CAAChF,MAAM,CAAC,CAAA;AAC1B,qBAAA;AACF,mBAAA;AACF,iBAAA;AACF,eAAC,MAAM,IAAI3F,KAAK,CAACuC,IAAI,KAAK,YAAY,EAAE,CACtC;AAEJ,aAAA;AACF,WAAA;AAEA,UAAA,MAAA;AACJ,OAAA;AACF,KACF,CAAC,CAAA;AAED,IAAA,OAAOpB,KAAK,CAAA;AACd,GAAA;AAEA,EAAA,CAAC0H,OAAO,CAAU,GAAA;AAChB,IAAA,IAAI,IAAI,CAAC3F,MAAM,CAAC,EAAE;AAChB;MACA,IAAI,CAACgJ,YAAY,GAAG,IAAI,CAAA;AACxB;MACA,IAAI,CAACC,WAAW,GAAG,IAAI,CAAA;AACzB,KAAA;IACA,IAAI,CAACzE,WAAW,CAAC,CAAC+C,aAAa,CAAC2B,WAAW,CAAC,IAAI,CAACpC,gBAAgB,CAAC,CAAA;AACpE,GAAA;AACA,EAAA,CAAClB,QAAQ,CAA2B,GAAA;AAClC,IAAA,OAAOuD,OAAO,CAACC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC9B,GAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"record.js","sources":["../src/-private/managed-array.ts","../src/-private/managed-object.ts","../src/-private/compute.ts","../src/record.ts"],"sourcesContent":["import type Store from '@ember-data/store';\nimport type { Signal } from '@ember-data/tracking/-private';\nimport { addToTransaction, createSignal, subscribe } from '@ember-data/tracking/-private';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { Cache } from '@warp-drive/core-types/cache';\nimport type { ArrayValue, ObjectValue, Value } from '@warp-drive/core-types/json/raw';\nimport type { OpaqueRecordInstance } from '@warp-drive/core-types/record';\nimport type { ArrayField, HashField, SchemaArrayField } from '@warp-drive/core-types/schema/fields';\n\nimport { SchemaRecord } from '../record';\nimport type { SchemaService } from '../schema';\nimport { ARRAY_SIGNAL, Editable, Identifier, Legacy, MUTATE, Parent, SOURCE } from '../symbols';\n\nexport function notifyArray(arr: ManagedArray) {\n addToTransaction(arr[ARRAY_SIGNAL]);\n}\n\ntype KeyType = string | symbol | number;\nconst ARRAY_GETTER_METHODS = new Set<KeyType>([\n Symbol.iterator,\n 'concat',\n 'entries',\n 'every',\n 'fill',\n 'filter',\n 'find',\n 'findIndex',\n 'flat',\n 'flatMap',\n 'forEach',\n 'includes',\n 'indexOf',\n 'join',\n 'keys',\n 'lastIndexOf',\n 'map',\n 'reduce',\n 'reduceRight',\n 'slice',\n 'some',\n 'values',\n]);\n// const ARRAY_SETTER_METHODS = new Set<KeyType>(['push', 'pop', 'unshift', 'shift', 'splice', 'sort']);\nconst SYNC_PROPS = new Set<KeyType>(['[]', 'length']);\nfunction isArrayGetter<T>(prop: KeyType): prop is keyof Array<T> {\n return ARRAY_GETTER_METHODS.has(prop);\n}\n// function isArraySetter<T>(prop: KeyType): prop is keyof Array<T> {\n// return ARRAY_SETTER_METHODS.has(prop);\n// }\n// function isSelfProp<T extends object>(self: T, prop: KeyType): prop is keyof T {\n// return prop in self;\n// }\n\nfunction convertToInt(prop: KeyType): number | null {\n if (typeof prop === 'symbol') return null;\n\n const num = Number(prop);\n\n if (isNaN(num)) return null;\n\n return num % 1 === 0 ? num : null;\n}\n\ntype ProxiedMethod = (...args: unknown[]) => unknown;\n\ntype ForEachCB = (record: OpaqueRecordInstance, index: number, context: typeof Proxy<unknown[]>) => void;\nfunction safeForEach(\n instance: typeof Proxy<unknown[]>,\n arr: unknown[],\n store: Store,\n callback: ForEachCB,\n target: unknown\n) {\n if (target === undefined) {\n target = null;\n }\n // clone to prevent mutation\n arr = arr.slice();\n assert('`forEach` expects a function as first argument.', typeof callback === 'function');\n\n // because we retrieveLatest above we need not worry if array is mutated during iteration\n // by unloadRecord/rollbackAttributes\n // push/add/removeObject may still be problematic\n // but this is a more traditionally expected forEach bug.\n const length = arr.length; // we need to access length to ensure we are consumed\n\n for (let index = 0; index < length; index++) {\n callback.call(target, arr[index], index, instance);\n }\n\n return instance;\n}\n\nexport interface ManagedArray extends Omit<Array<unknown>, '[]'> {\n [MUTATE]?(\n target: unknown[],\n receiver: typeof Proxy<unknown[]>,\n prop: string,\n args: unknown[],\n _SIGNAL: Signal\n ): unknown;\n}\n\nexport class ManagedArray {\n [SOURCE]: unknown[];\n declare identifier: StableRecordIdentifier;\n declare path: string[];\n declare owner: SchemaRecord;\n declare [ARRAY_SIGNAL]: Signal;\n declare [Editable]: boolean;\n declare [Legacy]: boolean;\n\n constructor(\n store: Store,\n schema: SchemaService,\n cache: Cache,\n field: ArrayField | SchemaArrayField,\n data: unknown[],\n identifier: StableRecordIdentifier,\n path: string[],\n owner: SchemaRecord,\n isSchemaArray: boolean,\n editable: boolean,\n legacy: boolean\n ) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this[SOURCE] = data?.slice();\n this[ARRAY_SIGNAL] = createSignal(this, 'length');\n this[Editable] = editable;\n this[Legacy] = legacy;\n const _SIGNAL = this[ARRAY_SIGNAL];\n const boundFns = new Map<KeyType, ProxiedMethod>();\n this.identifier = identifier;\n this.path = path;\n this.owner = owner;\n let transaction = false;\n type StorageKlass = typeof WeakMap<object, WeakRef<SchemaRecord>>;\n const mode = (field as SchemaArrayField).options?.key ?? '@identity';\n const RefStorage: StorageKlass =\n mode === '@identity'\n ? (WeakMap as unknown as StorageKlass)\n : // CAUTION CAUTION CAUTION\n // this is a pile of lies\n // the Map is Map<string, WeakRef<SchemaRecord>>\n // but TS does not understand how to juggle modes like this\n // internal to a method like ours without us duplicating the code\n // into two separate methods.\n Map<object, WeakRef<SchemaRecord>>;\n const ManagedRecordRefs = isSchemaArray ? new RefStorage() : null;\n const proxy = new Proxy(this[SOURCE], {\n get<R extends typeof Proxy<unknown[]>>(target: unknown[], prop: keyof R, receiver: R) {\n if (prop === ARRAY_SIGNAL) {\n return _SIGNAL;\n }\n if (prop === 'identifier') {\n return self.identifier;\n }\n if (prop === 'owner') {\n return self.owner;\n }\n\n const index = convertToInt(prop);\n if (_SIGNAL.shouldReset && (index !== null || SYNC_PROPS.has(prop) || isArrayGetter(prop))) {\n _SIGNAL.t = false;\n _SIGNAL.shouldReset = false;\n const newData = cache.getAttr(identifier, path);\n if (newData && newData !== self[SOURCE]) {\n self[SOURCE].length = 0;\n self[SOURCE].push(...(newData as ArrayValue));\n }\n }\n\n if (index !== null) {\n let val;\n if (mode === '@hash') {\n val = target[index];\n const hashField = schema.resource({ type: field.type! }).identity as HashField;\n const hashFn = schema.hashFn(hashField);\n val = hashFn(val as object, null, null);\n } else {\n // if mode is not @identity or @index, then access the key path.\n // we should assert that `mode` is a string\n // it should read directly from the cache value for that field (e.g. no derivation, no transformation)\n // and, we likely should lookup the associated field and throw an error IF\n // the given field does not exist OR\n // the field is anything other than a GenericField or LegacyAttributeField.\n if (mode !== '@identity' && mode !== '@index') {\n assert('mode must be a string', typeof mode === 'string');\n const modeField = schema.resource({ type: field.type! }).fields.find((f) => f.name === mode);\n assert('field must exist in schema', modeField);\n assert(\n 'field must be a GenericField or LegacyAttributeField',\n modeField.kind === 'field' || modeField.kind === 'attribute'\n );\n }\n val =\n mode === '@identity'\n ? target[index]\n : mode === '@index'\n ? '@index'\n : (target[index] as ObjectValue)[mode];\n }\n\n if (isSchemaArray) {\n if (!transaction) {\n subscribe(_SIGNAL);\n }\n\n if (val) {\n const recordRef = ManagedRecordRefs!.get(val);\n let record = recordRef?.deref();\n\n if (!record) {\n const recordPath = path.slice();\n // this is a dirty lie since path is string[] but really we\n // should change the types for paths to `Array<string | number>`\n // TODO we should allow the schema for the field to define a \"key\"\n // for stability. Default should be `@identity` which means that\n // same object reference from cache should result in same SchemaRecord\n // embedded object.\n recordPath.push(index as unknown as string);\n const recordIdentifier = self.owner[Identifier] || self.owner[Parent];\n\n record = new SchemaRecord(\n store,\n recordIdentifier,\n { [Editable]: self.owner[Editable], [Legacy]: self.owner[Legacy] },\n true,\n field.type,\n recordPath\n );\n // if mode is not @identity or @index, then access the key path now\n // to determine the key value.\n // chris says we can implement this as a special kind `@hash` which\n // would be a function that only has access to the cache value and not\n // the record itself, so derivation is possible but intentionally limited\n // and non-reactive?\n ManagedRecordRefs!.set(val, new WeakRef(record));\n } else {\n // TODO update embeddedPath if required\n }\n return record;\n }\n\n return val;\n }\n\n if (!transaction) {\n subscribe(_SIGNAL);\n }\n if (field.type) {\n const transform = schema.transformation(field);\n return transform.hydrate(val as Value, field.options ?? null, self.owner);\n }\n return val;\n }\n\n if (isArrayGetter(prop)) {\n let fn = boundFns.get(prop);\n\n if (fn === undefined) {\n if (prop === 'forEach') {\n fn = function () {\n subscribe(_SIGNAL);\n transaction = true;\n const result = safeForEach(receiver, target, store, arguments[0] as ForEachCB, arguments[1]);\n transaction = false;\n return result;\n };\n } else {\n fn = function () {\n subscribe(_SIGNAL);\n // array functions must run through Reflect to work properly\n // binding via other means will not work.\n transaction = true;\n const result = Reflect.apply(target[prop] as ProxiedMethod, receiver, arguments) as unknown;\n transaction = false;\n return result;\n };\n }\n boundFns.set(prop, fn);\n }\n return fn;\n }\n\n return Reflect.get(target, prop, receiver);\n },\n set(target, prop: KeyType, value, receiver) {\n if (prop === 'identifier') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n self.identifier = value;\n return true;\n }\n if (prop === 'owner') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n self.owner = value;\n return true;\n }\n const reflect = Reflect.set(target, prop, value, receiver);\n\n if (reflect) {\n if (!field.type) {\n cache.setAttr(identifier, path, self[SOURCE] as Value);\n _SIGNAL.shouldReset = true;\n return true;\n }\n\n let rawValue = self[SOURCE] as ArrayValue;\n if (!isSchemaArray) {\n const transform = schema.transformation(field);\n if (!transform) {\n throw new Error(`No '${field.type}' transform defined for use by ${identifier.type}.${String(prop)}`);\n }\n rawValue = (self[SOURCE] as ArrayValue).map((item) =>\n transform.serialize(item, field.options ?? null, self.owner)\n );\n }\n cache.setAttr(identifier, path, rawValue as Value);\n _SIGNAL.shouldReset = true;\n }\n return reflect;\n },\n }) as ManagedArray;\n\n return proxy;\n }\n}\n","import type { Signal } from '@ember-data/tracking/-private';\nimport { addToTransaction, createSignal, subscribe } from '@ember-data/tracking/-private';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { Cache } from '@warp-drive/core-types/cache';\nimport type { ObjectValue, Value } from '@warp-drive/core-types/json/raw';\n// import { STRUCTURED } from '@warp-drive/core-types/request';\nimport type { ObjectField, SchemaObjectField } from '@warp-drive/core-types/schema/fields';\n\nimport type { SchemaRecord } from '../record';\nimport type { SchemaService } from '../schema';\nimport { Editable, EmbeddedPath, Legacy, MUTATE, OBJECT_SIGNAL, Parent, SOURCE } from '../symbols';\n\nexport function notifyObject(obj: ManagedObject) {\n addToTransaction(obj[OBJECT_SIGNAL]);\n}\n\ntype ObjectSymbol = typeof OBJECT_SIGNAL | typeof Parent | typeof SOURCE | typeof Editable | typeof EmbeddedPath;\nconst ObjectSymbols = new Set<ObjectSymbol>([OBJECT_SIGNAL, Parent, SOURCE, Editable, EmbeddedPath]);\n\ntype KeyType = string | symbol | number;\n// const ignoredGlobalFields = new Set<string>(['setInterval', 'nodeType', 'nodeName', 'length', 'document', STRUCTURED]);\n\nexport interface ManagedObject {\n [MUTATE]?(\n target: unknown[],\n receiver: typeof Proxy<unknown[]>,\n prop: string,\n args: unknown[],\n _SIGNAL: Signal\n ): unknown;\n}\n\nexport class ManagedObject {\n declare [SOURCE]: object;\n declare [Parent]: StableRecordIdentifier;\n declare [EmbeddedPath]: string[];\n declare [OBJECT_SIGNAL]: Signal;\n declare [Editable]: boolean;\n declare [Legacy]: boolean;\n\n constructor(\n schema: SchemaService,\n cache: Cache,\n field: ObjectField | SchemaObjectField,\n data: object,\n identifier: StableRecordIdentifier,\n path: string[],\n owner: SchemaRecord,\n editable: boolean,\n legacy: boolean\n ) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this[SOURCE] = { ...data };\n this[OBJECT_SIGNAL] = createSignal(this, 'length');\n this[Editable] = editable;\n this[Legacy] = legacy;\n this[Parent] = identifier;\n this[EmbeddedPath] = path;\n\n const _SIGNAL = this[OBJECT_SIGNAL];\n const proxy = new Proxy(this[SOURCE], {\n ownKeys() {\n return Object.keys(self[SOURCE]);\n },\n\n has(target: unknown, prop: string | number | symbol) {\n return prop in self[SOURCE];\n },\n\n getOwnPropertyDescriptor(target, prop) {\n return {\n writable: editable,\n enumerable: true,\n configurable: true,\n };\n },\n\n get<R extends typeof Proxy<object>>(target: object, prop: keyof R, receiver: R) {\n if (ObjectSymbols.has(prop as ObjectSymbol)) {\n return self[prop as keyof typeof target];\n }\n\n if (prop === Symbol.toPrimitive) {\n return null;\n }\n if (prop === Symbol.toStringTag) {\n return `ManagedObject<${identifier.type}:${identifier.id} (${identifier.lid})>`;\n }\n if (prop === 'constructor') {\n return Object;\n }\n if (prop === 'toString') {\n return function () {\n return `ManagedObject<${identifier.type}:${identifier.id} (${identifier.lid})>`;\n };\n }\n if (prop === 'toHTML') {\n return function () {\n return '<div>ManagedObject</div>';\n };\n }\n\n if (_SIGNAL.shouldReset) {\n _SIGNAL.t = false;\n _SIGNAL.shouldReset = false;\n let newData = cache.getAttr(identifier, path);\n if (newData && newData !== self[SOURCE]) {\n if (field.type) {\n const transform = schema.transformation(field);\n newData = transform.hydrate(newData as ObjectValue, field.options ?? null, owner) as ObjectValue;\n }\n self[SOURCE] = { ...(newData as ObjectValue) }; // Add type assertion for newData\n }\n }\n\n if (prop in self[SOURCE]) {\n subscribe(_SIGNAL);\n\n return (self[SOURCE] as R)[prop];\n }\n return Reflect.get(target, prop, receiver) as R;\n },\n\n set(target, prop: KeyType, value, receiver) {\n assert(`Cannot set read-only property '${String(prop)}' on ManagedObject`, editable);\n const reflect = Reflect.set(target, prop, value, receiver);\n if (!reflect) {\n return false;\n }\n\n if (!field.type) {\n cache.setAttr(identifier, path, self[SOURCE] as Value);\n } else {\n const transform = schema.transformation(field);\n const val = transform.serialize(self[SOURCE], field.options ?? null, owner);\n cache.setAttr(identifier, path, val);\n }\n\n _SIGNAL.shouldReset = true;\n return true;\n },\n }) as ManagedObject;\n\n return proxy;\n }\n}\n","import type { Future } from '@ember-data/request';\nimport type Store from '@ember-data/store';\nimport type { StoreRequestInput } from '@ember-data/store';\nimport { defineSignal, getSignal, peekSignal } from '@ember-data/tracking/-private';\nimport { DEBUG } from '@warp-drive/build-config/env';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport { getOrSetGlobal } from '@warp-drive/core-types/-private';\nimport type { Cache } from '@warp-drive/core-types/cache';\nimport type { ResourceRelationship as SingleResourceRelationship } from '@warp-drive/core-types/cache/relationship';\nimport type { ObjectValue } from '@warp-drive/core-types/json/raw';\nimport type {\n ArrayField,\n DerivedField,\n FieldSchema,\n GenericField,\n LocalField,\n ObjectField,\n SchemaArrayField,\n SchemaObjectField,\n} from '@warp-drive/core-types/schema/fields';\nimport type { Link, Links } from '@warp-drive/core-types/spec/json-api-raw';\nimport { RecordStore } from '@warp-drive/core-types/symbols';\n\nimport { SchemaRecord } from '../record';\nimport type { SchemaService } from '../schema';\nimport { Editable, Identifier, Legacy, Parent } from '../symbols';\nimport { ManagedArray } from './managed-array';\nimport { ManagedObject } from './managed-object';\n\nexport const ManagedArrayMap = getOrSetGlobal(\n 'ManagedArrayMap',\n new Map<SchemaRecord, Map<FieldSchema, ManagedArray>>()\n);\nexport const ManagedObjectMap = getOrSetGlobal(\n 'ManagedObjectMap',\n new Map<SchemaRecord, Map<FieldSchema, ManagedObject | SchemaRecord>>()\n);\n\nexport function computeLocal(record: typeof Proxy<SchemaRecord>, field: LocalField, prop: string): unknown {\n let signal = peekSignal(record, prop);\n\n if (!signal) {\n signal = getSignal(record, prop, false);\n signal.lastValue = field.options?.defaultValue ?? null;\n }\n\n return signal.lastValue;\n}\n\nexport function peekManagedArray(record: SchemaRecord, field: FieldSchema): ManagedArray | undefined {\n const managedArrayMapForRecord = ManagedArrayMap.get(record);\n if (managedArrayMapForRecord) {\n return managedArrayMapForRecord.get(field);\n }\n}\n\nexport function peekManagedObject(record: SchemaRecord, field: ObjectField): ManagedObject | undefined;\nexport function peekManagedObject(record: SchemaRecord, field: SchemaObjectField): SchemaRecord | undefined;\nexport function peekManagedObject(\n record: SchemaRecord,\n field: ObjectField | SchemaObjectField\n): ManagedObject | SchemaRecord | undefined {\n const managedObjectMapForRecord = ManagedObjectMap.get(record);\n if (managedObjectMapForRecord) {\n return managedObjectMapForRecord.get(field);\n }\n}\n\nexport function computeField(\n schema: SchemaService,\n cache: Cache,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: GenericField,\n prop: string | string[]\n): unknown {\n const rawValue = cache.getAttr(identifier, prop);\n if (!field.type) {\n return rawValue;\n }\n const transform = schema.transformation(field);\n return transform.hydrate(rawValue, field.options ?? null, record);\n}\n\nexport function computeArray(\n store: Store,\n schema: SchemaService,\n cache: Cache,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: ArrayField | SchemaArrayField,\n path: string[],\n isSchemaArray: boolean,\n editable: boolean,\n legacy: boolean\n) {\n // the thing we hand out needs to know its owner and path in a private manner\n // its \"address\" is the parent identifier (identifier) + field name (field.name)\n // in the nested object case field name here is the full dot path from root resource to this value\n // its \"key\" is the field on the parent record\n // its \"owner\" is the parent record\n\n const managedArrayMapForRecord = ManagedArrayMap.get(record);\n let managedArray;\n if (managedArrayMapForRecord) {\n managedArray = managedArrayMapForRecord.get(field);\n }\n if (managedArray) {\n return managedArray;\n } else {\n const rawValue = cache.getAttr(identifier, path) as unknown[];\n if (!rawValue) {\n return null;\n }\n managedArray = new ManagedArray(\n store,\n schema,\n cache,\n field,\n rawValue,\n identifier,\n path,\n record,\n isSchemaArray,\n editable,\n legacy\n );\n if (!managedArrayMapForRecord) {\n ManagedArrayMap.set(record, new Map([[field, managedArray]]));\n } else {\n managedArrayMapForRecord.set(field, managedArray);\n }\n }\n return managedArray;\n}\n\nexport function computeObject(\n schema: SchemaService,\n cache: Cache,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: ObjectField,\n path: string[],\n editable: boolean,\n legacy: boolean\n) {\n const managedObjectMapForRecord = ManagedObjectMap.get(record);\n let managedObject;\n if (managedObjectMapForRecord) {\n managedObject = managedObjectMapForRecord.get(field);\n }\n if (managedObject) {\n return managedObject;\n } else {\n let rawValue = cache.getAttr(identifier, path) as object;\n if (!rawValue) {\n return null;\n }\n if (field.type) {\n const transform = schema.transformation(field);\n rawValue = transform.hydrate(rawValue as ObjectValue, field.options ?? null, record) as object;\n }\n managedObject = new ManagedObject(schema, cache, field, rawValue, identifier, path, record, editable, legacy);\n\n if (!managedObjectMapForRecord) {\n ManagedObjectMap.set(record, new Map([[field, managedObject]]));\n } else {\n managedObjectMapForRecord.set(field, managedObject);\n }\n }\n return managedObject;\n}\n\nexport function computeSchemaObject(\n store: Store,\n cache: Cache,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: SchemaObjectField,\n path: string[],\n legacy: boolean,\n editable: boolean\n) {\n const schemaObjectMapForRecord = ManagedObjectMap.get(record);\n let schemaObject;\n if (schemaObjectMapForRecord) {\n schemaObject = schemaObjectMapForRecord.get(field);\n }\n if (schemaObject) {\n return schemaObject;\n } else {\n const rawValue = cache.getAttr(identifier, path) as object;\n if (!rawValue) {\n return null;\n }\n const embeddedPath = path.slice();\n schemaObject = new SchemaRecord(\n store,\n identifier,\n {\n [Editable]: editable,\n [Legacy]: legacy,\n },\n true,\n field.type,\n embeddedPath\n );\n }\n if (!schemaObjectMapForRecord) {\n ManagedObjectMap.set(record, new Map([[field, schemaObject]]));\n } else {\n schemaObjectMapForRecord.set(field, schemaObject);\n }\n return schemaObject;\n}\n\nexport function computeAttribute(cache: Cache, identifier: StableRecordIdentifier, prop: string): unknown {\n return cache.getAttr(identifier, prop);\n}\n\nexport function computeDerivation(\n schema: SchemaService,\n record: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: DerivedField,\n prop: string\n): unknown {\n return schema.derivation(field)(record, field.options ?? null, prop);\n}\n\n// TODO probably this should just be a Document\n// but its separate until we work out the lid situation\nclass ResourceRelationship<T extends SchemaRecord = SchemaRecord> {\n declare lid: string;\n declare [Parent]: SchemaRecord;\n declare [RecordStore]: Store;\n declare name: string;\n\n declare data: T | null;\n declare links: Links;\n declare meta: Record<string, unknown>;\n\n constructor(\n store: Store,\n cache: Cache,\n parent: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: FieldSchema,\n name: string\n ) {\n const rawValue = cache.getRelationship(identifier, name) as SingleResourceRelationship;\n\n // TODO setup true lids for relationship documents\n // @ts-expect-error we need to give relationship documents a lid\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.lid = rawValue.lid ?? rawValue.links?.self ?? `relationship:${identifier.lid}.${name}`;\n this.data = rawValue.data ? store.peekRecord<T>(rawValue.data) : null;\n this.name = name;\n\n if (DEBUG) {\n this.links = Object.freeze(Object.assign({}, rawValue.links));\n this.meta = Object.freeze(Object.assign({}, rawValue.meta));\n } else {\n this.links = rawValue.links ?? {};\n this.meta = rawValue.meta ?? {};\n }\n\n this[RecordStore] = store;\n this[Parent] = parent;\n }\n\n fetch(options?: StoreRequestInput<T, T>): Future<T> {\n const url = options?.url ?? getHref(this.links.related) ?? getHref(this.links.self) ?? null;\n\n if (!url) {\n throw new Error(\n `Cannot ${options?.method ?? 'fetch'} ${this[Parent][Identifier].type}.${String(\n this.name\n )} because it has no related link`\n );\n }\n const request = Object.assign(\n {\n url,\n method: 'GET',\n },\n options\n );\n\n return this[RecordStore].request<T>(request);\n }\n}\n\ndefineSignal(ResourceRelationship.prototype, 'data');\ndefineSignal(ResourceRelationship.prototype, 'links');\ndefineSignal(ResourceRelationship.prototype, 'meta');\n\nfunction getHref(link?: Link | null): string | null {\n if (!link) {\n return null;\n }\n if (typeof link === 'string') {\n return link;\n }\n return link.href;\n}\n\nexport function computeResource<T extends SchemaRecord>(\n store: Store,\n cache: Cache,\n parent: SchemaRecord,\n identifier: StableRecordIdentifier,\n field: FieldSchema,\n prop: string\n): ResourceRelationship<T> {\n if (field.kind !== 'resource') {\n throw new Error(`The schema for ${identifier.type}.${String(prop)} is not a resource relationship`);\n }\n\n return new ResourceRelationship<T>(store, cache, parent, identifier, field, prop);\n}\n","import { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\n\nimport type { MinimalLegacyRecord } from '@ember-data/model/-private/model-methods';\nimport type Store from '@ember-data/store';\nimport type { NotificationType } from '@ember-data/store';\nimport { addToTransaction, entangleSignal, getSignal, type Signal, Signals } from '@ember-data/tracking/-private';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { ArrayValue, ObjectValue, Value } from '@warp-drive/core-types/json/raw';\nimport { STRUCTURED } from '@warp-drive/core-types/request';\nimport type { FieldSchema } from '@warp-drive/core-types/schema/fields';\nimport { RecordStore } from '@warp-drive/core-types/symbols';\n\nimport {\n computeArray,\n computeAttribute,\n computeDerivation,\n computeField,\n computeLocal,\n computeObject,\n computeResource,\n computeSchemaObject,\n ManagedArrayMap,\n ManagedObjectMap,\n peekManagedArray,\n peekManagedObject,\n} from './-private/compute';\nimport type { SchemaService } from './schema';\nimport {\n ARRAY_SIGNAL,\n Checkout,\n Destroy,\n Editable,\n EmbeddedPath,\n EmbeddedType,\n Identifier,\n Legacy,\n OBJECT_SIGNAL,\n Parent,\n} from './symbols';\n\nconst HAS_MODEL_PACKAGE = dependencySatisfies('@ember-data/model', '*');\nconst getLegacySupport = macroCondition(dependencySatisfies('@ember-data/model', '*'))\n ? (importSync('@ember-data/model/-private') as typeof import('@ember-data/model/-private')).lookupLegacySupport\n : null;\n\nexport { Editable, Legacy } from './symbols';\nconst IgnoredGlobalFields = new Set<string>(['length', 'nodeType', 'then', 'setInterval', 'document', STRUCTURED]);\nconst symbolList = [\n Destroy,\n RecordStore,\n Identifier,\n Editable,\n Parent,\n Checkout,\n Legacy,\n Signals,\n EmbeddedPath,\n EmbeddedType,\n];\nconst RecordSymbols = new Set(symbolList);\n\ntype RecordSymbol = (typeof symbolList)[number];\n\nfunction isPathMatch(a: string[], b: string[]) {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n}\n\nexport class SchemaRecord {\n declare [RecordStore]: Store;\n declare [Identifier]: StableRecordIdentifier;\n declare [Parent]: StableRecordIdentifier;\n declare [EmbeddedType]: string | null;\n declare [EmbeddedPath]: string[] | null;\n declare [Editable]: boolean;\n declare [Legacy]: boolean;\n declare [Signals]: Map<string, Signal>;\n declare [Symbol.toStringTag]: `SchemaRecord<${string}>`;\n declare ___notifications: object;\n\n constructor(\n store: Store,\n identifier: StableRecordIdentifier,\n Mode: { [Editable]: boolean; [Legacy]: boolean },\n isEmbedded = false,\n embeddedType: string | null = null,\n embeddedPath: string[] | null = null\n ) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n this[RecordStore] = store;\n if (isEmbedded) {\n this[Parent] = identifier;\n } else {\n this[Identifier] = identifier;\n }\n const IS_EDITABLE = (this[Editable] = Mode[Editable] ?? false);\n this[Legacy] = Mode[Legacy] ?? false;\n\n const schema = store.schema as unknown as SchemaService;\n const cache = store.cache;\n const identityField = schema.resource(identifier).identity;\n\n this[EmbeddedType] = embeddedType;\n this[EmbeddedPath] = embeddedPath;\n\n let fields: Map<string, FieldSchema>;\n if (isEmbedded) {\n fields = schema.fields({ type: embeddedType as string });\n } else {\n fields = schema.fields(identifier);\n }\n\n const signals: Map<string, Signal> = new Map();\n this[Signals] = signals;\n\n const proxy = new Proxy(this, {\n ownKeys() {\n return Array.from(fields.keys());\n },\n\n has(target: SchemaRecord, prop: string | number | symbol) {\n return fields.has(prop as string);\n },\n\n getOwnPropertyDescriptor(target, prop) {\n if (!fields.has(prop as string)) {\n throw new Error(`No field named ${String(prop)} on ${identifier.type}`);\n }\n const schemaForField = fields.get(prop as string)!;\n switch (schemaForField.kind) {\n case 'derived':\n return {\n writable: false,\n enumerable: true,\n configurable: true,\n };\n case '@local':\n case 'field':\n case 'attribute':\n case 'resource':\n case 'alias':\n case 'belongsTo':\n case 'hasMany':\n case 'collection':\n case 'schema-array':\n case 'array':\n case 'schema-object':\n case 'object':\n return {\n writable: IS_EDITABLE,\n enumerable: true,\n configurable: true,\n };\n }\n },\n\n get(target: SchemaRecord, prop: string | number | symbol, receiver: typeof Proxy<SchemaRecord>) {\n if (RecordSymbols.has(prop as RecordSymbol)) {\n return target[prop as keyof SchemaRecord];\n }\n\n if (prop === Symbol.toStringTag) {\n return `SchemaRecord<${identifier.type}:${identifier.id} (${identifier.lid})>`;\n }\n\n if (prop === 'toString') {\n return function () {\n return `SchemaRecord<${identifier.type}:${identifier.id} (${identifier.lid})>`;\n };\n }\n\n if (prop === 'toHTML') {\n return function () {\n return `<div>SchemaRecord<${identifier.type}:${identifier.id} (${identifier.lid})></div>`;\n };\n }\n\n if (prop === Symbol.toPrimitive) {\n return null;\n }\n\n // TODO make this a symbol\n if (prop === '___notifications') {\n return target.___notifications;\n }\n\n // SchemaRecord reserves use of keys that begin with these characters\n // for its own usage.\n // _, @, $, *\n\n const maybeField = prop === identityField?.name ? identityField : fields.get(prop as string);\n if (!maybeField) {\n if (IgnoredGlobalFields.has(prop as string)) {\n return undefined;\n }\n if (prop === 'constructor') {\n return SchemaRecord;\n }\n // too many things check for random symbols\n if (typeof prop === 'symbol') {\n return undefined;\n }\n let type = identifier.type;\n if (isEmbedded) {\n type = embeddedType!;\n }\n\n throw new Error(`No field named ${String(prop)} on ${type}`);\n }\n\n const field = maybeField.kind === 'alias' ? maybeField.options : maybeField;\n assert(\n `Alias fields cannot alias '@id' '@local' '@hash' or 'derived' fields`,\n maybeField.kind !== 'alias' || !['@id', '@local', '@hash', 'derived'].includes(maybeField.options.kind)\n );\n const propArray = isEmbedded ? embeddedPath!.slice() : [];\n // we use the field.name instead of prop here because we want to use the cache-path not\n // the record path.\n propArray.push(field.name as string);\n // propArray.push(prop as string);\n\n switch (field.kind) {\n case '@id':\n entangleSignal(signals, receiver, '@identity');\n return identifier.id;\n case '@hash':\n // TODO pass actual cache value not {}\n return schema.hashFn(field)({}, field.options ?? null, field.name ?? null);\n case '@local': {\n const lastValue = computeLocal(receiver, field, prop as string);\n entangleSignal(signals, receiver, prop as string);\n return lastValue;\n }\n case 'field':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n return computeField(schema, cache, target, identifier, field, propArray);\n case 'attribute':\n entangleSignal(signals, receiver, field.name);\n return computeAttribute(cache, identifier, prop as string);\n case 'resource':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n return computeResource(store, cache, target, identifier, field, prop as string);\n case 'derived':\n return computeDerivation(schema, receiver as unknown as SchemaRecord, identifier, field, prop as string);\n case 'schema-array':\n entangleSignal(signals, receiver, field.name);\n return computeArray(\n store,\n schema,\n cache,\n target,\n identifier,\n field,\n propArray,\n true,\n Mode[Editable],\n Mode[Legacy]\n );\n case 'array':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n return computeArray(\n store,\n schema,\n cache,\n target,\n identifier,\n field,\n propArray,\n false,\n Mode[Editable],\n Mode[Legacy]\n );\n case 'object':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n return computeObject(schema, cache, target, identifier, field, propArray, Mode[Editable], Mode[Legacy]);\n case 'schema-object':\n assert(\n `SchemaRecord.${field.name} is not available in legacy mode because it has type '${field.kind}'`,\n !target[Legacy]\n );\n entangleSignal(signals, receiver, field.name);\n // run transform, then use that value as the object to manage\n return computeSchemaObject(\n store,\n cache,\n target,\n identifier,\n field,\n propArray,\n Mode[Legacy],\n Mode[Editable]\n );\n case 'belongsTo':\n if (!HAS_MODEL_PACKAGE) {\n assert(\n `Cannot use belongsTo fields in your schema unless @ember-data/model is installed to provide legacy model support. ${field.name} should likely be migrated to be a resource field.`\n );\n }\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use belongsTo fields when the resource is in legacy mode`, Mode[Legacy]);\n entangleSignal(signals, receiver, field.name);\n return getLegacySupport(receiver as unknown as MinimalLegacyRecord).getBelongsTo(field.name);\n case 'hasMany':\n if (!HAS_MODEL_PACKAGE) {\n assert(\n `Cannot use hasMany fields in your schema unless @ember-data/model is installed to provide legacy model support. ${field.name} should likely be migrated to be a collection field.`\n );\n }\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use hasMany fields when the resource is in legacy mode`, Mode[Legacy]);\n entangleSignal(signals, receiver, field.name);\n return getLegacySupport(receiver as unknown as MinimalLegacyRecord).getHasMany(field.name);\n default:\n throw new Error(`Field '${String(prop)}' on '${identifier.type}' has the unknown kind '${field.kind}'`);\n }\n },\n set(target: SchemaRecord, prop: string | number | symbol, value: unknown, receiver: typeof Proxy<SchemaRecord>) {\n if (!IS_EDITABLE) {\n throw new Error(`Cannot set ${String(prop)} on ${identifier.type} because the record is not editable`);\n }\n\n const maybeField = prop === identityField?.name ? identityField : fields.get(prop as string);\n if (!maybeField) {\n const type = isEmbedded ? embeddedType! : identifier.type;\n throw new Error(`There is no field named ${String(prop)} on ${type}`);\n }\n const field = maybeField.kind === 'alias' ? maybeField.options : maybeField;\n assert(\n `Alias fields cannot alias '@id' '@local' '@hash' or 'derived' fields`,\n maybeField.kind !== 'alias' || !['@id', '@local', '@hash', 'derived'].includes(maybeField.options.kind)\n );\n const propArray = isEmbedded ? embeddedPath!.slice() : [];\n // we use the field.name instead of prop here because we want to use the cache-path not\n // the record path.\n propArray.push(field.name as string);\n // propArray.push(prop as string);\n\n switch (field.kind) {\n case '@id': {\n assert(`Expected to receive a string id`, typeof value === 'string' && value.length);\n const normalizedId = String(value);\n const didChange = normalizedId !== identifier.id;\n assert(\n `Cannot set ${identifier.type} record's id to ${normalizedId}, because id is already ${identifier.id}`,\n !didChange || identifier.id === null\n );\n\n if (normalizedId !== null && didChange) {\n store._instanceCache.setRecordId(identifier, normalizedId);\n store.notifications.notify(identifier, 'identity');\n }\n return true;\n }\n case '@local': {\n const signal = getSignal(receiver, prop as string, true);\n if (signal.lastValue !== value) {\n signal.lastValue = value;\n addToTransaction(signal);\n }\n return true;\n }\n case 'field': {\n if (!field.type) {\n cache.setAttr(identifier, propArray, value as Value);\n return true;\n }\n const transform = schema.transformation(field);\n const rawValue = transform.serialize(value, field.options ?? null, target);\n cache.setAttr(identifier, propArray, rawValue);\n return true;\n }\n case 'attribute': {\n cache.setAttr(identifier, propArray, value as Value);\n return true;\n }\n case 'array': {\n if (!field.type) {\n cache.setAttr(identifier, propArray, (value as ArrayValue)?.slice());\n const peeked = peekManagedArray(self, field);\n if (peeked) {\n const arrSignal = peeked[ARRAY_SIGNAL];\n arrSignal.shouldReset = true;\n }\n if (!Array.isArray(value)) {\n ManagedArrayMap.delete(target);\n }\n return true;\n }\n\n const transform = schema.transformation(field);\n const rawValue = (value as ArrayValue).map((item) =>\n transform.serialize(item, field.options ?? null, target)\n );\n cache.setAttr(identifier, propArray, rawValue);\n const peeked = peekManagedArray(self, field);\n if (peeked) {\n const arrSignal = peeked[ARRAY_SIGNAL];\n arrSignal.shouldReset = true;\n }\n return true;\n }\n case 'schema-array': {\n const arrayValue = (value as ArrayValue)?.slice();\n if (!Array.isArray(arrayValue)) {\n ManagedArrayMap.delete(target);\n }\n cache.setAttr(identifier, propArray, arrayValue);\n const peeked = peekManagedArray(self, field);\n if (peeked) {\n const arrSignal = peeked[ARRAY_SIGNAL];\n arrSignal.shouldReset = true;\n }\n if (!Array.isArray(value)) {\n ManagedArrayMap.delete(target);\n }\n return true;\n }\n case 'object': {\n if (!field.type) {\n let newValue = value;\n if (value !== null) {\n newValue = { ...(value as ObjectValue) };\n } else {\n ManagedObjectMap.delete(target);\n }\n\n cache.setAttr(identifier, propArray, newValue as Value);\n\n const peeked = peekManagedObject(self, field);\n if (peeked) {\n const objSignal = peeked[OBJECT_SIGNAL];\n objSignal.shouldReset = true;\n }\n return true;\n }\n\n const transform = schema.transformation(field);\n const rawValue = transform.serialize({ ...(value as ObjectValue) }, field.options ?? null, target);\n\n cache.setAttr(identifier, propArray, rawValue);\n const peeked = peekManagedObject(self, field);\n if (peeked) {\n const objSignal = peeked[OBJECT_SIGNAL];\n objSignal.shouldReset = true;\n }\n return true;\n }\n case 'schema-object': {\n let newValue = value;\n if (value !== null) {\n assert(`Expected value to be an object`, typeof value === 'object');\n newValue = { ...(value as ObjectValue) };\n const schemaFields = schema.fields({ type: field.type });\n for (const key of Object.keys(newValue as ObjectValue)) {\n if (!schemaFields.has(key)) {\n throw new Error(`Field ${key} does not exist on schema object ${field.type}`);\n }\n }\n } else {\n ManagedObjectMap.delete(target);\n }\n cache.setAttr(identifier, propArray, newValue as Value);\n // const peeked = peekManagedObject(self, field);\n // if (peeked) {\n // const objSignal = peeked[OBJECT_SIGNAL];\n // objSignal.shouldReset = true;\n // }\n return true;\n }\n case 'derived': {\n throw new Error(`Cannot set ${String(prop)} on ${identifier.type} because it is derived`);\n }\n case 'belongsTo':\n if (!HAS_MODEL_PACKAGE) {\n assert(\n `Cannot use belongsTo fields in your schema unless @ember-data/model is installed to provide legacy model support. ${field.name} should likely be migrated to be a resource field.`\n );\n }\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use belongsTo fields when the resource is in legacy mode`, Mode[Legacy]);\n store._join(() => {\n getLegacySupport(receiver as unknown as MinimalLegacyRecord).setDirtyBelongsTo(field.name, value);\n });\n return true;\n case 'hasMany':\n if (!HAS_MODEL_PACKAGE) {\n assert(\n `Cannot use hasMany fields in your schema unless @ember-data/model is installed to provide legacy model support. ${field.name} should likely be migrated to be a collection field.`\n );\n }\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use hasMany fields when the resource is in legacy mode`, Mode[Legacy]);\n assert(`You must pass an array of records to set a hasMany relationship`, Array.isArray(value));\n store._join(() => {\n const support = getLegacySupport(receiver as unknown as MinimalLegacyRecord);\n const manyArray = support.getManyArray(field.name);\n\n manyArray.splice(0, manyArray.length, ...(value as unknown[]));\n });\n return true;\n\n default:\n throw new Error(`Unknown field kind ${field.kind}`);\n }\n },\n });\n\n // what signal do we need for embedded record?\n this.___notifications = store.notifications.subscribe(\n identifier,\n (_: StableRecordIdentifier, type: NotificationType, key?: string | string[]) => {\n switch (type) {\n case 'identity': {\n if (isEmbedded || !identityField) return; // base paths never apply to embedded records\n\n if (identityField.name && identityField.kind === '@id') {\n const signal = signals.get('@identity');\n if (signal) {\n addToTransaction(signal);\n }\n }\n break;\n }\n case 'attributes':\n if (key) {\n if (Array.isArray(key)) {\n if (!isEmbedded) return; // deep paths will be handled by embedded records\n // TODO we should have the notification manager\n // ensure it is safe for each callback to mutate this array\n if (isPathMatch(embeddedPath!, key)) {\n // handle the notification\n // TODO we should likely handle this notification here\n // also we should add a LOGGING flag\n // eslint-disable-next-line no-console\n console.warn(`Notification unhandled for ${key.join(',')} on ${identifier.type}`, self);\n return;\n }\n\n // TODO we should add a LOGGING flag\n // console.log(`Deep notification skipped for ${key.join('.')} on ${identifier.type}`, self);\n // deep notify the key path\n } else {\n if (isEmbedded) return; // base paths never apply to embedded records\n\n // TODO determine what LOGGING flag to wrap this in if any\n // console.log(`Notification for ${key} on ${identifier.type}`, self);\n const signal = signals.get(key);\n if (signal) {\n addToTransaction(signal);\n }\n const field = fields.get(key);\n if (field?.kind === 'array' || field?.kind === 'schema-array') {\n const peeked = peekManagedArray(self, field);\n if (peeked) {\n const arrSignal = peeked[ARRAY_SIGNAL];\n arrSignal.shouldReset = true;\n addToTransaction(arrSignal);\n }\n }\n if (field?.kind === 'object') {\n const peeked = peekManagedObject(self, field);\n if (peeked) {\n const objSignal = peeked[OBJECT_SIGNAL];\n objSignal.shouldReset = true;\n addToTransaction(objSignal);\n }\n }\n }\n }\n break;\n case 'relationships':\n if (key) {\n if (Array.isArray(key)) {\n // FIXME\n } else {\n if (isEmbedded) return; // base paths never apply to embedded records\n\n const field = fields.get(key);\n assert(`Expected relationshp ${key} to be the name of a field`, field);\n if (field.kind === 'belongsTo') {\n // TODO determine what LOGGING flag to wrap this in if any\n // console.log(`Notification for ${key} on ${identifier.type}`, self);\n const signal = signals.get(key);\n if (signal) {\n addToTransaction(signal);\n }\n // FIXME\n } else if (field.kind === 'resource') {\n // FIXME\n } else if (field.kind === 'hasMany') {\n assert(`Expected to have a getLegacySupport function`, getLegacySupport);\n assert(`Can only use hasMany fields when the resource is in legacy mode`, Mode[Legacy]);\n\n const support = getLegacySupport(proxy as unknown as MinimalLegacyRecord);\n const manyArray = support && support._manyArrayCache[key];\n const hasPromise =\n support && (support._relationshipPromisesCache[key] as Promise<unknown> | undefined);\n\n if (manyArray && hasPromise) {\n // do nothing, we will notify the ManyArray directly\n // once the fetch has completed.\n return;\n }\n\n if (manyArray) {\n manyArray.notify();\n\n assert(`Expected options to exist on relationship meta`, field.options);\n assert(`Expected async to exist on relationship meta options`, 'async' in field.options);\n if (field.options.async) {\n const signal = signals.get(key);\n if (signal) {\n addToTransaction(signal);\n }\n }\n }\n } else if (field.kind === 'collection') {\n // FIXME\n }\n }\n }\n\n break;\n }\n }\n );\n\n return proxy;\n }\n\n [Destroy](): void {\n if (this[Legacy]) {\n // @ts-expect-error\n this.isDestroying = true;\n // @ts-expect-error\n this.isDestroyed = true;\n }\n this[RecordStore].notifications.unsubscribe(this.___notifications);\n }\n [Checkout](): Promise<SchemaRecord> {\n return Promise.resolve(this);\n }\n}\n"],"names":["ARRAY_GETTER_METHODS","Set","Symbol","iterator","SYNC_PROPS","isArrayGetter","prop","has","convertToInt","num","Number","isNaN","safeForEach","instance","arr","store","callback","target","undefined","slice","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","length","index","call","ManagedArray","SOURCE","constructor","schema","cache","field","data","identifier","path","owner","isSchemaArray","editable","legacy","self","ARRAY_SIGNAL","createSignal","Editable","Legacy","_SIGNAL","boundFns","Map","transaction","mode","options","key","RefStorage","WeakMap","ManagedRecordRefs","proxy","Proxy","get","receiver","shouldReset","t","newData","getAttr","push","val","hashField","resource","type","identity","hashFn","modeField","fields","find","f","name","kind","subscribe","recordRef","record","deref","recordPath","recordIdentifier","Identifier","Parent","SchemaRecord","set","WeakRef","transform","transformation","hydrate","fn","result","arguments","Reflect","apply","value","reflect","setAttr","rawValue","String","map","item","serialize","ObjectSymbols","OBJECT_SIGNAL","EmbeddedPath","ManagedObject","ownKeys","Object","keys","getOwnPropertyDescriptor","writable","enumerable","configurable","toPrimitive","toStringTag","id","lid","ManagedArrayMap","getOrSetGlobal","ManagedObjectMap","computeLocal","signal","peekSignal","getSignal","lastValue","defaultValue","peekManagedArray","managedArrayMapForRecord","peekManagedObject","managedObjectMapForRecord","computeField","computeArray","managedArray","computeObject","managedObject","computeSchemaObject","schemaObjectMapForRecord","schemaObject","embeddedPath","computeAttribute","computeDerivation","derivation","ResourceRelationship","parent","getRelationship","links","peekRecord","freeze","assign","meta","RecordStore","fetch","url","getHref","related","method","request","defineSignal","prototype","link","href","computeResource","HAS_MODEL_PACKAGE","dependencySatisfies","getLegacySupport","importSync","lookupLegacySupport","IgnoredGlobalFields","STRUCTURED","symbolList","Destroy","Checkout","Signals","EmbeddedType","RecordSymbols","isPathMatch","a","b","every","v","i","Mode","isEmbedded","embeddedType","IS_EDITABLE","identityField","signals","Array","from","schemaForField","___notifications","maybeField","includes","propArray","entangleSignal","getBelongsTo","getHasMany","normalizedId","didChange","_instanceCache","setRecordId","notifications","notify","addToTransaction","peeked","arrSignal","isArray","delete","arrayValue","newValue","objSignal","schemaFields","_join","setDirtyBelongsTo","support","manyArray","getManyArray","splice","_","console","warn","join","_manyArrayCache","hasPromise","_relationshipPromisesCache","async","isDestroying","isDestroyed","unsubscribe","Promise","resolve"],"mappings":";;;;;;;AAmBA,MAA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AACA,EAAA,CAACnB,QAAQ,CAA2B,GAAA;AAClC,IAAA,OAAO0D,OAAO,CAACC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC9B,GAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/schema-record",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.95",
|
|
4
4
|
"description": "Schema Driven Resource Presentation for WarpDrive and EmberData",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@ember-data/request": "5.4.0-alpha.
|
|
41
|
-
"@ember-data/model": "5.4.0-alpha.
|
|
42
|
-
"@ember-data/store": "5.4.0-alpha.
|
|
43
|
-
"@ember-data/tracking": "5.4.0-alpha.
|
|
44
|
-
"@warp-drive/core-types": "0.0.0-alpha.
|
|
40
|
+
"@ember-data/request": "5.4.0-alpha.109",
|
|
41
|
+
"@ember-data/model": "5.4.0-alpha.109",
|
|
42
|
+
"@ember-data/store": "5.4.0-alpha.109",
|
|
43
|
+
"@ember-data/tracking": "5.4.0-alpha.109",
|
|
44
|
+
"@warp-drive/core-types": "0.0.0-alpha.95"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"@ember-data/model": {
|
|
@@ -76,23 +76,23 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@embroider/macros": "^1.16.1",
|
|
79
|
-
"@warp-drive/build-config": "0.0.0-alpha.
|
|
79
|
+
"@warp-drive/build-config": "0.0.0-alpha.46"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@babel/core": "^7.24.5",
|
|
83
83
|
"@babel/plugin-transform-typescript": "^7.24.5",
|
|
84
84
|
"@babel/preset-env": "^7.24.5",
|
|
85
85
|
"@babel/preset-typescript": "^7.24.1",
|
|
86
|
-
"@ember-data/request": "5.4.0-alpha.
|
|
87
|
-
"@ember-data/model": "5.4.0-alpha.
|
|
88
|
-
"@ember-data/store": "5.4.0-alpha.
|
|
89
|
-
"@ember-data/legacy-compat": "5.4.0-alpha.
|
|
90
|
-
"@ember-data/tracking": "5.4.0-alpha.
|
|
91
|
-
"@ember-data/request-utils": "5.4.0-alpha.
|
|
86
|
+
"@ember-data/request": "5.4.0-alpha.109",
|
|
87
|
+
"@ember-data/model": "5.4.0-alpha.109",
|
|
88
|
+
"@ember-data/store": "5.4.0-alpha.109",
|
|
89
|
+
"@ember-data/legacy-compat": "5.4.0-alpha.109",
|
|
90
|
+
"@ember-data/tracking": "5.4.0-alpha.109",
|
|
91
|
+
"@ember-data/request-utils": "5.4.0-alpha.109",
|
|
92
92
|
"@ember/test-waiters": "^3.1.0",
|
|
93
93
|
"@glimmer/component": "^1.1.2",
|
|
94
|
-
"@warp-drive/core-types": "0.0.0-alpha.
|
|
95
|
-
"@warp-drive/internal-config": "5.4.0-alpha.
|
|
94
|
+
"@warp-drive/core-types": "0.0.0-alpha.95",
|
|
95
|
+
"@warp-drive/internal-config": "5.4.0-alpha.109",
|
|
96
96
|
"ember-source": "~5.8.0",
|
|
97
97
|
"pnpm-sync-dependencies-meta-injected": "0.0.14",
|
|
98
98
|
"typescript": "^5.4.5",
|
|
@@ -19,9 +19,9 @@ declare module '@warp-drive/schema-record/-private/compute' {
|
|
|
19
19
|
export function peekManagedObject(record: SchemaRecord, field: ObjectField): ManagedObject | undefined;
|
|
20
20
|
export function peekManagedObject(record: SchemaRecord, field: SchemaObjectField): SchemaRecord | undefined;
|
|
21
21
|
export function computeField(schema: SchemaService, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: GenericField, prop: string | string[]): unknown;
|
|
22
|
-
export function computeArray(store: Store, schema: SchemaService, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: ArrayField | SchemaArrayField, path: string[], isSchemaArray: boolean): ManagedArray | null;
|
|
23
|
-
export function computeObject(
|
|
24
|
-
export function computeSchemaObject(store: Store, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field:
|
|
22
|
+
export function computeArray(store: Store, schema: SchemaService, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: ArrayField | SchemaArrayField, path: string[], isSchemaArray: boolean, editable: boolean, legacy: boolean): ManagedArray | null;
|
|
23
|
+
export function computeObject(schema: SchemaService, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: ObjectField, path: string[], editable: boolean, legacy: boolean): SchemaRecord | ManagedObject | null;
|
|
24
|
+
export function computeSchemaObject(store: Store, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: SchemaObjectField, path: string[], legacy: boolean, editable: boolean): SchemaRecord | ManagedObject | null;
|
|
25
25
|
export function computeAttribute(cache: Cache, identifier: StableRecordIdentifier, prop: string): unknown;
|
|
26
26
|
export function computeDerivation(schema: SchemaService, record: SchemaRecord, identifier: StableRecordIdentifier, field: DerivedField, prop: string): unknown;
|
|
27
27
|
class ResourceRelationship<T extends SchemaRecord = SchemaRecord> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../src/-private/compute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,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B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAExG;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,sBAAsB,EAClC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,MAAM,GACX,OAAO,CAET;AAID,cAAM,oBAAoB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IACvB,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGpC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,sBAAsB,EAClC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM;IAuBd,KAAK,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;CAoBpD;AAgBD,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EACpD,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,sBAAsB,EAClC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,GACX,oBAAoB,CAAC,CAAC,CAAC,CAMzB"}
|
|
@@ -6,7 +6,7 @@ declare module '@warp-drive/schema-record/-private/managed-array' {
|
|
|
6
6
|
import type { ArrayField, SchemaArrayField } from '@warp-drive/core-types/schema/fields';
|
|
7
7
|
import { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
8
8
|
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
9
|
-
import { ARRAY_SIGNAL, MUTATE, SOURCE } from '@warp-drive/schema-record/symbols';
|
|
9
|
+
import { ARRAY_SIGNAL, Editable, Legacy, MUTATE, SOURCE } from '@warp-drive/schema-record/symbols';
|
|
10
10
|
export function notifyArray(arr: ManagedArray): void;
|
|
11
11
|
export interface ManagedArray extends Omit<Array<unknown>, '[]'> {
|
|
12
12
|
[MUTATE]?(target: unknown[], receiver: typeof Proxy<unknown[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
@@ -17,7 +17,9 @@ declare module '@warp-drive/schema-record/-private/managed-array' {
|
|
|
17
17
|
path: string[];
|
|
18
18
|
owner: SchemaRecord;
|
|
19
19
|
[ARRAY_SIGNAL]: Signal;
|
|
20
|
-
|
|
20
|
+
[Editable]: boolean;
|
|
21
|
+
[Legacy]: boolean;
|
|
22
|
+
constructor(store: Store, schema: SchemaService, cache: Cache, field: ArrayField | SchemaArrayField, data: unknown[], identifier: StableRecordIdentifier, path: string[], owner: SchemaRecord, isSchemaArray: boolean, editable: boolean, legacy: boolean);
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
//# sourceMappingURL=managed-array.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-array.d.ts","sourceRoot":"","sources":["../../src/-private/managed-array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,KAAK,EAAE,UAAU,EAAa,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAEpG,OAAO,EAAE,YAAY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MAAM,CAAC;IACvB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;gBAGxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,GAAG,gBAAgB,EACpC,IAAI,EAAE,OAAO,EAAE,EACf,UAAU,EAAE,sBAAsB,EAClC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,YAAY,EACnB,aAAa,EAAE,OAAO,EACtB,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,OAAO;CA4MlB"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
declare module '@warp-drive/schema-record/-private/managed-object' {
|
|
2
|
-
import type Store from '@ember-data/store';
|
|
3
2
|
import type { Signal } from '@ember-data/tracking/-private';
|
|
4
3
|
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
5
4
|
import type { Cache } from '@warp-drive/core-types/cache';
|
|
6
5
|
import type { ObjectField, SchemaObjectField } from '@warp-drive/core-types/schema/fields';
|
|
7
6
|
import type { SchemaRecord } from '@warp-drive/schema-record/record';
|
|
8
7
|
import type { SchemaService } from '@warp-drive/schema-record/schema';
|
|
9
|
-
import { MUTATE, OBJECT_SIGNAL, SOURCE } from '@warp-drive/schema-record/symbols';
|
|
8
|
+
import { Editable, EmbeddedPath, Legacy, MUTATE, OBJECT_SIGNAL, Parent, SOURCE } from '@warp-drive/schema-record/symbols';
|
|
10
9
|
export function notifyObject(obj: ManagedObject): void;
|
|
11
10
|
export interface ManagedObject {
|
|
12
11
|
[MUTATE]?(target: unknown[], receiver: typeof Proxy<unknown[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
13
12
|
}
|
|
14
13
|
export class ManagedObject {
|
|
15
14
|
[SOURCE]: object;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
owner: SchemaRecord;
|
|
15
|
+
[Parent]: StableRecordIdentifier;
|
|
16
|
+
[EmbeddedPath]: string[];
|
|
19
17
|
[OBJECT_SIGNAL]: Signal;
|
|
20
|
-
|
|
18
|
+
[Editable]: boolean;
|
|
19
|
+
[Legacy]: boolean;
|
|
20
|
+
constructor(schema: SchemaService, cache: Cache, field: ObjectField | SchemaObjectField, data: object, identifier: StableRecordIdentifier, path: string[], owner: SchemaRecord, editable: boolean, legacy: boolean);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=managed-object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-object.d.ts","sourceRoot":"","sources":["../../src/-private/managed-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"managed-object.d.ts","sourceRoot":"","sources":["../../src/-private/managed-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEnG,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,QAE9C;AAQD,MAAM,WAAW,aAAa;IAC5B,CAAC,MAAM,CAAC,CAAC,CACP,MAAM,EAAE,OAAO,EAAE,EACjB,QAAQ,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;CACZ;AAED,qBAAa,aAAa;IAChB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC;IACjC,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;gBAGxB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,WAAW,GAAG,iBAAiB,EACtC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,sBAAsB,EAClC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,OAAO;CAiGlB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
/// <reference path="./hooks.d.ts" />
|
|
1
2
|
/// <reference path="./schema.d.ts" />
|
|
2
3
|
/// <reference path="./symbols.d.ts" />
|
|
3
|
-
/// <reference path="./hooks.d.ts" />
|
|
4
4
|
/// <reference path="./record.d.ts" />
|
|
5
|
+
/// <reference path="./-private/compute.d.ts" />
|
|
5
6
|
/// <reference path="./-private/managed-array.d.ts" />
|
|
6
|
-
/// <reference path="./-private/managed-object.d.ts" />
|
|
7
|
-
/// <reference path="./-private/compute.d.ts" />
|
|
7
|
+
/// <reference path="./-private/managed-object.d.ts" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAA+C,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAElH,OAAO,KAAK,EAAE,sBA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