@ember-data-types/store 5.6.0-alpha.5 → 5.6.0-beta.1

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 (87) hide show
  1. package/package.json +1 -1
  2. package/unstable-preview-types/-private.d.ts +3 -29
  3. package/unstable-preview-types/configure.d.ts +14 -14
  4. package/unstable-preview-types/index.d.ts +4 -225
  5. package/unstable-preview-types/types.d.ts +3 -6
  6. package/unstable-preview-types/-private/cache-handler/handler.d.ts +0 -59
  7. package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +0 -1
  8. package/unstable-preview-types/-private/cache-handler/types.d.ts +0 -101
  9. package/unstable-preview-types/-private/cache-handler/types.d.ts.map +0 -1
  10. package/unstable-preview-types/-private/cache-handler/utils.d.ts +0 -34
  11. package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +0 -1
  12. package/unstable-preview-types/-private/caches/cache-utils.d.ts +0 -11
  13. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +0 -1
  14. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +0 -171
  15. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +0 -1
  16. package/unstable-preview-types/-private/caches/instance-cache.d.ts +0 -63
  17. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +0 -1
  18. package/unstable-preview-types/-private/caches/resource-utils.d.ts +0 -12
  19. package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +0 -1
  20. package/unstable-preview-types/-private/debug/utils.d.ts +0 -9
  21. package/unstable-preview-types/-private/debug/utils.d.ts.map +0 -1
  22. package/unstable-preview-types/-private/document.d.ts +0 -149
  23. package/unstable-preview-types/-private/document.d.ts.map +0 -1
  24. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +0 -166
  25. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +0 -1
  26. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +0 -19
  27. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
  28. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +0 -28
  29. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
  30. package/unstable-preview-types/-private/managers/cache-manager.d.ts +0 -430
  31. package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +0 -1
  32. package/unstable-preview-types/-private/managers/notification-manager.d.ts +0 -95
  33. package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +0 -1
  34. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +0 -100
  35. package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +0 -1
  36. package/unstable-preview-types/-private/network/request-cache.d.ts +0 -106
  37. package/unstable-preview-types/-private/network/request-cache.d.ts.map +0 -1
  38. package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts +0 -257
  39. package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts.map +0 -1
  40. package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts +0 -91
  41. package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
  42. package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts +0 -172
  43. package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
  44. package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts +0 -32
  45. package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
  46. package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts +0 -256
  47. package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts.map +0 -1
  48. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +0 -143
  49. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +0 -1
  50. package/unstable-preview-types/-private/record-arrays/many-array.d.ts +0 -202
  51. package/unstable-preview-types/-private/record-arrays/many-array.d.ts.map +0 -1
  52. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +0 -118
  53. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
  54. package/unstable-preview-types/-private/store-service.d.ts +0 -1597
  55. package/unstable-preview-types/-private/store-service.d.ts.map +0 -1
  56. package/unstable-preview-types/-private/store-service.type-test.d.ts +0 -4
  57. package/unstable-preview-types/-private/store-service.type-test.d.ts.map +0 -1
  58. package/unstable-preview-types/-private/utils/coerce-id.d.ts +0 -7
  59. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +0 -1
  60. package/unstable-preview-types/-private/utils/construct-resource.d.ts +0 -9
  61. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +0 -1
  62. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +0 -4
  63. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +0 -1
  64. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +0 -4
  65. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +0 -1
  66. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +0 -4
  67. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +0 -1
  68. package/unstable-preview-types/-private.d.ts.map +0 -1
  69. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +0 -102
  70. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +0 -1
  71. package/unstable-preview-types/-types/q/ds-model.d.ts +0 -24
  72. package/unstable-preview-types/-types/q/ds-model.d.ts.map +0 -1
  73. package/unstable-preview-types/-types/q/identifier.d.ts +0 -175
  74. package/unstable-preview-types/-types/q/identifier.d.ts.map +0 -1
  75. package/unstable-preview-types/-types/q/promise-proxies.d.ts +0 -4
  76. package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +0 -1
  77. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +0 -33
  78. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +0 -1
  79. package/unstable-preview-types/-types/q/record-instance.d.ts +0 -24
  80. package/unstable-preview-types/-types/q/record-instance.d.ts.map +0 -1
  81. package/unstable-preview-types/-types/q/schema-service.d.ts +0 -334
  82. package/unstable-preview-types/-types/q/schema-service.d.ts.map +0 -1
  83. package/unstable-preview-types/-types/q/store.d.ts +0 -37
  84. package/unstable-preview-types/-types/q/store.d.ts.map +0 -1
  85. package/unstable-preview-types/configure.d.ts.map +0 -1
  86. package/unstable-preview-types/index.d.ts.map +0 -1
  87. package/unstable-preview-types/types.d.ts.map +0 -1
