@ember-data/store 5.6.0-alpha.1 → 5.6.0-alpha.3

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/README.md CHANGED
@@ -124,11 +124,11 @@ import RequestManager from '@ember-data/request';
124
124
  import { CacheHandler } from '@ember-data/store';
125
125
  import Fetch from '@ember-data/request/fetch';
126
126
 
127
- export default class extends RequestManager {
128
- constructor(createArgs) {
129
- super(createArgs);
130
- this.use([Fetch]);
131
- this.useCache(CacheHandler);
127
+ export default {
128
+ create() {
129
+ return new RequestManager()
130
+ .use([Fetch])
131
+ .useCache(CacheHandler);
132
132
  }
133
133
  }
134
134
  ```
package/dist/-private.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CacheHandler, k as CollectionRecordArray, I as LiveArray, M as MUTATE, R as RecordArrayManager, v as RelatedCollection, l as SOURCE, G as Signals, S as Store, q as StoreMap, _ as _clearCaches, u as _deprecatingNormalize, h as coerceId, g as constructResource, L as consumeInternalSignal, F as defineNonEnumerableSignal, E as defineSignal, j as ensureStringId, D as entangleSignal, m as fastPush, B as gate, N as getOrCreateInternalSignal, y as getPromiseState, z as getRequestState, f as isDocumentIdentifier, i as isStableIdentifier, w as log, x as logGroup, A as memoized, K as notifyInternalSignal, p as peekCache, H as peekInternalSignal, r as recordIdentifierFor, n as removeRecordDataFor, t as setCacheFor, o as setRecordIdentifier, s as storeFor, J as withSignalStore } from "./request-state-uRtpn0Lc.js";
1
+ export { C as CacheHandler, k as CollectionRecordArray, I as LiveArray, M as MUTATE, R as RecordArrayManager, v as RelatedCollection, l as SOURCE, G as Signals, S as Store, q as StoreMap, _ as _clearCaches, u as _deprecatingNormalize, h as coerceId, g as constructResource, L as consumeInternalSignal, F as defineNonEnumerableSignal, E as defineSignal, j as ensureStringId, D as entangleSignal, m as fastPush, B as gate, N as getOrCreateInternalSignal, y as getPromiseState, z as getRequestState, f as isDocumentIdentifier, i as isStableIdentifier, w as log, x as logGroup, A as memoized, K as notifyInternalSignal, p as peekCache, H as peekInternalSignal, r as recordIdentifierFor, n as removeRecordDataFor, t as setCacheFor, o as setRecordIdentifier, s as storeFor, J as withSignalStore } from "./request-state-DCuV984f.js";
2
2
  export { A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, c as createMemo } from "./configure-BfLLW6GY.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, e as setKeyInfoForResource, s as storeFor } from "./request-state-uRtpn0Lc.js";
1
+ export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, e as setKeyInfoForResource, s as storeFor } from "./request-state-DCuV984f.js";
2
2
  import '@ember/debug';
3
3
  import '@embroider/macros';
4
4
  import '@ember-data/request-utils/string';
@@ -1,6 +1,6 @@
1
1
  import { deprecate, warn } from '@ember/debug';
2
2
  import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
3
- import { EnableHydration, SkipCache } from '@warp-drive/core-types/request';
3
+ import { withBrand, EnableHydration, SkipCache } from '@warp-drive/core-types/request';
4
4
  import { setLogging, getRuntimeConfig } from '@warp-drive/core-types/runtime';
5
5
  import { getOrSetGlobal, peekTransient, setTransient } from '@warp-drive/core-types/-private';
6
6
  import { a as createSignal, b as consumeSignal, n as notifySignal, c as createMemo, w as willSyncFlushWatchers, A as ARRAY_SIGNAL } from "./configure-BfLLW6GY.js";
@@ -1235,7 +1235,10 @@ class ReactiveDocument {
1235
1235
  });
1236
1236
  }
1237
1237
  }
1238
- async #request(link, options) {
1238
+ async #request(link, options = withBrand({
1239
+ url: '',
1240
+ method: 'GET'
1241
+ })) {
1239
1242
  const href = this.links?.[link];
1240
1243
  if (!href) {
1241
1244
  return null;
@@ -1256,9 +1259,12 @@ class ReactiveDocument {
1256
1259
  * @method fetch
1257
1260
  * @public
1258
1261
  * @param {Object} options
1259
- * @return Promise<Document>
1262
+ * @return {Promise<Document>}
1260
1263
  */
1261
- fetch(options = {}) {
1264
+ fetch(options = withBrand({
1265
+ url: '',
1266
+ method: 'GET'
1267
+ })) {
1262
1268
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
1263
1269
  if (!test) {
1264
1270
  throw new Error(`No self or related link`);
@@ -1277,9 +1283,9 @@ class ReactiveDocument {
1277
1283
  * @method next
1278
1284
  * @public
1279
1285
  * @param {Object} options
1280
- * @return Promise<Document | null>
1286
+ * @return {Promise<Document | null>}
1281
1287
  */
1282
- next(options = {}) {
1288
+ next(options) {
1283
1289
  return this.#request('next', options);
1284
1290
  }
1285
1291
 
@@ -1291,9 +1297,9 @@ class ReactiveDocument {
1291
1297
  * @method prev
1292
1298
  * @public
1293
1299
  * @param {Object} options
1294
- * @return Promise<Document | null>
1300
+ * @return {Promise<Document | null>}
1295
1301
  */
1296
- prev(options = {}) {
1302
+ prev(options) {
1297
1303
  return this.#request('prev', options);
1298
1304
  }
1299
1305
 
@@ -1305,9 +1311,9 @@ class ReactiveDocument {
1305
1311
  * @method first
1306
1312
  * @public
1307
1313
  * @param {Object} options
1308
- * @return Promise<Document | null>
1314
+ * @return {Promise<Document | null>}
1309
1315
  */
1310
- first(options = {}) {
1316
+ first(options) {
1311
1317
  return this.#request('first', options);
1312
1318
  }
1313
1319
 
@@ -1319,9 +1325,9 @@ class ReactiveDocument {
1319
1325
  * @method last
1320
1326
  * @public
1321
1327
  * @param {Object} options
1322
- * @return Promise<Document | null>
1328
+ * @return {Promise<Document | null>}
1323
1329
  */
1324
- last(options = {}) {
1330
+ last(options) {
1325
1331
  return this.#request('last', options);
1326
1332
  }
1327
1333