@rocicorp/zero 0.24.2025102200 → 0.25.0-canary.1
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/{chunk-PIXC6O7W.js → chunk-55BOUNXO.js} +3 -3
- package/out/chunk-55BOUNXO.js.map +7 -0
- package/out/{chunk-JS2ABYXG.js → chunk-AIPM77UE.js} +2762 -674
- package/out/chunk-AIPM77UE.js.map +7 -0
- package/out/{chunk-VHLCXJ6Q.js → chunk-TJFNGO7E.js} +4 -2
- package/out/{chunk-VHLCXJ6Q.js.map → chunk-TJFNGO7E.js.map} +2 -2
- package/out/{lazy-inspector-NCBESZMS.js → lazy-inspector-OXIFYSSQ.js} +2 -2
- package/out/react.js +16 -4
- package/out/react.js.map +4 -4
- package/out/replicache/src/dag/lazy-store.d.ts +1 -1
- package/out/replicache/src/dag/lazy-store.d.ts.map +1 -1
- package/out/replicache/src/log-options.d.ts +1 -1
- package/out/replicache/src/log-options.d.ts.map +1 -1
- package/out/replicache/src/persist/collect-idb-databases.d.ts +3 -3
- package/out/replicache/src/persist/collect-idb-databases.d.ts.map +1 -1
- package/out/replicache/src/replicache-options.d.ts +1 -1
- package/out/replicache/src/replicache-options.d.ts.map +1 -1
- package/out/shared/src/options.d.ts +1 -1
- package/out/shared/src/options.d.ts.map +1 -1
- package/out/shared/src/promise-race.d.ts +17 -0
- package/out/shared/src/promise-race.d.ts.map +1 -0
- package/out/solid.js +19 -6
- package/out/solid.js.map +4 -4
- package/out/z2s/src/compiler.d.ts +1 -1
- package/out/z2s/src/compiler.d.ts.map +1 -1
- package/out/z2s/src/compiler.js +1 -1
- package/out/z2s/src/compiler.js.map +1 -1
- package/out/z2s/src/sql.d.ts.map +1 -1
- package/out/z2s/src/sql.js +1 -1
- package/out/z2s/src/sql.js.map +1 -1
- package/out/zero/package.json +5 -4
- package/out/zero-cache/src/config/zero-config.d.ts +12 -0
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +36 -0
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/custom/fetch.d.ts +3 -1
- package/out/zero-cache/src/custom/fetch.d.ts.map +1 -1
- package/out/zero-cache/src/custom/fetch.js +101 -24
- package/out/zero-cache/src/custom/fetch.js.map +1 -1
- package/out/zero-cache/src/custom-queries/transform-query.d.ts +2 -6
- package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +1 -1
- package/out/zero-cache/src/custom-queries/transform-query.js +42 -41
- package/out/zero-cache/src/custom-queries/transform-query.js.map +1 -1
- package/out/zero-cache/src/db/create.d.ts +4 -0
- package/out/zero-cache/src/db/create.d.ts.map +1 -1
- package/out/zero-cache/src/db/create.js +7 -9
- package/out/zero-cache/src/db/create.js.map +1 -1
- package/out/zero-cache/src/db/lite-tables.d.ts.map +1 -1
- package/out/zero-cache/src/db/lite-tables.js +38 -17
- package/out/zero-cache/src/db/lite-tables.js.map +1 -1
- package/out/zero-cache/src/db/pg-to-lite.d.ts.map +1 -1
- package/out/zero-cache/src/db/pg-to-lite.js +7 -6
- package/out/zero-cache/src/db/pg-to-lite.js.map +1 -1
- package/out/zero-cache/src/db/specs.d.ts +24 -19
- package/out/zero-cache/src/db/specs.d.ts.map +1 -1
- package/out/zero-cache/src/db/specs.js.map +1 -1
- package/out/zero-cache/src/server/change-streamer.d.ts.map +1 -1
- package/out/zero-cache/src/server/change-streamer.js +1 -1
- package/out/zero-cache/src/server/change-streamer.js.map +1 -1
- package/out/zero-cache/src/server/inspector-delegate.d.ts.map +1 -1
- package/out/zero-cache/src/server/inspector-delegate.js +5 -1
- package/out/zero-cache/src/server/inspector-delegate.js.map +1 -1
- package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/server/syncer.js +1 -1
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/change-source/column-metadata.d.ts +65 -0
- package/out/zero-cache/src/services/change-source/column-metadata.d.ts.map +1 -0
- package/out/zero-cache/src/services/change-source/column-metadata.js +198 -0
- package/out/zero-cache/src/services/change-source/column-metadata.js.map +1 -0
- package/out/zero-cache/src/services/change-source/pg/change-source.js +1 -0
- package/out/zero-cache/src/services/change-source/pg/change-source.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.js +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.d.ts +25 -25
- package/out/zero-cache/src/services/change-source/pg/schema/published.d.ts +10 -10
- package/out/zero-cache/src/services/change-source/pg/schema/shard.d.ts +5 -5
- package/out/zero-cache/src/services/change-source/protocol/current/data.d.ts +16 -16
- package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts +24 -24
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +2 -1
- 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 +18 -2
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +8 -8
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +9 -7
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +4 -4
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.js +74 -56
- package/out/zero-cache/src/services/mutagen/pusher.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +3 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.js +10 -6
- package/out/zero-cache/src/services/view-syncer/client-handler.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.js +7 -4
- package/out/zero-cache/src/services/view-syncer/client-schema.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +4 -4
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.js +15 -6
- package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.js +4 -2
- package/out/zero-cache/src/services/view-syncer/cvr.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/key-columns.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/key-columns.js +4 -2
- package/out/zero-cache/src/services/view-syncer/key-columns.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +2 -2
- 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 +57 -27
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +11 -6
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/snapshotter.js +34 -22
- package/out/zero-cache/src/services/view-syncer/snapshotter.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.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 +111 -51
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/types/error-with-level.d.ts +9 -0
- package/out/zero-cache/src/types/error-with-level.d.ts.map +1 -0
- package/out/zero-cache/src/types/error-with-level.js +24 -0
- package/out/zero-cache/src/types/error-with-level.js.map +1 -0
- package/out/zero-cache/src/types/lite.d.ts +15 -13
- package/out/zero-cache/src/types/lite.d.ts.map +1 -1
- package/out/zero-cache/src/types/lite.js +17 -5
- package/out/zero-cache/src/types/lite.js.map +1 -1
- package/out/zero-cache/src/types/pg-data-type.d.ts +73 -0
- package/out/zero-cache/src/types/pg-data-type.d.ts.map +1 -0
- package/out/zero-cache/src/types/pg-data-type.js +76 -0
- package/out/zero-cache/src/types/pg-data-type.js.map +1 -0
- package/out/zero-cache/src/types/pg.d.ts +1 -73
- package/out/zero-cache/src/types/pg.d.ts.map +1 -1
- package/out/zero-cache/src/types/pg.js +0 -77
- package/out/zero-cache/src/types/pg.js.map +1 -1
- package/out/zero-cache/src/types/processes.d.ts +1 -1
- package/out/zero-cache/src/types/processes.d.ts.map +1 -1
- package/out/zero-cache/src/types/processes.js.map +1 -1
- package/out/zero-cache/src/types/schema-versions.d.ts +7 -3
- package/out/zero-cache/src/types/schema-versions.d.ts.map +1 -1
- package/out/zero-cache/src/types/schema-versions.js +7 -5
- package/out/zero-cache/src/types/schema-versions.js.map +1 -1
- package/out/zero-cache/src/types/subscription.d.ts +1 -1
- package/out/zero-cache/src/types/subscription.js +1 -1
- package/out/zero-cache/src/types/websocket-handoff.d.ts +3 -3
- package/out/zero-cache/src/types/websocket-handoff.d.ts.map +1 -1
- package/out/zero-cache/src/types/websocket-handoff.js +6 -4
- package/out/zero-cache/src/types/websocket-handoff.js.map +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +6 -1
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js +26 -9
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js +7 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js.map +1 -1
- package/out/zero-cache/src/workers/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer.js +21 -1
- package/out/zero-cache/src/workers/syncer.js.map +1 -1
- package/out/zero-client/src/client/client-error-kind-enum.d.ts +27 -0
- package/out/zero-client/src/client/client-error-kind-enum.d.ts.map +1 -0
- package/out/zero-client/src/client/client-error-kind.d.ts +5 -0
- package/out/zero-client/src/client/client-error-kind.d.ts.map +1 -0
- package/out/zero-client/src/client/connection-manager.d.ts +138 -0
- package/out/zero-client/src/client/connection-manager.d.ts.map +1 -0
- package/out/zero-client/src/client/connection-status-enum.d.ts +11 -0
- package/out/zero-client/src/client/connection-status-enum.d.ts.map +1 -0
- package/out/zero-client/src/client/connection-status.d.ts +5 -0
- package/out/zero-client/src/client/connection-status.d.ts.map +1 -0
- package/out/zero-client/src/client/connection.d.ts +45 -0
- package/out/zero-client/src/client/connection.d.ts.map +1 -0
- package/out/zero-client/src/client/crud.d.ts.map +1 -1
- package/out/zero-client/src/client/error.d.ts +192 -0
- package/out/zero-client/src/client/error.d.ts.map +1 -0
- package/out/zero-client/src/client/ivm-branch.d.ts +2 -2
- package/out/zero-client/src/client/ivm-branch.d.ts.map +1 -1
- package/out/zero-client/src/client/metric-name.d.ts +5 -0
- package/out/zero-client/src/client/metric-name.d.ts.map +1 -0
- package/out/zero-client/src/client/metrics.d.ts +12 -9
- package/out/zero-client/src/client/metrics.d.ts.map +1 -1
- package/out/zero-client/src/client/mutation-tracker.d.ts +5 -4
- package/out/zero-client/src/client/mutation-tracker.d.ts.map +1 -1
- package/out/zero-client/src/client/options.d.ts +6 -2
- package/out/zero-client/src/client/options.d.ts.map +1 -1
- package/out/zero-client/src/client/query-manager.d.ts +5 -4
- package/out/zero-client/src/client/query-manager.d.ts.map +1 -1
- package/out/zero-client/src/client/zero-rep.d.ts +1 -1
- package/out/zero-client/src/client/zero-rep.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.d.ts +55 -11
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/mod.d.ts +9 -1
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-protocol/src/ast.d.ts +2 -0
- package/out/zero-protocol/src/ast.d.ts.map +1 -1
- package/out/zero-protocol/src/ast.js +1 -0
- package/out/zero-protocol/src/ast.js.map +1 -1
- package/out/zero-protocol/src/custom-queries.d.ts +75 -4
- package/out/zero-protocol/src/custom-queries.d.ts.map +1 -1
- package/out/zero-protocol/src/custom-queries.js +18 -1
- package/out/zero-protocol/src/custom-queries.js.map +1 -1
- package/out/zero-protocol/src/down.d.ts +1 -1
- package/out/zero-protocol/src/error-kind-enum.d.ts +65 -0
- package/out/zero-protocol/src/error-kind-enum.d.ts.map +1 -1
- package/out/zero-protocol/src/error-kind-enum.js +2 -0
- package/out/zero-protocol/src/error-kind-enum.js.map +1 -1
- package/out/zero-protocol/src/error-origin-enum.d.ts +7 -0
- package/out/zero-protocol/src/error-origin-enum.d.ts.map +1 -0
- package/out/zero-protocol/src/error-origin-enum.js +4 -0
- package/out/zero-protocol/src/error-origin-enum.js.map +1 -0
- package/out/zero-protocol/src/error-origin.d.ts +5 -0
- package/out/zero-protocol/src/error-origin.d.ts.map +1 -0
- package/out/zero-protocol/src/error-origin.js +3 -0
- package/out/zero-protocol/src/error-origin.js.map +1 -0
- package/out/zero-protocol/src/error-reason-enum.d.ts +15 -0
- package/out/zero-protocol/src/error-reason-enum.d.ts.map +1 -0
- package/out/zero-protocol/src/error-reason-enum.js +8 -0
- package/out/zero-protocol/src/error-reason-enum.js.map +1 -0
- package/out/zero-protocol/src/error-reason.d.ts +5 -0
- package/out/zero-protocol/src/error-reason.d.ts.map +1 -0
- package/out/zero-protocol/src/error-reason.js +3 -0
- package/out/zero-protocol/src/error-reason.js.map +1 -0
- package/out/zero-protocol/src/error.d.ts +139 -1
- package/out/zero-protocol/src/error.d.ts.map +1 -1
- package/out/zero-protocol/src/error.js +64 -2
- package/out/zero-protocol/src/error.js.map +1 -1
- package/out/zero-protocol/src/mutation-id.d.ts +7 -0
- package/out/zero-protocol/src/mutation-id.d.ts.map +1 -0
- package/out/zero-protocol/src/mutation-id.js +6 -0
- package/out/zero-protocol/src/mutation-id.js.map +1 -0
- package/out/zero-protocol/src/mutations-patch.d.ts +3 -3
- package/out/zero-protocol/src/mutations-patch.d.ts.map +1 -1
- package/out/zero-protocol/src/mutations-patch.js +2 -1
- package/out/zero-protocol/src/mutations-patch.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 +2 -1
- package/out/zero-protocol/src/protocol-version.js.map +1 -1
- package/out/zero-protocol/src/push.d.ts +138 -13
- package/out/zero-protocol/src/push.d.ts.map +1 -1
- package/out/zero-protocol/src/push.js +34 -13
- package/out/zero-protocol/src/push.js.map +1 -1
- package/out/zero-react/src/mod.d.ts +2 -1
- package/out/zero-react/src/mod.d.ts.map +1 -1
- package/out/zero-react/src/use-zero-connection-state.d.ts +9 -0
- package/out/zero-react/src/use-zero-connection-state.d.ts.map +1 -0
- package/out/zero-react/src/use-zero-online.d.ts +2 -0
- package/out/zero-react/src/use-zero-online.d.ts.map +1 -1
- package/out/zero-schema/src/builder/relationship-builder.d.ts +20 -18
- package/out/zero-schema/src/builder/relationship-builder.d.ts.map +1 -1
- package/out/zero-schema/src/builder/relationship-builder.js.map +1 -1
- package/out/zero-server/src/adapters/drizzle.d.ts +2 -3
- package/out/zero-server/src/adapters/drizzle.d.ts.map +1 -1
- package/out/zero-server/src/adapters/drizzle.js.map +1 -1
- package/out/zero-server/src/adapters/pg.d.ts +1 -0
- package/out/zero-server/src/adapters/pg.d.ts.map +1 -1
- package/out/zero-server/src/adapters/pg.js.map +1 -1
- package/out/zero-server/src/adapters/postgresjs.d.ts +1 -0
- package/out/zero-server/src/adapters/postgresjs.d.ts.map +1 -1
- package/out/zero-server/src/adapters/postgresjs.js.map +1 -1
- package/out/zero-server/src/process-mutations.d.ts +3 -3
- package/out/zero-server/src/process-mutations.d.ts.map +1 -1
- package/out/zero-server/src/process-mutations.js.map +1 -1
- package/out/zero-server/src/schema.js +1 -1
- package/out/zero-server/src/schema.js.map +1 -1
- package/out/zero-server/src/zql-database.d.ts +1 -1
- package/out/zero-server/src/zql-database.d.ts.map +1 -1
- package/out/zero-server/src/zql-database.js.map +1 -1
- package/out/zero-solid/src/mod.d.ts +3 -2
- package/out/zero-solid/src/mod.d.ts.map +1 -1
- package/out/zero-solid/src/use-zero-connection-state.d.ts +10 -0
- package/out/zero-solid/src/use-zero-connection-state.d.ts.map +1 -0
- package/out/zero-solid/src/use-zero-online.d.ts +1 -7
- package/out/zero-solid/src/use-zero-online.d.ts.map +1 -1
- package/out/zero.js +13 -3
- package/out/zql/src/builder/builder.d.ts +14 -1
- package/out/zql/src/builder/builder.d.ts.map +1 -1
- package/out/zql/src/builder/builder.js +33 -2
- package/out/zql/src/builder/builder.js.map +1 -1
- package/out/zql/src/ivm/data.d.ts +1 -1
- package/out/zql/src/ivm/data.d.ts.map +1 -1
- package/out/zql/src/ivm/data.js.map +1 -1
- package/out/zql/src/ivm/filter-push.d.ts +1 -1
- package/out/zql/src/ivm/filter-push.d.ts.map +1 -1
- package/out/zql/src/ivm/filter-push.js.map +1 -1
- package/out/zql/src/ivm/memory-source.d.ts +5 -5
- package/out/zql/src/ivm/memory-source.d.ts.map +1 -1
- package/out/zql/src/ivm/memory-source.js +0 -16
- package/out/zql/src/ivm/memory-source.js.map +1 -1
- package/out/zql/src/ivm/source.d.ts +2 -6
- package/out/zql/src/ivm/source.d.ts.map +1 -1
- package/out/zql/src/ivm/take.d.ts +1 -1
- package/out/zql/src/ivm/take.d.ts.map +1 -1
- package/out/zql/src/ivm/take.js.map +1 -1
- package/out/zql/src/planner/planner-builder.d.ts +14 -0
- package/out/zql/src/planner/planner-builder.d.ts.map +1 -0
- package/out/zql/src/planner/planner-builder.js +180 -0
- package/out/zql/src/planner/planner-builder.js.map +1 -0
- package/out/zql/src/planner/planner-connection.d.ts +119 -0
- package/out/zql/src/planner/planner-connection.d.ts.map +1 -0
- package/out/zql/src/planner/planner-connection.js +301 -0
- package/out/zql/src/planner/planner-connection.js.map +1 -0
- package/out/zql/src/planner/planner-constraint.d.ts +14 -0
- package/out/zql/src/planner/planner-constraint.d.ts.map +1 -0
- package/out/zql/src/planner/planner-constraint.js +12 -0
- package/out/zql/src/planner/planner-constraint.js.map +1 -0
- package/out/zql/src/planner/planner-debug.d.ts +118 -0
- package/out/zql/src/planner/planner-debug.d.ts.map +1 -0
- package/out/zql/src/planner/planner-debug.js +125 -0
- package/out/zql/src/planner/planner-debug.js.map +1 -0
- package/out/zql/src/planner/planner-fan-in.d.ts +37 -0
- package/out/zql/src/planner/planner-fan-in.d.ts.map +1 -0
- package/out/zql/src/planner/planner-fan-in.js +149 -0
- package/out/zql/src/planner/planner-fan-in.js.map +1 -0
- package/out/zql/src/planner/planner-fan-out.d.ts +21 -0
- package/out/zql/src/planner/planner-fan-out.d.ts.map +1 -0
- package/out/zql/src/planner/planner-fan-out.js +45 -0
- package/out/zql/src/planner/planner-fan-out.js.map +1 -0
- package/out/zql/src/planner/planner-graph.d.ts +103 -0
- package/out/zql/src/planner/planner-graph.d.ts.map +1 -0
- package/out/zql/src/planner/planner-graph.js +411 -0
- package/out/zql/src/planner/planner-graph.js.map +1 -0
- package/out/zql/src/planner/planner-join.d.ts +81 -0
- package/out/zql/src/planner/planner-join.d.ts.map +1 -0
- package/out/zql/src/planner/planner-join.js +246 -0
- package/out/zql/src/planner/planner-join.js.map +1 -0
- package/out/zql/src/planner/planner-node.d.ts +21 -0
- package/out/zql/src/planner/planner-node.d.ts.map +1 -0
- package/out/zql/src/planner/planner-node.js +2 -0
- package/out/zql/src/planner/planner-node.js.map +1 -0
- package/out/zql/src/planner/planner-source.d.ts +11 -0
- package/out/zql/src/planner/planner-source.d.ts.map +1 -0
- package/out/zql/src/planner/planner-source.js +13 -0
- package/out/zql/src/planner/planner-source.js.map +1 -0
- package/out/zql/src/planner/planner-terminus.d.ts +16 -0
- package/out/zql/src/planner/planner-terminus.d.ts.map +1 -0
- package/out/zql/src/planner/planner-terminus.js +28 -0
- package/out/zql/src/planner/planner-terminus.js.map +1 -0
- package/out/zql/src/query/expression.d.ts +2 -2
- package/out/zql/src/query/expression.d.ts.map +1 -1
- package/out/zql/src/query/expression.js.map +1 -1
- package/out/zql/src/query/query-delegate.d.ts +3 -3
- package/out/zql/src/query/query-delegate.d.ts.map +1 -1
- package/out/zql/src/query/query-impl.d.ts +8 -8
- package/out/zql/src/query/query-impl.d.ts.map +1 -1
- package/out/zql/src/query/query-impl.js +0 -6
- package/out/zql/src/query/query-impl.js.map +1 -1
- package/out/zql/src/query/query.d.ts +3 -3
- package/out/zql/src/query/query.d.ts.map +1 -1
- package/out/zql/src/query/static-query.d.ts +1 -1
- package/out/zql/src/query/static-query.d.ts.map +1 -1
- package/out/zql/src/query/static-query.js.map +1 -1
- package/out/zql/src/query/typed-view.d.ts +1 -1
- package/out/zql/src/query/typed-view.d.ts.map +1 -1
- package/out/zqlite/src/query-delegate.d.ts +1 -1
- package/out/zqlite/src/query-delegate.d.ts.map +1 -1
- package/out/zqlite/src/query-delegate.js.map +1 -1
- package/out/zqlite/src/sqlite-cost-model.d.ts +17 -0
- package/out/zqlite/src/sqlite-cost-model.d.ts.map +1 -0
- package/out/zqlite/src/sqlite-cost-model.js +134 -0
- package/out/zqlite/src/sqlite-cost-model.js.map +1 -0
- package/out/zqlite/src/table-source.d.ts +4 -4
- package/out/zqlite/src/table-source.d.ts.map +1 -1
- package/out/zqlite/src/table-source.js +0 -16
- package/out/zqlite/src/table-source.js.map +1 -1
- package/package.json +5 -4
- package/out/chunk-JS2ABYXG.js.map +0 -7
- package/out/chunk-PIXC6O7W.js.map +0 -7
- package/out/zero-cache/src/types/error-for-client.d.ts +0 -23
- package/out/zero-cache/src/types/error-for-client.d.ts.map +0 -1
- package/out/zero-cache/src/types/error-for-client.js +0 -28
- package/out/zero-cache/src/types/error-for-client.js.map +0 -1
- package/out/zero-client/src/client/connection-state-enum.d.ts +0 -7
- package/out/zero-client/src/client/connection-state-enum.d.ts.map +0 -1
- package/out/zero-client/src/client/ping-result-enum.d.ts +0 -5
- package/out/zero-client/src/client/ping-result-enum.d.ts.map +0 -1
- package/out/zero-client/src/client/server-error.d.ts +0 -15
- package/out/zero-client/src/client/server-error.d.ts.map +0 -1
- package/out/zql/src/query/assert-no-not-exists.d.ts +0 -17
- package/out/zql/src/query/assert-no-not-exists.d.ts.map +0 -1
- package/out/zql/src/query/assert-no-not-exists.js +0 -40
- package/out/zql/src/query/assert-no-not-exists.js.map +0 -1
- /package/out/{lazy-inspector-NCBESZMS.js.map → lazy-inspector-OXIFYSSQ.js.map} +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Subscribable } from '../../../shared/src/subscribable.ts';
|
|
2
|
+
import { ConnectionStatus } from './connection-status.ts';
|
|
3
|
+
import { type ZeroError } from './error.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The current connection state of the Zero instance. It can be one of the following states:
|
|
6
|
+
*
|
|
7
|
+
* - `connecting`: The client is actively trying to connect every 5 seconds.
|
|
8
|
+
* - `attempt` counts the number of retries within the current retry window,
|
|
9
|
+
* - `disconnectAt` is the epoch timestamp when the client will transition to `disconnected` state
|
|
10
|
+
* - `reason` is the optional error associated with the connection attempt.
|
|
11
|
+
* - `disconnected`: The client is now in an "offline" state. It will continue
|
|
12
|
+
* to try to connect every 5 seconds.
|
|
13
|
+
* - `connected`: The client has opened a successful connection to the server.
|
|
14
|
+
* - `error`: A fatal error occurred. No connection retries will be made until the host
|
|
15
|
+
* application calls `connect()` again.
|
|
16
|
+
* - `reason` is the `ZeroError` associated with the error state.
|
|
17
|
+
* - `closed`: The client was shut down (for example via `zero.close()`). This is
|
|
18
|
+
* a terminal state, and a new Zero instance must be created to reconnect.
|
|
19
|
+
*/
|
|
20
|
+
export type ConnectionState = {
|
|
21
|
+
name: ConnectionStatus.Disconnected;
|
|
22
|
+
reason: ZeroError;
|
|
23
|
+
} | {
|
|
24
|
+
name: ConnectionStatus.Connecting;
|
|
25
|
+
attempt: number;
|
|
26
|
+
disconnectAt: number;
|
|
27
|
+
reason?: ZeroError | undefined;
|
|
28
|
+
} | {
|
|
29
|
+
name: ConnectionStatus.Connected;
|
|
30
|
+
} | {
|
|
31
|
+
name: ConnectionStatus.Error;
|
|
32
|
+
reason: ZeroError;
|
|
33
|
+
} | {
|
|
34
|
+
name: ConnectionStatus.Closed;
|
|
35
|
+
reason: ZeroError;
|
|
36
|
+
};
|
|
37
|
+
export type ConnectionManagerOptions = {
|
|
38
|
+
/**
|
|
39
|
+
* The amount of time we allow for continuous connecting attempts before
|
|
40
|
+
* transitioning to disconnected state.
|
|
41
|
+
*/
|
|
42
|
+
disconnectTimeoutMs: number;
|
|
43
|
+
/**
|
|
44
|
+
* How frequently we check whether the connecting timeout has elapsed.
|
|
45
|
+
* Defaults to 1 second.
|
|
46
|
+
*/
|
|
47
|
+
timeoutCheckIntervalMs?: number | undefined;
|
|
48
|
+
};
|
|
49
|
+
declare const TERMINAL_STATES: ["error"];
|
|
50
|
+
type TerminalConnectionStatus = (typeof TERMINAL_STATES)[number];
|
|
51
|
+
type TerminalConnectionState = Extract<ConnectionState, {
|
|
52
|
+
name: TerminalConnectionStatus;
|
|
53
|
+
}>;
|
|
54
|
+
export declare class ConnectionManager extends Subscribable<ConnectionState> {
|
|
55
|
+
#private;
|
|
56
|
+
constructor(options: ConnectionManagerOptions);
|
|
57
|
+
get state(): ConnectionState;
|
|
58
|
+
/**
|
|
59
|
+
* Returns true if the current state is equal to the given status.
|
|
60
|
+
*/
|
|
61
|
+
is(status: ConnectionStatus): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Returns true if the current state is a terminal state
|
|
64
|
+
* that can be recovered from by calling connect().
|
|
65
|
+
*/
|
|
66
|
+
isInTerminalState(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Returns true if the given status is a terminal state
|
|
69
|
+
* that can be recovered from by calling connect().
|
|
70
|
+
*/
|
|
71
|
+
static isTerminalState(state: ConnectionState): state is TerminalConnectionState;
|
|
72
|
+
/**
|
|
73
|
+
* Returns true if the run loop should continue.
|
|
74
|
+
* The run loop continues in disconnected, connecting, connected, and error states.
|
|
75
|
+
* It stops in closed state.
|
|
76
|
+
*/
|
|
77
|
+
shouldContinueRunLoop(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Waits for the next state change.
|
|
80
|
+
* @returns A promise that resolves when the next state change occurs.
|
|
81
|
+
*/
|
|
82
|
+
waitForStateChange(): Promise<ConnectionState>;
|
|
83
|
+
/**
|
|
84
|
+
* Transition to connecting state.
|
|
85
|
+
*
|
|
86
|
+
* This starts the 5-minute timeout timer, but if we've entered disconnected state,
|
|
87
|
+
* we stay there and continue retrying.
|
|
88
|
+
*
|
|
89
|
+
* @returns An object containing a promise that resolves on the next state change.
|
|
90
|
+
*/
|
|
91
|
+
connecting(reason?: ZeroError): {
|
|
92
|
+
nextStatePromise: Promise<ConnectionState>;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Transition to connected state.
|
|
96
|
+
* This resets the connecting timeout timer.
|
|
97
|
+
*
|
|
98
|
+
* @returns An object containing a promise that resolves on the next state change.
|
|
99
|
+
*/
|
|
100
|
+
connected(): {
|
|
101
|
+
nextStatePromise: Promise<ConnectionState>;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Transition to disconnected state.
|
|
105
|
+
* This is called when the 5-minute timeout expires, or when we're intentionally
|
|
106
|
+
* disconnecting due to an error (this will eventually be a separate state, error).
|
|
107
|
+
* The run loop will continue trying to reconnect.
|
|
108
|
+
*
|
|
109
|
+
* @returns An object containing a promise that resolves on the next state change.
|
|
110
|
+
*/
|
|
111
|
+
disconnected(reason: ZeroError): {
|
|
112
|
+
nextStatePromise: Promise<ConnectionState>;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Transition to error state.
|
|
116
|
+
* This pauses the run loop until connect() is called.
|
|
117
|
+
* Resets the 5-minute retry window and attempt counter.
|
|
118
|
+
*
|
|
119
|
+
* @returns An object containing a promise that resolves on the next state change.
|
|
120
|
+
*/
|
|
121
|
+
error(reason: ZeroError): {
|
|
122
|
+
nextStatePromise: Promise<ConnectionState>;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Transition to closed state.
|
|
126
|
+
* This is terminal - no further transitions are allowed.
|
|
127
|
+
*/
|
|
128
|
+
closed(): void;
|
|
129
|
+
cleanup: () => void;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Used to trigger the catch block when a terminal state is reached.
|
|
133
|
+
*
|
|
134
|
+
* @param state - The current connection state.
|
|
135
|
+
*/
|
|
136
|
+
export declare const throwIfConnectionError: (state: ConnectionState) => void;
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=connection-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-manager.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/connection-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAA6B,KAAK,SAAS,EAAC,MAAM,YAAY,CAAC;AAKtE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,eAAe,GACvB;IACE,IAAI,EAAE,gBAAgB,CAAC,YAAY,CAAC;IACpC,MAAM,EAAE,SAAS,CAAC;CACnB,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAChC,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC;CAClC,GACD;IACE,I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AC/B,gBAAgB,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;KAC5C;IA6BD;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,SAAS,GAAG;QAAC,gBAAgB,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;KAAC;IAuBtE;;;OAGG;IACH,MAAM;IAqBG,OAAO,QAAO,IAAI,CAGzB;CA4DH;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,eAAe,SAkB5D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const Disconnected = "disconnected";
|
|
2
|
+
export declare const Connecting = "connecting";
|
|
3
|
+
export declare const Connected = "connected";
|
|
4
|
+
export declare const Error = "error";
|
|
5
|
+
export declare const Closed = "closed";
|
|
6
|
+
export type Disconnected = typeof Disconnected;
|
|
7
|
+
export type Connecting = typeof Connecting;
|
|
8
|
+
export type Connected = typeof Connected;
|
|
9
|
+
export type Error = typeof Error;
|
|
10
|
+
export type Closed = typeof Closed;
|
|
11
|
+
//# sourceMappingURL=connection-status-enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-status-enum.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/connection-status-enum.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,SAAS,cAAc,CAAC;AACrC,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAC/C,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAC3C,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC;AACzC,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC;AACjC,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Enum } from '../../../shared/src/enum.ts';
|
|
2
|
+
import * as ConnectionStatusEnum from './connection-status-enum.ts';
|
|
3
|
+
export { ConnectionStatusEnum as ConnectionStatus };
|
|
4
|
+
export type ConnectionStatus = Enum<typeof ConnectionStatusEnum>;
|
|
5
|
+
//# sourceMappingURL=connection-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-status.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/connection-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAC,oBAAoB,IAAI,gBAAgB,EAAC,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ConnectionManager, ConnectionState } from './connection-manager.ts';
|
|
2
|
+
import type { ZeroLogContext } from './zero-log-context.ts';
|
|
3
|
+
export interface Source<T> {
|
|
4
|
+
/**
|
|
5
|
+
* The current state value.
|
|
6
|
+
*/
|
|
7
|
+
readonly current: T;
|
|
8
|
+
/**
|
|
9
|
+
* Subscribe to state changes.
|
|
10
|
+
*
|
|
11
|
+
* @param listener - Called when the state changes with the new state value.
|
|
12
|
+
* @returns A function to unsubscribe from state changes.
|
|
13
|
+
*/
|
|
14
|
+
subscribe(listener: (state: T) => void): () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Connection API for managing Zero's connection lifecycle.
|
|
18
|
+
*/
|
|
19
|
+
export interface Connection {
|
|
20
|
+
/**
|
|
21
|
+
* The current connection state as a subscribable value.
|
|
22
|
+
*/
|
|
23
|
+
readonly state: Source<ConnectionState>;
|
|
24
|
+
/**
|
|
25
|
+
* Resumes the connection from a terminal state.
|
|
26
|
+
*
|
|
27
|
+
* If called when not in a terminal state, this method does nothing.
|
|
28
|
+
*
|
|
29
|
+
* @returns A promise that resolves once the connection state has transitioned to connecting.
|
|
30
|
+
*/
|
|
31
|
+
connect(): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export declare class ConnectionImpl implements Connection {
|
|
34
|
+
#private;
|
|
35
|
+
constructor(connectionManager: ConnectionManager, lc: ZeroLogContext);
|
|
36
|
+
get state(): Source<ConnectionState>;
|
|
37
|
+
connect(): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export declare class ConnectionSource implements Source<ConnectionState> {
|
|
40
|
+
#private;
|
|
41
|
+
constructor(connectionManager: ConnectionManager);
|
|
42
|
+
get current(): ConnectionState;
|
|
43
|
+
get subscribe(): (listener: (obj: ConnectionState) => unknown) => (() => void);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IAEpB;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IAExC;;;;;;OAMG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,qBAAa,cAAe,YAAW,UAAU;;gBAKnC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yBf;AAED,wBAAsB,UAAU,CAC9B,EAAE,EAAE,gBAAgB,EACpB,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,eAAe,GAAG,SAAS,GACrC,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { Expand } from '../../../shared/src/expand.ts';
|
|
2
|
+
import { ErrorKind } from '../../../zero-protocol/src/error-kind.ts';
|
|
3
|
+
import { ErrorOrigin } from '../../../zero-protocol/src/error-origin.ts';
|
|
4
|
+
import { type BackoffBody, type ErrorBody, ProtocolError } from '../../../zero-protocol/src/error.ts';
|
|
5
|
+
import { ClientErrorKind } from './client-error-kind.ts';
|
|
6
|
+
export type ZeroError = ProtocolError | ClientError;
|
|
7
|
+
export type ZeroErrorBody = Expand<ErrorBody | ClientErrorBody>;
|
|
8
|
+
export type ZeroErrorKind = Expand<ErrorKind | ClientErrorKind>;
|
|
9
|
+
export type ClientErrorBody = {
|
|
10
|
+
kind: ClientErrorKind;
|
|
11
|
+
origin: typeof ErrorOrigin.Client;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Represents an error encountered by the client.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ClientError<const T extends Omit<ClientErrorBody, 'origin'> = Omit<ClientErrorBody, 'origin'>> extends Error {
|
|
18
|
+
readonly errorBody: {
|
|
19
|
+
origin: typeof ErrorOrigin.Client;
|
|
20
|
+
} & T;
|
|
21
|
+
constructor(errorBody: T, options?: ErrorOptions);
|
|
22
|
+
get kind(): T['kind'];
|
|
23
|
+
}
|
|
24
|
+
export declare function isServerError(ex: unknown): ex is ProtocolError<ErrorBody>;
|
|
25
|
+
export declare function isAuthError(ex: unknown): ex is ProtocolError & {
|
|
26
|
+
kind: ErrorKind.AuthInvalidated | ErrorKind.Unauthorized;
|
|
27
|
+
};
|
|
28
|
+
export declare function getBackoffParams(error: ZeroError): BackoffBody | undefined;
|
|
29
|
+
export declare function isClientError(ex: unknown): ex is ClientError<ClientErrorBody>;
|
|
30
|
+
export declare const NO_STATUS_TRANSITION = "NO_STATUS_TRANSITION";
|
|
31
|
+
/**
|
|
32
|
+
* Returns the status to transition to, or null if the error
|
|
33
|
+
* indicates that the connection should continue in the current state.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getErrorConnectionTransition(ex: unknown): {
|
|
36
|
+
readonly status: "NO_STATUS_TRANSITION";
|
|
37
|
+
readonly reason: ClientError<ClientErrorBody>;
|
|
38
|
+
} | {
|
|
39
|
+
readonly status: "error";
|
|
40
|
+
readonly reason: ClientError<ClientErrorBody>;
|
|
41
|
+
} | {
|
|
42
|
+
readonly status: "disconnected";
|
|
43
|
+
readonly reason: ClientError<ClientErrorBody>;
|
|
44
|
+
} | {
|
|
45
|
+
readonly status: "closed";
|
|
46
|
+
readonly reason: ClientError<ClientErrorBody>;
|
|
47
|
+
} | {
|
|
48
|
+
readonly status: "error";
|
|
49
|
+
readonly reason: ProtocolError<{
|
|
50
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
51
|
+
message: string;
|
|
52
|
+
mutationIDs: {
|
|
53
|
+
id: number;
|
|
54
|
+
clientID: string;
|
|
55
|
+
}[];
|
|
56
|
+
kind: "PushFailed";
|
|
57
|
+
origin: "server";
|
|
58
|
+
reason: "database" | "parse" | "oooMutation" | "unsupportedPushVersion" | "internal";
|
|
59
|
+
} | {
|
|
60
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
61
|
+
bodyPreview?: string | undefined;
|
|
62
|
+
message: string;
|
|
63
|
+
mutationIDs: {
|
|
64
|
+
id: number;
|
|
65
|
+
clientID: string;
|
|
66
|
+
}[];
|
|
67
|
+
kind: "PushFailed";
|
|
68
|
+
origin: "zeroCache";
|
|
69
|
+
reason: "http";
|
|
70
|
+
status: number;
|
|
71
|
+
} | {
|
|
72
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
73
|
+
message: string;
|
|
74
|
+
mutationIDs: {
|
|
75
|
+
id: number;
|
|
76
|
+
clientID: string;
|
|
77
|
+
}[];
|
|
78
|
+
kind: "PushFailed";
|
|
79
|
+
origin: "zeroCache";
|
|
80
|
+
reason: "parse" | "internal" | "timeout";
|
|
81
|
+
} | {
|
|
82
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
83
|
+
message: string;
|
|
84
|
+
kind: "TransformFailed";
|
|
85
|
+
queryIDs: string[];
|
|
86
|
+
origin: "server";
|
|
87
|
+
reason: "database" | "parse" | "internal";
|
|
88
|
+
} | {
|
|
89
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
90
|
+
bodyPreview?: string | undefined;
|
|
91
|
+
message: string;
|
|
92
|
+
kind: "TransformFailed";
|
|
93
|
+
queryIDs: string[];
|
|
94
|
+
origin: "zeroCache";
|
|
95
|
+
reason: "http";
|
|
96
|
+
status: number;
|
|
97
|
+
} | {
|
|
98
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
99
|
+
message: string;
|
|
100
|
+
kind: "TransformFailed";
|
|
101
|
+
queryIDs: string[];
|
|
102
|
+
origin: "zeroCache";
|
|
103
|
+
reason: "parse" | "internal" | "timeout";
|
|
104
|
+
} | {
|
|
105
|
+
origin?: "server" | "zeroCache" | undefined;
|
|
106
|
+
kind: "VersionNotSupported" | "AuthInvalidated" | "ClientNotFound" | "InvalidConnectionRequest" | "InvalidConnectionRequestBaseCookie" | "InvalidConnectionRequestLastMutationID" | "InvalidConnectionRequestClientDeleted" | "InvalidMessage" | "InvalidPush" | "MutationFailed" | "MutationRateLimited" | "Unauthorized" | "SchemaVersionNotSupported" | "Internal";
|
|
107
|
+
message: string;
|
|
108
|
+
} | {
|
|
109
|
+
minBackoffMs?: number | undefined;
|
|
110
|
+
maxBackoffMs?: number | undefined;
|
|
111
|
+
reconnectParams?: Record<string, string> | undefined;
|
|
112
|
+
origin?: "zeroCache" | undefined;
|
|
113
|
+
kind: "Rebalance" | "Rehome" | "ServerOverloaded";
|
|
114
|
+
message: string;
|
|
115
|
+
}>;
|
|
116
|
+
} | {
|
|
117
|
+
readonly status: "NO_STATUS_TRANSITION";
|
|
118
|
+
readonly reason: ProtocolError<{
|
|
119
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
120
|
+
message: string;
|
|
121
|
+
mutationIDs: {
|
|
122
|
+
id: number;
|
|
123
|
+
clientID: string;
|
|
124
|
+
}[];
|
|
125
|
+
kind: "PushFailed";
|
|
126
|
+
origin: "server";
|
|
127
|
+
reason: "database" | "parse" | "oooMutation" | "unsupportedPushVersion" | "internal";
|
|
128
|
+
} | {
|
|
129
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
130
|
+
bodyPreview?: string | undefined;
|
|
131
|
+
message: string;
|
|
132
|
+
mutationIDs: {
|
|
133
|
+
id: number;
|
|
134
|
+
clientID: string;
|
|
135
|
+
}[];
|
|
136
|
+
kind: "PushFailed";
|
|
137
|
+
origin: "zeroCache";
|
|
138
|
+
reason: "http";
|
|
139
|
+
status: number;
|
|
140
|
+
} | {
|
|
141
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
142
|
+
message: string;
|
|
143
|
+
mutationIDs: {
|
|
144
|
+
id: number;
|
|
145
|
+
clientID: string;
|
|
146
|
+
}[];
|
|
147
|
+
kind: "PushFailed";
|
|
148
|
+
origin: "zeroCache";
|
|
149
|
+
reason: "parse" | "internal" | "timeout";
|
|
150
|
+
} | {
|
|
151
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
152
|
+
message: string;
|
|
153
|
+
kind: "TransformFailed";
|
|
154
|
+
queryIDs: string[];
|
|
155
|
+
origin: "server";
|
|
156
|
+
reason: "database" | "parse" | "internal";
|
|
157
|
+
} | {
|
|
158
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
159
|
+
bodyPreview?: string | undefined;
|
|
160
|
+
message: string;
|
|
161
|
+
kind: "TransformFailed";
|
|
162
|
+
queryIDs: string[];
|
|
163
|
+
origin: "zeroCache";
|
|
164
|
+
reason: "http";
|
|
165
|
+
status: number;
|
|
166
|
+
} | {
|
|
167
|
+
details?: import("../mod.ts").ReadonlyJSONValue | undefined;
|
|
168
|
+
message: string;
|
|
169
|
+
kind: "TransformFailed";
|
|
170
|
+
queryIDs: string[];
|
|
171
|
+
origin: "zeroCache";
|
|
172
|
+
reason: "parse" | "internal" | "timeout";
|
|
173
|
+
} | {
|
|
174
|
+
origin?: "server" | "zeroCache" | undefined;
|
|
175
|
+
kind: "VersionNotSupported" | "AuthInvalidated" | "ClientNotFound" | "InvalidConnectionRequest" | "InvalidConnectionRequestBaseCookie" | "InvalidConnectionRequestLastMutationID" | "InvalidConnectionRequestClientDeleted" | "InvalidMessage" | "InvalidPush" | "MutationFailed" | "MutationRateLimited" | "Unauthorized" | "SchemaVersionNotSupported" | "Internal";
|
|
176
|
+
message: string;
|
|
177
|
+
} | {
|
|
178
|
+
minBackoffMs?: number | undefined;
|
|
179
|
+
maxBackoffMs?: number | undefined;
|
|
180
|
+
reconnectParams?: Record<string, string> | undefined;
|
|
181
|
+
origin?: "zeroCache" | undefined;
|
|
182
|
+
kind: "Rebalance" | "Rehome" | "ServerOverloaded";
|
|
183
|
+
message: string;
|
|
184
|
+
}>;
|
|
185
|
+
} | {
|
|
186
|
+
readonly status: "error";
|
|
187
|
+
readonly reason: ClientError<{
|
|
188
|
+
readonly kind: "Internal";
|
|
189
|
+
readonly message: string;
|
|
190
|
+
}>;
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/error.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAC,SAAS,EAAC,MAAM,0CAA0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,GAAG,SAAS,CAU1E;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,WAAW,CAAC,eAAe,CAAC,CAI7E;AAED,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4FvD"}
|
|
@@ -24,7 +24,7 @@ import type { LazyStore } from '../../../replicache/src/dag/lazy-store.ts';
|
|
|
24
24
|
export declare class IVMSourceBranch {
|
|
25
25
|
#private;
|
|
26
26
|
hash: Hash | undefined;
|
|
27
|
-
constructor(tables: Record<string, TableSchema>, hash?: Hash
|
|
27
|
+
constructor(tables: Record<string, TableSchema>, hash?: Hash, sources?: Map<string, MemorySource | undefined>);
|
|
28
28
|
getSource(name: string): MemorySource | undefined;
|
|
29
29
|
clear(): void;
|
|
30
30
|
/**
|
|
@@ -35,7 +35,7 @@ export declare class IVMSourceBranch {
|
|
|
35
35
|
/**
|
|
36
36
|
* Fork the branch and patch it up to match the desired head.
|
|
37
37
|
*/
|
|
38
|
-
forkToHead(store: LazyStore, desiredHead: Hash, readOptions?: ZeroReadOptions
|
|
38
|
+
forkToHead(store: LazyStore, desiredHead: Hash, readOptions?: ZeroReadOptions): Promise<IVMSourceBranch>;
|
|
39
39
|
/**
|
|
40
40
|
* Creates a new IVMSourceBranch that is a copy of the current one.
|
|
41
41
|
* This is a cheap operation since the b-trees are shared until a write is performed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ivm-branch.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/ivm-branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,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,GAAE,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAa;IAO5D,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAajD,KAAK;IAIL;;;OAGG;IACH,OAAO,CAAC,YAAY,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW;IAWzE;;OAEG;IACG,UAAU,CACd,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,IAAI,EACjB,WAAW,CAAC,EAAE,eAAe,GAC5B,OAAO,CAAC,eAAe,CAAC;IAY3B;;;;;;;OAOG;IACH,IAAI;CAYL;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,iBAkBb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metric-name.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/metric-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAC,cAAc,IAAI,UAAU,EAAC,CAAC;AACtC,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { MaybePromise } from '../../../shared/src/types.ts';
|
|
2
|
-
import {
|
|
2
|
+
import { type ZeroError } from './error.ts';
|
|
3
3
|
import type { ZeroLogContext } from './zero-log-context.ts';
|
|
4
4
|
export declare const DID_NOT_CONNECT_VALUE: number;
|
|
5
5
|
export declare const REPORT_INTERVAL_MS = 5000;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
export declare function getLastConnectErrorValue(reason: ZeroError): `server_${string}` | `client_${string}`;
|
|
7
|
+
/**
|
|
8
|
+
* Returns whether an error should be reported in metrics and
|
|
9
|
+
* increment the connect error count.
|
|
10
|
+
*
|
|
11
|
+
* Returns `true` for all server errors and client errors that represent actual
|
|
12
|
+
* connection problems. Returns `false` for expected client-side disconnections
|
|
13
|
+
* (user disconnect, client closed, hidden tab, clean/abrupt close).
|
|
14
|
+
*/
|
|
15
|
+
export declare function shouldReportConnectError(reason: ZeroError): boolean;
|
|
13
16
|
type MetricsReporter = (metrics: Series[]) => MaybePromise<void>;
|
|
14
17
|
export type MetricManagerOptions = {
|
|
15
18
|
reportIntervalMs: number;
|
|
@@ -29,7 +32,7 @@ export declare class MetricManager {
|
|
|
29
32
|
readonly lastConnectError: State;
|
|
30
33
|
setConnected(timeToConnectMs: number, totalTimeToConnectMs: number): void;
|
|
31
34
|
setDisconnectedWaitingForVisible(): void;
|
|
32
|
-
setConnectError(reason:
|
|
35
|
+
setConnectError(reason: ZeroError): void;
|
|
33
36
|
/**
|
|
34
37
|
* Tags to include in all metrics.
|
|
35
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAGL,KAAK,SAAS,EAEf,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAM1D,eAAO,MAAM,qBAAqB,QAAa,CAAC;AAEhD,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AASxC,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,2CAEzD;AAYD;;;;;;;G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B,GAAG;IAIH,KAAK;IAIL,KAAK;;;;CASN;AAMD;;;;;;;;;;;;GAYG;AACH,qBAAa,KAAM,YAAW,SAAS;;gBAKzB,MAAM,EAAE,MAAM,EAAE,YAAY,UAAQ;IAKhD,GAAG,CAAC,KAAK,EAAE,MAAM;IAIjB,GAAG;IAIH,KAAK;IAIL,KAAK;;;;CAYN"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { EphemeralID, MutationTrackingData } from '../../../replicache/src/replicache-options.ts';
|
|
2
|
-
import { type MutationID, type PushResponse } from '../../../zero-protocol/src/push.ts';
|
|
3
|
-
import type { ZeroLogContext } from './zero-log-context.ts';
|
|
4
2
|
import type { ReplicacheImpl } from '../../../replicache/src/impl.ts';
|
|
3
|
+
import { type MutationID, type PushResponseBody } from '../../../zero-protocol/src/push.ts';
|
|
4
|
+
import { type ZeroError } from './error.ts';
|
|
5
|
+
import type { ZeroLogContext } from './zero-log-context.ts';
|
|
5
6
|
/**
|
|
6
7
|
* Tracks what pushes are in-flight and resolves promises when they're acked.
|
|
7
8
|
*/
|
|
8
9
|
export declare class MutationTracker {
|
|
9
10
|
#private;
|
|
10
|
-
constructor(lc: ZeroLogContext, ackMutations: (upTo: MutationID) => void);
|
|
11
|
+
constructor(lc: ZeroLogContext, ackMutations: (upTo: MutationID) => void, onFatalError: (error: ZeroError) => void);
|
|
11
12
|
setClientIDAndWatch(clientID: string, experimentalWatch: ReplicacheImpl['experimentalWatch']): void;
|
|
12
13
|
trackMutation(): MutationTrackingData;
|
|
13
14
|
mutationIDAssigned(id: EphemeralID, mutationID: number): void;
|
|
@@ -16,7 +17,7 @@ export declare class MutationTracker {
|
|
|
16
17
|
* The mutation must not have been persisted to the client store.
|
|
17
18
|
*/
|
|
18
19
|
rejectMutation(id: EphemeralID, e: unknown): void;
|
|
19
|
-
processPushResponse(response:
|
|
20
|
+
processPushResponse(response: PushResponseBody): void;
|
|
20
21
|
/**
|
|
21
22
|
* DEPRECATED: to be removed when we switch to fully driving
|
|
22
23
|
* mutation resolution via poke.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-tracker.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/mutation-tracker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,oBAAoB,EACrB,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"mutation-tracker.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/mutation-tracker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,oBAAoB,EACrB,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAOpE,OAAO,EAGL,KAAK,UAAU,EAIf,KAAK,gBAAgB,EACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAC,KAAK,SAAS,EAAC,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAgB1D;;GAEG;AACH,qBAAa,eAAe;;gBAmBxB,EAAE,EAAE,cAAc,EAClB,YAAY,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,EACxC,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI;IAY1C,mBAAmB,CACjB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,cAAc,CAAC,mBAAmB,CAAC;IAexD,aAAa,IAAI,oBAAoB;IAUrC,kBAAkB,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAY7D;;;OAGG;IACH,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,GAAG,IAAI;IA+CjD,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAuDrD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAAW,CAAC,cAAc,EAAE,MAAM;IAIlC;;;;;;OAMG;IACH,YAAY,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAoB1C,IAAI,IAAI,WAEP;IAuHD;;;;;;;;;OASG;IACH,qBAAqB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;CASlD"}
|
|
@@ -96,11 +96,15 @@ export interface ZeroOptions<S extends Schema, MD extends CustomMutatorDefs | un
|
|
|
96
96
|
/**
|
|
97
97
|
* `onOnlineChange` is called when the Zero instance's online status changes.
|
|
98
98
|
*
|
|
99
|
-
* @deprecated Use
|
|
99
|
+
* @deprecated Use {@linkcode Connection.state.subscribe} on the Zero instance instead. e.g.
|
|
100
100
|
* ```ts
|
|
101
101
|
* const zero = new Zero({...});
|
|
102
|
-
* zero.
|
|
102
|
+
* zero.connection.state.subscribe((state) => {
|
|
103
|
+
* console.log('Connection state:', state.name);
|
|
104
|
+
* });
|
|
103
105
|
* ```
|
|
106
|
+
*
|
|
107
|
+
* Or use a hook like {@linkcode useZeroConnectionState} to subscribe to state changes.
|
|
104
108
|
*/
|
|
105
109
|
onOnlineChange?: ((online: boolean) => void) | undefined;
|
|
106
110
|
/**
|
|
@@ -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,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,CAAC,MAAM,+BAA+B,CAAC;AACnD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oDAAoD,CAAC;AAC/E,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,sBAAsB,EAAC,MAAM,gC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AC,MAAM,CAAC,CAKzE,CAAC"}
|
|
@@ -10,6 +10,7 @@ import type { ClientMetricMap } from '../../../zql/src/query/metrics-delegate.ts
|
|
|
10
10
|
import type { CustomQueryID } from '../../../zql/src/query/named.ts';
|
|
11
11
|
import type { GotCallback } from '../../../zql/src/query/query-delegate.ts';
|
|
12
12
|
import { type TTL } from '../../../zql/src/query/ttl.ts';
|
|
13
|
+
import { type ZeroError } from './error.ts';
|
|
13
14
|
import type { InspectorDelegate } from './inspector/inspector.ts';
|
|
14
15
|
import type { MutationTracker } from './mutation-tracker.ts';
|
|
15
16
|
import type { ReadTransaction } from './replicache-types.ts';
|
|
@@ -24,7 +25,7 @@ type ClientMetric = {
|
|
|
24
25
|
*/
|
|
25
26
|
export declare class QueryManager implements InspectorDelegate {
|
|
26
27
|
#private;
|
|
27
|
-
constructor(lc: ZeroLogContext, mutationTracker: MutationTracker, clientID: ClientID, tables: Record<string, TableSchema>, send: (change: ChangeDesiredQueriesMessage) => void, experimentalWatch: ReplicacheImpl['experimentalWatch'], recentQueriesMaxSize: number, queryChangeThrottleMs: number, slowMaterializeThreshold: number);
|
|
28
|
+
constructor(lc: ZeroLogContext, mutationTracker: MutationTracker, clientID: ClientID, tables: Record<string, TableSchema>, send: (change: ChangeDesiredQueriesMessage) => void, experimentalWatch: ReplicacheImpl['experimentalWatch'], recentQueriesMaxSize: number, queryChangeThrottleMs: number, slowMaterializeThreshold: number, onFatalError: (error: ZeroError) => void);
|
|
28
29
|
getAST(queryID: string): AST | undefined;
|
|
29
30
|
/**
|
|
30
31
|
* Get the queries that need to be registered with the server.
|
|
@@ -41,10 +42,10 @@ export declare class QueryManager implements InspectorDelegate {
|
|
|
41
42
|
* the client may have registered more queries. We need to diff the `initConnectionMessage`
|
|
42
43
|
* queries with the current set of queries to understand what those were.
|
|
43
44
|
*/
|
|
44
|
-
getQueriesPatch(tx: ReadTransaction, lastPatch?: Map<string, UpQueriesPatchOp>
|
|
45
|
+
getQueriesPatch(tx: ReadTransaction, lastPatch?: Map<string, UpQueriesPatchOp>): Promise<Map<string, UpQueriesPatchOp>>;
|
|
45
46
|
handleTransformErrors(errors: ErroredQuery[]): void;
|
|
46
|
-
addCustom(ast: AST, { name, args }: CustomQueryID, ttl: TTL, gotCallback?: GotCallback
|
|
47
|
-
addLegacy(ast: AST, ttl: TTL, gotCallback?: GotCallback
|
|
47
|
+
addCustom(ast: AST, { name, args }: CustomQueryID, ttl: TTL, gotCallback?: GotCallback): () => void;
|
|
48
|
+
addLegacy(ast: AST, ttl: TTL, gotCallback?: GotCallback): () => void;
|
|
48
49
|
updateCustom({ name, args }: CustomQueryID, ttl: TTL): void;
|
|
49
50
|
updateLegacy(ast: AST, ttl: TTL): void;
|
|
50
51
|
flushBatch(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-manager.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/query-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4CAA4C,CAAC;AAC/E,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qCAAqC,CAAC;AAIlE,OAAO,EAAC,OAAO,EAAC,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAGL,KAAK,GAAG,EACT,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,sDAAsD,CAAC;AACtG,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"query-manager.d.ts","sourceRoot":"","sources":["../../../../../zero-client/src/client/query-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4CAA4C,CAAC;AAC/E,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qCAAqC,CAAC;AAIlE,OAAO,EAAC,OAAO,EAAC,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAGL,KAAK,GAAG,EACT,MAAM,mCAA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