@ember-data/store 5.4.0-alpha.34 → 5.4.0-alpha.35
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/package.json +9 -9
- package/unstable-preview-types/-private/cache-handler.d.ts +1 -1
- package/unstable-preview-types/-private/caches/cache-utils.d.ts +3 -3
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +8 -8
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +10 -10
- package/unstable-preview-types/-private/caches/resource-utils.d.ts +3 -3
- package/unstable-preview-types/-private/document.d.ts +1 -1
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +1 -1
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +1 -1
- package/unstable-preview-types/-private/managers/cache-manager.d.ts +1 -1
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts +3 -3
- package/unstable-preview-types/-private/network/request-cache.d.ts +2 -2
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +8 -8
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +1 -1
- package/unstable-preview-types/-private/store-service.d.ts +1 -1
- package/unstable-preview-types/-private/utils/coerce-id.d.ts +2 -2
- package/unstable-preview-types/-private/utils/construct-resource.d.ts +5 -5
- package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/store",
|
|
3
|
-
"version": "5.4.0-alpha.
|
|
3
|
+
"version": "5.4.0-alpha.35",
|
|
4
4
|
"description": "The core of EmberData. Provides the Store service which coordinates the cache with the network and presentation layers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"ember-data-logo-light.svg"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@ember-data/private-build-infra": "5.4.0-alpha.
|
|
25
|
+
"@ember-data/private-build-infra": "5.4.0-alpha.35",
|
|
26
26
|
"@embroider/macros": "^1.13.5",
|
|
27
27
|
"ember-cli-babel": "^8.2.0",
|
|
28
28
|
"pnpm-sync-dependencies-meta-injected": "0.0.10"
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@ember-data/request": "5.4.0-alpha.
|
|
49
|
-
"@ember-data/tracking": "5.4.0-alpha.
|
|
48
|
+
"@ember-data/request": "5.4.0-alpha.35",
|
|
49
|
+
"@ember-data/tracking": "5.4.0-alpha.35",
|
|
50
50
|
"@ember/string": "^3.1.1",
|
|
51
|
-
"@warp-drive/core-types": "0.0.0-alpha.
|
|
51
|
+
"@warp-drive/core-types": "0.0.0-alpha.21"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@babel/cli": "^7.23.9",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"@babel/preset-env": "^7.23.9",
|
|
62
62
|
"@babel/preset-typescript": "^7.23.3",
|
|
63
63
|
"@babel/runtime": "^7.23.9",
|
|
64
|
-
"@ember-data/request": "5.4.0-alpha.
|
|
65
|
-
"@ember-data/tracking": "5.4.0-alpha.
|
|
64
|
+
"@ember-data/request": "5.4.0-alpha.35",
|
|
65
|
+
"@ember-data/tracking": "5.4.0-alpha.35",
|
|
66
66
|
"@ember/string": "^3.1.1",
|
|
67
67
|
"@embroider/addon-dev": "^4.1.2",
|
|
68
68
|
"@glimmer/component": "^1.1.2",
|
|
69
69
|
"@rollup/plugin-babel": "^6.0.4",
|
|
70
70
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
71
|
-
"@warp-drive/core-types": "0.0.0-alpha.
|
|
72
|
-
"@warp-drive/internal-config": "5.4.0-alpha.
|
|
71
|
+
"@warp-drive/core-types": "0.0.0-alpha.21",
|
|
72
|
+
"@warp-drive/internal-config": "5.4.0-alpha.35",
|
|
73
73
|
"ember-source": "~5.6.0",
|
|
74
74
|
"rollup": "^4.9.6",
|
|
75
75
|
"typescript": "^5.3.3",
|
|
@@ -2,9 +2,9 @@ declare module '@ember-data/store/-private/caches/cache-utils' {
|
|
|
2
2
|
import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
3
|
import type { Cache } from '@ember-data/store/-types/q/cache';
|
|
4
4
|
import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
5
|
+
export const CacheForIdentifierCache: Map<unknown, Cache>;
|
|
6
|
+
export function setCacheFor(identifier: StableRecordIdentifier | OpaqueRecordInstance, cache: Cache): void;
|
|
7
|
+
export function removeRecordDataFor(identifier: StableRecordIdentifier | OpaqueRecordInstance): void;
|
|
8
8
|
export default function peekCache(instance: StableRecordIdentifier): Cache | null;
|
|
9
9
|
export default function peekCache(instance: OpaqueRecordInstance): Cache;
|
|
10
10
|
}
|
|
@@ -3,8 +3,8 @@ declare module '@ember-data/store/-private/caches/identifier-cache' {
|
|
|
3
3
|
import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
|
|
4
4
|
import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/raw';
|
|
5
5
|
import type { ForgetMethod, GenerationMethod, ResetMethod, UpdateMethod } from '@ember-data/store/-types/q/identifier';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export function isStableIdentifier(identifier: unknown): identifier is StableRecordIdentifier;
|
|
7
|
+
export function isDocumentIdentifier(identifier: unknown): identifier is StableDocumentIdentifier;
|
|
8
8
|
interface KeyOptions {
|
|
9
9
|
lid: IdentifierMap;
|
|
10
10
|
id: IdentifierMap;
|
|
@@ -25,11 +25,11 @@ declare module '@ember-data/store/-private/caches/identifier-cache' {
|
|
|
25
25
|
};
|
|
26
26
|
export type KeyInfoMethod = (resource: unknown, known: StableRecordIdentifier | null) => KeyInfo;
|
|
27
27
|
export type MergeMethod = (targetIdentifier: StableRecordIdentifier, matchedIdentifier: StableRecordIdentifier, resourceData: unknown) => StableRecordIdentifier;
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
28
|
+
export function setIdentifierGenerationMethod(method: GenerationMethod | null): void;
|
|
29
|
+
export function setIdentifierUpdateMethod(method: UpdateMethod | null): void;
|
|
30
|
+
export function setIdentifierForgetMethod(method: ForgetMethod | null): void;
|
|
31
|
+
export function setIdentifierResetMethod(method: ResetMethod | null): void;
|
|
32
|
+
export function setKeyInfoForResource(method: KeyInfoMethod | null): void;
|
|
33
33
|
/**
|
|
34
34
|
* Each instance of {Store} receives a unique instance of a IdentifierCache.
|
|
35
35
|
*
|
|
@@ -43,7 +43,7 @@ declare module '@ember-data/store/-private/caches/identifier-cache' {
|
|
|
43
43
|
* @class IdentifierCache
|
|
44
44
|
@public
|
|
45
45
|
*/
|
|
46
|
-
export
|
|
46
|
+
export class IdentifierCache {
|
|
47
47
|
_cache: StableCache;
|
|
48
48
|
_generate: GenerationMethod;
|
|
49
49
|
_update: UpdateMethod;
|
|
@@ -9,7 +9,7 @@ declare module '@ember-data/store/-private/caches/instance-cache' {
|
|
|
9
9
|
import type { CacheManager } from '@ember-data/store/-private/managers/cache-manager';
|
|
10
10
|
import type { CreateRecordProperties } from '@ember-data/store/-private/store-service';
|
|
11
11
|
import type Store from '@ember-data/store/-private/store-service';
|
|
12
|
-
export
|
|
12
|
+
export function peekRecordIdentifier(record: OpaqueRecordInstance): StableRecordIdentifier | undefined;
|
|
13
13
|
/**
|
|
14
14
|
Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)
|
|
15
15
|
assigned to the given record instance.
|
|
@@ -29,16 +29,16 @@ declare module '@ember-data/store/-private/caches/instance-cache' {
|
|
|
29
29
|
@param {Object} record a record instance previously obstained from the store.
|
|
30
30
|
@return {StableRecordIdentifier}
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
32
|
+
export function recordIdentifierFor<T extends TypedRecordInstance>(record: T): StableRecordIdentifier<TypeFromInstance<T>>;
|
|
33
|
+
export function recordIdentifierFor(record: OpaqueRecordInstance): StableRecordIdentifier;
|
|
34
|
+
export function setRecordIdentifier(record: OpaqueRecordInstance, identifier: StableRecordIdentifier): void;
|
|
35
|
+
export const StoreMap: Map<unknown, Store>;
|
|
36
|
+
export function storeFor(record: OpaqueRecordInstance): Store | undefined;
|
|
37
37
|
type Caches = {
|
|
38
38
|
record: Map<StableRecordIdentifier, OpaqueRecordInstance>;
|
|
39
39
|
reference: WeakMap<StableRecordIdentifier, RecordReference>;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
41
|
+
export class InstanceCache {
|
|
42
42
|
store: Store;
|
|
43
43
|
cache: Cache;
|
|
44
44
|
_storeWrapper: CacheCapabilitiesManager;
|
|
@@ -55,9 +55,9 @@ declare module '@ember-data/store/-private/caches/instance-cache' {
|
|
|
55
55
|
clear(type?: string): void;
|
|
56
56
|
setRecordId(identifier: StableRecordIdentifier, id: string): void;
|
|
57
57
|
}
|
|
58
|
-
export
|
|
59
|
-
export
|
|
60
|
-
export
|
|
58
|
+
export function resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: StableRecordIdentifier): boolean;
|
|
59
|
+
export function preloadData(store: Store, identifier: StableRecordIdentifier, preload: Record<string, Value>): void;
|
|
60
|
+
export function _clearCaches(): void;
|
|
61
61
|
export {};
|
|
62
62
|
}
|
|
63
63
|
//# sourceMappingURL=instance-cache.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare module '@ember-data/store/-private/caches/resource-utils' {
|
|
2
|
-
export
|
|
2
|
+
export function hasLid(resource: unknown): resource is {
|
|
3
3
|
lid: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export function hasId(resource: unknown): resource is {
|
|
6
6
|
id: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export function hasType(resource: unknown): resource is {
|
|
9
9
|
type: string;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -3,7 +3,7 @@ declare module '@ember-data/store/-private/legacy-model-support/shim-model-class
|
|
|
3
3
|
import type { AttributeSchema, RelationshipSchema } from '@warp-drive/core-types/schema';
|
|
4
4
|
import type { KeyOrString, ModelSchema } from '@ember-data/store/-types/q/ds-model';
|
|
5
5
|
import type Store from '@ember-data/store/-private/store-service';
|
|
6
|
-
export
|
|
6
|
+
export function getShimClass<T>(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string): ShimModelClass<T>;
|
|
7
7
|
export default class ShimModelClass<T = unknown> implements ModelSchema<T> {
|
|
8
8
|
__store: Store;
|
|
9
9
|
modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
|
|
@@ -8,7 +8,7 @@ declare module '@ember-data/store/-private/managers/cache-capabilities-manager'
|
|
|
8
8
|
/**
|
|
9
9
|
@module @ember-data/store
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export class CacheCapabilitiesManager implements StoreWrapper {
|
|
12
12
|
_willNotify: boolean;
|
|
13
13
|
_pendingNotifies: Map<StableRecordIdentifier, Set<string>>;
|
|
14
14
|
_store: Store;
|
|
@@ -29,7 +29,7 @@ declare module '@ember-data/store/-private/managers/cache-manager' {
|
|
|
29
29
|
* @class CacheManager
|
|
30
30
|
* @public
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export class CacheManager implements Cache {
|
|
33
33
|
#private;
|
|
34
34
|
version: "2";
|
|
35
35
|
constructor(cache: Cache);
|
|
@@ -43,13 +43,13 @@ declare module '@ember-data/store/-private/managers/record-array-manager' {
|
|
|
43
43
|
* @param target the array to push into
|
|
44
44
|
* @param source the items to push into target
|
|
45
45
|
*/
|
|
46
|
-
export
|
|
46
|
+
export function fastPush<T>(target: T[], source: T[]): void;
|
|
47
47
|
type ChangeSet = Map<StableRecordIdentifier, 'add' | 'del'>;
|
|
48
48
|
/**
|
|
49
49
|
@class RecordArrayManager
|
|
50
50
|
@internal
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
class RecordArrayManager {
|
|
53
53
|
store: Store;
|
|
54
54
|
isDestroying: boolean;
|
|
55
55
|
isDestroyed: boolean;
|
|
@@ -91,7 +91,7 @@ declare module '@ember-data/store/-private/managers/record-array-manager' {
|
|
|
91
91
|
clear(isClear?: boolean): void;
|
|
92
92
|
destroy(): void;
|
|
93
93
|
}
|
|
94
|
-
export
|
|
94
|
+
export function disassociateIdentifier(ArraysCache: Map<StableRecordIdentifier, Set<Collection>>, array: Collection, identifier: StableRecordIdentifier): void;
|
|
95
95
|
export default RecordArrayManager;
|
|
96
96
|
}
|
|
97
97
|
//# sourceMappingURL=record-array-manager.d.ts.map
|
|
@@ -2,8 +2,8 @@ declare module '@ember-data/store/-private/network/request-cache' {
|
|
|
2
2
|
import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
3
|
import type { FindRecordOptions } from '@ember-data/store/-types/q/store';
|
|
4
4
|
import type Store from '@ember-data/store/-private/store-service';
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
const Touching: unique symbol;
|
|
6
|
+
export const RequestPromise: unique symbol;
|
|
7
7
|
export interface Operation {
|
|
8
8
|
op: string;
|
|
9
9
|
options: FindRecordOptions | undefined;
|
|
@@ -7,12 +7,12 @@ declare module '@ember-data/store/-private/record-arrays/identifier-array' {
|
|
|
7
7
|
import type RecordArrayManager from '@ember-data/store/-private/managers/record-array-manager';
|
|
8
8
|
import type Store from '@ember-data/store/-private/store-service';
|
|
9
9
|
import { NativeProxy } from '@ember-data/store/-private/record-arrays/native-proxy-type-fix';
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
export
|
|
10
|
+
export const ARRAY_SIGNAL: unique symbol;
|
|
11
|
+
export const SOURCE: unique symbol;
|
|
12
|
+
export const MUTATE: unique symbol;
|
|
13
|
+
export const NOTIFY: unique symbol;
|
|
14
|
+
const IS_COLLECTION: unique symbol;
|
|
15
|
+
export function notifyArray(arr: IdentifierArray): void;
|
|
16
16
|
export type IdentifierArrayCreateOptions<T = unknown> = {
|
|
17
17
|
identifiers: StableRecordIdentifier[];
|
|
18
18
|
type?: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
|
|
@@ -37,7 +37,7 @@ declare module '@ember-data/store/-private/record-arrays/identifier-array' {
|
|
|
37
37
|
interface IdentifierArray<T = unknown> extends Omit<Array<T>, '[]'> {
|
|
38
38
|
[MUTATE]?(target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
class IdentifierArray<T = unknown> {
|
|
41
41
|
DEPRECATED_CLASS_NAME: string;
|
|
42
42
|
/**
|
|
43
43
|
The flag to signal a `RecordArray` is currently loading data.
|
|
@@ -123,7 +123,7 @@ declare module '@ember-data/store/-private/record-arrays/identifier-array' {
|
|
|
123
123
|
query: ImmutableRequestInfo | Record<string, unknown> | null;
|
|
124
124
|
isLoaded: boolean;
|
|
125
125
|
};
|
|
126
|
-
export
|
|
126
|
+
export class Collection<T = unknown> extends IdentifierArray<T> {
|
|
127
127
|
query: ImmutableRequestInfo | Record<string, unknown> | null;
|
|
128
128
|
constructor(options: CollectionCreateOptions);
|
|
129
129
|
_update(): Promise<Collection<T>>;
|
|
@@ -112,7 +112,7 @@ declare module '@ember-data/store/-private/record-arrays/native-proxy-type-fix'
|
|
|
112
112
|
*/
|
|
113
113
|
new <TSource extends object, TTarget extends object>(target: TSource, handler: ProxyHandler<TSource>): TTarget;
|
|
114
114
|
}
|
|
115
|
-
export
|
|
115
|
+
export const NativeProxy: ProxyConstructor;
|
|
116
116
|
export {};
|
|
117
117
|
}
|
|
118
118
|
//# sourceMappingURL=native-proxy-type-fix.d.ts.map
|
|
@@ -74,7 +74,7 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
74
74
|
}): OpaqueRecordInstance;
|
|
75
75
|
teardownRecord(record: OpaqueRecordInstance): void;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
class Store extends EmberObject {
|
|
78
78
|
recordArrayManager: RecordArrayManager;
|
|
79
79
|
/**
|
|
80
80
|
* Provides access to the NotificationManager associated
|
|
@@ -3,8 +3,8 @@ declare module '@ember-data/store/-private/utils/coerce-id' {
|
|
|
3
3
|
@module @ember-data/store
|
|
4
4
|
*/
|
|
5
5
|
type Coercable = string | number | boolean | null | undefined | symbol;
|
|
6
|
-
|
|
7
|
-
export
|
|
6
|
+
function coerceId(id: unknown): string | null;
|
|
7
|
+
export function ensureStringId(id: Coercable): string;
|
|
8
8
|
export default coerceId;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=coerce-id.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare module '@ember-data/store/-private/utils/construct-resource' {
|
|
2
2
|
import type { ExistingResourceIdentifierObject, ResourceIdentifierObject } from '@warp-drive/core-types/spec/raw';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
function constructResource(type: ResourceIdentifierObject): ResourceIdentifierObject;
|
|
4
|
+
function constructResource(type: string, id: string, lid: string): ExistingResourceIdentifierObject;
|
|
5
|
+
function constructResource(type: string | undefined, id: null | undefined, lid: string): ExistingResourceIdentifierObject;
|
|
6
|
+
function constructResource(type: string, id: string, lid?: string | null): ExistingResourceIdentifierObject;
|
|
7
|
+
function constructResource(type: string, id?: string | number | null, lid?: string | null): ResourceIdentifierObject;
|
|
8
8
|
export default constructResource;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=construct-resource.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare module '@ember-data/store/-private/utils/identifier-debug-consts' {
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
2
|
+
export const DEBUG_CLIENT_ORIGINATED: unique symbol;
|
|
3
|
+
export const DEBUG_IDENTIFIER_BUCKET: unique symbol;
|
|
4
|
+
export const DEBUG_STALE_CACHE_OWNER: unique symbol;
|
|
5
|
+
export const CACHE_OWNER: unique symbol;
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=identifier-debug-consts.d.ts.map
|