@warp-drive/core 5.7.0-alpha.3 → 5.7.0-alpha.31

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.
Files changed (116) hide show
  1. package/declarations/graph/-private/-diff.d.ts +7 -20
  2. package/declarations/graph/-private/-edge-definition.d.ts +3 -12
  3. package/declarations/graph/-private/-state.d.ts +2 -2
  4. package/declarations/graph/-private/-utils.d.ts +5 -5
  5. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +3 -3
  6. package/declarations/graph/-private/edges/collection.d.ts +10 -10
  7. package/declarations/graph/-private/edges/implicit.d.ts +5 -5
  8. package/declarations/graph/-private/edges/resource.d.ts +6 -7
  9. package/declarations/graph/-private/graph.d.ts +17 -15
  10. package/declarations/graph/-private/operations/replace-related-records.d.ts +4 -4
  11. package/declarations/graph/-private/operations/update-relationship.d.ts +3 -3
  12. package/declarations/index.d.ts +1 -1
  13. package/declarations/reactive/-private/default-mode.d.ts +73 -0
  14. package/declarations/reactive/-private/document.d.ts +11 -21
  15. package/declarations/reactive/-private/fields/get-field-key.d.ts +8 -0
  16. package/declarations/reactive/-private/fields/managed-array.d.ts +7 -10
  17. package/declarations/reactive/-private/fields/managed-object.d.ts +7 -9
  18. package/declarations/reactive/-private/fields/many-array-manager.d.ts +2 -2
  19. package/declarations/reactive/-private/hooks.d.ts +2 -2
  20. package/declarations/reactive/-private/kind/alias-field.d.ts +4 -0
  21. package/declarations/reactive/-private/kind/array-field.d.ts +4 -0
  22. package/declarations/reactive/-private/kind/attribute-field.d.ts +4 -0
  23. package/declarations/reactive/-private/kind/belongs-to-field.d.ts +4 -0
  24. package/declarations/reactive/-private/kind/collection-field.d.ts +4 -0
  25. package/declarations/reactive/-private/kind/derived-field.d.ts +4 -0
  26. package/declarations/reactive/-private/kind/generic-field.d.ts +4 -0
  27. package/declarations/reactive/-private/kind/has-many-field.d.ts +4 -0
  28. package/declarations/reactive/-private/kind/hash-field.d.ts +4 -0
  29. package/declarations/reactive/-private/kind/identity-field.d.ts +4 -0
  30. package/declarations/reactive/-private/kind/local-field.d.ts +4 -0
  31. package/declarations/reactive/-private/kind/object-field.d.ts +4 -0
  32. package/declarations/reactive/-private/kind/resource-field.d.ts +4 -0
  33. package/declarations/reactive/-private/kind/schema-array-field.d.ts +4 -0
  34. package/declarations/reactive/-private/kind/schema-object-field.d.ts +4 -0
  35. package/declarations/reactive/-private/record.d.ts +44 -33
  36. package/declarations/reactive/-private/schema.d.ts +16 -72
  37. package/declarations/reactive/-private/symbols.d.ts +2 -7
  38. package/declarations/reactive/-private.d.ts +1 -1
  39. package/declarations/reactive.d.ts +278 -1
  40. package/declarations/request/-private/context.d.ts +3 -3
  41. package/declarations/request/-private/fetch.d.ts +2 -0
  42. package/declarations/request/-private/manager.d.ts +24 -28
  43. package/declarations/request/-private/types.d.ts +22 -23
  44. package/declarations/request/-private/utils.d.ts +44 -2
  45. package/declarations/store/-private/cache-handler/handler.d.ts +2 -8
  46. package/declarations/store/-private/cache-handler/types.d.ts +10 -10
  47. package/declarations/store/-private/cache-handler/utils.d.ts +4 -4
  48. package/declarations/store/-private/caches/instance-cache.d.ts +21 -19
  49. package/declarations/store/-private/debug/utils.d.ts +1 -0
  50. package/declarations/store/-private/default-cache-policy.d.ts +25 -38
  51. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +24 -15
  52. package/declarations/store/-private/{caches/identifier-cache.d.ts → managers/cache-key-manager.d.ts} +38 -52
  53. package/declarations/store/-private/managers/cache-manager.d.ts +47 -95
  54. package/declarations/store/-private/managers/notification-manager.d.ts +30 -42
  55. package/declarations/store/-private/managers/record-array-manager.d.ts +45 -41
  56. package/declarations/store/-private/network/request-cache.d.ts +21 -21
  57. package/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +24 -0
  58. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +3 -41
  59. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +14 -29
  60. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +24 -3
  61. package/declarations/store/-private/new-core-tmp/request-state.d.ts +129 -22
  62. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +51 -123
  63. package/declarations/store/-private/record-arrays/-utils.d.ts +80 -0
  64. package/declarations/store/-private/record-arrays/legacy-live-array.d.ts +81 -0
  65. package/declarations/store/-private/record-arrays/legacy-many-array.d.ts +133 -0
  66. package/declarations/store/-private/record-arrays/legacy-query.d.ts +81 -0
  67. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +1 -124
  68. package/declarations/store/-private/record-arrays/resource-array.d.ts +75 -0
  69. package/declarations/store/-private/store-service.d.ts +156 -101
  70. package/declarations/store/-private.d.ts +12 -9
  71. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +15 -24
  72. package/declarations/store/-types/q/identifier.d.ts +9 -6
  73. package/declarations/store/-types/q/record-instance.d.ts +0 -1
  74. package/declarations/store/-types/q/schema-service.d.ts +28 -40
  75. package/declarations/store/-types/q/store.d.ts +6 -7
  76. package/declarations/store/deprecated/-private.d.ts +12 -23
  77. package/declarations/store/deprecated/store.d.ts +11 -12
  78. package/declarations/types/-private.d.ts +1 -1
  79. package/declarations/types/cache/aliases.d.ts +2 -2
  80. package/declarations/types/cache/change.d.ts +2 -2
  81. package/declarations/types/cache/mutations.d.ts +13 -13
  82. package/declarations/types/cache/operations.d.ts +115 -32
  83. package/declarations/types/cache/relationship.d.ts +4 -4
  84. package/declarations/types/cache.d.ts +51 -113
  85. package/declarations/types/graph.d.ts +12 -12
  86. package/declarations/types/identifier.d.ts +52 -76
  87. package/declarations/types/params.d.ts +2 -3
  88. package/declarations/types/request.d.ts +69 -42
  89. package/declarations/types/schema/concepts.d.ts +2 -2
  90. package/declarations/types/schema/fields.d.ts +378 -14
  91. package/declarations/types/spec/document.d.ts +6 -6
  92. package/declarations/types/spec/json-api-raw.d.ts +6 -8
  93. package/declarations/utils/string.d.ts +2 -2
  94. package/dist/{configure-B48bFHOl.js → configure-C3x8YXzL.js} +5 -5
  95. package/dist/configure.js +1 -1
  96. package/dist/{context-COmAnXUQ.js → context-Bh-MA_tH.js} +40 -6
  97. package/dist/graph/-private.js +137 -144
  98. package/dist/index.js +25 -14
  99. package/dist/reactive/-private.js +1 -1
  100. package/dist/reactive.js +203 -1413
  101. package/dist/{request-state-CejVJgdj.js → request-state-DGyt5EV8.js} +5674 -2812
  102. package/dist/request.js +1 -1
  103. package/dist/store/-private.js +2 -3
  104. package/dist/store.js +32 -44
  105. package/dist/{symbols-SIstXMLI.js → symbols-sql1_mdx.js} +3 -8
  106. package/dist/types/-private.js +1 -1
  107. package/dist/types/identifier.js +19 -45
  108. package/dist/types/request.js +45 -3
  109. package/dist/types/schema/fields.js +23 -2
  110. package/dist/utils/string.js +2 -2
  111. package/package.json +10 -10
  112. package/declarations/reactive/-private/fields/compute.d.ts +0 -43
  113. package/declarations/store/-private/caches/cache-utils.d.ts +0 -12
  114. package/declarations/store/-private/record-arrays/identifier-array.d.ts +0 -147
  115. package/declarations/store/-private/record-arrays/many-array.d.ts +0 -197
  116. package/dist/handler-D2jjnIA-.js +0 -339
