@ember-data-types/store 5.4.0-beta.8 → 5.4.1-alpha.160
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/LICENSE.md +19 -7
- package/README.md +5 -8
- package/logos/NCC-1701-a-blue.svg +4 -0
- package/logos/NCC-1701-a-gold.svg +4 -0
- package/logos/NCC-1701-a-gold_100.svg +1 -0
- package/logos/NCC-1701-a-gold_base-64.txt +1 -0
- package/logos/NCC-1701-a.svg +4 -0
- package/logos/README.md +4 -0
- package/logos/docs-badge.svg +2 -0
- package/logos/github-header.svg +444 -0
- package/logos/social1.png +0 -0
- package/logos/social2.png +0 -0
- package/logos/warp-drive-logo-dark.svg +4 -0
- package/logos/warp-drive-logo-gold.svg +4 -0
- package/package.json +2 -3
- package/unstable-preview-types/-private/cache-handler/handler.d.ts +62 -0
- package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +1 -0
- package/unstable-preview-types/-private/{cache-handler.d.ts → cache-handler/types.d.ts} +25 -62
- package/unstable-preview-types/-private/cache-handler/types.d.ts.map +1 -0
- package/unstable-preview-types/-private/cache-handler/utils.d.ts +34 -0
- package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +7 -3
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -1
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +4 -1
- package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -1
- package/unstable-preview-types/-private/debug/utils.d.ts +9 -0
- package/unstable-preview-types/-private/debug/utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/document.d.ts +23 -14
- package/unstable-preview-types/-private/document.d.ts.map +1 -1
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -1
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +3 -3
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -1
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +3 -3
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -1
- package/unstable-preview-types/-private/managers/cache-manager.d.ts +23 -1
- package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -1
- package/unstable-preview-types/-private/managers/notification-manager.d.ts +11 -6
- package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -1
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts +9 -5
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -1
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +14 -2
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -1
- package/unstable-preview-types/-private/record-arrays/many-array.d.ts +199 -0
- package/unstable-preview-types/-private/record-arrays/many-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +3 -3
- package/unstable-preview-types/-private/store-service.d.ts +92 -19
- package/unstable-preview-types/-private/store-service.d.ts.map +1 -1
- package/unstable-preview-types/-private.d.ts +7 -4
- package/unstable-preview-types/-private.d.ts.map +1 -1
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +4 -4
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +1 -1
- package/unstable-preview-types/-types/q/ds-model.d.ts +3 -3
- package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -1
- package/unstable-preview-types/-types/q/schema-service.d.ts +16 -8
- package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +31 -30
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/unstable-preview-types/-private/cache-handler.d.ts.map +0 -1
- /package/{ember-data-logo-dark.svg → logos/ember-data-logo-dark.svg} +0 -0
- /package/{ember-data-logo-light.svg → logos/ember-data-logo-light.svg} +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 324 32">
|
|
2
|
+
<path fill="#110819"
|
|
3
|
+
d="M321.58 29.54a41.7 41.7 0 0 1-7.26 1.72c-2.4.36-4.87.53-7.4.53-3.21 0-6.09-.34-8.6-1.03a18.5 18.5 0 0 1-6.34-3.03 13.07 13.07 0 0 1-3.94-4.83c-.9-1.9-1.35-4.06-1.35-6.47a14.32 14.32 0 0 1 5.22-11.19 18.14 18.14 0 0 1 6.06-3.3c2.36-.81 5-1.21 7.9-1.21 2.68 0 5.13.36 7.35 1.1 2.24.71 4.15 1.78 5.74 3.2a14.28 14.28 0 0 1 3.72 5.24 18.12 18.12 0 0 1 1.33 7.17v1.98h-29.1a7.5 7.5 0 0 0 1.28 2.56c.6.77 1.4 1.43 2.42 1.97 1.02.55 2.27.97 3.74 1.27 1.5.3 3.27.45 5.33.45a35.35 35.35 0 0 0 8.23-.96c1.22-.3 2.31-.64 3.29-1 .99-.35 1.78-.7 2.38-1.07v6.9Zm-5.5-15.96a6.73 6.73 0 0 0-.66-2.26 5.82 5.82 0 0 0-1.72-2.13 9.46 9.46 0 0 0-3.1-1.54 15.6 15.6 0 0 0-4.77-.63c-1.79 0-3.33.23-4.64.67-1.3.44-2.4 1-3.29 1.65a8.37 8.37 0 0 0-2.04 2.13c-.48.76-.8 1.46-.94 2.1h21.16ZM271.84 31h-9.28L247.63 1.48h8.9l10.74 22.22 10.72-22.22h8.9L271.83 31ZM234.8 31V1.48h7.97V31h-7.97ZM229.73 8.16l-.94-.28c-.4-.13-.88-.25-1.42-.36a17.88 17.88 0 0 0-3.8-.45c-1.44 0-2.78.18-4.02.53-1.23.35-2.39.81-3.46 1.4a19.48 19.48 0 0 0-3 1.98c-.92.73-1.77 1.48-2.54 2.25V31h-7.97V1.48h7.97v4.8c.96-.72 1.94-1.41 2.94-2.07a25.36 25.36 0 0 1 3.16-1.78 18.9 18.9 0 0 1 3.48-1.23 15.39 15.39 0 0 1 5.44-.39 25 25 0 0 1 4.16.67v6.68ZM197.05 16.22c0 1.89-.2 3.57-.62 5.05a12.7 12.7 0 0 1-1.76 3.82 11.07 11.07 0 0 1-2.7 2.77 13.77 13.77 0 0 1-3.51 1.83c-1.29.46-2.68.8-4.17 1-1.49.21-3.04.31-4.66.31H160.9V1.48h18.69c1.62 0 3.17.1 4.66.32 1.49.2 2.88.53 4.17 1 1.3.45 2.48 1.06 3.54 1.82 1.06.74 1.96 1.67 2.7 2.77a12.7 12.7 0 0 1 1.77 3.82c.42 1.46.62 3.13.62 5Zm-8.03 0c0-1.42-.19-2.65-.56-3.7a5.64 5.64 0 0 0-1.76-2.57 7.66 7.66 0 0 0-3.16-1.53c-1.3-.34-2.9-.52-4.77-.52h-9.9v16.68h9.9c1.88 0 3.47-.17 4.77-.5a7.86 7.86 0 0 0 3.16-1.54c.81-.7 1.4-1.58 1.76-2.63.37-1.04.56-2.27.56-3.7ZM153.98 10.55c0 1.47-.25 2.78-.73 3.9a6.82 6.82 0 0 1-2.26 2.86 10.95 10.95 0 0 1-4 1.77 25.6 25.6 0 0 1-5.86.58h-13.26V31h-2.68V1.48h15.94c2.3 0 4.25.2 5.87.6 1.63.39 2.96.96 4 1.72a6.67 6.67 0 0 1 2.25 2.84c.48 1.13.73 2.43.73 3.9Zm-2.77 0c0-1.4-.24-2.54-.71-3.4a4.53 4.53 0 0 0-2.15-1.97c-.96-.48-2.19-.8-3.68-.95a50.43 50.43 0 0 0-5.26-.24h-11.54v13.15h11.54l2.51.02c.9 0 1.8-.04 2.67-.12.87-.1 1.7-.27 2.5-.5.8-.24 1.5-.6 2.1-1.1a5.05 5.05 0 0 0 1.46-1.9 7 7 0 0 0 .56-3ZM119.76 3.76c-.41-.13-1-.27-1.74-.41-.73-.16-1.67-.24-2.83-.24-1.6 0-3.12.2-4.54.6a17.94 17.94 0 0 0-7.28 3.96 23.73 23.73 0 0 0-2.8 2.83V31H97.9V1.48h2.69V7.5c.96-1 2-1.9 3.11-2.73a21.54 21.54 0 0 1 7.48-3.53 17.47 17.47 0 0 1 5.6-.47c.4.02.77.04 1.1.09a16.6 16.6 0 0 1 1.9.26v2.64ZM85.52 31v-3.27c-1.03.56-2.2 1.08-3.53 1.55a40.4 40.4 0 0 1-13.13 2.3c-1.91 0-3.64-.17-5.17-.52a12.2 12.2 0 0 1-3.87-1.52A7.38 7.38 0 0 1 57.37 27a7.06 7.06 0 0 1-.86-3.52c0-1.32.33-2.48 1-3.48a8.81 8.81 0 0 1 2.85-2.64c1.23-.76 2.71-1.4 4.45-1.91 1.74-.53 3.7-.98 5.84-1.34 2.15-.37 4.47-.67 6.96-.9 2.5-.24 5.14-.44 7.9-.6v-2.26c0-.91-.16-1.72-.5-2.42a5.54 5.54 0 0 0-1.45-1.83 7.97 7.97 0 0 0-2.17-1.31c-.83-.36-1.73-.65-2.7-.86a33.97 33.97 0 0 0-13.54.21c-1.03.25-2.02.53-2.96.86-.95.33-1.9.68-2.86 1.06V2.92c1.99-.53 4.1-.99 6.36-1.38 2.26-.4 4.66-.6 7.2-.6 2.14 0 4.15.19 6.01.56 1.86.36 3.48.94 4.86 1.74A9.16 9.16 0 0 1 87 6.36a8.55 8.55 0 0 1 1.18 4.62V31h-2.66Zm0-16c-4.69.25-8.69.62-12.01 1.09-3.31.47-6.02 1.05-8.12 1.74-2.1.69-3.66 1.49-4.64 2.4a4.18 4.18 0 0 0-1.46 3.12c0 .95.23 1.78.7 2.52a5.86 5.86 0 0 0 2.09 1.84c.9.49 2 .86 3.29 1.12 1.28.24 2.73.37 4.34.37a29.36 29.36 0 0 0 5.95-.6 36.6 36.6 0 0 0 5.71-1.57c.86-.32 1.64-.66 2.34-1.01a11.3 11.3 0 0 0 1.8-1.1v-9.93ZM28.65 1.48l10.53 27.37L50.09 1.48h2.99L41.2 31h-4L26.84 4.34 16.51 31h-4L.63 1.48h2.99l10.91 27.37 10.5-27.37h3.62Z" />
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 324 32">
|
|
2
|
+
<path fill="#FFC474"
|
|
3
|
+
d="M321.58 29.54a41.7 41.7 0 0 1-7.26 1.72c-2.4.36-4.87.53-7.4.53-3.21 0-6.09-.34-8.6-1.03a18.5 18.5 0 0 1-6.34-3.03 13.07 13.07 0 0 1-3.94-4.83c-.9-1.9-1.35-4.06-1.35-6.47a14.32 14.32 0 0 1 5.22-11.19 18.14 18.14 0 0 1 6.06-3.3c2.36-.81 5-1.21 7.9-1.21 2.68 0 5.13.36 7.35 1.1 2.24.71 4.15 1.78 5.74 3.2a14.28 14.28 0 0 1 3.72 5.24 18.12 18.12 0 0 1 1.33 7.17v1.98h-29.1a7.5 7.5 0 0 0 1.28 2.56c.6.77 1.4 1.43 2.42 1.97 1.02.55 2.27.97 3.74 1.27 1.5.3 3.27.45 5.33.45a35.35 35.35 0 0 0 8.23-.96c1.22-.3 2.31-.64 3.29-1 .99-.35 1.78-.7 2.38-1.07v6.9Zm-5.5-15.96a6.73 6.73 0 0 0-.66-2.26 5.82 5.82 0 0 0-1.72-2.13 9.46 9.46 0 0 0-3.1-1.54 15.6 15.6 0 0 0-4.77-.63c-1.79 0-3.33.23-4.64.67-1.3.44-2.4 1-3.29 1.65a8.37 8.37 0 0 0-2.04 2.13c-.48.76-.8 1.46-.94 2.1h21.16ZM271.84 31h-9.28L247.63 1.48h8.9l10.74 22.22 10.72-22.22h8.9L271.83 31ZM234.8 31V1.48h7.97V31h-7.97ZM229.73 8.16l-.94-.28c-.4-.13-.88-.25-1.42-.36a17.88 17.88 0 0 0-3.8-.45c-1.44 0-2.78.18-4.02.53-1.23.35-2.39.81-3.46 1.4a19.48 19.48 0 0 0-3 1.98c-.92.73-1.77 1.48-2.54 2.25V31h-7.97V1.48h7.97v4.8c.96-.72 1.94-1.41 2.94-2.07a25.36 25.36 0 0 1 3.16-1.78 18.9 18.9 0 0 1 3.48-1.23 15.39 15.39 0 0 1 5.44-.39 25 25 0 0 1 4.16.67v6.68ZM197.05 16.22c0 1.89-.2 3.57-.62 5.05a12.7 12.7 0 0 1-1.76 3.82 11.07 11.07 0 0 1-2.7 2.77 13.77 13.77 0 0 1-3.51 1.83c-1.29.46-2.68.8-4.17 1-1.49.21-3.04.31-4.66.31H160.9V1.48h18.69c1.62 0 3.17.1 4.66.32 1.49.2 2.88.53 4.17 1 1.3.45 2.48 1.06 3.54 1.82 1.06.74 1.96 1.67 2.7 2.77a12.7 12.7 0 0 1 1.77 3.82c.42 1.46.62 3.13.62 5Zm-8.03 0c0-1.42-.19-2.65-.56-3.7a5.64 5.64 0 0 0-1.76-2.57 7.66 7.66 0 0 0-3.16-1.53c-1.3-.34-2.9-.52-4.77-.52h-9.9v16.68h9.9c1.88 0 3.47-.17 4.77-.5a7.86 7.86 0 0 0 3.16-1.54c.81-.7 1.4-1.58 1.76-2.63.37-1.04.56-2.27.56-3.7ZM153.98 10.55c0 1.47-.25 2.78-.73 3.9a6.82 6.82 0 0 1-2.26 2.86 10.95 10.95 0 0 1-4 1.77 25.6 25.6 0 0 1-5.86.58h-13.26V31h-2.68V1.48h15.94c2.3 0 4.25.2 5.87.6 1.63.39 2.96.96 4 1.72a6.67 6.67 0 0 1 2.25 2.84c.48 1.13.73 2.43.73 3.9Zm-2.77 0c0-1.4-.24-2.54-.71-3.4a4.53 4.53 0 0 0-2.15-1.97c-.96-.48-2.19-.8-3.68-.95a50.43 50.43 0 0 0-5.26-.24h-11.54v13.15h11.54l2.51.02c.9 0 1.8-.04 2.67-.12.87-.1 1.7-.27 2.5-.5.8-.24 1.5-.6 2.1-1.1a5.05 5.05 0 0 0 1.46-1.9 7 7 0 0 0 .56-3ZM119.76 3.76c-.41-.13-1-.27-1.74-.41-.73-.16-1.67-.24-2.83-.24-1.6 0-3.12.2-4.54.6a17.94 17.94 0 0 0-7.28 3.96 23.73 23.73 0 0 0-2.8 2.83V31H97.9V1.48h2.69V7.5c.96-1 2-1.9 3.11-2.73a21.54 21.54 0 0 1 7.48-3.53 17.47 17.47 0 0 1 5.6-.47c.4.02.77.04 1.1.09a16.6 16.6 0 0 1 1.9.26v2.64ZM85.52 31v-3.27c-1.03.56-2.2 1.08-3.53 1.55a40.4 40.4 0 0 1-13.13 2.3c-1.91 0-3.64-.17-5.17-.52a12.2 12.2 0 0 1-3.87-1.52A7.38 7.38 0 0 1 57.37 27a7.06 7.06 0 0 1-.86-3.52c0-1.32.33-2.48 1-3.48a8.81 8.81 0 0 1 2.85-2.64c1.23-.76 2.71-1.4 4.45-1.91 1.74-.53 3.7-.98 5.84-1.34 2.15-.37 4.47-.67 6.96-.9 2.5-.24 5.14-.44 7.9-.6v-2.26c0-.91-.16-1.72-.5-2.42a5.54 5.54 0 0 0-1.45-1.83 7.97 7.97 0 0 0-2.17-1.31c-.83-.36-1.73-.65-2.7-.86a33.97 33.97 0 0 0-13.54.21c-1.03.25-2.02.53-2.96.86-.95.33-1.9.68-2.86 1.06V2.92c1.99-.53 4.1-.99 6.36-1.38 2.26-.4 4.66-.6 7.2-.6 2.14 0 4.15.19 6.01.56 1.86.36 3.48.94 4.86 1.74A9.16 9.16 0 0 1 87 6.36a8.55 8.55 0 0 1 1.18 4.62V31h-2.66Zm0-16c-4.69.25-8.69.62-12.01 1.09-3.31.47-6.02 1.05-8.12 1.74-2.1.69-3.66 1.49-4.64 2.4a4.18 4.18 0 0 0-1.46 3.12c0 .95.23 1.78.7 2.52a5.86 5.86 0 0 0 2.09 1.84c.9.49 2 .86 3.29 1.12 1.28.24 2.73.37 4.34.37a29.36 29.36 0 0 0 5.95-.6 36.6 36.6 0 0 0 5.71-1.57c.86-.32 1.64-.66 2.34-1.01a11.3 11.3 0 0 0 1.8-1.1v-9.93ZM28.65 1.48l10.53 27.37L50.09 1.48h2.99L41.2 31h-4L26.84 4.34 16.51 31h-4L.63 1.48h2.99l10.91 27.37 10.5-27.37h3.62Z" />
|
|
4
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data-types/store",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.1-alpha.160",
|
|
4
4
|
"files": [
|
|
5
5
|
"unstable-preview-types",
|
|
6
6
|
"README.md",
|
|
7
7
|
"LICENSE.md",
|
|
8
|
-
"
|
|
9
|
-
"ember-data-logo-light.svg"
|
|
8
|
+
"logos"
|
|
10
9
|
],
|
|
11
10
|
"private": false,
|
|
12
11
|
"description": "Type Declarations for @ember-data/store",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
declare module '@ember-data/store/-private/cache-handler/handler' {
|
|
2
|
+
/**
|
|
3
|
+
* @module @ember-data/store
|
|
4
|
+
*/
|
|
5
|
+
import type { CacheHandler as CacheHandlerType } from '@ember-data/request';
|
|
6
|
+
import type { ImmutableRequestInfo, RequestContext } from '@warp-drive/core-types/request';
|
|
7
|
+
import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';
|
|
8
|
+
import type { Store } from '@ember-data/store/-private/store-service';
|
|
9
|
+
export type LooseStoreRequestInfo<T = unknown, RT = unknown> = Omit<ImmutableRequestInfo<T, RT>, 'records' | 'headers'> & {
|
|
10
|
+
records?: ResourceIdentifierObject[];
|
|
11
|
+
headers?: Headers;
|
|
12
|
+
};
|
|
13
|
+
export type StoreRequestInput<T = unknown, RT = unknown> = ImmutableRequestInfo<T, RT> | LooseStoreRequestInfo<T, RT>;
|
|
14
|
+
export interface StoreRequestContext extends RequestContext {
|
|
15
|
+
request: ImmutableRequestInfo & {
|
|
16
|
+
store: Store;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A CacheHandler that adds support for using an EmberData Cache with a RequestManager.
|
|
21
|
+
*
|
|
22
|
+
* This handler will only run when a request has supplied a `store` instance. Requests
|
|
23
|
+
* issued by the store via `store.request()` will automatically have the `store` instance
|
|
24
|
+
* attached to the request.
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* requestManager.request({
|
|
28
|
+
* store: store,
|
|
29
|
+
* url: '/api/posts',
|
|
30
|
+
* method: 'GET'
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* When this handler elects to handle a request, it will return the raw `StructuredDocument`
|
|
35
|
+
* unless the request has `[EnableHydration]` set to `true`. In this case, the handler will
|
|
36
|
+
* return a `Document` instance that will automatically update the UI when the cache is updated
|
|
37
|
+
* in the future and will hydrate any identifiers in the StructuredDocument into Record instances.
|
|
38
|
+
*
|
|
39
|
+
* When issuing a request via the store, [EnableHydration] is automatically set to `true`. This
|
|
40
|
+
* means that if desired you can issue requests that utilize the cache without needing to also
|
|
41
|
+
* utilize Record instances if desired.
|
|
42
|
+
*
|
|
43
|
+
* Said differently, you could elect to issue all requests via a RequestManager, without ever using
|
|
44
|
+
* the store directly, by setting [EnableHydration] to `true` and providing a store instance. Not
|
|
45
|
+
* necessarily the most useful thing, but the decoupled nature of the RequestManager and incremental-feature
|
|
46
|
+
* approach of EmberData allows for this flexibility.
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { EnableHydration } from '@warp-drive/core-types/request';
|
|
50
|
+
*
|
|
51
|
+
* requestManager.request({
|
|
52
|
+
* store: store,
|
|
53
|
+
* url: '/api/posts',
|
|
54
|
+
* method: 'GET',
|
|
55
|
+
* [EnableHydration]: true
|
|
56
|
+
* });
|
|
57
|
+
*
|
|
58
|
+
* @typedoc
|
|
59
|
+
*/
|
|
60
|
+
export const CacheHandler: CacheHandlerType;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/-private/cache-handler/handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAI5F,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EAGf,MAAM,gCAAgC,CAAC;AAQxC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAGzF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAU9C,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,OAAO,EAAE,EAAE,GAAG,OAAO,IAAI,IAAI,CACjE,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC3B,SAAS,GAAG,SAAS,CACtB,GAAG;IACF,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,EAAE,EAAE,GAAG,OAAO,IAAI,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,qBAAqB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAEtH,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,OAAO,EAAE,oBAAoB,GAAG;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,YAAY,EAAE,gBA0E1B,CAAC"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/cache-handler' {
|
|
2
|
-
/**
|
|
3
|
-
* @module @ember-data/store
|
|
4
|
-
*/
|
|
5
|
-
import type { CacheHandler as CacheHandlerType } from '@ember-data/request';
|
|
1
|
+
declare module '@ember-data/store/-private/cache-handler/types' {
|
|
6
2
|
import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
|
|
7
|
-
import type { ImmutableRequestInfo,
|
|
8
|
-
import { EnableHydration } from '@warp-drive/core-types/request';
|
|
9
|
-
import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';
|
|
3
|
+
import type { ImmutableRequestInfo, ResponseInfo } from '@warp-drive/core-types/request';
|
|
10
4
|
import type { Store } from '@ember-data/store/-private/store-service';
|
|
11
5
|
/**
|
|
12
6
|
* A service which an application may provide to the store via
|
|
@@ -77,6 +71,28 @@ declare module '@ember-data/store/-private/cache-handler' {
|
|
|
77
71
|
*
|
|
78
72
|
* Note, this is invoked regardless of whether the request has a cache-key.
|
|
79
73
|
*
|
|
74
|
+
* It is best practice to notify the store of any requests marked as invalidated
|
|
75
|
+
* so that request subscriptions can reload when needed.
|
|
76
|
+
*
|
|
77
|
+
* ```ts
|
|
78
|
+
* store.notifications.notify(identifier, 'invalidated');
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* This allows anything subscribed to the request to be notified of the change
|
|
82
|
+
*
|
|
83
|
+
* e.g.
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* store.notifications.subscribe(identifier, (_, type) => {
|
|
87
|
+
* if (type === 'invalidated') {
|
|
88
|
+
* // do update
|
|
89
|
+
* }
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* Note,
|
|
94
|
+
*
|
|
95
|
+
*
|
|
80
96
|
* @method didRequest [Optional]
|
|
81
97
|
* @public
|
|
82
98
|
* @param {ImmutableRequestInfo} request
|
|
@@ -87,58 +103,5 @@ declare module '@ember-data/store/-private/cache-handler' {
|
|
|
87
103
|
*/
|
|
88
104
|
didRequest?(request: ImmutableRequestInfo, response: Response | ResponseInfo | null, identifier: StableDocumentIdentifier | null, store: Store): void;
|
|
89
105
|
}
|
|
90
|
-
export type LooseStoreRequestInfo<T = unknown, RT = unknown> = Omit<ImmutableRequestInfo<T, RT>, 'records' | 'headers'> & {
|
|
91
|
-
records?: ResourceIdentifierObject[];
|
|
92
|
-
headers?: Headers;
|
|
93
|
-
};
|
|
94
|
-
export type StoreRequestInput<T = unknown, RT = unknown> = ImmutableRequestInfo<T, RT> | LooseStoreRequestInfo<T, RT>;
|
|
95
|
-
export interface StoreRequestContext extends RequestContext {
|
|
96
|
-
request: ImmutableRequestInfo & {
|
|
97
|
-
store: Store;
|
|
98
|
-
[EnableHydration]?: boolean;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* A CacheHandler that adds support for using an EmberData Cache with a RequestManager.
|
|
103
|
-
*
|
|
104
|
-
* This handler will only run when a request has supplied a `store` instance. Requests
|
|
105
|
-
* issued by the store via `store.request()` will automatically have the `store` instance
|
|
106
|
-
* attached to the request.
|
|
107
|
-
*
|
|
108
|
-
* ```ts
|
|
109
|
-
* requestManager.request({
|
|
110
|
-
* store: store,
|
|
111
|
-
* url: '/api/posts',
|
|
112
|
-
* method: 'GET'
|
|
113
|
-
* });
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* When this handler elects to handle a request, it will return the raw `StructuredDocument`
|
|
117
|
-
* unless the request has `[EnableHydration]` set to `true`. In this case, the handler will
|
|
118
|
-
* return a `Document` instance that will automatically update the UI when the cache is updated
|
|
119
|
-
* in the future and will hydrate any identifiers in the StructuredDocument into Record instances.
|
|
120
|
-
*
|
|
121
|
-
* When issuing a request via the store, [EnableHydration] is automatically set to `true`. This
|
|
122
|
-
* means that if desired you can issue requests that utilize the cache without needing to also
|
|
123
|
-
* utilize Record instances if desired.
|
|
124
|
-
*
|
|
125
|
-
* Said differently, you could elect to issue all requests via a RequestManager, without ever using
|
|
126
|
-
* the store directly, by setting [EnableHydration] to `true` and providing a store instance. Not
|
|
127
|
-
* necessarily the most useful thing, but the decoupled nature of the RequestManager and incremental-feature
|
|
128
|
-
* approach of EmberData allows for this flexibility.
|
|
129
|
-
*
|
|
130
|
-
* ```ts
|
|
131
|
-
* import { EnableHydration } from '@warp-drive/core-types/request';
|
|
132
|
-
*
|
|
133
|
-
* requestManager.request({
|
|
134
|
-
* store: store,
|
|
135
|
-
* url: '/api/posts',
|
|
136
|
-
* method: 'GET',
|
|
137
|
-
* [EnableHydration]: true
|
|
138
|
-
* });
|
|
139
|
-
*
|
|
140
|
-
* @typedoc
|
|
141
|
-
*/
|
|
142
|
-
export const CacheHandler: CacheHandlerType;
|
|
143
106
|
}
|
|
144
|
-
//# sourceMappingURL=
|
|
107
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+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Q,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,8 +1,12 @@
|
|
|
1
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';
|
|
2
|
+
import { type Identifier, type RecordIdentifier, type StableDocumentIdentifier, type StableExistingRecordIdentifier, type StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
3
|
import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
|
|
4
|
-
import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';
|
|
4
|
+
import type { ExistingResourceIdentifierObject, ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';
|
|
5
5
|
import type { ForgetMethod, GenerationMethod, KeyInfo, KeyInfoMethod, ResetMethod, UpdateMethod } from '@ember-data/store/-types/q/identifier';
|
|
6
|
+
type TypeFromIdentifier<T> = T extends {
|
|
7
|
+
type: infer U;
|
|
8
|
+
} ? U : string;
|
|
9
|
+
type NarrowIdentifierIfPossible<T> = T extends ExistingResourceIdentifierObject ? StableExistingRecordIdentifier<TypeFromIdentifier<T>> : StableRecordIdentifier;
|
|
6
10
|
export function isStableIdentifier(identifier: unknown): identifier is StableRecordIdentifier;
|
|
7
11
|
export function isDocumentIdentifier(identifier: unknown): identifier is StableDocumentIdentifier;
|
|
8
12
|
interface KeyOptions {
|
|
@@ -110,7 +114,7 @@ declare module '@ember-data/store/-private/caches/identifier-cache' {
|
|
|
110
114
|
@return {StableRecordIdentifier}
|
|
111
115
|
@public
|
|
112
116
|
*/
|
|
113
|
-
getOrCreateRecordIdentifier(resource:
|
|
117
|
+
getOrCreateRecordIdentifier<T>(resource: T): NarrowIdentifierIfPossible<T>;
|
|
114
118
|
/**
|
|
115
119
|
Returns a new Identifier for the supplied data. Call this method to generate
|
|
116
120
|
an identifier when a new resource is being created local to the client and
|
|
@@ -1 +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,
|
|
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,EAC7B,KAAK,8BAA8B,EAEnC,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EACV,gCAAgC,EAEhC,wBAAwB,EACzB,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACb,MAAM,2BAA2B,CAAC;AAQnC,KAA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,wBAAwB,GAAG,IAAI;IAyB7F;;;;;;;;;;;;;;MAcE;IACF,2BAA2B,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,0BAA0B,CAAC,CAAC,CAAC;IAI1E;;;;;;;;;;;;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;IA8BhE,OAAO;CAOR"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
declare module '@ember-data/store/-private/caches/instance-cache' {
|
|
2
2
|
import type { Cache } from '@warp-drive/core-types/cache';
|
|
3
|
-
import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
|
+
import type { StableDocumentIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
4
4
|
import type { Value } from '@warp-drive/core-types/json/raw';
|
|
5
5
|
import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
|
|
6
6
|
import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
|
|
7
|
+
import { ReactiveDocument } from '@ember-data/store/-private/document';
|
|
7
8
|
import RecordReference from '@ember-data/store/-private/legacy-model-support/record-reference';
|
|
8
9
|
import { CacheCapabilitiesManager } from '@ember-data/store/-private/managers/cache-capabilities-manager';
|
|
9
10
|
import type { CacheManager } from '@ember-data/store/-private/managers/cache-manager';
|
|
@@ -36,6 +37,7 @@ declare module '@ember-data/store/-private/caches/instance-cache' {
|
|
|
36
37
|
type Caches = {
|
|
37
38
|
record: Map<StableRecordIdentifier, OpaqueRecordInstance>;
|
|
38
39
|
reference: WeakMap<StableRecordIdentifier, RecordReference>;
|
|
40
|
+
document: Map<StableDocumentIdentifier, ReactiveDocument<OpaqueRecordInstance | OpaqueRecordInstance[] | null | undefined>>;
|
|
39
41
|
};
|
|
40
42
|
export class InstanceCache {
|
|
41
43
|
store: Store;
|
|
@@ -45,6 +47,7 @@ declare module '@ember-data/store/-private/caches/instance-cache' {
|
|
|
45
47
|
__instances: Caches;
|
|
46
48
|
constructor(store: Store);
|
|
47
49
|
peek(identifier: StableRecordIdentifier): Cache | OpaqueRecordInstance | undefined;
|
|
50
|
+
getDocument<T>(identifier: StableDocumentIdentifier): ReactiveDocument<T>;
|
|
48
51
|
getRecord(identifier: StableRecordIdentifier, properties?: CreateRecordProperties): OpaqueRecordInstance;
|
|
49
52
|
getReference(identifier: StableRecordIdentifier): RecordReference;
|
|
50
53
|
recordIsLoaded(identifier: StableRecordIdentifier, filterDeleted?: boolean): boolean;
|
|
@@ -1 +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;
|
|
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,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC1G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iC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,CAAC;CACH,CAAC;AAEF,qBAAa,aAAa;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,wBAAwB,CAAC;IAExC,cAAc,EAAE,YAAY,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;gBAEhB,KAAK,EAAE,KAAK;IAuExB,IAAI,CAAC,UAAU,EAAE,sBAAsB,GAAG,KAAK,GAAG,oBAAoB,GAAG,SAAS;IAIlF,WAAW,CAAC,CAAC,EAAE,UAAU,EAAE,wBAAwB,GAAG,gBAAgB,CAAC,CAAC,CAAC;IASzE,SAAS,CAAC,UAAU,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAE,sBAAsB,GAAG,oBAAoB;IA8BxG,YAAY,CAAC,UAAU,EAAE,sBAAsB;IAW/C,cAAc,CAAC,UAAU,EAAE,sBAAsB,EAAE,aAAa,UAAQ;IAsBxE,UAAU,CAAC,UAAU,EAAE,sBAAsB;IAiB7C,YAAY,CAAC,UAAU,EAAE,sBAAsB;IAuD/C,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM;IAuBnB,WAAW,CAAC,UAAU,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM;CA+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,9 @@
|
|
|
1
|
+
declare module '@ember-data/store/-private/debug/utils' {
|
|
2
|
+
export function logGroup(scope: 'cache', prefix: string, type: string, lid: string, bucket: string, key: string): void;
|
|
3
|
+
export function logGroup(scope: 'reactive-ui', prefix: string, type: string, lid: string, bucket: string, key: ''): void;
|
|
4
|
+
export function logGroup(scope: 'notify', prefix: string, type: string, lid: string, bucket: string, key: string): void;
|
|
5
|
+
export function log(scope: 'cache', prefix: string, type: string, lid: string, bucket: string, key: string): void;
|
|
6
|
+
export function log(scope: 'reactive-ui', prefix: string, type: string, lid: string, bucket: string, key: ''): void;
|
|
7
|
+
export function log(scope: 'notify', prefix: string, type: string, lid: string, bucket: string, key: string): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/-private/debug/utils.ts"],"names":[],"mappings":"AAiEA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;AACvH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,EAAE,GACN,IAAI,CAAC;AACR,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;AAaxH,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;AAClH,wBAAgB,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;AACpH,wBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare module '@ember-data/store/-private/document' {
|
|
2
2
|
import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
|
-
import type { RequestInfo } from '@warp-drive/core-types/request';
|
|
3
|
+
import type { ImmutableRequestInfo, RequestInfo } from '@warp-drive/core-types/request';
|
|
4
|
+
import type { ResourceDocument } from '@warp-drive/core-types/spec/document';
|
|
4
5
|
import type { Meta, PaginationLinks } from '@warp-drive/core-types/spec/json-api-raw';
|
|
5
6
|
import type { Store } from '@ember-data/store/-private/store-service';
|
|
6
7
|
/**
|
|
@@ -13,9 +14,9 @@ declare module '@ember-data/store/-private/document' {
|
|
|
13
14
|
* determined by the record instance itself.
|
|
14
15
|
*
|
|
15
16
|
* @public
|
|
16
|
-
* @class
|
|
17
|
+
* @class ReactiveDocument
|
|
17
18
|
*/
|
|
18
|
-
export class
|
|
19
|
+
export class ReactiveDocument<T> {
|
|
19
20
|
#private;
|
|
20
21
|
/**
|
|
21
22
|
* The links object for this document, if any
|
|
@@ -32,7 +33,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
32
33
|
* @type {object|undefined} - a links object
|
|
33
34
|
* @public
|
|
34
35
|
*/
|
|
35
|
-
links?: PaginationLinks;
|
|
36
|
+
readonly links?: PaginationLinks;
|
|
36
37
|
/**
|
|
37
38
|
* The primary data for this document, if any.
|
|
38
39
|
*
|
|
@@ -46,7 +47,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
46
47
|
* @public
|
|
47
48
|
* @type {object|Array<object>|null|undefined} - a data object
|
|
48
49
|
*/
|
|
49
|
-
data?: T;
|
|
50
|
+
readonly data?: T;
|
|
50
51
|
/**
|
|
51
52
|
* The errors returned by the API for this request, if any
|
|
52
53
|
*
|
|
@@ -54,7 +55,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
54
55
|
* @public
|
|
55
56
|
* @type {object|undefined} - an errors object
|
|
56
57
|
*/
|
|
57
|
-
errors?: object[];
|
|
58
|
+
readonly errors?: object[];
|
|
58
59
|
/**
|
|
59
60
|
* The meta object for this document, if any
|
|
60
61
|
*
|
|
@@ -62,7 +63,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
62
63
|
* @public
|
|
63
64
|
* @type {object|undefined} - a meta object
|
|
64
65
|
*/
|
|
65
|
-
meta?: Meta;
|
|
66
|
+
readonly meta?: Meta;
|
|
66
67
|
/**
|
|
67
68
|
* The identifier associated with this document, if any
|
|
68
69
|
*
|
|
@@ -70,8 +71,16 @@ declare module '@ember-data/store/-private/document' {
|
|
|
70
71
|
* @public
|
|
71
72
|
* @type {StableDocumentIdentifier|null}
|
|
72
73
|
*/
|
|
73
|
-
identifier: StableDocumentIdentifier | null;
|
|
74
|
-
|
|
74
|
+
readonly identifier: StableDocumentIdentifier | null;
|
|
75
|
+
protected readonly _store: Store;
|
|
76
|
+
protected readonly _localCache: {
|
|
77
|
+
document: ResourceDocument;
|
|
78
|
+
request: ImmutableRequestInfo;
|
|
79
|
+
} | null;
|
|
80
|
+
constructor(store: Store, identifier: StableDocumentIdentifier | null, localCache: {
|
|
81
|
+
document: ResourceDocument;
|
|
82
|
+
request: ImmutableRequestInfo;
|
|
83
|
+
} | null);
|
|
75
84
|
/**
|
|
76
85
|
* Fetches the related link for this document, returning a promise that resolves
|
|
77
86
|
* with the document when the request completes. If no related link is present,
|
|
@@ -82,7 +91,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
82
91
|
* @param {object} options
|
|
83
92
|
* @return Promise<Document>
|
|
84
93
|
*/
|
|
85
|
-
fetch(options?: Partial<RequestInfo<T,
|
|
94
|
+
fetch(options?: Partial<RequestInfo<T, ReactiveDocument<T>>>): Promise<ReactiveDocument<T>>;
|
|
86
95
|
/**
|
|
87
96
|
* Fetches the next link for this document, returning a promise that resolves
|
|
88
97
|
* with the new document when the request completes, or null if there is no
|
|
@@ -93,7 +102,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
93
102
|
* @param {object} options
|
|
94
103
|
* @return Promise<Document | null>
|
|
95
104
|
*/
|
|
96
|
-
next(options?: Partial<RequestInfo<T,
|
|
105
|
+
next(options?: Partial<RequestInfo<T, ReactiveDocument<T>>>): Promise<ReactiveDocument<T> | null>;
|
|
97
106
|
/**
|
|
98
107
|
* Fetches the prev link for this document, returning a promise that resolves
|
|
99
108
|
* with the new document when the request completes, or null if there is no
|
|
@@ -104,7 +113,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
104
113
|
* @param {object} options
|
|
105
114
|
* @return Promise<Document | null>
|
|
106
115
|
*/
|
|
107
|
-
prev(options?: Partial<RequestInfo<T,
|
|
116
|
+
prev(options?: Partial<RequestInfo<T, ReactiveDocument<T>>>): Promise<ReactiveDocument<T> | null>;
|
|
108
117
|
/**
|
|
109
118
|
* Fetches the first link for this document, returning a promise that resolves
|
|
110
119
|
* with the new document when the request completes, or null if there is no
|
|
@@ -115,7 +124,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
115
124
|
* @param {object} options
|
|
116
125
|
* @return Promise<Document | null>
|
|
117
126
|
*/
|
|
118
|
-
first(options?: Partial<RequestInfo<T,
|
|
127
|
+
first(options?: Partial<RequestInfo<T, ReactiveDocument<T>>>): Promise<ReactiveDocument<T> | null>;
|
|
119
128
|
/**
|
|
120
129
|
* Fetches the last link for this document, returning a promise that resolves
|
|
121
130
|
* with the new document when the request completes, or null if there is no
|
|
@@ -126,7 +135,7 @@ declare module '@ember-data/store/-private/document' {
|
|
|
126
135
|
* @param {object} options
|
|
127
136
|
* @return Promise<Document | null>
|
|
128
137
|
*/
|
|
129
|
-
last(options?: Partial<RequestInfo<T,
|
|
138
|
+
last(options?: Partial<RequestInfo<T, ReactiveDocument<T>>>): Promise<ReactiveDocument<T> | null>;
|
|
130
139
|
/**
|
|
131
140
|
* Implemented for `JSON.stringify` support.
|
|
132
141
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/-private/document.ts"],"names":[],"mappings":"
|
|
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,oBAAoB,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,KAAK,EAAkC,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7G,OAAO,KAAK,EAAQ,IAAI,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAI5F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAO7C;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAgB,CAAC,CAAC;;IAC7B;;;;;;;;;;;;;;OAcG;IACH,SAAiB,KAAK,CAAC,EAAE,eAAe,CAAC;IACzC;;;;;;;;;;;;OAYG;IACH,SAAiB,IAAI,CAAC,EAAE,CAAC,CAAC;IAE1B;;;;;;OAMG;IACH,SAAiB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnC;;;;;;OAMG;IACH,SAAiB,IAAI,CAAC,EAAE,IAAI,CAAC;IAE7B;;;;;;OAMG;IACH,SAAiB,UAAU,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAE7D,mBAA2B,MAAM,EAAE,KAAK,CAAC;IACzC,mBAA2B,WAAW,EAAE;QAAE,QAAQ,EAAE,gBAAgB,CAAC;QAAC,OAAO,EAAE,oBAAoB,CAAA;KAAE,GAAG,IAAI,CA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../../../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;
|
|
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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare module '@ember-data/store/-private/legacy-model-support/shim-model-class' {
|
|
2
2
|
import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
|
|
3
|
-
import type { LegacyAttributeField,
|
|
3
|
+
import type { LegacyAttributeField, LegacyRelationshipField } from '@warp-drive/core-types/schema/fields';
|
|
4
4
|
import type { KeyOrString, ModelSchema } from '@ember-data/store/-types/q/ds-model';
|
|
5
5
|
import type { Store } from '@ember-data/store/-private/store-service';
|
|
6
6
|
export function getShimClass<T>(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string): ShimModelClass<T>;
|
|
@@ -10,9 +10,9 @@ declare module '@ember-data/store/-private/legacy-model-support/shim-model-class
|
|
|
10
10
|
constructor(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string);
|
|
11
11
|
get fields(): Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'>;
|
|
12
12
|
get attributes(): Map<KeyOrString<T>, LegacyAttributeField>;
|
|
13
|
-
get relationshipsByName(): Map<KeyOrString<T>,
|
|
13
|
+
get relationshipsByName(): Map<KeyOrString<T>, LegacyRelationshipField>;
|
|
14
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:
|
|
15
|
+
eachRelationship<K extends KeyOrString<T>>(callback: (key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
|
|
16
16
|
eachTransformedAttribute<K extends KeyOrString<T>>(callback: (key: K, type: string | null) => void, binding?: T): void;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"shim-model-class.d.ts","sourceRoot":"","sources":["../../../src/-private/legacy-model-support/shim-model-class.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE1G,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAM9C,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM,GACtE,cAAc,CAAC,CAAC,CAAC,CAcnB;AAGD,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,CAAC,GAAG,OAAO,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC;IAChE,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;gBACpE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM;IAKjG,IAAI,MAAM,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC,CAWvE;IAED,IAAI,UAAU,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAW1D;IAED,IAAI,mBAAmB,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAWtE;IAED,aAAa,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,oBAAoB,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;IAQhH,gBAAgB,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EACvC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,uBAAuB,KAAK,IAAI,EACjE,OAAO,CAAC,EAAE,CAAC;IASb,wBAAwB,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;CAQhH"}
|
|
@@ -19,9 +19,9 @@ declare module '@ember-data/store/-private/managers/cache-capabilities-manager'
|
|
|
19
19
|
get identifierCache(): IdentifierCache;
|
|
20
20
|
_scheduleNotification(identifier: StableRecordIdentifier, key: string): void;
|
|
21
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
|
|
22
|
+
notifyChange(identifier: StableRecordIdentifier, namespace: 'added' | 'removed', key: null): void;
|
|
23
|
+
notifyChange(identifier: StableDocumentIdentifier, namespace: 'added' | 'updated' | 'removed', key: null): void;
|
|
24
|
+
notifyChange(identifier: StableRecordIdentifier, namespace: NotificationType, key: string | null): void;
|
|
25
25
|
get schema(): SchemaService;
|
|
26
26
|
setRecordId(identifier: StableRecordIdentifier, id: string): void;
|
|
27
27
|
hasRecord(identifier: StableRecordIdentifier): boolean;
|
|
@@ -1 +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,K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ACjG,YAAY,CAAC,UAAU,EAAE,wBAAwB,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI;IAC/G,YAAY,CAAC,UAAU,EAAE,sBAAsB,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAkBvG,IAAI,MAAM,kBAET;IAED,WAAW,CAAC,UAAU,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM;IAK1D,SAAS,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO;IAItD,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,GAAG,IAAI;CAK3D"}
|
|
@@ -9,7 +9,7 @@ declare module '@ember-data/store/-private/managers/cache-manager' {
|
|
|
9
9
|
import type { StructuredDataDocument, StructuredDocument } from '@warp-drive/core-types/request';
|
|
10
10
|
import type { ResourceDocument, SingleResourceDataDocument } from '@warp-drive/core-types/spec/document';
|
|
11
11
|
import type { ApiError } from '@warp-drive/core-types/spec/error';
|
|
12
|
-
import type { StoreRequestContext } from '@ember-data/store/-private/cache-handler';
|
|
12
|
+
import type { StoreRequestContext } from '@ember-data/store/-private/cache-handler/handler';
|
|
13
13
|
/**
|
|
14
14
|
* The CacheManager wraps a Cache enforcing that only
|
|
15
15
|
* the public API surface area is exposed.
|
|
@@ -113,6 +113,8 @@ declare module '@ember-data/store/-private/managers/cache-manager' {
|
|
|
113
113
|
*/
|
|
114
114
|
peek(identifier: StableRecordIdentifier): unknown;
|
|
115
115
|
peek(identifier: StableDocumentIdentifier): ResourceDocument | null;
|
|
116
|
+
peekRemoteState(identifier: StableRecordIdentifier): unknown;
|
|
117
|
+
peekRemoteState(identifier: StableDocumentIdentifier): ResourceDocument | null;
|
|
116
118
|
/**
|
|
117
119
|
* Peek the Cache for the existing request data associated with
|
|
118
120
|
* a cacheable request
|
|
@@ -281,6 +283,16 @@ declare module '@ember-data/store/-private/managers/cache-manager' {
|
|
|
281
283
|
* @return {unknown}
|
|
282
284
|
*/
|
|
283
285
|
getAttr(identifier: StableRecordIdentifier, propertyName: string): Value | undefined;
|
|
286
|
+
/**
|
|
287
|
+
* Retrieve the remote state for an attribute from the cache
|
|
288
|
+
*
|
|
289
|
+
* @method getRemoteAttr
|
|
290
|
+
* @public
|
|
291
|
+
* @param identifier
|
|
292
|
+
* @param propertyName
|
|
293
|
+
* @return {unknown}
|
|
294
|
+
*/
|
|
295
|
+
getRemoteAttr(identifier: StableRecordIdentifier, propertyName: string): Value | undefined;
|
|
284
296
|
/**
|
|
285
297
|
* Mutate the data for an attribute in the cache
|
|
286
298
|
*
|
|
@@ -378,6 +390,16 @@ declare module '@ember-data/store/-private/managers/cache-manager' {
|
|
|
378
390
|
* @return resource relationship object
|
|
379
391
|
*/
|
|
380
392
|
getRelationship(identifier: StableRecordIdentifier, propertyName: string): ResourceRelationship | CollectionRelationship;
|
|
393
|
+
/**
|
|
394
|
+
* Query the cache for the remote state of a relationship property
|
|
395
|
+
*
|
|
396
|
+
* @method getRelationship
|
|
397
|
+
* @public
|
|
398
|
+
* @param identifier
|
|
399
|
+
* @param propertyName
|
|
400
|
+
* @return resource relationship object
|
|
401
|
+
*/
|
|
402
|
+
getRemoteRelationship(identifier: StableRecordIdentifier, propertyName: string): ResourceRelationship | CollectionRelationship;
|
|
381
403
|
/**
|
|
382
404
|
* Update the cache state for the given resource to be marked as locally deleted,
|
|
383
405
|
* or remove such a mark.
|