@ember-data/store 5.4.0-alpha.52 → 5.4.0-alpha.54
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/addon/-private.js +1 -1
- package/addon/{cache-handler-BGVZPfAA.js → cache-handler-TC2-lizB.js} +8 -10
- package/addon/cache-handler-TC2-lizB.js.map +1 -0
- package/addon/index.js +1 -1
- package/package.json +17 -17
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +1 -6
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -1
- package/unstable-preview-types/-private/store-service.d.ts +3 -3
- package/unstable-preview-types/-private/store-service.d.ts.map +1 -1
- package/unstable-preview-types/-private.d.ts +3 -2
- package/unstable-preview-types/-private.d.ts.map +1 -1
- package/unstable-preview-types/-types/q/identifier.d.ts +24 -0
- package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -1
- package/unstable-preview-types/-types/q/schema-service.d.ts +1 -1
- package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +3 -2
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/addon/cache-handler-BGVZPfAA.js.map +0 -1
package/addon/-private.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as ARRAY_SIGNAL,
|
|
1
|
+
export { A as ARRAY_SIGNAL, b as AdapterPopulatedRecordArray, C as CacheHandler, I as IdentifierArray, M as MUTATE, I as RecordArray, R as RecordArrayManager, d as SOURCE, S as Store, j as StoreMap, _ as _clearCaches, l as _deprecatingNormalize, a as coerceId, c as constructResource, e as ensureStringId, f as fastPush, i as isStableIdentifier, n as notifyArray, p as peekCache, r as recordIdentifierFor, g as removeRecordDataFor, k as setCacheFor, h as setRecordIdentifier, s as storeFor } from "./cache-handler-TC2-lizB";
|
|
@@ -152,6 +152,7 @@ let configuredForgetMethod;
|
|
|
152
152
|
let configuredGenerationMethod;
|
|
153
153
|
let configuredResetMethod;
|
|
154
154
|
let configuredUpdateMethod;
|
|
155
|
+
let configuredKeyInfoMethod;
|
|
155
156
|
function setIdentifierGenerationMethod(method) {
|
|
156
157
|
configuredGenerationMethod = method;
|
|
157
158
|
}
|
|
@@ -164,6 +165,9 @@ function setIdentifierForgetMethod(method) {
|
|
|
164
165
|
function setIdentifierResetMethod(method) {
|
|
165
166
|
configuredResetMethod = method;
|
|
166
167
|
}
|
|
168
|
+
function setKeyInfoForResource(method) {
|
|
169
|
+
configuredKeyInfoMethod = method;
|
|
170
|
+
}
|
|
167
171
|
|
|
168
172
|
// Map<type, Map<id, lid>>
|
|
169
173
|
|
|
@@ -249,7 +253,7 @@ class IdentifierCache {
|
|
|
249
253
|
this._forget = configuredForgetMethod || defaultEmptyCallback;
|
|
250
254
|
this._reset = configuredResetMethod || defaultEmptyCallback;
|
|
251
255
|
this._merge = defaultMergeMethod;
|
|
252
|
-
this._keyInfoForResource = defaultKeyInfoMethod;
|
|
256
|
+
this._keyInfoForResource = configuredKeyInfoMethod || defaultKeyInfoMethod;
|
|
253
257
|
this._isDefaultConfig = !configuredGenerationMethod;
|
|
254
258
|
this._id = IDENTIFIER_CACHE_ID++;
|
|
255
259
|
this._cache = {
|
|
@@ -3666,7 +3670,7 @@ class Store extends EmberObject {
|
|
|
3666
3670
|
* a resource.
|
|
3667
3671
|
*
|
|
3668
3672
|
* This hook can be used to select or instantiate any desired
|
|
3669
|
-
* mechanism of
|
|
3673
|
+
* mechanism of presenting cache data to the ui for access
|
|
3670
3674
|
* mutation, and interaction.
|
|
3671
3675
|
*
|
|
3672
3676
|
* @method instantiateRecord (hook)
|
|
@@ -4996,7 +5000,7 @@ class Store extends EmberObject {
|
|
|
4996
5000
|
if (macroCondition(getOwnConfig().env.DEBUG)) {
|
|
4997
5001
|
assertDestroyingStore(this, 'saveRecord');
|
|
4998
5002
|
}
|
|
4999
|
-
assert(`Unable to
|
|
5003
|
+
assert(`Unable to initiate save for a record in a disconnected state`, storeFor(record));
|
|
5000
5004
|
const identifier = recordIdentifierFor(record);
|
|
5001
5005
|
const cache = this.cache;
|
|
5002
5006
|
if (!identifier) {
|
|
@@ -5004,7 +5008,6 @@ class Store extends EmberObject {
|
|
|
5004
5008
|
// but just in case we reject here to prevent bad things.
|
|
5005
5009
|
return Promise.reject(new Error(`Record Is Disconnected`));
|
|
5006
5010
|
}
|
|
5007
|
-
// TODO we used to check if the record was destroyed here
|
|
5008
5011
|
assert(`Cannot initiate a save request for an unloaded record: ${identifier.lid}`, this._instanceCache.recordIsLoaded(identifier));
|
|
5009
5012
|
if (resourceIsFullyDeleted(this._instanceCache, identifier)) {
|
|
5010
5013
|
return Promise.resolve(record);
|
|
@@ -5029,11 +5032,6 @@ class Store extends EmberObject {
|
|
|
5029
5032
|
[SkipCache]: true
|
|
5030
5033
|
}
|
|
5031
5034
|
};
|
|
5032
|
-
|
|
5033
|
-
// we lie here on the type because legacy doesn't have enough context
|
|
5034
|
-
cache.willCommit(identifier, {
|
|
5035
|
-
request
|
|
5036
|
-
});
|
|
5037
5035
|
return this.request(request).then(document => document.content);
|
|
5038
5036
|
}
|
|
5039
5037
|
|
|
@@ -5716,4 +5714,4 @@ function isCacheAffecting(document) {
|
|
|
5716
5714
|
}
|
|
5717
5715
|
return document.response?.status !== 204;
|
|
5718
5716
|
}
|
|
5719
|
-
export { ARRAY_SIGNAL as A, CacheHandler as C, IdentifierArray as I, MUTATE as M, RecordArrayManager as R, Store as S, _clearCaches as _,
|
|
5717
|
+
export { ARRAY_SIGNAL as A, CacheHandler as C, IdentifierArray as I, MUTATE as M, RecordArrayManager as R, Store as S, _clearCaches as _, coerceId as a, Collection as b, constructResource as c, SOURCE as d, ensureStringId as e, fastPush as f, removeRecordDataFor as g, setRecordIdentifier as h, isStableIdentifier as i, StoreMap as j, setCacheFor as k, normalizeModelName as l, setIdentifierGenerationMethod as m, notifyArray as n, setIdentifierUpdateMethod as o, peekCache as p, setIdentifierForgetMethod as q, recordIdentifierFor as r, storeFor as s, setIdentifierResetMethod as t, setKeyInfoForResource as u };
|