@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,308 +1,331 @@
|
|
|
1
|
-
import type { StableRecordIdentifier } from
|
|
2
|
-
import type { QueryParamsSerializationOptions } from
|
|
3
|
-
import type { ExtractSuggestedCacheTypes, Includes, TypedRecordInstance, TypeFromInstanceOrString } from
|
|
4
|
-
import type { ResourceIdentifierObject } from
|
|
5
|
-
import type { RequestSignature } from
|
|
1
|
+
import type { StableRecordIdentifier } from "./identifier.js";
|
|
2
|
+
import type { QueryParamsSerializationOptions } from "./params.js";
|
|
3
|
+
import type { ExtractSuggestedCacheTypes, Includes, TypedRecordInstance, TypeFromInstanceOrString } from "./record.js";
|
|
4
|
+
import type { ResourceIdentifierObject } from "./spec/json-api-raw.js";
|
|
5
|
+
import type { RequestSignature } from "./symbols.js";
|
|
6
6
|
type Store = unknown;
|
|
7
|
-
export declare const SkipCache:
|
|
8
|
-
export declare const EnableHydration:
|
|
9
|
-
export declare const IS_FUTURE:
|
|
10
|
-
export declare const STRUCTURED:
|
|
11
|
-
export type HTTPMethod =
|
|
7
|
+
export declare const SkipCache: "___(unique) Symbol(SkipCache)";
|
|
8
|
+
export declare const EnableHydration: "___(unique) Symbol(EnableHydration)";
|
|
9
|
+
export declare const IS_FUTURE: "___(unique) Symbol(IS_FUTURE)";
|
|
10
|
+
export declare const STRUCTURED: "___(unique) Symbol(DOC)";
|
|
11
|
+
export type HTTPMethod = "QUERY" | "GET" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "CONNECT" | "TRACE";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
* Use these options to adjust CacheHandler behavior for a request.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
16
|
export type CacheOptions<T = unknown> = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
17
|
+
/**
|
|
18
|
+
* A key that uniquely identifies this request. If not present, the url wil be used
|
|
19
|
+
* as the key for any GET request, while all other requests will not be cached.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
key?: string;
|
|
23
|
+
/**
|
|
24
|
+
* If true, the request will be made even if a cached response is present
|
|
25
|
+
* and not expired.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
reload?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If true, and a cached response is present and not expired, the request
|
|
31
|
+
* will be made in the background and the cached response will be returned.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
backgroundReload?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Useful for metadata around when to invalidate the cache. Typically used
|
|
37
|
+
* by strategies that invalidate requests by resource type when a new resource
|
|
38
|
+
* of that type has been created. See the CachePolicy implementation
|
|
39
|
+
* provided by `@ember-data/request-utils` for an example.
|
|
40
|
+
*
|
|
41
|
+
* It is recommended to only use this for query/queryRecord requests where
|
|
42
|
+
* new records created later would affect the results, though using it for
|
|
43
|
+
* findRecord requests is also supported if desired where it may be useful
|
|
44
|
+
* when a create may affect the result of a sideloaded relationship.
|
|
45
|
+
*
|
|
46
|
+
* Generally it is better to patch the cache directly for relationship updates
|
|
47
|
+
* than to invalidate findRecord requests for one.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
types?: T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];
|
|
51
|
+
/**
|
|
52
|
+
* If true, the request will never be handled by the cache-manager and thus
|
|
53
|
+
* will never resolve from cache nor update the cache.
|
|
54
|
+
*
|
|
55
|
+
* Generally this is only used for legacy request that manage resource cache
|
|
56
|
+
* updates in a non-standard way via the LegacyNetworkHandler.
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
[SkipCache]?: boolean;
|
|
60
60
|
};
|
|
61
|
-
export type FindRecordRequestOptions<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
export type FindRecordRequestOptions<
|
|
62
|
+
RT = unknown,
|
|
63
|
+
T = unknown
|
|
64
|
+
> = {
|
|
65
|
+
url: string;
|
|
66
|
+
method: "GET";
|
|
67
|
+
headers: Headers;
|
|
68
|
+
cacheOptions?: CacheOptions<T>;
|
|
69
|
+
op: "findRecord";
|
|
70
|
+
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
71
|
+
[RequestSignature]?: RT;
|
|
69
72
|
};
|
|
70
|
-
export type QueryRequestOptions<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
export type QueryRequestOptions<
|
|
74
|
+
RT = unknown,
|
|
75
|
+
T = unknown
|
|
76
|
+
> = {
|
|
77
|
+
url: string;
|
|
78
|
+
method: "GET";
|
|
79
|
+
headers: Headers;
|
|
80
|
+
cacheOptions?: CacheOptions<T>;
|
|
81
|
+
op: "query";
|
|
82
|
+
[RequestSignature]?: RT;
|
|
77
83
|
};
|
|
78
|
-
export type PostQueryRequestOptions<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
export type PostQueryRequestOptions<
|
|
85
|
+
RT = unknown,
|
|
86
|
+
T = unknown
|
|
87
|
+
> = {
|
|
88
|
+
url: string;
|
|
89
|
+
method: "POST" | "QUERY";
|
|
90
|
+
headers: Headers;
|
|
91
|
+
body?: string | BodyInit | FormData;
|
|
92
|
+
cacheOptions: CacheOptions<T> & {
|
|
93
|
+
key: string;
|
|
94
|
+
};
|
|
95
|
+
op: "query";
|
|
96
|
+
[RequestSignature]?: RT;
|
|
88
97
|
};
|
|
89
|
-
export type DeleteRequestOptions<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
export type DeleteRequestOptions<
|
|
99
|
+
RT = unknown,
|
|
100
|
+
T = unknown
|
|
101
|
+
> = {
|
|
102
|
+
url: string;
|
|
103
|
+
method: "DELETE";
|
|
104
|
+
headers: Headers;
|
|
105
|
+
op: "deleteRecord";
|
|
106
|
+
body?: string | BodyInit | FormData;
|
|
107
|
+
data: {
|
|
108
|
+
record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
|
|
109
|
+
};
|
|
110
|
+
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
111
|
+
[RequestSignature]?: RT;
|
|
100
112
|
};
|
|
101
113
|
type ImmutableRequest<T> = Readonly<T> & {
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
readonly headers: ImmutableHeaders;
|
|
115
|
+
readonly records: [StableRecordIdentifier];
|
|
104
116
|
};
|
|
105
|
-
export type UpdateRequestOptions<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
export type UpdateRequestOptions<
|
|
118
|
+
RT = unknown,
|
|
119
|
+
T = unknown
|
|
120
|
+
> = {
|
|
121
|
+
url: string;
|
|
122
|
+
method: "PATCH" | "PUT";
|
|
123
|
+
headers: Headers;
|
|
124
|
+
op: "updateRecord";
|
|
125
|
+
body?: string | BodyInit | FormData;
|
|
126
|
+
data: {
|
|
127
|
+
record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
|
|
128
|
+
};
|
|
129
|
+
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
130
|
+
[RequestSignature]?: RT;
|
|
116
131
|
};
|
|
117
|
-
export type CreateRequestOptions<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
export type CreateRequestOptions<
|
|
133
|
+
RT = unknown,
|
|
134
|
+
T = unknown
|
|
135
|
+
> = {
|
|
136
|
+
url: string;
|
|
137
|
+
method: "POST";
|
|
138
|
+
headers: Headers;
|
|
139
|
+
op: "createRecord";
|
|
140
|
+
body?: string | BodyInit | FormData;
|
|
141
|
+
data: {
|
|
142
|
+
record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;
|
|
143
|
+
};
|
|
144
|
+
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
145
|
+
[RequestSignature]?: RT;
|
|
128
146
|
};
|
|
129
147
|
export type ImmutableDeleteRequestOptions = ImmutableRequest<DeleteRequestOptions>;
|
|
130
148
|
export type ImmutableUpdateRequestOptions = ImmutableRequest<UpdateRequestOptions>;
|
|
131
149
|
export type ImmutableCreateRequestOptions = ImmutableRequest<CreateRequestOptions>;
|
|
132
150
|
export type RemotelyAccessibleIdentifier<T extends string = string> = {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
id: string;
|
|
152
|
+
type: T;
|
|
153
|
+
lid?: string;
|
|
136
154
|
};
|
|
137
155
|
export type ConstrainedRequestOptions = {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
reload?: boolean;
|
|
157
|
+
backgroundReload?: boolean;
|
|
158
|
+
host?: string;
|
|
159
|
+
namespace?: string;
|
|
160
|
+
resourcePath?: string;
|
|
161
|
+
urlParamsSettings?: QueryParamsSerializationOptions;
|
|
144
162
|
};
|
|
145
163
|
export type FindRecordOptions<T = unknown> = ConstrainedRequestOptions & {
|
|
146
|
-
|
|
164
|
+
include?: T extends TypedRecordInstance ? Includes<T>[] : string | string[];
|
|
147
165
|
};
|
|
148
166
|
export interface StructuredDataDocument<T> {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
167
|
+
[STRUCTURED]?: true;
|
|
168
|
+
/**
|
|
169
|
+
* @see {@link ImmutableRequestInfo}
|
|
170
|
+
*/
|
|
171
|
+
request: ImmutableRequestInfo;
|
|
172
|
+
response: Response | ResponseInfo | null;
|
|
173
|
+
content: T;
|
|
156
174
|
}
|
|
157
175
|
export interface StructuredErrorDocument<T = unknown> extends Error {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
176
|
+
[STRUCTURED]?: true;
|
|
177
|
+
request: ImmutableRequestInfo;
|
|
178
|
+
response: Response | ResponseInfo | null;
|
|
179
|
+
error: string | object;
|
|
180
|
+
content?: T;
|
|
163
181
|
}
|
|
164
182
|
export type StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument<T>;
|
|
165
183
|
/**
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
184
|
+
* JavaScript's native Request class.
|
|
185
|
+
*
|
|
186
|
+
* WarpDrive provides our own typings due to incompleteness in the native typings.
|
|
187
|
+
*
|
|
188
|
+
*/
|
|
171
189
|
interface Request {
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
190
|
+
/** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
|
|
191
|
+
*/
|
|
192
|
+
cache?: RequestCache;
|
|
193
|
+
/** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.
|
|
194
|
+
*/
|
|
195
|
+
credentials?: RequestCredentials;
|
|
196
|
+
/** Returns the kind of resource requested by request, e.g., "document" or "script".
|
|
197
|
+
*/
|
|
198
|
+
destination?: RequestDestination;
|
|
199
|
+
/** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
|
|
200
|
+
*/
|
|
201
|
+
headers?: Headers;
|
|
202
|
+
/** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
|
|
203
|
+
*/
|
|
204
|
+
integrity?: string;
|
|
205
|
+
/** Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
206
|
+
*/
|
|
207
|
+
keepalive?: boolean;
|
|
208
|
+
/** Returns request's HTTP method, which is "GET" by default.
|
|
209
|
+
*/
|
|
210
|
+
method?: HTTPMethod;
|
|
211
|
+
/** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.
|
|
212
|
+
*
|
|
213
|
+
* `no-cors` is not allowed for streaming request bodies.
|
|
214
|
+
*
|
|
215
|
+
*/
|
|
216
|
+
mode?: RequestMode;
|
|
217
|
+
/** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
|
|
218
|
+
*/
|
|
219
|
+
redirect?: RequestRedirect;
|
|
220
|
+
/** Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.
|
|
221
|
+
*/
|
|
222
|
+
referrer?: string;
|
|
223
|
+
/** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
|
|
224
|
+
*/
|
|
225
|
+
referrerPolicy?: ReferrerPolicy;
|
|
226
|
+
/** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
227
|
+
*/
|
|
228
|
+
signal?: AbortSignal;
|
|
229
|
+
/** Returns the URL of request as a string.
|
|
230
|
+
*/
|
|
231
|
+
url?: string;
|
|
232
|
+
/** Any body that you want to add to your request. Note that a GET or HEAD request may not have a body.
|
|
233
|
+
*/
|
|
234
|
+
body?: BodyInit | null;
|
|
235
|
+
/**
|
|
236
|
+
* When sending a ReadableStream as the body of a request, 'half' must be
|
|
237
|
+
* specified.
|
|
238
|
+
*
|
|
239
|
+
* [Half Duplex Further Reading](https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests#half_duplex)
|
|
240
|
+
*
|
|
241
|
+
*/
|
|
242
|
+
duplex?: "half";
|
|
225
243
|
}
|
|
226
244
|
export interface ImmutableHeaders extends Headers {
|
|
227
|
-
|
|
228
|
-
|
|
245
|
+
clone?(): Headers;
|
|
246
|
+
toJSON(): [string, string][];
|
|
229
247
|
}
|
|
230
248
|
/**
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
export interface RequestInfo<
|
|
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
|
-
|
|
249
|
+
* Extends JavaScript's native {@link Request} object with additional
|
|
250
|
+
* properties specific to the RequestManager's capabilities.
|
|
251
|
+
*
|
|
252
|
+
*/
|
|
253
|
+
export interface RequestInfo<
|
|
254
|
+
RT = unknown,
|
|
255
|
+
T = unknown
|
|
256
|
+
> extends Request {
|
|
257
|
+
/**
|
|
258
|
+
* If provided, used instead of the AbortController auto-configured for each request by the RequestManager
|
|
259
|
+
*
|
|
260
|
+
*/
|
|
261
|
+
controller?: AbortController;
|
|
262
|
+
/**
|
|
263
|
+
* @see {@link CacheOptions}
|
|
264
|
+
*/
|
|
265
|
+
cacheOptions?: CacheOptions<T>;
|
|
266
|
+
store?: Store;
|
|
267
|
+
op?: string;
|
|
268
|
+
/**
|
|
269
|
+
* The identifiers of the primary resources involved in the request
|
|
270
|
+
* (if any). This may be used by handlers to perform transactional
|
|
271
|
+
* operations on the store.
|
|
272
|
+
*
|
|
273
|
+
*/
|
|
274
|
+
records?: StableRecordIdentifier[];
|
|
275
|
+
disableTestWaiter?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* data that a handler should convert into
|
|
278
|
+
* the query (GET) or body (POST).
|
|
279
|
+
*
|
|
280
|
+
* Note: It is recommended that builders set query params
|
|
281
|
+
* and body directly in most scenarios.
|
|
282
|
+
*
|
|
283
|
+
*/
|
|
284
|
+
data?: Record<string, unknown>;
|
|
285
|
+
/**
|
|
286
|
+
* options specifically intended for handlers
|
|
287
|
+
* to utilize to process the request
|
|
288
|
+
*
|
|
289
|
+
*/
|
|
290
|
+
options?: Record<string, unknown>;
|
|
291
|
+
[RequestSignature]?: RT;
|
|
292
|
+
[EnableHydration]?: boolean;
|
|
272
293
|
}
|
|
273
294
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
export type ImmutableRequestInfo<
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
295
|
+
* Immutable version of {@link RequestInfo}. This is what is passed to handlers.
|
|
296
|
+
*
|
|
297
|
+
*/
|
|
298
|
+
export type ImmutableRequestInfo<
|
|
299
|
+
RT = unknown,
|
|
300
|
+
T = unknown
|
|
301
|
+
> = Readonly<Omit<RequestInfo<RT, T>, "controller">> & {
|
|
302
|
+
readonly cacheOptions?: Readonly<CacheOptions<T>>;
|
|
303
|
+
readonly headers?: ImmutableHeaders;
|
|
304
|
+
readonly data?: Readonly<Record<string, unknown>>;
|
|
305
|
+
readonly options?: Readonly<Record<string, unknown>>;
|
|
306
|
+
/** Whether the request body has been read.
|
|
307
|
+
*/
|
|
308
|
+
readonly bodyUsed?: boolean;
|
|
285
309
|
};
|
|
286
310
|
export interface ResponseInfo {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
311
|
+
readonly headers: ImmutableHeaders;
|
|
312
|
+
readonly ok: boolean;
|
|
313
|
+
readonly redirected: boolean;
|
|
314
|
+
readonly status: number;
|
|
315
|
+
readonly statusText: string;
|
|
316
|
+
readonly type: ResponseType;
|
|
317
|
+
readonly url: string;
|
|
294
318
|
}
|
|
295
319
|
export interface RequestContext {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
320
|
+
/**
|
|
321
|
+
* @see {@link ImmutableRequestInfo}
|
|
322
|
+
*/
|
|
323
|
+
request: ImmutableRequestInfo;
|
|
324
|
+
id: number;
|
|
325
|
+
setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;
|
|
326
|
+
setResponse(response: Response | ResponseInfo | null): void;
|
|
303
327
|
}
|
|
304
328
|
export declare function withBrand<T>(obj: RequestInfo): RequestInfo<T> & {
|
|
305
|
-
|
|
329
|
+
[RequestSignature]: T;
|
|
306
330
|
};
|
|
307
331
|
export {};
|
|
308
|
-
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import type { LOG_CONFIG } from
|
|
1
|
+
import type { LOG_CONFIG } from "@warp-drive/build-config/-private/utils/logging";
|
|
2
2
|
declare const RuntimeConfig: {
|
|
3
|
-
|
|
3
|
+
debug: Partial<LOG_CONFIG>;
|
|
4
4
|
};
|
|
5
5
|
export declare function getRuntimeConfig(): typeof RuntimeConfig;
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
* Upserts the specified logging configuration into the runtime
|
|
8
|
+
* config.
|
|
9
|
+
*
|
|
10
|
+
* globalThis.setWarpDriveLogging({ LOG_CACHE: true } });
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
13
|
export declare function setLogging(config: Partial<LOG_CONFIG>): void;
|
|
14
14
|
export {};
|
|
15
|
-
//# sourceMappingURL=runtime.d.ts.map
|