@warp-drive/core 5.6.0-beta.1 → 5.6.0-beta.2
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/declarations/graph/-private/-diff.d.ts +7 -20
- package/declarations/graph/-private/-edge-definition.d.ts +3 -12
- package/declarations/graph/-private/-state.d.ts +2 -2
- package/declarations/graph/-private/-utils.d.ts +5 -5
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +3 -3
- package/declarations/graph/-private/edges/collection.d.ts +10 -10
- package/declarations/graph/-private/edges/implicit.d.ts +5 -5
- package/declarations/graph/-private/edges/resource.d.ts +6 -7
- package/declarations/graph/-private/graph.d.ts +17 -15
- package/declarations/graph/-private/operations/replace-related-records.d.ts +4 -4
- package/declarations/graph/-private/operations/update-relationship.d.ts +3 -3
- package/declarations/index.d.ts +1 -1
- package/declarations/reactive/-private/default-mode.d.ts +73 -0
- package/declarations/reactive/-private/document.d.ts +11 -27
- package/declarations/reactive/-private/fields/get-field-key.d.ts +8 -0
- package/declarations/reactive/-private/fields/managed-array.d.ts +7 -10
- package/declarations/reactive/-private/fields/managed-object.d.ts +7 -9
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +2 -2
- package/declarations/reactive/-private/hooks.d.ts +2 -2
- package/declarations/reactive/-private/kind/alias-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/array-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/attribute-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/belongs-to-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/collection-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/derived-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/generic-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/has-many-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/hash-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/identity-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/local-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/object-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/resource-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/schema-array-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/schema-object-field.d.ts +4 -0
- package/declarations/reactive/-private/record.d.ts +44 -33
- package/declarations/reactive/-private/schema.d.ts +50 -66
- package/declarations/reactive/-private/symbols.d.ts +2 -7
- package/declarations/reactive/-private.d.ts +1 -1
- package/declarations/reactive.d.ts +278 -1
- package/declarations/request/-private/context.d.ts +3 -5
- package/declarations/request/-private/fetch.d.ts +2 -0
- package/declarations/request/-private/manager.d.ts +24 -28
- package/declarations/request/-private/types.d.ts +22 -23
- package/declarations/request/-private/utils.d.ts +44 -2
- package/declarations/store/-private/cache-handler/handler.d.ts +2 -8
- package/declarations/store/-private/cache-handler/types.d.ts +10 -10
- package/declarations/store/-private/cache-handler/utils.d.ts +4 -4
- package/declarations/store/-private/caches/instance-cache.d.ts +22 -27
- package/declarations/store/-private/debug/utils.d.ts +1 -0
- package/declarations/store/-private/default-cache-policy.d.ts +25 -38
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +24 -15
- package/declarations/store/-private/{caches/identifier-cache.d.ts → managers/cache-key-manager.d.ts} +38 -52
- package/declarations/store/-private/managers/cache-manager.d.ts +46 -95
- package/declarations/store/-private/managers/notification-manager.d.ts +30 -43
- package/declarations/store/-private/managers/record-array-manager.d.ts +44 -41
- package/declarations/store/-private/network/request-cache.d.ts +21 -24
- package/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +24 -0
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +3 -41
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +14 -29
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +24 -3
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +133 -37
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +51 -133
- package/declarations/store/-private/record-arrays/-utils.d.ts +80 -0
- package/declarations/store/-private/record-arrays/legacy-live-array.d.ts +81 -0
- package/declarations/store/-private/record-arrays/legacy-many-array.d.ts +133 -0
- package/declarations/store/-private/record-arrays/legacy-query.d.ts +81 -0
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +1 -124
- package/declarations/store/-private/record-arrays/resource-array.d.ts +75 -0
- package/declarations/store/-private/store-service.d.ts +167 -872
- package/declarations/store/-private.d.ts +14 -10
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +15 -24
- package/declarations/store/-types/q/identifier.d.ts +9 -6
- package/declarations/store/-types/q/record-instance.d.ts +0 -1
- package/declarations/store/-types/q/schema-service.d.ts +64 -40
- package/declarations/store/-types/q/store.d.ts +6 -7
- package/declarations/store/deprecated/-private.d.ts +224 -0
- package/declarations/store/deprecated/store.d.ts +787 -0
- package/declarations/types/-private.d.ts +1 -1
- package/declarations/types/cache/aliases.d.ts +2 -2
- package/declarations/types/cache/change.d.ts +2 -2
- package/declarations/types/cache/mutations.d.ts +13 -13
- package/declarations/types/cache/operations.d.ts +115 -32
- package/declarations/types/cache/relationship.d.ts +4 -4
- package/declarations/types/cache.d.ts +51 -115
- package/declarations/types/graph.d.ts +12 -12
- package/declarations/types/identifier.d.ts +52 -76
- package/declarations/types/params.d.ts +2 -3
- package/declarations/types/request.d.ts +69 -42
- package/declarations/types/schema/concepts.d.ts +2 -2
- package/declarations/types/schema/fields.d.ts +391 -14
- package/declarations/types/spec/document.d.ts +6 -6
- package/declarations/types/spec/json-api-raw.d.ts +6 -8
- package/declarations/types.d.ts +2 -1
- package/declarations/utils/string.d.ts +2 -2
- package/dist/{configure-B48bFHOl.js → configure-C3x8YXzL.js} +5 -5
- package/dist/configure.js +1 -1
- package/dist/{context-COmAnXUQ.js → context-C_7OLieY.js} +48 -6
- package/dist/graph/-private.js +137 -144
- package/dist/index.js +25 -14
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.js +337 -1422
- package/dist/{request-state-CjLph1LP.js → request-state-C955e0AL.js} +8352 -5912
- package/dist/request.js +1 -1
- package/dist/store/-private.js +2 -3
- package/dist/store.js +32 -44
- package/dist/{symbols-SIstXMLI.js → symbols-sql1_mdx.js} +3 -8
- package/dist/types/-private.js +1 -1
- package/dist/types/identifier.js +19 -45
- package/dist/types/request.js +45 -3
- package/dist/types/schema/fields.js +23 -2
- package/dist/utils/string.js +2 -2
- package/package.json +10 -10
- package/declarations/reactive/-private/fields/compute.d.ts +0 -43
- package/declarations/store/-private/caches/cache-utils.d.ts +0 -12
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts +0 -159
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +0 -17
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +0 -147
- package/declarations/store/-private/record-arrays/many-array.d.ts +0 -197
- package/declarations/store/-types/q/ds-model.d.ts +0 -21
- package/dist/handler-C2T-IyJK.js +0 -339
package/declarations/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type { StableRecordIdentifier, ResourceKey } from "./types/identifier.js";
|
|
8
8
|
export type { CacheCapabilitiesManager } from "./store/-types/q/cache-capabilities-manager.js";
|
|
9
|
-
|
|
9
|
+
// FIXME this should come from somewhere more intelligent
|
|
10
|
+
export type { ModelSchema } from "./store/deprecated/-private.js";
|
|
10
11
|
export type { SchemaService } from "./store/-types/q/schema-service.js";
|
|
11
12
|
export type { BaseFinderOptions, FindRecordOptions, LegacyResourceQuery, QueryOptions, FindAllOptions } from "./store/-types/q/store.js";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* and by `@warp-drive/utilities/string`. It is not intended
|
|
17
17
|
* for use outside of these modules at this time.
|
|
18
18
|
*
|
|
19
|
-
* @
|
|
19
|
+
* @private
|
|
20
20
|
*/
|
|
21
21
|
export declare class LRUCache<
|
|
22
22
|
T,
|
|
@@ -43,6 +43,6 @@ export declare const STRING_DASHERIZE_CACHE: LRUCache<string, string>;
|
|
|
43
43
|
* This version is only in this location to support a deprecated
|
|
44
44
|
* behavior in the core package and will be removed in a future.
|
|
45
45
|
*
|
|
46
|
-
* @
|
|
46
|
+
* @private
|
|
47
47
|
*/
|
|
48
48
|
export declare function dasherize(str: string): string;
|
|
@@ -39,7 +39,7 @@ const OBJECT_SIGNAL = getOrSetGlobal('#{}', Symbol('#{}'));
|
|
|
39
39
|
*
|
|
40
40
|
* It may be an array of signals or a single signal.
|
|
41
41
|
*
|
|
42
|
-
* @
|
|
42
|
+
* @private
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -112,7 +112,7 @@ function setupSignals(buildConfig) {
|
|
|
112
112
|
/**
|
|
113
113
|
* Internal method for consuming the configured `createSignal` hook
|
|
114
114
|
*
|
|
115
|
-
* @
|
|
115
|
+
* @private
|
|
116
116
|
*/
|
|
117
117
|
function createSignal(obj, key) {
|
|
118
118
|
const signalHooks = peekTransient('signalHooks');
|
|
@@ -127,7 +127,7 @@ function createSignal(obj, key) {
|
|
|
127
127
|
/**
|
|
128
128
|
* Internal method for consuming the configured `consumeSignal` hook
|
|
129
129
|
*
|
|
130
|
-
* @
|
|
130
|
+
* @private
|
|
131
131
|
*/
|
|
132
132
|
function consumeSignal(signal) {
|
|
133
133
|
const signalHooks = peekTransient('signalHooks');
|
|
@@ -142,7 +142,7 @@ function consumeSignal(signal) {
|
|
|
142
142
|
/**
|
|
143
143
|
* Internal method for consuming the configured `notifySignal` hook
|
|
144
144
|
*
|
|
145
|
-
* @
|
|
145
|
+
* @private
|
|
146
146
|
*/
|
|
147
147
|
function notifySignal(signal) {
|
|
148
148
|
const signalHooks = peekTransient('signalHooks');
|
|
@@ -178,4 +178,4 @@ function waitFor(promise) {
|
|
|
178
178
|
}
|
|
179
179
|
return promise;
|
|
180
180
|
}
|
|
181
|
-
export { ARRAY_SIGNAL as A, OBJECT_SIGNAL as O,
|
|
181
|
+
export { ARRAY_SIGNAL as A, OBJECT_SIGNAL as O, consumeSignal as a, createMemo as b, createSignal as c, willSyncFlushWatchers as d, notifySignal as n, setupSignals as s, waitFor as w };
|
package/dist/configure.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as setupSignals } from "./configure-
|
|
1
|
+
export { s as setupSignals } from "./configure-C3x8YXzL.js";
|
|
@@ -306,6 +306,19 @@ function ensureDoc(owner, content, isError) {
|
|
|
306
306
|
content: content
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Additional properties exposed on errors thrown by the
|
|
312
|
+
* {@link Fetch | Fetch Handler}.
|
|
313
|
+
*
|
|
314
|
+
* In the case of an Abort or system/browser level issue,
|
|
315
|
+
* this extends {@link DOMException}.
|
|
316
|
+
*
|
|
317
|
+
* Else it extends from {@link AggregateError} if the
|
|
318
|
+
* response includes an array of errors, falling back
|
|
319
|
+
* to {@link Error} as its base.
|
|
320
|
+
*/
|
|
321
|
+
|
|
309
322
|
function enhanceReason(reason) {
|
|
310
323
|
return new DOMException(reason || 'The user aborted a request.', 'AbortError');
|
|
311
324
|
}
|
|
@@ -437,6 +450,17 @@ function upgradePromise(promise, future) {
|
|
|
437
450
|
promise.onFinalize = future.onFinalize;
|
|
438
451
|
promise.id = future.id;
|
|
439
452
|
promise.lid = future.lid;
|
|
453
|
+
promise.requester = future.requester;
|
|
454
|
+
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
455
|
+
// @ts-expect-error
|
|
456
|
+
promise.toJSON = () => {
|
|
457
|
+
const id = 'Future<' + promise.id + '>';
|
|
458
|
+
if (promise.lid) {
|
|
459
|
+
return `${id} (${promise.lid.lid})`;
|
|
460
|
+
}
|
|
461
|
+
return id;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
440
464
|
return promise;
|
|
441
465
|
}
|
|
442
466
|
function createFuture(owner) {
|
|
@@ -464,6 +488,17 @@ function createFuture(owner) {
|
|
|
464
488
|
};
|
|
465
489
|
promise.id = owner.requestId;
|
|
466
490
|
promise.lid = owner.god.identifier;
|
|
491
|
+
promise.requester = owner.god.requester;
|
|
492
|
+
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
493
|
+
// @ts-expect-error
|
|
494
|
+
promise.toJSON = () => {
|
|
495
|
+
const id = 'Future<' + promise.id + '>';
|
|
496
|
+
if (promise.lid) {
|
|
497
|
+
return `${id} (${promise.lid.lid})`;
|
|
498
|
+
}
|
|
499
|
+
return id;
|
|
500
|
+
};
|
|
501
|
+
}
|
|
467
502
|
deferred.promise = promise;
|
|
468
503
|
return deferred;
|
|
469
504
|
}
|
|
@@ -604,19 +639,24 @@ class ContextOwner {
|
|
|
604
639
|
}
|
|
605
640
|
}
|
|
606
641
|
class Context {
|
|
607
|
-
|
|
642
|
+
/** @internal */
|
|
643
|
+
|
|
644
|
+
/** @internal */
|
|
645
|
+
|
|
646
|
+
/** @internal */
|
|
647
|
+
|
|
608
648
|
constructor(owner, isCacheHandler) {
|
|
609
649
|
this.id = owner.requestId;
|
|
610
|
-
this
|
|
650
|
+
this.___owner = owner;
|
|
611
651
|
this.request = owner.enhancedRequest;
|
|
612
652
|
this._isCacheHandler = isCacheHandler;
|
|
613
653
|
this._finalized = false;
|
|
614
654
|
}
|
|
615
655
|
setStream(stream) {
|
|
616
|
-
this
|
|
656
|
+
this.___owner.setStream(stream);
|
|
617
657
|
}
|
|
618
658
|
setResponse(response) {
|
|
619
|
-
this
|
|
659
|
+
this.___owner.setResponse(response);
|
|
620
660
|
}
|
|
621
661
|
setIdentifier(identifier) {
|
|
622
662
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
@@ -624,11 +664,13 @@ class Context {
|
|
|
624
664
|
throw new Error(`setIdentifier may only be used synchronously from a CacheHandler`);
|
|
625
665
|
}
|
|
626
666
|
})(identifier && this._isCacheHandler && !this._finalized) : {};
|
|
627
|
-
this
|
|
667
|
+
this.___owner.god.identifier = identifier;
|
|
628
668
|
}
|
|
629
669
|
get hasRequestedStream() {
|
|
630
|
-
return this
|
|
670
|
+
return this.___owner.hasRequestedStream;
|
|
631
671
|
}
|
|
672
|
+
|
|
673
|
+
/** @private */
|
|
632
674
|
_finalize() {
|
|
633
675
|
this._finalized = true;
|
|
634
676
|
}
|