@ember-data-types/store 4.13.0-alpha.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 (81) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +201 -0
  3. package/ember-data-logo-dark.svg +12 -0
  4. package/ember-data-logo-light.svg +12 -0
  5. package/package.json +20 -0
  6. package/unstable-preview-types/-private/cache-handler/handler.d.ts +64 -0
  7. package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +1 -0
  8. package/unstable-preview-types/-private/cache-handler/types.d.ts +107 -0
  9. package/unstable-preview-types/-private/cache-handler/types.d.ts.map +1 -0
  10. package/unstable-preview-types/-private/cache-handler/utils.d.ts +39 -0
  11. package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +1 -0
  12. package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -0
  13. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -0
  14. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +176 -0
  15. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
  16. package/unstable-preview-types/-private/caches/instance-cache.d.ts +61 -0
  17. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -0
  18. package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -0
  19. package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +1 -0
  20. package/unstable-preview-types/-private/document.d.ts +146 -0
  21. package/unstable-preview-types/-private/document.d.ts.map +1 -0
  22. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +179 -0
  23. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -0
  24. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -0
  25. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -0
  26. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +31 -0
  27. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -0
  28. package/unstable-preview-types/-private/managers/cache-manager.d.ts +441 -0
  29. package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -0
  30. package/unstable-preview-types/-private/managers/notification-manager.d.ts +101 -0
  31. package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -0
  32. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +97 -0
  33. package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -0
  34. package/unstable-preview-types/-private/network/request-cache.d.ts +109 -0
  35. package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -0
  36. package/unstable-preview-types/-private/proxies/promise-proxies.d.ts +73 -0
  37. package/unstable-preview-types/-private/proxies/promise-proxies.d.ts.map +1 -0
  38. package/unstable-preview-types/-private/proxies/promise-proxy-base.d.ts +9 -0
  39. package/unstable-preview-types/-private/proxies/promise-proxy-base.d.ts.map +1 -0
  40. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +147 -0
  41. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -0
  42. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +118 -0
  43. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +1 -0
  44. package/unstable-preview-types/-private/store-service.d.ts +1574 -0
  45. package/unstable-preview-types/-private/store-service.d.ts.map +1 -0
  46. package/unstable-preview-types/-private/store-service.type-test.d.ts +4 -0
  47. package/unstable-preview-types/-private/store-service.type-test.d.ts.map +1 -0
  48. package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -0
  49. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -0
  50. package/unstable-preview-types/-private/utils/construct-resource.d.ts +9 -0
  51. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -0
  52. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -0
  53. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -0
  54. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -0
  55. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -0
  56. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -0
  57. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +1 -0
  58. package/unstable-preview-types/-private.d.ts +35 -0
  59. package/unstable-preview-types/-private.d.ts.map +1 -0
  60. package/unstable-preview-types/-types/overview.d.ts +21 -0
  61. package/unstable-preview-types/-types/overview.d.ts.map +1 -0
  62. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +109 -0
  63. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +1 -0
  64. package/unstable-preview-types/-types/q/ds-model.d.ts +25 -0
  65. package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -0
  66. package/unstable-preview-types/-types/q/identifier.d.ts +193 -0
  67. package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -0
  68. package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -0
  69. package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +1 -0
  70. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -0
  71. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -0
  72. package/unstable-preview-types/-types/q/record-instance.d.ts +29 -0
  73. package/unstable-preview-types/-types/q/record-instance.d.ts.map +1 -0
  74. package/unstable-preview-types/-types/q/schema-service.d.ts +358 -0
  75. package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -0
  76. package/unstable-preview-types/-types/q/store.d.ts +38 -0
  77. package/unstable-preview-types/-types/q/store.d.ts.map +1 -0
  78. package/unstable-preview-types/index.d.ts +226 -0
  79. package/unstable-preview-types/index.d.ts.map +1 -0
  80. package/unstable-preview-types/types.d.ts +7 -0
  81. package/unstable-preview-types/types.d.ts.map +1 -0