@@ -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
- * @internal
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
- * @internal
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
- * @internal
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
- * @internal
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, createSignal as a, consumeSignal as b, createMemo as c, willSyncFlushWatchers as d, notifySignal as n, setupSignals as s, waitFor as w };
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-B48bFHOl.js";
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,18 @@ class ContextOwner {
604
639
  }
605
640
  }
606
641
  class Context {
607
- #owner;
608
642
  constructor(owner, isCacheHandler) {
609
643
  this.id = owner.requestId;
610
- this.#owner = owner;
644
+ this.___owner = owner;
611
645
  this.request = owner.enhancedRequest;
612
646
  this._isCacheHandler = isCacheHandler;
613
647
  this._finalized = false;
614
648
  }
615
649
  setStream(stream) {
616
- this.#owner.setStream(stream);
650
+ this.___owner.setStream(stream);
617
651
  }
618
652
  setResponse(response) {
619
- this.#owner.setResponse(response);
653
+ this.___owner.setResponse(response);
620
654
  }
621
655
  setIdentifier(identifier) {
622
656
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
@@ -624,10 +658,10 @@ class Context {
624
658
  throw new Error(`setIdentifier may only be used synchronously from a CacheHandler`);
625
659
  }
626
660
  })(identifier && this._isCacheHandler && !this._finalized) : {};
627
- this.#owner.god.identifier = identifier;
661
+ this.___owner.god.identifier = identifier;
628
662
  }
629
663
  get hasRequestedStream() {
630
- return this.#owner.hasRequestedStream;
664
+ return this.___owner.hasRequestedStream;
631
665
  }
632
666
  _finalize() {
633
667
  this._finalized = true;