@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-data-types/store",
3
- "version": "5.6.0-alpha.5",
3
+ "version": "5.6.0-beta.1",
4
4
  "files": [
5
5
  "unstable-preview-types",
6
6
  "README.md",
@@ -1,30 +1,4 @@
1
1
  declare module '@ember-data/store/-private' {
2
- export { Store, storeFor } from '@ember-data/store/-private/store-service';
3
- export { recordIdentifierFor } from '@ember-data/store/-private/caches/instance-cache';
4
- export { CacheHandler, type StoreRequestContext } from '@ember-data/store/-private/cache-handler/handler';
5
- export { type CachePolicy } from '@ember-data/store/-private/cache-handler/types';
6
- export { isStableIdentifier, isDocumentIdentifier } from '@ember-data/store/-private/caches/identifier-cache';
7
- export { constructResource } from '@ember-data/store/-private/utils/construct-resource';
8
- export type { ReactiveDocument as Document } from '@ember-data/store/-private/document';
9
- export type { InstanceCache } from '@ember-data/store/-private/caches/instance-cache';
10
- export type { FindRecordQuery, Request, SaveRecordMutation, RequestCacheRequestState, RequestStateService, } from '@ember-data/store/-private/network/request-cache';
11
- export type { CreateRecordProperties } from '@ember-data/store/-private/store-service';
12
- export { coerceId, ensureStringId } from '@ember-data/store/-private/utils/coerce-id';
13
- export type { NativeProxy } from '@ember-data/store/-private/record-arrays/native-proxy-type-fix';
14
- export { IdentifierArray as LiveArray, Collection as CollectionRecordArray, SOURCE, MUTATE, } from '@ember-data/store/-private/record-arrays/identifier-array';
15
- export { RecordArrayManager, fastPush } from '@ember-data/store/-private/managers/record-array-manager';
16
- export { _clearCaches } from '@ember-data/store/-private/caches/instance-cache';
17
- export { peekCache, removeRecordDataFor } from '@ember-data/store/-private/caches/cache-utils';
18
- export { setRecordIdentifier, StoreMap } from '@ember-data/store/-private/caches/instance-cache';
19
- export { setCacheFor } from '@ember-data/store/-private/caches/cache-utils';
20
- export { normalizeModelName as _deprecatingNormalize } from '@ember-data/store/-private/utils/normalize-model-name';
21
- export type { StoreRequestInput } from '@ember-data/store/-private/cache-handler/handler';
22
- export { RelatedCollection } from '@ember-data/store/-private/record-arrays/many-array';
23
- export { log, logGroup } from '@ember-data/store/-private/debug/utils';
24
- export { getPromiseState, type PromiseState } from '@ember-data/store/-private/new-core-tmp/promise-state';
25
- export { getRequestState, type RequestLoadingState, type RequestCacheRequestState as RequestState, } from '@ember-data/store/-private/new-core-tmp/request-state';
26
- export { createMemo, type SignalHooks } from '@ember-data/store/-private/new-core-tmp/reactivity/configure';
27
- export { memoized, gate, entangleSignal, defineSignal, defineNonEnumerableSignal, } from '@ember-data/store/-private/new-core-tmp/reactivity/signal';
28
- export { ARRAY_SIGNAL, OBJECT_SIGNAL, Signals, type WarpDriveSignal, peekInternalSignal, withSignalStore, notifyInternalSignal, consumeInternalSignal, getOrCreateInternalSignal, } from '@ember-data/store/-private/new-core-tmp/reactivity/internal';
29
- }
30
- //# sourceMappingURL=-private.d.ts.map
2
+ export * from "@warp-drive/core/store/-private";
3
+
4
+ }
@@ -1,17 +1,17 @@
1
1
  declare module '@ember-data/store/configure' {
2
2
  /**
3
- * Provides a configuration API for the reactivity system
4
- * that WarpDrive should use.
5
- *
6
- * @module
7
- */
3
+ * Provides a configuration API for the reactivity system
4
+ * that WarpDrive should use.
5
+ *
6
+ * @module
7
+ */
8
8
  /**
9
- * Configures the signals implementation to use. Supports multiple
10
- * implementations simultaneously.
11
- *
12
- * @public
13
- * @param {function} buildConfig - a function that takes options and returns a configuration object
14
- */
15
- export { setupSignals } from '@ember-data/store/-private/new-core-tmp/reactivity/configure';
16
- }
17
- //# sourceMappingURL=configure.d.ts.map
9
+ * Configures the signals implementation to use. Supports multiple
10
+ * implementations simultaneously.
11
+ *
12
+ * @public
13
+ * @param {function} buildConfig - a function that takes options and returns a configuration object
14
+ */
15
+ export { setupSignals } from "@warp-drive/core/configure";
16
+
17
+ }
@@ -1,228 +1,7 @@
1
+ /// <reference path="./configure.d.ts" />
1
2
  /// <reference path="./-private.d.ts" />
