From fa4d2976fcc4f88de3cf3ca84aa855c619816e0a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:21:51 +0000 Subject: [PATCH] Version Packages --- .changeset/abortable-cancelled-rejection.md | 5 - .changeset/api-bridge-and-genstrict.md | 7 - .changeset/coordination-session-shutdown.md | 5 - .changeset/core-pin-lifecycle.md | 5 - .../core-service-client-cancellation.md | 5 - .../driver-diagnostic-channel-lifetime.md | 5 - .changeset/driver-immediate-disposal.md | 5 - .changeset/driver-on-endpoints-engine.md | 23 -- .../driver-rediscovery-unhandled-rejection.md | 5 - .changeset/drizzle-own-result-fields.md | 7 - .changeset/explicit-temporal-conversion.md | 9 - .../foundation-core-channel-ownership.md | 5 - .changeset/foundation-core-ready-waiters.md | 5 - .changeset/foundation-fsm-queue-lifetime.md | 5 - .changeset/foundation-reader-ownership.md | 7 - .changeset/foundation-reader-protocol.md | 5 - .changeset/foundation-transports.md | 5 - .changeset/foundation-writer-delivery.md | 5 - .changeset/foundation-writer-inputs.md | 9 - .changeset/fsm-drain-resources.md | 5 - .changeset/fsm-queue-lifecycle.md | 5 - .changeset/fsm-runtime-rework.md | 18 -- .changeset/grpc-header-cancellation.md | 5 - .changeset/grpc-response-lifecycle.md | 5 - .changeset/grpc-segmented-requests.md | 5 - .changeset/grpc-server-owned-sockets.md | 7 - .changeset/langchain-query-executor.md | 7 - .changeset/langchain-vector-fixes.md | 5 - .changeset/native-grpc-client.md | 5 - .changeset/native-grpc-sdk.md | 23 -- .changeset/native-grpc-server.md | 5 - .changeset/nested-optional-values.md | 7 - .changeset/opentelemetry-sdk-three.md | 5 - .changeset/provider-owned-token-refresh.md | 6 - .changeset/query-cancellation-retry.md | 5 - .changeset/query-client-shutdown.md | 7 - .changeset/query-confirmed-commit-error.md | 9 - .changeset/query-explicit-declare.md | 6 - .changeset/query-parameter-data-boundary.md | 9 - .changeset/query-preencoded-requests.md | 5 - .changeset/query-promise-like.md | 5 - .changeset/query-result-tuples.md | 7 - .changeset/query-retry-failure-boundaries.md | 6 - .changeset/query-session-recovery.md | 7 - .changeset/query-streaming-client.md | 17 -- .changeset/query-tracing-ownership.md | 5 - .changeset/query-zero-timeout.md | 5 - .changeset/quiet-protobuf-writer.md | 12 - .changeset/reader-fsm-migration.md | 18 -- .changeset/reader-group-cursor.md | 5 - .changeset/refresh-runtime-dependencies.md | 10 - .changeset/rpc-credential-wait.md | 5 - .changeset/static-driver-call-hooks.md | 5 - .../telemetry-drop-pessimization-until.md | 7 - .changeset/topic-optional-timestamp.md | 5 - .changeset/topic-reader-hardening.md | 19 -- .changeset/topic-writer-fsm-consolidation.md | 21 -- .changeset/topic-writer-immediate-destroy.md | 7 - .changeset/topic-writer-producer-takeover.md | 5 - .changeset/typed-temporal-inputs.md | 10 - .changeset/value-family-decimal.md | 7 - .changeset/value-family-dynumber.md | 5 - .changeset/value-family-empty.md | 5 - .changeset/value-family-pg.md | 6 - .changeset/value-family-tagged.md | 6 - .changeset/value-family-void.md | 5 - .changeset/value-family-wide-zone.md | 5 - .changeset/value-family-wide.md | 5 - .changeset/value-null-prototype-records.md | 5 - .changeset/value-scalar-wire.md | 5 - .changeset/value-typed-decoding.md | 7 - .changeset/value-validation-boundaries.md | 7 - .changeset/value-vectors.md | 7 - examples/api/package.json | 6 +- examples/auth-yandex-cloud/package.json | 6 +- examples/coordination/package.json | 4 +- examples/diagnostics/package.json | 4 +- examples/environ/package.json | 6 +- examples/fsm/package.json | 2 +- examples/query-clients/package.json | 6 +- examples/query/package.json | 6 +- examples/sls/package.json | 6 +- examples/telemetry/package.json | 6 +- examples/tls/package.json | 6 +- examples/topic/package.json | 6 +- package-lock.json | 237 +++++++++--------- packages/abortable/CHANGELOG.md | 6 + packages/abortable/package.json | 2 +- packages/api/CHANGELOG.md | 24 ++ packages/api/package.json | 4 +- packages/auth/CHANGELOG.md | 29 +++ packages/auth/package.json | 14 +- packages/coordination/CHANGELOG.md | 32 +++ packages/coordination/package.json | 18 +- packages/core/CHANGELOG.md | 67 +++++ packages/core/package.json | 18 +- packages/debug/CHANGELOG.md | 6 + packages/debug/package.json | 2 +- packages/error/CHANGELOG.md | 27 ++ packages/error/package.json | 6 +- packages/fsm/CHANGELOG.md | 29 +++ packages/fsm/package.json | 4 +- packages/grpc/CHANGELOG.md | 26 ++ packages/grpc/package.json | 4 +- packages/query/CHANGELOG.md | 86 +++++++ packages/query/package.json | 20 +- packages/retry/CHANGELOG.md | 30 +++ packages/retry/package.json | 12 +- packages/telemetry/CHANGELOG.md | 33 ++- packages/telemetry/package.json | 10 +- packages/topic/CHANGELOG.md | 106 ++++++++ packages/topic/package.json | 20 +- packages/value/CHANGELOG.md | 65 +++++ packages/value/package.json | 4 +- third-parties/auth-yandex-cloud/CHANGELOG.md | 11 + third-parties/auth-yandex-cloud/package.json | 10 +- third-parties/drizzle-adapter/CHANGELOG.md | 42 ++++ third-parties/drizzle-adapter/package.json | 10 +- third-parties/langchain/CHANGELOG.md | 33 +++ third-parties/langchain/package.json | 8 +- 120 files changed, 881 insertions(+), 775 deletions(-) delete mode 100644 .changeset/abortable-cancelled-rejection.md delete mode 100644 .changeset/api-bridge-and-genstrict.md delete mode 100644 .changeset/coordination-session-shutdown.md delete mode 100644 .changeset/core-pin-lifecycle.md delete mode 100644 .changeset/core-service-client-cancellation.md delete mode 100644 .changeset/driver-diagnostic-channel-lifetime.md delete mode 100644 .changeset/driver-immediate-disposal.md delete mode 100644 .changeset/driver-on-endpoints-engine.md delete mode 100644 .changeset/driver-rediscovery-unhandled-rejection.md delete mode 100644 .changeset/drizzle-own-result-fields.md delete mode 100644 .changeset/explicit-temporal-conversion.md delete mode 100644 .changeset/foundation-core-channel-ownership.md delete mode 100644 .changeset/foundation-core-ready-waiters.md delete mode 100644 .changeset/foundation-fsm-queue-lifetime.md delete mode 100644 .changeset/foundation-reader-ownership.md delete mode 100644 .changeset/foundation-reader-protocol.md delete mode 100644 .changeset/foundation-transports.md delete mode 100644 .changeset/foundation-writer-delivery.md delete mode 100644 .changeset/foundation-writer-inputs.md delete mode 100644 .changeset/fsm-drain-resources.md delete mode 100644 .changeset/fsm-queue-lifecycle.md delete mode 100644 .changeset/fsm-runtime-rework.md delete mode 100644 .changeset/grpc-header-cancellation.md delete mode 100644 .changeset/grpc-response-lifecycle.md delete mode 100644 .changeset/grpc-segmented-requests.md delete mode 100644 .changeset/grpc-server-owned-sockets.md delete mode 100644 .changeset/langchain-query-executor.md delete mode 100644 .changeset/langchain-vector-fixes.md delete mode 100644 .changeset/native-grpc-client.md delete mode 100644 .changeset/native-grpc-sdk.md delete mode 100644 .changeset/native-grpc-server.md delete mode 100644 .changeset/nested-optional-values.md delete mode 100644 .changeset/opentelemetry-sdk-three.md delete mode 100644 .changeset/provider-owned-token-refresh.md delete mode 100644 .changeset/query-cancellation-retry.md delete mode 100644 .changeset/query-client-shutdown.md delete mode 100644 .changeset/query-confirmed-commit-error.md delete mode 100644 .changeset/query-explicit-declare.md delete mode 100644 .changeset/query-parameter-data-boundary.md delete mode 100644 .changeset/query-preencoded-requests.md delete mode 100644 .changeset/query-promise-like.md delete mode 100644 .changeset/query-result-tuples.md delete mode 100644 .changeset/query-retry-failure-boundaries.md delete mode 100644 .changeset/query-session-recovery.md delete mode 100644 .changeset/query-streaming-client.md delete mode 100644 .changeset/query-tracing-ownership.md delete mode 100644 .changeset/query-zero-timeout.md delete mode 100644 .changeset/quiet-protobuf-writer.md delete mode 100644 .changeset/reader-fsm-migration.md delete mode 100644 .changeset/reader-group-cursor.md delete mode 100644 .changeset/refresh-runtime-dependencies.md delete mode 100644 .changeset/rpc-credential-wait.md delete mode 100644 .changeset/static-driver-call-hooks.md delete mode 100644 .changeset/telemetry-drop-pessimization-until.md delete mode 100644 .changeset/topic-optional-timestamp.md delete mode 100644 .changeset/topic-reader-hardening.md delete mode 100644 .changeset/topic-writer-fsm-consolidation.md delete mode 100644 .changeset/topic-writer-immediate-destroy.md delete mode 100644 .changeset/topic-writer-producer-takeover.md delete mode 100644 .changeset/typed-temporal-inputs.md delete mode 100644 .changeset/value-family-decimal.md delete mode 100644 .changeset/value-family-dynumber.md delete mode 100644 .changeset/value-family-empty.md delete mode 100644 .changeset/value-family-pg.md delete mode 100644 .changeset/value-family-tagged.md delete mode 100644 .changeset/value-family-void.md delete mode 100644 .changeset/value-family-wide-zone.md delete mode 100644 .changeset/value-family-wide.md delete mode 100644 .changeset/value-null-prototype-records.md delete mode 100644 .changeset/value-scalar-wire.md delete mode 100644 .changeset/value-typed-decoding.md delete mode 100644 .changeset/value-validation-boundaries.md delete mode 100644 .changeset/value-vectors.md create mode 100644 packages/grpc/CHANGELOG.md diff --git a/.changeset/abortable-cancelled-rejection.md b/.changeset/abortable-cancelled-rejection.md deleted file mode 100644 index 44be9f0bf..000000000 --- a/.changeset/abortable-cancelled-rejection.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/abortable': minor ---- - -Accept an optional abort signal and return the original Promise when it is absent. Observe late rejections after cancellation, including when the signal was already aborted, without cancelling the underlying operation. diff --git a/.changeset/api-bridge-and-genstrict.md b/.changeset/api-bridge-and-genstrict.md deleted file mode 100644 index 58f505cbf..000000000 --- a/.changeset/api-bridge-and-genstrict.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/api': major ---- - -Regenerate the protobuf types with the bridge / multi-pile (2-DC) API: `EndpointInfo.bridge_pile_name`, `ListEndpointsResult.pile_states`, `NodeLocation.bridge_pile_name`, and a new `@ydbjs/api/bridge` export exposing `PileState` / `PileState_State`. Also pick up newer upstream fields in discovery / query / topic / monitoring. - -**Breaking:** codegen moves to `protoc-gen-es` 2.12.x (aligned with the `@bufbuild/protobuf` 2.12 runtime), which honours `exactOptionalPropertyTypes`: optional message fields are now typed `T | undefined` instead of `T`. Consumers compiled with `exactOptionalPropertyTypes` that mirror generated optional fields into their own optional-typed fields must accept `undefined` (a type-level break, no behavioural change). diff --git a/.changeset/coordination-session-shutdown.md b/.changeset/coordination-session-shutdown.md deleted file mode 100644 index 2d82ae87d..000000000 --- a/.changeset/coordination-session-shutdown.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/coordination': patch ---- - -Stop coordination sessions immediately on destroy, clear pending watch notifications and timers, and reject further operations. Support synchronous disposal while preserving graceful close and async disposal through SessionStop acknowledgment. Preserve acknowledged semaphore ownership when only the acquisition's caller signal is cancelled; return its lease for explicit release or disposal. diff --git a/.changeset/core-pin-lifecycle.md b/.changeset/core-pin-lifecycle.md deleted file mode 100644 index 74061c44a..000000000 --- a/.changeset/core-pin-lifecycle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': patch ---- - -Wait for explicit endpoint pins to reach the routing snapshot before issuing RPCs. Keep shared pins until their last client is disposed, make disposal idempotent, and release the original node even if the caller mutates the target object. Cancelled RPCs leave the client's pin available for subsequent calls. diff --git a/.changeset/core-service-client-cancellation.md b/.changeset/core-service-client-cancellation.md deleted file mode 100644 index 036ea1370..000000000 --- a/.changeset/core-service-client-cancellation.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': patch ---- - -Cancel active calls and pending token waits when a service client closes, and discard its buffered responses. Preserve sibling clients and the driver-owned shared connections. diff --git a/.changeset/driver-diagnostic-channel-lifetime.md b/.changeset/driver-diagnostic-channel-lifetime.md deleted file mode 100644 index 0f9f3ffd4..000000000 --- a/.changeset/driver-diagnostic-channel-lifetime.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': patch ---- - -Retain driver diagnostic channels across driver lifetimes and garbage collection. Discovery, connection and lifecycle subscribers remain connected when subscribing after earlier unobserved publications, including on Bun. diff --git a/.changeset/driver-immediate-disposal.md b/.changeset/driver-immediate-disposal.md deleted file mode 100644 index 238444677..000000000 --- a/.changeset/driver-immediate-disposal.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': major ---- - -Make Driver a synchronous Disposable resource. Closing or leaving a using scope cancels active work and closes connections immediately; remove the ten-second drain and async disposal. Topic readers and writers retain their own graceful completion and are disposed before Driver. diff --git a/.changeset/driver-on-endpoints-engine.md b/.changeset/driver-on-endpoints-engine.md deleted file mode 100644 index 05d536938..000000000 --- a/.changeset/driver-on-endpoints-engine.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'@ydbjs/core': major ---- - -Rebuild `Driver`'s connection layer on a new, internal endpoints engine (a pure `@ydbjs/fsm` state machine for discovery/routing/health plus an `EndpointPool` facade with a synchronous, allocation-light `acquire()` that reads an atomically-swapped immutable `RoutingSnapshot`), replacing the legacy `ConnectionPool`. The engine is an implementation detail — consumers only ever hold a `Driver` — so it is **not** exported from the package root. - -`Driver`'s public shape is preserved (`ready`, `close`, `token`, `database`, `identity`, `Disposable`/`AsyncDisposable`, `kRegisterLibrary`), and `createClient` gains direct-IO routing: - -- `createClient(service)` — balanced across all healthy nodes. -- `createClient(service, nodeId)` — soft affinity to a node (node-bound query sessions). -- `createClient(service, { nodeId, endpoint?, hard? })` — direct-IO for topic direct read/write: `hard: true` routes every RPC to `nodeId` or fails (never substitutes); `endpoint` pins a server-named node (reachable before the next discovery round, e.g. a topic `PartitionLocation`). The returned client is `Disposable` and unpins on dispose. - -Behavioural changes vs the old pool: - -- **Balancing** is uniform-random within a locality tier (opt-in via `'ydb.sdk.locality_enabled'`, default off) instead of modulo round-robin, with O(1) node affinity. -- **Pessimization** has no fixed timer: a node is pessimized on `UNAVAILABLE`/`DEADLINE_EXCEEDED` and recovers on the next successful RPC or discovery round. The `ydb:driver.connection.pessimized` payload no longer carries `until`. `'ydb.sdk.connection_pessimization_timeout_ms'` is now ignored. -- **Rediscovery** adds degradation-triggered forced rounds and single-flight/backoff; each round is bounded by `'ydb.sdk.discovery_timeout_ms'` (a timed-out round is retryable, so a hung `listEndpoints` no longer wedges rediscovery). A retryable initial failure keeps retrying (only a non-retryable error is terminal and emits `ydb:driver.failed`); a round returning zero endpoints is rejected as a retryable failure in every state — never applied to routing, so a one-round LB glitch cannot wipe the endpoint set. -- **Connections** are dialed lazily and a node dropped from discovery is drained rather than torn down (a brief flap no longer forces a reconnect). `'ydb.sdk.connection_idle_timeout_ms'` now bounds the grace a retired channel is kept before reaping (no separate idle-active teardown). A graceful shutdown (`await using driver` / `[Symbol.asyncDispose]`) drains in-flight streams and returns as soon as they finish, capped by an internal close deadline; the synchronous `close()` tears everything down immediately. -- **Bridge (2DC) piles:** on a bridge cluster, routing is restricted to endpoints whose pile is `PRIMARY`, `PROMOTED`, or `SYNCHRONIZED` (other pile states are kept out of the balancing tiers, used only as a last resort when every pile is unusable). Opt-in `'ydb.sdk.prefer_primary_pile'` (default `false`) additionally keeps traffic on the `PRIMARY`/`PROMOTED` pile, falling back to `SYNCHRONIZED` only when the primary has no available node. It is soft (fallback preserved), a no-op on a non-bridge cluster, and takes precedence over `'ydb.sdk.locality_enabled'` in bridge mode (a pile already maps to a datacenter, so the two are not combined). -- **Bridge/pool observability:** every `ydb:driver.connection.*` event now carries the endpoint's `pile` (`''` on a non-bridge cluster), and `DriverHooks`' `EndpointInfo` gains a `pile` field. `ydb:driver.discovery.completed` additionally carries `selfLocation`, the pile roster (`piles: { name, status }[]`), and `primaryPile`. New channels: `ydb:driver.connection.pool.opened` (one-shot config snapshot), `ydb:driver.connection.pool.stats` (aggregate tier/pile counts on every routable-set change), `ydb:driver.pile.changed` (pile roster/primary change, inside the discovery span), and `ydb:driver.pile.fallback` (edge-triggered when `preferPrimaryPile` serves from the SYNCHRONIZED tier). -- **New options:** `'ydb.sdk.locality_enabled'` (default `false`), `'ydb.sdk.prefer_primary_pile'` (default `false`), and `'ydb.sdk.discovery_degraded_threshold'` (0..1, default `0.5`, validated). - -The `ConnectionPool` class and the `POOL_*_FOR_TESTING` symbols are removed. All `diagnostics_channel` channel names and identity-stamped payloads are preserved (minus the `until` field on `connection.pessimized`); the round-derived events are published inside the `tracing:ydb:driver.discovery` span so `@ydbjs/telemetry` attaches them to traces. `EndpointsUnavailableError` and the `Driver*` option/connection-string error classes are re-exported from the package root. diff --git a/.changeset/driver-rediscovery-unhandled-rejection.md b/.changeset/driver-rediscovery-unhandled-rejection.md deleted file mode 100644 index 5604a7d58..000000000 --- a/.changeset/driver-rediscovery-unhandled-rejection.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': patch ---- - -Fix process crash when a background rediscovery round fails. The periodic discovery loop scheduled its rounds as floating promises, so a terminally failed round (e.g. the discovery endpoint dropping mid-round until the per-round timeout aborted the retries) escalated to an `unhandledRejection` and killed the process. Failed background rounds are now caught and logged; the connection pool keeps serving last-known endpoints and the next interval tick retries. diff --git a/.changeset/drizzle-own-result-fields.md b/.changeset/drizzle-own-result-fields.md deleted file mode 100644 index 472670d8f..000000000 --- a/.changeset/drizzle-own-result-fields.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/drizzle-adapter': major ---- - -Return mapped result rows and nested selection groups as objects with a null prototype. Selected fields named `__proto__`, `constructor`, and `toString` remain own properties. Use `Object.hasOwn(row, name)` instead of inherited methods such as `row.hasOwnProperty(name)`; spread a result into `{ ...row }` when an object with `Object.prototype` is required. - -Ignore inherited properties in object-row lookup and nullable-join metadata while retaining positional fallback for absent fields and preserving own `null` and `undefined` values. diff --git a/.changeset/explicit-temporal-conversion.md b/.changeset/explicit-temporal-conversion.md deleted file mode 100644 index f7a4d3678..000000000 --- a/.changeset/explicit-temporal-conversion.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@ydbjs/value': minor -'@ydbjs/query': minor -'@ydbjs/drizzle-adapter': patch ---- - -Add opt-in Temporal result conversion with toJs(value, { temporal: true }), new QueryClient(driver, { temporal: true }) and query(driver, { temporal: true }). Preserve the default Value/Date representations when the option is disabled. - -Use the application-provided global Temporal implementation. TzDate and TzDate32 remain SDK Values because Temporal has no zoned date-only type. Preserve Drizzle's Date and numeric column representations with Temporal-enabled clients. diff --git a/.changeset/foundation-core-channel-ownership.md b/.changeset/foundation-core-channel-ownership.md deleted file mode 100644 index fa9860104..000000000 --- a/.changeset/foundation-core-channel-ownership.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': patch ---- - -Keep active discovered channels alive across repeated retirement and revival. Keep explicitly pinned connections separate from discovered connections with the same node ID so invalidating one does not close the other. diff --git a/.changeset/foundation-core-ready-waiters.md b/.changeset/foundation-core-ready-waiters.md deleted file mode 100644 index 52730c8d1..000000000 --- a/.changeset/foundation-core-ready-waiters.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': patch ---- - -Release cancelled readiness waiters before discovery completes, without cancelling other callers. Reject readiness after driver shutdown and preserve the original cause of terminal discovery failures. diff --git a/.changeset/foundation-fsm-queue-lifetime.md b/.changeset/foundation-fsm-queue-lifetime.md deleted file mode 100644 index 2d14a521e..000000000 --- a/.changeset/foundation-fsm-queue-lifetime.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/fsm': patch ---- - -Preserve queued items when a paused consumer is cancelled immediately after the queue resumes. Release the previous yielded payload while an iterator waits for its next item. diff --git a/.changeset/foundation-reader-ownership.md b/.changeset/foundation-reader-ownership.md deleted file mode 100644 index 0719132d7..000000000 --- a/.changeset/foundation-reader-ownership.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Keep reader payloads encoded until selected for delivery, preserve unread messages after clean close, and release them on destruction or terminal failure. Preserve transactional offset cancellation, snapshot settings and callbacks, and honor cancellation between slices of a response. maxBufferBytes accounts for wire response credit rather than decompressed payloads or RSS. - -Stop the reader immediately on destruction, including synchronous callback reentry, and release pending payloads and commit waiters without requiring a subsequent close. diff --git a/.changeset/foundation-reader-protocol.md b/.changeset/foundation-reader-protocol.md deleted file mode 100644 index a1d1a0cb4..000000000 --- a/.changeset/foundation-reader-protocol.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Preserve complete-response read credit across reconnects and account for releases during backoff. Track partition-session identities and pending commits through replacement and retirement, expire unreassigned partitions, and treat oversized read responses as terminal errors. Split sparse commit replay into bounded requests so reconnect cannot combine valid individual commits into an oversized frame. diff --git a/.changeset/foundation-transports.md b/.changeset/foundation-transports.md deleted file mode 100644 index 4af6d8786..000000000 --- a/.changeset/foundation-transports.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Keep Topic requests and token refreshes attached to the current stream. Ignore obsolete completions, prevent opening streams after cancellation, and continue reader token renewal when unchanged credentials are not acknowledged. diff --git a/.changeset/foundation-writer-delivery.md b/.changeset/foundation-writer-delivery.md deleted file mode 100644 index 53b972cd3..000000000 --- a/.changeset/foundation-writer-delivery.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Keep independent flush boundaries across acknowledgments and reconnect deduplication. Drain writer close through the normal connection lifecycle, preserve timed batching without repeated partial-batch scans, and release buffered messages, callbacks and codecs on shutdown. Restore the TopicTxWriter type export and contain rejected acknowledgment observers. diff --git a/.changeset/foundation-writer-inputs.md b/.changeset/foundation-writer-inputs.md deleted file mode 100644 index 81d3c1575..000000000 --- a/.changeset/foundation-writer-inputs.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Snapshot Topic writer dates and metadata at admission, copy bounded or growable payload views, and reject invalid dates or sequence numbers before accepting a message. Generate default producer identities with randomUUID(). - -Include metadata key/value bytes in the retained write budget and release that reservation after acknowledgments or reconnect recovery. Reject metadata above the 4096-byte per-message limit before copying it or changing writer state. - -Remove the unused acknowledged payload-byte diagnostic and calculate acknowledgment status counts only when the channel has subscribers. diff --git a/.changeset/fsm-drain-resources.md b/.changeset/fsm-drain-resources.md deleted file mode 100644 index cc8356a1f..000000000 --- a/.changeset/fsm-drain-resources.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/fsm': patch ---- - -Drain queued events with an indexed FIFO and release consumed references without repeatedly shifting the backlog. Avoid redundant drain waiters and Promise work for effect-free dispatch, and reuse the fulfilled Promise within each drain of synchronous effects. Preserve event order, microtask boundaries, shutdown behavior, and asynchronous context lifetime. Do not open an ingest source when its signal is already aborted. diff --git a/.changeset/fsm-queue-lifecycle.md b/.changeset/fsm-queue-lifecycle.md deleted file mode 100644 index a2611aff1..000000000 --- a/.changeset/fsm-queue-lifecycle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/fsm': patch ---- - -Keep queue readers isolated across reset, honor repeated pauses, and preserve already assigned values and terminal results during cancellation. diff --git a/.changeset/fsm-runtime-rework.md b/.changeset/fsm-runtime-rework.md deleted file mode 100644 index e537e6504..000000000 --- a/.changeset/fsm-runtime-rework.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'@ydbjs/fsm': major ---- - -Rework the runtime around a declarative lifecycle and surface faults to consumers. - -Breaking changes: - -- `EffectRuntime` no longer exposes `close()`, `destroy()`, or `ingest()` — it is now identical to `TransitionRuntime` (state, signal, emit, dispatch). Transitions and effect handlers run inside the event-drain loop, so awaiting the machine's own closure from there was a structural promise-cycle deadlock, and closing it mid-drain silently dropped queued outputs. -- A transition declares termination by returning `final: { reason }` in its `TransitionResult`: the machine stops accepting new events immediately, runs that transition's effects (cleanup), drains events already queued, then seals the output stream; `reason` lands on `signal.reason`. An effect that hits an unrecoverable error `throw`s — the machine is destroyed and the output iterator rethrows the error. -- `AbstractAsyncQueue.dispose()` (from `@ydbjs/fsm/queue`) is removed — it was a pure alias of `destroy()`; call `destroy()` or rely on `using` (`[Symbol.dispose]` now calls `destroy()` directly). - -Fixes and additions: - -- Internal machine faults now reach output consumers. When a transition, effect, or ingest source throws, the runtime still tears the machine down, but its output async-iterator rethrows the stop reason after draining instead of ending silently — so a consumer iterating the machine observes the failure and runs its terminal handling rather than mistaking a fault for a graceful close. The fault is delivered through the output queue via a new `AsyncQueue.fail(error)` primitive (seals the queue like `close()`, but the iterator throws `error` once the buffer drains). The iterator stays a direct queue passthrough — wrapping it in an async generator would add a per-item microtask that reorders delivery for latency-sensitive consumers. -- New `AsyncQueue.take(signal?)`: a cancellable single-step dequeue with the iterator's exact contract (pause, drain-then-throw after `fail()`). Aborting removes the parked waiter atomically inside the queue, so a cancelled `take()` can never swallow an item — unlike racing `iterator.next()` with a promise combinator, which leaves the underlying `next()` pending. Compose a bounded wait at the call site with `linkSignals(signal, AbortSignal.timeout(ms))`. -- An event dispatched synchronously from within a transition is now processed after the current transition's state change is applied, instead of being run re-entrantly against the stale (pre-transition) state. -- `close()` now waits for an in-flight drain to finish and drains any tail before sealing the output stream, so outputs from events queued during that drain are not dropped. diff --git a/.changeset/grpc-header-cancellation.md b/.changeset/grpc-header-cancellation.md deleted file mode 100644 index c969b9276..000000000 --- a/.changeset/grpc-header-cancellation.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/grpc': patch ---- - -Stop processing response trailers when a header observer closes or disposes the client. Report cancellation once and do not invoke trailer observers after shutdown. diff --git a/.changeset/grpc-response-lifecycle.md b/.changeset/grpc-response-lifecycle.md deleted file mode 100644 index f863374a0..000000000 --- a/.changeset/grpc-response-lifecycle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/grpc': patch ---- - -Preserve completed responses before malformed frame errors and after terminal trailers followed by HTTP/2 resets. Preserve repeated text trailer values. Reject service definitions with the reserved `close` method name and timer settings above Node's maximum delay. diff --git a/.changeset/grpc-segmented-requests.md b/.changeset/grpc-segmented-requests.md deleted file mode 100644 index ae5f9ea5b..000000000 --- a/.changeset/grpc-segmented-requests.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/grpc': minor ---- - -Allow request serializers to return a readonly array of byte segments. Send the segments as one gRPC message without combining them into a new buffer, validate their total size before writing, and respect HTTP/2 backpressure between segments. diff --git a/.changeset/grpc-server-owned-sockets.md b/.changeset/grpc-server-owned-sockets.md deleted file mode 100644 index 262fe9cf2..000000000 --- a/.changeset/grpc-server-owned-sockets.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/grpc': patch ---- - -Terminate server connections through their owned sockets during immediate shutdown. Avoid destroying the same HTTP/2 session again while a peer cancellation is already closing it. - -Classify synthetic CANCEL during socket loss as UNAVAILABLE even before the runtime marks the HTTP/2 session destroyed. Preserve a server CANCEL on a healthy connection draining after graceful GOAWAY. diff --git a/.changeset/langchain-query-executor.md b/.changeset/langchain-query-executor.md deleted file mode 100644 index 5866132cd..000000000 --- a/.changeset/langchain-query-executor.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/langchain': minor ---- - -Pass `queryClient` to `YDBVectorStore` to share an existing session pool. The store borrows the supplied client and driver. With a supplied driver it owns the pool, and with a connection string it owns both resources. - -Run vector queries through QueryClient with named parameters. Searches can retry after a lost response without repeating schema changes or embedding requests. An indexed search with a metadata filter fails before lazy table initialization, including when `dropExistingTable` is set. diff --git a/.changeset/langchain-vector-fixes.md b/.changeset/langchain-vector-fixes.md deleted file mode 100644 index 00da66bb2..000000000 --- a/.changeset/langchain-vector-fixes.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/langchain': minor ---- - -Honor explicit document IDs used by LangChain indexing, validate destructive delete options and vector dimensions, and reject invalid search scores. Bound embedding memory by processing and committing one batch at a time, and use the shared Float32 vector value encoding. Accept typed-array views for precomputed vectors and require Node.js 22.15 or a supported newer release. diff --git a/.changeset/native-grpc-client.md b/.changeset/native-grpc-client.md deleted file mode 100644 index 9c25d7a2f..000000000 --- a/.changeset/native-grpc-client.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/grpc': minor ---- - -Add a standalone HTTP/2 gRPC client with Promise unary calls, AsyncIterable streams, deadlines, cancellation, metadata, TLS, backpressure, GOAWAY handling, and bounded framing. Request headers and bodies are written separately without an extra payload copy. diff --git a/.changeset/native-grpc-sdk.md b/.changeset/native-grpc-sdk.md deleted file mode 100644 index 4f60067cf..000000000 --- a/.changeset/native-grpc-sdk.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'@ydbjs/api': major -'@ydbjs/auth': major -'@ydbjs/core': major -'@ydbjs/coordination': major -'@ydbjs/query': major -'@ydbjs/retry': major -'@ydbjs/telemetry': major -'@ydbjs/topic': major -'@ydbjs/error': minor ---- - -Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. - -Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. - -Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. - -High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. - -Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. - -Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. diff --git a/.changeset/native-grpc-server.md b/.changeset/native-grpc-server.md deleted file mode 100644 index 7075d904a..000000000 --- a/.changeset/native-grpc-server.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/grpc': minor ---- - -Add a typed HTTP/2 gRPC server with Promise and AsyncIterable handlers, cancellation, deadlines, metadata, TLS, and backpressure. Synchronous disposal cancels active calls; explicit close drains accepted calls. Invalid response metadata fails only its RPC, and deadlines reset incomplete response messages instead of sending malformed gRPC responses. diff --git a/.changeset/nested-optional-values.md b/.changeset/nested-optional-values.md deleted file mode 100644 index f80a1ffad..000000000 --- a/.changeset/nested-optional-values.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/value': patch ---- - -Preserve the presence of outer Optional values when an inner Optional is null. Encode the required nested_value wrapper and unwrap the corresponding level when decoding query results, instead of returning a protobuf object as a native scalar. - -Preserve struct members such as `__proto__` as own data properties, and apply the same own-field rule to single objects and lists of objects. diff --git a/.changeset/opentelemetry-sdk-three.md b/.changeset/opentelemetry-sdk-three.md deleted file mode 100644 index 3275aeb20..000000000 --- a/.changeset/opentelemetry-sdk-three.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/telemetry': major ---- - -Require OpenTelemetry API 1.10 and SDK 3.x (experimental packages 0.300.x). Update application providers, processors, and exporters together; SDK 2.x providers are not compatible with API 1.10. Trace context and baggage propagation remain supported. diff --git a/.changeset/provider-owned-token-refresh.md b/.changeset/provider-owned-token-refresh.md deleted file mode 100644 index 59166af0e..000000000 --- a/.changeset/provider-owned-token-refresh.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@ydbjs/auth': patch -'@ydbjs/auth-yandex-cloud': patch ---- - -Keep shared token refreshes independent of individual callers. Static, metadata, and Yandex Cloud providers own a five-second foreground request budget, including retries; static and Yandex Cloud background refreshes have a thirty-second budget. Cancelling a token request stops only that caller's wait. Cached reads and callers joining a refresh do not create provider timeouts. diff --git a/.changeset/query-cancellation-retry.md b/.changeset/query-cancellation-retry.md deleted file mode 100644 index f7878ea98..000000000 --- a/.changeset/query-cancellation-retry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/query': patch ---- - -Keep caller cancellation terminal even when its reason is a retryable database error. Cover pre-aborted nested operations, statements and tagged queries, and streams cancelled before their first read. Preserve the original reason as the cause, and finish stream cleanup before classifying callback failures for retry. diff --git a/.changeset/query-client-shutdown.md b/.changeset/query-client-shutdown.md deleted file mode 100644 index a05b4d9c7..000000000 --- a/.changeset/query-client-shutdown.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/query': minor ---- - -Add graceful `QueryClient.close()` and immediate `destroy()`. Async disposal drains accepted queries, transactions and session cleanup; synchronous disposal cancels owned work without closing the shared Driver. Release query resources after failed readiness and destruction, and prevent late cleanup RPCs or callbacks after shutdown. - -Keep actual query and transaction attempts owned until their cleanup completes, even when caller cancellation has already rejected the retry wrapper. Graceful close waits for rollback and close hooks; destroy still cancels them immediately. diff --git a/.changeset/query-confirmed-commit-error.md b/.changeset/query-confirmed-commit-error.md deleted file mode 100644 index 6b412186a..000000000 --- a/.changeset/query-confirmed-commit-error.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@ydbjs/error': minor -'@ydbjs/retry': patch -'@ydbjs/query': major ---- - -Report failed completion hooks after a confirmed commit as TransactionCompletionError, with committed=true and the original cause. Preserve this terminal classification across enclosing SDK retriers instead of exposing a retryable database error for an already committed transaction. - -Release SDK resources when cancellation interrupts application cleanup hooks. Preserve confirmed commit information on cancellation, and wrap retryable database errors used as cancellation reasons in AbortError with the original cause so enclosing callbacks cannot replay them. diff --git a/.changeset/query-explicit-declare.md b/.changeset/query-explicit-declare.md deleted file mode 100644 index 0ac9d92fd..000000000 --- a/.changeset/query-explicit-declare.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@ydbjs/query': major -'@ydbjs/value': patch ---- - -Stop generating `DECLARE` statements for tagged SQL. Write explicit declarations for servers or parameter types that require them. Named bindings with `.parameter()` and `.param()` now infer YDB types from native JavaScript values. Pass an SDK Value to select an exact type, or `undefined` to clear a binding. Malformed explicit Values throw when bound. QueryClient.driver exposes its underlying Driver for adapters sharing the client. diff --git a/.changeset/query-parameter-data-boundary.md b/.changeset/query-parameter-data-boundary.md deleted file mode 100644 index 961769618..000000000 --- a/.changeset/query-parameter-data-boundary.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@ydbjs/query': patch -'@ydbjs/drizzle-adapter': patch -'@ydbjs/langchain': patch ---- - -Infer tagged parameters through fromJs so JSON objects with type-like fields are bound as data. Reject malformed explicit Value bindings before executing the query. Escape backslashes as well as backticks in quoted identifiers. - -Use default YQL string escaping in Drizzle inline values and DDL builders, and in LangChain filter paths. Preserve backslashes before escaping quotes so data cannot terminate generated SQL literals. diff --git a/.changeset/query-preencoded-requests.md b/.changeset/query-preencoded-requests.md deleted file mode 100644 index 9d4027d48..000000000 --- a/.changeset/query-preencoded-requests.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/query': minor ---- - -Encode standalone tagged SQL text, settings and parameters before session admission and reuse the encoded request across automatic retries. Send the current session ID and query bytes as separate parts of one gRPC message. Remove protobuf graph snapshots and their internal exports. Explicit retry callbacks encode their current inputs on every statement call. diff --git a/.changeset/query-promise-like.md b/.changeset/query-promise-like.md deleted file mode 100644 index c22ba79cf..000000000 --- a/.changeset/query-promise-like.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/query': patch ---- - -Accept null callbacks in Query.then() to preserve PromiseLike compatibility when tagged query results are widened to unknown[][]. diff --git a/.changeset/query-result-tuples.md b/.changeset/query-result-tuples.md deleted file mode 100644 index c0aca1386..000000000 --- a/.changeset/query-result-tuples.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/query': major ---- - -Use a tuple of row types for query results: `sql<[Row]>` and `session.execute<[Row]>()` describe one result set, while `<[Row, CountRow]>` describes two. Reject a single row type or an unbounded array such as `Row[]` as the result generic. - -Keep `execute()` results as `{ resultSets, stats, metadata }`, with `rows`, `columns`, and `truncated` in each result set. Tagged queries continue returning arrays of rows. Preserve the result-set tuple when calling `.values()`. diff --git a/.changeset/query-retry-failure-boundaries.md b/.changeset/query-retry-failure-boundaries.md deleted file mode 100644 index e3aec0330..000000000 --- a/.changeset/query-retry-failure-boundaries.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@ydbjs/grpc': minor -'@ydbjs/retry': patch ---- - -Distinguish local protocol failures and HTTP/2 transport failures from server gRPC statuses. Stop retrying deterministic message-size and encoding failures (#586), and require idempotency before retrying ambiguous INTERNAL statuses or transport overload resets. Preserve the caller's cancellation reason and notify retry observers for attempts without backoff. diff --git a/.changeset/query-session-recovery.md b/.changeset/query-session-recovery.md deleted file mode 100644 index 12ec97992..000000000 --- a/.changeset/query-session-recovery.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/query': patch ---- - -Continue serving queued queries after session creation fails, propagate cancellation into replacement session creation, and prevent repeated lease disposal from lending one session to concurrent callers. Reject invalid session-pool bounds and retire sessions that cannot safely be reused after interrupted queries. - -Centralize pool ownership and shutdown transitions in one state machine. Bound admitted operations before driver readiness as well as queued acquisitions, while allowing already accepted work to finish retries during graceful shutdown. diff --git a/.changeset/query-streaming-client.md b/.changeset/query-streaming-client.md deleted file mode 100644 index ca9275767..000000000 --- a/.changeset/query-streaming-client.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@ydbjs/query': major -'@ydbjs/drizzle-adapter': patch -'@ydbjs/langchain': patch ---- - -Export the raw QueryClient class from the package root with retrySession(options, callback) and retryTransaction(options, callback) as its execution entry points. Options may be omitted, but the callback is always last. Each callback receives an executor and the current attempt's cancellation signal; execute() and stream() belong to that executor. The root client has no execute(), do(), transaction() or stream() methods. Retry policy belongs to the callback, while statement signal and timeout options can cap individual operations within the callback budget. - -Rename the callable tagged client type to SQLClient and migrate the Drizzle and LangChain integrations. query(driver) and query(client) provide the convenient tagged API, preserving sql.do(), sql.begin(), sql.transaction(), result shapes and repeat-await behavior over the same execution engine and pool. - -Streaming is available only from executors inside SDK-owned retry callbacks. The SDK owns retry boundaries and revokes streams when their callback ends. - -Keep tagged query bindings stable across retries; raw retry callbacks may build new parameters on each attempt, while each statement encodes its inputs before consumption. Revoke executors and unfinished streams when their callback ends, and prevent replay after a confirmed commit. Separate stream cancellation from session loss and preserve caller cancellation reasons. Expose beforeCommit for precommit work while retaining onCommit for transactional Topic compatibility. - -Reject commit-hook registration after preparation starts, and observe all started hooks even when another hook throws synchronously. - -Return object rows with null prototypes from execute(), stream() and the tagged SQL facade, including raw-mode rows. Array-mode rows and raw protobuf cells keep their respective representations. diff --git a/.changeset/query-tracing-ownership.md b/.changeset/query-tracing-ownership.md deleted file mode 100644 index 729bb618d..000000000 --- a/.changeset/query-tracing-ownership.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/query': patch ---- - -Preserve the query tracing context while consuming or closing ExecuteQuery RPCs, without changing the consumer's async context. diff --git a/.changeset/query-zero-timeout.md b/.changeset/query-zero-timeout.md deleted file mode 100644 index 5b6af66b4..000000000 --- a/.changeset/query-zero-timeout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/query': patch ---- - -Honor a zero timeout on tagged queries instead of treating it as an absent timeout. Keep the cancellation budget consistent with the raw QueryClient. diff --git a/.changeset/quiet-protobuf-writer.md b/.changeset/quiet-protobuf-writer.md deleted file mode 100644 index 7105578e9..000000000 --- a/.changeset/quiet-protobuf-writer.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@ydbjs/api': patch -'@ydbjs/auth': patch -'@ydbjs/coordination': patch -'@ydbjs/core': patch -'@ydbjs/error': patch -'@ydbjs/query': patch -'@ydbjs/topic': patch -'@ydbjs/value': patch ---- - -Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. diff --git a/.changeset/reader-fsm-migration.md b/.changeset/reader-fsm-migration.md deleted file mode 100644 index 4c2a9a705..000000000 --- a/.changeset/reader-fsm-migration.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'@ydbjs/topic': major ---- - -Rebuild the topic reader on a deterministic `@ydbjs/fsm` state machine (transport FSM + reader FSM), mirroring the writer. The public `TopicReader` / `TopicTxReader` API (read / commit / close / destroy + callbacks) is unchanged; the behaviour is more reliable: - -- `commit()` no longer rejects on a transparent reconnect. Pending commits are held per partition and re-sent on the new partition session (verified against a live server — YDB accepts a re-sent commit for offsets not read on that session), so a `read()` + `commit()` loop survives reconnects instead of crashing. -- Transactional read offsets are keyed by the stable partition id and survive a reconnect (previously lost, so the transaction could miss offsets). -- Byte flow-control is charged once per `ReadResponse` — a response spanning several partitions no longer over-releases credit. -- Retention gap-fill (committing past retention-deleted offsets) is preserved. -- `read()` accumulates a batch up to `limit`. With `batchWindowMs` set it yields at least every window (an empty batch on an idle topic, so a polling consumer never hangs); without it, it blocks until the next delivered chunk. The option was renamed from `waitMs`, which remains as a deprecated alias. -- On an unrecoverable terminal error `read()` now throws (instead of ending like a clean end-of-stream); the reader is already torn down, so it is not reusable and every further `read()` / `commit()` throws too. -- Transparent reconnect is now unbounded by default (waits for the server/topic to come back); the new `recoveryWindowMs` option re-imposes a finite terminal deadline. The new `retryOnSchemeError` option (off by default) retries `SCHEME_ERROR` so a reader started before its topic exists waits until it is created. A running reader whose topic is dropped idles until the server closes the stale read stream (~1 min), then transparently reconnects and resumes automatically if the topic exists again (`retryOnSchemeError` extends this to a topic recreated later). -- The new `gracefulShutdownTimeoutMs` option makes the graceful `close()` deadline configurable (default 30 s): past it, pending commits are dropped and the reader force-closes. -- Structured lifecycle events on `node:diagnostics_channel` under `ydb:topic.reader.*`, plus a `tracing:ydb:topic.reader.commit` span. -- `TopicTxReader` is now `AsyncDisposable` / `Disposable`. A manual `commit()` on a tx reader now throws — the `TopicTxReader` type never exposed it, but the runtime object did, and a plain-JS call would commit offsets outside the transaction (they would survive its rollback). -- `TopicPartitionSession.nextCommitStartOffset` is removed from the public class. It was commit-machinery state that leaked into the public surface in 6.1.x: user-visible (and mutable), while a corrupted anchor produces malformed commit ranges — which are session-fatal server-side. The gap-fill anchor now lives inside the reader state machine, keyed by the stable partition id, so it also survives reconnects (the session object does not). -- The default `maxBufferBytes` (server read credit / client-side buffer cap) is now 8 MiB, up from 4 MiB. diff --git a/.changeset/reader-group-cursor.md b/.changeset/reader-group-cursor.md deleted file mode 100644 index a7a332a8f..000000000 --- a/.changeset/reader-group-cursor.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Reduce topic reader allocations by consuming partition groups directly and releasing delivered message references while retaining unread messages. diff --git a/.changeset/refresh-runtime-dependencies.md b/.changeset/refresh-runtime-dependencies.md deleted file mode 100644 index 60bfbb7f0..000000000 --- a/.changeset/refresh-runtime-dependencies.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@ydbjs/coordination': patch -'@ydbjs/debug': patch -'@ydbjs/query': patch -'@ydbjs/telemetry': patch -'@ydbjs/topic': patch -'@ydbjs/value': patch ---- - -Refresh compatible dependency versions and remove unused runtime packages. Include the `ms` types required by the Topic reader's published declarations. diff --git a/.changeset/rpc-credential-wait.md b/.changeset/rpc-credential-wait.md deleted file mode 100644 index cef80ed24..000000000 --- a/.changeset/rpc-credential-wait.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': patch ---- - -Apply `ydb.sdk.token_timeout_ms` to each caller's wait for credentials before RPCs and through the `token` getter. Preserve the original RPC deadline and caller abort reason without forwarding RPC cancellation to shared provider work. Closing the Driver cancels its token waits. Already-fulfilled token promises do not allocate a token-wait timer. Measure the token-wait duration with a monotonic clock so system-clock changes cannot extend or shorten the configured budget. diff --git a/.changeset/static-driver-call-hooks.md b/.changeset/static-driver-call-hooks.md deleted file mode 100644 index 89d671978..000000000 --- a/.changeset/static-driver-call-hooks.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/core': patch ---- - -Publish driver call hooks for static connections as well as discovery-managed endpoints. diff --git a/.changeset/telemetry-drop-pessimization-until.md b/.changeset/telemetry-drop-pessimization-until.md deleted file mode 100644 index 40608b280..000000000 --- a/.changeset/telemetry-drop-pessimization-until.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/telemetry': patch ---- - -Drop the `pessimization.until` span-event attribute from the `ydb:driver.connection.pessimized` subscriber. The endpoints engine in `@ydbjs/core` no longer emits `until` (pessimization has no fixed timer), so the subscriber was writing `NaN` (`undefined / 1000`) as the attribute value under an active span. The `ATTR_YDB_DRIVER_CONNECTION_PESSIMIZATION_UNTIL` semconv constant is kept but deprecated. - -Add the `ydb.node.pile` (`ATTR_YDB_NODE_PILE`) span-event attribute to every `ydb:driver.connection.*` mapping, so bridge (2DC) traces show which pile each node belongs to alongside `ydb.node.dc`. The attribute is omitted on a non-bridge cluster (empty pile name). diff --git a/.changeset/topic-optional-timestamp.md b/.changeset/topic-optional-timestamp.md deleted file mode 100644 index 0130e2186..000000000 --- a/.changeset/topic-optional-timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Widen the reader's internal `PartitionReadData` timestamp fields (`writtenAt`, `createdAt`) to `Timestamp | undefined` to match the stricter optional-field typing from the regenerated `@ydbjs/api`. No behavioural change. diff --git a/.changeset/topic-reader-hardening.md b/.changeset/topic-reader-hardening.md deleted file mode 100644 index e8b9d0229..000000000 --- a/.changeset/topic-reader-hardening.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -'@ydbjs/topic': major ---- - -Harden the topic reader's commit semantics and multi-topic support, extend the reader/writer contracts: - -- Multi-topic readers key all partition state by (topic, partition id): topics sharing partition ids no longer collide (previously messages of one topic could be silently dropped and its commits attributed to the other topic's partition). -- `commit()` acknowledges exactly the messages it was given: each message covers its own offset range plus the server-side hole immediately preceding it (retention gaps, `readFrom` skips). Delivered-but-uncommitted messages are never covered by another message's commit; sparse commits resolve once the server watermark reaches them; overlapping commits never resolve before that watermark. Synchronous calls are combined into one microtask batch and return the same promise, so per-message concurrent processing produces one commit request instead of one request and promise per message. A commit racing a partition stop rejects immediately instead of hanging until the reassign GC. -- `commit()` rejects messages that belong to another reader's partition session. -- `onCommittedOffset` fires on every server-confirmed advance — commit acks, stop-request watermarks and partition status responses — including ended and stopped partitions. Start-hook `commitOffset` overrides are confirmed through partition status before resolving pending commits or notifying observers; graceful close waits for that confirmation. -- Soft partition stop honors the documented contract: `onPartitionSessionStop` is awaited before the stop response is sent and the partition keeps accepting reads and commits meanwhile — a real "last chance to commit". -- Transactional readers bind offsets at `read()` delivery (never covering buffered messages the consumer did not see), cover head gaps from the committed offset, keep tracked offsets when closed before the transaction commits, and route `UpdateOffsetsInTransaction` to the transaction session's node. -- `read()` validates `limit` and `batchWindowMs`; a read aborted mid-accumulation redelivers the accumulated messages on the next `read()` instead of dropping them. -- Large batches of small messages are delivered without exceeding the JavaScript function argument limit. -- Read flow-control credit is returned only after every message from a server response has passed through the async iterable. `reader.bufferedBytes` and `ydb:topic.reader.buffer.changed` expose the server-accounted bytes still retained by the reader. -- New reader option `autoPartitioningSupport` declares autopartitioning support to the server; ended partition sessions expose `childPartitionIds` / `adjacentPartitionIds`. -- The writer validates its configured codec against the server's `supportedCodecs` at init — fail-fast with an actionable error instead of a terminal server error after buffering — and rejects an empty `producer` id (silent no-dedup mode). -- `readFrom: 0` (the epoch) and `maxLag: 0` reach the InitRequest instead of being silently dropped. -- Drop Node.js 20 support. Require Node.js 22.15+ on the 22.x release line or Node.js 23.8+, with built-in RAW, GZIP and ZSTD codecs available on every supported runtime. diff --git a/.changeset/topic-writer-fsm-consolidation.md b/.changeset/topic-writer-fsm-consolidation.md deleted file mode 100644 index 9505b1493..000000000 --- a/.changeset/topic-writer-fsm-consolidation.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -'@ydbjs/topic': major ---- - -Consolidate the topic writer onto a single deterministic `@ydbjs/fsm` state machine. - -Breaking changes: - -- `write()` now returns `void` instead of a sequence number. Obtain the last acknowledged `seqNo` via `flush()` (returns `bigint`) or the `onAck` callback. -- `flush()` now returns `bigint` (was `bigint | undefined`). -- Removed the experimental `@ydbjs/topic/writer2` subpath export. -- Removed the `retryConfig` writer option. The writer now reconnects transparently (exponential backoff + jitter) and, by default, indefinitely — waiting for the server/topic to come back; the new `recoveryWindowMs` option re‑imposes a terminal deadline. In‑flight messages are resent and pending writes are not failed by a transparent reconnect. -- `flushIntervalMs` default changed from 10ms to 1000ms. -- `close()` now rejects when the graceful drain fails (non‑retryable error, or timeout with undelivered messages) instead of resolving silently — this makes transactional commit hooks fail rather than commit with lost writes. - -Fixes and additions: - -- Non‑RAW codecs (GZIP/ZSTD) are compressed once at `write()` and the compressed bytes are what the buffer accounts and the wire carries. -- `maxBufferBytes` is now enforced as a fail‑fast cap: `write()` throws synchronously when a message would push the un‑acknowledged buffer past the limit (default 256 MB), bounding writer memory. -- New options: `recoveryWindowMs` (finite reconnect deadline; unbounded by default), `retryOnSchemeError` (retry SCHEME_ERROR to wait for a not‑yet‑created topic; off by default), `gracefulShutdownTimeoutMs`, `partitionId` / `messageGroupId` (mutually exclusive), and `producer` is auto‑generated when omitted. -- Structured lifecycle events on `node:diagnostics_channel` under `ydb:topic.writer.*`. diff --git a/.changeset/topic-writer-immediate-destroy.md b/.changeset/topic-writer-immediate-destroy.md deleted file mode 100644 index 49705447c..000000000 --- a/.changeset/topic-writer-immediate-destroy.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Stop TopicWriter synchronously on destroy, release pending writes and callback references, and reject outstanding flush and close operations. Stop acknowledgment delivery when a callback or diagnostics subscriber destroys the writer. Preserve the first destruction or runtime failure reason when synchronous transport completion hooks reenter destroy. Graceful close continues to drain accepted writes and can still be interrupted by destroy. - -Cancel reader and writer credential waits when their stream is destroyed or replaced, while leaving shared provider refreshes running. diff --git a/.changeset/topic-writer-producer-takeover.md b/.changeset/topic-writer-producer-takeover.md deleted file mode 100644 index c2e4444c8..000000000 --- a/.changeset/topic-writer-producer-takeover.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/topic': patch ---- - -Stop a topic writer when the server explicitly reports that another session took over its producer, including the SESSION_EXPIRED response used by newer YDB versions. Preserve the original server error and keep retrying other expired-session errors. diff --git a/.changeset/typed-temporal-inputs.md b/.changeset/typed-temporal-inputs.md deleted file mode 100644 index 5ccc87b41..000000000 --- a/.changeset/typed-temporal-inputs.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@ydbjs/value': major -'@ydbjs/drizzle-adapter': patch ---- - -Preserve extended temporal values and supported timezone values as SDK Values in default JavaScript results. Keep Date, Datetime and Timestamp results as JavaScript Date and Interval as a number; preserve Drizzle's declared Date and numeric column types. - -Replace date-fns/TZDate with exact Temporal inputs and timezone text. The application supplies globalThis.Temporal; the SDK does not install or register a polyfill. Timezone constructors require Temporal for validation, including string inputs. Reject excess precision, non-ISO calendars, calendar durations and ambiguous local times. - -Require TypeScript 7 or later for the standard Temporal declarations included by the published types. diff --git a/.changeset/value-family-decimal.md b/.changeset/value-family-decimal.md deleted file mode 100644 index 87cb9b79c..000000000 --- a/.changeset/value-family-decimal.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/value': minor ---- - -Add Decimal and DecimalType with exact string and scaled-bigint construction, binary decoding, native string projection and precision/scale validation. - -Reject invalid unsigned wire words before composing the signed coefficient, so malformed values cannot be truncated into valid decimals. diff --git a/.changeset/value-family-dynumber.md b/.changeset/value-family-dynumber.md deleted file mode 100644 index e86a79485..000000000 --- a/.changeset/value-family-dynumber.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/value': minor ---- - -Add DyNumber and DyNumberType constructors and preserve exact decimal text in query parameters and native string results. diff --git a/.changeset/value-family-empty.md b/.changeset/value-family-empty.md deleted file mode 100644 index b9c1cb701..000000000 --- a/.changeset/value-family-empty.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/value': minor ---- - -Add EmptyList and EmptyDict constructors. Preserve their distinct wire schemas during decoding and project them to native arrays and Maps. diff --git a/.changeset/value-family-pg.md b/.changeset/value-family-pg.md deleted file mode 100644 index 3a694043c..000000000 --- a/.changeset/value-family-pg.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@ydbjs/value': major -'@ydbjs/query': major ---- - -Remove PostgreSQL Value types and the `@ydbjs/value/pg` entry point. Decoding a PostgreSQL schema now fails explicitly, including inside empty containers and absent Optionals. Query parameters reject PostgreSQL schemas, including custom Values. Query raw mode continues to return the wire values and type descriptors. diff --git a/.changeset/value-family-tagged.md b/.changeset/value-family-tagged.md deleted file mode 100644 index b15ab7403..000000000 --- a/.changeset/value-family-tagged.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@ydbjs/value': minor -'@ydbjs/query': patch ---- - -Add Tagged and TaggedType to preserve result tags and typed payloads. Reject Tagged parameter schemas before ExecuteQuery; apply AsTagged in YQL instead. diff --git a/.changeset/value-family-void.md b/.changeset/value-family-void.md deleted file mode 100644 index c62e63c8d..000000000 --- a/.changeset/value-family-void.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/value': minor ---- - -Add Void and VoidType with explicit typed results and query parameter support. diff --git a/.changeset/value-family-wide-zone.md b/.changeset/value-family-wide-zone.md deleted file mode 100644 index 643aab616..000000000 --- a/.changeset/value-family-wide-zone.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/value': minor ---- - -Add TzDate32, TzDatetime64 and TzTimestamp64 with exact timezone text, Temporal inputs and validation across extended YDB ranges. Keep results as typed Values by default. diff --git a/.changeset/value-family-wide.md b/.changeset/value-family-wide.md deleted file mode 100644 index 11e527b72..000000000 --- a/.changeset/value-family-wide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/value': minor ---- - -Add Date32, Datetime64, Timestamp64 and Interval64 constructors with exact units and Temporal inputs. Preserve their default typed Value representation and validate server ranges. diff --git a/.changeset/value-null-prototype-records.md b/.changeset/value-null-prototype-records.md deleted file mode 100644 index dc319048d..000000000 --- a/.changeset/value-null-prototype-records.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/value': major ---- - -Return null-prototype records from toJs(Struct), including nested Structs and Structs inside containers. Field names are ordinary own properties; use Object.hasOwn instead of inherited object methods. diff --git a/.changeset/value-scalar-wire.md b/.changeset/value-scalar-wire.md deleted file mode 100644 index 15a7a49c3..000000000 --- a/.changeset/value-scalar-wire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@ydbjs/value': patch ---- - -Encode Interval parameters using the signed 64-bit microsecond field and reject inputs that cannot represent exact integer microseconds. Keep leading zeros in TzTimestamp fractional seconds and encode Float64Array parameters as Double values. diff --git a/.changeset/value-typed-decoding.md b/.changeset/value-typed-decoding.md deleted file mode 100644 index 27c6c962a..000000000 --- a/.changeset/value-typed-decoding.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/value': patch ---- - -Preserve declared schemas when decoding supported values, including nested Optional presence, typed empty and nullable containers, Struct member order and UUID bits. Reject incompatible schemas and malformed wire values before silently losing data. Apply the same value classification inside arrays as for standalone values. - -Preserve scalar values without an unambiguous native representation as typed SDK Values. Variant results require raw mode. diff --git a/.changeset/value-validation-boundaries.md b/.changeset/value-validation-boundaries.md deleted file mode 100644 index c90bd226a..000000000 --- a/.changeset/value-validation-boundaries.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/value': patch ---- - -Validate primitive JavaScript payload types and scalar ranges in Value construction, including values decoded from protobuf. Reject implicit boolean, numeric, string and byte-array coercions before encoding; preserve valid floating-point special values and UUID words. - -Remove repeated checks from numeric wrappers and native result projection. Keep precision checks before conversions that could lose information. diff --git a/.changeset/value-vectors.md b/.changeset/value-vectors.md deleted file mode 100644 index 21ed5e699..000000000 --- a/.changeset/value-vectors.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@ydbjs/value': major ---- - -Add Float32Vector, Int8Vector, Uint8Vector, and BitVector values for YDB vector search. Encode numeric arrays directly into compact YDB String parameters, validate packed input, and expose owned typed-array projections. Decode known tagged vector results without constructing per-coordinate Values while preserving ordinary binary String results. - -Infer native Int8Array parameters as List; use Int8Vector explicitly for compact binary storage. diff --git a/examples/api/package.json b/examples/api/package.json index 5c0ade26c..fe09eb7a2 100644 --- a/examples/api/package.json +++ b/examples/api/package.json @@ -12,9 +12,9 @@ }, "dependencies": { "@bufbuild/protobuf": "^2.16.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/auth": "^6.3.1", - "@ydbjs/core": "^6.3.1" + "@ydbjs/api": "^7.0.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/core": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/examples/auth-yandex-cloud/package.json b/examples/auth-yandex-cloud/package.json index e32d6d311..b33a7966e 100644 --- a/examples/auth-yandex-cloud/package.json +++ b/examples/auth-yandex-cloud/package.json @@ -12,9 +12,9 @@ "dev": "DEBUG=ydbjs:* node index.js" }, "dependencies": { - "@ydbjs/auth-yandex-cloud": "^0.2.0", - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0" + "@ydbjs/auth-yandex-cloud": "^0.2.1", + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/examples/coordination/package.json b/examples/coordination/package.json index bac3e3a01..68bf8a266 100644 --- a/examples/coordination/package.json +++ b/examples/coordination/package.json @@ -12,7 +12,7 @@ "resource-management": "node resource-management.js" }, "dependencies": { - "@ydbjs/coordination": "^6.2.1", - "@ydbjs/core": "^6.3.1" + "@ydbjs/coordination": "^7.0.0", + "@ydbjs/core": "^7.0.0" } } diff --git a/examples/diagnostics/package.json b/examples/diagnostics/package.json index 6606d86cf..055d24827 100644 --- a/examples/diagnostics/package.json +++ b/examples/diagnostics/package.json @@ -10,8 +10,8 @@ "start": "node index.js" }, "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/examples/environ/package.json b/examples/environ/package.json index 73b8aa1fa..e1bde60e0 100644 --- a/examples/environ/package.json +++ b/examples/environ/package.json @@ -11,9 +11,9 @@ "dev": "DEBUG=ydbjs:* node index.js" }, "dependencies": { - "@ydbjs/api": "^6.0.7", - "@ydbjs/auth": "^6.3.1", - "@ydbjs/core": "^6.3.1" + "@ydbjs/api": "^7.0.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/core": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/examples/fsm/package.json b/examples/fsm/package.json index 1c1f9ec31..0e1db6cd7 100644 --- a/examples/fsm/package.json +++ b/examples/fsm/package.json @@ -8,6 +8,6 @@ "start": "node index.js" }, "dependencies": { - "@ydbjs/fsm": "^6.1.1" + "@ydbjs/fsm": "^7.0.0" } } diff --git a/examples/query-clients/package.json b/examples/query-clients/package.json index 82a29cff6..8c0607612 100644 --- a/examples/query-clients/package.json +++ b/examples/query-clients/package.json @@ -9,9 +9,9 @@ "memory": "node --expose-gc --max-old-space-size=128 dist/memory.js" }, "dependencies": { - "@ydbjs/query": "^6.3.0", - "@ydbjs/core": "^6.3.1", - "@ydbjs/value": "^6.0.8" + "@ydbjs/query": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", diff --git a/examples/query/package.json b/examples/query/package.json index 282d4c7de..da03cf017 100644 --- a/examples/query/package.json +++ b/examples/query/package.json @@ -11,9 +11,9 @@ "dev": "DEBUG=ydbjs:* node index.js" }, "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/value": "^6.0.8" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/examples/sls/package.json b/examples/sls/package.json index 4d1211e3b..309059403 100644 --- a/examples/sls/package.json +++ b/examples/sls/package.json @@ -12,9 +12,9 @@ "dev": "DEBUG=ydbjs:* node index.js" }, "dependencies": { - "@ydbjs/auth": "^6.3.1", - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0" + "@ydbjs/auth": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/examples/telemetry/package.json b/examples/telemetry/package.json index 5b7879347..40a19a36c 100644 --- a/examples/telemetry/package.json +++ b/examples/telemetry/package.json @@ -15,9 +15,9 @@ "@opentelemetry/exporter-trace-otlp-http": "^0.300.0", "@opentelemetry/sdk-metrics": "^3.0.0", "@opentelemetry/resources": "^3.0.0", - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/telemetry": "^6.0.1", + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/telemetry": "^7.0.0", "@opentelemetry/sdk-trace": "^3.0.0", "@opentelemetry/context-async-hooks": "^3.0.0", "@opentelemetry/core": "^3.0.0" diff --git a/examples/tls/package.json b/examples/tls/package.json index 7a94cdf5f..7552d9b28 100644 --- a/examples/tls/package.json +++ b/examples/tls/package.json @@ -11,9 +11,9 @@ "dev": "DEBUG=ydbjs:* node index.js" }, "dependencies": { - "@ydbjs/api": "^6.0.7", - "@ydbjs/auth": "^6.3.1", - "@ydbjs/core": "^6.3.1" + "@ydbjs/api": "^7.0.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/core": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/examples/topic/package.json b/examples/topic/package.json index 61d4228aa..f1488f384 100644 --- a/examples/topic/package.json +++ b/examples/topic/package.json @@ -11,9 +11,9 @@ "dev": "DEBUG=ydbjs:* node index.js" }, "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/topic": "^6.1.4" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/topic": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/package-lock.json b/package-lock.json index 3b1c5c87d..dc2e8e9d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,21 +28,14 @@ "npm": ">=10" } }, - "docs": { - "name": "@ydbjs/docs", - "extraneous": true, - "devDependencies": { - "vitepress": "^2.0.0-alpha.21" - } - }, "examples/api": { "name": "@ydbjs/examples-api", "version": "6.0.0", "dependencies": { "@bufbuild/protobuf": "^2.16.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/auth": "^6.3.1", - "@ydbjs/core": "^6.3.1" + "@ydbjs/api": "^7.0.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/core": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -53,9 +46,9 @@ "name": "@ydbjs/examples-auth-yandex-cloud", "version": "6.0.0", "dependencies": { - "@ydbjs/auth-yandex-cloud": "^0.2.0", - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0" + "@ydbjs/auth-yandex-cloud": "^0.2.1", + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -66,16 +59,16 @@ "name": "@ydbjs/examples-coordination", "version": "1.0.0", "dependencies": { - "@ydbjs/coordination": "^6.2.1", - "@ydbjs/core": "^6.3.1" + "@ydbjs/coordination": "^7.0.0", + "@ydbjs/core": "^7.0.0" } }, "examples/diagnostics": { "name": "@ydbjs/examples-diagnostics", "version": "0.1.0", "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -98,9 +91,9 @@ "name": "@ydbjs/examples-environ", "version": "6.0.0", "dependencies": { - "@ydbjs/api": "^6.0.7", - "@ydbjs/auth": "^6.3.1", - "@ydbjs/core": "^6.3.1" + "@ydbjs/api": "^7.0.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/core": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -111,7 +104,7 @@ "name": "@ydbjs/examples-fsm", "version": "6.0.0", "dependencies": { - "@ydbjs/fsm": "^6.1.1" + "@ydbjs/fsm": "^7.0.0" } }, "examples/langchain": { @@ -131,9 +124,9 @@ "name": "@ydbjs/examples-query", "version": "6.0.0", "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/value": "^6.0.8" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -144,9 +137,9 @@ "name": "@ydbjs/examples-query-clients", "version": "0.1.0", "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/value": "^6.0.8" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -157,9 +150,9 @@ "name": "@ydbjs/examples-sls", "version": "6.0.0", "dependencies": { - "@ydbjs/auth": "^6.3.1", - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0" + "@ydbjs/auth": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -178,9 +171,9 @@ "@opentelemetry/resources": "^3.0.0", "@opentelemetry/sdk-metrics": "^3.0.0", "@opentelemetry/sdk-trace": "^3.0.0", - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/telemetry": "^6.0.1" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/telemetry": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -191,9 +184,9 @@ "name": "@ydbjs/examples-tls", "version": "6.0.0", "dependencies": { - "@ydbjs/api": "^6.0.7", - "@ydbjs/auth": "^6.3.1", - "@ydbjs/core": "^6.3.1" + "@ydbjs/api": "^7.0.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/core": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -204,9 +197,9 @@ "name": "@ydbjs/examples-topic", "version": "6.0.0", "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/topic": "^6.1.4" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/topic": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -3444,7 +3437,7 @@ }, "packages/abortable": { "name": "@ydbjs/abortable", - "version": "6.1.0", + "version": "6.2.0", "license": "Apache-2.0", "engines": { "node": ">=20.19.0", @@ -3453,13 +3446,13 @@ }, "packages/api": { "name": "@ydbjs/api", - "version": "6.0.7", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "2.16.0" }, "devDependencies": { - "@ydbjs/grpc": "^0.1.0", + "@ydbjs/grpc": "^0.2.0", "typescript": "^7.0.2" }, "engines": { @@ -3469,16 +3462,16 @@ }, "packages/auth": { "name": "@ydbjs/auth", - "version": "6.3.1", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/grpc": "^0.1.0", - "@ydbjs/retry": "^6.3.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/grpc": "^0.2.0", + "@ydbjs/retry": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -3487,20 +3480,20 @@ }, "packages/coordination": { "name": "@ydbjs/coordination", - "version": "6.2.1", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/core": "^6.3.1", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/fsm": "^6.1.1", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/fsm": "^7.0.0", + "@ydbjs/grpc": "^0.2.0" }, "devDependencies": { - "@ydbjs/auth": "^6.3.1" + "@ydbjs/auth": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -3509,18 +3502,18 @@ }, "packages/core": { "name": "@ydbjs/core", - "version": "6.3.1", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/auth": "^6.3.1", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/fsm": "^6.1.1", - "@ydbjs/grpc": "^0.1.0", - "@ydbjs/retry": "^6.3.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/fsm": "^7.0.0", + "@ydbjs/grpc": "^0.2.0", + "@ydbjs/retry": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -3529,7 +3522,7 @@ }, "packages/debug": { "name": "@ydbjs/debug", - "version": "6.0.5", + "version": "6.0.6", "license": "Apache-2.0", "dependencies": { "debug": "^4.4.3" @@ -3544,12 +3537,12 @@ }, "packages/error": { "name": "@ydbjs/error", - "version": "6.0.6", + "version": "6.1.0", "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/api": "^7.0.0", + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -3558,10 +3551,10 @@ }, "packages/fsm": { "name": "@ydbjs/fsm", - "version": "6.1.1", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { - "@ydbjs/abortable": "^6.1.0" + "@ydbjs/abortable": "^6.2.0" }, "engines": { "node": ">=20.19.0", @@ -3570,10 +3563,10 @@ }, "packages/grpc": { "name": "@ydbjs/grpc", - "version": "0.1.0", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@ydbjs/abortable": "^6.1.0" + "@ydbjs/abortable": "^6.2.0" }, "devDependencies": { "@bufbuild/protobuf": "2.16.0" @@ -3585,19 +3578,19 @@ }, "packages/query": { "name": "@ydbjs/query", - "version": "6.3.0", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/core": "^6.3.1", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/fsm": "^6.1.1", - "@ydbjs/grpc": "^0.1.0", - "@ydbjs/retry": "^6.3.0", - "@ydbjs/value": "^6.0.8" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/fsm": "^7.0.0", + "@ydbjs/grpc": "^0.2.0", + "@ydbjs/retry": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -3606,14 +3599,14 @@ }, "packages/retry": { "name": "@ydbjs/retry", - "version": "6.3.0", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.0", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.0", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -3622,15 +3615,15 @@ }, "packages/telemetry": { "name": "@ydbjs/telemetry", - "version": "6.0.1", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.10.0", "@opentelemetry/instrumentation": "^0.300.0", "@opentelemetry/semantic-conventions": "^1.43.0", - "@ydbjs/api": "^6.0.0", - "@ydbjs/core": "^6.2.0", - "@ydbjs/error": "^6.0.0" + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/error": "^6.1.0" }, "devDependencies": { "@bufbuild/protobuf": "2.16.0", @@ -3638,7 +3631,7 @@ "@opentelemetry/core": "^3.0.0", "@opentelemetry/sdk-metrics": "^3.0.0", "@opentelemetry/sdk-trace": "^3.0.0", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -3647,23 +3640,23 @@ }, "packages/topic": { "name": "@ydbjs/topic", - "version": "6.1.4", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "2.16.0", "@types/ms": "^2.1.0", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/core": "^6.3.1", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/fsm": "^6.1.1", - "@ydbjs/grpc": "^0.1.0", - "@ydbjs/retry": "^6.3.0", + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/fsm": "^7.0.0", + "@ydbjs/grpc": "^0.2.0", + "@ydbjs/retry": "^7.0.0", "ms": "^2.1.3" }, "devDependencies": { - "@ydbjs/query": "^6.3.0" + "@ydbjs/query": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", @@ -3672,11 +3665,11 @@ }, "packages/value": { "name": "@ydbjs/value", - "version": "6.0.8", + "version": "7.0.0", "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/api": "^6.0.7" + "@ydbjs/api": "^7.0.0" }, "devDependencies": { "temporal-polyfill": "1.0.6" @@ -3704,13 +3697,13 @@ }, "third-parties/auth-yandex-cloud": { "name": "@ydbjs/auth-yandex-cloud", - "version": "0.2.0", + "version": "0.2.1", "license": "Apache-2.0", "dependencies": { - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/auth": "^6.3.0", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/retry": "^6.3.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/retry": "^7.0.0" }, "engines": { "node": ">=20.19.0", @@ -3719,13 +3712,13 @@ }, "third-parties/drizzle-adapter": { "name": "@ydbjs/drizzle-adapter", - "version": "0.1.1", + "version": "1.0.0", "license": "Apache-2.0", "dependencies": { - "@ydbjs/api": "^6.0.6", - "@ydbjs/core": "^6.3.0", - "@ydbjs/query": "^6.1.0", - "@ydbjs/value": "^6.0.7" + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "devDependencies": { "drizzle-orm": "^0.45.4" @@ -3740,12 +3733,12 @@ }, "third-parties/langchain": { "name": "@ydbjs/langchain", - "version": "0.1.0", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/value": "^6.0.8" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "devDependencies": { "@langchain/core": "^1.3.0" diff --git a/packages/abortable/CHANGELOG.md b/packages/abortable/CHANGELOG.md index 51ab06c79..b333f4697 100644 --- a/packages/abortable/CHANGELOG.md +++ b/packages/abortable/CHANGELOG.md @@ -1,5 +1,11 @@ # @ydbjs/abortable +## 6.2.0 + +### Minor Changes + +- [#680](https://github.com/ydb-platform/ydb-js-sdk/pull/680) [`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6) Thanks [@polRk](https://github.com/polRk)! - Accept an optional abort signal and return the original Promise when it is absent. Observe late rejections after cancellation, including when the signal was already aborted, without cancelling the underlying operation. + ## 6.1.0 ### Minor Changes diff --git a/packages/abortable/package.json b/packages/abortable/package.json index 3c45c09c3..246721c4a 100644 --- a/packages/abortable/package.json +++ b/packages/abortable/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/abortable", - "version": "6.1.0", + "version": "6.2.0", "description": "Utilities for working with AbortController and AbortSignal in YDB operations.", "keywords": [ "abort", diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index 7473d1769..d3c8fba95 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -1,5 +1,29 @@ # @ydbjs/api +## 7.0.0 + +### Major Changes + +- [#638](https://github.com/ydb-platform/ydb-js-sdk/pull/638) [`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be) Thanks [@polRk](https://github.com/polRk)! - Regenerate the protobuf types with the bridge / multi-pile (2-DC) API: `EndpointInfo.bridge_pile_name`, `ListEndpointsResult.pile_states`, `NodeLocation.bridge_pile_name`, and a new `@ydbjs/api/bridge` export exposing `PileState` / `PileState_State`. Also pick up newer upstream fields in discovery / query / topic / monitoring. + + **Breaking:** codegen moves to `protoc-gen-es` 2.12.x (aligned with the `@bufbuild/protobuf` 2.12 runtime), which honours `exactOptionalPropertyTypes`: optional message fields are now typed `T | undefined` instead of `T`. Consumers compiled with `exactOptionalPropertyTypes` that mirror generated optional fields into their own optional-typed fields must accept `undefined` (a type-level break, no behavioural change). + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +### Patch Changes + +- [#666](https://github.com/ydb-platform/ydb-js-sdk/pull/666) [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28) Thanks [@polRk](https://github.com/polRk)! - Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. + ## 6.0.7 ### Patch Changes diff --git a/packages/api/package.json b/packages/api/package.json index f425c9dc8..be29ea776 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/api", - "version": "6.0.7", + "version": "7.0.0", "description": "TypeScript gRPC service definitions and protobuf types for all YDB APIs. Enables strongly-typed client generation and low-level protocol access.", "keywords": [ "api", @@ -117,7 +117,7 @@ }, "devDependencies": { "typescript": "^7.0.2", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 3eefec4c6..5d6e417b4 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,34 @@ # @ydbjs/auth +## 7.0.0 + +### Major Changes + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +### Patch Changes + +- [#675](https://github.com/ydb-platform/ydb-js-sdk/pull/675) [`7380673`](https://github.com/ydb-platform/ydb-js-sdk/commit/7380673c1f41fff1329521202dc8759419ee9b1f) Thanks [@polRk](https://github.com/polRk)! - Keep shared token refreshes independent of individual callers. Static, metadata, and Yandex Cloud providers own a five-second foreground request budget, including retries; static and Yandex Cloud background refreshes have a thirty-second budget. Cancelling a token request stops only that caller's wait. Cached reads and callers joining a refresh do not create provider timeouts. + +- [#666](https://github.com/ydb-platform/ydb-js-sdk/pull/666) [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28) Thanks [@polRk](https://github.com/polRk)! - Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6), [`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`031e586`](https://github.com/ydb-platform/ydb-js-sdk/commit/031e586337262eca797d5bbd013dc9c0fedc9f1b), [`cda9c08`](https://github.com/ydb-platform/ydb-js-sdk/commit/cda9c08f28e16188db2493498780d88360bf08ae), [`dc41967`](https://github.com/ydb-platform/ydb-js-sdk/commit/dc419672abd79679b8f5d819067c374d9ff59208), [`986e841`](https://github.com/ydb-platform/ydb-js-sdk/commit/986e841781aebe4adb7d05a3deeeb105536fac93), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`b9342a1`](https://github.com/ydb-platform/ydb-js-sdk/commit/b9342a1648be7805047af2c15c43306998ee1726), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1)]: + - @ydbjs/abortable@6.2.0 + - @ydbjs/api@7.0.0 + - @ydbjs/grpc@0.2.0 + - @ydbjs/retry@7.0.0 + - @ydbjs/error@6.1.0 + - @ydbjs/debug@6.0.6 + ## 6.3.1 ### Patch Changes diff --git a/packages/auth/package.json b/packages/auth/package.json index 4f6dbdc49..9e825cd4a 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/auth", - "version": "6.3.1", + "version": "7.0.0", "description": "Authentication providers for YDB: static credentials, tokens, anonymous, and cloud metadata. Integrates with the core driver for secure access.", "keywords": [ "auth", @@ -70,12 +70,12 @@ }, "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/retry": "^6.3.0", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/api": "^7.0.0", + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/retry": "^7.0.0", + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", diff --git a/packages/coordination/CHANGELOG.md b/packages/coordination/CHANGELOG.md index 3432a0702..ad45b74e8 100644 --- a/packages/coordination/CHANGELOG.md +++ b/packages/coordination/CHANGELOG.md @@ -1,5 +1,37 @@ # @ydbjs/coordination +## 7.0.0 + +### Major Changes + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +### Patch Changes + +- [#703](https://github.com/ydb-platform/ydb-js-sdk/pull/703) [`5c0f0c2`](https://github.com/ydb-platform/ydb-js-sdk/commit/5c0f0c2b59c561a5eb2a4e64f81080ae8ba640db) Thanks [@polRk](https://github.com/polRk)! - Stop coordination sessions immediately on destroy, clear pending watch notifications and timers, and reject further operations. Support synchronous disposal while preserving graceful close and async disposal through SessionStop acknowledgment. Preserve acknowledged semaphore ownership when only the acquisition's caller signal is cancelled; return its lease for explicit release or disposal. + +- [#666](https://github.com/ydb-platform/ydb-js-sdk/pull/666) [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28) Thanks [@polRk](https://github.com/polRk)! - Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. + +- [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1) Thanks [@polRk](https://github.com/polRk)! - Refresh compatible dependency versions and remove unused runtime packages. Include the `ms` types required by the Topic reader's published declarations. +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6), [`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`cdff086`](https://github.com/ydb-platform/ydb-js-sdk/commit/cdff0864d850ba1bd1c7cf7c7041dd9742f04ef6), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`3e75fad`](https://github.com/ydb-platform/ydb-js-sdk/commit/3e75fad0225cc56f7b921577e5d91db426cb6313), [`64df3b5`](https://github.com/ydb-platform/ydb-js-sdk/commit/64df3b50005490e7c5a1628a6a9f31cb19e07d3d), [`807010c`](https://github.com/ydb-platform/ydb-js-sdk/commit/807010c6d784828b63676e351fd807ae0dd47338), [`65ba0fd`](https://github.com/ydb-platform/ydb-js-sdk/commit/65ba0fdf81aaaa880699633b005e1cf134f226a8), [`e6960f6`](https://github.com/ydb-platform/ydb-js-sdk/commit/e6960f6b4170c7d399739b364c45ed5ca8374eb4), [`549da21`](https://github.com/ydb-platform/ydb-js-sdk/commit/549da21a2f16312e5c774cb34ab4de87f40f3005), [`af97a85`](https://github.com/ydb-platform/ydb-js-sdk/commit/af97a858daea4a5a0a0df647abe19cf0f1e6bdb7), [`27bdd45`](https://github.com/ydb-platform/ydb-js-sdk/commit/27bdd45166b1e6b12bd7f83a559128cbb0f43ec1), [`0ca6e3a`](https://github.com/ydb-platform/ydb-js-sdk/commit/0ca6e3a44991d9aceedca3d777d86d1c8c3f9aae), [`6c3dee3`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c3dee3e5a84c666c3425cac779e18adc53be2b1), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`031e586`](https://github.com/ydb-platform/ydb-js-sdk/commit/031e586337262eca797d5bbd013dc9c0fedc9f1b), [`cda9c08`](https://github.com/ydb-platform/ydb-js-sdk/commit/cda9c08f28e16188db2493498780d88360bf08ae), [`dc41967`](https://github.com/ydb-platform/ydb-js-sdk/commit/dc419672abd79679b8f5d819067c374d9ff59208), [`986e841`](https://github.com/ydb-platform/ydb-js-sdk/commit/986e841781aebe4adb7d05a3deeeb105536fac93), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`b9342a1`](https://github.com/ydb-platform/ydb-js-sdk/commit/b9342a1648be7805047af2c15c43306998ee1726), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1), [`6ad8ff0`](https://github.com/ydb-platform/ydb-js-sdk/commit/6ad8ff016a40d9036add4d7db8dc5d0e6b8365de), [`c29324d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c29324d4adadf65bd2eb0b6de38672c0c286fc81)]: + - @ydbjs/abortable@6.2.0 + - @ydbjs/api@7.0.0 + - @ydbjs/core@7.0.0 + - @ydbjs/fsm@7.0.0 + - @ydbjs/grpc@0.2.0 + - @ydbjs/error@6.1.0 + - @ydbjs/debug@6.0.6 + ## 6.2.1 ### Patch Changes diff --git a/packages/coordination/package.json b/packages/coordination/package.json index 576dfe392..d3931f9f6 100644 --- a/packages/coordination/package.json +++ b/packages/coordination/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/coordination", - "version": "6.2.1", + "version": "7.0.0", "description": "High-level coordination client for YDB. Supports coordination nodes, distributed semaphores, and distributed locking.", "keywords": [ "ydb", @@ -46,16 +46,16 @@ }, "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/core": "^6.3.1", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/fsm": "^6.1.1", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/fsm": "^7.0.0", + "@ydbjs/grpc": "^0.2.0" }, "devDependencies": { - "@ydbjs/auth": "^6.3.1" + "@ydbjs/auth": "^7.0.0" }, "files": [ "dist", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index eb7346631..262030c9f 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,72 @@ # @ydbjs/core +## 7.0.0 + +### Major Changes + +- [#669](https://github.com/ydb-platform/ydb-js-sdk/pull/669) [`64df3b5`](https://github.com/ydb-platform/ydb-js-sdk/commit/64df3b50005490e7c5a1628a6a9f31cb19e07d3d) Thanks [@polRk](https://github.com/polRk)! - Make Driver a synchronous Disposable resource. Closing or leaving a using scope cancels active work and closes connections immediately; remove the ten-second drain and async disposal. Topic readers and writers retain their own graceful completion and are disposed before Driver. + +- [#638](https://github.com/ydb-platform/ydb-js-sdk/pull/638) [`807010c`](https://github.com/ydb-platform/ydb-js-sdk/commit/807010c6d784828b63676e351fd807ae0dd47338) Thanks [@polRk](https://github.com/polRk)! - Rebuild `Driver`'s connection layer on a new, internal endpoints engine (a pure `@ydbjs/fsm` state machine for discovery/routing/health plus an `EndpointPool` facade with a synchronous, allocation-light `acquire()` that reads an atomically-swapped immutable `RoutingSnapshot`), replacing the legacy `ConnectionPool`. The engine is an implementation detail — consumers only ever hold a `Driver` — so it is **not** exported from the package root. + + `Driver`'s public shape is preserved (`ready`, `close`, `token`, `database`, `identity`, `Disposable`/`AsyncDisposable`, `kRegisterLibrary`), and `createClient` gains direct-IO routing: + + - `createClient(service)` — balanced across all healthy nodes. + - `createClient(service, nodeId)` — soft affinity to a node (node-bound query sessions). + - `createClient(service, { nodeId, endpoint?, hard? })` — direct-IO for topic direct read/write: `hard: true` routes every RPC to `nodeId` or fails (never substitutes); `endpoint` pins a server-named node (reachable before the next discovery round, e.g. a topic `PartitionLocation`). The returned client is `Disposable` and unpins on dispose. + + Behavioural changes vs the old pool: + + - **Balancing** is uniform-random within a locality tier (opt-in via `'ydb.sdk.locality_enabled'`, default off) instead of modulo round-robin, with O(1) node affinity. + - **Pessimization** has no fixed timer: a node is pessimized on `UNAVAILABLE`/`DEADLINE_EXCEEDED` and recovers on the next successful RPC or discovery round. The `ydb:driver.connection.pessimized` payload no longer carries `until`. `'ydb.sdk.connection_pessimization_timeout_ms'` is now ignored. + - **Rediscovery** adds degradation-triggered forced rounds and single-flight/backoff; each round is bounded by `'ydb.sdk.discovery_timeout_ms'` (a timed-out round is retryable, so a hung `listEndpoints` no longer wedges rediscovery). A retryable initial failure keeps retrying (only a non-retryable error is terminal and emits `ydb:driver.failed`); a round returning zero endpoints is rejected as a retryable failure in every state — never applied to routing, so a one-round LB glitch cannot wipe the endpoint set. + - **Connections** are dialed lazily and a node dropped from discovery is drained rather than torn down (a brief flap no longer forces a reconnect). `'ydb.sdk.connection_idle_timeout_ms'` now bounds the grace a retired channel is kept before reaping (no separate idle-active teardown). A graceful shutdown (`await using driver` / `[Symbol.asyncDispose]`) drains in-flight streams and returns as soon as they finish, capped by an internal close deadline; the synchronous `close()` tears everything down immediately. + - **Bridge (2DC) piles:** on a bridge cluster, routing is restricted to endpoints whose pile is `PRIMARY`, `PROMOTED`, or `SYNCHRONIZED` (other pile states are kept out of the balancing tiers, used only as a last resort when every pile is unusable). Opt-in `'ydb.sdk.prefer_primary_pile'` (default `false`) additionally keeps traffic on the `PRIMARY`/`PROMOTED` pile, falling back to `SYNCHRONIZED` only when the primary has no available node. It is soft (fallback preserved), a no-op on a non-bridge cluster, and takes precedence over `'ydb.sdk.locality_enabled'` in bridge mode (a pile already maps to a datacenter, so the two are not combined). + - **Bridge/pool observability:** every `ydb:driver.connection.*` event now carries the endpoint's `pile` (`''` on a non-bridge cluster), and `DriverHooks`' `EndpointInfo` gains a `pile` field. `ydb:driver.discovery.completed` additionally carries `selfLocation`, the pile roster (`piles: { name, status }[]`), and `primaryPile`. New channels: `ydb:driver.connection.pool.opened` (one-shot config snapshot), `ydb:driver.connection.pool.stats` (aggregate tier/pile counts on every routable-set change), `ydb:driver.pile.changed` (pile roster/primary change, inside the discovery span), and `ydb:driver.pile.fallback` (edge-triggered when `preferPrimaryPile` serves from the SYNCHRONIZED tier). + - **New options:** `'ydb.sdk.locality_enabled'` (default `false`), `'ydb.sdk.prefer_primary_pile'` (default `false`), and `'ydb.sdk.discovery_degraded_threshold'` (0..1, default `0.5`, validated). + + The `ConnectionPool` class and the `POOL_*_FOR_TESTING` symbols are removed. All `diagnostics_channel` channel names and identity-stamped payloads are preserved (minus the `until` field on `connection.pessimized`); the round-derived events are published inside the `tracing:ydb:driver.discovery` span so `@ydbjs/telemetry` attaches them to traces. `EndpointsUnavailableError` and the `Driver*` option/connection-string error classes are re-exported from the package root. + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +### Patch Changes + +- [#660](https://github.com/ydb-platform/ydb-js-sdk/pull/660) [`cdff086`](https://github.com/ydb-platform/ydb-js-sdk/commit/cdff0864d850ba1bd1c7cf7c7041dd9742f04ef6) Thanks [@polRk](https://github.com/polRk)! - Wait for explicit endpoint pins to reach the routing snapshot before issuing RPCs. Keep shared pins until their last client is disposed, make disposal idempotent, and release the original node even if the caller mutates the target object. Cancelled RPCs leave the client's pin available for subsequent calls. + +- [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a) Thanks [@polRk](https://github.com/polRk)! - Cancel active calls and pending token waits when a service client closes, and discard its buffered responses. Preserve sibling clients and the driver-owned shared connections. + +- [#740](https://github.com/ydb-platform/ydb-js-sdk/pull/740) [`3e75fad`](https://github.com/ydb-platform/ydb-js-sdk/commit/3e75fad0225cc56f7b921577e5d91db426cb6313) Thanks [@polRk](https://github.com/polRk)! - Retain driver diagnostic channels across driver lifetimes and garbage collection. Discovery, connection and lifecycle subscribers remain connected when subscribing after earlier unobserved publications, including on Bun. + +- [#635](https://github.com/ydb-platform/ydb-js-sdk/pull/635) [`65ba0fd`](https://github.com/ydb-platform/ydb-js-sdk/commit/65ba0fdf81aaaa880699633b005e1cf134f226a8) Thanks [@polRk](https://github.com/polRk)! - Fix process crash when a background rediscovery round fails. The periodic discovery loop scheduled its rounds as floating promises, so a terminally failed round (e.g. the discovery endpoint dropping mid-round until the per-round timeout aborted the retries) escalated to an `unhandledRejection` and killed the process. Failed background rounds are now caught and logged; the connection pool keeps serving last-known endpoints and the next interval tick retries. + +- [#683](https://github.com/ydb-platform/ydb-js-sdk/pull/683) [`e6960f6`](https://github.com/ydb-platform/ydb-js-sdk/commit/e6960f6b4170c7d399739b364c45ed5ca8374eb4) Thanks [@polRk](https://github.com/polRk)! - Keep active discovered channels alive across repeated retirement and revival. Keep explicitly pinned connections separate from discovered connections with the same node ID so invalidating one does not close the other. + +- [`549da21`](https://github.com/ydb-platform/ydb-js-sdk/commit/549da21a2f16312e5c774cb34ab4de87f40f3005) Thanks [@polRk](https://github.com/polRk)! - Release cancelled readiness waiters before discovery completes, without cancelling other callers. Reject readiness after driver shutdown and preserve the original cause of terminal discovery failures. + +- [#666](https://github.com/ydb-platform/ydb-js-sdk/pull/666) [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28) Thanks [@polRk](https://github.com/polRk)! - Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. + +- [#676](https://github.com/ydb-platform/ydb-js-sdk/pull/676) [`6ad8ff0`](https://github.com/ydb-platform/ydb-js-sdk/commit/6ad8ff016a40d9036add4d7db8dc5d0e6b8365de) Thanks [@polRk](https://github.com/polRk)! - Apply `ydb.sdk.token_timeout_ms` to each caller's wait for credentials before RPCs and through the `token` getter. Preserve the original RPC deadline and caller abort reason without forwarding RPC cancellation to shared provider work. Closing the Driver cancels its token waits. Already-fulfilled token promises do not allocate a token-wait timer. Measure the token-wait duration with a monotonic clock so system-clock changes cannot extend or shorten the configured budget. + +- [#716](https://github.com/ydb-platform/ydb-js-sdk/pull/716) [`c29324d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c29324d4adadf65bd2eb0b6de38672c0c286fc81) Thanks [@polRk](https://github.com/polRk)! - Publish driver call hooks for static connections as well as discovery-managed endpoints. +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6), [`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`af97a85`](https://github.com/ydb-platform/ydb-js-sdk/commit/af97a858daea4a5a0a0df647abe19cf0f1e6bdb7), [`27bdd45`](https://github.com/ydb-platform/ydb-js-sdk/commit/27bdd45166b1e6b12bd7f83a559128cbb0f43ec1), [`0ca6e3a`](https://github.com/ydb-platform/ydb-js-sdk/commit/0ca6e3a44991d9aceedca3d777d86d1c8c3f9aae), [`6c3dee3`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c3dee3e5a84c666c3425cac779e18adc53be2b1), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`031e586`](https://github.com/ydb-platform/ydb-js-sdk/commit/031e586337262eca797d5bbd013dc9c0fedc9f1b), [`cda9c08`](https://github.com/ydb-platform/ydb-js-sdk/commit/cda9c08f28e16188db2493498780d88360bf08ae), [`dc41967`](https://github.com/ydb-platform/ydb-js-sdk/commit/dc419672abd79679b8f5d819067c374d9ff59208), [`986e841`](https://github.com/ydb-platform/ydb-js-sdk/commit/986e841781aebe4adb7d05a3deeeb105536fac93), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`b9342a1`](https://github.com/ydb-platform/ydb-js-sdk/commit/b9342a1648be7805047af2c15c43306998ee1726), [`7380673`](https://github.com/ydb-platform/ydb-js-sdk/commit/7380673c1f41fff1329521202dc8759419ee9b1f), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1)]: + - @ydbjs/abortable@6.2.0 + - @ydbjs/api@7.0.0 + - @ydbjs/fsm@7.0.0 + - @ydbjs/grpc@0.2.0 + - @ydbjs/auth@7.0.0 + - @ydbjs/retry@7.0.0 + - @ydbjs/error@6.1.0 + - @ydbjs/debug@6.0.6 + ## 6.3.1 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index ef3fcd510..7d2292160 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/core", - "version": "6.3.1", + "version": "7.0.0", "description": "Core driver for YDB: manages connections, endpoint discovery, authentication, and service client creation. Foundation for all YDB client operations.", "keywords": [ "core", @@ -50,14 +50,14 @@ }, "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/auth": "^6.3.1", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/fsm": "^6.1.1", - "@ydbjs/retry": "^6.3.0", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/fsm": "^7.0.0", + "@ydbjs/retry": "^7.0.0", + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", diff --git a/packages/debug/CHANGELOG.md b/packages/debug/CHANGELOG.md index 4fcd191e6..d11d583cf 100644 --- a/packages/debug/CHANGELOG.md +++ b/packages/debug/CHANGELOG.md @@ -1,5 +1,11 @@ # @ydbjs/debug +## 6.0.6 + +### Patch Changes + +- [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1) Thanks [@polRk](https://github.com/polRk)! - Refresh compatible dependency versions and remove unused runtime packages. Include the `ms` types required by the Topic reader's published declarations. + ## 6.0.5 ### Patch Changes diff --git a/packages/debug/package.json b/packages/debug/package.json index ce70896a4..b997efb52 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/debug", - "version": "6.0.5", + "version": "6.0.6", "description": "Centralized debug logging for YDB JavaScript SDK", "keywords": [ "debug", diff --git a/packages/error/CHANGELOG.md b/packages/error/CHANGELOG.md index 9b87b296b..cdda3471a 100644 --- a/packages/error/CHANGELOG.md +++ b/packages/error/CHANGELOG.md @@ -1,5 +1,32 @@ # @ydbjs/error +## 6.1.0 + +### Minor Changes + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Report failed completion hooks after a confirmed commit as TransactionCompletionError, with committed=true and the original cause. Preserve this terminal classification across enclosing SDK retriers instead of exposing a retryable database error for an already committed transaction. + + Release SDK resources when cancellation interrupts application cleanup hooks. Preserve confirmed commit information on cancellation, and wrap retryable database errors used as cancellation reasons in AbortError with the original cause so enclosing callbacks cannot replay them. + +### Patch Changes + +- [#666](https://github.com/ydb-platform/ydb-js-sdk/pull/666) [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28) Thanks [@polRk](https://github.com/polRk)! - Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. +- Updated dependencies [[`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`031e586`](https://github.com/ydb-platform/ydb-js-sdk/commit/031e586337262eca797d5bbd013dc9c0fedc9f1b), [`cda9c08`](https://github.com/ydb-platform/ydb-js-sdk/commit/cda9c08f28e16188db2493498780d88360bf08ae), [`dc41967`](https://github.com/ydb-platform/ydb-js-sdk/commit/dc419672abd79679b8f5d819067c374d9ff59208), [`986e841`](https://github.com/ydb-platform/ydb-js-sdk/commit/986e841781aebe4adb7d05a3deeeb105536fac93), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`b9342a1`](https://github.com/ydb-platform/ydb-js-sdk/commit/b9342a1648be7805047af2c15c43306998ee1726), [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28)]: + - @ydbjs/api@7.0.0 + - @ydbjs/grpc@0.2.0 + ## 6.0.6 ### Patch Changes diff --git a/packages/error/package.json b/packages/error/package.json index e234784d6..9a78bd965 100644 --- a/packages/error/package.json +++ b/packages/error/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/error", - "version": "6.0.6", + "version": "6.1.0", "description": "Error utilities for YDB: error classification, rich messages, and TypeScript support for robust error handling in YDB applications.", "keywords": [ "database", @@ -48,8 +48,8 @@ }, "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/api": "^7.0.0", + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", diff --git a/packages/fsm/CHANGELOG.md b/packages/fsm/CHANGELOG.md index 2ae7a6b90..9d96293ce 100644 --- a/packages/fsm/CHANGELOG.md +++ b/packages/fsm/CHANGELOG.md @@ -1,5 +1,34 @@ # @ydbjs/fsm +## 7.0.0 + +### Major Changes + +- [#637](https://github.com/ydb-platform/ydb-js-sdk/pull/637) [`6c3dee3`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c3dee3e5a84c666c3425cac779e18adc53be2b1) Thanks [@YandalfRed](https://github.com/YandalfRed)! - Rework the runtime around a declarative lifecycle and surface faults to consumers. + + Breaking changes: + + - `EffectRuntime` no longer exposes `close()`, `destroy()`, or `ingest()` — it is now identical to `TransitionRuntime` (state, signal, emit, dispatch). Transitions and effect handlers run inside the event-drain loop, so awaiting the machine's own closure from there was a structural promise-cycle deadlock, and closing it mid-drain silently dropped queued outputs. + - A transition declares termination by returning `final: { reason }` in its `TransitionResult`: the machine stops accepting new events immediately, runs that transition's effects (cleanup), drains events already queued, then seals the output stream; `reason` lands on `signal.reason`. An effect that hits an unrecoverable error `throw`s — the machine is destroyed and the output iterator rethrows the error. + - `AbstractAsyncQueue.dispose()` (from `@ydbjs/fsm/queue`) is removed — it was a pure alias of `destroy()`; call `destroy()` or rely on `using` (`[Symbol.dispose]` now calls `destroy()` directly). + + Fixes and additions: + + - Internal machine faults now reach output consumers. When a transition, effect, or ingest source throws, the runtime still tears the machine down, but its output async-iterator rethrows the stop reason after draining instead of ending silently — so a consumer iterating the machine observes the failure and runs its terminal handling rather than mistaking a fault for a graceful close. The fault is delivered through the output queue via a new `AsyncQueue.fail(error)` primitive (seals the queue like `close()`, but the iterator throws `error` once the buffer drains). The iterator stays a direct queue passthrough — wrapping it in an async generator would add a per-item microtask that reorders delivery for latency-sensitive consumers. + - New `AsyncQueue.take(signal?)`: a cancellable single-step dequeue with the iterator's exact contract (pause, drain-then-throw after `fail()`). Aborting removes the parked waiter atomically inside the queue, so a cancelled `take()` can never swallow an item — unlike racing `iterator.next()` with a promise combinator, which leaves the underlying `next()` pending. Compose a bounded wait at the call site with `linkSignals(signal, AbortSignal.timeout(ms))`. + - An event dispatched synchronously from within a transition is now processed after the current transition's state change is applied, instead of being run re-entrantly against the stale (pre-transition) state. + - `close()` now waits for an in-flight drain to finish and drains any tail before sealing the output stream, so outputs from events queued during that drain are not dropped. + +### Patch Changes + +- [#682](https://github.com/ydb-platform/ydb-js-sdk/pull/682) [`af97a85`](https://github.com/ydb-platform/ydb-js-sdk/commit/af97a858daea4a5a0a0df647abe19cf0f1e6bdb7) Thanks [@polRk](https://github.com/polRk)! - Preserve queued items when a paused consumer is cancelled immediately after the queue resumes. Release the previous yielded payload while an iterator waits for its next item. + +- [#671](https://github.com/ydb-platform/ydb-js-sdk/pull/671) [`27bdd45`](https://github.com/ydb-platform/ydb-js-sdk/commit/27bdd45166b1e6b12bd7f83a559128cbb0f43ec1) Thanks [@polRk](https://github.com/polRk)! - Drain queued events with an indexed FIFO and release consumed references without repeatedly shifting the backlog. Avoid redundant drain waiters and Promise work for effect-free dispatch, and reuse the fulfilled Promise within each drain of synchronous effects. Preserve event order, microtask boundaries, shutdown behavior, and asynchronous context lifetime. Do not open an ingest source when its signal is already aborted. + +- [#670](https://github.com/ydb-platform/ydb-js-sdk/pull/670) [`0ca6e3a`](https://github.com/ydb-platform/ydb-js-sdk/commit/0ca6e3a44991d9aceedca3d777d86d1c8c3f9aae) Thanks [@polRk](https://github.com/polRk)! - Keep queue readers isolated across reset, honor repeated pauses, and preserve already assigned values and terminal results during cancellation. +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6)]: + - @ydbjs/abortable@6.2.0 + ## 6.1.1 ### Patch Changes diff --git a/packages/fsm/package.json b/packages/fsm/package.json index 86eccc1ac..0aa9c8576 100644 --- a/packages/fsm/package.json +++ b/packages/fsm/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/fsm", - "version": "6.1.1", + "version": "7.0.0", "description": "Lightweight async-first FSM runtime for YDB JavaScript SDK packages.", "keywords": [ "ydb", @@ -48,7 +48,7 @@ "test": "tsc -b tsconfig.test.json && vitest --run" }, "dependencies": { - "@ydbjs/abortable": "^6.1.0" + "@ydbjs/abortable": "^6.2.0" }, "files": [ "dist", diff --git a/packages/grpc/CHANGELOG.md b/packages/grpc/CHANGELOG.md new file mode 100644 index 000000000..34f03dac6 --- /dev/null +++ b/packages/grpc/CHANGELOG.md @@ -0,0 +1,26 @@ +# @ydbjs/grpc + +## 0.2.0 + +### Minor Changes + +- [#746](https://github.com/ydb-platform/ydb-js-sdk/pull/746) [`cda9c08`](https://github.com/ydb-platform/ydb-js-sdk/commit/cda9c08f28e16188db2493498780d88360bf08ae) Thanks [@polRk](https://github.com/polRk)! - Allow request serializers to return a readonly array of byte segments. Send the segments as one gRPC message without combining them into a new buffer, validate their total size before writing, and respect HTTP/2 backpressure between segments. + +- [`986e841`](https://github.com/ydb-platform/ydb-js-sdk/commit/986e841781aebe4adb7d05a3deeeb105536fac93) Thanks [@polRk](https://github.com/polRk)! - Add a standalone HTTP/2 gRPC client with Promise unary calls, AsyncIterable streams, deadlines, cancellation, metadata, TLS, backpressure, GOAWAY handling, and bounded framing. Request headers and bodies are written separately without an extra payload copy. + +- [`b9342a1`](https://github.com/ydb-platform/ydb-js-sdk/commit/b9342a1648be7805047af2c15c43306998ee1726) Thanks [@polRk](https://github.com/polRk)! - Add a typed HTTP/2 gRPC server with Promise and AsyncIterable handlers, cancellation, deadlines, metadata, TLS, and backpressure. Synchronous disposal cancels active calls; explicit close drains accepted calls. Invalid response metadata fails only its RPC, and deadlines reset incomplete response messages instead of sending malformed gRPC responses. + +- [#714](https://github.com/ydb-platform/ydb-js-sdk/pull/714) [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846) Thanks [@polRk](https://github.com/polRk)! - Distinguish local protocol failures and HTTP/2 transport failures from server gRPC statuses. Stop retrying deterministic message-size and encoding failures ([#586](https://github.com/ydb-platform/ydb-js-sdk/issues/586)), and require idempotency before retrying ambiguous INTERNAL statuses or transport overload resets. Preserve the caller's cancellation reason and notify retry observers for attempts without backoff. + +### Patch Changes + +- [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a) Thanks [@polRk](https://github.com/polRk)! - Stop processing response trailers when a header observer closes or disposes the client. Report cancellation once and do not invoke trailer observers after shutdown. + +- [`031e586`](https://github.com/ydb-platform/ydb-js-sdk/commit/031e586337262eca797d5bbd013dc9c0fedc9f1b) Thanks [@polRk](https://github.com/polRk)! - Preserve completed responses before malformed frame errors and after terminal trailers followed by HTTP/2 resets. Preserve repeated text trailer values. Reject service definitions with the reserved `close` method name and timer settings above Node's maximum delay. + +- [`dc41967`](https://github.com/ydb-platform/ydb-js-sdk/commit/dc419672abd79679b8f5d819067c374d9ff59208) Thanks [@polRk](https://github.com/polRk)! - Terminate server connections through their owned sockets during immediate shutdown. Avoid destroying the same HTTP/2 session again while a peer cancellation is already closing it. + + Classify synthetic CANCEL during socket loss as UNAVAILABLE even before the runtime marks the HTTP/2 session destroyed. Preserve a server CANCEL on a healthy connection draining after graceful GOAWAY. + +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6)]: + - @ydbjs/abortable@6.2.0 diff --git a/packages/grpc/package.json b/packages/grpc/package.json index cffec92de..f2bd9f5dd 100644 --- a/packages/grpc/package.json +++ b/packages/grpc/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/grpc", - "version": "0.1.0", + "version": "0.2.0", "description": "Async gRPC transport over Node.js HTTP/2", "keywords": [ "grpc", @@ -52,7 +52,7 @@ }, "engineStrict": true, "dependencies": { - "@ydbjs/abortable": "^6.1.0" + "@ydbjs/abortable": "^6.2.0" }, "devDependencies": { "@bufbuild/protobuf": "2.16.0" diff --git a/packages/query/CHANGELOG.md b/packages/query/CHANGELOG.md index 786b7964d..1b19c0f95 100644 --- a/packages/query/CHANGELOG.md +++ b/packages/query/CHANGELOG.md @@ -1,5 +1,91 @@ # @ydbjs/query +## 7.0.0 + +### Major Changes + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Report failed completion hooks after a confirmed commit as TransactionCompletionError, with committed=true and the original cause. Preserve this terminal classification across enclosing SDK retriers instead of exposing a retryable database error for an already committed transaction. + + Release SDK resources when cancellation interrupts application cleanup hooks. Preserve confirmed commit information on cancellation, and wrap retryable database errors used as cancellation reasons in AbortError with the original cause so enclosing callbacks cannot replay them. + +- [#742](https://github.com/ydb-platform/ydb-js-sdk/pull/742) [`c04cd9d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c04cd9df0dc77f7d4115b096742c0754e68b4b26) Thanks [@polRk](https://github.com/polRk)! - Stop generating `DECLARE` statements for tagged SQL. Write explicit declarations for servers or parameter types that require them. Named bindings with `.parameter()` and `.param()` now infer YDB types from native JavaScript values. Pass an SDK Value to select an exact type, or `undefined` to clear a binding. Malformed explicit Values throw when bound. QueryClient.driver exposes its underlying Driver for adapters sharing the client. + +- [#727](https://github.com/ydb-platform/ydb-js-sdk/pull/727) [`917508a`](https://github.com/ydb-platform/ydb-js-sdk/commit/917508a6f5a565a996ee966f4c9f4938cbdf5184) Thanks [@polRk](https://github.com/polRk)! - Use a tuple of row types for query results: `sql<[Row]>` and `session.execute<[Row]>()` describe one result set, while `<[Row, CountRow]>` describes two. Reject a single row type or an unbounded array such as `Row[]` as the result generic. + + Keep `execute()` results as `{ resultSets, stats, metadata }`, with `rows`, `columns`, and `truncated` in each result set. Tagged queries continue returning arrays of rows. Preserve the result-set tuple when calling `.values()`. + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Export the raw QueryClient class from the package root with retrySession(options, callback) and retryTransaction(options, callback) as its execution entry points. Options may be omitted, but the callback is always last. Each callback receives an executor and the current attempt's cancellation signal; execute() and stream() belong to that executor. The root client has no execute(), do(), transaction() or stream() methods. Retry policy belongs to the callback, while statement signal and timeout options can cap individual operations within the callback budget. + + Rename the callable tagged client type to SQLClient and migrate the Drizzle and LangChain integrations. query(driver) and query(client) provide the convenient tagged API, preserving sql.do(), sql.begin(), sql.transaction(), result shapes and repeat-await behavior over the same execution engine and pool. + + Streaming is available only from executors inside SDK-owned retry callbacks. The SDK owns retry boundaries and revokes streams when their callback ends. + + Keep tagged query bindings stable across retries; raw retry callbacks may build new parameters on each attempt, while each statement encodes its inputs before consumption. Revoke executors and unfinished streams when their callback ends, and prevent replay after a confirmed commit. Separate stream cancellation from session loss and preserve caller cancellation reasons. Expose beforeCommit for precommit work while retaining onCommit for transactional Topic compatibility. + + Reject commit-hook registration after preparation starts, and observe all started hooks even when another hook throws synchronously. + + Return object rows with null prototypes from execute(), stream() and the tagged SQL facade, including raw-mode rows. Array-mode rows and raw protobuf cells keep their respective representations. + +- [#725](https://github.com/ydb-platform/ydb-js-sdk/pull/725) [`de9a120`](https://github.com/ydb-platform/ydb-js-sdk/commit/de9a12066039fac5ac4e701c48014bd320eefa77) Thanks [@polRk](https://github.com/polRk)! - Remove PostgreSQL Value types and the `@ydbjs/value/pg` entry point. Decoding a PostgreSQL schema now fails explicitly, including inside empty containers and absent Optionals. Query parameters reject PostgreSQL schemas, including custom Values. Query raw mode continues to return the wire values and type descriptors. + +### Minor Changes + +- [#726](https://github.com/ydb-platform/ydb-js-sdk/pull/726) [`4b3db40`](https://github.com/ydb-platform/ydb-js-sdk/commit/4b3db408e6875661588f6428ff28f20081c90c34) Thanks [@polRk](https://github.com/polRk)! - Add opt-in Temporal result conversion with toJs(value, { temporal: true }), new QueryClient(driver, { temporal: true }) and query(driver, { temporal: true }). Preserve the default Value/Date representations when the option is disabled. + + Use the application-provided global Temporal implementation. TzDate and TzDate32 remain SDK Values because Temporal has no zoned date-only type. Preserve Drizzle's Date and numeric column representations with Temporal-enabled clients. + +- [#704](https://github.com/ydb-platform/ydb-js-sdk/pull/704) [`4f76c1e`](https://github.com/ydb-platform/ydb-js-sdk/commit/4f76c1e760106f5305f9eddd2db5322e172214b7) Thanks [@polRk](https://github.com/polRk)! - Add graceful `QueryClient.close()` and immediate `destroy()`. Async disposal drains accepted queries, transactions and session cleanup; synchronous disposal cancels owned work without closing the shared Driver. Release query resources after failed readiness and destruction, and prevent late cleanup RPCs or callbacks after shutdown. + + Keep actual query and transaction attempts owned until their cleanup completes, even when caller cancellation has already rejected the retry wrapper. Graceful close waits for rollback and close hooks; destroy still cancels them immediately. + +- [#742](https://github.com/ydb-platform/ydb-js-sdk/pull/742) [`c04cd9d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c04cd9df0dc77f7d4115b096742c0754e68b4b26) Thanks [@polRk](https://github.com/polRk)! - Encode standalone tagged SQL text, settings and parameters before session admission and reuse the encoded request across automatic retries. Send the current session ID and query bytes as separate parts of one gRPC message. Remove protobuf graph snapshots and their internal exports. Explicit retry callbacks encode their current inputs on every statement call. + +### Patch Changes + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Keep caller cancellation terminal even when its reason is a retryable database error. Cover pre-aborted nested operations, statements and tagged queries, and streams cancelled before their first read. Preserve the original reason as the cause, and finish stream cleanup before classifying callback failures for retry. + +- [#738](https://github.com/ydb-platform/ydb-js-sdk/pull/738) [`f6159ec`](https://github.com/ydb-platform/ydb-js-sdk/commit/f6159ecbb40b31b23aef060a2aa608a9bfc7551e) Thanks [@polRk](https://github.com/polRk)! - Infer tagged parameters through fromJs so JSON objects with type-like fields are bound as data. Reject malformed explicit Value bindings before executing the query. Escape backslashes as well as backticks in quoted identifiers. + + Use default YQL string escaping in Drizzle inline values and DDL builders, and in LangChain filter paths. Preserve backslashes before escaping quotes so data cannot terminate generated SQL literals. + +- [#727](https://github.com/ydb-platform/ydb-js-sdk/pull/727) [`917508a`](https://github.com/ydb-platform/ydb-js-sdk/commit/917508a6f5a565a996ee966f4c9f4938cbdf5184) Thanks [@polRk](https://github.com/polRk)! - Accept null callbacks in Query.then() to preserve PromiseLike compatibility when tagged query results are widened to unknown[][]. + +- [#717](https://github.com/ydb-platform/ydb-js-sdk/pull/717) [`9d69461`](https://github.com/ydb-platform/ydb-js-sdk/commit/9d69461c6fc1edefb741957a0babe7e2e2626a33) Thanks [@polRk](https://github.com/polRk)! - Continue serving queued queries after session creation fails, propagate cancellation into replacement session creation, and prevent repeated lease disposal from lending one session to concurrent callers. Reject invalid session-pool bounds and retire sessions that cannot safely be reused after interrupted queries. + + Centralize pool ownership and shutdown transitions in one state machine. Bound admitted operations before driver readiness as well as queued acquisitions, while allowing already accepted work to finish retries during graceful shutdown. + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Preserve the query tracing context while consuming or closing ExecuteQuery RPCs, without changing the consumer's async context. + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Honor a zero timeout on tagged queries instead of treating it as an absent timeout. Keep the cancellation budget consistent with the raw QueryClient. + +- [#666](https://github.com/ydb-platform/ydb-js-sdk/pull/666) [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28) Thanks [@polRk](https://github.com/polRk)! - Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. + +- [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1) Thanks [@polRk](https://github.com/polRk)! - Refresh compatible dependency versions and remove unused runtime packages. Include the `ms` types required by the Topic reader's published declarations. + +- [#735](https://github.com/ydb-platform/ydb-js-sdk/pull/735) [`84798d1`](https://github.com/ydb-platform/ydb-js-sdk/commit/84798d1a4ef66a62b7da8d13f709c261d761ca85) Thanks [@polRk](https://github.com/polRk)! - Add Tagged and TaggedType to preserve result tags and typed payloads. Reject Tagged parameter schemas before ExecuteQuery; apply AsTagged in YQL instead. +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6), [`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`cdff086`](https://github.com/ydb-platform/ydb-js-sdk/commit/cdff0864d850ba1bd1c7cf7c7041dd9742f04ef6), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`3e75fad`](https://github.com/ydb-platform/ydb-js-sdk/commit/3e75fad0225cc56f7b921577e5d91db426cb6313), [`64df3b5`](https://github.com/ydb-platform/ydb-js-sdk/commit/64df3b50005490e7c5a1628a6a9f31cb19e07d3d), [`807010c`](https://github.com/ydb-platform/ydb-js-sdk/commit/807010c6d784828b63676e351fd807ae0dd47338), [`65ba0fd`](https://github.com/ydb-platform/ydb-js-sdk/commit/65ba0fdf81aaaa880699633b005e1cf134f226a8), [`4b3db40`](https://github.com/ydb-platform/ydb-js-sdk/commit/4b3db408e6875661588f6428ff28f20081c90c34), [`e6960f6`](https://github.com/ydb-platform/ydb-js-sdk/commit/e6960f6b4170c7d399739b364c45ed5ca8374eb4), [`549da21`](https://github.com/ydb-platform/ydb-js-sdk/commit/549da21a2f16312e5c774cb34ab4de87f40f3005), [`af97a85`](https://github.com/ydb-platform/ydb-js-sdk/commit/af97a858daea4a5a0a0df647abe19cf0f1e6bdb7), [`27bdd45`](https://github.com/ydb-platform/ydb-js-sdk/commit/27bdd45166b1e6b12bd7f83a559128cbb0f43ec1), [`0ca6e3a`](https://github.com/ydb-platform/ydb-js-sdk/commit/0ca6e3a44991d9aceedca3d777d86d1c8c3f9aae), [`6c3dee3`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c3dee3e5a84c666c3425cac779e18adc53be2b1), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`031e586`](https://github.com/ydb-platform/ydb-js-sdk/commit/031e586337262eca797d5bbd013dc9c0fedc9f1b), [`cda9c08`](https://github.com/ydb-platform/ydb-js-sdk/commit/cda9c08f28e16188db2493498780d88360bf08ae), [`dc41967`](https://github.com/ydb-platform/ydb-js-sdk/commit/dc419672abd79679b8f5d819067c374d9ff59208), [`986e841`](https://github.com/ydb-platform/ydb-js-sdk/commit/986e841781aebe4adb7d05a3deeeb105536fac93), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`b9342a1`](https://github.com/ydb-platform/ydb-js-sdk/commit/b9342a1648be7805047af2c15c43306998ee1726), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`c04cd9d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c04cd9df0dc77f7d4115b096742c0754e68b4b26), [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1), [`6ad8ff0`](https://github.com/ydb-platform/ydb-js-sdk/commit/6ad8ff016a40d9036add4d7db8dc5d0e6b8365de), [`c29324d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c29324d4adadf65bd2eb0b6de38672c0c286fc81), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`2fb8fb3`](https://github.com/ydb-platform/ydb-js-sdk/commit/2fb8fb33b7c7ffdb7a35fd986e27453d762e97f3), [`6c5994d`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c5994db17833904b30e556ddd5f44a9af0830e7), [`fad487e`](https://github.com/ydb-platform/ydb-js-sdk/commit/fad487ee4c059c95cc89bb54d01af9d37b400a24), [`de9a120`](https://github.com/ydb-platform/ydb-js-sdk/commit/de9a12066039fac5ac4e701c48014bd320eefa77), [`84798d1`](https://github.com/ydb-platform/ydb-js-sdk/commit/84798d1a4ef66a62b7da8d13f709c261d761ca85), [`294b07c`](https://github.com/ydb-platform/ydb-js-sdk/commit/294b07c4875e0752509ec8b4d5a0fc9a04f9be57), [`74d66f3`](https://github.com/ydb-platform/ydb-js-sdk/commit/74d66f3eda573229b652a03401cade4d21139427), [`f518b6a`](https://github.com/ydb-platform/ydb-js-sdk/commit/f518b6a70376a0f20c42d208d3e3ad4b9226b3ce), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`52e319f`](https://github.com/ydb-platform/ydb-js-sdk/commit/52e319f3f9fab7ca2d71dd732725a788310c5b8c), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`38b0c91`](https://github.com/ydb-platform/ydb-js-sdk/commit/38b0c91d1781bdd27f041b97e1a100ef70e9d3bd)]: + - @ydbjs/abortable@6.2.0 + - @ydbjs/api@7.0.0 + - @ydbjs/core@7.0.0 + - @ydbjs/value@7.0.0 + - @ydbjs/fsm@7.0.0 + - @ydbjs/grpc@0.2.0 + - @ydbjs/retry@7.0.0 + - @ydbjs/error@6.1.0 + - @ydbjs/debug@6.0.6 + ## 6.3.0 ### Minor Changes diff --git a/packages/query/package.json b/packages/query/package.json index c26e965d8..53a496031 100644 --- a/packages/query/package.json +++ b/packages/query/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/query", - "version": "6.3.0", + "version": "7.0.0", "description": "High-level, type-safe YQL query and transaction client for YDB. Supports tagged template syntax, parameter binding, transactions, and statistics.", "keywords": [ "database", @@ -50,15 +50,15 @@ }, "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/core": "^6.3.1", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/fsm": "^6.1.1", - "@ydbjs/retry": "^6.3.0", - "@ydbjs/value": "^6.0.8", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/api": "^7.0.0", + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/fsm": "^7.0.0", + "@ydbjs/retry": "^7.0.0", + "@ydbjs/value": "^7.0.0", + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", diff --git a/packages/retry/CHANGELOG.md b/packages/retry/CHANGELOG.md index cd0ab1729..2c43e9e7c 100644 --- a/packages/retry/CHANGELOG.md +++ b/packages/retry/CHANGELOG.md @@ -1,5 +1,35 @@ # @ydbjs/retry +## 7.0.0 + +### Major Changes + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +### Patch Changes + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Report failed completion hooks after a confirmed commit as TransactionCompletionError, with committed=true and the original cause. Preserve this terminal classification across enclosing SDK retriers instead of exposing a retryable database error for an already committed transaction. + + Release SDK resources when cancellation interrupts application cleanup hooks. Preserve confirmed commit information on cancellation, and wrap retryable database errors used as cancellation reasons in AbortError with the original cause so enclosing callbacks cannot replay them. + +- [#714](https://github.com/ydb-platform/ydb-js-sdk/pull/714) [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846) Thanks [@polRk](https://github.com/polRk)! - Distinguish local protocol failures and HTTP/2 transport failures from server gRPC statuses. Stop retrying deterministic message-size and encoding failures ([#586](https://github.com/ydb-platform/ydb-js-sdk/issues/586)), and require idempotency before retrying ambiguous INTERNAL statuses or transport overload resets. Preserve the caller's cancellation reason and notify retry observers for attempts without backoff. +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6), [`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`031e586`](https://github.com/ydb-platform/ydb-js-sdk/commit/031e586337262eca797d5bbd013dc9c0fedc9f1b), [`cda9c08`](https://github.com/ydb-platform/ydb-js-sdk/commit/cda9c08f28e16188db2493498780d88360bf08ae), [`dc41967`](https://github.com/ydb-platform/ydb-js-sdk/commit/dc419672abd79679b8f5d819067c374d9ff59208), [`986e841`](https://github.com/ydb-platform/ydb-js-sdk/commit/986e841781aebe4adb7d05a3deeeb105536fac93), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`b9342a1`](https://github.com/ydb-platform/ydb-js-sdk/commit/b9342a1648be7805047af2c15c43306998ee1726), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1)]: + - @ydbjs/abortable@6.2.0 + - @ydbjs/api@7.0.0 + - @ydbjs/grpc@0.2.0 + - @ydbjs/error@6.1.0 + - @ydbjs/debug@6.0.6 + ## 6.3.0 ### Minor Changes diff --git a/packages/retry/package.json b/packages/retry/package.json index 177c9dbf4..2a3b38a4a 100644 --- a/packages/retry/package.json +++ b/packages/retry/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/retry", - "version": "6.3.0", + "version": "7.0.0", "description": "Flexible, configurable retry logic for YDB operations. Supports custom strategies, budgets, and integration with async workflows.", "keywords": [ "database", @@ -56,11 +56,11 @@ "test": "vitest --run" }, "dependencies": { - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.0", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.0", - "@ydbjs/grpc": "^0.1.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/grpc": "^0.2.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", diff --git a/packages/telemetry/CHANGELOG.md b/packages/telemetry/CHANGELOG.md index e42b13d2f..186345ff3 100644 --- a/packages/telemetry/CHANGELOG.md +++ b/packages/telemetry/CHANGELOG.md @@ -1,5 +1,36 @@ # @ydbjs/telemetry +## 7.0.0 + +### Major Changes + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +- [#709](https://github.com/ydb-platform/ydb-js-sdk/pull/709) [`85601f5`](https://github.com/ydb-platform/ydb-js-sdk/commit/85601f5e42c9e7efcc9d44eb367e3bae12821b5c) Thanks [@polRk](https://github.com/polRk)! - Require OpenTelemetry API 1.10 and SDK 3.x (experimental packages 0.300.x). Update application providers, processors, and exporters together; SDK 2.x providers are not compatible with API 1.10. Trace context and baggage propagation remain supported. + +### Patch Changes + +- [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1) Thanks [@polRk](https://github.com/polRk)! - Refresh compatible dependency versions and remove unused runtime packages. Include the `ms` types required by the Topic reader's published declarations. + +- [#638](https://github.com/ydb-platform/ydb-js-sdk/pull/638) [`d5cdb51`](https://github.com/ydb-platform/ydb-js-sdk/commit/d5cdb515e7f5522d4008ec55d90dc00263f4df25) Thanks [@polRk](https://github.com/polRk)! - Drop the `pessimization.until` span-event attribute from the `ydb:driver.connection.pessimized` subscriber. The endpoints engine in `@ydbjs/core` no longer emits `until` (pessimization has no fixed timer), so the subscriber was writing `NaN` (`undefined / 1000`) as the attribute value under an active span. The `ATTR_YDB_DRIVER_CONNECTION_PESSIMIZATION_UNTIL` semconv constant is kept but deprecated. + + Add the `ydb.node.pile` (`ATTR_YDB_NODE_PILE`) span-event attribute to every `ydb:driver.connection.*` mapping, so bridge (2DC) traces show which pile each node belongs to alongside `ydb.node.dc`. The attribute is omitted on a non-bridge cluster (empty pile name). + +- Updated dependencies [[`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`cdff086`](https://github.com/ydb-platform/ydb-js-sdk/commit/cdff0864d850ba1bd1c7cf7c7041dd9742f04ef6), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`3e75fad`](https://github.com/ydb-platform/ydb-js-sdk/commit/3e75fad0225cc56f7b921577e5d91db426cb6313), [`64df3b5`](https://github.com/ydb-platform/ydb-js-sdk/commit/64df3b50005490e7c5a1628a6a9f31cb19e07d3d), [`807010c`](https://github.com/ydb-platform/ydb-js-sdk/commit/807010c6d784828b63676e351fd807ae0dd47338), [`65ba0fd`](https://github.com/ydb-platform/ydb-js-sdk/commit/65ba0fdf81aaaa880699633b005e1cf134f226a8), [`e6960f6`](https://github.com/ydb-platform/ydb-js-sdk/commit/e6960f6b4170c7d399739b364c45ed5ca8374eb4), [`549da21`](https://github.com/ydb-platform/ydb-js-sdk/commit/549da21a2f16312e5c774cb34ab4de87f40f3005), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`6ad8ff0`](https://github.com/ydb-platform/ydb-js-sdk/commit/6ad8ff016a40d9036add4d7db8dc5d0e6b8365de), [`c29324d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c29324d4adadf65bd2eb0b6de38672c0c286fc81)]: + - @ydbjs/api@7.0.0 + - @ydbjs/core@7.0.0 + - @ydbjs/error@6.1.0 + ## 6.0.1 ### Patch Changes @@ -78,7 +109,7 @@ - `ydb.query.session.acquire.duration` (Histogram) - `ydb.query.session.closed` (Counter, tagged with `ydb.session.close.reason` ∈ `{pool_close, attach_failed, -stream_closed, stream_error}`) + stream_closed, stream_error}`) - `ydb.query.session.acquire.failures` (Counter, tagged with `error.type`) - `ydb.auth.token.fetch.duration` (Histogram) diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index ec4b3ffcb..57028096a 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/telemetry", - "version": "6.0.1", + "version": "7.0.0", "description": "OpenTelemetry tracing for YDB JavaScript SDK. Subscribes to ydbjs diagnostics channels and emits OTel spans.", "keywords": [ "opentelemetry", @@ -55,15 +55,15 @@ "@opentelemetry/api": "^1.10.0", "@opentelemetry/instrumentation": "^0.300.0", "@opentelemetry/semantic-conventions": "^1.43.0", - "@ydbjs/api": "^6.0.0", - "@ydbjs/core": "^6.2.0", - "@ydbjs/error": "^6.0.0" + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/error": "^6.1.0" }, "devDependencies": { "@opentelemetry/context-async-hooks": "^3.0.0", "@opentelemetry/core": "^3.0.0", "@opentelemetry/sdk-metrics": "^3.0.0", - "@ydbjs/grpc": "^0.1.0", + "@ydbjs/grpc": "^0.2.0", "@bufbuild/protobuf": "2.16.0", "@opentelemetry/sdk-trace": "^3.0.0" }, diff --git a/packages/topic/CHANGELOG.md b/packages/topic/CHANGELOG.md index 54aef429d..96ff18822 100644 --- a/packages/topic/CHANGELOG.md +++ b/packages/topic/CHANGELOG.md @@ -1,5 +1,111 @@ # @ydbjs/topic +## 7.0.0 + +### Major Changes + +- [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096) Thanks [@polRk](https://github.com/polRk)! - Connect SDK services to `@ydbjs/grpc` and remove nice-grpc and grpc-js from the workspace. Service methods retain Promise results and AsyncIterable request/response streams, with AbortSignal cancellation and backpressure. Requires Node.js 22.15 or later supported by the SDK. + + Use `createServiceClient(service, transport)` for standalone calls. `Driver.createClient` retains discovery and node selection; `createPinnedClient` explicitly awaits endpoint pin acquisition. Configure TLS, message limits, and HTTP/2 windows through `transportOptions`. The transport does not replay RPCs or duplicate YDB balancing and retry policies. + + Call options accept plain metadata records, signals, absolute deadlines, and header/trailer/status observers. `RpcError` carries code, details, and trailing metadata; `MessageSizeError` identifies permanent local size-limit failures. Query metadata events expose the same record format. Register `addMetadataHook` before constructing Driver to add tracing headers. Credential providers supply `getToken`; Driver handles authentication and mandatory headers without middleware or interceptor adapters. + + High-level TopicWriter, TopicReader, query, and coordination operations retain their APIs. Generated API definitions remain independent of the transport at runtime. Request framing sends the header and serialized body separately, avoiding the payload copy used to prepend a gRPC frame header. + + Preserve explicit TLS server names when discovery provides no override, and avoid logging raw driver options. + + Preserve explicit gRPC endpoint ports when selecting TLS, including mixed-case URL schemes. Merge repeated case-insensitive call metadata values while keeping required driver headers authoritative over caller metadata and hooks. + +- [#637](https://github.com/ydb-platform/ydb-js-sdk/pull/637) [`51d3c1b`](https://github.com/ydb-platform/ydb-js-sdk/commit/51d3c1b98396f9e2c131a488d85cfdc0138bd1e9) Thanks [@YandalfRed](https://github.com/YandalfRed)! - Rebuild the topic reader on a deterministic `@ydbjs/fsm` state machine (transport FSM + reader FSM), mirroring the writer. The public `TopicReader` / `TopicTxReader` API (read / commit / close / destroy + callbacks) is unchanged; the behaviour is more reliable: + + - `commit()` no longer rejects on a transparent reconnect. Pending commits are held per partition and re-sent on the new partition session (verified against a live server — YDB accepts a re-sent commit for offsets not read on that session), so a `read()` + `commit()` loop survives reconnects instead of crashing. + - Transactional read offsets are keyed by the stable partition id and survive a reconnect (previously lost, so the transaction could miss offsets). + - Byte flow-control is charged once per `ReadResponse` — a response spanning several partitions no longer over-releases credit. + - Retention gap-fill (committing past retention-deleted offsets) is preserved. + - `read()` accumulates a batch up to `limit`. With `batchWindowMs` set it yields at least every window (an empty batch on an idle topic, so a polling consumer never hangs); without it, it blocks until the next delivered chunk. The option was renamed from `waitMs`, which remains as a deprecated alias. + - On an unrecoverable terminal error `read()` now throws (instead of ending like a clean end-of-stream); the reader is already torn down, so it is not reusable and every further `read()` / `commit()` throws too. + - Transparent reconnect is now unbounded by default (waits for the server/topic to come back); the new `recoveryWindowMs` option re-imposes a finite terminal deadline. The new `retryOnSchemeError` option (off by default) retries `SCHEME_ERROR` so a reader started before its topic exists waits until it is created. A running reader whose topic is dropped idles until the server closes the stale read stream (~1 min), then transparently reconnects and resumes automatically if the topic exists again (`retryOnSchemeError` extends this to a topic recreated later). + - The new `gracefulShutdownTimeoutMs` option makes the graceful `close()` deadline configurable (default 30 s): past it, pending commits are dropped and the reader force-closes. + - Structured lifecycle events on `node:diagnostics_channel` under `ydb:topic.reader.*`, plus a `tracing:ydb:topic.reader.commit` span. + - `TopicTxReader` is now `AsyncDisposable` / `Disposable`. A manual `commit()` on a tx reader now throws — the `TopicTxReader` type never exposed it, but the runtime object did, and a plain-JS call would commit offsets outside the transaction (they would survive its rollback). + - `TopicPartitionSession.nextCommitStartOffset` is removed from the public class. It was commit-machinery state that leaked into the public surface in 6.1.x: user-visible (and mutable), while a corrupted anchor produces malformed commit ranges — which are session-fatal server-side. The gap-fill anchor now lives inside the reader state machine, keyed by the stable partition id, so it also survives reconnects (the session object does not). + - The default `maxBufferBytes` (server read credit / client-side buffer cap) is now 8 MiB, up from 4 MiB. + +- [#643](https://github.com/ydb-platform/ydb-js-sdk/pull/643) [`abc8955`](https://github.com/ydb-platform/ydb-js-sdk/commit/abc8955bfc494c220490b04414dff77e572d4c86) Thanks [@polRk](https://github.com/polRk)! - Harden the topic reader's commit semantics and multi-topic support, extend the reader/writer contracts: + + - Multi-topic readers key all partition state by (topic, partition id): topics sharing partition ids no longer collide (previously messages of one topic could be silently dropped and its commits attributed to the other topic's partition). + - `commit()` acknowledges exactly the messages it was given: each message covers its own offset range plus the server-side hole immediately preceding it (retention gaps, `readFrom` skips). Delivered-but-uncommitted messages are never covered by another message's commit; sparse commits resolve once the server watermark reaches them; overlapping commits never resolve before that watermark. Synchronous calls are combined into one microtask batch and return the same promise, so per-message concurrent processing produces one commit request instead of one request and promise per message. A commit racing a partition stop rejects immediately instead of hanging until the reassign GC. + - `commit()` rejects messages that belong to another reader's partition session. + - `onCommittedOffset` fires on every server-confirmed advance — commit acks, stop-request watermarks and partition status responses — including ended and stopped partitions. Start-hook `commitOffset` overrides are confirmed through partition status before resolving pending commits or notifying observers; graceful close waits for that confirmation. + - Soft partition stop honors the documented contract: `onPartitionSessionStop` is awaited before the stop response is sent and the partition keeps accepting reads and commits meanwhile — a real "last chance to commit". + - Transactional readers bind offsets at `read()` delivery (never covering buffered messages the consumer did not see), cover head gaps from the committed offset, keep tracked offsets when closed before the transaction commits, and route `UpdateOffsetsInTransaction` to the transaction session's node. + - `read()` validates `limit` and `batchWindowMs`; a read aborted mid-accumulation redelivers the accumulated messages on the next `read()` instead of dropping them. + - Large batches of small messages are delivered without exceeding the JavaScript function argument limit. + - Read flow-control credit is returned only after every message from a server response has passed through the async iterable. `reader.bufferedBytes` and `ydb:topic.reader.buffer.changed` expose the server-accounted bytes still retained by the reader. + - New reader option `autoPartitioningSupport` declares autopartitioning support to the server; ended partition sessions expose `childPartitionIds` / `adjacentPartitionIds`. + - The writer validates its configured codec against the server's `supportedCodecs` at init — fail-fast with an actionable error instead of a terminal server error after buffering — and rejects an empty `producer` id (silent no-dedup mode). + - `readFrom: 0` (the epoch) and `maxLag: 0` reach the InitRequest instead of being silently dropped. + - Drop Node.js 20 support. Require Node.js 22.15+ on the 22.x release line or Node.js 23.8+, with built-in RAW, GZIP and ZSTD codecs available on every supported runtime. + +- [#637](https://github.com/ydb-platform/ydb-js-sdk/pull/637) [`8eefff2`](https://github.com/ydb-platform/ydb-js-sdk/commit/8eefff245e328f8aa79acef69d663906f1e02c04) Thanks [@YandalfRed](https://github.com/YandalfRed)! - Consolidate the topic writer onto a single deterministic `@ydbjs/fsm` state machine. + + Breaking changes: + + - `write()` now returns `void` instead of a sequence number. Obtain the last acknowledged `seqNo` via `flush()` (returns `bigint`) or the `onAck` callback. + - `flush()` now returns `bigint` (was `bigint | undefined`). + - Removed the experimental `@ydbjs/topic/writer2` subpath export. + - Removed the `retryConfig` writer option. The writer now reconnects transparently (exponential backoff + jitter) and, by default, indefinitely — waiting for the server/topic to come back; the new `recoveryWindowMs` option re‑imposes a terminal deadline. In‑flight messages are resent and pending writes are not failed by a transparent reconnect. + - `flushIntervalMs` default changed from 10ms to 1000ms. + - `close()` now rejects when the graceful drain fails (non‑retryable error, or timeout with undelivered messages) instead of resolving silently — this makes transactional commit hooks fail rather than commit with lost writes. + + Fixes and additions: + + - Non‑RAW codecs (GZIP/ZSTD) are compressed once at `write()` and the compressed bytes are what the buffer accounts and the wire carries. + - `maxBufferBytes` is now enforced as a fail‑fast cap: `write()` throws synchronously when a message would push the un‑acknowledged buffer past the limit (default 256 MB), bounding writer memory. + - New options: `recoveryWindowMs` (finite reconnect deadline; unbounded by default), `retryOnSchemeError` (retry SCHEME_ERROR to wait for a not‑yet‑created topic; off by default), `gracefulShutdownTimeoutMs`, `partitionId` / `messageGroupId` (mutually exclusive), and `producer` is auto‑generated when omitted. + - Structured lifecycle events on `node:diagnostics_channel` under `ydb:topic.writer.*`. + +### Patch Changes + +- [#689](https://github.com/ydb-platform/ydb-js-sdk/pull/689) [`79011d9`](https://github.com/ydb-platform/ydb-js-sdk/commit/79011d9a4003a812ba8d20c610149043f0eff98a) Thanks [@polRk](https://github.com/polRk)! - Keep reader payloads encoded until selected for delivery, preserve unread messages after clean close, and release them on destruction or terminal failure. Preserve transactional offset cancellation, snapshot settings and callbacks, and honor cancellation between slices of a response. maxBufferBytes accounts for wire response credit rather than decompressed payloads or RSS. + + Stop the reader immediately on destruction, including synchronous callback reentry, and release pending payloads and commit waiters without requiring a subsequent close. + +- [#688](https://github.com/ydb-platform/ydb-js-sdk/pull/688) [`71443ca`](https://github.com/ydb-platform/ydb-js-sdk/commit/71443ca6e475ebfc470cff9d6b3dd08953a5c50d) Thanks [@polRk](https://github.com/polRk)! - Preserve complete-response read credit across reconnects and account for releases during backoff. Track partition-session identities and pending commits through replacement and retirement, expire unreassigned partitions, and treat oversized read responses as terminal errors. Split sparse commit replay into bounded requests so reconnect cannot combine valid individual commits into an oversized frame. + +- [#686](https://github.com/ydb-platform/ydb-js-sdk/pull/686) [`fdb2757`](https://github.com/ydb-platform/ydb-js-sdk/commit/fdb2757a8f668405dd495e5ce02dca5ed4f30d51) Thanks [@polRk](https://github.com/polRk)! - Keep Topic requests and token refreshes attached to the current stream. Ignore obsolete completions, prevent opening streams after cancellation, and continue reader token renewal when unchanged credentials are not acknowledged. + +- [#656](https://github.com/ydb-platform/ydb-js-sdk/pull/656) [`8609b8b`](https://github.com/ydb-platform/ydb-js-sdk/commit/8609b8b8a93c2f580141df63c47004d0e9a54629) Thanks [@polRk](https://github.com/polRk)! - Keep independent flush boundaries across acknowledgments and reconnect deduplication. Drain writer close through the normal connection lifecycle, preserve timed batching without repeated partial-batch scans, and release buffered messages, callbacks and codecs on shutdown. Restore the TopicTxWriter type export and contain rejected acknowledgment observers. + +- [#687](https://github.com/ydb-platform/ydb-js-sdk/pull/687) [`4c214d0`](https://github.com/ydb-platform/ydb-js-sdk/commit/4c214d05663f837bd5aab252b89826d367bbe486) Thanks [@polRk](https://github.com/polRk)! - Snapshot Topic writer dates and metadata at admission, copy bounded or growable payload views, and reject invalid dates or sequence numbers before accepting a message. Generate default producer identities with randomUUID(). + + Include metadata key/value bytes in the retained write budget and release that reservation after acknowledgments or reconnect recovery. Reject metadata above the 4096-byte per-message limit before copying it or changing writer state. + + Remove the unused acknowledged payload-byte diagnostic and calculate acknowledgment status counts only when the channel has subscribers. + +- [#666](https://github.com/ydb-platform/ydb-js-sdk/pull/666) [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28) Thanks [@polRk](https://github.com/polRk)! - Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. + +- [#673](https://github.com/ydb-platform/ydb-js-sdk/pull/673) [`f6e78ec`](https://github.com/ydb-platform/ydb-js-sdk/commit/f6e78ec3f6332add45b32caabafce101020b6187) Thanks [@polRk](https://github.com/polRk)! - Reduce topic reader allocations by consuming partition groups directly and releasing delivered message references while retaining unread messages. + +- [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1) Thanks [@polRk](https://github.com/polRk)! - Refresh compatible dependency versions and remove unused runtime packages. Include the `ms` types required by the Topic reader's published declarations. + +- [#638](https://github.com/ydb-platform/ydb-js-sdk/pull/638) [`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be) Thanks [@polRk](https://github.com/polRk)! - Widen the reader's internal `PartitionReadData` timestamp fields (`writtenAt`, `createdAt`) to `Timestamp | undefined` to match the stricter optional-field typing from the regenerated `@ydbjs/api`. No behavioural change. + +- [#702](https://github.com/ydb-platform/ydb-js-sdk/pull/702) [`bc5bc26`](https://github.com/ydb-platform/ydb-js-sdk/commit/bc5bc2678124a732b9e8e3331ae23c93f3acc4f8) Thanks [@polRk](https://github.com/polRk)! - Stop TopicWriter synchronously on destroy, release pending writes and callback references, and reject outstanding flush and close operations. Stop acknowledgment delivery when a callback or diagnostics subscriber destroys the writer. Preserve the first destruction or runtime failure reason when synchronous transport completion hooks reenter destroy. Graceful close continues to drain accepted writes and can still be interrupted by destroy. + + Cancel reader and writer credential waits when their stream is destroyed or replaced, while leaving shared provider refreshes running. + +- [#728](https://github.com/ydb-platform/ydb-js-sdk/pull/728) [`8df05b7`](https://github.com/ydb-platform/ydb-js-sdk/commit/8df05b72549da00d5efc13b52daafdbf90f12f46) Thanks [@polRk](https://github.com/polRk)! - Stop a topic writer when the server explicitly reports that another session took over its producer, including the SESSION_EXPIRED response used by newer YDB versions. Preserve the original server error and keep retrying other expired-session errors. +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6), [`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`cdff086`](https://github.com/ydb-platform/ydb-js-sdk/commit/cdff0864d850ba1bd1c7cf7c7041dd9742f04ef6), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`3e75fad`](https://github.com/ydb-platform/ydb-js-sdk/commit/3e75fad0225cc56f7b921577e5d91db426cb6313), [`64df3b5`](https://github.com/ydb-platform/ydb-js-sdk/commit/64df3b50005490e7c5a1628a6a9f31cb19e07d3d), [`807010c`](https://github.com/ydb-platform/ydb-js-sdk/commit/807010c6d784828b63676e351fd807ae0dd47338), [`65ba0fd`](https://github.com/ydb-platform/ydb-js-sdk/commit/65ba0fdf81aaaa880699633b005e1cf134f226a8), [`e6960f6`](https://github.com/ydb-platform/ydb-js-sdk/commit/e6960f6b4170c7d399739b364c45ed5ca8374eb4), [`549da21`](https://github.com/ydb-platform/ydb-js-sdk/commit/549da21a2f16312e5c774cb34ab4de87f40f3005), [`af97a85`](https://github.com/ydb-platform/ydb-js-sdk/commit/af97a858daea4a5a0a0df647abe19cf0f1e6bdb7), [`27bdd45`](https://github.com/ydb-platform/ydb-js-sdk/commit/27bdd45166b1e6b12bd7f83a559128cbb0f43ec1), [`0ca6e3a`](https://github.com/ydb-platform/ydb-js-sdk/commit/0ca6e3a44991d9aceedca3d777d86d1c8c3f9aae), [`6c3dee3`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c3dee3e5a84c666c3425cac779e18adc53be2b1), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`031e586`](https://github.com/ydb-platform/ydb-js-sdk/commit/031e586337262eca797d5bbd013dc9c0fedc9f1b), [`cda9c08`](https://github.com/ydb-platform/ydb-js-sdk/commit/cda9c08f28e16188db2493498780d88360bf08ae), [`dc41967`](https://github.com/ydb-platform/ydb-js-sdk/commit/dc419672abd79679b8f5d819067c374d9ff59208), [`986e841`](https://github.com/ydb-platform/ydb-js-sdk/commit/986e841781aebe4adb7d05a3deeeb105536fac93), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`b9342a1`](https://github.com/ydb-platform/ydb-js-sdk/commit/b9342a1648be7805047af2c15c43306998ee1726), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1), [`6ad8ff0`](https://github.com/ydb-platform/ydb-js-sdk/commit/6ad8ff016a40d9036add4d7db8dc5d0e6b8365de), [`c29324d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c29324d4adadf65bd2eb0b6de38672c0c286fc81)]: + - @ydbjs/abortable@6.2.0 + - @ydbjs/api@7.0.0 + - @ydbjs/core@7.0.0 + - @ydbjs/fsm@7.0.0 + - @ydbjs/grpc@0.2.0 + - @ydbjs/retry@7.0.0 + - @ydbjs/error@6.1.0 + - @ydbjs/debug@6.0.6 + ## 6.1.4 ### Patch Changes diff --git a/packages/topic/package.json b/packages/topic/package.json index c37c86f0f..a539aadae 100644 --- a/packages/topic/package.json +++ b/packages/topic/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/topic", - "version": "6.1.4", + "version": "7.0.0", "description": "YDB Topics client for publish-subscribe messaging. Provides at-least-once delivery, exactly-once publishing, FIFO guarantees, and scalable message processing for unstructured data.", "keywords": [ "database", @@ -66,19 +66,19 @@ }, "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/api": "^6.0.7", - "@ydbjs/core": "^6.3.1", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/error": "^6.0.6", - "@ydbjs/fsm": "^6.1.1", - "@ydbjs/retry": "^6.3.0", + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/error": "^6.1.0", + "@ydbjs/fsm": "^7.0.0", + "@ydbjs/retry": "^7.0.0", "ms": "^2.1.3", - "@ydbjs/grpc": "^0.1.0", + "@ydbjs/grpc": "^0.2.0", "@types/ms": "^2.1.0" }, "devDependencies": { - "@ydbjs/query": "^6.3.0" + "@ydbjs/query": "^7.0.0" }, "engines": { "node": "^22.15.0 || >=23.8.0", diff --git a/packages/value/CHANGELOG.md b/packages/value/CHANGELOG.md index 15057c461..89c881a92 100644 --- a/packages/value/CHANGELOG.md +++ b/packages/value/CHANGELOG.md @@ -1,5 +1,70 @@ # @ydbjs/value +## 7.0.0 + +### Major Changes + +- [#715](https://github.com/ydb-platform/ydb-js-sdk/pull/715) [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b) Thanks [@polRk](https://github.com/polRk)! - Preserve extended temporal values and supported timezone values as SDK Values in default JavaScript results. Keep Date, Datetime and Timestamp results as JavaScript Date and Interval as a number; preserve Drizzle's declared Date and numeric column types. + + Replace date-fns/TZDate with exact Temporal inputs and timezone text. The application supplies globalThis.Temporal; the SDK does not install or register a polyfill. Timezone constructors require Temporal for validation, including string inputs. Reject excess precision, non-ISO calendars, calendar durations and ambiguous local times. + + Require TypeScript 7 or later for the standard Temporal declarations included by the published types. + +- [#725](https://github.com/ydb-platform/ydb-js-sdk/pull/725) [`de9a120`](https://github.com/ydb-platform/ydb-js-sdk/commit/de9a12066039fac5ac4e701c48014bd320eefa77) Thanks [@polRk](https://github.com/polRk)! - Remove PostgreSQL Value types and the `@ydbjs/value/pg` entry point. Decoding a PostgreSQL schema now fails explicitly, including inside empty containers and absent Optionals. Query parameters reject PostgreSQL schemas, including custom Values. Query raw mode continues to return the wire values and type descriptors. + +- [#715](https://github.com/ydb-platform/ydb-js-sdk/pull/715) [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b) Thanks [@polRk](https://github.com/polRk)! - Return null-prototype records from toJs(Struct), including nested Structs and Structs inside containers. Field names are ordinary own properties; use Object.hasOwn instead of inherited object methods. + +- [#749](https://github.com/ydb-platform/ydb-js-sdk/pull/749) [`38b0c91`](https://github.com/ydb-platform/ydb-js-sdk/commit/38b0c91d1781bdd27f041b97e1a100ef70e9d3bd) Thanks [@polRk](https://github.com/polRk)! - Add Float32Vector, Int8Vector, Uint8Vector, and BitVector values for YDB vector search. Encode numeric arrays directly into compact YDB String parameters, validate packed input, and expose owned typed-array projections. Decode known tagged vector results without constructing per-coordinate Values while preserving ordinary binary String results. + + Infer native Int8Array parameters as List; use Int8Vector explicitly for compact binary storage. + +### Minor Changes + +- [#726](https://github.com/ydb-platform/ydb-js-sdk/pull/726) [`4b3db40`](https://github.com/ydb-platform/ydb-js-sdk/commit/4b3db408e6875661588f6428ff28f20081c90c34) Thanks [@polRk](https://github.com/polRk)! - Add opt-in Temporal result conversion with toJs(value, { temporal: true }), new QueryClient(driver, { temporal: true }) and query(driver, { temporal: true }). Preserve the default Value/Date representations when the option is disabled. + + Use the application-provided global Temporal implementation. TzDate and TzDate32 remain SDK Values because Temporal has no zoned date-only type. Preserve Drizzle's Date and numeric column representations with Temporal-enabled clients. + +- [#731](https://github.com/ydb-platform/ydb-js-sdk/pull/731) [`2fb8fb3`](https://github.com/ydb-platform/ydb-js-sdk/commit/2fb8fb33b7c7ffdb7a35fd986e27453d762e97f3) Thanks [@polRk](https://github.com/polRk)! - Add Decimal and DecimalType with exact string and scaled-bigint construction, binary decoding, native string projection and precision/scale validation. + + Reject invalid unsigned wire words before composing the signed coefficient, so malformed values cannot be truncated into valid decimals. + +- [#733](https://github.com/ydb-platform/ydb-js-sdk/pull/733) [`6c5994d`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c5994db17833904b30e556ddd5f44a9af0830e7) Thanks [@polRk](https://github.com/polRk)! - Add DyNumber and DyNumberType constructors and preserve exact decimal text in query parameters and native string results. + +- [#732](https://github.com/ydb-platform/ydb-js-sdk/pull/732) [`fad487e`](https://github.com/ydb-platform/ydb-js-sdk/commit/fad487ee4c059c95cc89bb54d01af9d37b400a24) Thanks [@polRk](https://github.com/polRk)! - Add EmptyList and EmptyDict constructors. Preserve their distinct wire schemas during decoding and project them to native arrays and Maps. + +- [#735](https://github.com/ydb-platform/ydb-js-sdk/pull/735) [`84798d1`](https://github.com/ydb-platform/ydb-js-sdk/commit/84798d1a4ef66a62b7da8d13f709c261d761ca85) Thanks [@polRk](https://github.com/polRk)! - Add Tagged and TaggedType to preserve result tags and typed payloads. Reject Tagged parameter schemas before ExecuteQuery; apply AsTagged in YQL instead. + +- [#736](https://github.com/ydb-platform/ydb-js-sdk/pull/736) [`294b07c`](https://github.com/ydb-platform/ydb-js-sdk/commit/294b07c4875e0752509ec8b4d5a0fc9a04f9be57) Thanks [@polRk](https://github.com/polRk)! - Add Void and VoidType with explicit typed results and query parameter support. + +- [#734](https://github.com/ydb-platform/ydb-js-sdk/pull/734) [`74d66f3`](https://github.com/ydb-platform/ydb-js-sdk/commit/74d66f3eda573229b652a03401cade4d21139427) Thanks [@polRk](https://github.com/polRk)! - Add TzDate32, TzDatetime64 and TzTimestamp64 with exact timezone text, Temporal inputs and validation across extended YDB ranges. Keep results as typed Values by default. + +- [#724](https://github.com/ydb-platform/ydb-js-sdk/pull/724) [`f518b6a`](https://github.com/ydb-platform/ydb-js-sdk/commit/f518b6a70376a0f20c42d208d3e3ad4b9226b3ce) Thanks [@polRk](https://github.com/polRk)! - Add Date32, Datetime64, Timestamp64 and Interval64 constructors with exact units and Temporal inputs. Preserve their default typed Value representation and validate server ranges. + +### Patch Changes + +- [#715](https://github.com/ydb-platform/ydb-js-sdk/pull/715) [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b) Thanks [@polRk](https://github.com/polRk)! - Preserve the presence of outer Optional values when an inner Optional is null. Encode the required nested_value wrapper and unwrap the corresponding level when decoding query results, instead of returning a protobuf object as a native scalar. + + Preserve struct members such as `__proto__` as own data properties, and apply the same own-field rule to single objects and lists of objects. + +- [#742](https://github.com/ydb-platform/ydb-js-sdk/pull/742) [`c04cd9d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c04cd9df0dc77f7d4115b096742c0754e68b4b26) Thanks [@polRk](https://github.com/polRk)! - Stop generating `DECLARE` statements for tagged SQL. Write explicit declarations for servers or parameter types that require them. Named bindings with `.parameter()` and `.param()` now infer YDB types from native JavaScript values. Pass an SDK Value to select an exact type, or `undefined` to clear a binding. Malformed explicit Values throw when bound. QueryClient.driver exposes its underlying Driver for adapters sharing the client. + +- [#666](https://github.com/ydb-platform/ydb-js-sdk/pull/666) [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28) Thanks [@polRk](https://github.com/polRk)! - Upgrade protobuf to 2.16.0 to reduce temporary allocations during serialization and parsing. + +- [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1) Thanks [@polRk](https://github.com/polRk)! - Refresh compatible dependency versions and remove unused runtime packages. Include the `ms` types required by the Topic reader's published declarations. + +- [#721](https://github.com/ydb-platform/ydb-js-sdk/pull/721) [`52e319f`](https://github.com/ydb-platform/ydb-js-sdk/commit/52e319f3f9fab7ca2d71dd732725a788310c5b8c) Thanks [@polRk](https://github.com/polRk)! - Encode Interval parameters using the signed 64-bit microsecond field and reject inputs that cannot represent exact integer microseconds. Keep leading zeros in TzTimestamp fractional seconds and encode Float64Array parameters as Double values. + +- [#715](https://github.com/ydb-platform/ydb-js-sdk/pull/715) [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b) Thanks [@polRk](https://github.com/polRk)! - Preserve declared schemas when decoding supported values, including nested Optional presence, typed empty and nullable containers, Struct member order and UUID bits. Reject incompatible schemas and malformed wire values before silently losing data. Apply the same value classification inside arrays as for standalone values. + + Preserve scalar values without an unambiguous native representation as typed SDK Values. Variant results require raw mode. + +- [#715](https://github.com/ydb-platform/ydb-js-sdk/pull/715) [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b) Thanks [@polRk](https://github.com/polRk)! - Validate primitive JavaScript payload types and scalar ranges in Value construction, including values decoded from protobuf. Reject implicit boolean, numeric, string and byte-array coercions before encoding; preserve valid floating-point special values and UUID words. + + Remove repeated checks from numeric wrappers and native result projection. Keep precision checks before conversions that could lose information. + +- Updated dependencies [[`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28)]: + - @ydbjs/api@7.0.0 + ## 6.0.8 ### Patch Changes diff --git a/packages/value/package.json b/packages/value/package.json index 503e8eabd..fbdf9f21a 100644 --- a/packages/value/package.json +++ b/packages/value/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/value", - "version": "6.0.8", + "version": "7.0.0", "description": "Type-safe conversion and manipulation of YDB values and types. Encode/decode between native JS and YDB, with full support for primitives and complex types.", "keywords": [ "conversion", @@ -106,7 +106,7 @@ }, "dependencies": { "@bufbuild/protobuf": "2.16.0", - "@ydbjs/api": "^6.0.7" + "@ydbjs/api": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/third-parties/auth-yandex-cloud/CHANGELOG.md b/third-parties/auth-yandex-cloud/CHANGELOG.md index b52ca5206..64d1bd02e 100644 --- a/third-parties/auth-yandex-cloud/CHANGELOG.md +++ b/third-parties/auth-yandex-cloud/CHANGELOG.md @@ -1,5 +1,16 @@ # @ydbjs/auth-yandex-cloud +## 0.2.1 + +### Patch Changes + +- [#675](https://github.com/ydb-platform/ydb-js-sdk/pull/675) [`7380673`](https://github.com/ydb-platform/ydb-js-sdk/commit/7380673c1f41fff1329521202dc8759419ee9b1f) Thanks [@polRk](https://github.com/polRk)! - Keep shared token refreshes independent of individual callers. Static, metadata, and Yandex Cloud providers own a five-second foreground request budget, including retries; static and Yandex Cloud background refreshes have a thirty-second budget. Cancelling a token request stops only that caller's wait. Cached reads and callers joining a refresh do not create provider timeouts. +- Updated dependencies [[`1cb8668`](https://github.com/ydb-platform/ydb-js-sdk/commit/1cb8668cb014cf7603114666eb0f21064792eaa6), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`7380673`](https://github.com/ydb-platform/ydb-js-sdk/commit/7380673c1f41fff1329521202dc8759419ee9b1f), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`9e16c2c`](https://github.com/ydb-platform/ydb-js-sdk/commit/9e16c2c2524658a1f56fdd465a317f4a2ae64846), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1)]: + - @ydbjs/abortable@6.2.0 + - @ydbjs/auth@7.0.0 + - @ydbjs/retry@7.0.0 + - @ydbjs/debug@6.0.6 + ## 0.2.0 ### Minor Changes diff --git a/third-parties/auth-yandex-cloud/package.json b/third-parties/auth-yandex-cloud/package.json index 66556198e..dfc738ce3 100644 --- a/third-parties/auth-yandex-cloud/package.json +++ b/third-parties/auth-yandex-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/auth-yandex-cloud", - "version": "0.2.0", + "version": "0.2.1", "description": "Yandex Cloud Service Account authentication provider for YDB. Supports authorized key JSON files and automatic IAM token management.", "keywords": [ "auth", @@ -51,10 +51,10 @@ "test": "vitest --run" }, "dependencies": { - "@ydbjs/abortable": "^6.1.0", - "@ydbjs/auth": "^6.3.0", - "@ydbjs/debug": "^6.0.0", - "@ydbjs/retry": "^6.3.0" + "@ydbjs/abortable": "^6.2.0", + "@ydbjs/auth": "^7.0.0", + "@ydbjs/debug": "^6.0.6", + "@ydbjs/retry": "^7.0.0" }, "engines": { "node": ">=20.19.0", diff --git a/third-parties/drizzle-adapter/CHANGELOG.md b/third-parties/drizzle-adapter/CHANGELOG.md index 2aacd5fc3..610833463 100644 --- a/third-parties/drizzle-adapter/CHANGELOG.md +++ b/third-parties/drizzle-adapter/CHANGELOG.md @@ -1,5 +1,47 @@ # @ydbjs/drizzle-adapter +## 1.0.0 + +### Major Changes + +- [#722](https://github.com/ydb-platform/ydb-js-sdk/pull/722) [`cf9ff57`](https://github.com/ydb-platform/ydb-js-sdk/commit/cf9ff57cc0f8ffb82c42a894f7aba1ee5f09b49a) Thanks [@polRk](https://github.com/polRk)! - Return mapped result rows and nested selection groups as objects with a null prototype. Selected fields named `__proto__`, `constructor`, and `toString` remain own properties. Use `Object.hasOwn(row, name)` instead of inherited methods such as `row.hasOwnProperty(name)`; spread a result into `{ ...row }` when an object with `Object.prototype` is required. + + Ignore inherited properties in object-row lookup and nullable-join metadata while retaining positional fallback for absent fields and preserving own `null` and `undefined` values. + +### Patch Changes + +- [#726](https://github.com/ydb-platform/ydb-js-sdk/pull/726) [`4b3db40`](https://github.com/ydb-platform/ydb-js-sdk/commit/4b3db408e6875661588f6428ff28f20081c90c34) Thanks [@polRk](https://github.com/polRk)! - Add opt-in Temporal result conversion with toJs(value, { temporal: true }), new QueryClient(driver, { temporal: true }) and query(driver, { temporal: true }). Preserve the default Value/Date representations when the option is disabled. + + Use the application-provided global Temporal implementation. TzDate and TzDate32 remain SDK Values because Temporal has no zoned date-only type. Preserve Drizzle's Date and numeric column representations with Temporal-enabled clients. + +- [#738](https://github.com/ydb-platform/ydb-js-sdk/pull/738) [`f6159ec`](https://github.com/ydb-platform/ydb-js-sdk/commit/f6159ecbb40b31b23aef060a2aa608a9bfc7551e) Thanks [@polRk](https://github.com/polRk)! - Infer tagged parameters through fromJs so JSON objects with type-like fields are bound as data. Reject malformed explicit Value bindings before executing the query. Escape backslashes as well as backticks in quoted identifiers. + + Use default YQL string escaping in Drizzle inline values and DDL builders, and in LangChain filter paths. Preserve backslashes before escaping quotes so data cannot terminate generated SQL literals. + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Export the raw QueryClient class from the package root with retrySession(options, callback) and retryTransaction(options, callback) as its execution entry points. Options may be omitted, but the callback is always last. Each callback receives an executor and the current attempt's cancellation signal; execute() and stream() belong to that executor. The root client has no execute(), do(), transaction() or stream() methods. Retry policy belongs to the callback, while statement signal and timeout options can cap individual operations within the callback budget. + + Rename the callable tagged client type to SQLClient and migrate the Drizzle and LangChain integrations. query(driver) and query(client) provide the convenient tagged API, preserving sql.do(), sql.begin(), sql.transaction(), result shapes and repeat-await behavior over the same execution engine and pool. + + Streaming is available only from executors inside SDK-owned retry callbacks. The SDK owns retry boundaries and revokes streams when their callback ends. + + Keep tagged query bindings stable across retries; raw retry callbacks may build new parameters on each attempt, while each statement encodes its inputs before consumption. Revoke executors and unfinished streams when their callback ends, and prevent replay after a confirmed commit. Separate stream cancellation from session loss and preserve caller cancellation reasons. Expose beforeCommit for precommit work while retaining onCommit for transactional Topic compatibility. + + Reject commit-hook registration after preparation starts, and observe all started hooks even when another hook throws synchronously. + + Return object rows with null prototypes from execute(), stream() and the tagged SQL facade, including raw-mode rows. Array-mode rows and raw protobuf cells keep their respective representations. + +- [#715](https://github.com/ydb-platform/ydb-js-sdk/pull/715) [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b) Thanks [@polRk](https://github.com/polRk)! - Preserve extended temporal values and supported timezone values as SDK Values in default JavaScript results. Keep Date, Datetime and Timestamp results as JavaScript Date and Interval as a number; preserve Drizzle's declared Date and numeric column types. + + Replace date-fns/TZDate with exact Temporal inputs and timezone text. The application supplies globalThis.Temporal; the SDK does not install or register a polyfill. Timezone constructors require Temporal for validation, including string inputs. Reject excess precision, non-ISO calendars, calendar durations and ambiguous local times. + + Require TypeScript 7 or later for the standard Temporal declarations included by the published types. + +- Updated dependencies [[`5d0cc28`](https://github.com/ydb-platform/ydb-js-sdk/commit/5d0cc2869176b222a6c12e6f3455a530178599be), [`cdff086`](https://github.com/ydb-platform/ydb-js-sdk/commit/cdff0864d850ba1bd1c7cf7c7041dd9742f04ef6), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`3e75fad`](https://github.com/ydb-platform/ydb-js-sdk/commit/3e75fad0225cc56f7b921577e5d91db426cb6313), [`64df3b5`](https://github.com/ydb-platform/ydb-js-sdk/commit/64df3b50005490e7c5a1628a6a9f31cb19e07d3d), [`807010c`](https://github.com/ydb-platform/ydb-js-sdk/commit/807010c6d784828b63676e351fd807ae0dd47338), [`65ba0fd`](https://github.com/ydb-platform/ydb-js-sdk/commit/65ba0fdf81aaaa880699633b005e1cf134f226a8), [`4b3db40`](https://github.com/ydb-platform/ydb-js-sdk/commit/4b3db408e6875661588f6428ff28f20081c90c34), [`e6960f6`](https://github.com/ydb-platform/ydb-js-sdk/commit/e6960f6b4170c7d399739b364c45ed5ca8374eb4), [`549da21`](https://github.com/ydb-platform/ydb-js-sdk/commit/549da21a2f16312e5c774cb34ab4de87f40f3005), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`4f76c1e`](https://github.com/ydb-platform/ydb-js-sdk/commit/4f76c1e760106f5305f9eddd2db5322e172214b7), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`c04cd9d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c04cd9df0dc77f7d4115b096742c0754e68b4b26), [`f6159ec`](https://github.com/ydb-platform/ydb-js-sdk/commit/f6159ecbb40b31b23aef060a2aa608a9bfc7551e), [`c04cd9d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c04cd9df0dc77f7d4115b096742c0754e68b4b26), [`917508a`](https://github.com/ydb-platform/ydb-js-sdk/commit/917508a6f5a565a996ee966f4c9f4938cbdf5184), [`917508a`](https://github.com/ydb-platform/ydb-js-sdk/commit/917508a6f5a565a996ee966f4c9f4938cbdf5184), [`9d69461`](https://github.com/ydb-platform/ydb-js-sdk/commit/9d69461c6fc1edefb741957a0babe7e2e2626a33), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1), [`6ad8ff0`](https://github.com/ydb-platform/ydb-js-sdk/commit/6ad8ff016a40d9036add4d7db8dc5d0e6b8365de), [`c29324d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c29324d4adadf65bd2eb0b6de38672c0c286fc81), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`2fb8fb3`](https://github.com/ydb-platform/ydb-js-sdk/commit/2fb8fb33b7c7ffdb7a35fd986e27453d762e97f3), [`6c5994d`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c5994db17833904b30e556ddd5f44a9af0830e7), [`fad487e`](https://github.com/ydb-platform/ydb-js-sdk/commit/fad487ee4c059c95cc89bb54d01af9d37b400a24), [`de9a120`](https://github.com/ydb-platform/ydb-js-sdk/commit/de9a12066039fac5ac4e701c48014bd320eefa77), [`84798d1`](https://github.com/ydb-platform/ydb-js-sdk/commit/84798d1a4ef66a62b7da8d13f709c261d761ca85), [`294b07c`](https://github.com/ydb-platform/ydb-js-sdk/commit/294b07c4875e0752509ec8b4d5a0fc9a04f9be57), [`74d66f3`](https://github.com/ydb-platform/ydb-js-sdk/commit/74d66f3eda573229b652a03401cade4d21139427), [`f518b6a`](https://github.com/ydb-platform/ydb-js-sdk/commit/f518b6a70376a0f20c42d208d3e3ad4b9226b3ce), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`52e319f`](https://github.com/ydb-platform/ydb-js-sdk/commit/52e319f3f9fab7ca2d71dd732725a788310c5b8c), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`38b0c91`](https://github.com/ydb-platform/ydb-js-sdk/commit/38b0c91d1781bdd27f041b97e1a100ef70e9d3bd)]: + - @ydbjs/api@7.0.0 + - @ydbjs/core@7.0.0 + - @ydbjs/value@7.0.0 + - @ydbjs/query@7.0.0 + ## 0.1.1 ### Patch Changes diff --git a/third-parties/drizzle-adapter/package.json b/third-parties/drizzle-adapter/package.json index 9e2155a40..298cd2d88 100644 --- a/third-parties/drizzle-adapter/package.json +++ b/third-parties/drizzle-adapter/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/drizzle-adapter", - "version": "0.1.1", + "version": "1.0.0", "description": "YDB adapter for Drizzle ORM.", "keywords": [ "database", @@ -60,10 +60,10 @@ "check:surface": "node scripts/check-package-surface.mjs" }, "dependencies": { - "@ydbjs/api": "^6.0.6", - "@ydbjs/core": "^6.3.0", - "@ydbjs/query": "^6.1.0", - "@ydbjs/value": "^6.0.7" + "@ydbjs/api": "^7.0.0", + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "peerDependencies": { "drizzle-orm": "^0.45.2" diff --git a/third-parties/langchain/CHANGELOG.md b/third-parties/langchain/CHANGELOG.md index 04a511247..626124360 100644 --- a/third-parties/langchain/CHANGELOG.md +++ b/third-parties/langchain/CHANGELOG.md @@ -1,5 +1,38 @@ # @ydbjs/langchain +## 0.2.0 + +### Minor Changes + +- [`a13fa6f`](https://github.com/ydb-platform/ydb-js-sdk/commit/a13fa6ff270c74d89c59e654445df2c60c77cd68) Thanks [@polRk](https://github.com/polRk)! - Pass `queryClient` to `YDBVectorStore` to share an existing session pool. The store borrows the supplied client and driver. With a supplied driver it owns the pool, and with a connection string it owns both resources. + + Run vector queries through QueryClient with named parameters. Searches can retry after a lost response without repeating schema changes or embedding requests. An indexed search with a metadata filter fails before lazy table initialization, including when `dropExistingTable` is set. + +- [`1e6a209`](https://github.com/ydb-platform/ydb-js-sdk/commit/1e6a209a7593413f3897a2ca9669e8ddc4205574) Thanks [@polRk](https://github.com/polRk)! - Honor explicit document IDs used by LangChain indexing, validate destructive delete options and vector dimensions, and reject invalid search scores. Bound embedding memory by processing and committing one batch at a time, and use the shared Float32 vector value encoding. Accept typed-array views for precomputed vectors and require Node.js 22.15 or a supported newer release. + +### Patch Changes + +- [#738](https://github.com/ydb-platform/ydb-js-sdk/pull/738) [`f6159ec`](https://github.com/ydb-platform/ydb-js-sdk/commit/f6159ecbb40b31b23aef060a2aa608a9bfc7551e) Thanks [@polRk](https://github.com/polRk)! - Infer tagged parameters through fromJs so JSON objects with type-like fields are bound as data. Reject malformed explicit Value bindings before executing the query. Escape backslashes as well as backticks in quoted identifiers. + + Use default YQL string escaping in Drizzle inline values and DDL builders, and in LangChain filter paths. Preserve backslashes before escaping quotes so data cannot terminate generated SQL literals. + +- [#718](https://github.com/ydb-platform/ydb-js-sdk/pull/718) [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77) Thanks [@polRk](https://github.com/polRk)! - Export the raw QueryClient class from the package root with retrySession(options, callback) and retryTransaction(options, callback) as its execution entry points. Options may be omitted, but the callback is always last. Each callback receives an executor and the current attempt's cancellation signal; execute() and stream() belong to that executor. The root client has no execute(), do(), transaction() or stream() methods. Retry policy belongs to the callback, while statement signal and timeout options can cap individual operations within the callback budget. + + Rename the callable tagged client type to SQLClient and migrate the Drizzle and LangChain integrations. query(driver) and query(client) provide the convenient tagged API, preserving sql.do(), sql.begin(), sql.transaction(), result shapes and repeat-await behavior over the same execution engine and pool. + + Streaming is available only from executors inside SDK-owned retry callbacks. The SDK owns retry boundaries and revokes streams when their callback ends. + + Keep tagged query bindings stable across retries; raw retry callbacks may build new parameters on each attempt, while each statement encodes its inputs before consumption. Revoke executors and unfinished streams when their callback ends, and prevent replay after a confirmed commit. Separate stream cancellation from session loss and preserve caller cancellation reasons. Expose beforeCommit for precommit work while retaining onCommit for transactional Topic compatibility. + + Reject commit-hook registration after preparation starts, and observe all started hooks even when another hook throws synchronously. + + Return object rows with null prototypes from execute(), stream() and the tagged SQL facade, including raw-mode rows. Array-mode rows and raw protobuf cells keep their respective representations. + +- Updated dependencies [[`cdff086`](https://github.com/ydb-platform/ydb-js-sdk/commit/cdff0864d850ba1bd1c7cf7c7041dd9742f04ef6), [`0edf569`](https://github.com/ydb-platform/ydb-js-sdk/commit/0edf569632df41da24e3a00d4ec5e141d914704a), [`3e75fad`](https://github.com/ydb-platform/ydb-js-sdk/commit/3e75fad0225cc56f7b921577e5d91db426cb6313), [`64df3b5`](https://github.com/ydb-platform/ydb-js-sdk/commit/64df3b50005490e7c5a1628a6a9f31cb19e07d3d), [`807010c`](https://github.com/ydb-platform/ydb-js-sdk/commit/807010c6d784828b63676e351fd807ae0dd47338), [`65ba0fd`](https://github.com/ydb-platform/ydb-js-sdk/commit/65ba0fdf81aaaa880699633b005e1cf134f226a8), [`4b3db40`](https://github.com/ydb-platform/ydb-js-sdk/commit/4b3db408e6875661588f6428ff28f20081c90c34), [`e6960f6`](https://github.com/ydb-platform/ydb-js-sdk/commit/e6960f6b4170c7d399739b364c45ed5ca8374eb4), [`549da21`](https://github.com/ydb-platform/ydb-js-sdk/commit/549da21a2f16312e5c774cb34ab4de87f40f3005), [`a389fc4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a389fc49a435b0a2686f0085b00f663d07f98096), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`4f76c1e`](https://github.com/ydb-platform/ydb-js-sdk/commit/4f76c1e760106f5305f9eddd2db5322e172214b7), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`c04cd9d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c04cd9df0dc77f7d4115b096742c0754e68b4b26), [`f6159ec`](https://github.com/ydb-platform/ydb-js-sdk/commit/f6159ecbb40b31b23aef060a2aa608a9bfc7551e), [`c04cd9d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c04cd9df0dc77f7d4115b096742c0754e68b4b26), [`917508a`](https://github.com/ydb-platform/ydb-js-sdk/commit/917508a6f5a565a996ee966f4c9f4938cbdf5184), [`917508a`](https://github.com/ydb-platform/ydb-js-sdk/commit/917508a6f5a565a996ee966f4c9f4938cbdf5184), [`9d69461`](https://github.com/ydb-platform/ydb-js-sdk/commit/9d69461c6fc1edefb741957a0babe7e2e2626a33), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`ee92bca`](https://github.com/ydb-platform/ydb-js-sdk/commit/ee92bca539ff1e6886ece37722a8c491ee2c2e77), [`a4022e4`](https://github.com/ydb-platform/ydb-js-sdk/commit/a4022e4f218fa49d12796435f8722f7acd8b3d28), [`ea3692f`](https://github.com/ydb-platform/ydb-js-sdk/commit/ea3692fc850072a84a8d812826786642ccc1b1c1), [`6ad8ff0`](https://github.com/ydb-platform/ydb-js-sdk/commit/6ad8ff016a40d9036add4d7db8dc5d0e6b8365de), [`c29324d`](https://github.com/ydb-platform/ydb-js-sdk/commit/c29324d4adadf65bd2eb0b6de38672c0c286fc81), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`2fb8fb3`](https://github.com/ydb-platform/ydb-js-sdk/commit/2fb8fb33b7c7ffdb7a35fd986e27453d762e97f3), [`6c5994d`](https://github.com/ydb-platform/ydb-js-sdk/commit/6c5994db17833904b30e556ddd5f44a9af0830e7), [`fad487e`](https://github.com/ydb-platform/ydb-js-sdk/commit/fad487ee4c059c95cc89bb54d01af9d37b400a24), [`de9a120`](https://github.com/ydb-platform/ydb-js-sdk/commit/de9a12066039fac5ac4e701c48014bd320eefa77), [`84798d1`](https://github.com/ydb-platform/ydb-js-sdk/commit/84798d1a4ef66a62b7da8d13f709c261d761ca85), [`294b07c`](https://github.com/ydb-platform/ydb-js-sdk/commit/294b07c4875e0752509ec8b4d5a0fc9a04f9be57), [`74d66f3`](https://github.com/ydb-platform/ydb-js-sdk/commit/74d66f3eda573229b652a03401cade4d21139427), [`f518b6a`](https://github.com/ydb-platform/ydb-js-sdk/commit/f518b6a70376a0f20c42d208d3e3ad4b9226b3ce), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`52e319f`](https://github.com/ydb-platform/ydb-js-sdk/commit/52e319f3f9fab7ca2d71dd732725a788310c5b8c), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`6702070`](https://github.com/ydb-platform/ydb-js-sdk/commit/67020705c757ba4b0e5680b00e3107351bd9843b), [`38b0c91`](https://github.com/ydb-platform/ydb-js-sdk/commit/38b0c91d1781bdd27f041b97e1a100ef70e9d3bd)]: + - @ydbjs/core@7.0.0 + - @ydbjs/value@7.0.0 + - @ydbjs/query@7.0.0 + ## 0.1.0 ### Minor Changes diff --git a/third-parties/langchain/package.json b/third-parties/langchain/package.json index cc171089f..3efcf2b47 100644 --- a/third-parties/langchain/package.json +++ b/third-parties/langchain/package.json @@ -1,6 +1,6 @@ { "name": "@ydbjs/langchain", - "version": "0.1.0", + "version": "0.2.0", "description": "YDB integration for LangChain.js \u2014 VectorStore backed by YDB.", "keywords": [ "database", @@ -47,9 +47,9 @@ "test:int": "vitest --run --project int" }, "dependencies": { - "@ydbjs/core": "^6.3.1", - "@ydbjs/query": "^6.3.0", - "@ydbjs/value": "^6.0.8" + "@ydbjs/core": "^7.0.0", + "@ydbjs/query": "^7.0.0", + "@ydbjs/value": "^7.0.0" }, "peerDependencies": { "@langchain/core": ">=1.0.0 <2.0.0"