@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.
Files changed (120) 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 -27
  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 +50 -66
  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 -5
  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 +22 -27
  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 +46 -95
  54. package/declarations/store/-private/managers/notification-manager.d.ts +30 -43
  55. package/declarations/store/-private/managers/record-array-manager.d.ts +44 -41
  56. package/declarations/store/-private/network/request-cache.d.ts +21 -24
  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 +133 -37
  62. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +51 -133
  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 +167 -872
  70. package/declarations/store/-private.d.ts +14 -10
  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 +64 -40
  75. package/declarations/store/-types/q/store.d.ts +6 -7
  76. package/declarations/store/deprecated/-private.d.ts +224 -0
  77. package/declarations/store/deprecated/store.d.ts +787 -0
  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 -115
  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 +391 -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/types.d.ts +2 -1
  94. package/declarations/utils/string.d.ts +2 -2
  95. package/dist/{configure-B48bFHOl.js → configure-C3x8YXzL.js} +5 -5
  96. package/dist/configure.js +1 -1
  97. package/dist/{context-COmAnXUQ.js → context-C_7OLieY.js} +48 -6
  98. package/dist/graph/-private.js +137 -144
  99. package/dist/index.js +25 -14
  100. package/dist/reactive/-private.js +1 -1
  101. package/dist/reactive.js +337 -1422
  102. package/dist/{request-state-CjLph1LP.js → request-state-C955e0AL.js} +8352 -5912
  103. package/dist/request.js +1 -1
  104. package/dist/store/-private.js +2 -3
  105. package/dist/store.js +32 -44
  106. package/dist/{symbols-SIstXMLI.js → symbols-sql1_mdx.js} +3 -8
  107. package/dist/types/-private.js +1 -1
  108. package/dist/types/identifier.js +19 -45
  109. package/dist/types/request.js +45 -3
  110. package/dist/types/schema/fields.js +23 -2
  111. package/dist/utils/string.js +2 -2
  112. package/package.json +10 -10
  113. package/declarations/reactive/-private/fields/compute.d.ts +0 -43
  114. package/declarations/store/-private/caches/cache-utils.d.ts +0 -12
  115. package/declarations/store/-private/legacy-model-support/record-reference.d.ts +0 -159
  116. package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +0 -17
  117. package/declarations/store/-private/record-arrays/identifier-array.d.ts +0 -147
  118. package/declarations/store/-private/record-arrays/many-array.d.ts +0 -197
  119. package/declarations/store/-types/q/ds-model.d.ts +0 -21
  120. package/dist/handler-C2T-IyJK.js +0 -339
package/dist/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import { setLogging, getRuntimeConfig } from './types/runtime.js';
2
- import { a as cloneResponseProperties, I as IS_CACHE_HANDLER, b as assertValidRequest, e as executeNextHandler, d as getRequestResult, u as upgradePromise, s as setPromiseResult, f as clearRequestResult } from "./context-COmAnXUQ.js";
2
+ import { a as cloneResponseProperties, I as IS_CACHE_HANDLER, b as assertValidRequest, e as executeNextHandler, d as getRequestResult, u as upgradePromise, s as setPromiseResult, f as clearRequestResult } from "./context-C_7OLieY.js";
3
3
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
4
- import { w as waitFor } from "./configure-B48bFHOl.js";
4
+ import { w as waitFor } from "./configure-C3x8YXzL.js";
5
5
  import { peekUniversalTransient, setUniversalTransient } from './types/-private.js';
6
- export { S as Store, r as recordIdentifierFor, N as setIdentifierForgetMethod, K as setIdentifierGenerationMethod, O as setIdentifierResetMethod, L as setIdentifierUpdateMethod, P as setKeyInfoForResource, s as storeFor } from "./request-state-CjLph1LP.js";
7
- export { C as CacheHandler } from "./handler-C2T-IyJK.js";
6
+ import { EnableHydration } from './types/request.js';
7
+ export { C as CacheHandler, S as Store, r as recordIdentifierFor, U as setIdentifierForgetMethod, Q as setIdentifierGenerationMethod, V as setIdentifierResetMethod, T as setIdentifierUpdateMethod, W as setKeyInfoForResource, s as storeFor } from "./request-state-C955e0AL.js";
8
8
  import '@ember/debug';
