@rocicorp/zero 0.25.0-canary.8 → 0.25.0-canary.9
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/out/shared/src/deep-merge.d.ts +20 -3
- package/out/shared/src/deep-merge.d.ts.map +1 -1
- package/out/shared/src/deep-merge.js +27 -0
- package/out/shared/src/deep-merge.js.map +1 -0
- package/out/shared/src/logging.d.ts.map +1 -1
- package/out/shared/src/logging.js +25 -9
- package/out/shared/src/logging.js.map +1 -1
- package/out/shared/src/object-traversal.d.ts +19 -0
- package/out/shared/src/object-traversal.d.ts.map +1 -0
- package/out/shared/src/object-traversal.js +27 -0
- package/out/shared/src/object-traversal.js.map +1 -0
- package/out/zero/package.json.js +1 -1
- package/out/zero/src/pg.js +0 -2
- package/out/zero/src/pg.js.map +1 -1
- package/out/zero/src/server.js +0 -2
- package/out/zero/src/server.js.map +1 -1
- package/out/zero/src/zero.js +19 -3
- package/out/zero/src/zero.js.map +1 -1
- package/out/zero-cache/src/auth/jwt.d.ts +3 -0
- package/out/zero-cache/src/auth/jwt.d.ts.map +1 -1
- package/out/zero-cache/src/auth/jwt.js.map +1 -1
- package/out/zero-cache/src/auth/write-authorizer.d.ts +2 -1
- package/out/zero-cache/src/auth/write-authorizer.d.ts.map +1 -1
- package/out/zero-cache/src/auth/write-authorizer.js +1 -11
- package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
- package/out/zero-cache/src/config/zero-config.d.ts +27 -0
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +35 -7
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/custom/fetch.d.ts +5 -5
- package/out/zero-cache/src/custom/fetch.d.ts.map +1 -1
- package/out/zero-cache/src/custom/fetch.js +14 -11
- package/out/zero-cache/src/custom/fetch.js.map +1 -1
- package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +1 -1
- package/out/zero-cache/src/custom-queries/transform-query.js +2 -4
- package/out/zero-cache/src/custom-queries/transform-query.js.map +1 -1
- package/out/zero-cache/src/db/specs.d.ts +1 -1
- package/out/zero-cache/src/server/change-streamer.d.ts.map +1 -1
- package/out/zero-cache/src/server/change-streamer.js +9 -9
- package/out/zero-cache/src/server/change-streamer.js.map +1 -1
- package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/server/syncer.js +20 -8
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/analyze.d.ts +1 -1
- package/out/zero-cache/src/services/analyze.d.ts.map +1 -1
- package/out/zero-cache/src/services/analyze.js +10 -1
- package/out/zero-cache/src/services/analyze.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.d.ts +5 -5
- package/out/zero-cache/src/services/change-source/pg/schema/published.d.ts +2 -2
- package/out/zero-cache/src/services/change-source/pg/schema/shard.d.ts +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +11 -2
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.js +36 -0
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.js.map +1 -1
- package/out/zero-cache/src/services/http-service.d.ts +5 -4
- package/out/zero-cache/src/services/http-service.d.ts.map +1 -1
- package/out/zero-cache/src/services/http-service.js +15 -10
- package/out/zero-cache/src/services/http-service.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts +2 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +3 -2
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +198 -0
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.js +5 -5
- package/out/zero-cache/src/services/mutagen/pusher.js.map +1 -1
- package/out/zero-cache/src/services/run-ast.d.ts +4 -0
- package/out/zero-cache/src/services/run-ast.d.ts.map +1 -1
- package/out/zero-cache/src/services/run-ast.js +8 -1
- package/out/zero-cache/src/services/run-ast.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/inspect-handler.js +2 -1
- package/out/zero-cache/src/services/view-syncer/inspect-handler.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +15 -8
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +4 -4
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +48 -25
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/workers/connection.js +20 -15
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-cache/src/workers/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer.js +3 -3
- package/out/zero-cache/src/workers/syncer.js.map +1 -1
- package/out/zero-client/src/client/bindings.d.ts +4 -4
- package/out/zero-client/src/client/bindings.d.ts.map +1 -1
- package/out/zero-client/src/client/bindings.js.map +1 -1
- package/out/zero-client/src/client/connection.d.ts +1 -1
- package/out/zero-client/src/client/connection.d.ts.map +1 -1
- package/out/zero-client/src/client/connection.js +1 -1
- package/out/zero-client/src/client/connection.js.map +1 -1
- package/out/zero-client/src/client/crud.d.ts +7 -5
- package/out/zero-client/src/client/crud.d.ts.map +1 -1
- package/out/zero-client/src/client/crud.js +7 -7
- package/out/zero-client/src/client/crud.js.map +1 -1
- package/out/zero-client/src/client/custom.d.ts +7 -5
- package/out/zero-client/src/client/custom.d.ts.map +1 -1
- package/out/zero-client/src/client/custom.js +12 -7
- package/out/zero-client/src/client/custom.js.map +1 -1
- package/out/zero-client/src/client/inspector/inspector.d.ts +5 -1
- package/out/zero-client/src/client/inspector/inspector.d.ts.map +1 -1
- package/out/zero-client/src/client/inspector/inspector.js +7 -0
- package/out/zero-client/src/client/inspector/inspector.js.map +1 -1
- package/out/zero-client/src/client/inspector/lazy-inspector.d.ts.map +1 -1
- package/out/zero-client/src/client/inspector/lazy-inspector.js +13 -13
- package/out/zero-client/src/client/inspector/lazy-inspector.js.map +1 -1
- package/out/zero-client/src/client/make-mutate-property.d.ts +43 -0
- package/out/zero-client/src/client/make-mutate-property.d.ts.map +1 -0
- package/out/zero-client/src/client/make-mutate-property.js +38 -0
- package/out/zero-client/src/client/make-mutate-property.js.map +1 -0
- package/out/zero-client/src/client/make-replicache-mutators.d.ts +34 -0
- package/out/zero-client/src/client/make-replicache-mutators.d.ts.map +1 -0
- package/out/zero-client/src/client/make-replicache-mutators.js +103 -0
- package/out/zero-client/src/client/make-replicache-mutators.js.map +1 -0
- package/out/zero-client/src/client/options.d.ts +39 -27
- package/out/zero-client/src/client/options.d.ts.map +1 -1
- package/out/zero-client/src/client/options.js.map +1 -1
- package/out/zero-client/src/client/version.js +1 -1
- package/out/zero-client/src/client/zero.d.ts +23 -33
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.js +52 -118
- package/out/zero-client/src/client/zero.js.map +1 -1
- package/out/zero-client/src/mod.d.ts +12 -7
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-protocol/src/analyze-query-result.d.ts +236 -0
- package/out/zero-protocol/src/analyze-query-result.d.ts.map +1 -1
- package/out/zero-protocol/src/analyze-query-result.js +128 -2
- package/out/zero-protocol/src/analyze-query-result.js.map +1 -1
- package/out/zero-protocol/src/ast.d.ts +1 -1
- package/out/zero-protocol/src/connect.d.ts.map +1 -1
- package/out/zero-protocol/src/connect.js +4 -0
- package/out/zero-protocol/src/connect.js.map +1 -1
- package/out/zero-protocol/src/custom-queries.d.ts +1 -1
- package/out/zero-protocol/src/down.d.ts +99 -0
- package/out/zero-protocol/src/down.d.ts.map +1 -1
- package/out/zero-protocol/src/error.d.ts +4 -4
- package/out/zero-protocol/src/inspect-down.d.ts +297 -0
- package/out/zero-protocol/src/inspect-down.d.ts.map +1 -1
- package/out/zero-protocol/src/inspect-up.d.ts +4 -0
- package/out/zero-protocol/src/inspect-up.d.ts.map +1 -1
- package/out/zero-protocol/src/inspect-up.js +2 -1
- package/out/zero-protocol/src/inspect-up.js.map +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts.map +1 -1
- package/out/zero-protocol/src/protocol-version.js +1 -1
- package/out/zero-protocol/src/protocol-version.js.map +1 -1
- package/out/zero-protocol/src/push.d.ts +1 -1
- package/out/zero-protocol/src/up.d.ts +1 -0
- package/out/zero-protocol/src/up.d.ts.map +1 -1
- package/out/zero-react/src/components/inspector.d.ts +3 -2
- package/out/zero-react/src/components/inspector.d.ts.map +1 -1
- package/out/zero-react/src/components/inspector.js.map +1 -1
- package/out/zero-react/src/components/zero-inspector.d.ts +3 -2
- package/out/zero-react/src/components/zero-inspector.d.ts.map +1 -1
- package/out/zero-react/src/components/zero-inspector.js.map +1 -1
- package/out/zero-react/src/use-query.d.ts +5 -4
- package/out/zero-react/src/use-query.d.ts.map +1 -1
- package/out/zero-react/src/use-query.js +4 -3
- package/out/zero-react/src/use-query.js.map +1 -1
- package/out/zero-react/src/zero-provider.d.ts +7 -7
- package/out/zero-react/src/zero-provider.d.ts.map +1 -1
- package/out/zero-react/src/zero-provider.js.map +1 -1
- package/out/zero-schema/src/builder/schema-builder.js +1 -1
- package/out/zero-schema/src/builder/schema-builder.js.map +1 -1
- package/out/zero-server/src/custom.d.ts +4 -5
- package/out/zero-server/src/custom.d.ts.map +1 -1
- package/out/zero-server/src/custom.js.map +1 -1
- package/out/zero-server/src/mod.d.ts +0 -1
- package/out/zero-server/src/mod.d.ts.map +1 -1
- package/out/zero-server/src/process-mutations.d.ts +9 -14
- package/out/zero-server/src/process-mutations.d.ts.map +1 -1
- package/out/zero-server/src/process-mutations.js +151 -105
- package/out/zero-server/src/process-mutations.js.map +1 -1
- package/out/zero-server/src/push-processor.d.ts +5 -3
- package/out/zero-server/src/push-processor.d.ts.map +1 -1
- package/out/zero-server/src/push-processor.js +17 -25
- package/out/zero-server/src/push-processor.js.map +1 -1
- package/out/zero-server/src/queries/process-queries.js +1 -1
- package/out/zero-server/src/queries/process-queries.js.map +1 -1
- package/out/zero-server/src/zql-database.d.ts.map +1 -1
- package/out/zero-server/src/zql-database.js +1 -1
- package/out/zero-server/src/zql-database.js.map +1 -1
- package/out/zero-solid/src/use-query.d.ts +3 -3
- package/out/zero-solid/src/use-query.d.ts.map +1 -1
- package/out/zero-solid/src/use-query.js +27 -38
- package/out/zero-solid/src/use-query.js.map +1 -1
- package/out/zero-solid/src/use-zero-connection-state.d.ts.map +1 -1
- package/out/zero-solid/src/use-zero-connection-state.js +7 -5
- package/out/zero-solid/src/use-zero-connection-state.js.map +1 -1
- package/out/zero-solid/src/use-zero-online.d.ts.map +1 -1
- package/out/zero-solid/src/use-zero-online.js +7 -5
- package/out/zero-solid/src/use-zero-online.js.map +1 -1
- package/out/zero-solid/src/use-zero.d.ts +6 -5
- package/out/zero-solid/src/use-zero.d.ts.map +1 -1
- package/out/zero-solid/src/use-zero.js +2 -6
- package/out/zero-solid/src/use-zero.js.map +1 -1
- package/out/zql/src/builder/builder.d.ts +2 -1
- package/out/zql/src/builder/builder.d.ts.map +1 -1
- package/out/zql/src/builder/builder.js +4 -3
- package/out/zql/src/builder/builder.js.map +1 -1
- package/out/zql/src/mutate/custom.d.ts +15 -6
- package/out/zql/src/mutate/custom.d.ts.map +1 -1
- package/out/zql/src/mutate/custom.js +6 -6
- package/out/zql/src/mutate/custom.js.map +1 -1
- package/out/zql/src/mutate/mutator-registry.d.ts +142 -0
- package/out/zql/src/mutate/mutator-registry.d.ts.map +1 -0
- package/out/zql/src/mutate/mutator-registry.js +97 -0
- package/out/zql/src/mutate/mutator-registry.js.map +1 -0
- package/out/zql/src/mutate/mutator.d.ts +98 -0
- package/out/zql/src/mutate/mutator.d.ts.map +1 -0
- package/out/zql/src/mutate/mutator.js +35 -0
- package/out/zql/src/mutate/mutator.js.map +1 -0
- package/out/zql/src/planner/planner-connection.d.ts +7 -15
- package/out/zql/src/planner/planner-connection.d.ts.map +1 -1
- package/out/zql/src/planner/planner-connection.js +30 -24
- package/out/zql/src/planner/planner-connection.js.map +1 -1
- package/out/zql/src/planner/planner-debug.d.ts +37 -43
- package/out/zql/src/planner/planner-debug.d.ts.map +1 -1
- package/out/zql/src/planner/planner-debug.js +242 -0
- package/out/zql/src/planner/planner-debug.js.map +1 -0
- package/out/zql/src/planner/planner-fan-in.d.ts.map +1 -1
- package/out/zql/src/planner/planner-fan-in.js +11 -8
- package/out/zql/src/planner/planner-fan-in.js.map +1 -1
- package/out/zql/src/planner/planner-fan-out.d.ts.map +1 -1
- package/out/zql/src/planner/planner-fan-out.js +11 -8
- package/out/zql/src/planner/planner-fan-out.js.map +1 -1
- package/out/zql/src/planner/planner-graph.d.ts.map +1 -1
- package/out/zql/src/planner/planner-graph.js +13 -5
- package/out/zql/src/planner/planner-graph.js.map +1 -1
- package/out/zql/src/planner/planner-join.d.ts.map +1 -1
- package/out/zql/src/planner/planner-join.js +12 -9
- package/out/zql/src/planner/planner-join.js.map +1 -1
- package/out/zql/src/planner/planner-node.d.ts +4 -0
- package/out/zql/src/planner/planner-node.d.ts.map +1 -1
- package/out/zql/src/planner/planner-node.js +8 -0
- package/out/zql/src/planner/planner-node.js.map +1 -0
- package/out/zql/src/query/create-builder.d.ts +7 -0
- package/out/zql/src/query/create-builder.d.ts.map +1 -0
- package/out/zql/src/query/create-builder.js +44 -0
- package/out/zql/src/query/create-builder.js.map +1 -0
- package/out/zql/src/query/named.d.ts +1 -7
- package/out/zql/src/query/named.d.ts.map +1 -1
- package/out/zql/src/query/named.js +0 -21
- package/out/zql/src/query/named.js.map +1 -1
- package/out/zql/src/query/query-impl.d.ts +4 -3
- package/out/zql/src/query/query-impl.d.ts.map +1 -1
- package/out/zql/src/query/query-impl.js +3 -0
- package/out/zql/src/query/query-impl.js.map +1 -1
- package/out/zql/src/query/query-internals.js +0 -4
- package/out/zql/src/query/query-internals.js.map +1 -1
- package/out/zql/src/query/query-registry.d.ts +253 -0
- package/out/zql/src/query/query-registry.d.ts.map +1 -0
- package/out/zql/src/query/query-registry.js +131 -0
- package/out/zql/src/query/query-registry.js.map +1 -0
- package/out/zql/src/query/query.d.ts +16 -1
- package/out/zql/src/query/query.d.ts.map +1 -1
- package/out/zql/src/query/schema-query.d.ts +6 -0
- package/out/zql/src/query/schema-query.d.ts.map +1 -0
- package/out/zql/src/query/validate-input.js +12 -13
- package/out/zql/src/query/validate-input.js.map +1 -1
- package/package.json +2 -1
- package/out/zero-server/src/query-registry.d.ts +0 -10
- package/out/zero-server/src/query-registry.d.ts.map +0 -1
- package/out/zero-server/src/query-registry.js +0 -35
- package/out/zero-server/src/query-registry.js.map +0 -1
- package/out/zql/src/query/define-query.d.ts +0 -75
- package/out/zql/src/query/define-query.d.ts.map +0 -1
- package/out/zql/src/query/define-query.js +0 -47
- package/out/zql/src/query/define-query.js.map +0 -1
- package/out/zql/src/query/query-definitions.d.ts +0 -32
- package/out/zql/src/query/query-definitions.d.ts.map +0 -1
|
@@ -2,13 +2,13 @@ import type { LogLevel } from '@rocicorp/logger';
|
|
|
2
2
|
import type { StoreProvider } from '../../../replicache/src/kv/store.ts';
|
|
3
3
|
import * as v from '../../../shared/src/valita.ts';
|
|
4
4
|
import type { Schema } from '../../../zero-types/src/schema.ts';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AnyMutatorRegistry } from '../../../zql/src/mutate/mutator-registry.ts';
|
|
6
6
|
import type { CustomMutatorDefs } from './custom.ts';
|
|
7
7
|
import { UpdateNeededReasonType } from './update-needed-reason-type.ts';
|
|
8
8
|
/**
|
|
9
9
|
* Configuration for {@linkcode Zero}.
|
|
10
10
|
*/
|
|
11
|
-
export interface ZeroOptions<S extends Schema, MD extends CustomMutatorDefs | undefined = undefined,
|
|
11
|
+
export interface ZeroOptions<S extends Schema, MD extends AnyMutatorRegistry | CustomMutatorDefs | undefined = undefined, C = unknown> {
|
|
12
12
|
/**
|
|
13
13
|
* URL to the zero-cache. This can be a simple hostname, e.g.
|
|
14
14
|
* - "https://myapp-myteam.zero.ms"
|
|
@@ -20,6 +20,10 @@ export interface ZeroOptions<S extends Schema, MD extends CustomMutatorDefs | un
|
|
|
20
20
|
* the zero-cache is hosted on the same domain as the application. **Note that
|
|
21
21
|
* only a single path segment is allowed (e.g. it cannot be "/proxy/zero/\*")**.
|
|
22
22
|
*/
|
|
23
|
+
cacheURL?: string | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use {@linkcode cacheURL} instead.
|
|
26
|
+
*/
|
|
23
27
|
server?: string | null | undefined;
|
|
24
28
|
/**
|
|
25
29
|
* A token to identify and authenticate the user.
|
|
@@ -74,50 +78,58 @@ export interface ZeroOptions<S extends Schema, MD extends CustomMutatorDefs | un
|
|
|
74
78
|
* implementations. Client side mutators must be idempotent as a
|
|
75
79
|
* mutation can be rebased multiple times when folding in authoritative
|
|
76
80
|
* changes from the server to the client.
|
|
77
|
-
*/
|
|
78
|
-
mutators?: MD | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Custom URL for mutation requests sent to your API server.
|
|
81
|
-
* If not provided, uses the default configured in zero-cache.
|
|
82
|
-
*/
|
|
83
|
-
mutateURL?: string | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* An object whose values are your custom query definitions. Queries can
|
|
86
|
-
* either be top-level functions or grouped in namespaces (objects).
|
|
87
81
|
*
|
|
88
|
-
* Define
|
|
89
|
-
*
|
|
82
|
+
* Define mutators using the `defineMutator` function to create type-safe,
|
|
83
|
+
* parameterized mutations. Mutators can be top-level or grouped in namespaces.
|
|
90
84
|
*
|
|
91
85
|
* @example
|
|
92
86
|
* ```ts
|
|
87
|
+
* import {defineMutator} from '@rocicorp/zero';
|
|
88
|
+
*
|
|
93
89
|
* const z = new Zero({
|
|
94
90
|
* schema,
|
|
95
91
|
* userID,
|
|
96
|
-
*
|
|
97
|
-
* // Top-level
|
|
98
|
-
*
|
|
99
|
-
*
|
|
92
|
+
* mutators: {
|
|
93
|
+
* // Top-level mutator
|
|
94
|
+
* increment: defineMutator(({tx, args}: {tx: Transaction<Schema>, args: {id: string}}) =>
|
|
95
|
+
* tx.mutate.counter.update({id: args.id, value: tx.query.counter.where('id', '=', args.id).value + 1})
|
|
100
96
|
* ),
|
|
101
|
-
* // Namespace with multiple
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
97
|
+
* // Namespace with multiple mutators
|
|
98
|
+
* issues: {
|
|
99
|
+
* create: defineMutator(({tx, args}: {tx: Transaction<Schema>, args: {title: string}}) =>
|
|
100
|
+
* tx.mutate.issues.insert({id: nanoid(), title: args.title, status: 'open'})
|
|
101
|
+
* ),
|
|
102
|
+
* close: defineMutator(({tx, args}: {tx: Transaction<Schema>, args: {id: string}}) =>
|
|
103
|
+
* tx.mutate.issues.update({id: args.id, status: 'closed'})
|
|
105
104
|
* ),
|
|
106
105
|
* },
|
|
107
106
|
* },
|
|
108
107
|
* });
|
|
109
108
|
*
|
|
110
109
|
* // Usage
|
|
111
|
-
*
|
|
112
|
-
*
|
|
110
|
+
* await z.mutate.increment({id: 'counter-1'}).client;
|
|
111
|
+
* await z.mutate.issues.create({title: 'New issue'}).client;
|
|
112
|
+
* await z.mutate.issues.close({id: 'issue-123'}).client;
|
|
113
113
|
* ```
|
|
114
114
|
*/
|
|
115
|
-
|
|
115
|
+
mutators?: MD | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Custom URL for mutation requests sent to your API server.
|
|
118
|
+
* If not provided, uses the default configured in zero-cache.
|
|
119
|
+
*/
|
|
120
|
+
mutateURL?: string | undefined;
|
|
116
121
|
/**
|
|
117
122
|
* Custom URL for query requests sent to your API server.
|
|
118
123
|
* If not provided, uses the default configured in zero-cache.
|
|
124
|
+
*
|
|
125
|
+
* @deprecated Use {@linkcode queryURL} instead.
|
|
119
126
|
*/
|
|
120
127
|
getQueriesURL?: string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Custom URL for query requests sent to your API server.
|
|
130
|
+
* If not provided, uses the default configured in zero-cache.
|
|
131
|
+
*/
|
|
132
|
+
queryURL?: string | undefined;
|
|
121
133
|
/**
|
|
122
134
|
* `onOnlineChange` is called when the Zero instance's online status changes.
|
|
123
135
|
*
|
|
@@ -261,12 +273,12 @@ export interface ZeroOptions<S extends Schema, MD extends CustomMutatorDefs | un
|
|
|
261
273
|
/**
|
|
262
274
|
* Context is passed to Synced Queries when they are executed
|
|
263
275
|
*/
|
|
264
|
-
context?:
|
|
276
|
+
context?: C | undefined;
|
|
265
277
|
}
|
|
266
278
|
/**
|
|
267
279
|
* @deprecated Use {@link ZeroOptions} instead.
|
|
268
280
|
*/
|
|
269
|
-
export interface ZeroAdvancedOptions<S extends Schema, MD extends CustomMutatorDefs | undefined, Context
|
|
281
|
+
export interface ZeroAdvancedOptions<S extends Schema, MD extends AnyMutatorRegistry | CustomMutatorDefs | undefined, Context> extends ZeroOptions<S, MD, Context> {
|
|
270
282
|
}
|
|
271
283
|
type UpdateNeededReasonBase = {
|
|
272
284
|
message?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,CAAC,MAAM,+BAA+B,CAAC;AACnD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version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AAG,SAAS,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAClC,CAAC,SAAS,MAAM,EAChB,EAAE,SAAS,kBAAkB,GAAG,iBAAiB,GAAG,SAAS,EAC7D,OAAO,CACP,SAAQ,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC;CAAG;AAExC,KAAK,sBAAsB,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,CAAC;IAAC,IAAI,EAAE,sBAAsB,CAAC,cAAc,CAAA;CAAC,GAAG,sBAAsB,CAAC,GACxE,CAAC;IACC,IAAI,EAAE,sBAAsB,CAAC,mBAAmB,CAAC;CAClD,GAAG,sBAAsB,CAAC,GAC3B,CAAC;IACC,IAAI,EAAE,sBAAsB,CAAC,yBAAyB,CAAC;CACxD,GAAG,sBAAsB,CAAC,CAAC;AAEhC,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAKzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sources":["../../../../../zero-client/src/client/options.ts"],"sourcesContent":["import type {LogLevel} from '@rocicorp/logger';\nimport type {StoreProvider} from '../../../replicache/src/kv/store.ts';\nimport * as v from '../../../shared/src/valita.ts';\nimport type {Schema} from '../../../zero-types/src/schema.ts';\nimport type {QueryDefinitions} from '../../../zql/src/query/query-definitions.ts';\nimport type {CustomMutatorDefs} from './custom.ts';\nimport {UpdateNeededReasonType} from './update-needed-reason-type.ts';\n\n/**\n * Configuration for {@linkcode Zero}.\n */\nexport interface ZeroOptions<\n S extends Schema,\n MD extends CustomMutatorDefs | undefined = undefined,\n Context = unknown,\n QD extends QueryDefinitions<S, Context> | undefined = undefined,\n> {\n /**\n * URL to the zero-cache. This can be a simple hostname, e.g.\n * - \"https://myapp-myteam.zero.ms\"\n * or a prefix with a single path component, e.g.\n * - \"https://myapp-myteam.zero.ms/zero\"\n * - \"https://myapp-myteam.zero.ms/db\"\n *\n * The latter is useful for configuring routing rules (e.g. \"/zero/\\*\") when\n * the zero-cache is hosted on the same domain as the application. **Note that\n * only a single path segment is allowed (e.g. it cannot be \"/proxy/zero/\\*\")**.\n */\n server?: string | null | undefined;\n\n /**\n * A token to identify and authenticate the user.\n *\n * Set `auth` to `null` or `undefined` if there is no logged in user.\n *\n * When a 401 or 403 HTTP status code is received from your server, Zero will\n * transition to the `needs-auth` connection state. The app should call\n * `zero.connection.connect({auth: newToken})` with a new token to reconnect.\n *\n * The call to `connect` is handled automatically by the ZeroProvider component\n * for React and SolidJS when the `auth` prop changes.\n */\n auth?: string | null | undefined;\n\n /**\n * A unique identifier for the user. Must be non-empty.\n *\n * Each userID gets its own client-side storage so that the app can switch\n * between users without losing state.\n *\n * This must match the `sub` claim of the `auth` token if\n * `auth` is provided.\n */\n userID: string;\n\n /**\n * Distinguishes the storage used by this Zero instance from that of other\n * instances with the same userID. Useful in the case where the app wants to\n * have multiple Zero instances for the same user for different parts of the\n * app.\n */\n storageKey?: string | undefined;\n\n /**\n * Determines the level of detail at which Zero logs messages about\n * its operation. Messages are logged to the `console`.\n *\n * When this is set to `'debug'`, `'info'` and `'error'` messages are also\n * logged. When set to `'info'`, `'info'` and `'error'` but not\n * `'debug'` messages are logged. When set to `'error'` only `'error'`\n * messages are logged.\n *\n * Default is `'error'`.\n */\n logLevel?: LogLevel | undefined;\n\n /**\n * This defines the schema of the tables used in Zero and their relationships\n * to one another.\n */\n schema: S;\n\n /**\n * `mutators` is a map of custom mutator definitions. The keys are\n * namespaces or names of the mutators. The values are the mutator\n * implementations. Client side mutators must be idempotent as a\n * mutation can be rebased multiple times when folding in authoritative\n * changes from the server to the client.\n */\n mutators?: MD | undefined;\n\n /**\n * Custom URL for mutation requests sent to your API server.\n * If not provided, uses the default configured in zero-cache.\n */\n mutateURL?: string | undefined;\n\n /**\n * An object whose values are your custom query definitions. Queries can\n * either be top-level functions or grouped in namespaces (objects).\n *\n * Define queries using the `defineQuery` function to create parameterized\n * queries that can be called with arguments.\n *\n * @example\n * ```ts\n * const z = new Zero({\n * schema,\n * userID,\n * queries: {\n * // Top-level query\n * activeIssues: defineQuery('activeIssues', ({ctx}) =>\n * ctx.query.issue.where('status', '=', 'active')\n * ),\n * // Namespace with multiple queries\n * user: {\n * byID: defineQuery('userByID', ({ctx, args}: {args: string}) =>\n * ctx.query.user.where('id', '=', args)\n * ),\n * },\n * },\n * });\n *\n * // Usage\n * const issues = await z.run(z.query.activeIssues());\n * const user = await z.run(z.query.user.byID('user-123'));\n * ```\n */\n queries?: QD | undefined;\n\n /**\n * Custom URL for query requests sent to your API server.\n * If not provided, uses the default configured in zero-cache.\n */\n getQueriesURL?: string | undefined;\n\n /**\n * `onOnlineChange` is called when the Zero instance's online status changes.\n *\n * @deprecated Use {@linkcode Connection.state.subscribe} on the Zero instance instead. e.g.\n * ```ts\n * const zero = new Zero({...});\n * zero.connection.state.subscribe((state) => {\n * console.log('Connection state:', state.name);\n * });\n * ```\n *\n * Or use a hook like {@linkcode useZeroConnectionState} to subscribe to state changes.\n */\n onOnlineChange?: ((online: boolean) => void) | undefined;\n\n /**\n * `onUpdateNeeded` is called when a client code update is needed.\n *\n * See {@link UpdateNeededReason} for why updates can be needed.\n *\n * The default behavior is to reload the page (using `location.reload()`).\n * Provide your own function to prevent the page from\n * reloading automatically. You may want to display a toast to inform the end\n * user there is a new version of your app available and prompt them to\n * refresh.\n */\n onUpdateNeeded?: ((reason: UpdateNeededReason) => void) | undefined;\n\n /**\n * `onClientStateNotFound` is called when this client is no longer able\n * to sync with the zero-cache due to missing synchronization state. This\n * can be because:\n * - the local persistent synchronization state has been garbage collected.\n * This can happen if the client has no pending mutations and has not been\n * used for a while (e.g. the client's tab has been hidden for a long time).\n * - the zero-cache fails to find the server side synchronization state for\n * this client.\n *\n * The default behavior is to reload the page (using `location.reload()`).\n * Provide your own function to prevent the page from reloading automatically.\n */\n onClientStateNotFound?: (() => void) | undefined;\n\n /**\n * The number of milliseconds to wait before disconnecting a Zero\n * instance whose tab has become hidden.\n *\n * Instances in hidden tabs are disconnected to save resources.\n *\n * Default is 5_000.\n */\n hiddenTabDisconnectDelay?: number | undefined;\n\n /**\n * The number of milliseconds to wait before disconnecting a Zero\n * instance when the connection to the server has timed out.\n *\n * Default is 5 minutes.\n */\n disconnectTimeoutMs?: number | undefined;\n\n /**\n * The timeout in milliseconds for ping operations. This value is used for:\n * - How long to wait in idle before sending a ping to the server\n * - How long to wait for a pong response after sending a ping\n *\n * Total time to detect a dead connection is 2 × pingTimeoutMs.\n *\n * Default is 5_000.\n */\n pingTimeoutMs?: number | undefined;\n\n /**\n * Determines what kind of storage implementation to use on the client.\n *\n * Defaults to `'idb'` which means that Zero uses an IndexedDB storage\n * implementation. This allows the data to be persisted on the client and\n * enables faster syncs between application restarts.\n *\n * By setting this to `'mem'`, Zero uses an in memory storage and\n * the data is not persisted on the client.\n *\n * You can also set this to a function that is used to create new KV stores,\n * allowing a custom implementation of the underlying storage layer.\n */\n kvStore?: 'mem' | 'idb' | StoreProvider | undefined;\n\n /**\n * The maximum number of bytes to allow in a single header.\n *\n * Zero adds some extra information to headers on initialization if possible.\n * This speeds up data synchronization. This number should be kept less than\n * or equal to the maximum header size allowed by the zero-cache and any load\n * balancers.\n *\n * Default value: 8kb.\n */\n maxHeaderLength?: number | undefined;\n\n /**\n * The maximum amount of milliseconds to wait for a materialization to\n * complete (including network/server time) before printing a warning to the\n * console.\n *\n * Default value: 5_000.\n */\n slowMaterializeThreshold?: number | undefined;\n\n /**\n * UI rendering libraries will often provide a utility for batching multiple\n * state updates into a single render. Some examples are React's\n * `unstable_batchedUpdates`, and solid-js's `batch`.\n *\n * This option enables integrating these batch utilities with Zero.\n *\n * When `batchViewUpdates` is provided, Zero will call it whenever\n * it updates query view state with an `applyViewUpdates` function\n * that performs the actual state updates.\n *\n * Zero updates query view state when:\n * 1. creating a new view\n * 2. updating all existing queries' views to a new consistent state\n *\n * When creating a new view, that single view's creation will be wrapped\n * in a `batchViewUpdates` call.\n *\n * When updating existing queries, all queries will be updated in a single\n * `batchViewUpdates` call, so that the transition to the new consistent\n * state can be done in a single render.\n *\n * Implementations must always call `applyViewUpdates` synchronously.\n */\n batchViewUpdates?: ((applyViewUpdates: () => void) => void) | undefined;\n\n /**\n * The maximum number of recent queries, no longer subscribed to by a preload\n * or view, to continue syncing.\n *\n * Defaults is 0.\n *\n * @deprecated Use ttl instead\n */\n maxRecentQueries?: number | undefined;\n\n /**\n * Changes to queries are sent to server in batches. This option controls\n * the number of milliseconds to wait before sending the next batch.\n *\n * Defaults is 10.\n */\n queryChangeThrottleMs?: number | undefined;\n\n /**\n * Context is passed to Synced Queries when they are executed\n */\n // TODO(arv): Mutators should also get context.\n context?: Context | undefined;\n}\n\n/**\n * @deprecated Use {@link ZeroOptions} instead.\n */\nexport interface ZeroAdvancedOptions<\n S extends Schema,\n MD extends CustomMutatorDefs | undefined,\n Context,\n QD extends QueryDefinitions<S, Context> | undefined,\n> extends ZeroOptions<S, MD, Context, QD> {}\n\ntype UpdateNeededReasonBase = {\n message?: string;\n};\n\nexport type UpdateNeededReason =\n | ({type: UpdateNeededReasonType.NewClientGroup} & UpdateNeededReasonBase)\n | ({\n type: UpdateNeededReasonType.VersionNotSupported;\n } & UpdateNeededReasonBase)\n | ({\n type: UpdateNeededReasonType.SchemaVersionNotSupported;\n } & UpdateNeededReasonBase);\n\nexport const updateNeededReasonTypeSchema: v.Type<UpdateNeededReason['type']> =\n v.literalUnion(\n UpdateNeededReasonType.NewClientGroup,\n UpdateNeededReasonType.VersionNotSupported,\n UpdateNeededReasonType.SchemaVersionNotSupported,\n );\n"],"names":["v.literalUnion","UpdateNeededReasonType.NewClientGroup","UpdateNeededReasonType.VersionNotSupported","UpdateNeededReasonType.SchemaVersionNotSupported"],"mappings":";;AA8TO,MAAM,+BACXA;AAAAA,EACEC;AAAAA,EACAC;AAAAA,EACAC;AACF;"}
|
|
1
|
+
{"version":3,"file":"options.js","sources":["../../../../../zero-client/src/client/options.ts"],"sourcesContent":["import type {LogLevel} from '@rocicorp/logger';\nimport type {StoreProvider} from '../../../replicache/src/kv/store.ts';\nimport * as v from '../../../shared/src/valita.ts';\nimport type {Schema} from '../../../zero-types/src/schema.ts';\nimport type {AnyMutatorRegistry} from '../../../zql/src/mutate/mutator-registry.ts';\nimport type {CustomMutatorDefs} from './custom.ts';\nimport {UpdateNeededReasonType} from './update-needed-reason-type.ts';\n\n/**\n * Configuration for {@linkcode Zero}.\n */\nexport interface ZeroOptions<\n S extends Schema,\n MD extends AnyMutatorRegistry | CustomMutatorDefs | undefined = undefined,\n C = unknown,\n> {\n /**\n * URL to the zero-cache. This can be a simple hostname, e.g.\n * - \"https://myapp-myteam.zero.ms\"\n * or a prefix with a single path component, e.g.\n * - \"https://myapp-myteam.zero.ms/zero\"\n * - \"https://myapp-myteam.zero.ms/db\"\n *\n * The latter is useful for configuring routing rules (e.g. \"/zero/\\*\") when\n * the zero-cache is hosted on the same domain as the application. **Note that\n * only a single path segment is allowed (e.g. it cannot be \"/proxy/zero/\\*\")**.\n */\n cacheURL?: string | null | undefined;\n\n /**\n * @deprecated Use {@linkcode cacheURL} instead.\n */\n server?: string | null | undefined;\n\n /**\n * A token to identify and authenticate the user.\n *\n * Set `auth` to `null` or `undefined` if there is no logged in user.\n *\n * When a 401 or 403 HTTP status code is received from your server, Zero will\n * transition to the `needs-auth` connection state. The app should call\n * `zero.connection.connect({auth: newToken})` with a new token to reconnect.\n *\n * The call to `connect` is handled automatically by the ZeroProvider component\n * for React and SolidJS when the `auth` prop changes.\n */\n auth?: string | null | undefined;\n\n /**\n * A unique identifier for the user. Must be non-empty.\n *\n * Each userID gets its own client-side storage so that the app can switch\n * between users without losing state.\n *\n * This must match the `sub` claim of the `auth` token if\n * `auth` is provided.\n */\n userID: string;\n\n /**\n * Distinguishes the storage used by this Zero instance from that of other\n * instances with the same userID. Useful in the case where the app wants to\n * have multiple Zero instances for the same user for different parts of the\n * app.\n */\n storageKey?: string | undefined;\n\n /**\n * Determines the level of detail at which Zero logs messages about\n * its operation. Messages are logged to the `console`.\n *\n * When this is set to `'debug'`, `'info'` and `'error'` messages are also\n * logged. When set to `'info'`, `'info'` and `'error'` but not\n * `'debug'` messages are logged. When set to `'error'` only `'error'`\n * messages are logged.\n *\n * Default is `'error'`.\n */\n logLevel?: LogLevel | undefined;\n\n /**\n * This defines the schema of the tables used in Zero and their relationships\n * to one another.\n */\n schema: S;\n\n /**\n * `mutators` is a map of custom mutator definitions. The keys are\n * namespaces or names of the mutators. The values are the mutator\n * implementations. Client side mutators must be idempotent as a\n * mutation can be rebased multiple times when folding in authoritative\n * changes from the server to the client.\n *\n * Define mutators using the `defineMutator` function to create type-safe,\n * parameterized mutations. Mutators can be top-level or grouped in namespaces.\n *\n * @example\n * ```ts\n * import {defineMutator} from '@rocicorp/zero';\n *\n * const z = new Zero({\n * schema,\n * userID,\n * mutators: {\n * // Top-level mutator\n * increment: defineMutator(({tx, args}: {tx: Transaction<Schema>, args: {id: string}}) =>\n * tx.mutate.counter.update({id: args.id, value: tx.query.counter.where('id', '=', args.id).value + 1})\n * ),\n * // Namespace with multiple mutators\n * issues: {\n * create: defineMutator(({tx, args}: {tx: Transaction<Schema>, args: {title: string}}) =>\n * tx.mutate.issues.insert({id: nanoid(), title: args.title, status: 'open'})\n * ),\n * close: defineMutator(({tx, args}: {tx: Transaction<Schema>, args: {id: string}}) =>\n * tx.mutate.issues.update({id: args.id, status: 'closed'})\n * ),\n * },\n * },\n * });\n *\n * // Usage\n * await z.mutate.increment({id: 'counter-1'}).client;\n * await z.mutate.issues.create({title: 'New issue'}).client;\n * await z.mutate.issues.close({id: 'issue-123'}).client;\n * ```\n */\n mutators?: MD | undefined;\n\n /**\n * Custom URL for mutation requests sent to your API server.\n * If not provided, uses the default configured in zero-cache.\n */\n mutateURL?: string | undefined;\n\n /**\n * Custom URL for query requests sent to your API server.\n * If not provided, uses the default configured in zero-cache.\n *\n * @deprecated Use {@linkcode queryURL} instead.\n */\n getQueriesURL?: string | undefined;\n\n /**\n * Custom URL for query requests sent to your API server.\n * If not provided, uses the default configured in zero-cache.\n */\n queryURL?: string | undefined;\n\n /**\n * `onOnlineChange` is called when the Zero instance's online status changes.\n *\n * @deprecated Use {@linkcode Connection.state.subscribe} on the Zero instance instead. e.g.\n * ```ts\n * const zero = new Zero({...});\n * zero.connection.state.subscribe((state) => {\n * console.log('Connection state:', state.name);\n * });\n * ```\n *\n * Or use a hook like {@linkcode useZeroConnectionState} to subscribe to state changes.\n */\n onOnlineChange?: ((online: boolean) => void) | undefined;\n\n /**\n * `onUpdateNeeded` is called when a client code update is needed.\n *\n * See {@link UpdateNeededReason} for why updates can be needed.\n *\n * The default behavior is to reload the page (using `location.reload()`).\n * Provide your own function to prevent the page from\n * reloading automatically. You may want to display a toast to inform the end\n * user there is a new version of your app available and prompt them to\n * refresh.\n */\n onUpdateNeeded?: ((reason: UpdateNeededReason) => void) | undefined;\n\n /**\n * `onClientStateNotFound` is called when this client is no longer able\n * to sync with the zero-cache due to missing synchronization state. This\n * can be because:\n * - the local persistent synchronization state has been garbage collected.\n * This can happen if the client has no pending mutations and has not been\n * used for a while (e.g. the client's tab has been hidden for a long time).\n * - the zero-cache fails to find the server side synchronization state for\n * this client.\n *\n * The default behavior is to reload the page (using `location.reload()`).\n * Provide your own function to prevent the page from reloading automatically.\n */\n onClientStateNotFound?: (() => void) | undefined;\n\n /**\n * The number of milliseconds to wait before disconnecting a Zero\n * instance whose tab has become hidden.\n *\n * Instances in hidden tabs are disconnected to save resources.\n *\n * Default is 5_000.\n */\n hiddenTabDisconnectDelay?: number | undefined;\n\n /**\n * The number of milliseconds to wait before disconnecting a Zero\n * instance when the connection to the server has timed out.\n *\n * Default is 5 minutes.\n */\n disconnectTimeoutMs?: number | undefined;\n\n /**\n * The timeout in milliseconds for ping operations. This value is used for:\n * - How long to wait in idle before sending a ping to the server\n * - How long to wait for a pong response after sending a ping\n *\n * Total time to detect a dead connection is 2 × pingTimeoutMs.\n *\n * Default is 5_000.\n */\n pingTimeoutMs?: number | undefined;\n\n /**\n * Determines what kind of storage implementation to use on the client.\n *\n * Defaults to `'idb'` which means that Zero uses an IndexedDB storage\n * implementation. This allows the data to be persisted on the client and\n * enables faster syncs between application restarts.\n *\n * By setting this to `'mem'`, Zero uses an in memory storage and\n * the data is not persisted on the client.\n *\n * You can also set this to a function that is used to create new KV stores,\n * allowing a custom implementation of the underlying storage layer.\n */\n kvStore?: 'mem' | 'idb' | StoreProvider | undefined;\n\n /**\n * The maximum number of bytes to allow in a single header.\n *\n * Zero adds some extra information to headers on initialization if possible.\n * This speeds up data synchronization. This number should be kept less than\n * or equal to the maximum header size allowed by the zero-cache and any load\n * balancers.\n *\n * Default value: 8kb.\n */\n maxHeaderLength?: number | undefined;\n\n /**\n * The maximum amount of milliseconds to wait for a materialization to\n * complete (including network/server time) before printing a warning to the\n * console.\n *\n * Default value: 5_000.\n */\n slowMaterializeThreshold?: number | undefined;\n\n /**\n * UI rendering libraries will often provide a utility for batching multiple\n * state updates into a single render. Some examples are React's\n * `unstable_batchedUpdates`, and solid-js's `batch`.\n *\n * This option enables integrating these batch utilities with Zero.\n *\n * When `batchViewUpdates` is provided, Zero will call it whenever\n * it updates query view state with an `applyViewUpdates` function\n * that performs the actual state updates.\n *\n * Zero updates query view state when:\n * 1. creating a new view\n * 2. updating all existing queries' views to a new consistent state\n *\n * When creating a new view, that single view's creation will be wrapped\n * in a `batchViewUpdates` call.\n *\n * When updating existing queries, all queries will be updated in a single\n * `batchViewUpdates` call, so that the transition to the new consistent\n * state can be done in a single render.\n *\n * Implementations must always call `applyViewUpdates` synchronously.\n */\n batchViewUpdates?: ((applyViewUpdates: () => void) => void) | undefined;\n\n /**\n * The maximum number of recent queries, no longer subscribed to by a preload\n * or view, to continue syncing.\n *\n * Defaults is 0.\n *\n * @deprecated Use ttl instead\n */\n maxRecentQueries?: number | undefined;\n\n /**\n * Changes to queries are sent to server in batches. This option controls\n * the number of milliseconds to wait before sending the next batch.\n *\n * Defaults is 10.\n */\n queryChangeThrottleMs?: number | undefined;\n\n /**\n * Context is passed to Synced Queries when they are executed\n */\n // TODO(arv): Mutators should also get context.\n context?: C | undefined;\n}\n\n/**\n * @deprecated Use {@link ZeroOptions} instead.\n */\nexport interface ZeroAdvancedOptions<\n S extends Schema,\n MD extends AnyMutatorRegistry | CustomMutatorDefs | undefined,\n Context,\n> extends ZeroOptions<S, MD, Context> {}\n\ntype UpdateNeededReasonBase = {\n message?: string;\n};\n\nexport type UpdateNeededReason =\n | ({type: UpdateNeededReasonType.NewClientGroup} & UpdateNeededReasonBase)\n | ({\n type: UpdateNeededReasonType.VersionNotSupported;\n } & UpdateNeededReasonBase)\n | ({\n type: UpdateNeededReasonType.SchemaVersionNotSupported;\n } & UpdateNeededReasonBase);\n\nexport const updateNeededReasonTypeSchema: v.Type<UpdateNeededReason['type']> =\n v.literalUnion(\n UpdateNeededReasonType.NewClientGroup,\n UpdateNeededReasonType.VersionNotSupported,\n UpdateNeededReasonType.SchemaVersionNotSupported,\n );\n"],"names":["v.literalUnion","UpdateNeededReasonType.NewClientGroup","UpdateNeededReasonType.VersionNotSupported","UpdateNeededReasonType.SchemaVersionNotSupported"],"mappings":";;AAyUO,MAAM,+BACXA;AAAAA,EACEC;AAAAA,EACAC;AAAAA,EACAC;AACF;"}
|
|
@@ -5,7 +5,6 @@ import type { Puller } from '../../../replicache/src/puller.ts';
|
|
|
5
5
|
import type { Pusher } from '../../../replicache/src/pusher.ts';
|
|
6
6
|
import type { ClientGroupID, ClientID } from '../../../replicache/src/sync/ids.ts';
|
|
7
7
|
import type { MutatorDefs } from '../../../replicache/src/types.ts';
|
|
8
|
-
import type { DeepMerge } from '../../../shared/src/deep-merge.ts';
|
|
9
8
|
import { Subscribable } from '../../../shared/src/subscribable.ts';
|
|
10
9
|
import { type ClientSchema } from '../../../zero-protocol/src/client-schema.ts';
|
|
11
10
|
import type { DeleteClientsBody } from '../../../zero-protocol/src/delete-clients.ts';
|
|
@@ -13,41 +12,25 @@ import type { UpQueriesPatchOp } from '../../../zero-protocol/src/queries-patch.
|
|
|
13
12
|
import type { NullableVersion } from '../../../zero-protocol/src/version.ts';
|
|
14
13
|
import type { Schema } from '../../../zero-types/src/schema.ts';
|
|
15
14
|
import type { ViewFactory } from '../../../zql/src/ivm/view.ts';
|
|
16
|
-
import type
|
|
15
|
+
import { type AnyMutatorRegistry } from '../../../zql/src/mutate/mutator-registry.ts';
|
|
16
|
+
import type { MutationRequest } from '../../../zql/src/mutate/mutator.ts';
|
|
17
17
|
import type { QueryDelegate } from '../../../zql/src/query/query-delegate.ts';
|
|
18
|
-
import { type HumanReadable, type MaterializeOptions, type PreloadOptions, type PullRow, type
|
|
18
|
+
import { type HumanReadable, type MaterializeOptions, type PreloadOptions, type PullRow, type RunOptions, type ToQuery } from '../../../zql/src/query/query.ts';
|
|
19
|
+
import type { SchemaQuery } from '../../../zql/src/query/schema-query.ts';
|
|
19
20
|
import type { TypedView } from '../../../zql/src/query/typed-view.ts';
|
|
20
21
|
import { ActiveClientsManager } from './active-clients-manager.ts';
|
|
21
22
|
import { ConnectionManager } from './connection-manager.ts';
|
|
22
23
|
import { type Connection } from './connection.ts';
|
|
23
|
-
import { type BatchMutator
|
|
24
|
-
import type { CustomMutatorDefs,
|
|
24
|
+
import { type BatchMutator } from './crud.ts';
|
|
25
|
+
import type { CustomMutatorDefs, MutatorResult } from './custom.ts';
|
|
25
26
|
import { DeleteClientsManager } from './delete-clients-manager.ts';
|
|
26
27
|
import { type HTTPString, type WSString } from './http-string.ts';
|
|
27
28
|
import { Inspector } from './inspector/inspector.ts';
|
|
28
29
|
import { type LogOptions } from './log-options.ts';
|
|
30
|
+
import type { MakeMutatePropertyType } from './make-mutate-property.ts';
|
|
29
31
|
import type { ZeroOptions } from './options.ts';
|
|
30
32
|
import { QueryManager } from './query-manager.ts';
|
|
31
33
|
export type NoRelations = Record<string, never>;
|
|
32
|
-
export type MakeEntityQueriesFromSchema<S extends Schema> = {
|
|
33
|
-
readonly [K in keyof S['tables'] & string]: Query<S, K>;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* The shape exposed on the `Zero.query` instance with custom queries.
|
|
37
|
-
* Custom defined queries are added as properties that can be called to create query objects.
|
|
38
|
-
*/
|
|
39
|
-
export type MakeCustomQueryInterfaces<S extends Schema, QD extends QueryDefinitions<S, TContext>, TContext> = {
|
|
40
|
-
readonly [NamespaceOrName in keyof QD]: QD[NamespaceOrName] extends (options: {
|
|
41
|
-
ctx: TContext;
|
|
42
|
-
args: infer Args;
|
|
43
|
-
}) => Query<S, infer TTable, infer TReturn> ? [Args] extends [undefined] ? () => Query<S, TTable & string, TReturn> : undefined extends Args ? (args?: Args) => Query<S, TTable & string, TReturn> : (args: Args) => Query<S, TTable & string, TReturn> : {
|
|
44
|
-
readonly [P in keyof QD[NamespaceOrName]]: MakeCustomQueryInterface<S, QD[NamespaceOrName][P], TContext>;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export type MakeCustomQueryInterface<TSchema extends Schema, F, TContext> = F extends (options: {
|
|
48
|
-
ctx: TContext;
|
|
49
|
-
args: infer Args;
|
|
50
|
-
}) => Query<TSchema, infer TTable, infer TReturn> ? [Args] extends [undefined] ? () => Query<TSchema, TTable & string, TReturn> : undefined extends Args ? (args?: Args) => Query<TSchema, TTable & string, TReturn> : (args: Args) => Query<TSchema, TTable & string, TReturn> : never;
|
|
51
34
|
export type TestingContext = {
|
|
52
35
|
puller: Puller;
|
|
53
36
|
pusher: Pusher;
|
|
@@ -89,7 +72,7 @@ export interface ReplicacheInternalAPI {
|
|
|
89
72
|
lastMutationID(): number;
|
|
90
73
|
}
|
|
91
74
|
export declare function getInternalReplicacheImplForTesting(z: object): ReplicacheImpl<MutatorDefs>;
|
|
92
|
-
export declare class Zero<const S extends Schema, MD extends CustomMutatorDefs | undefined = undefined,
|
|
75
|
+
export declare class Zero<const S extends Schema, MD extends AnyMutatorRegistry | CustomMutatorDefs | undefined = undefined, C = unknown> {
|
|
93
76
|
#private;
|
|
94
77
|
readonly version: string;
|
|
95
78
|
readonly userID: string;
|
|
@@ -104,11 +87,16 @@ export declare class Zero<const S extends Schema, MD extends CustomMutatorDefs |
|
|
|
104
87
|
* The new value will take effect on the next ping cycle.
|
|
105
88
|
*/
|
|
106
89
|
pingTimeoutMs: number;
|
|
107
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Query builders for each table in the schema.
|
|
92
|
+
*
|
|
93
|
+
* @deprecated Use {@linkcode createBuilder} to create query builders instead.
|
|
94
|
+
*/
|
|
95
|
+
readonly query: SchemaQuery<S>;
|
|
108
96
|
/**
|
|
109
97
|
* Constructs a new Zero client.
|
|
110
98
|
*/
|
|
111
|
-
constructor(options: ZeroOptions<S, MD,
|
|
99
|
+
constructor(options: ZeroOptions<S, MD, C>);
|
|
112
100
|
/**
|
|
113
101
|
* Preloads data for a query into the cache, without keeping it in memory.
|
|
114
102
|
*
|
|
@@ -126,7 +114,7 @@ export declare class Zero<const S extends Schema, MD extends CustomMutatorDefs |
|
|
|
126
114
|
* // Now the data is cached and can be used immediately
|
|
127
115
|
* ```
|
|
128
116
|
*/
|
|
129
|
-
preload<TTable extends keyof S['tables'] & string, TReturn extends PullRow<TTable, S>>(query:
|
|
117
|
+
preload<TTable extends keyof S['tables'] & string, TReturn extends PullRow<TTable, S>>(query: ToQuery<S, TTable, TReturn, C>, options?: PreloadOptions): {
|
|
130
118
|
cleanup: () => void;
|
|
131
119
|
complete: Promise<void>;
|
|
132
120
|
};
|
|
@@ -150,8 +138,8 @@ export declare class Zero<const S extends Schema, MD extends CustomMutatorDefs |
|
|
|
150
138
|
* const cachedUsers = await zero.run(userQuery, {type: 'unknown'});
|
|
151
139
|
* ```
|
|
152
140
|
*/
|
|
153
|
-
run<TTable extends keyof S['tables'] & string, TReturn>(query:
|
|
154
|
-
get context():
|
|
141
|
+
run<TTable extends keyof S['tables'] & string, TReturn>(query: ToQuery<S, TTable, TReturn, C>, runOptions?: RunOptions): Promise<HumanReadable<TReturn>>;
|
|
142
|
+
get context(): C;
|
|
155
143
|
/**
|
|
156
144
|
* Creates a materialized view of a query that stays synchronized with the database.
|
|
157
145
|
*
|
|
@@ -176,8 +164,8 @@ export declare class Zero<const S extends Schema, MD extends CustomMutatorDefs |
|
|
|
176
164
|
* const customView = zero.materialize(userQuery, (query) => new MyCustomView(query));
|
|
177
165
|
* ```
|
|
178
166
|
*/
|
|
179
|
-
materialize<TTable extends keyof S['tables'] & string, TReturn>(query:
|
|
180
|
-
materialize<T, TTable extends keyof S['tables'] & string, TReturn>(query:
|
|
167
|
+
materialize<TTable extends keyof S['tables'] & string, TReturn>(query: ToQuery<S, TTable, TReturn, C>, options?: MaterializeOptions): TypedView<HumanReadable<TReturn>>;
|
|
168
|
+
materialize<T, TTable extends keyof S['tables'] & string, TReturn>(query: ToQuery<S, TTable, TReturn, C>, factory: ViewFactory<S, TTable, TReturn, T>, options?: MaterializeOptions): T;
|
|
181
169
|
/**
|
|
182
170
|
* The server URL that this Zero instance is configured with.
|
|
183
171
|
*/
|
|
@@ -235,7 +223,7 @@ export declare class Zero<const S extends Schema, MD extends CustomMutatorDefs |
|
|
|
235
223
|
* await zero.mutate.issue.update({id: '1', title: 'Updated title'});
|
|
236
224
|
* ```
|
|
237
225
|
*/
|
|
238
|
-
readonly mutate:
|
|
226
|
+
readonly mutate: MakeMutatePropertyType<S, MD, C> & ((mr: MutationRequest<S, C, any, any>) => MutatorResult);
|
|
239
227
|
/**
|
|
240
228
|
* Provides a way to batch multiple CRUD mutations together:
|
|
241
229
|
*
|
|
@@ -252,6 +240,8 @@ export declare class Zero<const S extends Schema, MD extends CustomMutatorDefs |
|
|
|
252
240
|
*
|
|
253
241
|
* `mutateBatch` is not allowed inside another `mutateBatch` call. Doing so
|
|
254
242
|
* will throw an error.
|
|
243
|
+
*
|
|
244
|
+
* @deprecated Use `zero.mutate(mutationRequest)`
|
|
255
245
|
*/
|
|
256
246
|
readonly mutateBatch: BatchMutator<S>;
|
|
257
247
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/zero.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgB,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAC,KAAK,QAAQ,EAAW,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EACL,cAAc,EAEf,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAC,MAAM,EAAe,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAC,MAAM,EAAe,MAAM,mCAAmC,CAAC;AAE5E,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACT,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EACV,WAAW,
|
|
1
|
+
{"version":3,"file":"zero.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/zero.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgB,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAC,KAAK,QAAQ,EAAW,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EACL,cAAc,EAEf,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAC,MAAM,EAAe,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAC,MAAM,EAAe,MAAM,mCAAmC,CAAC;AAE5E,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACT,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EACV,WAAW,EAEZ,MAAM,kCAAkC,CAAC;AAc1C,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AAGjE,OAAO,EAAC,KAAK,YAAY,EAAC,MAAM,6CAA6C,CAAC;AAG9E,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,8CAA8C,CAAC;AA6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