@ember-data-types/store 5.4.0-alpha.49 → 5.4.0-alpha.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-data-types/store",
3
- "version": "5.4.0-alpha.49",
3
+ "version": "5.4.0-alpha.51",
4
4
  "files": [
5
5
  "unstable-preview-types",
6
6
  "README.md",
@@ -95,6 +95,47 @@ declare module '@ember-data/store/-private/cache-handler' {
95
95
  [EnableHydration]?: boolean;
96
96
  };
97
97
  }
98
+ /**
99
+ * A CacheHandler that adds support for using an EmberData Cache with a RequestManager.
100
+ *
101
+ * This handler will only run when a request has supplied a `store` instance. Requests
102
+ * issued by the store via `store.request()` will automatically have the `store` instance
103
+ * attached to the request.
104
+ *
105
+ * ```ts
106
+ * requestManager.request({
107
+ * store: store,
108
+ * url: '/api/posts',
109
+ * method: 'GET'
110
+ * });
111
+ * ```
112
+ *
113
+ * When this handler elects to handle a request, it will return the raw `StructuredDocument`
114
+ * unless the request has `[EnableHydration]` set to `true`. In this case, the handler will
115
+ * return a `Document` instance that will automatically update the UI when the cache is updated
116
+ * in the future and will hydrate any identifiers in the StructuredDocument into Record instances.
117
+ *
118
+ * When issuing a request via the store, [EnableHydration] is automatically set to `true`. This
119
+ * means that if desired you can issue requests that utilize the cache without needing to also
120
+ * utilize Record instances if desired.
121
+ *
122
+ * Said differently, you could elect to issue all requests via a RequestManager, without ever using
123
+ * the store directly, by setting [EnableHydration] to `true` and providing a store instance. Not
124
+ * necessarily the most useful thing, but the decoupled nature of the RequestManager and incremental-feature
125
+ * approach of EmberData allows for this flexibility.
126
+ *
127
+ * ```ts
128
+ * import { EnableHydration } from '@warp-drive/core-types/request';
129
+ *
130
+ * requestManager.request({
131
+ * store: store,
132
+ * url: '/api/posts',
133
+ * method: 'GET',
134
+ * [EnableHydration]: true
135
+ * });
136
+ *
137
+ * @typedoc
138
+ */
98
139
  export const CacheHandler: CacheHandlerType;
99
140
  }
100
141
  //# sourceMappingURL=cache-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache-handler.d.ts","sourceRoot":"","sources":["../../src/-private/cache-handler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAGV,oBAAoB,EAEpB,cAAc,EACd,YAAY,EAGb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAa,MAAM,gCAAgC,CAAC;AAO5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAIhF,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;OAeG;IACH,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAC3E;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAE3E;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAE7G;;;;;;;;;;;;;;OAcG;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;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,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K,EAAE,KAAK,GAAG,IAAI,CAAC;IAE7G;;;;;;;;;;;;;;OAcG;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;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,SAAS,CAAC,GAAG;IACtF,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAE7E,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,OAAO,EAAE,oBAAoB,GAAG;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC/E;AAiTD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,YAAY,EAAE,gBAoD1B,CAAC"}
@@ -1,36 +1,36 @@
1
1
  /// <reference path="./-private.d.ts" />
2
2
  /// <reference path="./-types/overview.d.ts" />
3
- /// <reference path="./-types/q/identifier.d.ts" />
4
- /// <reference path="./-types/q/schema-service.d.ts" />
5
- /// <reference path="./-types/q/ds-model.d.ts" />
6
3
  /// <reference path="./-types/q/promise-proxies.d.ts" />
7
- /// <reference path="./-types/q/record-data-json-api.d.ts" />
8
- /// <reference path="./-types/q/cache-store-wrapper.d.ts" />
9
4
  /// <reference path="./-types/q/record-instance.d.ts" />
10
- /// <reference path="./-types/q/cache.d.ts" />
11
5
  /// <reference path="./-types/q/store.d.ts" />
6
+ /// <reference path="./-types/q/record-data-json-api.d.ts" />
7
+ /// <reference path="./-types/q/schema-service.d.ts" />
8
+ /// <reference path="./-types/q/cache.d.ts" />
9
+ /// <reference path="./-types/q/ds-model.d.ts" />
10
+ /// <reference path="./-types/q/cache-store-wrapper.d.ts" />
11
+ /// <reference path="./-types/q/identifier.d.ts" />
12
12
  /// <reference path="./-private/document.d.ts" />
13
- /// <reference path="./-private/cache-handler.d.ts" />
14
13
  /// <reference path="./-private/store-service.d.ts" />
15
- /// <reference path="./-private/legacy-model-support/record-reference.d.ts" />
16
- /// <reference path="./-private/legacy-model-support/shim-model-class.d.ts" />
14
+ /// <reference path="./-private/cache-handler.d.ts" />
15
+ /// <reference path="./-private/network/request-cache.d.ts" />
16
+ /// <reference path="./-private/caches/resource-utils.d.ts" />
17
17
  /// <reference path="./-private/caches/identifier-cache.d.ts" />
18
- /// <reference path="./-private/caches/instance-cache.d.ts" />
19
18
  /// <reference path="./-private/caches/cache-utils.d.ts" />
20
- /// <reference path="./-private/caches/resource-utils.d.ts" />
19
+ /// <reference path="./-private/caches/instance-cache.d.ts" />
20
+ /// <reference path="./-private/record-arrays/native-proxy-type-fix.d.ts" />
21
+ /// <reference path="./-private/record-arrays/identifier-array.d.ts" />
22
+ /// <reference path="./-private/legacy-model-support/record-reference.d.ts" />
23
+ /// <reference path="./-private/legacy-model-support/shim-model-class.d.ts" />
21
24
  /// <reference path="./-private/utils/coerce-id.d.ts" />
22
25
  /// <reference path="./-private/utils/is-non-empty-string.d.ts" />
23
26
  /// <reference path="./-private/utils/uuid-polyfill.d.ts" />
27
+ /// <reference path="./-private/utils/normalize-model-name.d.ts" />
24
28
  /// <reference path="./-private/utils/identifier-debug-consts.d.ts" />
25
29
  /// <reference path="./-private/utils/construct-resource.d.ts" />
26
- /// <reference path="./-private/utils/normalize-model-name.d.ts" />
27
- /// <reference path="./-private/record-arrays/identifier-array.d.ts" />
28
- /// <reference path="./-private/record-arrays/native-proxy-type-fix.d.ts" />
30
+ /// <reference path="./-private/managers/notification-manager.d.ts" />
31
+ /// <reference path="./-private/managers/cache-capabilities-manager.d.ts" />
29
32
  /// <reference path="./-private/managers/record-array-manager.d.ts" />
30
33
  /// <reference path="./-private/managers/cache-manager.d.ts" />
31
- /// <reference path="./-private/managers/cache-capabilities-manager.d.ts" />
32
- /// <reference path="./-private/managers/notification-manager.d.ts" />
33
- /// <reference path="./-private/network/request-cache.d.ts" />
34
34
  declare module '@ember-data/store' {
35
35
  /**
36
36
  * <p align="center">