9
9
  import './utils/string.js';
10
+ import "./symbols-sql1_mdx.js";
10
11
 
11
12
  // Lazily close over fetch to avoid breaking Mirage
12
13
  const _fetch = typeof fetch !== 'undefined' ? (...args) => fetch(...args) : typeof FastBoot !== 'undefined' ? (...args) => FastBoot.require('node-fetch')(...args) : () => {
@@ -61,6 +62,9 @@ const Fetch = {
61
62
  } else {
62
63
  e.statusText = 'Unknown Network Error';
63
64
  e.status = 0;
65
+ if (!(e instanceof DOMException)) {
66
+ e.code = 0;
67
+ }
64
68
  e.isRequestError = true;
65
69
  }
66
70
  throw e;
@@ -184,7 +188,8 @@ function isDict(v) {
184
188
  return v !== null && typeof v === 'object';
185
189
  }
186
190
  class RequestManager {
187
- #handlers = [];
191
+ /** @internal */
192
+
188
193
  /** @internal */
189
194
 
190
195
  /**
@@ -202,6 +207,7 @@ class RequestManager {
202
207
  Object.assign(this, options);
203
208
  this._pending = new Map();
204
209
  this._deduped = new Map();
210
+ this._handlers = [];
205
211
  }
206
212
 
207
213
  /**
@@ -218,13 +224,13 @@ class RequestManager {
218
224
  if (this._hasCacheHandler) {
219
225
  throw new Error(`\`RequestManager.useCache(<handler>)\` May only be invoked once.`);
220
226
  }
221
- if (Object.isFrozen(this.#handlers)) {
227
+ if (Object.isFrozen(this._handlers)) {
222
228
  throw new Error(`\`RequestManager.useCache(<handler>)\` May only be invoked prior to any request having been made.`);
223
229
  }
224
230
  this._hasCacheHandler = true;
225
231
  }
226
232
  cacheHandler[IS_CACHE_HANDLER] = true;
227
- this.#handlers.unshift(cacheHandler);
233
+ this._handlers.unshift(cacheHandler);
228
234
  return this;
229
235
  }
230
236
 
@@ -236,11 +242,9 @@ class RequestManager {
236
242
  * curry the request, or pass along a modified request.
237
243
  *
238
244
  * @public
239
- * @param {Handler[]} newHandlers
240
- * @return {ThisType}
241
245
  */
242
246
  use(newHandlers) {
243
- const handlers = this.#handlers;
247
+ const handlers = this._handlers;
244
248
  if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
245
249
  if (Object.isFrozen(handlers)) {
246
250
  throw new Error(`Cannot add a Handler to a RequestManager after a request has been made`);
@@ -264,11 +268,9 @@ class RequestManager {
264
268
  * Returns a Future that fulfills with a StructuredDocument
265
269
  *
266
270
  * @public
267
- * @param {RequestInfo} request
268
- * @return {Future}
269
271
  */
270
272
  request(request) {
271
- const handlers = this.#handlers;
273
+ const handlers = this._handlers;
272
274
  if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
273
275
  if (!Object.isFrozen(handlers)) {
274
276
  Object.freeze(handlers);
@@ -287,7 +289,8 @@ class RequestManager {
287
289
  stream: null,
288
290
  hasRequestedStream: false,
289
291
  id: requestId,
290
- identifier: null
292
+ identifier: null,
293
+ requester: request[EnableHydration] && request.store ? request.store : this
291
294
  };
292
295
  const promise = executeNextHandler(handlers, request, 0, context);
293
296
 
@@ -360,6 +363,14 @@ class RequestManager {
360
363
  }
361
364
  }
362
365
 
366
+ /**
367
+ * This type exists for internal use only for
368
+ * where intimate contracts still exist either for
369
+ * the Test Suite or for Legacy code.
370
+ *
371
+ * @private
372
+ */
373
+
363
374
  /**
364
375
  * @module
365
376
  * @mergeModuleWith <project>
@@ -1 +1 @@
1
- export { E as Editable, L as Legacy } from "../symbols-SIstXMLI.js";
1
+ export { C as Context } from "../symbols-sql1_mdx.js";