diff --git a/README.md b/README.md index f1f9e52..60f4531 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A community Python server SDK for [Zero](https://zero.rocicorp.dev/). It is not It ports what `@rocicorp/zero/server` gives a TypeScript backend: the query endpoint (`ZERO_QUERY_URL`), the mutate endpoint (`ZERO_MUTATE_URL`), the ZQL query builder, `defineQueries` and `defineMutators`, and `tx.mutate` and `tx.run` on Postgres. The client and `zero-cache` stay in TypeScript, and a Python backend serves the same TypeScript client a TypeScript backend would. -Compatibility is pinned to one Zero release at a time. This version is tested against `@rocicorp/zero` **1.11.3** (see `ZERO_VERSION`). +Compatibility is pinned to one Zero release at a time. This version is tested against `@rocicorp/zero` **1.11.4** (see `ZERO_VERSION`). ## Usage diff --git a/ZERO_VERSION b/ZERO_VERSION index 0a5af26..3d0e623 100644 --- a/ZERO_VERSION +++ b/ZERO_VERSION @@ -1 +1 @@ -1.11.3 +1.11.4 diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index 2001e66..0eaac61 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -15,7 +15,7 @@ services: retries: 60 zero-ts: &zero - image: rocicorp/zero:1.11.3 + image: rocicorp/zero:1.11.4 depends_on: postgres: condition: service_healthy diff --git a/e2e/package-lock.json b/e2e/package-lock.json index 2bd30fb..a366d29 100644 --- a/e2e/package-lock.json +++ b/e2e/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "zero-server-e2e", "dependencies": { - "@rocicorp/zero": "1.11.3", + "@rocicorp/zero": "1.11.4", "postgres": "3.4.9" } }, @@ -2204,9 +2204,9 @@ } }, "node_modules/@rocicorp/zero": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@rocicorp/zero/-/zero-1.11.3.tgz", - "integrity": "sha512-xP3yPX5q2zauLaZyPICoV7j/16PsyTixTyv85Kj/aFUT48JIyOHrAjsthHlpZhe46XbSlXHzDGSuqIjuwVJmHQ==", + "version": "1.11.4", + "resolved": "https://registry.npmjs.org/@rocicorp/zero/-/zero-1.11.4.tgz", + "integrity": "sha512-Epoj8MhHDYwzZtVPXCZRqCTYivh+B8BSAz/JzosWGhvwJj/LvnKoDXXT8OzwHwAbeo7hvyKSWyarKea7eAXGsQ==", "license": "Apache-2.0", "dependencies": { "@badrap/valita": "0.5.5", diff --git a/e2e/package.json b/e2e/package.json index 89d15b0..ae19f80 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "dependencies": { - "@rocicorp/zero": "1.11.3", + "@rocicorp/zero": "1.11.4", "postgres": "3.4.9" }, "overrides": { diff --git a/harness/package-lock.json b/harness/package-lock.json index 715d4bf..bb57a2e 100644 --- a/harness/package-lock.json +++ b/harness/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "zero-server-harness", "dependencies": { - "@rocicorp/zero": "1.11.3", + "@rocicorp/zero": "1.11.4", "postgres": "3.4.9" }, "devDependencies": { @@ -2283,9 +2283,9 @@ } }, "node_modules/@rocicorp/zero": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@rocicorp/zero/-/zero-1.11.3.tgz", - "integrity": "sha512-xP3yPX5q2zauLaZyPICoV7j/16PsyTixTyv85Kj/aFUT48JIyOHrAjsthHlpZhe46XbSlXHzDGSuqIjuwVJmHQ==", + "version": "1.11.4", + "resolved": "https://registry.npmjs.org/@rocicorp/zero/-/zero-1.11.4.tgz", + "integrity": "sha512-Epoj8MhHDYwzZtVPXCZRqCTYivh+B8BSAz/JzosWGhvwJj/LvnKoDXXT8OzwHwAbeo7hvyKSWyarKea7eAXGsQ==", "license": "Apache-2.0", "dependencies": { "@badrap/valita": "0.5.5", diff --git a/harness/package.json b/harness/package.json index ba8ed45..82df5d4 100644 --- a/harness/package.json +++ b/harness/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "dependencies": { - "@rocicorp/zero": "1.11.3", + "@rocicorp/zero": "1.11.4", "postgres": "3.4.9" }, "overrides": { diff --git a/src/zero_server/mutators.py b/src/zero_server/mutators.py index d278777..366d07a 100644 --- a/src/zero_server/mutators.py +++ b/src/zero_server/mutators.py @@ -1,7 +1,7 @@ """`define_mutator` and `define_mutators`: named server mutators the mutate endpoint dispatches to. -Ported from rocicorp/mono `packages/zql/src/mutate/mutator.ts` and `mutator-registry.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +Ported from rocicorp/mono `packages/zql/src/mutate/mutator.ts` and `mutator-registry.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. A mutator here is the server half of the TypeScript mutator of the same name: the client runs its own optimistically, and this one runs authoritatively inside the mutation's transaction. diff --git a/src/zero_server/protocol/application_error.py b/src/zero_server/protocol/application_error.py index e56fbb1..a6f233c 100644 --- a/src/zero_server/protocol/application_error.py +++ b/src/zero_server/protocol/application_error.py @@ -1,7 +1,7 @@ """The error application code raises to send a message and JSON details back to the client. -Ported from rocicorp/mono `packages/zero-protocol/src/application-error.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +Ported from rocicorp/mono `packages/zero-protocol/src/application-error.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from typing import Literal diff --git a/src/zero_server/protocol/ast.py b/src/zero_server/protocol/ast.py index f8a181e..52a8281 100644 --- a/src/zero_server/protocol/ast.py +++ b/src/zero_server/protocol/ast.py @@ -1,7 +1,7 @@ """The ZQL AST: what a query endpoint returns for each query zero-cache asks it to transform. Ported from rocicorp/mono `packages/zero-protocol/src/ast.ts`, `data.ts` and `primary-key.ts` at -zero/v1.11.3 (e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +zero/v1.11.4 (be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. The AST carries server names: `map_ast` maps a client-named AST through the schema's name mapper before it goes on the wire, as `handleQueryRequest` does upstream. diff --git a/src/zero_server/protocol/ast_wire.py b/src/zero_server/protocol/ast_wire.py index 2621074..d5152cf 100644 --- a/src/zero_server/protocol/ast_wire.py +++ b/src/zero_server/protocol/ast_wire.py @@ -1,7 +1,7 @@ """The AST's wire schema: what `AST.from_json` accepts, mirroring upstream's `astSchema`. Ported from rocicorp/mono `packages/zero-protocol/src/ast.ts`, `data.ts` and `primary-key.ts` at -zero/v1.11.3 (e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +zero/v1.11.4 (be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. These models are only ever parsed. Each turns into the plain node class of `zero_server.protocol.ast` it mirrors, which the builder, the query endpoint and z2s work with. diff --git a/src/zero_server/protocol/custom_queries.py b/src/zero_server/protocol/custom_queries.py index 6c52184..e3582ab 100644 --- a/src/zero_server/protocol/custom_queries.py +++ b/src/zero_server/protocol/custom_queries.py @@ -1,7 +1,7 @@ """What zero-cache POSTs to a query endpoint, and what each query becomes. -Ported from rocicorp/mono `packages/zero-protocol/src/custom-queries.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +Ported from rocicorp/mono `packages/zero-protocol/src/custom-queries.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from dataclasses import dataclass diff --git a/src/zero_server/protocol/error.py b/src/zero_server/protocol/error.py index 6e25e45..9bb86d4 100644 --- a/src/zero_server/protocol/error.py +++ b/src/zero_server/protocol/error.py @@ -1,8 +1,8 @@ """Error kinds, origins and reasons, and the bodies of a failed push or transform. Ported from rocicorp/mono `packages/zero-protocol/src/error.ts`, `error-kind-enum.ts`, -`error-origin-enum.ts` and `error-reason-enum.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +`error-origin-enum.ts` and `error-reason-enum.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from enum import StrEnum diff --git a/src/zero_server/protocol/mutate_server.py b/src/zero_server/protocol/mutate_server.py index fbb5936..bb8ef4a 100644 --- a/src/zero_server/protocol/mutate_server.py +++ b/src/zero_server/protocol/mutate_server.py @@ -1,7 +1,7 @@ """The mutate endpoint's response and query string. -Ported from rocicorp/mono `packages/zero-protocol/src/mutate-server.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +Ported from rocicorp/mono `packages/zero-protocol/src/mutate-server.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from collections.abc import Mapping diff --git a/src/zero_server/protocol/mutation.py b/src/zero_server/protocol/mutation.py index bd03e8b..1e42293 100644 --- a/src/zero_server/protocol/mutation.py +++ b/src/zero_server/protocol/mutation.py @@ -1,7 +1,7 @@ """Mutations as a push carries them, and the result recorded for each. Ported from rocicorp/mono `packages/zero-protocol/src/mutation.ts` and `mutation-type-enum.ts` at -zero/v1.11.3 (e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +zero/v1.11.4 (be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from typing import Annotated, Any, Literal diff --git a/src/zero_server/protocol/mutation_id.py b/src/zero_server/protocol/mutation_id.py index 6128699..ad861c1 100644 --- a/src/zero_server/protocol/mutation_id.py +++ b/src/zero_server/protocol/mutation_id.py @@ -1,5 +1,5 @@ -"""Ported from rocicorp/mono `packages/zero-protocol/src/mutation-id.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +"""Ported from rocicorp/mono `packages/zero-protocol/src/mutation-id.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from pydantic import Field, StrictStr diff --git a/src/zero_server/protocol/push.py b/src/zero_server/protocol/push.py index 5cb7b73..53b9960 100644 --- a/src/zero_server/protocol/push.py +++ b/src/zero_server/protocol/push.py @@ -1,7 +1,7 @@ """What zero-cache POSTs to a mutate endpoint. -Ported from rocicorp/mono `packages/zero-protocol/src/push.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +Ported from rocicorp/mono `packages/zero-protocol/src/push.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from pydantic import Field, StrictStr diff --git a/src/zero_server/protocol/query_server.py b/src/zero_server/protocol/query_server.py index 3ecd550..c55b457 100644 --- a/src/zero_server/protocol/query_server.py +++ b/src/zero_server/protocol/query_server.py @@ -1,7 +1,7 @@ """The query endpoint's response. -Ported from rocicorp/mono `packages/zero-protocol/src/query-server.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +Ported from rocicorp/mono `packages/zero-protocol/src/query-server.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from typing import Any, Final, Literal diff --git a/src/zero_server/protocol/schemas.py b/src/zero_server/protocol/schemas.py index 8b6d903..fd6d51b 100644 --- a/src/zero_server/protocol/schemas.py +++ b/src/zero_server/protocol/schemas.py @@ -3,8 +3,8 @@ Ported from rocicorp/mono `packages/shared/src/json-schema.ts`, `packages/zero-protocol/src/data.ts`, `packages/zero-protocol/src/primary-key.ts`, `packages/zero-protocol/src/mutation.ts`, `packages/zero-protocol/src/push.ts`, -`packages/zero-protocol/src/mutate-server.ts` and `packages/zero-protocol/src/custom-queries.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +`packages/zero-protocol/src/mutate-server.ts` and `packages/zero-protocol/src/custom-queries.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. The Pydantic models beside them decide what parses; `tests/wire/test_requests.py` holds the two to the same answer. These only run once a model has refused a value. diff --git a/src/zero_server/query/builder.py b/src/zero_server/query/builder.py index 48053f3..e6b1b07 100644 --- a/src/zero_server/query/builder.py +++ b/src/zero_server/query/builder.py @@ -1,7 +1,7 @@ """The ZQL query builder: a `Query` is an immutable AST under construction, in client names. -Ported from rocicorp/mono `packages/zql/src/query/query-impl.ts` and `create-builder.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +Ported from rocicorp/mono `packages/zql/src/query/query-impl.ts` and `create-builder.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. The errors match upstream's message for message, because a query endpoint reports them to the client. diff --git a/src/zero_server/query/expression.py b/src/zero_server/query/expression.py index 2324cda..01f6b54 100644 --- a/src/zero_server/query/expression.py +++ b/src/zero_server/query/expression.py @@ -1,7 +1,7 @@ """Conditions for `Query.where`: `cmp`, `and_`, `or_`, `not_` and `exists`. -Ported from rocicorp/mono `packages/zql/src/query/expression.ts` at zero/v1.11.3 -(e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +Ported from rocicorp/mono `packages/zql/src/query/expression.ts` at zero/v1.11.4 +(be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ from collections.abc import Callable diff --git a/src/zero_server/query/registry.py b/src/zero_server/query/registry.py index 6532c2a..9acdf67 100644 --- a/src/zero_server/query/registry.py +++ b/src/zero_server/query/registry.py @@ -1,7 +1,7 @@ """`define_query` and `define_queries`: named queries the query endpoint resolves by name. Ported from rocicorp/mono `packages/zql/src/query/query-registry.ts`, `validate-input.ts` and -`error.ts` at zero/v1.11.3 (e91e55f05b7a2c631f77238e1dd6fadf1029a538). Apache-2.0, Copyright Rocicorp. +`error.ts` at zero/v1.11.4 (be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. A validator is anything with Pydantic's `validate_python` (a `TypeAdapter`, or a model class), or a plain callable that returns the parsed value and raises `ValueError` on bad input. Upstream takes a diff --git a/src/zero_server/schema.py b/src/zero_server/schema.py index 9763cf2..923d3e9 100644 --- a/src/zero_server/schema.py +++ b/src/zero_server/schema.py @@ -4,7 +4,7 @@ `JSON.stringify(schema)` and load that here; this module has no schema DSL of its own. Ported from rocicorp/mono `packages/zero-types/src/schema.ts`, `schema-value.ts`, `name-mapper.ts` and -`packages/zero-schema/src/name-mapper.ts` at zero/v1.11.3 (e91e55f05b7a2c631f77238e1dd6fadf1029a538). +`packages/zero-schema/src/name-mapper.ts` at zero/v1.11.4 (be94346faaf4ee7e7b2cf983f6e5accae3a6b4fb). Apache-2.0, Copyright Rocicorp. """ diff --git a/src/zero_server/server/crud.py b/src/zero_server/server/crud.py index 109ad5d..d793fd7 100644 --- a/src/zero_server/server/crud.py +++ b/src/zero_server/server/crud.py @@ -1,8 +1,8 @@ """`tx.mutate.