@warp-drive/core 5.6.0-alpha.15 → 5.6.0-alpha.18
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/declarations/build-config/babel-macros.d.ts +1 -2
- package/declarations/build-config/canary-features.d.ts +1 -2
- package/declarations/build-config/debugging.d.ts +1 -2
- package/declarations/build-config/deprecations.d.ts +1 -2
- package/declarations/build-config/env.d.ts +1 -2
- package/declarations/build-config/macros.d.ts +1 -2
- package/declarations/build-config.d.ts +1 -2
- package/declarations/configure.d.ts +6 -7
- package/declarations/graph/-private/-diff.d.ts +21 -22
- package/declarations/graph/-private/-edge-definition.d.ts +134 -135
- package/declarations/graph/-private/-state.d.ts +93 -7
- package/declarations/graph/-private/-utils.d.ts +18 -13
- package/declarations/graph/-private/coerce-id.d.ts +6 -1
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +15 -4
- package/declarations/graph/-private/edges/collection.d.ts +35 -36
- package/declarations/graph/-private/edges/implicit.d.ts +28 -29
- package/declarations/graph/-private/edges/resource.d.ts +19 -20
- package/declarations/graph/-private/graph.d.ts +83 -48
- package/declarations/graph/-private/normalize-link.d.ts +7 -2
- package/declarations/graph/-private/operations/add-to-related-records.d.ts +3 -4
- package/declarations/graph/-private/operations/merge-identifier.d.ts +2 -3
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts +3 -4
- package/declarations/graph/-private/operations/replace-related-record.d.ts +2 -3
- package/declarations/graph/-private/operations/replace-related-records.d.ts +58 -4
- package/declarations/graph/-private/operations/update-relationship.d.ts +11 -9
- package/declarations/graph/-private.d.ts +9 -10
- package/declarations/index.d.ts +11 -12
- package/declarations/reactive/-private/document.d.ts +143 -144
- package/declarations/reactive/-private/fields/compute.d.ts +31 -28
- package/declarations/reactive/-private/fields/extension.d.ts +2 -3
- package/declarations/reactive/-private/fields/managed-array.d.ts +19 -20
- package/declarations/reactive/-private/fields/managed-object.d.ts +16 -16
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +15 -16
- package/declarations/reactive/-private/hooks.d.ts +3 -4
- package/declarations/reactive/-private/record.d.ts +61 -59
- package/declarations/reactive/-private/schema.d.ts +242 -224
- package/declarations/reactive/-private/symbols.d.ts +26 -1
- package/declarations/reactive/-private.d.ts +1 -2
- package/declarations/reactive.d.ts +4 -5
- package/declarations/request/-private/context.d.ts +34 -35
- package/declarations/request/-private/debug.d.ts +2 -3
- package/declarations/request/-private/fetch.d.ts +23 -24
- package/declarations/request/-private/future.d.ts +3 -4
- package/declarations/request/-private/manager.d.ts +159 -157
- package/declarations/request/-private/promise-cache.d.ts +21 -13
- package/declarations/request/-private/types.d.ts +124 -124
- package/declarations/request/-private/utils.d.ts +8 -9
- package/declarations/request.d.ts +5 -6
- package/declarations/store/-private/cache-handler/handler.d.ts +57 -52
- package/declarations/store/-private/cache-handler/types.d.ts +95 -96
- package/declarations/store/-private/cache-handler/utils.d.ts +16 -16
- package/declarations/store/-private/caches/cache-utils.d.ts +7 -4
- package/declarations/store/-private/caches/identifier-cache.d.ts +234 -246
- package/declarations/store/-private/caches/instance-cache.d.ts +47 -47
- package/declarations/store/-private/caches/resource-utils.d.ts +3 -4
- package/declarations/store/-private/debug/utils.d.ts +6 -7
- package/declarations/store/-private/default-cache-policy.d.ts +362 -361
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts +154 -159
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +14 -14
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +21 -22
- package/declarations/store/-private/managers/cache-manager.d.ts +440 -425
- package/declarations/store/-private/managers/notification-manager.d.ts +88 -83
- package/declarations/store/-private/managers/record-array-manager.d.ts +89 -90
- package/declarations/store/-private/network/request-cache.d.ts +86 -83
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts +252 -244
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +154 -155
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +148 -149
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +28 -23
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +263 -241
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +253 -223
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +125 -121
- package/declarations/store/-private/record-arrays/many-array.d.ts +180 -184
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +120 -110
- package/declarations/store/-private/store-service.d.ts +1594 -1586
- package/declarations/store/-private/utils/coerce-id.d.ts +6 -1
- package/declarations/store/-private/utils/construct-resource.d.ts +1 -2
- package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/declarations/store/-private.d.ts +31 -28
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +96 -97
- package/declarations/store/-types/q/ds-model.d.ts +17 -18
- package/declarations/store/-types/q/identifier.d.ts +11 -12
- package/declarations/store/-types/q/record-instance.d.ts +16 -17
- package/declarations/store/-types/q/schema-service.d.ts +346 -343
- package/declarations/store/-types/q/store.d.ts +25 -28
- package/declarations/store.d.ts +1 -2
- package/declarations/types/-private.d.ts +16 -8
- package/declarations/types/cache/aliases.d.ts +11 -1
- package/declarations/types/cache/change.d.ts +4 -5
- package/declarations/types/cache/mutations.d.ts +51 -28
- package/declarations/types/cache/operations.d.ts +60 -47
- package/declarations/types/cache/relationship.d.ts +11 -9
- package/declarations/types/cache.d.ts +495 -484
- package/declarations/types/graph.d.ts +31 -32
- package/declarations/types/identifier.d.ts +83 -82
- package/declarations/types/json/raw.d.ts +1 -2
- package/declarations/types/params.d.ts +4 -5
- package/declarations/types/record.d.ts +117 -76
- package/declarations/types/request.d.ts +289 -266
- package/declarations/types/runtime.d.ts +8 -9
- package/declarations/types/schema/concepts.d.ts +19 -13
- package/declarations/types/schema/fields.d.ts +1712 -1713
- package/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/declarations/types/spec/document.d.ts +28 -22
- package/declarations/types/spec/error.d.ts +16 -17
- package/declarations/types/spec/json-api-raw.d.ts +102 -102
- package/declarations/types/symbols.d.ts +74 -75
- package/declarations/types/utils.d.ts +5 -5
- package/declarations/types.d.ts +10 -11
- package/declarations/utils/string.d.ts +43 -40
- package/dist/graph/-private.js +1 -1
- package/dist/{handler-D1C3Innj.js → handler-C2T-IyJK.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.js +42 -73
- package/dist/{request-state-CCOJIj5i.js → request-state-CjLph1LP.js} +275 -261
- package/dist/store/-private.js +2 -2
- package/dist/{symbols-epHW0Vm9.js → symbols-SIstXMLI.js} +1 -1
- package/dist/types/-private.js +1 -1
- package/package.json +4 -4
- package/declarations/build-config/babel-macros.d.ts.map +0 -1
- package/declarations/build-config/canary-features.d.ts.map +0 -1
- package/declarations/build-config/debugging.d.ts.map +0 -1
- package/declarations/build-config/deprecations.d.ts.map +0 -1
- package/declarations/build-config/env.d.ts.map +0 -1
- package/declarations/build-config/macros.d.ts.map +0 -1
- package/declarations/build-config.d.ts.map +0 -1
- package/declarations/configure.d.ts.map +0 -1
- package/declarations/graph/-private/-diff.d.ts.map +0 -1
- package/declarations/graph/-private/-edge-definition.d.ts.map +0 -1
- package/declarations/graph/-private/-state.d.ts.map +0 -1
- package/declarations/graph/-private/-utils.d.ts.map +0 -1
- package/declarations/graph/-private/coerce-id.d.ts.map +0 -1
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts.map +0 -1
- package/declarations/graph/-private/edges/collection.d.ts.map +0 -1
- package/declarations/graph/-private/edges/implicit.d.ts.map +0 -1
- package/declarations/graph/-private/edges/resource.d.ts.map +0 -1
- package/declarations/graph/-private/graph.d.ts.map +0 -1
- package/declarations/graph/-private/normalize-link.d.ts.map +0 -1
- package/declarations/graph/-private/operations/add-to-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/merge-identifier.d.ts.map +0 -1
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/replace-related-record.d.ts.map +0 -1
- package/declarations/graph/-private/operations/replace-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/update-relationship.d.ts.map +0 -1
- package/declarations/graph/-private.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/reactive/-private/document.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/compute.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/extension.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/managed-array.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/managed-object.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/many-array-manager.d.ts.map +0 -1
- package/declarations/reactive/-private/hooks.d.ts.map +0 -1
- package/declarations/reactive/-private/record.d.ts.map +0 -1
- package/declarations/reactive/-private/schema.d.ts.map +0 -1
- package/declarations/reactive/-private/symbols.d.ts.map +0 -1
- package/declarations/reactive/-private.d.ts.map +0 -1
- package/declarations/reactive.d.ts.map +0 -1
- package/declarations/request/-private/context.d.ts.map +0 -1
- package/declarations/request/-private/debug.d.ts.map +0 -1
- package/declarations/request/-private/fetch.d.ts.map +0 -1
- package/declarations/request/-private/future.d.ts.map +0 -1
- package/declarations/request/-private/manager.d.ts.map +0 -1
- package/declarations/request/-private/promise-cache.d.ts.map +0 -1
- package/declarations/request/-private/types.d.ts.map +0 -1
- package/declarations/request/-private/utils.d.ts.map +0 -1
- package/declarations/request.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/handler.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/types.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/utils.d.ts.map +0 -1
- package/declarations/store/-private/caches/cache-utils.d.ts.map +0 -1
- package/declarations/store/-private/caches/identifier-cache.d.ts.map +0 -1
- package/declarations/store/-private/caches/instance-cache.d.ts.map +0 -1
- package/declarations/store/-private/caches/resource-utils.d.ts.map +0 -1
- package/declarations/store/-private/debug/utils.d.ts.map +0 -1
- package/declarations/store/-private/default-cache-policy.d.ts.map +0 -1
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts.map +0 -1
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/cache-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/notification-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/record-array-manager.d.ts.map +0 -1
- package/declarations/store/-private/network/request-cache.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/request-state.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/identifier-array.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/many-array.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
- package/declarations/store/-private/store-service.d.ts.map +0 -1
- package/declarations/store/-private/store-service.type-test.d.ts +0 -2
- package/declarations/store/-private/store-service.type-test.d.ts.map +0 -1
- package/declarations/store/-private/utils/coerce-id.d.ts.map +0 -1
- package/declarations/store/-private/utils/construct-resource.d.ts.map +0 -1
- package/declarations/store/-private/utils/is-non-empty-string.d.ts.map +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts.map +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts.map +0 -1
- package/declarations/store/-private.d.ts.map +0 -1
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts.map +0 -1
- package/declarations/store/-types/q/ds-model.d.ts.map +0 -1
- package/declarations/store/-types/q/identifier.d.ts.map +0 -1
- package/declarations/store/-types/q/promise-proxies.d.ts +0 -2
- package/declarations/store/-types/q/promise-proxies.d.ts.map +0 -1
- package/declarations/store/-types/q/record-data-json-api.d.ts +0 -31
- package/declarations/store/-types/q/record-data-json-api.d.ts.map +0 -1
- package/declarations/store/-types/q/record-instance.d.ts.map +0 -1
- package/declarations/store/-types/q/schema-service.d.ts.map +0 -1
- package/declarations/store/-types/q/store.d.ts.map +0 -1
- package/declarations/store.d.ts.map +0 -1
- package/declarations/types/-private.d.ts.map +0 -1
- package/declarations/types/cache/aliases.d.ts.map +0 -1
- package/declarations/types/cache/change.d.ts.map +0 -1
- package/declarations/types/cache/mutations.d.ts.map +0 -1
- package/declarations/types/cache/operations.d.ts.map +0 -1
- package/declarations/types/cache/relationship.d.ts.map +0 -1
- package/declarations/types/cache.d.ts.map +0 -1
- package/declarations/types/graph.d.ts.map +0 -1
- package/declarations/types/identifier.d.ts.map +0 -1
- package/declarations/types/json/raw.d.ts.map +0 -1
- package/declarations/types/params.d.ts.map +0 -1
- package/declarations/types/record.d.ts.map +0 -1
- package/declarations/types/record.type-test.d.ts +0 -2
- package/declarations/types/record.type-test.d.ts.map +0 -1
- package/declarations/types/request.d.ts.map +0 -1
- package/declarations/types/request.type-test.d.ts +0 -2
- package/declarations/types/request.type-test.d.ts.map +0 -1
- package/declarations/types/runtime.d.ts.map +0 -1
- package/declarations/types/schema/concepts.d.ts.map +0 -1
- package/declarations/types/schema/fields.d.ts.map +0 -1
- package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
- package/declarations/types/spec/document.d.ts.map +0 -1
- package/declarations/types/spec/error.d.ts.map +0 -1
- package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
- package/declarations/types/symbols.d.ts.map +0 -1
- package/declarations/types/utils.d.ts.map +0 -1
- package/declarations/types.d.ts.map +0 -1
- package/declarations/utils/string.d.ts.map +0 -1
- package/dist/build-config/babel-macros.js.map +0 -1
- package/dist/build-config/canary-features.js.map +0 -1
- package/dist/build-config/debugging.js.map +0 -1
- package/dist/build-config/deprecations.js.map +0 -1
- package/dist/build-config/env.js.map +0 -1
- package/dist/build-config/macros.js.map +0 -1
- package/dist/build-config.js.map +0 -1
- package/dist/configure-B48bFHOl.js.map +0 -1
- package/dist/configure.js.map +0 -1
- package/dist/context-COmAnXUQ.js.map +0 -1
- package/dist/graph/-private.js.map +0 -1
- package/dist/handler-D1C3Innj.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/reactive/-private.js.map +0 -1
- package/dist/reactive.js.map +0 -1
- package/dist/request-state-CCOJIj5i.js.map +0 -1
- package/dist/request.js.map +0 -1
- package/dist/store/-private.js.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/symbols-epHW0Vm9.js.map +0 -1
- package/dist/types/-private.js.map +0 -1
- package/dist/types/cache/aliases.js.map +0 -1
- package/dist/types/cache/change.js.map +0 -1
- package/dist/types/cache/mutations.js.map +0 -1
- package/dist/types/cache/operations.js.map +0 -1
- package/dist/types/cache/relationship.js.map +0 -1
- package/dist/types/cache.js.map +0 -1
- package/dist/types/graph.js.map +0 -1
- package/dist/types/identifier.js.map +0 -1
- package/dist/types/json/raw.js.map +0 -1
- package/dist/types/params.js.map +0 -1
- package/dist/types/record.js.map +0 -1
- package/dist/types/request.js.map +0 -1
- package/dist/types/runtime.js.map +0 -1
- package/dist/types/schema/concepts.js.map +0 -1
- package/dist/types/schema/fields.js.map +0 -1
- package/dist/types/schema/fields.type-test.js.map +0 -1
- package/dist/types/spec/document.js.map +0 -1
- package/dist/types/spec/error.js.map +0 -1
- package/dist/types/spec/json-api-raw.js.map +0 -1
- package/dist/types/symbols.js.map +0 -1
- package/dist/types/utils.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/string.js.map +0 -1
|
@@ -1,383 +1,384 @@
|
|
|
1
|
-
import type { Cache } from
|
|
2
|
-
import type { StableDocumentIdentifier, StableRecordIdentifier } from
|
|
3
|
-
import type { ImmutableRequestInfo, ResponseInfo, StructuredDocument } from
|
|
4
|
-
import type { ResourceDocument } from
|
|
1
|
+
import type { Cache } from "@warp-drive/core/types/cache";
|
|
2
|
+
import type { StableDocumentIdentifier, StableRecordIdentifier } from "@warp-drive/core/types/identifier";
|
|
3
|
+
import type { ImmutableRequestInfo, ResponseInfo, StructuredDocument } from "@warp-drive/core/types/request";
|
|
4
|
+
import type { ResourceDocument } from "@warp-drive/core/types/spec/document";
|
|
5
5
|
type UnsubscribeToken = object;
|
|
6
|
-
type CacheOperation =
|
|
7
|
-
type DocumentCacheOperation =
|
|
6
|
+
type CacheOperation = "added" | "removed" | "updated" | "state";
|
|
7
|
+
type DocumentCacheOperation = "invalidated" | "added" | "removed" | "updated" | "state";
|
|
8
8
|
export interface NotificationCallback {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
(identifier: StableRecordIdentifier, notificationType: "attributes" | "relationships", key?: string): void;
|
|
10
|
+
(identifier: StableRecordIdentifier, notificationType: "errors" | "meta" | "identity" | "state"): void;
|
|
11
11
|
}
|
|
12
12
|
interface ResourceOperationCallback {
|
|
13
|
-
|
|
13
|
+
// resource updates
|
|
14
|
+
(identifier: StableRecordIdentifier, notificationType: CacheOperation): void;
|
|
14
15
|
}
|
|
15
16
|
interface DocumentOperationCallback {
|
|
16
|
-
|
|
17
|
+
// document updates
|
|
18
|
+
(identifier: StableDocumentIdentifier, notificationType: DocumentCacheOperation): void;
|
|
17
19
|
}
|
|
18
20
|
type NotificationManager = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
subscribe(identifier: StableRecordIdentifier, callback: NotificationCallback): UnsubscribeToken;
|
|
22
|
+
subscribe(identifier: "resource", callback: ResourceOperationCallback): UnsubscribeToken;
|
|
23
|
+
subscribe(identifier: "document" | StableDocumentIdentifier, callback: DocumentOperationCallback): UnsubscribeToken;
|
|
24
|
+
notify(identifier: StableRecordIdentifier, value: "attributes" | "relationships", key?: string): boolean;
|
|
25
|
+
notify(identifier: StableRecordIdentifier, value: "errors" | "meta" | "identity" | "state"): boolean;
|
|
26
|
+
notify(identifier: StableRecordIdentifier, value: CacheOperation): boolean;
|
|
27
|
+
notify(identifier: StableDocumentIdentifier, value: DocumentCacheOperation): boolean;
|
|
26
28
|
};
|
|
27
29
|
type Store = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
cache: Cache;
|
|
31
|
+
notifications: NotificationManager;
|
|
30
32
|
};
|
|
31
33
|
export interface CacheControlValue {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
immutable?: boolean;
|
|
35
|
+
"max-age"?: number;
|
|
36
|
+
"must-revalidate"?: boolean;
|
|
37
|
+
"must-understand"?: boolean;
|
|
38
|
+
"no-cache"?: boolean;
|
|
39
|
+
"no-store"?: boolean;
|
|
40
|
+
"no-transform"?: boolean;
|
|
41
|
+
"only-if-cached"?: boolean;
|
|
42
|
+
private?: boolean;
|
|
43
|
+
"proxy-revalidate"?: boolean;
|
|
44
|
+
public?: boolean;
|
|
45
|
+
"s-maxage"?: number;
|
|
46
|
+
"stale-if-error"?: number;
|
|
47
|
+
"stale-while-revalidate"?: number;
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
50
|
+
* Parses a string Cache-Control header value into an object with the following structure:
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* interface CacheControlValue {
|
|
54
|
+
* immutable?: boolean;
|
|
55
|
+
* 'max-age'?: number;
|
|
56
|
+
* 'must-revalidate'?: boolean;
|
|
57
|
+
* 'must-understand'?: boolean;
|
|
58
|
+
* 'no-cache'?: boolean;
|
|
59
|
+
* 'no-store'?: boolean;
|
|
60
|
+
* 'no-transform'?: boolean;
|
|
61
|
+
* 'only-if-cached'?: boolean;
|
|
62
|
+
* private?: boolean;
|
|
63
|
+
* 'proxy-revalidate'?: boolean;
|
|
64
|
+
* public?: boolean;
|
|
65
|
+
* 's-maxage'?: number;
|
|
66
|
+
* 'stale-if-error'?: number;
|
|
67
|
+
* 'stale-while-revalidate'?: number;
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
* @param {String} header
|
|
73
|
+
* @return {CacheControlValue}
|
|
74
|
+
*/
|
|
73
75
|
export declare function parseCacheControl(header: string): CacheControlValue;
|
|
74
76
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
* The configuration options for the {@link DefaultCachePolicy}
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { DefaultCachePolicy } from '@warp-drive/core/store';
|
|
81
|
+
*
|
|
82
|
+
* new DefaultCachePolicy({
|
|
83
|
+
* // ... PolicyConfig Settings ... //
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
86
88
|
export type PolicyConfig = {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
89
|
+
/**
|
|
90
|
+
* the number of milliseconds after which a request is considered
|
|
91
|
+
* stale. If a request is issued again after this time, the request
|
|
92
|
+
* will respond from cache immediately while a background request
|
|
93
|
+
* is made to update the cache.
|
|
94
|
+
*
|
|
95
|
+
* This is calculated against the `date` header of the response.
|
|
96
|
+
*
|
|
97
|
+
* If your API does not provide a `date` header, the `Fetch` handler
|
|
98
|
+
* provided by `@warp-drive/core` will automatically add
|
|
99
|
+
* it to responses if it is not present. Responses without a `date`
|
|
100
|
+
* header will be considered stale immediately.
|
|
101
|
+
*
|
|
102
|
+
*/
|
|
103
|
+
apiCacheSoftExpires: number;
|
|
104
|
+
/**
|
|
105
|
+
* the number of milliseconds after which a request is considered
|
|
106
|
+
* expired and should be re-fetched. If a request is issued again
|
|
107
|
+
* after this time, the request will disregard the cache and
|
|
108
|
+
* wait for a fresh response from the API.
|
|
109
|
+
*
|
|
110
|
+
* This is calculated against the `date` header of the response.
|
|
111
|
+
*
|
|
112
|
+
* If your API does not provide a `date` header, the `Fetch` handler
|
|
113
|
+
* provided by `@warp-drive/core` will automatically add
|
|
114
|
+
* it to responses if it is not present. Responses without a `date`
|
|
115
|
+
* header will be considered hard expired immediately.
|
|
116
|
+
*
|
|
117
|
+
*/
|
|
118
|
+
apiCacheHardExpires: number;
|
|
119
|
+
/**
|
|
120
|
+
* In Testing environments, the `apiCacheSoftExpires` will always be `false`
|
|
121
|
+
* and `apiCacheHardExpires` will use the `apiCacheSoftExpires` value.
|
|
122
|
+
*
|
|
123
|
+
* This helps reduce flakiness and produce predictably rendered results in test suites.
|
|
124
|
+
*
|
|
125
|
+
* Requests that specifically set `cacheOptions.backgroundReload = true` will
|
|
126
|
+
* still be background reloaded in tests.
|
|
127
|
+
*
|
|
128
|
+
* This behavior can be opted out of by setting this value to `true`.
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
disableTestOptimization?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* In addition to the simple time-based expiration strategy, CachePolicy
|
|
134
|
+
* supports various common server-supplied expiration strategies via
|
|
135
|
+
* headers, as well as custom expiration strategies via the `isExpired`
|
|
136
|
+
* function.
|
|
137
|
+
*
|
|
138
|
+
* Requests will be validated for expiration against these constraints.
|
|
139
|
+
* If any of these constraints are not met, the request will be considered
|
|
140
|
+
* expired. If all constraints are met, the request will be considered
|
|
141
|
+
* valid and the time based expiration strategy will NOT be used.
|
|
142
|
+
*
|
|
143
|
+
* Meeting a constraint means BOTH that the properties the constraint
|
|
144
|
+
* requires are present AND that the expiration time indicated by those
|
|
145
|
+
* properties has not been exceeded.
|
|
146
|
+
*
|
|
147
|
+
* In other words, if the properties for a constraint are not present,
|
|
148
|
+
* this does not count either as meeting or as not meeting the constraint,
|
|
149
|
+
* the constraint simply does not apply.
|
|
150
|
+
*
|
|
151
|
+
* The `isExpired` function is called with the request and should return
|
|
152
|
+
* `true` if the request is expired, `false` if it is not expired, and
|
|
153
|
+
* `null` if the expiration status is unknown.
|
|
154
|
+
*
|
|
155
|
+
* In order constraints are checked:
|
|
156
|
+
*
|
|
157
|
+
* - isExpired function
|
|
158
|
+
* - ↳ (if null) X-WarpDrive-Expires header
|
|
159
|
+
* - ↳ (if null) Cache-Control header
|
|
160
|
+
* - ↳ (if null) Expires header
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
constraints?: {
|
|
164
|
+
/**
|
|
165
|
+
* Headers that should be checked for expiration.
|
|
166
|
+
*
|
|
167
|
+
*/
|
|
168
|
+
headers?: {
|
|
169
|
+
/**
|
|
170
|
+
* Whether the `Cache-Control` header should be checked for expiration.
|
|
171
|
+
* If `true`, then the `max-age` and `s-maxage` directives are used alongside
|
|
172
|
+
* the `Age` and `Date` headers to determine if the expiration time has passed.
|
|
173
|
+
*
|
|
174
|
+
* Other directives are ignored.
|
|
175
|
+
*
|
|
176
|
+
* 'Cache-Control' will take precedence over 'Expires' if both are present
|
|
177
|
+
* and both configured to be checked.
|
|
178
|
+
*
|
|
179
|
+
*/
|
|
180
|
+
"Cache-Control"?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Whether the `Expires` header should be checked for expiration.
|
|
183
|
+
*
|
|
184
|
+
* If `true`, then the `Expires` header is used to caclulate the expiration time
|
|
185
|
+
* and determine if the expiration time has passed.
|
|
186
|
+
*
|
|
187
|
+
* 'Cache-Control' will take precedence over 'Expires' if both are present.
|
|
188
|
+
*
|
|
189
|
+
*/
|
|
190
|
+
Expires?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Whether the `X-WarpDrive-Expires` header should be checked for expiration.
|
|
193
|
+
*
|
|
194
|
+
* If `true`, then the `X-WarpDrive-Expires` header is used to caclulate the expiration time
|
|
195
|
+
* and determine if the expiration time has passed.
|
|
196
|
+
*
|
|
197
|
+
* This header will take precedence over 'Cache-Control' and 'Expires' if all three are present.
|
|
198
|
+
*
|
|
199
|
+
* The header's value should be a [UTC date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString).
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
202
|
+
"X-WarpDrive-Expires"?: boolean;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* A function that should be called to determine if the request is expired.
|
|
206
|
+
*
|
|
207
|
+
* If present, this function will be called with the request and should return
|
|
208
|
+
* `true` if the request is expired, `false` if it is not expired, and
|
|
209
|
+
* `null` if the expiration status is unknown.
|
|
210
|
+
*
|
|
211
|
+
* If the function does not return `null`,
|
|
212
|
+
*
|
|
213
|
+
*/
|
|
214
|
+
isExpired?: (request: StructuredDocument<ResourceDocument>) => boolean | null;
|
|
215
|
+
};
|
|
214
216
|
};
|
|
215
217
|
/**
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
218
|
+
* A basic CachePolicy that can be added to the Store service.
|
|
219
|
+
*
|
|
220
|
+
* Determines staleness based on time since the request was last received from the API
|
|
221
|
+
* using the `date` header.
|
|
222
|
+
*
|
|
223
|
+
* Determines expiration based on configured constraints as well as a time based
|
|
224
|
+
* expiration strategy based on the `date` header.
|
|
225
|
+
*
|
|
226
|
+
* In order expiration is determined by:
|
|
227
|
+
*
|
|
228
|
+
* - Is explicitly invalidated
|
|
229
|
+
* - ↳ (if null) isExpired function \<IF Constraint Active>
|
|
230
|
+
* - ↳ (if null) X-WarpDrive-Expires header \<IF Constraint Active>
|
|
231
|
+
* - ↳ (if null) Cache-Control header \<IF Constraint Active>
|
|
232
|
+
* - ↳ (if null) Expires header \<IF Constraint Active>
|
|
233
|
+
* - ↳ (if null) Date header + apiCacheHardExpires \< current time
|
|
234
|
+
*
|
|
235
|
+
* Invalidates any request for which `cacheOptions.types` was provided when a createRecord
|
|
236
|
+
* request for that type is successful.
|
|
237
|
+
*
|
|
238
|
+
* For this to work, the `createRecord` request must include the `cacheOptions.types` array
|
|
239
|
+
* with the types that should be invalidated, or its request should specify the identifiers
|
|
240
|
+
* of the records that are being created via `records`. Providing both is valid.
|
|
241
|
+
*
|
|
242
|
+
* > [!NOTE]
|
|
243
|
+
* > only requests that had specified `cacheOptions.types` and occurred prior to the
|
|
244
|
+
* > createRecord request will be invalidated. This means that a given request should always
|
|
245
|
+
* > specify the types that would invalidate it to opt into this behavior. Abstracting this
|
|
246
|
+
* > behavior via builders is recommended to ensure consistency.
|
|
247
|
+
*
|
|
248
|
+
* This allows the Store's CacheHandler to determine if a request is expired and
|
|
249
|
+
* should be refetched upon next request.
|
|
250
|
+
*
|
|
251
|
+
* The `Fetch` handler provided by `@warp-drive/core` will automatically
|
|
252
|
+
* add the `date` header to responses if it is not present.
|
|
253
|
+
*
|
|
254
|
+
* > [!NOTE]
|
|
255
|
+
* > Date headers do not have millisecond precision, so expiration times should
|
|
256
|
+
* > generally be larger than 1000ms.
|
|
257
|
+
*
|
|
258
|
+
* Usage:
|
|
259
|
+
*
|
|
260
|
+
* ```ts
|
|
261
|
+
* import { Store } from '@warp-drive/core';
|
|
262
|
+
* import { DefaultCachePolicy } from '@warp-drive/core/store';
|
|
263
|
+
*
|
|
264
|
+
* export class AppStore extends Store {
|
|
265
|
+
* lifetimes = new DefaultCachePolicy({
|
|
266
|
+
* apiCacheSoftExpires: 30_000,
|
|
267
|
+
* apiCacheHardExpires: 60_000
|
|
268
|
+
* });
|
|
269
|
+
* }
|
|
270
|
+
* ```
|
|
271
|
+
*
|
|
272
|
+
* In Testing environments, the `apiCacheSoftExpires` will always be `false`
|
|
273
|
+
* and `apiCacheHardExpires` will use the `apiCacheSoftExpires` value.
|
|
274
|
+
*
|
|
275
|
+
* This helps reduce flakiness and produce predictably rendered results in test suites.
|
|
276
|
+
*
|
|
277
|
+
* Requests that specifically set `cacheOptions.backgroundReload = true` will
|
|
278
|
+
* still be background reloaded in tests.
|
|
279
|
+
*
|
|
280
|
+
* This behavior can be opted out of by setting `disableTestOptimization = true`
|
|
281
|
+
* in the policy config.
|
|
282
|
+
*
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
283
285
|
export declare class DefaultCachePolicy {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
286
|
+
config: PolicyConfig;
|
|
287
|
+
_stores: WeakMap<Store, {
|
|
288
|
+
invalidated: Set<StableDocumentIdentifier>;
|
|
289
|
+
types: Map<string, Set<StableDocumentIdentifier>>;
|
|
290
|
+
}>;
|
|
291
|
+
_getStore(store: Store): {
|
|
292
|
+
invalidated: Set<StableDocumentIdentifier>;
|
|
293
|
+
types: Map<string, Set<StableDocumentIdentifier>>;
|
|
294
|
+
};
|
|
295
|
+
constructor(config: PolicyConfig);
|
|
296
|
+
/**
|
|
297
|
+
* Invalidate a request by its identifier for a given store instance.
|
|
298
|
+
*
|
|
299
|
+
* While the store argument may seem redundant, the CachePolicy
|
|
300
|
+
* is designed to be shared across multiple stores / forks
|
|
301
|
+
* of the store.
|
|
302
|
+
*
|
|
303
|
+
* ```ts
|
|
304
|
+
* store.lifetimes.invalidateRequest(store, identifier);
|
|
305
|
+
* ```
|
|
306
|
+
*
|
|
307
|
+
* @public
|
|
308
|
+
* @param {StableDocumentIdentifier} identifier
|
|
309
|
+
* @param {Store} store
|
|
310
|
+
*/
|
|
311
|
+
invalidateRequest(identifier: StableDocumentIdentifier, store: Store): void;
|
|
312
|
+
/**
|
|
313
|
+
* Invalidate all requests associated to a specific type
|
|
314
|
+
* for a given store instance.
|
|
315
|
+
*
|
|
316
|
+
* While the store argument may seem redundant, the CachePolicy
|
|
317
|
+
* is designed to be shared across multiple stores / forks
|
|
318
|
+
* of the store.
|
|
319
|
+
*
|
|
320
|
+
* This invalidation is done automatically when using this service
|
|
321
|
+
* for both the CacheHandler and the LegacyNetworkHandler.
|
|
322
|
+
*
|
|
323
|
+
* ```ts
|
|
324
|
+
* store.lifetimes.invalidateRequestsForType(store, 'person');
|
|
325
|
+
* ```
|
|
326
|
+
*
|
|
327
|
+
* @public
|
|
328
|
+
* @param {String} type
|
|
329
|
+
* @param {Store} store
|
|
330
|
+
*/
|
|
331
|
+
invalidateRequestsForType(type: string, store: Store): void;
|
|
332
|
+
/**
|
|
333
|
+
* Invoked when a request has been fulfilled from the configured request handlers.
|
|
334
|
+
* This is invoked by the CacheHandler for both foreground and background requests
|
|
335
|
+
* once the cache has been updated.
|
|
336
|
+
*
|
|
337
|
+
* Note, this is invoked by the CacheHandler regardless of whether
|
|
338
|
+
* the request has a cache-key.
|
|
339
|
+
*
|
|
340
|
+
* This method should not be invoked directly by consumers.
|
|
341
|
+
*
|
|
342
|
+
* @public
|
|
343
|
+
* @param {ImmutableRequestInfo} request
|
|
344
|
+
* @param {ImmutableResponse} response
|
|
345
|
+
* @param {Store} store
|
|
346
|
+
* @param {StableDocumentIdentifier | null} identifier
|
|
347
|
+
* @return {void}
|
|
348
|
+
*/
|
|
349
|
+
didRequest(request: ImmutableRequestInfo, response: Response | ResponseInfo | null, identifier: StableDocumentIdentifier | null, store: Store): void;
|
|
350
|
+
/**
|
|
351
|
+
* Invoked to determine if the request may be fulfilled from cache
|
|
352
|
+
* if possible.
|
|
353
|
+
*
|
|
354
|
+
* Note, this is only invoked by the CacheHandler if the request has
|
|
355
|
+
* a cache-key.
|
|
356
|
+
*
|
|
357
|
+
* If no cache entry is found or the entry is hard expired,
|
|
358
|
+
* the request will be fulfilled from the configured request handlers
|
|
359
|
+
* and the cache will be updated before returning the response.
|
|
360
|
+
*
|
|
361
|
+
* @public
|
|
362
|
+
* @param {StableDocumentIdentifier} identifier
|
|
363
|
+
* @param {Store} store
|
|
364
|
+
* @return {Boolean} true if the request is considered hard expired
|
|
365
|
+
*/
|
|
366
|
+
isHardExpired(identifier: StableDocumentIdentifier, store: Store): boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Invoked if `isHardExpired` is false to determine if the request
|
|
369
|
+
* should be update behind the scenes if cache data is already available.
|
|
370
|
+
*
|
|
371
|
+
* Note, this is only invoked by the CacheHandler if the request has
|
|
372
|
+
* a cache-key.
|
|
373
|
+
*
|
|
374
|
+
* If true, the request will be fulfilled from cache while a backgrounded
|
|
375
|
+
* request is made to update the cache via the configured request handlers.
|
|
376
|
+
*
|
|
377
|
+
* @public
|
|
378
|
+
* @param {StableDocumentIdentifier} identifier
|
|
379
|
+
* @param {Store} store
|
|
380
|
+
* @return {Boolean} true if the request is considered soft expired
|
|
381
|
+
*/
|
|
382
|
+
isSoftExpired(identifier: StableDocumentIdentifier, store: Store): boolean;
|
|
381
383
|
}
|
|
382
384
|
export {};
|
|
383
|
-
//# sourceMappingURL=default-cache-policy.d.ts.map
|