@ember-data/store 5.4.0-alpha.3 → 5.4.0-alpha.31

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 (76) hide show
  1. package/README.md +8 -4
  2. package/addon/-private.js +1 -1
  3. package/addon/{store-service-0a03d2a4.js → cache-handler-oB00-31L.js} +1165 -1014
  4. package/addon/cache-handler-oB00-31L.js.map +1 -0
  5. package/addon/index.js +1 -1
  6. package/addon/index.js.map +1 -1
  7. package/package.json +62 -41
  8. package/unstable-preview-types/-private/cache-handler.d.ts +99 -0
  9. package/unstable-preview-types/-private/cache-handler.d.ts.map +1 -0
  10. package/unstable-preview-types/-private/caches/cache-utils.d.ts +9 -0
  11. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -0
  12. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +180 -0
  13. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
  14. package/unstable-preview-types/-private/caches/instance-cache.d.ts +61 -0
  15. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -0
  16. package/unstable-preview-types/-private/caches/resource-utils.d.ts +10 -0
  17. package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +1 -0
  18. package/unstable-preview-types/-private/document.d.ts +144 -0
  19. package/unstable-preview-types/-private/document.d.ts.map +1 -0
  20. package/unstable-preview-types/-private/index.d.ts +16 -0
  21. package/unstable-preview-types/-private/index.d.ts.map +1 -0
  22. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +177 -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 +17 -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 +27 -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 +440 -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 +96 -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 +95 -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 +107 -0
  35. package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -0
  36. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +135 -0
  37. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -0
  38. package/unstable-preview-types/-private/store-service.d.ts +1552 -0
  39. package/unstable-preview-types/-private/store-service.d.ts.map +1 -0
  40. package/unstable-preview-types/-private/utils/coerce-id.d.ts +8 -0
  41. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -0
  42. package/unstable-preview-types/-private/utils/construct-resource.d.ts +8 -0
  43. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -0
  44. package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts +5 -0
  45. package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts.map +1 -0
  46. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +2 -0
  47. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -0
  48. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +2 -0
  49. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -0
  50. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +2 -0
  51. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +1 -0
  52. package/unstable-preview-types/-private.d.ts +2 -0
  53. package/unstable-preview-types/-private.d.ts.map +1 -0
  54. package/unstable-preview-types/-types/overview.d.ts +19 -0
  55. package/unstable-preview-types/-types/overview.d.ts.map +1 -0
  56. package/unstable-preview-types/-types/q/cache-store-wrapper.d.ts +105 -0
  57. package/unstable-preview-types/-types/q/cache-store-wrapper.d.ts.map +1 -0
  58. package/unstable-preview-types/-types/q/cache.d.ts +45 -0
  59. package/unstable-preview-types/-types/q/cache.d.ts.map +1 -0
  60. package/unstable-preview-types/-types/q/ds-model.d.ts +13 -0
  61. package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -0
  62. package/unstable-preview-types/-types/q/identifier.d.ts +169 -0
  63. package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -0
  64. package/unstable-preview-types/-types/q/promise-proxies.d.ts +2 -0
  65. package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +1 -0
  66. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +34 -0
  67. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -0
  68. package/unstable-preview-types/-types/q/record-instance.d.ts +27 -0
  69. package/unstable-preview-types/-types/q/record-instance.d.ts.map +1 -0
  70. package/unstable-preview-types/-types/q/schema-service.d.ts +212 -0
  71. package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -0
  72. package/unstable-preview-types/-types/q/store.d.ts +15 -0
  73. package/unstable-preview-types/-types/q/store.d.ts.map +1 -0
  74. package/unstable-preview-types/index.d.ts +185 -0
  75. package/unstable-preview-types/index.d.ts.map +1 -0
  76. package/addon/store-service-0a03d2a4.js.map +0 -1