2
3
  /// <reference path="./types.d.ts" />
3
- /// <reference path="./configure.d.ts" />
4
- /// <reference path="./-private/document.d.ts" />
5
- /// <reference path="./-private/store-service.type-test.d.ts" />
6
- /// <reference path="./-private/store-service.d.ts" />
7
- /// <reference path="./-private/network/request-cache.d.ts" />
8
- /// <reference path="./-private/caches/instance-cache.d.ts" />
9
- /// <reference path="./-private/caches/resource-utils.d.ts" />
10
- /// <reference path="./-private/caches/cache-utils.d.ts" />
11
- /// <reference path="./-private/caches/identifier-cache.d.ts" />
12
- /// <reference path="./-private/legacy-model-support/record-reference.d.ts" />
13
- /// <reference path="./-private/legacy-model-support/shim-model-class.d.ts" />
14
- /// <reference path="./-private/debug/utils.d.ts" />
15
- /// <reference path="./-private/utils/normalize-model-name.d.ts" />
16
- /// <reference path="./-private/utils/construct-resource.d.ts" />
17
- /// <reference path="./-private/utils/uuid-polyfill.d.ts" />
18
- /// <reference path="./-private/utils/is-non-empty-string.d.ts" />
19
- /// <reference path="./-private/utils/coerce-id.d.ts" />
20
- /// <reference path="./-private/cache-handler/handler.d.ts" />
21
- /// <reference path="./-private/cache-handler/types.d.ts" />
22
- /// <reference path="./-private/cache-handler/utils.d.ts" />
23
- /// <reference path="./-private/managers/record-array-manager.d.ts" />
24
- /// <reference path="./-private/managers/notification-manager.d.ts" />
25
- /// <reference path="./-private/managers/cache-capabilities-manager.d.ts" />
26
- /// <reference path="./-private/managers/cache-manager.d.ts" />
27
- /// <reference path="./-private/new-core-tmp/promise-state.d.ts" />
28
- /// <reference path="./-private/new-core-tmp/request-state.d.ts" />
29
- /// <reference path="./-private/new-core-tmp/reactivity/internal.d.ts" />
30
- /// <reference path="./-private/new-core-tmp/reactivity/configure.d.ts" />
31
- /// <reference path="./-private/new-core-tmp/reactivity/signal.d.ts" />
32
- /// <reference path="./-private/record-arrays/identifier-array.d.ts" />
33
- /// <reference path="./-private/record-arrays/native-proxy-type-fix.d.ts" />
34
- /// <reference path="./-private/record-arrays/many-array.d.ts" />
35
- /// <reference path="./-types/q/identifier.d.ts" />
36
- /// <reference path="./-types/q/store.d.ts" />
37
- /// <reference path="./-types/q/ds-model.d.ts" />
38
- /// <reference path="./-types/q/record-instance.d.ts" />
39
- /// <reference path="./-types/q/promise-proxies.d.ts" />
40
- /// <reference path="./-types/q/cache-capabilities-manager.d.ts" />
41
- /// <reference path="./-types/q/schema-service.d.ts" />
42
- /// <reference path="./-types/q/record-data-json-api.d.ts" />
43
4
  declare module '@ember-data/store' {
44
- /**
45
- * <p align="center">
46
- * <img
47
- * class="project-logo"
48
- * src="https://raw.githubusercontent.com/emberjs/data/4612c9354e4c54d53327ec2cf21955075ce21294/ember-data-logo-light.svg#gh-light-mode-only"
49
- * alt="EmberData Store"
50
- * width="240px"
51
- * title="EmberData Store"
52
- * />
53
- * </p>
54
- *
55
- * This package provides [*Ember***Data**](https://github.com/emberjs/data/)'s `Store` class.
56
- *
57
- * A [Store](https://api.emberjs.com/ember-data/release/classes/Store) coordinates interaction between your application, a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache),
58
- * and sources of data (such as your API or a local persistence layer) accessed via a [RequestManager](https://github.com/emberjs/data/tree/main/packages/request).
59
- *
60
- * Optionally, a Store can be configured to hydrate the response data into rich presentation classes.
61
- *
62
- * ## Installation
63
- *
64
- * If you have installed `ember-data` then you already have this package installed.
65
- * Otherwise you can install it using your javascript package manager of choice.
66
- * For instance with [pnpm](https://pnpm.io/)
67
- *
68
- * ```
69
- * pnpm add @ember-data/store
70
- * ```
71
- *
72
- * After installing you will want to configure your first `Store`. Read more below
73
- * for how to create and configure stores for your application.
74
- *
75
- *
76
- * ## 🔨 Creating A Store
77
- *
78
- * To use a `Store` we will need to do few things: add a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache)
79
- * to store data **in-memory**, add a [Handler](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache) to fetch data from a source,
80
- * and implement `instantiateRecord` to tell the store how to display the data for individual resources.
81
- *
82
- * > **Note**
83
- * > If you are using the package `ember-data` then a JSON:API cache, RequestManager, LegacyNetworkHandler,
84
- * > and `instantiateRecord` are configured for you by default.
85
- *
86
- * ### Configuring A Cache
87
- *
88
- * To start, let's install a [JSON:API](https://jsonapi.org/) cache. If your app uses `GraphQL` or `REST` other
89
- * caches may better fit your data. You can author your own cache by creating one that
90
- * conforms to the [spec](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache).
91
- *
92
- * The package `@ember-data/json-api` provides a [JSON:API](https://jsonapi.org/) cache we can use.
93
- * After installing it, we can configure the store to use this cache.
94
- *
95
- * ```js
96
- * import Store from '@ember-data/store';
97
- * import Cache from '@ember-data/json-api';
98
- *
99
- * class extends Store {
100
- * createCache(storeWrapper) {
101
- * return new Cache(storeWrapper);
102
- * }
103
- * }
104
- * ```
105
- *
106
- * Now that we have a `cache` let's setup something to handle fetching
107
- * and saving data via our API.
108
- *
109
- * > **Note**
110
- * > The `ember-data` package automatically includes and configures
111
- * > the `@ember-data/json-api` cache for you.
112
- *
113
- * ### Handling Requests
114
- *
115
- * When *Ember***Data** needs to fetch or save data it will pass that request to your application's `RequestManager` for fulfillment. How this fulfillment occurs (in-memory, device storage, via single or multiple API requests, etc.) is then up to the registered request handlers.
116
- *
117
- * To start, let's install the `RequestManager` from `@ember-data/request` and the basic `Fetch` handler from ``@ember-data/request/fetch`.
118
- *
119
- * > **Note**
120
- * > If your app uses `GraphQL`, `REST` or different conventions for `JSON:API` than your cache expects, other handlers may better fit your data. You can author your own handler by creating one that conforms to the [handler interface](https://github.com/emberjs/data/tree/main/packages/request#handling-requests).
121
- *
122
- * ```ts
123
- * import Store from '@ember-data/store';
124
- * import RequestManager from '@ember-data/request';
125
- * import Fetch from '@ember-data/request/fetch';
126
- *
127
- * export default class extends Store {
128
- * requestManager = new RequestManager()
129
- * .use([Fetch]);
130
- * }
131
- * ```
132
- *
133
- * **Using RequestManager as a Service**
134
- *
135
- * Alternatively if you have configured the `RequestManager` to be a service you may re-use it.
136
- *
137
- * *app/services/request.js*
138
- * ```ts
139
- * import RequestManager from '@ember-data/request';
140
- * import Fetch from '@ember-data/request/fetch';
141
- *
142
- * export default {
143
- * create() {
144
- * return new RequestManager()
145
- * .use([Fetch])
146
- * .useCache(CacheHandler);
147
- * }
148
- * }
149
- * ```
150
- *
151
- * *app/services/store.js*
152
- * ```ts
153
- * import Store from '@ember-data/store';
154
- * import { service } from '@ember/service';
155
- *
156
- * export default class extends Store {
157
- * @service('request') requestManager
158
- * }
159
- * ```
160
- *
161
- *
162
- * ### Presenting Data from the Cache
163
- *
164
- * Now that we have a source and a cache for our data, we need to configure how
165
- * the Store delivers that data back to our application. We do this via the hook
166
- * [instantiateRecord](https://api.emberjs.com/ember-data/release/classes/Store/methods/instantiateRecord%20(hook)?anchor=instantiateRecord%20(hook)),
167
- * which allows us to transform the data for a resource before handing it to the application.
168
- *
169
- * A naive way to present the data would be to return it as JSON. Typically instead
170
- * this hook will be used to add reactivity and make each unique resource a singleton,
171
- * ensuring that if the cache updates our presented data will reflect the new state.
172
- *
173
- * Below is an example of using the hooks `instantiateRecord` and a `teardownRecord`
174
- * to provide minimal read-only reactive state for simple resources.
175
- *
176
- * ```ts
177
- * import Store, { recordIdentifierFor } from '@ember-data/store';
178
- * import { TrackedObject } from 'tracked-built-ins';
179
- *
180
- * class extends Store {
181
- * instantiateRecord(identifier) {
182
- * const { cache, notifications } = this;
183
- *
184
- * // create a TrackedObject with our attributes, id and type
185
- * const record = new TrackedObject(Object.assign({}, cache.peek(identifier)));
186
- * record.type = identifier.type;
187
- * record.id = identifier.id;
188
- *
189
- * notifications.subscribe(identifier, (_, change) => {
190
- * if (change === 'attributes') {
191
- * Object.assign(record, cache.peek(identifier));
192
- * }
193
- * });
194
- *
195
- * return record;
196
- * }
197
- * }
198
- * ```
199
- *
200
- * Because `instantiateRecord` is opaque to the nature of the record, an implementation
201
- * can be anything from a fairly simple object to a robust proxy that intelligently links
202
- * together associated records through relationships.
203
- *
204
- * This also enables creating a record that separates `edit` flows from `create` flows
205
- * entirely. A record class might choose to implement a `checkout`method that gives access
206
- * to an editable instance while the primary record continues to be read-only and reflect
207
- * only persisted (non-mutated) state.
208
- *
209
- * Typically you will choose an existing record implementation such as `@ember-data/model`
210
- * for your application.
211
- *
212
- * Because of the boundaries around instantiation and the cache, record implementations
213
- * should be capable of interop both with each other and with any `Cache`. Due to this,
214
- * if needed an application can utilize multiple record implementations and multiple cache
215
- * implementations either to support enhanced features for only a subset of records or to
216
- * be able to incrementally migrate from one record/cache to another record or cache.
217
- *
218
- * > **Note**
219
- * > The `ember-data` package automatically includes the `@ember-data/model`
220
- * > package and configures it for you.
221
- *
222
- * @module
223
- */
224
- export { Store as default, type StoreRequestContext, CacheHandler, type Document, type CachePolicy, type StoreRequestInput, recordIdentifierFor, storeFor, } from '@ember-data/store/-private';
225
- export type { DocumentCacheOperation, CacheOperation, NotificationType, } from '@ember-data/store/-private/managers/notification-manager';
226
- export { setIdentifierGenerationMethod, setIdentifierUpdateMethod, setIdentifierForgetMethod, setIdentifierResetMethod, setKeyInfoForResource, } from '@ember-data/store/-private/caches/identifier-cache';
227
- }
228
- //# sourceMappingURL=index.d.ts.map
5
+ export { Store as default, type StoreRequestContext, CacheHandler, type Document, type CachePolicy, type StoreRequestInput, recordIdentifierFor, storeFor, type DocumentCacheOperation, type CacheOperation, type NotificationType, setIdentifierGenerationMethod, setIdentifierUpdateMethod, setIdentifierForgetMethod, setIdentifierResetMethod, setKeyInfoForResource } from "@warp-drive/core";
6
+
7
+ }
@@ -1,7 +1,4 @@
1
1
  declare module '@ember-data/store/types' {
2
- export type { CacheCapabilitiesManager } from '@ember-data/store/-types/q/cache-capabilities-manager';
3
- export type { ModelSchema } from '@ember-data/store/-types/q/ds-model';
4
- export type { SchemaService } from '@ember-data/store/-types/q/schema-service';
5
- export type { BaseFinderOptions, FindRecordOptions, LegacyResourceQuery, QueryOptions, FindAllOptions, } from '@ember-data/store/-types/q/store';
6
- }
7
- //# sourceMappingURL=types.d.ts.map
2
+ export type { CacheCapabilitiesManager, ModelSchema, SchemaService, BaseFinderOptions, FindRecordOptions, LegacyResourceQuery, QueryOptions, FindAllOptions } from "@warp-drive/core/types";
3
+
4
+ }
@@ -1,59 +0,0 @@
1
- declare module '@ember-data/store/-private/cache-handler/handler' {
2
- import type { CacheHandler as CacheHandlerType } from '@ember-data/request';
3
- import type { ImmutableRequestInfo, RequestContext } from '@warp-drive/core-types/request';
4
- import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';
5
- import type { RequestSignature } from '@warp-drive/core-types/symbols';
6
- import type { Store } from '@ember-data/store/-private/store-service';
7
- export type LooseStoreRequestInfo<RT = unknown, T = unknown> = Omit<ImmutableRequestInfo<RT, T>, 'records' | 'headers' | typeof RequestSignature> & {
8
- records?: ResourceIdentifierObject[];
9
- headers?: Headers;
10
- };
11
- export type StoreRequestInput<RT = unknown, T = unknown> = ImmutableRequestInfo<RT, T> | LooseStoreRequestInfo<RT, T>;
12
- export interface StoreRequestContext extends RequestContext {
13
- request: ImmutableRequestInfo & {
14
- store: Store;
15
- };
16
- }
17
- /**
18
- * A CacheHandler that adds support for using an EmberData Cache with a RequestManager.
19
- *
20
- * This handler will only run when a request has supplied a `store` instance. Requests
21
- * issued by the store via `store.request()` will automatically have the `store` instance
22
- * attached to the request.
23
- *
24
- * ```ts
25
- * requestManager.request({
26
- * store: store,
27
- * url: '/api/posts',
28
- * method: 'GET'
29
- * });
30
- * ```
31
- *
32
- * When this handler elects to handle a request, it will return the raw `StructuredDocument`
33
- * unless the request has `[EnableHydration]` set to `true`. In this case, the handler will
34
- * return a `Document` instance that will automatically update the UI when the cache is updated
35
- * in the future and will hydrate any identifiers in the StructuredDocument into Record instances.
36
- *
37
- * When issuing a request via the store, [EnableHydration] is automatically set to `true`. This
38
- * means that if desired you can issue requests that utilize the cache without needing to also
39
- * utilize Record instances if desired.
40
- *
41
- * Said differently, you could elect to issue all requests via a RequestManager, without ever using
42
- * the store directly, by setting [EnableHydration] to `true` and providing a store instance. Not
43
- * necessarily the most useful thing, but the decoupled nature of the RequestManager and incremental-feature
44
- * approach of EmberData allows for this flexibility.
45
- *
46
- * ```ts
47
- * import { EnableHydration } from '@warp-drive/core-types/request';
48
- *
49
- * requestManager.request({
50
- * store: store,
51
- * url: '/api/posts',
52
- * method: 'GET',
53
- * [EnableHydration]: true
54
- * });
55
- *
56
- */
57
- export const CacheHandler: CacheHandlerType;
58
- }
59
- //# sourceMappingURL=handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/-private/cache-handler/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAA0C,MAAM,qBAAqB,CAAC;AAGpH,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EAGf,MAAM,gCAAgC,CAAC;AAQxC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAU9C,MAAM,MAAM,qBAAqB,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,IAAI,CACjE,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAC,EAC3B,SAAS,GAAG,SAAS,GAAG,OAAO,gBAAgB,CAChD,GAAG;IACF,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,qBAAqB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAEtH,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,OAAO,EAAE,oBAAoB,GAAG;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,YAAY,EAAE,gBA0E1B,CAAC"}
@@ -1,101 +0,0 @@
1
- declare module '@ember-data/store/-private/cache-handler/types' {
2
- import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
3
- import type { ImmutableRequestInfo, ResponseInfo } from '@warp-drive/core-types/request';
4
- import type { Store } from '@ember-data/store/-private/store-service';
5
- /**
6
- * A service which an application may provide to the store via
7
- * the store's `lifetimes` property to configure the behavior
8
- * of the CacheHandler.
9
- *
10
- * The default behavior for request lifetimes is to never expire
11
- * unless manually refreshed via `cacheOptions.reload` or `cacheOptions.backgroundReload`.
12
- *
13
- * Implementing this service allows you to programatically define
14
- * when a request should be considered expired.
15
- *
16
- * @class (Interface) CachePolicy
17
- * @public
18
- */
19
- export interface CachePolicy {
20
- /**
21
- * Invoked to determine if the request may be fulfilled from cache
22
- * if possible.
23
- *
24
- * Note, this is only invoked if the request has a cache-key.
25
- *
26
- * If no cache entry is found or the entry is hard expired,
27
- * the request will be fulfilled from the configured request handlers
28
- * and the cache will be updated before returning the response.
29
- *
30
- * @public
31
- * @param {StableDocumentIdentifier} identifier
32
- * @param {Store} store
33
- * @return {Boolean} true if the request is considered hard expired
34
- */
35
- isHardExpired(identifier: StableDocumentIdentifier, store: Store): boolean;
36
- /**
37
- * Invoked if `isHardExpired` is false to determine if the request
38
- * should be update behind the scenes if cache data is already available.
39
- *
40
- * Note, this is only invoked if the request has a cache-key.
41
- *
42
- * If true, the request will be fulfilled from cache while a backgrounded
43
- * request is made to update the cache via the configured request handlers.
44
- *
45
- * @public
46
- * @param {StableDocumentIdentifier} identifier
47
- * @param {Store} store
48
- * @return {Boolean} true if the request is considered soft expired
49
- */
50
- isSoftExpired(identifier: StableDocumentIdentifier, store: Store): boolean;
51
- /**
52
- * Invoked when a request will be sent to the configured request handlers.
53
- * This is invoked for both foreground and background requests.
54
- *
55
- * Note, this is invoked regardless of whether the request has a cache-key.
56
- *
57
- * @public
58
- * @param {ImmutableRequestInfo} request
59
- * @param {StableDocumentIdentifier | null} identifier
60
- * @param {Store} store
61
- * @return {void}
62
- */
63
- willRequest?(request: ImmutableRequestInfo, identifier: StableDocumentIdentifier | null, store: Store): void;
64
- /**
65
- * Invoked when a request has been fulfilled from the configured request handlers.
66
- * This is invoked for both foreground and background requests once the cache has
67
- * been updated.
68
- *
69
- * Note, this is invoked regardless of whether the request has a cache-key.
70
- *
71
- * It is best practice to notify the store of any requests marked as invalidated
72
- * so that request subscriptions can reload when needed.
73
- *
74
- * ```ts
75
- * store.notifications.notify(identifier, 'invalidated');
76
- * ```
77
- *
78
- * This allows anything subscribed to the request to be notified of the change
79
- *
80
- * e.g.
81
- *
82
- * ```ts
83
- * store.notifications.subscribe(identifier, (_, type) => {
84
- * if (type === 'invalidated') {
85
- * // do update
86
- * }
87
- * });
88
- * ```
89
- *
90
- *
91
- * @public
92
- * @param {ImmutableRequestInfo} request
93
- * @param {ImmutableResponse} response
94
- * @param {StableDocumentIdentifier | null} identifier
95
- * @param {Store} store
96
- * @return {void}
97
- */
98
- didRequest?(request: ImmutableRequestInfo, response: Response | ResponseInfo | null, identifier: StableDocumentIdentifier | null, store: Store): void;
99
- }
100
- }
101
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/-private/cache-handler/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEzF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAC3E;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAE3E;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAE7G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,UAAU,CAAC,CACT,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,EACxC,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAC3C,KAAK,EAAE,KAAK,GACX,IAAI,CAAC;CACT"}
@@ -1,34 +0,0 @@
1
- declare module '@ember-data/store/-private/cache-handler/utils' {
2
- import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
3
- import type { ImmutableCreateRequestOptions, ImmutableDeleteRequestOptions, ImmutableRequestInfo, ImmutableUpdateRequestOptions, StructuredDataDocument } from '@warp-drive/core-types/request';
4
- import type { ResourceDataDocument, ResourceErrorDocument } from '@warp-drive/core-types/spec/document';
5
- import type { ApiError } from '@warp-drive/core-types/spec/error';
6
- import type { Store } from '@ember-data/store/-private/store-service';
7
- export const MUTATION_OPS: Set<string>;
8
- export function calcShouldFetch(store: Store, request: ImmutableRequestInfo, hasCachedValue: boolean, identifier: StableDocumentIdentifier | null): boolean;
9
- export function calcShouldBackgroundFetch(store: Store, request: ImmutableRequestInfo, willFetch: boolean, identifier: StableDocumentIdentifier | null): boolean;
10
- export function isMutation(request: Partial<ImmutableRequestInfo>): request is ImmutableUpdateRequestOptions | ImmutableCreateRequestOptions | ImmutableDeleteRequestOptions;
11
- export function isCacheAffecting<T>(document: StructuredDataDocument<T>): boolean;
12
- export function isAggregateError(error: Error & {
13
- errors?: ApiError[];
14
- }): error is AggregateError & {
15
- errors: ApiError[];
16
- };
17
- export type RobustError = Error & {
18
- error: string | object;
19
- errors?: ApiError[];
20
- content?: unknown;
21
- };
22
- export function cloneError(error: RobustError): RobustError;
23
- export function isErrorDocument(document: ResourceDataDocument | ResourceErrorDocument): document is ResourceErrorDocument;
24
- export function getPriority(identifier: StableDocumentIdentifier | null, deduped: Map<StableDocumentIdentifier, {
25
- priority: {
26
- blocking: boolean;
27
- };
28
- }>, priority: {
29
- blocking: boolean;
30
- }): {
31
- blocking: boolean;
32
- };
33
- }
34
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/-private/cache-handler/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EACV,6BAA6B,EAC7B,6BAA6B,EAC7B,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACxG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY,aAA4D,CAAC;AAEtF,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,oBAAoB,EAC7B,cAAc,EAAE,OAAO,EACvB,UAAU,EAAE,wBAAwB,GAAG,IAAI,GAC1C,OAAO,CAQT;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,wBAAwB,GAAG,IAAI,GAC1C,OAAO,CAOT;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACrC,OAAO,IAAI,6BAA6B,GAAG,6BAA6B,GAAG,6BAA6B,CAE1G;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,OAAO,CAahF;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,GAAG;IAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAA;CAAE,GACrC,KAAK,IAAI,cAAc,GAAG;IAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;CAAE,CAElD;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAGrG,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,eAa5C;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,oBAAoB,GAAG,qBAAqB,GACrD,QAAQ,IAAI,qBAAqB,CAEnC;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAC3C,OAAO,EAAE,GAAG,CAAC,wBAAwB,EAAE;IAAE,QAAQ,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC,EAC3E,QAAQ,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE;cADgC,OAAO;EAUvE"}
@@ -1,11 +0,0 @@
1
- declare module '@ember-data/store/-private/caches/cache-utils' {
2
- import type { Cache } from '@warp-drive/core-types/cache';
3
- import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
4
- import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
5
- export const CacheForIdentifierCache: Map<unknown, Cache>;
6
- export function setCacheFor(identifier: StableRecordIdentifier | OpaqueRecordInstance, cache: Cache): void;
7
- export function removeRecordDataFor(identifier: StableRecordIdentifier | OpaqueRecordInstance): void;
8
- export function peekCache(instance: StableRecordIdentifier): Cache | null;
9
- export function peekCache(instance: OpaqueRecordInstance): Cache;
10
- }
11
- //# sourceMappingURL=cache-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache-utils.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/cache-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAO3E,eAAO,MAAM,uBAAuB,qBAGnC,CAAC;AAEF,wBAAgB,WAAW,CAAC,UAAU,EAAE,sBAAsB,GAAG,oBAAoB,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAMzG;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,sBAAsB,GAAG,oBAAoB,GAAG,IAAI,CAEnG;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,sBAAsB,GAAG,KAAK,GAAG,IAAI,CAAC;AAC1E,wBAAgB,SAAS,CAAC,QAAQ,EAAE,oBAAoB,GAAG,KAAK,CAAC"}