@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 +5 -5
- package/dist/-private.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{request-state-uRtpn0Lc.js → request-state-DCuV984f.js} +18 -12
- package/dist/request-state-DCuV984f.js.map +1 -0
- package/package.json +11 -15
- package/unstable-preview-types/-private/cache-handler/handler.d.ts +3 -2
- package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +1 -1
- package/unstable-preview-types/-private/cache-handler/types.d.ts +0 -2
- package/unstable-preview-types/-private/cache-handler/types.d.ts.map +1 -1
- package/unstable-preview-types/-private/document.d.ts +10 -10
- package/unstable-preview-types/-private/document.d.ts.map +1 -1
- package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts +9 -9
- package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts.map +1 -1
- package/unstable-preview-types/-private/store-service.d.ts +1 -1
- package/unstable-preview-types/-private/store-service.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +5 -4
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/dist/request-state-uRtpn0Lc.js.map +0 -1
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
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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-
|
|
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-
|
|
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
|
|