@@ -0,0 +1,144 @@
1
+ import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
2
+ import type { RequestInfo } from '@warp-drive/core-types/request';
3
+ import type { Meta, PaginationLinks } from '@warp-drive/core-types/spec/raw';
4
+ import type Store from './store-service';
5
+ /**
6
+ * A Document is a class that wraps the response content from a request to the API
7
+ * returned by `Cache.put` or `Cache.peek`, converting resource-identifiers into
8
+ * record instances.
9
+ *
10
+ * It is not directly instantiated by the user, and its properties should not
11
+ * be directly modified. Whether individual properties are mutable or not is
12
+ * determined by the record instance itself.
13
+ *
14
+ * @public
15
+ * @class Document
16
+ */
17
+ export declare class Document<T> {
18
+ #private;
19
+ /**
20
+ * The links object for this document, if any
21
+ *
22
+ * e.g.
23
+ *
24
+ * ```
25
+ * {
26
+ * self: '/articles?page[number]=3',
27
+ * }
28
+ * ```
29
+ *
30
+ * @property links
31
+ * @type {object|undefined} - a links object
32
+ * @public
33
+ */
34
+ links?: PaginationLinks;
35
+ /**
36
+ * The primary data for this document, if any.
37
+ *
38
+ * If this document has no primary data (e.g. because it is an error document)
39
+ * this property will be `undefined`.
40
+ *
41
+ * For collections this will be an array of record instances,
42
+ * for single resource requests it will be a single record instance or null.
43
+ *
44
+ * @property data
45
+ * @public
46
+ * @type {object|Array<object>|null|undefined} - a data object
47
+ */
48
+ data?: T;
49
+ /**
50
+ * The errors returned by the API for this request, if any
51
+ *
52
+ * @property errors
53
+ * @public
54
+ * @type {object|undefined} - an errors object
55
+ */
56
+ errors?: object[];
57
+ /**
58
+ * The meta object for this document, if any
59
+ *
60
+ * @property meta
61
+ * @public
62
+ * @type {object|undefined} - a meta object
63
+ */
64
+ meta?: Meta;
65
+ /**
66
+ * The identifier associated with this document, if any
67
+ *
68
+ * @property identifier
69
+ * @public
70
+ * @type {StableDocumentIdentifier|null}
71
+ */
72
+ identifier: StableDocumentIdentifier | null;
73
+ constructor(store: Store, identifier: StableDocumentIdentifier | null);
74
+ /**
75
+ * Fetches the related link for this document, returning a promise that resolves
76
+ * with the document when the request completes. If no related link is present,
77
+ * will fallback to the self link if present
78
+ *
79
+ * @method fetch
80
+ * @public
81
+ * @param {object} options
82
+ * @return Promise<Document>
83
+ */
84
+ fetch(options?: Partial<RequestInfo>): Promise<Document<T>>;
85
+ /**
86
+ * Fetches the next link for this document, returning a promise that resolves
87
+ * with the new document when the request completes, or null if there is no
88
+ * next link.
89
+ *
90
+ * @method next
91
+ * @public
92
+ * @param {object} options
93
+ * @return Promise<Document | null>
94
+ */
95
+ next(options?: Partial<RequestInfo>): Promise<Document<T> | null>;
96
+ /**
97
+ * Fetches the prev link for this document, returning a promise that resolves
98
+ * with the new document when the request completes, or null if there is no
99
+ * prev link.
100
+ *
101
+ * @method prev
102
+ * @public
103
+ * @param {object} options
104
+ * @return Promise<Document | null>
105
+ */
106
+ prev(options?: Partial<RequestInfo>): Promise<Document<T> | null>;
107
+ /**
108
+ * Fetches the first link for this document, returning a promise that resolves
109
+ * with the new document when the request completes, or null if there is no
110
+ * first link.
111
+ *
112
+ * @method first
113
+ * @public
114
+ * @param {object} options
115
+ * @return Promise<Document | null>
116
+ */
117
+ first(options?: Partial<RequestInfo>): Promise<Document<T> | null>;
118
+ /**
119
+ * Fetches the last link for this document, returning a promise that resolves
120
+ * with the new document when the request completes, or null if there is no
121
+ * last link.
122
+ *
123
+ * @method last
124
+ * @public
125
+ * @param {object} options
126
+ * @return Promise<Document | null>
127
+ */
128
+ last(options?: Partial<RequestInfo>): Promise<Document<T> | null>;
129
+ /**
130
+ * Implemented for `JSON.stringify` support.
131
+ *
132
+ * Returns the JSON representation of the document wrapper.
133
+ *
134
+ * This is a shallow serialization, it does not deeply serialize
135
+ * the document's contents, leaving that to the individual record
136
+ * instances to determine how to do, if at all.
137
+ *
138
+ * @method toJSON
139
+ * @public
140
+ * @return
141
+ */
142
+ toJSON(): object;
143
+ }
144
+ //# sourceMappingURL=document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/-private/document.ts"],"names":[],"mappings":"AAMA,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,iCAAiC,CAAC;AAEnF,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAOzC;;;;;;;;;;;GAWG;AACH,qBAAa,QAAQ,CAAC,CAAC;;IACrB;;;;;;;;;;;;;;OAcG;IACK,KAAK,CAAC,EAAE,eAAe,CAAC;IAChC;;;;;;;;;;;;OAYG;IACK,IAAI,CAAC,EAAE,CAAC,CAAC;IAEjB;;;;;;OAMG;IACK,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;;;OAMG;IACK,IAAI,CAAC,EAAE,IAAI,CAAC;IAEpB;;;;;;OAMG;IACK,UAAU,EAAE,wBAAwB,GAAG,IAAI,CAAC;gBAGxC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,wBAAwB,GAAG,IAAI;IAiBrE;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAO/D;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAIrE;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAIrE;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAItE;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAIrE;;;;;;;;;;;;OAYG;IACH,MAAM,IAAI,MAAM;CAiBjB"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ @module @ember-data/store
3
+ */
4
+ export { default as Store, storeFor } from './store-service';
5
+ export { recordIdentifierFor } from './caches/instance-cache';
6
+ export { CacheHandler, type LifetimesService } from './cache-handler';
7
+ export { setIdentifierGenerationMethod, setIdentifierUpdateMethod, setIdentifierForgetMethod, setIdentifierResetMethod, isStableIdentifier, } from './caches/identifier-cache';
8
+ export { default as coerceId } from './utils/coerce-id';
9
+ export { default as RecordArray, default as IdentifierArray, Collection as AdapterPopulatedRecordArray, notifyArray, SOURCE, MUTATE, ARRAY_SIGNAL, } from './record-arrays/identifier-array';
10
+ export { default as RecordArrayManager, fastPush } from './managers/record-array-manager';
11
+ export { _clearCaches } from './caches/instance-cache';
12
+ export { default as peekCache, removeRecordDataFor } from './caches/cache-utils';
13
+ export { setRecordIdentifier, StoreMap } from './caches/instance-cache';
14
+ export { setCacheFor } from './caches/cache-utils';
15
+ export { default as _deprecatingNormalize } from './utils/normalize-model-name';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/-private/index.ts"],"names":[],"mappings":"AAAA;;EAEE;AAEF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,OAAO,IAAI,eAAe,EAC1B,UAAU,IAAI,2BAA2B,EACzC,WAAW,EACX,MAAM,EACN,MAAM,EACN,YAAY,GACb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAG1F,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGjF,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,177 @@
1
+ import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
2
+ /**
3
+ @module @ember-data/store
4
+ */
5
+ import type { SingleResourceDocument } from '@warp-drive/core-types/spec/raw';
6
+ import type { OpaqueRecordInstance } from '../../-types/q/record-instance';
7
+ import type Store from '../store-service';
8
+ /**
9
+ @module @ember-data/store
10
+ */
11
+ /**
12
+ A `RecordReference` is a low-level API that allows users and
13
+ addon authors to perform meta-operations on a record.
14
+
15
+ @class RecordReference
16
+ @public
17
+ */
18
+ export default class RecordReference {
19
+ store: Store;
20
+ ___token: object;
21
+ ___identifier: StableRecordIdentifier;
22
+ _ref: number;
23
+ constructor(store: Store, identifier: StableRecordIdentifier);
24
+ destroy(): void;
25
+ get type(): string;
26
+ /**
27
+ The `id` of the record that this reference refers to.
28
+
29
+ Together, the `type` and `id` properties form a composite key for
30
+ the identity map.
31
+
32
+ Example
33
+
34
+ ```javascript
35
+ let userRef = store.getReference('user', 1);
36
+
37
+ userRef.id(); // '1'
38
+ ```
39
+
40
+ @method id
41
+ @public
42
+ @return {String} The id of the record.
43
+ */
44
+ id(): string | null;
45
+ /**
46
+ The `identifier` of the record that this reference refers to.
47
+
48
+ Together, the `type` and `id` properties form a composite key for
49
+ the identity map.
50
+
51
+ Example
52
+
53
+ ```javascript
54
+ let userRef = store.getReference('user', 1);
55
+
56
+ userRef.identifier(); // '1'
57
+ ```
58
+
59
+ @method identifier
60
+ @public
61
+ @return {String} The identifier of the record.
62
+ */
63
+ identifier(): StableRecordIdentifier;
64
+ /**
65
+ How the reference will be looked up when it is loaded. Currently
66
+ this always returns `identity` to signify that a record will be
67
+ loaded by its `type` and `id`.
68
+
69
+ Example
70
+
71
+ ```javascript
72
+ const userRef = store.getReference('user', 1);
73
+
74
+ userRef.remoteType(); // 'identity'
75
+ ```
76
+
77
+ @method remoteType
78
+ @public
79
+ @return {String} 'identity'
80
+ */
81
+ remoteType(): 'identity';
82
+ /**
83
+ This API allows you to provide a reference with new data. The
84
+ simplest usage of this API is similar to `store.push`: you provide a
85
+ normalized hash of data and the object represented by the reference
86
+ will update.
87
+
88
+ If you pass a promise to `push`, Ember Data will not ask the adapter
89
+ for the data if another attempt to fetch it is made in the
90
+ interim. When the promise resolves, the underlying object is updated
91
+ with the new data, and the promise returned by *this function* is resolved
92
+ with that object.
93
+
94
+ For example, `recordReference.push(promise)` will be resolved with a
95
+ record.
96
+
97
+ Example
98
+
99
+ ```javascript
100
+ let userRef = store.getReference('user', 1);
101
+
102
+ // provide data for reference
103
+ userRef.push({
104
+ data: {
105
+ id: "1",
106
+ type: "user",
107
+ attributes: {
108
+ username: "@user"
109
+ }
110
+ }
111
+ }).then(function(user) {
112
+ userRef.value() === user;
113
+ });
114
+ ```
115
+
116
+ @method push
117
+ @public
118
+ @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one
119
+ @return a promise for the value (record or relationship)
120
+ */
121
+ push(objectOrPromise: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<OpaqueRecordInstance>;
122
+ /**
123
+ If the entity referred to by the reference is already loaded, it is
124
+ present as `reference.value`. Otherwise the value returned by this function
125
+ is `null`.
126
+
127
+ Example
128
+
129
+ ```javascript
130
+ let userRef = store.getReference('user', 1);
131
+
132
+ userRef.value(); // user
133
+ ```
134
+
135
+ @method value
136
+ @public
137
+ @return {Model} the record for this RecordReference
138
+ */
139
+ value(): OpaqueRecordInstance | null;
140
+ /**
141
+ Triggers a fetch for the backing entity based on its `remoteType`
142
+ (see `remoteType` definitions per reference type).
143
+
144
+ Example
145
+
146
+ ```javascript
147
+ let userRef = store.getReference('user', 1);
148
+
149
+ // load user (via store.find)
150
+ userRef.load().then(...)
151
+ ```
152
+
153
+ @method load
154
+ @public
155
+ @return {Promise<record>} the record for this RecordReference
156
+ */
157
+ load(): Promise<unknown>;
158
+ /**
159
+ Reloads the record if it is already loaded. If the record is not
160
+ loaded it will load the record via `store.findRecord`
161
+
162
+ Example
163
+
164
+ ```javascript
165
+ let userRef = store.getReference('user', 1);
166
+
167
+ // or trigger a reload
168
+ userRef.reload().then(...)
169
+ ```
170
+
171
+ @method reload
172
+ @public
173
+ @return {Promise<record>} the record for this RecordReference
174
+ */
175
+ reload(): Promise<unknown>;
176
+ }
177
+ //# 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":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF;;EAEE;AACF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C;;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;IAKF;;;;;;;;;;;;;;;;;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,17 @@
1
+ import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
2
+ import type { AttributeSchema, RelationshipSchema } from '@warp-drive/core-types/schema';
3
+ import type { KeyOrString, ModelSchema } from '../../-types/q/ds-model';
4
+ import type Store from '../store-service';
5
+ export declare function getShimClass<T>(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string): ShimModelClass<T>;
6
+ export default class ShimModelClass<T = unknown> implements ModelSchema<T> {
7
+ __store: Store;
8
+ modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
9
+ constructor(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string);
10
+ get fields(): Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'>;
11
+ get attributes(): Map<KeyOrString<T>, AttributeSchema>;
12
+ get relationshipsByName(): Map<KeyOrString<T>, RelationshipSchema>;
13
+ eachAttribute<K extends KeyOrString<T>>(callback: (key: K, attribute: AttributeSchema) => void, binding?: T): void;
14
+ eachRelationship<K extends KeyOrString<T>>(callback: (key: K, relationship: RelationshipSchema) => void, binding?: T): void;
15
+ eachTransformedAttribute<K extends KeyOrString<T>>(callback: (key: K, type: string | null) => void, binding?: T): void;
16
+ }
17
+ //# 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":"AAAA,OAAO,K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,CAAC,CAAC,CAAC,EACvC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,kBAAkB,KAAK,IAAI,EAC5D,OAAO,CAAC,EAAE,CAAC;IAUb,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,27 @@
1
+ import type { StableDocumentIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
2
+ import type { CacheCapabilitiesManager as StoreWrapper } from '../../-types/q/cache-store-wrapper';
3
+ import type { SchemaService } from '../../-types/q/schema-service';
4
+ import type { IdentifierCache } from '../caches/identifier-cache';
5
+ import type Store from '../store-service';
6
+ import type { NotificationType } from './notification-manager';
7
+ /**
8
+ @module @ember-data/store
9
+ */
10
+ export declare class CacheCapabilitiesManager implements StoreWrapper {
11
+ _willNotify: boolean;
12
+ _pendingNotifies: Map<StableRecordIdentifier, Set<string>>;
13
+ _store: Store;
14
+ constructor(_store: Store);
15
+ get identifierCache(): IdentifierCache;
16
+ _scheduleNotification(identifier: StableRecordIdentifier, key: string): void;
17
+ _flushNotifications(): void;
18
+ notifyChange(identifier: StableRecordIdentifier, namespace: 'added' | 'removed'): void;
19
+ notifyChange(identifier: StableDocumentIdentifier, namespace: 'added' | 'updated' | 'removed'): void;
20
+ notifyChange(identifier: StableRecordIdentifier, namespace: NotificationType, key?: string): void;
21
+ getSchemaDefinitionService(): SchemaService;
22
+ get schema(): SchemaService;
23
+ setRecordId(identifier: StableRecordIdentifier, id: string): void;
24
+ hasRecord(identifier: StableRecordIdentifier): boolean;
25
+ disconnectRecord(identifier: StableRecordIdentifier): void;
26
+ }
27
+ //# sourceMappingURL=cache-capabilities-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-capabilities-manager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