@@ -0,0 +1,176 @@
1
+ declare module '@ember-data/store/-private/caches/identifier-cache' {
2
+ import { type Identifier, type RecordIdentifier, type StableDocumentIdentifier, type StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
+ import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
4
+ import type { 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
+ export function isStableIdentifier(identifier: unknown): identifier is StableRecordIdentifier;
7
+ export function isDocumentIdentifier(identifier: unknown): identifier is StableDocumentIdentifier;
8
+ interface KeyOptions {
9
+ lid: IdentifierMap;
10
+ id: IdentifierMap;
11
+ }
12
+ type TypeMap = {
13
+ [key: string]: KeyOptions;
14
+ };
15
+ type IdentifierMap = Map<string, StableRecordIdentifier>;
16
+ type StableCache = {
17
+ resources: IdentifierMap;
18
+ documents: Map<string, StableDocumentIdentifier>;
19
+ resourcesByType: TypeMap;
20
+ polymorphicLidBackMap: Map<string, string[]>;
21
+ };
22
+ export type MergeMethod = (targetIdentifier: StableRecordIdentifier, matchedIdentifier: StableRecordIdentifier, resourceData: unknown) => StableRecordIdentifier;
23
+ export function setIdentifierGenerationMethod(method: GenerationMethod | null): void;
24
+ export function setIdentifierUpdateMethod(method: UpdateMethod | null): void;
25
+ export function setIdentifierForgetMethod(method: ForgetMethod | null): void;
26
+ export function setIdentifierResetMethod(method: ResetMethod | null): void;
27
+ export function setKeyInfoForResource(method: KeyInfoMethod | null): void;
28
+ /**
29
+ * Each instance of {Store} receives a unique instance of a IdentifierCache.
30
+ *
31
+ * This cache is responsible for assigning or retrieving the unique identify
32
+ * for arbitrary resource data encountered by the store. Data representing
33
+ * a unique resource or record should always be represented by the same
34
+ * identifier.
35
+ *
36
+ * It can be configured by consuming applications.
37
+ *
38
+ * @class IdentifierCache
39
+ @public
40
+ */
41
+ export class IdentifierCache {
42
+ _cache: StableCache;
43
+ _generate: GenerationMethod;
44
+ _update: UpdateMethod;
45
+ _forget: ForgetMethod;
46
+ _reset: ResetMethod;
47
+ _merge: MergeMethod;
48
+ _keyInfoForResource: KeyInfoMethod;
49
+ _id: number;
50
+ constructor();
51
+ /**
52
+ * Internal hook to allow management of merge conflicts with identifiers.
53
+ *
54
+ * we allow late binding of this private internal merge so that
55
+ * the cache can insert itself here to handle elimination of duplicates
56
+ *
57
+ * @method __configureMerge
58
+ * @private
59
+ */
60
+ __configureMerge(method: MergeMethod | null): void;
61
+ upgradeIdentifier(resource: {
62
+ type: string;
63
+ id: string | null;
64
+ lid?: string;
65
+ }): StableRecordIdentifier;
66
+ /**
67
+ * @method _getRecordIdentifier
68
+ * @private
69
+ */
70
+ _getRecordIdentifier(resource: {
71
+ type: string;
72
+ id: string | null;
73
+ lid?: string;
74
+ }, shouldGenerate: 2): StableRecordIdentifier;
75
+ _getRecordIdentifier(resource: unknown, shouldGenerate: 1): StableRecordIdentifier;
76
+ _getRecordIdentifier(resource: unknown, shouldGenerate: 0): StableRecordIdentifier | undefined;
77
+ /**
78
+ * allows us to peek without generating when needed
79
+ * useful for the "create" case when we need to see if
80
+ * we are accidentally overwritting something
81
+ *
82
+ * @method peekRecordIdentifier
83
+ * @param resource
84
+ * @return {StableRecordIdentifier | undefined}
85
+ * @private
86
+ */
87
+ peekRecordIdentifier(resource: ResourceIdentifierObject | Identifier): StableRecordIdentifier | undefined;
88
+ /**
89
+ Returns the DocumentIdentifier for the given Request, creates one if it does not yet exist.
90
+ Returns `null` if the request does not have a `cacheKey` or `url`.
91
+
92
+ @method getOrCreateDocumentIdentifier
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
+ @method getOrCreateRecordIdentifier
109
+ @param resource
110
+ @return {StableRecordIdentifier}
111
+ @public
112
+ */
113
+ getOrCreateRecordIdentifier(resource: unknown): StableRecordIdentifier;
114
+ /**
115
+ Returns a new Identifier for the supplied data. Call this method to generate
116
+ an identifier when a new resource is being created local to the client and
117
+ potentially does not have an `id`.
118
+
119
+ Delegates generation to the user supplied `GenerateMethod` if one has been provided
120
+ with the signature `generateMethod({ type }, 'record')`.
121
+
122
+ @method createIdentifierForNewRecord
123
+ @param data
124
+ @return {StableRecordIdentifier}
125
+ @public
126
+ */
127
+ createIdentifierForNewRecord(data: {
128
+ type: string;
129
+ id?: string | null;
130
+ }): StableRecordIdentifier;
131
+ /**
132
+ Provides the opportunity to update secondary lookup tables for existing identifiers
133
+ Called after an identifier created with `createIdentifierForNewRecord` has been
134
+ committed.
135
+
136
+ Assigned `id` to an `Identifier` if `id` has not previously existed; however,
137
+ attempting to change the `id` or calling update without providing an `id` when
138
+ one is missing will throw an error.
139
+
140
+ - sets `id` (if `id` was previously `null`)
141
+ - `lid` and `type` MUST NOT be altered post creation
142
+
143
+ If a merge occurs, it is possible the returned identifier does not match the originally
144
+ provided identifier. In this case the abandoned identifier will go through the usual
145
+ `forgetRecordIdentifier` codepaths.
146
+
147
+ @method updateRecordIdentifier
148
+ @param identifierObject
149
+ @param data
150
+ @return {StableRecordIdentifier}
151
+ @public
152
+ */
153
+ updateRecordIdentifier(identifierObject: RecordIdentifier, data: unknown): StableRecordIdentifier;
154
+ /**
155
+ * @method _mergeRecordIdentifiers
156
+ * @private
157
+ */
158
+ _mergeRecordIdentifiers(keyInfo: KeyInfo, identifier: StableRecordIdentifier, existingIdentifier: StableRecordIdentifier, data: unknown): StableRecordIdentifier;
159
+ /**
160
+ Provides the opportunity to eliminate an identifier from secondary lookup tables
161
+ as well as eliminates it from ember-data's own lookup tables and book keeping.
162
+
163
+ Useful when a record has been deleted and the deletion has been persisted and
164
+ we do not care about the record anymore. Especially useful when an `id` of a
165
+ deleted record might be reused later for a new record.
166
+
167
+ @method forgetRecordIdentifier
168
+ @param identifierObject
169
+ @public
170
+ */
171
+ forgetRecordIdentifier(identifierObject: RecordIdentifier): void;
172
+ destroy(): void;
173
+ }
174
+ export {};
175
+ }
176
+ //# sourceMappingURL=identifier-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifier-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/identifier-cache.ts"],"names":[],"mappings":"AAWA,OAAO,EAKL,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAE7B,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAA0B,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEjH,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACb,MAAM,2BAA2B,CAAC;AAWnC,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,sBAAsB,CAE5F;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,wBAAwB,CAEhG;AAwBD,UAAU,UAAU;IAClB,GAAG,EAAE,aAAa,CAAC;IACnB,EAAE,EAAE,aAAa,CAAC;CACnB;AACD,KAAK,OAAO,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC;AAI7C,KAAK,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAEzD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACjD,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAA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KAAE,EAC3D,cAAc,EAAE,CAAC,GAChB,sBAAsB;IACzB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,GAAG,sBAAsB;IAClF,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,GAAG,sBAAsB,GAAG,SAAS;IAsE9F;;;;;;;;;OASG;IACH,oBAAoB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,UAAU,GAAG,sBAAsB,GAAG,SAAS;IAIzG;;;;;;;;MAQE;IACF,6BAA6B,CAAC,OAAO,EAAE,oBAAoB,GAAG,wBAAwB,GAAG,IAAI;IAyB7F;;;;;;;;;;;;;;MAcE;IACF,2BAA2B,CAAC,QAAQ,EAAE,OAAO,GAAG,sBAAsB;IAItE;;;;;;;;;;;;MAYE;IACF,4BAA4B,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,sBAAsB;IAyBhG;;;;;;;;;;;;;;;;;;;;;MAqBE;IACF,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,GAAG,sBAAsB;IAoEjG;;;OAGG;IACH,uBAAuB,CACrB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,sBAAsB,EAClC,kBAAkB,EAAE,sBAAsB,EAC1C,IAAI,EAAE,OAAO,GACZ,sBAAsB;IAoCzB;;;;;;;;;;;MAWE;IACF,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IA+BhE,OAAO;CAOR"}
@@ -0,0 +1,61 @@
1
+ declare module '@ember-data/store/-private/caches/instance-cache' {
2
+ import type { Cache } from '@warp-drive/core-types/cache';
3
+ import type { 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 RecordReference from '@ember-data/store/-private/legacy-model-support/record-reference';
8
+ import { CacheCapabilitiesManager } from '@ember-data/store/-private/managers/cache-capabilities-manager';
9
+ import type { CacheManager } from '@ember-data/store/-private/managers/cache-manager';
10
+ import type { CreateRecordProperties, Store } from '@ember-data/store/-private/store-service';
11
+ export function peekRecordIdentifier(record: OpaqueRecordInstance): StableRecordIdentifier | undefined;
12
+ /**
13
+ Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)
14
+ assigned to the given record instance.
15
+ ```js
16
+ import { recordIdentifierFor } from "@ember-data/store";
17
+ // ... gain access to a record, for instance with peekRecord or findRecord
18
+ const record = store.peekRecord("user", "1");
19
+ // get the identifier for the record (see docs for StableRecordIdentifier)
20
+ const identifier = recordIdentifierFor(record);
21
+ // access the identifier's properties.
22
+ const { id, type, lid } = identifier;
23
+ ```
24
+ @method recordIdentifierFor
25
+ @public
26
+ @static
27
+ @for @ember-data/store
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
+ };
40
+ export class InstanceCache {
41
+ store: Store;
42
+ cache: Cache;
43
+ _storeWrapper: CacheCapabilitiesManager;
44
+ __cacheManager: CacheManager;
45
+ __instances: Caches;
46
+ constructor(store: Store);
47
+ peek(identifier: StableRecordIdentifier): Cache | OpaqueRecordInstance | undefined;
48
+ getRecord(identifier: StableRecordIdentifier, properties?: CreateRecordProperties): OpaqueRecordInstance;
49
+ getReference(identifier: StableRecordIdentifier): RecordReference;
50
+ recordIsLoaded(identifier: StableRecordIdentifier, filterDeleted?: boolean): boolean;
51
+ disconnect(identifier: StableRecordIdentifier): void;
52
+ unloadRecord(identifier: StableRecordIdentifier): void;
53
+ clear(type?: string): void;
54
+ setRecordId(identifier: StableRecordIdentifier, id: string): void;
55
+ }
56
+ export function resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: StableRecordIdentifier): boolean;
57
+ export function preloadData(store: Store, identifier: StableRecordIdentifier, preload: Record<string, Value>): void;
58
+ export function _clearCaches(): void;
59
+ export {};
60
+ }
61
+ //# sourceMappingURL=instance-cache.d.ts.map
@@ -0,0 +1 @@
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,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAA4B,MAAM,+BAA+B,CAAC;AAQrH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,eAAe,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAoBtE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,sBAAsB,GAAG,SAAS,CAErG;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,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A+C3D;AAMD,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,sBAAsB,GAAG,OAAO,CAGhH;AAcD,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,QAwB3G;AAiCD,wBAAgB,YAAY,SAI3B"}
@@ -0,0 +1,12 @@
1
+ declare module '@ember-data/store/-private/caches/resource-utils' {
2
+ export function hasLid(resource: unknown): resource is {
3
+ lid: string;
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,146 @@
1
+ declare module '@ember-data/store/-private/document' {
2
+ import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
3
+ import type { RequestInfo } from '@warp-drive/core-types/request';
4
+ import type { Meta, PaginationLinks } from '@warp-drive/core-types/spec/json-api-raw';
5
+ import type { Store } from '@ember-data/store/-private/store-service';
6
+ /**
7
+ * A Document is a class that wraps the response content from a request to the API
8
+ * returned by `Cache.put` or `Cache.peek`, converting resource-identifiers into
9
+ * record instances.
10
+ *
11
+ * It is not directly instantiated by the user, and its properties should not
12
+ * be directly modified. Whether individual properties are mutable or not is
13
+ * determined by the record instance itself.
14
+ *
15
+ * @public
16
+ * @class Document
17
+ */
18
+ export class Document<T> {
19
+ #private;
20
+ /**
21
+ * The links object for this document, if any
22
+ *
23
+ * e.g.
24
+ *
25
+ * ```
26
+ * {
27
+ * self: '/articles?page[number]=3',
28
+ * }
29
+ * ```
30
+ *
31
+ * @property links
32
+ * @type {object|undefined} - a links object
33
+ * @public
34
+ */
35
+ links?: PaginationLinks;
36
+ /**
37
+ * The primary data for this document, if any.
38
+ *
39
+ * If this document has no primary data (e.g. because it is an error document)
40
+ * this property will be `undefined`.
41
+ *
42
+ * For collections this will be an array of record instances,
43
+ * for single resource requests it will be a single record instance or null.
44
+ *
45
+ * @property data
46
+ * @public
47
+ * @type {object|Array<object>|null|undefined} - a data object
48
+ */
49
+ data?: T;
50
+ /**
51
+ * The errors returned by the API for this request, if any
52
+ *
53
+ * @property errors
54
+ * @public
55
+ * @type {object|undefined} - an errors object
56
+ */
57
+ errors?: object[];
58
+ /**
59
+ * The meta object for this document, if any
60
+ *
61
+ * @property meta
62
+ * @public
63
+ * @type {object|undefined} - a meta object
64
+ */
65
+ meta?: Meta;
66
+ /**
67
+ * The identifier associated with this document, if any
68
+ *
69
+ * @property identifier
70
+ * @public
71
+ * @type {StableDocumentIdentifier|null}
72
+ */
73
+ identifier: StableDocumentIdentifier | null;
74
+ constructor(store: Store, identifier: StableDocumentIdentifier | null);
75
+ /**
76
+ * Fetches the related link for this document, returning a promise that resolves
77
+ * with the document when the request completes. If no related link is present,
78
+ * will fallback to the self link if present
79
+ *
80
+ * @method fetch
81
+ * @public
82
+ * @param {object} options
83
+ * @return Promise<Document>
84
+ */
85
+ fetch(options?: Partial<RequestInfo<T, Document<T>>>): Promise<Document<T>>;
86
+ /**
87
+ * Fetches the next link for this document, returning a promise that resolves
88
+ * with the new document when the request completes, or null if there is no
89
+ * next link.
90
+ *
91
+ * @method next
92
+ * @public
93
+ * @param {object} options
94
+ * @return Promise<Document | null>
95
+ */
96
+ next(options?: Partial<RequestInfo<T, Document<T>>>): Promise<Document<T> | null>;
97
+ /**
98
+ * Fetches the prev link for this document, returning a promise that resolves
99
+ * with the new document when the request completes, or null if there is no
100
+ * prev link.
101
+ *
102
+ * @method prev
103
+ * @public
104
+ * @param {object} options
105
+ * @return Promise<Document | null>
106
+ */
107
+ prev(options?: Partial<RequestInfo<T, Document<T>>>): Promise<Document<T> | null>;
108
+ /**
109
+ * Fetches the first link for this document, returning a promise that resolves
110
+ * with the new document when the request completes, or null if there is no
111
+ * first link.
112
+ *
113
+ * @method first
114
+ * @public
115
+ * @param {object} options
116
+ * @return Promise<Document | null>
117
+ */
118
+ first(options?: Partial<RequestInfo<T, Document<T>>>): Promise<Document<T> | null>;
119
+ /**
120
+ * Fetches the last link for this document, returning a promise that resolves
121
+ * with the new document when the request completes, or null if there is no
122
+ * last link.
123
+ *
124
+ * @method last
125
+ * @public
126
+ * @param {object} options
127
+ * @return Promise<Document | null>
128
+ */
129
+ last(options?: Partial<RequestInfo<T, Document<T>>>): Promise<Document<T> | null>;
130
+ /**
131
+ * Implemented for `JSON.stringify` support.
132
+ *
133
+ * Returns the JSON representation of the document wrapper.
134
+ *
135
+ * This is a shallow serialization, it does not deeply serialize
136
+ * the document's contents, leaving that to the individual record
137
+ * instances to determine how to do, if at all.
138
+ *
139
+ * @method toJSON
140
+ * @public
141
+ * @return
142
+ */
143
+ toJSON(): object;
144
+ }
145
+ }
146
+ //# sourceMappingURL=document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/-private/document.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAQ,IAAI,EAAE,eAAe,EAAE,MAAM,0C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;;;;;OASG;IACH,IAAI,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAIrF;;;;;;;;;;;;OAYG;IACH,MAAM,IAAI,MAAM;CAiBjB"}
@@ -0,0 +1,179 @@
1
+ declare module '@ember-data/store/-private/legacy-model-support/record-reference' {
2
+ import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
+ /**
4
+ @module @ember-data/store
5
+ */
6
+ import type { SingleResourceDocument } from '@warp-drive/core-types/spec/json-api-raw';
7
+ import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
8
+ import type { Store } from '@ember-data/store/-private/store-service';
9
+ /**
10
+ @module @ember-data/store
11
+ */
12
+ /**
13
+ A `RecordReference` is a low-level API that allows users and
14
+ addon authors to perform meta-operations on a record.
15
+
16
+ @class RecordReference
17
+ @public
18
+ */
19
+ export default class RecordReference {
20
+ store: Store;
21
+ ___token: object;
22
+ ___identifier: StableRecordIdentifier;
23
+ _ref: number;
24
+ constructor(store: Store, identifier: StableRecordIdentifier);
25
+ destroy(): void;
26
+ get type(): string;
27
+ /**
28
+ The `id` of the record that this reference refers to.
29
+
30
+ Together, the `type` and `id` properties form a composite key for
31
+ the identity map.
32
+
33
+ Example
34
+
35
+ ```javascript
36
+ let userRef = store.getReference('user', 1);
37
+
38
+ userRef.id(); // '1'
39
+ ```
40
+
41
+ @method id
42
+ @public
43
+ @return {String} The id of the record.
44
+ */
45
+ id(): string | null;
46
+ /**
47
+ The `identifier` of the record that this reference refers to.
48
+
49
+ Together, the `type` and `id` properties form a composite key for
50
+ the identity map.
51
+
52
+ Example
53
+
54
+ ```javascript
55
+ let userRef = store.getReference('user', 1);
56
+
57
+ userRef.identifier(); // '1'
58
+ ```
59
+
60
+ @method identifier
61
+ @public
62
+ @return {String} The identifier of the record.
63
+ */
64
+ identifier(): StableRecordIdentifier;
65
+ /**
66
+ How the reference will be looked up when it is loaded. Currently
67
+ this always returns `identity` to signify that a record will be
68
+ loaded by its `type` and `id`.
69
+
70
+ Example
71
+
72
+ ```javascript
73
+ const userRef = store.getReference('user', 1);
74
+
75
+ userRef.remoteType(); // 'identity'
76
+ ```
77
+
78
+ @method remoteType
79
+ @public
80
+ @return {String} 'identity'
81
+ */
82
+ remoteType(): 'identity';
83
+ /**
84
+ This API allows you to provide a reference with new data. The
85
+ simplest usage of this API is similar to `store.push`: you provide a
86
+ normalized hash of data and the object represented by the reference
87
+ will update.
88
+
89
+ If you pass a promise to `push`, Ember Data will not ask the adapter
90
+ for the data if another attempt to fetch it is made in the
91
+ interim. When the promise resolves, the underlying object is updated
92
+ with the new data, and the promise returned by *this function* is resolved
93
+ with that object.
94
+
95
+ For example, `recordReference.push(promise)` will be resolved with a
96
+ record.
97
+
98
+ Example
99
+
100
+ ```javascript
101
+ let userRef = store.getReference('user', 1);
102
+
103
+ // provide data for reference
104
+ userRef.push({
105
+ data: {
106
+ id: "1",
107
+ type: "user",
108
+ attributes: {
109
+ username: "@user"
110
+ }
111
+ }
112
+ }).then(function(user) {
113
+ userRef.value() === user;
114
+ });
115
+ ```
116
+
117
+ @method push
118
+ @public
119
+ @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one
120
+ @return a promise for the value (record or relationship)
121
+ */
122
+ push(objectOrPromise: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<OpaqueRecordInstance>;
123
+ /**
124
+ If the entity referred to by the reference is already loaded, it is
125
+ present as `reference.value`. Otherwise the value returned by this function
126
+ is `null`.
127
+
128
+ Example
129
+
130
+ ```javascript
131
+ let userRef = store.getReference('user', 1);
132
+
133
+ userRef.value(); // user
134
+ ```
135
+
136
+ @method value
137
+ @public
138
+ @return {Model} the record for this RecordReference
139
+ */
140
+ value(): OpaqueRecordInstance | null;
141
+ /**
142
+ Triggers a fetch for the backing entity based on its `remoteType`
143
+ (see `remoteType` definitions per reference type).
144
+
145
+ Example
146
+
147
+ ```javascript
148
+ let userRef = store.getReference('user', 1);
149
+
150
+ // load user (via store.find)
151
+ userRef.load().then(...)
152
+ ```
153
+
154
+ @method load
155
+ @public
156
+ @return {Promise<record>} the record for this RecordReference
157
+ */
158
+ load(): Promise<unknown>;
159
+ /**
160
+ Reloads the record if it is already loaded. If the record is not
161
+ loaded it will load the record via `store.findRecord`
162
+
163
+ Example
164
+
165
+ ```javascript
166
+ let userRef = store.getReference('user', 1);
167
+
168
+ // or trigger a reload
169
+ userRef.reload().then(...)
170
+ ```
171
+
172
+ @method reload
173
+ @public
174
+ @return {Promise<record>} the record for this RecordReference
175
+ */
176
+ reload(): Promise<unknown>;
177
+ }
178
+ }
179
+ //# sourceMappingURL=record-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-reference.d.ts","sourceRoot":"","sources":["../../../src/-private/legacy-model-support/record-reference.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF;;EAEE;AACF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAEvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;EAEE;AAEF;;;;;;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;;;;;;;;;;;;;;;;;MAiBE;IACF,EAAE;IAMF;;;;;;;;;;;;;;;;;MAiBE;IACF,UAAU,IAAI,sBAAsB;IAIpC;;;;;;;;;;;;;;;;MAgBE;IACF,UAAU,IAAI,UAAU;IAIxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAsCE;IACF,IAAI,CAAC,eAAe,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAO9G;;;;;;;;;;;;;;;;MAgBE;IACF,KAAK,IAAI,oBAAoB,GAAG,IAAI;IAIpC;;;;;;;;;;;;;;;;MAgBE;IACF,IAAI;IAQJ;;;;;;;;;;;;;;;;MAgBE;IACF,MAAM;CAOP"}
@@ -0,0 +1,19 @@
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, LegacyRelationshipSchema } 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>, LegacyRelationshipSchema>;
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: LegacyRelationshipSchema) => 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
@@ -0,0 +1 @@
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,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAE3G,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,wBAAwB,CAAC,CAWvE;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,wBAAwB,KAAK,IAAI,EAClE,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"}
@@ -0,0 +1,31 @@
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
+ /**
9
+ @module @ember-data/store
10
+ */
11
+ export interface CacheCapabilitiesManager {
12
+ getSchemaDefinitionService(): SchemaService;
13
+ }
14
+ export class CacheCapabilitiesManager implements StoreWrapper {
15
+ _willNotify: boolean;
16
+ _pendingNotifies: Map<StableRecordIdentifier, Set<string>>;
17
+ _store: Store;
18
+ constructor(_store: Store);
19
+ get identifierCache(): IdentifierCache;
20
+ _scheduleNotification(identifier: StableRecordIdentifier, key: string): void;
21
+ _flushNotifications(): void;
22
+ notifyChange(identifier: StableRecordIdentifier, namespace: 'added' | 'removed'): void;
23
+ notifyChange(identifier: StableDocumentIdentifier, namespace: 'added' | 'updated' | 'removed'): void;
24
+ notifyChange(identifier: StableRecordIdentifier, namespace: NotificationType, key?: string): void;
25
+ get schema(): SchemaService;
26
+ setRecordId(identifier: StableRecordIdentifier, id: string): void;
27
+ hasRecord(identifier: StableRecordIdentifier): boolean;
28
+ disconnectRecord(identifier: StableRecordIdentifier): void;
29
+ }
30
+ }
31
+ //# sourceMappingURL=cache-capabilities-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-capabilities-manager.d.ts","sourceRoot":"","sources":["../../../src/-private/managers/cache-capabilities-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE1G,OAAO,KAAK,EAAE,wBAAwB,IAAI,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;EAEE;AAEF,MAAM,WAAW,wBAAwB;IACvC,0BAA0B,IAAI,aAAa,CAAC;CAC7C;AACD,qBAAa,wBAAyB,YAAW,YAAY;IACnD,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,GAAG,CAAC,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,MAAM,EAAE,KAAK,CAAC;gBAEV,MAAM,EAAE,KAAK;IAMzB,IAAI,eAAe,IAAI,eAAe,CAErC;IAED,qBAAqB,CAAC,UAAU,EAAE,sBAAsB,EAAE,GAAG,EAAE,MAAM;IAyBrE,mBAAmB,IAAI,IAAI;IAgB3B,YAAY,CAAC,UAAU,EAAE,sBAAsB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