From 440cf1ea81fbd4bd18a4393bcb098084de4e8cfc Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Mon, 23 Mar 2026 15:39:36 +0100 Subject: [PATCH 1/2] feat(typescript-client): add move-in event support and rename MoveOutPattern to MovePattern Extend EventMessage to accept both move-out and move-in events, add active_conditions to ChangeMessage headers, and rename MoveOutPattern to MovePattern (with deprecated alias for backwards compat). Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/typescript-client/src/types.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/typescript-client/src/types.ts b/packages/typescript-client/src/types.ts index 414fb1c563..a4cff5bee5 100644 --- a/packages/typescript-client/src/types.ts +++ b/packages/typescript-client/src/types.ts @@ -60,13 +60,16 @@ export type Operation = `insert` | `update` | `delete` export type MoveTag = string /** - * A move-out pattern is a position and a value. The position is the index of the column - * that is being moved out. The value is the value of the column that is being moved out. + * A move pattern is a position and a value. The position is the index of the column + * involved in the move. The value is the value of that column. * * Tag width and value order is fixed for a given shape, so the client can determine * which tags match this pattern. */ -export type MoveOutPattern = { pos: number; value: string } +export type MovePattern = { pos: number; value: string } + +/** @deprecated Use {@link MovePattern} instead */ +export type MoveOutPattern = MovePattern /** * Serialized expression types for structured subset queries. @@ -125,7 +128,7 @@ export type ControlMessage = { } export type EventMessage = { - headers: Header & { event: `move-out`; patterns: MoveOutPattern[] } + headers: Header & { event: `move-out` | `move-in`; patterns: MovePattern[] } } export type ChangeMessage = Row> = { @@ -138,6 +141,7 @@ export type ChangeMessage = Row> = { /** Tags will always be present for changes if the shape has a subquery in its where clause, and are omitted otherwise.*/ tags?: MoveTag[] removed_tags?: MoveTag[] + active_conditions?: boolean[] } } From 3bff19403ec2f06f978d1f87c1534f823b0ca7ae Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 24 Mar 2026 09:51:42 +0100 Subject: [PATCH 2/2] chore: add changeset for move-in event support Co-Authored-By: Claude Opus 4.6 (1M context) --- .changeset/move-in-event-support.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/move-in-event-support.md diff --git a/.changeset/move-in-event-support.md b/.changeset/move-in-event-support.md new file mode 100644 index 0000000000..ba81f8735d --- /dev/null +++ b/.changeset/move-in-event-support.md @@ -0,0 +1,5 @@ +--- +'@electric-sql/client': patch +--- + +Add move-in event support to the TypeScript client. Rename `MoveOutPattern` to `MovePattern` (with a deprecated alias for backwards compatibility), extend `EventMessage` to accept both `move-out` and `move-in` events, and add `active_conditions` field to `ChangeMessage` headers.