@@ -1,171 +0,0 @@
1
- declare module '@ember-data/store/-private/caches/identifier-cache' {
2
- import { type Identifier, type RecordIdentifier, type StableDocumentIdentifier, type StableExistingRecordIdentifier, type StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
- import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
4
- import type { ExistingResourceIdentifierObject, ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';
5
- import type { ForgetMethod, GenerationMethod, KeyInfo, KeyInfoMethod, ResetMethod, UpdateMethod } from '@ember-data/store/-types/q/identifier';
6
- type TypeFromIdentifier<T> = T extends {
7
- type: infer U;
8
- } ? U : string;
9
- type NarrowIdentifierIfPossible<T> = T extends ExistingResourceIdentifierObject ? StableExistingRecordIdentifier<TypeFromIdentifier<T>> : StableRecordIdentifier;
10
- export function isStableIdentifier(identifier: unknown): identifier is StableRecordIdentifier;
11
- export function isDocumentIdentifier(identifier: unknown): identifier is StableDocumentIdentifier;
12
- interface KeyOptions {
13
- lid: IdentifierMap;
14
- id: IdentifierMap;
15
- }
16
- type TypeMap = {
17
- [key: string]: KeyOptions;
18
- };
19
- type IdentifierMap = Map<string, StableRecordIdentifier>;
20
- type StableCache = {
21
- resources: IdentifierMap;
22
- documents: Map<string, StableDocumentIdentifier>;
23
- resourcesByType: TypeMap;
24
- polymorphicLidBackMap: Map<string, string[]>;
25
- };
26
- export type MergeMethod = (targetIdentifier: StableRecordIdentifier, matchedIdentifier: StableRecordIdentifier, resourceData: unknown) => StableRecordIdentifier;
27
- export function setIdentifierGenerationMethod(method: GenerationMethod | null): void;
28
- export function setIdentifierUpdateMethod(method: UpdateMethod | null): void;
29
- export function setIdentifierForgetMethod(method: ForgetMethod | null): void;
30
- export function setIdentifierResetMethod(method: ResetMethod | null): void;
31
- export function setKeyInfoForResource(method: KeyInfoMethod | null): void;
32
- /**
33
- * Each instance of {Store} receives a unique instance of a IdentifierCache.
34
- *
35
- * This cache is responsible for assigning or retrieving the unique identify
36
- * for arbitrary resource data encountered by the store. Data representing
37
- * a unique resource or record should always be represented by the same
38
- * identifier.
39
- *
40
- * It can be configured by consuming applications.
41
- *
42
- * @class IdentifierCache
43
- @public
44
- */
45
- export class IdentifierCache {
46
- _cache: StableCache;
47
- _generate: GenerationMethod;
48
- _update: UpdateMethod;
49
- _forget: ForgetMethod;
50
- _reset: ResetMethod;
51
- _merge: MergeMethod;
52
- _keyInfoForResource: KeyInfoMethod;
53
- _id: number;
54
- constructor();
55
- /**
56
- * Internal hook to allow management of merge conflicts with identifiers.
57
- *
58
- * we allow late binding of this private internal merge so that
59
- * the cache can insert itself here to handle elimination of duplicates
60
- *
61
- * @private
62
- */
63
- __configureMerge(method: MergeMethod | null): void;
64
- upgradeIdentifier(resource: {
65
- type: string;
66
- id: string | null;
67
- lid?: string;
68
- }): StableRecordIdentifier;
69
- /**
70
- * @private
71
- */
72
- _getRecordIdentifier(resource: {
73
- type: string;
74
- id: string | null;
75
- lid?: string;
76
- }, shouldGenerate: 2): StableRecordIdentifier;
77
- _getRecordIdentifier(resource: unknown, shouldGenerate: 1): StableRecordIdentifier;
78
- _getRecordIdentifier(resource: unknown, shouldGenerate: 0): StableRecordIdentifier | undefined;
79
- /**
80
- * allows us to peek without generating when needed
81
- * useful for the "create" case when we need to see if
82
- * we are accidentally overwritting something
83
- *
84
- * @param resource
85
- * @return {StableRecordIdentifier | undefined}
86
- * @private
87
- */
88
- peekRecordIdentifier(resource: ResourceIdentifierObject | Identifier): StableRecordIdentifier | undefined;
89
- /**
90
- Returns the DocumentIdentifier for the given Request, creates one if it does not yet exist.
91
- Returns `null` if the request does not have a `cacheKey` or `url`.
92
-
93
- @param request
94
- @return {StableDocumentIdentifier | null}
95
- @public
96
- */
97
- getOrCreateDocumentIdentifier(request: ImmutableRequestInfo): StableDocumentIdentifier | null;
98
- /**
99
- Returns the Identifier for the given Resource, creates one if it does not yet exist.
100
-
101
- Specifically this means that we:
102
-
103
- - validate the `id` `type` and `lid` combo against known identifiers
104
- - return an object with an `lid` that is stable (repeated calls with the same
105
- `id` + `type` or `lid` will return the same `lid` value)
106
- - this referential stability of the object itself is guaranteed
107
-
108
- @param resource
109
- @return {StableRecordIdentifier}
110
- @public
111
- */
112
- getOrCreateRecordIdentifier<T>(resource: T): NarrowIdentifierIfPossible<T>;
113
- /**
114
- Returns a new Identifier for the supplied data. Call this method to generate
115
- an identifier when a new resource is being created local to the client and
116
- potentially does not have an `id`.
117
-
118
- Delegates generation to the user supplied `GenerateMethod` if one has been provided
119
- with the signature `generateMethod({ type }, 'record')`.
120
-
121
- @param data
122
- @return {StableRecordIdentifier}
123
- @public
124
- */
125
- createIdentifierForNewRecord(data: {
126
- type: string;
127
- id?: string | null;
128
- }): StableRecordIdentifier;
129
- /**
130
- Provides the opportunity to update secondary lookup tables for existing identifiers
131
- Called after an identifier created with `createIdentifierForNewRecord` has been
132
- committed.
133
-
134
- Assigned `id` to an `Identifier` if `id` has not previously existed; however,
135
- attempting to change the `id` or calling update without providing an `id` when
136
- one is missing will throw an error.
137
-
138
- - sets `id` (if `id` was previously `null`)
139
- - `lid` and `type` MUST NOT be altered post creation
140
-
141
- If a merge occurs, it is possible the returned identifier does not match the originally
142
- provided identifier. In this case the abandoned identifier will go through the usual
143
- `forgetRecordIdentifier` codepaths.
144
-
145
- @param identifierObject
146
- @param data
147
- @return {StableRecordIdentifier}
148
- @public
149
- */
150
- updateRecordIdentifier(identifierObject: RecordIdentifier, data: unknown): StableRecordIdentifier;
151
- /**
152
- * @private
153
- */
154
- _mergeRecordIdentifiers(keyInfo: KeyInfo, identifier: StableRecordIdentifier, existingIdentifier: StableRecordIdentifier, data: unknown): StableRecordIdentifier;
155
- /**
156
- Provides the opportunity to eliminate an identifier from secondary lookup tables
157
- as well as eliminates it from ember-data's own lookup tables and book keeping.
158
-
159
- Useful when a record has been deleted and the deletion has been persisted and
160
- we do not care about the record anymore. Especially useful when an `id` of a
161
- deleted record might be reused later for a new record.
162
-
163
- @param identifierObject
164
- @public
165
- */
166
- forgetRecordIdentifier(identifierObject: RecordIdentifier): void;
167
- destroy(): void;
168
- }
169
- export {};
170
- }
171
- //# sourceMappingURL=identifier-cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identifier-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/identifier-cache.ts"],"names":[],"mappings":"AAQA,OAAO,EAKL,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EAEnC,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EACV,gCAAgC,EAEhC,wBAAwB,EACzB,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACb,MAAM,2BAA2B,CAAC;AAQnC,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,MAAM,CAAC;AAEtE,KAAK,0BAA0B,CAAC,CAAC,IAAI,CAAC,SAAS,gCAAgC,GAC3E,8BAA8B,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GACrD,sBAAsB,CAAC;AAI3B,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,sBAAsB,CAE5F;AAED,wBAAgB,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gBAAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,GAAG,sBAAsB;IAoEjG;;OAEG;IACH,uBAAuB,CACrB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,sBAAsB,EAClC,kBAAkB,EAAE,sBAAsB,EAC1C,IAAI,EAAE,OAAO,GACZ,sBAAsB;IAoCzB;;;;;;;;;;MAUE;IACF,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IA8BhE,OAAO;CAOR"}
@@ -1,63 +0,0 @@
1
- declare module '@ember-data/store/-private/caches/instance-cache' {
2
- import type { Cache } from '@warp-drive/core-types/cache';
3
- import type { StableDocumentIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
4
- import type { Value } from '@warp-drive/core-types/json/raw';
5
- import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
6
- import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
7
- import { ReactiveDocument } from '@ember-data/store/-private/document';
8
- import RecordReference from '@ember-data/store/-private/legacy-model-support/record-reference';
9
- import { CacheCapabilitiesManager } from '@ember-data/store/-private/managers/cache-capabilities-manager';
10
- import type { CacheManager } from '@ember-data/store/-private/managers/cache-manager';
11
- import type { CreateRecordProperties, Store } from '@ember-data/store/-private/store-service';
12
- export function peekRecordIdentifier(record: OpaqueRecordInstance): StableRecordIdentifier | undefined;
13
- /**
14
- Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)
15
- assigned to the given record instance.
16
-
17
- ```js
18
- import { recordIdentifierFor } from "@ember-data/store";
19
- // ... gain access to a record, for instance with peekRecord or findRecord
20
- const record = store.peekRecord("user", "1");
21
- // get the identifier for the record (see docs for StableRecordIdentifier)
22
- const identifier = recordIdentifierFor(record);
23
- // access the identifier's properties.
24
- const { id, type, lid } = identifier;
25
- ```
26
-
27
- @public
28
- @param {Object} record a record instance previously obstained from the store.
29
- @return {StableRecordIdentifier}
30
- */
31
- export function recordIdentifierFor<T extends TypedRecordInstance>(record: T): StableRecordIdentifier<TypeFromInstance<T>>;
32
- export function recordIdentifierFor(record: OpaqueRecordInstance): StableRecordIdentifier;
33
- export function setRecordIdentifier(record: OpaqueRecordInstance, identifier: StableRecordIdentifier): void;
34
- export const StoreMap: Map<unknown, Store>;
35
- export function storeFor(record: OpaqueRecordInstance): Store | undefined;
36
- type Caches = {
37
- record: Map<StableRecordIdentifier, OpaqueRecordInstance>;
38
- reference: WeakMap<StableRecordIdentifier, RecordReference>;
39
- document: Map<StableDocumentIdentifier, ReactiveDocument<OpaqueRecordInstance | OpaqueRecordInstance[] | null | undefined>>;
40
- };
41
- export class InstanceCache {
42
- store: Store;
43
- cache: Cache;
44
- _storeWrapper: CacheCapabilitiesManager;
45
- __cacheManager: CacheManager;
46
- __instances: Caches;
47
- constructor(store: Store);
48
- peek(identifier: StableRecordIdentifier): Cache | OpaqueRecordInstance | undefined;
49
- getDocument<T>(identifier: StableDocumentIdentifier): ReactiveDocument<T>;
50
- getRecord(identifier: StableRecordIdentifier, properties?: CreateRecordProperties): OpaqueRecordInstance;
51
- getReference(identifier: StableRecordIdentifier): RecordReference;
52
- recordIsLoaded(identifier: StableRecordIdentifier, filterDeleted?: boolean): boolean;
53
- disconnect(identifier: StableRecordIdentifier): void;
54
- unloadRecord(identifier: StableRecordIdentifier): void;
55
- clear(type?: string): void;
56
- setRecordId(identifier: StableRecordIdentifier, id: string): void;
57
- }
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
- export {};
62
- }
63
- //# sourceMappingURL=instance-cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instance-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/instance-cache.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAA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
4
- };
5
- export function hasId(resource: unknown): resource is {
6
- id: string;
7
- };
8
- export function hasType(resource: unknown): resource is {
9
- type: string;
10
- };
11
- }
12
- //# sourceMappingURL=resource-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-utils.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/resource-utils.ts"],"names":[],"mappings":"AAUA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAErE;AAED,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAInE;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAEvE"}
@@ -1,9 +0,0 @@
1
- declare module '@ember-data/store/-private/debug/utils' {
2
- export function logGroup(scope: 'cache', prefix: string, type: string, lid: string, bucket: string, key: string): void;
3
- export function logGroup(scope: 'reactive-ui', prefix: string, type: string, lid: string, bucket: string, key: ''): void;
4
- export function logGroup(scope: 'notify', prefix: string, type: string, lid: string, bucket: string, key: string): void;
5
- export function log(scope: 'cache', prefix: string, type: string, lid: string, bucket: string, key: string): void;
6
- export function log(scope: 'reactive-ui', prefix: string, type: string, lid: string, bucket: string, key: ''): void;
7
- export function log(scope: 'notify', prefix: string, type: string, lid: string, bucket: string, key: string): void;
8
- }
9
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/-private/debug/utils.ts"],"names":[],"mappings":"AAiEA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;AACvH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,EAAE,GACN,IAAI,CAAC;AACR,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;AAaxH,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;AAClH,wBAAgB,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;AACpH,wBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC"}
@@ -1,149 +0,0 @@
1
- declare module '@ember-data/store/-private/document' {
2
- import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
3
- import type { ImmutableRequestInfo, RequestInfo } from '@warp-drive/core-types/request';
4
- import type { ResourceDocument } from '@warp-drive/core-types/spec/document';
5
- import type { Meta, PaginationLinks } from '@warp-drive/core-types/spec/json-api-raw';
6
- import type { Store } from '@ember-data/store/-private/store-service';
7
- /**
8
- * A Document is a class that wraps the response content from a request to the API
9
- * returned by `Cache.put` or `Cache.peek`, converting resource-identifiers into
10
- * record instances.
11
- *
12
- * It is not directly instantiated by the user, and its properties should not
13
- * be directly modified. Whether individual properties are mutable or not is
14
- * determined by the record instance itself.
15
- *
16
- * @public
17
- * @class ReactiveDocument
18
- */
19
- export class ReactiveDocument<T> {
20
- #private;
21
- /**
22
- * The links object for this document, if any
23
- *
24
- * e.g.
25
- *
26
- * ```
27
- * {
28
- * self: '/articles?page[number]=3',
29
- * }
30
- * ```
31
- *
32
- * @property links
33
- * @type {Object|undefined} - a links object
34
- * @public
35
- */
36
- readonly links?: PaginationLinks;
37
- /**
38
- * The primary data for this document, if any.
39
- *
40
- * If this document has no primary data (e.g. because it is an error document)
41
- * this property will be `undefined`.
42
- *
43
- * For collections this will be an array of record instances,
44
- * for single resource requests it will be a single record instance or null.
45
- *
46
- * @property data
47
- * @public
48
- * @type {Object|Array<object>|null|undefined} - a data object
49
- */
50
- readonly data?: T;
51
- /**
52
- * The errors returned by the API for this request, if any
53
- *
54
- * @property errors
55
- * @public
56
- * @type {Object|undefined} - an errors object
57
- */
58
- readonly errors?: object[];
59
- /**
60
- * The meta object for this document, if any
61
- *
62
- * @property meta
63
- * @public
64
- * @type {Object|undefined} - a meta object
65
- */
66
- readonly meta?: Meta;
67
- /**
68
- * The identifier associated with this document, if any
69
- *
70
- * @property identifier
71
- * @public
72
- * @type {StableDocumentIdentifier|null}
73
- */
74
- readonly identifier: StableDocumentIdentifier | null;
75
- protected readonly _store: Store;
76
- protected readonly _localCache: {
77
- document: ResourceDocument;
78
- request: ImmutableRequestInfo;
79
- } | null;
80
- constructor(store: Store, identifier: StableDocumentIdentifier | null, localCache: {
81
- document: ResourceDocument;
82
- request: ImmutableRequestInfo;
83
- } | null);
84
- /**
85
- * Fetches the related link for this document, returning a promise that resolves
86
- * with the document when the request completes. If no related link is present,
87
- * will fallback to the self link if present
88
- *
89
- * @public
90
- * @param {Object} options
91
- * @return {Promise<Document>}
92
- */
93
- fetch(options?: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T>>;
94
- /**
95
- * Fetches the next link for this document, returning a promise that resolves
96
- * with the new document when the request completes, or null if there is no
97
- * next link.
98
- *
99
- * @public
100
- * @param {Object} options
101
- * @return {Promise<Document | null>}
102
- */
103
- next(options?: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T> | null>;
104
- /**
105
- * Fetches the prev link for this document, returning a promise that resolves
106
- * with the new document when the request completes, or null if there is no
107
- * prev link.
108
- *
109
- * @public
110
- * @param {Object} options
111
- * @return {Promise<Document | null>}
112
- */
113
- prev(options: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T> | null>;
114
- /**
115
- * Fetches the first link for this document, returning a promise that resolves
116
- * with the new document when the request completes, or null if there is no
117
- * first link.
118
- *
119
- * @public
120
- * @param {Object} options
121
- * @return {Promise<Document | null>}
122
- */
123
- first(options: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T> | null>;
124
- /**
125
- * Fetches the last link for this document, returning a promise that resolves
126
- * with the new document when the request completes, or null if there is no
127
- * last link.
128
- *
129
- * @public
130
- * @param {Object} options
131
- * @return {Promise<Document | null>}
132
- */
133
- last(options: RequestInfo<ReactiveDocument<T>, T>): Promise<ReactiveDocument<T> | null>;
134
- /**
135
- * Implemented for `JSON.stringify` support.
136
- *
137
- * Returns the JSON representation of the document wrapper.
138
- *
139
- * This is a shallow serialization, it does not deeply serialize
140
- * the document's contents, leaving that to the individual record
141
- * instances to determine how to do, if at all.
142
- *
143
- * @public
144
- * @return
145
- */
146
- toJSON(): object;
147
- }
148
- }
149
- //# sourceMappingURL=document.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/-private/document.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,gC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CAAC,GAAG,IAAI,CAAC;IAIxF;;;;;;;;OAQG;IACH,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAIvF;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAIxF;;;;;;;;OAQG;IACH,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAIvF;;;;;;;;;;;OAWG;IACH,MAAM,IAAI,MAAM;CAiBjB"}
@@ -1,166 +0,0 @@
1
- declare module '@ember-data/store/-private/legacy-model-support/record-reference' {
2
- import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
- import type { SingleResourceDocument } from '@warp-drive/core-types/spec/json-api-raw';
4
- import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
5
- import type { Store } from '@ember-data/store/-private/store-service';
6
- /**
7
- A `RecordReference` is a low-level API that allows users and
8
- addon authors to perform meta-operations on a record.
9
-
10
- @class RecordReference
11
- @public
12
- */
13
- export default class RecordReference {
14
- store: Store;
15
- ___token: object;
16
- ___identifier: StableRecordIdentifier;
17
- _ref: number;
18
- constructor(store: Store, identifier: StableRecordIdentifier);
19
- destroy(): void;
20
- get type(): string;
21
- /**
22
- The `id` of the record that this reference refers to.
23
-
24
- Together, the `type` and `id` properties form a composite key for
25
- the identity map.
26
-
27
- Example
28
-
29
- ```javascript
30
- let userRef = store.getReference('user', 1);
31
-
32
- userRef.id(); // '1'
33
- ```
34
-
35
- @public
36
- @return {String} The id of the record.
37
- */
38
- id(): string | null;
39
- /**
40
- The `identifier` of the record that this reference refers to.
41
-
42
- Together, the `type` and `id` properties form a composite key for
43
- the identity map.
44
-
45
- Example
46
-
47
- ```javascript
48
- let userRef = store.getReference('user', 1);
49
-
50
- userRef.identifier(); // '1'
51
- ```
52
-
53
- @public
54
- @return {String} The identifier of the record.
55
- */
56
- identifier(): StableRecordIdentifier;
57
- /**
58
- How the reference will be looked up when it is loaded. Currently
59
- this always returns `identity` to signify that a record will be
60
- loaded by its `type` and `id`.
61
-
62
- Example
63
-
64
- ```javascript
65
- const userRef = store.getReference('user', 1);
66
-
67
- userRef.remoteType(); // 'identity'
68
- ```
69
-
70
- @public
71
- @return {String} 'identity'
72
- */
73
- remoteType(): 'identity';
74
- /**
75
- This API allows you to provide a reference with new data. The
76
- simplest usage of this API is similar to `store.push`: you provide a
77
- normalized hash of data and the object represented by the reference
78
- will update.
79
-
80
- If you pass a promise to `push`, Ember Data will not ask the adapter
81
- for the data if another attempt to fetch it is made in the
82
- interim. When the promise resolves, the underlying object is updated
83
- with the new data, and the promise returned by *this function* is resolved
84
- with that object.
85
-
86
- For example, `recordReference.push(promise)` will be resolved with a
87
- record.
88
-
89
- Example
90
-
91
- ```javascript
92
- let userRef = store.getReference('user', 1);
93
-
94
- // provide data for reference
95
- userRef.push({
96
- data: {
97
- id: "1",
98
- type: "user",
99
- attributes: {
100
- username: "@user"
101
- }
102
- }
103
- }).then(function(user) {
104
- userRef.value() === user;
105
- });
106
- ```
107
-
108
- @public
109
- @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one
110
- @return a promise for the value (record or relationship)
111
- */
112
- push(objectOrPromise: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<OpaqueRecordInstance>;
113
- /**
114
- If the entity referred to by the reference is already loaded, it is
115
- present as `reference.value`. Otherwise the value returned by this function
116
- is `null`.
117
-
118
- Example
119
-
120
- ```javascript
121
- let userRef = store.getReference('user', 1);
122
-
123
- userRef.value(); // user
124
- ```
125
-
126
- @public
127
- @return {Model} the record for this RecordReference
128
- */
129
- value(): OpaqueRecordInstance | null;
130
- /**
131
- Triggers a fetch for the backing entity based on its `remoteType`
132
- (see `remoteType` definitions per reference type).
133
-
134
- Example
135
-
136
- ```javascript
137
- let userRef = store.getReference('user', 1);
138
-
139
- // load user (via store.find)
140
- userRef.load().then(...)
141
- ```
142
-
143
- @public
144
- @return {Promise<record>} the record for this RecordReference
145
- */
146
- load(): Promise<unknown>;
147
- /**
148
- Reloads the record if it is already loaded. If the record is not
149
- loaded it will load the record via `store.findRecord`
150
-
151
- Example
152
-
153
- ```javascript
154
- let userRef = store.getReference('user', 1);
155
-
156
- // or trigger a reload
157
- userRef.reload().then(...)
158
- ```
159
-
160
- @public
161
- @return {Promise<record>} the record for this RecordReference
162
- */
163
- reload(): Promise<unknown>;
164
- }
165
- }
166
- //# sourceMappingURL=record-reference.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record-reference.d.ts","sourceRoot":"","sources":["../../../src/-private/legacy-model-support/record-reference.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAEvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;EAME;AACF,MAAM,CAAC,OAAO,OAAO,eAAe;IAC1B,KAAK,EAAE,KAAK,CAAC;IAErB,QAAQ,EAAG,MAAM,CAAC;IAClB,aAAa,EAAE,sBAAsB,CAAC;IAE9B,IAAI,EAAE,MAAM,CAAC;gBAET,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,sBAAsB;IAa5D,OAAO;IAIP,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;;;;;;;;;;;;MAgBE;IACF,EAAE;IAMF;;;;;;;;;;;;;;;;MAgBE;IACF,UAAU,IAAI,sBAAsB;IAIpC;;;;;;;;;;;;;;;MAeE;IACF,UAAU,IAAI,UAAU;IAIxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqCE;IACF,IAAI,CAAC,eAAe,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAO9G;;;;;;;;;;;;;;;MAeE;IACF,KAAK,IAAI,oBAAoB,GAAG,IAAI;IAIpC;;;;;;;;;;;;;;;MAeE;IACF,IAAI;IAQJ;;;;;;;;;;;;;;;MAeE;IACF,MAAM;CAOP"}
@@ -1,19 +0,0 @@
1
- declare module '@ember-data/store/-private/legacy-model-support/shim-model-class' {
2
- import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
3
- import type { LegacyAttributeField, LegacyRelationshipField } from '@warp-drive/core-types/schema/fields';
4
- import type { KeyOrString, ModelSchema } from '@ember-data/store/-types/q/ds-model';
5
- import type { Store } from '@ember-data/store/-private/store-service';
6
- export function getShimClass<T>(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string): ShimModelClass<T>;
7
- export default class ShimModelClass<T = unknown> implements ModelSchema<T> {
8
- __store: Store;
9
- modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
10
- constructor(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string);
11
- get fields(): Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'>;
12
- get attributes(): Map<KeyOrString<T>, LegacyAttributeField>;
13
- get relationshipsByName(): Map<KeyOrString<T>, LegacyRelationshipField>;
14
- eachAttribute<K extends KeyOrString<T>>(callback: (key: K, attribute: LegacyAttributeField) => void, binding?: T): void;
15
- eachRelationship<K extends KeyOrString<T>>(callback: (key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
16
- eachTransformedAttribute<K extends KeyOrString<T>>(callback: (key: K, type: string | null) => void, binding?: T): void;
17
- }
18
- }
19
- //# sourceMappingURL=shim-model-class.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shim-model-class.d.ts","sourceRoot":"","sources":["../../../src/-private/legacy-model-support/shim-model-class.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE1G,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAM9C,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM,GACtE,cAAc,CAAC,CAAC,CAAC,CAcnB;AAGD,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,CAAC,GAAG,OAAO,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC;IAChE,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;gBACpE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM;IAKjG,IAAI,MAAM,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC,CAWvE;IAED,IAAI,UAAU,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAW1D;IAED,IAAI,mBAAmB,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAWtE;IAED,aAAa,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,oBAAoB,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;IAQhH,gBAAgB,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EACvC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,uBAAuB,KAAK,IAAI,EACjE,OAAO,CAAC,EAAE,CAAC;IASb,wBAAwB,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;CAQhH"}
@@ -1,28 +0,0 @@
1
- declare module '@ember-data/store/-private/managers/cache-capabilities-manager' {
2
- import type { StableDocumentIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
- import type { CacheCapabilitiesManager as StoreWrapper } from '@ember-data/store/-types/q/cache-capabilities-manager';
4
- import type { SchemaService } from '@ember-data/store/-types/q/schema-service';
5
- import type { IdentifierCache } from '@ember-data/store/-private/caches/identifier-cache';
6
- import type { Store } from '@ember-data/store/-private/store-service';
7
- import type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';
8
- export interface CacheCapabilitiesManager {
9
- getSchemaDefinitionService(): SchemaService;
10
- }
11
- export class CacheCapabilitiesManager implements StoreWrapper {
12
- _willNotify: boolean;
13
- _pendingNotifies: Map<StableRecordIdentifier, Set<string>>;
14
- _store: Store;
15
- constructor(_store: Store);
16
- get identifierCache(): IdentifierCache;
17
- _scheduleNotification(identifier: StableRecordIdentifier, key: string): void;
18
- _flushNotifications(): void;
19
- notifyChange(identifier: StableRecordIdentifier, namespace: 'added' | 'removed', key: null): void;
20
- notifyChange(identifier: StableDocumentIdentifier, namespace: 'added' | 'updated' | 'removed', key: null): void;
21
- notifyChange(identifier: StableRecordIdentifier, namespace: NotificationType, key: string | null): void;
22
- get schema(): SchemaService;
23
- setRecordId(identifier: StableRecordIdentifier, id: string): void;
24
- hasRecord(identifier: StableRecordIdentifier): boolean;
25
- disconnectRecord(identifier: StableRecordIdentifier): void;
26
- }
27
- }
28
- //# sourceMappingURL=cache-capabilities-manager.d.ts.map