From 154c01d21caf3c6c7300f1b1aec0ba6a47ca1012 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 22 Jul 2025 22:55:34 -0400 Subject: [PATCH 01/37] Messing around with ts module api --- .../packages/sdk/src/algebraic_type.ts | 31 ++ sdks/typescript/packages/sdk/src/test.ts | 353 ++++++++++++++++++ 2 files changed, 384 insertions(+) create mode 100644 sdks/typescript/packages/sdk/src/test.ts diff --git a/sdks/typescript/packages/sdk/src/algebraic_type.ts b/sdks/typescript/packages/sdk/src/algebraic_type.ts index 0c9846fedeb..8ffbac4b42a 100644 --- a/sdks/typescript/packages/sdk/src/algebraic_type.ts +++ b/sdks/typescript/packages/sdk/src/algebraic_type.ts @@ -242,6 +242,37 @@ type AnyType = export type ComparablePrimitive = number | string | String | boolean | bigint; +type AT = + { tag: 'u8' } | + { tag: 'u16' } | + { tag: 'u32' } | + { tag: 'u64' } | + { tag: 'u128' } | + { tag: 'u256' } | + { tag: 'i8' } | + { tag: 'i16' } | + { tag: 'i32' } | + { tag: 'i64' } | + { tag: 'i128' } | + { tag: 'f32' } | + { tag: 'f64' } | + { tag: 'string' } | + { tag: 'bool' } | + { tag: 'product', value: PT } | + { tag: 'sum', value: ST }; + +type PT = { elements: { name: string, element: AT }[] }; +type ST = { variants: { tag: string, ty: AT }[] }; + +const at: AT = { + tag: 'product', + value: { + elements: [ + { name: '__identity__', element: { tag: 'u256' } }, + ], + }, +} + /** * The SpacetimeDB Algebraic Type System (SATS) is a structural type system in * which a nominal type system can be constructed. diff --git a/sdks/typescript/packages/sdk/src/test.ts b/sdks/typescript/packages/sdk/src/test.ts new file mode 100644 index 00000000000..3b0121f2351 --- /dev/null +++ b/sdks/typescript/packages/sdk/src/test.ts @@ -0,0 +1,353 @@ +import { AlgebraicType, ProductType, ProductTypeElement, SumTypeVariant } from "./algebraic_type"; + +type RawIdentifier = string; + +type AlgebraicTypeRef = number; + +type ColId = number; + +type ColList = ColId[]; + +type RawIndexAlgorithm = + { tag: "btree", value: { columns: ColList } } | + { tag: "hash", value: { columns: ColList } } | + { tag: "direct", value: { column: ColId } }; + +type Typespace = { + types: AlgebraicType[]; +} + +type RawIndexDefV9 = { + name?: string, + accessor_name?: RawIdentifier, + algorithm: RawIndexAlgorithm, +} + +type RawUniqueConstraintDataV9 = { columns: ColList }; + +type RawConstraintDataV9 = + { tag: "unique", value: RawUniqueConstraintDataV9 }; + +type RawConstraintDefV9 = { + name?: string, + data: RawConstraintDataV9, +} + +type RawSequenceDefV9 = { + name?: RawIdentifier, + column: ColId, + start?: number, + minValue?: number, + maxValue?: number, + increment: number +}; + +type TableType = "system" | "user"; +type TableAccess = "public" | "private"; + +type RawScheduleDefV9 = { + name?: RawIdentifier, + reducerName: RawIdentifier, + scheduledAtColumn: ColId, +}; + +type RawTableDefV9 = { + name: RawIdentifier, + productTypeRef: AlgebraicTypeRef, + primaryKey: ColList, + indexes: RawIndexDefV9[], + constraints: RawConstraintDefV9[], + sequences: RawSequenceDefV9[], + schedule?: RawScheduleDefV9, + tableType: TableType, + tableAccess: TableAccess, +}; + +type RawReducerDefV9 = { + name: RawIdentifier, + params: ProductType, + lifecycle?: "init" | "on_connect" | "on_disconnect", +} + +type RawScopedTypeNameV9 = { + name: RawIdentifier, + scope: RawIdentifier[], +} + +type RawTypeDefV9 = { + name: RawScopedTypeNameV9, + ty: AlgebraicTypeRef, + customOrdering: boolean, +} + +type RawMiscModuleExportV9 = never; + +type RawSql = string; +type RawRowLevelSecurityDefV9 = { + sql: RawSql +}; + +type RawModuleDef = { tag: "v8" } | { tag: "v9", value: RawModuleDefV9 }; + +type RawModuleDefV9 = { + typespace: Typespace, + tables: RawTableDefV9[], + reducers: RawReducerDefV9[], + types: RawTypeDefV9[], + miscExports: RawMiscModuleExportV9[], + rowLevelSecurity: RawRowLevelSecurityDefV9[], +} + +const moduleDef: RawModuleDefV9 = { + typespace: { types: [] }, + tables: [], + reducers: [], + types: [], + miscExports: [], + rowLevelSecurity: [], +} + +/* ---------- column builder ---------- */ +type Merge = M1 & Omit; + +export interface ColumnBuilder< + JS, // the JavaScript/TypeScript value type + M = {} // accumulated metadata: indexes, PKs, … +> { + /** phantom – gives the column’s JS type to the compiler */ + readonly __type__: JS; + readonly __spacetime_type__: AlgebraicType; + + index(name?: N): + ColumnBuilder>; + + primary_key(): + ColumnBuilder>; + + auto_inc(): + ColumnBuilder>; +} + +/* minimal runtime implementation – chainable, metadata ignored */ +function col< + JS, +>(__spacetime_type__: AlgebraicType): ColumnBuilder { + const c: any = { __spacetime_type__ }; + c.index = () => c; + c.primary_key = () => c; + c.auto_inc = () => c; + return c; +} + +/* ---------- primitive factories ---------- */ +export const t = { + /* ───── primitive scalars ───── */ + bool: (): ColumnBuilder => col(AlgebraicType.createBoolType()), + string: (): ColumnBuilder => col(AlgebraicType.createStringType()), + + /* integers share JS = number but differ in Kind */ + i8: (): ColumnBuilder => col(AlgebraicType.createI8Type()), + u8: (): ColumnBuilder => col(AlgebraicType.createU8Type()), + i16: (): ColumnBuilder => col(AlgebraicType.createI16Type()), + u16: (): ColumnBuilder => col(AlgebraicType.createU16Type()), + i32: (): ColumnBuilder => col(AlgebraicType.createI32Type()), + u32: (): ColumnBuilder => col(AlgebraicType.createU32Type()), + i64: (): ColumnBuilder => col(AlgebraicType.createI64Type()), + u64: (): ColumnBuilder => col(AlgebraicType.createU64Type()), + i128: (): ColumnBuilder => col(AlgebraicType.createI128Type()), + u128: (): ColumnBuilder => col(AlgebraicType.createU128Type()), + i256: (): ColumnBuilder => col(AlgebraicType.createI256Type()), + u256: (): ColumnBuilder => col(AlgebraicType.createU256Type()), + + f32: (): ColumnBuilder => col(AlgebraicType.createF32Type()), + f64: (): ColumnBuilder => col(AlgebraicType.createF64Type()), + + number: (): ColumnBuilder => col(AlgebraicType.createF64Type()), + + /* ───── structured builders ───── */ + object>>(def: Def) { + return { + ...col( + AlgebraicType.createProductType( + Object.entries(def).map(([n, c]) => + new ProductTypeElement(n, c.__spacetime_type__)) + ) + ), + __is_product_type__: true, + } as ProductTypeColumnBuilder; + }, + + array>(e: E): ColumnBuilder[]> { + return col[]>(AlgebraicType.createArrayType(e.__spacetime_type__)); + }, + + enum< + V extends Record>, + >(variants: V): ColumnBuilder< + { [K in keyof V]: { tag: K } & { value: Infer } }[keyof V] + > { + return col< + { [K in keyof V]: { tag: K } & { value: Infer } }[keyof V] + >( + AlgebraicType.createSumType( + Object.entries(variants).map( + ([n, c]) => new SumTypeVariant(n, c.__spacetime_type__) + ) + ) + ); + }, + +} as const; + +/* ─── brand marker ─────────────────────────── */ +interface ProductTypeBrand { + /** compile-time only – never set at runtime */ + readonly __is_product_type__: true; +} + +/* ─── helper for ColumnBuilder that carries the brand ───────────────── */ +export type ProductTypeColumnBuilder< + Def extends Record> +> = ColumnBuilder< + { [K in keyof Def]: ColumnType }> & ProductTypeBrand; + +/* ---------- utility: Infer ---------- */ +type ColumnType = + C extends ColumnBuilder ? JS : never; + +export type Infer = + S extends ColumnBuilder + ? JS + : never; + +/* ---------- table() ---------- */ +export function table< + Name extends string, + Schema extends ProductTypeColumnBuilder +>({ name, schema }: { name: Name, schema: Schema }) { + moduleDef.tables.push({ + name, + productTypeRef: moduleDef.typespace.types.length, + primaryKey: [], + indexes: [], + constraints: [], + sequences: [], + schedule: undefined, + tableType: "user", + tableAccess: "private", + }); + return { + index( + name: IName, + _def: I + ): undefined { + return void 0; + }, + }; +} + +/* ---------- reducer() ---------- */ +type ParamsAsObject

>> = { + [K in keyof P]: Infer; +}; + +export function reducer< + Name extends string, + Params extends Record>, + Ctx = unknown +>( + name: Name, + params: Params, + fn: (ctx: Ctx, payload: ParamsAsObject) => void, +): undefined { + /* compile‑time only */ + return void 0; +} + +/* ---------- procedure() ---------- */ +export function procedure< + Name extends string, + Params extends Record>, + Ctx, + R +>( + name: Name, + params: Params, + fn: (ctx: Ctx, payload: ParamsAsObject) => Promise | R, +): undefined { + return void 0; +} + +const point = t.object({ + x: t.f64(), + y: t.f64(), +}); +type Point = Infer; + +const user = t.object({ + id: t.string(), + name: t.string().index("btree"), + email: t.string(), + age: t.number(), +}); +type User = Infer; + +table("user", user); +table("logged_out_user", user); + +const player = t.object({ + id: t.u32().primary_key().auto_inc(), + name: t.string().index("btree"), + score: t.number(), + level: t.number(), + foo: t.number(), + bar: t.object({ + x: t.f64(), + y: t.f64(), + }), + baz: t.enum({ + Foo: t.f64(), + Bar: t.f64(), + Baz: t.string(), + }), +}); + +table("player", player).index("foobar", { + btree: { + columns: ["name", "score"], + } +}); + +reducer("move_player", { user, foo: point, player }, (ctx, { user, foo: Point, player }) => { + if (player.baz.tag === "Foo") { + player.baz.value += 1; + } else if (player.baz.tag === "Bar") { + player.baz.value += 2; + } else if (player.baz.tag === "Baz") { + player.baz.value += "!"; + } +}); + +procedure("get_user", { user }, async (ctx, { user }) => { + // return ctx.db.query("SELECT * FROM user WHERE id = ?", [user.id]); +}); + +////// + + +// const t = AlgebraicType; + +// function spacetimeType(foo: AlgebraicType) { + +// } + +// const Foo = spacetimeType(t.createProductType([ +// new ProductTypeElement("x", t.createSumType([ +// new SumTypeVariant("Bar1", t.createF64Type()), +// new SumTypeVariant("Bar2", t.createF64Type()), +// ])), +// new ProductTypeElement("y", t.createSumType([ +// new SumTypeVariant("Foo1", t.createF64Type()), +// new SumTypeVariant("Foo2", t.createF64Type()), +// ])), +// ])); \ No newline at end of file From ba163a8ce5cd6fb912099449b2a602ac97d17257 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Fri, 25 Jul 2025 11:19:56 -0400 Subject: [PATCH 02/37] Fixed schedule_at --- sdks/typescript/packages/sdk/src/schedule_at.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/typescript/packages/sdk/src/schedule_at.ts b/sdks/typescript/packages/sdk/src/schedule_at.ts index 0cbbac29448..46d978104ab 100644 --- a/sdks/typescript/packages/sdk/src/schedule_at.ts +++ b/sdks/typescript/packages/sdk/src/schedule_at.ts @@ -52,4 +52,4 @@ export namespace ScheduleAt { } export type ScheduleAt = ScheduleAt.Interval | ScheduleAt.Time; -export default ScheduleAt; +export default ScheduleAt; \ No newline at end of file From b2be35f9310e1847b324374683d9662b7cfc3f6a Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Mon, 18 Aug 2025 19:45:11 -0400 Subject: [PATCH 03/37] Splitting out into multiple libs from the sdk --- crates/bindings-typescript/LICENSE.txt | 1 + crates/bindings-typescript/package.json | 40 + .../src/algebraic_type.ts | 0 .../src/algebraic_value.ts | 0 .../bindings-typescript}/src/binary_reader.ts | 0 .../bindings-typescript}/src/binary_writer.ts | 0 .../bindings-typescript}/src/connection_id.ts | 0 .../bindings-typescript}/src/identity.ts | 2 - crates/bindings-typescript/src/index.ts | 11 + crates/bindings-typescript/src/reducers.ts | 40 + .../bindings-typescript}/src/schedule_at.ts | 0 crates/bindings-typescript/src/schema.ts | 717 ++++ .../bindings-typescript}/src/time_duration.ts | 0 .../bindings-typescript}/src/timestamp.ts | 0 .../bindings-typescript}/src/utils.ts | 0 .../pnpm-lock.yaml => pnpm-lock.yaml | 3348 ++++++----------- pnpm-workspace.yaml | 5 + sdks/typescript/packages/sdk/package.json | 3 +- .../packages/sdk/src/db_connection_builder.ts | 2 +- .../packages/sdk/src/db_connection_impl.ts | 15 +- sdks/typescript/packages/sdk/src/index.ts | 12 +- .../packages/sdk/src/message_types.ts | 6 +- .../packages/sdk/src/reducer_event.ts | 6 +- .../typescript/packages/sdk/src/serializer.ts | 6 +- .../packages/sdk/src/spacetime_module.ts | 2 +- .../packages/sdk/src/table_cache.ts | 2 +- sdks/typescript/packages/sdk/src/test.ts | 353 -- sdks/typescript/packages/sdk/tsconfig.json | 9 +- sdks/typescript/packages/sdk/tsup.config.ts | 90 + sdks/typescript/pnpm-workspace.yaml | 3 - sdks/typescript/tsup.config.ts | 56 - 31 files changed, 2178 insertions(+), 2551 deletions(-) create mode 120000 crates/bindings-typescript/LICENSE.txt create mode 100644 crates/bindings-typescript/package.json rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/algebraic_type.ts (100%) rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/algebraic_value.ts (100%) rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/binary_reader.ts (100%) rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/binary_writer.ts (100%) rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/connection_id.ts (100%) rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/identity.ts (92%) create mode 100644 crates/bindings-typescript/src/index.ts create mode 100644 crates/bindings-typescript/src/reducers.ts rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/schedule_at.ts (100%) create mode 100644 crates/bindings-typescript/src/schema.ts rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/time_duration.ts (100%) rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/timestamp.ts (100%) rename {sdks/typescript/packages/sdk => crates/bindings-typescript}/src/utils.ts (100%) rename sdks/typescript/pnpm-lock.yaml => pnpm-lock.yaml (51%) create mode 100644 pnpm-workspace.yaml delete mode 100644 sdks/typescript/packages/sdk/src/test.ts create mode 100644 sdks/typescript/packages/sdk/tsup.config.ts delete mode 100644 sdks/typescript/pnpm-workspace.yaml delete mode 100644 sdks/typescript/tsup.config.ts diff --git a/crates/bindings-typescript/LICENSE.txt b/crates/bindings-typescript/LICENSE.txt new file mode 120000 index 00000000000..1ef648f64b3 --- /dev/null +++ b/crates/bindings-typescript/LICENSE.txt @@ -0,0 +1 @@ +../../LICENSE.txt \ No newline at end of file diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json new file mode 100644 index 00000000000..a731498b684 --- /dev/null +++ b/crates/bindings-typescript/package.json @@ -0,0 +1,40 @@ +{ + "name": "spacetimedb", + "version": "0.0.1", + "description": "API and ABI bindings for the SpacetimeDB TypeScript module library", + "homepage": "https://github.com/clockworklabs/SpacetimeDB#readme", + "bugs": { "url": "https://github.com/clockworklabs/SpacetimeDB/issues" }, + + "source": "src/index.ts", + "main": "dist/index.cjs", + "module": "dist/index.mjs", + + "types": "src/index.ts", + "exports": { + ".": { + "types": "./src/index.ts", + "source": "./src/index.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + } + }, + + "files": ["src", "dist", "README.md", "LICENSE.txt"], + + "repository": { + "type": "git", + "url": "git+https://github.com/clockworklabs/SpacetimeDB.git" + }, + "license": "ISC", + "author": "Clockwork Labs", + "type": "module", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc -p tsconfig.build.json", + "prepack": "pnpm run build" + }, + "dependencies": { + "@zxing/text-encoding": "^0.9.0", + "base64-js": "^1.5.1" + } +} diff --git a/sdks/typescript/packages/sdk/src/algebraic_type.ts b/crates/bindings-typescript/src/algebraic_type.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/algebraic_type.ts rename to crates/bindings-typescript/src/algebraic_type.ts diff --git a/sdks/typescript/packages/sdk/src/algebraic_value.ts b/crates/bindings-typescript/src/algebraic_value.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/algebraic_value.ts rename to crates/bindings-typescript/src/algebraic_value.ts diff --git a/sdks/typescript/packages/sdk/src/binary_reader.ts b/crates/bindings-typescript/src/binary_reader.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/binary_reader.ts rename to crates/bindings-typescript/src/binary_reader.ts diff --git a/sdks/typescript/packages/sdk/src/binary_writer.ts b/crates/bindings-typescript/src/binary_writer.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/binary_writer.ts rename to crates/bindings-typescript/src/binary_writer.ts diff --git a/sdks/typescript/packages/sdk/src/connection_id.ts b/crates/bindings-typescript/src/connection_id.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/connection_id.ts rename to crates/bindings-typescript/src/connection_id.ts diff --git a/sdks/typescript/packages/sdk/src/identity.ts b/crates/bindings-typescript/src/identity.ts similarity index 92% rename from sdks/typescript/packages/sdk/src/identity.ts rename to crates/bindings-typescript/src/identity.ts index 9ce25dccbdc..41df6bbcedc 100644 --- a/sdks/typescript/packages/sdk/src/identity.ts +++ b/crates/bindings-typescript/src/identity.ts @@ -1,5 +1,3 @@ -import BinaryReader from './binary_reader'; -import BinaryWriter from './binary_writer'; import { hexStringToU256, u256ToHexString, u256ToUint8Array } from './utils'; /** diff --git a/crates/bindings-typescript/src/index.ts b/crates/bindings-typescript/src/index.ts new file mode 100644 index 00000000000..70ee6b7abbe --- /dev/null +++ b/crates/bindings-typescript/src/index.ts @@ -0,0 +1,11 @@ +export * from './connection_id'; +export * from './algebraic_type'; +export * from './algebraic_value'; +export { default as BinaryReader } from './binary_reader'; +export { default as BinaryWriter } from './binary_writer'; +export * from './schedule_at'; +export * from './time_duration'; +export * from './timestamp'; +export * from './utils'; +export * from './identity'; + diff --git a/crates/bindings-typescript/src/reducers.ts b/crates/bindings-typescript/src/reducers.ts new file mode 100644 index 00000000000..60e7fac51cf --- /dev/null +++ b/crates/bindings-typescript/src/reducers.ts @@ -0,0 +1,40 @@ +import { clientConnected, clientDisconnected, init, player, point, procedure, reducer, sendMessageSchedule, user, type Schema } from "./schema"; + +export const sendMessage = reducer( + 'send_message', + sendMessageSchedule, + (ctx, { scheduleId, scheduledAt, text }) => { + console.log(`Sending message: ${text} ${scheduleId}`); + } +); + +init('init', {}, ctx => { + console.log('Database initialized'); +}); + +clientConnected('on_connect', {}, ctx => { + console.log('Client connected'); +}); + +clientDisconnected('on_disconnect', {}, ctx => { + console.log('Client disconnected'); +}); + +reducer( + 'move_player', + { user, foo: point, player }, + (ctx, { user, foo: point, player }): void => { + ctx.db.player + if (player.baz.tag === 'Foo') { + player.baz.value += 1; + } else if (player.baz.tag === 'Bar') { + player.baz.value += 2; + } else if (player.baz.tag === 'Baz') { + player.baz.value += '!'; + } + } +); + +procedure('get_user', { user }, async (ctx, { user }) => { + console.log(user.email); +}); \ No newline at end of file diff --git a/sdks/typescript/packages/sdk/src/schedule_at.ts b/crates/bindings-typescript/src/schedule_at.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/schedule_at.ts rename to crates/bindings-typescript/src/schedule_at.ts diff --git a/crates/bindings-typescript/src/schema.ts b/crates/bindings-typescript/src/schema.ts new file mode 100644 index 00000000000..ae222689d89 --- /dev/null +++ b/crates/bindings-typescript/src/schema.ts @@ -0,0 +1,717 @@ +// import { +// AlgebraicType, +// ProductType, +// ProductTypeElement, +// SumTypeVariant, +// } from './algebraic_type'; +// import { sendMessage } from './reducers'; + +// type RawIdentifier = string; + +// type AlgebraicTypeRef = number; + +// type ColId = number; + +// type ColList = ColId[]; + +// type RawIndexAlgorithm = +// | { tag: 'btree'; value: { columns: ColList } } +// | { tag: 'hash'; value: { columns: ColList } } +// | { tag: 'direct'; value: { column: ColId } }; + +// type Typespace = { +// types: AlgebraicType[]; +// }; + +// type RawIndexDefV9 = { +// name?: string; +// accessor_name?: RawIdentifier; +// algorithm: RawIndexAlgorithm; +// }; + +// type RawUniqueConstraintDataV9 = { columns: ColList }; + +// type RawConstraintDataV9 = { tag: 'unique'; value: RawUniqueConstraintDataV9 }; + +// type RawConstraintDefV9 = { +// name?: string; +// data: RawConstraintDataV9; +// }; + +// type RawSequenceDefV9 = { +// name?: RawIdentifier; +// column: ColId; +// start?: number; +// minValue?: number; +// maxValue?: number; +// increment: number; +// }; + +// type TableType = 'system' | 'user'; +// type TableAccess = 'public' | 'private'; + +// type RawScheduleDefV9 = { +// name?: RawIdentifier; +// reducerName: RawIdentifier; +// scheduledAtColumn: ColId; +// }; + +// type RawTableDefV9 = { +// name: RawIdentifier; +// productTypeRef: AlgebraicTypeRef; +// primaryKey: ColList; +// indexes: RawIndexDefV9[]; +// constraints: RawConstraintDefV9[]; +// sequences: RawSequenceDefV9[]; +// schedule?: RawScheduleDefV9; +// tableType: TableType; +// tableAccess: TableAccess; +// }; + +// type RawReducerDefV9 = { +// name: RawIdentifier; +// params: ProductType; +// lifecycle?: 'init' | 'on_connect' | 'on_disconnect'; +// }; + +// type RawScopedTypeNameV9 = { +// name: RawIdentifier; +// scope: RawIdentifier[]; +// }; + +// type RawTypeDefV9 = { +// name: RawScopedTypeNameV9; +// ty: AlgebraicTypeRef; +// customOrdering: boolean; +// }; + +// type RawMiscModuleExportV9 = never; + +// type RawSql = string; +// type RawRowLevelSecurityDefV9 = { +// sql: RawSql; +// }; + +// type RawModuleDefV9 = { +// typespace: Typespace; +// tables: RawTableDefV9[]; +// reducers: RawReducerDefV9[]; +// types: RawTypeDefV9[]; +// miscExports: RawMiscModuleExportV9[]; +// rowLevelSecurity: RawRowLevelSecurityDefV9[]; +// }; + +// /***************************************************************** +// * shared helpers +// *****************************************************************/ +// type Merge = M1 & Omit; +// type Values = T[keyof T]; + +// /***************************************************************** +// * the run‑time catalogue that we are filling +// *****************************************************************/ +// export const MODULE_DEF: RawModuleDefV9 = { +// typespace: { types: [] }, +// tables: [], +// reducers: [], +// types: [], +// miscExports: [], +// rowLevelSecurity: [], +// }; + +// /***************************************************************** +// * ColumnBuilder – holds the JS type + Spacetime type + metadata +// *****************************************************************/ +// export interface ColumnBuilder< +// /** JS / TS visible type */ JS, +// /** accumulated column metadata */ M = {}, +// > { +// /** phantom – exposes the JS type to the compiler only */ +// readonly __type__: JS; +// /** the SpacetimeDB algebraic type (run‑time value) */ +// readonly __spacetime_type__: AlgebraicType; +// /** plain JS object where we accumulate column metadata */ +// readonly __meta__: M; + +// /** —— builder combinators ——————————————— */ +// index( +// algorithm?: N // default = "btree" +// ): ColumnBuilder>; + +// primary_key(): ColumnBuilder>; +// unique(): ColumnBuilder>; +// auto_inc(): ColumnBuilder>; +// } + +// /** create the concrete (but still opaque) builder object */ +// function col(__spacetime_type__: AlgebraicType): ColumnBuilder { +// const c: any = { +// __spacetime_type__, +// __meta__: {}, +// }; + +// /** all mutators simply stamp metadata and re‑use the same object */ +// c.index = (algo: any = 'btree') => { +// c.__meta__.index = algo; +// return c; +// }; +// c.primary_key = () => { +// c.__meta__.primaryKey = true; +// return c; +// }; +// c.unique = () => { +// c.__meta__.unique = true; +// return c; +// }; +// c.auto_inc = () => { +// c.__meta__.autoInc = true; +// return c; +// }; + +// return c; +// } + +// /***************************************************************** +// * Primitive factories – unchanged except we add scheduleAt() +// *****************************************************************/ +// export const t = { +// /* ───── primitive scalars ───── */ +// bool: (): ColumnBuilder => col(AlgebraicType.createBoolType()), +// string: (): ColumnBuilder => col(AlgebraicType.createStringType()), +// number: (): ColumnBuilder => col(AlgebraicType.createF64Type()), + +// /* integers share JS = number but differ in Kind */ +// i8: (): ColumnBuilder => col(AlgebraicType.createI8Type()), +// u8: (): ColumnBuilder => col(AlgebraicType.createU8Type()), +// i16: (): ColumnBuilder => col(AlgebraicType.createI16Type()), +// u16: (): ColumnBuilder => col(AlgebraicType.createU16Type()), +// i32: (): ColumnBuilder => col(AlgebraicType.createI32Type()), +// u32: (): ColumnBuilder => col(AlgebraicType.createU32Type()), +// i64: (): ColumnBuilder => col(AlgebraicType.createI64Type()), +// u64: (): ColumnBuilder => col(AlgebraicType.createU64Type()), +// i128: (): ColumnBuilder => col(AlgebraicType.createI128Type()), +// u128: (): ColumnBuilder => col(AlgebraicType.createU128Type()), +// i256: (): ColumnBuilder => col(AlgebraicType.createI256Type()), +// u256: (): ColumnBuilder => col(AlgebraicType.createU256Type()), + +// f32: (): ColumnBuilder => col(AlgebraicType.createF32Type()), +// f64: (): ColumnBuilder => col(AlgebraicType.createF64Type()), + +// /* ───── structured builders ───── */ +// object>>(def: Def): ProductTypeColumnBuilder { +// const productTy = AlgebraicType.createProductType( +// Object.entries(def).map( +// ([n, c]) => new ProductTypeElement(n, c.__spacetime_type__) +// ) +// ); +// /** carry the *definition* alongside so `table()` can introspect */ +// return Object.assign( +// col<{ [K in keyof Def]: ColumnType }>(productTy), +// { +// __is_product_type__: true as const, +// __def__: def, +// } +// ) as ProductTypeColumnBuilder; +// }, + +// array>(e: E): ColumnBuilder[]> { +// return col[]>(AlgebraicType.createArrayType(e.__spacetime_type__)); +// }, + +// enum>>( +// variants: V +// ): ColumnBuilder< +// { +// [K in keyof V]: { +// tag: K; +// value: Infer; +// }; +// }[keyof V] +// > { +// const ty = AlgebraicType.createSumType( +// Object.entries(variants).map( +// ([n, c]) => new SumTypeVariant(n, c.__spacetime_type__) +// ) +// ); +// type JS = { [K in keyof V]: { tag: K; value: Infer } }[keyof V]; +// return col(ty); +// }, + +// /* ───── scheduling helper ───── */ +// scheduleAt() { +// /* we model it as a 64‑bit timestamp for now */ +// const b = col(AlgebraicType.createI64Type()); +// b.interval = (isoLike: string) => { +// b.__meta__.scheduleAt = isoLike; // remember interval +// return b; +// }; +// return b as ColumnBuilder & { +// /** chainable convenience to attach the run‑time interval */ +// interval: (isoLike: string) => typeof b; +// }; +// }, + +// /* ───── generic index‑builder to be used in table options ───── */ +// index(opts?: { +// name?: IdxName; +// }): { +// btree(def: { +// columns: Cols; +// }): PendingIndex<(typeof def.columns)[number]>; +// hash(def: { +// columns: Cols; +// }): PendingIndex<(typeof def.columns)[number]>; +// direct(def: { column: Col }): PendingIndex; +// } { +// const common = { name: opts?.name }; +// return { +// btree(def: { columns: Cols }) { +// return { +// ...common, +// algorithm: { +// tag: 'btree', +// value: { columns: def.columns }, +// }, +// } as PendingIndex<(typeof def.columns)[number]>; +// }, +// hash(def: { columns: Cols }) { +// return { +// ...common, +// algorithm: { +// tag: 'hash', +// value: { columns: def.columns }, +// }, +// } as PendingIndex<(typeof def.columns)[number]>; +// }, +// direct(def: { column: Col }) { +// return { +// ...common, +// algorithm: { +// tag: 'direct', +// value: { column: def.column }, +// }, +// } as PendingIndex; +// }, +// }; +// }, +// } as const; + +// /***************************************************************** +// * Type helpers +// *****************************************************************/ +// interface ProductTypeBrand { +// readonly __is_product_type__: true; +// } + +// export type ProductTypeColumnBuilder< +// Def extends Record>, +// > = ColumnBuilder<{ [K in keyof Def]: ColumnType }> & +// ProductTypeBrand & { __def__: Def }; + +// type ColumnType = C extends ColumnBuilder ? JS : never; +// export type Infer = S extends ColumnBuilder ? JS : never; + +// /***************************************************************** +// * Index helper type used *inside* table() to enforce that only +// * existing column names are referenced. +// *****************************************************************/ +// type PendingIndex = { +// name?: string; +// accessor_name?: string; +// algorithm: +// | { tag: 'btree'; value: { columns: readonly AllowedCol[] } } +// | { tag: 'hash'; value: { columns: readonly AllowedCol[] } } +// | { tag: 'direct'; value: { column: AllowedCol } }; +// }; + +// /***************************************************************** +// * table() +// *****************************************************************/ +// type TableOpts< +// N extends string, +// Def extends Record>, +// Idx extends PendingIndex[] | undefined = undefined, +// > = { +// name: N; +// public?: boolean; +// indexes?: Idx; // declarative multi‑column indexes +// scheduled?: string; // reducer name for cron‑like tables +// }; + +// /** Opaque handle that `table()` returns, carrying row & type info for `schema()` */ +// type TableHandle = { +// readonly __table_name__: string; +// /** algebraic type for the *row* product type */ +// readonly __row_spacetime_type__: AlgebraicType; +// /** phantom only: row JS shape */ +// readonly __row_js__?: Row; +// }; + +// /** Infer the JS row type from a TableHandle */ +// type RowOf = H extends TableHandle ? R : never; + +// export function table< +// Name extends string, +// Def extends Record>, +// Row extends ProductTypeColumnBuilder, +// Idx extends PendingIndex[] | undefined = undefined, +// >( +// opts: TableOpts, +// row: Row +// ): TableHandle> { +// const { +// name, +// public: isPublic = false, +// indexes: userIndexes = [], +// scheduled, +// } = opts; + +// /** 1. column catalogue + helpers */ +// const def = row.__def__; +// const colIds = new Map(); +// const colIdList: ColList = []; + +// let nextCol: number = 0; +// for (const colName of Object.keys(def) as (keyof Def & string)[]) { +// colIds.set(colName, nextCol++); +// colIdList.push(colIds.get(colName)!); +// } + +// /** 2. gather primary keys, per‑column indexes, uniques, sequences */ +// const pk: ColList = []; +// const indexes: RawIndexDefV9[] = []; +// const constraints: RawConstraintDefV9[] = []; +// const sequences: RawSequenceDefV9[] = []; + +// let scheduleAtCol: ColId | undefined; + +// for (const [name, builder] of Object.entries(def) as [ +// keyof Def & string, +// ColumnBuilder, +// ][]) { +// const meta: any = builder.__meta__; + +// /* primary key */ +// if (meta.primaryKey) pk.push(colIds.get(name)!); + +// /* implicit 1‑column indexes */ +// if (meta.index) { +// const algo = (meta.index ?? 'btree') as 'btree' | 'hash' | 'direct'; +// const id = colIds.get(name)!; +// indexes.push( +// algo === 'direct' +// ? { algorithm: { tag: 'direct', value: { column: id } } } +// : { algorithm: { tag: algo, value: { columns: [id] } } } +// ); +// } + +// /* uniqueness */ +// if (meta.unique) { +// constraints.push({ +// data: { tag: 'unique', value: { columns: [colIds.get(name)!] } }, +// }); +// } + +// /* auto increment */ +// if (meta.autoInc) { +// sequences.push({ +// column: colIds.get(name)!, +// increment: 1, +// }); +// } + +// /* scheduleAt */ +// if (meta.scheduleAt) scheduleAtCol = colIds.get(name)!; +// } + +// /** 3. convert explicit multi‑column indexes coming from options.indexes */ +// for (const pending of (userIndexes ?? []) as PendingIndex< +// keyof Def & string +// >[]) { +// const converted: RawIndexDefV9 = { +// name: pending.name, +// accessor_name: pending.accessor_name, +// algorithm: ((): RawIndexAlgorithm => { +// if (pending.algorithm.tag === 'direct') +// return { +// tag: 'direct', +// value: { column: colIds.get(pending.algorithm.value.column)! }, +// }; +// return { +// tag: pending.algorithm.tag, +// value: { +// columns: pending.algorithm.value.columns.map(c => colIds.get(c)!), +// }, +// }; +// })(), +// }; +// indexes.push(converted); +// } + +// /** 4. add the product type to the global Typespace */ +// const productTypeRef: AlgebraicTypeRef = MODULE_DEF.typespace.types.length; +// MODULE_DEF.typespace.types.push(row.__spacetime_type__); + +// /** 5. finalise table record */ +// MODULE_DEF.tables.push({ +// name, +// productTypeRef, +// primaryKey: pk, +// indexes, +// constraints, +// sequences, +// schedule: +// scheduled && scheduleAtCol !== undefined +// ? { +// reducerName: scheduled, +// scheduledAtColumn: scheduleAtCol, +// } +// : undefined, +// tableType: 'user', +// tableAccess: isPublic ? 'public' : 'private', +// }); + +// // NEW: return a typed handle for schema() +// return { +// __table_name__: name, +// __row_spacetime_type__: row.__spacetime_type__, +// } as TableHandle>; +// } + +// /** schema() – consume a record of TableHandles and return a ColumnBuilder +// * whose JS type is a map of table -> row shape. +// */ +// export function schema< +// Def extends Record> +// >(def: Def) { +// // Build a Spacetime product type keyed by table name -> row algebraic type +// const productTy = AlgebraicType.createProductType( +// Object.entries(def).map( +// ([name, handle]) => +// new ProductTypeElement(name, (handle as TableHandle).__row_spacetime_type__) +// ) +// ); + +// // The JS-level type: { [table]: RowOf } +// type JS = { [K in keyof Def]: RowOf }; + +// // Return a regular ColumnBuilder so you can `Infer` cleanly +// return col(productTy); +// } + +// /***************************************************************** +// * reducer() +// *****************************************************************/ +// type ParamsAsObject>> = { +// [K in keyof ParamDef]: Infer; +// }; + +// /***************************************************************** +// * procedure() +// * +// * Stored procedures are opaque to the DB engine itself, so we just +// * keep them out of `RawModuleDefV9` for now – you can forward‑declare +// * a companion `RawMiscModuleExportV9` type later if desired. +// *****************************************************************/ +// export function procedure< +// Name extends string, +// Params extends Record>, +// Ctx, +// R, +// >( +// _name: Name, +// _params: Params, +// _fn: (ctx: Ctx, payload: ParamsAsObject) => Promise | R +// ): void { +// /* nothing to push yet — left for your misc export section */ +// } + +// /***************************************************************** +// * internal: pushReducer() helper used by reducer() and lifecycle wrappers +// *****************************************************************/ +// function pushReducer< +// S, +// Name extends string = string, +// Params extends Record> = Record> +// >( +// name: Name, +// params: Params | ProductTypeColumnBuilder, +// lifecycle?: RawReducerDefV9['lifecycle'] +// ): void { +// // Allow either a product-type ColumnBuilder or a plain params object +// const paramsInternal: Params = +// (params as any).__is_product_type__ === true +// ? (params as ProductTypeColumnBuilder).__def__ +// : (params as Params); + +// const paramType = new ProductType( +// Object.entries(paramsInternal).map( +// ([n, c]) => new ProductTypeElement(n, (c as ColumnBuilder).__spacetime_type__) +// ) +// ); + +// MODULE_DEF.reducers.push({ +// name, +// params: paramType, +// lifecycle, // <- lifecycle flag lands here +// }); +// } + +// /***************************************************************** +// * reducer() – leave behavior the same; delegate to pushReducer() +// *****************************************************************/ +// /** DB API you want inside reducers */ +// type TableApi = { +// insert: (row: Row) => void | Promise; +// // You can add more later: get, update, delete, where, etc. +// }; + +// /** Reducer context parametrized by the inferred Schema */ +// export type ReducerCtx = { +// db: { [K in keyof S & string]: TableApi }; +// }; + +// // no schema provided -> ctx.db is permissive +// export function reducer< +// Name extends string = string, +// Params extends Record> = Record>, +// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void +// >( +// name: Name, +// params: Params | ProductTypeColumnBuilder, +// fn: F +// ): F; + +// // schema provided -> ctx.db is precise +// export function reducer< +// S, +// Name extends string = string, +// Params extends Record> = Record>, +// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void +// >( +// name: Name, +// params: Params | ProductTypeColumnBuilder, +// fn: F +// ): F; + +// // single implementation (S defaults to any -> JS-like) +// export function reducer< +// S = any, +// Name extends string = string, +// Params extends Record> = Record>, +// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void +// >( +// name: Name, +// params: Params | ProductTypeColumnBuilder, +// fn: F +// ): F { +// pushReducer(name, params); +// return fn; +// } + +// /***************************************************************** +// * Lifecycle reducers +// * - register with lifecycle: 'init' | 'on_connect' | 'on_disconnect' +// * - keep the same call shape you’re already using +// *****************************************************************/ +// export function init< +// S = unknown, +// Params extends Record> = {}, +// >( +// name: 'init' = 'init', +// params: Params | ProductTypeColumnBuilder = {} as any, +// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void +// ): void { +// pushReducer(name, params, 'init'); +// } + +// export function clientConnected< +// S = unknown, +// Params extends Record> = {}, +// >( +// name: 'on_connect' = 'on_connect', +// params: Params | ProductTypeColumnBuilder = {} as any, +// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void +// ): void { +// pushReducer(name, params, 'on_connect'); +// } + +// export function clientDisconnected< +// S = unknown, +// Params extends Record> = {}, +// >( +// name: 'on_disconnect' = 'on_disconnect', +// params: Params | ProductTypeColumnBuilder = {} as any, +// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void +// ): void { +// pushReducer(name, params, 'on_disconnect'); +// } + +// /***************************************************************** +// * Example usage +// *****************************************************************/ + +// export const point = t.object({ +// x: t.f64(), +// y: t.f64(), +// }); +// type Point = Infer; + +// export const user = t.object({ +// id: t.string().primary_key(), +// name: t.string().index('btree'), +// email: t.string(), +// age: t.number(), +// }); +// type User = Infer; + +// export const player = t.object({ +// id: t.u32().primary_key().auto_inc(), +// name: t.string().index('btree'), +// score: t.number(), +// level: t.number(), +// foo: t.number().unique(), +// bar: t.object({ +// x: t.f64(), +// y: t.f64(), +// }), +// baz: t.enum({ +// Foo: t.f64(), +// Bar: t.f64(), +// Baz: t.string(), +// }), +// }); + +// export const sendMessageSchedule = t.object({ +// scheduleId: t.u64().primary_key(), +// scheduledAt: t.scheduleAt().interval('1h'), +// text: t.string(), +// }); + +// const s = schema({ +// user: table({ name: 'user' }, user), +// logged_out_user: table({ name: 'logged_out_user' }, user), +// player: table( +// { +// name: 'player', +// public: true, +// indexes: [ +// t.index({ name: 'my_index' }).btree({ columns: ['name', 'score'] }), +// ], +// }, +// player +// ), +// send_message_schedule: table( +// { +// name: 'send_message_schedule', +// scheduled: sendMessage, +// }, +// sendMessageSchedule +// ) +// }); + +// export type Schema = Infer; + +// export const func = () => { +// return "asdf"; +// } \ No newline at end of file diff --git a/sdks/typescript/packages/sdk/src/time_duration.ts b/crates/bindings-typescript/src/time_duration.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/time_duration.ts rename to crates/bindings-typescript/src/time_duration.ts diff --git a/sdks/typescript/packages/sdk/src/timestamp.ts b/crates/bindings-typescript/src/timestamp.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/timestamp.ts rename to crates/bindings-typescript/src/timestamp.ts diff --git a/sdks/typescript/packages/sdk/src/utils.ts b/crates/bindings-typescript/src/utils.ts similarity index 100% rename from sdks/typescript/packages/sdk/src/utils.ts rename to crates/bindings-typescript/src/utils.ts diff --git a/sdks/typescript/pnpm-lock.yaml b/pnpm-lock.yaml similarity index 51% rename from sdks/typescript/pnpm-lock.yaml rename to pnpm-lock.yaml index 3b8919b815a..a2d3255c7ac 100644 --- a/sdks/typescript/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,37 +6,46 @@ settings: importers: - .: + crates/bindings-typescript: + dependencies: + '@zxing/text-encoding': + specifier: ^0.9.0 + version: 0.9.0 + base64-js: + specifier: ^1.5.1 + version: 1.5.1 + + sdks/typescript: devDependencies: '@changesets/changelog-github': specifier: ^0.5.0 - version: 0.5.0 + version: 0.5.1 '@changesets/cli': specifier: ^2.27.7 - version: 2.27.9 + version: 2.29.6(@types/node@24.3.0) brotli-size-cli: specifier: ^1.0.0 version: 1.0.0 prettier: specifier: ^3.3.3 - version: 3.3.3 + version: 3.6.2 terser: specifier: ^5.31.2 - version: 5.34.1 + version: 5.43.1 tsup: specifier: ^8.1.0 - version: 8.3.0(postcss@8.5.1)(tsx@4.19.1)(typescript@5.6.2) + version: 8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.6.3) tsx: specifier: ^4.17.0 - version: 4.19.1 + version: 4.20.4 typescript: specifier: ^5.5.3 - version: 5.6.2 + version: 5.6.3 vitest: specifier: ^2.0.3 - version: 2.1.2(@types/node@22.15.0)(jsdom@26.0.0)(terser@5.34.1) + version: 2.1.9(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1) - examples/quickstart-chat: + sdks/typescript/examples/quickstart-chat: dependencies: '@clockworklabs/spacetimedb-sdk': specifier: workspace:* @@ -50,125 +59,54 @@ importers: devDependencies: '@eslint/js': specifier: ^9.17.0 - version: 9.18.0 - '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 - '@testing-library/react': - specifier: ^16.2.0 - version: 16.2.0(@testing-library/dom@10.4.0)(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@testing-library/user-event': - specifier: ^14.6.1 - version: 14.6.1(@testing-library/dom@10.4.0) - '@types/jest': - specifier: ^29.5.14 - version: 29.5.14 - '@types/react': - specifier: ^18.3.18 - version: 18.3.18 - '@types/react-dom': - specifier: ^18.3.5 - version: 18.3.5(@types/react@18.3.18) - '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.3.4(vite@6.0.11(@types/node@22.15.0)(terser@5.34.1)(tsx@4.19.1)) - eslint: - specifier: ^9.17.0 - version: 9.18.0 - eslint-plugin-react-hooks: - specifier: ^5.0.0 - version: 5.1.0(eslint@9.18.0) - eslint-plugin-react-refresh: - specifier: ^0.4.16 - version: 0.4.18(eslint@9.18.0) - globals: - specifier: ^15.14.0 - version: 15.14.0 - jsdom: - specifier: ^26.0.0 - version: 26.0.0 - typescript: - specifier: ~5.6.2 - version: 5.6.2 - typescript-eslint: - specifier: ^8.18.2 - version: 8.21.0(eslint@9.18.0)(typescript@5.6.2) - vite: - specifier: ^6.0.5 - version: 6.0.11(@types/node@22.15.0)(terser@5.34.1)(tsx@4.19.1) - - examples/repro-07032025: - dependencies: - '@clockworklabs/spacetimedb-sdk': - specifier: workspace:* - version: link:../../packages/sdk - devDependencies: - '@types/node': - specifier: ^22.13.9 - version: 22.15.0 - ts-node: - specifier: ^10.9.2 - version: 10.9.2(@types/node@22.15.0)(typescript@5.8.3) - typescript: - specifier: ^5.8.2 - version: 5.8.3 - - examples/repro2: - dependencies: - '@clockworklabs/spacetimedb-sdk': - specifier: workspace:* - version: link:../../packages/sdk - devDependencies: - '@eslint/js': - specifier: ^9.17.0 - version: 9.18.0 + version: 9.33.0 '@testing-library/jest-dom': specifier: ^6.6.3 - version: 6.6.3 + version: 6.7.0 '@testing-library/react': specifier: ^16.2.0 - version: 16.2.0(@testing-library/dom@10.4.0)(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@testing-library/user-event': specifier: ^14.6.1 - version: 14.6.1(@testing-library/dom@10.4.0) + version: 14.6.1(@testing-library/dom@10.4.1) '@types/jest': specifier: ^29.5.14 version: 29.5.14 '@types/react': specifier: ^18.3.18 - version: 18.3.18 + version: 18.3.23 '@types/react-dom': specifier: ^18.3.5 - version: 18.3.5(@types/react@18.3.18) + version: 18.3.7(@types/react@18.3.23) '@vitejs/plugin-react': specifier: ^4.3.4 - version: 4.3.4(vite@6.0.11(@types/node@22.15.0)(terser@5.34.1)(tsx@4.19.1)) + version: 4.7.0(vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4)) eslint: specifier: ^9.17.0 - version: 9.18.0 + version: 9.33.0 eslint-plugin-react-hooks: specifier: ^5.0.0 - version: 5.1.0(eslint@9.18.0) + version: 5.2.0(eslint@9.33.0) eslint-plugin-react-refresh: specifier: ^0.4.16 - version: 0.4.18(eslint@9.18.0) + version: 0.4.20(eslint@9.33.0) globals: specifier: ^15.14.0 - version: 15.14.0 + version: 15.15.0 jsdom: specifier: ^26.0.0 - version: 26.0.0 + version: 26.1.0 typescript: specifier: ~5.6.2 - version: 5.6.2 + version: 5.6.3 typescript-eslint: specifier: ^8.18.2 - version: 8.21.0(eslint@9.18.0)(typescript@5.6.2) + version: 8.40.0(eslint@9.33.0)(typescript@5.6.3) vite: specifier: ^6.0.5 - version: 6.0.11(@types/node@22.15.0)(terser@5.34.1)(tsx@4.19.1) + version: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) - packages/sdk: + sdks/typescript/packages/sdk: dependencies: '@zxing/text-encoding': specifier: ^0.9.0 @@ -176,18 +114,21 @@ importers: base64-js: specifier: ^1.5.1 version: 1.5.1 + spacetimedb: + specifier: workspace:^ + version: link:../../../../crates/bindings-typescript devDependencies: '@clockworklabs/test-app': - specifier: file:../test-app - version: file:packages/test-app + specifier: workspace:^ + version: link:../test-app tsup: specifier: ^8.1.0 - version: 8.3.0(postcss@8.5.1)(tsx@4.19.1)(typescript@5.8.3) + version: 8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.6.3) undici: specifier: ^6.19.2 - version: 6.19.8 + version: 6.21.3 - packages/test-app: + sdks/typescript/packages/test-app: dependencies: '@clockworklabs/spacetimedb-sdk': specifier: workspace:* @@ -201,296 +142,206 @@ importers: devDependencies: '@types/react': specifier: ^18.3.3 - version: 18.3.11 + version: 18.3.23 '@types/react-dom': specifier: ^18.3.0 - version: 18.3.0 + version: 18.3.7(@types/react@18.3.23) '@vitejs/plugin-react': specifier: ^4.3.1 - version: 4.3.2(vite@5.4.8(@types/node@22.15.0)(terser@5.34.1)) + version: 4.7.0(vite@5.4.19(@types/node@24.3.0)(terser@5.43.1)) typescript: specifier: ^5.2.2 - version: 5.6.2 + version: 5.6.3 vite: specifier: ^5.3.4 - version: 5.4.8(@types/node@22.15.0)(terser@5.34.1) + version: 5.4.19(@types/node@24.3.0)(terser@5.43.1) packages: - '@adobe/css-tools@4.4.1': - resolution: {integrity: sha512-12WGKBQzjUAI4ayyF4IAtfw2QR/IDoqk6jTddXDhtYTJF9ASmoE1zst7cVtP0aL/F1jUJL5r+JxKXKEgHNbEUQ==} + '@adobe/css-tools@4.4.4': + resolution: {integrity: sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==} '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@asamuzakjp/css-color@2.8.3': - resolution: {integrity: sha512-GIc76d9UI1hCvOATjZPyHFmE5qhRccp3/zGfMPapK3jBi+yocEzp6BBB0UnfRYP9NP4FANqUZYb0hnfs3TM3hw==} + '@asamuzakjp/css-color@3.2.0': + resolution: {integrity: sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==} - '@babel/code-frame@7.25.7': - resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==} + '@babel/code-frame@7.27.1': + resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} - '@babel/code-frame@7.26.2': - resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} + '@babel/compat-data@7.28.0': + resolution: {integrity: sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.25.7': - resolution: {integrity: sha512-9ickoLz+hcXCeh7jrcin+/SLWm+GkxE2kTvoYyp38p4WkdFXfQJxDFGWp/YHjiKLPx06z2A7W8XKuqbReXDzsw==} + '@babel/core@7.28.3': + resolution: {integrity: sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.26.5': - resolution: {integrity: sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg==} + '@babel/generator@7.28.3': + resolution: {integrity: sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw==} engines: {node: '>=6.9.0'} - '@babel/core@7.25.7': - resolution: {integrity: sha512-yJ474Zv3cwiSOO9nXJuqzvwEeM+chDuQ8GJirw+pZ91sCGCyOZ3dJkVE09fTV0VEVzXyLWhh3G/AolYTPX7Mow==} + '@babel/helper-compilation-targets@7.27.2': + resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} engines: {node: '>=6.9.0'} - '@babel/core@7.26.0': - resolution: {integrity: sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==} + '@babel/helper-globals@7.28.0': + resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} engines: {node: '>=6.9.0'} - '@babel/generator@7.25.7': - resolution: {integrity: sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==} + '@babel/helper-module-imports@7.27.1': + resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} engines: {node: '>=6.9.0'} - '@babel/generator@7.26.5': - resolution: {integrity: sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-compilation-targets@7.25.7': - resolution: {integrity: sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==} - engines: {node: '>=6.9.0'} - - '@babel/helper-compilation-targets@7.26.5': - resolution: {integrity: sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-imports@7.25.7': - resolution: {integrity: sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-imports@7.25.9': - resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-transforms@7.25.7': - resolution: {integrity: sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-module-transforms@7.26.0': - resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==} + '@babel/helper-module-transforms@7.28.3': + resolution: {integrity: sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-plugin-utils@7.25.7': - resolution: {integrity: sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-plugin-utils@7.26.5': - resolution: {integrity: sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-simple-access@7.25.7': - resolution: {integrity: sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.25.7': - resolution: {integrity: sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.25.9': - resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.25.7': - resolution: {integrity: sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.25.9': - resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-option@7.25.7': - resolution: {integrity: sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==} + '@babel/helper-plugin-utils@7.27.1': + resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.25.9': - resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==} + '@babel/helper-string-parser@7.27.1': + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.25.7': - resolution: {integrity: sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==} + '@babel/helper-validator-identifier@7.27.1': + resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.26.0': - resolution: {integrity: sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==} + '@babel/helper-validator-option@7.27.1': + resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.25.7': - resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==} + '@babel/helpers@7.28.3': + resolution: {integrity: sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==} engines: {node: '>=6.9.0'} - '@babel/parser@7.25.7': - resolution: {integrity: sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==} + '@babel/parser@7.28.3': + resolution: {integrity: sha512-7+Ey1mAgYqFAx2h0RuoxcQT5+MlG3GTV0TQrgr7/ZliKsm/MNDxVVutlWaziMq7wJNAz8MTqz55XLpWvva6StA==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/parser@7.26.5': - resolution: {integrity: sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/plugin-transform-react-jsx-self@7.25.7': - resolution: {integrity: sha512-JD9MUnLbPL0WdVK8AWC7F7tTG2OS6u/AKKnsK+NdRhUiVdnzyR1S3kKQCaRLOiaULvUiqK6Z4JQE635VgtCFeg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-react-jsx-self@7.25.9': - resolution: {integrity: sha512-y8quW6p0WHkEhmErnfe58r7x0A70uKphQm8Sp8cV7tjNQwK56sNVK0M73LK3WuYmsuyrftut4xAkjjgU0twaMg==} + '@babel/plugin-transform-react-jsx-self@7.27.1': + resolution: {integrity: sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx-source@7.25.7': - resolution: {integrity: sha512-S/JXG/KrbIY06iyJPKfxr0qRxnhNOdkNXYBl/rmwgDd72cQLH9tEGkDm/yJPGvcSIUoikzfjMios9i+xT/uv9w==} + '@babel/plugin-transform-react-jsx-source@7.27.1': + resolution: {integrity: sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx-source@7.25.9': - resolution: {integrity: sha512-+iqjT8xmXhhYv4/uiYd8FNQsraMFZIfxVSqxxVSZP0WbbSAWvBXAul0m/zu+7Vv4O/3WtApy9pmaTMiumEZgfg==} + '@babel/runtime@7.28.3': + resolution: {integrity: sha512-9uIQ10o0WGdpP6GDhXcdOJPJuDgFtIDtN/9+ArJQ2NAfAmiuhTQdzkaTGR33v43GYS2UrSA0eX2pPPHoFVvpxA==} engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/runtime@7.25.7': - resolution: {integrity: sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==} + '@babel/template@7.27.2': + resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.7': - resolution: {integrity: sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==} + '@babel/traverse@7.28.3': + resolution: {integrity: sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.9': - resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} + '@babel/types@7.28.2': + resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.25.7': - resolution: {integrity: sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==} - engines: {node: '>=6.9.0'} + '@changesets/apply-release-plan@7.0.12': + resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==} - '@babel/traverse@7.26.5': - resolution: {integrity: sha512-rkOSPOw+AXbgtwUga3U4u8RpoK9FEFWBNAlTpcnkLFjL5CT+oyHNuUUC/xx6XefEJ16r38r8Bc/lfp6rYuHeJQ==} - engines: {node: '>=6.9.0'} + '@changesets/assemble-release-plan@6.0.9': + resolution: {integrity: sha512-tPgeeqCHIwNo8sypKlS3gOPmsS3wP0zHt67JDuL20P4QcXiw/O4Hl7oXiuLnP9yg+rXLQ2sScdV1Kkzde61iSQ==} - '@babel/types@7.25.7': - resolution: {integrity: sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.26.5': - resolution: {integrity: sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==} - engines: {node: '>=6.9.0'} + '@changesets/changelog-git@0.2.1': + resolution: {integrity: sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==} - '@changesets/apply-release-plan@7.0.5': - resolution: {integrity: sha512-1cWCk+ZshEkSVEZrm2fSj1Gz8sYvxgUL4Q78+1ZZqeqfuevPTPk033/yUZ3df8BKMohkqqHfzj0HOOrG0KtXTw==} + '@changesets/changelog-github@0.5.1': + resolution: {integrity: sha512-BVuHtF+hrhUScSoHnJwTELB4/INQxVFc+P/Qdt20BLiBFIHFJDDUaGsZw+8fQeJTRP5hJZrzpt3oZWh0G19rAQ==} - '@changesets/assemble-release-plan@6.0.4': - resolution: {integrity: sha512-nqICnvmrwWj4w2x0fOhVj2QEGdlUuwVAwESrUo5HLzWMI1rE5SWfsr9ln+rDqWB6RQ2ZyaMZHUcU7/IRaUJS+Q==} - - '@changesets/changelog-git@0.2.0': - resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} - - '@changesets/changelog-github@0.5.0': - resolution: {integrity: sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==} - - '@changesets/cli@2.27.9': - resolution: {integrity: sha512-q42a/ZbDnxPpCb5Wkm6tMVIxgeI9C/bexntzTeCFBrQEdpisQqk8kCHllYZMDjYtEc1ZzumbMJAG8H0Z4rdvjg==} + '@changesets/cli@2.29.6': + resolution: {integrity: sha512-6qCcVsIG1KQLhpQ5zE8N0PckIx4+9QlHK3z6/lwKnw7Tir71Bjw8BeOZaxA/4Jt00pcgCnCSWZnyuZf5Il05QQ==} hasBin: true - '@changesets/config@3.0.3': - resolution: {integrity: sha512-vqgQZMyIcuIpw9nqFIpTSNyc/wgm/Lu1zKN5vECy74u95Qx/Wa9g27HdgO4NkVAaq+BGA8wUc/qvbvVNs93n6A==} + '@changesets/config@3.1.1': + resolution: {integrity: sha512-bd+3Ap2TKXxljCggI0mKPfzCQKeV/TU4yO2h2C6vAihIo8tzseAn2e7klSuiyYYXvgu53zMN1OeYMIQkaQoWnA==} '@changesets/errors@0.2.0': resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} - '@changesets/get-dependents-graph@2.1.2': - resolution: {integrity: sha512-sgcHRkiBY9i4zWYBwlVyAjEM9sAzs4wYVwJUdnbDLnVG3QwAaia1Mk5P8M7kraTOZN+vBET7n8KyB0YXCbFRLQ==} + '@changesets/get-dependents-graph@2.1.3': + resolution: {integrity: sha512-gphr+v0mv2I3Oxt19VdWRRUxq3sseyUpX9DaHpTUmLj92Y10AGy+XOtV+kbM6L/fDcpx7/ISDFK6T8A/P3lOdQ==} '@changesets/get-github-info@0.6.0': resolution: {integrity: sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==} - '@changesets/get-release-plan@4.0.4': - resolution: {integrity: sha512-SicG/S67JmPTrdcc9Vpu0wSQt7IiuN0dc8iR5VScnnTVPfIaLvKmEGRvIaF0kcn8u5ZqLbormZNTO77bCEvyWw==} + '@changesets/get-release-plan@4.0.13': + resolution: {integrity: sha512-DWG1pus72FcNeXkM12tx+xtExyH/c9I1z+2aXlObH3i9YA7+WZEVaiHzHl03thpvAgWTRaH64MpfHxozfF7Dvg==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} - '@changesets/git@3.0.1': - resolution: {integrity: sha512-pdgHcYBLCPcLd82aRcuO0kxCDbw/yISlOtkmwmE8Odo1L6hSiZrBOsRl84eYG7DRCab/iHnOkWqExqc4wxk2LQ==} + '@changesets/git@3.0.4': + resolution: {integrity: sha512-BXANzRFkX+XcC1q/d27NKvlJ1yf7PSAgi8JG6dt8EfbHFHi4neau7mufcSca5zRhwOL8j9s6EqsxmT+s+/E6Sw==} '@changesets/logger@0.1.1': resolution: {integrity: sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==} - '@changesets/parse@0.4.0': - resolution: {integrity: sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw==} + '@changesets/parse@0.4.1': + resolution: {integrity: sha512-iwksMs5Bf/wUItfcg+OXrEpravm5rEd9Bf4oyIPL4kVTmJQ7PNDSd6MDYkpSJR1pn7tz/k8Zf2DhTCqX08Ou+Q==} - '@changesets/pre@2.0.1': - resolution: {integrity: sha512-vvBJ/If4jKM4tPz9JdY2kGOgWmCowUYOi5Ycv8dyLnEE8FgpYYUo1mgJZxcdtGGP3aG8rAQulGLyyXGSLkIMTQ==} + '@changesets/pre@2.0.2': + resolution: {integrity: sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==} - '@changesets/read@0.6.1': - resolution: {integrity: sha512-jYMbyXQk3nwP25nRzQQGa1nKLY0KfoOV7VLgwucI0bUO8t8ZLCr6LZmgjXsiKuRDc+5A6doKPr9w2d+FEJ55zQ==} + '@changesets/read@0.6.5': + resolution: {integrity: sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==} - '@changesets/should-skip-package@0.1.1': - resolution: {integrity: sha512-H9LjLbF6mMHLtJIc/eHR9Na+MifJ3VxtgP/Y+XLn4BF7tDTEN1HNYtH6QMcjP1uxp9sjaFYmW8xqloaCi/ckTg==} + '@changesets/should-skip-package@0.1.2': + resolution: {integrity: sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==} '@changesets/types@4.1.0': resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} - '@changesets/types@6.0.0': - resolution: {integrity: sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==} - - '@changesets/write@0.3.2': - resolution: {integrity: sha512-kDxDrPNpUgsjDbWBvUo27PzKX4gqeKOlhibaOXDJA6kuBisGqNHv/HwGJrAu8U/dSf8ZEFIeHIPtvSlZI1kULw==} + '@changesets/types@6.1.0': + resolution: {integrity: sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==} - '@clockworklabs/test-app@file:packages/test-app': - resolution: {directory: packages/test-app, type: directory} + '@changesets/write@0.4.0': + resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} - '@cspotcode/source-map-support@0.8.1': - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} - - '@csstools/color-helpers@5.0.1': - resolution: {integrity: sha512-MKtmkA0BX87PKaO1NFRTFH+UnkgnmySQOvNxJubsadusqPEC2aJ9MOQiMceZJJ6oitUl/i0L6u0M1IrmAOmgBA==} + '@csstools/color-helpers@5.0.2': + resolution: {integrity: sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==} engines: {node: '>=18'} - '@csstools/css-calc@2.1.1': - resolution: {integrity: sha512-rL7kaUnTkL9K+Cvo2pnCieqNpTKgQzy5f+N+5Iuko9HAoasP+xgprVh7KN/MaJVvVL1l0EzQq2MoqBHKSrDrag==} + '@csstools/css-calc@2.1.4': + resolution: {integrity: sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-parser-algorithms': ^3.0.4 - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 - '@csstools/css-color-parser@3.0.7': - resolution: {integrity: sha512-nkMp2mTICw32uE5NN+EsJ4f5N+IGFeCFu4bGpiKgb2Pq/7J/MpyLBeQ5ry4KKtRFZaYs6sTmcMYrSRIyj5DFKA==} + '@csstools/css-color-parser@3.0.10': + resolution: {integrity: sha512-TiJ5Ajr6WRd1r8HSiwJvZBiJOqtH86aHpUjq5aEKWHiII2Qfjqd/HCWKPOW8EP4vcspXbHnXrwIDlu5savQipg==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-parser-algorithms': ^3.0.4 - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 - '@csstools/css-parser-algorithms@3.0.4': - resolution: {integrity: sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==} + '@csstools/css-parser-algorithms@3.0.5': + resolution: {integrity: sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-tokenizer': ^3.0.4 - '@csstools/css-tokenizer@3.0.3': - resolution: {integrity: sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==} + '@csstools/css-tokenizer@3.0.4': + resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==} engines: {node: '>=18'} '@esbuild/aix-ppc64@0.21.5': @@ -499,14 +350,8 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.23.1': - resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - - '@esbuild/aix-ppc64@0.24.2': - resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} + '@esbuild/aix-ppc64@0.25.9': + resolution: {integrity: sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] @@ -517,14 +362,8 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.23.1': - resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm64@0.24.2': - resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} + '@esbuild/android-arm64@0.25.9': + resolution: {integrity: sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==} engines: {node: '>=18'} cpu: [arm64] os: [android] @@ -535,14 +374,8 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.23.1': - resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - - '@esbuild/android-arm@0.24.2': - resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} + '@esbuild/android-arm@0.25.9': + resolution: {integrity: sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==} engines: {node: '>=18'} cpu: [arm] os: [android] @@ -553,14 +386,8 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.23.1': - resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - - '@esbuild/android-x64@0.24.2': - resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} + '@esbuild/android-x64@0.25.9': + resolution: {integrity: sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==} engines: {node: '>=18'} cpu: [x64] os: [android] @@ -571,14 +398,8 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.23.1': - resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} - engines: {node: '>=18'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-arm64@0.24.2': - resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} + '@esbuild/darwin-arm64@0.25.9': + resolution: {integrity: sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] @@ -589,14 +410,8 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.23.1': - resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} - engines: {node: '>=18'} - cpu: [x64] - os: [darwin] - - '@esbuild/darwin-x64@0.24.2': - resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} + '@esbuild/darwin-x64@0.25.9': + resolution: {integrity: sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==} engines: {node: '>=18'} cpu: [x64] os: [darwin] @@ -607,14 +422,8 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.23.1': - resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-arm64@0.24.2': - resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} + '@esbuild/freebsd-arm64@0.25.9': + resolution: {integrity: sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] @@ -625,14 +434,8 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.23.1': - resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.24.2': - resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} + '@esbuild/freebsd-x64@0.25.9': + resolution: {integrity: sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] @@ -643,14 +446,8 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.23.1': - resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm64@0.24.2': - resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} + '@esbuild/linux-arm64@0.25.9': + resolution: {integrity: sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==} engines: {node: '>=18'} cpu: [arm64] os: [linux] @@ -661,14 +458,8 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.23.1': - resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-arm@0.24.2': - resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} + '@esbuild/linux-arm@0.25.9': + resolution: {integrity: sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==} engines: {node: '>=18'} cpu: [arm] os: [linux] @@ -679,14 +470,8 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.23.1': - resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-ia32@0.24.2': - resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} + '@esbuild/linux-ia32@0.25.9': + resolution: {integrity: sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==} engines: {node: '>=18'} cpu: [ia32] os: [linux] @@ -697,14 +482,8 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.23.1': - resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-loong64@0.24.2': - resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} + '@esbuild/linux-loong64@0.25.9': + resolution: {integrity: sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==} engines: {node: '>=18'} cpu: [loong64] os: [linux] @@ -715,14 +494,8 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.23.1': - resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-mips64el@0.24.2': - resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} + '@esbuild/linux-mips64el@0.25.9': + resolution: {integrity: sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] @@ -733,14 +506,8 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.23.1': - resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-ppc64@0.24.2': - resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} + '@esbuild/linux-ppc64@0.25.9': + resolution: {integrity: sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] @@ -751,14 +518,8 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.23.1': - resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-riscv64@0.24.2': - resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} + '@esbuild/linux-riscv64@0.25.9': + resolution: {integrity: sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] @@ -769,14 +530,8 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.23.1': - resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-s390x@0.24.2': - resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} + '@esbuild/linux-s390x@0.25.9': + resolution: {integrity: sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==} engines: {node: '>=18'} cpu: [s390x] os: [linux] @@ -787,20 +542,14 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.23.1': - resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + '@esbuild/linux-x64@0.25.9': + resolution: {integrity: sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.24.2': - resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} - engines: {node: '>=18'} - cpu: [x64] - os: [linux] - - '@esbuild/netbsd-arm64@0.24.2': - resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} + '@esbuild/netbsd-arm64@0.25.9': + resolution: {integrity: sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] @@ -811,26 +560,14 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.23.1': - resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.24.2': - resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} + '@esbuild/netbsd-x64@0.25.9': + resolution: {integrity: sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.23.1': - resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - - '@esbuild/openbsd-arm64@0.24.2': - resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} + '@esbuild/openbsd-arm64@0.25.9': + resolution: {integrity: sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] @@ -841,17 +578,17 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.23.1': - resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + '@esbuild/openbsd-x64@0.25.9': + resolution: {integrity: sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.24.2': - resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} + '@esbuild/openharmony-arm64@0.25.9': + resolution: {integrity: sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==} engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] + cpu: [arm64] + os: [openharmony] '@esbuild/sunos-x64@0.21.5': resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} @@ -859,14 +596,8 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.23.1': - resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - - '@esbuild/sunos-x64@0.24.2': - resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} + '@esbuild/sunos-x64@0.25.9': + resolution: {integrity: sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==} engines: {node: '>=18'} cpu: [x64] os: [sunos] @@ -877,14 +608,8 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.23.1': - resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} - engines: {node: '>=18'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-arm64@0.24.2': - resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} + '@esbuild/win32-arm64@0.25.9': + resolution: {integrity: sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==} engines: {node: '>=18'} cpu: [arm64] os: [win32] @@ -895,14 +620,8 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.23.1': - resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-ia32@0.24.2': - resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} + '@esbuild/win32-ia32@0.25.9': + resolution: {integrity: sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==} engines: {node: '>=18'} cpu: [ia32] os: [win32] @@ -913,20 +632,14 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.23.1': - resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + '@esbuild/win32-x64@0.25.9': + resolution: {integrity: sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.24.2': - resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} - engines: {node: '>=18'} - cpu: [x64] - os: [win32] - - '@eslint-community/eslint-utils@4.4.1': - resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} + '@eslint-community/eslint-utils@4.7.0': + resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 @@ -935,28 +648,32 @@ packages: resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.19.1': - resolution: {integrity: sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==} + '@eslint/config-array@0.21.0': + resolution: {integrity: sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/config-helpers@0.3.1': + resolution: {integrity: sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.10.0': - resolution: {integrity: sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==} + '@eslint/core@0.15.2': + resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.2.0': - resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} + '@eslint/eslintrc@3.3.1': + resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.18.0': - resolution: {integrity: sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==} + '@eslint/js@9.33.0': + resolution: {integrity: sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/object-schema@2.1.5': - resolution: {integrity: sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==} + '@eslint/object-schema@2.1.6': + resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.5': - resolution: {integrity: sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==} + '@eslint/plugin-kit@0.3.5': + resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@humanfs/core@0.19.1': @@ -975,10 +692,19 @@ packages: resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} - '@humanwhocodes/retry@0.4.1': - resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} + '@inquirer/external-editor@1.0.1': + resolution: {integrity: sha512-Oau4yL24d2B5IL4ma4UpbQigkVhzPDXLoqy1ggK4gnHg/stmkffJE4oOXHXF3uz0UEpywG68KcyXsyYpA1Re/Q==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -995,29 +721,21 @@ packages: resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} - engines: {node: '>=6.0.0'} + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} - - '@jridgewell/source-map@0.3.6': - resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} - - '@jridgewell/sourcemap-codec@1.5.0': - resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jridgewell/source-map@0.3.11': + resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - '@jridgewell/trace-mapping@0.3.9': - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@jridgewell/trace-mapping@0.3.30': + resolution: {integrity: sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==} '@manypkg/find-root@1.1.0': resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} @@ -1041,99 +759,122 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@rollup/rollup-android-arm-eabi@4.24.0': - resolution: {integrity: sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==} + '@rolldown/pluginutils@1.0.0-beta.27': + resolution: {integrity: sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==} + + '@rollup/rollup-android-arm-eabi@4.46.3': + resolution: {integrity: sha512-UmTdvXnLlqQNOCJnyksjPs1G4GqXNGW1LrzCe8+8QoaLhhDeTXYBgJ3k6x61WIhlHX2U+VzEJ55TtIjR/HTySA==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.24.0': - resolution: {integrity: sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==} + '@rollup/rollup-android-arm64@4.46.3': + resolution: {integrity: sha512-8NoxqLpXm7VyeI0ocidh335D6OKT0UJ6fHdnIxf3+6oOerZZc+O7r+UhvROji6OspyPm+rrIdb1gTXtVIqn+Sg==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.24.0': - resolution: {integrity: sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==} + '@rollup/rollup-darwin-arm64@4.46.3': + resolution: {integrity: sha512-csnNavqZVs1+7/hUKtgjMECsNG2cdB8F7XBHP6FfQjqhjF8rzMzb3SLyy/1BG7YSfQ+bG75Ph7DyedbUqwq1rA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.24.0': - resolution: {integrity: sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==} + '@rollup/rollup-darwin-x64@4.46.3': + resolution: {integrity: sha512-r2MXNjbuYabSIX5yQqnT8SGSQ26XQc8fmp6UhlYJd95PZJkQD1u82fWP7HqvGUf33IsOC6qsiV+vcuD4SDP6iw==} cpu: [x64] os: [darwin] - '@rollup/rollup-linux-arm-gnueabihf@4.24.0': - resolution: {integrity: sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==} + '@rollup/rollup-freebsd-arm64@4.46.3': + resolution: {integrity: sha512-uluObTmgPJDuJh9xqxyr7MV61Imq+0IvVsAlWyvxAaBSNzCcmZlhfYcRhCdMaCsy46ccZa7vtDDripgs9Jkqsw==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.46.3': + resolution: {integrity: sha512-AVJXEq9RVHQnejdbFvh1eWEoobohUYN3nqJIPI4mNTMpsyYN01VvcAClxflyk2HIxvLpRcRggpX1m9hkXkpC/A==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.46.3': + resolution: {integrity: sha512-byyflM+huiwHlKi7VHLAYTKr67X199+V+mt1iRgJenAI594vcmGGddWlu6eHujmcdl6TqSNnvqaXJqZdnEWRGA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.24.0': - resolution: {integrity: sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==} + '@rollup/rollup-linux-arm-musleabihf@4.46.3': + resolution: {integrity: sha512-aLm3NMIjr4Y9LklrH5cu7yybBqoVCdr4Nvnm8WB7PKCn34fMCGypVNpGK0JQWdPAzR/FnoEoFtlRqZbBBLhVoQ==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.24.0': - resolution: {integrity: sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==} + '@rollup/rollup-linux-arm64-gnu@4.46.3': + resolution: {integrity: sha512-VtilE6eznJRDIoFOzaagQodUksTEfLIsvXymS+UdJiSXrPW7Ai+WG4uapAc3F7Hgs791TwdGh4xyOzbuzIZrnw==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.24.0': - resolution: {integrity: sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==} + '@rollup/rollup-linux-arm64-musl@4.46.3': + resolution: {integrity: sha512-dG3JuS6+cRAL0GQ925Vppafi0qwZnkHdPeuZIxIPXqkCLP02l7ka+OCyBoDEv8S+nKHxfjvjW4OZ7hTdHkx8/w==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': - resolution: {integrity: sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==} + '@rollup/rollup-linux-loongarch64-gnu@4.46.3': + resolution: {integrity: sha512-iU8DxnxEKJptf8Vcx4XvAUdpkZfaz0KWfRrnIRrOndL0SvzEte+MTM7nDH4A2Now4FvTZ01yFAgj6TX/mZl8hQ==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.46.3': + resolution: {integrity: sha512-VrQZp9tkk0yozJoQvQcqlWiqaPnLM6uY1qPYXvukKePb0fqaiQtOdMJSxNFUZFsGw5oA5vvVokjHrx8a9Qsz2A==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.24.0': - resolution: {integrity: sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==} + '@rollup/rollup-linux-riscv64-gnu@4.46.3': + resolution: {integrity: sha512-uf2eucWSUb+M7b0poZ/08LsbcRgaDYL8NCGjUeFMwCWFwOuFcZ8D9ayPl25P3pl+D2FH45EbHdfyUesQ2Lt9wA==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-riscv64-musl@4.46.3': + resolution: {integrity: sha512-7tnUcDvN8DHm/9ra+/nF7lLzYHDeODKKKrh6JmZejbh1FnCNZS8zMkZY5J4sEipy2OW1d1Ncc4gNHUd0DLqkSg==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.24.0': - resolution: {integrity: sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==} + '@rollup/rollup-linux-s390x-gnu@4.46.3': + resolution: {integrity: sha512-MUpAOallJim8CsJK+4Lc9tQzlfPbHxWDrGXZm2z6biaadNpvh3a5ewcdat478W+tXDoUiHwErX/dOql7ETcLqg==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.24.0': - resolution: {integrity: sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==} + '@rollup/rollup-linux-x64-gnu@4.46.3': + resolution: {integrity: sha512-F42IgZI4JicE2vM2PWCe0N5mR5vR0gIdORPqhGQ32/u1S1v3kLtbZ0C/mi9FFk7C5T0PgdeyWEPajPjaUpyoKg==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.24.0': - resolution: {integrity: sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==} + '@rollup/rollup-linux-x64-musl@4.46.3': + resolution: {integrity: sha512-oLc+JrwwvbimJUInzx56Q3ujL3Kkhxehg7O1gWAYzm8hImCd5ld1F2Gry5YDjR21MNb5WCKhC9hXgU7rRlyegQ==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.24.0': - resolution: {integrity: sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==} + '@rollup/rollup-win32-arm64-msvc@4.46.3': + resolution: {integrity: sha512-lOrQ+BVRstruD1fkWg9yjmumhowR0oLAAzavB7yFSaGltY8klttmZtCLvOXCmGE9mLIn8IBV/IFrQOWz5xbFPg==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.24.0': - resolution: {integrity: sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==} + '@rollup/rollup-win32-ia32-msvc@4.46.3': + resolution: {integrity: sha512-vvrVKPRS4GduGR7VMH8EylCBqsDcw6U+/0nPDuIjXQRbHJc6xOBj+frx8ksfZAh6+Fptw5wHrN7etlMmQnPQVg==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.24.0': - resolution: {integrity: sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==} + '@rollup/rollup-win32-x64-msvc@4.46.3': + resolution: {integrity: sha512-fi3cPxCnu3ZeM3EwKZPgXbWoGzm2XHgB/WShKI81uj8wG0+laobmqy5wbgEwzstlbLu4MyO8C19FyhhWseYKNQ==} cpu: [x64] os: [win32] '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} - '@testing-library/dom@10.4.0': - resolution: {integrity: sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==} + '@testing-library/dom@10.4.1': + resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==} engines: {node: '>=18'} - '@testing-library/jest-dom@6.6.3': - resolution: {integrity: sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==} + '@testing-library/jest-dom@6.7.0': + resolution: {integrity: sha512-RI2e97YZ7MRa+vxP4UUnMuMFL2buSsf0ollxUbTgrbPLKhMn8KVTx7raS6DYjC7v1NDVrioOvaShxsguLNISCA==} engines: {node: '>=14', npm: '>=6', yarn: '>=1'} - '@testing-library/react@16.2.0': - resolution: {integrity: sha512-2cSskAvA1QNtKc8Y9VJQRv0tm3hLVgxRGDB+KYhIaPQJ1I+RHbhIXcM+zClKXzMes/wshsMVzf4B9vS4IZpqDQ==} + '@testing-library/react@16.3.0': + resolution: {integrity: sha512-kFSyxiEDwv1WLl2fgsq6pPBbw5aWKrsY2/noi1Id0TK0UParSF62oFQFGHXIyaG4pp2tEub/Zlel+fjjZILDsw==} engines: {node: '>=18'} peerDependencies: '@testing-library/dom': ^10.0.0 @@ -1153,35 +894,23 @@ packages: peerDependencies: '@testing-library/dom': '>=7.21.4' - '@tsconfig/node10@1.0.11': - resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} - - '@tsconfig/node12@1.0.11': - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - - '@tsconfig/node14@1.0.3': - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - - '@tsconfig/node16@1.0.4': - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - '@types/aria-query@5.0.4': resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} - '@types/babel__generator@7.6.8': - resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==} + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} '@types/babel__template@7.4.4': resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - '@types/babel__traverse@7.20.6': - resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} - '@types/estree@1.0.6': - resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} @@ -1201,25 +930,19 @@ packages: '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - '@types/node@22.15.0': - resolution: {integrity: sha512-99S8dWD2DkeE6PBaEDw+In3aar7hdoBvjyJMR6vaKBTzpvR0P00ClzJMOoVrj9D2+Sy/YCwACYHnBTpMhg1UCA==} - - '@types/prop-types@15.7.13': - resolution: {integrity: sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==} + '@types/node@24.3.0': + resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==} - '@types/react-dom@18.3.0': - resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==} + '@types/prop-types@15.7.15': + resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} - '@types/react-dom@18.3.5': - resolution: {integrity: sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==} + '@types/react-dom@18.3.7': + resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==} peerDependencies: '@types/react': ^18.0.0 - '@types/react@18.3.11': - resolution: {integrity: sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ==} - - '@types/react@18.3.18': - resolution: {integrity: sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==} + '@types/react@18.3.23': + resolution: {integrity: sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==} '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} @@ -1230,73 +953,78 @@ packages: '@types/yargs@17.0.33': resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} - '@typescript-eslint/eslint-plugin@8.21.0': - resolution: {integrity: sha512-eTH+UOR4I7WbdQnG4Z48ebIA6Bgi7WO8HvFEneeYBxG8qCOYgTOFPSg6ek9ITIDvGjDQzWHcoWHCDO2biByNzA==} + '@typescript-eslint/eslint-plugin@8.40.0': + resolution: {integrity: sha512-w/EboPlBwnmOBtRbiOvzjD+wdiZdgFeo17lkltrtn7X37vagKKWJABvyfsJXTlHe6XBzugmYgd4A4nW+k8Mixw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + '@typescript-eslint/parser': ^8.40.0 eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/parser@8.21.0': - resolution: {integrity: sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA==} + '@typescript-eslint/parser@8.40.0': + resolution: {integrity: sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/project-service@8.40.0': + resolution: {integrity: sha512-/A89vz7Wf5DEXsGVvcGdYKbVM9F7DyFXj52lNYUDS1L9yJfqjW/fIp5PgMuEJL/KeqVTe2QSbXAGUZljDUpArw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/scope-manager@8.40.0': + resolution: {integrity: sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/scope-manager@8.21.0': - resolution: {integrity: sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==} + '@typescript-eslint/tsconfig-utils@8.40.0': + resolution: {integrity: sha512-jtMytmUaG9d/9kqSl/W3E3xaWESo4hFDxAIHGVW/WKKtQhesnRIJSAJO6XckluuJ6KDB5woD1EiqknriCtAmcw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/type-utils@8.21.0': - resolution: {integrity: sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ==} + '@typescript-eslint/type-utils@8.40.0': + resolution: {integrity: sha512-eE60cK4KzAc6ZrzlJnflXdrMqOBaugeukWICO2rB0KNvwdIMaEaYiywwHMzA1qFpTxrLhN9Lp4E/00EgWcD3Ow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/types@8.21.0': - resolution: {integrity: sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A==} + '@typescript-eslint/types@8.40.0': + resolution: {integrity: sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.21.0': - resolution: {integrity: sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg==} + '@typescript-eslint/typescript-estree@8.40.0': + resolution: {integrity: sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.8.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/utils@8.21.0': - resolution: {integrity: sha512-xcXBfcq0Kaxgj7dwejMbFyq7IOHgpNMtVuDveK7w3ZGwG9owKzhALVwKpTF2yrZmEwl9SWdetf3fxNzJQaVuxw==} + '@typescript-eslint/utils@8.40.0': + resolution: {integrity: sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/visitor-keys@8.21.0': - resolution: {integrity: sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w==} + '@typescript-eslint/visitor-keys@8.40.0': + resolution: {integrity: sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@vitejs/plugin-react@4.3.2': - resolution: {integrity: sha512-hieu+o05v4glEBucTcKMK3dlES0OeJlD9YVOAPraVMOInBCwzumaIFiUjr4bHK7NPgnAHgiskUoceKercrN8vg==} + '@vitejs/plugin-react@4.7.0': + resolution: {integrity: sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: ^4.2.0 || ^5.0.0 + vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 - '@vitejs/plugin-react@4.3.4': - resolution: {integrity: sha512-SCCPBJtYLdE8PX/7ZQAs1QAZ8Jqwih+0VBLum1EGqmCCQal+MIUqLCzj3ZUy8ufbC0cAM4LRlSTm7IQJwWT4ug==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^4.2.0 || ^5.0.0 || ^6.0.0 + '@vitest/expect@2.1.9': + resolution: {integrity: sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==} - '@vitest/expect@2.1.2': - resolution: {integrity: sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==} - - '@vitest/mocker@2.1.2': - resolution: {integrity: sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==} + '@vitest/mocker@2.1.9': + resolution: {integrity: sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==} peerDependencies: - '@vitest/spy': 2.1.2 - msw: ^2.3.5 + msw: ^2.4.9 vite: ^5.0.0 peerDependenciesMeta: msw: @@ -1304,20 +1032,20 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.2': - resolution: {integrity: sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==} + '@vitest/pretty-format@2.1.9': + resolution: {integrity: sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==} - '@vitest/runner@2.1.2': - resolution: {integrity: sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==} + '@vitest/runner@2.1.9': + resolution: {integrity: sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==} - '@vitest/snapshot@2.1.2': - resolution: {integrity: sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==} + '@vitest/snapshot@2.1.9': + resolution: {integrity: sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==} - '@vitest/spy@2.1.2': - resolution: {integrity: sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==} + '@vitest/spy@2.1.9': + resolution: {integrity: sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==} - '@vitest/utils@2.1.2': - resolution: {integrity: sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==} + '@vitest/utils@2.1.9': + resolution: {integrity: sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==} '@zxing/text-encoding@0.9.0': resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} @@ -1327,22 +1055,13 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn-walk@8.3.4: - resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} hasBin: true - acorn@8.14.0: - resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@7.1.3: - resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} + agent-base@7.1.4: + resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} ajv@6.12.6: @@ -1356,14 +1075,10 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.1.0: - resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} + ansi-regex@6.2.0: + resolution: {integrity: sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==} engines: {node: '>=12'} - ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -1379,13 +1094,6 @@ packages: any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - - arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} @@ -1407,9 +1115,6 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1420,15 +1125,11 @@ packages: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} - binary-extensions@2.3.0: - resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} - engines: {node: '>=8'} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + brace-expansion@1.1.12: + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} - brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + brace-expansion@2.0.2: + resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} @@ -1443,16 +1144,16 @@ packages: resolution: {integrity: sha512-uA9fOtlTRC0iqKfzff1W34DXUA3GyVqbUaeo3Rw3d4gd1eavKVCETXrn3NzO74W+UVkG3UHu8WxUi+XvKI/huA==} engines: {node: '>= 10.16.0'} - browserslist@4.24.0: - resolution: {integrity: sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==} + browserslist@4.25.2: + resolution: {integrity: sha512-0si2SJK3ooGzIawRu61ZdPCO1IncZwS8IzuX73sPZsXW6EQ/w/DAfPyKI8l1ETTCr2MnvqWitmlCUxgdul45jA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - bundle-require@5.0.0: - resolution: {integrity: sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==} + bundle-require@5.1.0: + resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: esbuild: '>=0.18' @@ -1465,57 +1166,39 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - caniuse-lite@1.0.30001667: - resolution: {integrity: sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==} - - chai@5.1.1: - resolution: {integrity: sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==} - engines: {node: '>=12'} - - chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} + caniuse-lite@1.0.30001735: + resolution: {integrity: sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w==} - chalk@3.0.0: - resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} - engines: {node: '>=8'} + chai@5.3.1: + resolution: {integrity: sha512-48af6xm9gQK8rhIcOxWwdGzIervm8BVTin+yRp9HEvU20BtVZ2lBywlIJBzwaDtvo0FvjeL7QdCADoUoqIbV3A==} + engines: {node: '>=18'} chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + chardet@2.1.0: + resolution: {integrity: sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==} check-error@2.1.1: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} - chokidar@3.6.0: - resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} - engines: {node: '>= 8.10.0'} + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} - color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} - color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} - color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -1526,23 +1209,16 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - consola@3.2.3: - resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + + consola@3.4.2: + resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} engines: {node: ^14.18.0 || >=16.10.0} convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - - cross-spawn@5.1.0: - resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} - - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} - engines: {node: '>= 8'} - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -1550,8 +1226,8 @@ packages: css.escape@1.5.1: resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} - cssstyle@4.2.1: - resolution: {integrity: sha512-9+vem03dMXG7gDmZ62uqmRiMRNtinIZ9ZyuF6BdxzfOD+FdN5hretzynkn0ReS2DO2GSw76RWHs0UmJPI2zUjw==} + cssstyle@4.6.0: + resolution: {integrity: sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==} engines: {node: '>=18'} csstype@3.1.3: @@ -1564,8 +1240,8 @@ packages: dataloader@1.4.0: resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} - debug@4.3.7: - resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} + debug@4.4.1: + resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -1573,8 +1249,8 @@ packages: supports-color: optional: true - decimal.js@10.5.0: - resolution: {integrity: sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==} + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} deep-eql@5.0.2: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} @@ -1583,10 +1259,6 @@ packages: deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -1599,10 +1271,6 @@ packages: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} - dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1623,8 +1291,8 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - electron-to-chromium@1.5.33: - resolution: {integrity: sha512-+cYTcFB1QqD4j4LegwLfpCNxifb6dDFUAwk6RsLusCwIaZI6or2f+q8rs5tTB2YC53HhOlIbEaqHMAAC8IOIwA==} + electron-to-chromium@1.5.204: + resolution: {integrity: sha512-s9VbBXWxfDrl67PlO4avwh0/GU2vcwx8Fph3wlR8LJl7ySGYId59EFE17VWVcuC3sLWNPENm6Z/uGqKbkPCcXA==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -1636,22 +1304,20 @@ packages: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} - entities@4.5.0: - resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + entities@6.0.1: + resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} hasBin: true - esbuild@0.23.1: - resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} - engines: {node: '>=18'} - hasBin: true - - esbuild@0.24.2: - resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} + esbuild@0.25.9: + resolution: {integrity: sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==} engines: {node: '>=18'} hasBin: true @@ -1659,10 +1325,6 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} - escape-string-regexp@1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - escape-string-regexp@2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} engines: {node: '>=8'} @@ -1671,31 +1333,31 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - eslint-plugin-react-hooks@5.1.0: - resolution: {integrity: sha512-mpJRtPgHN2tNAvZ35AMfqeB3Xqeo273QxrHJsbBEPWODRM4r0yB6jfoROqKEYrOn27UtRPpcpHc2UqyBSuUNTw==} + eslint-plugin-react-hooks@5.2.0: + resolution: {integrity: sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==} engines: {node: '>=10'} peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 - eslint-plugin-react-refresh@0.4.18: - resolution: {integrity: sha512-IRGEoFn3OKalm3hjfolEWGqoF/jPqeEYFp+C8B0WMzwGwBMvlRDQd06kghDhF0C61uJ6WfSDhEZE/sAQjduKgw==} + eslint-plugin-react-refresh@0.4.20: + resolution: {integrity: sha512-XpbHQ2q5gUF8BGOX4dHe+71qoirYMhApEPZ7sfhF/dNnOF1UXnCMGZf79SFTBO7Bz5YEIT4TMieSlJBWhP9WBA==} peerDependencies: eslint: '>=8.40' - eslint-scope@8.2.0: - resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} + eslint-scope@8.4.0: + resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.2.0: - resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} + eslint-visitor-keys@4.2.1: + resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.18.0: - resolution: {integrity: sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==} + eslint@9.33.0: + resolution: {integrity: sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -1704,8 +1366,8 @@ packages: jiti: optional: true - espree@10.3.0: - resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} + espree@10.4.0: + resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esprima@4.0.1: @@ -1732,9 +1394,9 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} + expect-type@1.2.2: + resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==} + engines: {node: '>=12.0.0'} expect@29.7.0: resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} @@ -1743,15 +1405,11 @@ packages: extendable-error@0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} engines: {node: '>=8.6.0'} fast-json-stable-stringify@2.1.0: @@ -1760,11 +1418,12 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + fastq@1.19.1: + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} - fdir@6.4.0: - resolution: {integrity: sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==} + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: @@ -1787,21 +1446,20 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} + fix-dts-default-cjs-exports@1.0.1: + resolution: {integrity: sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==} + flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} - flatted@3.3.2: - resolution: {integrity: sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==} + flatted@3.3.3: + resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} - foreground-child@3.3.0: - resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - form-data@4.0.1: - resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} - engines: {node: '>= 6'} - fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -1819,12 +1477,8 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} - get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - - get-tsconfig@4.8.1: - resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + get-tsconfig@4.10.1: + resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==} glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} @@ -1838,16 +1492,12 @@ packages: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true - globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globals@15.14.0: - resolution: {integrity: sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==} + globals@15.15.0: + resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} engines: {node: '>=18'} globby@11.1.0: @@ -1860,10 +1510,6 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -1880,16 +1526,9 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} - human-id@1.0.2: - resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} - - human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} + human-id@4.1.1: + resolution: {integrity: sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==} + hasBin: true iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} @@ -1899,8 +1538,12 @@ packages: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} - import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + ignore@7.0.5: + resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} + engines: {node: '>= 4'} + + import-fresh@3.3.1: + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} engines: {node: '>=6'} imurmurhash@0.1.4: @@ -1911,10 +1554,6 @@ packages: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} - is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -1934,10 +1573,6 @@ packages: is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} - is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - is-subdir@1.2.0: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} @@ -1987,8 +1622,8 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsdom@26.0.0: - resolution: {integrity: sha512-BZYDGVAIriBWTpIxYzrXjv3E/4u8+/pSG5bQdIYCbNCGOvsPkDQfTVLAIXAf9ETdCpduCVTkDe2NNZ8NIwUVzw==} + jsdom@26.1.0: + resolution: {integrity: sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==} engines: {node: '>=18'} peerDependencies: canvas: ^3.0.0 @@ -1996,8 +1631,8 @@ packages: canvas: optional: true - jsesc@3.0.2: - resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} hasBin: true @@ -2025,8 +1660,8 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - lilconfig@3.1.2: - resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} + lilconfig@3.1.3: + resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} engines: {node: '>=14'} lines-and-columns@1.2.4: @@ -2053,22 +1688,16 @@ packages: lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true - loupe@3.1.2: - resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} + loupe@3.2.0: + resolution: {integrity: sha512-2NCfZcT5VGVNX9mSZIxLRkEAegDGBpuQZBy13desuHeVORmBDyAET4TkJr4SjqQy3A8JDofMN6LpkK8Xcm/dlw==} lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@4.1.5: - resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} - lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -2076,14 +1705,8 @@ packages: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true - magic-string@0.30.11: - resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} - - make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - - merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + magic-string@0.30.17: + resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -2093,18 +1716,6 @@ packages: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -2120,6 +1731,9 @@ packages: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + mlly@1.7.4: + resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} + mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -2130,13 +1744,8 @@ packages: mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - nanoid@3.3.8: - resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -2152,36 +1761,20 @@ packages: encoding: optional: true - node-releases@2.0.18: - resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} - - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} + node-releases@2.0.19: + resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} - npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} - - nwsapi@2.2.16: - resolution: {integrity: sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ==} + nwsapi@2.2.21: + resolution: {integrity: sha512-o6nIY3qwiSXl7/LuOU0Dmuctd34Yay0yeuZRLFmDPrrdHpXKFndPj3hM+YEPVHYC5fx2otBx4Ilc/gyYSAUaIA==} object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} @@ -2216,15 +1809,15 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - package-manager-detector@0.2.1: - resolution: {integrity: sha512-/hVW2fZvAdEas+wyKh0SnlZ2mx0NIa1+j11YaQkogEJkcMErbwchHCuo8z7lEtajZJQZ6rgZNVTWMVVd71Bjng==} + package-manager-detector@0.2.11: + resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} - parse5@7.2.1: - resolution: {integrity: sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==} + parse5@7.3.0: + resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} @@ -2245,12 +1838,12 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - pathval@2.0.0: - resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} - engines: {node: '>= 14.16'} + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - picocolors@1.1.0: - resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -2259,18 +1852,21 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + picomatch@4.0.3: + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} - pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} + pkg-types@1.3.1: + resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + postcss-load-config@6.0.1: resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} engines: {node: '>= 18'} @@ -2289,12 +1885,8 @@ packages: yaml: optional: true - postcss@8.4.47: - resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} - engines: {node: ^10 || ^12 || >=14} - - postcss@8.5.1: - resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==} + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -2306,8 +1898,8 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - prettier@3.3.3: - resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + prettier@3.6.2: + resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} engines: {node: '>=14'} hasBin: true @@ -2323,13 +1915,13 @@ packages: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - pseudomap@1.0.2: - resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} - punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -2344,8 +1936,8 @@ packages: react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} - react-refresh@0.14.2: - resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} + react-refresh@0.17.0: + resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==} engines: {node: '>=0.10.0'} react@18.3.1: @@ -2356,17 +1948,14 @@ packages: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} - readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} + readdirp@4.1.2: + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} + engines: {node: '>= 14.18.0'} redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} - regenerator-runtime@0.14.1: - resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -2378,12 +1967,12 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rollup@4.24.0: - resolution: {integrity: sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==} + rollup@4.46.3: + resolution: {integrity: sha512-RZn2XTjXb8t5g13f5YclGoilU/kwT696DIkY3sywjdZidNSi3+vseaQov7D7BZXVJCPv3pDWUN69C78GGbXsKw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -2411,23 +2000,15 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.6.3: - resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + semver@7.7.2: + resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} engines: {node: '>=10'} hasBin: true - shebang-command@1.2.0: - resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} - engines: {node: '>=0.10.0'} - shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} - shebang-regex@1.0.0: - resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} - engines: {node: '>=0.10.0'} - shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} @@ -2435,9 +2016,6 @@ packages: siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} @@ -2461,8 +2039,8 @@ packages: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} - spawndamnit@2.0.0: - resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} + spawndamnit@3.0.1: + resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==} sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} @@ -2474,8 +2052,8 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - std-env@3.7.0: - resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} + std-env@3.9.0: + resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -2497,10 +2075,6 @@ packages: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} - strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -2514,10 +2088,6 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true - supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -2529,8 +2099,8 @@ packages: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} - terser@5.34.1: - resolution: {integrity: sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==} + terser@5.43.1: + resolution: {integrity: sha512-+6erLbBm0+LROX2sPXlUYx/ux5PyE9K/a92Wrt6oA+WDAoFTdpHE5tCYCI5PNzq2y8df4rA+QgHLJuR4jNymsg==} engines: {node: '>=10'} hasBin: true @@ -2544,15 +2114,15 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@0.3.0: - resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyglobby@0.2.9: - resolution: {integrity: sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw==} + tinyglobby@0.2.14: + resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} engines: {node: '>=12.0.0'} - tinypool@1.0.1: - resolution: {integrity: sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==} + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} engines: {node: ^18.0.0 || >=20.0.0} tinyrainbow@1.2.0: @@ -2563,27 +2133,19 @@ packages: resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} engines: {node: '>=14.0.0'} - tldts-core@6.1.75: - resolution: {integrity: sha512-AOvV5YYIAFFBfransBzSTyztkc3IMfz5Eq3YluaRiEu55nn43Fzaufx70UqEKYr8BoLCach4q8g/bg6e5+/aFw==} + tldts-core@6.1.86: + resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} - tldts@6.1.75: - resolution: {integrity: sha512-+lFzEXhpl7JXgWYaXcB6DqTYXbUArvrWAE/5ioq/X3CdWLbDjpPP4XTrQBmEJ91y3xbe4Fkw7Lxv4P3GWeJaNg==} + tldts@6.1.86: + resolution: {integrity: sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==} hasBin: true - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} - tough-cookie@5.1.0: - resolution: {integrity: sha512-rvZUv+7MoBYTiDmFPBrhL7Ujx9Sk+q9wwm22x8c8T5IJaR+Wsyc7TNxbVxo84kZoRJZZMazowFLqpankBEQrGg==} + tough-cookie@5.1.2: + resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} engines: {node: '>=16'} tr46@0.0.3: @@ -2592,16 +2154,16 @@ packages: tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} - tr46@5.0.0: - resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} + tr46@5.1.1: + resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==} engines: {node: '>=18'} tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true - ts-api-utils@2.0.0: - resolution: {integrity: sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==} + ts-api-utils@2.1.0: + resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} engines: {node: '>=18.12'} peerDependencies: typescript: '>=4.8.4' @@ -2609,22 +2171,8 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-node@10.9.2: - resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - - tsup@8.3.0: - resolution: {integrity: sha512-ALscEeyS03IomcuNdFdc0YWGVIkwH1Ws7nfTbAPuoILvEV2hpGQAY72LIOjglGo4ShWpZfpBqP/jpQVCzqYQag==} + tsup@8.5.0: + resolution: {integrity: sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ==} engines: {node: '>=18'} hasBin: true peerDependencies: @@ -2642,8 +2190,8 @@ packages: typescript: optional: true - tsx@4.19.1: - resolution: {integrity: sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==} + tsx@4.20.4: + resolution: {integrity: sha512-yyxBKfORQ7LuRt/BQKBXrpcq59ZvSW0XxwfjAt3w2/8PmdxaFzijtMhTawprSHhpzeM5BgU2hXHG3lklIERZXg==} engines: {node: '>=18.0.0'} hasBin: true @@ -2651,36 +2199,34 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - typescript-eslint@8.21.0: - resolution: {integrity: sha512-txEKYY4XMKwPXxNkN8+AxAdX6iIJAPiJbHE/FpQccs/sxw8Lf26kqwC3cn0xkHlW8kEbLhkhCsjWuMveaY9Rxw==} + typescript-eslint@8.40.0: + resolution: {integrity: sha512-Xvd2l+ZmFDPEt4oj1QEXzA4A2uUK6opvKu3eGN9aGjB8au02lIVcLyi375w94hHyejTOmzIU77L8ol2sRg9n7Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' + typescript: '>=4.8.4 <6.0.0' - typescript@5.6.2: - resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} + typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} engines: {node: '>=14.17'} hasBin: true - typescript@5.8.3: - resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} - engines: {node: '>=14.17'} - hasBin: true + ufo@1.6.1: + resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} - undici-types@6.21.0: - resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + undici-types@7.10.0: + resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} - undici@6.19.8: - resolution: {integrity: sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==} + undici@6.21.3: + resolution: {integrity: sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==} engines: {node: '>=18.17'} universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} - update-browserslist-db@1.1.1: - resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==} + update-browserslist-db@1.1.3: + resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -2688,16 +2234,13 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - - vite-node@2.1.2: - resolution: {integrity: sha512-HPcGNN5g/7I2OtPjLqgOtCRu/qhVvBxTUD3qzitmL0SrG1cWFzxzhMDWussxSbrRYWqnKf8P2jiNhPMSN+ymsQ==} + vite-node@2.1.9: + resolution: {integrity: sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite@5.4.8: - resolution: {integrity: sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==} + vite@5.4.19: + resolution: {integrity: sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -2727,8 +2270,8 @@ packages: terser: optional: true - vite@6.0.11: - resolution: {integrity: sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==} + vite@6.3.5: + resolution: {integrity: sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: @@ -2767,15 +2310,15 @@ packages: yaml: optional: true - vitest@2.1.2: - resolution: {integrity: sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==} + vitest@2.1.9: + resolution: {integrity: sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 2.1.2 - '@vitest/ui': 2.1.2 + '@vitest/browser': 2.1.9 + '@vitest/ui': 2.1.9 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -2814,8 +2357,8 @@ packages: resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} engines: {node: '>=18'} - whatwg-url@14.1.0: - resolution: {integrity: sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==} + whatwg-url@14.2.0: + resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==} engines: {node: '>=18'} whatwg-url@5.0.0: @@ -2824,10 +2367,6 @@ packages: whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} - which@1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true - which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -2850,8 +2389,8 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - ws@8.18.0: - resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + ws@8.18.3: + resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -2859,292 +2398,161 @@ packages: peerDependenciesMeta: bufferutil: optional: true - utf-8-validate: - optional: true - - xml-name-validator@5.0.0: - resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} - engines: {node: '>=18'} - - xmlchars@2.2.0: - resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} - - yallist@2.1.2: - resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} - - yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - - yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - -snapshots: - - '@adobe/css-tools@4.4.1': {} - - '@ampproject/remapping@2.3.0': - dependencies: - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - - '@asamuzakjp/css-color@2.8.3': - dependencies: - '@csstools/css-calc': 2.1.1(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-color-parser': 3.0.7(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 - lru-cache: 10.4.3 - - '@babel/code-frame@7.25.7': - dependencies: - '@babel/highlight': 7.25.7 - picocolors: 1.1.0 - - '@babel/code-frame@7.26.2': - dependencies: - '@babel/helper-validator-identifier': 7.25.9 - js-tokens: 4.0.0 - picocolors: 1.1.1 - - '@babel/compat-data@7.25.7': {} - - '@babel/compat-data@7.26.5': {} - - '@babel/core@7.25.7': - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.25.7 - '@babel/generator': 7.25.7 - '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.7) - '@babel/helpers': 7.25.7 - '@babel/parser': 7.25.7 - '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - convert-source-map: 2.0.0 - debug: 4.3.7 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/core@7.26.0': - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.26.2 - '@babel/generator': 7.26.5 - '@babel/helper-compilation-targets': 7.26.5 - '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.0) - '@babel/helpers': 7.26.0 - '@babel/parser': 7.26.5 - '@babel/template': 7.25.9 - '@babel/traverse': 7.26.5 - '@babel/types': 7.26.5 - convert-source-map: 2.0.0 - debug: 4.3.7 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/generator@7.25.7': - dependencies: - '@babel/types': 7.25.7 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 3.0.2 - - '@babel/generator@7.26.5': - dependencies: - '@babel/parser': 7.26.5 - '@babel/types': 7.26.5 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 3.0.2 - - '@babel/helper-compilation-targets@7.25.7': - dependencies: - '@babel/compat-data': 7.25.7 - '@babel/helper-validator-option': 7.25.7 - browserslist: 4.24.0 - lru-cache: 5.1.1 - semver: 6.3.1 - - '@babel/helper-compilation-targets@7.26.5': - dependencies: - '@babel/compat-data': 7.26.5 - '@babel/helper-validator-option': 7.25.9 - browserslist: 4.24.0 - lru-cache: 5.1.1 - semver: 6.3.1 - - '@babel/helper-module-imports@7.25.7': - dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-imports@7.25.9': - dependencies: - '@babel/traverse': 7.26.5 - '@babel/types': 7.26.5 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-module-imports': 7.25.7 - '@babel/helper-simple-access': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.26.0(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-module-imports': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 - '@babel/traverse': 7.26.5 - transitivePeerDependencies: - - supports-color - - '@babel/helper-plugin-utils@7.25.7': {} - - '@babel/helper-plugin-utils@7.26.5': {} - - '@babel/helper-simple-access@7.25.7': - dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - transitivePeerDependencies: - - supports-color + utf-8-validate: + optional: true - '@babel/helper-string-parser@7.25.7': {} + xml-name-validator@5.0.0: + resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} + engines: {node: '>=18'} - '@babel/helper-string-parser@7.25.9': {} + xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} - '@babel/helper-validator-identifier@7.25.7': {} + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - '@babel/helper-validator-identifier@7.25.9': {} + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} - '@babel/helper-validator-option@7.25.7': {} +snapshots: - '@babel/helper-validator-option@7.25.9': {} + '@adobe/css-tools@4.4.4': {} - '@babel/helpers@7.25.7': + '@ampproject/remapping@2.3.0': dependencies: - '@babel/template': 7.25.7 - '@babel/types': 7.25.7 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.30 - '@babel/helpers@7.26.0': + '@asamuzakjp/css-color@3.2.0': dependencies: - '@babel/template': 7.25.9 - '@babel/types': 7.26.5 + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-color-parser': 3.0.10(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 + lru-cache: 10.4.3 - '@babel/highlight@7.25.7': + '@babel/code-frame@7.27.1': dependencies: - '@babel/helper-validator-identifier': 7.25.7 - chalk: 2.4.2 + '@babel/helper-validator-identifier': 7.27.1 js-tokens: 4.0.0 - picocolors: 1.1.0 + picocolors: 1.1.1 - '@babel/parser@7.25.7': + '@babel/compat-data@7.28.0': {} + + '@babel/core@7.28.3': dependencies: - '@babel/types': 7.25.7 + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.27.1 + '@babel/generator': 7.28.3 + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.3) + '@babel/helpers': 7.28.3 + '@babel/parser': 7.28.3 + '@babel/template': 7.27.2 + '@babel/traverse': 7.28.3 + '@babel/types': 7.28.2 + convert-source-map: 2.0.0 + debug: 4.4.1 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color - '@babel/parser@7.26.5': + '@babel/generator@7.28.3': dependencies: - '@babel/types': 7.26.5 + '@babel/parser': 7.28.3 + '@babel/types': 7.28.2 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.30 + jsesc: 3.1.0 - '@babel/plugin-transform-react-jsx-self@7.25.7(@babel/core@7.25.7)': + '@babel/helper-compilation-targets@7.27.2': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/compat-data': 7.28.0 + '@babel/helper-validator-option': 7.27.1 + browserslist: 4.25.2 + lru-cache: 5.1.1 + semver: 6.3.1 - '@babel/plugin-transform-react-jsx-self@7.25.9(@babel/core@7.26.0)': + '@babel/helper-globals@7.28.0': {} + + '@babel/helper-module-imports@7.27.1': dependencies: - '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/traverse': 7.28.3 + '@babel/types': 7.28.2 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-react-jsx-source@7.25.7(@babel/core@7.25.7)': + '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.3)': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 + '@babel/core': 7.28.3 + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 + '@babel/traverse': 7.28.3 + transitivePeerDependencies: + - supports-color + + '@babel/helper-plugin-utils@7.27.1': {} - '@babel/plugin-transform-react-jsx-source@7.25.9(@babel/core@7.26.0)': + '@babel/helper-string-parser@7.27.1': {} + + '@babel/helper-validator-identifier@7.27.1': {} + + '@babel/helper-validator-option@7.27.1': {} + + '@babel/helpers@7.28.3': dependencies: - '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/template': 7.27.2 + '@babel/types': 7.28.2 - '@babel/runtime@7.25.7': + '@babel/parser@7.28.3': dependencies: - regenerator-runtime: 0.14.1 + '@babel/types': 7.28.2 - '@babel/template@7.25.7': + '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.28.3)': dependencies: - '@babel/code-frame': 7.25.7 - '@babel/parser': 7.25.7 - '@babel/types': 7.25.7 + '@babel/core': 7.28.3 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/template@7.25.9': + '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.28.3)': dependencies: - '@babel/code-frame': 7.26.2 - '@babel/parser': 7.26.5 - '@babel/types': 7.26.5 + '@babel/core': 7.28.3 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/runtime@7.28.3': {} - '@babel/traverse@7.25.7': + '@babel/template@7.27.2': dependencies: - '@babel/code-frame': 7.25.7 - '@babel/generator': 7.25.7 - '@babel/parser': 7.25.7 - '@babel/template': 7.25.7 - '@babel/types': 7.25.7 - debug: 4.3.7 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color + '@babel/code-frame': 7.27.1 + '@babel/parser': 7.28.3 + '@babel/types': 7.28.2 - '@babel/traverse@7.26.5': + '@babel/traverse@7.28.3': dependencies: - '@babel/code-frame': 7.26.2 - '@babel/generator': 7.26.5 - '@babel/parser': 7.26.5 - '@babel/template': 7.25.9 - '@babel/types': 7.26.5 - debug: 4.3.7 - globals: 11.12.0 + '@babel/code-frame': 7.27.1 + '@babel/generator': 7.28.3 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.28.3 + '@babel/template': 7.27.2 + '@babel/types': 7.28.2 + debug: 4.4.1 transitivePeerDependencies: - supports-color - '@babel/types@7.25.7': - dependencies: - '@babel/helper-string-parser': 7.25.7 - '@babel/helper-validator-identifier': 7.25.7 - to-fast-properties: 2.0.0 - - '@babel/types@7.26.5': + '@babel/types@7.28.2': dependencies: - '@babel/helper-string-parser': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 + '@babel/helper-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 - '@changesets/apply-release-plan@7.0.5': + '@changesets/apply-release-plan@7.0.12': dependencies: - '@changesets/config': 3.0.3 + '@changesets/config': 3.1.1 '@changesets/get-version-range-type': 0.4.0 - '@changesets/git': 3.0.1 - '@changesets/should-skip-package': 0.1.1 - '@changesets/types': 6.0.0 + '@changesets/git': 3.0.4 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 fs-extra: 7.0.1 @@ -3152,66 +2560,68 @@ snapshots: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.6.3 + semver: 7.7.2 - '@changesets/assemble-release-plan@6.0.4': + '@changesets/assemble-release-plan@6.0.9': dependencies: '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.2 - '@changesets/should-skip-package': 0.1.1 - '@changesets/types': 6.0.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 - semver: 7.6.3 + semver: 7.7.2 - '@changesets/changelog-git@0.2.0': + '@changesets/changelog-git@0.2.1': dependencies: - '@changesets/types': 6.0.0 + '@changesets/types': 6.1.0 - '@changesets/changelog-github@0.5.0': + '@changesets/changelog-github@0.5.1': dependencies: '@changesets/get-github-info': 0.6.0 - '@changesets/types': 6.0.0 + '@changesets/types': 6.1.0 dotenv: 8.6.0 transitivePeerDependencies: - encoding - '@changesets/cli@2.27.9': + '@changesets/cli@2.29.6(@types/node@24.3.0)': dependencies: - '@changesets/apply-release-plan': 7.0.5 - '@changesets/assemble-release-plan': 6.0.4 - '@changesets/changelog-git': 0.2.0 - '@changesets/config': 3.0.3 + '@changesets/apply-release-plan': 7.0.12 + '@changesets/assemble-release-plan': 6.0.9 + '@changesets/changelog-git': 0.2.1 + '@changesets/config': 3.1.1 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.2 - '@changesets/get-release-plan': 4.0.4 - '@changesets/git': 3.0.1 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/get-release-plan': 4.0.13 + '@changesets/git': 3.0.4 '@changesets/logger': 0.1.1 - '@changesets/pre': 2.0.1 - '@changesets/read': 0.6.1 - '@changesets/should-skip-package': 0.1.1 - '@changesets/types': 6.0.0 - '@changesets/write': 0.3.2 + '@changesets/pre': 2.0.2 + '@changesets/read': 0.6.5 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@changesets/write': 0.4.0 + '@inquirer/external-editor': 1.0.1(@types/node@24.3.0) '@manypkg/get-packages': 1.1.3 ansi-colors: 4.1.3 ci-info: 3.9.0 enquirer: 2.4.1 - external-editor: 3.1.0 fs-extra: 7.0.1 mri: 1.2.0 p-limit: 2.3.0 - package-manager-detector: 0.2.1 - picocolors: 1.1.0 + package-manager-detector: 0.2.11 + picocolors: 1.1.1 resolve-from: 5.0.0 - semver: 7.6.3 - spawndamnit: 2.0.0 + semver: 7.7.2 + spawndamnit: 3.0.1 term-size: 2.2.1 + transitivePeerDependencies: + - '@types/node' - '@changesets/config@3.0.3': + '@changesets/config@3.1.1': dependencies: '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.2 + '@changesets/get-dependents-graph': 2.1.3 '@changesets/logger': 0.1.1 - '@changesets/types': 6.0.0 + '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 micromatch: 4.0.8 @@ -3220,12 +2630,12 @@ snapshots: dependencies: extendable-error: 0.1.7 - '@changesets/get-dependents-graph@2.1.2': + '@changesets/get-dependents-graph@2.1.3': dependencies: - '@changesets/types': 6.0.0 + '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 - picocolors: 1.1.0 - semver: 7.6.3 + picocolors: 1.1.1 + semver: 7.7.2 '@changesets/get-github-info@0.6.0': dependencies: @@ -3234,353 +2644,276 @@ snapshots: transitivePeerDependencies: - encoding - '@changesets/get-release-plan@4.0.4': + '@changesets/get-release-plan@4.0.13': dependencies: - '@changesets/assemble-release-plan': 6.0.4 - '@changesets/config': 3.0.3 - '@changesets/pre': 2.0.1 - '@changesets/read': 0.6.1 - '@changesets/types': 6.0.0 + '@changesets/assemble-release-plan': 6.0.9 + '@changesets/config': 3.1.1 + '@changesets/pre': 2.0.2 + '@changesets/read': 0.6.5 + '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 '@changesets/get-version-range-type@0.4.0': {} - '@changesets/git@3.0.1': + '@changesets/git@3.0.4': dependencies: '@changesets/errors': 0.2.0 '@manypkg/get-packages': 1.1.3 is-subdir: 1.2.0 micromatch: 4.0.8 - spawndamnit: 2.0.0 + spawndamnit: 3.0.1 '@changesets/logger@0.1.1': dependencies: - picocolors: 1.1.0 + picocolors: 1.1.1 - '@changesets/parse@0.4.0': + '@changesets/parse@0.4.1': dependencies: - '@changesets/types': 6.0.0 + '@changesets/types': 6.1.0 js-yaml: 3.14.1 - '@changesets/pre@2.0.1': + '@changesets/pre@2.0.2': dependencies: '@changesets/errors': 0.2.0 - '@changesets/types': 6.0.0 + '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 - '@changesets/read@0.6.1': + '@changesets/read@0.6.5': dependencies: - '@changesets/git': 3.0.1 + '@changesets/git': 3.0.4 '@changesets/logger': 0.1.1 - '@changesets/parse': 0.4.0 - '@changesets/types': 6.0.0 + '@changesets/parse': 0.4.1 + '@changesets/types': 6.1.0 fs-extra: 7.0.1 p-filter: 2.1.0 - picocolors: 1.1.0 + picocolors: 1.1.1 - '@changesets/should-skip-package@0.1.1': + '@changesets/should-skip-package@0.1.2': dependencies: - '@changesets/types': 6.0.0 + '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 '@changesets/types@4.1.0': {} - '@changesets/types@6.0.0': {} + '@changesets/types@6.1.0': {} - '@changesets/write@0.3.2': + '@changesets/write@0.4.0': dependencies: - '@changesets/types': 6.0.0 + '@changesets/types': 6.1.0 fs-extra: 7.0.1 - human-id: 1.0.2 + human-id: 4.1.1 prettier: 2.8.8 - '@clockworklabs/test-app@file:packages/test-app': - dependencies: - '@clockworklabs/spacetimedb-sdk': link:packages/sdk - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - - '@cspotcode/source-map-support@0.8.1': - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - - '@csstools/color-helpers@5.0.1': {} + '@csstools/color-helpers@5.0.2': {} - '@csstools/css-calc@2.1.1(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': dependencies: - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 - '@csstools/css-color-parser@3.0.7(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-color-parser@3.0.10(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': dependencies: - '@csstools/color-helpers': 5.0.1 - '@csstools/css-calc': 2.1.1(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 + '@csstools/color-helpers': 5.0.2 + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 - '@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4)': dependencies: - '@csstools/css-tokenizer': 3.0.3 + '@csstools/css-tokenizer': 3.0.4 - '@csstools/css-tokenizer@3.0.3': {} + '@csstools/css-tokenizer@3.0.4': {} '@esbuild/aix-ppc64@0.21.5': optional: true - '@esbuild/aix-ppc64@0.23.1': - optional: true - - '@esbuild/aix-ppc64@0.24.2': + '@esbuild/aix-ppc64@0.25.9': optional: true '@esbuild/android-arm64@0.21.5': optional: true - '@esbuild/android-arm64@0.23.1': - optional: true - - '@esbuild/android-arm64@0.24.2': + '@esbuild/android-arm64@0.25.9': optional: true '@esbuild/android-arm@0.21.5': optional: true - '@esbuild/android-arm@0.23.1': - optional: true - - '@esbuild/android-arm@0.24.2': + '@esbuild/android-arm@0.25.9': optional: true '@esbuild/android-x64@0.21.5': optional: true - '@esbuild/android-x64@0.23.1': - optional: true - - '@esbuild/android-x64@0.24.2': + '@esbuild/android-x64@0.25.9': optional: true '@esbuild/darwin-arm64@0.21.5': optional: true - '@esbuild/darwin-arm64@0.23.1': - optional: true - - '@esbuild/darwin-arm64@0.24.2': + '@esbuild/darwin-arm64@0.25.9': optional: true '@esbuild/darwin-x64@0.21.5': optional: true - '@esbuild/darwin-x64@0.23.1': - optional: true - - '@esbuild/darwin-x64@0.24.2': + '@esbuild/darwin-x64@0.25.9': optional: true '@esbuild/freebsd-arm64@0.21.5': optional: true - '@esbuild/freebsd-arm64@0.23.1': - optional: true - - '@esbuild/freebsd-arm64@0.24.2': + '@esbuild/freebsd-arm64@0.25.9': optional: true '@esbuild/freebsd-x64@0.21.5': optional: true - '@esbuild/freebsd-x64@0.23.1': - optional: true - - '@esbuild/freebsd-x64@0.24.2': + '@esbuild/freebsd-x64@0.25.9': optional: true '@esbuild/linux-arm64@0.21.5': optional: true - '@esbuild/linux-arm64@0.23.1': - optional: true - - '@esbuild/linux-arm64@0.24.2': + '@esbuild/linux-arm64@0.25.9': optional: true '@esbuild/linux-arm@0.21.5': optional: true - '@esbuild/linux-arm@0.23.1': - optional: true - - '@esbuild/linux-arm@0.24.2': + '@esbuild/linux-arm@0.25.9': optional: true '@esbuild/linux-ia32@0.21.5': optional: true - '@esbuild/linux-ia32@0.23.1': - optional: true - - '@esbuild/linux-ia32@0.24.2': + '@esbuild/linux-ia32@0.25.9': optional: true '@esbuild/linux-loong64@0.21.5': optional: true - '@esbuild/linux-loong64@0.23.1': - optional: true - - '@esbuild/linux-loong64@0.24.2': + '@esbuild/linux-loong64@0.25.9': optional: true '@esbuild/linux-mips64el@0.21.5': optional: true - '@esbuild/linux-mips64el@0.23.1': - optional: true - - '@esbuild/linux-mips64el@0.24.2': + '@esbuild/linux-mips64el@0.25.9': optional: true '@esbuild/linux-ppc64@0.21.5': optional: true - '@esbuild/linux-ppc64@0.23.1': - optional: true - - '@esbuild/linux-ppc64@0.24.2': + '@esbuild/linux-ppc64@0.25.9': optional: true '@esbuild/linux-riscv64@0.21.5': optional: true - '@esbuild/linux-riscv64@0.23.1': - optional: true - - '@esbuild/linux-riscv64@0.24.2': + '@esbuild/linux-riscv64@0.25.9': optional: true '@esbuild/linux-s390x@0.21.5': optional: true - '@esbuild/linux-s390x@0.23.1': - optional: true - - '@esbuild/linux-s390x@0.24.2': + '@esbuild/linux-s390x@0.25.9': optional: true '@esbuild/linux-x64@0.21.5': optional: true - '@esbuild/linux-x64@0.23.1': + '@esbuild/linux-x64@0.25.9': optional: true - '@esbuild/linux-x64@0.24.2': - optional: true - - '@esbuild/netbsd-arm64@0.24.2': + '@esbuild/netbsd-arm64@0.25.9': optional: true '@esbuild/netbsd-x64@0.21.5': optional: true - '@esbuild/netbsd-x64@0.23.1': - optional: true - - '@esbuild/netbsd-x64@0.24.2': + '@esbuild/netbsd-x64@0.25.9': optional: true - '@esbuild/openbsd-arm64@0.23.1': - optional: true - - '@esbuild/openbsd-arm64@0.24.2': + '@esbuild/openbsd-arm64@0.25.9': optional: true '@esbuild/openbsd-x64@0.21.5': optional: true - '@esbuild/openbsd-x64@0.23.1': + '@esbuild/openbsd-x64@0.25.9': optional: true - '@esbuild/openbsd-x64@0.24.2': + '@esbuild/openharmony-arm64@0.25.9': optional: true '@esbuild/sunos-x64@0.21.5': optional: true - '@esbuild/sunos-x64@0.23.1': - optional: true - - '@esbuild/sunos-x64@0.24.2': + '@esbuild/sunos-x64@0.25.9': optional: true '@esbuild/win32-arm64@0.21.5': optional: true - '@esbuild/win32-arm64@0.23.1': - optional: true - - '@esbuild/win32-arm64@0.24.2': + '@esbuild/win32-arm64@0.25.9': optional: true '@esbuild/win32-ia32@0.21.5': optional: true - '@esbuild/win32-ia32@0.23.1': - optional: true - - '@esbuild/win32-ia32@0.24.2': + '@esbuild/win32-ia32@0.25.9': optional: true '@esbuild/win32-x64@0.21.5': optional: true - '@esbuild/win32-x64@0.23.1': + '@esbuild/win32-x64@0.25.9': optional: true - '@esbuild/win32-x64@0.24.2': - optional: true - - '@eslint-community/eslint-utils@4.4.1(eslint@9.18.0)': + '@eslint-community/eslint-utils@4.7.0(eslint@9.33.0)': dependencies: - eslint: 9.18.0 + eslint: 9.33.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} - '@eslint/config-array@0.19.1': + '@eslint/config-array@0.21.0': dependencies: - '@eslint/object-schema': 2.1.5 - debug: 4.3.7 + '@eslint/object-schema': 2.1.6 + debug: 4.4.1 minimatch: 3.1.2 transitivePeerDependencies: - supports-color - '@eslint/core@0.10.0': + '@eslint/config-helpers@0.3.1': {} + + '@eslint/core@0.15.2': dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.2.0': + '@eslint/eslintrc@3.3.1': dependencies: ajv: 6.12.6 - debug: 4.3.7 - espree: 10.3.0 + debug: 4.4.1 + espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 - import-fresh: 3.3.0 + import-fresh: 3.3.1 js-yaml: 4.1.0 minimatch: 3.1.2 strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color - '@eslint/js@9.18.0': {} + '@eslint/js@9.33.0': {} - '@eslint/object-schema@2.1.5': {} + '@eslint/object-schema@2.1.6': {} - '@eslint/plugin-kit@0.2.5': + '@eslint/plugin-kit@0.3.5': dependencies: - '@eslint/core': 0.10.0 + '@eslint/core': 0.15.2 levn: 0.4.1 '@humanfs/core@0.19.1': {} @@ -3594,7 +2927,14 @@ snapshots: '@humanwhocodes/retry@0.3.1': {} - '@humanwhocodes/retry@0.4.1': {} + '@humanwhocodes/retry@0.4.3': {} + + '@inquirer/external-editor@1.0.1(@types/node@24.3.0)': + dependencies: + chardet: 2.1.0 + iconv-lite: 0.6.3 + optionalDependencies: + '@types/node': 24.3.0 '@isaacs/cliui@8.0.2': dependencies: @@ -3618,47 +2958,39 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.15.0 + '@types/node': 24.3.0 '@types/yargs': 17.0.33 chalk: 4.1.2 - '@jridgewell/gen-mapping@0.3.5': + '@jridgewell/gen-mapping@0.3.13': dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.30 '@jridgewell/resolve-uri@3.1.2': {} - '@jridgewell/set-array@1.2.1': {} - - '@jridgewell/source-map@0.3.6': + '@jridgewell/source-map@0.3.11': dependencies: - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.30 - '@jridgewell/sourcemap-codec@1.5.0': {} + '@jridgewell/sourcemap-codec@1.5.5': {} - '@jridgewell/trace-mapping@0.3.25': + '@jridgewell/trace-mapping@0.3.30': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 - - '@jridgewell/trace-mapping@0.3.9': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@manypkg/find-root@1.1.0': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.28.3 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 '@manypkg/get-packages@1.1.3': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.28.3 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -3675,128 +3007,133 @@ snapshots: '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 + fastq: 1.19.1 '@pkgjs/parseargs@0.11.0': optional: true - '@rollup/rollup-android-arm-eabi@4.24.0': + '@rolldown/pluginutils@1.0.0-beta.27': {} + + '@rollup/rollup-android-arm-eabi@4.46.3': + optional: true + + '@rollup/rollup-android-arm64@4.46.3': + optional: true + + '@rollup/rollup-darwin-arm64@4.46.3': optional: true - '@rollup/rollup-android-arm64@4.24.0': + '@rollup/rollup-darwin-x64@4.46.3': optional: true - '@rollup/rollup-darwin-arm64@4.24.0': + '@rollup/rollup-freebsd-arm64@4.46.3': optional: true - '@rollup/rollup-darwin-x64@4.24.0': + '@rollup/rollup-freebsd-x64@4.46.3': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.24.0': + '@rollup/rollup-linux-arm-gnueabihf@4.46.3': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.24.0': + '@rollup/rollup-linux-arm-musleabihf@4.46.3': optional: true - '@rollup/rollup-linux-arm64-gnu@4.24.0': + '@rollup/rollup-linux-arm64-gnu@4.46.3': optional: true - '@rollup/rollup-linux-arm64-musl@4.24.0': + '@rollup/rollup-linux-arm64-musl@4.46.3': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': + '@rollup/rollup-linux-loongarch64-gnu@4.46.3': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.24.0': + '@rollup/rollup-linux-ppc64-gnu@4.46.3': optional: true - '@rollup/rollup-linux-s390x-gnu@4.24.0': + '@rollup/rollup-linux-riscv64-gnu@4.46.3': optional: true - '@rollup/rollup-linux-x64-gnu@4.24.0': + '@rollup/rollup-linux-riscv64-musl@4.46.3': optional: true - '@rollup/rollup-linux-x64-musl@4.24.0': + '@rollup/rollup-linux-s390x-gnu@4.46.3': optional: true - '@rollup/rollup-win32-arm64-msvc@4.24.0': + '@rollup/rollup-linux-x64-gnu@4.46.3': optional: true - '@rollup/rollup-win32-ia32-msvc@4.24.0': + '@rollup/rollup-linux-x64-musl@4.46.3': optional: true - '@rollup/rollup-win32-x64-msvc@4.24.0': + '@rollup/rollup-win32-arm64-msvc@4.46.3': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.46.3': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.46.3': optional: true '@sinclair/typebox@0.27.8': {} - '@testing-library/dom@10.4.0': + '@testing-library/dom@10.4.1': dependencies: - '@babel/code-frame': 7.26.2 - '@babel/runtime': 7.25.7 + '@babel/code-frame': 7.27.1 + '@babel/runtime': 7.28.3 '@types/aria-query': 5.0.4 aria-query: 5.3.0 - chalk: 4.1.2 dom-accessibility-api: 0.5.16 lz-string: 1.5.0 + picocolors: 1.1.1 pretty-format: 27.5.1 - '@testing-library/jest-dom@6.6.3': + '@testing-library/jest-dom@6.7.0': dependencies: - '@adobe/css-tools': 4.4.1 + '@adobe/css-tools': 4.4.4 aria-query: 5.3.2 - chalk: 3.0.0 css.escape: 1.5.1 dom-accessibility-api: 0.6.3 - lodash: 4.17.21 + picocolors: 1.1.1 redent: 3.0.0 - '@testing-library/react@16.2.0(@testing-library/dom@10.4.0)(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@testing-library/react@16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@testing-library/dom': 10.4.0 + '@babel/runtime': 7.28.3 + '@testing-library/dom': 10.4.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.18 - '@types/react-dom': 18.3.5(@types/react@18.3.18) + '@types/react': 18.3.23 + '@types/react-dom': 18.3.7(@types/react@18.3.23) - '@testing-library/user-event@14.6.1(@testing-library/dom@10.4.0)': + '@testing-library/user-event@14.6.1(@testing-library/dom@10.4.1)': dependencies: - '@testing-library/dom': 10.4.0 - - '@tsconfig/node10@1.0.11': {} - - '@tsconfig/node12@1.0.11': {} - - '@tsconfig/node14@1.0.3': {} - - '@tsconfig/node16@1.0.4': {} + '@testing-library/dom': 10.4.1 '@types/aria-query@5.0.4': {} '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.25.7 - '@babel/types': 7.25.7 - '@types/babel__generator': 7.6.8 + '@babel/parser': 7.28.3 + '@babel/types': 7.28.2 + '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.20.6 + '@types/babel__traverse': 7.28.0 - '@types/babel__generator@7.6.8': + '@types/babel__generator@7.27.0': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.28.2 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.25.7 - '@babel/types': 7.25.7 + '@babel/parser': 7.28.3 + '@babel/types': 7.28.2 - '@types/babel__traverse@7.20.6': + '@types/babel__traverse@7.28.0': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.28.2 - '@types/estree@1.0.6': {} + '@types/estree@1.0.8': {} '@types/istanbul-lib-coverage@2.0.6': {} @@ -3817,28 +3154,19 @@ snapshots: '@types/node@12.20.55': {} - '@types/node@22.15.0': - dependencies: - undici-types: 6.21.0 - - '@types/prop-types@15.7.13': {} - - '@types/react-dom@18.3.0': + '@types/node@24.3.0': dependencies: - '@types/react': 18.3.11 + undici-types: 7.10.0 - '@types/react-dom@18.3.5(@types/react@18.3.18)': - dependencies: - '@types/react': 18.3.18 + '@types/prop-types@15.7.15': {} - '@types/react@18.3.11': + '@types/react-dom@18.3.7(@types/react@18.3.23)': dependencies: - '@types/prop-types': 15.7.13 - csstype: 3.1.3 + '@types/react': 18.3.23 - '@types/react@18.3.18': + '@types/react@18.3.23': dependencies: - '@types/prop-types': 15.7.13 + '@types/prop-types': 15.7.15 csstype: 3.1.3 '@types/stack-utils@2.0.3': {} @@ -3849,160 +3177,172 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.21.0(@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.6.2))(eslint@9.18.0)(typescript@5.6.2)': + '@typescript-eslint/eslint-plugin@8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.6.3))(eslint@9.33.0)(typescript@5.6.3)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.21.0(eslint@9.18.0)(typescript@5.6.2) - '@typescript-eslint/scope-manager': 8.21.0 - '@typescript-eslint/type-utils': 8.21.0(eslint@9.18.0)(typescript@5.6.2) - '@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.21.0 - eslint: 9.18.0 + '@typescript-eslint/parser': 8.40.0(eslint@9.33.0)(typescript@5.6.3) + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/type-utils': 8.40.0(eslint@9.33.0)(typescript@5.6.3) + '@typescript-eslint/utils': 8.40.0(eslint@9.33.0)(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.40.0 + eslint: 9.33.0 graphemer: 1.4.0 - ignore: 5.3.2 + ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.0.0(typescript@5.6.2) - typescript: 5.6.2 + ts-api-utils: 2.1.0(typescript@5.6.3) + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.6.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.40.0 + debug: 4.4.1 + eslint: 9.33.0 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.6.2)': + '@typescript-eslint/project-service@8.40.0(typescript@5.6.3)': dependencies: - '@typescript-eslint/scope-manager': 8.21.0 - '@typescript-eslint/types': 8.21.0 - '@typescript-eslint/typescript-estree': 8.21.0(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.21.0 - debug: 4.3.7 - eslint: 9.18.0 - typescript: 5.6.2 + '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.6.3) + '@typescript-eslint/types': 8.40.0 + debug: 4.4.1 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.21.0': + '@typescript-eslint/scope-manager@8.40.0': + dependencies: + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/visitor-keys': 8.40.0 + + '@typescript-eslint/tsconfig-utils@8.40.0(typescript@5.6.3)': dependencies: - '@typescript-eslint/types': 8.21.0 - '@typescript-eslint/visitor-keys': 8.21.0 + typescript: 5.6.3 - '@typescript-eslint/type-utils@8.21.0(eslint@9.18.0)(typescript@5.6.2)': + '@typescript-eslint/type-utils@8.40.0(eslint@9.33.0)(typescript@5.6.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.21.0(typescript@5.6.2) - '@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.6.2) - debug: 4.3.7 - eslint: 9.18.0 - ts-api-utils: 2.0.0(typescript@5.6.2) - typescript: 5.6.2 + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.6.3) + '@typescript-eslint/utils': 8.40.0(eslint@9.33.0)(typescript@5.6.3) + debug: 4.4.1 + eslint: 9.33.0 + ts-api-utils: 2.1.0(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.21.0': {} + '@typescript-eslint/types@8.40.0': {} - '@typescript-eslint/typescript-estree@8.21.0(typescript@5.6.2)': + '@typescript-eslint/typescript-estree@8.40.0(typescript@5.6.3)': dependencies: - '@typescript-eslint/types': 8.21.0 - '@typescript-eslint/visitor-keys': 8.21.0 - debug: 4.3.7 - fast-glob: 3.3.2 + '@typescript-eslint/project-service': 8.40.0(typescript@5.6.3) + '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.6.3) + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/visitor-keys': 8.40.0 + debug: 4.4.1 + fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.6.3 - ts-api-utils: 2.0.0(typescript@5.6.2) - typescript: 5.6.2 + semver: 7.7.2 + ts-api-utils: 2.1.0(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.21.0(eslint@9.18.0)(typescript@5.6.2)': + '@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0) - '@typescript-eslint/scope-manager': 8.21.0 - '@typescript-eslint/types': 8.21.0 - '@typescript-eslint/typescript-estree': 8.21.0(typescript@5.6.2) - eslint: 9.18.0 - typescript: 5.6.2 + '@eslint-community/eslint-utils': 4.7.0(eslint@9.33.0) + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.6.3) + eslint: 9.33.0 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.21.0': + '@typescript-eslint/visitor-keys@8.40.0': dependencies: - '@typescript-eslint/types': 8.21.0 - eslint-visitor-keys: 4.2.0 + '@typescript-eslint/types': 8.40.0 + eslint-visitor-keys: 4.2.1 - '@vitejs/plugin-react@4.3.2(vite@5.4.8(@types/node@22.15.0)(terser@5.34.1))': + '@vitejs/plugin-react@4.7.0(vite@5.4.19(@types/node@24.3.0)(terser@5.43.1))': dependencies: - '@babel/core': 7.25.7 - '@babel/plugin-transform-react-jsx-self': 7.25.7(@babel/core@7.25.7) - '@babel/plugin-transform-react-jsx-source': 7.25.7(@babel/core@7.25.7) + '@babel/core': 7.28.3 + '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.3) + '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.3) + '@rolldown/pluginutils': 1.0.0-beta.27 '@types/babel__core': 7.20.5 - react-refresh: 0.14.2 - vite: 5.4.8(@types/node@22.15.0)(terser@5.34.1) + react-refresh: 0.17.0 + vite: 5.4.19(@types/node@24.3.0)(terser@5.43.1) transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@4.3.4(vite@6.0.11(@types/node@22.15.0)(terser@5.34.1)(tsx@4.19.1))': + '@vitejs/plugin-react@4.7.0(vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4))': dependencies: - '@babel/core': 7.26.0 - '@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.26.0) - '@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.26.0) + '@babel/core': 7.28.3 + '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.3) + '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.3) + '@rolldown/pluginutils': 1.0.0-beta.27 '@types/babel__core': 7.20.5 - react-refresh: 0.14.2 - vite: 6.0.11(@types/node@22.15.0)(terser@5.34.1)(tsx@4.19.1) + react-refresh: 0.17.0 + vite: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) transitivePeerDependencies: - supports-color - '@vitest/expect@2.1.2': + '@vitest/expect@2.1.9': dependencies: - '@vitest/spy': 2.1.2 - '@vitest/utils': 2.1.2 - chai: 5.1.1 + '@vitest/spy': 2.1.9 + '@vitest/utils': 2.1.9 + chai: 5.3.1 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.2(@vitest/spy@2.1.2)(vite@5.4.8(@types/node@22.15.0)(terser@5.34.1))': + '@vitest/mocker@2.1.9(vite@5.4.19(@types/node@24.3.0)(terser@5.43.1))': dependencies: - '@vitest/spy': 2.1.2 + '@vitest/spy': 2.1.9 estree-walker: 3.0.3 - magic-string: 0.30.11 + magic-string: 0.30.17 optionalDependencies: - vite: 5.4.8(@types/node@22.15.0)(terser@5.34.1) + vite: 5.4.19(@types/node@24.3.0)(terser@5.43.1) - '@vitest/pretty-format@2.1.2': + '@vitest/pretty-format@2.1.9': dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.1.2': + '@vitest/runner@2.1.9': dependencies: - '@vitest/utils': 2.1.2 + '@vitest/utils': 2.1.9 pathe: 1.1.2 - '@vitest/snapshot@2.1.2': + '@vitest/snapshot@2.1.9': dependencies: - '@vitest/pretty-format': 2.1.2 - magic-string: 0.30.11 + '@vitest/pretty-format': 2.1.9 + magic-string: 0.30.17 pathe: 1.1.2 - '@vitest/spy@2.1.2': + '@vitest/spy@2.1.9': dependencies: tinyspy: 3.0.2 - '@vitest/utils@2.1.2': + '@vitest/utils@2.1.9': dependencies: - '@vitest/pretty-format': 2.1.2 - loupe: 3.1.2 + '@vitest/pretty-format': 2.1.9 + loupe: 3.2.0 tinyrainbow: 1.2.0 '@zxing/text-encoding@0.9.0': {} - acorn-jsx@5.3.2(acorn@8.14.0): - dependencies: - acorn: 8.14.0 - - acorn-walk@8.3.4: + acorn-jsx@5.3.2(acorn@8.15.0): dependencies: - acorn: 8.14.0 - - acorn@8.12.1: {} + acorn: 8.15.0 - acorn@8.14.0: {} + acorn@8.15.0: {} - agent-base@7.1.3: {} + agent-base@7.1.4: {} ajv@6.12.6: dependencies: @@ -4015,11 +3355,7 @@ snapshots: ansi-regex@5.0.1: {} - ansi-regex@6.1.0: {} - - ansi-styles@3.2.1: - dependencies: - color-convert: 1.9.3 + ansi-regex@6.2.0: {} ansi-styles@4.3.0: dependencies: @@ -4031,13 +3367,6 @@ snapshots: any-promise@1.3.0: {} - anymatch@3.1.3: - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - - arg@4.1.3: {} - argparse@1.0.10: dependencies: sprintf-js: 1.0.3 @@ -4054,8 +3383,6 @@ snapshots: assertion-error@2.0.1: {} - asynckit@0.4.0: {} - balanced-match@1.0.2: {} base64-js@1.5.1: {} @@ -4064,14 +3391,12 @@ snapshots: dependencies: is-windows: 1.0.2 - binary-extensions@2.3.0: {} - - brace-expansion@1.1.11: + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 - brace-expansion@2.0.1: + brace-expansion@2.0.2: dependencies: balanced-match: 1.0.2 @@ -4089,107 +3414,66 @@ snapshots: dependencies: duplexer: 0.1.1 - browserslist@4.24.0: + browserslist@4.25.2: dependencies: - caniuse-lite: 1.0.30001667 - electron-to-chromium: 1.5.33 - node-releases: 2.0.18 - update-browserslist-db: 1.1.1(browserslist@4.24.0) + caniuse-lite: 1.0.30001735 + electron-to-chromium: 1.5.204 + node-releases: 2.0.19 + update-browserslist-db: 1.1.3(browserslist@4.25.2) buffer-from@1.1.2: {} - bundle-require@5.0.0(esbuild@0.23.1): + bundle-require@5.1.0(esbuild@0.25.9): dependencies: - esbuild: 0.23.1 + esbuild: 0.25.9 load-tsconfig: 0.2.5 cac@6.7.14: {} callsites@3.1.0: {} - caniuse-lite@1.0.30001667: {} + caniuse-lite@1.0.30001735: {} - chai@5.1.1: + chai@5.3.1: dependencies: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.2 - pathval: 2.0.0 - - chalk@2.4.2: - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - - chalk@3.0.0: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 + loupe: 3.2.0 + pathval: 2.0.1 chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - chardet@0.7.0: {} + chardet@2.1.0: {} check-error@2.1.1: {} - chokidar@3.6.0: + chokidar@4.0.3: dependencies: - anymatch: 3.1.3 - braces: 3.0.3 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 + readdirp: 4.1.2 ci-info@3.9.0: {} - color-convert@1.9.3: - dependencies: - color-name: 1.1.3 - color-convert@2.0.1: dependencies: color-name: 1.1.4 - color-name@1.1.3: {} - color-name@1.1.4: {} - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - commander@2.20.3: {} commander@4.1.1: {} concat-map@0.0.1: {} - consola@3.2.3: {} - - convert-source-map@2.0.0: {} - - create-require@1.1.1: {} + confbox@0.1.8: {} - cross-spawn@5.1.0: - dependencies: - lru-cache: 4.1.5 - shebang-command: 1.2.0 - which: 1.3.1 + consola@3.4.2: {} - cross-spawn@7.0.3: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 + convert-source-map@2.0.0: {} cross-spawn@7.0.6: dependencies: @@ -4199,9 +3483,9 @@ snapshots: css.escape@1.5.1: {} - cssstyle@4.2.1: + cssstyle@4.6.0: dependencies: - '@asamuzakjp/css-color': 2.8.3 + '@asamuzakjp/css-color': 3.2.0 rrweb-cssom: 0.8.0 csstype@3.1.3: {} @@ -4209,30 +3493,26 @@ snapshots: data-urls@5.0.0: dependencies: whatwg-mimetype: 4.0.0 - whatwg-url: 14.1.0 + whatwg-url: 14.2.0 dataloader@1.4.0: {} - debug@4.3.7: + debug@4.4.1: dependencies: ms: 2.1.3 - decimal.js@10.5.0: {} + decimal.js@10.6.0: {} deep-eql@5.0.2: {} deep-is@0.1.4: {} - delayed-stream@1.0.0: {} - dequal@2.0.3: {} detect-indent@6.1.0: {} diff-sequences@29.6.3: {} - diff@4.0.2: {} - dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -4247,7 +3527,7 @@ snapshots: eastasianwidth@0.2.0: {} - electron-to-chromium@1.5.33: {} + electron-to-chromium@1.5.204: {} emoji-regex@8.0.0: {} @@ -4258,7 +3538,9 @@ snapshots: ansi-colors: 4.1.3 strip-ansi: 6.0.1 - entities@4.5.0: {} + entities@6.0.1: {} + + es-module-lexer@1.7.0: {} esbuild@0.21.5: optionalDependencies: @@ -4286,108 +3568,81 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 - esbuild@0.23.1: + esbuild@0.25.9: optionalDependencies: - '@esbuild/aix-ppc64': 0.23.1 - '@esbuild/android-arm': 0.23.1 - '@esbuild/android-arm64': 0.23.1 - '@esbuild/android-x64': 0.23.1 - '@esbuild/darwin-arm64': 0.23.1 - '@esbuild/darwin-x64': 0.23.1 - '@esbuild/freebsd-arm64': 0.23.1 - '@esbuild/freebsd-x64': 0.23.1 - '@esbuild/linux-arm': 0.23.1 - '@esbuild/linux-arm64': 0.23.1 - '@esbuild/linux-ia32': 0.23.1 - '@esbuild/linux-loong64': 0.23.1 - '@esbuild/linux-mips64el': 0.23.1 - '@esbuild/linux-ppc64': 0.23.1 - '@esbuild/linux-riscv64': 0.23.1 - '@esbuild/linux-s390x': 0.23.1 - '@esbuild/linux-x64': 0.23.1 - '@esbuild/netbsd-x64': 0.23.1 - '@esbuild/openbsd-arm64': 0.23.1 - '@esbuild/openbsd-x64': 0.23.1 - '@esbuild/sunos-x64': 0.23.1 - '@esbuild/win32-arm64': 0.23.1 - '@esbuild/win32-ia32': 0.23.1 - '@esbuild/win32-x64': 0.23.1 - - esbuild@0.24.2: - optionalDependencies: - '@esbuild/aix-ppc64': 0.24.2 - '@esbuild/android-arm': 0.24.2 - '@esbuild/android-arm64': 0.24.2 - '@esbuild/android-x64': 0.24.2 - '@esbuild/darwin-arm64': 0.24.2 - '@esbuild/darwin-x64': 0.24.2 - '@esbuild/freebsd-arm64': 0.24.2 - '@esbuild/freebsd-x64': 0.24.2 - '@esbuild/linux-arm': 0.24.2 - '@esbuild/linux-arm64': 0.24.2 - '@esbuild/linux-ia32': 0.24.2 - '@esbuild/linux-loong64': 0.24.2 - '@esbuild/linux-mips64el': 0.24.2 - '@esbuild/linux-ppc64': 0.24.2 - '@esbuild/linux-riscv64': 0.24.2 - '@esbuild/linux-s390x': 0.24.2 - '@esbuild/linux-x64': 0.24.2 - '@esbuild/netbsd-arm64': 0.24.2 - '@esbuild/netbsd-x64': 0.24.2 - '@esbuild/openbsd-arm64': 0.24.2 - '@esbuild/openbsd-x64': 0.24.2 - '@esbuild/sunos-x64': 0.24.2 - '@esbuild/win32-arm64': 0.24.2 - '@esbuild/win32-ia32': 0.24.2 - '@esbuild/win32-x64': 0.24.2 + '@esbuild/aix-ppc64': 0.25.9 + '@esbuild/android-arm': 0.25.9 + '@esbuild/android-arm64': 0.25.9 + '@esbuild/android-x64': 0.25.9 + '@esbuild/darwin-arm64': 0.25.9 + '@esbuild/darwin-x64': 0.25.9 + '@esbuild/freebsd-arm64': 0.25.9 + '@esbuild/freebsd-x64': 0.25.9 + '@esbuild/linux-arm': 0.25.9 + '@esbuild/linux-arm64': 0.25.9 + '@esbuild/linux-ia32': 0.25.9 + '@esbuild/linux-loong64': 0.25.9 + '@esbuild/linux-mips64el': 0.25.9 + '@esbuild/linux-ppc64': 0.25.9 + '@esbuild/linux-riscv64': 0.25.9 + '@esbuild/linux-s390x': 0.25.9 + '@esbuild/linux-x64': 0.25.9 + '@esbuild/netbsd-arm64': 0.25.9 + '@esbuild/netbsd-x64': 0.25.9 + '@esbuild/openbsd-arm64': 0.25.9 + '@esbuild/openbsd-x64': 0.25.9 + '@esbuild/openharmony-arm64': 0.25.9 + '@esbuild/sunos-x64': 0.25.9 + '@esbuild/win32-arm64': 0.25.9 + '@esbuild/win32-ia32': 0.25.9 + '@esbuild/win32-x64': 0.25.9 escalade@3.2.0: {} - escape-string-regexp@1.0.5: {} - escape-string-regexp@2.0.0: {} escape-string-regexp@4.0.0: {} - eslint-plugin-react-hooks@5.1.0(eslint@9.18.0): + eslint-plugin-react-hooks@5.2.0(eslint@9.33.0): dependencies: - eslint: 9.18.0 + eslint: 9.33.0 - eslint-plugin-react-refresh@0.4.18(eslint@9.18.0): + eslint-plugin-react-refresh@0.4.20(eslint@9.33.0): dependencies: - eslint: 9.18.0 + eslint: 9.33.0 - eslint-scope@8.2.0: + eslint-scope@8.4.0: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.2.0: {} + eslint-visitor-keys@4.2.1: {} - eslint@9.18.0: + eslint@9.33.0: dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.33.0) '@eslint-community/regexpp': 4.12.1 - '@eslint/config-array': 0.19.1 - '@eslint/core': 0.10.0 - '@eslint/eslintrc': 3.2.0 - '@eslint/js': 9.18.0 - '@eslint/plugin-kit': 0.2.5 + '@eslint/config-array': 0.21.0 + '@eslint/config-helpers': 0.3.1 + '@eslint/core': 0.15.2 + '@eslint/eslintrc': 3.3.1 + '@eslint/js': 9.33.0 + '@eslint/plugin-kit': 0.3.5 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.4.1 - '@types/estree': 1.0.6 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.8 '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.3.7 + debug: 4.4.1 escape-string-regexp: 4.0.0 - eslint-scope: 8.2.0 - eslint-visitor-keys: 4.2.0 - espree: 10.3.0 + eslint-scope: 8.4.0 + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -4405,11 +3660,11 @@ snapshots: transitivePeerDependencies: - supports-color - espree@10.3.0: + espree@10.4.0: dependencies: - acorn: 8.14.0 - acorn-jsx: 5.3.2(acorn@8.14.0) - eslint-visitor-keys: 4.2.0 + acorn: 8.15.0 + acorn-jsx: 5.3.2(acorn@8.15.0) + eslint-visitor-keys: 4.2.1 esprima@4.0.1: {} @@ -4425,21 +3680,11 @@ snapshots: estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.6 + '@types/estree': 1.0.8 esutils@2.0.3: {} - execa@5.1.1: - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 + expect-type@1.2.2: {} expect@29.7.0: dependencies: @@ -4451,15 +3696,9 @@ snapshots: extendable-error@0.1.7: {} - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - fast-deep-equal@3.1.3: {} - fast-glob@3.3.2: + fast-glob@3.3.3: dependencies: '@nodelib/fs.stat': 2.0.5 '@nodelib/fs.walk': 1.2.8 @@ -4471,13 +3710,13 @@ snapshots: fast-levenshtein@2.0.6: {} - fastq@1.17.1: + fastq@1.19.1: dependencies: - reusify: 1.0.4 + reusify: 1.1.0 - fdir@6.4.0(picomatch@4.0.2): + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: - picomatch: 4.0.2 + picomatch: 4.0.3 file-entry-cache@8.0.0: dependencies: @@ -4497,24 +3736,24 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 + fix-dts-default-cjs-exports@1.0.1: + dependencies: + magic-string: 0.30.17 + mlly: 1.7.4 + rollup: 4.46.3 + flat-cache@4.0.1: dependencies: - flatted: 3.3.2 + flatted: 3.3.3 keyv: 4.5.4 - flatted@3.3.2: {} + flatted@3.3.3: {} - foreground-child@3.3.0: + foreground-child@3.3.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 signal-exit: 4.1.0 - form-data@4.0.1: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - fs-extra@7.0.1: dependencies: graceful-fs: 4.2.11 @@ -4532,9 +3771,7 @@ snapshots: gensync@1.0.0-beta.2: {} - get-stream@6.0.1: {} - - get-tsconfig@4.8.1: + get-tsconfig@4.10.1: dependencies: resolve-pkg-maps: 1.0.0 @@ -4548,24 +3785,22 @@ snapshots: glob@10.4.5: dependencies: - foreground-child: 3.3.0 + foreground-child: 3.3.1 jackspeak: 3.4.3 minimatch: 9.0.5 minipass: 7.1.2 package-json-from-dist: 1.0.1 path-scurry: 1.11.1 - globals@11.12.0: {} - globals@14.0.0: {} - globals@15.14.0: {} + globals@15.15.0: {} globby@11.1.0: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.3.2 + fast-glob: 3.3.3 ignore: 5.3.2 merge2: 1.4.1 slash: 3.0.0 @@ -4574,8 +3809,6 @@ snapshots: graphemer@1.4.0: {} - has-flag@3.0.0: {} - has-flag@4.0.0: {} html-encoding-sniffer@4.0.0: @@ -4584,25 +3817,19 @@ snapshots: http-proxy-agent@7.0.2: dependencies: - agent-base: 7.1.3 - debug: 4.3.7 + agent-base: 7.1.4 + debug: 4.4.1 transitivePeerDependencies: - supports-color https-proxy-agent@7.0.6: dependencies: - agent-base: 7.1.3 - debug: 4.3.7 + agent-base: 7.1.4 + debug: 4.4.1 transitivePeerDependencies: - supports-color - human-id@1.0.2: {} - - human-signals@2.1.0: {} - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 + human-id@4.1.1: {} iconv-lite@0.6.3: dependencies: @@ -4610,7 +3837,9 @@ snapshots: ignore@5.3.2: {} - import-fresh@3.3.0: + ignore@7.0.5: {} + + import-fresh@3.3.1: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 @@ -4619,10 +3848,6 @@ snapshots: indent-string@4.0.0: {} - is-binary-path@2.1.0: - dependencies: - binary-extensions: 2.3.0 - is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} @@ -4635,8 +3860,6 @@ snapshots: is-potential-custom-element-name@1.0.1: {} - is-stream@2.0.1: {} - is-subdir@1.2.0: dependencies: better-path-resolve: 1.0.0 @@ -4669,7 +3892,7 @@ snapshots: jest-message-util@29.7.0: dependencies: - '@babel/code-frame': 7.26.2 + '@babel/code-frame': 7.27.1 '@jest/types': 29.6.3 '@types/stack-utils': 2.0.3 chalk: 4.1.2 @@ -4682,7 +3905,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.15.0 + '@types/node': 24.3.0 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -4701,35 +3924,34 @@ snapshots: dependencies: argparse: 2.0.1 - jsdom@26.0.0: + jsdom@26.1.0: dependencies: - cssstyle: 4.2.1 + cssstyle: 4.6.0 data-urls: 5.0.0 - decimal.js: 10.5.0 - form-data: 4.0.1 + decimal.js: 10.6.0 html-encoding-sniffer: 4.0.0 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.6 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.16 - parse5: 7.2.1 + nwsapi: 2.2.21 + parse5: 7.3.0 rrweb-cssom: 0.8.0 saxes: 6.0.0 symbol-tree: 3.2.4 - tough-cookie: 5.1.0 + tough-cookie: 5.1.2 w3c-xmlserializer: 5.0.0 webidl-conversions: 7.0.0 whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 - whatwg-url: 14.1.0 - ws: 8.18.0 + whatwg-url: 14.2.0 + ws: 8.18.3 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - jsesc@3.0.2: {} + jsesc@3.1.0: {} json-buffer@3.0.1: {} @@ -4752,7 +3974,7 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - lilconfig@3.1.2: {} + lilconfig@3.1.3: {} lines-and-columns@1.2.4: {} @@ -4772,34 +3994,23 @@ snapshots: lodash.startcase@4.4.0: {} - lodash@4.17.21: {} - loose-envify@1.4.0: dependencies: js-tokens: 4.0.0 - loupe@3.1.2: {} + loupe@3.2.0: {} lru-cache@10.4.3: {} - lru-cache@4.1.5: - dependencies: - pseudomap: 1.0.2 - yallist: 2.1.2 - lru-cache@5.1.1: dependencies: yallist: 3.1.1 lz-string@1.5.0: {} - magic-string@0.30.11: + magic-string@0.30.17: dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - - make-error@1.3.6: {} - - merge-stream@2.0.0: {} + '@jridgewell/sourcemap-codec': 1.5.5 merge2@1.4.1: {} @@ -4808,26 +4019,25 @@ snapshots: braces: 3.0.3 picomatch: 2.3.1 - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - min-indent@1.0.1: {} minimatch@3.1.2: dependencies: - brace-expansion: 1.1.11 + brace-expansion: 1.1.12 minimatch@9.0.5: dependencies: - brace-expansion: 2.0.1 + brace-expansion: 2.0.2 minipass@7.1.2: {} + mlly@1.7.4: + dependencies: + acorn: 8.15.0 + pathe: 2.0.3 + pkg-types: 1.3.1 + ufo: 1.6.1 + mri@1.2.0: {} ms@2.1.3: {} @@ -4838,9 +4048,7 @@ snapshots: object-assign: 4.1.1 thenify-all: 1.6.0 - nanoid@3.3.7: {} - - nanoid@3.3.8: {} + nanoid@3.3.11: {} natural-compare@1.4.0: {} @@ -4848,22 +4056,12 @@ snapshots: dependencies: whatwg-url: 5.0.0 - node-releases@2.0.18: {} - - normalize-path@3.0.0: {} + node-releases@2.0.19: {} - npm-run-path@4.0.1: - dependencies: - path-key: 3.1.1 - - nwsapi@2.2.16: {} + nwsapi@2.2.21: {} object-assign@4.1.1: {} - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -4873,8 +4071,6 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 - os-tmpdir@1.0.2: {} - outdent@0.5.0: {} p-filter@2.1.0: @@ -4903,15 +4099,17 @@ snapshots: package-json-from-dist@1.0.1: {} - package-manager-detector@0.2.1: {} + package-manager-detector@0.2.11: + dependencies: + quansync: 0.2.11 parent-module@1.0.1: dependencies: callsites: 3.1.0 - parse5@7.2.1: + parse5@7.3.0: dependencies: - entities: 4.5.0 + entities: 6.0.1 path-exists@4.0.0: {} @@ -4926,36 +4124,36 @@ snapshots: pathe@1.1.2: {} - pathval@2.0.0: {} + pathe@2.0.3: {} - picocolors@1.1.0: {} + pathval@2.0.1: {} picocolors@1.1.1: {} picomatch@2.3.1: {} - picomatch@4.0.2: {} + picomatch@4.0.3: {} pify@4.0.1: {} - pirates@4.0.6: {} + pirates@4.0.7: {} - postcss-load-config@6.0.1(postcss@8.5.1)(tsx@4.19.1): + pkg-types@1.3.1: dependencies: - lilconfig: 3.1.2 - optionalDependencies: - postcss: 8.5.1 - tsx: 4.19.1 + confbox: 0.1.8 + mlly: 1.7.4 + pathe: 2.0.3 - postcss@8.4.47: + postcss-load-config@6.0.1(postcss@8.5.6)(tsx@4.20.4): dependencies: - nanoid: 3.3.7 - picocolors: 1.1.0 - source-map-js: 1.2.1 + lilconfig: 3.1.3 + optionalDependencies: + postcss: 8.5.6 + tsx: 4.20.4 - postcss@8.5.1: + postcss@8.5.6: dependencies: - nanoid: 3.3.8 + nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -4963,7 +4161,7 @@ snapshots: prettier@2.8.8: {} - prettier@3.3.3: {} + prettier@3.6.2: {} pretty-bytes@5.6.0: {} @@ -4979,10 +4177,10 @@ snapshots: ansi-styles: 5.2.0 react-is: 18.3.1 - pseudomap@1.0.2: {} - punycode@2.3.1: {} + quansync@0.2.11: {} + queue-microtask@1.2.3: {} react-dom@18.3.1(react@18.3.1): @@ -4995,7 +4193,7 @@ snapshots: react-is@18.3.1: {} - react-refresh@0.14.2: {} + react-refresh@0.17.0: {} react@18.3.1: dependencies: @@ -5008,45 +4206,45 @@ snapshots: pify: 4.0.1 strip-bom: 3.0.0 - readdirp@3.6.0: - dependencies: - picomatch: 2.3.1 + readdirp@4.1.2: {} redent@3.0.0: dependencies: indent-string: 4.0.0 strip-indent: 3.0.0 - regenerator-runtime@0.14.1: {} - resolve-from@4.0.0: {} resolve-from@5.0.0: {} resolve-pkg-maps@1.0.0: {} - reusify@1.0.4: {} + reusify@1.1.0: {} - rollup@4.24.0: + rollup@4.46.3: dependencies: - '@types/estree': 1.0.6 + '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.24.0 - '@rollup/rollup-android-arm64': 4.24.0 - '@rollup/rollup-darwin-arm64': 4.24.0 - '@rollup/rollup-darwin-x64': 4.24.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.24.0 - '@rollup/rollup-linux-arm-musleabihf': 4.24.0 - '@rollup/rollup-linux-arm64-gnu': 4.24.0 - '@rollup/rollup-linux-arm64-musl': 4.24.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.24.0 - '@rollup/rollup-linux-riscv64-gnu': 4.24.0 - '@rollup/rollup-linux-s390x-gnu': 4.24.0 - '@rollup/rollup-linux-x64-gnu': 4.24.0 - '@rollup/rollup-linux-x64-musl': 4.24.0 - '@rollup/rollup-win32-arm64-msvc': 4.24.0 - '@rollup/rollup-win32-ia32-msvc': 4.24.0 - '@rollup/rollup-win32-x64-msvc': 4.24.0 + '@rollup/rollup-android-arm-eabi': 4.46.3 + '@rollup/rollup-android-arm64': 4.46.3 + '@rollup/rollup-darwin-arm64': 4.46.3 + '@rollup/rollup-darwin-x64': 4.46.3 + '@rollup/rollup-freebsd-arm64': 4.46.3 + '@rollup/rollup-freebsd-x64': 4.46.3 + '@rollup/rollup-linux-arm-gnueabihf': 4.46.3 + '@rollup/rollup-linux-arm-musleabihf': 4.46.3 + '@rollup/rollup-linux-arm64-gnu': 4.46.3 + '@rollup/rollup-linux-arm64-musl': 4.46.3 + '@rollup/rollup-linux-loongarch64-gnu': 4.46.3 + '@rollup/rollup-linux-ppc64-gnu': 4.46.3 + '@rollup/rollup-linux-riscv64-gnu': 4.46.3 + '@rollup/rollup-linux-riscv64-musl': 4.46.3 + '@rollup/rollup-linux-s390x-gnu': 4.46.3 + '@rollup/rollup-linux-x64-gnu': 4.46.3 + '@rollup/rollup-linux-x64-musl': 4.46.3 + '@rollup/rollup-win32-arm64-msvc': 4.46.3 + '@rollup/rollup-win32-ia32-msvc': 4.46.3 + '@rollup/rollup-win32-x64-msvc': 4.46.3 fsevents: 2.3.3 rrweb-cssom@0.8.0: {} @@ -5071,24 +4269,16 @@ snapshots: semver@6.3.1: {} - semver@7.6.3: {} - - shebang-command@1.2.0: - dependencies: - shebang-regex: 1.0.0 + semver@7.7.2: {} shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 - shebang-regex@1.0.0: {} - shebang-regex@3.0.0: {} siginfo@2.0.0: {} - signal-exit@3.0.7: {} - signal-exit@4.1.0: {} slash@3.0.0: {} @@ -5106,10 +4296,10 @@ snapshots: dependencies: whatwg-url: 7.1.0 - spawndamnit@2.0.0: + spawndamnit@3.0.1: dependencies: - cross-spawn: 5.1.0 - signal-exit: 3.0.7 + cross-spawn: 7.0.6 + signal-exit: 4.1.0 sprintf-js@1.0.3: {} @@ -5119,7 +4309,7 @@ snapshots: stackback@0.0.2: {} - std-env@3.7.0: {} + std-env@3.9.0: {} string-width@4.2.3: dependencies: @@ -5139,12 +4329,10 @@ snapshots: strip-ansi@7.1.0: dependencies: - ansi-regex: 6.1.0 + ansi-regex: 6.2.0 strip-bom@3.0.0: {} - strip-final-newline@2.0.0: {} - strip-indent@3.0.0: dependencies: min-indent: 1.0.1 @@ -5153,18 +4341,14 @@ snapshots: sucrase@3.35.0: dependencies: - '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/gen-mapping': 0.3.13 commander: 4.1.1 glob: 10.4.5 lines-and-columns: 1.2.4 mz: 2.7.0 - pirates: 4.0.6 + pirates: 4.0.7 ts-interface-checker: 0.1.13 - supports-color@5.5.0: - dependencies: - has-flag: 3.0.0 - supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -5173,10 +4357,10 @@ snapshots: term-size@2.2.1: {} - terser@5.34.1: + terser@5.43.1: dependencies: - '@jridgewell/source-map': 0.3.6 - acorn: 8.12.1 + '@jridgewell/source-map': 0.3.11 + acorn: 8.15.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -5190,38 +4374,32 @@ snapshots: tinybench@2.9.0: {} - tinyexec@0.3.0: {} + tinyexec@0.3.2: {} - tinyglobby@0.2.9: + tinyglobby@0.2.14: dependencies: - fdir: 6.4.0(picomatch@4.0.2) - picomatch: 4.0.2 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 - tinypool@1.0.1: {} + tinypool@1.1.1: {} tinyrainbow@1.2.0: {} tinyspy@3.0.2: {} - tldts-core@6.1.75: {} + tldts-core@6.1.86: {} - tldts@6.1.75: + tldts@6.1.86: dependencies: - tldts-core: 6.1.75 - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-fast-properties@2.0.0: {} + tldts-core: 6.1.86 to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - tough-cookie@5.1.0: + tough-cookie@5.1.2: dependencies: - tldts: 6.1.75 + tldts: 6.1.86 tr46@0.0.3: {} @@ -5229,94 +4407,50 @@ snapshots: dependencies: punycode: 2.3.1 - tr46@5.0.0: + tr46@5.1.1: dependencies: punycode: 2.3.1 tree-kill@1.2.2: {} - ts-api-utils@2.0.0(typescript@5.6.2): + ts-api-utils@2.1.0(typescript@5.6.3): dependencies: - typescript: 5.6.2 + typescript: 5.6.3 ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@22.15.0)(typescript@5.8.3): - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 22.15.0 - acorn: 8.14.0 - acorn-walk: 8.3.4 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.8.3 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - - tsup@8.3.0(postcss@8.5.1)(tsx@4.19.1)(typescript@5.6.2): - dependencies: - bundle-require: 5.0.0(esbuild@0.23.1) - cac: 6.7.14 - chokidar: 3.6.0 - consola: 3.2.3 - debug: 4.3.7 - esbuild: 0.23.1 - execa: 5.1.1 - joycon: 3.1.1 - picocolors: 1.1.0 - postcss-load-config: 6.0.1(postcss@8.5.1)(tsx@4.19.1) - resolve-from: 5.0.0 - rollup: 4.24.0 - source-map: 0.8.0-beta.0 - sucrase: 3.35.0 - tinyglobby: 0.2.9 - tree-kill: 1.2.2 - optionalDependencies: - postcss: 8.5.1 - typescript: 5.6.2 - transitivePeerDependencies: - - jiti - - supports-color - - tsx - - yaml - - tsup@8.3.0(postcss@8.5.1)(tsx@4.19.1)(typescript@5.8.3): + tsup@8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.6.3): dependencies: - bundle-require: 5.0.0(esbuild@0.23.1) + bundle-require: 5.1.0(esbuild@0.25.9) cac: 6.7.14 - chokidar: 3.6.0 - consola: 3.2.3 - debug: 4.3.7 - esbuild: 0.23.1 - execa: 5.1.1 + chokidar: 4.0.3 + consola: 3.4.2 + debug: 4.4.1 + esbuild: 0.25.9 + fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 - picocolors: 1.1.0 - postcss-load-config: 6.0.1(postcss@8.5.1)(tsx@4.19.1) + picocolors: 1.1.1 + postcss-load-config: 6.0.1(postcss@8.5.6)(tsx@4.20.4) resolve-from: 5.0.0 - rollup: 4.24.0 + rollup: 4.46.3 source-map: 0.8.0-beta.0 sucrase: 3.35.0 - tinyglobby: 0.2.9 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 tree-kill: 1.2.2 optionalDependencies: - postcss: 8.5.1 - typescript: 5.8.3 + postcss: 8.5.6 + typescript: 5.6.3 transitivePeerDependencies: - jiti - supports-color - tsx - yaml - tsx@4.19.1: + tsx@4.20.4: dependencies: - esbuild: 0.23.1 - get-tsconfig: 4.8.1 + esbuild: 0.25.9 + get-tsconfig: 4.10.1 optionalDependencies: fsevents: 2.3.3 @@ -5324,44 +4458,44 @@ snapshots: dependencies: prelude-ls: 1.2.1 - typescript-eslint@8.21.0(eslint@9.18.0)(typescript@5.6.2): + typescript-eslint@8.40.0(eslint@9.33.0)(typescript@5.6.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.21.0(@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.6.2))(eslint@9.18.0)(typescript@5.6.2) - '@typescript-eslint/parser': 8.21.0(eslint@9.18.0)(typescript@5.6.2) - '@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.6.2) - eslint: 9.18.0 - typescript: 5.6.2 + '@typescript-eslint/eslint-plugin': 8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.6.3))(eslint@9.33.0)(typescript@5.6.3) + '@typescript-eslint/parser': 8.40.0(eslint@9.33.0)(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.6.3) + '@typescript-eslint/utils': 8.40.0(eslint@9.33.0)(typescript@5.6.3) + eslint: 9.33.0 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - typescript@5.6.2: {} + typescript@5.6.3: {} - typescript@5.8.3: {} + ufo@1.6.1: {} - undici-types@6.21.0: {} + undici-types@7.10.0: {} - undici@6.19.8: {} + undici@6.21.3: {} universalify@0.1.2: {} - update-browserslist-db@1.1.1(browserslist@4.24.0): + update-browserslist-db@1.1.3(browserslist@4.25.2): dependencies: - browserslist: 4.24.0 + browserslist: 4.25.2 escalade: 3.2.0 - picocolors: 1.1.0 + picocolors: 1.1.1 uri-js@4.4.1: dependencies: punycode: 2.3.1 - v8-compile-cache-lib@3.0.1: {} - - vite-node@2.1.2(@types/node@22.15.0)(terser@5.34.1): + vite-node@2.1.9(@types/node@24.3.0)(terser@5.43.1): dependencies: cac: 6.7.14 - debug: 4.3.7 + debug: 4.4.1 + es-module-lexer: 1.7.0 pathe: 1.1.2 - vite: 5.4.8(@types/node@22.15.0)(terser@5.34.1) + vite: 5.4.19(@types/node@24.3.0)(terser@5.43.1) transitivePeerDependencies: - '@types/node' - less @@ -5373,51 +4507,55 @@ snapshots: - supports-color - terser - vite@5.4.8(@types/node@22.15.0)(terser@5.34.1): + vite@5.4.19(@types/node@24.3.0)(terser@5.43.1): dependencies: esbuild: 0.21.5 - postcss: 8.4.47 - rollup: 4.24.0 + postcss: 8.5.6 + rollup: 4.46.3 optionalDependencies: - '@types/node': 22.15.0 + '@types/node': 24.3.0 fsevents: 2.3.3 - terser: 5.34.1 + terser: 5.43.1 - vite@6.0.11(@types/node@22.15.0)(terser@5.34.1)(tsx@4.19.1): + vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4): dependencies: - esbuild: 0.24.2 - postcss: 8.5.1 - rollup: 4.24.0 + esbuild: 0.25.9 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.46.3 + tinyglobby: 0.2.14 optionalDependencies: - '@types/node': 22.15.0 + '@types/node': 24.3.0 fsevents: 2.3.3 - terser: 5.34.1 - tsx: 4.19.1 - - vitest@2.1.2(@types/node@22.15.0)(jsdom@26.0.0)(terser@5.34.1): - dependencies: - '@vitest/expect': 2.1.2 - '@vitest/mocker': 2.1.2(@vitest/spy@2.1.2)(vite@5.4.8(@types/node@22.15.0)(terser@5.34.1)) - '@vitest/pretty-format': 2.1.2 - '@vitest/runner': 2.1.2 - '@vitest/snapshot': 2.1.2 - '@vitest/spy': 2.1.2 - '@vitest/utils': 2.1.2 - chai: 5.1.1 - debug: 4.3.7 - magic-string: 0.30.11 + terser: 5.43.1 + tsx: 4.20.4 + + vitest@2.1.9(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1): + dependencies: + '@vitest/expect': 2.1.9 + '@vitest/mocker': 2.1.9(vite@5.4.19(@types/node@24.3.0)(terser@5.43.1)) + '@vitest/pretty-format': 2.1.9 + '@vitest/runner': 2.1.9 + '@vitest/snapshot': 2.1.9 + '@vitest/spy': 2.1.9 + '@vitest/utils': 2.1.9 + chai: 5.3.1 + debug: 4.4.1 + expect-type: 1.2.2 + magic-string: 0.30.17 pathe: 1.1.2 - std-env: 3.7.0 + std-env: 3.9.0 tinybench: 2.9.0 - tinyexec: 0.3.0 - tinypool: 1.0.1 + tinyexec: 0.3.2 + tinypool: 1.1.1 tinyrainbow: 1.2.0 - vite: 5.4.8(@types/node@22.15.0)(terser@5.34.1) - vite-node: 2.1.2(@types/node@22.15.0)(terser@5.34.1) + vite: 5.4.19(@types/node@24.3.0)(terser@5.43.1) + vite-node: 2.1.9(@types/node@24.3.0)(terser@5.43.1) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.15.0 - jsdom: 26.0.0 + '@types/node': 24.3.0 + jsdom: 26.1.0 transitivePeerDependencies: - less - lightningcss @@ -5445,9 +4583,9 @@ snapshots: whatwg-mimetype@4.0.0: {} - whatwg-url@14.1.0: + whatwg-url@14.2.0: dependencies: - tr46: 5.0.0 + tr46: 5.1.1 webidl-conversions: 7.0.0 whatwg-url@5.0.0: @@ -5461,10 +4599,6 @@ snapshots: tr46: 1.0.1 webidl-conversions: 4.0.2 - which@1.3.1: - dependencies: - isexe: 2.0.0 - which@2.0.2: dependencies: isexe: 2.0.0 @@ -5488,16 +4622,12 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 - ws@8.18.0: {} + ws@8.18.3: {} xml-name-validator@5.0.0: {} xmlchars@2.2.0: {} - yallist@2.1.2: {} - yallist@3.1.1: {} - yn@3.1.1: {} - yocto-queue@0.1.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 00000000000..4999aa5bec4 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +packages: + - 'crates/bindings-typescript' + - 'sdks/typescript' + - 'sdks/typescript/packages/*' + - 'sdks/typescript/examples/**' \ No newline at end of file diff --git a/sdks/typescript/packages/sdk/package.json b/sdks/typescript/packages/sdk/package.json index 4f88a472860..eb53198e5d7 100644 --- a/sdks/typescript/packages/sdk/package.json +++ b/sdks/typescript/packages/sdk/package.json @@ -42,11 +42,12 @@ "undici": "^6.19.2" }, "devDependencies": { - "@clockworklabs/test-app": "file:../test-app", + "@clockworklabs/test-app": "workspace:^", "tsup": "^8.1.0", "undici": "^6.19.2" }, "dependencies": { + "spacetimedb": "workspace:^", "@zxing/text-encoding": "^0.9.0", "base64-js": "^1.5.1" } diff --git a/sdks/typescript/packages/sdk/src/db_connection_builder.ts b/sdks/typescript/packages/sdk/src/db_connection_builder.ts index ed62b93eff0..5461019aead 100644 --- a/sdks/typescript/packages/sdk/src/db_connection_builder.ts +++ b/sdks/typescript/packages/sdk/src/db_connection_builder.ts @@ -1,6 +1,6 @@ import { DbConnectionImpl, type ConnectionEvent } from './db_connection_impl'; import { EventEmitter } from './event_emitter'; -import type { Identity } from './identity'; +import type { Identity } from 'spacetimedb'; import type RemoteModule from './spacetime_module'; import { ensureMinimumVersionOrThrow } from './version'; import { WebsocketDecompressAdapter } from './websocket_decompress_adapter'; diff --git a/sdks/typescript/packages/sdk/src/db_connection_impl.ts b/sdks/typescript/packages/sdk/src/db_connection_impl.ts index 24075e0ed90..453be763383 100644 --- a/sdks/typescript/packages/sdk/src/db_connection_impl.ts +++ b/sdks/typescript/packages/sdk/src/db_connection_impl.ts @@ -1,4 +1,4 @@ -import { ConnectionId } from './connection_id'; +import { ConnectionId } from 'spacetimedb'; import { AlgebraicType, ProductType, @@ -6,23 +6,22 @@ import { SumType, SumTypeVariant, type ComparablePrimitive, -} from './algebraic_type.ts'; +} from 'spacetimedb'; import { AlgebraicValue, parseValue, ProductValue, type ReducerArgsAdapter, type ValueAdapter, -} from './algebraic_value.ts'; -import BinaryReader from './binary_reader.ts'; -import BinaryWriter from './binary_writer.ts'; +} from 'spacetimedb'; +import { BinaryReader } from 'spacetimedb'; +import { BinaryWriter } from 'spacetimedb'; import { BsatnRowList } from './client_api/bsatn_row_list_type.ts'; import { ClientMessage } from './client_api/client_message_type.ts'; import { DatabaseUpdate } from './client_api/database_update_type.ts'; import { QueryUpdate } from './client_api/query_update_type.ts'; import { ServerMessage } from './client_api/server_message_type.ts'; import { TableUpdate as RawTableUpdate } from './client_api/table_update_type.ts'; -import type * as clientApi from './client_api/index.ts'; import { ClientCache } from './client_cache.ts'; import { DbConnectionBuilder } from './db_connection_builder.ts'; import { type DbContext } from './db_context.ts'; @@ -35,7 +34,7 @@ import { } from './event_context.ts'; import { EventEmitter } from './event_emitter.ts'; import { decompress } from './decompress.ts'; -import type { Identity } from './identity.ts'; +import type { Identity } from 'spacetimedb'; import type { IdentityTokenMessage, Message, @@ -50,7 +49,7 @@ import { type PendingCallback, type TableUpdate as CacheTableUpdate, } from './table_cache.ts'; -import { deepEqual, toPascalCase } from './utils.ts'; +import { deepEqual } from 'spacetimedb'; import { WebsocketDecompressAdapter } from './websocket_decompress_adapter.ts'; import type { WebsocketTestAdapter } from './websocket_test_adapter.ts'; import { diff --git a/sdks/typescript/packages/sdk/src/index.ts b/sdks/typescript/packages/sdk/src/index.ts index 7aa615aaebe..a2d8f33117a 100644 --- a/sdks/typescript/packages/sdk/src/index.ts +++ b/sdks/typescript/packages/sdk/src/index.ts @@ -1,10 +1,12 @@ + // Should be at the top as other modules depend on it export * from './db_connection_impl.ts'; -export * from './connection_id.ts'; -export * from './schedule_at'; +export * from "spacetimedb"; +// export * from "./connection_id"; +// export * from './schedule_at'; export * from './client_cache.ts'; -export * from './identity.ts'; +// export * from './identity.ts'; export * from './message_types.ts'; -export * from './timestamp.ts'; -export * from './time_duration.ts'; +// export * from './timestamp.ts'; +// export * from './time_duration.ts'; diff --git a/sdks/typescript/packages/sdk/src/message_types.ts b/sdks/typescript/packages/sdk/src/message_types.ts index 3ce1f9ca982..f3af8f700e8 100644 --- a/sdks/typescript/packages/sdk/src/message_types.ts +++ b/sdks/typescript/packages/sdk/src/message_types.ts @@ -1,8 +1,8 @@ -import { ConnectionId } from './connection_id'; +import { ConnectionId } from 'spacetimedb'; import type { UpdateStatus } from './client_api/index.ts'; -import { Identity } from './identity.ts'; +import { Identity } from 'spacetimedb'; import type { TableUpdate } from './table_cache.ts'; -import { Timestamp } from './timestamp.ts'; +import { Timestamp } from 'spacetimedb'; export type InitialSubscriptionMessage = { tag: 'InitialSubscription'; diff --git a/sdks/typescript/packages/sdk/src/reducer_event.ts b/sdks/typescript/packages/sdk/src/reducer_event.ts index 8711dbfb139..f91717d316f 100644 --- a/sdks/typescript/packages/sdk/src/reducer_event.ts +++ b/sdks/typescript/packages/sdk/src/reducer_event.ts @@ -1,7 +1,7 @@ -import { ConnectionId } from './connection_id'; -import { Timestamp } from './timestamp.ts'; +import { ConnectionId } from 'spacetimedb'; +import { Timestamp } from 'spacetimedb'; import type { UpdateStatus } from './client_api/index.ts'; -import { Identity } from './identity.ts'; +import { Identity } from 'spacetimedb'; export type ReducerInfoType = { name: string; args?: any } | never; diff --git a/sdks/typescript/packages/sdk/src/serializer.ts b/sdks/typescript/packages/sdk/src/serializer.ts index ca1130adbd7..8736e389444 100644 --- a/sdks/typescript/packages/sdk/src/serializer.ts +++ b/sdks/typescript/packages/sdk/src/serializer.ts @@ -1,6 +1,6 @@ -import { AlgebraicType } from './algebraic_type'; -import type { MapValue } from './algebraic_value'; -import BinaryWriter from './binary_writer'; +import { AlgebraicType } from '../../../../../crates/bindings-typescript/src/algebraic_type'; +import type { MapValue } from '../../../../../crates/bindings-typescript/src/algebraic_value'; +import BinaryWriter from '../../../../../crates/bindings-typescript/src/binary_writer'; export interface Serializer { write(type: AlgebraicType, value: any): any; diff --git a/sdks/typescript/packages/sdk/src/spacetime_module.ts b/sdks/typescript/packages/sdk/src/spacetime_module.ts index 1ccefe2deb5..bc3839fdc0d 100644 --- a/sdks/typescript/packages/sdk/src/spacetime_module.ts +++ b/sdks/typescript/packages/sdk/src/spacetime_module.ts @@ -1,4 +1,4 @@ -import type { AlgebraicType } from './algebraic_type'; +import type { AlgebraicType } from '../../../../../crates/bindings-typescript/src/algebraic_type'; import type { DbConnectionImpl } from './db_connection_impl'; export interface TableRuntimeTypeInfo { diff --git a/sdks/typescript/packages/sdk/src/table_cache.ts b/sdks/typescript/packages/sdk/src/table_cache.ts index 8763c2189f6..54067f21a14 100644 --- a/sdks/typescript/packages/sdk/src/table_cache.ts +++ b/sdks/typescript/packages/sdk/src/table_cache.ts @@ -6,7 +6,7 @@ import { type EventContextInterface, } from './db_connection_impl.ts'; import { stdbLogger } from './logger.ts'; -import type { ComparablePrimitive } from './algebraic_type.ts'; +import type { ComparablePrimitive } from 'spacetimedb'; export type Operation = { type: 'insert' | 'delete'; diff --git a/sdks/typescript/packages/sdk/src/test.ts b/sdks/typescript/packages/sdk/src/test.ts deleted file mode 100644 index 3b0121f2351..00000000000 --- a/sdks/typescript/packages/sdk/src/test.ts +++ /dev/null @@ -1,353 +0,0 @@ -import { AlgebraicType, ProductType, ProductTypeElement, SumTypeVariant } from "./algebraic_type"; - -type RawIdentifier = string; - -type AlgebraicTypeRef = number; - -type ColId = number; - -type ColList = ColId[]; - -type RawIndexAlgorithm = - { tag: "btree", value: { columns: ColList } } | - { tag: "hash", value: { columns: ColList } } | - { tag: "direct", value: { column: ColId } }; - -type Typespace = { - types: AlgebraicType[]; -} - -type RawIndexDefV9 = { - name?: string, - accessor_name?: RawIdentifier, - algorithm: RawIndexAlgorithm, -} - -type RawUniqueConstraintDataV9 = { columns: ColList }; - -type RawConstraintDataV9 = - { tag: "unique", value: RawUniqueConstraintDataV9 }; - -type RawConstraintDefV9 = { - name?: string, - data: RawConstraintDataV9, -} - -type RawSequenceDefV9 = { - name?: RawIdentifier, - column: ColId, - start?: number, - minValue?: number, - maxValue?: number, - increment: number -}; - -type TableType = "system" | "user"; -type TableAccess = "public" | "private"; - -type RawScheduleDefV9 = { - name?: RawIdentifier, - reducerName: RawIdentifier, - scheduledAtColumn: ColId, -}; - -type RawTableDefV9 = { - name: RawIdentifier, - productTypeRef: AlgebraicTypeRef, - primaryKey: ColList, - indexes: RawIndexDefV9[], - constraints: RawConstraintDefV9[], - sequences: RawSequenceDefV9[], - schedule?: RawScheduleDefV9, - tableType: TableType, - tableAccess: TableAccess, -}; - -type RawReducerDefV9 = { - name: RawIdentifier, - params: ProductType, - lifecycle?: "init" | "on_connect" | "on_disconnect", -} - -type RawScopedTypeNameV9 = { - name: RawIdentifier, - scope: RawIdentifier[], -} - -type RawTypeDefV9 = { - name: RawScopedTypeNameV9, - ty: AlgebraicTypeRef, - customOrdering: boolean, -} - -type RawMiscModuleExportV9 = never; - -type RawSql = string; -type RawRowLevelSecurityDefV9 = { - sql: RawSql -}; - -type RawModuleDef = { tag: "v8" } | { tag: "v9", value: RawModuleDefV9 }; - -type RawModuleDefV9 = { - typespace: Typespace, - tables: RawTableDefV9[], - reducers: RawReducerDefV9[], - types: RawTypeDefV9[], - miscExports: RawMiscModuleExportV9[], - rowLevelSecurity: RawRowLevelSecurityDefV9[], -} - -const moduleDef: RawModuleDefV9 = { - typespace: { types: [] }, - tables: [], - reducers: [], - types: [], - miscExports: [], - rowLevelSecurity: [], -} - -/* ---------- column builder ---------- */ -type Merge = M1 & Omit; - -export interface ColumnBuilder< - JS, // the JavaScript/TypeScript value type - M = {} // accumulated metadata: indexes, PKs, … -> { - /** phantom – gives the column’s JS type to the compiler */ - readonly __type__: JS; - readonly __spacetime_type__: AlgebraicType; - - index(name?: N): - ColumnBuilder>; - - primary_key(): - ColumnBuilder>; - - auto_inc(): - ColumnBuilder>; -} - -/* minimal runtime implementation – chainable, metadata ignored */ -function col< - JS, ->(__spacetime_type__: AlgebraicType): ColumnBuilder { - const c: any = { __spacetime_type__ }; - c.index = () => c; - c.primary_key = () => c; - c.auto_inc = () => c; - return c; -} - -/* ---------- primitive factories ---------- */ -export const t = { - /* ───── primitive scalars ───── */ - bool: (): ColumnBuilder => col(AlgebraicType.createBoolType()), - string: (): ColumnBuilder => col(AlgebraicType.createStringType()), - - /* integers share JS = number but differ in Kind */ - i8: (): ColumnBuilder => col(AlgebraicType.createI8Type()), - u8: (): ColumnBuilder => col(AlgebraicType.createU8Type()), - i16: (): ColumnBuilder => col(AlgebraicType.createI16Type()), - u16: (): ColumnBuilder => col(AlgebraicType.createU16Type()), - i32: (): ColumnBuilder => col(AlgebraicType.createI32Type()), - u32: (): ColumnBuilder => col(AlgebraicType.createU32Type()), - i64: (): ColumnBuilder => col(AlgebraicType.createI64Type()), - u64: (): ColumnBuilder => col(AlgebraicType.createU64Type()), - i128: (): ColumnBuilder => col(AlgebraicType.createI128Type()), - u128: (): ColumnBuilder => col(AlgebraicType.createU128Type()), - i256: (): ColumnBuilder => col(AlgebraicType.createI256Type()), - u256: (): ColumnBuilder => col(AlgebraicType.createU256Type()), - - f32: (): ColumnBuilder => col(AlgebraicType.createF32Type()), - f64: (): ColumnBuilder => col(AlgebraicType.createF64Type()), - - number: (): ColumnBuilder => col(AlgebraicType.createF64Type()), - - /* ───── structured builders ───── */ - object>>(def: Def) { - return { - ...col( - AlgebraicType.createProductType( - Object.entries(def).map(([n, c]) => - new ProductTypeElement(n, c.__spacetime_type__)) - ) - ), - __is_product_type__: true, - } as ProductTypeColumnBuilder; - }, - - array>(e: E): ColumnBuilder[]> { - return col[]>(AlgebraicType.createArrayType(e.__spacetime_type__)); - }, - - enum< - V extends Record>, - >(variants: V): ColumnBuilder< - { [K in keyof V]: { tag: K } & { value: Infer } }[keyof V] - > { - return col< - { [K in keyof V]: { tag: K } & { value: Infer } }[keyof V] - >( - AlgebraicType.createSumType( - Object.entries(variants).map( - ([n, c]) => new SumTypeVariant(n, c.__spacetime_type__) - ) - ) - ); - }, - -} as const; - -/* ─── brand marker ─────────────────────────── */ -interface ProductTypeBrand { - /** compile-time only – never set at runtime */ - readonly __is_product_type__: true; -} - -/* ─── helper for ColumnBuilder that carries the brand ───────────────── */ -export type ProductTypeColumnBuilder< - Def extends Record> -> = ColumnBuilder< - { [K in keyof Def]: ColumnType }> & ProductTypeBrand; - -/* ---------- utility: Infer ---------- */ -type ColumnType = - C extends ColumnBuilder ? JS : never; - -export type Infer = - S extends ColumnBuilder - ? JS - : never; - -/* ---------- table() ---------- */ -export function table< - Name extends string, - Schema extends ProductTypeColumnBuilder ->({ name, schema }: { name: Name, schema: Schema }) { - moduleDef.tables.push({ - name, - productTypeRef: moduleDef.typespace.types.length, - primaryKey: [], - indexes: [], - constraints: [], - sequences: [], - schedule: undefined, - tableType: "user", - tableAccess: "private", - }); - return { - index( - name: IName, - _def: I - ): undefined { - return void 0; - }, - }; -} - -/* ---------- reducer() ---------- */ -type ParamsAsObject

>> = { - [K in keyof P]: Infer; -}; - -export function reducer< - Name extends string, - Params extends Record>, - Ctx = unknown ->( - name: Name, - params: Params, - fn: (ctx: Ctx, payload: ParamsAsObject) => void, -): undefined { - /* compile‑time only */ - return void 0; -} - -/* ---------- procedure() ---------- */ -export function procedure< - Name extends string, - Params extends Record>, - Ctx, - R ->( - name: Name, - params: Params, - fn: (ctx: Ctx, payload: ParamsAsObject) => Promise | R, -): undefined { - return void 0; -} - -const point = t.object({ - x: t.f64(), - y: t.f64(), -}); -type Point = Infer; - -const user = t.object({ - id: t.string(), - name: t.string().index("btree"), - email: t.string(), - age: t.number(), -}); -type User = Infer; - -table("user", user); -table("logged_out_user", user); - -const player = t.object({ - id: t.u32().primary_key().auto_inc(), - name: t.string().index("btree"), - score: t.number(), - level: t.number(), - foo: t.number(), - bar: t.object({ - x: t.f64(), - y: t.f64(), - }), - baz: t.enum({ - Foo: t.f64(), - Bar: t.f64(), - Baz: t.string(), - }), -}); - -table("player", player).index("foobar", { - btree: { - columns: ["name", "score"], - } -}); - -reducer("move_player", { user, foo: point, player }, (ctx, { user, foo: Point, player }) => { - if (player.baz.tag === "Foo") { - player.baz.value += 1; - } else if (player.baz.tag === "Bar") { - player.baz.value += 2; - } else if (player.baz.tag === "Baz") { - player.baz.value += "!"; - } -}); - -procedure("get_user", { user }, async (ctx, { user }) => { - // return ctx.db.query("SELECT * FROM user WHERE id = ?", [user.id]); -}); - -////// - - -// const t = AlgebraicType; - -// function spacetimeType(foo: AlgebraicType) { - -// } - -// const Foo = spacetimeType(t.createProductType([ -// new ProductTypeElement("x", t.createSumType([ -// new SumTypeVariant("Bar1", t.createF64Type()), -// new SumTypeVariant("Bar2", t.createF64Type()), -// ])), -// new ProductTypeElement("y", t.createSumType([ -// new SumTypeVariant("Foo1", t.createF64Type()), -// new SumTypeVariant("Foo2", t.createF64Type()), -// ])), -// ])); \ No newline at end of file diff --git a/sdks/typescript/packages/sdk/tsconfig.json b/sdks/typescript/packages/sdk/tsconfig.json index 8c28df00aa8..c0e0365fcae 100644 --- a/sdks/typescript/packages/sdk/tsconfig.json +++ b/sdks/typescript/packages/sdk/tsconfig.json @@ -15,8 +15,13 @@ "moduleResolution": "Bundler", "allowSyntheticDefaultImports": true, "isolatedDeclarations": true, - "isolatedModules": true + "isolatedModules": true, + + "baseUrl": ".", + "paths": { + "spacetimedb": ["../../../crates/bindings-typescript/src/index.ts"] + } }, - "include": ["src/**/*"], + "include": ["src/**/*", "tests/**/*"], "exclude": ["node_modules", "**/__tests__/*", "dist/**/*"] } diff --git a/sdks/typescript/packages/sdk/tsup.config.ts b/sdks/typescript/packages/sdk/tsup.config.ts new file mode 100644 index 00000000000..352e9f84dbd --- /dev/null +++ b/sdks/typescript/packages/sdk/tsup.config.ts @@ -0,0 +1,90 @@ +import path from 'node:path'; +import { defineConfig } from 'tsup'; + +// Hard path to the spacetimedb source file +const STDB_SRC = path.resolve( + __dirname, + '../../../../crates/bindings-typescript/src/index.ts' +); + +// Minimal alias plugin: rewrites "spacetimedb" to STDB_SRC +function aliasSpacetimedb() { + return { + name: 'alias-spacetimedb', + setup(build: any) { + build.onResolve({ filter: /^spacetimedb$/ }, () => ({ path: STDB_SRC })); + }, + }; +} + +function commonEsbuildTweaks() { + return (options: any) => { + // Prefer package.json "exports" condition "source" + // Fall back to normal import/default if a dep doesn't have it + options.conditions = ['source', 'import', 'default']; + // Some ecosystems still look at these; harmless to set + options.mainFields = ['browser', 'module', 'main']; + }; +} + +export default defineConfig([ + { + entryPoints: { + index: 'src/index.ts', + }, + format: ['esm'], + target: 'es2022', + legacyOutput: false, + dts: { + resolve: true, + }, + outDir: 'dist', + clean: true, + platform: 'browser', + noExternal: ['spacetimedb', 'brotli', 'buffer'], + treeshake: 'smallest', + external: ['undici'], + env: { + BROWSER: 'false', + }, + esbuildPlugins: [aliasSpacetimedb()], + esbuildOptions: commonEsbuildTweaks(), + }, + { + entryPoints: { + index: 'src/index.ts', + }, + format: ['esm'], + target: 'es2022', + legacyOutput: false, + dts: false, + outDir: 'dist/browser', + clean: true, + platform: 'browser', + noExternal: ['spacetimedb', 'brotli', 'buffer'], + treeshake: 'smallest', + external: ['undici'], + env: { + BROWSER: 'true', + }, + esbuildPlugins: [aliasSpacetimedb()], + esbuildOptions: commonEsbuildTweaks(), + }, + { + entryPoints: { + index: 'src/index.ts', + }, + format: ['esm'], + target: 'es2022', + outDir: 'dist/min', + dts: false, + sourcemap: true, + noExternal: ['spacetimedb', 'brotli', 'buffer', 'events'], + treeshake: 'smallest', + minify: 'terser', + platform: 'browser', + external: ['undici'], + esbuildPlugins: [aliasSpacetimedb()], + esbuildOptions: commonEsbuildTweaks(), + }, +]); diff --git a/sdks/typescript/pnpm-workspace.yaml b/sdks/typescript/pnpm-workspace.yaml deleted file mode 100644 index 02495561277..00000000000 --- a/sdks/typescript/pnpm-workspace.yaml +++ /dev/null @@ -1,3 +0,0 @@ -packages: - - 'packages/*' - - 'examples/**' diff --git a/sdks/typescript/tsup.config.ts b/sdks/typescript/tsup.config.ts deleted file mode 100644 index 779fe900a4e..00000000000 --- a/sdks/typescript/tsup.config.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig([ - { - entryPoints: { - index: 'src/index.ts', - }, - format: ['esm'], - target: 'es2022', - legacyOutput: false, - dts: { - resolve: true, - }, - clean: true, - platform: 'browser', - noExternal: ['brotli', 'buffer'], - treeshake: 'smallest', - external: ['undici'], - env: { - BROWSER: 'false', - }, - }, - { - entryPoints: { - index: 'src/index.ts', - }, - format: ['esm'], - target: 'es2022', - legacyOutput: false, - dts: false, - outDir: 'dist/browser', - clean: true, - platform: 'browser', - noExternal: ['brotli', 'buffer'], - treeshake: 'smallest', - external: ['undici'], - env: { - BROWSER: 'true', - }, - }, - { - entryPoints: { - index: 'src/index.ts', - }, - format: ['esm'], - target: 'es2022', - outDir: 'dist/min', - dts: false, - sourcemap: true, - noExternal: ['brotli', 'buffer', 'events'], - treeshake: 'smallest', - minify: 'terser', - platform: 'browser', - external: ['undici'], - }, -]); From 859c9ca7e2a7a77f93659c90d7ac1219b4774d5b Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 19 Aug 2025 19:25:11 -0400 Subject: [PATCH 04/37] Now using the code generated AlgebraicType and related types --- crates/bindings-typescript/package.json | 1 - .../bindings-typescript/src/algebraic_type.ts | 1597 ++++++++++------- .../src/algebraic_value.ts | 321 ---- .../src/autogen/algebraic_type_type.ts | 157 ++ .../src/autogen/index_type_type.ts | 82 + .../src/autogen/lifecycle_type.ts | 86 + .../src/autogen/misc_module_export_type.ts | 80 + .../src/autogen/product_type_element_type.ts | 70 + .../src/autogen/product_type_type.ts | 68 + .../src/autogen/raw_column_def_v_8_type.ts | 70 + .../autogen/raw_constraint_data_v_9_type.ts | 80 + .../autogen/raw_constraint_def_v_8_type.ts | 70 + .../autogen/raw_constraint_def_v_9_type.ts | 70 + .../src/autogen/raw_index_algorithm_type.ts | 86 + .../src/autogen/raw_index_def_v_8_type.ts | 74 + .../src/autogen/raw_index_def_v_9_type.ts | 72 + .../raw_misc_module_export_v_9_type.ts | 75 + .../src/autogen/raw_module_def_type.ts | 85 + .../src/autogen/raw_module_def_v_8_type.ts | 77 + .../src/autogen/raw_module_def_v_9_type.ts | 83 + .../src/autogen/raw_reducer_def_v_9_type.ts | 73 + .../raw_row_level_security_def_v_9_type.ts | 66 + .../src/autogen/raw_schedule_def_v_9_type.ts | 70 + .../autogen/raw_scoped_type_name_v_9_type.ts | 68 + .../src/autogen/raw_sequence_def_v_8_type.ts | 78 + .../src/autogen/raw_sequence_def_v_9_type.ts | 76 + .../src/autogen/raw_table_def_v_8_type.ts | 85 + .../src/autogen/raw_table_def_v_9_type.ts | 89 + .../src/autogen/raw_type_def_v_9_type.ts | 72 + .../raw_unique_constraint_data_v_9_type.ts | 66 + .../src/autogen/reducer_def_type.ts | 70 + .../src/autogen/sum_type_type.ts | 68 + .../src/autogen/sum_type_variant_type.ts | 70 + .../src/autogen/table_access_type.ts | 82 + .../src/autogen/table_desc_type.ts | 70 + .../src/autogen/table_type_type.ts | 82 + .../src/autogen/type_alias_type.ts | 68 + .../src/autogen/typespace_type.ts | 68 + crates/client-api-messages/DEVELOP.md | 2 +- .../examples/regen-typescript-moduledef.rs | 50 + crates/codegen/src/typescript.rs | 95 +- pnpm-lock.yaml | 33 +- .../examples/quickstart-chat/package.json | 5 +- .../sdk/src/client_api/bsatn_row_list_type.ts | 54 +- .../sdk/src/client_api/call_reducer_type.ts | 57 +- .../sdk/src/client_api/client_message_type.ts | 162 +- .../compressable_query_update_type.ts | 98 +- .../src/client_api/database_update_type.ts | 49 +- .../sdk/src/client_api/energy_quanta_type.ts | 42 +- .../sdk/src/client_api/identity_token_type.ts | 53 +- .../packages/sdk/src/client_api/index.ts | 168 +- .../client_api/initial_subscription_type.ts | 63 +- .../client_api/one_off_query_response_type.ts | 75 +- .../sdk/src/client_api/one_off_query_type.ts | 49 +- .../sdk/src/client_api/one_off_table_type.ts | 51 +- .../sdk/src/client_api/query_id_type.ts | 42 +- .../sdk/src/client_api/query_update_type.ts | 54 +- .../src/client_api/reducer_call_info_type.ts | 62 +- .../sdk/src/client_api/row_size_hint_type.ts | 68 +- .../sdk/src/client_api/server_message_type.ts | 223 +-- .../src/client_api/subscribe_applied_type.ts | 69 +- .../subscribe_multi_applied_type.ts | 71 +- .../src/client_api/subscribe_multi_type.ts | 55 +- .../sdk/src/client_api/subscribe_rows_type.ts | 55 +- .../src/client_api/subscribe_single_type.ts | 57 +- .../sdk/src/client_api/subscribe_type.ts | 49 +- .../src/client_api/subscription_error_type.ts | 75 +- .../sdk/src/client_api/table_update_type.ts | 61 +- .../transaction_update_light_type.ts | 61 +- .../src/client_api/transaction_update_type.ts | 95 +- .../client_api/unsubscribe_applied_type.ts | 69 +- .../unsubscribe_multi_applied_type.ts | 74 +- .../src/client_api/unsubscribe_multi_type.ts | 53 +- .../sdk/src/client_api/unsubscribe_type.ts | 48 +- .../sdk/src/client_api/update_status_type.ts | 80 +- .../packages/sdk/src/db_connection_impl.ts | 22 +- sdks/typescript/packages/sdk/src/index.ts | 5 - .../packages/sdk/src/spacetime_module.ts | 2 +- .../sdk/src/websocket_test_adapter.ts | 14 +- .../packages/sdk/tests/algebraic_type.test.ts | 170 ++ .../sdk/tests/algebraic_value.test.ts | 170 -- .../sdk/tests/binary_read_write.test.ts | 3 +- .../packages/sdk/tests/db_connection.test.ts | 33 +- .../packages/sdk/tests/table_cache.test.ts | 79 +- sdks/typescript/vitest.config.ts | 15 +- 85 files changed, 5188 insertions(+), 2477 deletions(-) create mode 100644 crates/bindings-typescript/src/autogen/algebraic_type_type.ts create mode 100644 crates/bindings-typescript/src/autogen/index_type_type.ts create mode 100644 crates/bindings-typescript/src/autogen/lifecycle_type.ts create mode 100644 crates/bindings-typescript/src/autogen/misc_module_export_type.ts create mode 100644 crates/bindings-typescript/src/autogen/product_type_element_type.ts create mode 100644 crates/bindings-typescript/src/autogen/product_type_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_module_def_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/reducer_def_type.ts create mode 100644 crates/bindings-typescript/src/autogen/sum_type_type.ts create mode 100644 crates/bindings-typescript/src/autogen/sum_type_variant_type.ts create mode 100644 crates/bindings-typescript/src/autogen/table_access_type.ts create mode 100644 crates/bindings-typescript/src/autogen/table_desc_type.ts create mode 100644 crates/bindings-typescript/src/autogen/table_type_type.ts create mode 100644 crates/bindings-typescript/src/autogen/type_alias_type.ts create mode 100644 crates/bindings-typescript/src/autogen/typespace_type.ts create mode 100644 crates/codegen/examples/regen-typescript-moduledef.rs create mode 100644 sdks/typescript/packages/sdk/tests/algebraic_type.test.ts delete mode 100644 sdks/typescript/packages/sdk/tests/algebraic_value.test.ts diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index a731498b684..3dc80caa9e1 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -29,7 +29,6 @@ "author": "Clockwork Labs", "type": "module", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc -p tsconfig.build.json", "prepack": "pnpm run build" }, diff --git a/crates/bindings-typescript/src/algebraic_type.ts b/crates/bindings-typescript/src/algebraic_type.ts index 8ffbac4b42a..a9b6ae0b49e 100644 --- a/crates/bindings-typescript/src/algebraic_type.ts +++ b/crates/bindings-typescript/src/algebraic_type.ts @@ -5,699 +5,1016 @@ import type BinaryReader from './binary_reader'; import BinaryWriter from './binary_writer'; import { Identity } from './identity'; import ScheduleAt from './schedule_at'; +import { __AlgebraicType, type __AlgebraicType as __AlgebraicTypeType } from './autogen/algebraic_type_type'; +import { ProductType } from './autogen/product_type_type'; +import { SumType } from './autogen/sum_type_type'; -/** - * A variant of a sum type. - * - * NOTE: Each element has an implicit element tag based on its order. - * Uniquely identifies an element similarly to protobuf tags. - */ -export class SumTypeVariant { - name: string; - algebraicType: AlgebraicType; +// Exports +export * from './autogen/product_type_element_type'; +export * from './autogen/sum_type_variant_type'; +export { type __AlgebraicTypeVariants as AlgebraicTypeVariants } from './autogen/algebraic_type_type'; - constructor(name: string, algebraicType: AlgebraicType) { - this.name = name; - this.algebraicType = algebraicType; - } -} +declare module "./autogen/product_type_type" { + export namespace ProductType { + export function serializeValue(writer: BinaryWriter, ty: ProductType, value: any): void; + export function deserializeValue(reader: BinaryReader, ty: ProductType): any; -/** - * Unlike most languages, sums in SATS are *[structural]* and not nominal. - * When checking whether two nominal types are the same, - * their names and/or declaration sites (e.g., module / namespace) are considered. - * Meanwhile, a structural type system would only check the structure of the type itself, - * e.g., the names of its variants and their inner data types in the case of a sum. - * - * This is also known as a discriminated union (implementation) or disjoint union. - * Another name is [coproduct (category theory)](https://ncatlab.org/nlab/show/coproduct). - * - * These structures are known as sum types because the number of possible values a sum - * ```ignore - * { N_0(T_0), N_1(T_1), ..., N_n(T_n) } - * ``` - * is: - * ```ignore - * Σ (i ∈ 0..n). values(T_i) - * ``` - * so for example, `values({ A(U64), B(Bool) }) = values(U64) + values(Bool)`. - * - * See also: https://ncatlab.org/nlab/show/sum+type. - * - * [structural]: https://en.wikipedia.org/wiki/Structural_type_system - */ -export class SumType { - variants: SumTypeVariant[]; - - constructor(variants: SumTypeVariant[]) { - this.variants = variants; + export function intoMapKey(ty: ProductType, value: any): ComparablePrimitive; } - - serialize = (writer: BinaryWriter, value: any): void => { - // In TypeScript we handle Option values as a special case - // we don't represent the some and none variants, but instead - // we represent the value directly. - if ( - this.variants.length == 2 && - this.variants[0].name === 'some' && - this.variants[1].name === 'none' - ) { - if (value !== null && value !== undefined) { - writer.writeByte(0); - this.variants[0].algebraicType.serialize(writer, value); - } else { - writer.writeByte(1); - } - } else { - let variant = value['tag']; - const index = this.variants.findIndex(v => v.name === variant); - if (index < 0) { - throw `Can't serialize a sum type, couldn't find ${value.tag} tag`; - } - writer.writeU8(index); - this.variants[index].algebraicType.serialize(writer, value['value']); - } - }; - - deserialize = (reader: BinaryReader): any => { - let tag = reader.readU8(); - // In TypeScript we handle Option values as a special case - // we don't represent the some and none variants, but instead - // we represent the value directly. - if ( - this.variants.length == 2 && - this.variants[0].name === 'some' && - this.variants[1].name === 'none' - ) { - if (tag === 0) { - return this.variants[0].algebraicType.deserialize(reader); - } else if (tag === 1) { - return undefined; - } else { - throw `Can't deserialize an option type, couldn't find ${tag} tag`; - } - } else { - let variant = this.variants[tag]; - let value = variant.algebraicType.deserialize(reader); - return { tag: variant.name, value }; - } - }; } -/** - * A factor / element of a product type. - * - * An element consist of an optional name and a type. - * - * NOTE: Each element has an implicit element tag based on its order. - * Uniquely identifies an element similarly to protobuf tags. - */ -export class ProductTypeElement { - name: string; - algebraicType: AlgebraicType; - - constructor(name: string, algebraicType: AlgebraicType) { - this.name = name; - this.algebraicType = algebraicType; +ProductType.serializeValue = function (writer: BinaryWriter, ty: ProductType, value: any): void { + for (let element of ty.elements) { + __AlgebraicType.serializeValue(writer, element.algebraicType, value[element.name!]); } } -/** - * A structural product type of the factors given by `elements`. - * - * This is also known as `struct` and `tuple` in many languages, - * but note that unlike most languages, products in SATs are *[structural]* and not nominal. - * When checking whether two nominal types are the same, - * their names and/or declaration sites (e.g., module / namespace) are considered. - * Meanwhile, a structural type system would only check the structure of the type itself, - * e.g., the names of its fields and their types in the case of a record. - * The name "product" comes from category theory. - * - * See also: https://ncatlab.org/nlab/show/product+type. - * - * These structures are known as product types because the number of possible values in product - * ```ignore - * { N_0: T_0, N_1: T_1, ..., N_n: T_n } - * ``` - * is: - * ```ignore - * Π (i ∈ 0..n). values(T_i) - * ``` - * so for example, `values({ A: U64, B: Bool }) = values(U64) * values(Bool)`. - * - * [structural]: https://en.wikipedia.org/wiki/Structural_type_system - */ -export class ProductType { - elements: ProductTypeElement[]; - - constructor(elements: ProductTypeElement[]) { - this.elements = elements; - } - - isEmpty(): boolean { - return this.elements.length === 0; - } - - serialize = (writer: BinaryWriter, value: object): void => { - for (let element of this.elements) { - element.algebraicType.serialize(writer, value[element.name]); +ProductType.deserializeValue = function (reader: BinaryReader, ty: ProductType): { [key: string]: any } { + let result: { [key: string]: any } = {}; + if (ty.elements.length === 1) { + if (ty.elements[0].name === '__time_duration_micros__') { + return new TimeDuration(reader.readI64()); } - }; - intoMapKey(value: any): ComparablePrimitive { - if (this.elements.length === 1) { - if (this.elements[0].name === '__time_duration_micros__') { - return (value as TimeDuration).__time_duration_micros__; - } - - if (this.elements[0].name === '__timestamp_micros_since_unix_epoch__') { - return (value as Timestamp).__timestamp_micros_since_unix_epoch__; - } - - if (this.elements[0].name === '__identity__') { - return (value as Identity).__identity__; - } - - if (this.elements[0].name === '__connection_id__') { - return (value as ConnectionId).__connection_id__; - } + if (ty.elements[0].name === '__timestamp_micros_since_unix_epoch__') { + return new Timestamp(reader.readI64()); } - // The fallback is to serialize and base64 encode the bytes. - const writer = new BinaryWriter(10); - this.serialize(writer, value); - return writer.toBase64(); - } - deserialize = (reader: BinaryReader): { [key: string]: any } => { - let result: { [key: string]: any } = {}; - if (this.elements.length === 1) { - if (this.elements[0].name === '__time_duration_micros__') { - return new TimeDuration(reader.readI64()); - } - - if (this.elements[0].name === '__timestamp_micros_since_unix_epoch__') { - return new Timestamp(reader.readI64()); - } - - if (this.elements[0].name === '__identity__') { - return new Identity(reader.readU256()); - } - - if (this.elements[0].name === '__connection_id__') { - return new ConnectionId(reader.readU128()); - } + if (ty.elements[0].name === '__identity__') { + return new Identity(reader.readU256()); } - for (let element of this.elements) { - result[element.name] = element.algebraicType.deserialize(reader); + if (ty.elements[0].name === '__connection_id__') { + return new ConnectionId(reader.readU128()); } - return result; - }; -} - -/* A map type from keys of type `keyType` to values of type `valueType`. */ -export class MapType { - keyType: AlgebraicType; - valueType: AlgebraicType; - - constructor(keyType: AlgebraicType, valueType: AlgebraicType) { - this.keyType = keyType; - this.valueType = valueType; } -} - -type ArrayBaseType = AlgebraicType; -type TypeRef = null; -type None = null; -export type EnumLabel = { label: string }; - -type AnyType = - | ProductType - | SumType - | ArrayBaseType - | MapType - | EnumLabel - | TypeRef - | None; - -export type ComparablePrimitive = number | string | String | boolean | bigint; -type AT = - { tag: 'u8' } | - { tag: 'u16' } | - { tag: 'u32' } | - { tag: 'u64' } | - { tag: 'u128' } | - { tag: 'u256' } | - { tag: 'i8' } | - { tag: 'i16' } | - { tag: 'i32' } | - { tag: 'i64' } | - { tag: 'i128' } | - { tag: 'f32' } | - { tag: 'f64' } | - { tag: 'string' } | - { tag: 'bool' } | - { tag: 'product', value: PT } | - { tag: 'sum', value: ST }; - -type PT = { elements: { name: string, element: AT }[] }; -type ST = { variants: { tag: string, ty: AT }[] }; - -const at: AT = { - tag: 'product', - value: { - elements: [ - { name: '__identity__', element: { tag: 'u256' } }, - ], - }, + for (let element of ty.elements) { + result[element.name!] = __AlgebraicType.deserializeValue(reader, element.algebraicType); + } + return result; } -/** - * The SpacetimeDB Algebraic Type System (SATS) is a structural type system in - * which a nominal type system can be constructed. - * - * The type system unifies the concepts sum types, product types, and built-in - * primitive types into a single type system. - */ -export class AlgebraicType { - type!: Type; - type_?: AnyType; +export { ProductType }; - #setter(type: Type, payload: AnyType | undefined) { - this.type_ = payload; - this.type = payload === undefined ? Type.None : type; - } - - get product(): ProductType { - if (this.type !== Type.ProductType) { - throw 'product type was requested, but the type is not ProductType'; +ProductType.intoMapKey = function (ty: ProductType, value: any): ComparablePrimitive { + if (ty.elements.length === 1) { + if (ty.elements[0].name === '__time_duration_micros__') { + return (value as TimeDuration).__time_duration_micros__; } - return this.type_ as ProductType; - } - set product(value: ProductType | undefined) { - this.#setter(Type.ProductType, value); - } - - get sum(): SumType { - if (this.type !== Type.SumType) { - throw 'sum type was requested, but the type is not SumType'; + if (ty.elements[0].name === '__timestamp_micros_since_unix_epoch__') { + return (value as Timestamp).__timestamp_micros_since_unix_epoch__; } - return this.type_ as SumType; - } - set sum(value: SumType | undefined) { - this.#setter(Type.SumType, value); - } - get array(): ArrayBaseType { - if (this.type !== Type.ArrayType) { - throw 'array type was requested, but the type is not ArrayType'; + if (ty.elements[0].name === '__identity__') { + return (value as Identity).__identity__; } - return this.type_ as ArrayBaseType; - } - set array(value: ArrayBaseType | undefined) { - this.#setter(Type.ArrayType, value); - } - get map(): MapType { - if (this.type !== Type.MapType) { - throw 'map type was requested, but the type is not MapType'; + if (ty.elements[0].name === '__connection_id__') { + return (value as ConnectionId).__connection_id__; } - return this.type_ as MapType; - } - set map(value: MapType | undefined) { - this.#setter(Type.MapType, value); - } - - static #createType(type: Type, payload: AnyType | undefined): AlgebraicType { - let at = new AlgebraicType(); - at.#setter(type, payload); - return at; - } - - static createProductType(elements: ProductTypeElement[]): AlgebraicType { - return this.#createType(Type.ProductType, new ProductType(elements)); - } - - static createSumType(variants: SumTypeVariant[]): AlgebraicType { - return this.#createType(Type.SumType, new SumType(variants)); - } - - static createArrayType(elementType: AlgebraicType): AlgebraicType { - return this.#createType(Type.ArrayType, elementType); - } - - static createMapType(key: AlgebraicType, val: AlgebraicType): AlgebraicType { - return this.#createType(Type.MapType, new MapType(key, val)); - } - - static createBoolType(): AlgebraicType { - return this.#createType(Type.Bool, null); - } - static createI8Type(): AlgebraicType { - return this.#createType(Type.I8, null); - } - static createU8Type(): AlgebraicType { - return this.#createType(Type.U8, null); - } - static createI16Type(): AlgebraicType { - return this.#createType(Type.I16, null); - } - static createU16Type(): AlgebraicType { - return this.#createType(Type.U16, null); - } - static createI32Type(): AlgebraicType { - return this.#createType(Type.I32, null); - } - static createU32Type(): AlgebraicType { - return this.#createType(Type.U32, null); - } - static createI64Type(): AlgebraicType { - return this.#createType(Type.I64, null); - } - static createU64Type(): AlgebraicType { - return this.#createType(Type.U64, null); - } - static createI128Type(): AlgebraicType { - return this.#createType(Type.I128, null); - } - static createU128Type(): AlgebraicType { - return this.#createType(Type.U128, null); - } - static createI256Type(): AlgebraicType { - return this.#createType(Type.I256, null); - } - static createU256Type(): AlgebraicType { - return this.#createType(Type.U256, null); - } - static createF32Type(): AlgebraicType { - return this.#createType(Type.F32, null); - } - static createF64Type(): AlgebraicType { - return this.#createType(Type.F64, null); - } - static createStringType(): AlgebraicType { - return this.#createType(Type.String, null); - } - static createBytesType(): AlgebraicType { - return this.createArrayType(this.createU8Type()); - } - static createOptionType(innerType: AlgebraicType): AlgebraicType { - return this.createSumType([ - new SumTypeVariant('some', innerType), - new SumTypeVariant('none', this.createProductType([])), - ]); - } - static createIdentityType(): AlgebraicType { - return this.createProductType([ - new ProductTypeElement('__identity__', this.createU256Type()), - ]); - } - - static createConnectionIdType(): AlgebraicType { - return this.createProductType([ - new ProductTypeElement('__connection_id__', this.createU128Type()), - ]); - } - - static createScheduleAtType(): AlgebraicType { - return ScheduleAt.getAlgebraicType(); - } - - static createTimestampType(): AlgebraicType { - return this.createProductType([ - new ProductTypeElement( - '__timestamp_micros_since_unix_epoch__', - this.createI64Type() - ), - ]); - } - - static createTimeDurationType(): AlgebraicType { - return this.createProductType([ - new ProductTypeElement('__time_duration_micros__', this.createI64Type()), - ]); - } - - isProductType(): boolean { - return this.type === Type.ProductType; } + // The fallback is to serialize and base64 encode the bytes. + const writer = new BinaryWriter(10); + AlgebraicType.serializeValue(writer, AlgebraicType.Product(ty), value); + return writer.toBase64(); +} - isSumType(): boolean { - return this.type === Type.SumType; +declare module "./autogen/sum_type_type" { + export namespace SumType { + export function serializeValue(writer: BinaryWriter, ty: SumType, value: any): void; + export function deserializeValue(reader: BinaryReader, ty: SumType): any; } +} - isArrayType(): boolean { - return this.type === Type.ArrayType; +SumType.serializeValue = function (writer: BinaryWriter, ty: SumType, value: any): void { + if ( + ty.variants.length == 2 && + ty.variants[0].name === 'some' && + ty.variants[1].name === 'none' + ) { + if (value !== null && value !== undefined) { + writer.writeByte(0); + __AlgebraicType.serializeValue(writer, ty.variants[0].algebraicType, value); + } else { + writer.writeByte(1); + } + } else { + let variant = value['tag']; + const index = ty.variants.findIndex(v => v.name === variant); + if (index < 0) { + throw `Can't serialize a sum type, couldn't find ${value.tag} tag`; + } + writer.writeU8(index); + __AlgebraicType.serializeValue(writer, ty.variants[index].algebraicType, value['value']); } +} - isMapType(): boolean { - return this.type === Type.MapType; +SumType.deserializeValue = function (reader: BinaryReader, ty: SumType): any { + let tag = reader.readU8(); + // In TypeScript we handle Option values as a special case + // we don't represent the some and none variants, but instead + // we represent the value directly. + if ( + ty.variants.length == 2 && + ty.variants[0].name === 'some' && + ty.variants[1].name === 'none' + ) { + if (tag === 0) { + return __AlgebraicType.deserializeValue(reader, ty.variants[0].algebraicType); + } else if (tag === 1) { + return undefined; + } else { + throw `Can't deserialize an option type, couldn't find ${tag} tag`; + } + } else { + let variant = ty.variants[tag]; + let value = __AlgebraicType.deserializeValue(reader, variant.algebraicType); + return { tag: variant.name, value }; } +} - #isBytes(): boolean { - return this.isArrayType() && this.array.type == Type.U8; - } +export { SumType }; - #isBytesNewtype(tag: string): boolean { - return ( - this.isProductType() && - this.product.elements.length === 1 && - (this.product.elements[0].algebraicType.type == Type.U128 || - this.product.elements[0].algebraicType.type == Type.U256) && - this.product.elements[0].name === tag - ); - } +declare module "./autogen/algebraic_type_type" { + export namespace __AlgebraicType { + export function createOptionType(innerType: __AlgebraicType): __AlgebraicType; + export function createIdentityType(): __AlgebraicType; + export function createConnectionIdType(): __AlgebraicType; + export function createScheduleAtType(): __AlgebraicType; + export function createTimestampType(): __AlgebraicType; + export function createTimeDurationType(): __AlgebraicType; + export function serializeValue(writer: BinaryWriter, ty: __AlgebraicType, value: any): void; + export function deserializeValue(reader: BinaryReader, ty: __AlgebraicType): any; - #isI64Newtype(tag: string): boolean { - return ( - this.isProductType() && - this.product.elements.length === 1 && - this.product.elements[0].algebraicType.type === Type.I64 && - this.product.elements[0].name === tag - ); + export function intoMapKey(ty: __AlgebraicType, value: any): ComparablePrimitive; } +} - isIdentity(): boolean { - return this.#isBytesNewtype('__identity__'); - } +__AlgebraicType.createOptionType = function (innerType: __AlgebraicType): __AlgebraicType { + return __AlgebraicType.Sum({ + variants: [ + { name: "some", algebraicType: innerType }, + { name: "none", algebraicType: __AlgebraicType.Product({ elements: [] }) } + ] + }); +} - isConnectionId(): boolean { - return this.#isBytesNewtype('__connection_id__'); - } +__AlgebraicType.createIdentityType = function (): __AlgebraicType { + return __AlgebraicType.Product({ elements: [ + { name: "__identity__", algebraicType: __AlgebraicType.U256 } + ]}) +} - isScheduleAt(): boolean { - return ( - this.isSumType() && - this.sum.variants.length === 2 && - this.sum.variants[0].name === 'Interval' && - this.sum.variants[0].algebraicType.type === Type.U64 && - this.sum.variants[1].name === 'Time' && - this.sum.variants[1].algebraicType.type === Type.U64 - ); - } +__AlgebraicType.createConnectionIdType = function (): __AlgebraicType { + return __AlgebraicType.Product({ elements: [ + { name: "__connection_id__", algebraicType: __AlgebraicType.U128 } + ]}); +} - isTimestamp(): boolean { - return this.#isI64Newtype('__timestamp_micros_since_unix_epoch__'); - } +__AlgebraicType.createScheduleAtType = function (): __AlgebraicType { + return ScheduleAt.getAlgebraicType(); +} - isTimeDuration(): boolean { - return this.#isI64Newtype('__time_duration_micros__'); - } +__AlgebraicType.createTimestampType = function (): __AlgebraicType { + return __AlgebraicType.Product({ elements: [ + { name: "__timestamp_micros_since_unix_epoch__", algebraicType: __AlgebraicType.I64 } + ]}); +} - /** - * Convert a value of the algebraic type into something that can be used as a key in a map. - * There are no guarantees about being able to order it. - * This is only guaranteed to be comparable to other values of the same type. - * @param value A value of the algebraic type - * @returns Something that can be used as a key in a map. - */ - intoMapKey(value: any): ComparablePrimitive { - switch (this.type) { - case Type.U8: - case Type.U16: - case Type.U32: - case Type.U64: - case Type.U128: - case Type.U256: - case Type.I8: - case Type.I16: - case Type.I64: - case Type.I128: - case Type.F32: - case Type.F64: - case Type.String: - case Type.Bool: - return value; - case Type.ProductType: - return this.product.intoMapKey(value); - default: - const writer = new BinaryWriter(10); - this.serialize(writer, value); - return writer.toBase64(); - } - } +__AlgebraicType.createTimeDurationType = function (): __AlgebraicType { + return __AlgebraicType.Product({ elements: [ + { name: "__time_duration_micros__", algebraicType: __AlgebraicType.I64 } + ]}); +} - serialize(writer: BinaryWriter, value: any): void { - switch (this.type) { - case Type.ProductType: - this.product.serialize(writer, value); - break; - case Type.SumType: - this.sum.serialize(writer, value); - break; - case Type.ArrayType: - if (this.#isBytes()) { - writer.writeUInt8Array(value); - } else { - const elemType = this.array; - writer.writeU32(value.length); - for (let elem of value) { - elemType.serialize(writer, elem); - } +__AlgebraicType.serializeValue = function (writer: BinaryWriter, ty: __AlgebraicType, value: any): void { + switch (ty.tag) { + case "Product": + ProductType.serializeValue(writer, ty.value, value); + break; + case "Sum": + SumType.serializeValue(writer, ty.value, value); + break; + case "Array": + if (ty.value.tag === "U8") { + writer.writeUInt8Array(value); + } else { + const elemType = ty.value; + writer.writeU32(value.length); + for (let elem of value) { + AlgebraicType.serializeValue(writer, elemType, elem); } - break; - case Type.MapType: - throw new Error('not implemented'); - case Type.Bool: - writer.writeBool(value); - break; - case Type.I8: - writer.writeI8(value); - break; - case Type.U8: - writer.writeU8(value); - break; - case Type.I16: - writer.writeI16(value); - break; - case Type.U16: - writer.writeU16(value); - break; - case Type.I32: - writer.writeI32(value); - break; - case Type.U32: - writer.writeU32(value); - break; - case Type.I64: - writer.writeI64(value); - break; - case Type.U64: - writer.writeU64(value); - break; - case Type.I128: - writer.writeI128(value); - break; - case Type.U128: - writer.writeU128(value); - break; - case Type.I256: - writer.writeI256(value); - break; - case Type.U256: - writer.writeU256(value); - break; - case Type.F32: - writer.writeF32(value); - break; - case Type.F64: - writer.writeF64(value); - break; - case Type.String: - writer.writeString(value); - break; - default: - throw new Error(`not implemented, ${this.type}`); - } + } + break; + case "Bool": + writer.writeBool(value); + break; + case "I8": + writer.writeI8(value); + break; + case "U8": + writer.writeU8(value); + break; + case "I16": + writer.writeI16(value); + break; + case "U16": + writer.writeU16(value); + break; + case "I32": + writer.writeI32(value); + break; + case "U32": + writer.writeU32(value); + break; + case "I64": + writer.writeI64(value); + break; + case "U64": + writer.writeU64(value); + break; + case "I128": + writer.writeI128(value); + break; + case "U128": + writer.writeU128(value); + break; + case "I256": + writer.writeI256(value); + break; + case "U256": + writer.writeU256(value); + break; + case "F32": + writer.writeF32(value); + break; + case "F64": + writer.writeF64(value); + break; + case "String": + writer.writeString(value); + break; + default: + throw new Error(`not implemented, ${ty.tag}`); } +} - deserialize(reader: BinaryReader): any { - switch (this.type) { - case Type.ProductType: - return this.product.deserialize(reader); - case Type.SumType: - return this.sum.deserialize(reader); - case Type.ArrayType: - if (this.#isBytes()) { - return reader.readUInt8Array(); - } else { - const elemType = this.array; - const length = reader.readU32(); - let result: any[] = []; - for (let i = 0; i < length; i++) { - result.push(elemType.deserialize(reader)); - } - return result; +__AlgebraicType.deserializeValue = function (reader: BinaryReader, ty: __AlgebraicType): any { + switch (ty.tag) { + case "Product": + return ProductType.deserializeValue(reader, ty.value); + case "Sum": + return SumType.deserializeValue(reader, ty.value); + case "Array": + if (ty.value.tag === "U8") { + return reader.readUInt8Array(); + } else { + const elemType = ty.value; + const length = reader.readU32(); + const result: any[] = []; + for (let i = 0; i < length; i++) { + result.push(AlgebraicType.deserializeValue(reader, elemType)); } - case Type.MapType: - // TODO: MapType is being removed - throw new Error('not implemented'); - case Type.Bool: - return reader.readBool(); - case Type.I8: - return reader.readI8(); - case Type.U8: - return reader.readU8(); - case Type.I16: - return reader.readI16(); - case Type.U16: - return reader.readU16(); - case Type.I32: - return reader.readI32(); - case Type.U32: - return reader.readU32(); - case Type.I64: - return reader.readI64(); - case Type.U64: - return reader.readU64(); - case Type.I128: - return reader.readI128(); - case Type.U128: - return reader.readU128(); - case Type.U256: - return reader.readU256(); - case Type.F32: - return reader.readF32(); - case Type.F64: - return reader.readF64(); - case Type.String: - return reader.readString(); - default: - throw new Error(`not implemented, ${this.type}`); - } + return result; + } + case "Bool": + return reader.readBool(); + case "I8": + return reader.readI8(); + case "U8": + return reader.readU8(); + case "I16": + return reader.readI16(); + case "U16": + return reader.readU16(); + case "I32": + return reader.readI32(); + case "U32": + return reader.readU32(); + case "I64": + return reader.readI64(); + case "U64": + return reader.readU64(); + case "I128": + return reader.readI128(); + case "U128": + return reader.readU128(); + case "I256": + return reader.readI256(); + case "U256": + return reader.readU256(); + case "F32": + return reader.readF32(); + case "F64": + return reader.readF64(); + case "String": + return reader.readString(); + default: + throw new Error(`not implemented, ${ty.tag}`); } } -export namespace AlgebraicType { - export enum Type { - SumType = 'SumType', - ProductType = 'ProductType', - ArrayType = 'ArrayType', - MapType = 'MapType', - Bool = 'Bool', - I8 = 'I8', - U8 = 'U8', - I16 = 'I16', - U16 = 'U16', - I32 = 'I32', - U32 = 'U32', - I64 = 'I64', - U64 = 'U64', - I128 = 'I128', - U128 = 'U128', - I256 = 'I256', - U256 = 'U256', - F32 = 'F32', - F64 = 'F64', - /** UTF-8 encoded */ - String = 'String', - None = 'None', +/** + * Convert a value of the algebraic type into something that can be used as a key in a map. + * There are no guarantees about being able to order it. + * This is only guaranteed to be comparable to other values of the same type. + * @param value A value of the algebraic type + * @returns Something that can be used as a key in a map. + */ +__AlgebraicType.intoMapKey = function (ty: __AlgebraicType, value: any): ComparablePrimitive { + switch (ty.tag) { + case "U8": + case "U16": + case "U32": + case "U64": + case "U128": + case "U256": + case "I8": + case "I16": + case "I64": + case "I128": + case "F32": + case "F64": + case "String": + case "Bool": + return value; + case "Product": + return ProductType.intoMapKey(ty.value, value); + default: + const writer = new BinaryWriter(10); + this.serialize(writer, value); + return writer.toBase64(); } } -// No idea why but in order to have a local alias for both of these -// need to be present -type Type = AlgebraicType.Type; -let Type: typeof AlgebraicType.Type = AlgebraicType.Type; +export type AlgebraicType = __AlgebraicTypeType; +export const AlgebraicType: typeof __AlgebraicType = __AlgebraicType; + +export type ComparablePrimitive = number | string | String | boolean | bigint; + +/** +// * A variant of a sum type. +// * +// * NOTE: Each element has an implicit element tag based on its order. +// * Uniquely identifies an element similarly to protobuf tags. +// */ +// export class SumTypeVariant { +// name: string; +// algebraicType: AlgebraicType; + +// constructor(name: string, algebraicType: AlgebraicType) { +// this.name = name; +// this.algebraicType = algebraicType; +// } +// } + +// /** +// * Unlike most languages, sums in SATS are *[structural]* and not nominal. +// * When checking whether two nominal types are the same, +// * their names and/or declaration sites (e.g., module / namespace) are considered. +// * Meanwhile, a structural type system would only check the structure of the type itself, +// * e.g., the names of its variants and their inner data types in the case of a sum. +// * +// * This is also known as a discriminated union (implementation) or disjoint union. +// * Another name is [coproduct (category theory)](https://ncatlab.org/nlab/show/coproduct). +// * +// * These structures are known as sum types because the number of possible values a sum +// * ```ignore +// * { N_0(T_0), N_1(T_1), ..., N_n(T_n) } +// * ``` +// * is: +// * ```ignore +// * Σ (i ∈ 0..n). values(T_i) +// * ``` +// * so for example, `values({ A(U64), B(Bool) }) = values(U64) + values(Bool)`. +// * +// * See also: https://ncatlab.org/nlab/show/sum+type. +// * +// * [structural]: https://en.wikipedia.org/wiki/Structural_type_system +// */ +// export class SumType { +// variants: SumTypeVariant[]; + +// constructor(variants: SumTypeVariant[]) { +// this.variants = variants; +// } + +// serialize = (writer: BinaryWriter, value: any): void => { +// // In TypeScript we handle Option values as a special case +// // we don't represent the some and none variants, but instead +// // we represent the value directly. +// if ( +// this.variants.length == 2 && +// this.variants[0].name === 'some' && +// this.variants[1].name === 'none' +// ) { +// if (value !== null && value !== undefined) { +// writer.writeByte(0); +// this.variants[0].algebraicType.serialize(writer, value); +// } else { +// writer.writeByte(1); +// } +// } else { +// let variant = value['tag']; +// const index = this.variants.findIndex(v => v.name === variant); +// if (index < 0) { +// throw `Can't serialize a sum type, couldn't find ${value.tag} tag`; +// } +// writer.writeU8(index); +// this.variants[index].algebraicType.serialize(writer, value['value']); +// } +// }; + +// deserialize = (reader: BinaryReader): any => { +// let tag = reader.readU8(); +// // In TypeScript we handle Option values as a special case +// // we don't represent the some and none variants, but instead +// // we represent the value directly. +// if ( +// this.variants.length == 2 && +// this.variants[0].name === 'some' && +// this.variants[1].name === 'none' +// ) { +// if (tag === 0) { +// return this.variants[0].algebraicType.deserialize(reader); +// } else if (tag === 1) { +// return undefined; +// } else { +// throw `Can't deserialize an option type, couldn't find ${tag} tag`; +// } +// } else { +// let variant = this.variants[tag]; +// let value = variant.algebraicType.deserialize(reader); +// return { tag: variant.name, value }; +// } +// }; +// } + +// /** +// * A factor / element of a product type. +// * +// * An element consist of an optional name and a type. +// * +// * NOTE: Each element has an implicit element tag based on its order. +// * Uniquely identifies an element similarly to protobuf tags. +// */ +// export class ProductTypeElement { +// name: string; +// algebraicType: AlgebraicType; + +// constructor(name: string, algebraicType: AlgebraicType) { +// this.name = name; +// this.algebraicType = algebraicType; +// } +// } + +// /** +// * A structural product type of the factors given by `elements`. +// * +// * This is also known as `struct` and `tuple` in many languages, +// * but note that unlike most languages, products in SATs are *[structural]* and not nominal. +// * When checking whether two nominal types are the same, +// * their names and/or declaration sites (e.g., module / namespace) are considered. +// * Meanwhile, a structural type system would only check the structure of the type itself, +// * e.g., the names of its fields and their types in the case of a record. +// * The name "product" comes from category theory. +// * +// * See also: https://ncatlab.org/nlab/show/product+type. +// * +// * These structures are known as product types because the number of possible values in product +// * ```ignore +// * { N_0: T_0, N_1: T_1, ..., N_n: T_n } +// * ``` +// * is: +// * ```ignore +// * Π (i ∈ 0..n). values(T_i) +// * ``` +// * so for example, `values({ A: U64, B: Bool }) = values(U64) * values(Bool)`. +// * +// * [structural]: https://en.wikipedia.org/wiki/Structural_type_system +// */ +// export class ProductType { +// elements: ProductTypeElement[]; + +// constructor(elements: ProductTypeElement[]) { +// this.elements = elements; +// } + +// isEmpty(): boolean { +// return this.elements.length === 0; +// } + +// serialize = (writer: BinaryWriter, value: object): void => { +// for (let element of this.elements) { +// element.algebraicType.serialize(writer, value[element.name]); +// } +// }; + +// intoMapKey(value: any): ComparablePrimitive { +// if (this.elements.length === 1) { +// if (this.elements[0].name === '__time_duration_micros__') { +// return (value as TimeDuration).__time_duration_micros__; +// } + +// if (this.elements[0].name === '__timestamp_micros_since_unix_epoch__') { +// return (value as Timestamp).__timestamp_micros_since_unix_epoch__; +// } + +// if (this.elements[0].name === '__identity__') { +// return (value as Identity).__identity__; +// } + +// if (this.elements[0].name === '__connection_id__') { +// return (value as ConnectionId).__connection_id__; +// } +// } +// // The fallback is to serialize and base64 encode the bytes. +// const writer = new BinaryWriter(10); +// this.serialize(writer, value); +// return writer.toBase64(); +// } + +// deserialize = (reader: BinaryReader): { [key: string]: any } => { +// let result: { [key: string]: any } = {}; +// if (this.elements.length === 1) { +// if (this.elements[0].name === '__time_duration_micros__') { +// return new TimeDuration(reader.readI64()); +// } + +// if (this.elements[0].name === '__timestamp_micros_since_unix_epoch__') { +// return new Timestamp(reader.readI64()); +// } + +// if (this.elements[0].name === '__identity__') { +// return new Identity(reader.readU256()); +// } + +// if (this.elements[0].name === '__connection_id__') { +// return new ConnectionId(reader.readU128()); +// } +// } + +// for (let element of this.elements) { +// result[element.name] = element.algebraicType.deserialize(reader); +// } +// return result; +// }; +// } + +// /* A map type from keys of type `keyType` to values of type `valueType`. */ +// export class MapType { +// keyType: AlgebraicType; +// valueType: AlgebraicType; + +// constructor(keyType: AlgebraicType, valueType: AlgebraicType) { +// this.keyType = keyType; +// this.valueType = valueType; +// } +// } + +// type ArrayBaseType = AlgebraicType; +// type TypeRef = null; +// type None = null; +// export type EnumLabel = { label: string }; + +// type AnyType = +// | ProductType +// | SumType +// | ArrayBaseType +// | MapType +// | EnumLabel +// | TypeRef +// | None; + +// export type ComparablePrimitive = number | string | String | boolean | bigint; + +// /** +// * The SpacetimeDB Algebraic Type System (SATS) is a structural type system in +// * which a nominal type system can be constructed. +// * +// * The type system unifies the concepts sum types, product types, and built-in +// * primitive types into a single type system. +// */ +// export class AlgebraicType { +// type!: Type; +// type_?: AnyType; + +// #setter(type: Type, payload: AnyType | undefined) { +// this.type_ = payload; +// this.type = payload === undefined ? Type.None : type; +// } + +// get product(): ProductType { +// if (this.type !== Type.ProductType) { +// throw 'product type was requested, but the type is not ProductType'; +// } +// return this.type_ as ProductType; +// } + +// set product(value: ProductType | undefined) { +// this.#setter(Type.ProductType, value); +// } + +// get sum(): SumType { +// if (this.type !== Type.SumType) { +// throw 'sum type was requested, but the type is not SumType'; +// } +// return this.type_ as SumType; +// } +// set sum(value: SumType | undefined) { +// this.#setter(Type.SumType, value); +// } + +// get array(): ArrayBaseType { +// if (this.type !== Type.ArrayType) { +// throw 'array type was requested, but the type is not ArrayType'; +// } +// return this.type_ as ArrayBaseType; +// } +// set array(value: ArrayBaseType | undefined) { +// this.#setter(Type.ArrayType, value); +// } + +// get map(): MapType { +// if (this.type !== Type.MapType) { +// throw 'map type was requested, but the type is not MapType'; +// } +// return this.type_ as MapType; +// } +// set map(value: MapType | undefined) { +// this.#setter(Type.MapType, value); +// } + +// static #createType(type: Type, payload: AnyType | undefined): AlgebraicType { +// let at = new AlgebraicType(); +// at.#setter(type, payload); +// return at; +// } + +// static createProductType(elements: ProductTypeElement[]): AlgebraicType { +// return this.#createType(Type.ProductType, new ProductType(elements)); +// } + +// static createSumType(variants: SumTypeVariant[]): AlgebraicType { +// return this.#createType(Type.SumType, new SumType(variants)); +// } + +// static createArrayType(elementType: AlgebraicType): AlgebraicType { +// return this.#createType(Type.ArrayType, elementType); +// } + +// static createMapType(key: AlgebraicType, val: AlgebraicType): AlgebraicType { +// return this.#createType(Type.MapType, new MapType(key, val)); +// } + +// static createBoolType(): AlgebraicType { +// return this.#createType(Type.Bool, null); +// } +// static createI8Type(): AlgebraicType { +// return this.#createType(Type.I8, null); +// } +// static createU8Type(): AlgebraicType { +// return this.#createType(Type.U8, null); +// } +// static createI16Type(): AlgebraicType { +// return this.#createType(Type.I16, null); +// } +// static createU16Type(): AlgebraicType { +// return this.#createType(Type.U16, null); +// } +// static createI32Type(): AlgebraicType { +// return this.#createType(Type.I32, null); +// } +// static createU32Type(): AlgebraicType { +// return this.#createType(Type.U32, null); +// } +// static createI64Type(): AlgebraicType { +// return this.#createType(Type.I64, null); +// } +// static createU64Type(): AlgebraicType { +// return this.#createType(Type.U64, null); +// } +// static createI128Type(): AlgebraicType { +// return this.#createType(Type.I128, null); +// } +// static createU128Type(): AlgebraicType { +// return this.#createType(Type.U128, null); +// } +// static createI256Type(): AlgebraicType { +// return this.#createType(Type.I256, null); +// } +// static createU256Type(): AlgebraicType { +// return this.#createType(Type.U256, null); +// } +// static createF32Type(): AlgebraicType { +// return this.#createType(Type.F32, null); +// } +// static createF64Type(): AlgebraicType { +// return this.#createType(Type.F64, null); +// } +// static createStringType(): AlgebraicType { +// return this.#createType(Type.String, null); +// } +// static createBytesType(): AlgebraicType { +// return this.createArrayType(this.createU8Type()); +// } +// static createOptionType(innerType: AlgebraicType): AlgebraicType { +// return this.createSumType([ +// new SumTypeVariant('some', innerType), +// new SumTypeVariant('none', this.createProductType([])), +// ]); +// } +// static createIdentityType(): AlgebraicType { +// return this.createProductType([ +// new ProductTypeElement('__identity__', this.createU256Type()), +// ]); +// } + +// static createConnectionIdType(): AlgebraicType { +// return this.createProductType([ +// new ProductTypeElement('__connection_id__', this.createU128Type()), +// ]); +// } + +// static createScheduleAtType(): AlgebraicType { +// return ScheduleAt.getAlgebraicType(); +// } + +// static createTimestampType(): AlgebraicType { +// return this.createProductType([ +// new ProductTypeElement( +// '__timestamp_micros_since_unix_epoch__', +// this.createI64Type() +// ), +// ]); +// } + +// static createTimeDurationType(): AlgebraicType { +// return this.createProductType([ +// new ProductTypeElement('__time_duration_micros__', this.createI64Type()), +// ]); +// } + +// isProductType(): boolean { +// return this.type === Type.ProductType; +// } + +// isSumType(): boolean { +// return this.type === Type.SumType; +// } + +// isArrayType(): boolean { +// return this.type === Type.ArrayType; +// } + +// isMapType(): boolean { +// return this.type === Type.MapType; +// } + +// #isBytes(): boolean { +// return this.isArrayType() && this.array.type == Type.U8; +// } + +// #isBytesNewtype(tag: string): boolean { +// return ( +// this.isProductType() && +// this.product.elements.length === 1 && +// (this.product.elements[0].algebraicType.type == Type.U128 || +// this.product.elements[0].algebraicType.type == Type.U256) && +// this.product.elements[0].name === tag +// ); +// } + +// #isI64Newtype(tag: string): boolean { +// return ( +// this.isProductType() && +// this.product.elements.length === 1 && +// this.product.elements[0].algebraicType.type === Type.I64 && +// this.product.elements[0].name === tag +// ); +// } + +// isIdentity(): boolean { +// return this.#isBytesNewtype('__identity__'); +// } + +// isConnectionId(): boolean { +// return this.#isBytesNewtype('__connection_id__'); +// } + +// isScheduleAt(): boolean { +// return ( +// this.isSumType() && +// this.sum.variants.length === 2 && +// this.sum.variants[0].name === 'Interval' && +// this.sum.variants[0].algebraicType.type === Type.U64 && +// this.sum.variants[1].name === 'Time' && +// this.sum.variants[1].algebraicType.type === Type.U64 +// ); +// } + +// isTimestamp(): boolean { +// return this.#isI64Newtype('__timestamp_micros_since_unix_epoch__'); +// } + +// isTimeDuration(): boolean { +// return this.#isI64Newtype('__time_duration_micros__'); +// } + +// /** +// * Convert a value of the algebraic type into something that can be used as a key in a map. +// * There are no guarantees about being able to order it. +// * This is only guaranteed to be comparable to other values of the same type. +// * @param value A value of the algebraic type +// * @returns Something that can be used as a key in a map. +// */ +// intoMapKey(value: any): ComparablePrimitive { +// switch (this.type) { +// case Type.U8: +// case Type.U16: +// case Type.U32: +// case Type.U64: +// case Type.U128: +// case Type.U256: +// case Type.I8: +// case Type.I16: +// case Type.I64: +// case Type.I128: +// case Type.F32: +// case Type.F64: +// case Type.String: +// case Type.Bool: +// return value; +// case Type.ProductType: +// return this.product.intoMapKey(value); +// default: +// const writer = new BinaryWriter(10); +// this.serialize(writer, value); +// return writer.toBase64(); +// } +// } + +// serialize(writer: BinaryWriter, value: any): void { +// switch (this.type) { +// case Type.ProductType: +// this.product.serialize(writer, value); +// break; +// case Type.SumType: +// this.sum.serialize(writer, value); +// break; +// case Type.ArrayType: +// if (this.#isBytes()) { +// writer.writeUInt8Array(value); +// } else { +// const elemType = this.array; +// writer.writeU32(value.length); +// for (let elem of value) { +// elemType.serialize(writer, elem); +// } +// } +// break; +// case Type.MapType: +// throw new Error('not implemented'); +// case Type.Bool: +// writer.writeBool(value); +// break; +// case Type.I8: +// writer.writeI8(value); +// break; +// case Type.U8: +// writer.writeU8(value); +// break; +// case Type.I16: +// writer.writeI16(value); +// break; +// case Type.U16: +// writer.writeU16(value); +// break; +// case Type.I32: +// writer.writeI32(value); +// break; +// case Type.U32: +// writer.writeU32(value); +// break; +// case Type.I64: +// writer.writeI64(value); +// break; +// case Type.U64: +// writer.writeU64(value); +// break; +// case Type.I128: +// writer.writeI128(value); +// break; +// case Type.U128: +// writer.writeU128(value); +// break; +// case Type.I256: +// writer.writeI256(value); +// break; +// case Type.U256: +// writer.writeU256(value); +// break; +// case Type.F32: +// writer.writeF32(value); +// break; +// case Type.F64: +// writer.writeF64(value); +// break; +// case Type.String: +// writer.writeString(value); +// break; +// default: +// throw new Error(`not implemented, ${this.type}`); +// } +// } + +// deserialize(reader: BinaryReader): any { +// switch (this.type) { +// case Type.ProductType: +// return this.product.deserialize(reader); +// case Type.SumType: +// return this.sum.deserialize(reader); +// case Type.ArrayType: +// if (this.#isBytes()) { +// return reader.readUInt8Array(); +// } else { +// const elemType = this.array; +// const length = reader.readU32(); +// let result: any[] = []; +// for (let i = 0; i < length; i++) { +// result.push(elemType.deserialize(reader)); +// } +// return result; +// } +// case Type.MapType: +// // TODO: MapType is being removed +// throw new Error('not implemented'); +// case Type.Bool: +// return reader.readBool(); +// case Type.I8: +// return reader.readI8(); +// case Type.U8: +// return reader.readU8(); +// case Type.I16: +// return reader.readI16(); +// case Type.U16: +// return reader.readU16(); +// case Type.I32: +// return reader.readI32(); +// case Type.U32: +// return reader.readU32(); +// case Type.I64: +// return reader.readI64(); +// case Type.U64: +// return reader.readU64(); +// case Type.I128: +// return reader.readI128(); +// case Type.U128: +// return reader.readU128(); +// case Type.U256: +// return reader.readU256(); +// case Type.F32: +// return reader.readF32(); +// case Type.F64: +// return reader.readF64(); +// case Type.String: +// return reader.readString(); +// default: +// throw new Error(`not implemented, ${this.type}`); +// } +// } +// } + +// export namespace AlgebraicType { +// export enum Type { +// SumType = 'SumType', +// ProductType = 'ProductType', +// ArrayType = 'ArrayType', +// MapType = 'MapType', +// Bool = 'Bool', +// I8 = 'I8', +// U8 = 'U8', +// I16 = 'I16', +// U16 = 'U16', +// I32 = 'I32', +// U32 = 'U32', +// I64 = 'I64', +// U64 = 'U64', +// I128 = 'I128', +// U128 = 'U128', +// I256 = 'I256', +// U256 = 'U256', +// F32 = 'F32', +// F64 = 'F64', +// /** UTF-8 encoded */ +// String = 'String', +// None = 'None', +// } +// } + +// // No idea why but in order to have a local alias for both of these +// // need to be present +// type Type = AlgebraicType.Type; +// let Type: typeof AlgebraicType.Type = AlgebraicType.Type; diff --git a/crates/bindings-typescript/src/algebraic_value.ts b/crates/bindings-typescript/src/algebraic_value.ts index b91a1de5a51..558f48a2a01 100644 --- a/crates/bindings-typescript/src/algebraic_value.ts +++ b/crates/bindings-typescript/src/algebraic_value.ts @@ -1,325 +1,4 @@ -import { ConnectionId } from './connection_id'; -import { AlgebraicType, ProductType, SumType } from './algebraic_type'; import BinaryReader from './binary_reader'; -import { Identity } from './identity'; -import { ScheduleAt } from './schedule_at'; - -export interface ReducerArgsAdapter { - next: () => ValueAdapter; -} - -export class BinaryReducerArgsAdapter { - adapter: BinaryAdapter; - - constructor(adapter: BinaryAdapter) { - this.adapter = adapter; - } - - next(): ValueAdapter { - return this.adapter; - } -} - -/** Defines the interface for deserialize `AlgebraicValue`s*/ -export interface ValueAdapter { - readUInt8Array: () => Uint8Array; - readArray: (type: AlgebraicType) => AlgebraicValue[]; - readMap: (keyType: AlgebraicType, valueType: AlgebraicType) => MapValue; - readString: () => string; - readSum: (type: SumType) => SumValue; - readProduct: (type: ProductType) => ProductValue; - - readBool: () => boolean; - readByte: () => number; - readI8: () => number; - readU8: () => number; - readI16: () => number; - readU16: () => number; - readI32: () => number; - readU32: () => number; - readI64: () => bigint; - readU64: () => bigint; - readU128: () => bigint; - readI128: () => bigint; - readF32: () => number; - readF64: () => number; - - callMethod(methodName: K): any; -} - -export class BinaryAdapter implements ValueAdapter { - #reader: BinaryReader; - - constructor(reader: BinaryReader) { - this.#reader = reader; - } - - callMethod(methodName: K): any { - return (this[methodName] as Function)(); - } - - readUInt8Array(): Uint8Array { - return this.#reader.readUInt8Array(); - } - - readArray(type: AlgebraicType): AlgebraicValue[] { - const length = this.#reader.readU32(); - let result: AlgebraicValue[] = []; - for (let i = 0; i < length; i++) { - result.push(AlgebraicValue.deserialize(type, this)); - } - - return result; - } - - readMap(keyType: AlgebraicType, valueType: AlgebraicType): MapValue { - const mapLength = this.#reader.readU32(); - let result: MapValue = new Map(); - for (let i = 0; i < mapLength; i++) { - const key = AlgebraicValue.deserialize(keyType, this); - const value = AlgebraicValue.deserialize(valueType, this); - result.set(key, value); - } - - return result; - } - - readString(): string { - return this.#reader.readString(); - } - - readSum(type: SumType): SumValue { - let tag = this.#reader.readByte(); - let sumValue = AlgebraicValue.deserialize( - type.variants[tag].algebraicType, - this - ); - return new SumValue(tag, sumValue); - } - - readProduct(type: ProductType): ProductValue { - let elements: AlgebraicValue[] = []; - - for (let element of type.elements) { - elements.push(AlgebraicValue.deserialize(element.algebraicType, this)); - } - return new ProductValue(elements); - } - - readBool(): boolean { - return this.#reader.readBool(); - } - readByte(): number { - return this.#reader.readByte(); - } - readI8(): number { - return this.#reader.readI8(); - } - readU8(): number { - return this.#reader.readU8(); - } - readI16(): number { - return this.#reader.readI16(); - } - readU16(): number { - return this.#reader.readU16(); - } - readI32(): number { - return this.#reader.readI32(); - } - readU32(): number { - return this.#reader.readU32(); - } - readI64(): bigint { - return this.#reader.readI64(); - } - readU64(): bigint { - return this.#reader.readU64(); - } - readU128(): bigint { - return this.#reader.readU128(); - } - readI128(): bigint { - return this.#reader.readI128(); - } - readF32(): number { - return this.#reader.readF32(); - } - readF64(): number { - return this.#reader.readF64(); - } -} - -/** A value of a sum type choosing a specific variant of the type. */ -export class SumValue { - /** A tag representing the choice of one variant of the sum type's variants. */ - tag: number; - /** - * Given a variant `Var(Ty)` in a sum type `{ Var(Ty), ... }`, - * this provides the `value` for `Ty`. - */ - value: AlgebraicValue; - - constructor(tag: number, value: AlgebraicValue) { - this.tag = tag; - this.value = value; - } - - static deserialize(type: SumType, adapter: ValueAdapter): SumValue { - return adapter.readSum(type); - } -} - -/** - * A product value is made of a list of - * "elements" / "fields" / "factors" of other `AlgebraicValue`s. - * - * The type of product value is a [product type](`ProductType`). - */ -export class ProductValue { - elements: AlgebraicValue[]; - - constructor(elements: AlgebraicValue[]) { - this.elements = elements; - } - - static deserialize(type: ProductType, adapter: ValueAdapter): ProductValue { - return adapter.readProduct(type); - } -} - -export type MapValue = Map; - -type AnyValue = - | SumValue - | ProductValue - | AlgebraicValue[] - | Uint8Array - | MapValue - | string - | boolean - | number - | bigint; - -/** A value in SATS. */ -export class AlgebraicValue { - value: AnyValue; - - constructor(value: AnyValue | undefined) { - if (value === undefined) { - // TODO: possibly get rid of it - throw 'value is undefined'; - } - this.value = value; - } - - callMethod(methodName: K): any { - return (this[methodName] as Function)(); - } - - static deserialize( - type: AlgebraicType, - adapter: ValueAdapter - ): AlgebraicValue { - switch (type.type) { - case AlgebraicType.Type.ProductType: - return new this(ProductValue.deserialize(type.product, adapter)); - case AlgebraicType.Type.SumType: - return new this(SumValue.deserialize(type.sum, adapter)); - case AlgebraicType.Type.ArrayType: - let elemType = type.array; - if (elemType.type === AlgebraicType.Type.U8) { - return new this(adapter.readUInt8Array()); - } else { - return new this(adapter.readArray(elemType)); - } - case AlgebraicType.Type.MapType: - let mapType = type.map; - return new this(adapter.readMap(mapType.keyType, mapType.valueType)); - case AlgebraicType.Type.Bool: - return new this(adapter.readBool()); - case AlgebraicType.Type.I8: - return new this(adapter.readI8()); - case AlgebraicType.Type.U8: - return new this(adapter.readU8()); - case AlgebraicType.Type.I16: - return new this(adapter.readI16()); - case AlgebraicType.Type.U16: - return new this(adapter.readU16()); - case AlgebraicType.Type.I32: - return new this(adapter.readI32()); - case AlgebraicType.Type.U32: - return new this(adapter.readU32()); - case AlgebraicType.Type.I64: - return new this(adapter.readI64()); - case AlgebraicType.Type.U64: - return new this(adapter.readU64()); - case AlgebraicType.Type.I128: - return new this(adapter.readI128()); - case AlgebraicType.Type.U128: - return new this(adapter.readU128()); - case AlgebraicType.Type.String: - return new this(adapter.readString()); - default: - throw new Error(`not implemented, ${type.type}`); - } - } - - // TODO: all of the following methods should actually check the type of `self.value` - // and throw if it does not match. - - asProductValue(): ProductValue { - return this.value as ProductValue; - } - - asField(index: number): AlgebraicValue { - return this.asProductValue().elements[index]; - } - - asSumValue(): SumValue { - return this.value as SumValue; - } - - asArray(): AlgebraicValue[] { - return this.value as AlgebraicValue[]; - } - - asMap(): MapValue { - return this.value as MapValue; - } - - asString(): string { - return this.value as string; - } - - asBoolean(): boolean { - return this.value as boolean; - } - - asNumber(): number { - return this.value as number; - } - - asBytes(): Uint8Array { - return this.value as Uint8Array; - } - - asBigInt(): bigint { - return this.value as bigint; - } - - asIdentity(): Identity { - return new Identity(this.asField(0).asBigInt()); - } - - asConnectionId(): ConnectionId { - return new ConnectionId(this.asField(0).asBigInt()); - } - - asScheduleAt(): ScheduleAt { - return ScheduleAt.fromValue(this); - } -} export interface ParseableType { deserialize: (reader: BinaryReader) => T; diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts new file mode 100644 index 00000000000..f9d5ae5f975 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts @@ -0,0 +1,157 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { SumType as __SumType } from "./sum_type_type"; +import { ProductType as __ProductType } from "./product_type_type"; + +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace __AlgebraicTypeVariants { + export type Ref = { tag: "Ref", value: number }; + export type Sum = { tag: "Sum", value: __SumType }; + export type Product = { tag: "Product", value: __ProductType }; + export type Array = { tag: "Array", value: __AlgebraicType }; + export type String = { tag: "String" }; + export type Bool = { tag: "Bool" }; + export type I8 = { tag: "I8" }; + export type U8 = { tag: "U8" }; + export type I16 = { tag: "I16" }; + export type U16 = { tag: "U16" }; + export type I32 = { tag: "I32" }; + export type U32 = { tag: "U32" }; + export type I64 = { tag: "I64" }; + export type U64 = { tag: "U64" }; + export type I128 = { tag: "I128" }; + export type U128 = { tag: "U128" }; + export type I256 = { tag: "I256" }; + export type U256 = { tag: "U256" }; + export type F32 = { tag: "F32" }; + export type F64 = { tag: "F64" }; +} + +// A namespace for generated variants and helper functions. +export namespace __AlgebraicType { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const Ref = (value: number): __AlgebraicType => ({ tag: "Ref", value }); + export const Sum = (value: __SumType): __AlgebraicType => ({ tag: "Sum", value }); + export const Product = (value: __ProductType): __AlgebraicType => ({ tag: "Product", value }); + export const Array = (value: __AlgebraicType): __AlgebraicType => ({ tag: "Array", value }); + export const String: { tag: "String" } = { tag: "String" }; + export const Bool: { tag: "Bool" } = { tag: "Bool" }; + export const I8: { tag: "I8" } = { tag: "I8" }; + export const U8: { tag: "U8" } = { tag: "U8" }; + export const I16: { tag: "I16" } = { tag: "I16" }; + export const U16: { tag: "U16" } = { tag: "U16" }; + export const I32: { tag: "I32" } = { tag: "I32" }; + export const U32: { tag: "U32" } = { tag: "U32" }; + export const I64: { tag: "I64" } = { tag: "I64" }; + export const U64: { tag: "U64" } = { tag: "U64" }; + export const I128: { tag: "I128" } = { tag: "I128" }; + export const U128: { tag: "U128" } = { tag: "U128" }; + export const I256: { tag: "I256" } = { tag: "I256" }; + export const U256: { tag: "U256" } = { tag: "U256" }; + export const F32: { tag: "F32" } = { tag: "F32" }; + export const F64: { tag: "F64" } = { tag: "F64" }; + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "Ref", algebraicType: AlgebraicType.U32 }, + { name: "Sum", algebraicType: __SumType.getTypeScriptAlgebraicType() }, + { name: "Product", algebraicType: __ProductType.getTypeScriptAlgebraicType() }, + { name: "Array", algebraicType: __AlgebraicType.getTypeScriptAlgebraicType() }, + { name: "String", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "Bool", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "I8", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "U8", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "I16", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "U16", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "I32", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "U32", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "I64", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "U64", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "I128", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "U128", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "I256", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "U256", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "F32", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "F64", algebraicType: AlgebraicType.Product({ elements: [] }) }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: __AlgebraicType): void { + AlgebraicType.serializeValue(writer, __AlgebraicType.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): __AlgebraicType { + return AlgebraicType.deserializeValue(reader, __AlgebraicType.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `__AlgebraicType`. +export type __AlgebraicType = __AlgebraicTypeVariants.Ref | + __AlgebraicTypeVariants.Sum | + __AlgebraicTypeVariants.Product | + __AlgebraicTypeVariants.Array | + __AlgebraicTypeVariants.String | + __AlgebraicTypeVariants.Bool | + __AlgebraicTypeVariants.I8 | + __AlgebraicTypeVariants.U8 | + __AlgebraicTypeVariants.I16 | + __AlgebraicTypeVariants.U16 | + __AlgebraicTypeVariants.I32 | + __AlgebraicTypeVariants.U32 | + __AlgebraicTypeVariants.I64 | + __AlgebraicTypeVariants.U64 | + __AlgebraicTypeVariants.I128 | + __AlgebraicTypeVariants.U128 | + __AlgebraicTypeVariants.I256 | + __AlgebraicTypeVariants.U256 | + __AlgebraicTypeVariants.F32 | + __AlgebraicTypeVariants.F64; + +export default __AlgebraicType; + diff --git a/crates/bindings-typescript/src/autogen/index_type_type.ts b/crates/bindings-typescript/src/autogen/index_type_type.ts new file mode 100644 index 00000000000..a06974c172c --- /dev/null +++ b/crates/bindings-typescript/src/autogen/index_type_type.ts @@ -0,0 +1,82 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace IndexTypeVariants { + export type BTree = { tag: "BTree" }; + export type Hash = { tag: "Hash" }; +} + +// A namespace for generated variants and helper functions. +export namespace IndexType { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const BTree: { tag: "BTree" } = { tag: "BTree" }; + export const Hash: { tag: "Hash" } = { tag: "Hash" }; + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "BTree", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "Hash", algebraicType: AlgebraicType.Product({ elements: [] }) }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: IndexType): void { + AlgebraicType.serializeValue(writer, IndexType.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): IndexType { + return AlgebraicType.deserializeValue(reader, IndexType.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `IndexType`. +export type IndexType = IndexTypeVariants.BTree | + IndexTypeVariants.Hash; + +export default IndexType; + diff --git a/crates/bindings-typescript/src/autogen/lifecycle_type.ts b/crates/bindings-typescript/src/autogen/lifecycle_type.ts new file mode 100644 index 00000000000..fcf1ff9372b --- /dev/null +++ b/crates/bindings-typescript/src/autogen/lifecycle_type.ts @@ -0,0 +1,86 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace LifecycleVariants { + export type Init = { tag: "Init" }; + export type OnConnect = { tag: "OnConnect" }; + export type OnDisconnect = { tag: "OnDisconnect" }; +} + +// A namespace for generated variants and helper functions. +export namespace Lifecycle { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const Init: { tag: "Init" } = { tag: "Init" }; + export const OnConnect: { tag: "OnConnect" } = { tag: "OnConnect" }; + export const OnDisconnect: { tag: "OnDisconnect" } = { tag: "OnDisconnect" }; + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "Init", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "OnConnect", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "OnDisconnect", algebraicType: AlgebraicType.Product({ elements: [] }) }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: Lifecycle): void { + AlgebraicType.serializeValue(writer, Lifecycle.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): Lifecycle { + return AlgebraicType.deserializeValue(reader, Lifecycle.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `Lifecycle`. +export type Lifecycle = LifecycleVariants.Init | + LifecycleVariants.OnConnect | + LifecycleVariants.OnDisconnect; + +export default Lifecycle; + diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts new file mode 100644 index 00000000000..93434fdaff6 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts @@ -0,0 +1,80 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { TypeAlias as __TypeAlias } from "./type_alias_type"; + +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace MiscModuleExportVariants { + export type TypeAlias = { tag: "TypeAlias", value: __TypeAlias }; +} + +// A namespace for generated variants and helper functions. +export namespace MiscModuleExport { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const TypeAlias = (value: __TypeAlias): MiscModuleExport => ({ tag: "TypeAlias", value }); + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "TypeAlias", algebraicType: __TypeAlias.getTypeScriptAlgebraicType() }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: MiscModuleExport): void { + AlgebraicType.serializeValue(writer, MiscModuleExport.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): MiscModuleExport { + return AlgebraicType.deserializeValue(reader, MiscModuleExport.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `MiscModuleExport`. +export type MiscModuleExport = MiscModuleExportVariants.TypeAlias; + +export default MiscModuleExport; + diff --git a/crates/bindings-typescript/src/autogen/product_type_element_type.ts b/crates/bindings-typescript/src/autogen/product_type_element_type.ts new file mode 100644 index 00000000000..70ae3fa9f72 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -0,0 +1,70 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { AlgebraicType as __AlgebraicType } from "./algebraic_type_type"; + +export type ProductTypeElement = { + name: string | undefined, + algebraicType: __AlgebraicType, +}; +export default ProductTypeElement; + +/** + * A namespace for generated helper functions. + */ +export namespace ProductTypeElement { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + { name: "algebraicType", algebraicType: __AlgebraicType.getTypeScriptAlgebraicType()}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: ProductTypeElement): void { + AlgebraicType.serializeValue(writer, ProductTypeElement.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): ProductTypeElement { + return AlgebraicType.deserializeValue(reader, ProductTypeElement.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/product_type_type.ts b/crates/bindings-typescript/src/autogen/product_type_type.ts new file mode 100644 index 00000000000..a16c137bd98 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/product_type_type.ts @@ -0,0 +1,68 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { ProductTypeElement as __ProductTypeElement } from "./product_type_element_type"; + +export type ProductType = { + elements: __ProductTypeElement[], +}; +export default ProductType; + +/** + * A namespace for generated helper functions. + */ +export namespace ProductType { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "elements", algebraicType: AlgebraicType.Array(__ProductTypeElement.getTypeScriptAlgebraicType())}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: ProductType): void { + AlgebraicType.serializeValue(writer, ProductType.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): ProductType { + return AlgebraicType.deserializeValue(reader, ProductType.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts new file mode 100644 index 00000000000..412d1d9fd48 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts @@ -0,0 +1,70 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { AlgebraicType as __AlgebraicType } from "./algebraic_type_type"; + +export type RawColumnDefV8 = { + colName: string, + colType: __AlgebraicType, +}; +export default RawColumnDefV8; + +/** + * A namespace for generated helper functions. + */ +export namespace RawColumnDefV8 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "colName", algebraicType: AlgebraicType.String}, + { name: "colType", algebraicType: __AlgebraicType.getTypeScriptAlgebraicType()}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawColumnDefV8): void { + AlgebraicType.serializeValue(writer, RawColumnDefV8.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawColumnDefV8 { + return AlgebraicType.deserializeValue(reader, RawColumnDefV8.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts new file mode 100644 index 00000000000..43edfa08e47 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts @@ -0,0 +1,80 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RawUniqueConstraintDataV9 as __RawUniqueConstraintDataV9 } from "./raw_unique_constraint_data_v_9_type"; + +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace RawConstraintDataV9Variants { + export type Unique = { tag: "Unique", value: __RawUniqueConstraintDataV9 }; +} + +// A namespace for generated variants and helper functions. +export namespace RawConstraintDataV9 { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const Unique = (value: __RawUniqueConstraintDataV9): RawConstraintDataV9 => ({ tag: "Unique", value }); + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "Unique", algebraicType: __RawUniqueConstraintDataV9.getTypeScriptAlgebraicType() }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawConstraintDataV9): void { + AlgebraicType.serializeValue(writer, RawConstraintDataV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawConstraintDataV9 { + return AlgebraicType.deserializeValue(reader, RawConstraintDataV9.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `RawConstraintDataV9`. +export type RawConstraintDataV9 = RawConstraintDataV9Variants.Unique; + +export default RawConstraintDataV9; + diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts new file mode 100644 index 00000000000..aa9c491c182 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts @@ -0,0 +1,70 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +export type RawConstraintDefV8 = { + constraintName: string, + constraints: number, + columns: number[], +}; +export default RawConstraintDefV8; + +/** + * A namespace for generated helper functions. + */ +export namespace RawConstraintDefV8 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "constraintName", algebraicType: AlgebraicType.String}, + { name: "constraints", algebraicType: AlgebraicType.U8}, + { name: "columns", algebraicType: AlgebraicType.Array(AlgebraicType.U16)}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawConstraintDefV8): void { + AlgebraicType.serializeValue(writer, RawConstraintDefV8.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawConstraintDefV8 { + return AlgebraicType.deserializeValue(reader, RawConstraintDefV8.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts new file mode 100644 index 00000000000..f667bcbd58d --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts @@ -0,0 +1,70 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RawConstraintDataV9 as __RawConstraintDataV9 } from "./raw_constraint_data_v_9_type"; + +export type RawConstraintDefV9 = { + name: string | undefined, + data: __RawConstraintDataV9, +}; +export default RawConstraintDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawConstraintDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + { name: "data", algebraicType: __RawConstraintDataV9.getTypeScriptAlgebraicType()}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawConstraintDefV9): void { + AlgebraicType.serializeValue(writer, RawConstraintDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawConstraintDefV9 { + return AlgebraicType.deserializeValue(reader, RawConstraintDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts new file mode 100644 index 00000000000..4e0b98da2bc --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts @@ -0,0 +1,86 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace RawIndexAlgorithmVariants { + export type BTree = { tag: "BTree", value: number[] }; + export type Hash = { tag: "Hash", value: number[] }; + export type Direct = { tag: "Direct", value: number }; +} + +// A namespace for generated variants and helper functions. +export namespace RawIndexAlgorithm { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const BTree = (value: number[]): RawIndexAlgorithm => ({ tag: "BTree", value }); + export const Hash = (value: number[]): RawIndexAlgorithm => ({ tag: "Hash", value }); + export const Direct = (value: number): RawIndexAlgorithm => ({ tag: "Direct", value }); + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "BTree", algebraicType: AlgebraicType.Array(AlgebraicType.U16) }, + { name: "Hash", algebraicType: AlgebraicType.Array(AlgebraicType.U16) }, + { name: "Direct", algebraicType: AlgebraicType.U16 }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawIndexAlgorithm): void { + AlgebraicType.serializeValue(writer, RawIndexAlgorithm.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawIndexAlgorithm { + return AlgebraicType.deserializeValue(reader, RawIndexAlgorithm.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `RawIndexAlgorithm`. +export type RawIndexAlgorithm = RawIndexAlgorithmVariants.BTree | + RawIndexAlgorithmVariants.Hash | + RawIndexAlgorithmVariants.Direct; + +export default RawIndexAlgorithm; + diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts new file mode 100644 index 00000000000..653ab5f931e --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts @@ -0,0 +1,74 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { IndexType as __IndexType } from "./index_type_type"; + +export type RawIndexDefV8 = { + indexName: string, + isUnique: boolean, + indexType: __IndexType, + columns: number[], +}; +export default RawIndexDefV8; + +/** + * A namespace for generated helper functions. + */ +export namespace RawIndexDefV8 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "indexName", algebraicType: AlgebraicType.String}, + { name: "isUnique", algebraicType: AlgebraicType.Bool}, + { name: "indexType", algebraicType: __IndexType.getTypeScriptAlgebraicType()}, + { name: "columns", algebraicType: AlgebraicType.Array(AlgebraicType.U16)}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawIndexDefV8): void { + AlgebraicType.serializeValue(writer, RawIndexDefV8.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawIndexDefV8 { + return AlgebraicType.deserializeValue(reader, RawIndexDefV8.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts new file mode 100644 index 00000000000..4bb32cdebff --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts @@ -0,0 +1,72 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RawIndexAlgorithm as __RawIndexAlgorithm } from "./raw_index_algorithm_type"; + +export type RawIndexDefV9 = { + name: string | undefined, + accessorName: string | undefined, + algorithm: __RawIndexAlgorithm, +}; +export default RawIndexDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawIndexDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + { name: "accessorName", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + { name: "algorithm", algebraicType: __RawIndexAlgorithm.getTypeScriptAlgebraicType()}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawIndexDefV9): void { + AlgebraicType.serializeValue(writer, RawIndexDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawIndexDefV9 { + return AlgebraicType.deserializeValue(reader, RawIndexDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts new file mode 100644 index 00000000000..d9c0873bbc9 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts @@ -0,0 +1,75 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace RawMiscModuleExportV9Variants { +} + +// A namespace for generated variants and helper functions. +export namespace RawMiscModuleExportV9 { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawMiscModuleExportV9): void { + AlgebraicType.serializeValue(writer, RawMiscModuleExportV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawMiscModuleExportV9 { + return AlgebraicType.deserializeValue(reader, RawMiscModuleExportV9.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `RawMiscModuleExportV9`. +export type RawMiscModuleExportV9 = never; + +export default RawMiscModuleExportV9; + diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts new file mode 100644 index 00000000000..568906fa4f2 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts @@ -0,0 +1,85 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RawModuleDefV8 as __RawModuleDefV8 } from "./raw_module_def_v_8_type"; +import { RawModuleDefV9 as __RawModuleDefV9 } from "./raw_module_def_v_9_type"; + +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace RawModuleDefVariants { + export type V8BackCompat = { tag: "V8BackCompat", value: __RawModuleDefV8 }; + export type V9 = { tag: "V9", value: __RawModuleDefV9 }; +} + +// A namespace for generated variants and helper functions. +export namespace RawModuleDef { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const V8BackCompat = (value: __RawModuleDefV8): RawModuleDef => ({ tag: "V8BackCompat", value }); + export const V9 = (value: __RawModuleDefV9): RawModuleDef => ({ tag: "V9", value }); + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "V8BackCompat", algebraicType: __RawModuleDefV8.getTypeScriptAlgebraicType() }, + { name: "V9", algebraicType: __RawModuleDefV9.getTypeScriptAlgebraicType() }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawModuleDef): void { + AlgebraicType.serializeValue(writer, RawModuleDef.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawModuleDef { + return AlgebraicType.deserializeValue(reader, RawModuleDef.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `RawModuleDef`. +export type RawModuleDef = RawModuleDefVariants.V8BackCompat | + RawModuleDefVariants.V9; + +export default RawModuleDef; + diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts new file mode 100644 index 00000000000..b911697bd5c --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts @@ -0,0 +1,77 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { Typespace as __Typespace } from "./typespace_type"; +import { TableDesc as __TableDesc } from "./table_desc_type"; +import { ReducerDef as __ReducerDef } from "./reducer_def_type"; +import { MiscModuleExport as __MiscModuleExport } from "./misc_module_export_type"; + +export type RawModuleDefV8 = { + typespace: __Typespace, + tables: __TableDesc[], + reducers: __ReducerDef[], + miscExports: __MiscModuleExport[], +}; +export default RawModuleDefV8; + +/** + * A namespace for generated helper functions. + */ +export namespace RawModuleDefV8 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "typespace", algebraicType: __Typespace.getTypeScriptAlgebraicType()}, + { name: "tables", algebraicType: AlgebraicType.Array(__TableDesc.getTypeScriptAlgebraicType())}, + { name: "reducers", algebraicType: AlgebraicType.Array(__ReducerDef.getTypeScriptAlgebraicType())}, + { name: "miscExports", algebraicType: AlgebraicType.Array(__MiscModuleExport.getTypeScriptAlgebraicType())}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawModuleDefV8): void { + AlgebraicType.serializeValue(writer, RawModuleDefV8.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawModuleDefV8 { + return AlgebraicType.deserializeValue(reader, RawModuleDefV8.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts new file mode 100644 index 00000000000..bca71219d52 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts @@ -0,0 +1,83 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { Typespace as __Typespace } from "./typespace_type"; +import { RawTableDefV9 as __RawTableDefV9 } from "./raw_table_def_v_9_type"; +import { RawReducerDefV9 as __RawReducerDefV9 } from "./raw_reducer_def_v_9_type"; +import { RawTypeDefV9 as __RawTypeDefV9 } from "./raw_type_def_v_9_type"; +import { RawMiscModuleExportV9 as __RawMiscModuleExportV9 } from "./raw_misc_module_export_v_9_type"; +import { RawRowLevelSecurityDefV9 as __RawRowLevelSecurityDefV9 } from "./raw_row_level_security_def_v_9_type"; + +export type RawModuleDefV9 = { + typespace: __Typespace, + tables: __RawTableDefV9[], + reducers: __RawReducerDefV9[], + types: __RawTypeDefV9[], + miscExports: __RawMiscModuleExportV9[], + rowLevelSecurity: __RawRowLevelSecurityDefV9[], +}; +export default RawModuleDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawModuleDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "typespace", algebraicType: __Typespace.getTypeScriptAlgebraicType()}, + { name: "tables", algebraicType: AlgebraicType.Array(__RawTableDefV9.getTypeScriptAlgebraicType())}, + { name: "reducers", algebraicType: AlgebraicType.Array(__RawReducerDefV9.getTypeScriptAlgebraicType())}, + { name: "types", algebraicType: AlgebraicType.Array(__RawTypeDefV9.getTypeScriptAlgebraicType())}, + { name: "miscExports", algebraicType: AlgebraicType.Array(__RawMiscModuleExportV9.getTypeScriptAlgebraicType())}, + { name: "rowLevelSecurity", algebraicType: AlgebraicType.Array(__RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType())}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawModuleDefV9): void { + AlgebraicType.serializeValue(writer, RawModuleDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawModuleDefV9 { + return AlgebraicType.deserializeValue(reader, RawModuleDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts new file mode 100644 index 00000000000..445ade6d38a --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts @@ -0,0 +1,73 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { ProductType as __ProductType } from "./product_type_type"; +import { Lifecycle as __Lifecycle } from "./lifecycle_type"; + +export type RawReducerDefV9 = { + name: string, + params: __ProductType, + lifecycle: __Lifecycle | undefined, +}; +export default RawReducerDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawReducerDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + { name: "params", algebraicType: __ProductType.getTypeScriptAlgebraicType()}, + { name: "lifecycle", algebraicType: AlgebraicType.createOptionType(__Lifecycle.getTypeScriptAlgebraicType())}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawReducerDefV9): void { + AlgebraicType.serializeValue(writer, RawReducerDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawReducerDefV9 { + return AlgebraicType.deserializeValue(reader, RawReducerDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts new file mode 100644 index 00000000000..e20fca1415e --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts @@ -0,0 +1,66 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +export type RawRowLevelSecurityDefV9 = { + sql: string, +}; +export default RawRowLevelSecurityDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawRowLevelSecurityDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "sql", algebraicType: AlgebraicType.String}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawRowLevelSecurityDefV9): void { + AlgebraicType.serializeValue(writer, RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawRowLevelSecurityDefV9 { + return AlgebraicType.deserializeValue(reader, RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts new file mode 100644 index 00000000000..55f56a3c8db --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts @@ -0,0 +1,70 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +export type RawScheduleDefV9 = { + name: string | undefined, + reducerName: string, + scheduledAtColumn: number, +}; +export default RawScheduleDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawScheduleDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + { name: "reducerName", algebraicType: AlgebraicType.String}, + { name: "scheduledAtColumn", algebraicType: AlgebraicType.U16}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawScheduleDefV9): void { + AlgebraicType.serializeValue(writer, RawScheduleDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawScheduleDefV9 { + return AlgebraicType.deserializeValue(reader, RawScheduleDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts new file mode 100644 index 00000000000..89dd4b16434 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts @@ -0,0 +1,68 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +export type RawScopedTypeNameV9 = { + scope: string[], + name: string, +}; +export default RawScopedTypeNameV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawScopedTypeNameV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "scope", algebraicType: AlgebraicType.Array(AlgebraicType.String)}, + { name: "name", algebraicType: AlgebraicType.String}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawScopedTypeNameV9): void { + AlgebraicType.serializeValue(writer, RawScopedTypeNameV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawScopedTypeNameV9 { + return AlgebraicType.deserializeValue(reader, RawScopedTypeNameV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts new file mode 100644 index 00000000000..71e76813e63 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts @@ -0,0 +1,78 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +export type RawSequenceDefV8 = { + sequenceName: string, + colPos: number, + increment: bigint, + start: bigint | undefined, + minValue: bigint | undefined, + maxValue: bigint | undefined, + allocated: bigint, +}; +export default RawSequenceDefV8; + +/** + * A namespace for generated helper functions. + */ +export namespace RawSequenceDefV8 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "sequenceName", algebraicType: AlgebraicType.String}, + { name: "colPos", algebraicType: AlgebraicType.U16}, + { name: "increment", algebraicType: AlgebraicType.I128}, + { name: "start", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, + { name: "minValue", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, + { name: "maxValue", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, + { name: "allocated", algebraicType: AlgebraicType.I128}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawSequenceDefV8): void { + AlgebraicType.serializeValue(writer, RawSequenceDefV8.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawSequenceDefV8 { + return AlgebraicType.deserializeValue(reader, RawSequenceDefV8.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts new file mode 100644 index 00000000000..8523c56c766 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts @@ -0,0 +1,76 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +export type RawSequenceDefV9 = { + name: string | undefined, + column: number, + start: bigint | undefined, + minValue: bigint | undefined, + maxValue: bigint | undefined, + increment: bigint, +}; +export default RawSequenceDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawSequenceDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + { name: "column", algebraicType: AlgebraicType.U16}, + { name: "start", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, + { name: "minValue", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, + { name: "maxValue", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, + { name: "increment", algebraicType: AlgebraicType.I128}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawSequenceDefV9): void { + AlgebraicType.serializeValue(writer, RawSequenceDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawSequenceDefV9 { + return AlgebraicType.deserializeValue(reader, RawSequenceDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts new file mode 100644 index 00000000000..2cf4a411bd7 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts @@ -0,0 +1,85 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RawColumnDefV8 as __RawColumnDefV8 } from "./raw_column_def_v_8_type"; +import { RawIndexDefV8 as __RawIndexDefV8 } from "./raw_index_def_v_8_type"; +import { RawConstraintDefV8 as __RawConstraintDefV8 } from "./raw_constraint_def_v_8_type"; +import { RawSequenceDefV8 as __RawSequenceDefV8 } from "./raw_sequence_def_v_8_type"; + +export type RawTableDefV8 = { + tableName: string, + columns: __RawColumnDefV8[], + indexes: __RawIndexDefV8[], + constraints: __RawConstraintDefV8[], + sequences: __RawSequenceDefV8[], + tableType: string, + tableAccess: string, + scheduled: string | undefined, +}; +export default RawTableDefV8; + +/** + * A namespace for generated helper functions. + */ +export namespace RawTableDefV8 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "tableName", algebraicType: AlgebraicType.String}, + { name: "columns", algebraicType: AlgebraicType.Array(__RawColumnDefV8.getTypeScriptAlgebraicType())}, + { name: "indexes", algebraicType: AlgebraicType.Array(__RawIndexDefV8.getTypeScriptAlgebraicType())}, + { name: "constraints", algebraicType: AlgebraicType.Array(__RawConstraintDefV8.getTypeScriptAlgebraicType())}, + { name: "sequences", algebraicType: AlgebraicType.Array(__RawSequenceDefV8.getTypeScriptAlgebraicType())}, + { name: "tableType", algebraicType: AlgebraicType.String}, + { name: "tableAccess", algebraicType: AlgebraicType.String}, + { name: "scheduled", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawTableDefV8): void { + AlgebraicType.serializeValue(writer, RawTableDefV8.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawTableDefV8 { + return AlgebraicType.deserializeValue(reader, RawTableDefV8.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts new file mode 100644 index 00000000000..369051c1658 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts @@ -0,0 +1,89 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RawIndexDefV9 as __RawIndexDefV9 } from "./raw_index_def_v_9_type"; +import { RawConstraintDefV9 as __RawConstraintDefV9 } from "./raw_constraint_def_v_9_type"; +import { RawSequenceDefV9 as __RawSequenceDefV9 } from "./raw_sequence_def_v_9_type"; +import { RawScheduleDefV9 as __RawScheduleDefV9 } from "./raw_schedule_def_v_9_type"; +import { TableType as __TableType } from "./table_type_type"; +import { TableAccess as __TableAccess } from "./table_access_type"; + +export type RawTableDefV9 = { + name: string, + productTypeRef: number, + primaryKey: number[], + indexes: __RawIndexDefV9[], + constraints: __RawConstraintDefV9[], + sequences: __RawSequenceDefV9[], + schedule: __RawScheduleDefV9 | undefined, + tableType: __TableType, + tableAccess: __TableAccess, +}; +export default RawTableDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawTableDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + { name: "productTypeRef", algebraicType: AlgebraicType.U32}, + { name: "primaryKey", algebraicType: AlgebraicType.Array(AlgebraicType.U16)}, + { name: "indexes", algebraicType: AlgebraicType.Array(__RawIndexDefV9.getTypeScriptAlgebraicType())}, + { name: "constraints", algebraicType: AlgebraicType.Array(__RawConstraintDefV9.getTypeScriptAlgebraicType())}, + { name: "sequences", algebraicType: AlgebraicType.Array(__RawSequenceDefV9.getTypeScriptAlgebraicType())}, + { name: "schedule", algebraicType: AlgebraicType.createOptionType(__RawScheduleDefV9.getTypeScriptAlgebraicType())}, + { name: "tableType", algebraicType: __TableType.getTypeScriptAlgebraicType()}, + { name: "tableAccess", algebraicType: __TableAccess.getTypeScriptAlgebraicType()}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawTableDefV9): void { + AlgebraicType.serializeValue(writer, RawTableDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawTableDefV9 { + return AlgebraicType.deserializeValue(reader, RawTableDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts new file mode 100644 index 00000000000..04857e064e4 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts @@ -0,0 +1,72 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RawScopedTypeNameV9 as __RawScopedTypeNameV9 } from "./raw_scoped_type_name_v_9_type"; + +export type RawTypeDefV9 = { + name: __RawScopedTypeNameV9, + ty: number, + customOrdering: boolean, +}; +export default RawTypeDefV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawTypeDefV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: __RawScopedTypeNameV9.getTypeScriptAlgebraicType()}, + { name: "ty", algebraicType: AlgebraicType.U32}, + { name: "customOrdering", algebraicType: AlgebraicType.Bool}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawTypeDefV9): void { + AlgebraicType.serializeValue(writer, RawTypeDefV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawTypeDefV9 { + return AlgebraicType.deserializeValue(reader, RawTypeDefV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts new file mode 100644 index 00000000000..2636291def0 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts @@ -0,0 +1,66 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +export type RawUniqueConstraintDataV9 = { + columns: number[], +}; +export default RawUniqueConstraintDataV9; + +/** + * A namespace for generated helper functions. + */ +export namespace RawUniqueConstraintDataV9 { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "columns", algebraicType: AlgebraicType.Array(AlgebraicType.U16)}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: RawUniqueConstraintDataV9): void { + AlgebraicType.serializeValue(writer, RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): RawUniqueConstraintDataV9 { + return AlgebraicType.deserializeValue(reader, RawUniqueConstraintDataV9.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/reducer_def_type.ts b/crates/bindings-typescript/src/autogen/reducer_def_type.ts new file mode 100644 index 00000000000..52218a4aa0e --- /dev/null +++ b/crates/bindings-typescript/src/autogen/reducer_def_type.ts @@ -0,0 +1,70 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { ProductTypeElement as __ProductTypeElement } from "./product_type_element_type"; + +export type ReducerDef = { + name: string, + args: __ProductTypeElement[], +}; +export default ReducerDef; + +/** + * A namespace for generated helper functions. + */ +export namespace ReducerDef { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + { name: "args", algebraicType: AlgebraicType.Array(__ProductTypeElement.getTypeScriptAlgebraicType())}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: ReducerDef): void { + AlgebraicType.serializeValue(writer, ReducerDef.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): ReducerDef { + return AlgebraicType.deserializeValue(reader, ReducerDef.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/sum_type_type.ts b/crates/bindings-typescript/src/autogen/sum_type_type.ts new file mode 100644 index 00000000000..72de12849fd --- /dev/null +++ b/crates/bindings-typescript/src/autogen/sum_type_type.ts @@ -0,0 +1,68 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { SumTypeVariant as __SumTypeVariant } from "./sum_type_variant_type"; + +export type SumType = { + variants: __SumTypeVariant[], +}; +export default SumType; + +/** + * A namespace for generated helper functions. + */ +export namespace SumType { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "variants", algebraicType: AlgebraicType.Array(__SumTypeVariant.getTypeScriptAlgebraicType())}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: SumType): void { + AlgebraicType.serializeValue(writer, SumType.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): SumType { + return AlgebraicType.deserializeValue(reader, SumType.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts new file mode 100644 index 00000000000..03ea9f3da60 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -0,0 +1,70 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { AlgebraicType as __AlgebraicType } from "./algebraic_type_type"; + +export type SumTypeVariant = { + name: string | undefined, + algebraicType: __AlgebraicType, +}; +export default SumTypeVariant; + +/** + * A namespace for generated helper functions. + */ +export namespace SumTypeVariant { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + { name: "algebraicType", algebraicType: __AlgebraicType.getTypeScriptAlgebraicType()}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: SumTypeVariant): void { + AlgebraicType.serializeValue(writer, SumTypeVariant.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): SumTypeVariant { + return AlgebraicType.deserializeValue(reader, SumTypeVariant.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/table_access_type.ts b/crates/bindings-typescript/src/autogen/table_access_type.ts new file mode 100644 index 00000000000..0f53ac71798 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_access_type.ts @@ -0,0 +1,82 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace TableAccessVariants { + export type Public = { tag: "Public" }; + export type Private = { tag: "Private" }; +} + +// A namespace for generated variants and helper functions. +export namespace TableAccess { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const Public: { tag: "Public" } = { tag: "Public" }; + export const Private: { tag: "Private" } = { tag: "Private" }; + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "Public", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "Private", algebraicType: AlgebraicType.Product({ elements: [] }) }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: TableAccess): void { + AlgebraicType.serializeValue(writer, TableAccess.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): TableAccess { + return AlgebraicType.deserializeValue(reader, TableAccess.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `TableAccess`. +export type TableAccess = TableAccessVariants.Public | + TableAccessVariants.Private; + +export default TableAccess; + diff --git a/crates/bindings-typescript/src/autogen/table_desc_type.ts b/crates/bindings-typescript/src/autogen/table_desc_type.ts new file mode 100644 index 00000000000..413be60fc14 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_desc_type.ts @@ -0,0 +1,70 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RawTableDefV8 as __RawTableDefV8 } from "./raw_table_def_v_8_type"; + +export type TableDesc = { + schema: __RawTableDefV8, + data: number, +}; +export default TableDesc; + +/** + * A namespace for generated helper functions. + */ +export namespace TableDesc { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "schema", algebraicType: __RawTableDefV8.getTypeScriptAlgebraicType()}, + { name: "data", algebraicType: AlgebraicType.U32}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: TableDesc): void { + AlgebraicType.serializeValue(writer, TableDesc.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): TableDesc { + return AlgebraicType.deserializeValue(reader, TableDesc.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/table_type_type.ts b/crates/bindings-typescript/src/autogen/table_type_type.ts new file mode 100644 index 00000000000..93165f3a0cf --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_type_type.ts @@ -0,0 +1,82 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace TableTypeVariants { + export type System = { tag: "System" }; + export type User = { tag: "User" }; +} + +// A namespace for generated variants and helper functions. +export namespace TableType { + // Helper functions for constructing each variant of the tagged union. + // ``` + // const foo = Foo.A(42); + // assert!(foo.tag === "A"); + // assert!(foo.value === 42); + // ``` + export const System: { tag: "System" } = { tag: "System" }; + export const User: { tag: "User" } = { tag: "User" }; + + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { name: "System", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "User", algebraicType: AlgebraicType.Product({ elements: [] }) }, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: TableType): void { + AlgebraicType.serializeValue(writer, TableType.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): TableType { + return AlgebraicType.deserializeValue(reader, TableType.getTypeScriptAlgebraicType()); + } + +} + +// The tagged union or sum type for the algebraic type `TableType`. +export type TableType = TableTypeVariants.System | + TableTypeVariants.User; + +export default TableType; + diff --git a/crates/bindings-typescript/src/autogen/type_alias_type.ts b/crates/bindings-typescript/src/autogen/type_alias_type.ts new file mode 100644 index 00000000000..438a84d4b70 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -0,0 +1,68 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +export type TypeAlias = { + name: string, + ty: number, +}; +export default TypeAlias; + +/** + * A namespace for generated helper functions. + */ +export namespace TypeAlias { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + { name: "ty", algebraicType: AlgebraicType.U32}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: TypeAlias): void { + AlgebraicType.serializeValue(writer, TypeAlias.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): TypeAlias { + return AlgebraicType.deserializeValue(reader, TypeAlias.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts new file mode 100644 index 00000000000..57c23770071 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -0,0 +1,68 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType, + AlgebraicValue, + BinaryReader, + BinaryWriter, + ConnectionId, + DbConnectionBuilder, + DbConnectionImpl, + Identity, + ProductType, + ProductTypeElement, + SubscriptionBuilderImpl, + SumType, + SumTypeVariant, + TableCache, + TimeDuration, + Timestamp, + deepEqual, + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { AlgebraicType as __AlgebraicType } from "./algebraic_type_type"; + +export type Typespace = { + types: __AlgebraicType[], +}; +export default Typespace; + +/** + * A namespace for generated helper functions. + */ +export namespace Typespace { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + export function getTypeScriptAlgebraicType(): AlgebraicType { + return AlgebraicType.Product({ + elements: [ + { name: "types", algebraicType: AlgebraicType.Array(__AlgebraicType.getTypeScriptAlgebraicType())}, + ] + }); + } + + export function serialize(writer: BinaryWriter, value: Typespace): void { + AlgebraicType.serializeValue(writer, Typespace.getTypeScriptAlgebraicType(), value); + } + + export function deserialize(reader: BinaryReader): Typespace { + return AlgebraicType.deserializeValue(reader, Typespace.getTypeScriptAlgebraicType()); + } + +} + + diff --git a/crates/client-api-messages/DEVELOP.md b/crates/client-api-messages/DEVELOP.md index 554fe37f654..cc568be474f 100644 --- a/crates/client-api-messages/DEVELOP.md +++ b/crates/client-api-messages/DEVELOP.md @@ -6,7 +6,7 @@ In this directory: ```sh cargo run --example get_ws_schema > ws_schema.json -spacetime generate --lang \ +spacetime generate -p spacetimedb-cli --lang \ --out-dir \ --module-def ws_schema.json ``` diff --git a/crates/codegen/examples/regen-typescript-moduledef.rs b/crates/codegen/examples/regen-typescript-moduledef.rs new file mode 100644 index 00000000000..df7ec16f71d --- /dev/null +++ b/crates/codegen/examples/regen-typescript-moduledef.rs @@ -0,0 +1,50 @@ +//! This script is used to generate the C# bindings for the `RawModuleDef` type. +//! Run `cargo run --example regen-csharp-moduledef` to update C# bindings whenever the module definition changes. + +use fs_err as fs; +use regex::Regex; +use spacetimedb_codegen::{generate, typescript}; +use spacetimedb_lib::{RawModuleDef, RawModuleDefV8}; +use spacetimedb_schema::def::ModuleDef; +use std::path::Path; +use std::sync::OnceLock; + +macro_rules! regex_replace { + ($value:expr, $re:expr, $replace:expr) => {{ + static RE: OnceLock = OnceLock::new(); + RE.get_or_init(|| Regex::new($re).unwrap()) + .replace_all($value, $replace) + }}; +} + +fn main() -> anyhow::Result<()> { + let module = RawModuleDefV8::with_builder(|module| { + module.add_type::(); + }); + + let dir = &Path::new(concat!( + env!("CARGO_MANIFEST_DIR"), + "/../bindings-typescript/src/autogen" + )) + .canonicalize()?; + + fs::remove_dir_all(dir)?; + fs::create_dir(dir)?; + + let module: ModuleDef = module.try_into()?; + generate( + &module, + &typescript::TypeScript, + ) + .into_iter() + .try_for_each(|(filename, code)| { + // Skip the index.ts since we don't need it. + if filename == "index.ts" { + return Ok(()); + } + let code = regex_replace!(&code, r"@clockworklabs/spacetimedb-sdk", "../index"); + fs::write(dir.join(filename), code.as_bytes()) + })?; + + Ok(()) +} \ No newline at end of file diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index ce074dcf266..118a4f97f42 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -708,6 +708,8 @@ fn define_namespace_and_object_type_for_product( out.with_indent(|out| write_arglist_no_delimiters(module, out, elements, None, true).unwrap()); writeln!(out, "}};"); } + + writeln!(out, "export default {name};"); out.newline(); @@ -727,14 +729,14 @@ fn define_namespace_and_object_type_for_product( "export function serialize(writer: BinaryWriter, value: {name}): void {{" ); out.indent(1); - writeln!(out, "{name}.getTypeScriptAlgebraicType().serialize(writer, value);"); + writeln!(out, "AlgebraicType.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value);"); out.dedent(1); writeln!(out, "}}"); writeln!(out); writeln!(out, "export function deserialize(reader: BinaryReader): {name} {{"); out.indent(1); - writeln!(out, "return {name}.getTypeScriptAlgebraicType().deserialize(reader);"); + writeln!(out, "return AlgebraicType.deserializeValue(reader, {name}.getTypeScriptAlgebraicType());"); out.dedent(1); writeln!(out, "}}"); writeln!(out); @@ -828,10 +830,10 @@ fn write_variant_constructors( if matches!(ty, AlgebraicTypeUse::Unit) { // If the variant has no members, we can export a simple object. // ``` - // export const Foo = { tag: "Foo" }; + // export const Foo: { tag: "Foo" } = { tag: "Foo" }; // ``` - write!(out, "export const {ident} = "); - writeln!(out, "{{ tag: \"{ident}\" }};"); + write!(out, "export const {ident}: {{ tag: \"{ident}\" }} = {{ tag: \"{ident}\" }};"); + writeln!(out); continue; } let variant_name = ident.deref().to_case(Case::Pascal); @@ -859,23 +861,38 @@ fn write_get_algebraic_type_for_sum( fn define_namespace_and_types_for_sum( module: &ModuleDef, out: &mut Indenter, - name: &str, + mut name: &str, variants: &[(Identifier, AlgebraicTypeUse)], ) { - writeln!(out, "// A namespace for generated variants and helper functions."); - writeln!(out, "export namespace {name} {{"); - out.indent(1); + + // For the purpose of bootstrapping AlgebraicType, if the name of the type + // is `AlgebraicType`, we need to use an alias. + if name == "AlgebraicType" { + name = "__AlgebraicType"; + } // Write all of the variant types. writeln!( out, "// These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of -// the tagged union." +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant`" ); + writeln!(out, "export namespace {name}Variants {{"); + out.indent(1); write_variant_types(module, out, variants); + out.dedent(1); + writeln!(out, "}}"); writeln!(out); + writeln!(out, "// A namespace for generated variants and helper functions."); + writeln!(out, "export namespace {name} {{"); + out.indent(1); + // Write all of the variant constructors. writeln!( out, @@ -895,16 +912,16 @@ fn define_namespace_and_types_for_sum( writeln!( out, - "export function serialize(writer: BinaryWriter, value: {name}): void {{ - {name}.getTypeScriptAlgebraicType().serialize(writer, value); + "export function serialize(writer: BinaryWriter, value: {name}): void {{ + AlgebraicType.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value); }}" ); writeln!(out); writeln!( out, - "export function deserialize(reader: BinaryReader): {name} {{ - return {name}.getTypeScriptAlgebraicType().deserialize(reader); + "export function deserialize(reader: BinaryReader): {name} {{ + return AlgebraicType.deserializeValue(reader, {name}.getTypeScriptAlgebraicType()); }}" ); writeln!(out); @@ -915,15 +932,27 @@ fn define_namespace_and_types_for_sum( out.newline(); writeln!(out, "// The tagged union or sum type for the algebraic type `{name}`."); + + // For the purpose of bootstrapping AlgebraicType, if the name of the type + // is `AlgebraicType`, we need to use an alias. + if name == "AlgebraicType" { + name = "__AlgebraicType"; + } + write!(out, "export type {name} = "); let names = variants .iter() - .map(|(ident, _)| format!("{name}.{}", ident.deref().to_case(Case::Pascal))) + .map(|(ident, _)| format!("{name}Variants.{}", ident.deref().to_case(Case::Pascal))) .collect::>() - .join(" | "); + .join(" |\n "); + + if variants.is_empty() { + writeln!(out, "never;"); + } else { + writeln!(out, "{names};"); + } - writeln!(out, "{names};"); out.newline(); writeln!(out, "export default {name};"); @@ -1073,7 +1102,7 @@ fn convert_algebraic_type<'a>( write!(out, ")"); } AlgebraicTypeUse::Array(ty) => { - write!(out, "AlgebraicType.createArrayType("); + write!(out, "AlgebraicType.Array("); convert_algebraic_type(module, out, ty, ref_prefix); write!(out, ")"); } @@ -1083,11 +1112,11 @@ fn convert_algebraic_type<'a>( type_ref_name(module, *r) ), AlgebraicTypeUse::Primitive(prim) => { - write!(out, "AlgebraicType.create{prim:?}Type()"); + write!(out, "AlgebraicType.{prim:?}"); } - AlgebraicTypeUse::Unit => write!(out, "AlgebraicType.createProductType([])"), + AlgebraicTypeUse::Unit => write!(out, "AlgebraicType.Product({{ elements: [] }})"), AlgebraicTypeUse::Never => unimplemented!(), - AlgebraicTypeUse::String => write!(out, "AlgebraicType.createStringType()"), + AlgebraicTypeUse::String => write!(out, "AlgebraicType.String"), } } @@ -1097,15 +1126,19 @@ fn convert_sum_type<'a>( variants: &'a [(Identifier, AlgebraicTypeUse)], ref_prefix: &'a str, ) { - writeln!(out, "AlgebraicType.createSumType(["); + writeln!(out, "AlgebraicType.Sum({{"); + out.indent(1); + writeln!(out, "variants: ["); out.indent(1); for (ident, ty) in variants { - write!(out, "new SumTypeVariant(\"{ident}\", ",); + write!(out, "{{ name: \"{ident}\", algebraicType: ",); convert_algebraic_type(module, out, ty, ref_prefix); - writeln!(out, "),"); + writeln!(out, " }},"); } out.dedent(1); - write!(out, "])") + writeln!(out, "]"); + out.dedent(1); + write!(out, "}})") } fn convert_product_type<'a>( @@ -1114,19 +1147,23 @@ fn convert_product_type<'a>( elements: &'a [(Identifier, AlgebraicTypeUse)], ref_prefix: &'a str, ) { - writeln!(out, "AlgebraicType.createProductType(["); + writeln!(out, "AlgebraicType.Product({{"); + out.indent(1); + writeln!(out, "elements: ["); out.indent(1); for (ident, ty) in elements { write!( out, - "new ProductTypeElement(\"{}\", ", + "{{ name: \"{}\", algebraicType: ", ident.deref().to_case(Case::Camel) ); convert_algebraic_type(module, out, ty, ref_prefix); - writeln!(out, "),"); + writeln!(out, "}},"); } out.dedent(1); - write!(out, "])") + writeln!(out, "]"); + out.dedent(1); + write!(out, "}})") } /// Print imports for each of the `imports`. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a2d3255c7ac..f4abfc0a295 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,8 +79,8 @@ importers: specifier: ^18.3.5 version: 18.3.7(@types/react@18.3.23) '@vitejs/plugin-react': - specifier: ^4.3.4 - version: 4.7.0(vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4)) + specifier: ^4.2.1 + version: 4.2.1(vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4)) eslint: specifier: ^9.17.0 version: 9.33.0 @@ -103,8 +103,11 @@ importers: specifier: ^8.18.2 version: 8.40.0(eslint@9.33.0)(typescript@5.6.3) vite: - specifier: ^6.0.5 + specifier: ^6.3.5 version: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + vitest: + specifier: 2.1.9 + version: 2.1.9(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1) sdks/typescript/packages/sdk: dependencies: @@ -1012,6 +1015,12 @@ packages: resolution: {integrity: sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@vitejs/plugin-react@4.2.1': + resolution: {integrity: sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + vite: ^4.2.0 || ^5.0.0 + '@vitejs/plugin-react@4.7.0': resolution: {integrity: sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -1936,6 +1945,10 @@ packages: react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + react-refresh@0.14.2: + resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} + engines: {node: '>=0.10.0'} + react-refresh@0.17.0: resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==} engines: {node: '>=0.10.0'} @@ -2038,6 +2051,7 @@ packages: source-map@0.8.0-beta.0: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} + deprecated: The work that was done in this beta branch won't be included in future versions spawndamnit@3.0.1: resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==} @@ -3270,19 +3284,18 @@ snapshots: '@typescript-eslint/types': 8.40.0 eslint-visitor-keys: 4.2.1 - '@vitejs/plugin-react@4.7.0(vite@5.4.19(@types/node@24.3.0)(terser@5.43.1))': + '@vitejs/plugin-react@4.2.1(vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4))': dependencies: '@babel/core': 7.28.3 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.3) '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.3) - '@rolldown/pluginutils': 1.0.0-beta.27 '@types/babel__core': 7.20.5 - react-refresh: 0.17.0 - vite: 5.4.19(@types/node@24.3.0)(terser@5.43.1) + react-refresh: 0.14.2 + vite: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@4.7.0(vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4))': + '@vitejs/plugin-react@4.7.0(vite@5.4.19(@types/node@24.3.0)(terser@5.43.1))': dependencies: '@babel/core': 7.28.3 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.3) @@ -3290,7 +3303,7 @@ snapshots: '@rolldown/pluginutils': 1.0.0-beta.27 '@types/babel__core': 7.20.5 react-refresh: 0.17.0 - vite: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + vite: 5.4.19(@types/node@24.3.0)(terser@5.43.1) transitivePeerDependencies: - supports-color @@ -4193,6 +4206,8 @@ snapshots: react-is@18.3.1: {} + react-refresh@0.14.2: {} + react-refresh@0.17.0: {} react@18.3.1: diff --git a/sdks/typescript/examples/quickstart-chat/package.json b/sdks/typescript/examples/quickstart-chat/package.json index bf138510c87..bba0e01905d 100644 --- a/sdks/typescript/examples/quickstart-chat/package.json +++ b/sdks/typescript/examples/quickstart-chat/package.json @@ -26,7 +26,7 @@ "@types/jest": "^29.5.14", "@types/react": "^18.3.18", "@types/react-dom": "^18.3.5", - "@vitejs/plugin-react": "^4.3.4", + "@vitejs/plugin-react": "^4.2.1", "eslint": "^9.17.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.16", @@ -34,6 +34,7 @@ "jsdom": "^26.0.0", "typescript": "~5.6.2", "typescript-eslint": "^8.18.2", - "vite": "^6.0.5" + "vite": "^6.3.5", + "vitest": "2.1.9" } } diff --git a/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts b/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts index 800837cc879..65f1a029445 100644 --- a/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,60 +11,60 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { RowSizeHint as __RowSizeHint } from './row_size_hint_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { RowSizeHint as __RowSizeHint } from "./row_size_hint_type"; export type BsatnRowList = { - sizeHint: __RowSizeHint; - rowsData: Uint8Array; + sizeHint: __RowSizeHint, + rowsData: Uint8Array, }; +export default BsatnRowList; /** * A namespace for generated helper functions. */ export namespace BsatnRowList { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'sizeHint', - __RowSizeHint.getTypeScriptAlgebraicType() - ), - new ProductTypeElement( - 'rowsData', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "sizeHint", algebraicType: __RowSizeHint.getTypeScriptAlgebraicType()}, + { name: "rowsData", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, + ] + }); } export function serialize(writer: BinaryWriter, value: BsatnRowList): void { - BsatnRowList.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, BsatnRowList.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): BsatnRowList { - return BsatnRowList.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, BsatnRowList.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts b/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts index d3bc69d59e3..9206fe6c96c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,59 +11,62 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; export type CallReducer = { - reducer: string; - args: Uint8Array; - requestId: number; - flags: number; + reducer: string, + args: Uint8Array, + requestId: number, + flags: number, }; +export default CallReducer; /** * A namespace for generated helper functions. */ export namespace CallReducer { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('reducer', AlgebraicType.createStringType()), - new ProductTypeElement( - 'args', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('flags', AlgebraicType.createU8Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "reducer", algebraicType: AlgebraicType.String}, + { name: "args", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "flags", algebraicType: AlgebraicType.U8}, + ] + }); } export function serialize(writer: BinaryWriter, value: CallReducer): void { - CallReducer.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, CallReducer.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): CallReducer { - return CallReducer.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, CallReducer.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts index 024fb466d5a..183626dd8f6 100644 --- a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,138 +11,100 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { CallReducer as __CallReducer } from './call_reducer_type'; -import { Subscribe as __Subscribe } from './subscribe_type'; -import { OneOffQuery as __OneOffQuery } from './one_off_query_type'; -import { SubscribeSingle as __SubscribeSingle } from './subscribe_single_type'; -import { SubscribeMulti as __SubscribeMulti } from './subscribe_multi_type'; -import { Unsubscribe as __Unsubscribe } from './unsubscribe_type'; -import { UnsubscribeMulti as __UnsubscribeMulti } from './unsubscribe_multi_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { CallReducer as __CallReducer } from "./call_reducer_type"; +import { Subscribe as __Subscribe } from "./subscribe_type"; +import { OneOffQuery as __OneOffQuery } from "./one_off_query_type"; +import { SubscribeSingle as __SubscribeSingle } from "./subscribe_single_type"; +import { SubscribeMulti as __SubscribeMulti } from "./subscribe_multi_type"; +import { Unsubscribe as __Unsubscribe } from "./unsubscribe_type"; +import { UnsubscribeMulti as __UnsubscribeMulti } from "./unsubscribe_multi_type"; + +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace ClientMessageVariants { + export type CallReducer = { tag: "CallReducer", value: __CallReducer }; + export type Subscribe = { tag: "Subscribe", value: __Subscribe }; + export type OneOffQuery = { tag: "OneOffQuery", value: __OneOffQuery }; + export type SubscribeSingle = { tag: "SubscribeSingle", value: __SubscribeSingle }; + export type SubscribeMulti = { tag: "SubscribeMulti", value: __SubscribeMulti }; + export type Unsubscribe = { tag: "Unsubscribe", value: __Unsubscribe }; + export type UnsubscribeMulti = { tag: "UnsubscribeMulti", value: __UnsubscribeMulti }; +} // A namespace for generated variants and helper functions. export namespace ClientMessage { - // These are the generated variant types for each variant of the tagged union. - // One type is generated per variant and will be used in the `value` field of - // the tagged union. - export type CallReducer = { tag: 'CallReducer'; value: __CallReducer }; - export type Subscribe = { tag: 'Subscribe'; value: __Subscribe }; - export type OneOffQuery = { tag: 'OneOffQuery'; value: __OneOffQuery }; - export type SubscribeSingle = { - tag: 'SubscribeSingle'; - value: __SubscribeSingle; - }; - export type SubscribeMulti = { - tag: 'SubscribeMulti'; - value: __SubscribeMulti; - }; - export type Unsubscribe = { tag: 'Unsubscribe'; value: __Unsubscribe }; - export type UnsubscribeMulti = { - tag: 'UnsubscribeMulti'; - value: __UnsubscribeMulti; - }; - // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const CallReducer = (value: __CallReducer): ClientMessage => ({ - tag: 'CallReducer', - value, - }); - export const Subscribe = (value: __Subscribe): ClientMessage => ({ - tag: 'Subscribe', - value, - }); - export const OneOffQuery = (value: __OneOffQuery): ClientMessage => ({ - tag: 'OneOffQuery', - value, - }); - export const SubscribeSingle = (value: __SubscribeSingle): ClientMessage => ({ - tag: 'SubscribeSingle', - value, - }); - export const SubscribeMulti = (value: __SubscribeMulti): ClientMessage => ({ - tag: 'SubscribeMulti', - value, - }); - export const Unsubscribe = (value: __Unsubscribe): ClientMessage => ({ - tag: 'Unsubscribe', - value, - }); - export const UnsubscribeMulti = ( - value: __UnsubscribeMulti - ): ClientMessage => ({ tag: 'UnsubscribeMulti', value }); + export const CallReducer = (value: __CallReducer): ClientMessage => ({ tag: "CallReducer", value }); + export const Subscribe = (value: __Subscribe): ClientMessage => ({ tag: "Subscribe", value }); + export const OneOffQuery = (value: __OneOffQuery): ClientMessage => ({ tag: "OneOffQuery", value }); + export const SubscribeSingle = (value: __SubscribeSingle): ClientMessage => ({ tag: "SubscribeSingle", value }); + export const SubscribeMulti = (value: __SubscribeMulti): ClientMessage => ({ tag: "SubscribeMulti", value }); + export const Unsubscribe = (value: __Unsubscribe): ClientMessage => ({ tag: "Unsubscribe", value }); + export const UnsubscribeMulti = (value: __UnsubscribeMulti): ClientMessage => ({ tag: "UnsubscribeMulti", value }); export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant( - 'CallReducer', - __CallReducer.getTypeScriptAlgebraicType() - ), - new SumTypeVariant('Subscribe', __Subscribe.getTypeScriptAlgebraicType()), - new SumTypeVariant( - 'OneOffQuery', - __OneOffQuery.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'SubscribeSingle', - __SubscribeSingle.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'SubscribeMulti', - __SubscribeMulti.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'Unsubscribe', - __Unsubscribe.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'UnsubscribeMulti', - __UnsubscribeMulti.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Sum({ + variants: [ + { name: "CallReducer", algebraicType: __CallReducer.getTypeScriptAlgebraicType() }, + { name: "Subscribe", algebraicType: __Subscribe.getTypeScriptAlgebraicType() }, + { name: "OneOffQuery", algebraicType: __OneOffQuery.getTypeScriptAlgebraicType() }, + { name: "SubscribeSingle", algebraicType: __SubscribeSingle.getTypeScriptAlgebraicType() }, + { name: "SubscribeMulti", algebraicType: __SubscribeMulti.getTypeScriptAlgebraicType() }, + { name: "Unsubscribe", algebraicType: __Unsubscribe.getTypeScriptAlgebraicType() }, + { name: "UnsubscribeMulti", algebraicType: __UnsubscribeMulti.getTypeScriptAlgebraicType() }, + ] + }); } export function serialize(writer: BinaryWriter, value: ClientMessage): void { - ClientMessage.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, ClientMessage.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): ClientMessage { - return ClientMessage.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, ClientMessage.getTypeScriptAlgebraicType()); } + } // The tagged union or sum type for the algebraic type `ClientMessage`. -export type ClientMessage = - | ClientMessage.CallReducer - | ClientMessage.Subscribe - | ClientMessage.OneOffQuery - | ClientMessage.SubscribeSingle - | ClientMessage.SubscribeMulti - | ClientMessage.Unsubscribe - | ClientMessage.UnsubscribeMulti; +export type ClientMessage = ClientMessage.CallReducer | + ClientMessage.Subscribe | + ClientMessage.OneOffQuery | + ClientMessage.SubscribeSingle | + ClientMessage.SubscribeMulti | + ClientMessage.Unsubscribe | + ClientMessage.UnsubscribeMulti; export default ClientMessage; + diff --git a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts index a1727419171..099746c666c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,94 +11,78 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryUpdate as __QueryUpdate } from './query_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryUpdate as __QueryUpdate } from "./query_update_type"; + +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace CompressableQueryUpdateVariants { + export type Uncompressed = { tag: "Uncompressed", value: __QueryUpdate }; + export type Brotli = { tag: "Brotli", value: Uint8Array }; + export type Gzip = { tag: "Gzip", value: Uint8Array }; +} // A namespace for generated variants and helper functions. export namespace CompressableQueryUpdate { - // These are the generated variant types for each variant of the tagged union. - // One type is generated per variant and will be used in the `value` field of - // the tagged union. - export type Uncompressed = { tag: 'Uncompressed'; value: __QueryUpdate }; - export type Brotli = { tag: 'Brotli'; value: Uint8Array }; - export type Gzip = { tag: 'Gzip'; value: Uint8Array }; - // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Uncompressed = ( - value: __QueryUpdate - ): CompressableQueryUpdate => ({ tag: 'Uncompressed', value }); - export const Brotli = (value: Uint8Array): CompressableQueryUpdate => ({ - tag: 'Brotli', - value, - }); - export const Gzip = (value: Uint8Array): CompressableQueryUpdate => ({ - tag: 'Gzip', - value, - }); + export const Uncompressed = (value: __QueryUpdate): CompressableQueryUpdate => ({ tag: "Uncompressed", value }); + export const Brotli = (value: Uint8Array): CompressableQueryUpdate => ({ tag: "Brotli", value }); + export const Gzip = (value: Uint8Array): CompressableQueryUpdate => ({ tag: "Gzip", value }); export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant( - 'Uncompressed', - __QueryUpdate.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'Brotli', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new SumTypeVariant( - 'Gzip', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - ]); + return AlgebraicType.Sum({ + variants: [ + { name: "Uncompressed", algebraicType: __QueryUpdate.getTypeScriptAlgebraicType() }, + { name: "Brotli", algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, + { name: "Gzip", algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: CompressableQueryUpdate - ): void { - CompressableQueryUpdate.getTypeScriptAlgebraicType().serialize( - writer, - value - ); + export function serialize(writer: BinaryWriter, value: CompressableQueryUpdate): void { + AlgebraicType.serializeValue(writer, CompressableQueryUpdate.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): CompressableQueryUpdate { - return CompressableQueryUpdate.getTypeScriptAlgebraicType().deserialize( - reader - ); + return AlgebraicType.deserializeValue(reader, CompressableQueryUpdate.getTypeScriptAlgebraicType()); } + } // The tagged union or sum type for the algebraic type `CompressableQueryUpdate`. -export type CompressableQueryUpdate = - | CompressableQueryUpdate.Uncompressed - | CompressableQueryUpdate.Brotli - | CompressableQueryUpdate.Gzip; +export type CompressableQueryUpdate = CompressableQueryUpdate.Uncompressed | + CompressableQueryUpdate.Brotli | + CompressableQueryUpdate.Gzip; export default CompressableQueryUpdate; + diff --git a/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts index 3a133f50b69..53748e21df3 100644 --- a/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,57 +11,58 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { TableUpdate as __TableUpdate } from './table_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { TableUpdate as __TableUpdate } from "./table_update_type"; export type DatabaseUpdate = { - tables: __TableUpdate[]; + tables: __TableUpdate[], }; +export default DatabaseUpdate; /** * A namespace for generated helper functions. */ export namespace DatabaseUpdate { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'tables', - AlgebraicType.createArrayType( - __TableUpdate.getTypeScriptAlgebraicType() - ) - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "tables", algebraicType: AlgebraicType.Array(__TableUpdate.getTypeScriptAlgebraicType())}, + ] + }); } export function serialize(writer: BinaryWriter, value: DatabaseUpdate): void { - DatabaseUpdate.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, DatabaseUpdate.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): DatabaseUpdate { - return DatabaseUpdate.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, DatabaseUpdate.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts b/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts index 686ca504d84..db5117ee483 100644 --- a/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,50 +11,56 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; export type EnergyQuanta = { - quanta: bigint; + quanta: bigint, }; +export default EnergyQuanta; /** * A namespace for generated helper functions. */ export namespace EnergyQuanta { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('quanta', AlgebraicType.createU128Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "quanta", algebraicType: AlgebraicType.U128}, + ] + }); } export function serialize(writer: BinaryWriter, value: EnergyQuanta): void { - EnergyQuanta.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, EnergyQuanta.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): EnergyQuanta { - return EnergyQuanta.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, EnergyQuanta.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts b/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts index 11dd455da03..8e4b8a94003 100644 --- a/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,57 +11,60 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; export type IdentityToken = { - identity: Identity; - token: string; - connectionId: ConnectionId; + identity: Identity, + token: string, + connectionId: ConnectionId, }; +export default IdentityToken; /** * A namespace for generated helper functions. */ export namespace IdentityToken { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('identity', AlgebraicType.createIdentityType()), - new ProductTypeElement('token', AlgebraicType.createStringType()), - new ProductTypeElement( - 'connectionId', - AlgebraicType.createConnectionIdType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "identity", algebraicType: AlgebraicType.createIdentityType()}, + { name: "token", algebraicType: AlgebraicType.String}, + { name: "connectionId", algebraicType: AlgebraicType.createConnectionIdType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: IdentityToken): void { - IdentityToken.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, IdentityToken.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): IdentityToken { - return IdentityToken.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, IdentityToken.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/index.ts b/sdks/typescript/packages/sdk/src/client_api/index.ts index 4274ff8c8e1..c53d9e8170c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/index.ts +++ b/sdks/typescript/packages/sdk/src/client_api/index.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,99 +11,104 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; // Import and reexport all reducer arg types // Import and reexport all table handle types // Import and reexport all types -import { BsatnRowList } from './bsatn_row_list_type.ts'; +import { BsatnRowList } from "./bsatn_row_list_type.ts"; export { BsatnRowList }; -import { CallReducer } from './call_reducer_type.ts'; +import { CallReducer } from "./call_reducer_type.ts"; export { CallReducer }; -import { ClientMessage } from './client_message_type.ts'; +import { ClientMessage } from "./client_message_type.ts"; export { ClientMessage }; -import { CompressableQueryUpdate } from './compressable_query_update_type.ts'; +import { CompressableQueryUpdate } from "./compressable_query_update_type.ts"; export { CompressableQueryUpdate }; -import { DatabaseUpdate } from './database_update_type.ts'; +import { DatabaseUpdate } from "./database_update_type.ts"; export { DatabaseUpdate }; -import { EnergyQuanta } from './energy_quanta_type.ts'; +import { EnergyQuanta } from "./energy_quanta_type.ts"; export { EnergyQuanta }; -import { IdentityToken } from './identity_token_type.ts'; +import { IdentityToken } from "./identity_token_type.ts"; export { IdentityToken }; -import { InitialSubscription } from './initial_subscription_type.ts'; +import { InitialSubscription } from "./initial_subscription_type.ts"; export { InitialSubscription }; -import { OneOffQuery } from './one_off_query_type.ts'; +import { OneOffQuery } from "./one_off_query_type.ts"; export { OneOffQuery }; -import { OneOffQueryResponse } from './one_off_query_response_type.ts'; +import { OneOffQueryResponse } from "./one_off_query_response_type.ts"; export { OneOffQueryResponse }; -import { OneOffTable } from './one_off_table_type.ts'; +import { OneOffTable } from "./one_off_table_type.ts"; export { OneOffTable }; -import { QueryId } from './query_id_type.ts'; +import { QueryId } from "./query_id_type.ts"; export { QueryId }; -import { QueryUpdate } from './query_update_type.ts'; +import { QueryUpdate } from "./query_update_type.ts"; export { QueryUpdate }; -import { ReducerCallInfo } from './reducer_call_info_type.ts'; +import { ReducerCallInfo } from "./reducer_call_info_type.ts"; export { ReducerCallInfo }; -import { RowSizeHint } from './row_size_hint_type.ts'; +import { RowSizeHint } from "./row_size_hint_type.ts"; export { RowSizeHint }; -import { ServerMessage } from './server_message_type.ts'; +import { ServerMessage } from "./server_message_type.ts"; export { ServerMessage }; -import { Subscribe } from './subscribe_type.ts'; +import { Subscribe } from "./subscribe_type.ts"; export { Subscribe }; -import { SubscribeApplied } from './subscribe_applied_type.ts'; +import { SubscribeApplied } from "./subscribe_applied_type.ts"; export { SubscribeApplied }; -import { SubscribeMulti } from './subscribe_multi_type.ts'; +import { SubscribeMulti } from "./subscribe_multi_type.ts"; export { SubscribeMulti }; -import { SubscribeMultiApplied } from './subscribe_multi_applied_type.ts'; +import { SubscribeMultiApplied } from "./subscribe_multi_applied_type.ts"; export { SubscribeMultiApplied }; -import { SubscribeRows } from './subscribe_rows_type.ts'; +import { SubscribeRows } from "./subscribe_rows_type.ts"; export { SubscribeRows }; -import { SubscribeSingle } from './subscribe_single_type.ts'; +import { SubscribeSingle } from "./subscribe_single_type.ts"; export { SubscribeSingle }; -import { SubscriptionError } from './subscription_error_type.ts'; +import { SubscriptionError } from "./subscription_error_type.ts"; export { SubscriptionError }; -import { TableUpdate } from './table_update_type.ts'; +import { TableUpdate } from "./table_update_type.ts"; export { TableUpdate }; -import { TransactionUpdate } from './transaction_update_type.ts'; +import { TransactionUpdate } from "./transaction_update_type.ts"; export { TransactionUpdate }; -import { TransactionUpdateLight } from './transaction_update_light_type.ts'; +import { TransactionUpdateLight } from "./transaction_update_light_type.ts"; export { TransactionUpdateLight }; -import { Unsubscribe } from './unsubscribe_type.ts'; +import { Unsubscribe } from "./unsubscribe_type.ts"; export { Unsubscribe }; -import { UnsubscribeApplied } from './unsubscribe_applied_type.ts'; +import { UnsubscribeApplied } from "./unsubscribe_applied_type.ts"; export { UnsubscribeApplied }; -import { UnsubscribeMulti } from './unsubscribe_multi_type.ts'; +import { UnsubscribeMulti } from "./unsubscribe_multi_type.ts"; export { UnsubscribeMulti }; -import { UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type.ts'; +import { UnsubscribeMultiApplied } from "./unsubscribe_multi_applied_type.ts"; export { UnsubscribeMultiApplied }; -import { UpdateStatus } from './update_status_type.ts'; +import { UpdateStatus } from "./update_status_type.ts"; export { UpdateStatus }; const REMOTE_MODULE = { - tables: {}, - reducers: {}, + tables: { + }, + reducers: { + }, + versionInfo: { + cliVersion: "1.3.0", + }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. // @@ -112,85 +119,48 @@ const REMOTE_MODULE = { eventContextConstructor: (imp: DbConnectionImpl, event: Event) => { return { ...(imp as DbConnection), - event, - }; + event + } }, dbViewConstructor: (imp: DbConnectionImpl) => { return new RemoteTables(imp); }, - reducersConstructor: ( - imp: DbConnectionImpl, - setReducerFlags: SetReducerFlags - ) => { + reducersConstructor: (imp: DbConnectionImpl, setReducerFlags: SetReducerFlags) => { return new RemoteReducers(imp, setReducerFlags); }, setReducerFlagsConstructor: () => { return new SetReducerFlags(); - }, -}; + } +} // A type representing all the possible variants of a reducer. -export type Reducer = never; +export type Reducer = never +; export class RemoteReducers { - constructor( - private connection: DbConnectionImpl, - private setCallReducerFlags: SetReducerFlags - ) {} + constructor(private connection: DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} + } -export class SetReducerFlags {} +export class SetReducerFlags { +} export class RemoteTables { constructor(private connection: DbConnectionImpl) {} } -export class SubscriptionBuilder extends SubscriptionBuilderImpl< - RemoteTables, - RemoteReducers, - SetReducerFlags -> {} +export class SubscriptionBuilder extends SubscriptionBuilderImpl { } -export class DbConnection extends DbConnectionImpl< - RemoteTables, - RemoteReducers, - SetReducerFlags -> { - static builder = (): DbConnectionBuilder< - DbConnection, - ErrorContext, - SubscriptionEventContext - > => { - return new DbConnectionBuilder< - DbConnection, - ErrorContext, - SubscriptionEventContext - >(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); - }; +export class DbConnection extends DbConnectionImpl { + static builder = (): DbConnectionBuilder => { + return new DbConnectionBuilder(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); + } subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); - }; + } } -export type EventContext = EventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags, - Reducer ->; -export type ReducerEventContext = ReducerEventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags, - Reducer ->; -export type SubscriptionEventContext = SubscriptionEventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags ->; -export type ErrorContext = ErrorContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags ->; +export type EventContext = EventContextInterface; +export type ReducerEventContext = ReducerEventContextInterface; +export type SubscriptionEventContext = SubscriptionEventContextInterface; +export type ErrorContext = ErrorContextInterface; diff --git a/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts b/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts index 266ac6833e0..e194d0079c1 100644 --- a/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,65 +11,62 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; export type InitialSubscription = { - databaseUpdate: __DatabaseUpdate; - requestId: number; - totalHostExecutionDuration: TimeDuration; + databaseUpdate: __DatabaseUpdate, + requestId: number, + totalHostExecutionDuration: TimeDuration, }; +export default InitialSubscription; /** * A namespace for generated helper functions. */ export namespace InitialSubscription { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'databaseUpdate', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDuration', - AlgebraicType.createTimeDurationType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "databaseUpdate", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType()}, + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "totalHostExecutionDuration", algebraicType: AlgebraicType.createTimeDurationType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: InitialSubscription - ): void { - InitialSubscription.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: InitialSubscription): void { + AlgebraicType.serializeValue(writer, InitialSubscription.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): InitialSubscription { - return InitialSubscription.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, InitialSubscription.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts index 885f9809361..735ac996750 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,75 +11,64 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { OneOffTable as __OneOffTable } from './one_off_table_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { OneOffTable as __OneOffTable } from "./one_off_table_type"; export type OneOffQueryResponse = { - messageId: Uint8Array; - error: string | undefined; - tables: __OneOffTable[]; - totalHostExecutionDuration: TimeDuration; + messageId: Uint8Array, + error: string | undefined, + tables: __OneOffTable[], + totalHostExecutionDuration: TimeDuration, }; +export default OneOffQueryResponse; /** * A namespace for generated helper functions. */ export namespace OneOffQueryResponse { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'messageId', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new ProductTypeElement( - 'error', - AlgebraicType.createOptionType(AlgebraicType.createStringType()) - ), - new ProductTypeElement( - 'tables', - AlgebraicType.createArrayType( - __OneOffTable.getTypeScriptAlgebraicType() - ) - ), - new ProductTypeElement( - 'totalHostExecutionDuration', - AlgebraicType.createTimeDurationType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "messageId", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, + { name: "error", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, + { name: "tables", algebraicType: AlgebraicType.Array(__OneOffTable.getTypeScriptAlgebraicType())}, + { name: "totalHostExecutionDuration", algebraicType: AlgebraicType.createTimeDurationType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: OneOffQueryResponse - ): void { - OneOffQueryResponse.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: OneOffQueryResponse): void { + AlgebraicType.serializeValue(writer, OneOffQueryResponse.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): OneOffQueryResponse { - return OneOffQueryResponse.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, OneOffQueryResponse.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts index 8fb2fdc881a..0d666e4f553 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,55 +11,58 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; export type OneOffQuery = { - messageId: Uint8Array; - queryString: string; + messageId: Uint8Array, + queryString: string, }; +export default OneOffQuery; /** * A namespace for generated helper functions. */ export namespace OneOffQuery { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'messageId', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new ProductTypeElement('queryString', AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "messageId", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, + { name: "queryString", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: OneOffQuery): void { - OneOffQuery.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, OneOffQuery.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): OneOffQuery { - return OneOffQuery.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, OneOffQuery.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts index 32c8abb64ba..531f2cd536c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,57 +11,60 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { BsatnRowList as __BsatnRowList } from './bsatn_row_list_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { BsatnRowList as __BsatnRowList } from "./bsatn_row_list_type"; export type OneOffTable = { - tableName: string; - rows: __BsatnRowList; + tableName: string, + rows: __BsatnRowList, }; +export default OneOffTable; /** * A namespace for generated helper functions. */ export namespace OneOffTable { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('tableName', AlgebraicType.createStringType()), - new ProductTypeElement( - 'rows', - __BsatnRowList.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "tableName", algebraicType: AlgebraicType.String}, + { name: "rows", algebraicType: __BsatnRowList.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: OneOffTable): void { - OneOffTable.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, OneOffTable.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): OneOffTable { - return OneOffTable.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, OneOffTable.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts b/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts index 1f41bf5e3ad..1109547a1cc 100644 --- a/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,50 +11,56 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; export type QueryId = { - id: number; + id: number, }; +export default QueryId; /** * A namespace for generated helper functions. */ export namespace QueryId { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('id', AlgebraicType.createU32Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "id", algebraicType: AlgebraicType.U32}, + ] + }); } export function serialize(writer: BinaryWriter, value: QueryId): void { - QueryId.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, QueryId.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): QueryId { - return QueryId.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, QueryId.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts index 10e0147f047..542225f0423 100644 --- a/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,60 +11,60 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { BsatnRowList as __BsatnRowList } from './bsatn_row_list_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { BsatnRowList as __BsatnRowList } from "./bsatn_row_list_type"; export type QueryUpdate = { - deletes: __BsatnRowList; - inserts: __BsatnRowList; + deletes: __BsatnRowList, + inserts: __BsatnRowList, }; +export default QueryUpdate; /** * A namespace for generated helper functions. */ export namespace QueryUpdate { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'deletes', - __BsatnRowList.getTypeScriptAlgebraicType() - ), - new ProductTypeElement( - 'inserts', - __BsatnRowList.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "deletes", algebraicType: __BsatnRowList.getTypeScriptAlgebraicType()}, + { name: "inserts", algebraicType: __BsatnRowList.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: QueryUpdate): void { - QueryUpdate.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, QueryUpdate.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): QueryUpdate { - return QueryUpdate.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, QueryUpdate.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts b/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts index 337fb073e23..d6318689ccc 100644 --- a/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,62 +11,62 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; export type ReducerCallInfo = { - reducerName: string; - reducerId: number; - args: Uint8Array; - requestId: number; + reducerName: string, + reducerId: number, + args: Uint8Array, + requestId: number, }; +export default ReducerCallInfo; /** * A namespace for generated helper functions. */ export namespace ReducerCallInfo { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('reducerName', AlgebraicType.createStringType()), - new ProductTypeElement('reducerId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'args', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "reducerName", algebraicType: AlgebraicType.String}, + { name: "reducerId", algebraicType: AlgebraicType.U32}, + { name: "args", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, + { name: "requestId", algebraicType: AlgebraicType.U32}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: ReducerCallInfo - ): void { - ReducerCallInfo.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: ReducerCallInfo): void { + AlgebraicType.serializeValue(writer, ReducerCallInfo.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): ReducerCallInfo { - return ReducerCallInfo.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, ReducerCallInfo.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts index 7f6830bcc51..ac3cc0b87ec 100644 --- a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,70 +11,72 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace RowSizeHintVariants { + export type FixedSize = { tag: "FixedSize", value: number }; + export type RowOffsets = { tag: "RowOffsets", value: bigint[] }; +} + // A namespace for generated variants and helper functions. export namespace RowSizeHint { - // These are the generated variant types for each variant of the tagged union. - // One type is generated per variant and will be used in the `value` field of - // the tagged union. - export type FixedSize = { tag: 'FixedSize'; value: number }; - export type RowOffsets = { tag: 'RowOffsets'; value: bigint[] }; - // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const FixedSize = (value: number): RowSizeHint => ({ - tag: 'FixedSize', - value, - }); - export const RowOffsets = (value: bigint[]): RowSizeHint => ({ - tag: 'RowOffsets', - value, - }); + export const FixedSize = (value: number): RowSizeHint => ({ tag: "FixedSize", value }); + export const RowOffsets = (value: bigint[]): RowSizeHint => ({ tag: "RowOffsets", value }); export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant('FixedSize', AlgebraicType.createU16Type()), - new SumTypeVariant( - 'RowOffsets', - AlgebraicType.createArrayType(AlgebraicType.createU64Type()) - ), - ]); + return AlgebraicType.Sum({ + variants: [ + { name: "FixedSize", algebraicType: AlgebraicType.U16 }, + { name: "RowOffsets", algebraicType: AlgebraicType.Array(AlgebraicType.U64) }, + ] + }); } export function serialize(writer: BinaryWriter, value: RowSizeHint): void { - RowSizeHint.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, RowSizeHint.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): RowSizeHint { - return RowSizeHint.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, RowSizeHint.getTypeScriptAlgebraicType()); } + } // The tagged union or sum type for the algebraic type `RowSizeHint`. -export type RowSizeHint = RowSizeHint.FixedSize | RowSizeHint.RowOffsets; +export type RowSizeHint = RowSizeHint.FixedSize | + RowSizeHint.RowOffsets; export default RowSizeHint; + diff --git a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts index c88b76f43f1..b54068ef072 100644 --- a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,184 +11,115 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { InitialSubscription as __InitialSubscription } from './initial_subscription_type'; -import { TransactionUpdate as __TransactionUpdate } from './transaction_update_type'; -import { TransactionUpdateLight as __TransactionUpdateLight } from './transaction_update_light_type'; -import { IdentityToken as __IdentityToken } from './identity_token_type'; -import { OneOffQueryResponse as __OneOffQueryResponse } from './one_off_query_response_type'; -import { SubscribeApplied as __SubscribeApplied } from './subscribe_applied_type'; -import { UnsubscribeApplied as __UnsubscribeApplied } from './unsubscribe_applied_type'; -import { SubscriptionError as __SubscriptionError } from './subscription_error_type'; -import { SubscribeMultiApplied as __SubscribeMultiApplied } from './subscribe_multi_applied_type'; -import { UnsubscribeMultiApplied as __UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { InitialSubscription as __InitialSubscription } from "./initial_subscription_type"; +import { TransactionUpdate as __TransactionUpdate } from "./transaction_update_type"; +import { TransactionUpdateLight as __TransactionUpdateLight } from "./transaction_update_light_type"; +import { IdentityToken as __IdentityToken } from "./identity_token_type"; +import { OneOffQueryResponse as __OneOffQueryResponse } from "./one_off_query_response_type"; +import { SubscribeApplied as __SubscribeApplied } from "./subscribe_applied_type"; +import { UnsubscribeApplied as __UnsubscribeApplied } from "./unsubscribe_applied_type"; +import { SubscriptionError as __SubscriptionError } from "./subscription_error_type"; +import { SubscribeMultiApplied as __SubscribeMultiApplied } from "./subscribe_multi_applied_type"; +import { UnsubscribeMultiApplied as __UnsubscribeMultiApplied } from "./unsubscribe_multi_applied_type"; + +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace ServerMessageVariants { + export type InitialSubscription = { tag: "InitialSubscription", value: __InitialSubscription }; + export type TransactionUpdate = { tag: "TransactionUpdate", value: __TransactionUpdate }; + export type TransactionUpdateLight = { tag: "TransactionUpdateLight", value: __TransactionUpdateLight }; + export type IdentityToken = { tag: "IdentityToken", value: __IdentityToken }; + export type OneOffQueryResponse = { tag: "OneOffQueryResponse", value: __OneOffQueryResponse }; + export type SubscribeApplied = { tag: "SubscribeApplied", value: __SubscribeApplied }; + export type UnsubscribeApplied = { tag: "UnsubscribeApplied", value: __UnsubscribeApplied }; + export type SubscriptionError = { tag: "SubscriptionError", value: __SubscriptionError }; + export type SubscribeMultiApplied = { tag: "SubscribeMultiApplied", value: __SubscribeMultiApplied }; + export type UnsubscribeMultiApplied = { tag: "UnsubscribeMultiApplied", value: __UnsubscribeMultiApplied }; +} // A namespace for generated variants and helper functions. export namespace ServerMessage { - // These are the generated variant types for each variant of the tagged union. - // One type is generated per variant and will be used in the `value` field of - // the tagged union. - export type InitialSubscription = { - tag: 'InitialSubscription'; - value: __InitialSubscription; - }; - export type TransactionUpdate = { - tag: 'TransactionUpdate'; - value: __TransactionUpdate; - }; - export type TransactionUpdateLight = { - tag: 'TransactionUpdateLight'; - value: __TransactionUpdateLight; - }; - export type IdentityToken = { tag: 'IdentityToken'; value: __IdentityToken }; - export type OneOffQueryResponse = { - tag: 'OneOffQueryResponse'; - value: __OneOffQueryResponse; - }; - export type SubscribeApplied = { - tag: 'SubscribeApplied'; - value: __SubscribeApplied; - }; - export type UnsubscribeApplied = { - tag: 'UnsubscribeApplied'; - value: __UnsubscribeApplied; - }; - export type SubscriptionError = { - tag: 'SubscriptionError'; - value: __SubscriptionError; - }; - export type SubscribeMultiApplied = { - tag: 'SubscribeMultiApplied'; - value: __SubscribeMultiApplied; - }; - export type UnsubscribeMultiApplied = { - tag: 'UnsubscribeMultiApplied'; - value: __UnsubscribeMultiApplied; - }; - // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const InitialSubscription = ( - value: __InitialSubscription - ): ServerMessage => ({ tag: 'InitialSubscription', value }); - export const TransactionUpdate = ( - value: __TransactionUpdate - ): ServerMessage => ({ tag: 'TransactionUpdate', value }); - export const TransactionUpdateLight = ( - value: __TransactionUpdateLight - ): ServerMessage => ({ tag: 'TransactionUpdateLight', value }); - export const IdentityToken = (value: __IdentityToken): ServerMessage => ({ - tag: 'IdentityToken', - value, - }); - export const OneOffQueryResponse = ( - value: __OneOffQueryResponse - ): ServerMessage => ({ tag: 'OneOffQueryResponse', value }); - export const SubscribeApplied = ( - value: __SubscribeApplied - ): ServerMessage => ({ tag: 'SubscribeApplied', value }); - export const UnsubscribeApplied = ( - value: __UnsubscribeApplied - ): ServerMessage => ({ tag: 'UnsubscribeApplied', value }); - export const SubscriptionError = ( - value: __SubscriptionError - ): ServerMessage => ({ tag: 'SubscriptionError', value }); - export const SubscribeMultiApplied = ( - value: __SubscribeMultiApplied - ): ServerMessage => ({ tag: 'SubscribeMultiApplied', value }); - export const UnsubscribeMultiApplied = ( - value: __UnsubscribeMultiApplied - ): ServerMessage => ({ tag: 'UnsubscribeMultiApplied', value }); + export const InitialSubscription = (value: __InitialSubscription): ServerMessage => ({ tag: "InitialSubscription", value }); + export const TransactionUpdate = (value: __TransactionUpdate): ServerMessage => ({ tag: "TransactionUpdate", value }); + export const TransactionUpdateLight = (value: __TransactionUpdateLight): ServerMessage => ({ tag: "TransactionUpdateLight", value }); + export const IdentityToken = (value: __IdentityToken): ServerMessage => ({ tag: "IdentityToken", value }); + export const OneOffQueryResponse = (value: __OneOffQueryResponse): ServerMessage => ({ tag: "OneOffQueryResponse", value }); + export const SubscribeApplied = (value: __SubscribeApplied): ServerMessage => ({ tag: "SubscribeApplied", value }); + export const UnsubscribeApplied = (value: __UnsubscribeApplied): ServerMessage => ({ tag: "UnsubscribeApplied", value }); + export const SubscriptionError = (value: __SubscriptionError): ServerMessage => ({ tag: "SubscriptionError", value }); + export const SubscribeMultiApplied = (value: __SubscribeMultiApplied): ServerMessage => ({ tag: "SubscribeMultiApplied", value }); + export const UnsubscribeMultiApplied = (value: __UnsubscribeMultiApplied): ServerMessage => ({ tag: "UnsubscribeMultiApplied", value }); export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant( - 'InitialSubscription', - __InitialSubscription.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'TransactionUpdate', - __TransactionUpdate.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'TransactionUpdateLight', - __TransactionUpdateLight.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'IdentityToken', - __IdentityToken.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'OneOffQueryResponse', - __OneOffQueryResponse.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'SubscribeApplied', - __SubscribeApplied.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'UnsubscribeApplied', - __UnsubscribeApplied.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'SubscriptionError', - __SubscriptionError.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'SubscribeMultiApplied', - __SubscribeMultiApplied.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'UnsubscribeMultiApplied', - __UnsubscribeMultiApplied.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Sum({ + variants: [ + { name: "InitialSubscription", algebraicType: __InitialSubscription.getTypeScriptAlgebraicType() }, + { name: "TransactionUpdate", algebraicType: __TransactionUpdate.getTypeScriptAlgebraicType() }, + { name: "TransactionUpdateLight", algebraicType: __TransactionUpdateLight.getTypeScriptAlgebraicType() }, + { name: "IdentityToken", algebraicType: __IdentityToken.getTypeScriptAlgebraicType() }, + { name: "OneOffQueryResponse", algebraicType: __OneOffQueryResponse.getTypeScriptAlgebraicType() }, + { name: "SubscribeApplied", algebraicType: __SubscribeApplied.getTypeScriptAlgebraicType() }, + { name: "UnsubscribeApplied", algebraicType: __UnsubscribeApplied.getTypeScriptAlgebraicType() }, + { name: "SubscriptionError", algebraicType: __SubscriptionError.getTypeScriptAlgebraicType() }, + { name: "SubscribeMultiApplied", algebraicType: __SubscribeMultiApplied.getTypeScriptAlgebraicType() }, + { name: "UnsubscribeMultiApplied", algebraicType: __UnsubscribeMultiApplied.getTypeScriptAlgebraicType() }, + ] + }); } export function serialize(writer: BinaryWriter, value: ServerMessage): void { - ServerMessage.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, ServerMessage.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): ServerMessage { - return ServerMessage.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, ServerMessage.getTypeScriptAlgebraicType()); } + } // The tagged union or sum type for the algebraic type `ServerMessage`. -export type ServerMessage = - | ServerMessage.InitialSubscription - | ServerMessage.TransactionUpdate - | ServerMessage.TransactionUpdateLight - | ServerMessage.IdentityToken - | ServerMessage.OneOffQueryResponse - | ServerMessage.SubscribeApplied - | ServerMessage.UnsubscribeApplied - | ServerMessage.SubscriptionError - | ServerMessage.SubscribeMultiApplied - | ServerMessage.UnsubscribeMultiApplied; +export type ServerMessage = ServerMessage.InitialSubscription | + ServerMessage.TransactionUpdate | + ServerMessage.TransactionUpdateLight | + ServerMessage.IdentityToken | + ServerMessage.OneOffQueryResponse | + ServerMessage.SubscribeApplied | + ServerMessage.UnsubscribeApplied | + ServerMessage.SubscriptionError | + ServerMessage.SubscribeMultiApplied | + ServerMessage.UnsubscribeMultiApplied; export default ServerMessage; + diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts index fbd3dfb9c55..3fc60584b8d 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,68 +11,65 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryId as __QueryId } from './query_id_type'; -import { SubscribeRows as __SubscribeRows } from './subscribe_rows_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryId as __QueryId } from "./query_id_type"; +import { SubscribeRows as __SubscribeRows } from "./subscribe_rows_type"; export type SubscribeApplied = { - requestId: number; - totalHostExecutionDurationMicros: bigint; - queryId: __QueryId; - rows: __SubscribeRows; + requestId: number, + totalHostExecutionDurationMicros: bigint, + queryId: __QueryId, + rows: __SubscribeRows, }; +export default SubscribeApplied; /** * A namespace for generated helper functions. */ export namespace SubscribeApplied { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - new ProductTypeElement( - 'rows', - __SubscribeRows.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, + { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, + { name: "rows", algebraicType: __SubscribeRows.getTypeScriptAlgebraicType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: SubscribeApplied - ): void { - SubscribeApplied.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: SubscribeApplied): void { + AlgebraicType.serializeValue(writer, SubscribeApplied.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): SubscribeApplied { - return SubscribeApplied.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, SubscribeApplied.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts index 54b78817959..8575f63ba64 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,70 +11,65 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryId as __QueryId } from './query_id_type'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryId as __QueryId } from "./query_id_type"; +import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; export type SubscribeMultiApplied = { - requestId: number; - totalHostExecutionDurationMicros: bigint; - queryId: __QueryId; - update: __DatabaseUpdate; + requestId: number, + totalHostExecutionDurationMicros: bigint, + queryId: __QueryId, + update: __DatabaseUpdate, }; +export default SubscribeMultiApplied; /** * A namespace for generated helper functions. */ export namespace SubscribeMultiApplied { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - new ProductTypeElement( - 'update', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, + { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, + { name: "update", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: SubscribeMultiApplied - ): void { - SubscribeMultiApplied.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: SubscribeMultiApplied): void { + AlgebraicType.serializeValue(writer, SubscribeMultiApplied.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): SubscribeMultiApplied { - return SubscribeMultiApplied.getTypeScriptAlgebraicType().deserialize( - reader - ); + return AlgebraicType.deserializeValue(reader, SubscribeMultiApplied.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts index 349f9f1a059..84252d56f7c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,59 +11,62 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryId as __QueryId } from './query_id_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryId as __QueryId } from "./query_id_type"; export type SubscribeMulti = { - queryStrings: string[]; - requestId: number; - queryId: __QueryId; + queryStrings: string[], + requestId: number, + queryId: __QueryId, }; +export default SubscribeMulti; /** * A namespace for generated helper functions. */ export namespace SubscribeMulti { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'queryStrings', - AlgebraicType.createArrayType(AlgebraicType.createStringType()) - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "queryStrings", algebraicType: AlgebraicType.Array(AlgebraicType.String)}, + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: SubscribeMulti): void { - SubscribeMulti.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, SubscribeMulti.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): SubscribeMulti { - return SubscribeMulti.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, SubscribeMulti.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts index b1c6d6295ea..434beca175c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,59 +11,62 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { TableUpdate as __TableUpdate } from './table_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { TableUpdate as __TableUpdate } from "./table_update_type"; export type SubscribeRows = { - tableId: number; - tableName: string; - tableRows: __TableUpdate; + tableId: number, + tableName: string, + tableRows: __TableUpdate, }; +export default SubscribeRows; /** * A namespace for generated helper functions. */ export namespace SubscribeRows { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('tableId', AlgebraicType.createU32Type()), - new ProductTypeElement('tableName', AlgebraicType.createStringType()), - new ProductTypeElement( - 'tableRows', - __TableUpdate.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "tableId", algebraicType: AlgebraicType.U32}, + { name: "tableName", algebraicType: AlgebraicType.String}, + { name: "tableRows", algebraicType: __TableUpdate.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: SubscribeRows): void { - SubscribeRows.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, SubscribeRows.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): SubscribeRows { - return SubscribeRows.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, SubscribeRows.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts index 2f564678c7e..21c0ed16929 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,59 +11,62 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryId as __QueryId } from './query_id_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryId as __QueryId } from "./query_id_type"; export type SubscribeSingle = { - query: string; - requestId: number; - queryId: __QueryId; + query: string, + requestId: number, + queryId: __QueryId, }; +export default SubscribeSingle; /** * A namespace for generated helper functions. */ export namespace SubscribeSingle { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('query', AlgebraicType.createStringType()), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "query", algebraicType: AlgebraicType.String}, + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: SubscribeSingle - ): void { - SubscribeSingle.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: SubscribeSingle): void { + AlgebraicType.serializeValue(writer, SubscribeSingle.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): SubscribeSingle { - return SubscribeSingle.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, SubscribeSingle.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts index cb6e4edb6ad..2fd7824672e 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,55 +11,58 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; export type Subscribe = { - queryStrings: string[]; - requestId: number; + queryStrings: string[], + requestId: number, }; +export default Subscribe; /** * A namespace for generated helper functions. */ export namespace Subscribe { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'queryStrings', - AlgebraicType.createArrayType(AlgebraicType.createStringType()) - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "queryStrings", algebraicType: AlgebraicType.Array(AlgebraicType.String)}, + { name: "requestId", algebraicType: AlgebraicType.U32}, + ] + }); } export function serialize(writer: BinaryWriter, value: Subscribe): void { - Subscribe.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Subscribe.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Subscribe { - return Subscribe.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Subscribe.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts index d8e0a792ee2..0fd1c46e619 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,73 +11,64 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; export type SubscriptionError = { - totalHostExecutionDurationMicros: bigint; - requestId: number | undefined; - queryId: number | undefined; - tableId: number | undefined; - error: string; + totalHostExecutionDurationMicros: bigint, + requestId: number | undefined, + queryId: number | undefined, + tableId: number | undefined, + error: string, }; +export default SubscriptionError; /** * A namespace for generated helper functions. */ export namespace SubscriptionError { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement( - 'requestId', - AlgebraicType.createOptionType(AlgebraicType.createU32Type()) - ), - new ProductTypeElement( - 'queryId', - AlgebraicType.createOptionType(AlgebraicType.createU32Type()) - ), - new ProductTypeElement( - 'tableId', - AlgebraicType.createOptionType(AlgebraicType.createU32Type()) - ), - new ProductTypeElement('error', AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, + { name: "requestId", algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32)}, + { name: "queryId", algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32)}, + { name: "tableId", algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32)}, + { name: "error", algebraicType: AlgebraicType.String}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: SubscriptionError - ): void { - SubscriptionError.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: SubscriptionError): void { + AlgebraicType.serializeValue(writer, SubscriptionError.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): SubscriptionError { - return SubscriptionError.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, SubscriptionError.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts index cc4999cb9fc..2f17b2e2be2 100644 --- a/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,63 +11,64 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { CompressableQueryUpdate as __CompressableQueryUpdate } from './compressable_query_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { CompressableQueryUpdate as __CompressableQueryUpdate } from "./compressable_query_update_type"; export type TableUpdate = { - tableId: number; - tableName: string; - numRows: bigint; - updates: __CompressableQueryUpdate[]; + tableId: number, + tableName: string, + numRows: bigint, + updates: __CompressableQueryUpdate[], }; +export default TableUpdate; /** * A namespace for generated helper functions. */ export namespace TableUpdate { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('tableId', AlgebraicType.createU32Type()), - new ProductTypeElement('tableName', AlgebraicType.createStringType()), - new ProductTypeElement('numRows', AlgebraicType.createU64Type()), - new ProductTypeElement( - 'updates', - AlgebraicType.createArrayType( - __CompressableQueryUpdate.getTypeScriptAlgebraicType() - ) - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "tableId", algebraicType: AlgebraicType.U32}, + { name: "tableName", algebraicType: AlgebraicType.String}, + { name: "numRows", algebraicType: AlgebraicType.U64}, + { name: "updates", algebraicType: AlgebraicType.Array(__CompressableQueryUpdate.getTypeScriptAlgebraicType())}, + ] + }); } export function serialize(writer: BinaryWriter, value: TableUpdate): void { - TableUpdate.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, TableUpdate.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TableUpdate { - return TableUpdate.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, TableUpdate.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts b/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts index 567fe4b332a..e3e352663ed 100644 --- a/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,65 +11,60 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; export type TransactionUpdateLight = { - requestId: number; - update: __DatabaseUpdate; + requestId: number, + update: __DatabaseUpdate, }; +export default TransactionUpdateLight; /** * A namespace for generated helper functions. */ export namespace TransactionUpdateLight { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'update', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "update", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: TransactionUpdateLight - ): void { - TransactionUpdateLight.getTypeScriptAlgebraicType().serialize( - writer, - value - ); + export function serialize(writer: BinaryWriter, value: TransactionUpdateLight): void { + AlgebraicType.serializeValue(writer, TransactionUpdateLight.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TransactionUpdateLight { - return TransactionUpdateLight.getTypeScriptAlgebraicType().deserialize( - reader - ); + return AlgebraicType.deserializeValue(reader, TransactionUpdateLight.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts index 6391ba98d6d..6faa15d1e2f 100644 --- a/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,87 +11,72 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { UpdateStatus as __UpdateStatus } from './update_status_type'; -import { ReducerCallInfo as __ReducerCallInfo } from './reducer_call_info_type'; -import { EnergyQuanta as __EnergyQuanta } from './energy_quanta_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { UpdateStatus as __UpdateStatus } from "./update_status_type"; +import { ReducerCallInfo as __ReducerCallInfo } from "./reducer_call_info_type"; +import { EnergyQuanta as __EnergyQuanta } from "./energy_quanta_type"; export type TransactionUpdate = { - status: __UpdateStatus; - timestamp: Timestamp; - callerIdentity: Identity; - callerConnectionId: ConnectionId; - reducerCall: __ReducerCallInfo; - energyQuantaUsed: __EnergyQuanta; - totalHostExecutionDuration: TimeDuration; + status: __UpdateStatus, + timestamp: Timestamp, + callerIdentity: Identity, + callerConnectionId: ConnectionId, + reducerCall: __ReducerCallInfo, + energyQuantaUsed: __EnergyQuanta, + totalHostExecutionDuration: TimeDuration, }; +export default TransactionUpdate; /** * A namespace for generated helper functions. */ export namespace TransactionUpdate { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement( - 'status', - __UpdateStatus.getTypeScriptAlgebraicType() - ), - new ProductTypeElement('timestamp', AlgebraicType.createTimestampType()), - new ProductTypeElement( - 'callerIdentity', - AlgebraicType.createIdentityType() - ), - new ProductTypeElement( - 'callerConnectionId', - AlgebraicType.createConnectionIdType() - ), - new ProductTypeElement( - 'reducerCall', - __ReducerCallInfo.getTypeScriptAlgebraicType() - ), - new ProductTypeElement( - 'energyQuantaUsed', - __EnergyQuanta.getTypeScriptAlgebraicType() - ), - new ProductTypeElement( - 'totalHostExecutionDuration', - AlgebraicType.createTimeDurationType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "status", algebraicType: __UpdateStatus.getTypeScriptAlgebraicType()}, + { name: "timestamp", algebraicType: AlgebraicType.createTimestampType()}, + { name: "callerIdentity", algebraicType: AlgebraicType.createIdentityType()}, + { name: "callerConnectionId", algebraicType: AlgebraicType.createConnectionIdType()}, + { name: "reducerCall", algebraicType: __ReducerCallInfo.getTypeScriptAlgebraicType()}, + { name: "energyQuantaUsed", algebraicType: __EnergyQuanta.getTypeScriptAlgebraicType()}, + { name: "totalHostExecutionDuration", algebraicType: AlgebraicType.createTimeDurationType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: TransactionUpdate - ): void { - TransactionUpdate.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: TransactionUpdate): void { + AlgebraicType.serializeValue(writer, TransactionUpdate.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TransactionUpdate { - return TransactionUpdate.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, TransactionUpdate.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts index ab63a797d5a..8e84fffa198 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,68 +11,65 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryId as __QueryId } from './query_id_type'; -import { SubscribeRows as __SubscribeRows } from './subscribe_rows_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryId as __QueryId } from "./query_id_type"; +import { SubscribeRows as __SubscribeRows } from "./subscribe_rows_type"; export type UnsubscribeApplied = { - requestId: number; - totalHostExecutionDurationMicros: bigint; - queryId: __QueryId; - rows: __SubscribeRows; + requestId: number, + totalHostExecutionDurationMicros: bigint, + queryId: __QueryId, + rows: __SubscribeRows, }; +export default UnsubscribeApplied; /** * A namespace for generated helper functions. */ export namespace UnsubscribeApplied { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - new ProductTypeElement( - 'rows', - __SubscribeRows.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, + { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, + { name: "rows", algebraicType: __SubscribeRows.getTypeScriptAlgebraicType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: UnsubscribeApplied - ): void { - UnsubscribeApplied.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: UnsubscribeApplied): void { + AlgebraicType.serializeValue(writer, UnsubscribeApplied.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): UnsubscribeApplied { - return UnsubscribeApplied.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, UnsubscribeApplied.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts index 92126057962..7ba3ad72698 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,73 +11,65 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryId as __QueryId } from './query_id_type'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryId as __QueryId } from "./query_id_type"; +import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; export type UnsubscribeMultiApplied = { - requestId: number; - totalHostExecutionDurationMicros: bigint; - queryId: __QueryId; - update: __DatabaseUpdate; + requestId: number, + totalHostExecutionDurationMicros: bigint, + queryId: __QueryId, + update: __DatabaseUpdate, }; +export default UnsubscribeMultiApplied; /** * A namespace for generated helper functions. */ export namespace UnsubscribeMultiApplied { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - new ProductTypeElement( - 'update', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, + { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, + { name: "update", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: UnsubscribeMultiApplied - ): void { - UnsubscribeMultiApplied.getTypeScriptAlgebraicType().serialize( - writer, - value - ); + export function serialize(writer: BinaryWriter, value: UnsubscribeMultiApplied): void { + AlgebraicType.serializeValue(writer, UnsubscribeMultiApplied.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): UnsubscribeMultiApplied { - return UnsubscribeMultiApplied.getTypeScriptAlgebraicType().deserialize( - reader - ); + return AlgebraicType.deserializeValue(reader, UnsubscribeMultiApplied.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts index 32d02ba14c0..e3cdbbd56d7 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,57 +11,60 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryId as __QueryId } from './query_id_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryId as __QueryId } from "./query_id_type"; export type UnsubscribeMulti = { - requestId: number; - queryId: __QueryId; + requestId: number, + queryId: __QueryId, }; +export default UnsubscribeMulti; /** * A namespace for generated helper functions. */ export namespace UnsubscribeMulti { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: UnsubscribeMulti - ): void { - UnsubscribeMulti.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: UnsubscribeMulti): void { + AlgebraicType.serializeValue(writer, UnsubscribeMulti.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): UnsubscribeMulti { - return UnsubscribeMulti.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, UnsubscribeMulti.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts index 368f68c4d87..92519980047 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,54 +11,60 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { QueryId as __QueryId } from './query_id_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { QueryId as __QueryId } from "./query_id_type"; export type Unsubscribe = { - requestId: number; - queryId: __QueryId; + requestId: number, + queryId: __QueryId, }; +export default Unsubscribe; /** * A namespace for generated helper functions. */ export namespace Unsubscribe { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "requestId", algebraicType: AlgebraicType.U32}, + { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: Unsubscribe): void { - Unsubscribe.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Unsubscribe.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Unsubscribe { - return Unsubscribe.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Unsubscribe.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts index 68aa8865f54..e2a88a749d1 100644 --- a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts @@ -1,6 +1,8 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -9,78 +11,78 @@ import { AlgebraicValue, BinaryReader, BinaryWriter, - CallReducerFlags, ConnectionId, DbConnectionBuilder, DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, Identity, ProductType, ProductTypeElement, - ReducerEventContextInterface, SubscriptionBuilderImpl, - SubscriptionEventContextInterface, SumType, SumTypeVariant, TableCache, TimeDuration, Timestamp, deepEqual, -} from '../index'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; + type CallReducerFlags, + type DbContext, + type ErrorContextInterface, + type Event, + type EventContextInterface, + type ReducerEventContextInterface, + type SubscriptionEventContextInterface, +} from "../index"; +import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; + +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace UpdateStatusVariants { + export type Committed = { tag: "Committed", value: __DatabaseUpdate }; + export type Failed = { tag: "Failed", value: string }; + export type OutOfEnergy = { tag: "OutOfEnergy" }; +} // A namespace for generated variants and helper functions. export namespace UpdateStatus { - // These are the generated variant types for each variant of the tagged union. - // One type is generated per variant and will be used in the `value` field of - // the tagged union. - export type Committed = { tag: 'Committed'; value: __DatabaseUpdate }; - export type Failed = { tag: 'Failed'; value: string }; - export type OutOfEnergy = { tag: 'OutOfEnergy' }; - // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Committed = (value: __DatabaseUpdate): UpdateStatus => ({ - tag: 'Committed', - value, - }); - export const Failed = (value: string): UpdateStatus => ({ - tag: 'Failed', - value, - }); - export const OutOfEnergy = { tag: 'OutOfEnergy' }; + export const Committed = (value: __DatabaseUpdate): UpdateStatus => ({ tag: "Committed", value }); + export const Failed = (value: string): UpdateStatus => ({ tag: "Failed", value }); + export const OutOfEnergy: { tag: "OutOfEnergy" } = { tag: "OutOfEnergy" }; export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant( - 'Committed', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - new SumTypeVariant('Failed', AlgebraicType.createStringType()), - new SumTypeVariant('OutOfEnergy', AlgebraicType.createProductType([])), - ]); + return AlgebraicType.Sum({ + variants: [ + { name: "Committed", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType() }, + { name: "Failed", algebraicType: AlgebraicType.String }, + { name: "OutOfEnergy", algebraicType: AlgebraicType.Product({ elements: [] }) }, + ] + }); } export function serialize(writer: BinaryWriter, value: UpdateStatus): void { - UpdateStatus.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, UpdateStatus.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): UpdateStatus { - return UpdateStatus.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, UpdateStatus.getTypeScriptAlgebraicType()); } + } // The tagged union or sum type for the algebraic type `UpdateStatus`. -export type UpdateStatus = - | UpdateStatus.Committed - | UpdateStatus.Failed - | UpdateStatus.OutOfEnergy; +export type UpdateStatus = UpdateStatus.Committed | + UpdateStatus.Failed | + UpdateStatus.OutOfEnergy; export default UpdateStatus; + diff --git a/sdks/typescript/packages/sdk/src/db_connection_impl.ts b/sdks/typescript/packages/sdk/src/db_connection_impl.ts index 453be763383..4d7c9e44a46 100644 --- a/sdks/typescript/packages/sdk/src/db_connection_impl.ts +++ b/sdks/typescript/packages/sdk/src/db_connection_impl.ts @@ -1,6 +1,7 @@ import { ConnectionId } from 'spacetimedb'; import { AlgebraicType, + type AlgebraicTypeVariants, ProductType, ProductTypeElement, SumType, @@ -8,11 +9,7 @@ import { type ComparablePrimitive, } from 'spacetimedb'; import { - AlgebraicValue, parseValue, - ProductValue, - type ReducerArgsAdapter, - type ValueAdapter, } from 'spacetimedb'; import { BinaryReader } from 'spacetimedb'; import { BinaryWriter } from 'spacetimedb'; @@ -64,21 +61,17 @@ import { fromByteArray } from 'base64-js'; export { AlgebraicType, - AlgebraicValue, BinaryReader, BinaryWriter, DbConnectionBuilder, deepEqual, ProductType, ProductTypeElement, - ProductValue, SubscriptionBuilderImpl, SumType, SumTypeVariant, TableCache, type Event, - type ReducerArgsAdapter, - type ValueAdapter, }; export type { @@ -322,10 +315,11 @@ export class DbConnectionImpl< this.#remoteModule.tables[tableName]!.primaryKeyInfo; while (reader.offset < buffer.length + buffer.byteOffset) { const initialOffset = reader.offset; - const row = rowType.deserialize(reader); + const row = AlgebraicType.deserializeValue(reader, rowType); let rowId: ComparablePrimitive | undefined = undefined; if (primaryKeyInfo !== undefined) { - rowId = primaryKeyInfo.colType.intoMapKey( + rowId = AlgebraicType.intoMapKey( + primaryKeyInfo.colType, row[primaryKeyInfo.colName] ); } else { @@ -421,7 +415,7 @@ export class DbConnectionImpl< const args = txUpdate.reducerCall.args; const energyQuantaUsed = txUpdate.energyQuantaUsed; - let tableUpdates: CacheTableUpdate[]; + let tableUpdates: CacheTableUpdate[] = []; let errMessage = ''; switch (txUpdate.status.tag) { case 'Committed': @@ -617,7 +611,7 @@ export class DbConnectionImpl< this.#remoteModule.reducers[reducerInfo.reducerName]; try { const reader = new BinaryReader(reducerInfo.args as Uint8Array); - reducerArgs = reducerTypeInfo.argsType.deserialize(reader); + reducerArgs = AlgebraicType.deserializeValue(reader, reducerTypeInfo.argsType); } catch { // This should only be printed in development, since it's // possible for clients to receive new reducers that they don't @@ -680,8 +674,8 @@ export class DbConnectionImpl< ); const argsArray: any[] = []; - reducerTypeInfo.argsType.product.elements.forEach((element, index) => { - argsArray.push(reducerArgs[element.name]); + (reducerTypeInfo.argsType as AlgebraicTypeVariants.Product).value.elements.forEach((element, index) => { + argsArray.push(reducerArgs[element.name!]); }); this.#reducerEmitter.emit( reducerInfo.reducerName, diff --git a/sdks/typescript/packages/sdk/src/index.ts b/sdks/typescript/packages/sdk/src/index.ts index a2d8f33117a..af7e70a119f 100644 --- a/sdks/typescript/packages/sdk/src/index.ts +++ b/sdks/typescript/packages/sdk/src/index.ts @@ -3,10 +3,5 @@ export * from './db_connection_impl.ts'; export * from "spacetimedb"; -// export * from "./connection_id"; -// export * from './schedule_at'; export * from './client_cache.ts'; -// export * from './identity.ts'; export * from './message_types.ts'; -// export * from './timestamp.ts'; -// export * from './time_duration.ts'; diff --git a/sdks/typescript/packages/sdk/src/spacetime_module.ts b/sdks/typescript/packages/sdk/src/spacetime_module.ts index bc3839fdc0d..b7e4d810747 100644 --- a/sdks/typescript/packages/sdk/src/spacetime_module.ts +++ b/sdks/typescript/packages/sdk/src/spacetime_module.ts @@ -1,4 +1,4 @@ -import type { AlgebraicType } from '../../../../../crates/bindings-typescript/src/algebraic_type'; +import type { AlgebraicType } from 'spacetimedb'; import type { DbConnectionImpl } from './db_connection_impl'; export interface TableRuntimeTypeInfo { diff --git a/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts b/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts index fe151c89d91..8e741573ca8 100644 --- a/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts +++ b/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts @@ -1,4 +1,4 @@ -import BinaryWriter from './binary_writer.ts'; +import { AlgebraicType, BinaryWriter } from 'spacetimedb'; import { ServerMessage } from './client_api/index.ts'; class WebsocketTestAdapter { @@ -29,7 +29,7 @@ class WebsocketTestAdapter { sendToClient(message: ServerMessage): void { const writer = new BinaryWriter(1024); - ServerMessage.getTypeScriptAlgebraicType().serialize(writer, message); + AlgebraicType.serializeValue(writer, ServerMessage.getTypeScriptAlgebraicType(), message); const rawBytes = writer.getBuffer(); // The brotli library's `compress` is somehow broken: it returns `null` for some inputs. // See https://github.com/foliojs/brotli.js/issues/36, which is closed but not actually fixed. @@ -39,11 +39,11 @@ class WebsocketTestAdapter { this.onmessage({ data: rawBytes }); } - async createWebSocketFn( - _url: string, - _protocol: string, - _params: any - ): Promise { + async createWebSocketFn(args: { + url: URL, + wsProtocol: string, + authToken?: string + }): Promise { return this; } } diff --git a/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts b/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts new file mode 100644 index 00000000000..2bc6e608a8b --- /dev/null +++ b/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts @@ -0,0 +1,170 @@ +import { describe, expect, test } from 'vitest'; +import { AlgebraicType, BinaryReader, BinaryWriter } from 'spacetimedb'; + +describe('AlgebraicValue', () => { + test('when created with a ProductValue it assigns the product property', () => { + const value = { foo: "foobar" }; + const algebraic_type = AlgebraicType.Product({ + elements: [ + { name: "foo", algebraicType: AlgebraicType.String }, + ], + }) + const binaryWriter = new BinaryWriter(1024); + AlgebraicType.serializeValue(binaryWriter, algebraic_type, value); + + const buffer = binaryWriter.getBuffer(); + console.log(buffer); + }); + + // test('when created with a SumValue it assigns the sum property', () => { + // let value = new SumValue(1, new AlgebraicValue(1)); + // let av = new AlgebraicValue(value); + // expect(av.asSumValue()).toBe(value); + // }); + + // test('when created with a AlgebraicValue(string) it can be requested as a string', () => { + // let av = new AlgebraicValue('foo'); + + // expect(av.asString()).toBe('foo'); + // }); + + // test('options handle falsy strings', () => { + // let stringOptionType = AlgebraicType.createOptionType( + // AlgebraicType.createStringType() + // ); + // let writer = new BinaryWriter(1024); + // stringOptionType.serialize(writer, ''); + // let parsed = stringOptionType.deserialize( + // new BinaryReader(writer.getBuffer()) + // ); + // // Make sure we don't turn this into undefined. + // expect(parsed).toEqual(''); + + // writer = new BinaryWriter(1024); + // stringOptionType.serialize(writer, null); + // parsed = stringOptionType.deserialize(new BinaryReader(writer.getBuffer())); + // expect(parsed).toEqual(undefined); + + // writer = new BinaryWriter(1024); + // stringOptionType.serialize(writer, undefined); + // parsed = stringOptionType.deserialize(new BinaryReader(writer.getBuffer())); + // expect(parsed).toEqual(undefined); + // }); + + // test('options handle falsy numbers', () => { + // let stringOptionType = AlgebraicType.createOptionType( + // AlgebraicType.createU32Type() + // ); + // let writer = new BinaryWriter(1024); + // stringOptionType.serialize(writer, 0); + // let parsed = stringOptionType.deserialize( + // new BinaryReader(writer.getBuffer()) + // ); + // // Make sure we don't turn this into undefined. + // expect(parsed).toEqual(0); + + // writer = new BinaryWriter(1024); + // stringOptionType.serialize(writer, null); + // parsed = stringOptionType.deserialize(new BinaryReader(writer.getBuffer())); + // expect(parsed).toEqual(undefined); + + // writer = new BinaryWriter(1024); + // stringOptionType.serialize(writer, undefined); + // parsed = stringOptionType.deserialize(new BinaryReader(writer.getBuffer())); + // expect(parsed).toEqual(undefined); + // }); + + // test('when created with a AlgebraicValue(AlgebraicValue[]) it can be requested as an array', () => { + // let array: AlgebraicValue[] = [new AlgebraicValue(1)]; + // let av = new AlgebraicValue(array); + // expect(av.asArray()).toBe(array); + // }); + + // describe('deserialize with a binary adapter', () => { + // test('should correctly deserialize array with U8 type', () => { + // const input = new Uint8Array([2, 0, 0, 0, 10, 20]); + // const reader = new BinaryReader(input); + // const adapter: BinaryAdapter = new BinaryAdapter(reader); + // const type = AlgebraicType.createBytesType(); + + // const result = AlgebraicValue.deserialize(type, adapter); + + // expect(result.asBytes()).toEqual(new Uint8Array([10, 20])); + // }); + + // test('should correctly deserialize array with U128 type', () => { + // // byte array of length 0002 + // // prettier-ignore + // const input = new Uint8Array([ + // 3, 0, 0, 0, // 4 bytes for length + // 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 bytes for u128 + // 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, // 16 bytes for max u128 + // 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 bytes for u128 + // ]); + // const reader = new BinaryReader(input); + // const adapter: BinaryAdapter = new BinaryAdapter(reader); + // const type = AlgebraicType.createArrayType( + // AlgebraicType.createU128Type() + // ); + + // const result = AlgebraicValue.deserialize(type, adapter); + + // const u128_max = BigInt(2) ** BigInt(128) - BigInt(1); + // expect(result.asArray().map(e => e.asBigInt())).toEqual([ + // BigInt(1), + // u128_max, + // BigInt(10), + // ]); + // }); + + // test('should correctly deserialize an U128 type', () => { + // // byte array of length 0002 + // // prettier-ignore + // const input = new Uint8Array([ + // 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, // 16 bytes for max u128 + // ]); + // const reader = new BinaryReader(input); + // const adapter: BinaryAdapter = new BinaryAdapter(reader); + // const result = AlgebraicValue.deserialize( + // AlgebraicType.createU128Type(), + // adapter + // ); + + // const u128_max = BigInt(2) ** BigInt(128) - BigInt(1); + // expect(result.asBigInt()).toEqual(u128_max); + // }); + + // test('should correctly deserialize a boolean type', () => { + // // byte array of length 0002 + // const input = new Uint8Array([1]); + // const reader = new BinaryReader(input); + // const adapter: BinaryAdapter = new BinaryAdapter(reader); + // const result = AlgebraicValue.deserialize( + // AlgebraicType.createBoolType(), + // adapter + // ); + + // expect(result.asBoolean()).toEqual(true); + // }); + + // test('should correctly deserialize a string type', () => { + // // byte array of length 0002 + // const text = 'zażółć gęślą jaźń'; + // const encoder = new TextEncoder(); + // const textBytes = encoder.encode(text); + + // const input = new Uint8Array(textBytes.length + 4); + // input.set(new Uint8Array([textBytes.length, 0, 0, 0])); + // input.set(textBytes, 4); + + // const reader = new BinaryReader(input); + // const adapter: BinaryAdapter = new BinaryAdapter(reader); + // const result = AlgebraicValue.deserialize( + // AlgebraicType.createStringType(), + // adapter + // ); + + // expect(result.asString()).toEqual('zażółć gęślą jaźń'); + // }); + // }); +}); diff --git a/sdks/typescript/packages/sdk/tests/algebraic_value.test.ts b/sdks/typescript/packages/sdk/tests/algebraic_value.test.ts deleted file mode 100644 index 12e778223ed..00000000000 --- a/sdks/typescript/packages/sdk/tests/algebraic_value.test.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { describe, expect, test } from 'vitest'; -import { AlgebraicType } from '../src/algebraic_type'; -import { - AlgebraicValue, - BinaryAdapter, - ProductValue, - SumValue, -} from '../src/algebraic_value'; -import BinaryReader from '../src/binary_reader'; -import BinaryWriter from '../src/binary_writer'; - -describe('AlgebraicValue', () => { - test('when created with a ProductValue it assigns the product property', () => { - let value = new ProductValue([]); - let av = new AlgebraicValue(value); - expect(av.asProductValue()).toBe(value); - }); - - test('when created with a SumValue it assigns the sum property', () => { - let value = new SumValue(1, new AlgebraicValue(1)); - let av = new AlgebraicValue(value); - expect(av.asSumValue()).toBe(value); - }); - - test('when created with a AlgebraicValue(string) it can be requested as a string', () => { - let av = new AlgebraicValue('foo'); - - expect(av.asString()).toBe('foo'); - }); - - test('options handle falsy strings', () => { - let stringOptionType = AlgebraicType.createOptionType( - AlgebraicType.createStringType() - ); - let writer = new BinaryWriter(1024); - stringOptionType.serialize(writer, ''); - let parsed = stringOptionType.deserialize( - new BinaryReader(writer.getBuffer()) - ); - // Make sure we don't turn this into undefined. - expect(parsed).toEqual(''); - - writer = new BinaryWriter(1024); - stringOptionType.serialize(writer, null); - parsed = stringOptionType.deserialize(new BinaryReader(writer.getBuffer())); - expect(parsed).toEqual(undefined); - - writer = new BinaryWriter(1024); - stringOptionType.serialize(writer, undefined); - parsed = stringOptionType.deserialize(new BinaryReader(writer.getBuffer())); - expect(parsed).toEqual(undefined); - }); - - test('options handle falsy numbers', () => { - let stringOptionType = AlgebraicType.createOptionType( - AlgebraicType.createU32Type() - ); - let writer = new BinaryWriter(1024); - stringOptionType.serialize(writer, 0); - let parsed = stringOptionType.deserialize( - new BinaryReader(writer.getBuffer()) - ); - // Make sure we don't turn this into undefined. - expect(parsed).toEqual(0); - - writer = new BinaryWriter(1024); - stringOptionType.serialize(writer, null); - parsed = stringOptionType.deserialize(new BinaryReader(writer.getBuffer())); - expect(parsed).toEqual(undefined); - - writer = new BinaryWriter(1024); - stringOptionType.serialize(writer, undefined); - parsed = stringOptionType.deserialize(new BinaryReader(writer.getBuffer())); - expect(parsed).toEqual(undefined); - }); - - test('when created with a AlgebraicValue(AlgebraicValue[]) it can be requested as an array', () => { - let array: AlgebraicValue[] = [new AlgebraicValue(1)]; - let av = new AlgebraicValue(array); - expect(av.asArray()).toBe(array); - }); - - describe('deserialize with a binary adapter', () => { - test('should correctly deserialize array with U8 type', () => { - const input = new Uint8Array([2, 0, 0, 0, 10, 20]); - const reader = new BinaryReader(input); - const adapter: BinaryAdapter = new BinaryAdapter(reader); - const type = AlgebraicType.createBytesType(); - - const result = AlgebraicValue.deserialize(type, adapter); - - expect(result.asBytes()).toEqual(new Uint8Array([10, 20])); - }); - - test('should correctly deserialize array with U128 type', () => { - // byte array of length 0002 - // prettier-ignore - const input = new Uint8Array([ - 3, 0, 0, 0, // 4 bytes for length - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 bytes for u128 - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, // 16 bytes for max u128 - 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 bytes for u128 - ]); - const reader = new BinaryReader(input); - const adapter: BinaryAdapter = new BinaryAdapter(reader); - const type = AlgebraicType.createArrayType( - AlgebraicType.createU128Type() - ); - - const result = AlgebraicValue.deserialize(type, adapter); - - const u128_max = BigInt(2) ** BigInt(128) - BigInt(1); - expect(result.asArray().map(e => e.asBigInt())).toEqual([ - BigInt(1), - u128_max, - BigInt(10), - ]); - }); - - test('should correctly deserialize an U128 type', () => { - // byte array of length 0002 - // prettier-ignore - const input = new Uint8Array([ - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, // 16 bytes for max u128 - ]); - const reader = new BinaryReader(input); - const adapter: BinaryAdapter = new BinaryAdapter(reader); - const result = AlgebraicValue.deserialize( - AlgebraicType.createU128Type(), - adapter - ); - - const u128_max = BigInt(2) ** BigInt(128) - BigInt(1); - expect(result.asBigInt()).toEqual(u128_max); - }); - - test('should correctly deserialize a boolean type', () => { - // byte array of length 0002 - const input = new Uint8Array([1]); - const reader = new BinaryReader(input); - const adapter: BinaryAdapter = new BinaryAdapter(reader); - const result = AlgebraicValue.deserialize( - AlgebraicType.createBoolType(), - adapter - ); - - expect(result.asBoolean()).toEqual(true); - }); - - test('should correctly deserialize a string type', () => { - // byte array of length 0002 - const text = 'zażółć gęślą jaźń'; - const encoder = new TextEncoder(); - const textBytes = encoder.encode(text); - - const input = new Uint8Array(textBytes.length + 4); - input.set(new Uint8Array([textBytes.length, 0, 0, 0])); - input.set(textBytes, 4); - - const reader = new BinaryReader(input); - const adapter: BinaryAdapter = new BinaryAdapter(reader); - const result = AlgebraicValue.deserialize( - AlgebraicType.createStringType(), - adapter - ); - - expect(result.asString()).toEqual('zażółć gęślą jaźń'); - }); - }); -}); diff --git a/sdks/typescript/packages/sdk/tests/binary_read_write.test.ts b/sdks/typescript/packages/sdk/tests/binary_read_write.test.ts index 993f6675a9d..8108eb0e561 100644 --- a/sdks/typescript/packages/sdk/tests/binary_read_write.test.ts +++ b/sdks/typescript/packages/sdk/tests/binary_read_write.test.ts @@ -1,6 +1,5 @@ import { describe, expect, test } from 'vitest'; -import BinaryReader from '../src/binary_reader'; -import BinaryWriter from '../src/binary_writer'; +import { BinaryReader, BinaryWriter } from 'spacetimedb'; /* // Generated by the following Rust code: diff --git a/sdks/typescript/packages/sdk/tests/db_connection.test.ts b/sdks/typescript/packages/sdk/tests/db_connection.test.ts index 8339256c9a6..5d61d7369eb 100644 --- a/sdks/typescript/packages/sdk/tests/db_connection.test.ts +++ b/sdks/typescript/packages/sdk/tests/db_connection.test.ts @@ -6,15 +6,14 @@ import { User, } from '@clockworklabs/test-app/src/module_bindings'; import { beforeEach, describe, expect, test } from 'vitest'; -import { ConnectionId } from '../src/connection_id'; -import { Timestamp } from '../src/timestamp'; -import { TimeDuration } from '../src/time_duration'; -import { AlgebraicType } from '../src/algebraic_type'; -import { parseValue } from '../src/algebraic_value'; -import BinaryWriter from '../src/binary_writer'; +import { ConnectionId } from 'spacetimedb'; +import { Timestamp } from 'spacetimedb'; +import { TimeDuration } from 'spacetimedb'; +import { AlgebraicType } from 'spacetimedb'; +import { BinaryWriter } from 'spacetimedb'; import * as ws from '../src/client_api'; -import { ReducerEvent } from '../src/db_connection_impl'; -import { Identity } from '../src/identity'; +import type { ReducerEvent } from '../src/db_connection_impl'; +import { Identity } from 'spacetimedb'; import WebsocketTestAdapter from '../src/websocket_test_adapter'; const anIdentity = Identity.fromString( @@ -30,8 +29,8 @@ const sallyIdentity = Identity.fromString( class Deferred { #isResolved: boolean = false; #isRejected: boolean = false; - #resolve: (value: T | PromiseLike) => void; - #reject: (reason?: any) => void; + #resolve: (value: T | PromiseLike) => void = () => {}; + #reject: (reason?: any) => void = () => {}; promise: Promise; constructor() { @@ -84,7 +83,7 @@ function encodeUser(value: User): Uint8Array { function encodeCreatePlayerArgs(name: string, location: Point): Uint8Array { const writer = new BinaryWriter(1024); - AlgebraicType.createStringType().serialize(writer, name); + AlgebraicType.serializeValue(writer, AlgebraicType.String, name); Point.serialize(writer, location); return writer.getBuffer(); } @@ -124,7 +123,7 @@ describe('DbConnection', () => { const client = DbConnection.builder() .withUri('ws://127.0.0.1:1234') .withModuleName('db') - .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter)) + .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter) as any) .onConnect(() => { called = true; onConnectPromise.resolve(); @@ -152,7 +151,7 @@ describe('DbConnection', () => { const client = DbConnection.builder() .withUri('ws://127.0.0.1:1234') .withModuleName('db') - .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter)) + .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter) as any) .onConnect(() => { called = true; }) @@ -330,7 +329,7 @@ describe('DbConnection', () => { const client = DbConnection.builder() .withUri('ws://127.0.0.1:1234') .withModuleName('db') - .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter)) + .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter) as any) .onConnect(() => { called = true; }) @@ -402,7 +401,7 @@ describe('DbConnection', () => { const client = DbConnection.builder() .withUri('ws://127.0.0.1:1234') .withModuleName('db') - .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter)) + .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter) as any) .onConnect(() => { called = true; }) @@ -482,7 +481,7 @@ describe('DbConnection', () => { const client = DbConnection.builder() .withUri('ws://127.0.0.1:1234') .withModuleName('db') - .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter)) + .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter) as any) .onConnect(() => { called = true; }) @@ -618,7 +617,7 @@ describe('DbConnection', () => { const client = DbConnection.builder() .withUri('ws://127.0.0.1:1234') .withModuleName('db') - .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter)) + .withWSFn(wsAdapter.createWebSocketFn.bind(wsAdapter) as any) .build(); await client['wsPromise']; const user1 = { identity: bobIdentity, username: 'bob' }; diff --git a/sdks/typescript/packages/sdk/tests/table_cache.test.ts b/sdks/typescript/packages/sdk/tests/table_cache.test.ts index 1e666af4e45..029434496ae 100644 --- a/sdks/typescript/packages/sdk/tests/table_cache.test.ts +++ b/sdks/typescript/packages/sdk/tests/table_cache.test.ts @@ -1,10 +1,10 @@ -import { Operation, TableCache } from '../src/table_cache'; +import { type Operation, TableCache } from '../src/table_cache'; import type { TableRuntimeTypeInfo } from '../src/spacetime_module'; import { describe, expect, test } from 'vitest'; import { Player } from '@clockworklabs/test-app/src/module_bindings'; -import { AlgebraicType, ProductTypeElement } from '../src/algebraic_type'; +import { AlgebraicType, ProductType, type AlgebraicTypeVariants } from 'spacetimedb'; interface ApplyOperations { ops: Operation[]; @@ -99,22 +99,26 @@ function runTest(tableCache: TableCache, testSteps: TestStep[]) { describe('TableCache', () => { describe('Unindexed player table', () => { - const pointType = AlgebraicType.createProductType([ - new ProductTypeElement('x', AlgebraicType.createU16Type()), - new ProductTypeElement('y', AlgebraicType.createU16Type()), - ]); - const playerType = AlgebraicType.createProductType([ - new ProductTypeElement('ownerId', AlgebraicType.createStringType()), - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', pointType), - ]); + const pointType = AlgebraicType.Product({ + elements: [ + { name: 'x', algebraicType: AlgebraicType.U16 }, + { name: 'y', algebraicType: AlgebraicType.U16 }, + ] + }); + const playerType = AlgebraicType.Product({ + elements: [ + { name: 'ownerId', algebraicType: AlgebraicType.String }, + { name: 'name', algebraicType: AlgebraicType.String }, + { name: 'location', algebraicType: pointType }, + ] + }); const tableTypeInfo: TableRuntimeTypeInfo = { tableName: 'player', rowType: playerType, }; const newTable = () => new TableCache(tableTypeInfo); const mkOperation = (type: 'insert' | 'delete', row: Player) => { - let rowId = tableTypeInfo.rowType.intoMapKey(row); + let rowId = AlgebraicType.intoMapKey(tableTypeInfo.rowType, row); return { type, rowId, @@ -402,26 +406,31 @@ describe('TableCache', () => { }); }); describe('Indexed player table', () => { - const pointType = AlgebraicType.createProductType([ - new ProductTypeElement('x', AlgebraicType.createU16Type()), - new ProductTypeElement('y', AlgebraicType.createU16Type()), - ]); - const playerType = AlgebraicType.createProductType([ - new ProductTypeElement('ownerId', AlgebraicType.createStringType()), - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', pointType), - ]); + const pointType = AlgebraicType.Product({ + elements: [ + { name: 'x', algebraicType: AlgebraicType.U16 }, + { name: 'y', algebraicType: AlgebraicType.U16 }, + ] + }); + const playerType: AlgebraicType = AlgebraicType.Product({ + elements: [ + { name: 'ownerId', algebraicType: AlgebraicType.String }, + { name: 'name', algebraicType: AlgebraicType.String }, + { name: 'location', algebraicType: pointType }, + ] + }); const tableTypeInfo: TableRuntimeTypeInfo = { tableName: 'player', rowType: playerType, primaryKeyInfo: { colName: 'ownerId', - colType: playerType.product.elements[0].algebraicType, + colType: (playerType as AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }; const newTable = () => new TableCache(tableTypeInfo); const mkOperation = (type: 'insert' | 'delete', row: Player) => { - let rowId = tableTypeInfo.primaryKeyInfo!.colType.intoMapKey( + let rowId = AlgebraicType.intoMapKey( + tableTypeInfo.primaryKeyInfo!.colType, row['ownerId'] ); return { @@ -756,15 +765,19 @@ describe('TableCache', () => { }); }); - const pointType = AlgebraicType.createProductType([ - new ProductTypeElement('x', AlgebraicType.createU16Type()), - new ProductTypeElement('y', AlgebraicType.createU16Type()), - ]); - const playerType = AlgebraicType.createProductType([ - new ProductTypeElement('ownerId', AlgebraicType.createStringType()), - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', pointType), - ]); + const pointType = AlgebraicType.Product({ + elements: [ + { name: 'x', algebraicType: AlgebraicType.U16 }, + { name: 'y', algebraicType: AlgebraicType.U16 }, + ] + }); + const playerType = AlgebraicType.Product({ + elements: [ + { name: 'ownerId', algebraicType: AlgebraicType.String }, + { name: 'name', algebraicType: AlgebraicType.String }, + { name: 'location', algebraicType: pointType }, + ] + }); test('should be empty on creation', () => { const tableTypeInfo: TableRuntimeTypeInfo = { @@ -772,7 +785,7 @@ describe('TableCache', () => { rowType: playerType, primaryKeyInfo: { colName: 'ownerId', - colType: playerType.product.elements[0].algebraicType, + colType: (playerType as AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }; const tableCache = new TableCache(tableTypeInfo); diff --git a/sdks/typescript/vitest.config.ts b/sdks/typescript/vitest.config.ts index 4ac6027d578..47876caf89d 100644 --- a/sdks/typescript/vitest.config.ts +++ b/sdks/typescript/vitest.config.ts @@ -1,7 +1,18 @@ -import { defineConfig } from 'vitest/config'; +import { defineConfig } from 'vitest/config' export default defineConfig({ test: { environment: 'node', + deps: { + // Force Vite to process the workspace dependency from source + inline: ['spacetimedb'], + }, }, -}); + resolve: { + // Make Vite/Vitest consider "source" entries from workspace packages + conditions: ['source', 'import', 'default'], + mainFields: ['module', 'main', 'browser'], + preserveSymlinks: true, // useful with pnpm workspaces/links + extensions: ['.ts', '.tsx', '.mjs', '.js', '.json'], + }, +}) \ No newline at end of file From 7e8d7c298b98507d7806ad478d289a793c44f724 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 19 Aug 2025 19:38:51 -0400 Subject: [PATCH 05/37] Cleaned up some comments --- .../bindings-typescript/src/algebraic_type.ts | 746 ++---------------- 1 file changed, 79 insertions(+), 667 deletions(-) diff --git a/crates/bindings-typescript/src/algebraic_type.ts b/crates/bindings-typescript/src/algebraic_type.ts index a9b6ae0b49e..f79bf04eb97 100644 --- a/crates/bindings-typescript/src/algebraic_type.ts +++ b/crates/bindings-typescript/src/algebraic_type.ts @@ -10,11 +10,51 @@ import { ProductType } from './autogen/product_type_type'; import { SumType } from './autogen/sum_type_type'; // Exports +/** + * A factor / element of a product type. + * + * An element consist of an optional name and a type. + * + * NOTE: Each element has an implicit element tag based on its order. + * Uniquely identifies an element similarly to protobuf tags. + */ export * from './autogen/product_type_element_type'; + +/** + * A variant of a sum type. + * + * NOTE: Each element has an implicit element tag based on its order. + * Uniquely identifies an element similarly to protobuf tags. + */ export * from './autogen/sum_type_variant_type'; export { type __AlgebraicTypeVariants as AlgebraicTypeVariants } from './autogen/algebraic_type_type'; declare module "./autogen/product_type_type" { + /** + * A structural product type of the factors given by `elements`. + * + * This is also known as `struct` and `tuple` in many languages, + * but note that unlike most languages, products in SATs are *[structural]* and not nominal. + * When checking whether two nominal types are the same, + * their names and/or declaration sites (e.g., module / namespace) are considered. + * Meanwhile, a structural type system would only check the structure of the type itself, + * e.g., the names of its fields and their types in the case of a record. + * The name "product" comes from category theory. + * + * See also: https://ncatlab.org/nlab/show/product+type. + * + * These structures are known as product types because the number of possible values in product + * ```ignore + * { N_0: T_0, N_1: T_1, ..., N_n: T_n } + * ``` + * is: + * ```ignore + * Π (i ∈ 0..n). values(T_i) + * ``` + * so for example, `values({ A: U64, B: Bool }) = values(U64) * values(Bool)`. + * + * [structural]: https://en.wikipedia.org/wiki/Structural_type_system + */ export namespace ProductType { export function serializeValue(writer: BinaryWriter, ty: ProductType, value: any): void; export function deserializeValue(reader: BinaryReader, ty: ProductType): any; @@ -82,6 +122,30 @@ ProductType.intoMapKey = function (ty: ProductType, value: any): ComparablePrimi } declare module "./autogen/sum_type_type" { + /** + * Unlike most languages, sums in SATS are *[structural]* and not nominal. + * When checking whether two nominal types are the same, + * their names and/or declaration sites (e.g., module / namespace) are considered. + * Meanwhile, a structural type system would only check the structure of the type itself, + * e.g., the names of its variants and their inner data types in the case of a sum. + * + * This is also known as a discriminated union (implementation) or disjoint union. + * Another name is [coproduct (category theory)](https://ncatlab.org/nlab/show/coproduct). + * + * These structures are known as sum types because the number of possible values a sum + * ```ignore + * { N_0(T_0), N_1(T_1), ..., N_n(T_n) } + * ``` + * is: + * ```ignore + * Σ (i ∈ 0..n). values(T_i) + * ``` + * so for example, `values({ A(U64), B(Bool) }) = values(U64) + values(Bool)`. + * + * See also: https://ncatlab.org/nlab/show/sum+type. + * + * [structural]: https://en.wikipedia.org/wiki/Structural_type_system + */ export namespace SumType { export function serializeValue(writer: BinaryWriter, ty: SumType, value: any): void; export function deserializeValue(reader: BinaryReader, ty: SumType): any; @@ -138,6 +202,13 @@ SumType.deserializeValue = function (reader: BinaryReader, ty: SumType): any { export { SumType }; declare module "./autogen/algebraic_type_type" { + /** + * The SpacetimeDB Algebraic Type System (SATS) is a structural type system in + * which a nominal type system can be constructed. + * + * The type system unifies the concepts sum types, product types, and built-in + * primitive types into a single type system. + */ export namespace __AlgebraicType { export function createOptionType(innerType: __AlgebraicType): __AlgebraicType; export function createIdentityType(): __AlgebraicType; @@ -148,6 +219,13 @@ declare module "./autogen/algebraic_type_type" { export function serializeValue(writer: BinaryWriter, ty: __AlgebraicType, value: any): void; export function deserializeValue(reader: BinaryReader, ty: __AlgebraicType): any; + /** + * Convert a value of the algebraic type into something that can be used as a key in a map. + * There are no guarantees about being able to order it. + * This is only guaranteed to be comparable to other values of the same type. + * @param value A value of the algebraic type + * @returns Something that can be used as a key in a map. + */ export function intoMapKey(ty: __AlgebraicType, value: any): ComparablePrimitive; } } @@ -351,670 +429,4 @@ __AlgebraicType.intoMapKey = function (ty: __AlgebraicType, value: any): Compara export type AlgebraicType = __AlgebraicTypeType; export const AlgebraicType: typeof __AlgebraicType = __AlgebraicType; - -export type ComparablePrimitive = number | string | String | boolean | bigint; - -/** -// * A variant of a sum type. -// * -// * NOTE: Each element has an implicit element tag based on its order. -// * Uniquely identifies an element similarly to protobuf tags. -// */ -// export class SumTypeVariant { -// name: string; -// algebraicType: AlgebraicType; - -// constructor(name: string, algebraicType: AlgebraicType) { -// this.name = name; -// this.algebraicType = algebraicType; -// } -// } - -// /** -// * Unlike most languages, sums in SATS are *[structural]* and not nominal. -// * When checking whether two nominal types are the same, -// * their names and/or declaration sites (e.g., module / namespace) are considered. -// * Meanwhile, a structural type system would only check the structure of the type itself, -// * e.g., the names of its variants and their inner data types in the case of a sum. -// * -// * This is also known as a discriminated union (implementation) or disjoint union. -// * Another name is [coproduct (category theory)](https://ncatlab.org/nlab/show/coproduct). -// * -// * These structures are known as sum types because the number of possible values a sum -// * ```ignore -// * { N_0(T_0), N_1(T_1), ..., N_n(T_n) } -// * ``` -// * is: -// * ```ignore -// * Σ (i ∈ 0..n). values(T_i) -// * ``` -// * so for example, `values({ A(U64), B(Bool) }) = values(U64) + values(Bool)`. -// * -// * See also: https://ncatlab.org/nlab/show/sum+type. -// * -// * [structural]: https://en.wikipedia.org/wiki/Structural_type_system -// */ -// export class SumType { -// variants: SumTypeVariant[]; - -// constructor(variants: SumTypeVariant[]) { -// this.variants = variants; -// } - -// serialize = (writer: BinaryWriter, value: any): void => { -// // In TypeScript we handle Option values as a special case -// // we don't represent the some and none variants, but instead -// // we represent the value directly. -// if ( -// this.variants.length == 2 && -// this.variants[0].name === 'some' && -// this.variants[1].name === 'none' -// ) { -// if (value !== null && value !== undefined) { -// writer.writeByte(0); -// this.variants[0].algebraicType.serialize(writer, value); -// } else { -// writer.writeByte(1); -// } -// } else { -// let variant = value['tag']; -// const index = this.variants.findIndex(v => v.name === variant); -// if (index < 0) { -// throw `Can't serialize a sum type, couldn't find ${value.tag} tag`; -// } -// writer.writeU8(index); -// this.variants[index].algebraicType.serialize(writer, value['value']); -// } -// }; - -// deserialize = (reader: BinaryReader): any => { -// let tag = reader.readU8(); -// // In TypeScript we handle Option values as a special case -// // we don't represent the some and none variants, but instead -// // we represent the value directly. -// if ( -// this.variants.length == 2 && -// this.variants[0].name === 'some' && -// this.variants[1].name === 'none' -// ) { -// if (tag === 0) { -// return this.variants[0].algebraicType.deserialize(reader); -// } else if (tag === 1) { -// return undefined; -// } else { -// throw `Can't deserialize an option type, couldn't find ${tag} tag`; -// } -// } else { -// let variant = this.variants[tag]; -// let value = variant.algebraicType.deserialize(reader); -// return { tag: variant.name, value }; -// } -// }; -// } - -// /** -// * A factor / element of a product type. -// * -// * An element consist of an optional name and a type. -// * -// * NOTE: Each element has an implicit element tag based on its order. -// * Uniquely identifies an element similarly to protobuf tags. -// */ -// export class ProductTypeElement { -// name: string; -// algebraicType: AlgebraicType; - -// constructor(name: string, algebraicType: AlgebraicType) { -// this.name = name; -// this.algebraicType = algebraicType; -// } -// } - -// /** -// * A structural product type of the factors given by `elements`. -// * -// * This is also known as `struct` and `tuple` in many languages, -// * but note that unlike most languages, products in SATs are *[structural]* and not nominal. -// * When checking whether two nominal types are the same, -// * their names and/or declaration sites (e.g., module / namespace) are considered. -// * Meanwhile, a structural type system would only check the structure of the type itself, -// * e.g., the names of its fields and their types in the case of a record. -// * The name "product" comes from category theory. -// * -// * See also: https://ncatlab.org/nlab/show/product+type. -// * -// * These structures are known as product types because the number of possible values in product -// * ```ignore -// * { N_0: T_0, N_1: T_1, ..., N_n: T_n } -// * ``` -// * is: -// * ```ignore -// * Π (i ∈ 0..n). values(T_i) -// * ``` -// * so for example, `values({ A: U64, B: Bool }) = values(U64) * values(Bool)`. -// * -// * [structural]: https://en.wikipedia.org/wiki/Structural_type_system -// */ -// export class ProductType { -// elements: ProductTypeElement[]; - -// constructor(elements: ProductTypeElement[]) { -// this.elements = elements; -// } - -// isEmpty(): boolean { -// return this.elements.length === 0; -// } - -// serialize = (writer: BinaryWriter, value: object): void => { -// for (let element of this.elements) { -// element.algebraicType.serialize(writer, value[element.name]); -// } -// }; - -// intoMapKey(value: any): ComparablePrimitive { -// if (this.elements.length === 1) { -// if (this.elements[0].name === '__time_duration_micros__') { -// return (value as TimeDuration).__time_duration_micros__; -// } - -// if (this.elements[0].name === '__timestamp_micros_since_unix_epoch__') { -// return (value as Timestamp).__timestamp_micros_since_unix_epoch__; -// } - -// if (this.elements[0].name === '__identity__') { -// return (value as Identity).__identity__; -// } - -// if (this.elements[0].name === '__connection_id__') { -// return (value as ConnectionId).__connection_id__; -// } -// } -// // The fallback is to serialize and base64 encode the bytes. -// const writer = new BinaryWriter(10); -// this.serialize(writer, value); -// return writer.toBase64(); -// } - -// deserialize = (reader: BinaryReader): { [key: string]: any } => { -// let result: { [key: string]: any } = {}; -// if (this.elements.length === 1) { -// if (this.elements[0].name === '__time_duration_micros__') { -// return new TimeDuration(reader.readI64()); -// } - -// if (this.elements[0].name === '__timestamp_micros_since_unix_epoch__') { -// return new Timestamp(reader.readI64()); -// } - -// if (this.elements[0].name === '__identity__') { -// return new Identity(reader.readU256()); -// } - -// if (this.elements[0].name === '__connection_id__') { -// return new ConnectionId(reader.readU128()); -// } -// } - -// for (let element of this.elements) { -// result[element.name] = element.algebraicType.deserialize(reader); -// } -// return result; -// }; -// } - -// /* A map type from keys of type `keyType` to values of type `valueType`. */ -// export class MapType { -// keyType: AlgebraicType; -// valueType: AlgebraicType; - -// constructor(keyType: AlgebraicType, valueType: AlgebraicType) { -// this.keyType = keyType; -// this.valueType = valueType; -// } -// } - -// type ArrayBaseType = AlgebraicType; -// type TypeRef = null; -// type None = null; -// export type EnumLabel = { label: string }; - -// type AnyType = -// | ProductType -// | SumType -// | ArrayBaseType -// | MapType -// | EnumLabel -// | TypeRef -// | None; - -// export type ComparablePrimitive = number | string | String | boolean | bigint; - -// /** -// * The SpacetimeDB Algebraic Type System (SATS) is a structural type system in -// * which a nominal type system can be constructed. -// * -// * The type system unifies the concepts sum types, product types, and built-in -// * primitive types into a single type system. -// */ -// export class AlgebraicType { -// type!: Type; -// type_?: AnyType; - -// #setter(type: Type, payload: AnyType | undefined) { -// this.type_ = payload; -// this.type = payload === undefined ? Type.None : type; -// } - -// get product(): ProductType { -// if (this.type !== Type.ProductType) { -// throw 'product type was requested, but the type is not ProductType'; -// } -// return this.type_ as ProductType; -// } - -// set product(value: ProductType | undefined) { -// this.#setter(Type.ProductType, value); -// } - -// get sum(): SumType { -// if (this.type !== Type.SumType) { -// throw 'sum type was requested, but the type is not SumType'; -// } -// return this.type_ as SumType; -// } -// set sum(value: SumType | undefined) { -// this.#setter(Type.SumType, value); -// } - -// get array(): ArrayBaseType { -// if (this.type !== Type.ArrayType) { -// throw 'array type was requested, but the type is not ArrayType'; -// } -// return this.type_ as ArrayBaseType; -// } -// set array(value: ArrayBaseType | undefined) { -// this.#setter(Type.ArrayType, value); -// } - -// get map(): MapType { -// if (this.type !== Type.MapType) { -// throw 'map type was requested, but the type is not MapType'; -// } -// return this.type_ as MapType; -// } -// set map(value: MapType | undefined) { -// this.#setter(Type.MapType, value); -// } - -// static #createType(type: Type, payload: AnyType | undefined): AlgebraicType { -// let at = new AlgebraicType(); -// at.#setter(type, payload); -// return at; -// } - -// static createProductType(elements: ProductTypeElement[]): AlgebraicType { -// return this.#createType(Type.ProductType, new ProductType(elements)); -// } - -// static createSumType(variants: SumTypeVariant[]): AlgebraicType { -// return this.#createType(Type.SumType, new SumType(variants)); -// } - -// static createArrayType(elementType: AlgebraicType): AlgebraicType { -// return this.#createType(Type.ArrayType, elementType); -// } - -// static createMapType(key: AlgebraicType, val: AlgebraicType): AlgebraicType { -// return this.#createType(Type.MapType, new MapType(key, val)); -// } - -// static createBoolType(): AlgebraicType { -// return this.#createType(Type.Bool, null); -// } -// static createI8Type(): AlgebraicType { -// return this.#createType(Type.I8, null); -// } -// static createU8Type(): AlgebraicType { -// return this.#createType(Type.U8, null); -// } -// static createI16Type(): AlgebraicType { -// return this.#createType(Type.I16, null); -// } -// static createU16Type(): AlgebraicType { -// return this.#createType(Type.U16, null); -// } -// static createI32Type(): AlgebraicType { -// return this.#createType(Type.I32, null); -// } -// static createU32Type(): AlgebraicType { -// return this.#createType(Type.U32, null); -// } -// static createI64Type(): AlgebraicType { -// return this.#createType(Type.I64, null); -// } -// static createU64Type(): AlgebraicType { -// return this.#createType(Type.U64, null); -// } -// static createI128Type(): AlgebraicType { -// return this.#createType(Type.I128, null); -// } -// static createU128Type(): AlgebraicType { -// return this.#createType(Type.U128, null); -// } -// static createI256Type(): AlgebraicType { -// return this.#createType(Type.I256, null); -// } -// static createU256Type(): AlgebraicType { -// return this.#createType(Type.U256, null); -// } -// static createF32Type(): AlgebraicType { -// return this.#createType(Type.F32, null); -// } -// static createF64Type(): AlgebraicType { -// return this.#createType(Type.F64, null); -// } -// static createStringType(): AlgebraicType { -// return this.#createType(Type.String, null); -// } -// static createBytesType(): AlgebraicType { -// return this.createArrayType(this.createU8Type()); -// } -// static createOptionType(innerType: AlgebraicType): AlgebraicType { -// return this.createSumType([ -// new SumTypeVariant('some', innerType), -// new SumTypeVariant('none', this.createProductType([])), -// ]); -// } -// static createIdentityType(): AlgebraicType { -// return this.createProductType([ -// new ProductTypeElement('__identity__', this.createU256Type()), -// ]); -// } - -// static createConnectionIdType(): AlgebraicType { -// return this.createProductType([ -// new ProductTypeElement('__connection_id__', this.createU128Type()), -// ]); -// } - -// static createScheduleAtType(): AlgebraicType { -// return ScheduleAt.getAlgebraicType(); -// } - -// static createTimestampType(): AlgebraicType { -// return this.createProductType([ -// new ProductTypeElement( -// '__timestamp_micros_since_unix_epoch__', -// this.createI64Type() -// ), -// ]); -// } - -// static createTimeDurationType(): AlgebraicType { -// return this.createProductType([ -// new ProductTypeElement('__time_duration_micros__', this.createI64Type()), -// ]); -// } - -// isProductType(): boolean { -// return this.type === Type.ProductType; -// } - -// isSumType(): boolean { -// return this.type === Type.SumType; -// } - -// isArrayType(): boolean { -// return this.type === Type.ArrayType; -// } - -// isMapType(): boolean { -// return this.type === Type.MapType; -// } - -// #isBytes(): boolean { -// return this.isArrayType() && this.array.type == Type.U8; -// } - -// #isBytesNewtype(tag: string): boolean { -// return ( -// this.isProductType() && -// this.product.elements.length === 1 && -// (this.product.elements[0].algebraicType.type == Type.U128 || -// this.product.elements[0].algebraicType.type == Type.U256) && -// this.product.elements[0].name === tag -// ); -// } - -// #isI64Newtype(tag: string): boolean { -// return ( -// this.isProductType() && -// this.product.elements.length === 1 && -// this.product.elements[0].algebraicType.type === Type.I64 && -// this.product.elements[0].name === tag -// ); -// } - -// isIdentity(): boolean { -// return this.#isBytesNewtype('__identity__'); -// } - -// isConnectionId(): boolean { -// return this.#isBytesNewtype('__connection_id__'); -// } - -// isScheduleAt(): boolean { -// return ( -// this.isSumType() && -// this.sum.variants.length === 2 && -// this.sum.variants[0].name === 'Interval' && -// this.sum.variants[0].algebraicType.type === Type.U64 && -// this.sum.variants[1].name === 'Time' && -// this.sum.variants[1].algebraicType.type === Type.U64 -// ); -// } - -// isTimestamp(): boolean { -// return this.#isI64Newtype('__timestamp_micros_since_unix_epoch__'); -// } - -// isTimeDuration(): boolean { -// return this.#isI64Newtype('__time_duration_micros__'); -// } - -// /** -// * Convert a value of the algebraic type into something that can be used as a key in a map. -// * There are no guarantees about being able to order it. -// * This is only guaranteed to be comparable to other values of the same type. -// * @param value A value of the algebraic type -// * @returns Something that can be used as a key in a map. -// */ -// intoMapKey(value: any): ComparablePrimitive { -// switch (this.type) { -// case Type.U8: -// case Type.U16: -// case Type.U32: -// case Type.U64: -// case Type.U128: -// case Type.U256: -// case Type.I8: -// case Type.I16: -// case Type.I64: -// case Type.I128: -// case Type.F32: -// case Type.F64: -// case Type.String: -// case Type.Bool: -// return value; -// case Type.ProductType: -// return this.product.intoMapKey(value); -// default: -// const writer = new BinaryWriter(10); -// this.serialize(writer, value); -// return writer.toBase64(); -// } -// } - -// serialize(writer: BinaryWriter, value: any): void { -// switch (this.type) { -// case Type.ProductType: -// this.product.serialize(writer, value); -// break; -// case Type.SumType: -// this.sum.serialize(writer, value); -// break; -// case Type.ArrayType: -// if (this.#isBytes()) { -// writer.writeUInt8Array(value); -// } else { -// const elemType = this.array; -// writer.writeU32(value.length); -// for (let elem of value) { -// elemType.serialize(writer, elem); -// } -// } -// break; -// case Type.MapType: -// throw new Error('not implemented'); -// case Type.Bool: -// writer.writeBool(value); -// break; -// case Type.I8: -// writer.writeI8(value); -// break; -// case Type.U8: -// writer.writeU8(value); -// break; -// case Type.I16: -// writer.writeI16(value); -// break; -// case Type.U16: -// writer.writeU16(value); -// break; -// case Type.I32: -// writer.writeI32(value); -// break; -// case Type.U32: -// writer.writeU32(value); -// break; -// case Type.I64: -// writer.writeI64(value); -// break; -// case Type.U64: -// writer.writeU64(value); -// break; -// case Type.I128: -// writer.writeI128(value); -// break; -// case Type.U128: -// writer.writeU128(value); -// break; -// case Type.I256: -// writer.writeI256(value); -// break; -// case Type.U256: -// writer.writeU256(value); -// break; -// case Type.F32: -// writer.writeF32(value); -// break; -// case Type.F64: -// writer.writeF64(value); -// break; -// case Type.String: -// writer.writeString(value); -// break; -// default: -// throw new Error(`not implemented, ${this.type}`); -// } -// } - -// deserialize(reader: BinaryReader): any { -// switch (this.type) { -// case Type.ProductType: -// return this.product.deserialize(reader); -// case Type.SumType: -// return this.sum.deserialize(reader); -// case Type.ArrayType: -// if (this.#isBytes()) { -// return reader.readUInt8Array(); -// } else { -// const elemType = this.array; -// const length = reader.readU32(); -// let result: any[] = []; -// for (let i = 0; i < length; i++) { -// result.push(elemType.deserialize(reader)); -// } -// return result; -// } -// case Type.MapType: -// // TODO: MapType is being removed -// throw new Error('not implemented'); -// case Type.Bool: -// return reader.readBool(); -// case Type.I8: -// return reader.readI8(); -// case Type.U8: -// return reader.readU8(); -// case Type.I16: -// return reader.readI16(); -// case Type.U16: -// return reader.readU16(); -// case Type.I32: -// return reader.readI32(); -// case Type.U32: -// return reader.readU32(); -// case Type.I64: -// return reader.readI64(); -// case Type.U64: -// return reader.readU64(); -// case Type.I128: -// return reader.readI128(); -// case Type.U128: -// return reader.readU128(); -// case Type.U256: -// return reader.readU256(); -// case Type.F32: -// return reader.readF32(); -// case Type.F64: -// return reader.readF64(); -// case Type.String: -// return reader.readString(); -// default: -// throw new Error(`not implemented, ${this.type}`); -// } -// } -// } - -// export namespace AlgebraicType { -// export enum Type { -// SumType = 'SumType', -// ProductType = 'ProductType', -// ArrayType = 'ArrayType', -// MapType = 'MapType', -// Bool = 'Bool', -// I8 = 'I8', -// U8 = 'U8', -// I16 = 'I16', -// U16 = 'U16', -// I32 = 'I32', -// U32 = 'U32', -// I64 = 'I64', -// U64 = 'U64', -// I128 = 'I128', -// U128 = 'U128', -// I256 = 'I256', -// U256 = 'U256', -// F32 = 'F32', -// F64 = 'F64', -// /** UTF-8 encoded */ -// String = 'String', -// None = 'None', -// } -// } - -// // No idea why but in order to have a local alias for both of these -// // need to be present -// type Type = AlgebraicType.Type; -// let Type: typeof AlgebraicType.Type = AlgebraicType.Type; +export type ComparablePrimitive = number | string | String | boolean | bigint; \ No newline at end of file From f05ab4162f731f951ee5951c9b83863bbe507af6 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 19 Aug 2025 19:41:36 -0400 Subject: [PATCH 06/37] Removed errant files --- crates/bindings-typescript/src/reducers.ts | 40 -- crates/bindings-typescript/src/schema.ts | 717 --------------------- 2 files changed, 757 deletions(-) delete mode 100644 crates/bindings-typescript/src/reducers.ts delete mode 100644 crates/bindings-typescript/src/schema.ts diff --git a/crates/bindings-typescript/src/reducers.ts b/crates/bindings-typescript/src/reducers.ts deleted file mode 100644 index 60e7fac51cf..00000000000 --- a/crates/bindings-typescript/src/reducers.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { clientConnected, clientDisconnected, init, player, point, procedure, reducer, sendMessageSchedule, user, type Schema } from "./schema"; - -export const sendMessage = reducer( - 'send_message', - sendMessageSchedule, - (ctx, { scheduleId, scheduledAt, text }) => { - console.log(`Sending message: ${text} ${scheduleId}`); - } -); - -init('init', {}, ctx => { - console.log('Database initialized'); -}); - -clientConnected('on_connect', {}, ctx => { - console.log('Client connected'); -}); - -clientDisconnected('on_disconnect', {}, ctx => { - console.log('Client disconnected'); -}); - -reducer( - 'move_player', - { user, foo: point, player }, - (ctx, { user, foo: point, player }): void => { - ctx.db.player - if (player.baz.tag === 'Foo') { - player.baz.value += 1; - } else if (player.baz.tag === 'Bar') { - player.baz.value += 2; - } else if (player.baz.tag === 'Baz') { - player.baz.value += '!'; - } - } -); - -procedure('get_user', { user }, async (ctx, { user }) => { - console.log(user.email); -}); \ No newline at end of file diff --git a/crates/bindings-typescript/src/schema.ts b/crates/bindings-typescript/src/schema.ts deleted file mode 100644 index ae222689d89..00000000000 --- a/crates/bindings-typescript/src/schema.ts +++ /dev/null @@ -1,717 +0,0 @@ -// import { -// AlgebraicType, -// ProductType, -// ProductTypeElement, -// SumTypeVariant, -// } from './algebraic_type'; -// import { sendMessage } from './reducers'; - -// type RawIdentifier = string; - -// type AlgebraicTypeRef = number; - -// type ColId = number; - -// type ColList = ColId[]; - -// type RawIndexAlgorithm = -// | { tag: 'btree'; value: { columns: ColList } } -// | { tag: 'hash'; value: { columns: ColList } } -// | { tag: 'direct'; value: { column: ColId } }; - -// type Typespace = { -// types: AlgebraicType[]; -// }; - -// type RawIndexDefV9 = { -// name?: string; -// accessor_name?: RawIdentifier; -// algorithm: RawIndexAlgorithm; -// }; - -// type RawUniqueConstraintDataV9 = { columns: ColList }; - -// type RawConstraintDataV9 = { tag: 'unique'; value: RawUniqueConstraintDataV9 }; - -// type RawConstraintDefV9 = { -// name?: string; -// data: RawConstraintDataV9; -// }; - -// type RawSequenceDefV9 = { -// name?: RawIdentifier; -// column: ColId; -// start?: number; -// minValue?: number; -// maxValue?: number; -// increment: number; -// }; - -// type TableType = 'system' | 'user'; -// type TableAccess = 'public' | 'private'; - -// type RawScheduleDefV9 = { -// name?: RawIdentifier; -// reducerName: RawIdentifier; -// scheduledAtColumn: ColId; -// }; - -// type RawTableDefV9 = { -// name: RawIdentifier; -// productTypeRef: AlgebraicTypeRef; -// primaryKey: ColList; -// indexes: RawIndexDefV9[]; -// constraints: RawConstraintDefV9[]; -// sequences: RawSequenceDefV9[]; -// schedule?: RawScheduleDefV9; -// tableType: TableType; -// tableAccess: TableAccess; -// }; - -// type RawReducerDefV9 = { -// name: RawIdentifier; -// params: ProductType; -// lifecycle?: 'init' | 'on_connect' | 'on_disconnect'; -// }; - -// type RawScopedTypeNameV9 = { -// name: RawIdentifier; -// scope: RawIdentifier[]; -// }; - -// type RawTypeDefV9 = { -// name: RawScopedTypeNameV9; -// ty: AlgebraicTypeRef; -// customOrdering: boolean; -// }; - -// type RawMiscModuleExportV9 = never; - -// type RawSql = string; -// type RawRowLevelSecurityDefV9 = { -// sql: RawSql; -// }; - -// type RawModuleDefV9 = { -// typespace: Typespace; -// tables: RawTableDefV9[]; -// reducers: RawReducerDefV9[]; -// types: RawTypeDefV9[]; -// miscExports: RawMiscModuleExportV9[]; -// rowLevelSecurity: RawRowLevelSecurityDefV9[]; -// }; - -// /***************************************************************** -// * shared helpers -// *****************************************************************/ -// type Merge = M1 & Omit; -// type Values = T[keyof T]; - -// /***************************************************************** -// * the run‑time catalogue that we are filling -// *****************************************************************/ -// export const MODULE_DEF: RawModuleDefV9 = { -// typespace: { types: [] }, -// tables: [], -// reducers: [], -// types: [], -// miscExports: [], -// rowLevelSecurity: [], -// }; - -// /***************************************************************** -// * ColumnBuilder – holds the JS type + Spacetime type + metadata -// *****************************************************************/ -// export interface ColumnBuilder< -// /** JS / TS visible type */ JS, -// /** accumulated column metadata */ M = {}, -// > { -// /** phantom – exposes the JS type to the compiler only */ -// readonly __type__: JS; -// /** the SpacetimeDB algebraic type (run‑time value) */ -// readonly __spacetime_type__: AlgebraicType; -// /** plain JS object where we accumulate column metadata */ -// readonly __meta__: M; - -// /** —— builder combinators ——————————————— */ -// index( -// algorithm?: N // default = "btree" -// ): ColumnBuilder>; - -// primary_key(): ColumnBuilder>; -// unique(): ColumnBuilder>; -// auto_inc(): ColumnBuilder>; -// } - -// /** create the concrete (but still opaque) builder object */ -// function col(__spacetime_type__: AlgebraicType): ColumnBuilder { -// const c: any = { -// __spacetime_type__, -// __meta__: {}, -// }; - -// /** all mutators simply stamp metadata and re‑use the same object */ -// c.index = (algo: any = 'btree') => { -// c.__meta__.index = algo; -// return c; -// }; -// c.primary_key = () => { -// c.__meta__.primaryKey = true; -// return c; -// }; -// c.unique = () => { -// c.__meta__.unique = true; -// return c; -// }; -// c.auto_inc = () => { -// c.__meta__.autoInc = true; -// return c; -// }; - -// return c; -// } - -// /***************************************************************** -// * Primitive factories – unchanged except we add scheduleAt() -// *****************************************************************/ -// export const t = { -// /* ───── primitive scalars ───── */ -// bool: (): ColumnBuilder => col(AlgebraicType.createBoolType()), -// string: (): ColumnBuilder => col(AlgebraicType.createStringType()), -// number: (): ColumnBuilder => col(AlgebraicType.createF64Type()), - -// /* integers share JS = number but differ in Kind */ -// i8: (): ColumnBuilder => col(AlgebraicType.createI8Type()), -// u8: (): ColumnBuilder => col(AlgebraicType.createU8Type()), -// i16: (): ColumnBuilder => col(AlgebraicType.createI16Type()), -// u16: (): ColumnBuilder => col(AlgebraicType.createU16Type()), -// i32: (): ColumnBuilder => col(AlgebraicType.createI32Type()), -// u32: (): ColumnBuilder => col(AlgebraicType.createU32Type()), -// i64: (): ColumnBuilder => col(AlgebraicType.createI64Type()), -// u64: (): ColumnBuilder => col(AlgebraicType.createU64Type()), -// i128: (): ColumnBuilder => col(AlgebraicType.createI128Type()), -// u128: (): ColumnBuilder => col(AlgebraicType.createU128Type()), -// i256: (): ColumnBuilder => col(AlgebraicType.createI256Type()), -// u256: (): ColumnBuilder => col(AlgebraicType.createU256Type()), - -// f32: (): ColumnBuilder => col(AlgebraicType.createF32Type()), -// f64: (): ColumnBuilder => col(AlgebraicType.createF64Type()), - -// /* ───── structured builders ───── */ -// object>>(def: Def): ProductTypeColumnBuilder { -// const productTy = AlgebraicType.createProductType( -// Object.entries(def).map( -// ([n, c]) => new ProductTypeElement(n, c.__spacetime_type__) -// ) -// ); -// /** carry the *definition* alongside so `table()` can introspect */ -// return Object.assign( -// col<{ [K in keyof Def]: ColumnType }>(productTy), -// { -// __is_product_type__: true as const, -// __def__: def, -// } -// ) as ProductTypeColumnBuilder; -// }, - -// array>(e: E): ColumnBuilder[]> { -// return col[]>(AlgebraicType.createArrayType(e.__spacetime_type__)); -// }, - -// enum>>( -// variants: V -// ): ColumnBuilder< -// { -// [K in keyof V]: { -// tag: K; -// value: Infer; -// }; -// }[keyof V] -// > { -// const ty = AlgebraicType.createSumType( -// Object.entries(variants).map( -// ([n, c]) => new SumTypeVariant(n, c.__spacetime_type__) -// ) -// ); -// type JS = { [K in keyof V]: { tag: K; value: Infer } }[keyof V]; -// return col(ty); -// }, - -// /* ───── scheduling helper ───── */ -// scheduleAt() { -// /* we model it as a 64‑bit timestamp for now */ -// const b = col(AlgebraicType.createI64Type()); -// b.interval = (isoLike: string) => { -// b.__meta__.scheduleAt = isoLike; // remember interval -// return b; -// }; -// return b as ColumnBuilder & { -// /** chainable convenience to attach the run‑time interval */ -// interval: (isoLike: string) => typeof b; -// }; -// }, - -// /* ───── generic index‑builder to be used in table options ───── */ -// index(opts?: { -// name?: IdxName; -// }): { -// btree(def: { -// columns: Cols; -// }): PendingIndex<(typeof def.columns)[number]>; -// hash(def: { -// columns: Cols; -// }): PendingIndex<(typeof def.columns)[number]>; -// direct(def: { column: Col }): PendingIndex; -// } { -// const common = { name: opts?.name }; -// return { -// btree(def: { columns: Cols }) { -// return { -// ...common, -// algorithm: { -// tag: 'btree', -// value: { columns: def.columns }, -// }, -// } as PendingIndex<(typeof def.columns)[number]>; -// }, -// hash(def: { columns: Cols }) { -// return { -// ...common, -// algorithm: { -// tag: 'hash', -// value: { columns: def.columns }, -// }, -// } as PendingIndex<(typeof def.columns)[number]>; -// }, -// direct(def: { column: Col }) { -// return { -// ...common, -// algorithm: { -// tag: 'direct', -// value: { column: def.column }, -// }, -// } as PendingIndex; -// }, -// }; -// }, -// } as const; - -// /***************************************************************** -// * Type helpers -// *****************************************************************/ -// interface ProductTypeBrand { -// readonly __is_product_type__: true; -// } - -// export type ProductTypeColumnBuilder< -// Def extends Record>, -// > = ColumnBuilder<{ [K in keyof Def]: ColumnType }> & -// ProductTypeBrand & { __def__: Def }; - -// type ColumnType = C extends ColumnBuilder ? JS : never; -// export type Infer = S extends ColumnBuilder ? JS : never; - -// /***************************************************************** -// * Index helper type used *inside* table() to enforce that only -// * existing column names are referenced. -// *****************************************************************/ -// type PendingIndex = { -// name?: string; -// accessor_name?: string; -// algorithm: -// | { tag: 'btree'; value: { columns: readonly AllowedCol[] } } -// | { tag: 'hash'; value: { columns: readonly AllowedCol[] } } -// | { tag: 'direct'; value: { column: AllowedCol } }; -// }; - -// /***************************************************************** -// * table() -// *****************************************************************/ -// type TableOpts< -// N extends string, -// Def extends Record>, -// Idx extends PendingIndex[] | undefined = undefined, -// > = { -// name: N; -// public?: boolean; -// indexes?: Idx; // declarative multi‑column indexes -// scheduled?: string; // reducer name for cron‑like tables -// }; - -// /** Opaque handle that `table()` returns, carrying row & type info for `schema()` */ -// type TableHandle = { -// readonly __table_name__: string; -// /** algebraic type for the *row* product type */ -// readonly __row_spacetime_type__: AlgebraicType; -// /** phantom only: row JS shape */ -// readonly __row_js__?: Row; -// }; - -// /** Infer the JS row type from a TableHandle */ -// type RowOf = H extends TableHandle ? R : never; - -// export function table< -// Name extends string, -// Def extends Record>, -// Row extends ProductTypeColumnBuilder, -// Idx extends PendingIndex[] | undefined = undefined, -// >( -// opts: TableOpts, -// row: Row -// ): TableHandle> { -// const { -// name, -// public: isPublic = false, -// indexes: userIndexes = [], -// scheduled, -// } = opts; - -// /** 1. column catalogue + helpers */ -// const def = row.__def__; -// const colIds = new Map(); -// const colIdList: ColList = []; - -// let nextCol: number = 0; -// for (const colName of Object.keys(def) as (keyof Def & string)[]) { -// colIds.set(colName, nextCol++); -// colIdList.push(colIds.get(colName)!); -// } - -// /** 2. gather primary keys, per‑column indexes, uniques, sequences */ -// const pk: ColList = []; -// const indexes: RawIndexDefV9[] = []; -// const constraints: RawConstraintDefV9[] = []; -// const sequences: RawSequenceDefV9[] = []; - -// let scheduleAtCol: ColId | undefined; - -// for (const [name, builder] of Object.entries(def) as [ -// keyof Def & string, -// ColumnBuilder, -// ][]) { -// const meta: any = builder.__meta__; - -// /* primary key */ -// if (meta.primaryKey) pk.push(colIds.get(name)!); - -// /* implicit 1‑column indexes */ -// if (meta.index) { -// const algo = (meta.index ?? 'btree') as 'btree' | 'hash' | 'direct'; -// const id = colIds.get(name)!; -// indexes.push( -// algo === 'direct' -// ? { algorithm: { tag: 'direct', value: { column: id } } } -// : { algorithm: { tag: algo, value: { columns: [id] } } } -// ); -// } - -// /* uniqueness */ -// if (meta.unique) { -// constraints.push({ -// data: { tag: 'unique', value: { columns: [colIds.get(name)!] } }, -// }); -// } - -// /* auto increment */ -// if (meta.autoInc) { -// sequences.push({ -// column: colIds.get(name)!, -// increment: 1, -// }); -// } - -// /* scheduleAt */ -// if (meta.scheduleAt) scheduleAtCol = colIds.get(name)!; -// } - -// /** 3. convert explicit multi‑column indexes coming from options.indexes */ -// for (const pending of (userIndexes ?? []) as PendingIndex< -// keyof Def & string -// >[]) { -// const converted: RawIndexDefV9 = { -// name: pending.name, -// accessor_name: pending.accessor_name, -// algorithm: ((): RawIndexAlgorithm => { -// if (pending.algorithm.tag === 'direct') -// return { -// tag: 'direct', -// value: { column: colIds.get(pending.algorithm.value.column)! }, -// }; -// return { -// tag: pending.algorithm.tag, -// value: { -// columns: pending.algorithm.value.columns.map(c => colIds.get(c)!), -// }, -// }; -// })(), -// }; -// indexes.push(converted); -// } - -// /** 4. add the product type to the global Typespace */ -// const productTypeRef: AlgebraicTypeRef = MODULE_DEF.typespace.types.length; -// MODULE_DEF.typespace.types.push(row.__spacetime_type__); - -// /** 5. finalise table record */ -// MODULE_DEF.tables.push({ -// name, -// productTypeRef, -// primaryKey: pk, -// indexes, -// constraints, -// sequences, -// schedule: -// scheduled && scheduleAtCol !== undefined -// ? { -// reducerName: scheduled, -// scheduledAtColumn: scheduleAtCol, -// } -// : undefined, -// tableType: 'user', -// tableAccess: isPublic ? 'public' : 'private', -// }); - -// // NEW: return a typed handle for schema() -// return { -// __table_name__: name, -// __row_spacetime_type__: row.__spacetime_type__, -// } as TableHandle>; -// } - -// /** schema() – consume a record of TableHandles and return a ColumnBuilder -// * whose JS type is a map of table -> row shape. -// */ -// export function schema< -// Def extends Record> -// >(def: Def) { -// // Build a Spacetime product type keyed by table name -> row algebraic type -// const productTy = AlgebraicType.createProductType( -// Object.entries(def).map( -// ([name, handle]) => -// new ProductTypeElement(name, (handle as TableHandle).__row_spacetime_type__) -// ) -// ); - -// // The JS-level type: { [table]: RowOf } -// type JS = { [K in keyof Def]: RowOf }; - -// // Return a regular ColumnBuilder so you can `Infer` cleanly -// return col(productTy); -// } - -// /***************************************************************** -// * reducer() -// *****************************************************************/ -// type ParamsAsObject>> = { -// [K in keyof ParamDef]: Infer; -// }; - -// /***************************************************************** -// * procedure() -// * -// * Stored procedures are opaque to the DB engine itself, so we just -// * keep them out of `RawModuleDefV9` for now – you can forward‑declare -// * a companion `RawMiscModuleExportV9` type later if desired. -// *****************************************************************/ -// export function procedure< -// Name extends string, -// Params extends Record>, -// Ctx, -// R, -// >( -// _name: Name, -// _params: Params, -// _fn: (ctx: Ctx, payload: ParamsAsObject) => Promise | R -// ): void { -// /* nothing to push yet — left for your misc export section */ -// } - -// /***************************************************************** -// * internal: pushReducer() helper used by reducer() and lifecycle wrappers -// *****************************************************************/ -// function pushReducer< -// S, -// Name extends string = string, -// Params extends Record> = Record> -// >( -// name: Name, -// params: Params | ProductTypeColumnBuilder, -// lifecycle?: RawReducerDefV9['lifecycle'] -// ): void { -// // Allow either a product-type ColumnBuilder or a plain params object -// const paramsInternal: Params = -// (params as any).__is_product_type__ === true -// ? (params as ProductTypeColumnBuilder).__def__ -// : (params as Params); - -// const paramType = new ProductType( -// Object.entries(paramsInternal).map( -// ([n, c]) => new ProductTypeElement(n, (c as ColumnBuilder).__spacetime_type__) -// ) -// ); - -// MODULE_DEF.reducers.push({ -// name, -// params: paramType, -// lifecycle, // <- lifecycle flag lands here -// }); -// } - -// /***************************************************************** -// * reducer() – leave behavior the same; delegate to pushReducer() -// *****************************************************************/ -// /** DB API you want inside reducers */ -// type TableApi = { -// insert: (row: Row) => void | Promise; -// // You can add more later: get, update, delete, where, etc. -// }; - -// /** Reducer context parametrized by the inferred Schema */ -// export type ReducerCtx = { -// db: { [K in keyof S & string]: TableApi }; -// }; - -// // no schema provided -> ctx.db is permissive -// export function reducer< -// Name extends string = string, -// Params extends Record> = Record>, -// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void -// >( -// name: Name, -// params: Params | ProductTypeColumnBuilder, -// fn: F -// ): F; - -// // schema provided -> ctx.db is precise -// export function reducer< -// S, -// Name extends string = string, -// Params extends Record> = Record>, -// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void -// >( -// name: Name, -// params: Params | ProductTypeColumnBuilder, -// fn: F -// ): F; - -// // single implementation (S defaults to any -> JS-like) -// export function reducer< -// S = any, -// Name extends string = string, -// Params extends Record> = Record>, -// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void -// >( -// name: Name, -// params: Params | ProductTypeColumnBuilder, -// fn: F -// ): F { -// pushReducer(name, params); -// return fn; -// } - -// /***************************************************************** -// * Lifecycle reducers -// * - register with lifecycle: 'init' | 'on_connect' | 'on_disconnect' -// * - keep the same call shape you’re already using -// *****************************************************************/ -// export function init< -// S = unknown, -// Params extends Record> = {}, -// >( -// name: 'init' = 'init', -// params: Params | ProductTypeColumnBuilder = {} as any, -// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void -// ): void { -// pushReducer(name, params, 'init'); -// } - -// export function clientConnected< -// S = unknown, -// Params extends Record> = {}, -// >( -// name: 'on_connect' = 'on_connect', -// params: Params | ProductTypeColumnBuilder = {} as any, -// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void -// ): void { -// pushReducer(name, params, 'on_connect'); -// } - -// export function clientDisconnected< -// S = unknown, -// Params extends Record> = {}, -// >( -// name: 'on_disconnect' = 'on_disconnect', -// params: Params | ProductTypeColumnBuilder = {} as any, -// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void -// ): void { -// pushReducer(name, params, 'on_disconnect'); -// } - -// /***************************************************************** -// * Example usage -// *****************************************************************/ - -// export const point = t.object({ -// x: t.f64(), -// y: t.f64(), -// }); -// type Point = Infer; - -// export const user = t.object({ -// id: t.string().primary_key(), -// name: t.string().index('btree'), -// email: t.string(), -// age: t.number(), -// }); -// type User = Infer; - -// export const player = t.object({ -// id: t.u32().primary_key().auto_inc(), -// name: t.string().index('btree'), -// score: t.number(), -// level: t.number(), -// foo: t.number().unique(), -// bar: t.object({ -// x: t.f64(), -// y: t.f64(), -// }), -// baz: t.enum({ -// Foo: t.f64(), -// Bar: t.f64(), -// Baz: t.string(), -// }), -// }); - -// export const sendMessageSchedule = t.object({ -// scheduleId: t.u64().primary_key(), -// scheduledAt: t.scheduleAt().interval('1h'), -// text: t.string(), -// }); - -// const s = schema({ -// user: table({ name: 'user' }, user), -// logged_out_user: table({ name: 'logged_out_user' }, user), -// player: table( -// { -// name: 'player', -// public: true, -// indexes: [ -// t.index({ name: 'my_index' }).btree({ columns: ['name', 'score'] }), -// ], -// }, -// player -// ), -// send_message_schedule: table( -// { -// name: 'send_message_schedule', -// scheduled: sendMessage, -// }, -// sendMessageSchedule -// ) -// }); - -// export type Schema = Infer; - -// export const func = () => { -// return "asdf"; -// } \ No newline at end of file From 7a3b830053f6bdb32ef108ccf7419ce4556b158d Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 19 Aug 2025 19:56:32 -0400 Subject: [PATCH 07/37] codegen formatting --- .../examples/regen-typescript-moduledef.rs | 25 ++++++++----------- crates/codegen/src/typescript.rs | 22 ++++++++++------ 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/crates/codegen/examples/regen-typescript-moduledef.rs b/crates/codegen/examples/regen-typescript-moduledef.rs index df7ec16f71d..f71c3e01297 100644 --- a/crates/codegen/examples/regen-typescript-moduledef.rs +++ b/crates/codegen/examples/regen-typescript-moduledef.rs @@ -32,19 +32,16 @@ fn main() -> anyhow::Result<()> { fs::create_dir(dir)?; let module: ModuleDef = module.try_into()?; - generate( - &module, - &typescript::TypeScript, - ) - .into_iter() - .try_for_each(|(filename, code)| { - // Skip the index.ts since we don't need it. - if filename == "index.ts" { - return Ok(()); - } - let code = regex_replace!(&code, r"@clockworklabs/spacetimedb-sdk", "../index"); - fs::write(dir.join(filename), code.as_bytes()) - })?; + generate(&module, &typescript::TypeScript) + .into_iter() + .try_for_each(|(filename, code)| { + // Skip the index.ts since we don't need it. + if filename == "index.ts" { + return Ok(()); + } + let code = regex_replace!(&code, r"@clockworklabs/spacetimedb-sdk", "../index"); + fs::write(dir.join(filename), code.as_bytes()) + })?; Ok(()) -} \ No newline at end of file +} diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index 118a4f97f42..1928f3457c7 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -708,7 +708,7 @@ fn define_namespace_and_object_type_for_product( out.with_indent(|out| write_arglist_no_delimiters(module, out, elements, None, true).unwrap()); writeln!(out, "}};"); } - + writeln!(out, "export default {name};"); out.newline(); @@ -729,14 +729,20 @@ fn define_namespace_and_object_type_for_product( "export function serialize(writer: BinaryWriter, value: {name}): void {{" ); out.indent(1); - writeln!(out, "AlgebraicType.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value);"); + writeln!( + out, + "AlgebraicType.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value);" + ); out.dedent(1); writeln!(out, "}}"); writeln!(out); writeln!(out, "export function deserialize(reader: BinaryReader): {name} {{"); out.indent(1); - writeln!(out, "return AlgebraicType.deserializeValue(reader, {name}.getTypeScriptAlgebraicType());"); + writeln!( + out, + "return AlgebraicType.deserializeValue(reader, {name}.getTypeScriptAlgebraicType());" + ); out.dedent(1); writeln!(out, "}}"); writeln!(out); @@ -832,7 +838,10 @@ fn write_variant_constructors( // ``` // export const Foo: { tag: "Foo" } = { tag: "Foo" }; // ``` - write!(out, "export const {ident}: {{ tag: \"{ident}\" }} = {{ tag: \"{ident}\" }};"); + write!( + out, + "export const {ident}: {{ tag: \"{ident}\" }} = {{ tag: \"{ident}\" }};" + ); writeln!(out); continue; } @@ -864,7 +873,6 @@ fn define_namespace_and_types_for_sum( mut name: &str, variants: &[(Identifier, AlgebraicTypeUse)], ) { - // For the purpose of bootstrapping AlgebraicType, if the name of the type // is `AlgebraicType`, we need to use an alias. if name == "AlgebraicType" { @@ -912,7 +920,7 @@ fn define_namespace_and_types_for_sum( writeln!( out, - "export function serialize(writer: BinaryWriter, value: {name}): void {{ + "export function serialize(writer: BinaryWriter, value: {name}): void {{ AlgebraicType.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value); }}" ); @@ -920,7 +928,7 @@ fn define_namespace_and_types_for_sum( writeln!( out, - "export function deserialize(reader: BinaryReader): {name} {{ + "export function deserialize(reader: BinaryReader): {name} {{ return AlgebraicType.deserializeValue(reader, {name}.getTypeScriptAlgebraicType()); }}" ); From e0482e0b2a9af5c2f44a08f51b4880ec26529811 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 19 Aug 2025 21:19:35 -0400 Subject: [PATCH 08/37] Prettier formatting for the bindings repo --- .../.prettierignore => .prettierignore | 0 sdks/typescript/.prettierrc => .prettierrc | 0 crates/bindings-typescript/package.json | 22 +- .../bindings-typescript/src/algebraic_type.ts | 305 +++++++++++------- .../src/autogen/algebraic_type_type.ts | 223 ++++++++----- .../src/autogen/index_type_type.ts | 38 ++- .../src/autogen/lifecycle_type.ts | 51 +-- .../src/autogen/misc_module_export_type.ts | 36 ++- .../src/autogen/product_type_element_type.ts | 45 ++- .../src/autogen/product_type_type.ts | 35 +- .../src/autogen/raw_column_def_v_8_type.ts | 37 ++- .../autogen/raw_constraint_data_v_9_type.ts | 36 ++- .../autogen/raw_constraint_def_v_8_type.ts | 44 ++- .../autogen/raw_constraint_def_v_9_type.ts | 45 ++- .../src/autogen/raw_index_algorithm_type.ts | 59 ++-- .../src/autogen/raw_index_def_v_8_type.ts | 48 +-- .../src/autogen/raw_index_def_v_9_type.ts | 47 ++- .../raw_misc_module_export_v_9_type.ts | 26 +- .../src/autogen/raw_module_def_type.ts | 50 ++- .../src/autogen/raw_module_def_v_8_type.ts | 66 ++-- .../src/autogen/raw_module_def_v_9_type.ts | 88 +++-- .../src/autogen/raw_reducer_def_v_9_type.ts | 53 +-- .../raw_row_level_security_def_v_9_type.ts | 33 +- .../src/autogen/raw_schedule_def_v_9_type.ts | 44 ++- .../autogen/raw_scoped_type_name_v_9_type.ts | 40 ++- .../src/autogen/raw_sequence_def_v_8_type.ts | 66 ++-- .../src/autogen/raw_sequence_def_v_9_type.ts | 65 ++-- .../src/autogen/raw_table_def_v_8_type.ts | 87 +++-- .../src/autogen/raw_table_def_v_9_type.ts | 101 ++++-- .../src/autogen/raw_type_def_v_9_type.ts | 41 ++- .../raw_unique_constraint_data_v_9_type.ts | 36 ++- .../src/autogen/reducer_def_type.ts | 39 ++- .../src/autogen/sum_type_type.ts | 35 +- .../src/autogen/sum_type_variant_type.ts | 40 ++- .../src/autogen/table_access_type.ts | 40 ++- .../src/autogen/table_desc_type.ts | 37 ++- .../src/autogen/table_type_type.ts | 38 ++- .../src/autogen/type_alias_type.ts | 32 +- .../src/autogen/typespace_type.ts | 35 +- crates/bindings-typescript/src/index.ts | 1 - crates/bindings-typescript/src/schedule_at.ts | 2 +- pnpm-lock.yaml | 3 + 42 files changed, 1378 insertions(+), 791 deletions(-) rename sdks/typescript/.prettierignore => .prettierignore (100%) rename sdks/typescript/.prettierrc => .prettierrc (100%) diff --git a/sdks/typescript/.prettierignore b/.prettierignore similarity index 100% rename from sdks/typescript/.prettierignore rename to .prettierignore diff --git a/sdks/typescript/.prettierrc b/.prettierrc similarity index 100% rename from sdks/typescript/.prettierrc rename to .prettierrc diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index 3dc80caa9e1..ab33b74f419 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -3,12 +3,12 @@ "version": "0.0.1", "description": "API and ABI bindings for the SpacetimeDB TypeScript module library", "homepage": "https://github.com/clockworklabs/SpacetimeDB#readme", - "bugs": { "url": "https://github.com/clockworklabs/SpacetimeDB/issues" }, - + "bugs": { + "url": "https://github.com/clockworklabs/SpacetimeDB/issues" + }, "source": "src/index.ts", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "src/index.ts", "exports": { ".": { @@ -18,9 +18,12 @@ "require": "./dist/index.cjs" } }, - - "files": ["src", "dist", "README.md", "LICENSE.txt"], - + "files": [ + "src", + "dist", + "README.md", + "LICENSE.txt" + ], "repository": { "type": "git", "url": "git+https://github.com/clockworklabs/SpacetimeDB.git" @@ -30,10 +33,13 @@ "type": "module", "scripts": { "build": "tsc -p tsconfig.build.json", - "prepack": "pnpm run build" + "prepack": "pnpm run build", + "format": "prettier --write .", + "lint": "prettier . --check --verbose" }, "dependencies": { "@zxing/text-encoding": "^0.9.0", - "base64-js": "^1.5.1" + "base64-js": "^1.5.1", + "prettier": "^3.3.3" } } diff --git a/crates/bindings-typescript/src/algebraic_type.ts b/crates/bindings-typescript/src/algebraic_type.ts index f79bf04eb97..3b69ea617d6 100644 --- a/crates/bindings-typescript/src/algebraic_type.ts +++ b/crates/bindings-typescript/src/algebraic_type.ts @@ -5,7 +5,10 @@ import type BinaryReader from './binary_reader'; import BinaryWriter from './binary_writer'; import { Identity } from './identity'; import ScheduleAt from './schedule_at'; -import { __AlgebraicType, type __AlgebraicType as __AlgebraicTypeType } from './autogen/algebraic_type_type'; +import { + __AlgebraicType, + type __AlgebraicType as __AlgebraicTypeType, +} from './autogen/algebraic_type_type'; import { ProductType } from './autogen/product_type_type'; import { SumType } from './autogen/sum_type_type'; @@ -29,7 +32,7 @@ export * from './autogen/product_type_element_type'; export * from './autogen/sum_type_variant_type'; export { type __AlgebraicTypeVariants as AlgebraicTypeVariants } from './autogen/algebraic_type_type'; -declare module "./autogen/product_type_type" { +declare module './autogen/product_type_type' { /** * A structural product type of the factors given by `elements`. * @@ -56,20 +59,41 @@ declare module "./autogen/product_type_type" { * [structural]: https://en.wikipedia.org/wiki/Structural_type_system */ export namespace ProductType { - export function serializeValue(writer: BinaryWriter, ty: ProductType, value: any): void; - export function deserializeValue(reader: BinaryReader, ty: ProductType): any; + export function serializeValue( + writer: BinaryWriter, + ty: ProductType, + value: any + ): void; + export function deserializeValue( + reader: BinaryReader, + ty: ProductType + ): any; - export function intoMapKey(ty: ProductType, value: any): ComparablePrimitive; + export function intoMapKey( + ty: ProductType, + value: any + ): ComparablePrimitive; } } -ProductType.serializeValue = function (writer: BinaryWriter, ty: ProductType, value: any): void { +ProductType.serializeValue = function ( + writer: BinaryWriter, + ty: ProductType, + value: any +): void { for (let element of ty.elements) { - __AlgebraicType.serializeValue(writer, element.algebraicType, value[element.name!]); + __AlgebraicType.serializeValue( + writer, + element.algebraicType, + value[element.name!] + ); } -} +}; -ProductType.deserializeValue = function (reader: BinaryReader, ty: ProductType): { [key: string]: any } { +ProductType.deserializeValue = function ( + reader: BinaryReader, + ty: ProductType +): { [key: string]: any } { let result: { [key: string]: any } = {}; if (ty.elements.length === 1) { if (ty.elements[0].name === '__time_duration_micros__') { @@ -90,14 +114,20 @@ ProductType.deserializeValue = function (reader: BinaryReader, ty: ProductType): } for (let element of ty.elements) { - result[element.name!] = __AlgebraicType.deserializeValue(reader, element.algebraicType); + result[element.name!] = __AlgebraicType.deserializeValue( + reader, + element.algebraicType + ); } return result; -} +}; export { ProductType }; -ProductType.intoMapKey = function (ty: ProductType, value: any): ComparablePrimitive { +ProductType.intoMapKey = function ( + ty: ProductType, + value: any +): ComparablePrimitive { if (ty.elements.length === 1) { if (ty.elements[0].name === '__time_duration_micros__') { return (value as TimeDuration).__time_duration_micros__; @@ -119,9 +149,9 @@ ProductType.intoMapKey = function (ty: ProductType, value: any): ComparablePrimi const writer = new BinaryWriter(10); AlgebraicType.serializeValue(writer, AlgebraicType.Product(ty), value); return writer.toBase64(); -} +}; -declare module "./autogen/sum_type_type" { +declare module './autogen/sum_type_type' { /** * Unlike most languages, sums in SATS are *[structural]* and not nominal. * When checking whether two nominal types are the same, @@ -147,12 +177,20 @@ declare module "./autogen/sum_type_type" { * [structural]: https://en.wikipedia.org/wiki/Structural_type_system */ export namespace SumType { - export function serializeValue(writer: BinaryWriter, ty: SumType, value: any): void; + export function serializeValue( + writer: BinaryWriter, + ty: SumType, + value: any + ): void; export function deserializeValue(reader: BinaryReader, ty: SumType): any; } } -SumType.serializeValue = function (writer: BinaryWriter, ty: SumType, value: any): void { +SumType.serializeValue = function ( + writer: BinaryWriter, + ty: SumType, + value: any +): void { if ( ty.variants.length == 2 && ty.variants[0].name === 'some' && @@ -160,7 +198,11 @@ SumType.serializeValue = function (writer: BinaryWriter, ty: SumType, value: any ) { if (value !== null && value !== undefined) { writer.writeByte(0); - __AlgebraicType.serializeValue(writer, ty.variants[0].algebraicType, value); + __AlgebraicType.serializeValue( + writer, + ty.variants[0].algebraicType, + value + ); } else { writer.writeByte(1); } @@ -171,9 +213,13 @@ SumType.serializeValue = function (writer: BinaryWriter, ty: SumType, value: any throw `Can't serialize a sum type, couldn't find ${value.tag} tag`; } writer.writeU8(index); - __AlgebraicType.serializeValue(writer, ty.variants[index].algebraicType, value['value']); + __AlgebraicType.serializeValue( + writer, + ty.variants[index].algebraicType, + value['value'] + ); } -} +}; SumType.deserializeValue = function (reader: BinaryReader, ty: SumType): any { let tag = reader.readU8(); @@ -186,7 +232,10 @@ SumType.deserializeValue = function (reader: BinaryReader, ty: SumType): any { ty.variants[1].name === 'none' ) { if (tag === 0) { - return __AlgebraicType.deserializeValue(reader, ty.variants[0].algebraicType); + return __AlgebraicType.deserializeValue( + reader, + ty.variants[0].algebraicType + ); } else if (tag === 1) { return undefined; } else { @@ -197,11 +246,11 @@ SumType.deserializeValue = function (reader: BinaryReader, ty: SumType): any { let value = __AlgebraicType.deserializeValue(reader, variant.algebraicType); return { tag: variant.name, value }; } -} +}; export { SumType }; -declare module "./autogen/algebraic_type_type" { +declare module './autogen/algebraic_type_type' { /** * The SpacetimeDB Algebraic Type System (SATS) is a structural type system in * which a nominal type system can be constructed. @@ -210,14 +259,23 @@ declare module "./autogen/algebraic_type_type" { * primitive types into a single type system. */ export namespace __AlgebraicType { - export function createOptionType(innerType: __AlgebraicType): __AlgebraicType; + export function createOptionType( + innerType: __AlgebraicType + ): __AlgebraicType; export function createIdentityType(): __AlgebraicType; export function createConnectionIdType(): __AlgebraicType; export function createScheduleAtType(): __AlgebraicType; export function createTimestampType(): __AlgebraicType; export function createTimeDurationType(): __AlgebraicType; - export function serializeValue(writer: BinaryWriter, ty: __AlgebraicType, value: any): void; - export function deserializeValue(reader: BinaryReader, ty: __AlgebraicType): any; + export function serializeValue( + writer: BinaryWriter, + ty: __AlgebraicType, + value: any + ): void; + export function deserializeValue( + reader: BinaryReader, + ty: __AlgebraicType + ): any; /** * Convert a value of the algebraic type into something that can be used as a key in a map. @@ -226,57 +284,78 @@ declare module "./autogen/algebraic_type_type" { * @param value A value of the algebraic type * @returns Something that can be used as a key in a map. */ - export function intoMapKey(ty: __AlgebraicType, value: any): ComparablePrimitive; + export function intoMapKey( + ty: __AlgebraicType, + value: any + ): ComparablePrimitive; } } -__AlgebraicType.createOptionType = function (innerType: __AlgebraicType): __AlgebraicType { +__AlgebraicType.createOptionType = function ( + innerType: __AlgebraicType +): __AlgebraicType { return __AlgebraicType.Sum({ variants: [ - { name: "some", algebraicType: innerType }, - { name: "none", algebraicType: __AlgebraicType.Product({ elements: [] }) } - ] + { name: 'some', algebraicType: innerType }, + { + name: 'none', + algebraicType: __AlgebraicType.Product({ elements: [] }), + }, + ], }); -} +}; __AlgebraicType.createIdentityType = function (): __AlgebraicType { - return __AlgebraicType.Product({ elements: [ - { name: "__identity__", algebraicType: __AlgebraicType.U256 } - ]}) -} + return __AlgebraicType.Product({ + elements: [{ name: '__identity__', algebraicType: __AlgebraicType.U256 }], + }); +}; __AlgebraicType.createConnectionIdType = function (): __AlgebraicType { - return __AlgebraicType.Product({ elements: [ - { name: "__connection_id__", algebraicType: __AlgebraicType.U128 } - ]}); -} + return __AlgebraicType.Product({ + elements: [ + { name: '__connection_id__', algebraicType: __AlgebraicType.U128 }, + ], + }); +}; __AlgebraicType.createScheduleAtType = function (): __AlgebraicType { return ScheduleAt.getAlgebraicType(); -} +}; __AlgebraicType.createTimestampType = function (): __AlgebraicType { - return __AlgebraicType.Product({ elements: [ - { name: "__timestamp_micros_since_unix_epoch__", algebraicType: __AlgebraicType.I64 } - ]}); -} + return __AlgebraicType.Product({ + elements: [ + { + name: '__timestamp_micros_since_unix_epoch__', + algebraicType: __AlgebraicType.I64, + }, + ], + }); +}; __AlgebraicType.createTimeDurationType = function (): __AlgebraicType { - return __AlgebraicType.Product({ elements: [ - { name: "__time_duration_micros__", algebraicType: __AlgebraicType.I64 } - ]}); -} + return __AlgebraicType.Product({ + elements: [ + { name: '__time_duration_micros__', algebraicType: __AlgebraicType.I64 }, + ], + }); +}; -__AlgebraicType.serializeValue = function (writer: BinaryWriter, ty: __AlgebraicType, value: any): void { +__AlgebraicType.serializeValue = function ( + writer: BinaryWriter, + ty: __AlgebraicType, + value: any +): void { switch (ty.tag) { - case "Product": + case 'Product': ProductType.serializeValue(writer, ty.value, value); break; - case "Sum": + case 'Sum': SumType.serializeValue(writer, ty.value, value); break; - case "Array": - if (ty.value.tag === "U8") { + case 'Array': + if (ty.value.tag === 'U8') { writer.writeUInt8Array(value); } else { const elemType = ty.value; @@ -286,67 +365,70 @@ __AlgebraicType.serializeValue = function (writer: BinaryWriter, ty: __Algebraic } } break; - case "Bool": + case 'Bool': writer.writeBool(value); break; - case "I8": + case 'I8': writer.writeI8(value); break; - case "U8": + case 'U8': writer.writeU8(value); break; - case "I16": + case 'I16': writer.writeI16(value); break; - case "U16": + case 'U16': writer.writeU16(value); break; - case "I32": + case 'I32': writer.writeI32(value); break; - case "U32": + case 'U32': writer.writeU32(value); break; - case "I64": + case 'I64': writer.writeI64(value); break; - case "U64": + case 'U64': writer.writeU64(value); break; - case "I128": + case 'I128': writer.writeI128(value); break; - case "U128": + case 'U128': writer.writeU128(value); break; - case "I256": + case 'I256': writer.writeI256(value); break; - case "U256": + case 'U256': writer.writeU256(value); break; - case "F32": + case 'F32': writer.writeF32(value); break; - case "F64": + case 'F64': writer.writeF64(value); break; - case "String": + case 'String': writer.writeString(value); break; default: throw new Error(`not implemented, ${ty.tag}`); } -} +}; -__AlgebraicType.deserializeValue = function (reader: BinaryReader, ty: __AlgebraicType): any { +__AlgebraicType.deserializeValue = function ( + reader: BinaryReader, + ty: __AlgebraicType +): any { switch (ty.tag) { - case "Product": + case 'Product': return ProductType.deserializeValue(reader, ty.value); - case "Sum": + case 'Sum': return SumType.deserializeValue(reader, ty.value); - case "Array": - if (ty.value.tag === "U8") { + case 'Array': + if (ty.value.tag === 'U8') { return reader.readUInt8Array(); } else { const elemType = ty.value; @@ -357,42 +439,42 @@ __AlgebraicType.deserializeValue = function (reader: BinaryReader, ty: __Algebra } return result; } - case "Bool": + case 'Bool': return reader.readBool(); - case "I8": + case 'I8': return reader.readI8(); - case "U8": + case 'U8': return reader.readU8(); - case "I16": + case 'I16': return reader.readI16(); - case "U16": + case 'U16': return reader.readU16(); - case "I32": + case 'I32': return reader.readI32(); - case "U32": + case 'U32': return reader.readU32(); - case "I64": + case 'I64': return reader.readI64(); - case "U64": + case 'U64': return reader.readU64(); - case "I128": + case 'I128': return reader.readI128(); - case "U128": + case 'U128': return reader.readU128(); - case "I256": + case 'I256': return reader.readI256(); - case "U256": + case 'U256': return reader.readU256(); - case "F32": + case 'F32': return reader.readF32(); - case "F64": + case 'F64': return reader.readF64(); - case "String": + case 'String': return reader.readString(); default: throw new Error(`not implemented, ${ty.tag}`); } -} +}; /** * Convert a value of the algebraic type into something that can be used as a key in a map. @@ -401,32 +483,35 @@ __AlgebraicType.deserializeValue = function (reader: BinaryReader, ty: __Algebra * @param value A value of the algebraic type * @returns Something that can be used as a key in a map. */ -__AlgebraicType.intoMapKey = function (ty: __AlgebraicType, value: any): ComparablePrimitive { +__AlgebraicType.intoMapKey = function ( + ty: __AlgebraicType, + value: any +): ComparablePrimitive { switch (ty.tag) { - case "U8": - case "U16": - case "U32": - case "U64": - case "U128": - case "U256": - case "I8": - case "I16": - case "I64": - case "I128": - case "F32": - case "F64": - case "String": - case "Bool": + case 'U8': + case 'U16': + case 'U32': + case 'U64': + case 'U128': + case 'U256': + case 'I8': + case 'I16': + case 'I64': + case 'I128': + case 'F32': + case 'F64': + case 'String': + case 'Bool': return value; - case "Product": + case 'Product': return ProductType.intoMapKey(ty.value, value); default: const writer = new BinaryWriter(10); this.serialize(writer, value); return writer.toBase64(); } -} +}; export type AlgebraicType = __AlgebraicTypeType; export const AlgebraicType: typeof __AlgebraicType = __AlgebraicType; -export type ComparablePrimitive = number | string | String | boolean | bigint; \ No newline at end of file +export type ComparablePrimitive = number | string | String | boolean | bigint; diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts index f9d5ae5f975..f5de17be634 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts @@ -31,9 +31,9 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { SumType as __SumType } from "./sum_type_type"; -import { ProductType as __ProductType } from "./product_type_type"; +} from '../index'; +import { SumType as __SumType } from './sum_type_type'; +import { ProductType as __ProductType } from './product_type_type'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of @@ -43,26 +43,26 @@ import { ProductType as __ProductType } from "./product_type_type"; // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace __AlgebraicTypeVariants { - export type Ref = { tag: "Ref", value: number }; - export type Sum = { tag: "Sum", value: __SumType }; - export type Product = { tag: "Product", value: __ProductType }; - export type Array = { tag: "Array", value: __AlgebraicType }; - export type String = { tag: "String" }; - export type Bool = { tag: "Bool" }; - export type I8 = { tag: "I8" }; - export type U8 = { tag: "U8" }; - export type I16 = { tag: "I16" }; - export type U16 = { tag: "U16" }; - export type I32 = { tag: "I32" }; - export type U32 = { tag: "U32" }; - export type I64 = { tag: "I64" }; - export type U64 = { tag: "U64" }; - export type I128 = { tag: "I128" }; - export type U128 = { tag: "U128" }; - export type I256 = { tag: "I256" }; - export type U256 = { tag: "U256" }; - export type F32 = { tag: "F32" }; - export type F64 = { tag: "F64" }; + export type Ref = { tag: 'Ref'; value: number }; + export type Sum = { tag: 'Sum'; value: __SumType }; + export type Product = { tag: 'Product'; value: __ProductType }; + export type Array = { tag: 'Array'; value: __AlgebraicType }; + export type String = { tag: 'String' }; + export type Bool = { tag: 'Bool' }; + export type I8 = { tag: 'I8' }; + export type U8 = { tag: 'U8' }; + export type I16 = { tag: 'I16' }; + export type U16 = { tag: 'U16' }; + export type I32 = { tag: 'I32' }; + export type U32 = { tag: 'U32' }; + export type I64 = { tag: 'I64' }; + export type U64 = { tag: 'U64' }; + export type I128 = { tag: 'I128' }; + export type U128 = { tag: 'U128' }; + export type I256 = { tag: 'I256' }; + export type U256 = { tag: 'U256' }; + export type F32 = { tag: 'F32' }; + export type F64 = { tag: 'F64' }; } // A namespace for generated variants and helper functions. @@ -73,85 +73,130 @@ export namespace __AlgebraicType { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Ref = (value: number): __AlgebraicType => ({ tag: "Ref", value }); - export const Sum = (value: __SumType): __AlgebraicType => ({ tag: "Sum", value }); - export const Product = (value: __ProductType): __AlgebraicType => ({ tag: "Product", value }); - export const Array = (value: __AlgebraicType): __AlgebraicType => ({ tag: "Array", value }); - export const String: { tag: "String" } = { tag: "String" }; - export const Bool: { tag: "Bool" } = { tag: "Bool" }; - export const I8: { tag: "I8" } = { tag: "I8" }; - export const U8: { tag: "U8" } = { tag: "U8" }; - export const I16: { tag: "I16" } = { tag: "I16" }; - export const U16: { tag: "U16" } = { tag: "U16" }; - export const I32: { tag: "I32" } = { tag: "I32" }; - export const U32: { tag: "U32" } = { tag: "U32" }; - export const I64: { tag: "I64" } = { tag: "I64" }; - export const U64: { tag: "U64" } = { tag: "U64" }; - export const I128: { tag: "I128" } = { tag: "I128" }; - export const U128: { tag: "U128" } = { tag: "U128" }; - export const I256: { tag: "I256" } = { tag: "I256" }; - export const U256: { tag: "U256" } = { tag: "U256" }; - export const F32: { tag: "F32" } = { tag: "F32" }; - export const F64: { tag: "F64" } = { tag: "F64" }; + export const Ref = (value: number): __AlgebraicType => ({ + tag: 'Ref', + value, + }); + export const Sum = (value: __SumType): __AlgebraicType => ({ + tag: 'Sum', + value, + }); + export const Product = (value: __ProductType): __AlgebraicType => ({ + tag: 'Product', + value, + }); + export const Array = (value: __AlgebraicType): __AlgebraicType => ({ + tag: 'Array', + value, + }); + export const String: { tag: 'String' } = { tag: 'String' }; + export const Bool: { tag: 'Bool' } = { tag: 'Bool' }; + export const I8: { tag: 'I8' } = { tag: 'I8' }; + export const U8: { tag: 'U8' } = { tag: 'U8' }; + export const I16: { tag: 'I16' } = { tag: 'I16' }; + export const U16: { tag: 'U16' } = { tag: 'U16' }; + export const I32: { tag: 'I32' } = { tag: 'I32' }; + export const U32: { tag: 'U32' } = { tag: 'U32' }; + export const I64: { tag: 'I64' } = { tag: 'I64' }; + export const U64: { tag: 'U64' } = { tag: 'U64' }; + export const I128: { tag: 'I128' } = { tag: 'I128' }; + export const U128: { tag: 'U128' } = { tag: 'U128' }; + export const I256: { tag: 'I256' } = { tag: 'I256' }; + export const U256: { tag: 'U256' } = { tag: 'U256' }; + export const F32: { tag: 'F32' } = { tag: 'F32' }; + export const F64: { tag: 'F64' } = { tag: 'F64' }; export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "Ref", algebraicType: AlgebraicType.U32 }, - { name: "Sum", algebraicType: __SumType.getTypeScriptAlgebraicType() }, - { name: "Product", algebraicType: __ProductType.getTypeScriptAlgebraicType() }, - { name: "Array", algebraicType: __AlgebraicType.getTypeScriptAlgebraicType() }, - { name: "String", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "Bool", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "I8", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "U8", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "I16", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "U16", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "I32", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "U32", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "I64", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "U64", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "I128", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "U128", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "I256", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "U256", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "F32", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "F64", algebraicType: AlgebraicType.Product({ elements: [] }) }, - ] + { name: 'Ref', algebraicType: AlgebraicType.U32 }, + { name: 'Sum', algebraicType: __SumType.getTypeScriptAlgebraicType() }, + { + name: 'Product', + algebraicType: __ProductType.getTypeScriptAlgebraicType(), + }, + { + name: 'Array', + algebraicType: __AlgebraicType.getTypeScriptAlgebraicType(), + }, + { + name: 'String', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'Bool', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { name: 'I8', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: 'U8', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: 'I16', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: 'U16', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: 'I32', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: 'U32', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: 'I64', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: 'U64', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { + name: 'I128', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'U128', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'I256', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'U256', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { name: 'F32', algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: 'F64', algebraicType: AlgebraicType.Product({ elements: [] }) }, + ], }); } - export function serialize(writer: BinaryWriter, value: __AlgebraicType): void { - AlgebraicType.serializeValue(writer, __AlgebraicType.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: __AlgebraicType + ): void { + AlgebraicType.serializeValue( + writer, + __AlgebraicType.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): __AlgebraicType { - return AlgebraicType.deserializeValue(reader, __AlgebraicType.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + __AlgebraicType.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `__AlgebraicType`. -export type __AlgebraicType = __AlgebraicTypeVariants.Ref | - __AlgebraicTypeVariants.Sum | - __AlgebraicTypeVariants.Product | - __AlgebraicTypeVariants.Array | - __AlgebraicTypeVariants.String | - __AlgebraicTypeVariants.Bool | - __AlgebraicTypeVariants.I8 | - __AlgebraicTypeVariants.U8 | - __AlgebraicTypeVariants.I16 | - __AlgebraicTypeVariants.U16 | - __AlgebraicTypeVariants.I32 | - __AlgebraicTypeVariants.U32 | - __AlgebraicTypeVariants.I64 | - __AlgebraicTypeVariants.U64 | - __AlgebraicTypeVariants.I128 | - __AlgebraicTypeVariants.U128 | - __AlgebraicTypeVariants.I256 | - __AlgebraicTypeVariants.U256 | - __AlgebraicTypeVariants.F32 | - __AlgebraicTypeVariants.F64; +export type __AlgebraicType = + | __AlgebraicTypeVariants.Ref + | __AlgebraicTypeVariants.Sum + | __AlgebraicTypeVariants.Product + | __AlgebraicTypeVariants.Array + | __AlgebraicTypeVariants.String + | __AlgebraicTypeVariants.Bool + | __AlgebraicTypeVariants.I8 + | __AlgebraicTypeVariants.U8 + | __AlgebraicTypeVariants.I16 + | __AlgebraicTypeVariants.U16 + | __AlgebraicTypeVariants.I32 + | __AlgebraicTypeVariants.U32 + | __AlgebraicTypeVariants.I64 + | __AlgebraicTypeVariants.U64 + | __AlgebraicTypeVariants.I128 + | __AlgebraicTypeVariants.U128 + | __AlgebraicTypeVariants.I256 + | __AlgebraicTypeVariants.U256 + | __AlgebraicTypeVariants.F32 + | __AlgebraicTypeVariants.F64; export default __AlgebraicType; - diff --git a/crates/bindings-typescript/src/autogen/index_type_type.ts b/crates/bindings-typescript/src/autogen/index_type_type.ts index a06974c172c..6c443beee38 100644 --- a/crates/bindings-typescript/src/autogen/index_type_type.ts +++ b/crates/bindings-typescript/src/autogen/index_type_type.ts @@ -31,7 +31,7 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of // the tagged union. @@ -40,8 +40,8 @@ import { // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace IndexTypeVariants { - export type BTree = { tag: "BTree" }; - export type Hash = { tag: "Hash" }; + export type BTree = { tag: 'BTree' }; + export type Hash = { tag: 'Hash' }; } // A namespace for generated variants and helper functions. @@ -52,31 +52,41 @@ export namespace IndexType { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const BTree: { tag: "BTree" } = { tag: "BTree" }; - export const Hash: { tag: "Hash" } = { tag: "Hash" }; + export const BTree: { tag: 'BTree' } = { tag: 'BTree' }; + export const Hash: { tag: 'Hash' } = { tag: 'Hash' }; export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "BTree", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "Hash", algebraicType: AlgebraicType.Product({ elements: [] }) }, - ] + { + name: 'BTree', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'Hash', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + ], }); } export function serialize(writer: BinaryWriter, value: IndexType): void { - AlgebraicType.serializeValue(writer, IndexType.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + IndexType.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): IndexType { - return AlgebraicType.deserializeValue(reader, IndexType.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + IndexType.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `IndexType`. -export type IndexType = IndexTypeVariants.BTree | - IndexTypeVariants.Hash; +export type IndexType = IndexTypeVariants.BTree | IndexTypeVariants.Hash; export default IndexType; - diff --git a/crates/bindings-typescript/src/autogen/lifecycle_type.ts b/crates/bindings-typescript/src/autogen/lifecycle_type.ts index fcf1ff9372b..932ab87dffa 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_type.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_type.ts @@ -31,7 +31,7 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of // the tagged union. @@ -40,9 +40,9 @@ import { // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace LifecycleVariants { - export type Init = { tag: "Init" }; - export type OnConnect = { tag: "OnConnect" }; - export type OnDisconnect = { tag: "OnDisconnect" }; + export type Init = { tag: 'Init' }; + export type OnConnect = { tag: 'OnConnect' }; + export type OnDisconnect = { tag: 'OnDisconnect' }; } // A namespace for generated variants and helper functions. @@ -53,34 +53,49 @@ export namespace Lifecycle { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Init: { tag: "Init" } = { tag: "Init" }; - export const OnConnect: { tag: "OnConnect" } = { tag: "OnConnect" }; - export const OnDisconnect: { tag: "OnDisconnect" } = { tag: "OnDisconnect" }; + export const Init: { tag: 'Init' } = { tag: 'Init' }; + export const OnConnect: { tag: 'OnConnect' } = { tag: 'OnConnect' }; + export const OnDisconnect: { tag: 'OnDisconnect' } = { tag: 'OnDisconnect' }; export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "Init", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "OnConnect", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "OnDisconnect", algebraicType: AlgebraicType.Product({ elements: [] }) }, - ] + { + name: 'Init', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'OnConnect', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'OnDisconnect', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + ], }); } export function serialize(writer: BinaryWriter, value: Lifecycle): void { - AlgebraicType.serializeValue(writer, Lifecycle.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + Lifecycle.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): Lifecycle { - return AlgebraicType.deserializeValue(reader, Lifecycle.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + Lifecycle.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `Lifecycle`. -export type Lifecycle = LifecycleVariants.Init | - LifecycleVariants.OnConnect | - LifecycleVariants.OnDisconnect; +export type Lifecycle = + | LifecycleVariants.Init + | LifecycleVariants.OnConnect + | LifecycleVariants.OnDisconnect; export default Lifecycle; - diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts index 93434fdaff6..a4f4f2f9775 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts @@ -31,8 +31,8 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { TypeAlias as __TypeAlias } from "./type_alias_type"; +} from '../index'; +import { TypeAlias as __TypeAlias } from './type_alias_type'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of @@ -42,7 +42,7 @@ import { TypeAlias as __TypeAlias } from "./type_alias_type"; // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace MiscModuleExportVariants { - export type TypeAlias = { tag: "TypeAlias", value: __TypeAlias }; + export type TypeAlias = { tag: 'TypeAlias'; value: __TypeAlias }; } // A namespace for generated variants and helper functions. @@ -53,28 +53,42 @@ export namespace MiscModuleExport { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const TypeAlias = (value: __TypeAlias): MiscModuleExport => ({ tag: "TypeAlias", value }); + export const TypeAlias = (value: __TypeAlias): MiscModuleExport => ({ + tag: 'TypeAlias', + value, + }); export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "TypeAlias", algebraicType: __TypeAlias.getTypeScriptAlgebraicType() }, - ] + { + name: 'TypeAlias', + algebraicType: __TypeAlias.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: MiscModuleExport): void { - AlgebraicType.serializeValue(writer, MiscModuleExport.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: MiscModuleExport + ): void { + AlgebraicType.serializeValue( + writer, + MiscModuleExport.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): MiscModuleExport { - return AlgebraicType.deserializeValue(reader, MiscModuleExport.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + MiscModuleExport.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `MiscModuleExport`. export type MiscModuleExport = MiscModuleExportVariants.TypeAlias; export default MiscModuleExport; - diff --git a/crates/bindings-typescript/src/autogen/product_type_element_type.ts b/crates/bindings-typescript/src/autogen/product_type_element_type.ts index 70ae3fa9f72..5535ce89bbe 100644 --- a/crates/bindings-typescript/src/autogen/product_type_element_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { AlgebraicType as __AlgebraicType } from "./algebraic_type_type"; +} from '../index'; +import { AlgebraicType as __AlgebraicType } from './algebraic_type_type'; export type ProductTypeElement = { - name: string | undefined, - algebraicType: __AlgebraicType, + name: string | undefined; + algebraicType: __AlgebraicType; }; export default ProductTypeElement; @@ -45,26 +45,39 @@ export default ProductTypeElement; */ export namespace ProductTypeElement { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - { name: "algebraicType", algebraicType: __AlgebraicType.getTypeScriptAlgebraicType()}, - ] + { + name: 'name', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + { + name: 'algebraicType', + algebraicType: __AlgebraicType.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: ProductTypeElement): void { - AlgebraicType.serializeValue(writer, ProductTypeElement.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: ProductTypeElement + ): void { + AlgebraicType.serializeValue( + writer, + ProductTypeElement.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): ProductTypeElement { - return AlgebraicType.deserializeValue(reader, ProductTypeElement.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + ProductTypeElement.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/product_type_type.ts b/crates/bindings-typescript/src/autogen/product_type_type.ts index a16c137bd98..08c7eff534b 100644 --- a/crates/bindings-typescript/src/autogen/product_type_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_type.ts @@ -31,11 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { ProductTypeElement as __ProductTypeElement } from "./product_type_element_type"; +} from '../index'; +import { ProductTypeElement as __ProductTypeElement } from './product_type_element_type'; export type ProductType = { - elements: __ProductTypeElement[], + elements: __ProductTypeElement[]; }; export default ProductType; @@ -44,25 +44,34 @@ export default ProductType; */ export namespace ProductType { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "elements", algebraicType: AlgebraicType.Array(__ProductTypeElement.getTypeScriptAlgebraicType())}, - ] + { + name: 'elements', + algebraicType: AlgebraicType.Array( + __ProductTypeElement.getTypeScriptAlgebraicType() + ), + }, + ], }); } export function serialize(writer: BinaryWriter, value: ProductType): void { - AlgebraicType.serializeValue(writer, ProductType.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + ProductType.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): ProductType { - return AlgebraicType.deserializeValue(reader, ProductType.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + ProductType.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts index 412d1d9fd48..04cd3a2c21f 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { AlgebraicType as __AlgebraicType } from "./algebraic_type_type"; +} from '../index'; +import { AlgebraicType as __AlgebraicType } from './algebraic_type_type'; export type RawColumnDefV8 = { - colName: string, - colType: __AlgebraicType, + colName: string; + colType: __AlgebraicType; }; export default RawColumnDefV8; @@ -45,26 +45,33 @@ export default RawColumnDefV8; */ export namespace RawColumnDefV8 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "colName", algebraicType: AlgebraicType.String}, - { name: "colType", algebraicType: __AlgebraicType.getTypeScriptAlgebraicType()}, - ] + { name: 'colName', algebraicType: AlgebraicType.String }, + { + name: 'colType', + algebraicType: __AlgebraicType.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RawColumnDefV8): void { - AlgebraicType.serializeValue(writer, RawColumnDefV8.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawColumnDefV8.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawColumnDefV8 { - return AlgebraicType.deserializeValue(reader, RawColumnDefV8.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawColumnDefV8.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts index 43edfa08e47..976f6c91724 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts @@ -31,8 +31,8 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RawUniqueConstraintDataV9 as __RawUniqueConstraintDataV9 } from "./raw_unique_constraint_data_v_9_type"; +} from '../index'; +import { RawUniqueConstraintDataV9 as __RawUniqueConstraintDataV9 } from './raw_unique_constraint_data_v_9_type'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of @@ -42,7 +42,7 @@ import { RawUniqueConstraintDataV9 as __RawUniqueConstraintDataV9 } from "./raw_ // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace RawConstraintDataV9Variants { - export type Unique = { tag: "Unique", value: __RawUniqueConstraintDataV9 }; + export type Unique = { tag: 'Unique'; value: __RawUniqueConstraintDataV9 }; } // A namespace for generated variants and helper functions. @@ -53,28 +53,42 @@ export namespace RawConstraintDataV9 { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Unique = (value: __RawUniqueConstraintDataV9): RawConstraintDataV9 => ({ tag: "Unique", value }); + export const Unique = ( + value: __RawUniqueConstraintDataV9 + ): RawConstraintDataV9 => ({ tag: 'Unique', value }); export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "Unique", algebraicType: __RawUniqueConstraintDataV9.getTypeScriptAlgebraicType() }, - ] + { + name: 'Unique', + algebraicType: + __RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawConstraintDataV9): void { - AlgebraicType.serializeValue(writer, RawConstraintDataV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawConstraintDataV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawConstraintDataV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawConstraintDataV9 { - return AlgebraicType.deserializeValue(reader, RawConstraintDataV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawConstraintDataV9.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `RawConstraintDataV9`. export type RawConstraintDataV9 = RawConstraintDataV9Variants.Unique; export default RawConstraintDataV9; - diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts index aa9c491c182..dc4241a5a80 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts @@ -31,11 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type RawConstraintDefV8 = { - constraintName: string, - constraints: number, - columns: number[], + constraintName: string; + constraints: number; + columns: number[]; }; export default RawConstraintDefV8; @@ -44,27 +44,37 @@ export default RawConstraintDefV8; */ export namespace RawConstraintDefV8 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "constraintName", algebraicType: AlgebraicType.String}, - { name: "constraints", algebraicType: AlgebraicType.U8}, - { name: "columns", algebraicType: AlgebraicType.Array(AlgebraicType.U16)}, - ] + { name: 'constraintName', algebraicType: AlgebraicType.String }, + { name: 'constraints', algebraicType: AlgebraicType.U8 }, + { + name: 'columns', + algebraicType: AlgebraicType.Array(AlgebraicType.U16), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawConstraintDefV8): void { - AlgebraicType.serializeValue(writer, RawConstraintDefV8.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawConstraintDefV8 + ): void { + AlgebraicType.serializeValue( + writer, + RawConstraintDefV8.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawConstraintDefV8 { - return AlgebraicType.deserializeValue(reader, RawConstraintDefV8.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawConstraintDefV8.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts index f667bcbd58d..b7b38c098cb 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RawConstraintDataV9 as __RawConstraintDataV9 } from "./raw_constraint_data_v_9_type"; +} from '../index'; +import { RawConstraintDataV9 as __RawConstraintDataV9 } from './raw_constraint_data_v_9_type'; export type RawConstraintDefV9 = { - name: string | undefined, - data: __RawConstraintDataV9, + name: string | undefined; + data: __RawConstraintDataV9; }; export default RawConstraintDefV9; @@ -45,26 +45,39 @@ export default RawConstraintDefV9; */ export namespace RawConstraintDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - { name: "data", algebraicType: __RawConstraintDataV9.getTypeScriptAlgebraicType()}, - ] + { + name: 'name', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + { + name: 'data', + algebraicType: __RawConstraintDataV9.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawConstraintDefV9): void { - AlgebraicType.serializeValue(writer, RawConstraintDefV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawConstraintDefV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawConstraintDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawConstraintDefV9 { - return AlgebraicType.deserializeValue(reader, RawConstraintDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawConstraintDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts index 4e0b98da2bc..b4211af26e2 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts @@ -31,7 +31,7 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of // the tagged union. @@ -40,9 +40,9 @@ import { // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace RawIndexAlgorithmVariants { - export type BTree = { tag: "BTree", value: number[] }; - export type Hash = { tag: "Hash", value: number[] }; - export type Direct = { tag: "Direct", value: number }; + export type BTree = { tag: 'BTree'; value: number[] }; + export type Hash = { tag: 'Hash'; value: number[] }; + export type Direct = { tag: 'Direct'; value: number }; } // A namespace for generated variants and helper functions. @@ -53,34 +53,55 @@ export namespace RawIndexAlgorithm { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const BTree = (value: number[]): RawIndexAlgorithm => ({ tag: "BTree", value }); - export const Hash = (value: number[]): RawIndexAlgorithm => ({ tag: "Hash", value }); - export const Direct = (value: number): RawIndexAlgorithm => ({ tag: "Direct", value }); + export const BTree = (value: number[]): RawIndexAlgorithm => ({ + tag: 'BTree', + value, + }); + export const Hash = (value: number[]): RawIndexAlgorithm => ({ + tag: 'Hash', + value, + }); + export const Direct = (value: number): RawIndexAlgorithm => ({ + tag: 'Direct', + value, + }); export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "BTree", algebraicType: AlgebraicType.Array(AlgebraicType.U16) }, - { name: "Hash", algebraicType: AlgebraicType.Array(AlgebraicType.U16) }, - { name: "Direct", algebraicType: AlgebraicType.U16 }, - ] + { + name: 'BTree', + algebraicType: AlgebraicType.Array(AlgebraicType.U16), + }, + { name: 'Hash', algebraicType: AlgebraicType.Array(AlgebraicType.U16) }, + { name: 'Direct', algebraicType: AlgebraicType.U16 }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawIndexAlgorithm): void { - AlgebraicType.serializeValue(writer, RawIndexAlgorithm.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawIndexAlgorithm + ): void { + AlgebraicType.serializeValue( + writer, + RawIndexAlgorithm.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawIndexAlgorithm { - return AlgebraicType.deserializeValue(reader, RawIndexAlgorithm.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawIndexAlgorithm.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `RawIndexAlgorithm`. -export type RawIndexAlgorithm = RawIndexAlgorithmVariants.BTree | - RawIndexAlgorithmVariants.Hash | - RawIndexAlgorithmVariants.Direct; +export type RawIndexAlgorithm = + | RawIndexAlgorithmVariants.BTree + | RawIndexAlgorithmVariants.Hash + | RawIndexAlgorithmVariants.Direct; export default RawIndexAlgorithm; - diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts index 653ab5f931e..061c10f7e84 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts @@ -31,14 +31,14 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { IndexType as __IndexType } from "./index_type_type"; +} from '../index'; +import { IndexType as __IndexType } from './index_type_type'; export type RawIndexDefV8 = { - indexName: string, - isUnique: boolean, - indexType: __IndexType, - columns: number[], + indexName: string; + isUnique: boolean; + indexType: __IndexType; + columns: number[]; }; export default RawIndexDefV8; @@ -47,28 +47,38 @@ export default RawIndexDefV8; */ export namespace RawIndexDefV8 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "indexName", algebraicType: AlgebraicType.String}, - { name: "isUnique", algebraicType: AlgebraicType.Bool}, - { name: "indexType", algebraicType: __IndexType.getTypeScriptAlgebraicType()}, - { name: "columns", algebraicType: AlgebraicType.Array(AlgebraicType.U16)}, - ] + { name: 'indexName', algebraicType: AlgebraicType.String }, + { name: 'isUnique', algebraicType: AlgebraicType.Bool }, + { + name: 'indexType', + algebraicType: __IndexType.getTypeScriptAlgebraicType(), + }, + { + name: 'columns', + algebraicType: AlgebraicType.Array(AlgebraicType.U16), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RawIndexDefV8): void { - AlgebraicType.serializeValue(writer, RawIndexDefV8.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawIndexDefV8.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawIndexDefV8 { - return AlgebraicType.deserializeValue(reader, RawIndexDefV8.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawIndexDefV8.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts index 4bb32cdebff..3b0503c5edc 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RawIndexAlgorithm as __RawIndexAlgorithm } from "./raw_index_algorithm_type"; +} from '../index'; +import { RawIndexAlgorithm as __RawIndexAlgorithm } from './raw_index_algorithm_type'; export type RawIndexDefV9 = { - name: string | undefined, - accessorName: string | undefined, - algorithm: __RawIndexAlgorithm, + name: string | undefined; + accessorName: string | undefined; + algorithm: __RawIndexAlgorithm; }; export default RawIndexDefV9; @@ -46,27 +46,40 @@ export default RawIndexDefV9; */ export namespace RawIndexDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - { name: "accessorName", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - { name: "algorithm", algebraicType: __RawIndexAlgorithm.getTypeScriptAlgebraicType()}, - ] + { + name: 'name', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + { + name: 'accessorName', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + { + name: 'algorithm', + algebraicType: __RawIndexAlgorithm.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RawIndexDefV9): void { - AlgebraicType.serializeValue(writer, RawIndexDefV9.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawIndexDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawIndexDefV9 { - return AlgebraicType.deserializeValue(reader, RawIndexDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawIndexDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts index d9c0873bbc9..c6d089e48cb 100644 --- a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts @@ -31,7 +31,7 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of // the tagged union. @@ -39,8 +39,7 @@ import { // interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` -export namespace RawMiscModuleExportV9Variants { -} +export namespace RawMiscModuleExportV9Variants {} // A namespace for generated variants and helper functions. export namespace RawMiscModuleExportV9 { @@ -53,23 +52,30 @@ export namespace RawMiscModuleExportV9 { export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ - variants: [ - ] + variants: [], }); } - export function serialize(writer: BinaryWriter, value: RawMiscModuleExportV9): void { - AlgebraicType.serializeValue(writer, RawMiscModuleExportV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawMiscModuleExportV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawMiscModuleExportV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawMiscModuleExportV9 { - return AlgebraicType.deserializeValue(reader, RawMiscModuleExportV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawMiscModuleExportV9.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `RawMiscModuleExportV9`. export type RawMiscModuleExportV9 = never; export default RawMiscModuleExportV9; - diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts index 568906fa4f2..d5f589796ec 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts @@ -31,9 +31,9 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RawModuleDefV8 as __RawModuleDefV8 } from "./raw_module_def_v_8_type"; -import { RawModuleDefV9 as __RawModuleDefV9 } from "./raw_module_def_v_9_type"; +} from '../index'; +import { RawModuleDefV8 as __RawModuleDefV8 } from './raw_module_def_v_8_type'; +import { RawModuleDefV9 as __RawModuleDefV9 } from './raw_module_def_v_9_type'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of @@ -43,8 +43,8 @@ import { RawModuleDefV9 as __RawModuleDefV9 } from "./raw_module_def_v_9_type"; // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace RawModuleDefVariants { - export type V8BackCompat = { tag: "V8BackCompat", value: __RawModuleDefV8 }; - export type V9 = { tag: "V9", value: __RawModuleDefV9 }; + export type V8BackCompat = { tag: 'V8BackCompat'; value: __RawModuleDefV8 }; + export type V9 = { tag: 'V9'; value: __RawModuleDefV9 }; } // A namespace for generated variants and helper functions. @@ -55,31 +55,49 @@ export namespace RawModuleDef { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const V8BackCompat = (value: __RawModuleDefV8): RawModuleDef => ({ tag: "V8BackCompat", value }); - export const V9 = (value: __RawModuleDefV9): RawModuleDef => ({ tag: "V9", value }); + export const V8BackCompat = (value: __RawModuleDefV8): RawModuleDef => ({ + tag: 'V8BackCompat', + value, + }); + export const V9 = (value: __RawModuleDefV9): RawModuleDef => ({ + tag: 'V9', + value, + }); export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "V8BackCompat", algebraicType: __RawModuleDefV8.getTypeScriptAlgebraicType() }, - { name: "V9", algebraicType: __RawModuleDefV9.getTypeScriptAlgebraicType() }, - ] + { + name: 'V8BackCompat', + algebraicType: __RawModuleDefV8.getTypeScriptAlgebraicType(), + }, + { + name: 'V9', + algebraicType: __RawModuleDefV9.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RawModuleDef): void { - AlgebraicType.serializeValue(writer, RawModuleDef.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawModuleDef.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawModuleDef { - return AlgebraicType.deserializeValue(reader, RawModuleDef.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawModuleDef.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `RawModuleDef`. -export type RawModuleDef = RawModuleDefVariants.V8BackCompat | - RawModuleDefVariants.V9; +export type RawModuleDef = + | RawModuleDefVariants.V8BackCompat + | RawModuleDefVariants.V9; export default RawModuleDef; - diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts index b911697bd5c..f526803b631 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts @@ -31,17 +31,17 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { Typespace as __Typespace } from "./typespace_type"; -import { TableDesc as __TableDesc } from "./table_desc_type"; -import { ReducerDef as __ReducerDef } from "./reducer_def_type"; -import { MiscModuleExport as __MiscModuleExport } from "./misc_module_export_type"; +} from '../index'; +import { Typespace as __Typespace } from './typespace_type'; +import { TableDesc as __TableDesc } from './table_desc_type'; +import { ReducerDef as __ReducerDef } from './reducer_def_type'; +import { MiscModuleExport as __MiscModuleExport } from './misc_module_export_type'; export type RawModuleDefV8 = { - typespace: __Typespace, - tables: __TableDesc[], - reducers: __ReducerDef[], - miscExports: __MiscModuleExport[], + typespace: __Typespace; + tables: __TableDesc[]; + reducers: __ReducerDef[]; + miscExports: __MiscModuleExport[]; }; export default RawModuleDefV8; @@ -50,28 +50,50 @@ export default RawModuleDefV8; */ export namespace RawModuleDefV8 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "typespace", algebraicType: __Typespace.getTypeScriptAlgebraicType()}, - { name: "tables", algebraicType: AlgebraicType.Array(__TableDesc.getTypeScriptAlgebraicType())}, - { name: "reducers", algebraicType: AlgebraicType.Array(__ReducerDef.getTypeScriptAlgebraicType())}, - { name: "miscExports", algebraicType: AlgebraicType.Array(__MiscModuleExport.getTypeScriptAlgebraicType())}, - ] + { + name: 'typespace', + algebraicType: __Typespace.getTypeScriptAlgebraicType(), + }, + { + name: 'tables', + algebraicType: AlgebraicType.Array( + __TableDesc.getTypeScriptAlgebraicType() + ), + }, + { + name: 'reducers', + algebraicType: AlgebraicType.Array( + __ReducerDef.getTypeScriptAlgebraicType() + ), + }, + { + name: 'miscExports', + algebraicType: AlgebraicType.Array( + __MiscModuleExport.getTypeScriptAlgebraicType() + ), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RawModuleDefV8): void { - AlgebraicType.serializeValue(writer, RawModuleDefV8.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawModuleDefV8.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawModuleDefV8 { - return AlgebraicType.deserializeValue(reader, RawModuleDefV8.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawModuleDefV8.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts index bca71219d52..23c5f2962b2 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts @@ -31,21 +31,21 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { Typespace as __Typespace } from "./typespace_type"; -import { RawTableDefV9 as __RawTableDefV9 } from "./raw_table_def_v_9_type"; -import { RawReducerDefV9 as __RawReducerDefV9 } from "./raw_reducer_def_v_9_type"; -import { RawTypeDefV9 as __RawTypeDefV9 } from "./raw_type_def_v_9_type"; -import { RawMiscModuleExportV9 as __RawMiscModuleExportV9 } from "./raw_misc_module_export_v_9_type"; -import { RawRowLevelSecurityDefV9 as __RawRowLevelSecurityDefV9 } from "./raw_row_level_security_def_v_9_type"; +} from '../index'; +import { Typespace as __Typespace } from './typespace_type'; +import { RawTableDefV9 as __RawTableDefV9 } from './raw_table_def_v_9_type'; +import { RawReducerDefV9 as __RawReducerDefV9 } from './raw_reducer_def_v_9_type'; +import { RawTypeDefV9 as __RawTypeDefV9 } from './raw_type_def_v_9_type'; +import { RawMiscModuleExportV9 as __RawMiscModuleExportV9 } from './raw_misc_module_export_v_9_type'; +import { RawRowLevelSecurityDefV9 as __RawRowLevelSecurityDefV9 } from './raw_row_level_security_def_v_9_type'; export type RawModuleDefV9 = { - typespace: __Typespace, - tables: __RawTableDefV9[], - reducers: __RawReducerDefV9[], - types: __RawTypeDefV9[], - miscExports: __RawMiscModuleExportV9[], - rowLevelSecurity: __RawRowLevelSecurityDefV9[], + typespace: __Typespace; + tables: __RawTableDefV9[]; + reducers: __RawReducerDefV9[]; + types: __RawTypeDefV9[]; + miscExports: __RawMiscModuleExportV9[]; + rowLevelSecurity: __RawRowLevelSecurityDefV9[]; }; export default RawModuleDefV9; @@ -54,30 +54,62 @@ export default RawModuleDefV9; */ export namespace RawModuleDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "typespace", algebraicType: __Typespace.getTypeScriptAlgebraicType()}, - { name: "tables", algebraicType: AlgebraicType.Array(__RawTableDefV9.getTypeScriptAlgebraicType())}, - { name: "reducers", algebraicType: AlgebraicType.Array(__RawReducerDefV9.getTypeScriptAlgebraicType())}, - { name: "types", algebraicType: AlgebraicType.Array(__RawTypeDefV9.getTypeScriptAlgebraicType())}, - { name: "miscExports", algebraicType: AlgebraicType.Array(__RawMiscModuleExportV9.getTypeScriptAlgebraicType())}, - { name: "rowLevelSecurity", algebraicType: AlgebraicType.Array(__RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType())}, - ] + { + name: 'typespace', + algebraicType: __Typespace.getTypeScriptAlgebraicType(), + }, + { + name: 'tables', + algebraicType: AlgebraicType.Array( + __RawTableDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'reducers', + algebraicType: AlgebraicType.Array( + __RawReducerDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'types', + algebraicType: AlgebraicType.Array( + __RawTypeDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'miscExports', + algebraicType: AlgebraicType.Array( + __RawMiscModuleExportV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'rowLevelSecurity', + algebraicType: AlgebraicType.Array( + __RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType() + ), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RawModuleDefV9): void { - AlgebraicType.serializeValue(writer, RawModuleDefV9.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawModuleDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawModuleDefV9 { - return AlgebraicType.deserializeValue(reader, RawModuleDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawModuleDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts index 445ade6d38a..9106ef76573 100644 --- a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts @@ -31,14 +31,14 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { ProductType as __ProductType } from "./product_type_type"; -import { Lifecycle as __Lifecycle } from "./lifecycle_type"; +} from '../index'; +import { ProductType as __ProductType } from './product_type_type'; +import { Lifecycle as __Lifecycle } from './lifecycle_type'; export type RawReducerDefV9 = { - name: string, - params: __ProductType, - lifecycle: __Lifecycle | undefined, + name: string; + params: __ProductType; + lifecycle: __Lifecycle | undefined; }; export default RawReducerDefV9; @@ -47,27 +47,42 @@ export default RawReducerDefV9; */ export namespace RawReducerDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, - { name: "params", algebraicType: __ProductType.getTypeScriptAlgebraicType()}, - { name: "lifecycle", algebraicType: AlgebraicType.createOptionType(__Lifecycle.getTypeScriptAlgebraicType())}, - ] + { name: 'name', algebraicType: AlgebraicType.String }, + { + name: 'params', + algebraicType: __ProductType.getTypeScriptAlgebraicType(), + }, + { + name: 'lifecycle', + algebraicType: AlgebraicType.createOptionType( + __Lifecycle.getTypeScriptAlgebraicType() + ), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawReducerDefV9): void { - AlgebraicType.serializeValue(writer, RawReducerDefV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawReducerDefV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawReducerDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawReducerDefV9 { - return AlgebraicType.deserializeValue(reader, RawReducerDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawReducerDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts index e20fca1415e..95e2046cd51 100644 --- a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts @@ -31,9 +31,9 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type RawRowLevelSecurityDefV9 = { - sql: string, + sql: string; }; export default RawRowLevelSecurityDefV9; @@ -42,25 +42,30 @@ export default RawRowLevelSecurityDefV9; */ export namespace RawRowLevelSecurityDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ - elements: [ - { name: "sql", algebraicType: AlgebraicType.String}, - ] + elements: [{ name: 'sql', algebraicType: AlgebraicType.String }], }); } - export function serialize(writer: BinaryWriter, value: RawRowLevelSecurityDefV9): void { - AlgebraicType.serializeValue(writer, RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawRowLevelSecurityDefV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawRowLevelSecurityDefV9 { - return AlgebraicType.deserializeValue(reader, RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts index 55f56a3c8db..8d15be4c2c1 100644 --- a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts @@ -31,11 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type RawScheduleDefV9 = { - name: string | undefined, - reducerName: string, - scheduledAtColumn: number, + name: string | undefined; + reducerName: string; + scheduledAtColumn: number; }; export default RawScheduleDefV9; @@ -44,27 +44,37 @@ export default RawScheduleDefV9; */ export namespace RawScheduleDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - { name: "reducerName", algebraicType: AlgebraicType.String}, - { name: "scheduledAtColumn", algebraicType: AlgebraicType.U16}, - ] + { + name: 'name', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + { name: 'reducerName', algebraicType: AlgebraicType.String }, + { name: 'scheduledAtColumn', algebraicType: AlgebraicType.U16 }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawScheduleDefV9): void { - AlgebraicType.serializeValue(writer, RawScheduleDefV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawScheduleDefV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawScheduleDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawScheduleDefV9 { - return AlgebraicType.deserializeValue(reader, RawScheduleDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawScheduleDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts index 89dd4b16434..f03fb5ac838 100644 --- a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts @@ -31,10 +31,10 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type RawScopedTypeNameV9 = { - scope: string[], - name: string, + scope: string[]; + name: string; }; export default RawScopedTypeNameV9; @@ -43,26 +43,36 @@ export default RawScopedTypeNameV9; */ export namespace RawScopedTypeNameV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "scope", algebraicType: AlgebraicType.Array(AlgebraicType.String)}, - { name: "name", algebraicType: AlgebraicType.String}, - ] + { + name: 'scope', + algebraicType: AlgebraicType.Array(AlgebraicType.String), + }, + { name: 'name', algebraicType: AlgebraicType.String }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawScopedTypeNameV9): void { - AlgebraicType.serializeValue(writer, RawScopedTypeNameV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawScopedTypeNameV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawScopedTypeNameV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawScopedTypeNameV9 { - return AlgebraicType.deserializeValue(reader, RawScopedTypeNameV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawScopedTypeNameV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts index 71e76813e63..1acd51dbc42 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts @@ -31,15 +31,15 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type RawSequenceDefV8 = { - sequenceName: string, - colPos: number, - increment: bigint, - start: bigint | undefined, - minValue: bigint | undefined, - maxValue: bigint | undefined, - allocated: bigint, + sequenceName: string; + colPos: number; + increment: bigint; + start: bigint | undefined; + minValue: bigint | undefined; + maxValue: bigint | undefined; + allocated: bigint; }; export default RawSequenceDefV8; @@ -48,31 +48,47 @@ export default RawSequenceDefV8; */ export namespace RawSequenceDefV8 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "sequenceName", algebraicType: AlgebraicType.String}, - { name: "colPos", algebraicType: AlgebraicType.U16}, - { name: "increment", algebraicType: AlgebraicType.I128}, - { name: "start", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, - { name: "minValue", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, - { name: "maxValue", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, - { name: "allocated", algebraicType: AlgebraicType.I128}, - ] + { name: 'sequenceName', algebraicType: AlgebraicType.String }, + { name: 'colPos', algebraicType: AlgebraicType.U16 }, + { name: 'increment', algebraicType: AlgebraicType.I128 }, + { + name: 'start', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + }, + { + name: 'minValue', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + }, + { + name: 'maxValue', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + }, + { name: 'allocated', algebraicType: AlgebraicType.I128 }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawSequenceDefV8): void { - AlgebraicType.serializeValue(writer, RawSequenceDefV8.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawSequenceDefV8 + ): void { + AlgebraicType.serializeValue( + writer, + RawSequenceDefV8.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawSequenceDefV8 { - return AlgebraicType.deserializeValue(reader, RawSequenceDefV8.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawSequenceDefV8.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts index 8523c56c766..c0d402613f1 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts @@ -31,14 +31,14 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type RawSequenceDefV9 = { - name: string | undefined, - column: number, - start: bigint | undefined, - minValue: bigint | undefined, - maxValue: bigint | undefined, - increment: bigint, + name: string | undefined; + column: number; + start: bigint | undefined; + minValue: bigint | undefined; + maxValue: bigint | undefined; + increment: bigint; }; export default RawSequenceDefV9; @@ -47,30 +47,49 @@ export default RawSequenceDefV9; */ export namespace RawSequenceDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - { name: "column", algebraicType: AlgebraicType.U16}, - { name: "start", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, - { name: "minValue", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, - { name: "maxValue", algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128)}, - { name: "increment", algebraicType: AlgebraicType.I128}, - ] + { + name: 'name', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + { name: 'column', algebraicType: AlgebraicType.U16 }, + { + name: 'start', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + }, + { + name: 'minValue', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + }, + { + name: 'maxValue', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + }, + { name: 'increment', algebraicType: AlgebraicType.I128 }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawSequenceDefV9): void { - AlgebraicType.serializeValue(writer, RawSequenceDefV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawSequenceDefV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawSequenceDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawSequenceDefV9 { - return AlgebraicType.deserializeValue(reader, RawSequenceDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawSequenceDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts index 2cf4a411bd7..873d2cb042e 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts @@ -31,21 +31,21 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RawColumnDefV8 as __RawColumnDefV8 } from "./raw_column_def_v_8_type"; -import { RawIndexDefV8 as __RawIndexDefV8 } from "./raw_index_def_v_8_type"; -import { RawConstraintDefV8 as __RawConstraintDefV8 } from "./raw_constraint_def_v_8_type"; -import { RawSequenceDefV8 as __RawSequenceDefV8 } from "./raw_sequence_def_v_8_type"; +} from '../index'; +import { RawColumnDefV8 as __RawColumnDefV8 } from './raw_column_def_v_8_type'; +import { RawIndexDefV8 as __RawIndexDefV8 } from './raw_index_def_v_8_type'; +import { RawConstraintDefV8 as __RawConstraintDefV8 } from './raw_constraint_def_v_8_type'; +import { RawSequenceDefV8 as __RawSequenceDefV8 } from './raw_sequence_def_v_8_type'; export type RawTableDefV8 = { - tableName: string, - columns: __RawColumnDefV8[], - indexes: __RawIndexDefV8[], - constraints: __RawConstraintDefV8[], - sequences: __RawSequenceDefV8[], - tableType: string, - tableAccess: string, - scheduled: string | undefined, + tableName: string; + columns: __RawColumnDefV8[]; + indexes: __RawIndexDefV8[]; + constraints: __RawConstraintDefV8[]; + sequences: __RawSequenceDefV8[]; + tableType: string; + tableAccess: string; + scheduled: string | undefined; }; export default RawTableDefV8; @@ -54,32 +54,59 @@ export default RawTableDefV8; */ export namespace RawTableDefV8 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "tableName", algebraicType: AlgebraicType.String}, - { name: "columns", algebraicType: AlgebraicType.Array(__RawColumnDefV8.getTypeScriptAlgebraicType())}, - { name: "indexes", algebraicType: AlgebraicType.Array(__RawIndexDefV8.getTypeScriptAlgebraicType())}, - { name: "constraints", algebraicType: AlgebraicType.Array(__RawConstraintDefV8.getTypeScriptAlgebraicType())}, - { name: "sequences", algebraicType: AlgebraicType.Array(__RawSequenceDefV8.getTypeScriptAlgebraicType())}, - { name: "tableType", algebraicType: AlgebraicType.String}, - { name: "tableAccess", algebraicType: AlgebraicType.String}, - { name: "scheduled", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - ] + { name: 'tableName', algebraicType: AlgebraicType.String }, + { + name: 'columns', + algebraicType: AlgebraicType.Array( + __RawColumnDefV8.getTypeScriptAlgebraicType() + ), + }, + { + name: 'indexes', + algebraicType: AlgebraicType.Array( + __RawIndexDefV8.getTypeScriptAlgebraicType() + ), + }, + { + name: 'constraints', + algebraicType: AlgebraicType.Array( + __RawConstraintDefV8.getTypeScriptAlgebraicType() + ), + }, + { + name: 'sequences', + algebraicType: AlgebraicType.Array( + __RawSequenceDefV8.getTypeScriptAlgebraicType() + ), + }, + { name: 'tableType', algebraicType: AlgebraicType.String }, + { name: 'tableAccess', algebraicType: AlgebraicType.String }, + { + name: 'scheduled', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RawTableDefV8): void { - AlgebraicType.serializeValue(writer, RawTableDefV8.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawTableDefV8.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawTableDefV8 { - return AlgebraicType.deserializeValue(reader, RawTableDefV8.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawTableDefV8.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts index 369051c1658..2d51371911d 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts @@ -31,24 +31,24 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RawIndexDefV9 as __RawIndexDefV9 } from "./raw_index_def_v_9_type"; -import { RawConstraintDefV9 as __RawConstraintDefV9 } from "./raw_constraint_def_v_9_type"; -import { RawSequenceDefV9 as __RawSequenceDefV9 } from "./raw_sequence_def_v_9_type"; -import { RawScheduleDefV9 as __RawScheduleDefV9 } from "./raw_schedule_def_v_9_type"; -import { TableType as __TableType } from "./table_type_type"; -import { TableAccess as __TableAccess } from "./table_access_type"; +} from '../index'; +import { RawIndexDefV9 as __RawIndexDefV9 } from './raw_index_def_v_9_type'; +import { RawConstraintDefV9 as __RawConstraintDefV9 } from './raw_constraint_def_v_9_type'; +import { RawSequenceDefV9 as __RawSequenceDefV9 } from './raw_sequence_def_v_9_type'; +import { RawScheduleDefV9 as __RawScheduleDefV9 } from './raw_schedule_def_v_9_type'; +import { TableType as __TableType } from './table_type_type'; +import { TableAccess as __TableAccess } from './table_access_type'; export type RawTableDefV9 = { - name: string, - productTypeRef: number, - primaryKey: number[], - indexes: __RawIndexDefV9[], - constraints: __RawConstraintDefV9[], - sequences: __RawSequenceDefV9[], - schedule: __RawScheduleDefV9 | undefined, - tableType: __TableType, - tableAccess: __TableAccess, + name: string; + productTypeRef: number; + primaryKey: number[]; + indexes: __RawIndexDefV9[]; + constraints: __RawConstraintDefV9[]; + sequences: __RawSequenceDefV9[]; + schedule: __RawScheduleDefV9 | undefined; + tableType: __TableType; + tableAccess: __TableAccess; }; export default RawTableDefV9; @@ -57,33 +57,66 @@ export default RawTableDefV9; */ export namespace RawTableDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, - { name: "productTypeRef", algebraicType: AlgebraicType.U32}, - { name: "primaryKey", algebraicType: AlgebraicType.Array(AlgebraicType.U16)}, - { name: "indexes", algebraicType: AlgebraicType.Array(__RawIndexDefV9.getTypeScriptAlgebraicType())}, - { name: "constraints", algebraicType: AlgebraicType.Array(__RawConstraintDefV9.getTypeScriptAlgebraicType())}, - { name: "sequences", algebraicType: AlgebraicType.Array(__RawSequenceDefV9.getTypeScriptAlgebraicType())}, - { name: "schedule", algebraicType: AlgebraicType.createOptionType(__RawScheduleDefV9.getTypeScriptAlgebraicType())}, - { name: "tableType", algebraicType: __TableType.getTypeScriptAlgebraicType()}, - { name: "tableAccess", algebraicType: __TableAccess.getTypeScriptAlgebraicType()}, - ] + { name: 'name', algebraicType: AlgebraicType.String }, + { name: 'productTypeRef', algebraicType: AlgebraicType.U32 }, + { + name: 'primaryKey', + algebraicType: AlgebraicType.Array(AlgebraicType.U16), + }, + { + name: 'indexes', + algebraicType: AlgebraicType.Array( + __RawIndexDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'constraints', + algebraicType: AlgebraicType.Array( + __RawConstraintDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'sequences', + algebraicType: AlgebraicType.Array( + __RawSequenceDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'schedule', + algebraicType: AlgebraicType.createOptionType( + __RawScheduleDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'tableType', + algebraicType: __TableType.getTypeScriptAlgebraicType(), + }, + { + name: 'tableAccess', + algebraicType: __TableAccess.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RawTableDefV9): void { - AlgebraicType.serializeValue(writer, RawTableDefV9.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawTableDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawTableDefV9 { - return AlgebraicType.deserializeValue(reader, RawTableDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawTableDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts index 04857e064e4..0e4b516e766 100644 --- a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RawScopedTypeNameV9 as __RawScopedTypeNameV9 } from "./raw_scoped_type_name_v_9_type"; +} from '../index'; +import { RawScopedTypeNameV9 as __RawScopedTypeNameV9 } from './raw_scoped_type_name_v_9_type'; export type RawTypeDefV9 = { - name: __RawScopedTypeNameV9, - ty: number, - customOrdering: boolean, + name: __RawScopedTypeNameV9; + ty: number; + customOrdering: boolean; }; export default RawTypeDefV9; @@ -46,27 +46,34 @@ export default RawTypeDefV9; */ export namespace RawTypeDefV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: __RawScopedTypeNameV9.getTypeScriptAlgebraicType()}, - { name: "ty", algebraicType: AlgebraicType.U32}, - { name: "customOrdering", algebraicType: AlgebraicType.Bool}, - ] + { + name: 'name', + algebraicType: __RawScopedTypeNameV9.getTypeScriptAlgebraicType(), + }, + { name: 'ty', algebraicType: AlgebraicType.U32 }, + { name: 'customOrdering', algebraicType: AlgebraicType.Bool }, + ], }); } export function serialize(writer: BinaryWriter, value: RawTypeDefV9): void { - AlgebraicType.serializeValue(writer, RawTypeDefV9.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RawTypeDefV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawTypeDefV9 { - return AlgebraicType.deserializeValue(reader, RawTypeDefV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawTypeDefV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts index 2636291def0..9330420f261 100644 --- a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts @@ -31,9 +31,9 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type RawUniqueConstraintDataV9 = { - columns: number[], + columns: number[]; }; export default RawUniqueConstraintDataV9; @@ -42,25 +42,35 @@ export default RawUniqueConstraintDataV9; */ export namespace RawUniqueConstraintDataV9 { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "columns", algebraicType: AlgebraicType.Array(AlgebraicType.U16)}, - ] + { + name: 'columns', + algebraicType: AlgebraicType.Array(AlgebraicType.U16), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: RawUniqueConstraintDataV9): void { - AlgebraicType.serializeValue(writer, RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: RawUniqueConstraintDataV9 + ): void { + AlgebraicType.serializeValue( + writer, + RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RawUniqueConstraintDataV9 { - return AlgebraicType.deserializeValue(reader, RawUniqueConstraintDataV9.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RawUniqueConstraintDataV9.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/reducer_def_type.ts b/crates/bindings-typescript/src/autogen/reducer_def_type.ts index 52218a4aa0e..0542a4b2547 100644 --- a/crates/bindings-typescript/src/autogen/reducer_def_type.ts +++ b/crates/bindings-typescript/src/autogen/reducer_def_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { ProductTypeElement as __ProductTypeElement } from "./product_type_element_type"; +} from '../index'; +import { ProductTypeElement as __ProductTypeElement } from './product_type_element_type'; export type ReducerDef = { - name: string, - args: __ProductTypeElement[], + name: string; + args: __ProductTypeElement[]; }; export default ReducerDef; @@ -45,26 +45,35 @@ export default ReducerDef; */ export namespace ReducerDef { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, - { name: "args", algebraicType: AlgebraicType.Array(__ProductTypeElement.getTypeScriptAlgebraicType())}, - ] + { name: 'name', algebraicType: AlgebraicType.String }, + { + name: 'args', + algebraicType: AlgebraicType.Array( + __ProductTypeElement.getTypeScriptAlgebraicType() + ), + }, + ], }); } export function serialize(writer: BinaryWriter, value: ReducerDef): void { - AlgebraicType.serializeValue(writer, ReducerDef.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + ReducerDef.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): ReducerDef { - return AlgebraicType.deserializeValue(reader, ReducerDef.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + ReducerDef.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/sum_type_type.ts b/crates/bindings-typescript/src/autogen/sum_type_type.ts index 72de12849fd..fd29825d9c9 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_type.ts @@ -31,11 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { SumTypeVariant as __SumTypeVariant } from "./sum_type_variant_type"; +} from '../index'; +import { SumTypeVariant as __SumTypeVariant } from './sum_type_variant_type'; export type SumType = { - variants: __SumTypeVariant[], + variants: __SumTypeVariant[]; }; export default SumType; @@ -44,25 +44,34 @@ export default SumType; */ export namespace SumType { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "variants", algebraicType: AlgebraicType.Array(__SumTypeVariant.getTypeScriptAlgebraicType())}, - ] + { + name: 'variants', + algebraicType: AlgebraicType.Array( + __SumTypeVariant.getTypeScriptAlgebraicType() + ), + }, + ], }); } export function serialize(writer: BinaryWriter, value: SumType): void { - AlgebraicType.serializeValue(writer, SumType.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + SumType.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): SumType { - return AlgebraicType.deserializeValue(reader, SumType.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + SumType.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts index 03ea9f3da60..1bede6a96d5 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { AlgebraicType as __AlgebraicType } from "./algebraic_type_type"; +} from '../index'; +import { AlgebraicType as __AlgebraicType } from './algebraic_type_type'; export type SumTypeVariant = { - name: string | undefined, - algebraicType: __AlgebraicType, + name: string | undefined; + algebraicType: __AlgebraicType; }; export default SumTypeVariant; @@ -45,26 +45,36 @@ export default SumTypeVariant; */ export namespace SumTypeVariant { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - { name: "algebraicType", algebraicType: __AlgebraicType.getTypeScriptAlgebraicType()}, - ] + { + name: 'name', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + { + name: 'algebraicType', + algebraicType: __AlgebraicType.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: SumTypeVariant): void { - AlgebraicType.serializeValue(writer, SumTypeVariant.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + SumTypeVariant.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): SumTypeVariant { - return AlgebraicType.deserializeValue(reader, SumTypeVariant.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + SumTypeVariant.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/table_access_type.ts b/crates/bindings-typescript/src/autogen/table_access_type.ts index 0f53ac71798..1d0915c9247 100644 --- a/crates/bindings-typescript/src/autogen/table_access_type.ts +++ b/crates/bindings-typescript/src/autogen/table_access_type.ts @@ -31,7 +31,7 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of // the tagged union. @@ -40,8 +40,8 @@ import { // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace TableAccessVariants { - export type Public = { tag: "Public" }; - export type Private = { tag: "Private" }; + export type Public = { tag: 'Public' }; + export type Private = { tag: 'Private' }; } // A namespace for generated variants and helper functions. @@ -52,31 +52,43 @@ export namespace TableAccess { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Public: { tag: "Public" } = { tag: "Public" }; - export const Private: { tag: "Private" } = { tag: "Private" }; + export const Public: { tag: 'Public' } = { tag: 'Public' }; + export const Private: { tag: 'Private' } = { tag: 'Private' }; export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "Public", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "Private", algebraicType: AlgebraicType.Product({ elements: [] }) }, - ] + { + name: 'Public', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'Private', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + ], }); } export function serialize(writer: BinaryWriter, value: TableAccess): void { - AlgebraicType.serializeValue(writer, TableAccess.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + TableAccess.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): TableAccess { - return AlgebraicType.deserializeValue(reader, TableAccess.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + TableAccess.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `TableAccess`. -export type TableAccess = TableAccessVariants.Public | - TableAccessVariants.Private; +export type TableAccess = + | TableAccessVariants.Public + | TableAccessVariants.Private; export default TableAccess; - diff --git a/crates/bindings-typescript/src/autogen/table_desc_type.ts b/crates/bindings-typescript/src/autogen/table_desc_type.ts index 413be60fc14..ffe728c0c8e 100644 --- a/crates/bindings-typescript/src/autogen/table_desc_type.ts +++ b/crates/bindings-typescript/src/autogen/table_desc_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RawTableDefV8 as __RawTableDefV8 } from "./raw_table_def_v_8_type"; +} from '../index'; +import { RawTableDefV8 as __RawTableDefV8 } from './raw_table_def_v_8_type'; export type TableDesc = { - schema: __RawTableDefV8, - data: number, + schema: __RawTableDefV8; + data: number; }; export default TableDesc; @@ -45,26 +45,33 @@ export default TableDesc; */ export namespace TableDesc { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "schema", algebraicType: __RawTableDefV8.getTypeScriptAlgebraicType()}, - { name: "data", algebraicType: AlgebraicType.U32}, - ] + { + name: 'schema', + algebraicType: __RawTableDefV8.getTypeScriptAlgebraicType(), + }, + { name: 'data', algebraicType: AlgebraicType.U32 }, + ], }); } export function serialize(writer: BinaryWriter, value: TableDesc): void { - AlgebraicType.serializeValue(writer, TableDesc.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + TableDesc.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): TableDesc { - return AlgebraicType.deserializeValue(reader, TableDesc.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + TableDesc.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/table_type_type.ts b/crates/bindings-typescript/src/autogen/table_type_type.ts index 93165f3a0cf..d14f0d4c6a4 100644 --- a/crates/bindings-typescript/src/autogen/table_type_type.ts +++ b/crates/bindings-typescript/src/autogen/table_type_type.ts @@ -31,7 +31,7 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of // the tagged union. @@ -40,8 +40,8 @@ import { // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace TableTypeVariants { - export type System = { tag: "System" }; - export type User = { tag: "User" }; + export type System = { tag: 'System' }; + export type User = { tag: 'User' }; } // A namespace for generated variants and helper functions. @@ -52,31 +52,41 @@ export namespace TableType { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const System: { tag: "System" } = { tag: "System" }; - export const User: { tag: "User" } = { tag: "User" }; + export const System: { tag: 'System' } = { tag: 'System' }; + export const User: { tag: 'User' } = { tag: 'User' }; export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "System", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "User", algebraicType: AlgebraicType.Product({ elements: [] }) }, - ] + { + name: 'System', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + { + name: 'User', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + ], }); } export function serialize(writer: BinaryWriter, value: TableType): void { - AlgebraicType.serializeValue(writer, TableType.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + TableType.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): TableType { - return AlgebraicType.deserializeValue(reader, TableType.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + TableType.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `TableType`. -export type TableType = TableTypeVariants.System | - TableTypeVariants.User; +export type TableType = TableTypeVariants.System | TableTypeVariants.User; export default TableType; - diff --git a/crates/bindings-typescript/src/autogen/type_alias_type.ts b/crates/bindings-typescript/src/autogen/type_alias_type.ts index 438a84d4b70..dee431c3ff2 100644 --- a/crates/bindings-typescript/src/autogen/type_alias_type.ts +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -31,10 +31,10 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type TypeAlias = { - name: string, - ty: number, + name: string; + ty: number; }; export default TypeAlias; @@ -43,26 +43,30 @@ export default TypeAlias; */ export namespace TypeAlias { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, - { name: "ty", algebraicType: AlgebraicType.U32}, - ] + { name: 'name', algebraicType: AlgebraicType.String }, + { name: 'ty', algebraicType: AlgebraicType.U32 }, + ], }); } export function serialize(writer: BinaryWriter, value: TypeAlias): void { - AlgebraicType.serializeValue(writer, TypeAlias.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + TypeAlias.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): TypeAlias { - return AlgebraicType.deserializeValue(reader, TypeAlias.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + TypeAlias.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts index 57c23770071..e9d08c905d5 100644 --- a/crates/bindings-typescript/src/autogen/typespace_type.ts +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -31,11 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { AlgebraicType as __AlgebraicType } from "./algebraic_type_type"; +} from '../index'; +import { AlgebraicType as __AlgebraicType } from './algebraic_type_type'; export type Typespace = { - types: __AlgebraicType[], + types: __AlgebraicType[]; }; export default Typespace; @@ -44,25 +44,34 @@ export default Typespace; */ export namespace Typespace { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "types", algebraicType: AlgebraicType.Array(__AlgebraicType.getTypeScriptAlgebraicType())}, - ] + { + name: 'types', + algebraicType: AlgebraicType.Array( + __AlgebraicType.getTypeScriptAlgebraicType() + ), + }, + ], }); } export function serialize(writer: BinaryWriter, value: Typespace): void { - AlgebraicType.serializeValue(writer, Typespace.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + Typespace.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): Typespace { - return AlgebraicType.deserializeValue(reader, Typespace.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + Typespace.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/crates/bindings-typescript/src/index.ts b/crates/bindings-typescript/src/index.ts index 70ee6b7abbe..8f22f4c3048 100644 --- a/crates/bindings-typescript/src/index.ts +++ b/crates/bindings-typescript/src/index.ts @@ -8,4 +8,3 @@ export * from './time_duration'; export * from './timestamp'; export * from './utils'; export * from './identity'; - diff --git a/crates/bindings-typescript/src/schedule_at.ts b/crates/bindings-typescript/src/schedule_at.ts index 46d978104ab..0cbbac29448 100644 --- a/crates/bindings-typescript/src/schedule_at.ts +++ b/crates/bindings-typescript/src/schedule_at.ts @@ -52,4 +52,4 @@ export namespace ScheduleAt { } export type ScheduleAt = ScheduleAt.Interval | ScheduleAt.Time; -export default ScheduleAt; \ No newline at end of file +export default ScheduleAt; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f4abfc0a295..e8869d39067 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: base64-js: specifier: ^1.5.1 version: 1.5.1 + prettier: + specifier: ^3.3.3 + version: 3.6.2 sdks/typescript: devDependencies: From 61d999812dc1f9a0e2afe08e4bd2afe9ab8f932a Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 19 Aug 2025 21:20:21 -0400 Subject: [PATCH 09/37] Prettier formatting for the sdk --- .../examples/quickstart-chat/src/index.css | 10 +- .../sdk/src/client_api/bsatn_row_list_type.ts | 40 ++-- .../sdk/src/client_api/call_reducer_type.ts | 40 ++-- .../sdk/src/client_api/client_message_type.ts | 138 ++++++++---- .../compressable_query_update_type.ts | 63 ++++-- .../src/client_api/database_update_type.ts | 35 ++-- .../sdk/src/client_api/energy_quanta_type.ts | 28 +-- .../sdk/src/client_api/identity_token_type.ts | 39 ++-- .../packages/sdk/src/client_api/index.ts | 151 ++++++++------ .../client_api/initial_subscription_type.ts | 49 +++-- .../client_api/one_off_query_response_type.ts | 61 ++++-- .../sdk/src/client_api/one_off_query_type.ts | 35 ++-- .../sdk/src/client_api/one_off_table_type.ts | 37 ++-- .../sdk/src/client_api/query_id_type.ts | 28 +-- .../sdk/src/client_api/query_update_type.ts | 40 ++-- .../src/client_api/reducer_call_info_type.ts | 45 ++-- .../sdk/src/client_api/row_size_hint_type.ts | 41 ++-- .../sdk/src/client_api/server_message_type.ts | 196 +++++++++++++----- .../src/client_api/subscribe_applied_type.ts | 58 ++++-- .../subscribe_multi_applied_type.ts | 58 ++++-- .../src/client_api/subscribe_multi_type.ts | 44 ++-- .../sdk/src/client_api/subscribe_rows_type.ts | 41 ++-- .../src/client_api/subscribe_single_type.ts | 46 ++-- .../sdk/src/client_api/subscribe_type.ts | 35 ++-- .../src/client_api/subscription_error_type.ts | 61 ++++-- .../sdk/src/client_api/table_update_type.ts | 47 +++-- .../transaction_update_light_type.ts | 42 ++-- .../src/client_api/transaction_update_type.ts | 84 +++++--- .../client_api/unsubscribe_applied_type.ts | 58 ++++-- .../unsubscribe_multi_applied_type.ts | 58 ++++-- .../src/client_api/unsubscribe_multi_type.ts | 42 ++-- .../sdk/src/client_api/unsubscribe_type.ts | 37 ++-- .../sdk/src/client_api/update_status_type.ts | 56 +++-- .../packages/sdk/src/db_connection_impl.ts | 15 +- sdks/typescript/packages/sdk/src/index.ts | 3 +- .../sdk/src/websocket_test_adapter.ts | 12 +- .../packages/sdk/tests/algebraic_type.test.ts | 8 +- .../packages/sdk/tests/table_cache.test.ts | 24 ++- sdks/typescript/vitest.config.ts | 4 +- 39 files changed, 1214 insertions(+), 695 deletions(-) diff --git a/sdks/typescript/examples/quickstart-chat/src/index.css b/sdks/typescript/examples/quickstart-chat/src/index.css index 9390800cc7e..12a6ed0082f 100644 --- a/sdks/typescript/examples/quickstart-chat/src/index.css +++ b/sdks/typescript/examples/quickstart-chat/src/index.css @@ -32,16 +32,16 @@ body, } body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; + font-family: + -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', + 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; + font-family: + source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; } /* ----- Buttons ----- */ diff --git a/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts b/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts index 65f1a029445..2c48b17e593 100644 --- a/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { RowSizeHint as __RowSizeHint } from "./row_size_hint_type"; +} from '../index'; +import { RowSizeHint as __RowSizeHint } from './row_size_hint_type'; export type BsatnRowList = { - sizeHint: __RowSizeHint, - rowsData: Uint8Array, + sizeHint: __RowSizeHint; + rowsData: Uint8Array; }; export default BsatnRowList; @@ -45,26 +45,36 @@ export default BsatnRowList; */ export namespace BsatnRowList { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "sizeHint", algebraicType: __RowSizeHint.getTypeScriptAlgebraicType()}, - { name: "rowsData", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, - ] + { + name: 'sizeHint', + algebraicType: __RowSizeHint.getTypeScriptAlgebraicType(), + }, + { + name: 'rowsData', + algebraicType: AlgebraicType.Array(AlgebraicType.U8), + }, + ], }); } export function serialize(writer: BinaryWriter, value: BsatnRowList): void { - AlgebraicType.serializeValue(writer, BsatnRowList.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + BsatnRowList.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): BsatnRowList { - return AlgebraicType.deserializeValue(reader, BsatnRowList.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + BsatnRowList.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts b/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts index 9206fe6c96c..6c07a33c979 100644 --- a/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type CallReducer = { - reducer: string, - args: Uint8Array, - requestId: number, - flags: number, + reducer: string; + args: Uint8Array; + requestId: number; + flags: number; }; export default CallReducer; @@ -45,28 +45,32 @@ export default CallReducer; */ export namespace CallReducer { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "reducer", algebraicType: AlgebraicType.String}, - { name: "args", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "flags", algebraicType: AlgebraicType.U8}, - ] + { name: 'reducer', algebraicType: AlgebraicType.String }, + { name: 'args', algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'flags', algebraicType: AlgebraicType.U8 }, + ], }); } export function serialize(writer: BinaryWriter, value: CallReducer): void { - AlgebraicType.serializeValue(writer, CallReducer.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + CallReducer.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): CallReducer { - return AlgebraicType.deserializeValue(reader, CallReducer.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + CallReducer.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts index 183626dd8f6..ec74643e0d5 100644 --- a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts @@ -31,14 +31,14 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { CallReducer as __CallReducer } from "./call_reducer_type"; -import { Subscribe as __Subscribe } from "./subscribe_type"; -import { OneOffQuery as __OneOffQuery } from "./one_off_query_type"; -import { SubscribeSingle as __SubscribeSingle } from "./subscribe_single_type"; -import { SubscribeMulti as __SubscribeMulti } from "./subscribe_multi_type"; -import { Unsubscribe as __Unsubscribe } from "./unsubscribe_type"; -import { UnsubscribeMulti as __UnsubscribeMulti } from "./unsubscribe_multi_type"; +} from '../index'; +import { CallReducer as __CallReducer } from './call_reducer_type'; +import { Subscribe as __Subscribe } from './subscribe_type'; +import { OneOffQuery as __OneOffQuery } from './one_off_query_type'; +import { SubscribeSingle as __SubscribeSingle } from './subscribe_single_type'; +import { SubscribeMulti as __SubscribeMulti } from './subscribe_multi_type'; +import { Unsubscribe as __Unsubscribe } from './unsubscribe_type'; +import { UnsubscribeMulti as __UnsubscribeMulti } from './unsubscribe_multi_type'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of @@ -48,13 +48,22 @@ import { UnsubscribeMulti as __UnsubscribeMulti } from "./unsubscribe_multi_type // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace ClientMessageVariants { - export type CallReducer = { tag: "CallReducer", value: __CallReducer }; - export type Subscribe = { tag: "Subscribe", value: __Subscribe }; - export type OneOffQuery = { tag: "OneOffQuery", value: __OneOffQuery }; - export type SubscribeSingle = { tag: "SubscribeSingle", value: __SubscribeSingle }; - export type SubscribeMulti = { tag: "SubscribeMulti", value: __SubscribeMulti }; - export type Unsubscribe = { tag: "Unsubscribe", value: __Unsubscribe }; - export type UnsubscribeMulti = { tag: "UnsubscribeMulti", value: __UnsubscribeMulti }; + export type CallReducer = { tag: 'CallReducer'; value: __CallReducer }; + export type Subscribe = { tag: 'Subscribe'; value: __Subscribe }; + export type OneOffQuery = { tag: 'OneOffQuery'; value: __OneOffQuery }; + export type SubscribeSingle = { + tag: 'SubscribeSingle'; + value: __SubscribeSingle; + }; + export type SubscribeMulti = { + tag: 'SubscribeMulti'; + value: __SubscribeMulti; + }; + export type Unsubscribe = { tag: 'Unsubscribe'; value: __Unsubscribe }; + export type UnsubscribeMulti = { + tag: 'UnsubscribeMulti'; + value: __UnsubscribeMulti; + }; } // A namespace for generated variants and helper functions. @@ -65,46 +74,93 @@ export namespace ClientMessage { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const CallReducer = (value: __CallReducer): ClientMessage => ({ tag: "CallReducer", value }); - export const Subscribe = (value: __Subscribe): ClientMessage => ({ tag: "Subscribe", value }); - export const OneOffQuery = (value: __OneOffQuery): ClientMessage => ({ tag: "OneOffQuery", value }); - export const SubscribeSingle = (value: __SubscribeSingle): ClientMessage => ({ tag: "SubscribeSingle", value }); - export const SubscribeMulti = (value: __SubscribeMulti): ClientMessage => ({ tag: "SubscribeMulti", value }); - export const Unsubscribe = (value: __Unsubscribe): ClientMessage => ({ tag: "Unsubscribe", value }); - export const UnsubscribeMulti = (value: __UnsubscribeMulti): ClientMessage => ({ tag: "UnsubscribeMulti", value }); + export const CallReducer = (value: __CallReducer): ClientMessage => ({ + tag: 'CallReducer', + value, + }); + export const Subscribe = (value: __Subscribe): ClientMessage => ({ + tag: 'Subscribe', + value, + }); + export const OneOffQuery = (value: __OneOffQuery): ClientMessage => ({ + tag: 'OneOffQuery', + value, + }); + export const SubscribeSingle = (value: __SubscribeSingle): ClientMessage => ({ + tag: 'SubscribeSingle', + value, + }); + export const SubscribeMulti = (value: __SubscribeMulti): ClientMessage => ({ + tag: 'SubscribeMulti', + value, + }); + export const Unsubscribe = (value: __Unsubscribe): ClientMessage => ({ + tag: 'Unsubscribe', + value, + }); + export const UnsubscribeMulti = ( + value: __UnsubscribeMulti + ): ClientMessage => ({ tag: 'UnsubscribeMulti', value }); export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "CallReducer", algebraicType: __CallReducer.getTypeScriptAlgebraicType() }, - { name: "Subscribe", algebraicType: __Subscribe.getTypeScriptAlgebraicType() }, - { name: "OneOffQuery", algebraicType: __OneOffQuery.getTypeScriptAlgebraicType() }, - { name: "SubscribeSingle", algebraicType: __SubscribeSingle.getTypeScriptAlgebraicType() }, - { name: "SubscribeMulti", algebraicType: __SubscribeMulti.getTypeScriptAlgebraicType() }, - { name: "Unsubscribe", algebraicType: __Unsubscribe.getTypeScriptAlgebraicType() }, - { name: "UnsubscribeMulti", algebraicType: __UnsubscribeMulti.getTypeScriptAlgebraicType() }, - ] + { + name: 'CallReducer', + algebraicType: __CallReducer.getTypeScriptAlgebraicType(), + }, + { + name: 'Subscribe', + algebraicType: __Subscribe.getTypeScriptAlgebraicType(), + }, + { + name: 'OneOffQuery', + algebraicType: __OneOffQuery.getTypeScriptAlgebraicType(), + }, + { + name: 'SubscribeSingle', + algebraicType: __SubscribeSingle.getTypeScriptAlgebraicType(), + }, + { + name: 'SubscribeMulti', + algebraicType: __SubscribeMulti.getTypeScriptAlgebraicType(), + }, + { + name: 'Unsubscribe', + algebraicType: __Unsubscribe.getTypeScriptAlgebraicType(), + }, + { + name: 'UnsubscribeMulti', + algebraicType: __UnsubscribeMulti.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: ClientMessage): void { - AlgebraicType.serializeValue(writer, ClientMessage.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + ClientMessage.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): ClientMessage { - return AlgebraicType.deserializeValue(reader, ClientMessage.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + ClientMessage.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `ClientMessage`. -export type ClientMessage = ClientMessage.CallReducer | - ClientMessage.Subscribe | - ClientMessage.OneOffQuery | - ClientMessage.SubscribeSingle | - ClientMessage.SubscribeMulti | - ClientMessage.Unsubscribe | - ClientMessage.UnsubscribeMulti; +export type ClientMessage = + | ClientMessage.CallReducer + | ClientMessage.Subscribe + | ClientMessage.OneOffQuery + | ClientMessage.SubscribeSingle + | ClientMessage.SubscribeMulti + | ClientMessage.Unsubscribe + | ClientMessage.UnsubscribeMulti; export default ClientMessage; - diff --git a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts index 099746c666c..a93534c64e0 100644 --- a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts @@ -31,8 +31,8 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryUpdate as __QueryUpdate } from "./query_update_type"; +} from '../index'; +import { QueryUpdate as __QueryUpdate } from './query_update_type'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of @@ -42,9 +42,9 @@ import { QueryUpdate as __QueryUpdate } from "./query_update_type"; // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace CompressableQueryUpdateVariants { - export type Uncompressed = { tag: "Uncompressed", value: __QueryUpdate }; - export type Brotli = { tag: "Brotli", value: Uint8Array }; - export type Gzip = { tag: "Gzip", value: Uint8Array }; + export type Uncompressed = { tag: 'Uncompressed'; value: __QueryUpdate }; + export type Brotli = { tag: 'Brotli'; value: Uint8Array }; + export type Gzip = { tag: 'Gzip'; value: Uint8Array }; } // A namespace for generated variants and helper functions. @@ -55,34 +55,57 @@ export namespace CompressableQueryUpdate { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Uncompressed = (value: __QueryUpdate): CompressableQueryUpdate => ({ tag: "Uncompressed", value }); - export const Brotli = (value: Uint8Array): CompressableQueryUpdate => ({ tag: "Brotli", value }); - export const Gzip = (value: Uint8Array): CompressableQueryUpdate => ({ tag: "Gzip", value }); + export const Uncompressed = ( + value: __QueryUpdate + ): CompressableQueryUpdate => ({ tag: 'Uncompressed', value }); + export const Brotli = (value: Uint8Array): CompressableQueryUpdate => ({ + tag: 'Brotli', + value, + }); + export const Gzip = (value: Uint8Array): CompressableQueryUpdate => ({ + tag: 'Gzip', + value, + }); export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "Uncompressed", algebraicType: __QueryUpdate.getTypeScriptAlgebraicType() }, - { name: "Brotli", algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, - { name: "Gzip", algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, - ] + { + name: 'Uncompressed', + algebraicType: __QueryUpdate.getTypeScriptAlgebraicType(), + }, + { + name: 'Brotli', + algebraicType: AlgebraicType.Array(AlgebraicType.U8), + }, + { name: 'Gzip', algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, + ], }); } - export function serialize(writer: BinaryWriter, value: CompressableQueryUpdate): void { - AlgebraicType.serializeValue(writer, CompressableQueryUpdate.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: CompressableQueryUpdate + ): void { + AlgebraicType.serializeValue( + writer, + CompressableQueryUpdate.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): CompressableQueryUpdate { - return AlgebraicType.deserializeValue(reader, CompressableQueryUpdate.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + CompressableQueryUpdate.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `CompressableQueryUpdate`. -export type CompressableQueryUpdate = CompressableQueryUpdate.Uncompressed | - CompressableQueryUpdate.Brotli | - CompressableQueryUpdate.Gzip; +export type CompressableQueryUpdate = + | CompressableQueryUpdate.Uncompressed + | CompressableQueryUpdate.Brotli + | CompressableQueryUpdate.Gzip; export default CompressableQueryUpdate; - diff --git a/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts index 53748e21df3..8d51a2c4030 100644 --- a/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts @@ -31,11 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { TableUpdate as __TableUpdate } from "./table_update_type"; +} from '../index'; +import { TableUpdate as __TableUpdate } from './table_update_type'; export type DatabaseUpdate = { - tables: __TableUpdate[], + tables: __TableUpdate[]; }; export default DatabaseUpdate; @@ -44,25 +44,34 @@ export default DatabaseUpdate; */ export namespace DatabaseUpdate { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "tables", algebraicType: AlgebraicType.Array(__TableUpdate.getTypeScriptAlgebraicType())}, - ] + { + name: 'tables', + algebraicType: AlgebraicType.Array( + __TableUpdate.getTypeScriptAlgebraicType() + ), + }, + ], }); } export function serialize(writer: BinaryWriter, value: DatabaseUpdate): void { - AlgebraicType.serializeValue(writer, DatabaseUpdate.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + DatabaseUpdate.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): DatabaseUpdate { - return AlgebraicType.deserializeValue(reader, DatabaseUpdate.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + DatabaseUpdate.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts b/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts index db5117ee483..c04a663ff9e 100644 --- a/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts @@ -31,9 +31,9 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type EnergyQuanta = { - quanta: bigint, + quanta: bigint; }; export default EnergyQuanta; @@ -42,25 +42,27 @@ export default EnergyQuanta; */ export namespace EnergyQuanta { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ - elements: [ - { name: "quanta", algebraicType: AlgebraicType.U128}, - ] + elements: [{ name: 'quanta', algebraicType: AlgebraicType.U128 }], }); } export function serialize(writer: BinaryWriter, value: EnergyQuanta): void { - AlgebraicType.serializeValue(writer, EnergyQuanta.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + EnergyQuanta.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): EnergyQuanta { - return AlgebraicType.deserializeValue(reader, EnergyQuanta.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + EnergyQuanta.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts b/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts index 8e4b8a94003..bf59fc0820b 100644 --- a/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts @@ -31,11 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type IdentityToken = { - identity: Identity, - token: string, - connectionId: ConnectionId, + identity: Identity; + token: string; + connectionId: ConnectionId; }; export default IdentityToken; @@ -44,27 +44,34 @@ export default IdentityToken; */ export namespace IdentityToken { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "identity", algebraicType: AlgebraicType.createIdentityType()}, - { name: "token", algebraicType: AlgebraicType.String}, - { name: "connectionId", algebraicType: AlgebraicType.createConnectionIdType()}, - ] + { name: 'identity', algebraicType: AlgebraicType.createIdentityType() }, + { name: 'token', algebraicType: AlgebraicType.String }, + { + name: 'connectionId', + algebraicType: AlgebraicType.createConnectionIdType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: IdentityToken): void { - AlgebraicType.serializeValue(writer, IdentityToken.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + IdentityToken.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): IdentityToken { - return AlgebraicType.deserializeValue(reader, IdentityToken.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + IdentityToken.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/index.ts b/sdks/typescript/packages/sdk/src/client_api/index.ts index c53d9e8170c..305df328c99 100644 --- a/sdks/typescript/packages/sdk/src/client_api/index.ts +++ b/sdks/typescript/packages/sdk/src/client_api/index.ts @@ -31,83 +31,81 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; // Import and reexport all reducer arg types // Import and reexport all table handle types // Import and reexport all types -import { BsatnRowList } from "./bsatn_row_list_type.ts"; +import { BsatnRowList } from './bsatn_row_list_type.ts'; export { BsatnRowList }; -import { CallReducer } from "./call_reducer_type.ts"; +import { CallReducer } from './call_reducer_type.ts'; export { CallReducer }; -import { ClientMessage } from "./client_message_type.ts"; +import { ClientMessage } from './client_message_type.ts'; export { ClientMessage }; -import { CompressableQueryUpdate } from "./compressable_query_update_type.ts"; +import { CompressableQueryUpdate } from './compressable_query_update_type.ts'; export { CompressableQueryUpdate }; -import { DatabaseUpdate } from "./database_update_type.ts"; +import { DatabaseUpdate } from './database_update_type.ts'; export { DatabaseUpdate }; -import { EnergyQuanta } from "./energy_quanta_type.ts"; +import { EnergyQuanta } from './energy_quanta_type.ts'; export { EnergyQuanta }; -import { IdentityToken } from "./identity_token_type.ts"; +import { IdentityToken } from './identity_token_type.ts'; export { IdentityToken }; -import { InitialSubscription } from "./initial_subscription_type.ts"; +import { InitialSubscription } from './initial_subscription_type.ts'; export { InitialSubscription }; -import { OneOffQuery } from "./one_off_query_type.ts"; +import { OneOffQuery } from './one_off_query_type.ts'; export { OneOffQuery }; -import { OneOffQueryResponse } from "./one_off_query_response_type.ts"; +import { OneOffQueryResponse } from './one_off_query_response_type.ts'; export { OneOffQueryResponse }; -import { OneOffTable } from "./one_off_table_type.ts"; +import { OneOffTable } from './one_off_table_type.ts'; export { OneOffTable }; -import { QueryId } from "./query_id_type.ts"; +import { QueryId } from './query_id_type.ts'; export { QueryId }; -import { QueryUpdate } from "./query_update_type.ts"; +import { QueryUpdate } from './query_update_type.ts'; export { QueryUpdate }; -import { ReducerCallInfo } from "./reducer_call_info_type.ts"; +import { ReducerCallInfo } from './reducer_call_info_type.ts'; export { ReducerCallInfo }; -import { RowSizeHint } from "./row_size_hint_type.ts"; +import { RowSizeHint } from './row_size_hint_type.ts'; export { RowSizeHint }; -import { ServerMessage } from "./server_message_type.ts"; +import { ServerMessage } from './server_message_type.ts'; export { ServerMessage }; -import { Subscribe } from "./subscribe_type.ts"; +import { Subscribe } from './subscribe_type.ts'; export { Subscribe }; -import { SubscribeApplied } from "./subscribe_applied_type.ts"; +import { SubscribeApplied } from './subscribe_applied_type.ts'; export { SubscribeApplied }; -import { SubscribeMulti } from "./subscribe_multi_type.ts"; +import { SubscribeMulti } from './subscribe_multi_type.ts'; export { SubscribeMulti }; -import { SubscribeMultiApplied } from "./subscribe_multi_applied_type.ts"; +import { SubscribeMultiApplied } from './subscribe_multi_applied_type.ts'; export { SubscribeMultiApplied }; -import { SubscribeRows } from "./subscribe_rows_type.ts"; +import { SubscribeRows } from './subscribe_rows_type.ts'; export { SubscribeRows }; -import { SubscribeSingle } from "./subscribe_single_type.ts"; +import { SubscribeSingle } from './subscribe_single_type.ts'; export { SubscribeSingle }; -import { SubscriptionError } from "./subscription_error_type.ts"; +import { SubscriptionError } from './subscription_error_type.ts'; export { SubscriptionError }; -import { TableUpdate } from "./table_update_type.ts"; +import { TableUpdate } from './table_update_type.ts'; export { TableUpdate }; -import { TransactionUpdate } from "./transaction_update_type.ts"; +import { TransactionUpdate } from './transaction_update_type.ts'; export { TransactionUpdate }; -import { TransactionUpdateLight } from "./transaction_update_light_type.ts"; +import { TransactionUpdateLight } from './transaction_update_light_type.ts'; export { TransactionUpdateLight }; -import { Unsubscribe } from "./unsubscribe_type.ts"; +import { Unsubscribe } from './unsubscribe_type.ts'; export { Unsubscribe }; -import { UnsubscribeApplied } from "./unsubscribe_applied_type.ts"; +import { UnsubscribeApplied } from './unsubscribe_applied_type.ts'; export { UnsubscribeApplied }; -import { UnsubscribeMulti } from "./unsubscribe_multi_type.ts"; +import { UnsubscribeMulti } from './unsubscribe_multi_type.ts'; export { UnsubscribeMulti }; -import { UnsubscribeMultiApplied } from "./unsubscribe_multi_applied_type.ts"; +import { UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type.ts'; export { UnsubscribeMultiApplied }; -import { UpdateStatus } from "./update_status_type.ts"; +import { UpdateStatus } from './update_status_type.ts'; export { UpdateStatus }; const REMOTE_MODULE = { - tables: { - }, - reducers: { - }, + tables: {}, + reducers: {}, versionInfo: { - cliVersion: "1.3.0", + cliVersion: '1.3.0', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. @@ -119,48 +117,85 @@ const REMOTE_MODULE = { eventContextConstructor: (imp: DbConnectionImpl, event: Event) => { return { ...(imp as DbConnection), - event - } + event, + }; }, dbViewConstructor: (imp: DbConnectionImpl) => { return new RemoteTables(imp); }, - reducersConstructor: (imp: DbConnectionImpl, setReducerFlags: SetReducerFlags) => { + reducersConstructor: ( + imp: DbConnectionImpl, + setReducerFlags: SetReducerFlags + ) => { return new RemoteReducers(imp, setReducerFlags); }, setReducerFlagsConstructor: () => { return new SetReducerFlags(); - } -} + }, +}; // A type representing all the possible variants of a reducer. -export type Reducer = never -; +export type Reducer = never; export class RemoteReducers { - constructor(private connection: DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} - + constructor( + private connection: DbConnectionImpl, + private setCallReducerFlags: SetReducerFlags + ) {} } -export class SetReducerFlags { -} +export class SetReducerFlags {} export class RemoteTables { constructor(private connection: DbConnectionImpl) {} } -export class SubscriptionBuilder extends SubscriptionBuilderImpl { } +export class SubscriptionBuilder extends SubscriptionBuilderImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> {} -export class DbConnection extends DbConnectionImpl { - static builder = (): DbConnectionBuilder => { - return new DbConnectionBuilder(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); - } +export class DbConnection extends DbConnectionImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> { + static builder = (): DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + > => { + return new DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + >(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); + }; subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); - } + }; } -export type EventContext = EventContextInterface; -export type ReducerEventContext = ReducerEventContextInterface; -export type SubscriptionEventContext = SubscriptionEventContextInterface; -export type ErrorContext = ErrorContextInterface; +export type EventContext = EventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type ReducerEventContext = ReducerEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type SubscriptionEventContext = SubscriptionEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; +export type ErrorContext = ErrorContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; diff --git a/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts b/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts index e194d0079c1..55dff1b7aae 100644 --- a/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; +} from '../index'; +import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; export type InitialSubscription = { - databaseUpdate: __DatabaseUpdate, - requestId: number, - totalHostExecutionDuration: TimeDuration, + databaseUpdate: __DatabaseUpdate; + requestId: number; + totalHostExecutionDuration: TimeDuration; }; export default InitialSubscription; @@ -46,27 +46,40 @@ export default InitialSubscription; */ export namespace InitialSubscription { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "databaseUpdate", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType()}, - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "totalHostExecutionDuration", algebraicType: AlgebraicType.createTimeDurationType()}, - ] + { + name: 'databaseUpdate', + algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'totalHostExecutionDuration', + algebraicType: AlgebraicType.createTimeDurationType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: InitialSubscription): void { - AlgebraicType.serializeValue(writer, InitialSubscription.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: InitialSubscription + ): void { + AlgebraicType.serializeValue( + writer, + InitialSubscription.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): InitialSubscription { - return AlgebraicType.deserializeValue(reader, InitialSubscription.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + InitialSubscription.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts index 735ac996750..26ae0054216 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts @@ -31,14 +31,14 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { OneOffTable as __OneOffTable } from "./one_off_table_type"; +} from '../index'; +import { OneOffTable as __OneOffTable } from './one_off_table_type'; export type OneOffQueryResponse = { - messageId: Uint8Array, - error: string | undefined, - tables: __OneOffTable[], - totalHostExecutionDuration: TimeDuration, + messageId: Uint8Array; + error: string | undefined; + tables: __OneOffTable[]; + totalHostExecutionDuration: TimeDuration; }; export default OneOffQueryResponse; @@ -47,28 +47,49 @@ export default OneOffQueryResponse; */ export namespace OneOffQueryResponse { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "messageId", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, - { name: "error", algebraicType: AlgebraicType.createOptionType(AlgebraicType.String)}, - { name: "tables", algebraicType: AlgebraicType.Array(__OneOffTable.getTypeScriptAlgebraicType())}, - { name: "totalHostExecutionDuration", algebraicType: AlgebraicType.createTimeDurationType()}, - ] + { + name: 'messageId', + algebraicType: AlgebraicType.Array(AlgebraicType.U8), + }, + { + name: 'error', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + }, + { + name: 'tables', + algebraicType: AlgebraicType.Array( + __OneOffTable.getTypeScriptAlgebraicType() + ), + }, + { + name: 'totalHostExecutionDuration', + algebraicType: AlgebraicType.createTimeDurationType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: OneOffQueryResponse): void { - AlgebraicType.serializeValue(writer, OneOffQueryResponse.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: OneOffQueryResponse + ): void { + AlgebraicType.serializeValue( + writer, + OneOffQueryResponse.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): OneOffQueryResponse { - return AlgebraicType.deserializeValue(reader, OneOffQueryResponse.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + OneOffQueryResponse.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts index 0d666e4f553..3cb8c62e029 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts @@ -31,10 +31,10 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type OneOffQuery = { - messageId: Uint8Array, - queryString: string, + messageId: Uint8Array; + queryString: string; }; export default OneOffQuery; @@ -43,26 +43,33 @@ export default OneOffQuery; */ export namespace OneOffQuery { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "messageId", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, - { name: "queryString", algebraicType: AlgebraicType.String}, - ] + { + name: 'messageId', + algebraicType: AlgebraicType.Array(AlgebraicType.U8), + }, + { name: 'queryString', algebraicType: AlgebraicType.String }, + ], }); } export function serialize(writer: BinaryWriter, value: OneOffQuery): void { - AlgebraicType.serializeValue(writer, OneOffQuery.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + OneOffQuery.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): OneOffQuery { - return AlgebraicType.deserializeValue(reader, OneOffQuery.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + OneOffQuery.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts index 531f2cd536c..68f0fdc10b5 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { BsatnRowList as __BsatnRowList } from "./bsatn_row_list_type"; +} from '../index'; +import { BsatnRowList as __BsatnRowList } from './bsatn_row_list_type'; export type OneOffTable = { - tableName: string, - rows: __BsatnRowList, + tableName: string; + rows: __BsatnRowList; }; export default OneOffTable; @@ -45,26 +45,33 @@ export default OneOffTable; */ export namespace OneOffTable { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "tableName", algebraicType: AlgebraicType.String}, - { name: "rows", algebraicType: __BsatnRowList.getTypeScriptAlgebraicType()}, - ] + { name: 'tableName', algebraicType: AlgebraicType.String }, + { + name: 'rows', + algebraicType: __BsatnRowList.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: OneOffTable): void { - AlgebraicType.serializeValue(writer, OneOffTable.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + OneOffTable.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): OneOffTable { - return AlgebraicType.deserializeValue(reader, OneOffTable.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + OneOffTable.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts b/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts index 1109547a1cc..4d0d371863c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts @@ -31,9 +31,9 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type QueryId = { - id: number, + id: number; }; export default QueryId; @@ -42,25 +42,27 @@ export default QueryId; */ export namespace QueryId { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ - elements: [ - { name: "id", algebraicType: AlgebraicType.U32}, - ] + elements: [{ name: 'id', algebraicType: AlgebraicType.U32 }], }); } export function serialize(writer: BinaryWriter, value: QueryId): void { - AlgebraicType.serializeValue(writer, QueryId.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + QueryId.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): QueryId { - return AlgebraicType.deserializeValue(reader, QueryId.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + QueryId.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts index 542225f0423..4497d057ca0 100644 --- a/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { BsatnRowList as __BsatnRowList } from "./bsatn_row_list_type"; +} from '../index'; +import { BsatnRowList as __BsatnRowList } from './bsatn_row_list_type'; export type QueryUpdate = { - deletes: __BsatnRowList, - inserts: __BsatnRowList, + deletes: __BsatnRowList; + inserts: __BsatnRowList; }; export default QueryUpdate; @@ -45,26 +45,36 @@ export default QueryUpdate; */ export namespace QueryUpdate { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "deletes", algebraicType: __BsatnRowList.getTypeScriptAlgebraicType()}, - { name: "inserts", algebraicType: __BsatnRowList.getTypeScriptAlgebraicType()}, - ] + { + name: 'deletes', + algebraicType: __BsatnRowList.getTypeScriptAlgebraicType(), + }, + { + name: 'inserts', + algebraicType: __BsatnRowList.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: QueryUpdate): void { - AlgebraicType.serializeValue(writer, QueryUpdate.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + QueryUpdate.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): QueryUpdate { - return AlgebraicType.deserializeValue(reader, QueryUpdate.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + QueryUpdate.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts b/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts index d6318689ccc..45bf4438012 100644 --- a/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type ReducerCallInfo = { - reducerName: string, - reducerId: number, - args: Uint8Array, - requestId: number, + reducerName: string; + reducerId: number; + args: Uint8Array; + requestId: number; }; export default ReducerCallInfo; @@ -45,28 +45,35 @@ export default ReducerCallInfo; */ export namespace ReducerCallInfo { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "reducerName", algebraicType: AlgebraicType.String}, - { name: "reducerId", algebraicType: AlgebraicType.U32}, - { name: "args", algebraicType: AlgebraicType.Array(AlgebraicType.U8)}, - { name: "requestId", algebraicType: AlgebraicType.U32}, - ] + { name: 'reducerName', algebraicType: AlgebraicType.String }, + { name: 'reducerId', algebraicType: AlgebraicType.U32 }, + { name: 'args', algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + ], }); } - export function serialize(writer: BinaryWriter, value: ReducerCallInfo): void { - AlgebraicType.serializeValue(writer, ReducerCallInfo.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: ReducerCallInfo + ): void { + AlgebraicType.serializeValue( + writer, + ReducerCallInfo.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): ReducerCallInfo { - return AlgebraicType.deserializeValue(reader, ReducerCallInfo.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + ReducerCallInfo.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts index ac3cc0b87ec..0fc6f21166b 100644 --- a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts @@ -31,7 +31,7 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of // the tagged union. @@ -40,8 +40,8 @@ import { // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace RowSizeHintVariants { - export type FixedSize = { tag: "FixedSize", value: number }; - export type RowOffsets = { tag: "RowOffsets", value: bigint[] }; + export type FixedSize = { tag: 'FixedSize'; value: number }; + export type RowOffsets = { tag: 'RowOffsets'; value: bigint[] }; } // A namespace for generated variants and helper functions. @@ -52,31 +52,44 @@ export namespace RowSizeHint { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const FixedSize = (value: number): RowSizeHint => ({ tag: "FixedSize", value }); - export const RowOffsets = (value: bigint[]): RowSizeHint => ({ tag: "RowOffsets", value }); + export const FixedSize = (value: number): RowSizeHint => ({ + tag: 'FixedSize', + value, + }); + export const RowOffsets = (value: bigint[]): RowSizeHint => ({ + tag: 'RowOffsets', + value, + }); export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "FixedSize", algebraicType: AlgebraicType.U16 }, - { name: "RowOffsets", algebraicType: AlgebraicType.Array(AlgebraicType.U64) }, - ] + { name: 'FixedSize', algebraicType: AlgebraicType.U16 }, + { + name: 'RowOffsets', + algebraicType: AlgebraicType.Array(AlgebraicType.U64), + }, + ], }); } export function serialize(writer: BinaryWriter, value: RowSizeHint): void { - AlgebraicType.serializeValue(writer, RowSizeHint.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + RowSizeHint.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): RowSizeHint { - return AlgebraicType.deserializeValue(reader, RowSizeHint.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + RowSizeHint.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `RowSizeHint`. -export type RowSizeHint = RowSizeHint.FixedSize | - RowSizeHint.RowOffsets; +export type RowSizeHint = RowSizeHint.FixedSize | RowSizeHint.RowOffsets; export default RowSizeHint; - diff --git a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts index b54068ef072..308d5d58479 100644 --- a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts @@ -31,17 +31,17 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { InitialSubscription as __InitialSubscription } from "./initial_subscription_type"; -import { TransactionUpdate as __TransactionUpdate } from "./transaction_update_type"; -import { TransactionUpdateLight as __TransactionUpdateLight } from "./transaction_update_light_type"; -import { IdentityToken as __IdentityToken } from "./identity_token_type"; -import { OneOffQueryResponse as __OneOffQueryResponse } from "./one_off_query_response_type"; -import { SubscribeApplied as __SubscribeApplied } from "./subscribe_applied_type"; -import { UnsubscribeApplied as __UnsubscribeApplied } from "./unsubscribe_applied_type"; -import { SubscriptionError as __SubscriptionError } from "./subscription_error_type"; -import { SubscribeMultiApplied as __SubscribeMultiApplied } from "./subscribe_multi_applied_type"; -import { UnsubscribeMultiApplied as __UnsubscribeMultiApplied } from "./unsubscribe_multi_applied_type"; +} from '../index'; +import { InitialSubscription as __InitialSubscription } from './initial_subscription_type'; +import { TransactionUpdate as __TransactionUpdate } from './transaction_update_type'; +import { TransactionUpdateLight as __TransactionUpdateLight } from './transaction_update_light_type'; +import { IdentityToken as __IdentityToken } from './identity_token_type'; +import { OneOffQueryResponse as __OneOffQueryResponse } from './one_off_query_response_type'; +import { SubscribeApplied as __SubscribeApplied } from './subscribe_applied_type'; +import { UnsubscribeApplied as __UnsubscribeApplied } from './unsubscribe_applied_type'; +import { SubscriptionError as __SubscriptionError } from './subscription_error_type'; +import { SubscribeMultiApplied as __SubscribeMultiApplied } from './subscribe_multi_applied_type'; +import { UnsubscribeMultiApplied as __UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of @@ -51,16 +51,43 @@ import { UnsubscribeMultiApplied as __UnsubscribeMultiApplied } from "./unsubscr // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace ServerMessageVariants { - export type InitialSubscription = { tag: "InitialSubscription", value: __InitialSubscription }; - export type TransactionUpdate = { tag: "TransactionUpdate", value: __TransactionUpdate }; - export type TransactionUpdateLight = { tag: "TransactionUpdateLight", value: __TransactionUpdateLight }; - export type IdentityToken = { tag: "IdentityToken", value: __IdentityToken }; - export type OneOffQueryResponse = { tag: "OneOffQueryResponse", value: __OneOffQueryResponse }; - export type SubscribeApplied = { tag: "SubscribeApplied", value: __SubscribeApplied }; - export type UnsubscribeApplied = { tag: "UnsubscribeApplied", value: __UnsubscribeApplied }; - export type SubscriptionError = { tag: "SubscriptionError", value: __SubscriptionError }; - export type SubscribeMultiApplied = { tag: "SubscribeMultiApplied", value: __SubscribeMultiApplied }; - export type UnsubscribeMultiApplied = { tag: "UnsubscribeMultiApplied", value: __UnsubscribeMultiApplied }; + export type InitialSubscription = { + tag: 'InitialSubscription'; + value: __InitialSubscription; + }; + export type TransactionUpdate = { + tag: 'TransactionUpdate'; + value: __TransactionUpdate; + }; + export type TransactionUpdateLight = { + tag: 'TransactionUpdateLight'; + value: __TransactionUpdateLight; + }; + export type IdentityToken = { tag: 'IdentityToken'; value: __IdentityToken }; + export type OneOffQueryResponse = { + tag: 'OneOffQueryResponse'; + value: __OneOffQueryResponse; + }; + export type SubscribeApplied = { + tag: 'SubscribeApplied'; + value: __SubscribeApplied; + }; + export type UnsubscribeApplied = { + tag: 'UnsubscribeApplied'; + value: __UnsubscribeApplied; + }; + export type SubscriptionError = { + tag: 'SubscriptionError'; + value: __SubscriptionError; + }; + export type SubscribeMultiApplied = { + tag: 'SubscribeMultiApplied'; + value: __SubscribeMultiApplied; + }; + export type UnsubscribeMultiApplied = { + tag: 'UnsubscribeMultiApplied'; + value: __UnsubscribeMultiApplied; + }; } // A namespace for generated variants and helper functions. @@ -71,55 +98,112 @@ export namespace ServerMessage { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const InitialSubscription = (value: __InitialSubscription): ServerMessage => ({ tag: "InitialSubscription", value }); - export const TransactionUpdate = (value: __TransactionUpdate): ServerMessage => ({ tag: "TransactionUpdate", value }); - export const TransactionUpdateLight = (value: __TransactionUpdateLight): ServerMessage => ({ tag: "TransactionUpdateLight", value }); - export const IdentityToken = (value: __IdentityToken): ServerMessage => ({ tag: "IdentityToken", value }); - export const OneOffQueryResponse = (value: __OneOffQueryResponse): ServerMessage => ({ tag: "OneOffQueryResponse", value }); - export const SubscribeApplied = (value: __SubscribeApplied): ServerMessage => ({ tag: "SubscribeApplied", value }); - export const UnsubscribeApplied = (value: __UnsubscribeApplied): ServerMessage => ({ tag: "UnsubscribeApplied", value }); - export const SubscriptionError = (value: __SubscriptionError): ServerMessage => ({ tag: "SubscriptionError", value }); - export const SubscribeMultiApplied = (value: __SubscribeMultiApplied): ServerMessage => ({ tag: "SubscribeMultiApplied", value }); - export const UnsubscribeMultiApplied = (value: __UnsubscribeMultiApplied): ServerMessage => ({ tag: "UnsubscribeMultiApplied", value }); + export const InitialSubscription = ( + value: __InitialSubscription + ): ServerMessage => ({ tag: 'InitialSubscription', value }); + export const TransactionUpdate = ( + value: __TransactionUpdate + ): ServerMessage => ({ tag: 'TransactionUpdate', value }); + export const TransactionUpdateLight = ( + value: __TransactionUpdateLight + ): ServerMessage => ({ tag: 'TransactionUpdateLight', value }); + export const IdentityToken = (value: __IdentityToken): ServerMessage => ({ + tag: 'IdentityToken', + value, + }); + export const OneOffQueryResponse = ( + value: __OneOffQueryResponse + ): ServerMessage => ({ tag: 'OneOffQueryResponse', value }); + export const SubscribeApplied = ( + value: __SubscribeApplied + ): ServerMessage => ({ tag: 'SubscribeApplied', value }); + export const UnsubscribeApplied = ( + value: __UnsubscribeApplied + ): ServerMessage => ({ tag: 'UnsubscribeApplied', value }); + export const SubscriptionError = ( + value: __SubscriptionError + ): ServerMessage => ({ tag: 'SubscriptionError', value }); + export const SubscribeMultiApplied = ( + value: __SubscribeMultiApplied + ): ServerMessage => ({ tag: 'SubscribeMultiApplied', value }); + export const UnsubscribeMultiApplied = ( + value: __UnsubscribeMultiApplied + ): ServerMessage => ({ tag: 'UnsubscribeMultiApplied', value }); export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "InitialSubscription", algebraicType: __InitialSubscription.getTypeScriptAlgebraicType() }, - { name: "TransactionUpdate", algebraicType: __TransactionUpdate.getTypeScriptAlgebraicType() }, - { name: "TransactionUpdateLight", algebraicType: __TransactionUpdateLight.getTypeScriptAlgebraicType() }, - { name: "IdentityToken", algebraicType: __IdentityToken.getTypeScriptAlgebraicType() }, - { name: "OneOffQueryResponse", algebraicType: __OneOffQueryResponse.getTypeScriptAlgebraicType() }, - { name: "SubscribeApplied", algebraicType: __SubscribeApplied.getTypeScriptAlgebraicType() }, - { name: "UnsubscribeApplied", algebraicType: __UnsubscribeApplied.getTypeScriptAlgebraicType() }, - { name: "SubscriptionError", algebraicType: __SubscriptionError.getTypeScriptAlgebraicType() }, - { name: "SubscribeMultiApplied", algebraicType: __SubscribeMultiApplied.getTypeScriptAlgebraicType() }, - { name: "UnsubscribeMultiApplied", algebraicType: __UnsubscribeMultiApplied.getTypeScriptAlgebraicType() }, - ] + { + name: 'InitialSubscription', + algebraicType: __InitialSubscription.getTypeScriptAlgebraicType(), + }, + { + name: 'TransactionUpdate', + algebraicType: __TransactionUpdate.getTypeScriptAlgebraicType(), + }, + { + name: 'TransactionUpdateLight', + algebraicType: __TransactionUpdateLight.getTypeScriptAlgebraicType(), + }, + { + name: 'IdentityToken', + algebraicType: __IdentityToken.getTypeScriptAlgebraicType(), + }, + { + name: 'OneOffQueryResponse', + algebraicType: __OneOffQueryResponse.getTypeScriptAlgebraicType(), + }, + { + name: 'SubscribeApplied', + algebraicType: __SubscribeApplied.getTypeScriptAlgebraicType(), + }, + { + name: 'UnsubscribeApplied', + algebraicType: __UnsubscribeApplied.getTypeScriptAlgebraicType(), + }, + { + name: 'SubscriptionError', + algebraicType: __SubscriptionError.getTypeScriptAlgebraicType(), + }, + { + name: 'SubscribeMultiApplied', + algebraicType: __SubscribeMultiApplied.getTypeScriptAlgebraicType(), + }, + { + name: 'UnsubscribeMultiApplied', + algebraicType: __UnsubscribeMultiApplied.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: ServerMessage): void { - AlgebraicType.serializeValue(writer, ServerMessage.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + ServerMessage.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): ServerMessage { - return AlgebraicType.deserializeValue(reader, ServerMessage.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + ServerMessage.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `ServerMessage`. -export type ServerMessage = ServerMessage.InitialSubscription | - ServerMessage.TransactionUpdate | - ServerMessage.TransactionUpdateLight | - ServerMessage.IdentityToken | - ServerMessage.OneOffQueryResponse | - ServerMessage.SubscribeApplied | - ServerMessage.UnsubscribeApplied | - ServerMessage.SubscriptionError | - ServerMessage.SubscribeMultiApplied | - ServerMessage.UnsubscribeMultiApplied; +export type ServerMessage = + | ServerMessage.InitialSubscription + | ServerMessage.TransactionUpdate + | ServerMessage.TransactionUpdateLight + | ServerMessage.IdentityToken + | ServerMessage.OneOffQueryResponse + | ServerMessage.SubscribeApplied + | ServerMessage.UnsubscribeApplied + | ServerMessage.SubscriptionError + | ServerMessage.SubscribeMultiApplied + | ServerMessage.UnsubscribeMultiApplied; export default ServerMessage; - diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts index 3fc60584b8d..d32956f10b2 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts @@ -31,15 +31,15 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryId as __QueryId } from "./query_id_type"; -import { SubscribeRows as __SubscribeRows } from "./subscribe_rows_type"; +} from '../index'; +import { QueryId as __QueryId } from './query_id_type'; +import { SubscribeRows as __SubscribeRows } from './subscribe_rows_type'; export type SubscribeApplied = { - requestId: number, - totalHostExecutionDurationMicros: bigint, - queryId: __QueryId, - rows: __SubscribeRows, + requestId: number; + totalHostExecutionDurationMicros: bigint; + queryId: __QueryId; + rows: __SubscribeRows; }; export default SubscribeApplied; @@ -48,28 +48,44 @@ export default SubscribeApplied; */ export namespace SubscribeApplied { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, - { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, - { name: "rows", algebraicType: __SubscribeRows.getTypeScriptAlgebraicType()}, - ] + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'totalHostExecutionDurationMicros', + algebraicType: AlgebraicType.U64, + }, + { + name: 'queryId', + algebraicType: __QueryId.getTypeScriptAlgebraicType(), + }, + { + name: 'rows', + algebraicType: __SubscribeRows.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: SubscribeApplied): void { - AlgebraicType.serializeValue(writer, SubscribeApplied.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: SubscribeApplied + ): void { + AlgebraicType.serializeValue( + writer, + SubscribeApplied.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): SubscribeApplied { - return AlgebraicType.deserializeValue(reader, SubscribeApplied.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + SubscribeApplied.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts index 8575f63ba64..1d19ffcb9a7 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts @@ -31,15 +31,15 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryId as __QueryId } from "./query_id_type"; -import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; +} from '../index'; +import { QueryId as __QueryId } from './query_id_type'; +import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; export type SubscribeMultiApplied = { - requestId: number, - totalHostExecutionDurationMicros: bigint, - queryId: __QueryId, - update: __DatabaseUpdate, + requestId: number; + totalHostExecutionDurationMicros: bigint; + queryId: __QueryId; + update: __DatabaseUpdate; }; export default SubscribeMultiApplied; @@ -48,28 +48,44 @@ export default SubscribeMultiApplied; */ export namespace SubscribeMultiApplied { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, - { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, - { name: "update", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType()}, - ] + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'totalHostExecutionDurationMicros', + algebraicType: AlgebraicType.U64, + }, + { + name: 'queryId', + algebraicType: __QueryId.getTypeScriptAlgebraicType(), + }, + { + name: 'update', + algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: SubscribeMultiApplied): void { - AlgebraicType.serializeValue(writer, SubscribeMultiApplied.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: SubscribeMultiApplied + ): void { + AlgebraicType.serializeValue( + writer, + SubscribeMultiApplied.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): SubscribeMultiApplied { - return AlgebraicType.deserializeValue(reader, SubscribeMultiApplied.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + SubscribeMultiApplied.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts index 84252d56f7c..dc2650d8c8e 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryId as __QueryId } from "./query_id_type"; +} from '../index'; +import { QueryId as __QueryId } from './query_id_type'; export type SubscribeMulti = { - queryStrings: string[], - requestId: number, - queryId: __QueryId, + queryStrings: string[]; + requestId: number; + queryId: __QueryId; }; export default SubscribeMulti; @@ -46,27 +46,37 @@ export default SubscribeMulti; */ export namespace SubscribeMulti { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "queryStrings", algebraicType: AlgebraicType.Array(AlgebraicType.String)}, - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, - ] + { + name: 'queryStrings', + algebraicType: AlgebraicType.Array(AlgebraicType.String), + }, + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'queryId', + algebraicType: __QueryId.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: SubscribeMulti): void { - AlgebraicType.serializeValue(writer, SubscribeMulti.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + SubscribeMulti.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): SubscribeMulti { - return AlgebraicType.deserializeValue(reader, SubscribeMulti.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + SubscribeMulti.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts index 434beca175c..4367f37460f 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { TableUpdate as __TableUpdate } from "./table_update_type"; +} from '../index'; +import { TableUpdate as __TableUpdate } from './table_update_type'; export type SubscribeRows = { - tableId: number, - tableName: string, - tableRows: __TableUpdate, + tableId: number; + tableName: string; + tableRows: __TableUpdate; }; export default SubscribeRows; @@ -46,27 +46,34 @@ export default SubscribeRows; */ export namespace SubscribeRows { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "tableId", algebraicType: AlgebraicType.U32}, - { name: "tableName", algebraicType: AlgebraicType.String}, - { name: "tableRows", algebraicType: __TableUpdate.getTypeScriptAlgebraicType()}, - ] + { name: 'tableId', algebraicType: AlgebraicType.U32 }, + { name: 'tableName', algebraicType: AlgebraicType.String }, + { + name: 'tableRows', + algebraicType: __TableUpdate.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: SubscribeRows): void { - AlgebraicType.serializeValue(writer, SubscribeRows.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + SubscribeRows.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): SubscribeRows { - return AlgebraicType.deserializeValue(reader, SubscribeRows.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + SubscribeRows.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts index 21c0ed16929..777b7009eb2 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryId as __QueryId } from "./query_id_type"; +} from '../index'; +import { QueryId as __QueryId } from './query_id_type'; export type SubscribeSingle = { - query: string, - requestId: number, - queryId: __QueryId, + query: string; + requestId: number; + queryId: __QueryId; }; export default SubscribeSingle; @@ -46,27 +46,37 @@ export default SubscribeSingle; */ export namespace SubscribeSingle { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "query", algebraicType: AlgebraicType.String}, - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, - ] + { name: 'query', algebraicType: AlgebraicType.String }, + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'queryId', + algebraicType: __QueryId.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: SubscribeSingle): void { - AlgebraicType.serializeValue(writer, SubscribeSingle.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: SubscribeSingle + ): void { + AlgebraicType.serializeValue( + writer, + SubscribeSingle.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): SubscribeSingle { - return AlgebraicType.deserializeValue(reader, SubscribeSingle.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + SubscribeSingle.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts index 2fd7824672e..a04d7037dd3 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts @@ -31,10 +31,10 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type Subscribe = { - queryStrings: string[], - requestId: number, + queryStrings: string[]; + requestId: number; }; export default Subscribe; @@ -43,26 +43,33 @@ export default Subscribe; */ export namespace Subscribe { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "queryStrings", algebraicType: AlgebraicType.Array(AlgebraicType.String)}, - { name: "requestId", algebraicType: AlgebraicType.U32}, - ] + { + name: 'queryStrings', + algebraicType: AlgebraicType.Array(AlgebraicType.String), + }, + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + ], }); } export function serialize(writer: BinaryWriter, value: Subscribe): void { - AlgebraicType.serializeValue(writer, Subscribe.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + Subscribe.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): Subscribe { - return AlgebraicType.deserializeValue(reader, Subscribe.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + Subscribe.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts index 0fd1c46e619..ea475a522eb 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; +} from '../index'; export type SubscriptionError = { - totalHostExecutionDurationMicros: bigint, - requestId: number | undefined, - queryId: number | undefined, - tableId: number | undefined, - error: string, + totalHostExecutionDurationMicros: bigint; + requestId: number | undefined; + queryId: number | undefined; + tableId: number | undefined; + error: string; }; export default SubscriptionError; @@ -46,29 +46,48 @@ export default SubscriptionError; */ export namespace SubscriptionError { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, - { name: "requestId", algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32)}, - { name: "queryId", algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32)}, - { name: "tableId", algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32)}, - { name: "error", algebraicType: AlgebraicType.String}, - ] + { + name: 'totalHostExecutionDurationMicros', + algebraicType: AlgebraicType.U64, + }, + { + name: 'requestId', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32), + }, + { + name: 'queryId', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32), + }, + { + name: 'tableId', + algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32), + }, + { name: 'error', algebraicType: AlgebraicType.String }, + ], }); } - export function serialize(writer: BinaryWriter, value: SubscriptionError): void { - AlgebraicType.serializeValue(writer, SubscriptionError.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: SubscriptionError + ): void { + AlgebraicType.serializeValue( + writer, + SubscriptionError.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): SubscriptionError { - return AlgebraicType.deserializeValue(reader, SubscriptionError.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + SubscriptionError.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts index 2f17b2e2be2..1ec2d86bd7c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts @@ -31,14 +31,14 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { CompressableQueryUpdate as __CompressableQueryUpdate } from "./compressable_query_update_type"; +} from '../index'; +import { CompressableQueryUpdate as __CompressableQueryUpdate } from './compressable_query_update_type'; export type TableUpdate = { - tableId: number, - tableName: string, - numRows: bigint, - updates: __CompressableQueryUpdate[], + tableId: number; + tableName: string; + numRows: bigint; + updates: __CompressableQueryUpdate[]; }; export default TableUpdate; @@ -47,28 +47,37 @@ export default TableUpdate; */ export namespace TableUpdate { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "tableId", algebraicType: AlgebraicType.U32}, - { name: "tableName", algebraicType: AlgebraicType.String}, - { name: "numRows", algebraicType: AlgebraicType.U64}, - { name: "updates", algebraicType: AlgebraicType.Array(__CompressableQueryUpdate.getTypeScriptAlgebraicType())}, - ] + { name: 'tableId', algebraicType: AlgebraicType.U32 }, + { name: 'tableName', algebraicType: AlgebraicType.String }, + { name: 'numRows', algebraicType: AlgebraicType.U64 }, + { + name: 'updates', + algebraicType: AlgebraicType.Array( + __CompressableQueryUpdate.getTypeScriptAlgebraicType() + ), + }, + ], }); } export function serialize(writer: BinaryWriter, value: TableUpdate): void { - AlgebraicType.serializeValue(writer, TableUpdate.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + TableUpdate.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): TableUpdate { - return AlgebraicType.deserializeValue(reader, TableUpdate.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + TableUpdate.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts b/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts index e3e352663ed..bd727980673 100644 --- a/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; +} from '../index'; +import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; export type TransactionUpdateLight = { - requestId: number, - update: __DatabaseUpdate, + requestId: number; + update: __DatabaseUpdate; }; export default TransactionUpdateLight; @@ -45,26 +45,36 @@ export default TransactionUpdateLight; */ export namespace TransactionUpdateLight { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "update", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType()}, - ] + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'update', + algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: TransactionUpdateLight): void { - AlgebraicType.serializeValue(writer, TransactionUpdateLight.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: TransactionUpdateLight + ): void { + AlgebraicType.serializeValue( + writer, + TransactionUpdateLight.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): TransactionUpdateLight { - return AlgebraicType.deserializeValue(reader, TransactionUpdateLight.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + TransactionUpdateLight.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts index 6faa15d1e2f..9c18fe8d771 100644 --- a/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts @@ -31,19 +31,19 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { UpdateStatus as __UpdateStatus } from "./update_status_type"; -import { ReducerCallInfo as __ReducerCallInfo } from "./reducer_call_info_type"; -import { EnergyQuanta as __EnergyQuanta } from "./energy_quanta_type"; +} from '../index'; +import { UpdateStatus as __UpdateStatus } from './update_status_type'; +import { ReducerCallInfo as __ReducerCallInfo } from './reducer_call_info_type'; +import { EnergyQuanta as __EnergyQuanta } from './energy_quanta_type'; export type TransactionUpdate = { - status: __UpdateStatus, - timestamp: Timestamp, - callerIdentity: Identity, - callerConnectionId: ConnectionId, - reducerCall: __ReducerCallInfo, - energyQuantaUsed: __EnergyQuanta, - totalHostExecutionDuration: TimeDuration, + status: __UpdateStatus; + timestamp: Timestamp; + callerIdentity: Identity; + callerConnectionId: ConnectionId; + reducerCall: __ReducerCallInfo; + energyQuantaUsed: __EnergyQuanta; + totalHostExecutionDuration: TimeDuration; }; export default TransactionUpdate; @@ -52,31 +52,59 @@ export default TransactionUpdate; */ export namespace TransactionUpdate { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "status", algebraicType: __UpdateStatus.getTypeScriptAlgebraicType()}, - { name: "timestamp", algebraicType: AlgebraicType.createTimestampType()}, - { name: "callerIdentity", algebraicType: AlgebraicType.createIdentityType()}, - { name: "callerConnectionId", algebraicType: AlgebraicType.createConnectionIdType()}, - { name: "reducerCall", algebraicType: __ReducerCallInfo.getTypeScriptAlgebraicType()}, - { name: "energyQuantaUsed", algebraicType: __EnergyQuanta.getTypeScriptAlgebraicType()}, - { name: "totalHostExecutionDuration", algebraicType: AlgebraicType.createTimeDurationType()}, - ] + { + name: 'status', + algebraicType: __UpdateStatus.getTypeScriptAlgebraicType(), + }, + { + name: 'timestamp', + algebraicType: AlgebraicType.createTimestampType(), + }, + { + name: 'callerIdentity', + algebraicType: AlgebraicType.createIdentityType(), + }, + { + name: 'callerConnectionId', + algebraicType: AlgebraicType.createConnectionIdType(), + }, + { + name: 'reducerCall', + algebraicType: __ReducerCallInfo.getTypeScriptAlgebraicType(), + }, + { + name: 'energyQuantaUsed', + algebraicType: __EnergyQuanta.getTypeScriptAlgebraicType(), + }, + { + name: 'totalHostExecutionDuration', + algebraicType: AlgebraicType.createTimeDurationType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: TransactionUpdate): void { - AlgebraicType.serializeValue(writer, TransactionUpdate.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: TransactionUpdate + ): void { + AlgebraicType.serializeValue( + writer, + TransactionUpdate.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): TransactionUpdate { - return AlgebraicType.deserializeValue(reader, TransactionUpdate.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + TransactionUpdate.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts index 8e84fffa198..0b78732b851 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts @@ -31,15 +31,15 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryId as __QueryId } from "./query_id_type"; -import { SubscribeRows as __SubscribeRows } from "./subscribe_rows_type"; +} from '../index'; +import { QueryId as __QueryId } from './query_id_type'; +import { SubscribeRows as __SubscribeRows } from './subscribe_rows_type'; export type UnsubscribeApplied = { - requestId: number, - totalHostExecutionDurationMicros: bigint, - queryId: __QueryId, - rows: __SubscribeRows, + requestId: number; + totalHostExecutionDurationMicros: bigint; + queryId: __QueryId; + rows: __SubscribeRows; }; export default UnsubscribeApplied; @@ -48,28 +48,44 @@ export default UnsubscribeApplied; */ export namespace UnsubscribeApplied { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, - { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, - { name: "rows", algebraicType: __SubscribeRows.getTypeScriptAlgebraicType()}, - ] + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'totalHostExecutionDurationMicros', + algebraicType: AlgebraicType.U64, + }, + { + name: 'queryId', + algebraicType: __QueryId.getTypeScriptAlgebraicType(), + }, + { + name: 'rows', + algebraicType: __SubscribeRows.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: UnsubscribeApplied): void { - AlgebraicType.serializeValue(writer, UnsubscribeApplied.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: UnsubscribeApplied + ): void { + AlgebraicType.serializeValue( + writer, + UnsubscribeApplied.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): UnsubscribeApplied { - return AlgebraicType.deserializeValue(reader, UnsubscribeApplied.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + UnsubscribeApplied.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts index 7ba3ad72698..fb17896d6fb 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts @@ -31,15 +31,15 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryId as __QueryId } from "./query_id_type"; -import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; +} from '../index'; +import { QueryId as __QueryId } from './query_id_type'; +import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; export type UnsubscribeMultiApplied = { - requestId: number, - totalHostExecutionDurationMicros: bigint, - queryId: __QueryId, - update: __DatabaseUpdate, + requestId: number; + totalHostExecutionDurationMicros: bigint; + queryId: __QueryId; + update: __DatabaseUpdate; }; export default UnsubscribeMultiApplied; @@ -48,28 +48,44 @@ export default UnsubscribeMultiApplied; */ export namespace UnsubscribeMultiApplied { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "totalHostExecutionDurationMicros", algebraicType: AlgebraicType.U64}, - { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, - { name: "update", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType()}, - ] + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'totalHostExecutionDurationMicros', + algebraicType: AlgebraicType.U64, + }, + { + name: 'queryId', + algebraicType: __QueryId.getTypeScriptAlgebraicType(), + }, + { + name: 'update', + algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: UnsubscribeMultiApplied): void { - AlgebraicType.serializeValue(writer, UnsubscribeMultiApplied.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: UnsubscribeMultiApplied + ): void { + AlgebraicType.serializeValue( + writer, + UnsubscribeMultiApplied.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): UnsubscribeMultiApplied { - return AlgebraicType.deserializeValue(reader, UnsubscribeMultiApplied.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + UnsubscribeMultiApplied.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts index e3cdbbd56d7..69e8d704367 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryId as __QueryId } from "./query_id_type"; +} from '../index'; +import { QueryId as __QueryId } from './query_id_type'; export type UnsubscribeMulti = { - requestId: number, - queryId: __QueryId, + requestId: number; + queryId: __QueryId; }; export default UnsubscribeMulti; @@ -45,26 +45,36 @@ export default UnsubscribeMulti; */ export namespace UnsubscribeMulti { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, - ] + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'queryId', + algebraicType: __QueryId.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: UnsubscribeMulti): void { - AlgebraicType.serializeValue(writer, UnsubscribeMulti.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: UnsubscribeMulti + ): void { + AlgebraicType.serializeValue( + writer, + UnsubscribeMulti.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): UnsubscribeMulti { - return AlgebraicType.deserializeValue(reader, UnsubscribeMulti.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + UnsubscribeMulti.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts index 92519980047..a6391629b1c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts @@ -31,12 +31,12 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { QueryId as __QueryId } from "./query_id_type"; +} from '../index'; +import { QueryId as __QueryId } from './query_id_type'; export type Unsubscribe = { - requestId: number, - queryId: __QueryId, + requestId: number; + queryId: __QueryId; }; export default Unsubscribe; @@ -45,26 +45,33 @@ export default Unsubscribe; */ export namespace Unsubscribe { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "requestId", algebraicType: AlgebraicType.U32}, - { name: "queryId", algebraicType: __QueryId.getTypeScriptAlgebraicType()}, - ] + { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { + name: 'queryId', + algebraicType: __QueryId.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: Unsubscribe): void { - AlgebraicType.serializeValue(writer, Unsubscribe.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + Unsubscribe.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): Unsubscribe { - return AlgebraicType.deserializeValue(reader, Unsubscribe.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + Unsubscribe.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts index e2a88a749d1..1336844778c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts @@ -31,8 +31,8 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "../index"; -import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; +} from '../index'; +import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; // These are the generated variant types for each variant of the tagged union. // One type is generated per variant and will be used in the `value` field of @@ -42,9 +42,9 @@ import { DatabaseUpdate as __DatabaseUpdate } from "./database_update_type"; // the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` // type. e.g. `const x: FooVariants.Variant` export namespace UpdateStatusVariants { - export type Committed = { tag: "Committed", value: __DatabaseUpdate }; - export type Failed = { tag: "Failed", value: string }; - export type OutOfEnergy = { tag: "OutOfEnergy" }; + export type Committed = { tag: 'Committed'; value: __DatabaseUpdate }; + export type Failed = { tag: 'Failed'; value: string }; + export type OutOfEnergy = { tag: 'OutOfEnergy' }; } // A namespace for generated variants and helper functions. @@ -55,34 +55,52 @@ export namespace UpdateStatus { // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Committed = (value: __DatabaseUpdate): UpdateStatus => ({ tag: "Committed", value }); - export const Failed = (value: string): UpdateStatus => ({ tag: "Failed", value }); - export const OutOfEnergy: { tag: "OutOfEnergy" } = { tag: "OutOfEnergy" }; + export const Committed = (value: __DatabaseUpdate): UpdateStatus => ({ + tag: 'Committed', + value, + }); + export const Failed = (value: string): UpdateStatus => ({ + tag: 'Failed', + value, + }); + export const OutOfEnergy: { tag: 'OutOfEnergy' } = { tag: 'OutOfEnergy' }; export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ - { name: "Committed", algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType() }, - { name: "Failed", algebraicType: AlgebraicType.String }, - { name: "OutOfEnergy", algebraicType: AlgebraicType.Product({ elements: [] }) }, - ] + { + name: 'Committed', + algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + { name: 'Failed', algebraicType: AlgebraicType.String }, + { + name: 'OutOfEnergy', + algebraicType: AlgebraicType.Product({ elements: [] }), + }, + ], }); } export function serialize(writer: BinaryWriter, value: UpdateStatus): void { - AlgebraicType.serializeValue(writer, UpdateStatus.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + UpdateStatus.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): UpdateStatus { - return AlgebraicType.deserializeValue(reader, UpdateStatus.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + UpdateStatus.getTypeScriptAlgebraicType() + ); } - } // The tagged union or sum type for the algebraic type `UpdateStatus`. -export type UpdateStatus = UpdateStatus.Committed | - UpdateStatus.Failed | - UpdateStatus.OutOfEnergy; +export type UpdateStatus = + | UpdateStatus.Committed + | UpdateStatus.Failed + | UpdateStatus.OutOfEnergy; export default UpdateStatus; - diff --git a/sdks/typescript/packages/sdk/src/db_connection_impl.ts b/sdks/typescript/packages/sdk/src/db_connection_impl.ts index 4d7c9e44a46..5dcf88c1339 100644 --- a/sdks/typescript/packages/sdk/src/db_connection_impl.ts +++ b/sdks/typescript/packages/sdk/src/db_connection_impl.ts @@ -8,9 +8,7 @@ import { SumTypeVariant, type ComparablePrimitive, } from 'spacetimedb'; -import { - parseValue, -} from 'spacetimedb'; +import { parseValue } from 'spacetimedb'; import { BinaryReader } from 'spacetimedb'; import { BinaryWriter } from 'spacetimedb'; import { BsatnRowList } from './client_api/bsatn_row_list_type.ts'; @@ -319,7 +317,7 @@ export class DbConnectionImpl< let rowId: ComparablePrimitive | undefined = undefined; if (primaryKeyInfo !== undefined) { rowId = AlgebraicType.intoMapKey( - primaryKeyInfo.colType, + primaryKeyInfo.colType, row[primaryKeyInfo.colName] ); } else { @@ -611,7 +609,10 @@ export class DbConnectionImpl< this.#remoteModule.reducers[reducerInfo.reducerName]; try { const reader = new BinaryReader(reducerInfo.args as Uint8Array); - reducerArgs = AlgebraicType.deserializeValue(reader, reducerTypeInfo.argsType); + reducerArgs = AlgebraicType.deserializeValue( + reader, + reducerTypeInfo.argsType + ); } catch { // This should only be printed in development, since it's // possible for clients to receive new reducers that they don't @@ -674,7 +675,9 @@ export class DbConnectionImpl< ); const argsArray: any[] = []; - (reducerTypeInfo.argsType as AlgebraicTypeVariants.Product).value.elements.forEach((element, index) => { + ( + reducerTypeInfo.argsType as AlgebraicTypeVariants.Product + ).value.elements.forEach((element, index) => { argsArray.push(reducerArgs[element.name!]); }); this.#reducerEmitter.emit( diff --git a/sdks/typescript/packages/sdk/src/index.ts b/sdks/typescript/packages/sdk/src/index.ts index af7e70a119f..ee1df19fe19 100644 --- a/sdks/typescript/packages/sdk/src/index.ts +++ b/sdks/typescript/packages/sdk/src/index.ts @@ -1,7 +1,6 @@ - // Should be at the top as other modules depend on it export * from './db_connection_impl.ts'; -export * from "spacetimedb"; +export * from 'spacetimedb'; export * from './client_cache.ts'; export * from './message_types.ts'; diff --git a/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts b/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts index 8e741573ca8..2bdbd4ed018 100644 --- a/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts +++ b/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts @@ -29,7 +29,11 @@ class WebsocketTestAdapter { sendToClient(message: ServerMessage): void { const writer = new BinaryWriter(1024); - AlgebraicType.serializeValue(writer, ServerMessage.getTypeScriptAlgebraicType(), message); + AlgebraicType.serializeValue( + writer, + ServerMessage.getTypeScriptAlgebraicType(), + message + ); const rawBytes = writer.getBuffer(); // The brotli library's `compress` is somehow broken: it returns `null` for some inputs. // See https://github.com/foliojs/brotli.js/issues/36, which is closed but not actually fixed. @@ -40,9 +44,9 @@ class WebsocketTestAdapter { } async createWebSocketFn(args: { - url: URL, - wsProtocol: string, - authToken?: string + url: URL; + wsProtocol: string; + authToken?: string; }): Promise { return this; } diff --git a/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts b/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts index 2bc6e608a8b..913f9eb83d3 100644 --- a/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts +++ b/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts @@ -3,12 +3,10 @@ import { AlgebraicType, BinaryReader, BinaryWriter } from 'spacetimedb'; describe('AlgebraicValue', () => { test('when created with a ProductValue it assigns the product property', () => { - const value = { foo: "foobar" }; + const value = { foo: 'foobar' }; const algebraic_type = AlgebraicType.Product({ - elements: [ - { name: "foo", algebraicType: AlgebraicType.String }, - ], - }) + elements: [{ name: 'foo', algebraicType: AlgebraicType.String }], + }); const binaryWriter = new BinaryWriter(1024); AlgebraicType.serializeValue(binaryWriter, algebraic_type, value); diff --git a/sdks/typescript/packages/sdk/tests/table_cache.test.ts b/sdks/typescript/packages/sdk/tests/table_cache.test.ts index 029434496ae..e2a97cbc980 100644 --- a/sdks/typescript/packages/sdk/tests/table_cache.test.ts +++ b/sdks/typescript/packages/sdk/tests/table_cache.test.ts @@ -4,7 +4,11 @@ import { describe, expect, test } from 'vitest'; import { Player } from '@clockworklabs/test-app/src/module_bindings'; -import { AlgebraicType, ProductType, type AlgebraicTypeVariants } from 'spacetimedb'; +import { + AlgebraicType, + ProductType, + type AlgebraicTypeVariants, +} from 'spacetimedb'; interface ApplyOperations { ops: Operation[]; @@ -103,14 +107,14 @@ describe('TableCache', () => { elements: [ { name: 'x', algebraicType: AlgebraicType.U16 }, { name: 'y', algebraicType: AlgebraicType.U16 }, - ] + ], }); const playerType = AlgebraicType.Product({ elements: [ { name: 'ownerId', algebraicType: AlgebraicType.String }, { name: 'name', algebraicType: AlgebraicType.String }, { name: 'location', algebraicType: pointType }, - ] + ], }); const tableTypeInfo: TableRuntimeTypeInfo = { tableName: 'player', @@ -410,21 +414,22 @@ describe('TableCache', () => { elements: [ { name: 'x', algebraicType: AlgebraicType.U16 }, { name: 'y', algebraicType: AlgebraicType.U16 }, - ] + ], }); const playerType: AlgebraicType = AlgebraicType.Product({ elements: [ { name: 'ownerId', algebraicType: AlgebraicType.String }, { name: 'name', algebraicType: AlgebraicType.String }, { name: 'location', algebraicType: pointType }, - ] + ], }); const tableTypeInfo: TableRuntimeTypeInfo = { tableName: 'player', rowType: playerType, primaryKeyInfo: { colName: 'ownerId', - colType: (playerType as AlgebraicTypeVariants.Product).value.elements[0].algebraicType, + colType: (playerType as AlgebraicTypeVariants.Product).value.elements[0] + .algebraicType, }, }; const newTable = () => new TableCache(tableTypeInfo); @@ -769,14 +774,14 @@ describe('TableCache', () => { elements: [ { name: 'x', algebraicType: AlgebraicType.U16 }, { name: 'y', algebraicType: AlgebraicType.U16 }, - ] + ], }); const playerType = AlgebraicType.Product({ elements: [ { name: 'ownerId', algebraicType: AlgebraicType.String }, { name: 'name', algebraicType: AlgebraicType.String }, { name: 'location', algebraicType: pointType }, - ] + ], }); test('should be empty on creation', () => { @@ -785,7 +790,8 @@ describe('TableCache', () => { rowType: playerType, primaryKeyInfo: { colName: 'ownerId', - colType: (playerType as AlgebraicTypeVariants.Product).value.elements[0].algebraicType, + colType: (playerType as AlgebraicTypeVariants.Product).value.elements[0] + .algebraicType, }, }; const tableCache = new TableCache(tableTypeInfo); diff --git a/sdks/typescript/vitest.config.ts b/sdks/typescript/vitest.config.ts index 47876caf89d..7de9bbad8ac 100644 --- a/sdks/typescript/vitest.config.ts +++ b/sdks/typescript/vitest.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'vitest/config' +import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { @@ -15,4 +15,4 @@ export default defineConfig({ preserveSymlinks: true, // useful with pnpm workspaces/links extensions: ['.ts', '.tsx', '.mjs', '.js', '.json'], }, -}) \ No newline at end of file +}); From 9c465fc007dab71c7f0d73208fb1f9e5f5c06711 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 19 Aug 2025 21:40:33 -0400 Subject: [PATCH 10/37] Fixed broken import --- .../src/autogen/product_type_element_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_column_def_v_8_type.ts | 2 +- crates/bindings-typescript/src/autogen/sum_type_variant_type.ts | 2 +- crates/bindings-typescript/src/autogen/typespace_type.ts | 2 +- crates/codegen/examples/regen-typescript-moduledef.rs | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/bindings-typescript/src/autogen/product_type_element_type.ts b/crates/bindings-typescript/src/autogen/product_type_element_type.ts index 5535ce89bbe..2a25091e8cb 100644 --- a/crates/bindings-typescript/src/autogen/product_type_element_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -32,7 +32,7 @@ import { type ReducerEventContextInterface, type SubscriptionEventContextInterface, } from '../index'; -import { AlgebraicType as __AlgebraicType } from './algebraic_type_type'; +import { __AlgebraicType } from './algebraic_type_type'; export type ProductTypeElement = { name: string | undefined; diff --git a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts index 04cd3a2c21f..89a6a3d2c38 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts @@ -32,7 +32,7 @@ import { type ReducerEventContextInterface, type SubscriptionEventContextInterface, } from '../index'; -import { AlgebraicType as __AlgebraicType } from './algebraic_type_type'; +import { __AlgebraicType } from './algebraic_type_type'; export type RawColumnDefV8 = { colName: string; diff --git a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts index 1bede6a96d5..7575d755d21 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -32,7 +32,7 @@ import { type ReducerEventContextInterface, type SubscriptionEventContextInterface, } from '../index'; -import { AlgebraicType as __AlgebraicType } from './algebraic_type_type'; +import { __AlgebraicType } from './algebraic_type_type'; export type SumTypeVariant = { name: string | undefined; diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts index e9d08c905d5..16e4200b704 100644 --- a/crates/bindings-typescript/src/autogen/typespace_type.ts +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -32,7 +32,7 @@ import { type ReducerEventContextInterface, type SubscriptionEventContextInterface, } from '../index'; -import { AlgebraicType as __AlgebraicType } from './algebraic_type_type'; +import { __AlgebraicType } from './algebraic_type_type'; export type Typespace = { types: __AlgebraicType[]; diff --git a/crates/codegen/examples/regen-typescript-moduledef.rs b/crates/codegen/examples/regen-typescript-moduledef.rs index f71c3e01297..1b07d0d0c7c 100644 --- a/crates/codegen/examples/regen-typescript-moduledef.rs +++ b/crates/codegen/examples/regen-typescript-moduledef.rs @@ -40,6 +40,7 @@ fn main() -> anyhow::Result<()> { return Ok(()); } let code = regex_replace!(&code, r"@clockworklabs/spacetimedb-sdk", "../index"); + let code = &code.replace("AlgebraicType as __AlgebraicType", "__AlgebraicType"); fs::write(dir.join(filename), code.as_bytes()) })?; From b143a3ad591090120a8af1aca371e0d05989f297 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 19 Aug 2025 21:46:46 -0400 Subject: [PATCH 11/37] Updated snap files --- .../codegen__codegen_typescript.snap | 486 +++++++++++------- 1 file changed, 298 insertions(+), 188 deletions(-) diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index 43caad9b21d..210eb621876 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -41,6 +41,7 @@ import { export type AddPlayer = { name: string, }; +export default AddPlayer; /** * A namespace for generated helper functions. @@ -51,17 +52,19 @@ export namespace AddPlayer { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: AddPlayer): void { - AddPlayer.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, AddPlayer.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): AddPlayer { - return AddPlayer.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, AddPlayer.getTypeScriptAlgebraicType()); } } @@ -106,6 +109,7 @@ import { export type AddPrivate = { name: string, }; +export default AddPrivate; /** * A namespace for generated helper functions. @@ -116,17 +120,19 @@ export namespace AddPrivate { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: AddPrivate): void { - AddPrivate.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, AddPrivate.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): AddPrivate { - return AddPrivate.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, AddPrivate.getTypeScriptAlgebraicType()); } } @@ -172,6 +178,7 @@ export type Add = { name: string, age: number, }; +export default Add; /** * A namespace for generated helper functions. @@ -182,18 +189,20 @@ export namespace Add { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - new ProductTypeElement("age", AlgebraicType.createU8Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + { name: "age", algebraicType: AlgebraicType.U8}, + ] + }); } export function serialize(writer: BinaryWriter, value: Add): void { - Add.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Add.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Add { - return Add.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Add.getTypeScriptAlgebraicType()); } } @@ -236,6 +245,7 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type AssertCallerIdentityIsModuleIdentity = {}; +export default AssertCallerIdentityIsModuleIdentity; /** * A namespace for generated helper functions. @@ -246,16 +256,18 @@ export namespace AssertCallerIdentityIsModuleIdentity { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - ]); + return AlgebraicType.Product({ + elements: [ + ] + }); } export function serialize(writer: BinaryWriter, value: AssertCallerIdentityIsModuleIdentity): void { - AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): AssertCallerIdentityIsModuleIdentity { - return AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType()); } } @@ -299,6 +311,7 @@ import { export type Baz = { field: string, }; +export default Baz; /** * A namespace for generated helper functions. @@ -309,17 +322,19 @@ export namespace Baz { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("field", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "field", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: Baz): void { - Baz.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Baz.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Baz { - return Baz.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Baz.getTypeScriptAlgebraicType()); } } @@ -363,6 +378,7 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type ClientConnected = {}; +export default ClientConnected; /** * A namespace for generated helper functions. @@ -373,16 +389,18 @@ export namespace ClientConnected { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - ]); + return AlgebraicType.Product({ + elements: [ + ] + }); } export function serialize(writer: BinaryWriter, value: ClientConnected): void { - ClientConnected.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, ClientConnected.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): ClientConnected { - return ClientConnected.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, ClientConnected.getTypeScriptAlgebraicType()); } } @@ -427,6 +445,7 @@ import { export type DeletePlayer = { id: bigint, }; +export default DeletePlayer; /** * A namespace for generated helper functions. @@ -437,17 +456,19 @@ export namespace DeletePlayer { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("id", AlgebraicType.createU64Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "id", algebraicType: AlgebraicType.U64}, + ] + }); } export function serialize(writer: BinaryWriter, value: DeletePlayer): void { - DeletePlayer.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, DeletePlayer.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): DeletePlayer { - return DeletePlayer.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, DeletePlayer.getTypeScriptAlgebraicType()); } } @@ -492,6 +513,7 @@ import { export type DeletePlayersByName = { name: string, }; +export default DeletePlayersByName; /** * A namespace for generated helper functions. @@ -502,17 +524,19 @@ export namespace DeletePlayersByName { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: DeletePlayersByName): void { - DeletePlayersByName.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, DeletePlayersByName.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): DeletePlayersByName { - return DeletePlayersByName.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, DeletePlayersByName.getTypeScriptAlgebraicType()); } } @@ -555,15 +579,21 @@ import { } from "@clockworklabs/spacetimedb-sdk"; import { Baz as __Baz } from "./baz_type"; -// A namespace for generated variants and helper functions. -export namespace Foobar { - // These are the generated variant types for each variant of the tagged union. - // One type is generated per variant and will be used in the `value` field of - // the tagged union. +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace FoobarVariants { export type Baz = { tag: "Baz", value: __Baz }; export type Bar = { tag: "Bar" }; export type Har = { tag: "Har", value: number }; +} +// A namespace for generated variants and helper functions. +export namespace Foobar { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); @@ -571,29 +601,33 @@ export namespace Foobar { // assert!(foo.value === 42); // ``` export const Baz = (value: __Baz): Foobar => ({ tag: "Baz", value }); - export const Bar = { tag: "Bar" }; + export const Bar: { tag: "Bar" } = { tag: "Bar" }; export const Har = (value: number): Foobar => ({ tag: "Har", value }); export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant("Baz", __Baz.getTypeScriptAlgebraicType()), - new SumTypeVariant("Bar", AlgebraicType.createProductType([])), - new SumTypeVariant("Har", AlgebraicType.createU32Type()), - ]); + return AlgebraicType.Sum({ + variants: [ + { name: "Baz", algebraicType: __Baz.getTypeScriptAlgebraicType() }, + { name: "Bar", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "Har", algebraicType: AlgebraicType.U32 }, + ] + }); } export function serialize(writer: BinaryWriter, value: Foobar): void { - Foobar.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Foobar.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Foobar { - return Foobar.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Foobar.getTypeScriptAlgebraicType()); } } // The tagged union or sum type for the algebraic type `Foobar`. -export type Foobar = Foobar.Baz | Foobar.Bar | Foobar.Har; +export type Foobar = FoobarVariants.Baz | + FoobarVariants.Bar | + FoobarVariants.Har; export default Foobar; @@ -717,6 +751,7 @@ export type HasSpecialStuff = { identity: Identity, connectionId: ConnectionId, }; +export default HasSpecialStuff; /** * A namespace for generated helper functions. @@ -727,18 +762,20 @@ export namespace HasSpecialStuff { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("identity", AlgebraicType.createIdentityType()), - new ProductTypeElement("connectionId", AlgebraicType.createConnectionIdType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "identity", algebraicType: AlgebraicType.createIdentityType()}, + { name: "connectionId", algebraicType: AlgebraicType.createConnectionIdType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: HasSpecialStuff): void { - HasSpecialStuff.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, HasSpecialStuff.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): HasSpecialStuff { - return HasSpecialStuff.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, HasSpecialStuff.getTypeScriptAlgebraicType()); } } @@ -1431,6 +1468,7 @@ import { export type ListOverAge = { age: number, }; +export default ListOverAge; /** * A namespace for generated helper functions. @@ -1441,17 +1479,19 @@ export namespace ListOverAge { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("age", AlgebraicType.createU8Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "age", algebraicType: AlgebraicType.U8}, + ] + }); } export function serialize(writer: BinaryWriter, value: ListOverAge): void { - ListOverAge.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, ListOverAge.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): ListOverAge { - return ListOverAge.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, ListOverAge.getTypeScriptAlgebraicType()); } } @@ -1494,6 +1534,7 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type LogModuleIdentity = {}; +export default LogModuleIdentity; /** * A namespace for generated helper functions. @@ -1504,16 +1545,18 @@ export namespace LogModuleIdentity { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - ]); + return AlgebraicType.Product({ + elements: [ + ] + }); } export function serialize(writer: BinaryWriter, value: LogModuleIdentity): void { - LogModuleIdentity.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, LogModuleIdentity.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): LogModuleIdentity { - return LogModuleIdentity.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, LogModuleIdentity.getTypeScriptAlgebraicType()); } } @@ -1708,42 +1751,51 @@ import { type ReducerEventContextInterface, type SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -// A namespace for generated variants and helper functions. -export namespace NamespaceTestC { - // These are the generated variant types for each variant of the tagged union. - // One type is generated per variant and will be used in the `value` field of - // the tagged union. +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace NamespaceTestCVariants { export type Foo = { tag: "Foo" }; export type Bar = { tag: "Bar" }; +} +// A namespace for generated variants and helper functions. +export namespace NamespaceTestC { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Foo = { tag: "Foo" }; - export const Bar = { tag: "Bar" }; + export const Foo: { tag: "Foo" } = { tag: "Foo" }; + export const Bar: { tag: "Bar" } = { tag: "Bar" }; export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant("Foo", AlgebraicType.createProductType([])), - new SumTypeVariant("Bar", AlgebraicType.createProductType([])), - ]); + return AlgebraicType.Sum({ + variants: [ + { name: "Foo", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "Bar", algebraicType: AlgebraicType.Product({ elements: [] }) }, + ] + }); } export function serialize(writer: BinaryWriter, value: NamespaceTestC): void { - NamespaceTestC.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, NamespaceTestC.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): NamespaceTestC { - return NamespaceTestC.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, NamespaceTestC.getTypeScriptAlgebraicType()); } } // The tagged union or sum type for the algebraic type `NamespaceTestC`. -export type NamespaceTestC = NamespaceTestC.Foo | NamespaceTestC.Bar; +export type NamespaceTestC = NamespaceTestCVariants.Foo | + NamespaceTestCVariants.Bar; export default NamespaceTestC; @@ -1783,45 +1835,55 @@ import { type ReducerEventContextInterface, type SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -// A namespace for generated variants and helper functions. -export namespace NamespaceTestF { - // These are the generated variant types for each variant of the tagged union. - // One type is generated per variant and will be used in the `value` field of - // the tagged union. +// These are the generated variant types for each variant of the tagged union. +// One type is generated per variant and will be used in the `value` field of +// the tagged union. +// NOTE: These are generated in a separate namespace because TypeScript +// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of +// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` +// type. e.g. `const x: FooVariants.Variant` +export namespace NamespaceTestFVariants { export type Foo = { tag: "Foo" }; export type Bar = { tag: "Bar" }; export type Baz = { tag: "Baz", value: string }; +} +// A namespace for generated variants and helper functions. +export namespace NamespaceTestF { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Foo = { tag: "Foo" }; - export const Bar = { tag: "Bar" }; + export const Foo: { tag: "Foo" } = { tag: "Foo" }; + export const Bar: { tag: "Bar" } = { tag: "Bar" }; export const Baz = (value: string): NamespaceTestF => ({ tag: "Baz", value }); export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant("Foo", AlgebraicType.createProductType([])), - new SumTypeVariant("Bar", AlgebraicType.createProductType([])), - new SumTypeVariant("Baz", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Sum({ + variants: [ + { name: "Foo", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "Bar", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "Baz", algebraicType: AlgebraicType.String }, + ] + }); } export function serialize(writer: BinaryWriter, value: NamespaceTestF): void { - NamespaceTestF.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, NamespaceTestF.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): NamespaceTestF { - return NamespaceTestF.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, NamespaceTestF.getTypeScriptAlgebraicType()); } } // The tagged union or sum type for the algebraic type `NamespaceTestF`. -export type NamespaceTestF = NamespaceTestF.Foo | NamespaceTestF.Bar | NamespaceTestF.Baz; +export type NamespaceTestF = NamespaceTestFVariants.Foo | + NamespaceTestFVariants.Bar | + NamespaceTestFVariants.Baz; export default NamespaceTestF; @@ -1976,6 +2038,7 @@ export type Person = { name: string, age: number, }; +export default Person; /** * A namespace for generated helper functions. @@ -1986,19 +2049,21 @@ export namespace Person { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("id", AlgebraicType.createU32Type()), - new ProductTypeElement("name", AlgebraicType.createStringType()), - new ProductTypeElement("age", AlgebraicType.createU8Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "id", algebraicType: AlgebraicType.U32}, + { name: "name", algebraicType: AlgebraicType.String}, + { name: "age", algebraicType: AlgebraicType.U8}, + ] + }); } export function serialize(writer: BinaryWriter, value: Person): void { - Person.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Person.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Person { - return Person.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Person.getTypeScriptAlgebraicType()); } } @@ -2176,6 +2241,7 @@ export type PkMultiIdentity = { id: number, other: number, }; +export default PkMultiIdentity; /** * A namespace for generated helper functions. @@ -2186,18 +2252,20 @@ export namespace PkMultiIdentity { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("id", AlgebraicType.createU32Type()), - new ProductTypeElement("other", AlgebraicType.createU32Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "id", algebraicType: AlgebraicType.U32}, + { name: "other", algebraicType: AlgebraicType.U32}, + ] + }); } export function serialize(writer: BinaryWriter, value: PkMultiIdentity): void { - PkMultiIdentity.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, PkMultiIdentity.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): PkMultiIdentity { - return PkMultiIdentity.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, PkMultiIdentity.getTypeScriptAlgebraicType()); } } @@ -2398,6 +2466,7 @@ export type Player = { playerId: bigint, name: string, }; +export default Player; /** * A namespace for generated helper functions. @@ -2408,19 +2477,21 @@ export namespace Player { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("identity", AlgebraicType.createIdentityType()), - new ProductTypeElement("playerId", AlgebraicType.createU64Type()), - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "identity", algebraicType: AlgebraicType.createIdentityType()}, + { name: "playerId", algebraicType: AlgebraicType.U64}, + { name: "name", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: Player): void { - Player.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Player.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Player { - return Player.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Player.getTypeScriptAlgebraicType()); } } @@ -2466,6 +2537,7 @@ export type Point = { x: bigint, y: bigint, }; +export default Point; /** * A namespace for generated helper functions. @@ -2476,18 +2548,20 @@ export namespace Point { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("x", AlgebraicType.createI64Type()), - new ProductTypeElement("y", AlgebraicType.createI64Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "x", algebraicType: AlgebraicType.I64}, + { name: "y", algebraicType: AlgebraicType.I64}, + ] + }); } export function serialize(writer: BinaryWriter, value: Point): void { - Point.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Point.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Point { - return Point.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Point.getTypeScriptAlgebraicType()); } } @@ -2692,6 +2766,7 @@ import { export type PrivateTable = { name: string, }; +export default PrivateTable; /** * A namespace for generated helper functions. @@ -2702,17 +2777,19 @@ export namespace PrivateTable { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: PrivateTable): void { - PrivateTable.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, PrivateTable.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): PrivateTable { - return PrivateTable.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, PrivateTable.getTypeScriptAlgebraicType()); } } @@ -2756,6 +2833,7 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type QueryPrivate = {}; +export default QueryPrivate; /** * A namespace for generated helper functions. @@ -2766,16 +2844,18 @@ export namespace QueryPrivate { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - ]); + return AlgebraicType.Product({ + elements: [ + ] + }); } export function serialize(writer: BinaryWriter, value: QueryPrivate): void { - QueryPrivate.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, QueryPrivate.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): QueryPrivate { - return QueryPrivate.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, QueryPrivate.getTypeScriptAlgebraicType()); } } @@ -2931,6 +3011,7 @@ export type RepeatingTestArg = { scheduledAt: { tag: "Interval", value: TimeDuration } | { tag: "Time", value: Timestamp }, prevTime: Timestamp, }; +export default RepeatingTestArg; /** * A namespace for generated helper functions. @@ -2941,19 +3022,21 @@ export namespace RepeatingTestArg { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("scheduledId", AlgebraicType.createU64Type()), - new ProductTypeElement("scheduledAt", AlgebraicType.createScheduleAtType()), - new ProductTypeElement("prevTime", AlgebraicType.createTimestampType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "scheduledId", algebraicType: AlgebraicType.U64}, + { name: "scheduledAt", algebraicType: AlgebraicType.createScheduleAtType()}, + { name: "prevTime", algebraicType: AlgebraicType.createTimestampType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: RepeatingTestArg): void { - RepeatingTestArg.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, RepeatingTestArg.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): RepeatingTestArg { - return RepeatingTestArg.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, RepeatingTestArg.getTypeScriptAlgebraicType()); } } @@ -3001,6 +3084,7 @@ import { RepeatingTestArg as __RepeatingTestArg } from "./repeating_test_arg_typ export type RepeatingTest = { arg: __RepeatingTestArg, }; +export default RepeatingTest; /** * A namespace for generated helper functions. @@ -3011,17 +3095,19 @@ export namespace RepeatingTest { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("arg", __RepeatingTestArg.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "arg", algebraicType: __RepeatingTestArg.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: RepeatingTest): void { - RepeatingTest.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, RepeatingTest.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): RepeatingTest { - return RepeatingTest.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, RepeatingTest.getTypeScriptAlgebraicType()); } } @@ -3064,6 +3150,7 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type SayHello = {}; +export default SayHello; /** * A namespace for generated helper functions. @@ -3074,16 +3161,18 @@ export namespace SayHello { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - ]); + return AlgebraicType.Product({ + elements: [ + ] + }); } export function serialize(writer: BinaryWriter, value: SayHello): void { - SayHello.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, SayHello.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): SayHello { - return SayHello.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, SayHello.getTypeScriptAlgebraicType()); } } @@ -3209,6 +3298,7 @@ export type TestA = { y: number, z: string, }; +export default TestA; /** * A namespace for generated helper functions. @@ -3219,19 +3309,21 @@ export namespace TestA { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("x", AlgebraicType.createU32Type()), - new ProductTypeElement("y", AlgebraicType.createU32Type()), - new ProductTypeElement("z", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "x", algebraicType: AlgebraicType.U32}, + { name: "y", algebraicType: AlgebraicType.U32}, + { name: "z", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: TestA): void { - TestA.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, TestA.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TestA { - return TestA.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, TestA.getTypeScriptAlgebraicType()); } } @@ -3276,6 +3368,7 @@ import { export type TestB = { foo: string, }; +export default TestB; /** * A namespace for generated helper functions. @@ -3286,17 +3379,19 @@ export namespace TestB { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("foo", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "foo", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: TestB): void { - TestB.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, TestB.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TestB { - return TestB.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, TestB.getTypeScriptAlgebraicType()); } } @@ -3340,6 +3435,7 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type TestBtreeIndexArgs = {}; +export default TestBtreeIndexArgs; /** * A namespace for generated helper functions. @@ -3350,16 +3446,18 @@ export namespace TestBtreeIndexArgs { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - ]); + return AlgebraicType.Product({ + elements: [ + ] + }); } export function serialize(writer: BinaryWriter, value: TestBtreeIndexArgs): void { - TestBtreeIndexArgs.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, TestBtreeIndexArgs.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TestBtreeIndexArgs { - return TestBtreeIndexArgs.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, TestBtreeIndexArgs.getTypeScriptAlgebraicType()); } } @@ -3487,6 +3585,7 @@ import { NamespaceTestC as __NamespaceTestC } from "./namespace_test_c_type"; export type TestD = { testC: __NamespaceTestC | undefined, }; +export default TestD; /** * A namespace for generated helper functions. @@ -3497,17 +3596,19 @@ export namespace TestD { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("testC", AlgebraicType.createOptionType(__NamespaceTestC.getTypeScriptAlgebraicType())), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "testC", algebraicType: AlgebraicType.createOptionType(__NamespaceTestC.getTypeScriptAlgebraicType())}, + ] + }); } export function serialize(writer: BinaryWriter, value: TestD): void { - TestD.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, TestD.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TestD { - return TestD.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, TestD.getTypeScriptAlgebraicType()); } } @@ -3663,6 +3764,7 @@ export type TestE = { id: bigint, name: string, }; +export default TestE; /** * A namespace for generated helper functions. @@ -3673,18 +3775,20 @@ export namespace TestE { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("id", AlgebraicType.createU64Type()), - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "id", algebraicType: AlgebraicType.U64}, + { name: "name", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: TestE): void { - TestE.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, TestE.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TestE { - return TestE.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, TestE.getTypeScriptAlgebraicType()); } } @@ -3813,6 +3917,7 @@ import { Foobar as __Foobar } from "./foobar_type"; export type TestFoobar = { field: __Foobar, }; +export default TestFoobar; /** * A namespace for generated helper functions. @@ -3823,17 +3928,19 @@ export namespace TestFoobar { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("field", __Foobar.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "field", algebraicType: __Foobar.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: TestFoobar): void { - TestFoobar.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, TestFoobar.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): TestFoobar { - return TestFoobar.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, TestFoobar.getTypeScriptAlgebraicType()); } } @@ -3887,6 +3994,7 @@ export type Test = { arg3: __NamespaceTestC, arg4: __NamespaceTestF, }; +export default Test; /** * A namespace for generated helper functions. @@ -3897,20 +4005,22 @@ export namespace Test { * This function is derived from the AlgebraicType used to generate this type. */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement("arg", __TestA.getTypeScriptAlgebraicType()), - new ProductTypeElement("arg2", __TestB.getTypeScriptAlgebraicType()), - new ProductTypeElement("arg3", __NamespaceTestC.getTypeScriptAlgebraicType()), - new ProductTypeElement("arg4", __NamespaceTestF.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "arg", algebraicType: __TestA.getTypeScriptAlgebraicType()}, + { name: "arg2", algebraicType: __TestB.getTypeScriptAlgebraicType()}, + { name: "arg3", algebraicType: __NamespaceTestC.getTypeScriptAlgebraicType()}, + { name: "arg4", algebraicType: __NamespaceTestF.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: Test): void { - Test.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Test.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Test { - return Test.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Test.getTypeScriptAlgebraicType()); } } From 8d74fc4bf152952f62456fc515fb55e547190150 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 20 Aug 2025 09:44:48 -0400 Subject: [PATCH 12/37] Testing fixes --- Cargo.lock | 250 +++++++++++++----- Cargo.toml | 2 +- crates/codegen/src/typescript.rs | 2 +- .../packages/test-app/server/Cargo.toml | 2 +- .../module_bindings/create_player_reducer.ts | 33 ++- .../test-app/src/module_bindings/index.ts | 160 ++++------- .../src/module_bindings/player_table.ts | 36 +-- .../src/module_bindings/player_type.ts | 38 +-- .../src/module_bindings/point_type.ts | 32 ++- .../module_bindings/unindexed_player_table.ts | 23 +- .../module_bindings/unindexed_player_type.ts | 43 +-- .../src/module_bindings/user_table.ts | 30 +-- .../test-app/src/module_bindings/user_type.ts | 32 ++- 13 files changed, 368 insertions(+), 315 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d62de6b9d8..552624b7c13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -404,7 +404,7 @@ name = "benchmarks-module" version = "0.1.0" dependencies = [ "anyhow", - "spacetimedb", + "spacetimedb 1.3.2", ] [[package]] @@ -2991,7 +2991,7 @@ name = "keynote-benchmarks" version = "0.1.0" dependencies = [ "log", - "spacetimedb", + "spacetimedb 1.3.2", ] [[package]] @@ -3281,7 +3281,7 @@ version = "0.0.0" dependencies = [ "anyhow", "log", - "spacetimedb", + "spacetimedb 1.3.2", ] [[package]] @@ -3764,7 +3764,7 @@ name = "perf-test-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb", + "spacetimedb 1.3.2", ] [[package]] @@ -4223,7 +4223,7 @@ name = "quickstart-chat-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb", + "spacetimedb 1.3.2", ] [[package]] @@ -4903,7 +4903,7 @@ dependencies = [ "anyhow", "log", "paste", - "spacetimedb", + "spacetimedb 1.3.2", ] [[package]] @@ -5264,7 +5264,25 @@ name = "spacetime-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb", + "spacetimedb 1.3.2", +] + +[[package]] +name = "spacetimedb" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cd00b22d3170c92858f448db222a135c6302e336f1729c17e77f634c7e9e849" +dependencies = [ + "bytemuck", + "derive_more", + "getrandom 0.2.16", + "log", + "rand 0.8.5", + "scoped-tls", + "spacetimedb-bindings-macro 1.3.0", + "spacetimedb-bindings-sys 1.3.0", + "spacetimedb-lib 1.3.0", + "spacetimedb-primitives 1.3.0", ] [[package]] @@ -5278,10 +5296,10 @@ dependencies = [ "log", "rand 0.8.5", "scoped-tls", - "spacetimedb-bindings-macro", - "spacetimedb-bindings-sys", - "spacetimedb-lib", - "spacetimedb-primitives", + "spacetimedb-bindings-macro 1.3.2", + "spacetimedb-bindings-sys 1.3.2", + "spacetimedb-lib 1.3.2", + "spacetimedb-primitives 1.3.2", "trybuild", ] @@ -5294,7 +5312,7 @@ dependencies = [ "serde_json", "serde_with", "spacetimedb-jsonwebtoken", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", ] [[package]] @@ -5327,11 +5345,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-execution", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-paths", - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.2", "spacetimedb-query", - "spacetimedb-sats", + "spacetimedb-sats 1.3.2", "spacetimedb-schema", "spacetimedb-standalone", "spacetimedb-table", @@ -5344,6 +5362,20 @@ dependencies = [ "walkdir", ] +[[package]] +name = "spacetimedb-bindings-macro" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dcccbad947dbecdb49f6c241762a78451344f04c1bdad023a3b1b5942238b2" +dependencies = [ + "heck 0.4.1", + "humantime", + "proc-macro2", + "quote", + "spacetimedb-primitives 1.3.0", + "syn 2.0.101", +] + [[package]] name = "spacetimedb-bindings-macro" version = "1.3.2" @@ -5352,15 +5384,24 @@ dependencies = [ "humantime", "proc-macro2", "quote", - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.2", "syn 2.0.101", ] +[[package]] +name = "spacetimedb-bindings-sys" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "969e77710b67e7db3e86bb4e195ba325f5f288efd1bfd6b1997ca9c389d22b04" +dependencies = [ + "spacetimedb-primitives 1.3.0", +] + [[package]] name = "spacetimedb-bindings-sys" version = "1.3.2" dependencies = [ - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.2", ] [[package]] @@ -5401,9 +5442,9 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-paths", - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.2", "spacetimedb-schema", "syntect", "tabled", @@ -5462,7 +5503,7 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-jsonwebtoken", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-paths", "spacetimedb-schema", "tempfile", @@ -5493,9 +5534,9 @@ dependencies = [ "serde_json", "serde_with", "smallvec", - "spacetimedb-lib", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-lib 1.3.2", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "strum", "thiserror 1.0.69", ] @@ -5511,8 +5552,8 @@ dependencies = [ "itertools 0.12.1", "regex", "spacetimedb-data-structures", - "spacetimedb-lib", - "spacetimedb-primitives", + "spacetimedb-lib 1.3.2", + "spacetimedb-primitives 1.3.2", "spacetimedb-schema", "spacetimedb-testing", ] @@ -5539,8 +5580,8 @@ dependencies = [ "spacetimedb-commitlog", "spacetimedb-fs-utils", "spacetimedb-paths", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "tempfile", "thiserror 1.0.69", "tokio", @@ -5628,14 +5669,14 @@ dependencies = [ "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", "spacetimedb-jwks", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-memory-usage", "spacetimedb-metrics", "spacetimedb-paths", "spacetimedb-physical-plan", - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.2", "spacetimedb-query", - "spacetimedb-sats", + "spacetimedb-sats 1.3.2", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-subscription", @@ -5704,11 +5745,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-durability", "spacetimedb-execution", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-metrics", "spacetimedb-paths", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-table", @@ -5726,7 +5767,7 @@ dependencies = [ "log", "spacetimedb-commitlog", "spacetimedb-paths", - "spacetimedb-sats", + "spacetimedb-sats 1.3.2", "tokio", "tracing", ] @@ -5738,10 +5779,10 @@ dependencies = [ "anyhow", "itertools 0.12.1", "spacetimedb-expr", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-physical-plan", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "spacetimedb-sql-parser", "spacetimedb-table", ] @@ -5755,10 +5796,10 @@ dependencies = [ "derive_more", "ethnum", "pretty_assertions", - "spacetimedb", - "spacetimedb-lib", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb 1.3.2", + "spacetimedb-lib 1.3.2", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "spacetimedb-schema", "spacetimedb-sql-parser", "thiserror 1.0.69", @@ -5806,6 +5847,26 @@ dependencies = [ "tokio", ] +[[package]] +name = "spacetimedb-lib" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e9b8d04af6da14e3b7cc79b4b88c1c309c994eeba6a97f298fd0cdc7f897209" +dependencies = [ + "anyhow", + "bitflags 2.9.0", + "blake3", + "chrono", + "derive_more", + "enum-as-inner", + "hex", + "itertools 0.12.1", + "spacetimedb-bindings-macro 1.3.0", + "spacetimedb-primitives 1.3.0", + "spacetimedb-sats 1.3.0", + "thiserror 1.0.69", +] + [[package]] name = "spacetimedb-lib" version = "1.3.2" @@ -5826,11 +5887,11 @@ dependencies = [ "ron", "serde", "serde_json", - "spacetimedb-bindings-macro", + "spacetimedb-bindings-macro 1.3.2", "spacetimedb-memory-usage", "spacetimedb-metrics", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "thiserror 1.0.69", ] @@ -5879,13 +5940,25 @@ dependencies = [ "either", "pretty_assertions", "spacetimedb-expr", - "spacetimedb-lib", - "spacetimedb-primitives", + "spacetimedb-lib 1.3.2", + "spacetimedb-primitives 1.3.2", "spacetimedb-schema", "spacetimedb-sql-parser", "spacetimedb-table", ] +[[package]] +name = "spacetimedb-primitives" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0181dc495c66138755705e573f0e0a9a7024660f207ebd1e35d0a1f839813e84" +dependencies = [ + "bitflags 2.9.0", + "either", + "itertools 0.12.1", + "nohash-hasher", +] + [[package]] name = "spacetimedb-primitives" version = "1.3.2" @@ -5908,13 +5981,39 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-physical-plan", - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.2", "spacetimedb-sql-parser", "spacetimedb-table", ] +[[package]] +name = "spacetimedb-sats" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9700ea5d62401c05633ce86d369dbc4a73ec978ac7e347ab8563626ad01fbc" +dependencies = [ + "anyhow", + "arrayvec", + "bitflags 2.9.0", + "bytemuck", + "bytes", + "chrono", + "decorum", + "derive_more", + "enum-as-inner", + "ethnum", + "hex", + "itertools 0.12.1", + "second-stack", + "sha3", + "smallvec", + "spacetimedb-bindings-macro 1.3.0", + "spacetimedb-primitives 1.3.0", + "thiserror 1.0.69", +] + [[package]] name = "spacetimedb-sats" version = "1.3.2" @@ -5941,10 +6040,10 @@ dependencies = [ "serde", "sha3", "smallvec", - "spacetimedb-bindings-macro", + "spacetimedb-bindings-macro 1.3.2", "spacetimedb-memory-usage", "spacetimedb-metrics", - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.2", "thiserror 1.0.69", ] @@ -5967,9 +6066,9 @@ dependencies = [ "serial_test", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-lib 1.3.2", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "spacetimedb-sql-parser", "spacetimedb-testing", "termcolor", @@ -5999,9 +6098,9 @@ dependencies = [ "rand 0.9.1", "spacetimedb-client-api-messages", "spacetimedb-data-structures", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-metrics", - "spacetimedb-sats", + "spacetimedb-sats 1.3.2", "spacetimedb-testing", "thiserror 1.0.69", "tokio", @@ -6027,10 +6126,10 @@ dependencies = [ "spacetimedb-datastore", "spacetimedb-durability", "spacetimedb-fs-utils", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-paths", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -6046,7 +6145,7 @@ name = "spacetimedb-sql-parser" version = "1.3.2" dependencies = [ "derive_more", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "sqlparser", "thiserror 1.0.69", ] @@ -6077,7 +6176,7 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-paths", "spacetimedb-table", "tempfile", @@ -6097,9 +6196,9 @@ dependencies = [ "anyhow", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-physical-plan", - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.2", "spacetimedb-query", ] @@ -6121,10 +6220,10 @@ dependencies = [ "rand 0.9.1", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-memory-usage", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "spacetimedb-schema", "thiserror 1.0.69", ] @@ -6147,7 +6246,7 @@ dependencies = [ "spacetimedb-client-api", "spacetimedb-core", "spacetimedb-data-structures", - "spacetimedb-lib", + "spacetimedb-lib 1.3.2", "spacetimedb-paths", "spacetimedb-schema", "spacetimedb-standalone", @@ -6193,9 +6292,9 @@ dependencies = [ "smallvec", "spacetimedb-data-structures", "spacetimedb-execution", - "spacetimedb-lib", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-lib 1.3.2", + "spacetimedb-primitives 1.3.2", + "spacetimedb-sats 1.3.2", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -6293,8 +6392,8 @@ dependencies = [ "rust_decimal", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib", - "spacetimedb-sats", + "spacetimedb-lib 1.3.2", + "spacetimedb-sats 1.3.2", "spacetimedb-vm", "sqllogictest", "sqllogictest-engines", @@ -7199,6 +7298,15 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "typescript-test-app" +version = "0.1.0" +dependencies = [ + "anyhow", + "log", + "spacetimedb 1.3.0", +] + [[package]] name = "unarray" version = "0.1.4" diff --git a/Cargo.toml b/Cargo.toml index 9c9e061605d..aa883850943 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ members = [ "sdks/rust/tests/connect_disconnect_client", "tools/upgrade-version", "tools/license-check", - "crates/codegen", + "sdks/typescript/packages/test-app/server", ] default-members = ["crates/cli", "crates/standalone", "crates/update"] # cargo feature graph resolver. v3 is default in edition2024 but workspace diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index 1928f3457c7..c7cfe258b9f 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -332,7 +332,7 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) writeln!(out, "colName: \"{}\",", pk.col_name.to_string().to_case(Case::Camel)); writeln!( out, - "colType: {row_type}.getTypeScriptAlgebraicType().product.elements[{}].algebraicType,", + "colType: ({row_type}.getTypeScriptAlgebraicType() as ProductType).value.elements[{}].algebraicType,", pk.col_pos.0 ); out.dedent(1); diff --git a/sdks/typescript/packages/test-app/server/Cargo.toml b/sdks/typescript/packages/test-app/server/Cargo.toml index 9b278585109..f47518024d9 100644 --- a/sdks/typescript/packages/test-app/server/Cargo.toml +++ b/sdks/typescript/packages/test-app/server/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "spacetime-module" +name = "typescript-test-app" version = "0.1.0" edition = "2021" diff --git a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts index 55285852c94..59f87ddeb23 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,35 +31,40 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from "@clockworklabs/spacetimedb-sdk"; -import { Point as __Point } from './point_type'; +import { Point as __Point } from "./point_type"; export type CreatePlayer = { - name: string; - location: __Point; + name: string, + location: __Point, }; +export default CreatePlayer; /** * A namespace for generated helper functions. */ export namespace CreatePlayer { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', __Point.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "name", algebraicType: AlgebraicType.String}, + { name: "location", algebraicType: __Point.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: CreatePlayer): void { - CreatePlayer.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, CreatePlayer.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): CreatePlayer { - return CreatePlayer.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, CreatePlayer.getTypeScriptAlgebraicType()); } + } + diff --git a/sdks/typescript/packages/test-app/src/module_bindings/index.ts b/sdks/typescript/packages/test-app/src/module_bindings/index.ts index 86fcf287d7b..f4729b16241 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/index.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,65 +31,63 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from "@clockworklabs/spacetimedb-sdk"; // Import and reexport all reducer arg types -import { CreatePlayer } from './create_player_reducer.ts'; +import { CreatePlayer } from "./create_player_reducer.ts"; export { CreatePlayer }; // Import and reexport all table handle types -import { PlayerTableHandle } from './player_table.ts'; +import { PlayerTableHandle } from "./player_table.ts"; export { PlayerTableHandle }; -import { UnindexedPlayerTableHandle } from './unindexed_player_table.ts'; +import { UnindexedPlayerTableHandle } from "./unindexed_player_table.ts"; export { UnindexedPlayerTableHandle }; -import { UserTableHandle } from './user_table.ts'; +import { UserTableHandle } from "./user_table.ts"; export { UserTableHandle }; // Import and reexport all types -import { Player } from './player_type.ts'; +import { Player } from "./player_type.ts"; export { Player }; -import { Point } from './point_type.ts'; +import { Point } from "./point_type.ts"; export { Point }; -import { UnindexedPlayer } from './unindexed_player_type.ts'; +import { UnindexedPlayer } from "./unindexed_player_type.ts"; export { UnindexedPlayer }; -import { User } from './user_type.ts'; +import { User } from "./user_type.ts"; export { User }; const REMOTE_MODULE = { tables: { player: { - tableName: 'player', + tableName: "player", rowType: Player.getTypeScriptAlgebraicType(), - primaryKey: 'ownerId', + primaryKey: "ownerId", primaryKeyInfo: { - colName: 'ownerId', - colType: - Player.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colName: "ownerId", + colType: (Player.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, }, }, unindexed_player: { - tableName: 'unindexed_player', + tableName: "unindexed_player", rowType: UnindexedPlayer.getTypeScriptAlgebraicType(), }, user: { - tableName: 'user', + tableName: "user", rowType: User.getTypeScriptAlgebraicType(), - primaryKey: 'identity', + primaryKey: "identity", primaryKeyInfo: { - colName: 'identity', - colType: - User.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colName: "identity", + colType: (User.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, }, }, }, reducers: { create_player: { - reducerName: 'create_player', + reducerName: "create_player", argsType: CreatePlayer.getTypeScriptAlgebraicType(), }, }, versionInfo: { - cliVersion: '1.2.0', + cliVersion: "1.3.0", }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. @@ -101,55 +99,44 @@ const REMOTE_MODULE = { eventContextConstructor: (imp: DbConnectionImpl, event: Event) => { return { ...(imp as DbConnection), - event, - }; + event + } }, dbViewConstructor: (imp: DbConnectionImpl) => { return new RemoteTables(imp); }, - reducersConstructor: ( - imp: DbConnectionImpl, - setReducerFlags: SetReducerFlags - ) => { + reducersConstructor: (imp: DbConnectionImpl, setReducerFlags: SetReducerFlags) => { return new RemoteReducers(imp, setReducerFlags); }, setReducerFlagsConstructor: () => { return new SetReducerFlags(); - }, -}; + } +} // A type representing all the possible variants of a reducer. -export type Reducer = never | { name: 'CreatePlayer'; args: CreatePlayer }; +export type Reducer = never +| { name: "CreatePlayer", args: CreatePlayer } +; export class RemoteReducers { - constructor( - private connection: DbConnectionImpl, - private setCallReducerFlags: SetReducerFlags - ) {} + constructor(private connection: DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} createPlayer(name: string, location: Point) { const __args = { name, location }; let __writer = new BinaryWriter(1024); CreatePlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer( - 'create_player', - __argsBuffer, - this.setCallReducerFlags.createPlayerFlags - ); + this.connection.callReducer("create_player", __argsBuffer, this.setCallReducerFlags.createPlayerFlags); } - onCreatePlayer( - callback: (ctx: ReducerEventContext, name: string, location: Point) => void - ) { - this.connection.onReducer('create_player', callback); + onCreatePlayer(callback: (ctx: ReducerEventContext, name: string, location: Point) => void) { + this.connection.onReducer("create_player", callback); } - removeOnCreatePlayer( - callback: (ctx: ReducerEventContext, name: string, location: Point) => void - ) { - this.connection.offReducer('create_player', callback); + removeOnCreatePlayer(callback: (ctx: ReducerEventContext, name: string, location: Point) => void) { + this.connection.offReducer("create_player", callback); } + } export class SetReducerFlags { @@ -157,82 +144,37 @@ export class SetReducerFlags { createPlayer(flags: CallReducerFlags) { this.createPlayerFlags = flags; } + } export class RemoteTables { constructor(private connection: DbConnectionImpl) {} get player(): PlayerTableHandle { - return new PlayerTableHandle( - this.connection.clientCache.getOrCreateTable( - REMOTE_MODULE.tables.player - ) - ); + return new PlayerTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.player)); } get unindexedPlayer(): UnindexedPlayerTableHandle { - return new UnindexedPlayerTableHandle( - this.connection.clientCache.getOrCreateTable( - REMOTE_MODULE.tables.unindexed_player - ) - ); + return new UnindexedPlayerTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.unindexed_player)); } get user(): UserTableHandle { - return new UserTableHandle( - this.connection.clientCache.getOrCreateTable( - REMOTE_MODULE.tables.user - ) - ); + return new UserTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.user)); } } -export class SubscriptionBuilder extends SubscriptionBuilderImpl< - RemoteTables, - RemoteReducers, - SetReducerFlags -> {} - -export class DbConnection extends DbConnectionImpl< - RemoteTables, - RemoteReducers, - SetReducerFlags -> { - static builder = (): DbConnectionBuilder< - DbConnection, - ErrorContext, - SubscriptionEventContext - > => { - return new DbConnectionBuilder< - DbConnection, - ErrorContext, - SubscriptionEventContext - >(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); - }; +export class SubscriptionBuilder extends SubscriptionBuilderImpl { } + +export class DbConnection extends DbConnectionImpl { + static builder = (): DbConnectionBuilder => { + return new DbConnectionBuilder(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); + } subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); - }; + } } -export type EventContext = EventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags, - Reducer ->; -export type ReducerEventContext = ReducerEventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags, - Reducer ->; -export type SubscriptionEventContext = SubscriptionEventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags ->; -export type ErrorContext = ErrorContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags ->; +export type EventContext = EventContextInterface; +export type ReducerEventContext = ReducerEventContextInterface; +export type SubscriptionEventContext = SubscriptionEventContextInterface; +export type ErrorContext = ErrorContextInterface; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts index 7eec606c5d5..00fb9572969 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,16 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; -import { Player } from './player_type'; -import { Point as __Point } from './point_type'; +} from "@clockworklabs/spacetimedb-sdk"; +import { Player } from "./player_type"; +import { Point as __Point } from "./point_type"; -import { - type EventContext, - type Reducer, - RemoteReducers, - RemoteTables, -} from '.'; +import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; /** * Table handle for the table `player`. @@ -91,30 +86,25 @@ export class PlayerTableHandle { onInsert = (cb: (ctx: EventContext, row: Player) => void) => { return this.tableCache.onInsert(cb); - }; + } removeOnInsert = (cb: (ctx: EventContext, row: Player) => void) => { return this.tableCache.removeOnInsert(cb); - }; + } onDelete = (cb: (ctx: EventContext, row: Player) => void) => { return this.tableCache.onDelete(cb); - }; + } removeOnDelete = (cb: (ctx: EventContext, row: Player) => void) => { return this.tableCache.removeOnDelete(cb); - }; + } // Updates are only defined for tables with primary keys. - onUpdate = ( - cb: (ctx: EventContext, oldRow: Player, newRow: Player) => void - ) => { + onUpdate = (cb: (ctx: EventContext, oldRow: Player, newRow: Player) => void) => { return this.tableCache.onUpdate(cb); - }; + } - removeOnUpdate = ( - cb: (ctx: EventContext, onRow: Player, newRow: Player) => void - ) => { + removeOnUpdate = (cb: (ctx: EventContext, onRow: Player, newRow: Player) => void) => { return this.tableCache.removeOnUpdate(cb); - }; -} + }} diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts index 884e63551ba..86e176118d4 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,36 +31,42 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; -import { Point as __Point } from './point_type'; +} from "@clockworklabs/spacetimedb-sdk"; +import { Point as __Point } from "./point_type"; export type Player = { - ownerId: string; - name: string; - location: __Point; + ownerId: string, + name: string, + location: __Point, }; +export default Player; /** * A namespace for generated helper functions. */ export namespace Player { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('ownerId', AlgebraicType.createStringType()), - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', __Point.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "ownerId", algebraicType: AlgebraicType.String}, + { name: "name", algebraicType: AlgebraicType.String}, + { name: "location", algebraicType: __Point.getTypeScriptAlgebraicType()}, + ] + }); } export function serialize(writer: BinaryWriter, value: Player): void { - Player.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Player.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Player { - return Player.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Player.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts index c74f56ad623..6a0482c4e8f 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,32 +31,38 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from "@clockworklabs/spacetimedb-sdk"; export type Point = { - x: number; - y: number; + x: number, + y: number, }; +export default Point; /** * A namespace for generated helper functions. */ export namespace Point { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('x', AlgebraicType.createU16Type()), - new ProductTypeElement('y', AlgebraicType.createU16Type()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "x", algebraicType: AlgebraicType.U16}, + { name: "y", algebraicType: AlgebraicType.U16}, + ] + }); } export function serialize(writer: BinaryWriter, value: Point): void { - Point.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, Point.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): Point { - return Point.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, Point.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts index a0b3c754db9..17196bd59e6 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,16 +31,11 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; -import { UnindexedPlayer } from './unindexed_player_type'; -import { Point as __Point } from './point_type'; +} from "@clockworklabs/spacetimedb-sdk"; +import { UnindexedPlayer } from "./unindexed_player_type"; +import { Point as __Point } from "./point_type"; -import { - type EventContext, - type Reducer, - RemoteReducers, - RemoteTables, -} from '.'; +import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; /** * Table handle for the table `unindexed_player`. @@ -69,17 +64,17 @@ export class UnindexedPlayerTableHandle { onInsert = (cb: (ctx: EventContext, row: UnindexedPlayer) => void) => { return this.tableCache.onInsert(cb); - }; + } removeOnInsert = (cb: (ctx: EventContext, row: UnindexedPlayer) => void) => { return this.tableCache.removeOnInsert(cb); - }; + } onDelete = (cb: (ctx: EventContext, row: UnindexedPlayer) => void) => { return this.tableCache.onDelete(cb); - }; + } removeOnDelete = (cb: (ctx: EventContext, row: UnindexedPlayer) => void) => { return this.tableCache.removeOnDelete(cb); - }; + } } diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts index 82f25307017..167a3d3fd27 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,39 +31,42 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; -import { Point as __Point } from './point_type'; +} from "@clockworklabs/spacetimedb-sdk"; +import { Point as __Point } from "./point_type"; export type UnindexedPlayer = { - ownerId: string; - name: string; - location: __Point; + ownerId: string, + name: string, + location: __Point, }; +export default UnindexedPlayer; /** * A namespace for generated helper functions. */ export namespace UnindexedPlayer { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('ownerId', AlgebraicType.createStringType()), - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', __Point.getTypeScriptAlgebraicType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "ownerId", algebraicType: AlgebraicType.String}, + { name: "name", algebraicType: AlgebraicType.String}, + { name: "location", algebraicType: __Point.getTypeScriptAlgebraicType()}, + ] + }); } - export function serialize( - writer: BinaryWriter, - value: UnindexedPlayer - ): void { - UnindexedPlayer.getTypeScriptAlgebraicType().serialize(writer, value); + export function serialize(writer: BinaryWriter, value: UnindexedPlayer): void { + AlgebraicType.serializeValue(writer, UnindexedPlayer.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): UnindexedPlayer { - return UnindexedPlayer.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, UnindexedPlayer.getTypeScriptAlgebraicType()); } + } + + diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts index 605a14bc304..24676611d7e 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,14 +31,9 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; -import { User } from './user_type'; -import { - type EventContext, - type Reducer, - RemoteReducers, - RemoteTables, -} from '.'; +} from "@clockworklabs/spacetimedb-sdk"; +import { User } from "./user_type"; +import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; /** * Table handle for the table `user`. @@ -89,28 +84,25 @@ export class UserTableHandle { onInsert = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.onInsert(cb); - }; + } removeOnInsert = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.removeOnInsert(cb); - }; + } onDelete = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.onDelete(cb); - }; + } removeOnDelete = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.removeOnDelete(cb); - }; + } // Updates are only defined for tables with primary keys. onUpdate = (cb: (ctx: EventContext, oldRow: User, newRow: User) => void) => { return this.tableCache.onUpdate(cb); - }; + } - removeOnUpdate = ( - cb: (ctx: EventContext, onRow: User, newRow: User) => void - ) => { + removeOnUpdate = (cb: (ctx: EventContext, onRow: User, newRow: User) => void) => { return this.tableCache.removeOnUpdate(cb); - }; -} + }} diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts index 4a3943a26bf..d01847cdb75 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). /* eslint-disable */ /* tslint:disable */ @@ -31,32 +31,38 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from "@clockworklabs/spacetimedb-sdk"; export type User = { - identity: Identity; - username: string; + identity: Identity, + username: string, }; +export default User; /** * A namespace for generated helper functions. */ export namespace User { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('identity', AlgebraicType.createIdentityType()), - new ProductTypeElement('username', AlgebraicType.createStringType()), - ]); + return AlgebraicType.Product({ + elements: [ + { name: "identity", algebraicType: AlgebraicType.createIdentityType()}, + { name: "username", algebraicType: AlgebraicType.String}, + ] + }); } export function serialize(writer: BinaryWriter, value: User): void { - User.getTypeScriptAlgebraicType().serialize(writer, value); + AlgebraicType.serializeValue(writer, User.getTypeScriptAlgebraicType(), value); } export function deserialize(reader: BinaryReader): User { - return User.getTypeScriptAlgebraicType().deserialize(reader); + return AlgebraicType.deserializeValue(reader, User.getTypeScriptAlgebraicType()); } + } + + From d9d83ecc1406ab64d16d3ea044e368b698813782 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 20 Aug 2025 11:04:24 -0400 Subject: [PATCH 13/37] Formatting --- .../module_bindings/create_player_reducer.ts | 36 ++-- .../test-app/src/module_bindings/index.ts | 158 ++++++++++++------ .../src/module_bindings/player_table.ts | 34 ++-- .../src/module_bindings/player_type.ts | 41 +++-- .../src/module_bindings/point_type.ts | 32 ++-- .../module_bindings/unindexed_player_table.ts | 21 ++- .../module_bindings/unindexed_player_type.ts | 46 +++-- .../src/module_bindings/user_table.ts | 28 ++-- .../test-app/src/module_bindings/user_type.ts | 32 ++-- 9 files changed, 271 insertions(+), 157 deletions(-) diff --git a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts index 59f87ddeb23..2ee9a0d6c8e 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from '@clockworklabs/spacetimedb-sdk'; -import { Point as __Point } from "./point_type"; +import { Point as __Point } from './point_type'; export type CreatePlayer = { - name: string, - location: __Point, + name: string; + location: __Point; }; export default CreatePlayer; @@ -46,25 +46,33 @@ export default CreatePlayer; */ export namespace CreatePlayer { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, - { name: "location", algebraicType: __Point.getTypeScriptAlgebraicType()}, - ] + { name: 'name', algebraicType: AlgebraicType.String }, + { + name: 'location', + algebraicType: __Point.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: CreatePlayer): void { - AlgebraicType.serializeValue(writer, CreatePlayer.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + CreatePlayer.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): CreatePlayer { - return AlgebraicType.deserializeValue(reader, CreatePlayer.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + CreatePlayer.getTypeScriptAlgebraicType() + ); } - } - diff --git a/sdks/typescript/packages/test-app/src/module_bindings/index.ts b/sdks/typescript/packages/test-app/src/module_bindings/index.ts index f4729b16241..1fc8c6062e4 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/index.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/index.ts @@ -31,63 +31,65 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from '@clockworklabs/spacetimedb-sdk'; // Import and reexport all reducer arg types -import { CreatePlayer } from "./create_player_reducer.ts"; +import { CreatePlayer } from './create_player_reducer.ts'; export { CreatePlayer }; // Import and reexport all table handle types -import { PlayerTableHandle } from "./player_table.ts"; +import { PlayerTableHandle } from './player_table.ts'; export { PlayerTableHandle }; -import { UnindexedPlayerTableHandle } from "./unindexed_player_table.ts"; +import { UnindexedPlayerTableHandle } from './unindexed_player_table.ts'; export { UnindexedPlayerTableHandle }; -import { UserTableHandle } from "./user_table.ts"; +import { UserTableHandle } from './user_table.ts'; export { UserTableHandle }; // Import and reexport all types -import { Player } from "./player_type.ts"; +import { Player } from './player_type.ts'; export { Player }; -import { Point } from "./point_type.ts"; +import { Point } from './point_type.ts'; export { Point }; -import { UnindexedPlayer } from "./unindexed_player_type.ts"; +import { UnindexedPlayer } from './unindexed_player_type.ts'; export { UnindexedPlayer }; -import { User } from "./user_type.ts"; +import { User } from './user_type.ts'; export { User }; const REMOTE_MODULE = { tables: { player: { - tableName: "player", + tableName: 'player', rowType: Player.getTypeScriptAlgebraicType(), - primaryKey: "ownerId", + primaryKey: 'ownerId', primaryKeyInfo: { - colName: "ownerId", - colType: (Player.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, + colName: 'ownerId', + colType: (Player.getTypeScriptAlgebraicType() as ProductType).value + .elements[0].algebraicType, }, }, unindexed_player: { - tableName: "unindexed_player", + tableName: 'unindexed_player', rowType: UnindexedPlayer.getTypeScriptAlgebraicType(), }, user: { - tableName: "user", + tableName: 'user', rowType: User.getTypeScriptAlgebraicType(), - primaryKey: "identity", + primaryKey: 'identity', primaryKeyInfo: { - colName: "identity", - colType: (User.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, + colName: 'identity', + colType: (User.getTypeScriptAlgebraicType() as ProductType).value + .elements[0].algebraicType, }, }, }, reducers: { create_player: { - reducerName: "create_player", + reducerName: 'create_player', argsType: CreatePlayer.getTypeScriptAlgebraicType(), }, }, versionInfo: { - cliVersion: "1.3.0", + cliVersion: '1.3.0', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. @@ -99,44 +101,55 @@ const REMOTE_MODULE = { eventContextConstructor: (imp: DbConnectionImpl, event: Event) => { return { ...(imp as DbConnection), - event - } + event, + }; }, dbViewConstructor: (imp: DbConnectionImpl) => { return new RemoteTables(imp); }, - reducersConstructor: (imp: DbConnectionImpl, setReducerFlags: SetReducerFlags) => { + reducersConstructor: ( + imp: DbConnectionImpl, + setReducerFlags: SetReducerFlags + ) => { return new RemoteReducers(imp, setReducerFlags); }, setReducerFlagsConstructor: () => { return new SetReducerFlags(); - } -} + }, +}; // A type representing all the possible variants of a reducer. -export type Reducer = never -| { name: "CreatePlayer", args: CreatePlayer } -; +export type Reducer = never | { name: 'CreatePlayer'; args: CreatePlayer }; export class RemoteReducers { - constructor(private connection: DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} + constructor( + private connection: DbConnectionImpl, + private setCallReducerFlags: SetReducerFlags + ) {} createPlayer(name: string, location: Point) { const __args = { name, location }; let __writer = new BinaryWriter(1024); CreatePlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("create_player", __argsBuffer, this.setCallReducerFlags.createPlayerFlags); + this.connection.callReducer( + 'create_player', + __argsBuffer, + this.setCallReducerFlags.createPlayerFlags + ); } - onCreatePlayer(callback: (ctx: ReducerEventContext, name: string, location: Point) => void) { - this.connection.onReducer("create_player", callback); + onCreatePlayer( + callback: (ctx: ReducerEventContext, name: string, location: Point) => void + ) { + this.connection.onReducer('create_player', callback); } - removeOnCreatePlayer(callback: (ctx: ReducerEventContext, name: string, location: Point) => void) { - this.connection.offReducer("create_player", callback); + removeOnCreatePlayer( + callback: (ctx: ReducerEventContext, name: string, location: Point) => void + ) { + this.connection.offReducer('create_player', callback); } - } export class SetReducerFlags { @@ -144,37 +157,82 @@ export class SetReducerFlags { createPlayer(flags: CallReducerFlags) { this.createPlayerFlags = flags; } - } export class RemoteTables { constructor(private connection: DbConnectionImpl) {} get player(): PlayerTableHandle { - return new PlayerTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.player)); + return new PlayerTableHandle( + this.connection.clientCache.getOrCreateTable( + REMOTE_MODULE.tables.player + ) + ); } get unindexedPlayer(): UnindexedPlayerTableHandle { - return new UnindexedPlayerTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.unindexed_player)); + return new UnindexedPlayerTableHandle( + this.connection.clientCache.getOrCreateTable( + REMOTE_MODULE.tables.unindexed_player + ) + ); } get user(): UserTableHandle { - return new UserTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.user)); + return new UserTableHandle( + this.connection.clientCache.getOrCreateTable( + REMOTE_MODULE.tables.user + ) + ); } } -export class SubscriptionBuilder extends SubscriptionBuilderImpl { } - -export class DbConnection extends DbConnectionImpl { - static builder = (): DbConnectionBuilder => { - return new DbConnectionBuilder(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); - } +export class SubscriptionBuilder extends SubscriptionBuilderImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> {} + +export class DbConnection extends DbConnectionImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> { + static builder = (): DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + > => { + return new DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + >(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); + }; subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); - } + }; } -export type EventContext = EventContextInterface; -export type ReducerEventContext = ReducerEventContextInterface; -export type SubscriptionEventContext = SubscriptionEventContextInterface; -export type ErrorContext = ErrorContextInterface; +export type EventContext = EventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type ReducerEventContext = ReducerEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type SubscriptionEventContext = SubscriptionEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; +export type ErrorContext = ErrorContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts index 00fb9572969..45516a71d93 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts @@ -31,11 +31,16 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; -import { Player } from "./player_type"; -import { Point as __Point } from "./point_type"; +} from '@clockworklabs/spacetimedb-sdk'; +import { Player } from './player_type'; +import { Point as __Point } from './point_type'; -import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; +import { + type EventContext, + type Reducer, + RemoteReducers, + RemoteTables, +} from '.'; /** * Table handle for the table `player`. @@ -86,25 +91,30 @@ export class PlayerTableHandle { onInsert = (cb: (ctx: EventContext, row: Player) => void) => { return this.tableCache.onInsert(cb); - } + }; removeOnInsert = (cb: (ctx: EventContext, row: Player) => void) => { return this.tableCache.removeOnInsert(cb); - } + }; onDelete = (cb: (ctx: EventContext, row: Player) => void) => { return this.tableCache.onDelete(cb); - } + }; removeOnDelete = (cb: (ctx: EventContext, row: Player) => void) => { return this.tableCache.removeOnDelete(cb); - } + }; // Updates are only defined for tables with primary keys. - onUpdate = (cb: (ctx: EventContext, oldRow: Player, newRow: Player) => void) => { + onUpdate = ( + cb: (ctx: EventContext, oldRow: Player, newRow: Player) => void + ) => { return this.tableCache.onUpdate(cb); - } + }; - removeOnUpdate = (cb: (ctx: EventContext, onRow: Player, newRow: Player) => void) => { + removeOnUpdate = ( + cb: (ctx: EventContext, onRow: Player, newRow: Player) => void + ) => { return this.tableCache.removeOnUpdate(cb); - }} + }; +} diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts index 86e176118d4..08ce3e4ac41 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; -import { Point as __Point } from "./point_type"; +} from '@clockworklabs/spacetimedb-sdk'; +import { Point as __Point } from './point_type'; export type Player = { - ownerId: string, - name: string, - location: __Point, + ownerId: string; + name: string; + location: __Point; }; export default Player; @@ -46,27 +46,34 @@ export default Player; */ export namespace Player { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "ownerId", algebraicType: AlgebraicType.String}, - { name: "name", algebraicType: AlgebraicType.String}, - { name: "location", algebraicType: __Point.getTypeScriptAlgebraicType()}, - ] + { name: 'ownerId', algebraicType: AlgebraicType.String }, + { name: 'name', algebraicType: AlgebraicType.String }, + { + name: 'location', + algebraicType: __Point.getTypeScriptAlgebraicType(), + }, + ], }); } export function serialize(writer: BinaryWriter, value: Player): void { - AlgebraicType.serializeValue(writer, Player.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + Player.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): Player { - return AlgebraicType.deserializeValue(reader, Player.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + Player.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts index 6a0482c4e8f..addda6a3c72 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts @@ -31,10 +31,10 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from '@clockworklabs/spacetimedb-sdk'; export type Point = { - x: number, - y: number, + x: number; + y: number; }; export default Point; @@ -43,26 +43,30 @@ export default Point; */ export namespace Point { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "x", algebraicType: AlgebraicType.U16}, - { name: "y", algebraicType: AlgebraicType.U16}, - ] + { name: 'x', algebraicType: AlgebraicType.U16 }, + { name: 'y', algebraicType: AlgebraicType.U16 }, + ], }); } export function serialize(writer: BinaryWriter, value: Point): void { - AlgebraicType.serializeValue(writer, Point.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + Point.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): Point { - return AlgebraicType.deserializeValue(reader, Point.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + Point.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts index 17196bd59e6..737520dea40 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts @@ -31,11 +31,16 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; -import { UnindexedPlayer } from "./unindexed_player_type"; -import { Point as __Point } from "./point_type"; +} from '@clockworklabs/spacetimedb-sdk'; +import { UnindexedPlayer } from './unindexed_player_type'; +import { Point as __Point } from './point_type'; -import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; +import { + type EventContext, + type Reducer, + RemoteReducers, + RemoteTables, +} from '.'; /** * Table handle for the table `unindexed_player`. @@ -64,17 +69,17 @@ export class UnindexedPlayerTableHandle { onInsert = (cb: (ctx: EventContext, row: UnindexedPlayer) => void) => { return this.tableCache.onInsert(cb); - } + }; removeOnInsert = (cb: (ctx: EventContext, row: UnindexedPlayer) => void) => { return this.tableCache.removeOnInsert(cb); - } + }; onDelete = (cb: (ctx: EventContext, row: UnindexedPlayer) => void) => { return this.tableCache.onDelete(cb); - } + }; removeOnDelete = (cb: (ctx: EventContext, row: UnindexedPlayer) => void) => { return this.tableCache.removeOnDelete(cb); - } + }; } diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts index 167a3d3fd27..ed8bedc15b3 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts @@ -31,13 +31,13 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; -import { Point as __Point } from "./point_type"; +} from '@clockworklabs/spacetimedb-sdk'; +import { Point as __Point } from './point_type'; export type UnindexedPlayer = { - ownerId: string, - name: string, - location: __Point, + ownerId: string; + name: string; + location: __Point; }; export default UnindexedPlayer; @@ -46,27 +46,37 @@ export default UnindexedPlayer; */ export namespace UnindexedPlayer { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "ownerId", algebraicType: AlgebraicType.String}, - { name: "name", algebraicType: AlgebraicType.String}, - { name: "location", algebraicType: __Point.getTypeScriptAlgebraicType()}, - ] + { name: 'ownerId', algebraicType: AlgebraicType.String }, + { name: 'name', algebraicType: AlgebraicType.String }, + { + name: 'location', + algebraicType: __Point.getTypeScriptAlgebraicType(), + }, + ], }); } - export function serialize(writer: BinaryWriter, value: UnindexedPlayer): void { - AlgebraicType.serializeValue(writer, UnindexedPlayer.getTypeScriptAlgebraicType(), value); + export function serialize( + writer: BinaryWriter, + value: UnindexedPlayer + ): void { + AlgebraicType.serializeValue( + writer, + UnindexedPlayer.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): UnindexedPlayer { - return AlgebraicType.deserializeValue(reader, UnindexedPlayer.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + UnindexedPlayer.getTypeScriptAlgebraicType() + ); } - } - - diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts index 24676611d7e..bebbdc203c1 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts @@ -31,9 +31,14 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; -import { User } from "./user_type"; -import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; +} from '@clockworklabs/spacetimedb-sdk'; +import { User } from './user_type'; +import { + type EventContext, + type Reducer, + RemoteReducers, + RemoteTables, +} from '.'; /** * Table handle for the table `user`. @@ -84,25 +89,28 @@ export class UserTableHandle { onInsert = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.onInsert(cb); - } + }; removeOnInsert = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.removeOnInsert(cb); - } + }; onDelete = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.onDelete(cb); - } + }; removeOnDelete = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.removeOnDelete(cb); - } + }; // Updates are only defined for tables with primary keys. onUpdate = (cb: (ctx: EventContext, oldRow: User, newRow: User) => void) => { return this.tableCache.onUpdate(cb); - } + }; - removeOnUpdate = (cb: (ctx: EventContext, onRow: User, newRow: User) => void) => { + removeOnUpdate = ( + cb: (ctx: EventContext, onRow: User, newRow: User) => void + ) => { return this.tableCache.removeOnUpdate(cb); - }} + }; +} diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts index d01847cdb75..f70f72d7b9d 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts @@ -31,10 +31,10 @@ import { type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from '@clockworklabs/spacetimedb-sdk'; export type User = { - identity: Identity, - username: string, + identity: Identity; + username: string; }; export default User; @@ -43,26 +43,30 @@ export default User; */ export namespace User { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ export function getTypeScriptAlgebraicType(): AlgebraicType { return AlgebraicType.Product({ elements: [ - { name: "identity", algebraicType: AlgebraicType.createIdentityType()}, - { name: "username", algebraicType: AlgebraicType.String}, - ] + { name: 'identity', algebraicType: AlgebraicType.createIdentityType() }, + { name: 'username', algebraicType: AlgebraicType.String }, + ], }); } export function serialize(writer: BinaryWriter, value: User): void { - AlgebraicType.serializeValue(writer, User.getTypeScriptAlgebraicType(), value); + AlgebraicType.serializeValue( + writer, + User.getTypeScriptAlgebraicType(), + value + ); } export function deserialize(reader: BinaryReader): User { - return AlgebraicType.deserializeValue(reader, User.getTypeScriptAlgebraicType()); + return AlgebraicType.deserializeValue( + reader, + User.getTypeScriptAlgebraicType() + ); } - } - - From 3007ce2372fe6f4b198ce6dbabb76670f3ca0b69 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 20 Aug 2025 12:47:43 -0400 Subject: [PATCH 14/37] Fixed tests hopefully --- crates/bindings-typescript/package.json | 4 +- pnpm-lock.yaml | 206 ++++++++++++++++++ pnpm-workspace.yaml | 5 +- sdks/typescript/packages/sdk/package.json | 7 +- sdks/typescript/packages/sdk/vitest.config.ts | 15 ++ 5 files changed, 231 insertions(+), 6 deletions(-) create mode 100644 sdks/typescript/packages/sdk/vitest.config.ts diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index ab33b74f419..47a6b21487a 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -14,8 +14,10 @@ ".": { "types": "./src/index.ts", "source": "./src/index.ts", + "development": "./src/index.ts", "import": "./dist/index.mjs", - "require": "./dist/index.cjs" + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" } }, "files": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e8869d39067..95082f24c3b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -133,6 +133,9 @@ importers: undici: specifier: ^6.19.2 version: 6.21.3 + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4) sdks/typescript/packages/test-app: dependencies: @@ -915,6 +918,12 @@ packages: '@types/babel__traverse@7.28.0': resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + '@types/chai@5.2.2': + resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} @@ -1033,6 +1042,9 @@ packages: '@vitest/expect@2.1.9': resolution: {integrity: sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==} + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + '@vitest/mocker@2.1.9': resolution: {integrity: sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==} peerDependencies: @@ -1044,21 +1056,47 @@ packages: vite: optional: true + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + '@vitest/pretty-format@2.1.9': resolution: {integrity: sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==} + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + '@vitest/runner@2.1.9': resolution: {integrity: sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==} + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + '@vitest/snapshot@2.1.9': resolution: {integrity: sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==} + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + '@vitest/spy@2.1.9': resolution: {integrity: sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==} + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + '@vitest/utils@2.1.9': resolution: {integrity: sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==} + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + '@zxing/text-encoding@0.9.0': resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} @@ -1626,6 +1664,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -2100,6 +2141,9 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + strip-literal@3.0.0: + resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==} + sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} @@ -2146,10 +2190,18 @@ packages: resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} engines: {node: '>=14.0.0'} + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} + engines: {node: '>=14.0.0'} + tinyspy@3.0.2: resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} engines: {node: '>=14.0.0'} + tinyspy@4.0.3: + resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + engines: {node: '>=14.0.0'} + tldts-core@6.1.86: resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} @@ -2256,6 +2308,11 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + vite@5.4.19: resolution: {integrity: sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -2352,6 +2409,34 @@ packages: jsdom: optional: true + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + w3c-xmlserializer@5.0.0: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} @@ -3150,6 +3235,12 @@ snapshots: dependencies: '@babel/types': 7.28.2 + '@types/chai@5.2.2': + dependencies: + '@types/deep-eql': 4.0.2 + + '@types/deep-eql@4.0.2': {} + '@types/estree@1.0.8': {} '@types/istanbul-lib-coverage@2.0.6': {} @@ -3317,6 +3408,14 @@ snapshots: chai: 5.3.1 tinyrainbow: 1.2.0 + '@vitest/expect@3.2.4': + dependencies: + '@types/chai': 5.2.2 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.1 + tinyrainbow: 2.0.0 + '@vitest/mocker@2.1.9(vite@5.4.19(@types/node@24.3.0)(terser@5.43.1))': dependencies: '@vitest/spy': 2.1.9 @@ -3325,31 +3424,65 @@ snapshots: optionalDependencies: vite: 5.4.19(@types/node@24.3.0)(terser@5.43.1) + '@vitest/mocker@3.2.4(vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.17 + optionalDependencies: + vite: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + '@vitest/pretty-format@2.1.9': dependencies: tinyrainbow: 1.2.0 + '@vitest/pretty-format@3.2.4': + dependencies: + tinyrainbow: 2.0.0 + '@vitest/runner@2.1.9': dependencies: '@vitest/utils': 2.1.9 pathe: 1.1.2 + '@vitest/runner@3.2.4': + dependencies: + '@vitest/utils': 3.2.4 + pathe: 2.0.3 + strip-literal: 3.0.0 + '@vitest/snapshot@2.1.9': dependencies: '@vitest/pretty-format': 2.1.9 magic-string: 0.30.17 pathe: 1.1.2 + '@vitest/snapshot@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + magic-string: 0.30.17 + pathe: 2.0.3 + '@vitest/spy@2.1.9': dependencies: tinyspy: 3.0.2 + '@vitest/spy@3.2.4': + dependencies: + tinyspy: 4.0.3 + '@vitest/utils@2.1.9': dependencies: '@vitest/pretty-format': 2.1.9 loupe: 3.2.0 tinyrainbow: 1.2.0 + '@vitest/utils@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + loupe: 3.2.0 + tinyrainbow: 2.0.0 + '@zxing/text-encoding@0.9.0': {} acorn-jsx@5.3.2(acorn@8.15.0): @@ -3931,6 +4064,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + js-yaml@3.14.1: dependencies: argparse: 1.0.10 @@ -4357,6 +4492,10 @@ snapshots: strip-json-comments@3.1.1: {} + strip-literal@3.0.0: + dependencies: + js-tokens: 9.0.1 + sucrase@3.35.0: dependencies: '@jridgewell/gen-mapping': 0.3.13 @@ -4403,8 +4542,12 @@ snapshots: tinyrainbow@1.2.0: {} + tinyrainbow@2.0.0: {} + tinyspy@3.0.2: {} + tinyspy@4.0.3: {} + tldts-core@6.1.86: {} tldts@6.1.86: @@ -4525,6 +4668,27 @@ snapshots: - supports-color - terser + vite-node@3.2.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4): + dependencies: + cac: 6.7.14 + debug: 4.4.1 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + vite@5.4.19(@types/node@24.3.0)(terser@5.43.1): dependencies: esbuild: 0.21.5 @@ -4585,6 +4749,48 @@ snapshots: - supports-color - terser + vitest@3.2.4(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.1 + debug: 4.4.1 + expect-type: 1.2.2 + magic-string: 0.30.17 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + vite-node: 3.2.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 24.3.0 + jsdom: 26.1.0 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + w3c-xmlserializer@5.0.0: dependencies: xml-name-validator: 5.0.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4999aa5bec4..b901c33a57a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,6 @@ packages: - 'crates/bindings-typescript' - 'sdks/typescript' - - 'sdks/typescript/packages/*' - - 'sdks/typescript/examples/**' \ No newline at end of file + - 'sdks/typescript/packages/sdk' + - 'sdks/typescript/packages/test-app' + - 'sdks/typescript/examples/quickstart-chat' \ No newline at end of file diff --git a/sdks/typescript/packages/sdk/package.json b/sdks/typescript/packages/sdk/package.json index eb53198e5d7..0b909d469ea 100644 --- a/sdks/typescript/packages/sdk/package.json +++ b/sdks/typescript/packages/sdk/package.json @@ -44,11 +44,12 @@ "devDependencies": { "@clockworklabs/test-app": "workspace:^", "tsup": "^8.1.0", - "undici": "^6.19.2" + "undici": "^6.19.2", + "vitest": "^3.2.4" }, "dependencies": { - "spacetimedb": "workspace:^", "@zxing/text-encoding": "^0.9.0", - "base64-js": "^1.5.1" + "base64-js": "^1.5.1", + "spacetimedb": "workspace:^" } } diff --git a/sdks/typescript/packages/sdk/vitest.config.ts b/sdks/typescript/packages/sdk/vitest.config.ts new file mode 100644 index 00000000000..297addb4ffc --- /dev/null +++ b/sdks/typescript/packages/sdk/vitest.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + environment: 'node', + deps: { inline: ['spacetimedb'] }, + }, + resolve: { + // include conditions that point to source in dev + conditions: ['development', 'source', 'node', 'import', 'default'], + mainFields: ['module', 'main', 'browser'], + preserveSymlinks: true, + extensions: ['.ts', '.tsx', '.mjs', '.js', '.json'], + }, +}) \ No newline at end of file From 1f71f5540edeefdc9f29cf9e84a7456c87177fd2 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 20 Aug 2025 12:50:16 -0400 Subject: [PATCH 15/37] Ran formatter --- sdks/typescript/packages/sdk/vitest.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/typescript/packages/sdk/vitest.config.ts b/sdks/typescript/packages/sdk/vitest.config.ts index 297addb4ffc..02bfd1afcd2 100644 --- a/sdks/typescript/packages/sdk/vitest.config.ts +++ b/sdks/typescript/packages/sdk/vitest.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'vitest/config' +import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { @@ -12,4 +12,4 @@ export default defineConfig({ preserveSymlinks: true, extensions: ['.ts', '.tsx', '.mjs', '.js', '.json'], }, -}) \ No newline at end of file +}); From 202aebc661e451852384f09f2edfe82eff17235a Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 20 Aug 2025 12:56:41 -0400 Subject: [PATCH 16/37] Fixed snapshots --- .../tests/snapshots/codegen__codegen_typescript.snap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index 210eb621876..5aeb034359f 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -920,7 +920,7 @@ const REMOTE_MODULE = { primaryKey: "identity", primaryKeyInfo: { colName: "identity", - colType: Player.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (Player.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, }, }, person: { @@ -929,7 +929,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: Person.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (Person.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, }, }, pk_multi_identity: { @@ -938,7 +938,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: PkMultiIdentity.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (PkMultiIdentity.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, }, }, player: { @@ -947,7 +947,7 @@ const REMOTE_MODULE = { primaryKey: "identity", primaryKeyInfo: { colName: "identity", - colType: Player.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (Player.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, }, }, points: { @@ -964,7 +964,7 @@ const REMOTE_MODULE = { primaryKey: "scheduledId", primaryKeyInfo: { colName: "scheduledId", - colType: RepeatingTestArg.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (RepeatingTestArg.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, }, }, test_a: { @@ -981,7 +981,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: TestE.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (TestE.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, }, }, test_f: { From d63ecf020c33467be448c4723021a9e0654cff09 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 20 Aug 2025 16:50:52 -0400 Subject: [PATCH 17/37] Put the generation of all typescript bindings into pnpm scripts --- crates/bindings-typescript/package.json | 3 ++- pnpm-lock.yaml | 6 ++++++ .../examples/quickstart-chat/package.json | 7 +++++-- sdks/typescript/package.json | 3 ++- sdks/typescript/packages/sdk/package.json | 4 ++++ .../sdk/src/client_api/client_message_type.ts | 14 ++++++------- .../compressable_query_update_type.ts | 6 +++--- .../sdk/src/client_api/row_size_hint_type.ts | 4 +++- .../sdk/src/client_api/server_message_type.ts | 20 +++++++++---------- .../sdk/src/client_api/update_status_type.ts | 6 +++--- .../typescript/packages/test-app/package.json | 6 ++++-- 11 files changed, 49 insertions(+), 30 deletions(-) diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index 47a6b21487a..a04ea885f0a 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -37,7 +37,8 @@ "build": "tsc -p tsconfig.build.json", "prepack": "pnpm run build", "format": "prettier --write .", - "lint": "prettier . --check --verbose" + "lint": "prettier . --check --verbose", + "generate": "cargo run -p spacetimedb-codegen --example regen-typescript-moduledef && prettier --write src/autogen" }, "dependencies": { "@zxing/text-encoding": "^0.9.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95082f24c3b..58e1ce85607 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -99,6 +99,9 @@ importers: jsdom: specifier: ^26.0.0 version: 26.1.0 + prettier: + specifier: ^3.3.3 + version: 3.6.2 typescript: specifier: ~5.6.2 version: 5.6.3 @@ -127,6 +130,9 @@ importers: '@clockworklabs/test-app': specifier: workspace:^ version: link:../test-app + prettier: + specifier: ^3.3.3 + version: 3.6.2 tsup: specifier: ^8.1.0 version: 8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.6.3) diff --git a/sdks/typescript/examples/quickstart-chat/package.json b/sdks/typescript/examples/quickstart-chat/package.json index bba0e01905d..1b2c0ee75c9 100644 --- a/sdks/typescript/examples/quickstart-chat/package.json +++ b/sdks/typescript/examples/quickstart-chat/package.json @@ -6,10 +6,12 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build", - "lint": "eslint .", + "format": "prettier --write .", + "lint": "eslint . && prettier . --check", "preview": "vite preview", "test": "vitest", - "spacetime:generate-bindings": "spacetime generate --lang typescript --out-dir src/module_bindings --project-path server", + "generate": "cargo build -p spacetimedb-standalone && cargo run -p spacetimedb-cli generate --lang typescript --out-dir src/module_bindings --project-path ../../../../modules/quickstart-chat && prettier --write src/module_bindings", + "spacetime:generate": "spacetime generate --lang typescript --out-dir src/module_bindings --project-path server", "spacetime:publish:local": "spacetime publish chat --project-path server --server local", "spacetime:publish": "spacetime publish chat --project-path server --server testnet" }, @@ -32,6 +34,7 @@ "eslint-plugin-react-refresh": "^0.4.16", "globals": "^15.14.0", "jsdom": "^26.0.0", + "prettier": "^3.3.3", "typescript": "~5.6.2", "typescript-eslint": "^8.18.2", "vite": "^6.3.5", diff --git a/sdks/typescript/package.json b/sdks/typescript/package.json index 85428c188b4..82c865001f0 100644 --- a/sdks/typescript/package.json +++ b/sdks/typescript/package.json @@ -12,7 +12,8 @@ "ci:version": "changeset version", "format": "prettier --write .", "lint": "prettier . --check", - "test": "pnpm -r test" + "test": "pnpm -r test", + "generate": "pnpm --filter ./examples/quickstart-chat generate && pnpm --filter ./packages/sdks generate && pnpm --filter ./packages/test-app generate" }, "devDependencies": { "@changesets/changelog-github": "^0.5.0", diff --git a/sdks/typescript/packages/sdk/package.json b/sdks/typescript/packages/sdk/package.json index 0b909d469ea..df928ba2778 100644 --- a/sdks/typescript/packages/sdk/package.json +++ b/sdks/typescript/packages/sdk/package.json @@ -25,7 +25,10 @@ }, "scripts": { "compile": "tsup", + "format": "prettier --write .", + "lint": "prettier . --check", "test": "vitest run", + "generate": "cargo build -p spacetimedb-standalone && cargo run -p spacetimedb-client-api-messages --example get_ws_schema > ws_schema.json && cargo run -p spacetimedb-cli generate --lang typescript --out-dir src/client_api --module-def ws_schema.json && rm ws_schema.json && find src/client_api -type f -exec perl -pi -e 's#\\@clockworklabs/spacetimedb-sdk#../index#g' {} + && prettier --write src/client_api", "size": "brotli-size dist/min/index.js" }, "repository": { @@ -43,6 +46,7 @@ }, "devDependencies": { "@clockworklabs/test-app": "workspace:^", + "prettier": "^3.3.3", "tsup": "^8.1.0", "undici": "^6.19.2", "vitest": "^3.2.4" diff --git a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts index ec74643e0d5..b6cd4a723ea 100644 --- a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts @@ -155,12 +155,12 @@ export namespace ClientMessage { // The tagged union or sum type for the algebraic type `ClientMessage`. export type ClientMessage = - | ClientMessage.CallReducer - | ClientMessage.Subscribe - | ClientMessage.OneOffQuery - | ClientMessage.SubscribeSingle - | ClientMessage.SubscribeMulti - | ClientMessage.Unsubscribe - | ClientMessage.UnsubscribeMulti; + | ClientMessageVariants.CallReducer + | ClientMessageVariants.Subscribe + | ClientMessageVariants.OneOffQuery + | ClientMessageVariants.SubscribeSingle + | ClientMessageVariants.SubscribeMulti + | ClientMessageVariants.Unsubscribe + | ClientMessageVariants.UnsubscribeMulti; export default ClientMessage; diff --git a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts index a93534c64e0..2f95beb9f4b 100644 --- a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts @@ -104,8 +104,8 @@ export namespace CompressableQueryUpdate { // The tagged union or sum type for the algebraic type `CompressableQueryUpdate`. export type CompressableQueryUpdate = - | CompressableQueryUpdate.Uncompressed - | CompressableQueryUpdate.Brotli - | CompressableQueryUpdate.Gzip; + | CompressableQueryUpdateVariants.Uncompressed + | CompressableQueryUpdateVariants.Brotli + | CompressableQueryUpdateVariants.Gzip; export default CompressableQueryUpdate; diff --git a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts index 0fc6f21166b..58dcd762a74 100644 --- a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts @@ -90,6 +90,8 @@ export namespace RowSizeHint { } // The tagged union or sum type for the algebraic type `RowSizeHint`. -export type RowSizeHint = RowSizeHint.FixedSize | RowSizeHint.RowOffsets; +export type RowSizeHint = + | RowSizeHintVariants.FixedSize + | RowSizeHintVariants.RowOffsets; export default RowSizeHint; diff --git a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts index 308d5d58479..ae5cacc361d 100644 --- a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts @@ -195,15 +195,15 @@ export namespace ServerMessage { // The tagged union or sum type for the algebraic type `ServerMessage`. export type ServerMessage = - | ServerMessage.InitialSubscription - | ServerMessage.TransactionUpdate - | ServerMessage.TransactionUpdateLight - | ServerMessage.IdentityToken - | ServerMessage.OneOffQueryResponse - | ServerMessage.SubscribeApplied - | ServerMessage.UnsubscribeApplied - | ServerMessage.SubscriptionError - | ServerMessage.SubscribeMultiApplied - | ServerMessage.UnsubscribeMultiApplied; + | ServerMessageVariants.InitialSubscription + | ServerMessageVariants.TransactionUpdate + | ServerMessageVariants.TransactionUpdateLight + | ServerMessageVariants.IdentityToken + | ServerMessageVariants.OneOffQueryResponse + | ServerMessageVariants.SubscribeApplied + | ServerMessageVariants.UnsubscribeApplied + | ServerMessageVariants.SubscriptionError + | ServerMessageVariants.SubscribeMultiApplied + | ServerMessageVariants.UnsubscribeMultiApplied; export default ServerMessage; diff --git a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts index 1336844778c..b90f18ea6fa 100644 --- a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts @@ -99,8 +99,8 @@ export namespace UpdateStatus { // The tagged union or sum type for the algebraic type `UpdateStatus`. export type UpdateStatus = - | UpdateStatus.Committed - | UpdateStatus.Failed - | UpdateStatus.OutOfEnergy; + | UpdateStatusVariants.Committed + | UpdateStatusVariants.Failed + | UpdateStatusVariants.OutOfEnergy; export default UpdateStatus; diff --git a/sdks/typescript/packages/test-app/package.json b/sdks/typescript/packages/test-app/package.json index a98f2642634..056d810ccae 100644 --- a/sdks/typescript/packages/test-app/package.json +++ b/sdks/typescript/packages/test-app/package.json @@ -9,9 +9,11 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "format": "prettier --write .", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 && prettier . --check", "preview": "vite preview", - "spacetime:generate-bindings": "spacetime generate --lang typescript --out-dir src/module_bindings --project-path server", + "generate": "cargo build -p spacetimedb-standalone && cargo run -p spacetimedb-cli generate --lang typescript --out-dir src/module_bindings --project-path server && prettier --write src/module_bindings", + "spacetime:generate": "spacetime generate --lang typescript --out-dir src/module_bindings --project-path server", "spacetime:start": "spacetime start server", "spacetime:publish:local": "spacetime publish game --project-path server --server local", "spacetime:publish": "spacetime publish game --project-path server --server testnet" From 64e06e3be516fd9d29c929f8eda59079034a21b5 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 20 Aug 2025 14:54:12 -0700 Subject: [PATCH 18/37] [tyler/ts-module-test]: empty commit to bump CI From 163cb7c910ecef66f356437a151dc708478a6167 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 20 Aug 2025 20:57:57 -0400 Subject: [PATCH 19/37] Fixed schedule_at --- crates/bindings-typescript/src/schedule_at.ts | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/crates/bindings-typescript/src/schedule_at.ts b/crates/bindings-typescript/src/schedule_at.ts index 0cbbac29448..303ce15eb6a 100644 --- a/crates/bindings-typescript/src/schedule_at.ts +++ b/crates/bindings-typescript/src/schedule_at.ts @@ -1,12 +1,16 @@ -import { AlgebraicType, SumTypeVariant } from './algebraic_type'; -import type { AlgebraicValue } from './algebraic_value'; +import { AlgebraicType } from './algebraic_type'; export namespace ScheduleAt { export function getAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant('Interval', AlgebraicType.createTimeDurationType()), - new SumTypeVariant('Time', AlgebraicType.createTimestampType()), - ]); + return AlgebraicType.Sum({ + variants: [ + { + name: 'Interval', + algebraicType: AlgebraicType.createTimeDurationType(), + }, + { name: 'Time', algebraicType: AlgebraicType.createTimestampType() }, + ], + }); } export type Interval = { @@ -25,30 +29,6 @@ export namespace ScheduleAt { tag: 'Time', value: { __timestamp_micros_since_unix_epoch__: value }, }); - - export function fromValue(value: AlgebraicValue): ScheduleAt { - let sumValue = value.asSumValue(); - switch (sumValue.tag) { - case 0: - return { - tag: 'Interval', - value: { - __time_duration_micros__: sumValue.value - .asProductValue() - .elements[0].asBigInt(), - }, - }; - case 1: - return { - tag: 'Time', - value: { - __timestamp_micros_since_unix_epoch__: sumValue.value.asBigInt(), - }, - }; - default: - throw 'unreachable'; - } - } } export type ScheduleAt = ScheduleAt.Interval | ScheduleAt.Time; From fa8ab56ca23ab564f46c1b1a25cc7ea20af0e5d1 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 20 Aug 2025 21:03:42 -0400 Subject: [PATCH 20/37] Added missing tsconfig.json --- crates/bindings-typescript/package.json | 4 ++-- crates/bindings-typescript/tsconfig.json | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 crates/bindings-typescript/tsconfig.json diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index a04ea885f0a..a3fde6eaf26 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -34,8 +34,8 @@ "author": "Clockwork Labs", "type": "module", "scripts": { - "build": "tsc -p tsconfig.build.json", - "prepack": "pnpm run build", + "build": "tsc", + "compile": "pnpm run build", "format": "prettier --write .", "lint": "prettier . --check --verbose", "generate": "cargo run -p spacetimedb-codegen --example regen-typescript-moduledef && prettier --write src/autogen" diff --git a/crates/bindings-typescript/tsconfig.json b/crates/bindings-typescript/tsconfig.json new file mode 100644 index 00000000000..d676fea5d40 --- /dev/null +++ b/crates/bindings-typescript/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "declaration": true, + "emitDeclarationOnly": false, + "noEmit": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "verbatimModuleSyntax": true, + "allowImportingTsExtensions": true, + "strict": true, + "noImplicitAny": false, + "moduleResolution": "Bundler", + "allowSyntheticDefaultImports": true, + "isolatedDeclarations": true, + "isolatedModules": true, + }, + "include": ["src/**/*", "tests/**/*"], + "exclude": ["node_modules", "**/__tests__/*", "dist/**/*"] +} From 1c3aff74182fdef5d146cdc18eecea18c87e21c0 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Thu, 21 Aug 2025 16:37:04 -0400 Subject: [PATCH 21/37] Fix license --- crates/bindings-typescript/LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bindings-typescript/LICENSE.txt b/crates/bindings-typescript/LICENSE.txt index 1ef648f64b3..8540cf8a991 120000 --- a/crates/bindings-typescript/LICENSE.txt +++ b/crates/bindings-typescript/LICENSE.txt @@ -1 +1 @@ -../../LICENSE.txt \ No newline at end of file +../../licenses/BSL.txt \ No newline at end of file From 13867180eff1d3679dfedf445167b813cc302052 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Mon, 25 Aug 2025 11:58:00 -0400 Subject: [PATCH 22/37] Modified .prettierignore to ignore all .github folders in the project --- .prettierignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index 3592bad75bc..a544b13e5bb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,4 +2,4 @@ node_modules pnpm-lock.yaml dist target -/.github +.github From c44e4579580fbc1d1c1b5ed15501289a71df854f Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 10:25:13 -0400 Subject: [PATCH 23/37] Modified typescript codegen to not use namespace and to prefer ES6 modules --- crates/bindings-typescript/eslint.config.js | 41 + crates/bindings-typescript/package.json | 16 +- .../bindings-typescript/src/algebraic_type.ts | 889 +++++++++--------- .../src/autogen/algebraic_type_type.ts | 281 +++--- .../src/autogen/algebraic_type_variants.ts | 55 ++ .../src/autogen/index_type_type.ts | 96 +- .../src/autogen/index_type_variants.ts | 34 + .../src/autogen/lifecycle_type.ts | 107 +-- .../src/autogen/lifecycle_variants.ts | 35 + .../src/autogen/misc_module_export_type.ts | 98 +- .../autogen/misc_module_export_variants.ts | 35 + .../src/autogen/product_type_element_type.ts | 81 +- .../src/autogen/product_type_type.ts | 76 +- .../src/autogen/raw_column_def_v_8_type.ts | 76 +- .../raw_column_default_value_v_9_type.ts | 74 ++ .../autogen/raw_constraint_data_v_9_type.ts | 102 +- .../raw_constraint_data_v_9_variants.ts | 35 + .../autogen/raw_constraint_def_v_8_type.ts | 78 +- .../autogen/raw_constraint_def_v_9_type.ts | 81 +- .../src/autogen/raw_index_algorithm_type.ts | 122 +-- .../autogen/raw_index_algorithm_variants.ts | 35 + .../src/autogen/raw_index_def_v_8_type.ts | 80 +- .../src/autogen/raw_index_def_v_9_type.ts | 82 +- .../raw_misc_module_export_v_9_type.ts | 101 +- .../raw_misc_module_export_v_9_variants.ts | 38 + .../src/autogen/raw_module_def_type.ts | 109 +-- .../src/autogen/raw_module_def_v_8_type.ts | 98 +- .../src/autogen/raw_module_def_v_9_type.ts | 114 ++- .../src/autogen/raw_module_def_variants.ts | 37 + .../src/autogen/raw_reducer_def_v_9_type.ts | 87 +- .../raw_row_level_security_def_v_9_type.ts | 74 +- .../src/autogen/raw_schedule_def_v_9_type.ts | 80 +- .../autogen/raw_scoped_type_name_v_9_type.ts | 78 +- .../src/autogen/raw_sequence_def_v_8_type.ts | 92 +- .../src/autogen/raw_sequence_def_v_9_type.ts | 92 +- .../src/autogen/raw_table_def_v_8_type.ts | 110 ++- .../src/autogen/raw_table_def_v_9_type.ts | 118 ++- .../src/autogen/raw_type_def_v_9_type.ts | 78 +- .../raw_unique_constraint_data_v_9_type.ts | 74 +- .../src/autogen/reducer_def_type.ts | 78 +- .../src/autogen/sum_type_type.ts | 76 +- .../src/autogen/sum_type_variant_type.ts | 78 +- .../src/autogen/table_access_type.ts | 100 +- .../src/autogen/table_access_variants.ts | 34 + .../src/autogen/table_desc_type.ts | 76 +- .../src/autogen/table_type_type.ts | 96 +- .../src/autogen/table_type_variants.ts | 34 + .../src/autogen/type_alias_type.ts | 73 +- .../src/autogen/typespace_type.ts | 76 +- .../bindings-typescript/src/connection_id.ts | 2 +- crates/bindings-typescript/src/schedule_at.ts | 44 +- crates/bindings-typescript/src/utils.ts | 12 +- crates/bindings-typescript/tsconfig.json | 18 +- crates/cli/src/subcommands/generate.rs | 6 +- .../examples/regen-csharp-moduledef.rs | 4 +- .../examples/regen-typescript-moduledef.rs | 5 +- crates/codegen/src/csharp.rs | 53 +- crates/codegen/src/lib.rs | 39 +- crates/codegen/src/rust.rs | 45 +- crates/codegen/src/typescript.rs | 370 ++++---- crates/codegen/tests/codegen.rs | 5 +- pnpm-lock.yaml | 158 ++++ 62 files changed, 2928 insertions(+), 2543 deletions(-) create mode 100644 crates/bindings-typescript/eslint.config.js create mode 100644 crates/bindings-typescript/src/autogen/algebraic_type_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/index_type_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/lifecycle_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/misc_module_export_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/raw_module_def_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/table_access_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/table_type_variants.ts diff --git a/crates/bindings-typescript/eslint.config.js b/crates/bindings-typescript/eslint.config.js new file mode 100644 index 00000000000..f330f33e73a --- /dev/null +++ b/crates/bindings-typescript/eslint.config.js @@ -0,0 +1,41 @@ +import js from '@eslint/js'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; +import { defineConfig } from 'eslint/config'; + +export default defineConfig([ + { ignores: ['dist'] }, + { + files: ['**/*.{ts,tsx}'], + languageOptions: { + parser: tseslint.parser, + ecmaVersion: 'latest', + sourceType: 'module', + globals: { ...globals.browser, ...globals.node }, + }, + plugins: { + '@typescript-eslint': tseslint.plugin, + }, + extends: [js.configs.recommended, ...tseslint.configs.recommended], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-namespace': 'error', + 'no-restricted-syntax': [ + 'error', + { + selector: 'TSEnumDeclaration', + message: 'Do not use enums; stick to JS-compatible types.', + }, + { + selector: 'TSEnumDeclaration[const=true]', + message: 'Do not use const enum; use unions or objects.', + }, + { selector: 'Decorator', message: 'Do not use decorators.' }, + { + selector: 'TSParameterProperty', + message: 'Do not use parameter properties.', + }, + ], + }, + }, +]); diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index a3fde6eaf26..5d938ac8227 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -37,12 +37,26 @@ "build": "tsc", "compile": "pnpm run build", "format": "prettier --write .", - "lint": "prettier . --check --verbose", + "lint": "eslint . && prettier . --check", + "test": "vitest run", + "coverage": "vitest run --coverage", "generate": "cargo run -p spacetimedb-codegen --example regen-typescript-moduledef && prettier --write src/autogen" }, "dependencies": { "@zxing/text-encoding": "^0.9.0", "base64-js": "^1.5.1", "prettier": "^3.3.3" + }, + "devDependencies": { + "@eslint/js": "^9.17.0", + "@typescript-eslint/eslint-plugin": "^8.18.2", + "@typescript-eslint/parser": "^8.18.2", + "eslint": "^9.33.0", + "globals": "^15.14.0", + "ts-node": "^10.9.2", + "typescript": "^5.9.2", + "typescript-eslint": "^8.18.2", + "vite": "^7.1.3", + "vitest": "^3.2.4" } } diff --git a/crates/bindings-typescript/src/algebraic_type.ts b/crates/bindings-typescript/src/algebraic_type.ts index 3b69ea617d6..2e6fcc9d05a 100644 --- a/crates/bindings-typescript/src/algebraic_type.ts +++ b/crates/bindings-typescript/src/algebraic_type.ts @@ -4,15 +4,20 @@ import { ConnectionId } from './connection_id'; import type BinaryReader from './binary_reader'; import BinaryWriter from './binary_writer'; import { Identity } from './identity'; -import ScheduleAt from './schedule_at'; import { - __AlgebraicType, - type __AlgebraicType as __AlgebraicTypeType, + AlgebraicType as AlgebraicTypeType, + AlgebraicType as AlgebraicTypeValue, } from './autogen/algebraic_type_type'; -import { ProductType } from './autogen/product_type_type'; -import { SumType } from './autogen/sum_type_type'; +import { + type ProductType as ProductTypeType, + ProductType as ProductTypeValue, +} from './autogen/product_type_type'; +import { + type SumType as SumTypeType, + SumType as SumTypeValue, +} from './autogen/sum_type_type'; +import ScheduleAt from './schedule_at'; -// Exports /** * A factor / element of a product type. * @@ -30,488 +35,448 @@ export * from './autogen/product_type_element_type'; * Uniquely identifies an element similarly to protobuf tags. */ export * from './autogen/sum_type_variant_type'; -export { type __AlgebraicTypeVariants as AlgebraicTypeVariants } from './autogen/algebraic_type_type'; - -declare module './autogen/product_type_type' { - /** - * A structural product type of the factors given by `elements`. - * - * This is also known as `struct` and `tuple` in many languages, - * but note that unlike most languages, products in SATs are *[structural]* and not nominal. - * When checking whether two nominal types are the same, - * their names and/or declaration sites (e.g., module / namespace) are considered. - * Meanwhile, a structural type system would only check the structure of the type itself, - * e.g., the names of its fields and their types in the case of a record. - * The name "product" comes from category theory. - * - * See also: https://ncatlab.org/nlab/show/product+type. - * - * These structures are known as product types because the number of possible values in product - * ```ignore - * { N_0: T_0, N_1: T_1, ..., N_n: T_n } - * ``` - * is: - * ```ignore - * Π (i ∈ 0..n). values(T_i) - * ``` - * so for example, `values({ A: U64, B: Bool }) = values(U64) * values(Bool)`. - * - * [structural]: https://en.wikipedia.org/wiki/Structural_type_system - */ - export namespace ProductType { - export function serializeValue( - writer: BinaryWriter, - ty: ProductType, - value: any - ): void; - export function deserializeValue( - reader: BinaryReader, - ty: ProductType - ): any; - - export function intoMapKey( - ty: ProductType, - value: any - ): ComparablePrimitive; - } -} -ProductType.serializeValue = function ( - writer: BinaryWriter, - ty: ProductType, - value: any -): void { - for (let element of ty.elements) { - __AlgebraicType.serializeValue( - writer, - element.algebraicType, - value[element.name!] - ); - } -}; +/** + * The variant types of the Algebraic Type tagged union. + */ +export type * as AlgebraicTypeVariants from './autogen/algebraic_type_variants'; -ProductType.deserializeValue = function ( - reader: BinaryReader, - ty: ProductType -): { [key: string]: any } { - let result: { [key: string]: any } = {}; - if (ty.elements.length === 1) { - if (ty.elements[0].name === '__time_duration_micros__') { - return new TimeDuration(reader.readI64()); - } +/** + * The SpacetimeDB Algebraic Type System (SATS) is a structural type system in + * which a nominal type system can be constructed. + * + * The type system unifies the concepts sum types, product types, and built-in + * primitive types into a single type system. + */ +export type AlgebraicType = AlgebraicTypeType; - if (ty.elements[0].name === '__timestamp_micros_since_unix_epoch__') { - return new Timestamp(reader.readI64()); +/** + * Algebraic Type utilities. + */ +export const AlgebraicType: { + createOptionType(innerType: AlgebraicTypeType): AlgebraicTypeType; + createIdentityType(): AlgebraicTypeType; + createConnectionIdType(): AlgebraicTypeType; + createScheduleAtType(): AlgebraicTypeType; + createTimestampType(): AlgebraicTypeType; + createTimeDurationType(): AlgebraicTypeType; + serializeValue(writer: BinaryWriter, ty: AlgebraicTypeType, value: any): void; + deserializeValue(reader: BinaryReader, ty: AlgebraicTypeType): any; + /** + * Convert a value of the algebraic type into something that can be used as a key in a map. + * There are no guarantees about being able to order it. + * This is only guaranteed to be comparable to other values of the same type. + * @param value A value of the algebraic type + * @returns Something that can be used as a key in a map. + */ + intoMapKey(ty: AlgebraicTypeType, value: any): ComparablePrimitive; +} & typeof AlgebraicTypeValue = { + ...AlgebraicTypeValue, + createOptionType: function (innerType: AlgebraicTypeType): AlgebraicTypeType { + return AlgebraicTypeValue.Sum({ + variants: [ + { name: 'some', algebraicType: innerType }, + { + name: 'none', + algebraicType: AlgebraicTypeValue.Product({ elements: [] }), + }, + ], + }); + }, + createIdentityType: function (): AlgebraicTypeType { + return AlgebraicTypeValue.Product({ + elements: [ + { name: '__identity__', algebraicType: AlgebraicTypeValue.U256 }, + ], + }); + }, + createConnectionIdType: function (): AlgebraicTypeType { + return AlgebraicTypeValue.Product({ + elements: [ + { name: '__connection_id__', algebraicType: AlgebraicTypeValue.U128 }, + ], + }); + }, + createScheduleAtType: function (): AlgebraicTypeType { + return ScheduleAt.getAlgebraicType(); + }, + createTimestampType: function (): AlgebraicTypeType { + return AlgebraicTypeValue.Product({ + elements: [ + { + name: '__timestamp_micros_since_unix_epoch__', + algebraicType: AlgebraicTypeValue.I64, + }, + ], + }); + }, + createTimeDurationType: function (): AlgebraicTypeType { + return AlgebraicTypeValue.Product({ + elements: [ + { + name: '__time_duration_micros__', + algebraicType: AlgebraicTypeValue.I64, + }, + ], + }); + }, + serializeValue: function ( + writer: BinaryWriter, + ty: AlgebraicTypeType, + value: any + ): void { + switch (ty.tag) { + case 'Product': + ProductType.serializeValue(writer, ty.value, value); + break; + case 'Sum': + SumType.serializeValue(writer, ty.value, value); + break; + case 'Array': + if (ty.value.tag === 'U8') { + writer.writeUInt8Array(value); + } else { + const elemType = ty.value; + writer.writeU32(value.length); + for (const elem of value) { + AlgebraicType.serializeValue(writer, elemType, elem); + } + } + break; + case 'Bool': + writer.writeBool(value); + break; + case 'I8': + writer.writeI8(value); + break; + case 'U8': + writer.writeU8(value); + break; + case 'I16': + writer.writeI16(value); + break; + case 'U16': + writer.writeU16(value); + break; + case 'I32': + writer.writeI32(value); + break; + case 'U32': + writer.writeU32(value); + break; + case 'I64': + writer.writeI64(value); + break; + case 'U64': + writer.writeU64(value); + break; + case 'I128': + writer.writeI128(value); + break; + case 'U128': + writer.writeU128(value); + break; + case 'I256': + writer.writeI256(value); + break; + case 'U256': + writer.writeU256(value); + break; + case 'F32': + writer.writeF32(value); + break; + case 'F64': + writer.writeF64(value); + break; + case 'String': + writer.writeString(value); + break; + default: + throw new Error(`not implemented, ${ty.tag}`); } - - if (ty.elements[0].name === '__identity__') { - return new Identity(reader.readU256()); + }, + deserializeValue: function ( + reader: BinaryReader, + ty: AlgebraicTypeType + ): any { + switch (ty.tag) { + case 'Product': + return ProductType.deserializeValue(reader, ty.value); + case 'Sum': + return SumType.deserializeValue(reader, ty.value); + case 'Array': + if (ty.value.tag === 'U8') { + return reader.readUInt8Array(); + } else { + const elemType = ty.value; + const length = reader.readU32(); + const result: any[] = []; + for (let i = 0; i < length; i++) { + result.push(AlgebraicType.deserializeValue(reader, elemType)); + } + return result; + } + case 'Bool': + return reader.readBool(); + case 'I8': + return reader.readI8(); + case 'U8': + return reader.readU8(); + case 'I16': + return reader.readI16(); + case 'U16': + return reader.readU16(); + case 'I32': + return reader.readI32(); + case 'U32': + return reader.readU32(); + case 'I64': + return reader.readI64(); + case 'U64': + return reader.readU64(); + case 'I128': + return reader.readI128(); + case 'U128': + return reader.readU128(); + case 'I256': + return reader.readI256(); + case 'U256': + return reader.readU256(); + case 'F32': + return reader.readF32(); + case 'F64': + return reader.readF64(); + case 'String': + return reader.readString(); + default: + throw new Error(`not implemented, ${ty.tag}`); } - - if (ty.elements[0].name === '__connection_id__') { - return new ConnectionId(reader.readU128()); + }, + /** + * Convert a value of the algebraic type into something that can be used as a key in a map. + * There are no guarantees about being able to order it. + * This is only guaranteed to be comparable to other values of the same type. + * @param value A value of the algebraic type + * @returns Something that can be used as a key in a map. + */ + intoMapKey: function ( + ty: AlgebraicTypeType, + value: any + ): ComparablePrimitive { + switch (ty.tag) { + case 'U8': + case 'U16': + case 'U32': + case 'U64': + case 'U128': + case 'U256': + case 'I8': + case 'I16': + case 'I64': + case 'I128': + case 'F32': + case 'F64': + case 'String': + case 'Bool': + return value; + case 'Product': + return ProductType.intoMapKey(ty.value, value); + default: { + const writer = new BinaryWriter(10); + this.serialize(writer, value); + return writer.toBase64(); + } } - } - - for (let element of ty.elements) { - result[element.name!] = __AlgebraicType.deserializeValue( - reader, - element.algebraicType - ); - } - return result; + }, }; -export { ProductType }; - -ProductType.intoMapKey = function ( - ty: ProductType, - value: any -): ComparablePrimitive { - if (ty.elements.length === 1) { - if (ty.elements[0].name === '__time_duration_micros__') { - return (value as TimeDuration).__time_duration_micros__; - } - - if (ty.elements[0].name === '__timestamp_micros_since_unix_epoch__') { - return (value as Timestamp).__timestamp_micros_since_unix_epoch__; - } +/** + * A structural product type of the factors given by `elements`. + * + * This is also known as `struct` and `tuple` in many languages, + * but note that unlike most languages, products in SATs are *[structural]* and not nominal. + * When checking whether two nominal types are the same, + * their names and/or declaration sites (e.g., module / namespace) are considered. + * Meanwhile, a structural type system would only check the structure of the type itself, + * e.g., the names of its fields and their types in the case of a record. + * The name "product" comes from category theory. + * + * See also: https://ncatlab.org/nlab/show/product+type. + * + * These structures are known as product types because the number of possible values in product + * ```ignore + * { N_0: T_0, N_1: T_1, ..., N_n: T_n } + * ``` + * is: + * ```ignore + * Π (i ∈ 0..n). values(T_i) + * ``` + * so for example, `values({ A: U64, B: Bool }) = values(U64) * values(Bool)`. + * + * [structural]: https://en.wikipedia.org/wiki/Structural_type_system + */ +export type ProductType = ProductTypeType; - if (ty.elements[0].name === '__identity__') { - return (value as Identity).__identity__; +export const ProductType: { + serializeValue(writer: BinaryWriter, ty: ProductTypeType, value: any): void; + deserializeValue(reader: BinaryReader, ty: ProductTypeType): any; + intoMapKey(ty: ProductTypeType, value: any): ComparablePrimitive; +} = { + ...ProductTypeValue, + serializeValue(writer: BinaryWriter, ty: ProductTypeType, value: any): void { + for (const element of ty.elements) { + AlgebraicType.serializeValue( + writer, + element.algebraicType, + value[element.name!] + ); } + }, + deserializeValue(reader: BinaryReader, ty: ProductTypeType): any { + const result: { [key: string]: any } = {}; + if (ty.elements.length === 1) { + if (ty.elements[0].name === '__time_duration_micros__') { + return new TimeDuration(reader.readI64()); + } - if (ty.elements[0].name === '__connection_id__') { - return (value as ConnectionId).__connection_id__; - } - } - // The fallback is to serialize and base64 encode the bytes. - const writer = new BinaryWriter(10); - AlgebraicType.serializeValue(writer, AlgebraicType.Product(ty), value); - return writer.toBase64(); -}; + if (ty.elements[0].name === '__timestamp_micros_since_unix_epoch__') { + return new Timestamp(reader.readI64()); + } -declare module './autogen/sum_type_type' { - /** - * Unlike most languages, sums in SATS are *[structural]* and not nominal. - * When checking whether two nominal types are the same, - * their names and/or declaration sites (e.g., module / namespace) are considered. - * Meanwhile, a structural type system would only check the structure of the type itself, - * e.g., the names of its variants and their inner data types in the case of a sum. - * - * This is also known as a discriminated union (implementation) or disjoint union. - * Another name is [coproduct (category theory)](https://ncatlab.org/nlab/show/coproduct). - * - * These structures are known as sum types because the number of possible values a sum - * ```ignore - * { N_0(T_0), N_1(T_1), ..., N_n(T_n) } - * ``` - * is: - * ```ignore - * Σ (i ∈ 0..n). values(T_i) - * ``` - * so for example, `values({ A(U64), B(Bool) }) = values(U64) + values(Bool)`. - * - * See also: https://ncatlab.org/nlab/show/sum+type. - * - * [structural]: https://en.wikipedia.org/wiki/Structural_type_system - */ - export namespace SumType { - export function serializeValue( - writer: BinaryWriter, - ty: SumType, - value: any - ): void; - export function deserializeValue(reader: BinaryReader, ty: SumType): any; - } -} + if (ty.elements[0].name === '__identity__') { + return new Identity(reader.readU256()); + } -SumType.serializeValue = function ( - writer: BinaryWriter, - ty: SumType, - value: any -): void { - if ( - ty.variants.length == 2 && - ty.variants[0].name === 'some' && - ty.variants[1].name === 'none' - ) { - if (value !== null && value !== undefined) { - writer.writeByte(0); - __AlgebraicType.serializeValue( - writer, - ty.variants[0].algebraicType, - value - ); - } else { - writer.writeByte(1); - } - } else { - let variant = value['tag']; - const index = ty.variants.findIndex(v => v.name === variant); - if (index < 0) { - throw `Can't serialize a sum type, couldn't find ${value.tag} tag`; + if (ty.elements[0].name === '__connection_id__') { + return new ConnectionId(reader.readU128()); + } } - writer.writeU8(index); - __AlgebraicType.serializeValue( - writer, - ty.variants[index].algebraicType, - value['value'] - ); - } -}; -SumType.deserializeValue = function (reader: BinaryReader, ty: SumType): any { - let tag = reader.readU8(); - // In TypeScript we handle Option values as a special case - // we don't represent the some and none variants, but instead - // we represent the value directly. - if ( - ty.variants.length == 2 && - ty.variants[0].name === 'some' && - ty.variants[1].name === 'none' - ) { - if (tag === 0) { - return __AlgebraicType.deserializeValue( + for (const element of ty.elements) { + result[element.name!] = AlgebraicType.deserializeValue( reader, - ty.variants[0].algebraicType + element.algebraicType ); - } else if (tag === 1) { - return undefined; - } else { - throw `Can't deserialize an option type, couldn't find ${tag} tag`; } - } else { - let variant = ty.variants[tag]; - let value = __AlgebraicType.deserializeValue(reader, variant.algebraicType); - return { tag: variant.name, value }; - } -}; - -export { SumType }; - -declare module './autogen/algebraic_type_type' { - /** - * The SpacetimeDB Algebraic Type System (SATS) is a structural type system in - * which a nominal type system can be constructed. - * - * The type system unifies the concepts sum types, product types, and built-in - * primitive types into a single type system. - */ - export namespace __AlgebraicType { - export function createOptionType( - innerType: __AlgebraicType - ): __AlgebraicType; - export function createIdentityType(): __AlgebraicType; - export function createConnectionIdType(): __AlgebraicType; - export function createScheduleAtType(): __AlgebraicType; - export function createTimestampType(): __AlgebraicType; - export function createTimeDurationType(): __AlgebraicType; - export function serializeValue( - writer: BinaryWriter, - ty: __AlgebraicType, - value: any - ): void; - export function deserializeValue( - reader: BinaryReader, - ty: __AlgebraicType - ): any; - - /** - * Convert a value of the algebraic type into something that can be used as a key in a map. - * There are no guarantees about being able to order it. - * This is only guaranteed to be comparable to other values of the same type. - * @param value A value of the algebraic type - * @returns Something that can be used as a key in a map. - */ - export function intoMapKey( - ty: __AlgebraicType, - value: any - ): ComparablePrimitive; - } -} - -__AlgebraicType.createOptionType = function ( - innerType: __AlgebraicType -): __AlgebraicType { - return __AlgebraicType.Sum({ - variants: [ - { name: 'some', algebraicType: innerType }, - { - name: 'none', - algebraicType: __AlgebraicType.Product({ elements: [] }), - }, - ], - }); -}; - -__AlgebraicType.createIdentityType = function (): __AlgebraicType { - return __AlgebraicType.Product({ - elements: [{ name: '__identity__', algebraicType: __AlgebraicType.U256 }], - }); -}; - -__AlgebraicType.createConnectionIdType = function (): __AlgebraicType { - return __AlgebraicType.Product({ - elements: [ - { name: '__connection_id__', algebraicType: __AlgebraicType.U128 }, - ], - }); -}; - -__AlgebraicType.createScheduleAtType = function (): __AlgebraicType { - return ScheduleAt.getAlgebraicType(); -}; - -__AlgebraicType.createTimestampType = function (): __AlgebraicType { - return __AlgebraicType.Product({ - elements: [ - { - name: '__timestamp_micros_since_unix_epoch__', - algebraicType: __AlgebraicType.I64, - }, - ], - }); -}; + return result; + }, + intoMapKey(ty: ProductTypeType, value: any): ComparablePrimitive { + if (ty.elements.length === 1) { + if (ty.elements[0].name === '__time_duration_micros__') { + return (value as TimeDuration).__time_duration_micros__; + } -__AlgebraicType.createTimeDurationType = function (): __AlgebraicType { - return __AlgebraicType.Product({ - elements: [ - { name: '__time_duration_micros__', algebraicType: __AlgebraicType.I64 }, - ], - }); -}; + if (ty.elements[0].name === '__timestamp_micros_since_unix_epoch__') { + return (value as Timestamp).__timestamp_micros_since_unix_epoch__; + } -__AlgebraicType.serializeValue = function ( - writer: BinaryWriter, - ty: __AlgebraicType, - value: any -): void { - switch (ty.tag) { - case 'Product': - ProductType.serializeValue(writer, ty.value, value); - break; - case 'Sum': - SumType.serializeValue(writer, ty.value, value); - break; - case 'Array': - if (ty.value.tag === 'U8') { - writer.writeUInt8Array(value); - } else { - const elemType = ty.value; - writer.writeU32(value.length); - for (let elem of value) { - AlgebraicType.serializeValue(writer, elemType, elem); - } + if (ty.elements[0].name === '__identity__') { + return (value as Identity).__identity__; } - break; - case 'Bool': - writer.writeBool(value); - break; - case 'I8': - writer.writeI8(value); - break; - case 'U8': - writer.writeU8(value); - break; - case 'I16': - writer.writeI16(value); - break; - case 'U16': - writer.writeU16(value); - break; - case 'I32': - writer.writeI32(value); - break; - case 'U32': - writer.writeU32(value); - break; - case 'I64': - writer.writeI64(value); - break; - case 'U64': - writer.writeU64(value); - break; - case 'I128': - writer.writeI128(value); - break; - case 'U128': - writer.writeU128(value); - break; - case 'I256': - writer.writeI256(value); - break; - case 'U256': - writer.writeU256(value); - break; - case 'F32': - writer.writeF32(value); - break; - case 'F64': - writer.writeF64(value); - break; - case 'String': - writer.writeString(value); - break; - default: - throw new Error(`not implemented, ${ty.tag}`); - } -}; -__AlgebraicType.deserializeValue = function ( - reader: BinaryReader, - ty: __AlgebraicType -): any { - switch (ty.tag) { - case 'Product': - return ProductType.deserializeValue(reader, ty.value); - case 'Sum': - return SumType.deserializeValue(reader, ty.value); - case 'Array': - if (ty.value.tag === 'U8') { - return reader.readUInt8Array(); - } else { - const elemType = ty.value; - const length = reader.readU32(); - const result: any[] = []; - for (let i = 0; i < length; i++) { - result.push(AlgebraicType.deserializeValue(reader, elemType)); - } - return result; + if (ty.elements[0].name === '__connection_id__') { + return (value as ConnectionId).__connection_id__; } - case 'Bool': - return reader.readBool(); - case 'I8': - return reader.readI8(); - case 'U8': - return reader.readU8(); - case 'I16': - return reader.readI16(); - case 'U16': - return reader.readU16(); - case 'I32': - return reader.readI32(); - case 'U32': - return reader.readU32(); - case 'I64': - return reader.readI64(); - case 'U64': - return reader.readU64(); - case 'I128': - return reader.readI128(); - case 'U128': - return reader.readU128(); - case 'I256': - return reader.readI256(); - case 'U256': - return reader.readU256(); - case 'F32': - return reader.readF32(); - case 'F64': - return reader.readF64(); - case 'String': - return reader.readString(); - default: - throw new Error(`not implemented, ${ty.tag}`); - } + } + // The fallback is to serialize and base64 encode the bytes. + const writer = new BinaryWriter(10); + AlgebraicType.serializeValue(writer, AlgebraicType.Product(ty), value); + return writer.toBase64(); + }, }; /** - * Convert a value of the algebraic type into something that can be used as a key in a map. - * There are no guarantees about being able to order it. - * This is only guaranteed to be comparable to other values of the same type. - * @param value A value of the algebraic type - * @returns Something that can be used as a key in a map. + * Unlike most languages, sums in SATS are *[structural]* and not nominal. + * When checking whether two nominal types are the same, + * their names and/or declaration sites (e.g., module / namespace) are considered. + * Meanwhile, a structural type system would only check the structure of the type itself, + * e.g., the names of its variants and their inner data types in the case of a sum. + * + * This is also known as a discriminated union (implementation) or disjoint union. + * Another name is [coproduct (category theory)](https://ncatlab.org/nlab/show/coproduct). + * + * These structures are known as sum types because the number of possible values a sum + * ```ignore + * { N_0(T_0), N_1(T_1), ..., N_n(T_n) } + * ``` + * is: + * ```ignore + * Σ (i ∈ 0..n). values(T_i) + * ``` + * so for example, `values({ A(U64), B(Bool) }) = values(U64) + values(Bool)`. + * + * See also: https://ncatlab.org/nlab/show/sum+type. + * + * [structural]: https://en.wikipedia.org/wiki/Structural_type_system */ -__AlgebraicType.intoMapKey = function ( - ty: __AlgebraicType, - value: any -): ComparablePrimitive { - switch (ty.tag) { - case 'U8': - case 'U16': - case 'U32': - case 'U64': - case 'U128': - case 'U256': - case 'I8': - case 'I16': - case 'I64': - case 'I128': - case 'F32': - case 'F64': - case 'String': - case 'Bool': - return value; - case 'Product': - return ProductType.intoMapKey(ty.value, value); - default: - const writer = new BinaryWriter(10); - this.serialize(writer, value); - return writer.toBase64(); - } +export const SumType: { + serializeValue(writer: BinaryWriter, ty: SumTypeType, value: any): void; + deserializeValue(reader: BinaryReader, ty: SumTypeType): any; +} = { + ...SumTypeValue, + serializeValue: function ( + writer: BinaryWriter, + ty: SumTypeType, + value: any + ): void { + if ( + ty.variants.length == 2 && + ty.variants[0].name === 'some' && + ty.variants[1].name === 'none' + ) { + if (value !== null && value !== undefined) { + writer.writeByte(0); + AlgebraicType.serializeValue( + writer, + ty.variants[0].algebraicType, + value + ); + } else { + writer.writeByte(1); + } + } else { + const variant = value['tag']; + const index = ty.variants.findIndex(v => v.name === variant); + if (index < 0) { + throw `Can't serialize a sum type, couldn't find ${value.tag} tag`; + } + writer.writeU8(index); + AlgebraicType.serializeValue( + writer, + ty.variants[index].algebraicType, + value['value'] + ); + } + }, + deserializeValue: function (reader: BinaryReader, ty: SumTypeType): any { + const tag = reader.readU8(); + // In TypeScript we handle Option values as a special case + // we don't represent the some and none variants, but instead + // we represent the value directly. + if ( + ty.variants.length == 2 && + ty.variants[0].name === 'some' && + ty.variants[1].name === 'none' + ) { + if (tag === 0) { + return AlgebraicType.deserializeValue( + reader, + ty.variants[0].algebraicType + ); + } else if (tag === 1) { + return undefined; + } else { + throw `Can't deserialize an option type, couldn't find ${tag} tag`; + } + } else { + const variant = ty.variants[tag]; + const value = AlgebraicType.deserializeValue( + reader, + variant.algebraicType + ); + return { tag: variant.name, value }; + } + }, }; -export type AlgebraicType = __AlgebraicTypeType; -export const AlgebraicType: typeof __AlgebraicType = __AlgebraicType; -export type ComparablePrimitive = number | string | String | boolean | bigint; +export type ComparablePrimitive = number | string | boolean | bigint; diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts index f5de17be634..fede8241aed 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts @@ -1,202 +1,185 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { SumType as __SumType } from './sum_type_type'; -import { ProductType as __ProductType } from './product_type_type'; +import { SumType } from './sum_type_type'; +import { ProductType } from './product_type_type'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace __AlgebraicTypeVariants { - export type Ref = { tag: 'Ref'; value: number }; - export type Sum = { tag: 'Sum'; value: __SumType }; - export type Product = { tag: 'Product'; value: __ProductType }; - export type Array = { tag: 'Array'; value: __AlgebraicType }; - export type String = { tag: 'String' }; - export type Bool = { tag: 'Bool' }; - export type I8 = { tag: 'I8' }; - export type U8 = { tag: 'U8' }; - export type I16 = { tag: 'I16' }; - export type U16 = { tag: 'U16' }; - export type I32 = { tag: 'I32' }; - export type U32 = { tag: 'U32' }; - export type I64 = { tag: 'I64' }; - export type U64 = { tag: 'U64' }; - export type I128 = { tag: 'I128' }; - export type U128 = { tag: 'U128' }; - export type I256 = { tag: 'I256' }; - export type U256 = { tag: 'U256' }; - export type F32 = { tag: 'F32' }; - export type F64 = { tag: 'F64' }; -} +import * as AlgebraicTypeVariants from './algebraic_type_variants'; -// A namespace for generated variants and helper functions. -export namespace __AlgebraicType { +// The tagged union or sum type for the algebraic type `AlgebraicType`. +export type AlgebraicType = + | AlgebraicTypeVariants.Ref + | AlgebraicTypeVariants.Sum + | AlgebraicTypeVariants.Product + | AlgebraicTypeVariants.Array + | AlgebraicTypeVariants.String + | AlgebraicTypeVariants.Bool + | AlgebraicTypeVariants.I8 + | AlgebraicTypeVariants.U8 + | AlgebraicTypeVariants.I16 + | AlgebraicTypeVariants.U16 + | AlgebraicTypeVariants.I32 + | AlgebraicTypeVariants.U32 + | AlgebraicTypeVariants.I64 + | AlgebraicTypeVariants.U64 + | AlgebraicTypeVariants.I128 + | AlgebraicTypeVariants.U128 + | AlgebraicTypeVariants.I256 + | AlgebraicTypeVariants.U256 + | AlgebraicTypeVariants.F32 + | AlgebraicTypeVariants.F64; + +// A value with helper functions to construct the type. +export const AlgebraicType = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Ref = (value: number): __AlgebraicType => ({ - tag: 'Ref', - value, - }); - export const Sum = (value: __SumType): __AlgebraicType => ({ - tag: 'Sum', - value, - }); - export const Product = (value: __ProductType): __AlgebraicType => ({ - tag: 'Product', - value, - }); - export const Array = (value: __AlgebraicType): __AlgebraicType => ({ - tag: 'Array', - value, - }); - export const String: { tag: 'String' } = { tag: 'String' }; - export const Bool: { tag: 'Bool' } = { tag: 'Bool' }; - export const I8: { tag: 'I8' } = { tag: 'I8' }; - export const U8: { tag: 'U8' } = { tag: 'U8' }; - export const I16: { tag: 'I16' } = { tag: 'I16' }; - export const U16: { tag: 'U16' } = { tag: 'U16' }; - export const I32: { tag: 'I32' } = { tag: 'I32' }; - export const U32: { tag: 'U32' } = { tag: 'U32' }; - export const I64: { tag: 'I64' } = { tag: 'I64' }; - export const U64: { tag: 'U64' } = { tag: 'U64' }; - export const I128: { tag: 'I128' } = { tag: 'I128' }; - export const U128: { tag: 'U128' } = { tag: 'U128' }; - export const I256: { tag: 'I256' } = { tag: 'I256' }; - export const U256: { tag: 'U256' } = { tag: 'U256' }; - export const F32: { tag: 'F32' } = { tag: 'F32' }; - export const F64: { tag: 'F64' } = { tag: 'F64' }; + Ref: (value: number): AlgebraicType => ({ tag: 'Ref', value }), + Sum: (value: SumType): AlgebraicType => ({ tag: 'Sum', value }), + Product: (value: ProductType): AlgebraicType => ({ tag: 'Product', value }), + Array: (value: AlgebraicType): AlgebraicType => ({ tag: 'Array', value }), + String: { tag: 'String' } as const, + Bool: { tag: 'Bool' } as const, + I8: { tag: 'I8' } as const, + U8: { tag: 'U8' } as const, + I16: { tag: 'I16' } as const, + U16: { tag: 'U16' } as const, + I32: { tag: 'I32' } as const, + U32: { tag: 'U32' } as const, + I64: { tag: 'I64' } as const, + U64: { tag: 'U64' } as const, + I128: { tag: 'I128' } as const, + U128: { tag: 'U128' } as const, + I256: { tag: 'I256' } as const, + U256: { tag: 'U256' } as const, + F32: { tag: 'F32' } as const, + F64: { tag: 'F64' } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ - { name: 'Ref', algebraicType: AlgebraicType.U32 }, - { name: 'Sum', algebraicType: __SumType.getTypeScriptAlgebraicType() }, + { name: 'Ref', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'Sum', algebraicType: SumType.getTypeScriptAlgebraicType() }, { name: 'Product', - algebraicType: __ProductType.getTypeScriptAlgebraicType(), + algebraicType: ProductType.getTypeScriptAlgebraicType(), }, { name: 'Array', - algebraicType: __AlgebraicType.getTypeScriptAlgebraicType(), + algebraicType: AlgebraicType.getTypeScriptAlgebraicType(), }, { name: 'String', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'Bool', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'I8', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'U8', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'I16', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'U16', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'I32', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'U32', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'I64', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'U64', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, - { name: 'I8', algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: 'U8', algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: 'I16', algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: 'U16', algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: 'I32', algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: 'U32', algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: 'I64', algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: 'U64', algebraicType: AlgebraicType.Product({ elements: [] }) }, { name: 'I128', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'U128', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'I256', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'U256', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'F32', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'F64', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, - { name: 'F32', algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: 'F64', algebraicType: AlgebraicType.Product({ elements: [] }) }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: __AlgebraicType - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: AlgebraicType): void { + __AlgebraicTypeValue.serializeValue( writer, - __AlgebraicType.getTypeScriptAlgebraicType(), + AlgebraicType.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): __AlgebraicType { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): AlgebraicType { + return __AlgebraicTypeValue.deserializeValue( reader, - __AlgebraicType.getTypeScriptAlgebraicType() + AlgebraicType.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `__AlgebraicType`. -export type __AlgebraicType = - | __AlgebraicTypeVariants.Ref - | __AlgebraicTypeVariants.Sum - | __AlgebraicTypeVariants.Product - | __AlgebraicTypeVariants.Array - | __AlgebraicTypeVariants.String - | __AlgebraicTypeVariants.Bool - | __AlgebraicTypeVariants.I8 - | __AlgebraicTypeVariants.U8 - | __AlgebraicTypeVariants.I16 - | __AlgebraicTypeVariants.U16 - | __AlgebraicTypeVariants.I32 - | __AlgebraicTypeVariants.U32 - | __AlgebraicTypeVariants.I64 - | __AlgebraicTypeVariants.U64 - | __AlgebraicTypeVariants.I128 - | __AlgebraicTypeVariants.U128 - | __AlgebraicTypeVariants.I256 - | __AlgebraicTypeVariants.U256 - | __AlgebraicTypeVariants.F32 - | __AlgebraicTypeVariants.F64; + }, +}; -export default __AlgebraicType; +export default AlgebraicType; diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts new file mode 100644 index 00000000000..a22a15f5845 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts @@ -0,0 +1,55 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { SumType } from './sum_type_type'; +import { ProductType } from './product_type_type'; + +import AlgebraicType from './algebraic_type_type'; + +export type Ref = { tag: 'Ref'; value: number }; +export type Sum = { tag: 'Sum'; value: SumType }; +export type Product = { tag: 'Product'; value: ProductType }; +export type Array = { tag: 'Array'; value: AlgebraicType }; +export type String = { tag: 'String' }; +export type Bool = { tag: 'Bool' }; +export type I8 = { tag: 'I8' }; +export type U8 = { tag: 'U8' }; +export type I16 = { tag: 'I16' }; +export type U16 = { tag: 'U16' }; +export type I32 = { tag: 'I32' }; +export type U32 = { tag: 'U32' }; +export type I64 = { tag: 'I64' }; +export type U64 = { tag: 'U64' }; +export type I128 = { tag: 'I128' }; +export type U128 = { tag: 'U128' }; +export type I256 = { tag: 'I256' }; +export type U256 = { tag: 'U256' }; +export type F32 = { tag: 'F32' }; +export type F64 = { tag: 'F64' }; diff --git a/crates/bindings-typescript/src/autogen/index_type_type.ts b/crates/bindings-typescript/src/autogen/index_type_type.ts index 6c443beee38..a8c3e848ee6 100644 --- a/crates/bindings-typescript/src/autogen/index_type_type.ts +++ b/crates/bindings-typescript/src/autogen/index_type_type.ts @@ -1,92 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace IndexTypeVariants { - export type BTree = { tag: 'BTree' }; - export type Hash = { tag: 'Hash' }; -} +import * as IndexTypeVariants from './index_type_variants'; -// A namespace for generated variants and helper functions. -export namespace IndexType { +// The tagged union or sum type for the algebraic type `IndexType`. +export type IndexType = IndexTypeVariants.BTree | IndexTypeVariants.Hash; + +// A value with helper functions to construct the type. +export const IndexType = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const BTree: { tag: 'BTree' } = { tag: 'BTree' }; - export const Hash: { tag: 'Hash' } = { tag: 'Hash' }; + BTree: { tag: 'BTree' } as const, + Hash: { tag: 'Hash' } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'BTree', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'Hash', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: IndexType): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: IndexType): void { + __AlgebraicTypeValue.serializeValue( writer, IndexType.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): IndexType { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): IndexType { + return __AlgebraicTypeValue.deserializeValue( reader, IndexType.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `IndexType`. -export type IndexType = IndexTypeVariants.BTree | IndexTypeVariants.Hash; + }, +}; export default IndexType; diff --git a/crates/bindings-typescript/src/autogen/index_type_variants.ts b/crates/bindings-typescript/src/autogen/index_type_variants.ts new file mode 100644 index 00000000000..50cb3ddaab9 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/index_type_variants.ts @@ -0,0 +1,34 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import IndexType from './index_type_type'; + +export type BTree = { tag: 'BTree' }; +export type Hash = { tag: 'Hash' }; diff --git a/crates/bindings-typescript/src/autogen/lifecycle_type.ts b/crates/bindings-typescript/src/autogen/lifecycle_type.ts index 932ab87dffa..c925f8adba0 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_type.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_type.ts @@ -1,101 +1,86 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace LifecycleVariants { - export type Init = { tag: 'Init' }; - export type OnConnect = { tag: 'OnConnect' }; - export type OnDisconnect = { tag: 'OnDisconnect' }; -} +import * as LifecycleVariants from './lifecycle_variants'; -// A namespace for generated variants and helper functions. -export namespace Lifecycle { +// The tagged union or sum type for the algebraic type `Lifecycle`. +export type Lifecycle = + | LifecycleVariants.Init + | LifecycleVariants.OnConnect + | LifecycleVariants.OnDisconnect; + +// A value with helper functions to construct the type. +export const Lifecycle = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Init: { tag: 'Init' } = { tag: 'Init' }; - export const OnConnect: { tag: 'OnConnect' } = { tag: 'OnConnect' }; - export const OnDisconnect: { tag: 'OnDisconnect' } = { tag: 'OnDisconnect' }; + Init: { tag: 'Init' } as const, + OnConnect: { tag: 'OnConnect' } as const, + OnDisconnect: { tag: 'OnDisconnect' } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'Init', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'OnConnect', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'OnDisconnect', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: Lifecycle): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: Lifecycle): void { + __AlgebraicTypeValue.serializeValue( writer, Lifecycle.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): Lifecycle { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): Lifecycle { + return __AlgebraicTypeValue.deserializeValue( reader, Lifecycle.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `Lifecycle`. -export type Lifecycle = - | LifecycleVariants.Init - | LifecycleVariants.OnConnect - | LifecycleVariants.OnDisconnect; + }, +}; export default Lifecycle; diff --git a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts new file mode 100644 index 00000000000..8dcb4fdffd8 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import Lifecycle from './lifecycle_type'; + +export type Init = { tag: 'Init' }; +export type OnConnect = { tag: 'OnConnect' }; +export type OnDisconnect = { tag: 'OnDisconnect' }; diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts index a4f4f2f9775..b359afc8d41 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts @@ -1,94 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { TypeAlias as __TypeAlias } from './type_alias_type'; +import { TypeAlias } from './type_alias_type'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace MiscModuleExportVariants { - export type TypeAlias = { tag: 'TypeAlias'; value: __TypeAlias }; -} +import * as MiscModuleExportVariants from './misc_module_export_variants'; -// A namespace for generated variants and helper functions. -export namespace MiscModuleExport { +// The tagged union or sum type for the algebraic type `MiscModuleExport`. +export type MiscModuleExport = MiscModuleExportVariants.TypeAlias; + +// A value with helper functions to construct the type. +export const MiscModuleExport = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const TypeAlias = (value: __TypeAlias): MiscModuleExport => ({ + TypeAlias: (value: TypeAlias): MiscModuleExport => ({ tag: 'TypeAlias', value, - }); + }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'TypeAlias', - algebraicType: __TypeAlias.getTypeScriptAlgebraicType(), + algebraicType: TypeAlias.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: MiscModuleExport - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: MiscModuleExport): void { + __AlgebraicTypeValue.serializeValue( writer, MiscModuleExport.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): MiscModuleExport { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): MiscModuleExport { + return __AlgebraicTypeValue.deserializeValue( reader, MiscModuleExport.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `MiscModuleExport`. -export type MiscModuleExport = MiscModuleExportVariants.TypeAlias; + }, +}; export default MiscModuleExport; diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts new file mode 100644 index 00000000000..967516820b9 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { TypeAlias } from './type_alias_type'; + +import MiscModuleExport from './misc_module_export_type'; + +export type TypeAlias = { tag: 'TypeAlias'; value: TypeAlias }; diff --git a/crates/bindings-typescript/src/autogen/product_type_element_type.ts b/crates/bindings-typescript/src/autogen/product_type_element_type.ts index 2a25091e8cb..cf95feb5d2b 100644 --- a/crates/bindings-typescript/src/autogen/product_type_element_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -1,83 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { __AlgebraicType } from './algebraic_type_type'; +import { AlgebraicType } from './algebraic_type_type'; export type ProductTypeElement = { name: string | undefined; - algebraicType: __AlgebraicType; + algebraicType: AlgebraicType; }; export default ProductTypeElement; /** * A namespace for generated helper functions. */ -export namespace ProductTypeElement { +export const ProductTypeElement = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'name', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, { name: 'algebraicType', - algebraicType: __AlgebraicType.getTypeScriptAlgebraicType(), + algebraicType: AlgebraicType.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: ProductTypeElement - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: ProductTypeElement): void { + __AlgebraicTypeValue.serializeValue( writer, ProductTypeElement.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): ProductTypeElement { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): ProductTypeElement { + return __AlgebraicTypeValue.deserializeValue( reader, ProductTypeElement.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/product_type_type.ts b/crates/bindings-typescript/src/autogen/product_type_type.ts index 08c7eff534b..2b6f0b6b58d 100644 --- a/crates/bindings-typescript/src/autogen/product_type_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_type.ts @@ -1,77 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { ProductTypeElement as __ProductTypeElement } from './product_type_element_type'; +import { ProductTypeElement } from './product_type_element_type'; export type ProductType = { - elements: __ProductTypeElement[]; + elements: ProductTypeElement[]; }; export default ProductType; /** * A namespace for generated helper functions. */ -export namespace ProductType { +export const ProductType = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'elements', - algebraicType: AlgebraicType.Array( - __ProductTypeElement.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + ProductTypeElement.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: ProductType): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: ProductType): void { + __AlgebraicTypeValue.serializeValue( writer, ProductType.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): ProductType { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): ProductType { + return __AlgebraicTypeValue.deserializeValue( reader, ProductType.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts index 89a6a3d2c38..d717b3a6f38 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts @@ -1,77 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { __AlgebraicType } from './algebraic_type_type'; +import { AlgebraicType } from './algebraic_type_type'; export type RawColumnDefV8 = { colName: string; - colType: __AlgebraicType; + colType: AlgebraicType; }; export default RawColumnDefV8; /** * A namespace for generated helper functions. */ -export namespace RawColumnDefV8 { +export const RawColumnDefV8 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'colName', algebraicType: AlgebraicType.String }, + { name: 'colName', algebraicType: __AlgebraicTypeValue.String }, { name: 'colType', - algebraicType: __AlgebraicType.getTypeScriptAlgebraicType(), + algebraicType: AlgebraicType.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawColumnDefV8): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawColumnDefV8): void { + __AlgebraicTypeValue.serializeValue( writer, RawColumnDefV8.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawColumnDefV8 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawColumnDefV8 { + return __AlgebraicTypeValue.deserializeValue( reader, RawColumnDefV8.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts new file mode 100644 index 00000000000..ca437286aaf --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts @@ -0,0 +1,74 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; + +export type RawColumnDefaultValueV9 = { + table: string; + colId: number; + value: Uint8Array; +}; +export default RawColumnDefaultValueV9; + +/** + * A namespace for generated helper functions. + */ +export const RawColumnDefaultValueV9 = { + /** + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'table', algebraicType: __AlgebraicTypeValue.String }, + { name: 'colId', algebraicType: __AlgebraicTypeValue.U16 }, + { + name: 'value', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawColumnDefaultValueV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawColumnDefaultValueV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawColumnDefaultValueV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawColumnDefaultValueV9.getTypeScriptAlgebraicType() + ); + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts index 976f6c91724..15d82135b9b 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts @@ -1,94 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawUniqueConstraintDataV9 as __RawUniqueConstraintDataV9 } from './raw_unique_constraint_data_v_9_type'; +import { RawUniqueConstraintDataV9 } from './raw_unique_constraint_data_v_9_type'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace RawConstraintDataV9Variants { - export type Unique = { tag: 'Unique'; value: __RawUniqueConstraintDataV9 }; -} +import * as RawConstraintDataV9Variants from './raw_constraint_data_v_9_variants'; -// A namespace for generated variants and helper functions. -export namespace RawConstraintDataV9 { +// The tagged union or sum type for the algebraic type `RawConstraintDataV9`. +export type RawConstraintDataV9 = RawConstraintDataV9Variants.Unique; + +// A value with helper functions to construct the type. +export const RawConstraintDataV9 = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Unique = ( - value: __RawUniqueConstraintDataV9 - ): RawConstraintDataV9 => ({ tag: 'Unique', value }); + Unique: (value: RawUniqueConstraintDataV9): RawConstraintDataV9 => ({ + tag: 'Unique', + value, + }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'Unique', - algebraicType: - __RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), + algebraicType: RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawConstraintDataV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawConstraintDataV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawConstraintDataV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawConstraintDataV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawConstraintDataV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawConstraintDataV9.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `RawConstraintDataV9`. -export type RawConstraintDataV9 = RawConstraintDataV9Variants.Unique; + }, +}; export default RawConstraintDataV9; diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts new file mode 100644 index 00000000000..9e68b5fe568 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { RawUniqueConstraintDataV9 } from './raw_unique_constraint_data_v_9_type'; + +import RawConstraintDataV9 from './raw_constraint_data_v_9_type'; + +export type Unique = { tag: 'Unique'; value: RawUniqueConstraintDataV9 }; diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts index dc4241a5a80..aa76eec47dd 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type RawConstraintDefV8 = { constraintName: string; constraints: number; @@ -42,39 +39,36 @@ export default RawConstraintDefV8; /** * A namespace for generated helper functions. */ -export namespace RawConstraintDefV8 { +export const RawConstraintDefV8 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'constraintName', algebraicType: AlgebraicType.String }, - { name: 'constraints', algebraicType: AlgebraicType.U8 }, + { name: 'constraintName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'constraints', algebraicType: __AlgebraicTypeValue.U8 }, { name: 'columns', - algebraicType: AlgebraicType.Array(AlgebraicType.U16), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawConstraintDefV8 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawConstraintDefV8): void { + __AlgebraicTypeValue.serializeValue( writer, RawConstraintDefV8.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawConstraintDefV8 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawConstraintDefV8 { + return __AlgebraicTypeValue.deserializeValue( reader, RawConstraintDefV8.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts index b7b38c098cb..8fce62ec079 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts @@ -1,83 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawConstraintDataV9 as __RawConstraintDataV9 } from './raw_constraint_data_v_9_type'; +import { RawConstraintDataV9 } from './raw_constraint_data_v_9_type'; export type RawConstraintDefV9 = { name: string | undefined; - data: __RawConstraintDataV9; + data: RawConstraintDataV9; }; export default RawConstraintDefV9; /** * A namespace for generated helper functions. */ -export namespace RawConstraintDefV9 { +export const RawConstraintDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'name', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, { name: 'data', - algebraicType: __RawConstraintDataV9.getTypeScriptAlgebraicType(), + algebraicType: RawConstraintDataV9.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawConstraintDefV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawConstraintDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawConstraintDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawConstraintDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawConstraintDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawConstraintDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts index b4211af26e2..17a53ff5f33 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts @@ -1,107 +1,83 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace RawIndexAlgorithmVariants { - export type BTree = { tag: 'BTree'; value: number[] }; - export type Hash = { tag: 'Hash'; value: number[] }; - export type Direct = { tag: 'Direct'; value: number }; -} +import * as RawIndexAlgorithmVariants from './raw_index_algorithm_variants'; -// A namespace for generated variants and helper functions. -export namespace RawIndexAlgorithm { +// The tagged union or sum type for the algebraic type `RawIndexAlgorithm`. +export type RawIndexAlgorithm = + | RawIndexAlgorithmVariants.BTree + | RawIndexAlgorithmVariants.Hash + | RawIndexAlgorithmVariants.Direct; + +// A value with helper functions to construct the type. +export const RawIndexAlgorithm = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const BTree = (value: number[]): RawIndexAlgorithm => ({ - tag: 'BTree', - value, - }); - export const Hash = (value: number[]): RawIndexAlgorithm => ({ - tag: 'Hash', - value, - }); - export const Direct = (value: number): RawIndexAlgorithm => ({ - tag: 'Direct', - value, - }); + BTree: (value: number[]): RawIndexAlgorithm => ({ tag: 'BTree', value }), + Hash: (value: number[]): RawIndexAlgorithm => ({ tag: 'Hash', value }), + Direct: (value: number): RawIndexAlgorithm => ({ tag: 'Direct', value }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'BTree', - algebraicType: AlgebraicType.Array(AlgebraicType.U16), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), + }, + { + name: 'Hash', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), }, - { name: 'Hash', algebraicType: AlgebraicType.Array(AlgebraicType.U16) }, - { name: 'Direct', algebraicType: AlgebraicType.U16 }, + { name: 'Direct', algebraicType: __AlgebraicTypeValue.U16 }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawIndexAlgorithm - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawIndexAlgorithm): void { + __AlgebraicTypeValue.serializeValue( writer, RawIndexAlgorithm.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawIndexAlgorithm { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawIndexAlgorithm { + return __AlgebraicTypeValue.deserializeValue( reader, RawIndexAlgorithm.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `RawIndexAlgorithm`. -export type RawIndexAlgorithm = - | RawIndexAlgorithmVariants.BTree - | RawIndexAlgorithmVariants.Hash - | RawIndexAlgorithmVariants.Direct; + }, +}; export default RawIndexAlgorithm; diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts new file mode 100644 index 00000000000..2e37e194bcf --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import RawIndexAlgorithm from './raw_index_algorithm_type'; + +export type BTree = { tag: 'BTree'; value: number[] }; +export type Hash = { tag: 'Hash'; value: number[] }; +export type Direct = { tag: 'Direct'; value: number }; diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts index 061c10f7e84..203609cabd8 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts @@ -1,43 +1,39 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { IndexType as __IndexType } from './index_type_type'; +import { IndexType } from './index_type_type'; export type RawIndexDefV8 = { indexName: string; isUnique: boolean; - indexType: __IndexType; + indexType: IndexType; columns: number[]; }; export default RawIndexDefV8; @@ -45,40 +41,40 @@ export default RawIndexDefV8; /** * A namespace for generated helper functions. */ -export namespace RawIndexDefV8 { +export const RawIndexDefV8 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'indexName', algebraicType: AlgebraicType.String }, - { name: 'isUnique', algebraicType: AlgebraicType.Bool }, + { name: 'indexName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'isUnique', algebraicType: __AlgebraicTypeValue.Bool }, { name: 'indexType', - algebraicType: __IndexType.getTypeScriptAlgebraicType(), + algebraicType: IndexType.getTypeScriptAlgebraicType(), }, { name: 'columns', - algebraicType: AlgebraicType.Array(AlgebraicType.U16), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawIndexDefV8): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawIndexDefV8): void { + __AlgebraicTypeValue.serializeValue( writer, RawIndexDefV8.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawIndexDefV8 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawIndexDefV8 { + return __AlgebraicTypeValue.deserializeValue( reader, RawIndexDefV8.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts index 3b0503c5edc..462f7c32095 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts @@ -1,85 +1,85 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawIndexAlgorithm as __RawIndexAlgorithm } from './raw_index_algorithm_type'; +import { RawIndexAlgorithm } from './raw_index_algorithm_type'; export type RawIndexDefV9 = { name: string | undefined; accessorName: string | undefined; - algorithm: __RawIndexAlgorithm; + algorithm: RawIndexAlgorithm; }; export default RawIndexDefV9; /** * A namespace for generated helper functions. */ -export namespace RawIndexDefV9 { +export const RawIndexDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'name', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, { name: 'accessorName', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, { name: 'algorithm', - algebraicType: __RawIndexAlgorithm.getTypeScriptAlgebraicType(), + algebraicType: RawIndexAlgorithm.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawIndexDefV9): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawIndexDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawIndexDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawIndexDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawIndexDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawIndexDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts index c6d089e48cb..69eaaadf2b6 100644 --- a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts @@ -1,81 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace RawMiscModuleExportV9Variants {} +import { RawColumnDefaultValueV9 } from './raw_column_default_value_v_9_type'; -// A namespace for generated variants and helper functions. -export namespace RawMiscModuleExportV9 { +import * as RawMiscModuleExportV9Variants from './raw_misc_module_export_v_9_variants'; + +// The tagged union or sum type for the algebraic type `RawMiscModuleExportV9`. +export type RawMiscModuleExportV9 = + RawMiscModuleExportV9Variants.ColumnDefaultValue; + +// A value with helper functions to construct the type. +export const RawMiscModuleExportV9 = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` + ColumnDefaultValue: ( + value: RawColumnDefaultValueV9 + ): RawMiscModuleExportV9 => ({ tag: 'ColumnDefaultValue', value }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ - variants: [], + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'ColumnDefaultValue', + algebraicType: RawColumnDefaultValueV9.getTypeScriptAlgebraicType(), + }, + ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawMiscModuleExportV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawMiscModuleExportV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawMiscModuleExportV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawMiscModuleExportV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawMiscModuleExportV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawMiscModuleExportV9.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `RawMiscModuleExportV9`. -export type RawMiscModuleExportV9 = never; + }, +}; export default RawMiscModuleExportV9; diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts new file mode 100644 index 00000000000..d5a198ee1b3 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts @@ -0,0 +1,38 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { RawColumnDefaultValueV9 } from './raw_column_default_value_v_9_type'; + +import RawMiscModuleExportV9 from './raw_misc_module_export_v_9_type'; + +export type ColumnDefaultValue = { + tag: 'ColumnDefaultValue'; + value: RawColumnDefaultValueV9; +}; diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts index d5f589796ec..97a30bdf27f 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts @@ -1,103 +1,86 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawModuleDefV8 as __RawModuleDefV8 } from './raw_module_def_v_8_type'; -import { RawModuleDefV9 as __RawModuleDefV9 } from './raw_module_def_v_9_type'; +import { RawModuleDefV8 } from './raw_module_def_v_8_type'; +import { RawModuleDefV9 } from './raw_module_def_v_9_type'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace RawModuleDefVariants { - export type V8BackCompat = { tag: 'V8BackCompat'; value: __RawModuleDefV8 }; - export type V9 = { tag: 'V9'; value: __RawModuleDefV9 }; -} +import * as RawModuleDefVariants from './raw_module_def_variants'; -// A namespace for generated variants and helper functions. -export namespace RawModuleDef { +// The tagged union or sum type for the algebraic type `RawModuleDef`. +export type RawModuleDef = + | RawModuleDefVariants.V8BackCompat + | RawModuleDefVariants.V9; + +// A value with helper functions to construct the type. +export const RawModuleDef = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const V8BackCompat = (value: __RawModuleDefV8): RawModuleDef => ({ + V8BackCompat: (value: RawModuleDefV8): RawModuleDef => ({ tag: 'V8BackCompat', value, - }); - export const V9 = (value: __RawModuleDefV9): RawModuleDef => ({ - tag: 'V9', - value, - }); + }), + V9: (value: RawModuleDefV9): RawModuleDef => ({ tag: 'V9', value }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'V8BackCompat', - algebraicType: __RawModuleDefV8.getTypeScriptAlgebraicType(), + algebraicType: RawModuleDefV8.getTypeScriptAlgebraicType(), }, { name: 'V9', - algebraicType: __RawModuleDefV9.getTypeScriptAlgebraicType(), + algebraicType: RawModuleDefV9.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawModuleDef): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawModuleDef): void { + __AlgebraicTypeValue.serializeValue( writer, RawModuleDef.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawModuleDef { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawModuleDef { + return __AlgebraicTypeValue.deserializeValue( reader, RawModuleDef.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `RawModuleDef`. -export type RawModuleDef = - | RawModuleDefVariants.V8BackCompat - | RawModuleDefVariants.V9; + }, +}; export default RawModuleDef; diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts index f526803b631..01a099260b0 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts @@ -1,99 +1,95 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { Typespace as __Typespace } from './typespace_type'; -import { TableDesc as __TableDesc } from './table_desc_type'; -import { ReducerDef as __ReducerDef } from './reducer_def_type'; -import { MiscModuleExport as __MiscModuleExport } from './misc_module_export_type'; +import { Typespace } from './typespace_type'; +import { TableDesc } from './table_desc_type'; +import { ReducerDef } from './reducer_def_type'; +import { MiscModuleExport } from './misc_module_export_type'; export type RawModuleDefV8 = { - typespace: __Typespace; - tables: __TableDesc[]; - reducers: __ReducerDef[]; - miscExports: __MiscModuleExport[]; + typespace: Typespace; + tables: TableDesc[]; + reducers: ReducerDef[]; + miscExports: MiscModuleExport[]; }; export default RawModuleDefV8; /** * A namespace for generated helper functions. */ -export namespace RawModuleDefV8 { +export const RawModuleDefV8 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'typespace', - algebraicType: __Typespace.getTypeScriptAlgebraicType(), + algebraicType: Typespace.getTypeScriptAlgebraicType(), }, { name: 'tables', - algebraicType: AlgebraicType.Array( - __TableDesc.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + TableDesc.getTypeScriptAlgebraicType() ), }, { name: 'reducers', - algebraicType: AlgebraicType.Array( - __ReducerDef.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + ReducerDef.getTypeScriptAlgebraicType() ), }, { name: 'miscExports', - algebraicType: AlgebraicType.Array( - __MiscModuleExport.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + MiscModuleExport.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawModuleDefV8): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawModuleDefV8): void { + __AlgebraicTypeValue.serializeValue( writer, RawModuleDefV8.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawModuleDefV8 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawModuleDefV8 { + return __AlgebraicTypeValue.deserializeValue( reader, RawModuleDefV8.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts index 23c5f2962b2..f6603c11c0a 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts @@ -1,115 +1,111 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { Typespace as __Typespace } from './typespace_type'; -import { RawTableDefV9 as __RawTableDefV9 } from './raw_table_def_v_9_type'; -import { RawReducerDefV9 as __RawReducerDefV9 } from './raw_reducer_def_v_9_type'; -import { RawTypeDefV9 as __RawTypeDefV9 } from './raw_type_def_v_9_type'; -import { RawMiscModuleExportV9 as __RawMiscModuleExportV9 } from './raw_misc_module_export_v_9_type'; -import { RawRowLevelSecurityDefV9 as __RawRowLevelSecurityDefV9 } from './raw_row_level_security_def_v_9_type'; +import { Typespace } from './typespace_type'; +import { RawTableDefV9 } from './raw_table_def_v_9_type'; +import { RawReducerDefV9 } from './raw_reducer_def_v_9_type'; +import { RawTypeDefV9 } from './raw_type_def_v_9_type'; +import { RawMiscModuleExportV9 } from './raw_misc_module_export_v_9_type'; +import { RawRowLevelSecurityDefV9 } from './raw_row_level_security_def_v_9_type'; export type RawModuleDefV9 = { - typespace: __Typespace; - tables: __RawTableDefV9[]; - reducers: __RawReducerDefV9[]; - types: __RawTypeDefV9[]; - miscExports: __RawMiscModuleExportV9[]; - rowLevelSecurity: __RawRowLevelSecurityDefV9[]; + typespace: Typespace; + tables: RawTableDefV9[]; + reducers: RawReducerDefV9[]; + types: RawTypeDefV9[]; + miscExports: RawMiscModuleExportV9[]; + rowLevelSecurity: RawRowLevelSecurityDefV9[]; }; export default RawModuleDefV9; /** * A namespace for generated helper functions. */ -export namespace RawModuleDefV9 { +export const RawModuleDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'typespace', - algebraicType: __Typespace.getTypeScriptAlgebraicType(), + algebraicType: Typespace.getTypeScriptAlgebraicType(), }, { name: 'tables', - algebraicType: AlgebraicType.Array( - __RawTableDefV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawTableDefV9.getTypeScriptAlgebraicType() ), }, { name: 'reducers', - algebraicType: AlgebraicType.Array( - __RawReducerDefV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawReducerDefV9.getTypeScriptAlgebraicType() ), }, { name: 'types', - algebraicType: AlgebraicType.Array( - __RawTypeDefV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawTypeDefV9.getTypeScriptAlgebraicType() ), }, { name: 'miscExports', - algebraicType: AlgebraicType.Array( - __RawMiscModuleExportV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawMiscModuleExportV9.getTypeScriptAlgebraicType() ), }, { name: 'rowLevelSecurity', - algebraicType: AlgebraicType.Array( - __RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawModuleDefV9): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawModuleDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawModuleDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawModuleDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawModuleDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawModuleDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts new file mode 100644 index 00000000000..f87ac4bf23c --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts @@ -0,0 +1,37 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { RawModuleDefV8 } from './raw_module_def_v_8_type'; +import { RawModuleDefV9 } from './raw_module_def_v_9_type'; + +import RawModuleDef from './raw_module_def_type'; + +export type V8BackCompat = { tag: 'V8BackCompat'; value: RawModuleDefV8 }; +export type V9 = { tag: 'V9'; value: RawModuleDefV9 }; diff --git a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts index 9106ef76573..278e0ab0c54 100644 --- a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts @@ -1,88 +1,81 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { ProductType as __ProductType } from './product_type_type'; -import { Lifecycle as __Lifecycle } from './lifecycle_type'; +import { ProductType } from './product_type_type'; +import { Lifecycle } from './lifecycle_type'; export type RawReducerDefV9 = { name: string; - params: __ProductType; - lifecycle: __Lifecycle | undefined; + params: ProductType; + lifecycle: Lifecycle | undefined; }; export default RawReducerDefV9; /** * A namespace for generated helper functions. */ -export namespace RawReducerDefV9 { +export const RawReducerDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'name', algebraicType: AlgebraicType.String }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, { name: 'params', - algebraicType: __ProductType.getTypeScriptAlgebraicType(), + algebraicType: ProductType.getTypeScriptAlgebraicType(), }, { name: 'lifecycle', - algebraicType: AlgebraicType.createOptionType( - __Lifecycle.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.createOptionType( + Lifecycle.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawReducerDefV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawReducerDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawReducerDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawReducerDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawReducerDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawReducerDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts index 95e2046cd51..b88cbb362d2 100644 --- a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type RawRowLevelSecurityDefV9 = { sql: string; }; @@ -40,32 +37,29 @@ export default RawRowLevelSecurityDefV9; /** * A namespace for generated helper functions. */ -export namespace RawRowLevelSecurityDefV9 { +export const RawRowLevelSecurityDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ - elements: [{ name: 'sql', algebraicType: AlgebraicType.String }], + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [{ name: 'sql', algebraicType: __AlgebraicTypeValue.String }], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawRowLevelSecurityDefV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawRowLevelSecurityDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawRowLevelSecurityDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawRowLevelSecurityDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts index 8d15be4c2c1..8540b0c604b 100644 --- a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type RawScheduleDefV9 = { name: string | undefined; reducerName: string; @@ -42,39 +39,38 @@ export default RawScheduleDefV9; /** * A namespace for generated helper functions. */ -export namespace RawScheduleDefV9 { +export const RawScheduleDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'name', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, - { name: 'reducerName', algebraicType: AlgebraicType.String }, - { name: 'scheduledAtColumn', algebraicType: AlgebraicType.U16 }, + { name: 'reducerName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'scheduledAtColumn', algebraicType: __AlgebraicTypeValue.U16 }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawScheduleDefV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawScheduleDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawScheduleDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawScheduleDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawScheduleDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawScheduleDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts index f03fb5ac838..d4f126d426a 100644 --- a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type RawScopedTypeNameV9 = { scope: string[]; name: string; @@ -41,38 +38,37 @@ export default RawScopedTypeNameV9; /** * A namespace for generated helper functions. */ -export namespace RawScopedTypeNameV9 { +export const RawScopedTypeNameV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'scope', - algebraicType: AlgebraicType.Array(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.Array( + __AlgebraicTypeValue.String + ), }, - { name: 'name', algebraicType: AlgebraicType.String }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawScopedTypeNameV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawScopedTypeNameV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawScopedTypeNameV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawScopedTypeNameV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawScopedTypeNameV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawScopedTypeNameV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts index 1acd51dbc42..64ec8ebcb24 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type RawSequenceDefV8 = { sequenceName: string; colPos: number; @@ -46,49 +43,52 @@ export default RawSequenceDefV8; /** * A namespace for generated helper functions. */ -export namespace RawSequenceDefV8 { +export const RawSequenceDefV8 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'sequenceName', algebraicType: AlgebraicType.String }, - { name: 'colPos', algebraicType: AlgebraicType.U16 }, - { name: 'increment', algebraicType: AlgebraicType.I128 }, + { name: 'sequenceName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'colPos', algebraicType: __AlgebraicTypeValue.U16 }, + { name: 'increment', algebraicType: __AlgebraicTypeValue.I128 }, { name: 'start', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), }, { name: 'minValue', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), }, { name: 'maxValue', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), }, - { name: 'allocated', algebraicType: AlgebraicType.I128 }, + { name: 'allocated', algebraicType: __AlgebraicTypeValue.I128 }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawSequenceDefV8 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawSequenceDefV8): void { + __AlgebraicTypeValue.serializeValue( writer, RawSequenceDefV8.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawSequenceDefV8 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawSequenceDefV8 { + return __AlgebraicTypeValue.deserializeValue( reader, RawSequenceDefV8.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts index c0d402613f1..baaa581b48a 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type RawSequenceDefV9 = { name: string | undefined; column: number; @@ -45,51 +42,56 @@ export default RawSequenceDefV9; /** * A namespace for generated helper functions. */ -export namespace RawSequenceDefV9 { +export const RawSequenceDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'name', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, - { name: 'column', algebraicType: AlgebraicType.U16 }, + { name: 'column', algebraicType: __AlgebraicTypeValue.U16 }, { name: 'start', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), }, { name: 'minValue', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), }, { name: 'maxValue', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.I128), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), }, - { name: 'increment', algebraicType: AlgebraicType.I128 }, + { name: 'increment', algebraicType: __AlgebraicTypeValue.I128 }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawSequenceDefV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawSequenceDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawSequenceDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawSequenceDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawSequenceDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawSequenceDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts index 873d2cb042e..df323c87ec4 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts @@ -1,48 +1,44 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawColumnDefV8 as __RawColumnDefV8 } from './raw_column_def_v_8_type'; -import { RawIndexDefV8 as __RawIndexDefV8 } from './raw_index_def_v_8_type'; -import { RawConstraintDefV8 as __RawConstraintDefV8 } from './raw_constraint_def_v_8_type'; -import { RawSequenceDefV8 as __RawSequenceDefV8 } from './raw_sequence_def_v_8_type'; +import { RawColumnDefV8 } from './raw_column_def_v_8_type'; +import { RawIndexDefV8 } from './raw_index_def_v_8_type'; +import { RawConstraintDefV8 } from './raw_constraint_def_v_8_type'; +import { RawSequenceDefV8 } from './raw_sequence_def_v_8_type'; export type RawTableDefV8 = { tableName: string; - columns: __RawColumnDefV8[]; - indexes: __RawIndexDefV8[]; - constraints: __RawConstraintDefV8[]; - sequences: __RawSequenceDefV8[]; + columns: RawColumnDefV8[]; + indexes: RawIndexDefV8[]; + constraints: RawConstraintDefV8[]; + sequences: RawSequenceDefV8[]; tableType: string; tableAccess: string; scheduled: string | undefined; @@ -52,61 +48,63 @@ export default RawTableDefV8; /** * A namespace for generated helper functions. */ -export namespace RawTableDefV8 { +export const RawTableDefV8 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'tableName', algebraicType: AlgebraicType.String }, + { name: 'tableName', algebraicType: __AlgebraicTypeValue.String }, { name: 'columns', - algebraicType: AlgebraicType.Array( - __RawColumnDefV8.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawColumnDefV8.getTypeScriptAlgebraicType() ), }, { name: 'indexes', - algebraicType: AlgebraicType.Array( - __RawIndexDefV8.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawIndexDefV8.getTypeScriptAlgebraicType() ), }, { name: 'constraints', - algebraicType: AlgebraicType.Array( - __RawConstraintDefV8.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawConstraintDefV8.getTypeScriptAlgebraicType() ), }, { name: 'sequences', - algebraicType: AlgebraicType.Array( - __RawSequenceDefV8.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawSequenceDefV8.getTypeScriptAlgebraicType() ), }, - { name: 'tableType', algebraicType: AlgebraicType.String }, - { name: 'tableAccess', algebraicType: AlgebraicType.String }, + { name: 'tableType', algebraicType: __AlgebraicTypeValue.String }, + { name: 'tableAccess', algebraicType: __AlgebraicTypeValue.String }, { name: 'scheduled', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawTableDefV8): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawTableDefV8): void { + __AlgebraicTypeValue.serializeValue( writer, RawTableDefV8.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawTableDefV8 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawTableDefV8 { + return __AlgebraicTypeValue.deserializeValue( reader, RawTableDefV8.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts index 2d51371911d..eac754cef77 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts @@ -1,122 +1,118 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawIndexDefV9 as __RawIndexDefV9 } from './raw_index_def_v_9_type'; -import { RawConstraintDefV9 as __RawConstraintDefV9 } from './raw_constraint_def_v_9_type'; -import { RawSequenceDefV9 as __RawSequenceDefV9 } from './raw_sequence_def_v_9_type'; -import { RawScheduleDefV9 as __RawScheduleDefV9 } from './raw_schedule_def_v_9_type'; -import { TableType as __TableType } from './table_type_type'; -import { TableAccess as __TableAccess } from './table_access_type'; +import { RawIndexDefV9 } from './raw_index_def_v_9_type'; +import { RawConstraintDefV9 } from './raw_constraint_def_v_9_type'; +import { RawSequenceDefV9 } from './raw_sequence_def_v_9_type'; +import { RawScheduleDefV9 } from './raw_schedule_def_v_9_type'; +import { TableType } from './table_type_type'; +import { TableAccess } from './table_access_type'; export type RawTableDefV9 = { name: string; productTypeRef: number; primaryKey: number[]; - indexes: __RawIndexDefV9[]; - constraints: __RawConstraintDefV9[]; - sequences: __RawSequenceDefV9[]; - schedule: __RawScheduleDefV9 | undefined; - tableType: __TableType; - tableAccess: __TableAccess; + indexes: RawIndexDefV9[]; + constraints: RawConstraintDefV9[]; + sequences: RawSequenceDefV9[]; + schedule: RawScheduleDefV9 | undefined; + tableType: TableType; + tableAccess: TableAccess; }; export default RawTableDefV9; /** * A namespace for generated helper functions. */ -export namespace RawTableDefV9 { +export const RawTableDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'name', algebraicType: AlgebraicType.String }, - { name: 'productTypeRef', algebraicType: AlgebraicType.U32 }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'productTypeRef', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'primaryKey', - algebraicType: AlgebraicType.Array(AlgebraicType.U16), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), }, { name: 'indexes', - algebraicType: AlgebraicType.Array( - __RawIndexDefV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawIndexDefV9.getTypeScriptAlgebraicType() ), }, { name: 'constraints', - algebraicType: AlgebraicType.Array( - __RawConstraintDefV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawConstraintDefV9.getTypeScriptAlgebraicType() ), }, { name: 'sequences', - algebraicType: AlgebraicType.Array( - __RawSequenceDefV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + RawSequenceDefV9.getTypeScriptAlgebraicType() ), }, { name: 'schedule', - algebraicType: AlgebraicType.createOptionType( - __RawScheduleDefV9.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.createOptionType( + RawScheduleDefV9.getTypeScriptAlgebraicType() ), }, { name: 'tableType', - algebraicType: __TableType.getTypeScriptAlgebraicType(), + algebraicType: TableType.getTypeScriptAlgebraicType(), }, { name: 'tableAccess', - algebraicType: __TableAccess.getTypeScriptAlgebraicType(), + algebraicType: TableAccess.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawTableDefV9): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawTableDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawTableDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawTableDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawTableDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawTableDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts index 0e4b516e766..8002ebd10bb 100644 --- a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts @@ -1,41 +1,37 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawScopedTypeNameV9 as __RawScopedTypeNameV9 } from './raw_scoped_type_name_v_9_type'; +import { RawScopedTypeNameV9 } from './raw_scoped_type_name_v_9_type'; export type RawTypeDefV9 = { - name: __RawScopedTypeNameV9; + name: RawScopedTypeNameV9; ty: number; customOrdering: boolean; }; @@ -44,36 +40,36 @@ export default RawTypeDefV9; /** * A namespace for generated helper functions. */ -export namespace RawTypeDefV9 { +export const RawTypeDefV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'name', - algebraicType: __RawScopedTypeNameV9.getTypeScriptAlgebraicType(), + algebraicType: RawScopedTypeNameV9.getTypeScriptAlgebraicType(), }, - { name: 'ty', algebraicType: AlgebraicType.U32 }, - { name: 'customOrdering', algebraicType: AlgebraicType.Bool }, + { name: 'ty', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'customOrdering', algebraicType: __AlgebraicTypeValue.Bool }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RawTypeDefV9): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawTypeDefV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawTypeDefV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawTypeDefV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawTypeDefV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawTypeDefV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts index 9330420f261..2510c540dc0 100644 --- a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type RawUniqueConstraintDataV9 = { columns: number[]; }; @@ -40,37 +37,34 @@ export default RawUniqueConstraintDataV9; /** * A namespace for generated helper functions. */ -export namespace RawUniqueConstraintDataV9 { +export const RawUniqueConstraintDataV9 = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'columns', - algebraicType: AlgebraicType.Array(AlgebraicType.U16), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: RawUniqueConstraintDataV9 - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RawUniqueConstraintDataV9): void { + __AlgebraicTypeValue.serializeValue( writer, RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RawUniqueConstraintDataV9 { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RawUniqueConstraintDataV9 { + return __AlgebraicTypeValue.deserializeValue( reader, RawUniqueConstraintDataV9.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/reducer_def_type.ts b/crates/bindings-typescript/src/autogen/reducer_def_type.ts index 0542a4b2547..23a24da5883 100644 --- a/crates/bindings-typescript/src/autogen/reducer_def_type.ts +++ b/crates/bindings-typescript/src/autogen/reducer_def_type.ts @@ -1,79 +1,75 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { ProductTypeElement as __ProductTypeElement } from './product_type_element_type'; +import { ProductTypeElement } from './product_type_element_type'; export type ReducerDef = { name: string; - args: __ProductTypeElement[]; + args: ProductTypeElement[]; }; export default ReducerDef; /** * A namespace for generated helper functions. */ -export namespace ReducerDef { +export const ReducerDef = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'name', algebraicType: AlgebraicType.String }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, { name: 'args', - algebraicType: AlgebraicType.Array( - __ProductTypeElement.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + ProductTypeElement.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: ReducerDef): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: ReducerDef): void { + __AlgebraicTypeValue.serializeValue( writer, ReducerDef.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): ReducerDef { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): ReducerDef { + return __AlgebraicTypeValue.deserializeValue( reader, ReducerDef.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/sum_type_type.ts b/crates/bindings-typescript/src/autogen/sum_type_type.ts index fd29825d9c9..e8293bfd636 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_type.ts @@ -1,77 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { SumTypeVariant as __SumTypeVariant } from './sum_type_variant_type'; +import { SumTypeVariant } from './sum_type_variant_type'; export type SumType = { - variants: __SumTypeVariant[]; + variants: SumTypeVariant[]; }; export default SumType; /** * A namespace for generated helper functions. */ -export namespace SumType { +export const SumType = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'variants', - algebraicType: AlgebraicType.Array( - __SumTypeVariant.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + SumTypeVariant.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: SumType): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: SumType): void { + __AlgebraicTypeValue.serializeValue( writer, SumType.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): SumType { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): SumType { + return __AlgebraicTypeValue.deserializeValue( reader, SumType.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts index 7575d755d21..e153d28cddf 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -1,80 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { __AlgebraicType } from './algebraic_type_type'; +import { AlgebraicType } from './algebraic_type_type'; export type SumTypeVariant = { name: string | undefined; - algebraicType: __AlgebraicType; + algebraicType: AlgebraicType; }; export default SumTypeVariant; /** * A namespace for generated helper functions. */ -export namespace SumTypeVariant { +export const SumTypeVariant = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'name', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, { name: 'algebraicType', - algebraicType: __AlgebraicType.getTypeScriptAlgebraicType(), + algebraicType: AlgebraicType.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: SumTypeVariant): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: SumTypeVariant): void { + __AlgebraicTypeValue.serializeValue( writer, SumTypeVariant.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): SumTypeVariant { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): SumTypeVariant { + return __AlgebraicTypeValue.deserializeValue( reader, SumTypeVariant.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/table_access_type.ts b/crates/bindings-typescript/src/autogen/table_access_type.ts index 1d0915c9247..bf9c23bca6d 100644 --- a/crates/bindings-typescript/src/autogen/table_access_type.ts +++ b/crates/bindings-typescript/src/autogen/table_access_type.ts @@ -1,94 +1,80 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace TableAccessVariants { - export type Public = { tag: 'Public' }; - export type Private = { tag: 'Private' }; -} +import * as TableAccessVariants from './table_access_variants'; -// A namespace for generated variants and helper functions. -export namespace TableAccess { +// The tagged union or sum type for the algebraic type `TableAccess`. +export type TableAccess = + | TableAccessVariants.Public + | TableAccessVariants.Private; + +// A value with helper functions to construct the type. +export const TableAccess = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Public: { tag: 'Public' } = { tag: 'Public' }; - export const Private: { tag: 'Private' } = { tag: 'Private' }; + Public: { tag: 'Public' } as const, + Private: { tag: 'Private' } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'Public', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'Private', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: TableAccess): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: TableAccess): void { + __AlgebraicTypeValue.serializeValue( writer, TableAccess.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): TableAccess { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): TableAccess { + return __AlgebraicTypeValue.deserializeValue( reader, TableAccess.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `TableAccess`. -export type TableAccess = - | TableAccessVariants.Public - | TableAccessVariants.Private; + }, +}; export default TableAccess; diff --git a/crates/bindings-typescript/src/autogen/table_access_variants.ts b/crates/bindings-typescript/src/autogen/table_access_variants.ts new file mode 100644 index 00000000000..197e5201204 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_access_variants.ts @@ -0,0 +1,34 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import TableAccess from './table_access_type'; + +export type Public = { tag: 'Public' }; +export type Private = { tag: 'Private' }; diff --git a/crates/bindings-typescript/src/autogen/table_desc_type.ts b/crates/bindings-typescript/src/autogen/table_desc_type.ts index ffe728c0c8e..43687c2ac0b 100644 --- a/crates/bindings-typescript/src/autogen/table_desc_type.ts +++ b/crates/bindings-typescript/src/autogen/table_desc_type.ts @@ -1,41 +1,37 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawTableDefV8 as __RawTableDefV8 } from './raw_table_def_v_8_type'; +import { RawTableDefV8 } from './raw_table_def_v_8_type'; export type TableDesc = { - schema: __RawTableDefV8; + schema: RawTableDefV8; data: number; }; export default TableDesc; @@ -43,35 +39,35 @@ export default TableDesc; /** * A namespace for generated helper functions. */ -export namespace TableDesc { +export const TableDesc = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'schema', - algebraicType: __RawTableDefV8.getTypeScriptAlgebraicType(), + algebraicType: RawTableDefV8.getTypeScriptAlgebraicType(), }, - { name: 'data', algebraicType: AlgebraicType.U32 }, + { name: 'data', algebraicType: __AlgebraicTypeValue.U32 }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: TableDesc): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: TableDesc): void { + __AlgebraicTypeValue.serializeValue( writer, TableDesc.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): TableDesc { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): TableDesc { + return __AlgebraicTypeValue.deserializeValue( reader, TableDesc.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/table_type_type.ts b/crates/bindings-typescript/src/autogen/table_type_type.ts index d14f0d4c6a4..1d61702aad6 100644 --- a/crates/bindings-typescript/src/autogen/table_type_type.ts +++ b/crates/bindings-typescript/src/autogen/table_type_type.ts @@ -1,92 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace TableTypeVariants { - export type System = { tag: 'System' }; - export type User = { tag: 'User' }; -} +import * as TableTypeVariants from './table_type_variants'; -// A namespace for generated variants and helper functions. -export namespace TableType { +// The tagged union or sum type for the algebraic type `TableType`. +export type TableType = TableTypeVariants.System | TableTypeVariants.User; + +// A value with helper functions to construct the type. +export const TableType = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const System: { tag: 'System' } = { tag: 'System' }; - export const User: { tag: 'User' } = { tag: 'User' }; + System: { tag: 'System' } as const, + User: { tag: 'User' } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'System', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, { name: 'User', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: TableType): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: TableType): void { + __AlgebraicTypeValue.serializeValue( writer, TableType.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): TableType { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): TableType { + return __AlgebraicTypeValue.deserializeValue( reader, TableType.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `TableType`. -export type TableType = TableTypeVariants.System | TableTypeVariants.User; + }, +}; export default TableType; diff --git a/crates/bindings-typescript/src/autogen/table_type_variants.ts b/crates/bindings-typescript/src/autogen/table_type_variants.ts new file mode 100644 index 00000000000..2ed28bbc33c --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_type_variants.ts @@ -0,0 +1,34 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import TableType from './table_type_type'; + +export type System = { tag: 'System' }; +export type User = { tag: 'User' }; diff --git a/crates/bindings-typescript/src/autogen/type_alias_type.ts b/crates/bindings-typescript/src/autogen/type_alias_type.ts index dee431c3ff2..439ca7e6cb7 100644 --- a/crates/bindings-typescript/src/autogen/type_alias_type.ts +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type TypeAlias = { name: string; ty: number; @@ -41,32 +38,32 @@ export default TypeAlias; /** * A namespace for generated helper functions. */ -export namespace TypeAlias { +export const TypeAlias = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'name', algebraicType: AlgebraicType.String }, - { name: 'ty', algebraicType: AlgebraicType.U32 }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'ty', algebraicType: __AlgebraicTypeValue.U32 }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: TypeAlias): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: TypeAlias): void { + __AlgebraicTypeValue.serializeValue( writer, TypeAlias.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): TypeAlias { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): TypeAlias { + return __AlgebraicTypeValue.deserializeValue( reader, TypeAlias.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts index 16e4200b704..ebd3cc508b6 100644 --- a/crates/bindings-typescript/src/autogen/typespace_type.ts +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -1,77 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { __AlgebraicType } from './algebraic_type_type'; +import { AlgebraicType } from './algebraic_type_type'; export type Typespace = { - types: __AlgebraicType[]; + types: AlgebraicType[]; }; export default Typespace; /** * A namespace for generated helper functions. */ -export namespace Typespace { +export const Typespace = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'types', - algebraicType: AlgebraicType.Array( - __AlgebraicType.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + AlgebraicType.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: Typespace): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: Typespace): void { + __AlgebraicTypeValue.serializeValue( writer, Typespace.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): Typespace { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): Typespace { + return __AlgebraicTypeValue.deserializeValue( reader, Typespace.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/crates/bindings-typescript/src/connection_id.ts b/crates/bindings-typescript/src/connection_id.ts index c8d95016c18..9428069e797 100644 --- a/crates/bindings-typescript/src/connection_id.ts +++ b/crates/bindings-typescript/src/connection_id.ts @@ -69,7 +69,7 @@ export class ConnectionId { } static fromStringOrNull(str: string): ConnectionId | null { - let addr = ConnectionId.fromString(str); + const addr = ConnectionId.fromString(str); if (addr.isZero()) { return null; } else { diff --git a/crates/bindings-typescript/src/schedule_at.ts b/crates/bindings-typescript/src/schedule_at.ts index 303ce15eb6a..be1d8962e46 100644 --- a/crates/bindings-typescript/src/schedule_at.ts +++ b/crates/bindings-typescript/src/schedule_at.ts @@ -1,7 +1,9 @@ import { AlgebraicType } from './algebraic_type'; -export namespace ScheduleAt { - export function getAlgebraicType(): AlgebraicType { +export const ScheduleAt: { + getAlgebraicType(): AlgebraicType; +} = { + getAlgebraicType(): AlgebraicType { return AlgebraicType.Sum({ variants: [ { @@ -11,25 +13,25 @@ export namespace ScheduleAt { { name: 'Time', algebraicType: AlgebraicType.createTimestampType() }, ], }); - } + }, +}; - export type Interval = { - tag: 'Interval'; - value: { __time_duration_micros__: BigInt }; - }; - export const Interval = (value: BigInt): Interval => ({ - tag: 'Interval', - value: { __time_duration_micros__: value }, - }); - export type Time = { - tag: 'Time'; - value: { __timestamp_micros_since_unix_epoch__: BigInt }; - }; - export const Time = (value: BigInt): Time => ({ - tag: 'Time', - value: { __timestamp_micros_since_unix_epoch__: value }, - }); -} +export type Interval = { + tag: 'Interval'; + value: { __time_duration_micros__: bigint }; +}; +export const Interval = (value: bigint): Interval => ({ + tag: 'Interval', + value: { __time_duration_micros__: value }, +}); +export type Time = { + tag: 'Time'; + value: { __timestamp_micros_since_unix_epoch__: bigint }; +}; +export const Time = (value: bigint): Time => ({ + tag: 'Time', + value: { __timestamp_micros_since_unix_epoch__: value }, +}); -export type ScheduleAt = ScheduleAt.Interval | ScheduleAt.Time; +export type ScheduleAt = Interval | Time; export default ScheduleAt; diff --git a/crates/bindings-typescript/src/utils.ts b/crates/bindings-typescript/src/utils.ts index 4ab3b4609a7..b29c3d05c6b 100644 --- a/crates/bindings-typescript/src/utils.ts +++ b/crates/bindings-typescript/src/utils.ts @@ -31,7 +31,7 @@ export function deepEqual(obj1: any, obj2: any): boolean { if (keys1.length !== keys2.length) return false; // Check all keys and compare values recursively - for (let key of keys1) { + for (const key of keys1) { if (!keys2.includes(key) || !deepEqual(obj1[key], obj2[key])) { return false; } @@ -64,8 +64,10 @@ export function hexStringToUint8Array(str: string): Uint8Array { if (str.startsWith('0x')) { str = str.slice(2); } - let matches = str.match(/.{1,2}/g) || []; - let data = Uint8Array.from(matches.map((byte: string) => parseInt(byte, 16))); + const matches = str.match(/.{1,2}/g) || []; + const data = Uint8Array.from( + matches.map((byte: string) => parseInt(byte, 16)) + ); if (data.length != 32) { return new Uint8Array(0); } @@ -81,7 +83,7 @@ export function hexStringToU256(str: string): bigint { } export function u128ToUint8Array(data: bigint): Uint8Array { - let writer = new BinaryWriter(16); + const writer = new BinaryWriter(16); writer.writeU128(data); return writer.getBuffer(); } @@ -91,7 +93,7 @@ export function u128ToHexString(data: bigint): string { } export function u256ToUint8Array(data: bigint): Uint8Array { - let writer = new BinaryWriter(32); + const writer = new BinaryWriter(32); writer.writeU256(data); return writer.getBuffer(); } diff --git a/crates/bindings-typescript/tsconfig.json b/crates/bindings-typescript/tsconfig.json index d676fea5d40..1c25ed3d799 100644 --- a/crates/bindings-typescript/tsconfig.json +++ b/crates/bindings-typescript/tsconfig.json @@ -2,20 +2,26 @@ "compilerOptions": { "target": "ESNext", "module": "ESNext", + + "strict": true, "declaration": true, "emitDeclarationOnly": false, "noEmit": true, - "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "verbatimModuleSyntax": true, "allowImportingTsExtensions": true, - "strict": true, - "noImplicitAny": false, + "noImplicitAny": true, "moduleResolution": "Bundler", - "allowSyntheticDefaultImports": true, "isolatedDeclarations": true, - "isolatedModules": true, + + // This library is ESM-only, do not import commonjs modules + "esModuleInterop": false, + "allowSyntheticDefaultImports": false, + "useDefineForClassFields": true, + + // Crucial when using esbuild/swc/babel instead of tsc emit: + "verbatimModuleSyntax": true, + "isolatedModules": true }, "include": ["src/**/*", "tests/**/*"], "exclude": ["node_modules", "**/__tests__/*", "dist/**/*"] diff --git a/crates/cli/src/subcommands/generate.rs b/crates/cli/src/subcommands/generate.rs index cce0d353dd2..6e60cd00c29 100644 --- a/crates/cli/src/subcommands/generate.rs +++ b/crates/cli/src/subcommands/generate.rs @@ -5,7 +5,7 @@ use clap::parser::ValueSource; use clap::Arg; use clap::ArgAction::Set; use fs_err as fs; -use spacetimedb_codegen::{generate, Csharp, Lang, Rust, TypeScript, AUTO_GENERATED_PREFIX}; +use spacetimedb_codegen::{generate, Csharp, Lang, OutputFile, Rust, TypeScript, AUTO_GENERATED_PREFIX}; use spacetimedb_lib::de::serde::DeserializeWrapper; use spacetimedb_lib::{sats, RawModuleDef}; use spacetimedb_schema; @@ -145,8 +145,8 @@ pub async fn exec_ex( Language::TypeScript => &TypeScript, }; - for (fname, code) in generate(&module, gen_lang) { - let fname = Path::new(&fname); + for OutputFile { filename, code } in generate(&module, gen_lang) { + let fname = Path::new(&filename); // If a generator asks for a file in a subdirectory, create the subdirectory first. if let Some(parent) = fname.parent().filter(|p| !p.as_os_str().is_empty()) { fs::create_dir_all(out_dir.join(parent))?; diff --git a/crates/codegen/examples/regen-csharp-moduledef.rs b/crates/codegen/examples/regen-csharp-moduledef.rs index 11510d4e26f..74db4b9de90 100644 --- a/crates/codegen/examples/regen-csharp-moduledef.rs +++ b/crates/codegen/examples/regen-csharp-moduledef.rs @@ -3,7 +3,7 @@ use fs_err as fs; use regex::Regex; -use spacetimedb_codegen::{csharp, generate}; +use spacetimedb_codegen::{csharp, generate, OutputFile}; use spacetimedb_lib::{RawModuleDef, RawModuleDefV8}; use spacetimedb_schema::def::ModuleDef; use std::path::Path; @@ -39,7 +39,7 @@ fn main() -> anyhow::Result<()> { }, ) .into_iter() - .try_for_each(|(filename, code)| { + .try_for_each(|OutputFile { filename, code }| { // Skip anything but raw types (in particular, this will skip top-level SpacetimeDBClient.g.cs which we don't need). let Some(filename) = filename.strip_prefix("Types/") else { return Ok(()); diff --git a/crates/codegen/examples/regen-typescript-moduledef.rs b/crates/codegen/examples/regen-typescript-moduledef.rs index 1b07d0d0c7c..fcf098bcdae 100644 --- a/crates/codegen/examples/regen-typescript-moduledef.rs +++ b/crates/codegen/examples/regen-typescript-moduledef.rs @@ -3,7 +3,7 @@ use fs_err as fs; use regex::Regex; -use spacetimedb_codegen::{generate, typescript}; +use spacetimedb_codegen::{generate, typescript, OutputFile}; use spacetimedb_lib::{RawModuleDef, RawModuleDefV8}; use spacetimedb_schema::def::ModuleDef; use std::path::Path; @@ -34,13 +34,12 @@ fn main() -> anyhow::Result<()> { let module: ModuleDef = module.try_into()?; generate(&module, &typescript::TypeScript) .into_iter() - .try_for_each(|(filename, code)| { + .try_for_each(|OutputFile { filename, code }| { // Skip the index.ts since we don't need it. if filename == "index.ts" { return Ok(()); } let code = regex_replace!(&code, r"@clockworklabs/spacetimedb-sdk", "../index"); - let code = &code.replace("AlgebraicType as __AlgebraicType", "__AlgebraicType"); fs::write(dir.join(filename), code.as_bytes()) })?; diff --git a/crates/codegen/src/csharp.rs b/crates/codegen/src/csharp.rs index 884600b2d80..0bae17a05f8 100644 --- a/crates/codegen/src/csharp.rs +++ b/crates/codegen/src/csharp.rs @@ -6,16 +6,15 @@ use std::ops::Deref; use super::code_indenter::CodeIndenter; use super::Lang; -use crate::indent_scope; use crate::util::{ collect_case, is_reducer_invokable, iter_indexes, iter_reducers, iter_tables, print_auto_generated_file_comment, type_ref_name, }; +use crate::{indent_scope, OutputFile}; use convert_case::{Case, Casing}; use spacetimedb_lib::sats::layout::PrimitiveType; use spacetimedb_primitives::ColId; use spacetimedb_schema::def::{BTreeAlgorithm, IndexAlgorithm, ModuleDef, TableDef, TypeDef}; -use spacetimedb_schema::identifier::Identifier; use spacetimedb_schema::schema::{Schema, TableSchema}; use spacetimedb_schema::type_for_generate::{ AlgebraicTypeDef, AlgebraicTypeUse, PlainEnumTypeDef, ProductTypeDef, SumTypeDef, TypespaceForGenerate, @@ -434,19 +433,7 @@ pub struct Csharp<'opts> { } impl Lang for Csharp<'_> { - fn table_filename(&self, _module: &ModuleDef, table: &TableDef) -> String { - format!("Tables/{}.g.cs", table.name.deref().to_case(Case::Pascal)) - } - - fn type_filename(&self, type_name: &spacetimedb_schema::def::ScopedTypeName) -> String { - format!("Types/{}.g.cs", collect_case(Case::Pascal, type_name.name_segments())) - } - - fn reducer_filename(&self, reducer_name: &Identifier) -> String { - format!("Reducers/{}.g.cs", reducer_name.deref().to_case(Case::Pascal)) - } - - fn generate_table(&self, module: &ModuleDef, table: &TableDef) -> String { + fn generate_table_file(&self, module: &ModuleDef, table: &TableDef) -> OutputFile { let mut output = CsharpAutogen::new( self.namespace, &[ @@ -572,19 +559,27 @@ impl Lang for Csharp<'_> { writeln!(output, "public readonly {csharp_table_class_name} {csharp_table_name};"); }); - output.into_inner() + OutputFile { + filename: format!("Tables/{}.g.cs", table.name.deref().to_case(Case::Pascal)), + code: output.into_inner(), + } } - fn generate_type(&self, module: &ModuleDef, typ: &TypeDef) -> String { + fn generate_type_files(&self, module: &ModuleDef, typ: &TypeDef) -> Vec { let name = collect_case(Case::Pascal, typ.name.name_segments()); - match &module.typespace_for_generate()[typ.ty] { - AlgebraicTypeDef::Sum(sum) => autogen_csharp_sum(module, name, sum, self.namespace), - AlgebraicTypeDef::Product(prod) => autogen_csharp_tuple(module, name, prod, self.namespace), - AlgebraicTypeDef::PlainEnum(plain_enum) => autogen_csharp_plain_enum(name, plain_enum, self.namespace), - } + let filename = format!("Types/{name}.g.cs"); + let code = match &module.typespace_for_generate()[typ.ty] { + AlgebraicTypeDef::Sum(sum) => autogen_csharp_sum(module, name.clone(), sum, self.namespace), + AlgebraicTypeDef::Product(prod) => autogen_csharp_tuple(module, name.clone(), prod, self.namespace), + AlgebraicTypeDef::PlainEnum(plain_enum) => { + autogen_csharp_plain_enum(name.clone(), plain_enum, self.namespace) + } + }; + + vec![OutputFile { filename, code }] } - fn generate_reducer(&self, module: &ModuleDef, reducer: &spacetimedb_schema::def::ReducerDef) -> String { + fn generate_reducer_file(&self, module: &ModuleDef, reducer: &spacetimedb_schema::def::ReducerDef) -> OutputFile { let mut output = CsharpAutogen::new( self.namespace, &[ @@ -704,10 +699,13 @@ impl Lang for Csharp<'_> { }); } - output.into_inner() + OutputFile { + filename: format!("Reducers/{}.g.cs", reducer.name.deref().to_case(Case::Pascal)), + code: output.into_inner(), + } } - fn generate_globals(&self, module: &ModuleDef) -> Vec<(String, String)> { + fn generate_globals_file(&self, module: &ModuleDef) -> OutputFile { let mut output = CsharpAutogen::new( self.namespace, &[ @@ -860,7 +858,10 @@ impl Lang for Csharp<'_> { }); }); - vec![("SpacetimeDBClient.g.cs".to_owned(), output.into_inner())] + OutputFile { + filename: "SpacetimeDBClient.g.cs".to_owned(), + code: output.into_inner(), + } } } diff --git a/crates/codegen/src/lib.rs b/crates/codegen/src/lib.rs index d595af60238..25ba367d847 100644 --- a/crates/codegen/src/lib.rs +++ b/crates/codegen/src/lib.rs @@ -1,5 +1,4 @@ -use spacetimedb_schema::def::{ModuleDef, ReducerDef, ScopedTypeName, TableDef, TypeDef}; -use spacetimedb_schema::identifier::Identifier; +use spacetimedb_schema::def::{ModuleDef, ReducerDef, TableDef, TypeDef}; mod code_indenter; pub mod csharp; @@ -12,32 +11,24 @@ pub use self::rust::Rust; pub use self::typescript::TypeScript; pub use util::AUTO_GENERATED_PREFIX; -pub fn generate(module: &ModuleDef, lang: &dyn Lang) -> Vec<(String, String)> { +pub fn generate(module: &ModuleDef, lang: &dyn Lang) -> Vec { itertools::chain!( - module - .tables() - .map(|tbl| (lang.table_filename(module, tbl), lang.generate_table(module, tbl))), - module - .types() - .map(|typ| (lang.type_filename(&typ.name), lang.generate_type(module, typ))), - util::iter_reducers(module).map(|reducer| { - ( - lang.reducer_filename(&reducer.name), - lang.generate_reducer(module, reducer), - ) - }), - lang.generate_globals(module), + module.tables().map(|tbl| lang.generate_table_file(module, tbl)), + module.types().flat_map(|typ| lang.generate_type_files(module, typ)), + util::iter_reducers(module).map(|reducer| lang.generate_reducer_file(module, reducer)), + std::iter::once(lang.generate_globals_file(module)), ) .collect() } -pub trait Lang { - fn table_filename(&self, module: &ModuleDef, table: &TableDef) -> String; - fn type_filename(&self, type_name: &ScopedTypeName) -> String; - fn reducer_filename(&self, reducer_name: &Identifier) -> String; +pub struct OutputFile { + pub filename: String, + pub code: String, +} - fn generate_table(&self, module: &ModuleDef, tbl: &TableDef) -> String; - fn generate_type(&self, module: &ModuleDef, typ: &TypeDef) -> String; - fn generate_reducer(&self, module: &ModuleDef, reducer: &ReducerDef) -> String; - fn generate_globals(&self, module: &ModuleDef) -> Vec<(String, String)>; +pub trait Lang { + fn generate_table_file(&self, module: &ModuleDef, tbl: &TableDef) -> OutputFile; + fn generate_type_files(&self, module: &ModuleDef, typ: &TypeDef) -> Vec; + fn generate_reducer_file(&self, module: &ModuleDef, reducer: &ReducerDef) -> OutputFile; + fn generate_globals_file(&self, module: &ModuleDef) -> OutputFile; } diff --git a/crates/codegen/src/rust.rs b/crates/codegen/src/rust.rs index 853f924d3fb..3fae8de736d 100644 --- a/crates/codegen/src/rust.rs +++ b/crates/codegen/src/rust.rs @@ -2,6 +2,7 @@ use super::code_indenter::{CodeIndenter, Indenter}; use super::util::{collect_case, iter_reducers, print_lines, type_ref_name}; use super::Lang; use crate::util::{iter_tables, iter_types, iter_unique_cols, print_auto_generated_file_comment}; +use crate::OutputFile; use convert_case::{Case, Casing}; use spacetimedb_lib::sats::layout::PrimitiveType; use spacetimedb_lib::sats::AlgebraicTypeRef; @@ -21,23 +22,7 @@ const INDENT: &str = " "; pub struct Rust; impl Lang for Rust { - fn table_filename( - &self, - _module: &spacetimedb_schema::def::ModuleDef, - table: &spacetimedb_schema::def::TableDef, - ) -> String { - table_module_name(&table.name) + ".rs" - } - - fn type_filename(&self, type_name: &ScopedTypeName) -> String { - type_module_name(type_name) + ".rs" - } - - fn reducer_filename(&self, reducer_name: &Identifier) -> String { - reducer_module_name(reducer_name) + ".rs" - } - - fn generate_type(&self, module: &ModuleDef, typ: &TypeDef) -> String { + fn generate_type_files(&self, module: &ModuleDef, typ: &TypeDef) -> Vec { let type_name = collect_case(Case::Pascal, typ.name.name_segments()); let mut output = CodeIndenter::new(String::new(), INDENT); @@ -78,9 +63,12 @@ impl __sdk::InModule for {type_name} {{ ", ); - output.into_inner() + vec![OutputFile { + filename: type_module_name(&typ.name) + ".rs", + code: output.into_inner(), + }] } - fn generate_table(&self, module: &ModuleDef, table: &TableDef) -> String { + fn generate_table_file(&self, module: &ModuleDef, table: &TableDef) -> OutputFile { let schema = TableSchema::from_module_def(module, table, (), 0.into()) .validated() .expect("Failed to generate table due to validation errors"); @@ -301,9 +289,12 @@ pub(super) fn parse_table_update( // TODO: expose non-unique indices. - output.into_inner() + OutputFile { + filename: table_module_name(&table.name) + ".rs", + code: output.into_inner(), + } } - fn generate_reducer(&self, module: &ModuleDef, reducer: &ReducerDef) -> String { + fn generate_reducer_file(&self, module: &ModuleDef, reducer: &ReducerDef) -> OutputFile { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; @@ -488,10 +479,13 @@ impl {set_reducer_flags_trait} for super::SetReducerFlags {{ " ); - output.into_inner() + OutputFile { + filename: reducer_module_name(&reducer.name) + ".rs", + code: output.into_inner(), + } } - fn generate_globals(&self, module: &ModuleDef) -> Vec<(String, String)> { + fn generate_globals_file(&self, module: &ModuleDef) -> OutputFile { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; @@ -534,7 +528,10 @@ impl {set_reducer_flags_trait} for super::SetReducerFlags {{ // This includes a method for initializing the tables in the client cache. print_impl_spacetime_module(module, out); - vec![("mod.rs".to_string(), (output.into_inner()))] + OutputFile { + filename: "mod.rs".to_string(), + code: output.into_inner(), + } } } diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index c7cfe258b9f..9e26a9f68c0 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -1,5 +1,5 @@ -use crate::indent_scope; use crate::util::{is_reducer_invokable, iter_reducers, iter_tables, iter_types, iter_unique_cols}; +use crate::{indent_scope, OutputFile}; use super::util::{collect_case, print_auto_generated_file_comment, type_ref_name}; @@ -13,7 +13,7 @@ use spacetimedb_lib::sats::AlgebraicTypeRef; use spacetimedb_schema::def::{ModuleDef, ReducerDef, ScopedTypeName, TableDef, TypeDef}; use spacetimedb_schema::identifier::Identifier; use spacetimedb_schema::schema::{Schema, TableSchema}; -use spacetimedb_schema::type_for_generate::{AlgebraicTypeDef, AlgebraicTypeUse}; +use spacetimedb_schema::type_for_generate::{AlgebraicTypeDef, AlgebraicTypeUse, ProductTypeDef}; use super::code_indenter::{CodeIndenter, Indenter}; use super::Lang; @@ -26,40 +26,73 @@ const INDENT: &str = " "; pub struct TypeScript; impl Lang for TypeScript { - fn table_filename( - &self, - _module: &spacetimedb_schema::def::ModuleDef, - table: &spacetimedb_schema::def::TableDef, - ) -> String { - table_module_name(&table.name) + ".ts" - } + fn generate_type_files(&self, module: &ModuleDef, typ: &TypeDef) -> Vec { + let type_name = collect_case(Case::Pascal, typ.name.name_segments()); - fn type_filename(&self, type_name: &ScopedTypeName) -> String { - type_module_name(type_name) + ".ts" - } + let define_type_for_product = |product: &ProductTypeDef| { + let mut output = CodeIndenter::new(String::new(), INDENT); + let out = &mut output; - fn reducer_filename(&self, reducer_name: &Identifier) -> String { - reducer_module_name(reducer_name) + ".ts" - } + print_file_header(out); + gen_and_print_imports(module, out, &product.elements, &[typ.ty]); + writeln!(out); + define_body_for_product(module, out, &type_name, &product.elements); + out.newline(); + OutputFile { + filename: type_module_name(&typ.name) + ".ts", + code: output.into_inner(), + } + }; - fn generate_type(&self, module: &ModuleDef, typ: &TypeDef) -> String { - // TODO(cloutiertyler): I do think TypeScript does support namespaces: - // https://www.typescriptlang.org/docs/handbook/namespaces.html - let type_name = collect_case(Case::Pascal, typ.name.name_segments()); + let define_variants_for_sum = |variants: &[(Identifier, AlgebraicTypeUse)]| { + let mut output = CodeIndenter::new(String::new(), INDENT); + let out = &mut output; - let mut output = CodeIndenter::new(String::new(), INDENT); - let out = &mut output; + print_file_header(out); + gen_and_print_imports(module, out, variants, &[typ.ty]); + // Import the current type in case of recursive sum types + writeln!(out, "import {} from './{}'", type_name, type_module_name(&typ.name)); + writeln!(out); + write_variant_types(module, out, variants); + out.newline(); + OutputFile { + filename: variants_module_name(&typ.name) + ".ts", + code: output.into_inner(), + } + }; - print_file_header(out); + let define_type_for_sum = |variants: &[(Identifier, AlgebraicTypeUse)]| { + let mut output = CodeIndenter::new(String::new(), INDENT); + let out = &mut output; + + print_file_header(out); + gen_and_print_imports(module, out, variants, &[typ.ty]); + writeln!( + out, + "import * as {}Variants from './{}'", + type_name, + variants_module_name(&typ.name) + ); + writeln!(out); + // For the purpose of bootstrapping AlgebraicType, if the name of the type + // is `AlgebraicType`, we need to use an alias. + define_body_for_sum(module, out, &type_name, variants); + out.newline(); + OutputFile { + filename: type_module_name(&typ.name) + ".ts", + code: output.into_inner(), + } + }; match &module.typespace_for_generate()[typ.ty] { AlgebraicTypeDef::Product(product) => { - gen_and_print_imports(module, out, &product.elements, &[typ.ty]); - define_namespace_and_object_type_for_product(module, out, &type_name, &product.elements); + vec![define_type_for_product(product)] } AlgebraicTypeDef::Sum(sum) => { - gen_and_print_imports(module, out, &sum.variants, &[typ.ty]); - define_namespace_and_types_for_sum(module, out, &type_name, &sum.variants); + vec![ + define_variants_for_sum(&sum.variants), + define_type_for_sum(&sum.variants), + ] } AlgebraicTypeDef::PlainEnum(plain_enum) => { let variants = plain_enum @@ -68,15 +101,12 @@ impl Lang for TypeScript { .cloned() .map(|var| (var, AlgebraicTypeUse::Unit)) .collect::>(); - define_namespace_and_types_for_sum(module, out, &type_name, &variants); + vec![define_variants_for_sum(&variants), define_type_for_sum(&variants)] } } - out.newline(); - - output.into_inner() } - fn generate_table(&self, module: &ModuleDef, table: &TableDef) -> String { + fn generate_table_file(&self, module: &ModuleDef, table: &TableDef) -> OutputFile { let schema = TableSchema::from_module_def(module, table, (), 0.into()) .validated() .expect("Failed to generate table due to validation errors"); @@ -132,9 +162,9 @@ export class {table_handle} {{ " ); out.indent(1); - writeln!(out, "tableCache: TableCache<{row_type}>;"); + writeln!(out, "tableCache: __TableCache<{row_type}>;"); writeln!(out); - writeln!(out, "constructor(tableCache: TableCache<{row_type}>) {{"); + writeln!(out, "constructor(tableCache: __TableCache<{row_type}>) {{"); out.with_indent(|out| writeln!(out, "this.tableCache = tableCache;")); writeln!(out, "}}"); writeln!(out); @@ -187,7 +217,7 @@ export class {table_handle} {{ out.with_indent(|out| { writeln!(out, "for (let row of this.tableCache.iter()) {{"); out.with_indent(|out| { - writeln!(out, "if (deepEqual(row.{unique_field_name}, col_val)) {{"); + writeln!(out, "if (__deepEqual(row.{unique_field_name}, col_val)) {{"); out.with_indent(|out| { writeln!(out, "return row;"); }); @@ -240,10 +270,13 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) out.dedent(1); writeln!(out, "}}"); - output.into_inner() + OutputFile { + filename: table_module_name(&table.name) + ".ts", + code: output.into_inner(), + } } - fn generate_reducer(&self, module: &ModuleDef, reducer: &ReducerDef) -> String { + fn generate_reducer_file(&self, module: &ModuleDef, reducer: &ReducerDef) -> OutputFile { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; @@ -261,12 +294,15 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) let args_type = reducer_args_type_name(&reducer.name); - define_namespace_and_object_type_for_product(module, out, &args_type, &reducer.params_for_generate.elements); + define_body_for_product(module, out, &args_type, &reducer.params_for_generate.elements); - output.into_inner() + OutputFile { + filename: reducer_module_name(&reducer.name) + ".ts", + code: output.into_inner(), + } } - fn generate_globals(&self, module: &ModuleDef) -> Vec<(String, String)> { + fn generate_globals_file(&self, module: &ModuleDef) -> OutputFile { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; @@ -332,7 +368,7 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) writeln!(out, "colName: \"{}\",", pk.col_name.to_string().to_case(Case::Camel)); writeln!( out, - "colType: ({row_type}.getTypeScriptAlgebraicType() as ProductType).value.elements[{}].algebraicType,", + "colType: ({row_type}.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[{}].algebraicType,", pk.col_pos.0 ); out.dedent(1); @@ -373,16 +409,16 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) // all we do is build a TypeScript object which we could have done inside the // SDK, but if in the future we wanted to create a class this would be // necessary because classes have methods, so we'll keep it. -eventContextConstructor: (imp: DbConnectionImpl, event: Event) => {{ +eventContextConstructor: (imp: __DbConnectionImpl, event: __Event) => {{ return {{ ...(imp as DbConnection), event }} }}, -dbViewConstructor: (imp: DbConnectionImpl) => {{ +dbViewConstructor: (imp: __DbConnectionImpl) => {{ return new RemoteTables(imp); }}, -reducersConstructor: (imp: DbConnectionImpl, setReducerFlags: SetReducerFlags) => {{ +reducersConstructor: (imp: __DbConnectionImpl, setReducerFlags: SetReducerFlags) => {{ return new RemoteReducers(imp, setReducerFlags); }}, setReducerFlagsConstructor: () => {{ @@ -420,25 +456,28 @@ setReducerFlagsConstructor: () => {{ writeln!( out, - "export type EventContext = EventContextInterface;" + "export type EventContext = __EventContextInterface;" ); writeln!( out, - "export type ReducerEventContext = ReducerEventContextInterface;" + "export type ReducerEventContext = __ReducerEventContextInterface;" ); writeln!( out, - "export type SubscriptionEventContext = SubscriptionEventContextInterface;" + "export type SubscriptionEventContext = __SubscriptionEventContextInterface;" ); writeln!( out, - "export type ErrorContext = ErrorContextInterface;" + "export type ErrorContext = __ErrorContextInterface;" ); - vec![("index.ts".to_string(), (output.into_inner()))] + OutputFile { + filename: "index.ts".to_string(), + code: output.into_inner(), + } } } @@ -447,7 +486,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { out.indent(1); writeln!( out, - "constructor(private connection: DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {{}}" + "constructor(private connection: __DbConnectionImpl, private setCallReducerFlags: __SetReducerFlags) {{}}" ); out.newline(); @@ -486,7 +525,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { writeln!(out, "{reducer_function_name}({arg_list}) {{"); out.with_indent(|out| { writeln!(out, "const __args = {{ {arg_name_list} }};"); - writeln!(out, "let __writer = new BinaryWriter(1024);"); + writeln!(out, "let __writer = new __BinaryWriter(1024);"); writeln!( out, "{reducer_variant}.getTypeScriptAlgebraicType().serialize(__writer, __args);" @@ -535,8 +574,8 @@ fn print_set_reducer_flags(module: &ModuleDef, out: &mut Indenter) { for reducer in iter_reducers(module).filter(|r| is_reducer_invokable(r)) { let reducer_function_name = reducer_function_name(reducer); - writeln!(out, "{reducer_function_name}Flags: CallReducerFlags = 'FullUpdate';"); - writeln!(out, "{reducer_function_name}(flags: CallReducerFlags) {{"); + writeln!(out, "{reducer_function_name}Flags: __CallReducerFlags = 'FullUpdate';"); + writeln!(out, "{reducer_function_name}(flags: __CallReducerFlags) {{"); out.with_indent(|out| { writeln!(out, "this.{reducer_function_name}Flags = flags;"); }); @@ -551,7 +590,7 @@ fn print_set_reducer_flags(module: &ModuleDef, out: &mut Indenter) { fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) { writeln!(out, "export class RemoteTables {{"); out.indent(1); - writeln!(out, "constructor(private connection: DbConnectionImpl) {{}}"); + writeln!(out, "constructor(private connection: __DbConnectionImpl) {{}}"); for table in iter_tables(module) { writeln!(out); @@ -578,24 +617,24 @@ fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) { fn print_subscription_builder(_module: &ModuleDef, out: &mut Indenter) { writeln!( out, - "export class SubscriptionBuilder extends SubscriptionBuilderImpl {{ }}" + "export class SubscriptionBuilder extends __SubscriptionBuilderImpl {{ }}" ); } fn print_db_connection(_module: &ModuleDef, out: &mut Indenter) { writeln!( out, - "export class DbConnection extends DbConnectionImpl {{" + "export class DbConnection extends __DbConnectionImpl {{" ); out.indent(1); writeln!( out, - "static builder = (): DbConnectionBuilder => {{" + "static builder = (): __DbConnectionBuilder => {{" ); out.indent(1); writeln!( out, - "return new DbConnectionBuilder(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection);" + "return new __DbConnectionBuilder(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection);" ); out.dedent(1); writeln!(out, "}}"); @@ -623,31 +662,29 @@ fn print_reducer_enum_defn(module: &ModuleDef, out: &mut Indenter) { } fn print_spacetimedb_imports(out: &mut Indenter) { + // All library imports are prefixed with `__` to avoid + // clashing with the names of user generated types. let mut types = [ - "AlgebraicType", - "ProductType", - "ProductTypeElement", - "SumType", - "SumTypeVariant", - "AlgebraicValue", - "Identity", - "ConnectionId", - "Timestamp", - "TimeDuration", - "DbConnectionBuilder", - "TableCache", - "BinaryWriter", - "type CallReducerFlags", - "type EventContextInterface", - "type ReducerEventContextInterface", - "type SubscriptionEventContextInterface", - "type ErrorContextInterface", - "SubscriptionBuilderImpl", - "BinaryReader", - "DbConnectionImpl", - "type DbContext", - "type Event", - "deepEqual", + "type AlgebraicType as __AlgebraicTypeType", + "AlgebraicType as __AlgebraicTypeValue", + "type AlgebraicTypeVariants as __AlgebraicTypeVariants", + "Identity as __Identity", + "ConnectionId as __ConnectionId", + "Timestamp as __Timestamp", + "TimeDuration as __TimeDuration", + "DbConnectionBuilder as __DbConnectionBuilder", + "TableCache as __TableCache", + "BinaryWriter as __BinaryWriter", + "type CallReducerFlags as __CallReducerFlags", + "type EventContextInterface as __EventContextInterface", + "type ReducerEventContextInterface as __ReducerEventContextInterface", + "type SubscriptionEventContextInterface as __SubscriptionEventContextInterface", + "type ErrorContextInterface as __ErrorContextInterface", + "SubscriptionBuilderImpl as __SubscriptionBuilderImpl", + "BinaryReader as __BinaryReader", + "DbConnectionImpl as __DbConnectionImpl", + "type Event as __Event", + "deepEqual as __deepEqual", ]; types.sort(); writeln!(out, "import {{"); @@ -683,18 +720,18 @@ fn write_get_algebraic_type_for_product( * This function is derived from the AlgebraicType used to generate this type. */" ); - writeln!(out, "export function getTypeScriptAlgebraicType(): AlgebraicType {{"); + writeln!(out, "getTypeScriptAlgebraicType(): __AlgebraicTypeType {{"); { out.indent(1); write!(out, "return "); - convert_product_type(module, out, elements, "__"); + convert_product_type(module, out, elements, ""); writeln!(out, ";"); out.dedent(1); } - writeln!(out, "}}"); + writeln!(out, "}},"); } -fn define_namespace_and_object_type_for_product( +fn define_body_for_product( module: &ModuleDef, out: &mut Indenter, name: &str, @@ -719,32 +756,29 @@ fn define_namespace_and_object_type_for_product( * A namespace for generated helper functions. */" ); - writeln!(out, "export namespace {name} {{"); + writeln!(out, "export const {name} = {{"); out.indent(1); write_get_algebraic_type_for_product(module, out, elements); writeln!(out); - writeln!( - out, - "export function serialize(writer: BinaryWriter, value: {name}): void {{" - ); + writeln!(out, "serialize(writer: __BinaryWriter, value: {name}): void {{"); out.indent(1); writeln!( out, - "AlgebraicType.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value);" + "__AlgebraicTypeValue.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value);" ); out.dedent(1); - writeln!(out, "}}"); + writeln!(out, "}},"); writeln!(out); - writeln!(out, "export function deserialize(reader: BinaryReader): {name} {{"); + writeln!(out, "deserialize(reader: __BinaryReader): {name} {{"); out.indent(1); writeln!( out, - "return AlgebraicType.deserializeValue(reader, {name}.getTypeScriptAlgebraicType());" + "return __AlgebraicTypeValue.deserializeValue(reader, {name}.getTypeScriptAlgebraicType());" ); out.dedent(1); - writeln!(out, "}}"); + writeln!(out, "}},"); writeln!(out); out.dedent(1); @@ -772,7 +806,7 @@ fn write_arglist_no_delimiters( }; write!(out, "{name}: ")?; - write_type(module, out, ty, Some("__"))?; + write_type(module, out, ty, Some(""))?; writeln!(out, ",")?; } @@ -811,7 +845,7 @@ fn write_sum_variant_type(module: &ModuleDef, out: &mut Indenter, ident: &Identi // but this is a departure from our previous convention and is not much different. if !matches!(ty, AlgebraicTypeUse::Unit) { write!(out, ", value: "); - write_type(module, out, ty, Some("__")).unwrap(); + write_type(module, out, ty, Some("")).unwrap(); } writeln!(out, " }};"); @@ -836,19 +870,16 @@ fn write_variant_constructors( if matches!(ty, AlgebraicTypeUse::Unit) { // If the variant has no members, we can export a simple object. // ``` - // export const Foo: { tag: "Foo" } = { tag: "Foo" }; + // Foo: { tag: "Foo" } = { tag: "Foo" } as const, // ``` - write!( - out, - "export const {ident}: {{ tag: \"{ident}\" }} = {{ tag: \"{ident}\" }};" - ); + write!(out, "{ident}: {{ tag: \"{ident}\" }} as const,"); writeln!(out); continue; } let variant_name = ident.deref().to_case(Case::Pascal); - write!(out, "export const {variant_name} = (value: "); - write_type(module, out, ty, Some("__")).unwrap(); - writeln!(out, "): {name} => ({{ tag: \"{variant_name}\", value }});"); + write!(out, "{variant_name}: (value: "); + write_type(module, out, ty, Some("")).unwrap(); + writeln!(out, "): {name} => ({{ tag: \"{variant_name}\", value }}),"); } } @@ -857,48 +888,42 @@ fn write_get_algebraic_type_for_sum( out: &mut Indenter, variants: &[(Identifier, AlgebraicTypeUse)], ) { - writeln!(out, "export function getTypeScriptAlgebraicType(): AlgebraicType {{"); + writeln!(out, "getTypeScriptAlgebraicType(): __AlgebraicTypeType {{"); { indent_scope!(out); write!(out, "return "); - convert_sum_type(module, &mut out, variants, "__"); + convert_sum_type(module, &mut out, variants, ""); writeln!(out, ";"); } - writeln!(out, "}}"); + writeln!(out, "}},"); } -fn define_namespace_and_types_for_sum( +fn define_body_for_sum( module: &ModuleDef, out: &mut Indenter, - mut name: &str, + name: &str, variants: &[(Identifier, AlgebraicTypeUse)], ) { - // For the purpose of bootstrapping AlgebraicType, if the name of the type - // is `AlgebraicType`, we need to use an alias. - if name == "AlgebraicType" { - name = "__AlgebraicType"; + writeln!(out, "// The tagged union or sum type for the algebraic type `{name}`."); + write!(out, "export type {name} = "); + + let names = variants + .iter() + .map(|(ident, _)| format!("{name}Variants.{}", ident.deref().to_case(Case::Pascal))) + .collect::>() + .join(" |\n "); + + if variants.is_empty() { + writeln!(out, "never;"); + } else { + writeln!(out, "{names};"); } - // Write all of the variant types. - writeln!( - out, - "// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant`" - ); - writeln!(out, "export namespace {name}Variants {{"); - out.indent(1); - write_variant_types(module, out, variants); - out.dedent(1); - writeln!(out, "}}"); - writeln!(out); + out.newline(); - writeln!(out, "// A namespace for generated variants and helper functions."); - writeln!(out, "export namespace {name} {{"); + // Write the runtime value with helper functions + writeln!(out, "// A value with helper functions to construct the type."); + writeln!(out, "export const {name} = {{"); out.indent(1); // Write all of the variant constructors. @@ -920,17 +945,17 @@ fn define_namespace_and_types_for_sum( writeln!( out, - "export function serialize(writer: BinaryWriter, value: {name}): void {{ - AlgebraicType.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value); -}}" + "serialize(writer: __BinaryWriter, value: {name}): void {{ + __AlgebraicTypeValue.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value); +}}," ); writeln!(out); writeln!( out, - "export function deserialize(reader: BinaryReader): {name} {{ - return AlgebraicType.deserializeValue(reader, {name}.getTypeScriptAlgebraicType()); -}}" + "deserialize(reader: __BinaryReader): {name} {{ + return __AlgebraicTypeValue.deserializeValue(reader, {name}.getTypeScriptAlgebraicType()); +}}," ); writeln!(out); @@ -939,30 +964,6 @@ fn define_namespace_and_types_for_sum( writeln!(out, "}}"); out.newline(); - writeln!(out, "// The tagged union or sum type for the algebraic type `{name}`."); - - // For the purpose of bootstrapping AlgebraicType, if the name of the type - // is `AlgebraicType`, we need to use an alias. - if name == "AlgebraicType" { - name = "__AlgebraicType"; - } - - write!(out, "export type {name} = "); - - let names = variants - .iter() - .map(|(ident, _)| format!("{name}Variants.{}", ident.deref().to_case(Case::Pascal))) - .collect::>() - .join(" |\n "); - - if variants.is_empty() { - writeln!(out, "never;"); - } else { - writeln!(out, "{names};"); - } - - out.newline(); - writeln!(out, "export default {name};"); } @@ -975,6 +976,10 @@ fn type_module_name(type_name: &ScopedTypeName) -> String { collect_case(Case::Snake, type_name.name_segments()) + "_type" } +fn variants_module_name(type_name: &ScopedTypeName) -> String { + collect_case(Case::Snake, type_name.name_segments()) + "_variants" +} + fn table_module_name(table_name: &Identifier) -> String { table_name.deref().to_case(Case::Snake) + "_table" } @@ -1037,13 +1042,13 @@ pub fn write_type( match ty { AlgebraicTypeUse::Unit => write!(out, "void")?, AlgebraicTypeUse::Never => write!(out, "never")?, - AlgebraicTypeUse::Identity => write!(out, "Identity")?, - AlgebraicTypeUse::ConnectionId => write!(out, "ConnectionId")?, - AlgebraicTypeUse::Timestamp => write!(out, "Timestamp")?, - AlgebraicTypeUse::TimeDuration => write!(out, "TimeDuration")?, + AlgebraicTypeUse::Identity => write!(out, "__Identity")?, + AlgebraicTypeUse::ConnectionId => write!(out, "__ConnectionId")?, + AlgebraicTypeUse::Timestamp => write!(out, "__Timestamp")?, + AlgebraicTypeUse::TimeDuration => write!(out, "__TimeDuration")?, AlgebraicTypeUse::ScheduleAt => write!( out, - "{{ tag: \"Interval\", value: TimeDuration }} | {{ tag: \"Time\", value: Timestamp }}" + "{{ tag: \"Interval\", value: __TimeDuration }} | {{ tag: \"Time\", value: __Timestamp }}" )?, AlgebraicTypeUse::Option(inner_ty) => { write_type(module, out, inner_ty, ref_prefix)?; @@ -1099,18 +1104,18 @@ fn convert_algebraic_type<'a>( ref_prefix: &'a str, ) { match ty { - AlgebraicTypeUse::ScheduleAt => write!(out, "AlgebraicType.createScheduleAtType()"), - AlgebraicTypeUse::Identity => write!(out, "AlgebraicType.createIdentityType()"), - AlgebraicTypeUse::ConnectionId => write!(out, "AlgebraicType.createConnectionIdType()"), - AlgebraicTypeUse::Timestamp => write!(out, "AlgebraicType.createTimestampType()"), - AlgebraicTypeUse::TimeDuration => write!(out, "AlgebraicType.createTimeDurationType()"), + AlgebraicTypeUse::ScheduleAt => write!(out, "__AlgebraicTypeValue.createScheduleAtType()"), + AlgebraicTypeUse::Identity => write!(out, "__AlgebraicTypeValue.createIdentityType()"), + AlgebraicTypeUse::ConnectionId => write!(out, "__AlgebraicTypeValue.createConnectionIdType()"), + AlgebraicTypeUse::Timestamp => write!(out, "__AlgebraicTypeValue.createTimestampType()"), + AlgebraicTypeUse::TimeDuration => write!(out, "__AlgebraicTypeValue.createTimeDurationType()"), AlgebraicTypeUse::Option(inner_ty) => { - write!(out, "AlgebraicType.createOptionType("); + write!(out, "__AlgebraicTypeValue.createOptionType("); convert_algebraic_type(module, out, inner_ty, ref_prefix); write!(out, ")"); } AlgebraicTypeUse::Array(ty) => { - write!(out, "AlgebraicType.Array("); + write!(out, "__AlgebraicTypeValue.Array("); convert_algebraic_type(module, out, ty, ref_prefix); write!(out, ")"); } @@ -1120,11 +1125,11 @@ fn convert_algebraic_type<'a>( type_ref_name(module, *r) ), AlgebraicTypeUse::Primitive(prim) => { - write!(out, "AlgebraicType.{prim:?}"); + write!(out, "__AlgebraicTypeValue.{prim:?}"); } - AlgebraicTypeUse::Unit => write!(out, "AlgebraicType.Product({{ elements: [] }})"), + AlgebraicTypeUse::Unit => write!(out, "__AlgebraicTypeValue.Product({{ elements: [] }})"), AlgebraicTypeUse::Never => unimplemented!(), - AlgebraicTypeUse::String => write!(out, "AlgebraicType.String"), + AlgebraicTypeUse::String => write!(out, "__AlgebraicTypeValue.String"), } } @@ -1134,7 +1139,7 @@ fn convert_sum_type<'a>( variants: &'a [(Identifier, AlgebraicTypeUse)], ref_prefix: &'a str, ) { - writeln!(out, "AlgebraicType.Sum({{"); + writeln!(out, "__AlgebraicTypeValue.Sum({{"); out.indent(1); writeln!(out, "variants: ["); out.indent(1); @@ -1155,7 +1160,7 @@ fn convert_product_type<'a>( elements: &'a [(Identifier, AlgebraicTypeUse)], ref_prefix: &'a str, ) { - writeln!(out, "AlgebraicType.Product({{"); + writeln!(out, "__AlgebraicTypeValue.Product({{"); out.indent(1); writeln!(out, "elements: ["); out.indent(1); @@ -1179,10 +1184,7 @@ fn print_imports(module: &ModuleDef, out: &mut Indenter, imports: Imports) { for typeref in imports { let module_name = type_ref_module_name(module, typeref); let type_name = type_ref_name(module, typeref); - writeln!( - out, - "import {{ {type_name} as __{type_name} }} from \"./{module_name}\";" - ); + writeln!(out, "import {{ {type_name} }} from \"./{module_name}\";"); } } diff --git a/crates/codegen/tests/codegen.rs b/crates/codegen/tests/codegen.rs index 27b08d0c6fd..9760d11cbb4 100644 --- a/crates/codegen/tests/codegen.rs +++ b/crates/codegen/tests/codegen.rs @@ -15,7 +15,10 @@ macro_rules! declare_tests { #[test] fn $name() { let module = compiled_module(); - let outfiles = HashMap::<_, _>::from_iter(generate(&module, &$lang)); + let outfiles = generate(&module, &$lang) + .into_iter() + .map(|f| (f.filename, f.content)) + .collect::>(); let mut settings = insta::Settings::clone_current(); settings.set_sort_maps(true); // Ignore the autogenerated comments with version info, since it changes with every diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58e1ce85607..c4a4aea1abe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,68 @@ importers: prettier: specifier: ^3.3.3 version: 3.6.2 + devDependencies: + '@eslint/js': + specifier: ^9.17.0 + version: 9.33.0 + '@typescript-eslint/eslint-plugin': + specifier: ^8.18.2 + version: 8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2) + '@typescript-eslint/parser': + specifier: ^8.18.2 + version: 8.40.0(eslint@9.33.0)(typescript@5.9.2) + eslint: + specifier: ^9.33.0 + version: 9.33.0 + globals: + specifier: ^15.14.0 + version: 15.15.0 + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@24.3.0)(typescript@5.9.2) + typescript: + specifier: ^5.9.2 + version: 5.9.2 + typescript-eslint: + specifier: ^8.18.2 + version: 8.40.0(eslint@9.33.0)(typescript@5.9.2) + vite: + specifier: ^7.1.3 + version: 7.1.3(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4) + + docs: + dependencies: + github-slugger: + specifier: ^2.0.0 + version: 2.0.0 + devDependencies: + '@types/node': + specifier: ^22.10.2 + version: 22.17.2 + prettier: + specifier: ^3.3.3 + version: 3.6.2 + remark-parse: + specifier: ^11.0.0 + version: 11.0.0 + remark-stringify: + specifier: ^11.0.0 + version: 11.0.0 + tsx: + specifier: ^4.19.2 + version: 4.20.4 + typescript: + specifier: ^5.6.3 + version: 5.6.3 + unified: + specifier: ^11.0.5 + version: 11.0.5 + unist-util-visit: + specifier: ^5.0.0 + version: 5.0.0 sdks/typescript: devDependencies: @@ -3308,6 +3370,23 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/eslint-plugin@8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2)': + dependencies: + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.40.0(eslint@9.33.0)(typescript@5.9.2) + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/type-utils': 8.40.0(eslint@9.33.0)(typescript@5.9.2) + '@typescript-eslint/utils': 8.40.0(eslint@9.33.0)(typescript@5.9.2) + '@typescript-eslint/visitor-keys': 8.40.0 + eslint: 9.33.0 + graphemer: 1.4.0 + ignore: 7.0.5 + natural-compare: 1.4.0 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.6.3)': dependencies: '@typescript-eslint/scope-manager': 8.40.0 @@ -3320,6 +3399,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.9.2)': + dependencies: + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) + '@typescript-eslint/visitor-keys': 8.40.0 + debug: 4.4.1 + eslint: 9.33.0 + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/project-service@8.40.0(typescript@5.6.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.6.3) @@ -3329,6 +3420,15 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/project-service@8.40.0(typescript@5.9.2)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.9.2) + '@typescript-eslint/types': 8.40.0 + debug: 4.4.1 + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/scope-manager@8.40.0': dependencies: '@typescript-eslint/types': 8.40.0 @@ -3338,6 +3438,10 @@ snapshots: dependencies: typescript: 5.6.3 + '@typescript-eslint/tsconfig-utils@8.40.0(typescript@5.9.2)': + dependencies: + typescript: 5.9.2 + '@typescript-eslint/type-utils@8.40.0(eslint@9.33.0)(typescript@5.6.3)': dependencies: '@typescript-eslint/types': 8.40.0 @@ -3350,6 +3454,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/type-utils@8.40.0(eslint@9.33.0)(typescript@5.9.2)': + dependencies: + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.40.0(eslint@9.33.0)(typescript@5.9.2) + debug: 4.4.1 + eslint: 9.33.0 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/types@8.40.0': {} '@typescript-eslint/typescript-estree@8.40.0(typescript@5.6.3)': @@ -3368,6 +3484,22 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/typescript-estree@8.40.0(typescript@5.9.2)': + dependencies: + '@typescript-eslint/project-service': 8.40.0(typescript@5.9.2) + '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.9.2) + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/visitor-keys': 8.40.0 + debug: 4.4.1 + fast-glob: 3.3.3 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.7.2 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.6.3)': dependencies: '@eslint-community/eslint-utils': 4.7.0(eslint@9.33.0) @@ -3379,6 +3511,17 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2)': + dependencies: + '@eslint-community/eslint-utils': 4.7.0(eslint@9.33.0) + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) + eslint: 9.33.0 + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/visitor-keys@8.40.0': dependencies: '@typescript-eslint/types': 8.40.0 @@ -4584,6 +4727,10 @@ snapshots: dependencies: typescript: 5.6.3 + ts-api-utils@2.1.0(typescript@5.9.2): + dependencies: + typescript: 5.9.2 + ts-interface-checker@0.1.13: {} tsup@8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.6.3): @@ -4636,6 +4783,17 @@ snapshots: transitivePeerDependencies: - supports-color + typescript-eslint@8.40.0(eslint@9.33.0)(typescript@5.9.2): + dependencies: + '@typescript-eslint/eslint-plugin': 8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.9.2))(eslint@9.33.0)(typescript@5.9.2) + '@typescript-eslint/parser': 8.40.0(eslint@9.33.0)(typescript@5.9.2) + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.40.0(eslint@9.33.0)(typescript@5.9.2) + eslint: 9.33.0 + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + typescript@5.6.3: {} ufo@1.6.1: {} From 89fc09e6692697a92cf41d025e5d8fed7921cfeb Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 10:44:57 -0400 Subject: [PATCH 24/37] Updated versions in typescript files --- crates/bindings-typescript/src/autogen/algebraic_type_type.ts | 2 +- .../bindings-typescript/src/autogen/algebraic_type_variants.ts | 2 +- crates/bindings-typescript/src/autogen/index_type_type.ts | 2 +- crates/bindings-typescript/src/autogen/index_type_variants.ts | 2 +- crates/bindings-typescript/src/autogen/lifecycle_type.ts | 2 +- crates/bindings-typescript/src/autogen/lifecycle_variants.ts | 2 +- .../bindings-typescript/src/autogen/misc_module_export_type.ts | 2 +- .../src/autogen/misc_module_export_variants.ts | 2 +- .../src/autogen/product_type_element_type.ts | 2 +- crates/bindings-typescript/src/autogen/product_type_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_column_def_v_8_type.ts | 2 +- .../src/autogen/raw_column_default_value_v_9_type.ts | 2 +- .../src/autogen/raw_constraint_data_v_9_type.ts | 2 +- .../src/autogen/raw_constraint_data_v_9_variants.ts | 2 +- .../src/autogen/raw_constraint_def_v_8_type.ts | 2 +- .../src/autogen/raw_constraint_def_v_9_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_index_algorithm_type.ts | 2 +- .../src/autogen/raw_index_algorithm_variants.ts | 2 +- .../bindings-typescript/src/autogen/raw_index_def_v_8_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_index_def_v_9_type.ts | 2 +- .../src/autogen/raw_misc_module_export_v_9_type.ts | 2 +- .../src/autogen/raw_misc_module_export_v_9_variants.ts | 2 +- crates/bindings-typescript/src/autogen/raw_module_def_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_module_def_v_8_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_module_def_v_9_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_module_def_variants.ts | 2 +- .../bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts | 2 +- .../src/autogen/raw_row_level_security_def_v_9_type.ts | 2 +- .../src/autogen/raw_schedule_def_v_9_type.ts | 2 +- .../src/autogen/raw_scoped_type_name_v_9_type.ts | 2 +- .../src/autogen/raw_sequence_def_v_8_type.ts | 2 +- .../src/autogen/raw_sequence_def_v_9_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_table_def_v_8_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_table_def_v_9_type.ts | 2 +- crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts | 2 +- .../src/autogen/raw_unique_constraint_data_v_9_type.ts | 2 +- crates/bindings-typescript/src/autogen/reducer_def_type.ts | 2 +- crates/bindings-typescript/src/autogen/sum_type_type.ts | 2 +- crates/bindings-typescript/src/autogen/sum_type_variant_type.ts | 2 +- crates/bindings-typescript/src/autogen/table_access_type.ts | 2 +- crates/bindings-typescript/src/autogen/table_access_variants.ts | 2 +- crates/bindings-typescript/src/autogen/table_desc_type.ts | 2 +- crates/bindings-typescript/src/autogen/table_type_type.ts | 2 +- crates/bindings-typescript/src/autogen/table_type_variants.ts | 2 +- crates/bindings-typescript/src/autogen/type_alias_type.ts | 2 +- crates/bindings-typescript/src/autogen/typespace_type.ts | 2 +- 46 files changed, 46 insertions(+), 46 deletions(-) diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts index fede8241aed..b633e704273 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts index a22a15f5845..e129b3409c1 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/index_type_type.ts b/crates/bindings-typescript/src/autogen/index_type_type.ts index a8c3e848ee6..3d0851e7791 100644 --- a/crates/bindings-typescript/src/autogen/index_type_type.ts +++ b/crates/bindings-typescript/src/autogen/index_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/index_type_variants.ts b/crates/bindings-typescript/src/autogen/index_type_variants.ts index 50cb3ddaab9..6c162812730 100644 --- a/crates/bindings-typescript/src/autogen/index_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/index_type_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/lifecycle_type.ts b/crates/bindings-typescript/src/autogen/lifecycle_type.ts index c925f8adba0..bdc05ff8f2e 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_type.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts index 8dcb4fdffd8..6c187d3e450 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts index b359afc8d41..576af678c8d 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts index 967516820b9..ceb96dc63cf 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/product_type_element_type.ts b/crates/bindings-typescript/src/autogen/product_type_element_type.ts index cf95feb5d2b..07113f3e1b7 100644 --- a/crates/bindings-typescript/src/autogen/product_type_element_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/product_type_type.ts b/crates/bindings-typescript/src/autogen/product_type_type.ts index 2b6f0b6b58d..827955c4cc0 100644 --- a/crates/bindings-typescript/src/autogen/product_type_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts index d717b3a6f38..e8c2bbb0eda 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts index ca437286aaf..0ce003a50e8 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts index 15d82135b9b..5df61a528f0 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts index 9e68b5fe568..8b28829f014 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts index aa76eec47dd..e8aa86241a6 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts index 8fce62ec079..604a8db4d11 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts index 17a53ff5f33..637cdbb721e 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts index 2e37e194bcf..395e2c0001e 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts index 203609cabd8..c0c39fac162 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts index 462f7c32095..2a95be2bc2b 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts index 69eaaadf2b6..69910ce7e09 100644 --- a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts index d5a198ee1b3..0bdfe0759cb 100644 --- a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts index 97a30bdf27f..9615fe95338 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts index 01a099260b0..cda10456fa9 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts index f6603c11c0a..00336500965 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts index f87ac4bf23c..fc33e088aaf 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts index 278e0ab0c54..aa0d1b3364a 100644 --- a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts index b88cbb362d2..fc1d6dc6e58 100644 --- a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts index 8540b0c604b..2bc266f0cf6 100644 --- a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts index d4f126d426a..1f0acce4cff 100644 --- a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts index 64ec8ebcb24..deaa4ec0f0b 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts index baaa581b48a..d5ca6ba41d8 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts index df323c87ec4..abbe4d8174f 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts index eac754cef77..6c6b51691f4 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts index 8002ebd10bb..c7be9476ba3 100644 --- a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts index 2510c540dc0..15d463a4855 100644 --- a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/reducer_def_type.ts b/crates/bindings-typescript/src/autogen/reducer_def_type.ts index 23a24da5883..416194f456a 100644 --- a/crates/bindings-typescript/src/autogen/reducer_def_type.ts +++ b/crates/bindings-typescript/src/autogen/reducer_def_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/sum_type_type.ts b/crates/bindings-typescript/src/autogen/sum_type_type.ts index e8293bfd636..663efb1c95c 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts index e153d28cddf..22b8410359a 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_access_type.ts b/crates/bindings-typescript/src/autogen/table_access_type.ts index bf9c23bca6d..556adf9496e 100644 --- a/crates/bindings-typescript/src/autogen/table_access_type.ts +++ b/crates/bindings-typescript/src/autogen/table_access_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_access_variants.ts b/crates/bindings-typescript/src/autogen/table_access_variants.ts index 197e5201204..20812c7b86a 100644 --- a/crates/bindings-typescript/src/autogen/table_access_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_access_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_desc_type.ts b/crates/bindings-typescript/src/autogen/table_desc_type.ts index 43687c2ac0b..7b528a2325d 100644 --- a/crates/bindings-typescript/src/autogen/table_desc_type.ts +++ b/crates/bindings-typescript/src/autogen/table_desc_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_type_type.ts b/crates/bindings-typescript/src/autogen/table_type_type.ts index 1d61702aad6..0bcbec9585b 100644 --- a/crates/bindings-typescript/src/autogen/table_type_type.ts +++ b/crates/bindings-typescript/src/autogen/table_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_type_variants.ts b/crates/bindings-typescript/src/autogen/table_type_variants.ts index 2ed28bbc33c..35dc5ff36f7 100644 --- a/crates/bindings-typescript/src/autogen/table_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_type_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/type_alias_type.ts b/crates/bindings-typescript/src/autogen/type_alias_type.ts index 439ca7e6cb7..faf70f250e3 100644 --- a/crates/bindings-typescript/src/autogen/type_alias_type.ts +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts index ebd3cc508b6..f15ca74bf2a 100644 --- a/crates/bindings-typescript/src/autogen/typespace_type.ts +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit c62e7f66950e1c18265ffa65a9a96e156b23098b). +// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). /* eslint-disable */ /* tslint:disable */ From 85774a05bb2d3a07b748a605dd17353bb9c4e3a1 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 11:57:54 -0400 Subject: [PATCH 25/37] Fixed clippy --- crates/codegen/tests/codegen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/codegen/tests/codegen.rs b/crates/codegen/tests/codegen.rs index 9760d11cbb4..f9912ca44cc 100644 --- a/crates/codegen/tests/codegen.rs +++ b/crates/codegen/tests/codegen.rs @@ -17,7 +17,7 @@ macro_rules! declare_tests { let module = compiled_module(); let outfiles = generate(&module, &$lang) .into_iter() - .map(|f| (f.filename, f.content)) + .map(|f| (f.filename, f.code)) .collect::>(); let mut settings = insta::Settings::clone_current(); settings.set_sort_maps(true); From 8e735a43934557d5c855fa64c2e34645634cb04d Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 14:59:47 -0400 Subject: [PATCH 26/37] Updated the snap files --- .../codegen__codegen_typescript.snap | 3024 ++++++++--------- 1 file changed, 1474 insertions(+), 1550 deletions(-) diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index 5aeb034359f..1459b4dac08 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -12,30 +12,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type AddPlayer = { @@ -46,26 +42,26 @@ export default AddPlayer; /** * A namespace for generated helper functions. */ -export namespace AddPlayer { +export const AddPlayer = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: AddPlayer): void { - AlgebraicType.serializeValue(writer, AddPlayer.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: AddPlayer): void { + __AlgebraicTypeValue.serializeValue(writer, AddPlayer.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): AddPlayer { - return AlgebraicType.deserializeValue(reader, AddPlayer.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): AddPlayer { + return __AlgebraicTypeValue.deserializeValue(reader, AddPlayer.getTypeScriptAlgebraicType()); + }, } @@ -80,30 +76,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type AddPrivate = { @@ -114,26 +106,26 @@ export default AddPrivate; /** * A namespace for generated helper functions. */ -export namespace AddPrivate { +export const AddPrivate = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: AddPrivate): void { - AlgebraicType.serializeValue(writer, AddPrivate.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: AddPrivate): void { + __AlgebraicTypeValue.serializeValue(writer, AddPrivate.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): AddPrivate { - return AlgebraicType.deserializeValue(reader, AddPrivate.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): AddPrivate { + return __AlgebraicTypeValue.deserializeValue(reader, AddPrivate.getTypeScriptAlgebraicType()); + }, } @@ -148,30 +140,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type Add = { @@ -183,27 +171,27 @@ export default Add; /** * A namespace for generated helper functions. */ -export namespace Add { +export const Add = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, - { name: "age", algebraicType: AlgebraicType.U8}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + { name: "age", algebraicType: __AlgebraicTypeValue.U8}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: Add): void { - AlgebraicType.serializeValue(writer, Add.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: Add): void { + __AlgebraicTypeValue.serializeValue(writer, Add.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Add { - return AlgebraicType.deserializeValue(reader, Add.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): Add { + return __AlgebraicTypeValue.deserializeValue(reader, Add.getTypeScriptAlgebraicType()); + }, } @@ -218,30 +206,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type AssertCallerIdentityIsModuleIdentity = {}; @@ -250,25 +234,25 @@ export default AssertCallerIdentityIsModuleIdentity; /** * A namespace for generated helper functions. */ -export namespace AssertCallerIdentityIsModuleIdentity { +export const AssertCallerIdentityIsModuleIdentity = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ ] }); - } + }, - export function serialize(writer: BinaryWriter, value: AssertCallerIdentityIsModuleIdentity): void { - AlgebraicType.serializeValue(writer, AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: AssertCallerIdentityIsModuleIdentity): void { + __AlgebraicTypeValue.serializeValue(writer, AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): AssertCallerIdentityIsModuleIdentity { - return AlgebraicType.deserializeValue(reader, AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): AssertCallerIdentityIsModuleIdentity { + return __AlgebraicTypeValue.deserializeValue(reader, AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType()); + }, } @@ -283,31 +267,28 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type Baz = { field: string, }; @@ -316,26 +297,26 @@ export default Baz; /** * A namespace for generated helper functions. */ -export namespace Baz { +export const Baz = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "field", algebraicType: AlgebraicType.String}, + { name: "field", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: Baz): void { - AlgebraicType.serializeValue(writer, Baz.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: Baz): void { + __AlgebraicTypeValue.serializeValue(writer, Baz.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Baz { - return AlgebraicType.deserializeValue(reader, Baz.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): Baz { + return __AlgebraicTypeValue.deserializeValue(reader, Baz.getTypeScriptAlgebraicType()); + }, } @@ -351,30 +332,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type ClientConnected = {}; @@ -383,25 +360,25 @@ export default ClientConnected; /** * A namespace for generated helper functions. */ -export namespace ClientConnected { +export const ClientConnected = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ ] }); - } + }, - export function serialize(writer: BinaryWriter, value: ClientConnected): void { - AlgebraicType.serializeValue(writer, ClientConnected.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: ClientConnected): void { + __AlgebraicTypeValue.serializeValue(writer, ClientConnected.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): ClientConnected { - return AlgebraicType.deserializeValue(reader, ClientConnected.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): ClientConnected { + return __AlgebraicTypeValue.deserializeValue(reader, ClientConnected.getTypeScriptAlgebraicType()); + }, } @@ -416,30 +393,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type DeletePlayer = { @@ -450,26 +423,26 @@ export default DeletePlayer; /** * A namespace for generated helper functions. */ -export namespace DeletePlayer { +export const DeletePlayer = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "id", algebraicType: AlgebraicType.U64}, + { name: "id", algebraicType: __AlgebraicTypeValue.U64}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: DeletePlayer): void { - AlgebraicType.serializeValue(writer, DeletePlayer.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: DeletePlayer): void { + __AlgebraicTypeValue.serializeValue(writer, DeletePlayer.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): DeletePlayer { - return AlgebraicType.deserializeValue(reader, DeletePlayer.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): DeletePlayer { + return __AlgebraicTypeValue.deserializeValue(reader, DeletePlayer.getTypeScriptAlgebraicType()); + }, } @@ -484,30 +457,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type DeletePlayersByName = { @@ -518,26 +487,26 @@ export default DeletePlayersByName; /** * A namespace for generated helper functions. */ -export namespace DeletePlayersByName { +export const DeletePlayersByName = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: DeletePlayersByName): void { - AlgebraicType.serializeValue(writer, DeletePlayersByName.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: DeletePlayersByName): void { + __AlgebraicTypeValue.serializeValue(writer, DeletePlayersByName.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): DeletePlayersByName { - return AlgebraicType.deserializeValue(reader, DeletePlayersByName.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): DeletePlayersByName { + return __AlgebraicTypeValue.deserializeValue(reader, DeletePlayersByName.getTypeScriptAlgebraicType()); + }, } @@ -552,85 +521,110 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -import { Baz as __Baz } from "./baz_type"; - -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace FoobarVariants { - export type Baz = { tag: "Baz", value: __Baz }; - export type Bar = { tag: "Bar" }; - export type Har = { tag: "Har", value: number }; -} +import { Baz } from "./baz_type"; + +import * as FoobarVariants from './foobar_variants' -// A namespace for generated variants and helper functions. -export namespace Foobar { +// The tagged union or sum type for the algebraic type `Foobar`. +export type Foobar = FoobarVariants.Baz | + FoobarVariants.Bar | + FoobarVariants.Har; + +// A value with helper functions to construct the type. +export const Foobar = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Baz = (value: __Baz): Foobar => ({ tag: "Baz", value }); - export const Bar: { tag: "Bar" } = { tag: "Bar" }; - export const Har = (value: number): Foobar => ({ tag: "Har", value }); + Baz: (value: Baz): Foobar => ({ tag: "Baz", value }), + Bar: { tag: "Bar" } as const, + Har: (value: number): Foobar => ({ tag: "Har", value }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ - { name: "Baz", algebraicType: __Baz.getTypeScriptAlgebraicType() }, - { name: "Bar", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "Har", algebraicType: AlgebraicType.U32 }, + { name: "Baz", algebraicType: Baz.getTypeScriptAlgebraicType() }, + { name: "Bar", algebraicType: __AlgebraicTypeValue.Product({ elements: [] }) }, + { name: "Har", algebraicType: __AlgebraicTypeValue.U32 }, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: Foobar): void { - AlgebraicType.serializeValue(writer, Foobar.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: Foobar): void { + __AlgebraicTypeValue.serializeValue(writer, Foobar.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Foobar { - return AlgebraicType.deserializeValue(reader, Foobar.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): Foobar { + return __AlgebraicTypeValue.deserializeValue(reader, Foobar.getTypeScriptAlgebraicType()); + }, } -// The tagged union or sum type for the algebraic type `Foobar`. -export type Foobar = FoobarVariants.Baz | - FoobarVariants.Bar | - FoobarVariants.Har; - export default Foobar; +''' +"foobar_variants.ts" = ''' +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +VERSION_COMMENT + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from "@clockworklabs/spacetimedb-sdk"; +import { Baz } from "./baz_type"; + +import Foobar from './foobar_type' + +export type Baz = { tag: "Baz", value: Baz }; +export type Bar = { tag: "Bar" }; +export type Har = { tag: "Har", value: number }; + ''' "has_special_stuff_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -642,30 +636,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { HasSpecialStuff } from "./has_special_stuff_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -681,9 +671,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.hasSpecialStuff.on_insert(...)`. */ export class HasSpecialStuffTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -722,61 +712,58 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type HasSpecialStuff = { - identity: Identity, - connectionId: ConnectionId, + identity: __Identity, + connectionId: __ConnectionId, }; export default HasSpecialStuff; /** * A namespace for generated helper functions. */ -export namespace HasSpecialStuff { +export const HasSpecialStuff = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "identity", algebraicType: AlgebraicType.createIdentityType()}, - { name: "connectionId", algebraicType: AlgebraicType.createConnectionIdType()}, + { name: "identity", algebraicType: __AlgebraicTypeValue.createIdentityType()}, + { name: "connectionId", algebraicType: __AlgebraicTypeValue.createConnectionIdType()}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: HasSpecialStuff): void { - AlgebraicType.serializeValue(writer, HasSpecialStuff.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: HasSpecialStuff): void { + __AlgebraicTypeValue.serializeValue(writer, HasSpecialStuff.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): HasSpecialStuff { - return AlgebraicType.deserializeValue(reader, HasSpecialStuff.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): HasSpecialStuff { + return __AlgebraicTypeValue.deserializeValue(reader, HasSpecialStuff.getTypeScriptAlgebraicType()); + }, } @@ -792,30 +779,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; // Import and reexport all reducer arg types @@ -920,7 +903,7 @@ const REMOTE_MODULE = { primaryKey: "identity", primaryKeyInfo: { colName: "identity", - colType: (Player.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, + colType: (Player.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, person: { @@ -929,7 +912,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: (Person.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, + colType: (Person.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, pk_multi_identity: { @@ -938,7 +921,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: (PkMultiIdentity.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, + colType: (PkMultiIdentity.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, player: { @@ -947,7 +930,7 @@ const REMOTE_MODULE = { primaryKey: "identity", primaryKeyInfo: { colName: "identity", - colType: (Player.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, + colType: (Player.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, points: { @@ -964,7 +947,7 @@ const REMOTE_MODULE = { primaryKey: "scheduledId", primaryKeyInfo: { colName: "scheduledId", - colType: (RepeatingTestArg.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, + colType: (RepeatingTestArg.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, test_a: { @@ -981,7 +964,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: (TestE.getTypeScriptAlgebraicType() as ProductType).value.elements[0].algebraicType, + colType: (TestE.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, test_f: { @@ -1057,16 +1040,16 @@ const REMOTE_MODULE = { // all we do is build a TypeScript object which we could have done inside the // SDK, but if in the future we wanted to create a class this would be // necessary because classes have methods, so we'll keep it. - eventContextConstructor: (imp: DbConnectionImpl, event: Event) => { + eventContextConstructor: (imp: __DbConnectionImpl, event: __Event) => { return { ...(imp as DbConnection), event } }, - dbViewConstructor: (imp: DbConnectionImpl) => { + dbViewConstructor: (imp: __DbConnectionImpl) => { return new RemoteTables(imp); }, - reducersConstructor: (imp: DbConnectionImpl, setReducerFlags: SetReducerFlags) => { + reducersConstructor: (imp: __DbConnectionImpl, setReducerFlags: SetReducerFlags) => { return new RemoteReducers(imp, setReducerFlags); }, setReducerFlagsConstructor: () => { @@ -1093,11 +1076,11 @@ export type Reducer = never ; export class RemoteReducers { - constructor(private connection: DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} + constructor(private connection: __DbConnectionImpl, private setCallReducerFlags: __SetReducerFlags) {} add(name: string, age: number) { const __args = { name, age }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); Add.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("add", __argsBuffer, this.setCallReducerFlags.addFlags); @@ -1113,7 +1096,7 @@ export class RemoteReducers { addPlayer(name: string) { const __args = { name }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); AddPlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("add_player", __argsBuffer, this.setCallReducerFlags.addPlayerFlags); @@ -1129,7 +1112,7 @@ export class RemoteReducers { addPrivate(name: string) { const __args = { name }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); AddPrivate.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("add_private", __argsBuffer, this.setCallReducerFlags.addPrivateFlags); @@ -1165,7 +1148,7 @@ export class RemoteReducers { deletePlayer(id: bigint) { const __args = { id }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); DeletePlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("delete_player", __argsBuffer, this.setCallReducerFlags.deletePlayerFlags); @@ -1181,7 +1164,7 @@ export class RemoteReducers { deletePlayersByName(name: string) { const __args = { name }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); DeletePlayersByName.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("delete_players_by_name", __argsBuffer, this.setCallReducerFlags.deletePlayersByNameFlags); @@ -1197,7 +1180,7 @@ export class RemoteReducers { listOverAge(age: number) { const __args = { age }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); ListOverAge.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("list_over_age", __argsBuffer, this.setCallReducerFlags.listOverAgeFlags); @@ -1237,7 +1220,7 @@ export class RemoteReducers { repeatingTest(arg: RepeatingTestArg) { const __args = { arg }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); RepeatingTest.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("repeating_test", __argsBuffer, this.setCallReducerFlags.repeatingTestFlags); @@ -1265,7 +1248,7 @@ export class RemoteReducers { test(arg: TestA, arg2: TestB, arg3: NamespaceTestC, arg4: NamespaceTestF) { const __args = { arg, arg2, arg3, arg4 }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); Test.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("test", __argsBuffer, this.setCallReducerFlags.testFlags); @@ -1294,75 +1277,75 @@ export class RemoteReducers { } export class SetReducerFlags { - addFlags: CallReducerFlags = 'FullUpdate'; - add(flags: CallReducerFlags) { + addFlags: __CallReducerFlags = 'FullUpdate'; + add(flags: __CallReducerFlags) { this.addFlags = flags; } - addPlayerFlags: CallReducerFlags = 'FullUpdate'; - addPlayer(flags: CallReducerFlags) { + addPlayerFlags: __CallReducerFlags = 'FullUpdate'; + addPlayer(flags: __CallReducerFlags) { this.addPlayerFlags = flags; } - addPrivateFlags: CallReducerFlags = 'FullUpdate'; - addPrivate(flags: CallReducerFlags) { + addPrivateFlags: __CallReducerFlags = 'FullUpdate'; + addPrivate(flags: __CallReducerFlags) { this.addPrivateFlags = flags; } - assertCallerIdentityIsModuleIdentityFlags: CallReducerFlags = 'FullUpdate'; - assertCallerIdentityIsModuleIdentity(flags: CallReducerFlags) { + assertCallerIdentityIsModuleIdentityFlags: __CallReducerFlags = 'FullUpdate'; + assertCallerIdentityIsModuleIdentity(flags: __CallReducerFlags) { this.assertCallerIdentityIsModuleIdentityFlags = flags; } - deletePlayerFlags: CallReducerFlags = 'FullUpdate'; - deletePlayer(flags: CallReducerFlags) { + deletePlayerFlags: __CallReducerFlags = 'FullUpdate'; + deletePlayer(flags: __CallReducerFlags) { this.deletePlayerFlags = flags; } - deletePlayersByNameFlags: CallReducerFlags = 'FullUpdate'; - deletePlayersByName(flags: CallReducerFlags) { + deletePlayersByNameFlags: __CallReducerFlags = 'FullUpdate'; + deletePlayersByName(flags: __CallReducerFlags) { this.deletePlayersByNameFlags = flags; } - listOverAgeFlags: CallReducerFlags = 'FullUpdate'; - listOverAge(flags: CallReducerFlags) { + listOverAgeFlags: __CallReducerFlags = 'FullUpdate'; + listOverAge(flags: __CallReducerFlags) { this.listOverAgeFlags = flags; } - logModuleIdentityFlags: CallReducerFlags = 'FullUpdate'; - logModuleIdentity(flags: CallReducerFlags) { + logModuleIdentityFlags: __CallReducerFlags = 'FullUpdate'; + logModuleIdentity(flags: __CallReducerFlags) { this.logModuleIdentityFlags = flags; } - queryPrivateFlags: CallReducerFlags = 'FullUpdate'; - queryPrivate(flags: CallReducerFlags) { + queryPrivateFlags: __CallReducerFlags = 'FullUpdate'; + queryPrivate(flags: __CallReducerFlags) { this.queryPrivateFlags = flags; } - repeatingTestFlags: CallReducerFlags = 'FullUpdate'; - repeatingTest(flags: CallReducerFlags) { + repeatingTestFlags: __CallReducerFlags = 'FullUpdate'; + repeatingTest(flags: __CallReducerFlags) { this.repeatingTestFlags = flags; } - sayHelloFlags: CallReducerFlags = 'FullUpdate'; - sayHello(flags: CallReducerFlags) { + sayHelloFlags: __CallReducerFlags = 'FullUpdate'; + sayHello(flags: __CallReducerFlags) { this.sayHelloFlags = flags; } - testFlags: CallReducerFlags = 'FullUpdate'; - test(flags: CallReducerFlags) { + testFlags: __CallReducerFlags = 'FullUpdate'; + test(flags: __CallReducerFlags) { this.testFlags = flags; } - testBtreeIndexArgsFlags: CallReducerFlags = 'FullUpdate'; - testBtreeIndexArgs(flags: CallReducerFlags) { + testBtreeIndexArgsFlags: __CallReducerFlags = 'FullUpdate'; + testBtreeIndexArgs(flags: __CallReducerFlags) { this.testBtreeIndexArgsFlags = flags; } } export class RemoteTables { - constructor(private connection: DbConnectionImpl) {} + constructor(private connection: __DbConnectionImpl) {} get hasSpecialStuff(): HasSpecialStuffTableHandle { return new HasSpecialStuffTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.has_special_stuff)); @@ -1413,21 +1396,21 @@ export class RemoteTables { } } -export class SubscriptionBuilder extends SubscriptionBuilderImpl { } +export class SubscriptionBuilder extends __SubscriptionBuilderImpl { } -export class DbConnection extends DbConnectionImpl { - static builder = (): DbConnectionBuilder => { - return new DbConnectionBuilder(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); +export class DbConnection extends __DbConnectionImpl { + static builder = (): __DbConnectionBuilder => { + return new __DbConnectionBuilder(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); } subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); } } -export type EventContext = EventContextInterface; -export type ReducerEventContext = ReducerEventContextInterface; -export type SubscriptionEventContext = SubscriptionEventContextInterface; -export type ErrorContext = ErrorContextInterface; +export type EventContext = __EventContextInterface; +export type ReducerEventContext = __ReducerEventContextInterface; +export type SubscriptionEventContext = __SubscriptionEventContextInterface; +export type ErrorContext = __ErrorContextInterface; ''' "list_over_age_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1439,30 +1422,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type ListOverAge = { @@ -1473,26 +1452,26 @@ export default ListOverAge; /** * A namespace for generated helper functions. */ -export namespace ListOverAge { +export const ListOverAge = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "age", algebraicType: AlgebraicType.U8}, + { name: "age", algebraicType: __AlgebraicTypeValue.U8}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: ListOverAge): void { - AlgebraicType.serializeValue(writer, ListOverAge.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: ListOverAge): void { + __AlgebraicTypeValue.serializeValue(writer, ListOverAge.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): ListOverAge { - return AlgebraicType.deserializeValue(reader, ListOverAge.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): ListOverAge { + return __AlgebraicTypeValue.deserializeValue(reader, ListOverAge.getTypeScriptAlgebraicType()); + }, } @@ -1507,30 +1486,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type LogModuleIdentity = {}; @@ -1539,25 +1514,25 @@ export default LogModuleIdentity; /** * A namespace for generated helper functions. */ -export namespace LogModuleIdentity { +export const LogModuleIdentity = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ ] }); - } + }, - export function serialize(writer: BinaryWriter, value: LogModuleIdentity): void { - AlgebraicType.serializeValue(writer, LogModuleIdentity.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: LogModuleIdentity): void { + __AlgebraicTypeValue.serializeValue(writer, LogModuleIdentity.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): LogModuleIdentity { - return AlgebraicType.deserializeValue(reader, LogModuleIdentity.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): LogModuleIdentity { + return __AlgebraicTypeValue.deserializeValue(reader, LogModuleIdentity.getTypeScriptAlgebraicType()); + }, } @@ -1572,30 +1547,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { Player } from "./player_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -1611,9 +1582,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.loggedOutPlayer.on_insert(...)`. */ export class LoggedOutPlayerTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -1638,9 +1609,9 @@ export class LoggedOutPlayerTableHandle { identity = { // Find the subscribed row whose `identity` column value is equal to `col_val`, // if such a row is present in the client cache. - find: (col_val: Identity): Player | undefined => { + find: (col_val: __Identity): Player | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.identity, col_val)) { + if (__deepEqual(row.identity, col_val)) { return row; } } @@ -1662,7 +1633,7 @@ export class LoggedOutPlayerTableHandle { // if such a row is present in the client cache. find: (col_val: bigint): Player | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.playerId, col_val)) { + if (__deepEqual(row.playerId, col_val)) { return row; } } @@ -1684,7 +1655,7 @@ export class LoggedOutPlayerTableHandle { // if such a row is present in the client cache. find: (col_val: string): Player | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.name, col_val)) { + if (__deepEqual(row.name, col_val)) { return row; } } @@ -1726,79 +1697,102 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace NamespaceTestCVariants { - export type Foo = { tag: "Foo" }; - export type Bar = { tag: "Bar" }; -} +import * as NamespaceTestCVariants from './namespace_test_c_variants' -// A namespace for generated variants and helper functions. -export namespace NamespaceTestC { +// The tagged union or sum type for the algebraic type `NamespaceTestC`. +export type NamespaceTestC = NamespaceTestCVariants.Foo | + NamespaceTestCVariants.Bar; + +// A value with helper functions to construct the type. +export const NamespaceTestC = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Foo: { tag: "Foo" } = { tag: "Foo" }; - export const Bar: { tag: "Bar" } = { tag: "Bar" }; + Foo: { tag: "Foo" } as const, + Bar: { tag: "Bar" } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ - { name: "Foo", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "Bar", algebraicType: AlgebraicType.Product({ elements: [] }) }, + { name: "Foo", algebraicType: __AlgebraicTypeValue.Product({ elements: [] }) }, + { name: "Bar", algebraicType: __AlgebraicTypeValue.Product({ elements: [] }) }, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: NamespaceTestC): void { - AlgebraicType.serializeValue(writer, NamespaceTestC.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: NamespaceTestC): void { + __AlgebraicTypeValue.serializeValue(writer, NamespaceTestC.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): NamespaceTestC { - return AlgebraicType.deserializeValue(reader, NamespaceTestC.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): NamespaceTestC { + return __AlgebraicTypeValue.deserializeValue(reader, NamespaceTestC.getTypeScriptAlgebraicType()); + }, } -// The tagged union or sum type for the algebraic type `NamespaceTestC`. -export type NamespaceTestC = NamespaceTestCVariants.Foo | - NamespaceTestCVariants.Bar; - export default NamespaceTestC; +''' +"namespace_test_c_variants.ts" = ''' +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +VERSION_COMMENT + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from "@clockworklabs/spacetimedb-sdk"; +import NamespaceTestC from './namespace_test_c_type' + +export type Foo = { tag: "Foo" }; +export type Bar = { tag: "Bar" }; + ''' "namespace_test_f_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1810,83 +1804,106 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace NamespaceTestFVariants { - export type Foo = { tag: "Foo" }; - export type Bar = { tag: "Bar" }; - export type Baz = { tag: "Baz", value: string }; -} +import * as NamespaceTestFVariants from './namespace_test_f_variants' + +// The tagged union or sum type for the algebraic type `NamespaceTestF`. +export type NamespaceTestF = NamespaceTestFVariants.Foo | + NamespaceTestFVariants.Bar | + NamespaceTestFVariants.Baz; -// A namespace for generated variants and helper functions. -export namespace NamespaceTestF { +// A value with helper functions to construct the type. +export const NamespaceTestF = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Foo: { tag: "Foo" } = { tag: "Foo" }; - export const Bar: { tag: "Bar" } = { tag: "Bar" }; - export const Baz = (value: string): NamespaceTestF => ({ tag: "Baz", value }); + Foo: { tag: "Foo" } as const, + Bar: { tag: "Bar" } as const, + Baz: (value: string): NamespaceTestF => ({ tag: "Baz", value }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ - { name: "Foo", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "Bar", algebraicType: AlgebraicType.Product({ elements: [] }) }, - { name: "Baz", algebraicType: AlgebraicType.String }, + { name: "Foo", algebraicType: __AlgebraicTypeValue.Product({ elements: [] }) }, + { name: "Bar", algebraicType: __AlgebraicTypeValue.Product({ elements: [] }) }, + { name: "Baz", algebraicType: __AlgebraicTypeValue.String }, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: NamespaceTestF): void { - AlgebraicType.serializeValue(writer, NamespaceTestF.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: NamespaceTestF): void { + __AlgebraicTypeValue.serializeValue(writer, NamespaceTestF.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): NamespaceTestF { - return AlgebraicType.deserializeValue(reader, NamespaceTestF.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): NamespaceTestF { + return __AlgebraicTypeValue.deserializeValue(reader, NamespaceTestF.getTypeScriptAlgebraicType()); + }, } -// The tagged union or sum type for the algebraic type `NamespaceTestF`. -export type NamespaceTestF = NamespaceTestFVariants.Foo | - NamespaceTestFVariants.Bar | - NamespaceTestFVariants.Baz; - export default NamespaceTestF; +''' +"namespace_test_f_variants.ts" = ''' +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +VERSION_COMMENT + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from "@clockworklabs/spacetimedb-sdk"; +import NamespaceTestF from './namespace_test_f_type' + +export type Foo = { tag: "Foo" }; +export type Bar = { tag: "Bar" }; +export type Baz = { tag: "Baz", value: string }; + ''' "person_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1898,30 +1915,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { Person } from "./person_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -1937,9 +1950,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.person.on_insert(...)`. */ export class PersonTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -1966,7 +1979,7 @@ export class PersonTableHandle { // if such a row is present in the client cache. find: (col_val: number): Person | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.id, col_val)) { + if (__deepEqual(row.id, col_val)) { return row; } } @@ -2008,31 +2021,28 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type Person = { id: number, name: string, @@ -2043,28 +2053,28 @@ export default Person; /** * A namespace for generated helper functions. */ -export namespace Person { +export const Person = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "id", algebraicType: AlgebraicType.U32}, - { name: "name", algebraicType: AlgebraicType.String}, - { name: "age", algebraicType: AlgebraicType.U8}, + { name: "id", algebraicType: __AlgebraicTypeValue.U32}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + { name: "age", algebraicType: __AlgebraicTypeValue.U8}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: Person): void { - AlgebraicType.serializeValue(writer, Person.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: Person): void { + __AlgebraicTypeValue.serializeValue(writer, Person.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Person { - return AlgebraicType.deserializeValue(reader, Person.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): Person { + return __AlgebraicTypeValue.deserializeValue(reader, Person.getTypeScriptAlgebraicType()); + }, } @@ -2080,30 +2090,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { PkMultiIdentity } from "./pk_multi_identity_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -2119,9 +2125,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.pkMultiIdentity.on_insert(...)`. */ export class PkMultiIdentityTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -2148,7 +2154,7 @@ export class PkMultiIdentityTableHandle { // if such a row is present in the client cache. find: (col_val: number): PkMultiIdentity | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.id, col_val)) { + if (__deepEqual(row.id, col_val)) { return row; } } @@ -2170,7 +2176,7 @@ export class PkMultiIdentityTableHandle { // if such a row is present in the client cache. find: (col_val: number): PkMultiIdentity | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.other, col_val)) { + if (__deepEqual(row.other, col_val)) { return row; } } @@ -2212,31 +2218,28 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type PkMultiIdentity = { id: number, other: number, @@ -2246,27 +2249,27 @@ export default PkMultiIdentity; /** * A namespace for generated helper functions. */ -export namespace PkMultiIdentity { +export const PkMultiIdentity = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "id", algebraicType: AlgebraicType.U32}, - { name: "other", algebraicType: AlgebraicType.U32}, + { name: "id", algebraicType: __AlgebraicTypeValue.U32}, + { name: "other", algebraicType: __AlgebraicTypeValue.U32}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: PkMultiIdentity): void { - AlgebraicType.serializeValue(writer, PkMultiIdentity.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: PkMultiIdentity): void { + __AlgebraicTypeValue.serializeValue(writer, PkMultiIdentity.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): PkMultiIdentity { - return AlgebraicType.deserializeValue(reader, PkMultiIdentity.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): PkMultiIdentity { + return __AlgebraicTypeValue.deserializeValue(reader, PkMultiIdentity.getTypeScriptAlgebraicType()); + }, } @@ -2282,30 +2285,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { Player } from "./player_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -2321,9 +2320,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.player.on_insert(...)`. */ export class PlayerTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -2348,9 +2347,9 @@ export class PlayerTableHandle { identity = { // Find the subscribed row whose `identity` column value is equal to `col_val`, // if such a row is present in the client cache. - find: (col_val: Identity): Player | undefined => { + find: (col_val: __Identity): Player | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.identity, col_val)) { + if (__deepEqual(row.identity, col_val)) { return row; } } @@ -2372,7 +2371,7 @@ export class PlayerTableHandle { // if such a row is present in the client cache. find: (col_val: bigint): Player | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.playerId, col_val)) { + if (__deepEqual(row.playerId, col_val)) { return row; } } @@ -2394,7 +2393,7 @@ export class PlayerTableHandle { // if such a row is present in the client cache. find: (col_val: string): Player | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.name, col_val)) { + if (__deepEqual(row.name, col_val)) { return row; } } @@ -2436,33 +2435,30 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type Player = { - identity: Identity, + identity: __Identity, playerId: bigint, name: string, }; @@ -2471,28 +2467,28 @@ export default Player; /** * A namespace for generated helper functions. */ -export namespace Player { +export const Player = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "identity", algebraicType: AlgebraicType.createIdentityType()}, - { name: "playerId", algebraicType: AlgebraicType.U64}, - { name: "name", algebraicType: AlgebraicType.String}, + { name: "identity", algebraicType: __AlgebraicTypeValue.createIdentityType()}, + { name: "playerId", algebraicType: __AlgebraicTypeValue.U64}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: Player): void { - AlgebraicType.serializeValue(writer, Player.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: Player): void { + __AlgebraicTypeValue.serializeValue(writer, Player.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Player { - return AlgebraicType.deserializeValue(reader, Player.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): Player { + return __AlgebraicTypeValue.deserializeValue(reader, Player.getTypeScriptAlgebraicType()); + }, } @@ -2508,31 +2504,28 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type Point = { x: bigint, y: bigint, @@ -2542,27 +2535,27 @@ export default Point; /** * A namespace for generated helper functions. */ -export namespace Point { +export const Point = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "x", algebraicType: AlgebraicType.I64}, - { name: "y", algebraicType: AlgebraicType.I64}, + { name: "x", algebraicType: __AlgebraicTypeValue.I64}, + { name: "y", algebraicType: __AlgebraicTypeValue.I64}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: Point): void { - AlgebraicType.serializeValue(writer, Point.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: Point): void { + __AlgebraicTypeValue.serializeValue(writer, Point.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Point { - return AlgebraicType.deserializeValue(reader, Point.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): Point { + return __AlgebraicTypeValue.deserializeValue(reader, Point.getTypeScriptAlgebraicType()); + }, } @@ -2578,30 +2571,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { Point } from "./point_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -2617,9 +2606,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.points.on_insert(...)`. */ export class PointsTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -2658,30 +2647,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { PrivateTable } from "./private_table_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -2697,9 +2682,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.privateTable.on_insert(...)`. */ export class PrivateTableTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -2738,31 +2723,28 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type PrivateTable = { name: string, }; @@ -2771,26 +2753,26 @@ export default PrivateTable; /** * A namespace for generated helper functions. */ -export namespace PrivateTable { +export const PrivateTable = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "name", algebraicType: AlgebraicType.String}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: PrivateTable): void { - AlgebraicType.serializeValue(writer, PrivateTable.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: PrivateTable): void { + __AlgebraicTypeValue.serializeValue(writer, PrivateTable.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): PrivateTable { - return AlgebraicType.deserializeValue(reader, PrivateTable.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): PrivateTable { + return __AlgebraicTypeValue.deserializeValue(reader, PrivateTable.getTypeScriptAlgebraicType()); + }, } @@ -2806,30 +2788,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type QueryPrivate = {}; @@ -2838,25 +2816,25 @@ export default QueryPrivate; /** * A namespace for generated helper functions. */ -export namespace QueryPrivate { +export const QueryPrivate = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ ] }); - } + }, - export function serialize(writer: BinaryWriter, value: QueryPrivate): void { - AlgebraicType.serializeValue(writer, QueryPrivate.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: QueryPrivate): void { + __AlgebraicTypeValue.serializeValue(writer, QueryPrivate.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): QueryPrivate { - return AlgebraicType.deserializeValue(reader, QueryPrivate.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): QueryPrivate { + return __AlgebraicTypeValue.deserializeValue(reader, QueryPrivate.getTypeScriptAlgebraicType()); + }, } @@ -2871,30 +2849,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { RepeatingTestArg } from "./repeating_test_arg_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -2910,9 +2884,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.repeatingTestArg.on_insert(...)`. */ export class RepeatingTestArgTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -2939,7 +2913,7 @@ export class RepeatingTestArgTableHandle { // if such a row is present in the client cache. find: (col_val: bigint): RepeatingTestArg | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.scheduledId, col_val)) { + if (__deepEqual(row.scheduledId, col_val)) { return row; } } @@ -2981,63 +2955,60 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type RepeatingTestArg = { scheduledId: bigint, - scheduledAt: { tag: "Interval", value: TimeDuration } | { tag: "Time", value: Timestamp }, - prevTime: Timestamp, + scheduledAt: { tag: "Interval", value: __TimeDuration } | { tag: "Time", value: __Timestamp }, + prevTime: __Timestamp, }; export default RepeatingTestArg; /** * A namespace for generated helper functions. */ -export namespace RepeatingTestArg { +export const RepeatingTestArg = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "scheduledId", algebraicType: AlgebraicType.U64}, - { name: "scheduledAt", algebraicType: AlgebraicType.createScheduleAtType()}, - { name: "prevTime", algebraicType: AlgebraicType.createTimestampType()}, + { name: "scheduledId", algebraicType: __AlgebraicTypeValue.U64}, + { name: "scheduledAt", algebraicType: __AlgebraicTypeValue.createScheduleAtType()}, + { name: "prevTime", algebraicType: __AlgebraicTypeValue.createTimestampType()}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: RepeatingTestArg): void { - AlgebraicType.serializeValue(writer, RepeatingTestArg.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: RepeatingTestArg): void { + __AlgebraicTypeValue.serializeValue(writer, RepeatingTestArg.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): RepeatingTestArg { - return AlgebraicType.deserializeValue(reader, RepeatingTestArg.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): RepeatingTestArg { + return __AlgebraicTypeValue.deserializeValue(reader, RepeatingTestArg.getTypeScriptAlgebraicType()); + }, } @@ -3053,62 +3024,58 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -import { RepeatingTestArg as __RepeatingTestArg } from "./repeating_test_arg_type"; +import { RepeatingTestArg } from "./repeating_test_arg_type"; export type RepeatingTest = { - arg: __RepeatingTestArg, + arg: RepeatingTestArg, }; export default RepeatingTest; /** * A namespace for generated helper functions. */ -export namespace RepeatingTest { +export const RepeatingTest = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "arg", algebraicType: __RepeatingTestArg.getTypeScriptAlgebraicType()}, + { name: "arg", algebraicType: RepeatingTestArg.getTypeScriptAlgebraicType()}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: RepeatingTest): void { - AlgebraicType.serializeValue(writer, RepeatingTest.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: RepeatingTest): void { + __AlgebraicTypeValue.serializeValue(writer, RepeatingTest.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): RepeatingTest { - return AlgebraicType.deserializeValue(reader, RepeatingTest.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): RepeatingTest { + return __AlgebraicTypeValue.deserializeValue(reader, RepeatingTest.getTypeScriptAlgebraicType()); + }, } @@ -3123,30 +3090,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type SayHello = {}; @@ -3155,25 +3118,25 @@ export default SayHello; /** * A namespace for generated helper functions. */ -export namespace SayHello { +export const SayHello = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ ] }); - } + }, - export function serialize(writer: BinaryWriter, value: SayHello): void { - AlgebraicType.serializeValue(writer, SayHello.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: SayHello): void { + __AlgebraicTypeValue.serializeValue(writer, SayHello.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): SayHello { - return AlgebraicType.deserializeValue(reader, SayHello.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): SayHello { + return __AlgebraicTypeValue.deserializeValue(reader, SayHello.getTypeScriptAlgebraicType()); + }, } @@ -3188,30 +3151,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { TestA } from "./test_a_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -3227,9 +3186,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.testA.on_insert(...)`. */ export class TestATableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -3268,31 +3227,28 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type TestA = { x: number, y: number, @@ -3303,28 +3259,28 @@ export default TestA; /** * A namespace for generated helper functions. */ -export namespace TestA { +export const TestA = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "x", algebraicType: AlgebraicType.U32}, - { name: "y", algebraicType: AlgebraicType.U32}, - { name: "z", algebraicType: AlgebraicType.String}, + { name: "x", algebraicType: __AlgebraicTypeValue.U32}, + { name: "y", algebraicType: __AlgebraicTypeValue.U32}, + { name: "z", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: TestA): void { - AlgebraicType.serializeValue(writer, TestA.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: TestA): void { + __AlgebraicTypeValue.serializeValue(writer, TestA.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestA { - return AlgebraicType.deserializeValue(reader, TestA.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): TestA { + return __AlgebraicTypeValue.deserializeValue(reader, TestA.getTypeScriptAlgebraicType()); + }, } @@ -3340,31 +3296,28 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type TestB = { foo: string, }; @@ -3373,26 +3326,26 @@ export default TestB; /** * A namespace for generated helper functions. */ -export namespace TestB { +export const TestB = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "foo", algebraicType: AlgebraicType.String}, + { name: "foo", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: TestB): void { - AlgebraicType.serializeValue(writer, TestB.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: TestB): void { + __AlgebraicTypeValue.serializeValue(writer, TestB.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestB { - return AlgebraicType.deserializeValue(reader, TestB.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): TestB { + return __AlgebraicTypeValue.deserializeValue(reader, TestB.getTypeScriptAlgebraicType()); + }, } @@ -3408,30 +3361,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; export type TestBtreeIndexArgs = {}; @@ -3440,25 +3389,25 @@ export default TestBtreeIndexArgs; /** * A namespace for generated helper functions. */ -export namespace TestBtreeIndexArgs { +export const TestBtreeIndexArgs = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ ] }); - } + }, - export function serialize(writer: BinaryWriter, value: TestBtreeIndexArgs): void { - AlgebraicType.serializeValue(writer, TestBtreeIndexArgs.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: TestBtreeIndexArgs): void { + __AlgebraicTypeValue.serializeValue(writer, TestBtreeIndexArgs.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestBtreeIndexArgs { - return AlgebraicType.deserializeValue(reader, TestBtreeIndexArgs.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): TestBtreeIndexArgs { + return __AlgebraicTypeValue.deserializeValue(reader, TestBtreeIndexArgs.getTypeScriptAlgebraicType()); + }, } @@ -3473,33 +3422,29 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { TestD } from "./test_d_type"; -import { NamespaceTestC as __NamespaceTestC } from "./namespace_test_c_type"; +import { NamespaceTestC } from "./namespace_test_c_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -3514,9 +3459,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.testD.on_insert(...)`. */ export class TestDTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -3555,61 +3500,58 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -import { NamespaceTestC as __NamespaceTestC } from "./namespace_test_c_type"; +import { NamespaceTestC } from "./namespace_test_c_type"; + export type TestD = { - testC: __NamespaceTestC | undefined, + testC: NamespaceTestC | undefined, }; export default TestD; /** * A namespace for generated helper functions. */ -export namespace TestD { +export const TestD = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "testC", algebraicType: AlgebraicType.createOptionType(__NamespaceTestC.getTypeScriptAlgebraicType())}, + { name: "testC", algebraicType: __AlgebraicTypeValue.createOptionType(NamespaceTestC.getTypeScriptAlgebraicType())}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: TestD): void { - AlgebraicType.serializeValue(writer, TestD.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: TestD): void { + __AlgebraicTypeValue.serializeValue(writer, TestD.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestD { - return AlgebraicType.deserializeValue(reader, TestD.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): TestD { + return __AlgebraicTypeValue.deserializeValue(reader, TestD.getTypeScriptAlgebraicType()); + }, } @@ -3625,30 +3567,26 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { TestE } from "./test_e_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -3664,9 +3602,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.testE.on_insert(...)`. */ export class TestETableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -3693,7 +3631,7 @@ export class TestETableHandle { // if such a row is present in the client cache. find: (col_val: bigint): TestE | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.id, col_val)) { + if (__deepEqual(row.id, col_val)) { return row; } } @@ -3735,31 +3673,28 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; + export type TestE = { id: bigint, name: string, @@ -3769,27 +3704,27 @@ export default TestE; /** * A namespace for generated helper functions. */ -export namespace TestE { +export const TestE = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "id", algebraicType: AlgebraicType.U64}, - { name: "name", algebraicType: AlgebraicType.String}, + { name: "id", algebraicType: __AlgebraicTypeValue.U64}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: TestE): void { - AlgebraicType.serializeValue(writer, TestE.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: TestE): void { + __AlgebraicTypeValue.serializeValue(writer, TestE.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestE { - return AlgebraicType.deserializeValue(reader, TestE.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): TestE { + return __AlgebraicTypeValue.deserializeValue(reader, TestE.getTypeScriptAlgebraicType()); + }, } @@ -3805,33 +3740,29 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { TestFoobar } from "./test_foobar_type"; -import { Foobar as __Foobar } from "./foobar_type"; +import { Foobar } from "./foobar_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; @@ -3846,9 +3777,9 @@ import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from ". * like `ctx.db.testF.on_insert(...)`. */ export class TestFTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -3887,61 +3818,58 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -import { Foobar as __Foobar } from "./foobar_type"; +import { Foobar } from "./foobar_type"; + export type TestFoobar = { - field: __Foobar, + field: Foobar, }; export default TestFoobar; /** * A namespace for generated helper functions. */ -export namespace TestFoobar { +export const TestFoobar = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "field", algebraicType: __Foobar.getTypeScriptAlgebraicType()}, + { name: "field", algebraicType: Foobar.getTypeScriptAlgebraicType()}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: TestFoobar): void { - AlgebraicType.serializeValue(writer, TestFoobar.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: TestFoobar): void { + __AlgebraicTypeValue.serializeValue(writer, TestFoobar.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestFoobar { - return AlgebraicType.deserializeValue(reader, TestFoobar.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): TestFoobar { + return __AlgebraicTypeValue.deserializeValue(reader, TestFoobar.getTypeScriptAlgebraicType()); + }, } @@ -3957,71 +3885,67 @@ VERSION_COMMENT /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -import { TestA as __TestA } from "./test_a_type"; -import { TestB as __TestB } from "./test_b_type"; -import { NamespaceTestC as __NamespaceTestC } from "./namespace_test_c_type"; -import { NamespaceTestF as __NamespaceTestF } from "./namespace_test_f_type"; +import { TestA } from "./test_a_type"; +import { TestB } from "./test_b_type"; +import { NamespaceTestC } from "./namespace_test_c_type"; +import { NamespaceTestF } from "./namespace_test_f_type"; export type Test = { - arg: __TestA, - arg2: __TestB, - arg3: __NamespaceTestC, - arg4: __NamespaceTestF, + arg: TestA, + arg2: TestB, + arg3: NamespaceTestC, + arg4: NamespaceTestF, }; export default Test; /** * A namespace for generated helper functions. */ -export namespace Test { +export const Test = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: "arg", algebraicType: __TestA.getTypeScriptAlgebraicType()}, - { name: "arg2", algebraicType: __TestB.getTypeScriptAlgebraicType()}, - { name: "arg3", algebraicType: __NamespaceTestC.getTypeScriptAlgebraicType()}, - { name: "arg4", algebraicType: __NamespaceTestF.getTypeScriptAlgebraicType()}, + { name: "arg", algebraicType: TestA.getTypeScriptAlgebraicType()}, + { name: "arg2", algebraicType: TestB.getTypeScriptAlgebraicType()}, + { name: "arg3", algebraicType: NamespaceTestC.getTypeScriptAlgebraicType()}, + { name: "arg4", algebraicType: NamespaceTestF.getTypeScriptAlgebraicType()}, ] }); - } + }, - export function serialize(writer: BinaryWriter, value: Test): void { - AlgebraicType.serializeValue(writer, Test.getTypeScriptAlgebraicType(), value); - } + serialize(writer: __BinaryWriter, value: Test): void { + __AlgebraicTypeValue.serializeValue(writer, Test.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Test { - return AlgebraicType.deserializeValue(reader, Test.getTypeScriptAlgebraicType()); - } + deserialize(reader: __BinaryReader): Test { + return __AlgebraicTypeValue.deserializeValue(reader, Test.getTypeScriptAlgebraicType()); + }, } From 015d3897d0c173880c094091f6cfe3422cbc884c Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 15:09:57 -0400 Subject: [PATCH 27/37] Update pnpm-lock.yaml --- pnpm-lock.yaml | 234 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 200 insertions(+), 34 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4a4aea1abe..63dfa2a141e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,41 +44,10 @@ importers: version: 8.40.0(eslint@9.33.0)(typescript@5.9.2) vite: specifier: ^7.1.3 - version: 7.1.3(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + version: 7.1.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4) - - docs: - dependencies: - github-slugger: - specifier: ^2.0.0 - version: 2.0.0 - devDependencies: - '@types/node': - specifier: ^22.10.2 - version: 22.17.2 - prettier: - specifier: ^3.3.3 - version: 3.6.2 - remark-parse: - specifier: ^11.0.0 - version: 11.0.0 - remark-stringify: - specifier: ^11.0.0 - version: 11.0.0 - tsx: - specifier: ^4.19.2 - version: 4.20.4 - typescript: - specifier: ^5.6.3 - version: 5.6.3 - unified: - specifier: ^11.0.5 - version: 11.0.5 - unist-util-visit: - specifier: ^5.0.0 - version: 5.0.0 + version: 3.2.4(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4) sdks/typescript: devDependencies: @@ -197,7 +166,7 @@ importers: version: 3.6.2 tsup: specifier: ^8.1.0 - version: 8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.6.3) + version: 8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.9.2) undici: specifier: ^6.19.2 version: 6.21.3 @@ -393,6 +362,10 @@ packages: '@changesets/write@0.4.0': resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + '@csstools/color-helpers@5.0.2': resolution: {integrity: sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==} engines: {node: '>=18'} @@ -814,6 +787,9 @@ packages: '@jridgewell/trace-mapping@0.3.30': resolution: {integrity: sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==} + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@manypkg/find-root@1.1.0': resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} @@ -971,6 +947,18 @@ packages: peerDependencies: '@testing-library/dom': '>=7.21.4' + '@tsconfig/node10@1.0.11': + resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + '@types/aria-query@5.0.4': resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} @@ -1173,6 +1161,10 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} + engines: {node: '>=0.4.0'} + acorn@8.15.0: resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} @@ -1212,6 +1204,9 @@ packages: any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} @@ -1337,6 +1332,9 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -1389,6 +1387,10 @@ packages: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1829,6 +1831,9 @@ packages: magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -2308,6 +2313,20 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + tsup@8.5.0: resolution: {integrity: sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ==} engines: {node: '>=18'} @@ -2348,6 +2367,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} + engines: {node: '>=14.17'} + hasBin: true + ufo@1.6.1: resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} @@ -2371,6 +2395,9 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + vite-node@2.1.9: resolution: {integrity: sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -2452,6 +2479,46 @@ packages: yaml: optional: true + vite@7.1.4: + resolution: {integrity: sha512-X5QFK4SGynAeeIt+A7ZWnApdUyHYm+pzv/8/A57LqSGcI88U6R6ipOs3uCesdc6yl7nl+zNO0t8LmqAdXcQihw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + vitest@2.1.9: resolution: {integrity: sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==} engines: {node: ^18.0.0 || >=20.0.0} @@ -2581,6 +2648,10 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -2875,6 +2946,10 @@ snapshots: human-id: 4.1.1 prettier: 2.8.8 + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + '@csstools/color-helpers@5.0.2': {} '@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': @@ -3151,6 +3226,11 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + '@manypkg/find-root@1.1.0': dependencies: '@babel/runtime': 7.28.3 @@ -3280,6 +3360,14 @@ snapshots: dependencies: '@testing-library/dom': 10.4.1 + '@tsconfig/node10@1.0.11': {} + + '@tsconfig/node12@1.0.11': {} + + '@tsconfig/node14@1.0.3': {} + + '@tsconfig/node16@1.0.4': {} + '@types/aria-query@5.0.4': {} '@types/babel__core@7.20.5': @@ -3638,6 +3726,10 @@ snapshots: dependencies: acorn: 8.15.0 + acorn-walk@8.3.4: + dependencies: + acorn: 8.15.0 + acorn@8.15.0: {} agent-base@7.1.4: {} @@ -3665,6 +3757,8 @@ snapshots: any-promise@1.3.0: {} + arg@4.1.3: {} + argparse@1.0.10: dependencies: sprintf-js: 1.0.3 @@ -3773,6 +3867,8 @@ snapshots: convert-source-map@2.0.0: {} + create-require@1.1.1: {} + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -3811,6 +3907,8 @@ snapshots: diff-sequences@29.6.3: {} + diff@4.0.2: {} + dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -4312,6 +4410,8 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 + make-error@1.3.6: {} + merge2@1.4.1: {} micromatch@4.0.8: @@ -4733,6 +4833,24 @@ snapshots: ts-interface-checker@0.1.13: {} + ts-node@10.9.2(@types/node@24.3.0)(typescript@5.9.2): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 24.3.0 + acorn: 8.15.0 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.9.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + tsup@8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.6.3): dependencies: bundle-require: 5.1.0(esbuild@0.25.9) @@ -4761,6 +4879,34 @@ snapshots: - tsx - yaml + tsup@8.5.0(postcss@8.5.6)(tsx@4.20.4)(typescript@5.9.2): + dependencies: + bundle-require: 5.1.0(esbuild@0.25.9) + cac: 6.7.14 + chokidar: 4.0.3 + consola: 3.4.2 + debug: 4.4.1 + esbuild: 0.25.9 + fix-dts-default-cjs-exports: 1.0.1 + joycon: 3.1.1 + picocolors: 1.1.1 + postcss-load-config: 6.0.1(postcss@8.5.6)(tsx@4.20.4) + resolve-from: 5.0.0 + rollup: 4.46.3 + source-map: 0.8.0-beta.0 + sucrase: 3.35.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 + tree-kill: 1.2.2 + optionalDependencies: + postcss: 8.5.6 + typescript: 5.9.2 + transitivePeerDependencies: + - jiti + - supports-color + - tsx + - yaml + tsx@4.20.4: dependencies: esbuild: 0.25.9 @@ -4796,6 +4942,8 @@ snapshots: typescript@5.6.3: {} + typescript@5.9.2: {} + ufo@1.6.1: {} undici-types@7.10.0: {} @@ -4814,6 +4962,8 @@ snapshots: dependencies: punycode: 2.3.1 + v8-compile-cache-lib@3.0.1: {} + vite-node@2.1.9(@types/node@24.3.0)(terser@5.43.1): dependencies: cac: 6.7.14 @@ -4877,6 +5027,20 @@ snapshots: terser: 5.43.1 tsx: 4.20.4 + vite@7.1.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4): + dependencies: + esbuild: 0.25.9 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.46.3 + tinyglobby: 0.2.14 + optionalDependencies: + '@types/node': 24.3.0 + fsevents: 2.3.3 + terser: 5.43.1 + tsx: 4.20.4 + vitest@2.1.9(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1): dependencies: '@vitest/expect': 2.1.9 @@ -5018,4 +5182,6 @@ snapshots: yallist@3.1.1: {} + yn@3.1.1: {} + yocto-queue@0.1.0: {} From 79309e15dfbf79ea92541f9f1106994aaae35b41 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 15:16:03 -0400 Subject: [PATCH 28/37] Regenerated with new code generation --- .../identity_connected_reducer.ts | 81 +++++++------- .../identity_disconnected_reducer.ts | 81 +++++++------- .../src/module_bindings/index.ts | 96 ++++++++--------- .../src/module_bindings/message_table.ts | 50 ++++----- .../src/module_bindings/message_type.ts | 97 +++++++++-------- .../module_bindings/send_message_reducer.ts | 80 +++++++------- .../src/module_bindings/set_name_reducer.ts | 80 +++++++------- .../src/module_bindings/user_table.ts | 54 +++++----- .../src/module_bindings/user_type.ts | 100 ++++++++++-------- .../module_bindings/create_player_reducer.ts | 79 +++++++------- .../test-app/src/module_bindings/index.ts | 97 ++++++++--------- .../src/module_bindings/player_table.ts | 54 +++++----- .../src/module_bindings/player_type.ts | 81 +++++++------- .../src/module_bindings/point_type.ts | 73 ++++++------- .../module_bindings/unindexed_player_table.ts | 52 +++++---- .../module_bindings/unindexed_player_type.ts | 84 +++++++-------- .../src/module_bindings/user_table.ts | 54 +++++----- .../test-app/src/module_bindings/user_type.ts | 78 +++++++------- 18 files changed, 681 insertions(+), 690 deletions(-) diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts index 113201844ed..6cf78b69c46 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts @@ -1,60 +1,63 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; export type IdentityConnected = {}; +export default IdentityConnected; /** * A namespace for generated helper functions. */ -export namespace IdentityConnected { +export const IdentityConnected = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [], + }); + }, - export function serialize( - writer: BinaryWriter, - value: IdentityConnected - ): void { - IdentityConnected.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: IdentityConnected): void { + __AlgebraicTypeValue.serializeValue( + writer, + IdentityConnected.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): IdentityConnected { - return IdentityConnected.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): IdentityConnected { + return __AlgebraicTypeValue.deserializeValue( + reader, + IdentityConnected.getTypeScriptAlgebraicType() + ); + }, +}; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts index 33f7a6403f7..7ac34ae01a5 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts @@ -1,62 +1,63 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; export type IdentityDisconnected = {}; +export default IdentityDisconnected; /** * A namespace for generated helper functions. */ -export namespace IdentityDisconnected { +export const IdentityDisconnected = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [], + }); + }, - export function serialize( - writer: BinaryWriter, - value: IdentityDisconnected - ): void { - IdentityDisconnected.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: IdentityDisconnected): void { + __AlgebraicTypeValue.serializeValue( + writer, + IdentityDisconnected.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): IdentityDisconnected { - return IdentityDisconnected.getTypeScriptAlgebraicType().deserialize( - reader + deserialize(reader: __BinaryReader): IdentityDisconnected { + return __AlgebraicTypeValue.deserializeValue( + reader, + IdentityDisconnected.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts index fe3b6deb407..cb51ffe53ec 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts @@ -1,36 +1,32 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; // Import and reexport all reducer arg types @@ -67,8 +63,9 @@ const REMOTE_MODULE = { primaryKey: 'identity', primaryKeyInfo: { colName: 'identity', - colType: - User.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: ( + User.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product + ).value.elements[0].algebraicType, }, }, }, @@ -100,17 +97,20 @@ const REMOTE_MODULE = { // all we do is build a TypeScript object which we could have done inside the // SDK, but if in the future we wanted to create a class this would be // necessary because classes have methods, so we'll keep it. - eventContextConstructor: (imp: DbConnectionImpl, event: Event) => { + eventContextConstructor: ( + imp: __DbConnectionImpl, + event: __Event + ) => { return { ...(imp as DbConnection), event, }; }, - dbViewConstructor: (imp: DbConnectionImpl) => { + dbViewConstructor: (imp: __DbConnectionImpl) => { return new RemoteTables(imp); }, reducersConstructor: ( - imp: DbConnectionImpl, + imp: __DbConnectionImpl, setReducerFlags: SetReducerFlags ) => { return new RemoteReducers(imp, setReducerFlags); @@ -130,8 +130,8 @@ export type Reducer = export class RemoteReducers { constructor( - private connection: DbConnectionImpl, - private setCallReducerFlags: SetReducerFlags + private connection: __DbConnectionImpl, + private setCallReducerFlags: __SetReducerFlags ) {} onIdentityConnected(callback: (ctx: ReducerEventContext) => void) { @@ -152,7 +152,7 @@ export class RemoteReducers { sendMessage(text: string) { const __args = { text }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); SendMessage.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer( @@ -174,7 +174,7 @@ export class RemoteReducers { setName(name: string) { const __args = { name }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); SetName.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer( @@ -194,19 +194,19 @@ export class RemoteReducers { } export class SetReducerFlags { - sendMessageFlags: CallReducerFlags = 'FullUpdate'; - sendMessage(flags: CallReducerFlags) { + sendMessageFlags: __CallReducerFlags = 'FullUpdate'; + sendMessage(flags: __CallReducerFlags) { this.sendMessageFlags = flags; } - setNameFlags: CallReducerFlags = 'FullUpdate'; - setName(flags: CallReducerFlags) { + setNameFlags: __CallReducerFlags = 'FullUpdate'; + setName(flags: __CallReducerFlags) { this.setNameFlags = flags; } } export class RemoteTables { - constructor(private connection: DbConnectionImpl) {} + constructor(private connection: __DbConnectionImpl) {} get message(): MessageTableHandle { return new MessageTableHandle( @@ -225,51 +225,51 @@ export class RemoteTables { } } -export class SubscriptionBuilder extends SubscriptionBuilderImpl< +export class SubscriptionBuilder extends __SubscriptionBuilderImpl< RemoteTables, RemoteReducers, SetReducerFlags > {} -export class DbConnection extends DbConnectionImpl< +export class DbConnection extends __DbConnectionImpl< RemoteTables, RemoteReducers, SetReducerFlags > { - static builder = (): DbConnectionBuilder< + static builder = (): __DbConnectionBuilder< DbConnection, ErrorContext, SubscriptionEventContext > => { - return new DbConnectionBuilder< + return new __DbConnectionBuilder< DbConnection, ErrorContext, SubscriptionEventContext - >(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); + >(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); }; subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); }; } -export type EventContext = EventContextInterface< +export type EventContext = __EventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags, Reducer >; -export type ReducerEventContext = ReducerEventContextInterface< +export type ReducerEventContext = __ReducerEventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags, Reducer >; -export type SubscriptionEventContext = SubscriptionEventContextInterface< +export type SubscriptionEventContext = __SubscriptionEventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags >; -export type ErrorContext = ErrorContextInterface< +export type ErrorContext = __ErrorContextInterface< RemoteTables, RemoteReducers, SetReducerFlags diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts index 19ce1d7afe6..5527a695844 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts @@ -1,36 +1,32 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; import { Message } from './message_type'; import { @@ -51,9 +47,9 @@ import { * like `ctx.db.message.on_insert(...)`. */ export class MessageTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts index 577574da5e8..3aed4096306 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts @@ -1,64 +1,77 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; + export type Message = { - sender: Identity; - sent: Timestamp; + sender: __Identity; + sent: __Timestamp; text: string; }; +export default Message; /** * A namespace for generated helper functions. */ -export namespace Message { +export const Message = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('sender', AlgebraicType.createIdentityType()), - new ProductTypeElement('sent', AlgebraicType.createTimestampType()), - new ProductTypeElement('text', AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'sender', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { + name: 'sent', + algebraicType: __AlgebraicTypeValue.createTimestampType(), + }, + { name: 'text', algebraicType: __AlgebraicTypeValue.String }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: Message): void { - Message.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Message): void { + __AlgebraicTypeValue.serializeValue( + writer, + Message.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): Message { - return Message.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): Message { + return __AlgebraicTypeValue.deserializeValue( + reader, + Message.getTypeScriptAlgebraicType() + ); + }, +}; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts index 98c1913332f..0ac75971f28 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts @@ -1,61 +1,65 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; export type SendMessage = { text: string; }; +export default SendMessage; /** * A namespace for generated helper functions. */ -export namespace SendMessage { +export const SendMessage = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('text', AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [{ name: 'text', algebraicType: __AlgebraicTypeValue.String }], + }); + }, - export function serialize(writer: BinaryWriter, value: SendMessage): void { - SendMessage.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: SendMessage): void { + __AlgebraicTypeValue.serializeValue( + writer, + SendMessage.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): SendMessage { - return SendMessage.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): SendMessage { + return __AlgebraicTypeValue.deserializeValue( + reader, + SendMessage.getTypeScriptAlgebraicType() + ); + }, +}; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts index f377481297a..127d26cb276 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts @@ -1,61 +1,65 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; export type SetName = { name: string; }; +export default SetName; /** * A namespace for generated helper functions. */ -export namespace SetName { +export const SetName = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('name', AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [{ name: 'name', algebraicType: __AlgebraicTypeValue.String }], + }); + }, - export function serialize(writer: BinaryWriter, value: SetName): void { - SetName.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: SetName): void { + __AlgebraicTypeValue.serializeValue( + writer, + SetName.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): SetName { - return SetName.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): SetName { + return __AlgebraicTypeValue.deserializeValue( + reader, + SetName.getTypeScriptAlgebraicType() + ); + }, +}; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts index d59979009e6..00e1516b716 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts @@ -1,36 +1,32 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; import { User } from './user_type'; import { @@ -51,9 +47,9 @@ import { * like `ctx.db.user.on_insert(...)`. */ export class UserTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -78,9 +74,9 @@ export class UserTableHandle { identity = { // Find the subscribed row whose `identity` column value is equal to `col_val`, // if such a row is present in the client cache. - find: (col_val: Identity): User | undefined => { + find: (col_val: __Identity): User | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.identity, col_val)) { + if (__deepEqual(row.identity, col_val)) { return row; } } diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts index 8946f9c01e1..37ff6d2c802 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts @@ -1,67 +1,79 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; + export type User = { - identity: Identity; + identity: __Identity; name: string | undefined; online: boolean; }; +export default User; /** * A namespace for generated helper functions. */ -export namespace User { +export const User = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createProductType([ - new ProductTypeElement('identity', AlgebraicType.createIdentityType()), - new ProductTypeElement( - 'name', - AlgebraicType.createOptionType(AlgebraicType.createStringType()) - ), - new ProductTypeElement('online', AlgebraicType.createBoolType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'identity', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { + name: 'name', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { name: 'online', algebraicType: __AlgebraicTypeValue.Bool }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: User): void { - User.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: User): void { + __AlgebraicTypeValue.serializeValue( + writer, + User.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): User { - return User.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): User { + return __AlgebraicTypeValue.deserializeValue( + reader, + User.getTypeScriptAlgebraicType() + ); + }, +}; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts index 2ee9a0d6c8e..1835cb76107 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts @@ -1,78 +1,71 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; -import { Point as __Point } from './point_type'; +import { Point } from './point_type'; export type CreatePlayer = { name: string; - location: __Point; + location: Point; }; export default CreatePlayer; /** * A namespace for generated helper functions. */ -export namespace CreatePlayer { +export const CreatePlayer = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'name', algebraicType: AlgebraicType.String }, - { - name: 'location', - algebraicType: __Point.getTypeScriptAlgebraicType(), - }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'location', algebraicType: Point.getTypeScriptAlgebraicType() }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: CreatePlayer): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: CreatePlayer): void { + __AlgebraicTypeValue.serializeValue( writer, CreatePlayer.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): CreatePlayer { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): CreatePlayer { + return __AlgebraicTypeValue.deserializeValue( reader, CreatePlayer.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/index.ts b/sdks/typescript/packages/test-app/src/module_bindings/index.ts index 1fc8c6062e4..5381dad32e6 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/index.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/index.ts @@ -1,36 +1,32 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; // Import and reexport all reducer arg types @@ -63,8 +59,9 @@ const REMOTE_MODULE = { primaryKey: 'ownerId', primaryKeyInfo: { colName: 'ownerId', - colType: (Player.getTypeScriptAlgebraicType() as ProductType).value - .elements[0].algebraicType, + colType: ( + Player.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product + ).value.elements[0].algebraicType, }, }, unindexed_player: { @@ -77,8 +74,9 @@ const REMOTE_MODULE = { primaryKey: 'identity', primaryKeyInfo: { colName: 'identity', - colType: (User.getTypeScriptAlgebraicType() as ProductType).value - .elements[0].algebraicType, + colType: ( + User.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product + ).value.elements[0].algebraicType, }, }, }, @@ -89,7 +87,7 @@ const REMOTE_MODULE = { }, }, versionInfo: { - cliVersion: '1.3.0', + cliVersion: '1.3.2', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. @@ -98,17 +96,20 @@ const REMOTE_MODULE = { // all we do is build a TypeScript object which we could have done inside the // SDK, but if in the future we wanted to create a class this would be // necessary because classes have methods, so we'll keep it. - eventContextConstructor: (imp: DbConnectionImpl, event: Event) => { + eventContextConstructor: ( + imp: __DbConnectionImpl, + event: __Event + ) => { return { ...(imp as DbConnection), event, }; }, - dbViewConstructor: (imp: DbConnectionImpl) => { + dbViewConstructor: (imp: __DbConnectionImpl) => { return new RemoteTables(imp); }, reducersConstructor: ( - imp: DbConnectionImpl, + imp: __DbConnectionImpl, setReducerFlags: SetReducerFlags ) => { return new RemoteReducers(imp, setReducerFlags); @@ -123,13 +124,13 @@ export type Reducer = never | { name: 'CreatePlayer'; args: CreatePlayer }; export class RemoteReducers { constructor( - private connection: DbConnectionImpl, - private setCallReducerFlags: SetReducerFlags + private connection: __DbConnectionImpl, + private setCallReducerFlags: __SetReducerFlags ) {} createPlayer(name: string, location: Point) { const __args = { name, location }; - let __writer = new BinaryWriter(1024); + let __writer = new __BinaryWriter(1024); CreatePlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer( @@ -153,14 +154,14 @@ export class RemoteReducers { } export class SetReducerFlags { - createPlayerFlags: CallReducerFlags = 'FullUpdate'; - createPlayer(flags: CallReducerFlags) { + createPlayerFlags: __CallReducerFlags = 'FullUpdate'; + createPlayer(flags: __CallReducerFlags) { this.createPlayerFlags = flags; } } export class RemoteTables { - constructor(private connection: DbConnectionImpl) {} + constructor(private connection: __DbConnectionImpl) {} get player(): PlayerTableHandle { return new PlayerTableHandle( @@ -187,51 +188,51 @@ export class RemoteTables { } } -export class SubscriptionBuilder extends SubscriptionBuilderImpl< +export class SubscriptionBuilder extends __SubscriptionBuilderImpl< RemoteTables, RemoteReducers, SetReducerFlags > {} -export class DbConnection extends DbConnectionImpl< +export class DbConnection extends __DbConnectionImpl< RemoteTables, RemoteReducers, SetReducerFlags > { - static builder = (): DbConnectionBuilder< + static builder = (): __DbConnectionBuilder< DbConnection, ErrorContext, SubscriptionEventContext > => { - return new DbConnectionBuilder< + return new __DbConnectionBuilder< DbConnection, ErrorContext, SubscriptionEventContext - >(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); + >(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); }; subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); }; } -export type EventContext = EventContextInterface< +export type EventContext = __EventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags, Reducer >; -export type ReducerEventContext = ReducerEventContextInterface< +export type ReducerEventContext = __ReducerEventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags, Reducer >; -export type SubscriptionEventContext = SubscriptionEventContextInterface< +export type SubscriptionEventContext = __SubscriptionEventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags >; -export type ErrorContext = ErrorContextInterface< +export type ErrorContext = __ErrorContextInterface< RemoteTables, RemoteReducers, SetReducerFlags diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts index 45516a71d93..471655189a5 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts @@ -1,39 +1,35 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; import { Player } from './player_type'; -import { Point as __Point } from './point_type'; +import { Point } from './point_type'; import { type EventContext, @@ -53,9 +49,9 @@ import { * like `ctx.db.player.on_insert(...)`. */ export class PlayerTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -82,7 +78,7 @@ export class PlayerTableHandle { // if such a row is present in the client cache. find: (col_val: string): Player | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.ownerId, col_val)) { + if (__deepEqual(row.ownerId, col_val)) { return row; } } diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts index 08ce3e4ac41..43b338f4707 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts @@ -1,79 +1,72 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; -import { Point as __Point } from './point_type'; +import { Point } from './point_type'; export type Player = { ownerId: string; name: string; - location: __Point; + location: Point; }; export default Player; /** * A namespace for generated helper functions. */ -export namespace Player { +export const Player = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'ownerId', algebraicType: AlgebraicType.String }, - { name: 'name', algebraicType: AlgebraicType.String }, - { - name: 'location', - algebraicType: __Point.getTypeScriptAlgebraicType(), - }, + { name: 'ownerId', algebraicType: __AlgebraicTypeValue.String }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'location', algebraicType: Point.getTypeScriptAlgebraicType() }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: Player): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: Player): void { + __AlgebraicTypeValue.serializeValue( writer, Player.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): Player { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): Player { + return __AlgebraicTypeValue.deserializeValue( reader, Player.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts index addda6a3c72..5aa9fc63d9e 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; + export type Point = { x: number; y: number; @@ -41,32 +38,32 @@ export default Point; /** * A namespace for generated helper functions. */ -export namespace Point { +export const Point = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'x', algebraicType: AlgebraicType.U16 }, - { name: 'y', algebraicType: AlgebraicType.U16 }, + { name: 'x', algebraicType: __AlgebraicTypeValue.U16 }, + { name: 'y', algebraicType: __AlgebraicTypeValue.U16 }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: Point): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: Point): void { + __AlgebraicTypeValue.serializeValue( writer, Point.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): Point { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): Point { + return __AlgebraicTypeValue.deserializeValue( reader, Point.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts index 737520dea40..7ec788ac87a 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts @@ -1,39 +1,35 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; import { UnindexedPlayer } from './unindexed_player_type'; -import { Point as __Point } from './point_type'; +import { Point } from './point_type'; import { type EventContext, @@ -53,9 +49,9 @@ import { * like `ctx.db.unindexedPlayer.on_insert(...)`. */ export class UnindexedPlayerTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts index ed8bedc15b3..8fab6459446 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts @@ -1,82 +1,72 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; -import { Point as __Point } from './point_type'; +import { Point } from './point_type'; export type UnindexedPlayer = { ownerId: string; name: string; - location: __Point; + location: Point; }; export default UnindexedPlayer; /** * A namespace for generated helper functions. */ -export namespace UnindexedPlayer { +export const UnindexedPlayer = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'ownerId', algebraicType: AlgebraicType.String }, - { name: 'name', algebraicType: AlgebraicType.String }, - { - name: 'location', - algebraicType: __Point.getTypeScriptAlgebraicType(), - }, + { name: 'ownerId', algebraicType: __AlgebraicTypeValue.String }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'location', algebraicType: Point.getTypeScriptAlgebraicType() }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: UnindexedPlayer - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: UnindexedPlayer): void { + __AlgebraicTypeValue.serializeValue( writer, UnindexedPlayer.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): UnindexedPlayer { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): UnindexedPlayer { + return __AlgebraicTypeValue.deserializeValue( reader, UnindexedPlayer.getTypeScriptAlgebraicType() ); - } -} + }, +}; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts index bebbdc203c1..00e1516b716 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts @@ -1,36 +1,32 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; import { User } from './user_type'; import { @@ -51,9 +47,9 @@ import { * like `ctx.db.user.on_insert(...)`. */ export class UserTableHandle { - tableCache: TableCache; + tableCache: __TableCache; - constructor(tableCache: TableCache) { + constructor(tableCache: __TableCache) { this.tableCache = tableCache; } @@ -78,9 +74,9 @@ export class UserTableHandle { identity = { // Find the subscribed row whose `identity` column value is equal to `col_val`, // if such a row is present in the client cache. - find: (col_val: Identity): User | undefined => { + find: (col_val: __Identity): User | undefined => { for (let row of this.tableCache.iter()) { - if (deepEqual(row.identity, col_val)) { + if (__deepEqual(row.identity, col_val)) { return row; } } diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts index f70f72d7b9d..b9a80d57bc3 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts @@ -1,39 +1,36 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; + export type User = { - identity: Identity; + identity: __Identity; username: string; }; export default User; @@ -41,32 +38,35 @@ export default User; /** * A namespace for generated helper functions. */ -export namespace User { +export const User = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'identity', algebraicType: AlgebraicType.createIdentityType() }, - { name: 'username', algebraicType: AlgebraicType.String }, + { + name: 'identity', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { name: 'username', algebraicType: __AlgebraicTypeValue.String }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: User): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: User): void { + __AlgebraicTypeValue.serializeValue( writer, User.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): User { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): User { + return __AlgebraicTypeValue.deserializeValue( reader, User.getTypeScriptAlgebraicType() ); - } -} + }, +}; From 2e66b1049f1a73eb1bea04ffeb76d35ca779af81 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 17:26:41 -0400 Subject: [PATCH 29/37] Fixed issue with generation --- .../src/autogen/product_type_element_type.ts | 6 +- .../src/autogen/product_type_type.ts | 6 +- .../src/autogen/raw_column_def_v_8_type.ts | 6 +- .../raw_column_default_value_v_9_type.ts | 6 +- .../autogen/raw_constraint_def_v_8_type.ts | 6 +- .../autogen/raw_constraint_def_v_9_type.ts | 6 +- .../src/autogen/raw_index_def_v_8_type.ts | 6 +- .../src/autogen/raw_index_def_v_9_type.ts | 6 +- .../src/autogen/raw_module_def_v_8_type.ts | 6 +- .../src/autogen/raw_module_def_v_9_type.ts | 6 +- .../src/autogen/raw_reducer_def_v_9_type.ts | 6 +- .../raw_row_level_security_def_v_9_type.ts | 6 +- .../src/autogen/raw_schedule_def_v_9_type.ts | 6 +- .../autogen/raw_scoped_type_name_v_9_type.ts | 6 +- .../src/autogen/raw_sequence_def_v_8_type.ts | 6 +- .../src/autogen/raw_sequence_def_v_9_type.ts | 6 +- .../src/autogen/raw_table_def_v_8_type.ts | 6 +- .../src/autogen/raw_table_def_v_9_type.ts | 6 +- .../src/autogen/raw_type_def_v_9_type.ts | 6 +- .../raw_unique_constraint_data_v_9_type.ts | 6 +- .../src/autogen/reducer_def_type.ts | 6 +- .../src/autogen/sum_type_type.ts | 6 +- .../src/autogen/sum_type_variant_type.ts | 6 +- .../src/autogen/table_desc_type.ts | 6 +- .../src/autogen/type_alias_type.ts | 6 +- .../src/autogen/typespace_type.ts | 6 +- .../src/server/server/reducers.ts | 50 ++ .../src/server/server/schema.ts | 684 ++++++++++++++++++ crates/codegen/src/typescript.rs | 12 +- .../identity_connected_reducer.ts | 6 +- .../identity_disconnected_reducer.ts | 6 +- .../src/module_bindings/message_type.ts | 6 +- .../module_bindings/send_message_reducer.ts | 6 +- .../src/module_bindings/set_name_reducer.ts | 6 +- .../src/module_bindings/user_type.ts | 6 +- .../sdk/src/client_api/bsatn_row_list_type.ts | 82 +-- .../sdk/src/client_api/call_reducer_type.ts | 86 +-- .../sdk/src/client_api/client_message_type.ts | 176 ++--- .../src/client_api/client_message_variants.ts | 53 ++ .../compressable_query_update_type.ts | 124 ++-- .../compressable_query_update_variants.ts | 37 + .../src/client_api/database_update_type.ts | 82 +-- .../sdk/src/client_api/energy_quanta_type.ts | 77 +- .../sdk/src/client_api/identity_token_type.ts | 88 +-- .../packages/sdk/src/client_api/index.ts | 81 +-- .../client_api/initial_subscription_type.ts | 89 ++- .../client_api/one_off_query_response_type.ts | 95 ++- .../sdk/src/client_api/one_off_query_type.ts | 79 +- .../sdk/src/client_api/one_off_table_type.ts | 82 +-- .../sdk/src/client_api/query_id_type.ts | 77 +- .../sdk/src/client_api/query_update_type.ts | 84 +-- .../src/client_api/reducer_call_info_type.ts | 89 ++- .../sdk/src/client_api/row_size_hint_type.ts | 106 ++- .../src/client_api/row_size_hint_variants.ts | 34 + .../sdk/src/client_api/server_message_type.ts | 250 +++---- .../src/client_api/server_message_variants.ts | 80 ++ .../src/client_api/subscribe_applied_type.ts | 93 ++- .../subscribe_multi_applied_type.ts | 93 ++- .../src/client_api/subscribe_multi_type.ts | 86 ++- .../sdk/src/client_api/subscribe_rows_type.ts | 84 +-- .../src/client_api/subscribe_single_type.ts | 87 +-- .../sdk/src/client_api/subscribe_type.ts | 81 +-- .../src/client_api/subscription_error_type.ts | 94 +-- .../sdk/src/client_api/table_update_type.ts | 88 ++- .../transaction_update_light_type.ts | 85 +-- .../src/client_api/transaction_update_type.ts | 111 ++- .../client_api/unsubscribe_applied_type.ts | 93 ++- .../unsubscribe_multi_applied_type.ts | 93 ++- .../src/client_api/unsubscribe_multi_type.ts | 85 +-- .../sdk/src/client_api/unsubscribe_type.ts | 82 +-- .../sdk/src/client_api/update_status_type.ts | 114 ++- .../src/client_api/update_status_variants.ts | 37 + .../module_bindings/create_player_reducer.ts | 6 +- .../src/module_bindings/player_type.ts | 6 +- .../src/module_bindings/point_type.ts | 6 +- .../module_bindings/unindexed_player_type.ts | 6 +- .../test-app/src/module_bindings/user_type.ts | 6 +- 77 files changed, 2534 insertions(+), 1791 deletions(-) create mode 100644 crates/bindings-typescript/src/server/server/reducers.ts create mode 100644 crates/bindings-typescript/src/server/server/schema.ts create mode 100644 sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts create mode 100644 sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts create mode 100644 sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts create mode 100644 sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts create mode 100644 sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts diff --git a/crates/bindings-typescript/src/autogen/product_type_element_type.ts b/crates/bindings-typescript/src/autogen/product_type_element_type.ts index 07113f3e1b7..8e61adf3c39 100644 --- a/crates/bindings-typescript/src/autogen/product_type_element_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -34,10 +34,8 @@ export type ProductTypeElement = { name: string | undefined; algebraicType: AlgebraicType; }; -export default ProductTypeElement; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const ProductTypeElement = { /** @@ -76,3 +74,5 @@ export const ProductTypeElement = { ); }, }; + +export default ProductTypeElement; diff --git a/crates/bindings-typescript/src/autogen/product_type_type.ts b/crates/bindings-typescript/src/autogen/product_type_type.ts index 827955c4cc0..9646caeb9d4 100644 --- a/crates/bindings-typescript/src/autogen/product_type_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_type.ts @@ -33,10 +33,8 @@ import { ProductTypeElement } from './product_type_element_type'; export type ProductType = { elements: ProductTypeElement[]; }; -export default ProductType; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const ProductType = { /** @@ -71,3 +69,5 @@ export const ProductType = { ); }, }; + +export default ProductType; diff --git a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts index e8c2bbb0eda..13a86275e81 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts @@ -34,10 +34,8 @@ export type RawColumnDefV8 = { colName: string; colType: AlgebraicType; }; -export default RawColumnDefV8; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawColumnDefV8 = { /** @@ -71,3 +69,5 @@ export const RawColumnDefV8 = { ); }, }; + +export default RawColumnDefV8; diff --git a/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts index 0ce003a50e8..b0c49d4f056 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts @@ -34,10 +34,8 @@ export type RawColumnDefaultValueV9 = { colId: number; value: Uint8Array; }; -export default RawColumnDefaultValueV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawColumnDefaultValueV9 = { /** @@ -72,3 +70,5 @@ export const RawColumnDefaultValueV9 = { ); }, }; + +export default RawColumnDefaultValueV9; diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts index e8aa86241a6..fae463b280b 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts @@ -34,10 +34,8 @@ export type RawConstraintDefV8 = { constraints: number; columns: number[]; }; -export default RawConstraintDefV8; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawConstraintDefV8 = { /** @@ -72,3 +70,5 @@ export const RawConstraintDefV8 = { ); }, }; + +export default RawConstraintDefV8; diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts index 604a8db4d11..6631d910716 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts @@ -34,10 +34,8 @@ export type RawConstraintDefV9 = { name: string | undefined; data: RawConstraintDataV9; }; -export default RawConstraintDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawConstraintDefV9 = { /** @@ -76,3 +74,5 @@ export const RawConstraintDefV9 = { ); }, }; + +export default RawConstraintDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts index c0c39fac162..be09abc83be 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts @@ -36,10 +36,8 @@ export type RawIndexDefV8 = { indexType: IndexType; columns: number[]; }; -export default RawIndexDefV8; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawIndexDefV8 = { /** @@ -78,3 +76,5 @@ export const RawIndexDefV8 = { ); }, }; + +export default RawIndexDefV8; diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts index 2a95be2bc2b..b2e1df9f7f1 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts @@ -35,10 +35,8 @@ export type RawIndexDefV9 = { accessorName: string | undefined; algorithm: RawIndexAlgorithm; }; -export default RawIndexDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawIndexDefV9 = { /** @@ -83,3 +81,5 @@ export const RawIndexDefV9 = { ); }, }; + +export default RawIndexDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts index cda10456fa9..5bca6244434 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts @@ -39,10 +39,8 @@ export type RawModuleDefV8 = { reducers: ReducerDef[]; miscExports: MiscModuleExport[]; }; -export default RawModuleDefV8; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawModuleDefV8 = { /** @@ -93,3 +91,5 @@ export const RawModuleDefV8 = { ); }, }; + +export default RawModuleDefV8; diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts index 00336500965..f237b3cfe03 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts @@ -43,10 +43,8 @@ export type RawModuleDefV9 = { miscExports: RawMiscModuleExportV9[]; rowLevelSecurity: RawRowLevelSecurityDefV9[]; }; -export default RawModuleDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawModuleDefV9 = { /** @@ -109,3 +107,5 @@ export const RawModuleDefV9 = { ); }, }; + +export default RawModuleDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts index aa0d1b3364a..1917bbc4fa8 100644 --- a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts @@ -36,10 +36,8 @@ export type RawReducerDefV9 = { params: ProductType; lifecycle: Lifecycle | undefined; }; -export default RawReducerDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawReducerDefV9 = { /** @@ -79,3 +77,5 @@ export const RawReducerDefV9 = { ); }, }; + +export default RawReducerDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts index fc1d6dc6e58..3a1aa101294 100644 --- a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts @@ -32,10 +32,8 @@ import { export type RawRowLevelSecurityDefV9 = { sql: string; }; -export default RawRowLevelSecurityDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawRowLevelSecurityDefV9 = { /** @@ -63,3 +61,5 @@ export const RawRowLevelSecurityDefV9 = { ); }, }; + +export default RawRowLevelSecurityDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts index 2bc266f0cf6..65a9d359099 100644 --- a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts @@ -34,10 +34,8 @@ export type RawScheduleDefV9 = { reducerName: string; scheduledAtColumn: number; }; -export default RawScheduleDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawScheduleDefV9 = { /** @@ -74,3 +72,5 @@ export const RawScheduleDefV9 = { ); }, }; + +export default RawScheduleDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts index 1f0acce4cff..0f5f8316d48 100644 --- a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts @@ -33,10 +33,8 @@ export type RawScopedTypeNameV9 = { scope: string[]; name: string; }; -export default RawScopedTypeNameV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawScopedTypeNameV9 = { /** @@ -72,3 +70,5 @@ export const RawScopedTypeNameV9 = { ); }, }; + +export default RawScopedTypeNameV9; diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts index deaa4ec0f0b..577ccfc1bca 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts @@ -38,10 +38,8 @@ export type RawSequenceDefV8 = { maxValue: bigint | undefined; allocated: bigint; }; -export default RawSequenceDefV8; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawSequenceDefV8 = { /** @@ -92,3 +90,5 @@ export const RawSequenceDefV8 = { ); }, }; + +export default RawSequenceDefV8; diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts index d5ca6ba41d8..b8fbac27fea 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts @@ -37,10 +37,8 @@ export type RawSequenceDefV9 = { maxValue: bigint | undefined; increment: bigint; }; -export default RawSequenceDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawSequenceDefV9 = { /** @@ -95,3 +93,5 @@ export const RawSequenceDefV9 = { ); }, }; + +export default RawSequenceDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts index abbe4d8174f..814744d7a32 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts @@ -43,10 +43,8 @@ export type RawTableDefV8 = { tableAccess: string; scheduled: string | undefined; }; -export default RawTableDefV8; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawTableDefV8 = { /** @@ -108,3 +106,5 @@ export const RawTableDefV8 = { ); }, }; + +export default RawTableDefV8; diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts index 6c6b51691f4..a127ae31b8b 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts @@ -46,10 +46,8 @@ export type RawTableDefV9 = { tableType: TableType; tableAccess: TableAccess; }; -export default RawTableDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawTableDefV9 = { /** @@ -116,3 +114,5 @@ export const RawTableDefV9 = { ); }, }; + +export default RawTableDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts index c7be9476ba3..fdc5f278b67 100644 --- a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts @@ -35,10 +35,8 @@ export type RawTypeDefV9 = { ty: number; customOrdering: boolean; }; -export default RawTypeDefV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawTypeDefV9 = { /** @@ -73,3 +71,5 @@ export const RawTypeDefV9 = { ); }, }; + +export default RawTypeDefV9; diff --git a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts index 15d463a4855..4ab42566279 100644 --- a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts @@ -32,10 +32,8 @@ import { export type RawUniqueConstraintDataV9 = { columns: number[]; }; -export default RawUniqueConstraintDataV9; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RawUniqueConstraintDataV9 = { /** @@ -68,3 +66,5 @@ export const RawUniqueConstraintDataV9 = { ); }, }; + +export default RawUniqueConstraintDataV9; diff --git a/crates/bindings-typescript/src/autogen/reducer_def_type.ts b/crates/bindings-typescript/src/autogen/reducer_def_type.ts index 416194f456a..da704043732 100644 --- a/crates/bindings-typescript/src/autogen/reducer_def_type.ts +++ b/crates/bindings-typescript/src/autogen/reducer_def_type.ts @@ -34,10 +34,8 @@ export type ReducerDef = { name: string; args: ProductTypeElement[]; }; -export default ReducerDef; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const ReducerDef = { /** @@ -73,3 +71,5 @@ export const ReducerDef = { ); }, }; + +export default ReducerDef; diff --git a/crates/bindings-typescript/src/autogen/sum_type_type.ts b/crates/bindings-typescript/src/autogen/sum_type_type.ts index 663efb1c95c..12d3cb9294f 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_type.ts @@ -33,10 +33,8 @@ import { SumTypeVariant } from './sum_type_variant_type'; export type SumType = { variants: SumTypeVariant[]; }; -export default SumType; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const SumType = { /** @@ -71,3 +69,5 @@ export const SumType = { ); }, }; + +export default SumType; diff --git a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts index 22b8410359a..6d1cf358856 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -34,10 +34,8 @@ export type SumTypeVariant = { name: string | undefined; algebraicType: AlgebraicType; }; -export default SumTypeVariant; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const SumTypeVariant = { /** @@ -76,3 +74,5 @@ export const SumTypeVariant = { ); }, }; + +export default SumTypeVariant; diff --git a/crates/bindings-typescript/src/autogen/table_desc_type.ts b/crates/bindings-typescript/src/autogen/table_desc_type.ts index 7b528a2325d..475c6b994c5 100644 --- a/crates/bindings-typescript/src/autogen/table_desc_type.ts +++ b/crates/bindings-typescript/src/autogen/table_desc_type.ts @@ -34,10 +34,8 @@ export type TableDesc = { schema: RawTableDefV8; data: number; }; -export default TableDesc; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const TableDesc = { /** @@ -71,3 +69,5 @@ export const TableDesc = { ); }, }; + +export default TableDesc; diff --git a/crates/bindings-typescript/src/autogen/type_alias_type.ts b/crates/bindings-typescript/src/autogen/type_alias_type.ts index faf70f250e3..edc738850a5 100644 --- a/crates/bindings-typescript/src/autogen/type_alias_type.ts +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -33,10 +33,8 @@ export type TypeAlias = { name: string; ty: number; }; -export default TypeAlias; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const TypeAlias = { /** @@ -67,3 +65,5 @@ export const TypeAlias = { ); }, }; + +export default TypeAlias; diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts index f15ca74bf2a..43b9ee016d1 100644 --- a/crates/bindings-typescript/src/autogen/typespace_type.ts +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -33,10 +33,8 @@ import { AlgebraicType } from './algebraic_type_type'; export type Typespace = { types: AlgebraicType[]; }; -export default Typespace; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Typespace = { /** @@ -71,3 +69,5 @@ export const Typespace = { ); }, }; + +export default Typespace; diff --git a/crates/bindings-typescript/src/server/server/reducers.ts b/crates/bindings-typescript/src/server/server/reducers.ts new file mode 100644 index 00000000000..f79a193c05a --- /dev/null +++ b/crates/bindings-typescript/src/server/server/reducers.ts @@ -0,0 +1,50 @@ +// import { +// clientConnected, +// clientDisconnected, +// init, +// player, +// point, +// procedure, +// reducer, +// sendMessageSchedule, +// user, +// type Schema, +// } from './schema'; + +// export const sendMessage = reducer( +// 'send_message', +// sendMessageSchedule, +// (ctx, { scheduleId, scheduledAt, text }) => { +// console.log(`Sending message: ${text} ${scheduleId}`); +// } +// ); + +// init('init', {}, ctx => { +// console.log('Database initialized'); +// }); + +// clientConnected('on_connect', {}, ctx => { +// console.log('Client connected'); +// }); + +// clientDisconnected('on_disconnect', {}, ctx => { +// console.log('Client disconnected'); +// }); + +// reducer( +// 'move_player', +// { user, foo: point, player }, +// (ctx: ReducerCtx, user, foo, player): void => { +// if (player.baz.tag === 'Foo') { +// player.baz.value += 1; +// } else if (player.baz.tag === 'Bar') { +// player.baz.value += 2; +// } else if (player.baz.tag === 'Baz') { +// player.baz.value += '!'; +// } +// } +// ); + +// procedure('get_user', { user }, async (ctx, { user }) => { +// console.log(user.email); +// }); diff --git a/crates/bindings-typescript/src/server/server/schema.ts b/crates/bindings-typescript/src/server/server/schema.ts new file mode 100644 index 00000000000..ebe03e3fac9 --- /dev/null +++ b/crates/bindings-typescript/src/server/server/schema.ts @@ -0,0 +1,684 @@ +// import { +// AlgebraicType, +// ProductType, +// ProductTypeElement, +// } from '../algebraic_type'; +// import type RawConstraintDefV9 from '../autogen/raw_constraint_def_v_9_type'; +// import RawIndexAlgorithm from '../autogen/raw_index_algorithm_type'; +// import type RawIndexDefV9 from '../autogen/raw_index_def_v_9_type'; +// import { RawModuleDefV9 } from "../autogen/raw_module_def_v_9_type"; +// import type RawReducerDefV9 from '../autogen/raw_reducer_def_v_9_type'; +// import type RawSequenceDefV9 from '../autogen/raw_sequence_def_v_9_type'; +// import Lifecycle from '../autogen/lifecycle_type'; +// import ScheduleAt from '../schedule_at'; +// import RawTableDefV9 from '../autogen/raw_table_def_v_9_type'; +// import type Typespace from '../autogen/typespace_type'; +// import type { ColumnBuilder } from './type_builders'; +// import t from "./type_builders"; + +// type AlgebraicTypeRef = number; +// type ColId = number; +// type ColList = ColId[]; + +// /***************************************************************** +// * shared helpers +// *****************************************************************/ +// type Merge = M1 & Omit; +// type Values = T[keyof T]; + +// /***************************************************************** +// * the run‑time catalogue that we are filling +// *****************************************************************/ +// export const MODULE_DEF: RawModuleDefV9 = { +// typespace: { types: [] }, +// tables: [], +// reducers: [], +// types: [], +// miscExports: [], +// rowLevelSecurity: [], +// }; + +// /***************************************************************** +// * Type helpers +// *****************************************************************/ +// type ColumnType = C extends ColumnBuilder ? JS : never; +// export type Infer = S extends ColumnBuilder ? JS : never; + +// /***************************************************************** +// * Index helper type used *inside* table() to enforce that only +// * existing column names are referenced. +// *****************************************************************/ +// type PendingIndex = { +// name?: string; +// accessor_name?: string; +// algorithm: +// | { tag: 'BTree'; value: { columns: readonly AllowedCol[] } } +// | { tag: 'Hash'; value: { columns: readonly AllowedCol[] } } +// | { tag: 'Direct'; value: { column: AllowedCol } }; +// }; + +// /***************************************************************** +// * table() +// *****************************************************************/ +// type TableOpts< +// N extends string, +// Def extends Record>, +// Idx extends PendingIndex[] | undefined = undefined, +// > = { +// name: N; +// public?: boolean; +// indexes?: Idx; // declarative multi‑column indexes +// scheduled?: string; // reducer name for cron‑like tables +// }; + +// /***************************************************************** +// * Branded types for better IDE navigation +// *****************************************************************/ + +// // Create unique symbols for each table to enable better IDE navigation +// declare const TABLE_BRAND: unique symbol; +// declare const SCHEMA_BRAND: unique symbol; + +// /***************************************************************** +// * Opaque handle that `table()` returns, now remembers the NAME literal +// *****************************************************************/ + +// // Helper types for extracting info from table handles +// type RowOf = H extends TableHandle ? R : never; +// type NameOf = H extends TableHandle ? N : never; + +// /***************************************************************** +// * table() – unchanged behavior, but return typed Name on the handle +// *****************************************************************/ +// /** +// * Defines a database table with schema and options +// * @param opts - Table configuration including name, indexes, and access control +// * @param row - Product type defining the table's row structure +// * @returns Table handle for use in schema() function +// * @example +// * ```ts +// * const playerTable = table( +// * { name: 'player', public: true }, +// * t.object({ +// * id: t.u32().primary_key(), +// * name: t.string().index('btree') +// * }) +// * ); +// * ``` +// */ +// export function table< +// const TableName extends string, +// Row extends Record>, +// Idx extends PendingIndex[] | undefined = undefined, +// >(opts: TableOpts, row: Row): TableHandle> { +// const { +// name, +// public: isPublic = false, +// indexes: userIndexes = [], +// scheduled, +// } = opts; + +// /** 1. column catalogue + helpers */ +// const def = row.__def__; +// const colIds = new Map(); +// const colIdList: ColList = []; + +// let nextCol: number = 0; +// for (const colName of Object.keys(def) as (keyof Row & string)[]) { +// colIds.set(colName, nextCol++); +// colIdList.push(colIds.get(colName)!); +// } + +// /** 2. gather primary keys, per‑column indexes, uniques, sequences */ +// const pk: ColList = []; +// const indexes: RawIndexDefV9[] = []; +// const constraints: RawConstraintDefV9[] = []; +// const sequences: RawSequenceDefV9[] = []; + +// let scheduleAtCol: ColId | undefined; + +// for (const [name, builder] of Object.entries(def) as [ +// keyof Row & string, +// ColumnBuilder, +// ][]) { +// const meta: any = builder.__meta__; + +// /* primary key */ +// if (meta.primaryKey) pk.push(colIds.get(name)!); + +// /* implicit 1‑column indexes */ +// if (meta.index) { +// const algo = (meta.index ?? 'btree') as 'BTree' | 'Hash' | 'Direct'; +// const id = colIds.get(name)!; +// indexes.push( +// algo === 'Direct' +// ? { name: "TODO", accessorName: "TODO", algorithm: RawIndexAlgorithm.Direct(id) } +// : { name: "TODO", accessorName: "TODO", algorithm: { tag: algo, value: [id] } } +// ); +// } + +// /* uniqueness */ +// if (meta.unique) { +// constraints.push({ +// name: "TODO", +// data: { tag: 'Unique', value: { columns: [colIds.get(name)!] } }, +// }); +// } + +// /* auto increment */ +// if (meta.autoInc) { +// sequences.push({ +// name: "TODO", +// start: 0n, // TODO +// minValue: 0n, // TODO +// maxValue: 0n, // TODO +// column: colIds.get(name)!, +// increment: 1n, +// }); +// } + +// /* scheduleAt */ +// if (meta.scheduleAt) scheduleAtCol = colIds.get(name)!; +// } + +// /** 3. convert explicit multi‑column indexes coming from options.indexes */ +// for (const pending of (userIndexes ?? []) as PendingIndex< +// keyof Row & string +// >[]) { +// const converted: RawIndexDefV9 = { +// name: pending.name, +// accessorName: pending.accessor_name, +// algorithm: ((): RawIndexAlgorithm => { +// if (pending.algorithm.tag === 'Direct') +// return { +// tag: 'Direct', +// value: colIds.get(pending.algorithm.value.column)!, +// }; +// return { +// tag: pending.algorithm.tag, +// value: pending.algorithm.value.columns.map(c => colIds.get(c)!), +// }; +// })(), +// }; +// indexes.push(converted); +// } + +// /** 4. add the product type to the global Typespace */ +// const productTypeRef: AlgebraicTypeRef = MODULE_DEF.typespace.types.length; +// MODULE_DEF.typespace.types.push(row.__spacetime_type__); + +// /** 5. finalise table record */ +// const tableDef: RawTableDefV9 = { +// name, +// productTypeRef, +// primaryKey: pk, +// indexes, +// constraints, +// sequences, +// schedule: +// scheduled && scheduleAtCol !== undefined +// ? { +// name: "TODO", +// reducerName: scheduled, +// scheduledAtColumn: scheduleAtCol, +// } +// : undefined, +// tableType: { tag: 'User' }, +// tableAccess: { tag: isPublic ? 'Public' : 'Private' }, +// }; +// MODULE_DEF.tables.push(tableDef); + +// return { +// __table_name__: name as TableName, +// __row_type__: {} as Infer, +// __row_spacetime_type__: row.__spacetime_type__, +// } as TableHandle>; +// } + +// /***************************************************************** +// * schema() – Fixed to properly infer table names and row types +// *****************************************************************/ + +// /***************************************************************** +// * reducer() +// *****************************************************************/ +// type ParamsAsObject>> = { +// [K in keyof ParamDef]: Infer; +// }; + +// /***************************************************************** +// * procedure() +// * +// * Stored procedures are opaque to the DB engine itself, so we just +// * keep them out of `RawModuleDefV9` for now – you can forward‑declare +// * a companion `RawMiscModuleExportV9` type later if desired. +// *****************************************************************/ +// export function procedure< +// Name extends string, +// Params extends Record>, +// Ctx, +// R, +// >( +// _name: Name, +// _params: Params, +// _fn: (ctx: Ctx, payload: ParamsAsObject) => Promise | R +// ): void { +// /* nothing to push yet — left for your misc export section */ +// } + +// /***************************************************************** +// * internal: pushReducer() helper used by reducer() and lifecycle wrappers +// *****************************************************************/ +// function pushReducer< +// S, +// Name extends string = string, +// Params extends Record> = Record< +// string, +// ColumnBuilder +// >, +// >( +// name: Name, +// params: Params | ProductTypeColumnBuilder, +// lifecycle?: RawReducerDefV9['lifecycle'] +// ): void { +// // Allow either a product-type ColumnBuilder or a plain params object +// const paramsInternal: Params = +// (params as any).__is_product_type__ === true +// ? (params as ProductTypeColumnBuilder).__def__ +// : (params as Params); + +// const paramType = { +// elements: Object.entries(paramsInternal).map( +// ([n, c]) => +// ({ name: n, algebraicType: (c as ColumnBuilder).__spacetime_type__ }) +// ) +// }; + +// MODULE_DEF.reducers.push({ +// name, +// params: paramType, +// lifecycle, // <- lifecycle flag lands here +// }); +// } + +// /***************************************************************** +// * reducer() – leave behavior the same; delegate to pushReducer() +// *****************************************************************/ + +// /***************************************************************** +// * Lifecycle reducers +// * - register with lifecycle: 'init' | 'on_connect' | 'on_disconnect' +// * - keep the same call shape you're already using +// *****************************************************************/ +// export function init< +// S extends Record = any, +// Params extends Record> = {}, +// >( +// name: 'init' = 'init', +// params: Params | ProductTypeColumnBuilder = {} as any, +// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void +// ): void { +// pushReducer(name, params, Lifecycle.Init); +// } + +// export function clientConnected< +// S extends Record = any, +// Params extends Record> = {}, +// >( +// name: 'on_connect' = 'on_connect', +// params: Params | ProductTypeColumnBuilder = {} as any, +// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void +// ): void { +// pushReducer(name, params, Lifecycle.OnConnect); +// } + +// export function clientDisconnected< +// S extends Record = any, +// Params extends Record> = {}, +// >( +// name: 'on_disconnect' = 'on_disconnect', +// params: Params | ProductTypeColumnBuilder = {} as any, +// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void +// ): void { +// pushReducer(name, params, Lifecycle.OnDisconnect); +// } + +// /***************************************************************** +// * Example usage with explicit interfaces for better navigation +// *****************************************************************/ +// const point = t.object({ +// x: t.f64(), +// y: t.f64(), +// }); +// type Point = Infer; + +// const user = { +// id: t.string().primaryKey(), +// name: t.string().index('btree'), +// email: t.string(), +// age: t.number(), +// }; +// type User = Infer; + +// const player = { +// id: t.u32().primaryKey().autoInc(), +// name: t.string().index('btree'), +// score: t.number(), +// level: t.number(), +// foo: t.number().unique(), +// bar: t.object({ +// x: t.f64(), +// y: t.f64(), +// }), +// baz: t.enum({ +// Foo: t.f64(), +// Bar: t.f64(), +// Baz: t.string(), +// }), +// }; + +// const sendMessageSchedule = t.object({ +// scheduleId: t.u64().primaryKey(), +// scheduledAt: t.scheduleAt(), +// text: t.string(), +// }); + +// // Create the schema with named references +// const s = schema( +// table({ +// name: 'player', +// public: true, +// indexes: [ +// t.index({ name: 'my_index' }).btree({ columns: ['name', 'score'] }), +// ], +// }, player), +// table({ name: 'logged_out_user' }, user), +// table({ name: 'user' }, user), +// table({ +// name: 'send_message_schedule', +// scheduled: 'move_player', +// }, sendMessageSchedule) +// ); + +// // Export explicit type alias for the schema +// export type Schemar = InferSchema; + +// const foo = reducer('move_player', { user, point, player }, (ctx, { user, point, player }) => { +// ctx.db.send_message_schedule.insert({ +// scheduleId: 1, +// scheduledAt: ScheduleAt.Interval(234_000n), +// text: 'Move player' +// }); + +// ctx.db.player.insert(player); + +// if (player.baz.tag === 'Foo') { +// player.baz.value += 1; +// } else if (player.baz.tag === 'Bar') { +// player.baz.value += 2; +// } else if (player.baz.tag === 'Baz') { +// player.baz.value += '!'; +// } +// }); + +// const bar = reducer('foobar', {}, (ctx) => { +// bar(ctx, {}); +// }) + +// init('init', {}, (_ctx) => { + +// }) + +// // Result like Rust +// export type Result = +// | { ok: true; value: T } +// | { ok: false; error: E }; + +// // /* ───── generic index‑builder to be used in table options ───── */ +// // index(opts?: { +// // name?: IdxName; +// // }): { +// // btree(def: { +// // columns: Cols; +// // }): PendingIndex<(typeof def.columns)[number]>; +// // hash(def: { +// // columns: Cols; +// // }): PendingIndex<(typeof def.columns)[number]>; +// // direct(def: { column: Col }): PendingIndex; +// // } { +// // const common = { name: opts?.name }; +// // return { +// // btree(def: { columns: Cols }) { +// // return { +// // ...common, +// // algorithm: { +// // tag: 'BTree', +// // value: { columns: def.columns }, +// // }, +// // } as PendingIndex<(typeof def.columns)[number]>; +// // }, +// // hash(def: { columns: Cols }) { +// // return { +// // ...common, +// // algorithm: { +// // tag: 'Hash', +// // value: { columns: def.columns }, +// // }, +// // } as PendingIndex<(typeof def.columns)[number]>; +// // }, +// // direct(def: { column: Col }) { +// // return { +// // ...common, +// // algorithm: { +// // tag: 'Direct', +// // value: { column: def.column }, +// // }, +// // } as PendingIndex; +// // }, +// // }; +// // }, + +// // type TableOpts< +// // N extends string, +// // Def extends Record>, +// // Idx extends PendingIndex[] | undefined = undefined, +// // > = { +// // name: N; +// // public?: boolean; +// // indexes?: Idx; // declarative multi‑column indexes +// // scheduled?: string; // reducer name for cron‑like tables +// // }; + +// // export function table< +// // const Name extends string, +// // Def extends Record>, +// // Row extends ProductTypeColumnBuilder, +// // Idx extends PendingIndex[] | undefined = undefined, +// // >(opts: TableOpts, row: Row): TableHandle, Name> { + +// // /** +// // * Creates a schema from table definitions +// // * @param handles - Array of table handles created by table() function +// // * @returns ColumnBuilder representing the complete database schema +// // * @example +// // * ```ts +// // * const s = schema( +// // * table({ name: 'users' }, userTable), +// // * table({ name: 'posts' }, postTable) +// // * ); +// // * ``` +// // */ +// // export function schema< +// // const H extends readonly TableHandle[] +// // >(...handles: H): ColumnBuilder> & { +// // /** @internal - for IDE navigation to schema variable */ +// // readonly __schema_definition__?: never; +// // }; + +// // /** +// // * Creates a schema from table definitions (array overload) +// // * @param handles - Array of table handles created by table() function +// // * @returns ColumnBuilder representing the complete database schema +// // */ +// // export function schema< +// // const H extends readonly TableHandle[] +// // >(handles: H): ColumnBuilder> & { +// // /** @internal - for IDE navigation to schema variable */ +// // readonly __schema_definition__?: never; +// // }; + +// // export function schema(...args: any[]): ColumnBuilder { +// // const handles = +// // (args.length === 1 && Array.isArray(args[0]) ? args[0] : args) as TableHandle[]; + +// // const productTy = AlgebraicType.Product({ +// // elements: handles.map(h => ({ +// // name: h.__table_name__, +// // algebraicType: h.__row_spacetime_type__, +// // })), +// // }); + +// // return col(productTy); +// // } + +// type UntypedTablesTuple = TableHandle[]; +// function schema(...tablesTuple: TablesTuple): Schema { +// return { +// tables: tablesTuple +// } +// } + +// type UntypedSchemaDef = { +// typespace: Typespace, +// tables: [RawTableDefV9], +// } + +// type Schema = { +// tables: Tables, +// } + +// type TableHandle = { +// readonly __table_name__: TableName; +// readonly __row_type__: Row; +// readonly __row_spacetime_type__: AlgebraicType; +// }; + +// type InferSchema = SchemaDef extends Schema ? Tables : never; + +// /** +// * Reducer context parametrized by the inferred Schema +// */ +// export type ReducerCtx = { +// db: DbView; +// }; + +// type DbView = { +// [K in keyof SchemaDef]: Table> +// }; + +// // schema provided -> ctx.db is precise +// export function reducer< +// S extends Record, +// Name extends string = string, +// Params extends Record> = Record< +// string, +// ColumnBuilder +// >, +// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void, +// >(name: Name, params: Params | ProductTypeColumnBuilder, fn: F): F; + +// // no schema provided -> ctx.db is permissive +// export function reducer< +// Name extends string = string, +// Params extends Record> = Record< +// string, +// ColumnBuilder +// >, +// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void, +// >(name: Name, params: Params | ProductTypeColumnBuilder, fn: F): F; + +// // single implementation (S defaults to any -> JS-like) +// export function reducer< +// S extends Record = any, +// Name extends string = string, +// Params extends Record> = Record< +// string, +// ColumnBuilder +// >, +// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void, +// >(name: Name, params: Params | ProductTypeColumnBuilder, fn: F): F { +// pushReducer(name, params); +// return fn; +// } + +// // export type Infer = S extends ColumnBuilder ? JS : never; + +// // Create interfaces for each table to enable better navigation +// type TableHandleTupleToObject[]> = +// T extends readonly [TableHandle, ...infer Rest] +// ? Rest extends readonly TableHandle[] +// ? { [K in N1]: R1 } & TableHandleTupleToObject +// : { [K in N1]: R1 } +// : {}; + +// // Alternative approach - direct tuple iteration with interfaces +// type TupleToSchema[]> = TableHandleTupleToObject; + +// type TableNamesInSchemaDef = +// keyof SchemaDef & string; + +// type TableByName< +// SchemaDef extends UntypedSchemaDef, +// TableName extends TableNamesInSchemaDef, +// > = SchemaDef[TableName]; + +// type RowFromTable = +// TableDef["row"]; + +// /** +// * Reducer context parametrized by the inferred Schema +// */ +// type ReducerContext = { +// db: DbView; +// }; + +// type AnyTable = Table; +// type AnySchema = Record; + +// type Outer = { + +// } + +// type ReducerBuilder = { + +// } + +// type Local = {}; + +// /** +// * Table +// * +// * - Row: row shape +// * - UCV: unique-constraint violation error type (never if none) +// * - AIO: auto-increment overflow error type (never if none) +// */ +// export type Table = { +// /** Returns the number of rows in the TX state. */ +// count(): number; + +// /** Iterate over all rows in the TX state. Rust IteratorIterator → TS Iterable. */ +// iter(): IterableIterator; + +// /** Insert and return the inserted row (auto-increment fields filled). May throw on error. */ +// insert(row: Row): Row; + +// /** Like insert, but returns a Result instead of throwing. */ +// try_insert(row: Row): Result; + +// /** Delete a row equal to `row`. Returns true if something was deleted. */ +// delete(row: Row): boolean; +// }; + +// type DbContext> = { +// db: DbView, +// }; diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index 9e26a9f68c0..d2d6e2f0c18 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -746,14 +746,10 @@ fn define_body_for_product( writeln!(out, "}};"); } - writeln!(out, "export default {name};"); - - out.newline(); - writeln!( out, "/** - * A namespace for generated helper functions. + * An object for generated helper functions. */" ); writeln!(out, "export const {name} = {{"); @@ -785,6 +781,10 @@ fn define_body_for_product( writeln!(out, "}}"); out.newline(); + + writeln!(out, "export default {name};"); + + out.newline(); } fn write_arglist_no_delimiters( @@ -965,6 +965,8 @@ fn define_body_for_sum( out.newline(); writeln!(out, "export default {name};"); + + out.newline(); } fn type_ref_module_name(module: &ModuleDef, type_ref: AlgebraicTypeRef) -> String { diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts index 6cf78b69c46..bb04f3176b9 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts @@ -30,10 +30,8 @@ import { } from '@clockworklabs/spacetimedb-sdk'; export type IdentityConnected = {}; -export default IdentityConnected; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const IdentityConnected = { /** @@ -61,3 +59,5 @@ export const IdentityConnected = { ); }, }; + +export default IdentityConnected; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts index 7ac34ae01a5..1ef486ec8d4 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts @@ -30,10 +30,8 @@ import { } from '@clockworklabs/spacetimedb-sdk'; export type IdentityDisconnected = {}; -export default IdentityDisconnected; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const IdentityDisconnected = { /** @@ -61,3 +59,5 @@ export const IdentityDisconnected = { ); }, }; + +export default IdentityDisconnected; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts index 3aed4096306..5b279400d42 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts @@ -34,10 +34,8 @@ export type Message = { sent: __Timestamp; text: string; }; -export default Message; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Message = { /** @@ -75,3 +73,5 @@ export const Message = { ); }, }; + +export default Message; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts index 0ac75971f28..9127abe5d24 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts @@ -32,10 +32,8 @@ import { export type SendMessage = { text: string; }; -export default SendMessage; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const SendMessage = { /** @@ -63,3 +61,5 @@ export const SendMessage = { ); }, }; + +export default SendMessage; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts index 127d26cb276..34e3b35c33f 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts @@ -32,10 +32,8 @@ import { export type SetName = { name: string; }; -export default SetName; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const SetName = { /** @@ -63,3 +61,5 @@ export const SetName = { ); }, }; + +export default SetName; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts index 37ff6d2c802..8d0d503921c 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts @@ -34,10 +34,8 @@ export type User = { name: string | undefined; online: boolean; }; -export default User; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const User = { /** @@ -77,3 +75,5 @@ export const User = { ); }, }; + +export default User; diff --git a/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts b/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts index 2c48b17e593..27e7dec5bd9 100644 --- a/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts @@ -1,80 +1,76 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RowSizeHint as __RowSizeHint } from './row_size_hint_type'; +import { RowSizeHint } from './row_size_hint_type'; export type BsatnRowList = { - sizeHint: __RowSizeHint; + sizeHint: RowSizeHint; rowsData: Uint8Array; }; -export default BsatnRowList; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace BsatnRowList { +export const BsatnRowList = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'sizeHint', - algebraicType: __RowSizeHint.getTypeScriptAlgebraicType(), + algebraicType: RowSizeHint.getTypeScriptAlgebraicType(), }, { name: 'rowsData', - algebraicType: AlgebraicType.Array(AlgebraicType.U8), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: BsatnRowList): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: BsatnRowList): void { + __AlgebraicTypeValue.serializeValue( writer, BsatnRowList.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): BsatnRowList { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): BsatnRowList { + return __AlgebraicTypeValue.deserializeValue( reader, BsatnRowList.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default BsatnRowList; diff --git a/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts b/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts index 6c07a33c979..60b80f0af2b 100644 --- a/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts @@ -1,76 +1,76 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type CallReducer = { reducer: string; args: Uint8Array; requestId: number; flags: number; }; -export default CallReducer; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace CallReducer { +export const CallReducer = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'reducer', algebraicType: AlgebraicType.String }, - { name: 'args', algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, - { name: 'requestId', algebraicType: AlgebraicType.U32 }, - { name: 'flags', algebraicType: AlgebraicType.U8 }, + { name: 'reducer', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'args', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'flags', algebraicType: __AlgebraicTypeValue.U8 }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: CallReducer): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: CallReducer): void { + __AlgebraicTypeValue.serializeValue( writer, CallReducer.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): CallReducer { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): CallReducer { + return __AlgebraicTypeValue.deserializeValue( reader, CallReducer.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default CallReducer; diff --git a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts index b6cd4a723ea..f219c9993ca 100644 --- a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts @@ -1,166 +1,136 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { CallReducer as __CallReducer } from './call_reducer_type'; -import { Subscribe as __Subscribe } from './subscribe_type'; -import { OneOffQuery as __OneOffQuery } from './one_off_query_type'; -import { SubscribeSingle as __SubscribeSingle } from './subscribe_single_type'; -import { SubscribeMulti as __SubscribeMulti } from './subscribe_multi_type'; -import { Unsubscribe as __Unsubscribe } from './unsubscribe_type'; -import { UnsubscribeMulti as __UnsubscribeMulti } from './unsubscribe_multi_type'; +import { CallReducer } from './call_reducer_type'; +import { Subscribe } from './subscribe_type'; +import { OneOffQuery } from './one_off_query_type'; +import { SubscribeSingle } from './subscribe_single_type'; +import { SubscribeMulti } from './subscribe_multi_type'; +import { Unsubscribe } from './unsubscribe_type'; +import { UnsubscribeMulti } from './unsubscribe_multi_type'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace ClientMessageVariants { - export type CallReducer = { tag: 'CallReducer'; value: __CallReducer }; - export type Subscribe = { tag: 'Subscribe'; value: __Subscribe }; - export type OneOffQuery = { tag: 'OneOffQuery'; value: __OneOffQuery }; - export type SubscribeSingle = { - tag: 'SubscribeSingle'; - value: __SubscribeSingle; - }; - export type SubscribeMulti = { - tag: 'SubscribeMulti'; - value: __SubscribeMulti; - }; - export type Unsubscribe = { tag: 'Unsubscribe'; value: __Unsubscribe }; - export type UnsubscribeMulti = { - tag: 'UnsubscribeMulti'; - value: __UnsubscribeMulti; - }; -} +import * as ClientMessageVariants from './client_message_variants'; -// A namespace for generated variants and helper functions. -export namespace ClientMessage { +// The tagged union or sum type for the algebraic type `ClientMessage`. +export type ClientMessage = + | ClientMessageVariants.CallReducer + | ClientMessageVariants.Subscribe + | ClientMessageVariants.OneOffQuery + | ClientMessageVariants.SubscribeSingle + | ClientMessageVariants.SubscribeMulti + | ClientMessageVariants.Unsubscribe + | ClientMessageVariants.UnsubscribeMulti; + +// A value with helper functions to construct the type. +export const ClientMessage = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const CallReducer = (value: __CallReducer): ClientMessage => ({ + CallReducer: (value: CallReducer): ClientMessage => ({ tag: 'CallReducer', value, - }); - export const Subscribe = (value: __Subscribe): ClientMessage => ({ - tag: 'Subscribe', - value, - }); - export const OneOffQuery = (value: __OneOffQuery): ClientMessage => ({ + }), + Subscribe: (value: Subscribe): ClientMessage => ({ tag: 'Subscribe', value }), + OneOffQuery: (value: OneOffQuery): ClientMessage => ({ tag: 'OneOffQuery', value, - }); - export const SubscribeSingle = (value: __SubscribeSingle): ClientMessage => ({ + }), + SubscribeSingle: (value: SubscribeSingle): ClientMessage => ({ tag: 'SubscribeSingle', value, - }); - export const SubscribeMulti = (value: __SubscribeMulti): ClientMessage => ({ + }), + SubscribeMulti: (value: SubscribeMulti): ClientMessage => ({ tag: 'SubscribeMulti', value, - }); - export const Unsubscribe = (value: __Unsubscribe): ClientMessage => ({ + }), + Unsubscribe: (value: Unsubscribe): ClientMessage => ({ tag: 'Unsubscribe', value, - }); - export const UnsubscribeMulti = ( - value: __UnsubscribeMulti - ): ClientMessage => ({ tag: 'UnsubscribeMulti', value }); + }), + UnsubscribeMulti: (value: UnsubscribeMulti): ClientMessage => ({ + tag: 'UnsubscribeMulti', + value, + }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'CallReducer', - algebraicType: __CallReducer.getTypeScriptAlgebraicType(), + algebraicType: CallReducer.getTypeScriptAlgebraicType(), }, { name: 'Subscribe', - algebraicType: __Subscribe.getTypeScriptAlgebraicType(), + algebraicType: Subscribe.getTypeScriptAlgebraicType(), }, { name: 'OneOffQuery', - algebraicType: __OneOffQuery.getTypeScriptAlgebraicType(), + algebraicType: OneOffQuery.getTypeScriptAlgebraicType(), }, { name: 'SubscribeSingle', - algebraicType: __SubscribeSingle.getTypeScriptAlgebraicType(), + algebraicType: SubscribeSingle.getTypeScriptAlgebraicType(), }, { name: 'SubscribeMulti', - algebraicType: __SubscribeMulti.getTypeScriptAlgebraicType(), + algebraicType: SubscribeMulti.getTypeScriptAlgebraicType(), }, { name: 'Unsubscribe', - algebraicType: __Unsubscribe.getTypeScriptAlgebraicType(), + algebraicType: Unsubscribe.getTypeScriptAlgebraicType(), }, { name: 'UnsubscribeMulti', - algebraicType: __UnsubscribeMulti.getTypeScriptAlgebraicType(), + algebraicType: UnsubscribeMulti.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: ClientMessage): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: ClientMessage): void { + __AlgebraicTypeValue.serializeValue( writer, ClientMessage.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): ClientMessage { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): ClientMessage { + return __AlgebraicTypeValue.deserializeValue( reader, ClientMessage.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `ClientMessage`. -export type ClientMessage = - | ClientMessageVariants.CallReducer - | ClientMessageVariants.Subscribe - | ClientMessageVariants.OneOffQuery - | ClientMessageVariants.SubscribeSingle - | ClientMessageVariants.SubscribeMulti - | ClientMessageVariants.Unsubscribe - | ClientMessageVariants.UnsubscribeMulti; + }, +}; export default ClientMessage; diff --git a/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts b/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts new file mode 100644 index 00000000000..73e1ff9e711 --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { CallReducer } from './call_reducer_type'; +import { Subscribe } from './subscribe_type'; +import { OneOffQuery } from './one_off_query_type'; +import { SubscribeSingle } from './subscribe_single_type'; +import { SubscribeMulti } from './subscribe_multi_type'; +import { Unsubscribe } from './unsubscribe_type'; +import { UnsubscribeMulti } from './unsubscribe_multi_type'; + +import ClientMessage from './client_message_type'; + +export type CallReducer = { tag: 'CallReducer'; value: CallReducer }; +export type Subscribe = { tag: 'Subscribe'; value: Subscribe }; +export type OneOffQuery = { tag: 'OneOffQuery'; value: OneOffQuery }; +export type SubscribeSingle = { + tag: 'SubscribeSingle'; + value: SubscribeSingle; +}; +export type SubscribeMulti = { tag: 'SubscribeMulti'; value: SubscribeMulti }; +export type Unsubscribe = { tag: 'Unsubscribe'; value: Unsubscribe }; +export type UnsubscribeMulti = { + tag: 'UnsubscribeMulti'; + value: UnsubscribeMulti; +}; diff --git a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts index 2f95beb9f4b..840142d7c75 100644 --- a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts @@ -1,111 +1,97 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryUpdate as __QueryUpdate } from './query_update_type'; +import { QueryUpdate } from './query_update_type'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace CompressableQueryUpdateVariants { - export type Uncompressed = { tag: 'Uncompressed'; value: __QueryUpdate }; - export type Brotli = { tag: 'Brotli'; value: Uint8Array }; - export type Gzip = { tag: 'Gzip'; value: Uint8Array }; -} +import * as CompressableQueryUpdateVariants from './compressable_query_update_variants'; -// A namespace for generated variants and helper functions. -export namespace CompressableQueryUpdate { +// The tagged union or sum type for the algebraic type `CompressableQueryUpdate`. +export type CompressableQueryUpdate = + | CompressableQueryUpdateVariants.Uncompressed + | CompressableQueryUpdateVariants.Brotli + | CompressableQueryUpdateVariants.Gzip; + +// A value with helper functions to construct the type. +export const CompressableQueryUpdate = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Uncompressed = ( - value: __QueryUpdate - ): CompressableQueryUpdate => ({ tag: 'Uncompressed', value }); - export const Brotli = (value: Uint8Array): CompressableQueryUpdate => ({ + Uncompressed: (value: QueryUpdate): CompressableQueryUpdate => ({ + tag: 'Uncompressed', + value, + }), + Brotli: (value: Uint8Array): CompressableQueryUpdate => ({ tag: 'Brotli', value, - }); - export const Gzip = (value: Uint8Array): CompressableQueryUpdate => ({ + }), + Gzip: (value: Uint8Array): CompressableQueryUpdate => ({ tag: 'Gzip', value, - }); + }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'Uncompressed', - algebraicType: __QueryUpdate.getTypeScriptAlgebraicType(), + algebraicType: QueryUpdate.getTypeScriptAlgebraicType(), }, { name: 'Brotli', - algebraicType: AlgebraicType.Array(AlgebraicType.U8), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + { + name: 'Gzip', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), }, - { name: 'Gzip', algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: CompressableQueryUpdate - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: CompressableQueryUpdate): void { + __AlgebraicTypeValue.serializeValue( writer, CompressableQueryUpdate.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): CompressableQueryUpdate { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): CompressableQueryUpdate { + return __AlgebraicTypeValue.deserializeValue( reader, CompressableQueryUpdate.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `CompressableQueryUpdate`. -export type CompressableQueryUpdate = - | CompressableQueryUpdateVariants.Uncompressed - | CompressableQueryUpdateVariants.Brotli - | CompressableQueryUpdateVariants.Gzip; + }, +}; export default CompressableQueryUpdate; diff --git a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts new file mode 100644 index 00000000000..69f826b5089 --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts @@ -0,0 +1,37 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { QueryUpdate } from './query_update_type'; + +import CompressableQueryUpdate from './compressable_query_update_type'; + +export type Uncompressed = { tag: 'Uncompressed'; value: QueryUpdate }; +export type Brotli = { tag: 'Brotli'; value: Uint8Array }; +export type Gzip = { tag: 'Gzip'; value: Uint8Array }; diff --git a/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts index 8d51a2c4030..f27ce5c6502 100644 --- a/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts @@ -1,77 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { TableUpdate as __TableUpdate } from './table_update_type'; +import { TableUpdate } from './table_update_type'; export type DatabaseUpdate = { - tables: __TableUpdate[]; + tables: TableUpdate[]; }; -export default DatabaseUpdate; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace DatabaseUpdate { +export const DatabaseUpdate = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'tables', - algebraicType: AlgebraicType.Array( - __TableUpdate.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + TableUpdate.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: DatabaseUpdate): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: DatabaseUpdate): void { + __AlgebraicTypeValue.serializeValue( writer, DatabaseUpdate.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): DatabaseUpdate { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): DatabaseUpdate { + return __AlgebraicTypeValue.deserializeValue( reader, DatabaseUpdate.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default DatabaseUpdate; diff --git a/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts b/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts index c04a663ff9e..88560f3a3c3 100644 --- a/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts @@ -1,68 +1,65 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type EnergyQuanta = { quanta: bigint; }; -export default EnergyQuanta; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace EnergyQuanta { +export const EnergyQuanta = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ - elements: [{ name: 'quanta', algebraicType: AlgebraicType.U128 }], + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [{ name: 'quanta', algebraicType: __AlgebraicTypeValue.U128 }], }); - } + }, - export function serialize(writer: BinaryWriter, value: EnergyQuanta): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: EnergyQuanta): void { + __AlgebraicTypeValue.serializeValue( writer, EnergyQuanta.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): EnergyQuanta { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): EnergyQuanta { + return __AlgebraicTypeValue.deserializeValue( reader, EnergyQuanta.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default EnergyQuanta; diff --git a/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts b/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts index bf59fc0820b..8137f7b7a01 100644 --- a/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts @@ -1,77 +1,77 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type IdentityToken = { - identity: Identity; + identity: __Identity; token: string; - connectionId: ConnectionId; + connectionId: __ConnectionId; }; -export default IdentityToken; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace IdentityToken { +export const IdentityToken = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'identity', algebraicType: AlgebraicType.createIdentityType() }, - { name: 'token', algebraicType: AlgebraicType.String }, + { + name: 'identity', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { name: 'token', algebraicType: __AlgebraicTypeValue.String }, { name: 'connectionId', - algebraicType: AlgebraicType.createConnectionIdType(), + algebraicType: __AlgebraicTypeValue.createConnectionIdType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: IdentityToken): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: IdentityToken): void { + __AlgebraicTypeValue.serializeValue( writer, IdentityToken.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): IdentityToken { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): IdentityToken { + return __AlgebraicTypeValue.deserializeValue( reader, IdentityToken.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default IdentityToken; diff --git a/sdks/typescript/packages/sdk/src/client_api/index.ts b/sdks/typescript/packages/sdk/src/client_api/index.ts index 305df328c99..ab9c47b919c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/index.ts +++ b/sdks/typescript/packages/sdk/src/client_api/index.ts @@ -1,36 +1,32 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; // Import and reexport all reducer arg types @@ -105,7 +101,7 @@ const REMOTE_MODULE = { tables: {}, reducers: {}, versionInfo: { - cliVersion: '1.3.0', + cliVersion: '1.3.2', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. @@ -114,17 +110,20 @@ const REMOTE_MODULE = { // all we do is build a TypeScript object which we could have done inside the // SDK, but if in the future we wanted to create a class this would be // necessary because classes have methods, so we'll keep it. - eventContextConstructor: (imp: DbConnectionImpl, event: Event) => { + eventContextConstructor: ( + imp: __DbConnectionImpl, + event: __Event + ) => { return { ...(imp as DbConnection), event, }; }, - dbViewConstructor: (imp: DbConnectionImpl) => { + dbViewConstructor: (imp: __DbConnectionImpl) => { return new RemoteTables(imp); }, reducersConstructor: ( - imp: DbConnectionImpl, + imp: __DbConnectionImpl, setReducerFlags: SetReducerFlags ) => { return new RemoteReducers(imp, setReducerFlags); @@ -139,62 +138,62 @@ export type Reducer = never; export class RemoteReducers { constructor( - private connection: DbConnectionImpl, - private setCallReducerFlags: SetReducerFlags + private connection: __DbConnectionImpl, + private setCallReducerFlags: __SetReducerFlags ) {} } export class SetReducerFlags {} export class RemoteTables { - constructor(private connection: DbConnectionImpl) {} + constructor(private connection: __DbConnectionImpl) {} } -export class SubscriptionBuilder extends SubscriptionBuilderImpl< +export class SubscriptionBuilder extends __SubscriptionBuilderImpl< RemoteTables, RemoteReducers, SetReducerFlags > {} -export class DbConnection extends DbConnectionImpl< +export class DbConnection extends __DbConnectionImpl< RemoteTables, RemoteReducers, SetReducerFlags > { - static builder = (): DbConnectionBuilder< + static builder = (): __DbConnectionBuilder< DbConnection, ErrorContext, SubscriptionEventContext > => { - return new DbConnectionBuilder< + return new __DbConnectionBuilder< DbConnection, ErrorContext, SubscriptionEventContext - >(REMOTE_MODULE, (imp: DbConnectionImpl) => imp as DbConnection); + >(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); }; subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); }; } -export type EventContext = EventContextInterface< +export type EventContext = __EventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags, Reducer >; -export type ReducerEventContext = ReducerEventContextInterface< +export type ReducerEventContext = __ReducerEventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags, Reducer >; -export type SubscriptionEventContext = SubscriptionEventContextInterface< +export type SubscriptionEventContext = __SubscriptionEventContextInterface< RemoteTables, RemoteReducers, SetReducerFlags >; -export type ErrorContext = ErrorContextInterface< +export type ErrorContext = __ErrorContextInterface< RemoteTables, RemoteReducers, SetReducerFlags diff --git a/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts b/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts index 55dff1b7aae..4f25b976bf8 100644 --- a/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts @@ -1,85 +1,78 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; +import { DatabaseUpdate } from './database_update_type'; export type InitialSubscription = { - databaseUpdate: __DatabaseUpdate; + databaseUpdate: DatabaseUpdate; requestId: number; - totalHostExecutionDuration: TimeDuration; + totalHostExecutionDuration: __TimeDuration; }; -export default InitialSubscription; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace InitialSubscription { +export const InitialSubscription = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'databaseUpdate', - algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), }, - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'totalHostExecutionDuration', - algebraicType: AlgebraicType.createTimeDurationType(), + algebraicType: __AlgebraicTypeValue.createTimeDurationType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: InitialSubscription - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: InitialSubscription): void { + __AlgebraicTypeValue.serializeValue( writer, InitialSubscription.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): InitialSubscription { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): InitialSubscription { + return __AlgebraicTypeValue.deserializeValue( reader, InitialSubscription.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default InitialSubscription; diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts index 26ae0054216..e3f72df78da 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts @@ -1,95 +1,90 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { OneOffTable as __OneOffTable } from './one_off_table_type'; +import { OneOffTable } from './one_off_table_type'; export type OneOffQueryResponse = { messageId: Uint8Array; error: string | undefined; - tables: __OneOffTable[]; - totalHostExecutionDuration: TimeDuration; + tables: OneOffTable[]; + totalHostExecutionDuration: __TimeDuration; }; -export default OneOffQueryResponse; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace OneOffQueryResponse { +export const OneOffQueryResponse = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'messageId', - algebraicType: AlgebraicType.Array(AlgebraicType.U8), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), }, { name: 'error', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), }, { name: 'tables', - algebraicType: AlgebraicType.Array( - __OneOffTable.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + OneOffTable.getTypeScriptAlgebraicType() ), }, { name: 'totalHostExecutionDuration', - algebraicType: AlgebraicType.createTimeDurationType(), + algebraicType: __AlgebraicTypeValue.createTimeDurationType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: OneOffQueryResponse - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: OneOffQueryResponse): void { + __AlgebraicTypeValue.serializeValue( writer, OneOffQueryResponse.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): OneOffQueryResponse { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): OneOffQueryResponse { + return __AlgebraicTypeValue.deserializeValue( reader, OneOffQueryResponse.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default OneOffQueryResponse; diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts index 3cb8c62e029..b32cf566443 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts @@ -1,75 +1,72 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type OneOffQuery = { messageId: Uint8Array; queryString: string; }; -export default OneOffQuery; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace OneOffQuery { +export const OneOffQuery = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'messageId', - algebraicType: AlgebraicType.Array(AlgebraicType.U8), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), }, - { name: 'queryString', algebraicType: AlgebraicType.String }, + { name: 'queryString', algebraicType: __AlgebraicTypeValue.String }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: OneOffQuery): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: OneOffQuery): void { + __AlgebraicTypeValue.serializeValue( writer, OneOffQuery.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): OneOffQuery { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): OneOffQuery { + return __AlgebraicTypeValue.deserializeValue( reader, OneOffQuery.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default OneOffQuery; diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts index 68f0fdc10b5..ff9454dc85d 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts @@ -1,77 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { BsatnRowList as __BsatnRowList } from './bsatn_row_list_type'; +import { BsatnRowList } from './bsatn_row_list_type'; export type OneOffTable = { tableName: string; - rows: __BsatnRowList; + rows: BsatnRowList; }; -export default OneOffTable; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace OneOffTable { +export const OneOffTable = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'tableName', algebraicType: AlgebraicType.String }, + { name: 'tableName', algebraicType: __AlgebraicTypeValue.String }, { name: 'rows', - algebraicType: __BsatnRowList.getTypeScriptAlgebraicType(), + algebraicType: BsatnRowList.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: OneOffTable): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: OneOffTable): void { + __AlgebraicTypeValue.serializeValue( writer, OneOffTable.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): OneOffTable { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): OneOffTable { + return __AlgebraicTypeValue.deserializeValue( reader, OneOffTable.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default OneOffTable; diff --git a/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts b/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts index 4d0d371863c..32ab5fcf28c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts @@ -1,68 +1,65 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type QueryId = { id: number; }; -export default QueryId; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace QueryId { +export const QueryId = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ - elements: [{ name: 'id', algebraicType: AlgebraicType.U32 }], + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [{ name: 'id', algebraicType: __AlgebraicTypeValue.U32 }], }); - } + }, - export function serialize(writer: BinaryWriter, value: QueryId): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: QueryId): void { + __AlgebraicTypeValue.serializeValue( writer, QueryId.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): QueryId { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): QueryId { + return __AlgebraicTypeValue.deserializeValue( reader, QueryId.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default QueryId; diff --git a/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts index 4497d057ca0..9a91b909009 100644 --- a/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts @@ -1,80 +1,76 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { BsatnRowList as __BsatnRowList } from './bsatn_row_list_type'; +import { BsatnRowList } from './bsatn_row_list_type'; export type QueryUpdate = { - deletes: __BsatnRowList; - inserts: __BsatnRowList; + deletes: BsatnRowList; + inserts: BsatnRowList; }; -export default QueryUpdate; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace QueryUpdate { +export const QueryUpdate = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'deletes', - algebraicType: __BsatnRowList.getTypeScriptAlgebraicType(), + algebraicType: BsatnRowList.getTypeScriptAlgebraicType(), }, { name: 'inserts', - algebraicType: __BsatnRowList.getTypeScriptAlgebraicType(), + algebraicType: BsatnRowList.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: QueryUpdate): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: QueryUpdate): void { + __AlgebraicTypeValue.serializeValue( writer, QueryUpdate.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): QueryUpdate { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): QueryUpdate { + return __AlgebraicTypeValue.deserializeValue( reader, QueryUpdate.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default QueryUpdate; diff --git a/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts b/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts index 45bf4438012..2507139cec3 100644 --- a/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts @@ -1,79 +1,76 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type ReducerCallInfo = { reducerName: string; reducerId: number; args: Uint8Array; requestId: number; }; -export default ReducerCallInfo; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace ReducerCallInfo { +export const ReducerCallInfo = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'reducerName', algebraicType: AlgebraicType.String }, - { name: 'reducerId', algebraicType: AlgebraicType.U32 }, - { name: 'args', algebraicType: AlgebraicType.Array(AlgebraicType.U8) }, - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'reducerName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'reducerId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'args', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: ReducerCallInfo - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: ReducerCallInfo): void { + __AlgebraicTypeValue.serializeValue( writer, ReducerCallInfo.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): ReducerCallInfo { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): ReducerCallInfo { + return __AlgebraicTypeValue.deserializeValue( reader, ReducerCallInfo.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default ReducerCallInfo; diff --git a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts index 58dcd762a74..30ccfd1ed9b 100644 --- a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts @@ -1,97 +1,77 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace RowSizeHintVariants { - export type FixedSize = { tag: 'FixedSize'; value: number }; - export type RowOffsets = { tag: 'RowOffsets'; value: bigint[] }; -} +import * as RowSizeHintVariants from './row_size_hint_variants'; -// A namespace for generated variants and helper functions. -export namespace RowSizeHint { +// The tagged union or sum type for the algebraic type `RowSizeHint`. +export type RowSizeHint = + | RowSizeHintVariants.FixedSize + | RowSizeHintVariants.RowOffsets; + +// A value with helper functions to construct the type. +export const RowSizeHint = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const FixedSize = (value: number): RowSizeHint => ({ - tag: 'FixedSize', - value, - }); - export const RowOffsets = (value: bigint[]): RowSizeHint => ({ - tag: 'RowOffsets', - value, - }); + FixedSize: (value: number): RowSizeHint => ({ tag: 'FixedSize', value }), + RowOffsets: (value: bigint[]): RowSizeHint => ({ tag: 'RowOffsets', value }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ - { name: 'FixedSize', algebraicType: AlgebraicType.U16 }, + { name: 'FixedSize', algebraicType: __AlgebraicTypeValue.U16 }, { name: 'RowOffsets', - algebraicType: AlgebraicType.Array(AlgebraicType.U64), + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U64), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: RowSizeHint): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: RowSizeHint): void { + __AlgebraicTypeValue.serializeValue( writer, RowSizeHint.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): RowSizeHint { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): RowSizeHint { + return __AlgebraicTypeValue.deserializeValue( reader, RowSizeHint.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `RowSizeHint`. -export type RowSizeHint = - | RowSizeHintVariants.FixedSize - | RowSizeHintVariants.RowOffsets; + }, +}; export default RowSizeHint; diff --git a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts new file mode 100644 index 00000000000..cbccd65fd1d --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts @@ -0,0 +1,34 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import RowSizeHint from './row_size_hint_type'; + +export type FixedSize = { tag: 'FixedSize'; value: number }; +export type RowOffsets = { tag: 'RowOffsets'; value: bigint[] }; diff --git a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts index ae5cacc361d..09c21779f31 100644 --- a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts @@ -1,209 +1,169 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { InitialSubscription as __InitialSubscription } from './initial_subscription_type'; -import { TransactionUpdate as __TransactionUpdate } from './transaction_update_type'; -import { TransactionUpdateLight as __TransactionUpdateLight } from './transaction_update_light_type'; -import { IdentityToken as __IdentityToken } from './identity_token_type'; -import { OneOffQueryResponse as __OneOffQueryResponse } from './one_off_query_response_type'; -import { SubscribeApplied as __SubscribeApplied } from './subscribe_applied_type'; -import { UnsubscribeApplied as __UnsubscribeApplied } from './unsubscribe_applied_type'; -import { SubscriptionError as __SubscriptionError } from './subscription_error_type'; -import { SubscribeMultiApplied as __SubscribeMultiApplied } from './subscribe_multi_applied_type'; -import { UnsubscribeMultiApplied as __UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type'; +import { InitialSubscription } from './initial_subscription_type'; +import { TransactionUpdate } from './transaction_update_type'; +import { TransactionUpdateLight } from './transaction_update_light_type'; +import { IdentityToken } from './identity_token_type'; +import { OneOffQueryResponse } from './one_off_query_response_type'; +import { SubscribeApplied } from './subscribe_applied_type'; +import { UnsubscribeApplied } from './unsubscribe_applied_type'; +import { SubscriptionError } from './subscription_error_type'; +import { SubscribeMultiApplied } from './subscribe_multi_applied_type'; +import { UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace ServerMessageVariants { - export type InitialSubscription = { - tag: 'InitialSubscription'; - value: __InitialSubscription; - }; - export type TransactionUpdate = { - tag: 'TransactionUpdate'; - value: __TransactionUpdate; - }; - export type TransactionUpdateLight = { - tag: 'TransactionUpdateLight'; - value: __TransactionUpdateLight; - }; - export type IdentityToken = { tag: 'IdentityToken'; value: __IdentityToken }; - export type OneOffQueryResponse = { - tag: 'OneOffQueryResponse'; - value: __OneOffQueryResponse; - }; - export type SubscribeApplied = { - tag: 'SubscribeApplied'; - value: __SubscribeApplied; - }; - export type UnsubscribeApplied = { - tag: 'UnsubscribeApplied'; - value: __UnsubscribeApplied; - }; - export type SubscriptionError = { - tag: 'SubscriptionError'; - value: __SubscriptionError; - }; - export type SubscribeMultiApplied = { - tag: 'SubscribeMultiApplied'; - value: __SubscribeMultiApplied; - }; - export type UnsubscribeMultiApplied = { - tag: 'UnsubscribeMultiApplied'; - value: __UnsubscribeMultiApplied; - }; -} +import * as ServerMessageVariants from './server_message_variants'; -// A namespace for generated variants and helper functions. -export namespace ServerMessage { +// The tagged union or sum type for the algebraic type `ServerMessage`. +export type ServerMessage = + | ServerMessageVariants.InitialSubscription + | ServerMessageVariants.TransactionUpdate + | ServerMessageVariants.TransactionUpdateLight + | ServerMessageVariants.IdentityToken + | ServerMessageVariants.OneOffQueryResponse + | ServerMessageVariants.SubscribeApplied + | ServerMessageVariants.UnsubscribeApplied + | ServerMessageVariants.SubscriptionError + | ServerMessageVariants.SubscribeMultiApplied + | ServerMessageVariants.UnsubscribeMultiApplied; + +// A value with helper functions to construct the type. +export const ServerMessage = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const InitialSubscription = ( - value: __InitialSubscription - ): ServerMessage => ({ tag: 'InitialSubscription', value }); - export const TransactionUpdate = ( - value: __TransactionUpdate - ): ServerMessage => ({ tag: 'TransactionUpdate', value }); - export const TransactionUpdateLight = ( - value: __TransactionUpdateLight - ): ServerMessage => ({ tag: 'TransactionUpdateLight', value }); - export const IdentityToken = (value: __IdentityToken): ServerMessage => ({ + InitialSubscription: (value: InitialSubscription): ServerMessage => ({ + tag: 'InitialSubscription', + value, + }), + TransactionUpdate: (value: TransactionUpdate): ServerMessage => ({ + tag: 'TransactionUpdate', + value, + }), + TransactionUpdateLight: (value: TransactionUpdateLight): ServerMessage => ({ + tag: 'TransactionUpdateLight', + value, + }), + IdentityToken: (value: IdentityToken): ServerMessage => ({ tag: 'IdentityToken', value, - }); - export const OneOffQueryResponse = ( - value: __OneOffQueryResponse - ): ServerMessage => ({ tag: 'OneOffQueryResponse', value }); - export const SubscribeApplied = ( - value: __SubscribeApplied - ): ServerMessage => ({ tag: 'SubscribeApplied', value }); - export const UnsubscribeApplied = ( - value: __UnsubscribeApplied - ): ServerMessage => ({ tag: 'UnsubscribeApplied', value }); - export const SubscriptionError = ( - value: __SubscriptionError - ): ServerMessage => ({ tag: 'SubscriptionError', value }); - export const SubscribeMultiApplied = ( - value: __SubscribeMultiApplied - ): ServerMessage => ({ tag: 'SubscribeMultiApplied', value }); - export const UnsubscribeMultiApplied = ( - value: __UnsubscribeMultiApplied - ): ServerMessage => ({ tag: 'UnsubscribeMultiApplied', value }); + }), + OneOffQueryResponse: (value: OneOffQueryResponse): ServerMessage => ({ + tag: 'OneOffQueryResponse', + value, + }), + SubscribeApplied: (value: SubscribeApplied): ServerMessage => ({ + tag: 'SubscribeApplied', + value, + }), + UnsubscribeApplied: (value: UnsubscribeApplied): ServerMessage => ({ + tag: 'UnsubscribeApplied', + value, + }), + SubscriptionError: (value: SubscriptionError): ServerMessage => ({ + tag: 'SubscriptionError', + value, + }), + SubscribeMultiApplied: (value: SubscribeMultiApplied): ServerMessage => ({ + tag: 'SubscribeMultiApplied', + value, + }), + UnsubscribeMultiApplied: (value: UnsubscribeMultiApplied): ServerMessage => ({ + tag: 'UnsubscribeMultiApplied', + value, + }), - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'InitialSubscription', - algebraicType: __InitialSubscription.getTypeScriptAlgebraicType(), + algebraicType: InitialSubscription.getTypeScriptAlgebraicType(), }, { name: 'TransactionUpdate', - algebraicType: __TransactionUpdate.getTypeScriptAlgebraicType(), + algebraicType: TransactionUpdate.getTypeScriptAlgebraicType(), }, { name: 'TransactionUpdateLight', - algebraicType: __TransactionUpdateLight.getTypeScriptAlgebraicType(), + algebraicType: TransactionUpdateLight.getTypeScriptAlgebraicType(), }, { name: 'IdentityToken', - algebraicType: __IdentityToken.getTypeScriptAlgebraicType(), + algebraicType: IdentityToken.getTypeScriptAlgebraicType(), }, { name: 'OneOffQueryResponse', - algebraicType: __OneOffQueryResponse.getTypeScriptAlgebraicType(), + algebraicType: OneOffQueryResponse.getTypeScriptAlgebraicType(), }, { name: 'SubscribeApplied', - algebraicType: __SubscribeApplied.getTypeScriptAlgebraicType(), + algebraicType: SubscribeApplied.getTypeScriptAlgebraicType(), }, { name: 'UnsubscribeApplied', - algebraicType: __UnsubscribeApplied.getTypeScriptAlgebraicType(), + algebraicType: UnsubscribeApplied.getTypeScriptAlgebraicType(), }, { name: 'SubscriptionError', - algebraicType: __SubscriptionError.getTypeScriptAlgebraicType(), + algebraicType: SubscriptionError.getTypeScriptAlgebraicType(), }, { name: 'SubscribeMultiApplied', - algebraicType: __SubscribeMultiApplied.getTypeScriptAlgebraicType(), + algebraicType: SubscribeMultiApplied.getTypeScriptAlgebraicType(), }, { name: 'UnsubscribeMultiApplied', - algebraicType: __UnsubscribeMultiApplied.getTypeScriptAlgebraicType(), + algebraicType: UnsubscribeMultiApplied.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: ServerMessage): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: ServerMessage): void { + __AlgebraicTypeValue.serializeValue( writer, ServerMessage.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): ServerMessage { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): ServerMessage { + return __AlgebraicTypeValue.deserializeValue( reader, ServerMessage.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `ServerMessage`. -export type ServerMessage = - | ServerMessageVariants.InitialSubscription - | ServerMessageVariants.TransactionUpdate - | ServerMessageVariants.TransactionUpdateLight - | ServerMessageVariants.IdentityToken - | ServerMessageVariants.OneOffQueryResponse - | ServerMessageVariants.SubscribeApplied - | ServerMessageVariants.UnsubscribeApplied - | ServerMessageVariants.SubscriptionError - | ServerMessageVariants.SubscribeMultiApplied - | ServerMessageVariants.UnsubscribeMultiApplied; + }, +}; export default ServerMessage; diff --git a/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts b/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts new file mode 100644 index 00000000000..87a97c9832e --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts @@ -0,0 +1,80 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { InitialSubscription } from './initial_subscription_type'; +import { TransactionUpdate } from './transaction_update_type'; +import { TransactionUpdateLight } from './transaction_update_light_type'; +import { IdentityToken } from './identity_token_type'; +import { OneOffQueryResponse } from './one_off_query_response_type'; +import { SubscribeApplied } from './subscribe_applied_type'; +import { UnsubscribeApplied } from './unsubscribe_applied_type'; +import { SubscriptionError } from './subscription_error_type'; +import { SubscribeMultiApplied } from './subscribe_multi_applied_type'; +import { UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type'; + +import ServerMessage from './server_message_type'; + +export type InitialSubscription = { + tag: 'InitialSubscription'; + value: InitialSubscription; +}; +export type TransactionUpdate = { + tag: 'TransactionUpdate'; + value: TransactionUpdate; +}; +export type TransactionUpdateLight = { + tag: 'TransactionUpdateLight'; + value: TransactionUpdateLight; +}; +export type IdentityToken = { tag: 'IdentityToken'; value: IdentityToken }; +export type OneOffQueryResponse = { + tag: 'OneOffQueryResponse'; + value: OneOffQueryResponse; +}; +export type SubscribeApplied = { + tag: 'SubscribeApplied'; + value: SubscribeApplied; +}; +export type UnsubscribeApplied = { + tag: 'UnsubscribeApplied'; + value: UnsubscribeApplied; +}; +export type SubscriptionError = { + tag: 'SubscriptionError'; + value: SubscriptionError; +}; +export type SubscribeMultiApplied = { + tag: 'SubscribeMultiApplied'; + value: SubscribeMultiApplied; +}; +export type UnsubscribeMultiApplied = { + tag: 'UnsubscribeMultiApplied'; + value: UnsubscribeMultiApplied; +}; diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts index d32956f10b2..1445bd80223 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts @@ -1,91 +1,84 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryId as __QueryId } from './query_id_type'; -import { SubscribeRows as __SubscribeRows } from './subscribe_rows_type'; +import { QueryId } from './query_id_type'; +import { SubscribeRows } from './subscribe_rows_type'; export type SubscribeApplied = { requestId: number; totalHostExecutionDurationMicros: bigint; - queryId: __QueryId; - rows: __SubscribeRows; + queryId: QueryId; + rows: SubscribeRows; }; -export default SubscribeApplied; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace SubscribeApplied { +export const SubscribeApplied = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'totalHostExecutionDurationMicros', - algebraicType: AlgebraicType.U64, + algebraicType: __AlgebraicTypeValue.U64, }, { name: 'queryId', - algebraicType: __QueryId.getTypeScriptAlgebraicType(), + algebraicType: QueryId.getTypeScriptAlgebraicType(), }, { name: 'rows', - algebraicType: __SubscribeRows.getTypeScriptAlgebraicType(), + algebraicType: SubscribeRows.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: SubscribeApplied - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: SubscribeApplied): void { + __AlgebraicTypeValue.serializeValue( writer, SubscribeApplied.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): SubscribeApplied { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): SubscribeApplied { + return __AlgebraicTypeValue.deserializeValue( reader, SubscribeApplied.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default SubscribeApplied; diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts index 1d19ffcb9a7..3f05af12d12 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts @@ -1,91 +1,84 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryId as __QueryId } from './query_id_type'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; +import { QueryId } from './query_id_type'; +import { DatabaseUpdate } from './database_update_type'; export type SubscribeMultiApplied = { requestId: number; totalHostExecutionDurationMicros: bigint; - queryId: __QueryId; - update: __DatabaseUpdate; + queryId: QueryId; + update: DatabaseUpdate; }; -export default SubscribeMultiApplied; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace SubscribeMultiApplied { +export const SubscribeMultiApplied = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'totalHostExecutionDurationMicros', - algebraicType: AlgebraicType.U64, + algebraicType: __AlgebraicTypeValue.U64, }, { name: 'queryId', - algebraicType: __QueryId.getTypeScriptAlgebraicType(), + algebraicType: QueryId.getTypeScriptAlgebraicType(), }, { name: 'update', - algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: SubscribeMultiApplied - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: SubscribeMultiApplied): void { + __AlgebraicTypeValue.serializeValue( writer, SubscribeMultiApplied.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): SubscribeMultiApplied { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): SubscribeMultiApplied { + return __AlgebraicTypeValue.deserializeValue( reader, SubscribeMultiApplied.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default SubscribeMultiApplied; diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts index dc2650d8c8e..3ec276b24c8 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts @@ -1,82 +1,80 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryId as __QueryId } from './query_id_type'; +import { QueryId } from './query_id_type'; export type SubscribeMulti = { queryStrings: string[]; requestId: number; - queryId: __QueryId; + queryId: QueryId; }; -export default SubscribeMulti; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace SubscribeMulti { +export const SubscribeMulti = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'queryStrings', - algebraicType: AlgebraicType.Array(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.Array( + __AlgebraicTypeValue.String + ), }, - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'queryId', - algebraicType: __QueryId.getTypeScriptAlgebraicType(), + algebraicType: QueryId.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: SubscribeMulti): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: SubscribeMulti): void { + __AlgebraicTypeValue.serializeValue( writer, SubscribeMulti.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): SubscribeMulti { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): SubscribeMulti { + return __AlgebraicTypeValue.deserializeValue( reader, SubscribeMulti.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default SubscribeMulti; diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts index 4367f37460f..f6d80e7ae70 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts @@ -1,79 +1,75 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { TableUpdate as __TableUpdate } from './table_update_type'; +import { TableUpdate } from './table_update_type'; export type SubscribeRows = { tableId: number; tableName: string; - tableRows: __TableUpdate; + tableRows: TableUpdate; }; -export default SubscribeRows; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace SubscribeRows { +export const SubscribeRows = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'tableId', algebraicType: AlgebraicType.U32 }, - { name: 'tableName', algebraicType: AlgebraicType.String }, + { name: 'tableId', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'tableName', algebraicType: __AlgebraicTypeValue.String }, { name: 'tableRows', - algebraicType: __TableUpdate.getTypeScriptAlgebraicType(), + algebraicType: TableUpdate.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: SubscribeRows): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: SubscribeRows): void { + __AlgebraicTypeValue.serializeValue( writer, SubscribeRows.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): SubscribeRows { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): SubscribeRows { + return __AlgebraicTypeValue.deserializeValue( reader, SubscribeRows.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default SubscribeRows; diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts index 777b7009eb2..d3252f853e2 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts @@ -1,82 +1,75 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryId as __QueryId } from './query_id_type'; +import { QueryId } from './query_id_type'; export type SubscribeSingle = { query: string; requestId: number; - queryId: __QueryId; + queryId: QueryId; }; -export default SubscribeSingle; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace SubscribeSingle { +export const SubscribeSingle = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'query', algebraicType: AlgebraicType.String }, - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'query', algebraicType: __AlgebraicTypeValue.String }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'queryId', - algebraicType: __QueryId.getTypeScriptAlgebraicType(), + algebraicType: QueryId.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: SubscribeSingle - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: SubscribeSingle): void { + __AlgebraicTypeValue.serializeValue( writer, SubscribeSingle.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): SubscribeSingle { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): SubscribeSingle { + return __AlgebraicTypeValue.deserializeValue( reader, SubscribeSingle.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default SubscribeSingle; diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts index a04d7037dd3..febcfa425b5 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts @@ -1,75 +1,74 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type Subscribe = { queryStrings: string[]; requestId: number; }; -export default Subscribe; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace Subscribe { +export const Subscribe = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'queryStrings', - algebraicType: AlgebraicType.Array(AlgebraicType.String), + algebraicType: __AlgebraicTypeValue.Array( + __AlgebraicTypeValue.String + ), }, - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: Subscribe): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: Subscribe): void { + __AlgebraicTypeValue.serializeValue( writer, Subscribe.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): Subscribe { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): Subscribe { + return __AlgebraicTypeValue.deserializeValue( reader, Subscribe.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default Subscribe; diff --git a/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts index ea475a522eb..b73eee4aade 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts @@ -1,37 +1,34 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; + export type SubscriptionError = { totalHostExecutionDurationMicros: bigint; requestId: number | undefined; @@ -39,55 +36,58 @@ export type SubscriptionError = { tableId: number | undefined; error: string; }; -export default SubscriptionError; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace SubscriptionError { +export const SubscriptionError = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'totalHostExecutionDurationMicros', - algebraicType: AlgebraicType.U64, + algebraicType: __AlgebraicTypeValue.U64, }, { name: 'requestId', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.U32 + ), }, { name: 'queryId', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.U32 + ), }, { name: 'tableId', - algebraicType: AlgebraicType.createOptionType(AlgebraicType.U32), + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.U32 + ), }, - { name: 'error', algebraicType: AlgebraicType.String }, + { name: 'error', algebraicType: __AlgebraicTypeValue.String }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: SubscriptionError - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: SubscriptionError): void { + __AlgebraicTypeValue.serializeValue( writer, SubscriptionError.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): SubscriptionError { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): SubscriptionError { + return __AlgebraicTypeValue.deserializeValue( reader, SubscriptionError.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default SubscriptionError; diff --git a/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts index 1ec2d86bd7c..8bcc8479232 100644 --- a/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts @@ -1,83 +1,79 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { CompressableQueryUpdate as __CompressableQueryUpdate } from './compressable_query_update_type'; +import { CompressableQueryUpdate } from './compressable_query_update_type'; export type TableUpdate = { tableId: number; tableName: string; numRows: bigint; - updates: __CompressableQueryUpdate[]; + updates: CompressableQueryUpdate[]; }; -export default TableUpdate; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace TableUpdate { +export const TableUpdate = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'tableId', algebraicType: AlgebraicType.U32 }, - { name: 'tableName', algebraicType: AlgebraicType.String }, - { name: 'numRows', algebraicType: AlgebraicType.U64 }, + { name: 'tableId', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'tableName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'numRows', algebraicType: __AlgebraicTypeValue.U64 }, { name: 'updates', - algebraicType: AlgebraicType.Array( - __CompressableQueryUpdate.getTypeScriptAlgebraicType() + algebraicType: __AlgebraicTypeValue.Array( + CompressableQueryUpdate.getTypeScriptAlgebraicType() ), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: TableUpdate): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: TableUpdate): void { + __AlgebraicTypeValue.serializeValue( writer, TableUpdate.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): TableUpdate { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): TableUpdate { + return __AlgebraicTypeValue.deserializeValue( reader, TableUpdate.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default TableUpdate; diff --git a/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts b/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts index bd727980673..7851089370f 100644 --- a/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts @@ -1,80 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; +import { DatabaseUpdate } from './database_update_type'; export type TransactionUpdateLight = { requestId: number; - update: __DatabaseUpdate; + update: DatabaseUpdate; }; -export default TransactionUpdateLight; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace TransactionUpdateLight { +export const TransactionUpdateLight = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'update', - algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: TransactionUpdateLight - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: TransactionUpdateLight): void { + __AlgebraicTypeValue.serializeValue( writer, TransactionUpdateLight.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): TransactionUpdateLight { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): TransactionUpdateLight { + return __AlgebraicTypeValue.deserializeValue( reader, TransactionUpdateLight.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default TransactionUpdateLight; diff --git a/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts index 9c18fe8d771..d497b3c9582 100644 --- a/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts @@ -1,110 +1,103 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { UpdateStatus as __UpdateStatus } from './update_status_type'; -import { ReducerCallInfo as __ReducerCallInfo } from './reducer_call_info_type'; -import { EnergyQuanta as __EnergyQuanta } from './energy_quanta_type'; +import { UpdateStatus } from './update_status_type'; +import { ReducerCallInfo } from './reducer_call_info_type'; +import { EnergyQuanta } from './energy_quanta_type'; export type TransactionUpdate = { - status: __UpdateStatus; - timestamp: Timestamp; - callerIdentity: Identity; - callerConnectionId: ConnectionId; - reducerCall: __ReducerCallInfo; - energyQuantaUsed: __EnergyQuanta; - totalHostExecutionDuration: TimeDuration; + status: UpdateStatus; + timestamp: __Timestamp; + callerIdentity: __Identity; + callerConnectionId: __ConnectionId; + reducerCall: ReducerCallInfo; + energyQuantaUsed: EnergyQuanta; + totalHostExecutionDuration: __TimeDuration; }; -export default TransactionUpdate; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace TransactionUpdate { +export const TransactionUpdate = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ { name: 'status', - algebraicType: __UpdateStatus.getTypeScriptAlgebraicType(), + algebraicType: UpdateStatus.getTypeScriptAlgebraicType(), }, { name: 'timestamp', - algebraicType: AlgebraicType.createTimestampType(), + algebraicType: __AlgebraicTypeValue.createTimestampType(), }, { name: 'callerIdentity', - algebraicType: AlgebraicType.createIdentityType(), + algebraicType: __AlgebraicTypeValue.createIdentityType(), }, { name: 'callerConnectionId', - algebraicType: AlgebraicType.createConnectionIdType(), + algebraicType: __AlgebraicTypeValue.createConnectionIdType(), }, { name: 'reducerCall', - algebraicType: __ReducerCallInfo.getTypeScriptAlgebraicType(), + algebraicType: ReducerCallInfo.getTypeScriptAlgebraicType(), }, { name: 'energyQuantaUsed', - algebraicType: __EnergyQuanta.getTypeScriptAlgebraicType(), + algebraicType: EnergyQuanta.getTypeScriptAlgebraicType(), }, { name: 'totalHostExecutionDuration', - algebraicType: AlgebraicType.createTimeDurationType(), + algebraicType: __AlgebraicTypeValue.createTimeDurationType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: TransactionUpdate - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: TransactionUpdate): void { + __AlgebraicTypeValue.serializeValue( writer, TransactionUpdate.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): TransactionUpdate { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): TransactionUpdate { + return __AlgebraicTypeValue.deserializeValue( reader, TransactionUpdate.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default TransactionUpdate; diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts index 0b78732b851..0954bf347c1 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts @@ -1,91 +1,84 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryId as __QueryId } from './query_id_type'; -import { SubscribeRows as __SubscribeRows } from './subscribe_rows_type'; +import { QueryId } from './query_id_type'; +import { SubscribeRows } from './subscribe_rows_type'; export type UnsubscribeApplied = { requestId: number; totalHostExecutionDurationMicros: bigint; - queryId: __QueryId; - rows: __SubscribeRows; + queryId: QueryId; + rows: SubscribeRows; }; -export default UnsubscribeApplied; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace UnsubscribeApplied { +export const UnsubscribeApplied = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'totalHostExecutionDurationMicros', - algebraicType: AlgebraicType.U64, + algebraicType: __AlgebraicTypeValue.U64, }, { name: 'queryId', - algebraicType: __QueryId.getTypeScriptAlgebraicType(), + algebraicType: QueryId.getTypeScriptAlgebraicType(), }, { name: 'rows', - algebraicType: __SubscribeRows.getTypeScriptAlgebraicType(), + algebraicType: SubscribeRows.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: UnsubscribeApplied - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: UnsubscribeApplied): void { + __AlgebraicTypeValue.serializeValue( writer, UnsubscribeApplied.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): UnsubscribeApplied { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): UnsubscribeApplied { + return __AlgebraicTypeValue.deserializeValue( reader, UnsubscribeApplied.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default UnsubscribeApplied; diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts index fb17896d6fb..1b84117e2a2 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts @@ -1,91 +1,84 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryId as __QueryId } from './query_id_type'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; +import { QueryId } from './query_id_type'; +import { DatabaseUpdate } from './database_update_type'; export type UnsubscribeMultiApplied = { requestId: number; totalHostExecutionDurationMicros: bigint; - queryId: __QueryId; - update: __DatabaseUpdate; + queryId: QueryId; + update: DatabaseUpdate; }; -export default UnsubscribeMultiApplied; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace UnsubscribeMultiApplied { +export const UnsubscribeMultiApplied = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'totalHostExecutionDurationMicros', - algebraicType: AlgebraicType.U64, + algebraicType: __AlgebraicTypeValue.U64, }, { name: 'queryId', - algebraicType: __QueryId.getTypeScriptAlgebraicType(), + algebraicType: QueryId.getTypeScriptAlgebraicType(), }, { name: 'update', - algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: UnsubscribeMultiApplied - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: UnsubscribeMultiApplied): void { + __AlgebraicTypeValue.serializeValue( writer, UnsubscribeMultiApplied.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): UnsubscribeMultiApplied { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): UnsubscribeMultiApplied { + return __AlgebraicTypeValue.deserializeValue( reader, UnsubscribeMultiApplied.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default UnsubscribeMultiApplied; diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts index 69e8d704367..1688ff6a731 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts @@ -1,80 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryId as __QueryId } from './query_id_type'; +import { QueryId } from './query_id_type'; export type UnsubscribeMulti = { requestId: number; - queryId: __QueryId; + queryId: QueryId; }; -export default UnsubscribeMulti; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace UnsubscribeMulti { +export const UnsubscribeMulti = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'queryId', - algebraicType: __QueryId.getTypeScriptAlgebraicType(), + algebraicType: QueryId.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize( - writer: BinaryWriter, - value: UnsubscribeMulti - ): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: UnsubscribeMulti): void { + __AlgebraicTypeValue.serializeValue( writer, UnsubscribeMulti.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): UnsubscribeMulti { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): UnsubscribeMulti { + return __AlgebraicTypeValue.deserializeValue( reader, UnsubscribeMulti.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default UnsubscribeMulti; diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts index a6391629b1c..09f49cab038 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts @@ -1,77 +1,73 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryId as __QueryId } from './query_id_type'; +import { QueryId } from './query_id_type'; export type Unsubscribe = { requestId: number; - queryId: __QueryId; + queryId: QueryId; }; -export default Unsubscribe; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ -export namespace Unsubscribe { +export const Unsubscribe = { /** * A function which returns this type represented as an AlgebraicType. * This function is derived from the AlgebraicType used to generate this type. */ - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Product({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ elements: [ - { name: 'requestId', algebraicType: AlgebraicType.U32 }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, { name: 'queryId', - algebraicType: __QueryId.getTypeScriptAlgebraicType(), + algebraicType: QueryId.getTypeScriptAlgebraicType(), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: Unsubscribe): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: Unsubscribe): void { + __AlgebraicTypeValue.serializeValue( writer, Unsubscribe.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): Unsubscribe { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): Unsubscribe { + return __AlgebraicTypeValue.deserializeValue( reader, Unsubscribe.getTypeScriptAlgebraicType() ); - } -} + }, +}; + +export default Unsubscribe; diff --git a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts index b90f18ea6fa..e52c0c01a5e 100644 --- a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts @@ -1,106 +1,88 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.0 (commit be6130a209e59b047af47123db3be3182ede6d36). +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - Identity, - ProductType, - ProductTypeElement, - SubscriptionBuilderImpl, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, - type CallReducerFlags, - type DbContext, - type ErrorContextInterface, - type Event, - type EventContextInterface, - type ReducerEventContextInterface, - type SubscriptionEventContextInterface, + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { DatabaseUpdate as __DatabaseUpdate } from './database_update_type'; +import { DatabaseUpdate } from './database_update_type'; -// These are the generated variant types for each variant of the tagged union. -// One type is generated per variant and will be used in the `value` field of -// the tagged union. -// NOTE: These are generated in a separate namespace because TypeScript -// interprets `Foo` in the statement `const x: Foo.Variant = ...` as the type `Foo` instead of -// the namespace `Foo` which includes types within it. Therefore we generate the `FooVariants` -// type. e.g. `const x: FooVariants.Variant` -export namespace UpdateStatusVariants { - export type Committed = { tag: 'Committed'; value: __DatabaseUpdate }; - export type Failed = { tag: 'Failed'; value: string }; - export type OutOfEnergy = { tag: 'OutOfEnergy' }; -} +import * as UpdateStatusVariants from './update_status_variants'; -// A namespace for generated variants and helper functions. -export namespace UpdateStatus { +// The tagged union or sum type for the algebraic type `UpdateStatus`. +export type UpdateStatus = + | UpdateStatusVariants.Committed + | UpdateStatusVariants.Failed + | UpdateStatusVariants.OutOfEnergy; + +// A value with helper functions to construct the type. +export const UpdateStatus = { // Helper functions for constructing each variant of the tagged union. // ``` // const foo = Foo.A(42); // assert!(foo.tag === "A"); // assert!(foo.value === 42); // ``` - export const Committed = (value: __DatabaseUpdate): UpdateStatus => ({ + Committed: (value: DatabaseUpdate): UpdateStatus => ({ tag: 'Committed', value, - }); - export const Failed = (value: string): UpdateStatus => ({ - tag: 'Failed', - value, - }); - export const OutOfEnergy: { tag: 'OutOfEnergy' } = { tag: 'OutOfEnergy' }; + }), + Failed: (value: string): UpdateStatus => ({ tag: 'Failed', value }), + OutOfEnergy: { tag: 'OutOfEnergy' } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.Sum({ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ variants: [ { name: 'Committed', - algebraicType: __DatabaseUpdate.getTypeScriptAlgebraicType(), + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), }, - { name: 'Failed', algebraicType: AlgebraicType.String }, + { name: 'Failed', algebraicType: __AlgebraicTypeValue.String }, { name: 'OutOfEnergy', - algebraicType: AlgebraicType.Product({ elements: [] }), + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), }, ], }); - } + }, - export function serialize(writer: BinaryWriter, value: UpdateStatus): void { - AlgebraicType.serializeValue( + serialize(writer: __BinaryWriter, value: UpdateStatus): void { + __AlgebraicTypeValue.serializeValue( writer, UpdateStatus.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): UpdateStatus { - return AlgebraicType.deserializeValue( + deserialize(reader: __BinaryReader): UpdateStatus { + return __AlgebraicTypeValue.deserializeValue( reader, UpdateStatus.getTypeScriptAlgebraicType() ); - } -} - -// The tagged union or sum type for the algebraic type `UpdateStatus`. -export type UpdateStatus = - | UpdateStatusVariants.Committed - | UpdateStatusVariants.Failed - | UpdateStatusVariants.OutOfEnergy; + }, +}; export default UpdateStatus; diff --git a/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts b/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts new file mode 100644 index 00000000000..beadd5d0b51 --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts @@ -0,0 +1,37 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). + +/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +import { + AlgebraicType as __AlgebraicTypeValue, + BinaryReader as __BinaryReader, + BinaryWriter as __BinaryWriter, + ConnectionId as __ConnectionId, + DbConnectionBuilder as __DbConnectionBuilder, + DbConnectionImpl as __DbConnectionImpl, + Identity as __Identity, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + TableCache as __TableCache, + TimeDuration as __TimeDuration, + Timestamp as __Timestamp, + deepEqual as __deepEqual, + type AlgebraicType as __AlgebraicTypeType, + type AlgebraicTypeVariants as __AlgebraicTypeVariants, + type CallReducerFlags as __CallReducerFlags, + type ErrorContextInterface as __ErrorContextInterface, + type Event as __Event, + type EventContextInterface as __EventContextInterface, + type ReducerEventContextInterface as __ReducerEventContextInterface, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, +} from '../index'; +import { DatabaseUpdate } from './database_update_type'; + +import UpdateStatus from './update_status_type'; + +export type Committed = { tag: 'Committed'; value: DatabaseUpdate }; +export type Failed = { tag: 'Failed'; value: string }; +export type OutOfEnergy = { tag: 'OutOfEnergy' }; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts index 1835cb76107..bdee4664a1f 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts @@ -35,10 +35,8 @@ export type CreatePlayer = { name: string; location: Point; }; -export default CreatePlayer; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const CreatePlayer = { /** @@ -69,3 +67,5 @@ export const CreatePlayer = { ); }, }; + +export default CreatePlayer; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts index 43b338f4707..ebfac3b427a 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts @@ -35,10 +35,8 @@ export type Player = { name: string; location: Point; }; -export default Player; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Player = { /** @@ -70,3 +68,5 @@ export const Player = { ); }, }; + +export default Player; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts index 5aa9fc63d9e..27112d36c1d 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts @@ -33,10 +33,8 @@ export type Point = { x: number; y: number; }; -export default Point; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Point = { /** @@ -67,3 +65,5 @@ export const Point = { ); }, }; + +export default Point; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts index 8fab6459446..97800bd2232 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts @@ -35,10 +35,8 @@ export type UnindexedPlayer = { name: string; location: Point; }; -export default UnindexedPlayer; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const UnindexedPlayer = { /** @@ -70,3 +68,5 @@ export const UnindexedPlayer = { ); }, }; + +export default UnindexedPlayer; diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts index b9a80d57bc3..e92ffc6ff4d 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts @@ -33,10 +33,8 @@ export type User = { identity: __Identity; username: string; }; -export default User; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const User = { /** @@ -70,3 +68,5 @@ export const User = { ); }, }; + +export default User; From b2c660210edd68e9ed2c52a318dd9100cc775c3a Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 18:08:06 -0400 Subject: [PATCH 30/37] Fixed variant bindings generation --- .../src/autogen/algebraic_type_variants.ts | 13 +++--- .../src/autogen/index_type_variants.ts | 1 - .../src/autogen/lifecycle_variants.ts | 1 - .../autogen/misc_module_export_variants.ts | 6 +-- .../raw_constraint_data_v_9_variants.ts | 6 +-- .../autogen/raw_index_algorithm_variants.ts | 1 - .../raw_misc_module_export_v_9_variants.ts | 6 +-- .../src/autogen/raw_module_def_variants.ts | 10 ++-- .../src/autogen/table_access_variants.ts | 1 - .../src/autogen/table_type_variants.ts | 1 - crates/codegen/src/typescript.rs | 46 +++++++++++-------- .../src/client_api/client_message_variants.ts | 33 ++++++------- .../compressable_query_update_variants.ts | 6 +-- .../src/client_api/row_size_hint_variants.ts | 1 - .../src/client_api/server_message_variants.ts | 42 ++++++++--------- .../src/client_api/update_status_variants.ts | 6 +-- 16 files changed, 85 insertions(+), 95 deletions(-) diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts index e129b3409c1..b2e37af5a81 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts @@ -28,15 +28,14 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { SumType } from './sum_type_type'; -import { ProductType } from './product_type_type'; - -import AlgebraicType from './algebraic_type_type'; +import { AlgebraicType as AlgebraicTypeType } from './algebraic_type_type'; +import { SumType as SumTypeType } from './sum_type_type'; +import { ProductType as ProductTypeType } from './product_type_type'; export type Ref = { tag: 'Ref'; value: number }; -export type Sum = { tag: 'Sum'; value: SumType }; -export type Product = { tag: 'Product'; value: ProductType }; -export type Array = { tag: 'Array'; value: AlgebraicType }; +export type Sum = { tag: 'Sum'; value: SumTypeType }; +export type Product = { tag: 'Product'; value: ProductTypeType }; +export type Array = { tag: 'Array'; value: AlgebraicTypeType }; export type String = { tag: 'String' }; export type Bool = { tag: 'Bool' }; export type I8 = { tag: 'I8' }; diff --git a/crates/bindings-typescript/src/autogen/index_type_variants.ts b/crates/bindings-typescript/src/autogen/index_type_variants.ts index 6c162812730..8655233a9dc 100644 --- a/crates/bindings-typescript/src/autogen/index_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/index_type_variants.ts @@ -28,7 +28,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import IndexType from './index_type_type'; export type BTree = { tag: 'BTree' }; export type Hash = { tag: 'Hash' }; diff --git a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts index 6c187d3e450..3f525b71a81 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts @@ -28,7 +28,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import Lifecycle from './lifecycle_type'; export type Init = { tag: 'Init' }; export type OnConnect = { tag: 'OnConnect' }; diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts index ceb96dc63cf..c5d64f48050 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts @@ -28,8 +28,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { TypeAlias } from './type_alias_type'; +import { TypeAlias as TypeAliasType } from './type_alias_type'; -import MiscModuleExport from './misc_module_export_type'; - -export type TypeAlias = { tag: 'TypeAlias'; value: TypeAlias }; +export type TypeAlias = { tag: 'TypeAlias'; value: TypeAliasType }; diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts index 8b28829f014..9f4183daae9 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts @@ -28,8 +28,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawUniqueConstraintDataV9 } from './raw_unique_constraint_data_v_9_type'; +import { RawUniqueConstraintDataV9 as RawUniqueConstraintDataV9Type } from './raw_unique_constraint_data_v_9_type'; -import RawConstraintDataV9 from './raw_constraint_data_v_9_type'; - -export type Unique = { tag: 'Unique'; value: RawUniqueConstraintDataV9 }; +export type Unique = { tag: 'Unique'; value: RawUniqueConstraintDataV9Type }; diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts index 395e2c0001e..18f4b36caf3 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts @@ -28,7 +28,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import RawIndexAlgorithm from './raw_index_algorithm_type'; export type BTree = { tag: 'BTree'; value: number[] }; export type Hash = { tag: 'Hash'; value: number[] }; diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts index 0bdfe0759cb..e42936cb3e1 100644 --- a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts @@ -28,11 +28,9 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawColumnDefaultValueV9 } from './raw_column_default_value_v_9_type'; - -import RawMiscModuleExportV9 from './raw_misc_module_export_v_9_type'; +import { RawColumnDefaultValueV9 as RawColumnDefaultValueV9Type } from './raw_column_default_value_v_9_type'; export type ColumnDefaultValue = { tag: 'ColumnDefaultValue'; - value: RawColumnDefaultValueV9; + value: RawColumnDefaultValueV9Type; }; diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts index fc33e088aaf..505a5af4b40 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts @@ -28,10 +28,8 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { RawModuleDefV8 } from './raw_module_def_v_8_type'; -import { RawModuleDefV9 } from './raw_module_def_v_9_type'; +import { RawModuleDefV8 as RawModuleDefV8Type } from './raw_module_def_v_8_type'; +import { RawModuleDefV9 as RawModuleDefV9Type } from './raw_module_def_v_9_type'; -import RawModuleDef from './raw_module_def_type'; - -export type V8BackCompat = { tag: 'V8BackCompat'; value: RawModuleDefV8 }; -export type V9 = { tag: 'V9'; value: RawModuleDefV9 }; +export type V8BackCompat = { tag: 'V8BackCompat'; value: RawModuleDefV8Type }; +export type V9 = { tag: 'V9'; value: RawModuleDefV9Type }; diff --git a/crates/bindings-typescript/src/autogen/table_access_variants.ts b/crates/bindings-typescript/src/autogen/table_access_variants.ts index 20812c7b86a..c7c94bb09b5 100644 --- a/crates/bindings-typescript/src/autogen/table_access_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_access_variants.ts @@ -28,7 +28,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import TableAccess from './table_access_type'; export type Public = { tag: 'Public' }; export type Private = { tag: 'Private' }; diff --git a/crates/bindings-typescript/src/autogen/table_type_variants.ts b/crates/bindings-typescript/src/autogen/table_type_variants.ts index 35dc5ff36f7..8e655f8b985 100644 --- a/crates/bindings-typescript/src/autogen/table_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_type_variants.ts @@ -28,7 +28,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import TableType from './table_type_type'; export type System = { tag: 'System' }; export type User = { tag: 'User' }; diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index d2d6e2f0c18..c84f1946ee4 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -34,7 +34,7 @@ impl Lang for TypeScript { let out = &mut output; print_file_header(out); - gen_and_print_imports(module, out, &product.elements, &[typ.ty]); + gen_and_print_imports(module, out, &product.elements, &[typ.ty], None); writeln!(out); define_body_for_product(module, out, &type_name, &product.elements); out.newline(); @@ -49,9 +49,8 @@ impl Lang for TypeScript { let out = &mut output; print_file_header(out); - gen_and_print_imports(module, out, variants, &[typ.ty]); - // Import the current type in case of recursive sum types - writeln!(out, "import {} from './{}'", type_name, type_module_name(&typ.name)); + // Note that the current type is not included in dont_import below. + gen_and_print_imports(module, out, variants, &[], Some("Type")); writeln!(out); write_variant_types(module, out, variants); out.newline(); @@ -66,7 +65,7 @@ impl Lang for TypeScript { let out = &mut output; print_file_header(out); - gen_and_print_imports(module, out, variants, &[typ.ty]); + gen_and_print_imports(module, out, variants, &[typ.ty], None); writeln!( out, "import * as {}Variants from './{}'", @@ -132,6 +131,7 @@ impl Lang for TypeScript { out, &product_def.elements, &[], // No need to skip any imports; we're not defining a type, so there's no chance of circular imports. + None, ); writeln!( @@ -290,6 +290,7 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) &reducer.params_for_generate.elements, // No need to skip any imports; we're not emitting a type that other modules can import. &[], + None, ); let args_type = reducer_args_type_name(&reducer.name); @@ -501,7 +502,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { arg_name_list += &arg_name; arg_list += &arg_name; arg_list += ": "; - write_type(module, &mut arg_list, arg_ty, None).unwrap(); + write_type(module, &mut arg_list, arg_ty, None, None).unwrap(); arg_list += ", "; arg_name_list += ", "; } @@ -806,7 +807,7 @@ fn write_arglist_no_delimiters( }; write!(out, "{name}: ")?; - write_type(module, out, ty, Some(""))?; + write_type(module, out, ty, None, None)?; writeln!(out, ",")?; } @@ -827,25 +828,25 @@ fn write_sum_variant_type(module: &ModuleDef, out: &mut Indenter, ident: &Identi // If the contained type is not the unit type, write the tag and the value. // ``` - // { tag: "Bar", value: Bar } + // { tag: "Bar", value: BarType } // { tag: "Bar", value: number } // { tag: "Bar", value: string } // ``` // Note you could alternatively do: // ``` - // { tag: "Bar" } & Bar + // { tag: "Bar" } & BarType // ``` // for non-primitive types but that doesn't extend to primitives. // Another alternative would be to name the value field the same as the tag field, but lowercased // ``` - // { tag: "Bar", bar: Bar } + // { tag: "Bar", bar: BarType } // { tag: "Bar", bar: number } // { tag: "Bar", bar: string } // ``` // but this is a departure from our previous convention and is not much different. if !matches!(ty, AlgebraicTypeUse::Unit) { write!(out, ", value: "); - write_type(module, out, ty, Some("")).unwrap(); + write_type(module, out, ty, None, Some("Type")).unwrap(); } writeln!(out, " }};"); @@ -878,7 +879,7 @@ fn write_variant_constructors( } let variant_name = ident.deref().to_case(Case::Pascal); write!(out, "{variant_name}: (value: "); - write_type(module, out, ty, Some("")).unwrap(); + write_type(module, out, ty, None, None).unwrap(); writeln!(out, "): {name} => ({{ tag: \"{variant_name}\", value }}),"); } } @@ -1008,7 +1009,7 @@ fn reducer_function_name(reducer: &ReducerDef) -> String { pub fn type_name(module: &ModuleDef, ty: &AlgebraicTypeUse) -> String { let mut s = String::new(); - write_type(module, &mut s, ty, None).unwrap(); + write_type(module, &mut s, ty, None, None).unwrap(); s } @@ -1040,6 +1041,7 @@ pub fn write_type( out: &mut W, ty: &AlgebraicTypeUse, ref_prefix: Option<&str>, + ref_suffix: Option<&str>, ) -> fmt::Result { match ty { AlgebraicTypeUse::Unit => write!(out, "void")?, @@ -1053,7 +1055,7 @@ pub fn write_type( "{{ tag: \"Interval\", value: __TimeDuration }} | {{ tag: \"Time\", value: __Timestamp }}" )?, AlgebraicTypeUse::Option(inner_ty) => { - write_type(module, out, inner_ty, ref_prefix)?; + write_type(module, out, inner_ty, ref_prefix, ref_suffix)?; write!(out, " | undefined")?; } AlgebraicTypeUse::Primitive(prim) => match prim { @@ -1083,7 +1085,7 @@ pub fn write_type( if needs_parens { write!(out, "(")?; } - write_type(module, out, elem_ty, ref_prefix)?; + write_type(module, out, elem_ty, ref_prefix, ref_suffix)?; if needs_parens { write!(out, ")")?; } @@ -1094,6 +1096,9 @@ pub fn write_type( write!(out, "{prefix}")?; } write!(out, "{}", type_ref_name(module, *r))?; + if let Some(suffix) = ref_suffix { + write!(out, "{suffix}")?; + } } } Ok(()) @@ -1182,11 +1187,15 @@ fn convert_product_type<'a>( } /// Print imports for each of the `imports`. -fn print_imports(module: &ModuleDef, out: &mut Indenter, imports: Imports) { +fn print_imports(module: &ModuleDef, out: &mut Indenter, imports: Imports, suffix: Option<&str>) { for typeref in imports { let module_name = type_ref_module_name(module, typeref); let type_name = type_ref_name(module, typeref); - writeln!(out, "import {{ {type_name} }} from \"./{module_name}\";"); + if let Some(suffix) = suffix { + writeln!(out, "import {{ {type_name} as {type_name}{suffix} }} from \"./{module_name}\";"); + } else { + writeln!(out, "import {{ {type_name} }} from \"./{module_name}\";"); + } } } @@ -1200,6 +1209,7 @@ fn gen_and_print_imports( out: &mut Indenter, roots: &[(Identifier, AlgebraicTypeUse)], dont_import: &[AlgebraicTypeRef], + suffix: Option<&str>, ) { let mut imports = BTreeSet::new(); @@ -1213,7 +1223,7 @@ fn gen_and_print_imports( } let len = imports.len(); - print_imports(module, out, imports); + print_imports(module, out, imports, suffix); if len > 0 { out.newline(); diff --git a/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts b/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts index 73e1ff9e711..6f3e0725412 100644 --- a/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts @@ -28,26 +28,27 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { CallReducer } from './call_reducer_type'; -import { Subscribe } from './subscribe_type'; -import { OneOffQuery } from './one_off_query_type'; -import { SubscribeSingle } from './subscribe_single_type'; -import { SubscribeMulti } from './subscribe_multi_type'; -import { Unsubscribe } from './unsubscribe_type'; -import { UnsubscribeMulti } from './unsubscribe_multi_type'; +import { CallReducer as CallReducerType } from './call_reducer_type'; +import { Subscribe as SubscribeType } from './subscribe_type'; +import { OneOffQuery as OneOffQueryType } from './one_off_query_type'; +import { SubscribeSingle as SubscribeSingleType } from './subscribe_single_type'; +import { SubscribeMulti as SubscribeMultiType } from './subscribe_multi_type'; +import { Unsubscribe as UnsubscribeType } from './unsubscribe_type'; +import { UnsubscribeMulti as UnsubscribeMultiType } from './unsubscribe_multi_type'; -import ClientMessage from './client_message_type'; - -export type CallReducer = { tag: 'CallReducer'; value: CallReducer }; -export type Subscribe = { tag: 'Subscribe'; value: Subscribe }; -export type OneOffQuery = { tag: 'OneOffQuery'; value: OneOffQuery }; +export type CallReducer = { tag: 'CallReducer'; value: CallReducerType }; +export type Subscribe = { tag: 'Subscribe'; value: SubscribeType }; +export type OneOffQuery = { tag: 'OneOffQuery'; value: OneOffQueryType }; export type SubscribeSingle = { tag: 'SubscribeSingle'; - value: SubscribeSingle; + value: SubscribeSingleType; +}; +export type SubscribeMulti = { + tag: 'SubscribeMulti'; + value: SubscribeMultiType; }; -export type SubscribeMulti = { tag: 'SubscribeMulti'; value: SubscribeMulti }; -export type Unsubscribe = { tag: 'Unsubscribe'; value: Unsubscribe }; +export type Unsubscribe = { tag: 'Unsubscribe'; value: UnsubscribeType }; export type UnsubscribeMulti = { tag: 'UnsubscribeMulti'; - value: UnsubscribeMulti; + value: UnsubscribeMultiType; }; diff --git a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts index 69f826b5089..c08053c3f4e 100644 --- a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts @@ -28,10 +28,8 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { QueryUpdate } from './query_update_type'; +import { QueryUpdate as QueryUpdateType } from './query_update_type'; -import CompressableQueryUpdate from './compressable_query_update_type'; - -export type Uncompressed = { tag: 'Uncompressed'; value: QueryUpdate }; +export type Uncompressed = { tag: 'Uncompressed'; value: QueryUpdateType }; export type Brotli = { tag: 'Brotli'; value: Uint8Array }; export type Gzip = { tag: 'Gzip'; value: Uint8Array }; diff --git a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts index cbccd65fd1d..3bfed766b47 100644 --- a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts @@ -28,7 +28,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import RowSizeHint from './row_size_hint_type'; export type FixedSize = { tag: 'FixedSize'; value: number }; export type RowOffsets = { tag: 'RowOffsets'; value: bigint[] }; diff --git a/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts b/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts index 87a97c9832e..deb1bdb0086 100644 --- a/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts @@ -28,53 +28,51 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { InitialSubscription } from './initial_subscription_type'; -import { TransactionUpdate } from './transaction_update_type'; -import { TransactionUpdateLight } from './transaction_update_light_type'; -import { IdentityToken } from './identity_token_type'; -import { OneOffQueryResponse } from './one_off_query_response_type'; -import { SubscribeApplied } from './subscribe_applied_type'; -import { UnsubscribeApplied } from './unsubscribe_applied_type'; -import { SubscriptionError } from './subscription_error_type'; -import { SubscribeMultiApplied } from './subscribe_multi_applied_type'; -import { UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type'; - -import ServerMessage from './server_message_type'; +import { InitialSubscription as InitialSubscriptionType } from './initial_subscription_type'; +import { TransactionUpdate as TransactionUpdateType } from './transaction_update_type'; +import { TransactionUpdateLight as TransactionUpdateLightType } from './transaction_update_light_type'; +import { IdentityToken as IdentityTokenType } from './identity_token_type'; +import { OneOffQueryResponse as OneOffQueryResponseType } from './one_off_query_response_type'; +import { SubscribeApplied as SubscribeAppliedType } from './subscribe_applied_type'; +import { UnsubscribeApplied as UnsubscribeAppliedType } from './unsubscribe_applied_type'; +import { SubscriptionError as SubscriptionErrorType } from './subscription_error_type'; +import { SubscribeMultiApplied as SubscribeMultiAppliedType } from './subscribe_multi_applied_type'; +import { UnsubscribeMultiApplied as UnsubscribeMultiAppliedType } from './unsubscribe_multi_applied_type'; export type InitialSubscription = { tag: 'InitialSubscription'; - value: InitialSubscription; + value: InitialSubscriptionType; }; export type TransactionUpdate = { tag: 'TransactionUpdate'; - value: TransactionUpdate; + value: TransactionUpdateType; }; export type TransactionUpdateLight = { tag: 'TransactionUpdateLight'; - value: TransactionUpdateLight; + value: TransactionUpdateLightType; }; -export type IdentityToken = { tag: 'IdentityToken'; value: IdentityToken }; +export type IdentityToken = { tag: 'IdentityToken'; value: IdentityTokenType }; export type OneOffQueryResponse = { tag: 'OneOffQueryResponse'; - value: OneOffQueryResponse; + value: OneOffQueryResponseType; }; export type SubscribeApplied = { tag: 'SubscribeApplied'; - value: SubscribeApplied; + value: SubscribeAppliedType; }; export type UnsubscribeApplied = { tag: 'UnsubscribeApplied'; - value: UnsubscribeApplied; + value: UnsubscribeAppliedType; }; export type SubscriptionError = { tag: 'SubscriptionError'; - value: SubscriptionError; + value: SubscriptionErrorType; }; export type SubscribeMultiApplied = { tag: 'SubscribeMultiApplied'; - value: SubscribeMultiApplied; + value: SubscribeMultiAppliedType; }; export type UnsubscribeMultiApplied = { tag: 'UnsubscribeMultiApplied'; - value: UnsubscribeMultiApplied; + value: UnsubscribeMultiAppliedType; }; diff --git a/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts b/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts index beadd5d0b51..ebae60598e7 100644 --- a/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts @@ -28,10 +28,8 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; -import { DatabaseUpdate } from './database_update_type'; +import { DatabaseUpdate as DatabaseUpdateType } from './database_update_type'; -import UpdateStatus from './update_status_type'; - -export type Committed = { tag: 'Committed'; value: DatabaseUpdate }; +export type Committed = { tag: 'Committed'; value: DatabaseUpdateType }; export type Failed = { tag: 'Failed'; value: string }; export type OutOfEnergy = { tag: 'OutOfEnergy' }; From 20d2d8137cb79f31b4b0b94e25dfb058c58eddc4 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 18:18:32 -0400 Subject: [PATCH 31/37] Removed errant files --- .../src/server/server/reducers.ts | 50 -- .../src/server/server/schema.ts | 684 ------------------ 2 files changed, 734 deletions(-) delete mode 100644 crates/bindings-typescript/src/server/server/reducers.ts delete mode 100644 crates/bindings-typescript/src/server/server/schema.ts diff --git a/crates/bindings-typescript/src/server/server/reducers.ts b/crates/bindings-typescript/src/server/server/reducers.ts deleted file mode 100644 index f79a193c05a..00000000000 --- a/crates/bindings-typescript/src/server/server/reducers.ts +++ /dev/null @@ -1,50 +0,0 @@ -// import { -// clientConnected, -// clientDisconnected, -// init, -// player, -// point, -// procedure, -// reducer, -// sendMessageSchedule, -// user, -// type Schema, -// } from './schema'; - -// export const sendMessage = reducer( -// 'send_message', -// sendMessageSchedule, -// (ctx, { scheduleId, scheduledAt, text }) => { -// console.log(`Sending message: ${text} ${scheduleId}`); -// } -// ); - -// init('init', {}, ctx => { -// console.log('Database initialized'); -// }); - -// clientConnected('on_connect', {}, ctx => { -// console.log('Client connected'); -// }); - -// clientDisconnected('on_disconnect', {}, ctx => { -// console.log('Client disconnected'); -// }); - -// reducer( -// 'move_player', -// { user, foo: point, player }, -// (ctx: ReducerCtx, user, foo, player): void => { -// if (player.baz.tag === 'Foo') { -// player.baz.value += 1; -// } else if (player.baz.tag === 'Bar') { -// player.baz.value += 2; -// } else if (player.baz.tag === 'Baz') { -// player.baz.value += '!'; -// } -// } -// ); - -// procedure('get_user', { user }, async (ctx, { user }) => { -// console.log(user.email); -// }); diff --git a/crates/bindings-typescript/src/server/server/schema.ts b/crates/bindings-typescript/src/server/server/schema.ts deleted file mode 100644 index ebe03e3fac9..00000000000 --- a/crates/bindings-typescript/src/server/server/schema.ts +++ /dev/null @@ -1,684 +0,0 @@ -// import { -// AlgebraicType, -// ProductType, -// ProductTypeElement, -// } from '../algebraic_type'; -// import type RawConstraintDefV9 from '../autogen/raw_constraint_def_v_9_type'; -// import RawIndexAlgorithm from '../autogen/raw_index_algorithm_type'; -// import type RawIndexDefV9 from '../autogen/raw_index_def_v_9_type'; -// import { RawModuleDefV9 } from "../autogen/raw_module_def_v_9_type"; -// import type RawReducerDefV9 from '../autogen/raw_reducer_def_v_9_type'; -// import type RawSequenceDefV9 from '../autogen/raw_sequence_def_v_9_type'; -// import Lifecycle from '../autogen/lifecycle_type'; -// import ScheduleAt from '../schedule_at'; -// import RawTableDefV9 from '../autogen/raw_table_def_v_9_type'; -// import type Typespace from '../autogen/typespace_type'; -// import type { ColumnBuilder } from './type_builders'; -// import t from "./type_builders"; - -// type AlgebraicTypeRef = number; -// type ColId = number; -// type ColList = ColId[]; - -// /***************************************************************** -// * shared helpers -// *****************************************************************/ -// type Merge = M1 & Omit; -// type Values = T[keyof T]; - -// /***************************************************************** -// * the run‑time catalogue that we are filling -// *****************************************************************/ -// export const MODULE_DEF: RawModuleDefV9 = { -// typespace: { types: [] }, -// tables: [], -// reducers: [], -// types: [], -// miscExports: [], -// rowLevelSecurity: [], -// }; - -// /***************************************************************** -// * Type helpers -// *****************************************************************/ -// type ColumnType = C extends ColumnBuilder ? JS : never; -// export type Infer = S extends ColumnBuilder ? JS : never; - -// /***************************************************************** -// * Index helper type used *inside* table() to enforce that only -// * existing column names are referenced. -// *****************************************************************/ -// type PendingIndex = { -// name?: string; -// accessor_name?: string; -// algorithm: -// | { tag: 'BTree'; value: { columns: readonly AllowedCol[] } } -// | { tag: 'Hash'; value: { columns: readonly AllowedCol[] } } -// | { tag: 'Direct'; value: { column: AllowedCol } }; -// }; - -// /***************************************************************** -// * table() -// *****************************************************************/ -// type TableOpts< -// N extends string, -// Def extends Record>, -// Idx extends PendingIndex[] | undefined = undefined, -// > = { -// name: N; -// public?: boolean; -// indexes?: Idx; // declarative multi‑column indexes -// scheduled?: string; // reducer name for cron‑like tables -// }; - -// /***************************************************************** -// * Branded types for better IDE navigation -// *****************************************************************/ - -// // Create unique symbols for each table to enable better IDE navigation -// declare const TABLE_BRAND: unique symbol; -// declare const SCHEMA_BRAND: unique symbol; - -// /***************************************************************** -// * Opaque handle that `table()` returns, now remembers the NAME literal -// *****************************************************************/ - -// // Helper types for extracting info from table handles -// type RowOf = H extends TableHandle ? R : never; -// type NameOf = H extends TableHandle ? N : never; - -// /***************************************************************** -// * table() – unchanged behavior, but return typed Name on the handle -// *****************************************************************/ -// /** -// * Defines a database table with schema and options -// * @param opts - Table configuration including name, indexes, and access control -// * @param row - Product type defining the table's row structure -// * @returns Table handle for use in schema() function -// * @example -// * ```ts -// * const playerTable = table( -// * { name: 'player', public: true }, -// * t.object({ -// * id: t.u32().primary_key(), -// * name: t.string().index('btree') -// * }) -// * ); -// * ``` -// */ -// export function table< -// const TableName extends string, -// Row extends Record>, -// Idx extends PendingIndex[] | undefined = undefined, -// >(opts: TableOpts, row: Row): TableHandle> { -// const { -// name, -// public: isPublic = false, -// indexes: userIndexes = [], -// scheduled, -// } = opts; - -// /** 1. column catalogue + helpers */ -// const def = row.__def__; -// const colIds = new Map(); -// const colIdList: ColList = []; - -// let nextCol: number = 0; -// for (const colName of Object.keys(def) as (keyof Row & string)[]) { -// colIds.set(colName, nextCol++); -// colIdList.push(colIds.get(colName)!); -// } - -// /** 2. gather primary keys, per‑column indexes, uniques, sequences */ -// const pk: ColList = []; -// const indexes: RawIndexDefV9[] = []; -// const constraints: RawConstraintDefV9[] = []; -// const sequences: RawSequenceDefV9[] = []; - -// let scheduleAtCol: ColId | undefined; - -// for (const [name, builder] of Object.entries(def) as [ -// keyof Row & string, -// ColumnBuilder, -// ][]) { -// const meta: any = builder.__meta__; - -// /* primary key */ -// if (meta.primaryKey) pk.push(colIds.get(name)!); - -// /* implicit 1‑column indexes */ -// if (meta.index) { -// const algo = (meta.index ?? 'btree') as 'BTree' | 'Hash' | 'Direct'; -// const id = colIds.get(name)!; -// indexes.push( -// algo === 'Direct' -// ? { name: "TODO", accessorName: "TODO", algorithm: RawIndexAlgorithm.Direct(id) } -// : { name: "TODO", accessorName: "TODO", algorithm: { tag: algo, value: [id] } } -// ); -// } - -// /* uniqueness */ -// if (meta.unique) { -// constraints.push({ -// name: "TODO", -// data: { tag: 'Unique', value: { columns: [colIds.get(name)!] } }, -// }); -// } - -// /* auto increment */ -// if (meta.autoInc) { -// sequences.push({ -// name: "TODO", -// start: 0n, // TODO -// minValue: 0n, // TODO -// maxValue: 0n, // TODO -// column: colIds.get(name)!, -// increment: 1n, -// }); -// } - -// /* scheduleAt */ -// if (meta.scheduleAt) scheduleAtCol = colIds.get(name)!; -// } - -// /** 3. convert explicit multi‑column indexes coming from options.indexes */ -// for (const pending of (userIndexes ?? []) as PendingIndex< -// keyof Row & string -// >[]) { -// const converted: RawIndexDefV9 = { -// name: pending.name, -// accessorName: pending.accessor_name, -// algorithm: ((): RawIndexAlgorithm => { -// if (pending.algorithm.tag === 'Direct') -// return { -// tag: 'Direct', -// value: colIds.get(pending.algorithm.value.column)!, -// }; -// return { -// tag: pending.algorithm.tag, -// value: pending.algorithm.value.columns.map(c => colIds.get(c)!), -// }; -// })(), -// }; -// indexes.push(converted); -// } - -// /** 4. add the product type to the global Typespace */ -// const productTypeRef: AlgebraicTypeRef = MODULE_DEF.typespace.types.length; -// MODULE_DEF.typespace.types.push(row.__spacetime_type__); - -// /** 5. finalise table record */ -// const tableDef: RawTableDefV9 = { -// name, -// productTypeRef, -// primaryKey: pk, -// indexes, -// constraints, -// sequences, -// schedule: -// scheduled && scheduleAtCol !== undefined -// ? { -// name: "TODO", -// reducerName: scheduled, -// scheduledAtColumn: scheduleAtCol, -// } -// : undefined, -// tableType: { tag: 'User' }, -// tableAccess: { tag: isPublic ? 'Public' : 'Private' }, -// }; -// MODULE_DEF.tables.push(tableDef); - -// return { -// __table_name__: name as TableName, -// __row_type__: {} as Infer, -// __row_spacetime_type__: row.__spacetime_type__, -// } as TableHandle>; -// } - -// /***************************************************************** -// * schema() – Fixed to properly infer table names and row types -// *****************************************************************/ - -// /***************************************************************** -// * reducer() -// *****************************************************************/ -// type ParamsAsObject>> = { -// [K in keyof ParamDef]: Infer; -// }; - -// /***************************************************************** -// * procedure() -// * -// * Stored procedures are opaque to the DB engine itself, so we just -// * keep them out of `RawModuleDefV9` for now – you can forward‑declare -// * a companion `RawMiscModuleExportV9` type later if desired. -// *****************************************************************/ -// export function procedure< -// Name extends string, -// Params extends Record>, -// Ctx, -// R, -// >( -// _name: Name, -// _params: Params, -// _fn: (ctx: Ctx, payload: ParamsAsObject) => Promise | R -// ): void { -// /* nothing to push yet — left for your misc export section */ -// } - -// /***************************************************************** -// * internal: pushReducer() helper used by reducer() and lifecycle wrappers -// *****************************************************************/ -// function pushReducer< -// S, -// Name extends string = string, -// Params extends Record> = Record< -// string, -// ColumnBuilder -// >, -// >( -// name: Name, -// params: Params | ProductTypeColumnBuilder, -// lifecycle?: RawReducerDefV9['lifecycle'] -// ): void { -// // Allow either a product-type ColumnBuilder or a plain params object -// const paramsInternal: Params = -// (params as any).__is_product_type__ === true -// ? (params as ProductTypeColumnBuilder).__def__ -// : (params as Params); - -// const paramType = { -// elements: Object.entries(paramsInternal).map( -// ([n, c]) => -// ({ name: n, algebraicType: (c as ColumnBuilder).__spacetime_type__ }) -// ) -// }; - -// MODULE_DEF.reducers.push({ -// name, -// params: paramType, -// lifecycle, // <- lifecycle flag lands here -// }); -// } - -// /***************************************************************** -// * reducer() – leave behavior the same; delegate to pushReducer() -// *****************************************************************/ - -// /***************************************************************** -// * Lifecycle reducers -// * - register with lifecycle: 'init' | 'on_connect' | 'on_disconnect' -// * - keep the same call shape you're already using -// *****************************************************************/ -// export function init< -// S extends Record = any, -// Params extends Record> = {}, -// >( -// name: 'init' = 'init', -// params: Params | ProductTypeColumnBuilder = {} as any, -// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void -// ): void { -// pushReducer(name, params, Lifecycle.Init); -// } - -// export function clientConnected< -// S extends Record = any, -// Params extends Record> = {}, -// >( -// name: 'on_connect' = 'on_connect', -// params: Params | ProductTypeColumnBuilder = {} as any, -// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void -// ): void { -// pushReducer(name, params, Lifecycle.OnConnect); -// } - -// export function clientDisconnected< -// S extends Record = any, -// Params extends Record> = {}, -// >( -// name: 'on_disconnect' = 'on_disconnect', -// params: Params | ProductTypeColumnBuilder = {} as any, -// _fn?: (ctx: ReducerCtx, payload: ParamsAsObject) => void -// ): void { -// pushReducer(name, params, Lifecycle.OnDisconnect); -// } - -// /***************************************************************** -// * Example usage with explicit interfaces for better navigation -// *****************************************************************/ -// const point = t.object({ -// x: t.f64(), -// y: t.f64(), -// }); -// type Point = Infer; - -// const user = { -// id: t.string().primaryKey(), -// name: t.string().index('btree'), -// email: t.string(), -// age: t.number(), -// }; -// type User = Infer; - -// const player = { -// id: t.u32().primaryKey().autoInc(), -// name: t.string().index('btree'), -// score: t.number(), -// level: t.number(), -// foo: t.number().unique(), -// bar: t.object({ -// x: t.f64(), -// y: t.f64(), -// }), -// baz: t.enum({ -// Foo: t.f64(), -// Bar: t.f64(), -// Baz: t.string(), -// }), -// }; - -// const sendMessageSchedule = t.object({ -// scheduleId: t.u64().primaryKey(), -// scheduledAt: t.scheduleAt(), -// text: t.string(), -// }); - -// // Create the schema with named references -// const s = schema( -// table({ -// name: 'player', -// public: true, -// indexes: [ -// t.index({ name: 'my_index' }).btree({ columns: ['name', 'score'] }), -// ], -// }, player), -// table({ name: 'logged_out_user' }, user), -// table({ name: 'user' }, user), -// table({ -// name: 'send_message_schedule', -// scheduled: 'move_player', -// }, sendMessageSchedule) -// ); - -// // Export explicit type alias for the schema -// export type Schemar = InferSchema; - -// const foo = reducer('move_player', { user, point, player }, (ctx, { user, point, player }) => { -// ctx.db.send_message_schedule.insert({ -// scheduleId: 1, -// scheduledAt: ScheduleAt.Interval(234_000n), -// text: 'Move player' -// }); - -// ctx.db.player.insert(player); - -// if (player.baz.tag === 'Foo') { -// player.baz.value += 1; -// } else if (player.baz.tag === 'Bar') { -// player.baz.value += 2; -// } else if (player.baz.tag === 'Baz') { -// player.baz.value += '!'; -// } -// }); - -// const bar = reducer('foobar', {}, (ctx) => { -// bar(ctx, {}); -// }) - -// init('init', {}, (_ctx) => { - -// }) - -// // Result like Rust -// export type Result = -// | { ok: true; value: T } -// | { ok: false; error: E }; - -// // /* ───── generic index‑builder to be used in table options ───── */ -// // index(opts?: { -// // name?: IdxName; -// // }): { -// // btree(def: { -// // columns: Cols; -// // }): PendingIndex<(typeof def.columns)[number]>; -// // hash(def: { -// // columns: Cols; -// // }): PendingIndex<(typeof def.columns)[number]>; -// // direct(def: { column: Col }): PendingIndex; -// // } { -// // const common = { name: opts?.name }; -// // return { -// // btree(def: { columns: Cols }) { -// // return { -// // ...common, -// // algorithm: { -// // tag: 'BTree', -// // value: { columns: def.columns }, -// // }, -// // } as PendingIndex<(typeof def.columns)[number]>; -// // }, -// // hash(def: { columns: Cols }) { -// // return { -// // ...common, -// // algorithm: { -// // tag: 'Hash', -// // value: { columns: def.columns }, -// // }, -// // } as PendingIndex<(typeof def.columns)[number]>; -// // }, -// // direct(def: { column: Col }) { -// // return { -// // ...common, -// // algorithm: { -// // tag: 'Direct', -// // value: { column: def.column }, -// // }, -// // } as PendingIndex; -// // }, -// // }; -// // }, - -// // type TableOpts< -// // N extends string, -// // Def extends Record>, -// // Idx extends PendingIndex[] | undefined = undefined, -// // > = { -// // name: N; -// // public?: boolean; -// // indexes?: Idx; // declarative multi‑column indexes -// // scheduled?: string; // reducer name for cron‑like tables -// // }; - -// // export function table< -// // const Name extends string, -// // Def extends Record>, -// // Row extends ProductTypeColumnBuilder, -// // Idx extends PendingIndex[] | undefined = undefined, -// // >(opts: TableOpts, row: Row): TableHandle, Name> { - -// // /** -// // * Creates a schema from table definitions -// // * @param handles - Array of table handles created by table() function -// // * @returns ColumnBuilder representing the complete database schema -// // * @example -// // * ```ts -// // * const s = schema( -// // * table({ name: 'users' }, userTable), -// // * table({ name: 'posts' }, postTable) -// // * ); -// // * ``` -// // */ -// // export function schema< -// // const H extends readonly TableHandle[] -// // >(...handles: H): ColumnBuilder> & { -// // /** @internal - for IDE navigation to schema variable */ -// // readonly __schema_definition__?: never; -// // }; - -// // /** -// // * Creates a schema from table definitions (array overload) -// // * @param handles - Array of table handles created by table() function -// // * @returns ColumnBuilder representing the complete database schema -// // */ -// // export function schema< -// // const H extends readonly TableHandle[] -// // >(handles: H): ColumnBuilder> & { -// // /** @internal - for IDE navigation to schema variable */ -// // readonly __schema_definition__?: never; -// // }; - -// // export function schema(...args: any[]): ColumnBuilder { -// // const handles = -// // (args.length === 1 && Array.isArray(args[0]) ? args[0] : args) as TableHandle[]; - -// // const productTy = AlgebraicType.Product({ -// // elements: handles.map(h => ({ -// // name: h.__table_name__, -// // algebraicType: h.__row_spacetime_type__, -// // })), -// // }); - -// // return col(productTy); -// // } - -// type UntypedTablesTuple = TableHandle[]; -// function schema(...tablesTuple: TablesTuple): Schema { -// return { -// tables: tablesTuple -// } -// } - -// type UntypedSchemaDef = { -// typespace: Typespace, -// tables: [RawTableDefV9], -// } - -// type Schema = { -// tables: Tables, -// } - -// type TableHandle = { -// readonly __table_name__: TableName; -// readonly __row_type__: Row; -// readonly __row_spacetime_type__: AlgebraicType; -// }; - -// type InferSchema = SchemaDef extends Schema ? Tables : never; - -// /** -// * Reducer context parametrized by the inferred Schema -// */ -// export type ReducerCtx = { -// db: DbView; -// }; - -// type DbView = { -// [K in keyof SchemaDef]: Table> -// }; - -// // schema provided -> ctx.db is precise -// export function reducer< -// S extends Record, -// Name extends string = string, -// Params extends Record> = Record< -// string, -// ColumnBuilder -// >, -// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void, -// >(name: Name, params: Params | ProductTypeColumnBuilder, fn: F): F; - -// // no schema provided -> ctx.db is permissive -// export function reducer< -// Name extends string = string, -// Params extends Record> = Record< -// string, -// ColumnBuilder -// >, -// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void, -// >(name: Name, params: Params | ProductTypeColumnBuilder, fn: F): F; - -// // single implementation (S defaults to any -> JS-like) -// export function reducer< -// S extends Record = any, -// Name extends string = string, -// Params extends Record> = Record< -// string, -// ColumnBuilder -// >, -// F = (ctx: ReducerCtx, payload: ParamsAsObject) => void, -// >(name: Name, params: Params | ProductTypeColumnBuilder, fn: F): F { -// pushReducer(name, params); -// return fn; -// } - -// // export type Infer = S extends ColumnBuilder ? JS : never; - -// // Create interfaces for each table to enable better navigation -// type TableHandleTupleToObject[]> = -// T extends readonly [TableHandle, ...infer Rest] -// ? Rest extends readonly TableHandle[] -// ? { [K in N1]: R1 } & TableHandleTupleToObject -// : { [K in N1]: R1 } -// : {}; - -// // Alternative approach - direct tuple iteration with interfaces -// type TupleToSchema[]> = TableHandleTupleToObject; - -// type TableNamesInSchemaDef = -// keyof SchemaDef & string; - -// type TableByName< -// SchemaDef extends UntypedSchemaDef, -// TableName extends TableNamesInSchemaDef, -// > = SchemaDef[TableName]; - -// type RowFromTable = -// TableDef["row"]; - -// /** -// * Reducer context parametrized by the inferred Schema -// */ -// type ReducerContext = { -// db: DbView; -// }; - -// type AnyTable = Table; -// type AnySchema = Record; - -// type Outer = { - -// } - -// type ReducerBuilder = { - -// } - -// type Local = {}; - -// /** -// * Table -// * -// * - Row: row shape -// * - UCV: unique-constraint violation error type (never if none) -// * - AIO: auto-increment overflow error type (never if none) -// */ -// export type Table = { -// /** Returns the number of rows in the TX state. */ -// count(): number; - -// /** Iterate over all rows in the TX state. Rust IteratorIterator → TS Iterable. */ -// iter(): IterableIterator; - -// /** Insert and return the inserted row (auto-increment fields filled). May throw on error. */ -// insert(row: Row): Row; - -// /** Like insert, but returns a Result instead of throwing. */ -// try_insert(row: Row): Result; - -// /** Delete a row equal to `row`. Returns true if something was deleted. */ -// delete(row: Row): boolean; -// }; - -// type DbContext> = { -// db: DbView, -// }; From 0f2cc06a0c0aa0bcb6a4dff16f82692e5c6510e3 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 18:19:24 -0400 Subject: [PATCH 32/37] Cargo fmt --- crates/codegen/src/typescript.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index c84f1946ee4..36da7d6b805 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -1192,7 +1192,10 @@ fn print_imports(module: &ModuleDef, out: &mut Indenter, imports: Imports, suffi let module_name = type_ref_module_name(module, typeref); let type_name = type_ref_name(module, typeref); if let Some(suffix) = suffix { - writeln!(out, "import {{ {type_name} as {type_name}{suffix} }} from \"./{module_name}\";"); + writeln!( + out, + "import {{ {type_name} as {type_name}{suffix} }} from \"./{module_name}\";" + ); } else { writeln!(out, "import {{ {type_name} }} from \"./{module_name}\";"); } From 3db451087eddc31ac5fed279cd51121beb33e893 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Tue, 2 Sep 2025 18:20:41 -0400 Subject: [PATCH 33/37] Updated snap --- .../codegen__codegen_typescript.snap | 172 +++++++++--------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index 1459b4dac08..f80ddc0cd0d 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -37,10 +37,8 @@ import { export type AddPlayer = { name: string, }; -export default AddPlayer; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const AddPlayer = { /** @@ -65,6 +63,8 @@ export const AddPlayer = { } +export default AddPlayer; + ''' "add_private_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -101,10 +101,8 @@ import { export type AddPrivate = { name: string, }; -export default AddPrivate; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const AddPrivate = { /** @@ -129,6 +127,8 @@ export const AddPrivate = { } +export default AddPrivate; + ''' "add_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -166,10 +166,8 @@ export type Add = { name: string, age: number, }; -export default Add; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Add = { /** @@ -195,6 +193,8 @@ export const Add = { } +export default Add; + ''' "assert_caller_identity_is_module_identity_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -229,10 +229,8 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type AssertCallerIdentityIsModuleIdentity = {}; -export default AssertCallerIdentityIsModuleIdentity; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const AssertCallerIdentityIsModuleIdentity = { /** @@ -256,6 +254,8 @@ export const AssertCallerIdentityIsModuleIdentity = { } +export default AssertCallerIdentityIsModuleIdentity; + ''' "baz_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -292,10 +292,8 @@ import { export type Baz = { field: string, }; -export default Baz; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Baz = { /** @@ -320,6 +318,8 @@ export const Baz = { } +export default Baz; + ''' "client_connected_reducer.ts" = ''' @@ -355,10 +355,8 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type ClientConnected = {}; -export default ClientConnected; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const ClientConnected = { /** @@ -382,6 +380,8 @@ export const ClientConnected = { } +export default ClientConnected; + ''' "delete_player_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -418,10 +418,8 @@ import { export type DeletePlayer = { id: bigint, }; -export default DeletePlayer; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const DeletePlayer = { /** @@ -446,6 +444,8 @@ export const DeletePlayer = { } +export default DeletePlayer; + ''' "delete_players_by_name_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -482,10 +482,8 @@ import { export type DeletePlayersByName = { name: string, }; -export default DeletePlayersByName; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const DeletePlayersByName = { /** @@ -510,6 +508,8 @@ export const DeletePlayersByName = { } +export default DeletePlayersByName; + ''' "foobar_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -585,6 +585,7 @@ export const Foobar = { export default Foobar; + ''' "foobar_variants.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -617,11 +618,10 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -import { Baz } from "./baz_type"; +import { Baz as BazType } from "./baz_type"; -import Foobar from './foobar_type' -export type Baz = { tag: "Baz", value: Baz }; +export type Baz = { tag: "Baz", value: BazType }; export type Bar = { tag: "Bar" }; export type Har = { tag: "Har", value: number }; @@ -738,10 +738,8 @@ export type HasSpecialStuff = { identity: __Identity, connectionId: __ConnectionId, }; -export default HasSpecialStuff; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const HasSpecialStuff = { /** @@ -767,6 +765,8 @@ export const HasSpecialStuff = { } +export default HasSpecialStuff; + ''' "index.ts" = ''' @@ -1447,10 +1447,8 @@ import { export type ListOverAge = { age: number, }; -export default ListOverAge; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const ListOverAge = { /** @@ -1475,6 +1473,8 @@ export const ListOverAge = { } +export default ListOverAge; + ''' "log_module_identity_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1509,10 +1509,8 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type LogModuleIdentity = {}; -export default LogModuleIdentity; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const LogModuleIdentity = { /** @@ -1536,6 +1534,8 @@ export const LogModuleIdentity = { } +export default LogModuleIdentity; + ''' "logged_out_player_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1756,6 +1756,7 @@ export const NamespaceTestC = { export default NamespaceTestC; + ''' "namespace_test_c_variants.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1788,7 +1789,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -import NamespaceTestC from './namespace_test_c_type' export type Foo = { tag: "Foo" }; export type Bar = { tag: "Bar" }; @@ -1866,6 +1866,7 @@ export const NamespaceTestF = { export default NamespaceTestF; + ''' "namespace_test_f_variants.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1898,7 +1899,6 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; -import NamespaceTestF from './namespace_test_f_type' export type Foo = { tag: "Foo" }; export type Bar = { tag: "Bar" }; @@ -2048,10 +2048,8 @@ export type Person = { name: string, age: number, }; -export default Person; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Person = { /** @@ -2078,6 +2076,8 @@ export const Person = { } +export default Person; + ''' "pk_multi_identity_table.ts" = ''' @@ -2244,10 +2244,8 @@ export type PkMultiIdentity = { id: number, other: number, }; -export default PkMultiIdentity; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const PkMultiIdentity = { /** @@ -2273,6 +2271,8 @@ export const PkMultiIdentity = { } +export default PkMultiIdentity; + ''' "player_table.ts" = ''' @@ -2462,10 +2462,8 @@ export type Player = { playerId: bigint, name: string, }; -export default Player; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Player = { /** @@ -2492,6 +2490,8 @@ export const Player = { } +export default Player; + ''' "point_type.ts" = ''' @@ -2530,10 +2530,8 @@ export type Point = { x: bigint, y: bigint, }; -export default Point; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Point = { /** @@ -2559,6 +2557,8 @@ export const Point = { } +export default Point; + ''' "points_table.ts" = ''' @@ -2748,10 +2748,8 @@ import { export type PrivateTable = { name: string, }; -export default PrivateTable; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const PrivateTable = { /** @@ -2776,6 +2774,8 @@ export const PrivateTable = { } +export default PrivateTable; + ''' "query_private_reducer.ts" = ''' @@ -2811,10 +2811,8 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type QueryPrivate = {}; -export default QueryPrivate; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const QueryPrivate = { /** @@ -2838,6 +2836,8 @@ export const QueryPrivate = { } +export default QueryPrivate; + ''' "repeating_test_arg_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -2982,10 +2982,8 @@ export type RepeatingTestArg = { scheduledAt: { tag: "Interval", value: __TimeDuration } | { tag: "Time", value: __Timestamp }, prevTime: __Timestamp, }; -export default RepeatingTestArg; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RepeatingTestArg = { /** @@ -3012,6 +3010,8 @@ export const RepeatingTestArg = { } +export default RepeatingTestArg; + ''' "repeating_test_reducer.ts" = ''' @@ -3051,10 +3051,8 @@ import { RepeatingTestArg } from "./repeating_test_arg_type"; export type RepeatingTest = { arg: RepeatingTestArg, }; -export default RepeatingTest; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const RepeatingTest = { /** @@ -3079,6 +3077,8 @@ export const RepeatingTest = { } +export default RepeatingTest; + ''' "say_hello_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -3113,10 +3113,8 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type SayHello = {}; -export default SayHello; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const SayHello = { /** @@ -3140,6 +3138,8 @@ export const SayHello = { } +export default SayHello; + ''' "test_a_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -3254,10 +3254,8 @@ export type TestA = { y: number, z: string, }; -export default TestA; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const TestA = { /** @@ -3284,6 +3282,8 @@ export const TestA = { } +export default TestA; + ''' "test_b_type.ts" = ''' @@ -3321,10 +3321,8 @@ import { export type TestB = { foo: string, }; -export default TestB; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const TestB = { /** @@ -3349,6 +3347,8 @@ export const TestB = { } +export default TestB; + ''' "test_btree_index_args_reducer.ts" = ''' @@ -3384,10 +3384,8 @@ import { } from "@clockworklabs/spacetimedb-sdk"; export type TestBtreeIndexArgs = {}; -export default TestBtreeIndexArgs; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const TestBtreeIndexArgs = { /** @@ -3411,6 +3409,8 @@ export const TestBtreeIndexArgs = { } +export default TestBtreeIndexArgs; + ''' "test_d_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -3527,10 +3527,8 @@ import { NamespaceTestC } from "./namespace_test_c_type"; export type TestD = { testC: NamespaceTestC | undefined, }; -export default TestD; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const TestD = { /** @@ -3555,6 +3553,8 @@ export const TestD = { } +export default TestD; + ''' "test_e_table.ts" = ''' @@ -3699,10 +3699,8 @@ export type TestE = { id: bigint, name: string, }; -export default TestE; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const TestE = { /** @@ -3728,6 +3726,8 @@ export const TestE = { } +export default TestE; + ''' "test_f_table.ts" = ''' @@ -3845,10 +3845,8 @@ import { Foobar } from "./foobar_type"; export type TestFoobar = { field: Foobar, }; -export default TestFoobar; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const TestFoobar = { /** @@ -3873,6 +3871,8 @@ export const TestFoobar = { } +export default TestFoobar; + ''' "test_reducer.ts" = ''' @@ -3918,10 +3918,8 @@ export type Test = { arg3: NamespaceTestC, arg4: NamespaceTestF, }; -export default Test; - /** - * A namespace for generated helper functions. + * An object for generated helper functions. */ export const Test = { /** @@ -3949,4 +3947,6 @@ export const Test = { } +export default Test; + ''' From c62a2c7f345d9ba34ad6812a885a133cc472855a Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 3 Sep 2025 10:10:15 -0400 Subject: [PATCH 34/37] Fixed __SetReducerFlags --- crates/codegen/src/typescript.rs | 2 +- crates/codegen/tests/snapshots/codegen__codegen_typescript.snap | 2 +- .../examples/quickstart-chat/src/module_bindings/index.ts | 2 +- sdks/typescript/packages/sdk/src/client_api/index.ts | 2 +- sdks/typescript/packages/test-app/src/module_bindings/index.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index 36da7d6b805..be2706c024d 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -487,7 +487,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { out.indent(1); writeln!( out, - "constructor(private connection: __DbConnectionImpl, private setCallReducerFlags: __SetReducerFlags) {{}}" + "constructor(private connection: __DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {{}}" ); out.newline(); diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index f80ddc0cd0d..d064c60121f 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -1076,7 +1076,7 @@ export type Reducer = never ; export class RemoteReducers { - constructor(private connection: __DbConnectionImpl, private setCallReducerFlags: __SetReducerFlags) {} + constructor(private connection: __DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} add(name: string, age: number) { const __args = { name, age }; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts index cb51ffe53ec..11268f7f93f 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts @@ -131,7 +131,7 @@ export type Reducer = export class RemoteReducers { constructor( private connection: __DbConnectionImpl, - private setCallReducerFlags: __SetReducerFlags + private setCallReducerFlags: SetReducerFlags ) {} onIdentityConnected(callback: (ctx: ReducerEventContext) => void) { diff --git a/sdks/typescript/packages/sdk/src/client_api/index.ts b/sdks/typescript/packages/sdk/src/client_api/index.ts index ab9c47b919c..65be9435c71 100644 --- a/sdks/typescript/packages/sdk/src/client_api/index.ts +++ b/sdks/typescript/packages/sdk/src/client_api/index.ts @@ -139,7 +139,7 @@ export type Reducer = never; export class RemoteReducers { constructor( private connection: __DbConnectionImpl, - private setCallReducerFlags: __SetReducerFlags + private setCallReducerFlags: SetReducerFlags ) {} } diff --git a/sdks/typescript/packages/test-app/src/module_bindings/index.ts b/sdks/typescript/packages/test-app/src/module_bindings/index.ts index 5381dad32e6..4845a7731d6 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/index.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/index.ts @@ -125,7 +125,7 @@ export type Reducer = never | { name: 'CreatePlayer'; args: CreatePlayer }; export class RemoteReducers { constructor( private connection: __DbConnectionImpl, - private setCallReducerFlags: __SetReducerFlags + private setCallReducerFlags: SetReducerFlags ) {} createPlayer(name: string, location: Point) { From b2e3a0612d0c59e32117ce0cf091deb92fb7c9be Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 3 Sep 2025 16:12:16 -0400 Subject: [PATCH 35/37] Bumped the minimum CLI version number to 1.4.0 --- sdks/typescript/packages/sdk/src/version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/typescript/packages/sdk/src/version.ts b/sdks/typescript/packages/sdk/src/version.ts index 9221a121994..f3d7a67b1d2 100644 --- a/sdks/typescript/packages/sdk/src/version.ts +++ b/sdks/typescript/packages/sdk/src/version.ts @@ -114,7 +114,7 @@ export class SemanticVersion { // The SDK depends on some module information that was not generated before this version. export const _MINIMUM_CLI_VERSION: SemanticVersion = new SemanticVersion( 1, - 2, + 4, 0 ); From c9276358a10fa5dcbee7683260a68b8f9aef3361 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 3 Sep 2025 16:24:55 -0400 Subject: [PATCH 36/37] Bumped the version number to 1.4.0 because this PR introduces a breaking change for the TypeScript SDK codegen --- Cargo.lock | 220 +++++++++--------- Cargo.toml | 64 ++--- LICENSE.txt | 4 +- .../src/subcommands/project/rust/Cargo._toml | 2 +- licenses/BSL.txt | 4 +- 5 files changed, 147 insertions(+), 147 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 552624b7c13..705c0f9b24f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -404,7 +404,7 @@ name = "benchmarks-module" version = "0.1.0" dependencies = [ "anyhow", - "spacetimedb 1.3.2", + "spacetimedb 1.4.0", ] [[package]] @@ -959,7 +959,7 @@ dependencies = [ [[package]] name = "connect_disconnect_client" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "spacetimedb-sdk", @@ -2991,7 +2991,7 @@ name = "keynote-benchmarks" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.3.2", + "spacetimedb 1.4.0", ] [[package]] @@ -3281,7 +3281,7 @@ version = "0.0.0" dependencies = [ "anyhow", "log", - "spacetimedb 1.3.2", + "spacetimedb 1.4.0", ] [[package]] @@ -3764,7 +3764,7 @@ name = "perf-test-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.3.2", + "spacetimedb 1.4.0", ] [[package]] @@ -4223,7 +4223,7 @@ name = "quickstart-chat-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.3.2", + "spacetimedb 1.4.0", ] [[package]] @@ -4903,7 +4903,7 @@ dependencies = [ "anyhow", "log", "paste", - "spacetimedb 1.3.2", + "spacetimedb 1.4.0", ] [[package]] @@ -5264,7 +5264,7 @@ name = "spacetime-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.3.2", + "spacetimedb 1.4.0", ] [[package]] @@ -5287,7 +5287,7 @@ dependencies = [ [[package]] name = "spacetimedb" -version = "1.3.2" +version = "1.4.0" dependencies = [ "bytemuck", "derive_more", @@ -5296,28 +5296,28 @@ dependencies = [ "log", "rand 0.8.5", "scoped-tls", - "spacetimedb-bindings-macro 1.3.2", - "spacetimedb-bindings-sys 1.3.2", - "spacetimedb-lib 1.3.2", - "spacetimedb-primitives 1.3.2", + "spacetimedb-bindings-macro 1.4.0", + "spacetimedb-bindings-sys 1.4.0", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", "trybuild", ] [[package]] name = "spacetimedb-auth" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "serde", "serde_json", "serde_with", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", ] [[package]] name = "spacetimedb-bench" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "anymap", @@ -5345,11 +5345,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-execution", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", - "spacetimedb-primitives 1.3.2", + "spacetimedb-primitives 1.4.0", "spacetimedb-query", - "spacetimedb-sats 1.3.2", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-standalone", "spacetimedb-table", @@ -5378,13 +5378,13 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-macro" -version = "1.3.2" +version = "1.4.0" dependencies = [ "heck 0.4.1", "humantime", "proc-macro2", "quote", - "spacetimedb-primitives 1.3.2", + "spacetimedb-primitives 1.4.0", "syn 2.0.101", ] @@ -5399,14 +5399,14 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-sys" -version = "1.3.2" +version = "1.4.0" dependencies = [ - "spacetimedb-primitives 1.3.2", + "spacetimedb-primitives 1.4.0", ] [[package]] name = "spacetimedb-cli" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "base64 0.21.7", @@ -5442,9 +5442,9 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", - "spacetimedb-primitives 1.3.2", + "spacetimedb-primitives 1.4.0", "spacetimedb-schema", "syntect", "tabled", @@ -5467,7 +5467,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "async-stream", @@ -5503,7 +5503,7 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", "spacetimedb-schema", "tempfile", @@ -5520,7 +5520,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api-messages" -version = "1.3.2" +version = "1.4.0" dependencies = [ "bytes", "bytestring", @@ -5534,16 +5534,16 @@ dependencies = [ "serde_json", "serde_with", "smallvec", - "spacetimedb-lib 1.3.2", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "strum", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-codegen" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -5552,15 +5552,15 @@ dependencies = [ "itertools 0.12.1", "regex", "spacetimedb-data-structures", - "spacetimedb-lib 1.3.2", - "spacetimedb-primitives 1.3.2", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", "spacetimedb-schema", "spacetimedb-testing", ] [[package]] name = "spacetimedb-commitlog" -version = "1.3.2" +version = "1.4.0" dependencies = [ "async-stream", "bitflags 2.9.0", @@ -5580,8 +5580,8 @@ dependencies = [ "spacetimedb-commitlog", "spacetimedb-fs-utils", "spacetimedb-paths", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "tempfile", "thiserror 1.0.69", "tokio", @@ -5592,7 +5592,7 @@ dependencies = [ [[package]] name = "spacetimedb-core" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "arrayvec", @@ -5669,14 +5669,14 @@ dependencies = [ "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", "spacetimedb-jwks", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-memory-usage", "spacetimedb-metrics", "spacetimedb-paths", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.3.2", + "spacetimedb-primitives 1.4.0", "spacetimedb-query", - "spacetimedb-sats 1.3.2", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-subscription", @@ -5711,7 +5711,7 @@ dependencies = [ [[package]] name = "spacetimedb-data-structures" -version = "1.3.2" +version = "1.4.0" dependencies = [ "ahash 0.8.12", "crossbeam-queue", @@ -5725,7 +5725,7 @@ dependencies = [ [[package]] name = "spacetimedb-datastore" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "bytes", @@ -5745,11 +5745,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-durability", "spacetimedb-execution", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-metrics", "spacetimedb-paths", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-table", @@ -5760,46 +5760,46 @@ dependencies = [ [[package]] name = "spacetimedb-durability" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "itertools 0.12.1", "log", "spacetimedb-commitlog", "spacetimedb-paths", - "spacetimedb-sats 1.3.2", + "spacetimedb-sats 1.4.0", "tokio", "tracing", ] [[package]] name = "spacetimedb-execution" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "itertools 0.12.1", "spacetimedb-expr", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-sql-parser", "spacetimedb-table", ] [[package]] name = "spacetimedb-expr" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "bigdecimal", "derive_more", "ethnum", "pretty_assertions", - "spacetimedb 1.3.2", - "spacetimedb-lib 1.3.2", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb 1.4.0", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-sql-parser", "thiserror 1.0.69", @@ -5807,7 +5807,7 @@ dependencies = [ [[package]] name = "spacetimedb-fs-utils" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "hex", @@ -5869,7 +5869,7 @@ dependencies = [ [[package]] name = "spacetimedb-lib" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "bitflags 2.9.0", @@ -5887,17 +5887,17 @@ dependencies = [ "ron", "serde", "serde_json", - "spacetimedb-bindings-macro 1.3.2", + "spacetimedb-bindings-macro 1.4.0", "spacetimedb-memory-usage", "spacetimedb-metrics", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-memory-usage" -version = "1.3.2" +version = "1.4.0" dependencies = [ "decorum", "ethnum", @@ -5907,7 +5907,7 @@ dependencies = [ [[package]] name = "spacetimedb-metrics" -version = "1.3.2" +version = "1.4.0" dependencies = [ "arrayvec", "itertools 0.12.1", @@ -5917,7 +5917,7 @@ dependencies = [ [[package]] name = "spacetimedb-paths" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "chrono", @@ -5933,15 +5933,15 @@ dependencies = [ [[package]] name = "spacetimedb-physical-plan" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "derive_more", "either", "pretty_assertions", "spacetimedb-expr", - "spacetimedb-lib 1.3.2", - "spacetimedb-primitives 1.3.2", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", "spacetimedb-schema", "spacetimedb-sql-parser", "spacetimedb-table", @@ -5961,7 +5961,7 @@ dependencies = [ [[package]] name = "spacetimedb-primitives" -version = "1.3.2" +version = "1.4.0" dependencies = [ "bitflags 2.9.0", "either", @@ -5973,7 +5973,7 @@ dependencies = [ [[package]] name = "spacetimedb-query" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "itertools 0.12.1", @@ -5981,9 +5981,9 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.3.2", + "spacetimedb-primitives 1.4.0", "spacetimedb-sql-parser", "spacetimedb-table", ] @@ -6016,7 +6016,7 @@ dependencies = [ [[package]] name = "spacetimedb-sats" -version = "1.3.2" +version = "1.4.0" dependencies = [ "ahash 0.8.12", "anyhow", @@ -6040,16 +6040,16 @@ dependencies = [ "serde", "sha3", "smallvec", - "spacetimedb-bindings-macro 1.3.2", + "spacetimedb-bindings-macro 1.4.0", "spacetimedb-memory-usage", "spacetimedb-metrics", - "spacetimedb-primitives 1.3.2", + "spacetimedb-primitives 1.4.0", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-schema" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "derive_more", @@ -6066,9 +6066,9 @@ dependencies = [ "serial_test", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib 1.3.2", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-sql-parser", "spacetimedb-testing", "termcolor", @@ -6079,7 +6079,7 @@ dependencies = [ [[package]] name = "spacetimedb-sdk" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anymap", "base64 0.21.7", @@ -6098,9 +6098,9 @@ dependencies = [ "rand 0.9.1", "spacetimedb-client-api-messages", "spacetimedb-data-structures", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-metrics", - "spacetimedb-sats 1.3.2", + "spacetimedb-sats 1.4.0", "spacetimedb-testing", "thiserror 1.0.69", "tokio", @@ -6109,7 +6109,7 @@ dependencies = [ [[package]] name = "spacetimedb-snapshot" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "blake3", @@ -6126,10 +6126,10 @@ dependencies = [ "spacetimedb-datastore", "spacetimedb-durability", "spacetimedb-fs-utils", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -6142,17 +6142,17 @@ dependencies = [ [[package]] name = "spacetimedb-sql-parser" -version = "1.3.2" +version = "1.4.0" dependencies = [ "derive_more", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "sqlparser", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-standalone" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "async-trait", @@ -6176,7 +6176,7 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", "spacetimedb-table", "tempfile", @@ -6191,20 +6191,20 @@ dependencies = [ [[package]] name = "spacetimedb-subscription" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.3.2", + "spacetimedb-primitives 1.4.0", "spacetimedb-query", ] [[package]] name = "spacetimedb-table" -version = "1.3.2" +version = "1.4.0" dependencies = [ "ahash 0.8.12", "blake3", @@ -6220,17 +6220,17 @@ dependencies = [ "rand 0.9.1", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-memory-usage", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-testing" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "clap 4.5.37", @@ -6246,7 +6246,7 @@ dependencies = [ "spacetimedb-client-api", "spacetimedb-core", "spacetimedb-data-structures", - "spacetimedb-lib 1.3.2", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", "spacetimedb-schema", "spacetimedb-standalone", @@ -6257,7 +6257,7 @@ dependencies = [ [[package]] name = "spacetimedb-update" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "bytes", @@ -6282,7 +6282,7 @@ dependencies = [ [[package]] name = "spacetimedb-vm" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "arrayvec", @@ -6292,9 +6292,9 @@ dependencies = [ "smallvec", "spacetimedb-data-structures", "spacetimedb-execution", - "spacetimedb-lib 1.3.2", - "spacetimedb-primitives 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -6373,7 +6373,7 @@ dependencies = [ [[package]] name = "sqltest" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "async-trait", @@ -6392,8 +6392,8 @@ dependencies = [ "rust_decimal", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib 1.3.2", - "spacetimedb-sats 1.3.2", + "spacetimedb-lib 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-vm", "sqllogictest", "sqllogictest-engines", @@ -6711,7 +6711,7 @@ dependencies = [ [[package]] name = "test-client" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "env_logger 0.10.2", @@ -6723,7 +6723,7 @@ dependencies = [ [[package]] name = "test-counter" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "spacetimedb-data-structures", diff --git a/Cargo.toml b/Cargo.toml index aa883850943..e6cbb963f01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,43 +90,43 @@ inherits = "release" debug = true [workspace.package] -version = "1.3.2" +version = "1.4.0" edition = "2021" # update rust-toolchain.toml too! rust-version = "1.88.0" [workspace.dependencies] -spacetimedb = { path = "crates/bindings", version = "1.3.2" } -spacetimedb-auth = { path = "crates/auth", version = "1.3.2" } -spacetimedb-bindings-macro = { path = "crates/bindings-macro", version = "1.3.2" } -spacetimedb-bindings-sys = { path = "crates/bindings-sys", version = "1.3.2" } -spacetimedb-cli = { path = "crates/cli", version = "1.3.2" } -spacetimedb-client-api = { path = "crates/client-api", version = "1.3.2" } -spacetimedb-client-api-messages = { path = "crates/client-api-messages", version = "1.3.2" } -spacetimedb-codegen = { path = "crates/codegen", version = "1.3.2" } -spacetimedb-commitlog = { path = "crates/commitlog", version = "1.3.2" } -spacetimedb-core = { path = "crates/core", version = "1.3.2" } -spacetimedb-data-structures = { path = "crates/data-structures", version = "1.3.2" } -spacetimedb-datastore = { path = "crates/datastore", version = "1.3.2" } -spacetimedb-durability = { path = "crates/durability", version = "1.3.2" } -spacetimedb-execution = { path = "crates/execution", version = "1.3.2" } -spacetimedb-expr = { path = "crates/expr", version = "1.3.2" } -spacetimedb-lib = { path = "crates/lib", default-features = false, version = "1.3.2" } -spacetimedb-memory-usage = { path = "crates/memory-usage", version = "1.3.2", default-features = false } -spacetimedb-metrics = { path = "crates/metrics", version = "1.3.2" } -spacetimedb-paths = { path = "crates/paths", version = "1.3.2" } -spacetimedb-physical-plan = { path = "crates/physical-plan", version = "1.3.2" } -spacetimedb-primitives = { path = "crates/primitives", version = "1.3.2" } -spacetimedb-query = { path = "crates/query", version = "1.3.2" } -spacetimedb-sats = { path = "crates/sats", version = "1.3.2" } -spacetimedb-schema = { path = "crates/schema", version = "1.3.2" } -spacetimedb-standalone = { path = "crates/standalone", version = "1.3.2" } -spacetimedb-sql-parser = { path = "crates/sql-parser", version = "1.3.2" } -spacetimedb-table = { path = "crates/table", version = "1.3.2" } -spacetimedb-vm = { path = "crates/vm", version = "1.3.2" } -spacetimedb-fs-utils = { path = "crates/fs-utils", version = "1.3.2" } -spacetimedb-snapshot = { path = "crates/snapshot", version = "1.3.2" } -spacetimedb-subscription = { path = "crates/subscription", version = "1.3.2" } +spacetimedb = { path = "crates/bindings", version = "1.4.0" } +spacetimedb-auth = { path = "crates/auth", version = "1.4.0" } +spacetimedb-bindings-macro = { path = "crates/bindings-macro", version = "1.4.0" } +spacetimedb-bindings-sys = { path = "crates/bindings-sys", version = "1.4.0" } +spacetimedb-cli = { path = "crates/cli", version = "1.4.0" } +spacetimedb-client-api = { path = "crates/client-api", version = "1.4.0" } +spacetimedb-client-api-messages = { path = "crates/client-api-messages", version = "1.4.0" } +spacetimedb-codegen = { path = "crates/codegen", version = "1.4.0" } +spacetimedb-commitlog = { path = "crates/commitlog", version = "1.4.0" } +spacetimedb-core = { path = "crates/core", version = "1.4.0" } +spacetimedb-data-structures = { path = "crates/data-structures", version = "1.4.0" } +spacetimedb-datastore = { path = "crates/datastore", version = "1.4.0" } +spacetimedb-durability = { path = "crates/durability", version = "1.4.0" } +spacetimedb-execution = { path = "crates/execution", version = "1.4.0" } +spacetimedb-expr = { path = "crates/expr", version = "1.4.0" } +spacetimedb-lib = { path = "crates/lib", default-features = false, version = "1.4.0" } +spacetimedb-memory-usage = { path = "crates/memory-usage", version = "1.4.0", default-features = false } +spacetimedb-metrics = { path = "crates/metrics", version = "1.4.0" } +spacetimedb-paths = { path = "crates/paths", version = "1.4.0" } +spacetimedb-physical-plan = { path = "crates/physical-plan", version = "1.4.0" } +spacetimedb-primitives = { path = "crates/primitives", version = "1.4.0" } +spacetimedb-query = { path = "crates/query", version = "1.4.0" } +spacetimedb-sats = { path = "crates/sats", version = "1.4.0" } +spacetimedb-schema = { path = "crates/schema", version = "1.4.0" } +spacetimedb-standalone = { path = "crates/standalone", version = "1.4.0" } +spacetimedb-sql-parser = { path = "crates/sql-parser", version = "1.4.0" } +spacetimedb-table = { path = "crates/table", version = "1.4.0" } +spacetimedb-vm = { path = "crates/vm", version = "1.4.0" } +spacetimedb-fs-utils = { path = "crates/fs-utils", version = "1.4.0" } +spacetimedb-snapshot = { path = "crates/snapshot", version = "1.4.0" } +spacetimedb-subscription = { path = "crates/subscription", version = "1.4.0" } # Prevent `ahash` from pulling in `getrandom` by disabling default features. # Modules use `getrandom02` and we need to prevent an incompatible version diff --git a/LICENSE.txt b/LICENSE.txt index 1d9fdced3b9..a95276a0448 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -5,7 +5,7 @@ Business Source License 1.1 Parameters Licensor: Clockwork Laboratories, Inc. -Licensed Work: SpacetimeDB 1.3.2 +Licensed Work: SpacetimeDB 1.4.0 The Licensed Work is (c) 2023 Clockwork Laboratories, Inc. @@ -21,7 +21,7 @@ Additional Use Grant: You may make use of the Licensed Work provided your Licensed Work by creating tables whose schemas are controlled by such third parties. -Change Date: 2030-08-27 +Change Date: 2030-09-03 Change License: GNU Affero General Public License v3.0 with a linking exception diff --git a/crates/cli/src/subcommands/project/rust/Cargo._toml b/crates/cli/src/subcommands/project/rust/Cargo._toml index d27d186c9e0..360377c7fba 100644 --- a/crates/cli/src/subcommands/project/rust/Cargo._toml +++ b/crates/cli/src/subcommands/project/rust/Cargo._toml @@ -9,5 +9,5 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -spacetimedb = "1.3.2" +spacetimedb = "1.4.0" log = "0.4" diff --git a/licenses/BSL.txt b/licenses/BSL.txt index ca1f88fefd3..125fcf25a1d 100644 --- a/licenses/BSL.txt +++ b/licenses/BSL.txt @@ -5,7 +5,7 @@ Business Source License 1.1 Parameters Licensor: Clockwork Laboratories, Inc. -Licensed Work: SpacetimeDB 1.2.0 +Licensed Work: SpacetimeDB 1.4.0 The Licensed Work is (c) 2023 Clockwork Laboratories, Inc. @@ -21,7 +21,7 @@ Additional Use Grant: You may make use of the Licensed Work provided your Licensed Work by creating tables whose schemas are controlled by such third parties. -Change Date: 2030-06-04 +Change Date: 2030-09-03 Change License: GNU Affero General Public License v3.0 with a linking exception From fba33d92b94d92d149cc5433714a2d3418339494 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 3 Sep 2025 16:46:07 -0400 Subject: [PATCH 37/37] Re ran all the code gen with the new version --- crates/bindings-typescript/src/autogen/algebraic_type_type.ts | 2 +- .../src/autogen/algebraic_type_variants.ts | 2 +- crates/bindings-typescript/src/autogen/index_type_type.ts | 2 +- crates/bindings-typescript/src/autogen/index_type_variants.ts | 2 +- crates/bindings-typescript/src/autogen/lifecycle_type.ts | 2 +- crates/bindings-typescript/src/autogen/lifecycle_variants.ts | 2 +- .../src/autogen/misc_module_export_type.ts | 2 +- .../src/autogen/misc_module_export_variants.ts | 2 +- .../src/autogen/product_type_element_type.ts | 2 +- crates/bindings-typescript/src/autogen/product_type_type.ts | 2 +- .../src/autogen/raw_column_def_v_8_type.ts | 2 +- .../src/autogen/raw_column_default_value_v_9_type.ts | 2 +- .../src/autogen/raw_constraint_data_v_9_type.ts | 2 +- .../src/autogen/raw_constraint_data_v_9_variants.ts | 2 +- .../src/autogen/raw_constraint_def_v_8_type.ts | 2 +- .../src/autogen/raw_constraint_def_v_9_type.ts | 2 +- .../src/autogen/raw_index_algorithm_type.ts | 2 +- .../src/autogen/raw_index_algorithm_variants.ts | 2 +- .../bindings-typescript/src/autogen/raw_index_def_v_8_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_index_def_v_9_type.ts | 2 +- .../src/autogen/raw_misc_module_export_v_9_type.ts | 2 +- .../src/autogen/raw_misc_module_export_v_9_variants.ts | 2 +- crates/bindings-typescript/src/autogen/raw_module_def_type.ts | 2 +- .../src/autogen/raw_module_def_v_8_type.ts | 2 +- .../src/autogen/raw_module_def_v_9_type.ts | 2 +- .../src/autogen/raw_module_def_variants.ts | 2 +- .../src/autogen/raw_reducer_def_v_9_type.ts | 2 +- .../src/autogen/raw_row_level_security_def_v_9_type.ts | 2 +- .../src/autogen/raw_schedule_def_v_9_type.ts | 2 +- .../src/autogen/raw_scoped_type_name_v_9_type.ts | 2 +- .../src/autogen/raw_sequence_def_v_8_type.ts | 2 +- .../src/autogen/raw_sequence_def_v_9_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_table_def_v_8_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_table_def_v_9_type.ts | 2 +- .../bindings-typescript/src/autogen/raw_type_def_v_9_type.ts | 2 +- .../src/autogen/raw_unique_constraint_data_v_9_type.ts | 2 +- crates/bindings-typescript/src/autogen/reducer_def_type.ts | 2 +- crates/bindings-typescript/src/autogen/sum_type_type.ts | 2 +- .../bindings-typescript/src/autogen/sum_type_variant_type.ts | 2 +- crates/bindings-typescript/src/autogen/table_access_type.ts | 2 +- .../bindings-typescript/src/autogen/table_access_variants.ts | 2 +- crates/bindings-typescript/src/autogen/table_desc_type.ts | 2 +- crates/bindings-typescript/src/autogen/table_type_type.ts | 2 +- crates/bindings-typescript/src/autogen/table_type_variants.ts | 2 +- crates/bindings-typescript/src/autogen/type_alias_type.ts | 2 +- crates/bindings-typescript/src/autogen/typespace_type.ts | 2 +- .../src/module_bindings/identity_connected_reducer.ts | 2 +- .../src/module_bindings/identity_disconnected_reducer.ts | 2 +- .../examples/quickstart-chat/src/module_bindings/index.ts | 4 ++-- .../quickstart-chat/src/module_bindings/message_table.ts | 2 +- .../quickstart-chat/src/module_bindings/message_type.ts | 2 +- .../src/module_bindings/send_message_reducer.ts | 2 +- .../quickstart-chat/src/module_bindings/set_name_reducer.ts | 2 +- .../quickstart-chat/src/module_bindings/user_table.ts | 2 +- .../examples/quickstart-chat/src/module_bindings/user_type.ts | 2 +- .../packages/sdk/src/client_api/bsatn_row_list_type.ts | 2 +- .../packages/sdk/src/client_api/call_reducer_type.ts | 2 +- .../packages/sdk/src/client_api/client_message_type.ts | 2 +- .../packages/sdk/src/client_api/client_message_variants.ts | 2 +- .../sdk/src/client_api/compressable_query_update_type.ts | 2 +- .../sdk/src/client_api/compressable_query_update_variants.ts | 2 +- .../packages/sdk/src/client_api/database_update_type.ts | 2 +- .../packages/sdk/src/client_api/energy_quanta_type.ts | 2 +- .../packages/sdk/src/client_api/identity_token_type.ts | 2 +- sdks/typescript/packages/sdk/src/client_api/index.ts | 4 ++-- .../packages/sdk/src/client_api/initial_subscription_type.ts | 2 +- .../sdk/src/client_api/one_off_query_response_type.ts | 2 +- .../packages/sdk/src/client_api/one_off_query_type.ts | 2 +- .../packages/sdk/src/client_api/one_off_table_type.ts | 2 +- sdks/typescript/packages/sdk/src/client_api/query_id_type.ts | 2 +- .../packages/sdk/src/client_api/query_update_type.ts | 2 +- .../packages/sdk/src/client_api/reducer_call_info_type.ts | 2 +- .../packages/sdk/src/client_api/row_size_hint_type.ts | 2 +- .../packages/sdk/src/client_api/row_size_hint_variants.ts | 2 +- .../packages/sdk/src/client_api/server_message_type.ts | 2 +- .../packages/sdk/src/client_api/server_message_variants.ts | 2 +- .../packages/sdk/src/client_api/subscribe_applied_type.ts | 2 +- .../sdk/src/client_api/subscribe_multi_applied_type.ts | 2 +- .../packages/sdk/src/client_api/subscribe_multi_type.ts | 2 +- .../packages/sdk/src/client_api/subscribe_rows_type.ts | 2 +- .../packages/sdk/src/client_api/subscribe_single_type.ts | 2 +- sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts | 2 +- .../packages/sdk/src/client_api/subscription_error_type.ts | 2 +- .../packages/sdk/src/client_api/table_update_type.ts | 2 +- .../sdk/src/client_api/transaction_update_light_type.ts | 2 +- .../packages/sdk/src/client_api/transaction_update_type.ts | 2 +- .../packages/sdk/src/client_api/unsubscribe_applied_type.ts | 2 +- .../sdk/src/client_api/unsubscribe_multi_applied_type.ts | 2 +- .../packages/sdk/src/client_api/unsubscribe_multi_type.ts | 2 +- .../packages/sdk/src/client_api/unsubscribe_type.ts | 2 +- .../packages/sdk/src/client_api/update_status_type.ts | 2 +- .../packages/sdk/src/client_api/update_status_variants.ts | 2 +- .../test-app/src/module_bindings/create_player_reducer.ts | 2 +- .../typescript/packages/test-app/src/module_bindings/index.ts | 4 ++-- .../packages/test-app/src/module_bindings/player_table.ts | 2 +- .../packages/test-app/src/module_bindings/player_type.ts | 2 +- .../packages/test-app/src/module_bindings/point_type.ts | 2 +- .../test-app/src/module_bindings/unindexed_player_table.ts | 2 +- .../test-app/src/module_bindings/unindexed_player_type.ts | 2 +- .../packages/test-app/src/module_bindings/user_table.ts | 2 +- .../packages/test-app/src/module_bindings/user_type.ts | 2 +- 101 files changed, 104 insertions(+), 104 deletions(-) diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts index b633e704273..feab7f22b4a 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts index b2e37af5a81..df1992c048f 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/index_type_type.ts b/crates/bindings-typescript/src/autogen/index_type_type.ts index 3d0851e7791..ff61a7cc6a0 100644 --- a/crates/bindings-typescript/src/autogen/index_type_type.ts +++ b/crates/bindings-typescript/src/autogen/index_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/index_type_variants.ts b/crates/bindings-typescript/src/autogen/index_type_variants.ts index 8655233a9dc..30e120ae9a2 100644 --- a/crates/bindings-typescript/src/autogen/index_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/index_type_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/lifecycle_type.ts b/crates/bindings-typescript/src/autogen/lifecycle_type.ts index bdc05ff8f2e..950f5d110df 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_type.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts index 3f525b71a81..f08120a97e0 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts index 576af678c8d..a904ba7fd59 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts index c5d64f48050..5bca056d4db 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/product_type_element_type.ts b/crates/bindings-typescript/src/autogen/product_type_element_type.ts index 8e61adf3c39..bf8ed63332c 100644 --- a/crates/bindings-typescript/src/autogen/product_type_element_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/product_type_type.ts b/crates/bindings-typescript/src/autogen/product_type_type.ts index 9646caeb9d4..a19be70fe43 100644 --- a/crates/bindings-typescript/src/autogen/product_type_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts index 13a86275e81..da026b6e186 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts index b0c49d4f056..1287d2d766d 100644 --- a/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_column_default_value_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts index 5df61a528f0..d5df3e0e100 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts index 9f4183daae9..d71210f5642 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts index fae463b280b..58bf26292b7 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts index 6631d910716..a2ef77c6cbc 100644 --- a/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts index 637cdbb721e..c839cbb70ff 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts index 18f4b36caf3..3319c94afab 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts index be09abc83be..722d25763aa 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts index b2e1df9f7f1..8e025d9f999 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts index 69910ce7e09..ad225023ba2 100644 --- a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts index e42936cb3e1..3e15b9f03eb 100644 --- a/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts index 9615fe95338..2d49ba95a02 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts index 5bca6244434..47c4c3e93c2 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts index f237b3cfe03..ce498ca27f6 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts index 505a5af4b40..017e8abb3fe 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts index 1917bbc4fa8..58f662325a8 100644 --- a/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts index 3a1aa101294..61ddf168f08 100644 --- a/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts index 65a9d359099..6ae9374b3a3 100644 --- a/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_schedule_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts index 0f5f8316d48..1973b4beac0 100644 --- a/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts index 577ccfc1bca..d6ce72bfe7c 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts index b8fbac27fea..acc62576c00 100644 --- a/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts index 814744d7a32..e1077966889 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts index a127ae31b8b..34da2e5f652 100644 --- a/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts index fdc5f278b67..84cd101c664 100644 --- a/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_type_def_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts index 4ab42566279..8a505a021ba 100644 --- a/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_v_9_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/reducer_def_type.ts b/crates/bindings-typescript/src/autogen/reducer_def_type.ts index da704043732..e5b814cec0b 100644 --- a/crates/bindings-typescript/src/autogen/reducer_def_type.ts +++ b/crates/bindings-typescript/src/autogen/reducer_def_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/sum_type_type.ts b/crates/bindings-typescript/src/autogen/sum_type_type.ts index 12d3cb9294f..d0b4b0d7d78 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts index 6d1cf358856..9b329209226 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_access_type.ts b/crates/bindings-typescript/src/autogen/table_access_type.ts index 556adf9496e..1046355d4b5 100644 --- a/crates/bindings-typescript/src/autogen/table_access_type.ts +++ b/crates/bindings-typescript/src/autogen/table_access_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_access_variants.ts b/crates/bindings-typescript/src/autogen/table_access_variants.ts index c7c94bb09b5..f1e870b26de 100644 --- a/crates/bindings-typescript/src/autogen/table_access_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_access_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_desc_type.ts b/crates/bindings-typescript/src/autogen/table_desc_type.ts index 475c6b994c5..3f5ffdfb4c1 100644 --- a/crates/bindings-typescript/src/autogen/table_desc_type.ts +++ b/crates/bindings-typescript/src/autogen/table_desc_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_type_type.ts b/crates/bindings-typescript/src/autogen/table_type_type.ts index 0bcbec9585b..521e5482d1d 100644 --- a/crates/bindings-typescript/src/autogen/table_type_type.ts +++ b/crates/bindings-typescript/src/autogen/table_type_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/table_type_variants.ts b/crates/bindings-typescript/src/autogen/table_type_variants.ts index 8e655f8b985..4452eeb3646 100644 --- a/crates/bindings-typescript/src/autogen/table_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_type_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/type_alias_type.ts b/crates/bindings-typescript/src/autogen/type_alias_type.ts index edc738850a5..3979a8ca780 100644 --- a/crates/bindings-typescript/src/autogen/type_alias_type.ts +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts index 43b9ee016d1..940777acc8b 100644 --- a/crates/bindings-typescript/src/autogen/typespace_type.ts +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit ff523588610ff8945b900c991264bb7db9c41e86). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts index bb04f3176b9..f8475bcf68f 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts index 1ef486ec8d4..30040f9ce0b 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts index 11268f7f93f..34640f577e2 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ @@ -88,7 +88,7 @@ const REMOTE_MODULE = { }, }, versionInfo: { - cliVersion: '1.3.2', + cliVersion: '1.4.0', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts index 5527a695844..25d18af1e5e 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts index 5b279400d42..51ee540553e 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts index 9127abe5d24..77abc3ba6f7 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts index 34e3b35c33f..ba20079cdc4 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts index 00e1516b716..c5621d4662b 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts index 8d0d503921c..2d4ef93d4a2 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts +++ b/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts b/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts index 27e7dec5bd9..06c9f1046a5 100644 --- a/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/bsatn_row_list_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts b/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts index 60b80f0af2b..9c64ab288c0 100644 --- a/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/call_reducer_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts index f219c9993ca..cec53446b34 100644 --- a/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts b/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts index 6f3e0725412..1966e580ad1 100644 --- a/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts index 840142d7c75..971b48d57a6 100644 --- a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts index c08053c3f4e..334f7554a14 100644 --- a/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts index f27ce5c6502..4f474aa0dd2 100644 --- a/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts b/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts index 88560f3a3c3..5c63a4a9d86 100644 --- a/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/energy_quanta_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts b/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts index 8137f7b7a01..8aa6ffe1587 100644 --- a/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/identity_token_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/index.ts b/sdks/typescript/packages/sdk/src/client_api/index.ts index 65be9435c71..2a85ea7879b 100644 --- a/sdks/typescript/packages/sdk/src/client_api/index.ts +++ b/sdks/typescript/packages/sdk/src/client_api/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ @@ -101,7 +101,7 @@ const REMOTE_MODULE = { tables: {}, reducers: {}, versionInfo: { - cliVersion: '1.3.2', + cliVersion: '1.4.0', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. diff --git a/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts b/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts index 4f25b976bf8..c61c64e85d0 100644 --- a/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/initial_subscription_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts index e3f72df78da..50fcbfa0e18 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_query_response_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts index b32cf566443..3cc954693d0 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_query_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts b/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts index ff9454dc85d..b8336eae965 100644 --- a/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/one_off_table_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts b/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts index 32ab5fcf28c..4b29a61b1fc 100644 --- a/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/query_id_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts index 9a91b909009..4103309ee73 100644 --- a/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/query_update_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts b/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts index 2507139cec3..8bc6c146545 100644 --- a/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/reducer_call_info_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts index 30ccfd1ed9b..3aea4b97f9c 100644 --- a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts index 3bfed766b47..f412f78bba9 100644 --- a/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts index 09c21779f31..0f02237db1b 100644 --- a/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts b/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts index deb1bdb0086..a71b79bc508 100644 --- a/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts index 1445bd80223..2fcf4090591 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_applied_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts index 3f05af12d12..004c57cf553 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_applied_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts index 3ec276b24c8..c0244e62dff 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_multi_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts index f6d80e7ae70..0e09b3aa8ea 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_rows_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts index d3252f853e2..72e9b53d286 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_single_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts index febcfa425b5..ba481b91c40 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts b/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts index b73eee4aade..7738c95b397 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscription_error_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts index 8bcc8479232..6199f4538c6 100644 --- a/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/table_update_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts b/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts index 7851089370f..409a5ca91e6 100644 --- a/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/transaction_update_light_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts index d497b3c9582..b83c63dfa92 100644 --- a/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/transaction_update_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts index 0954bf347c1..8aa1983eb14 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_applied_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts index 1b84117e2a2..f98c40c8064 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_applied_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts index 1688ff6a731..ed6c54d2b7e 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_multi_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts index 09f49cab038..ac996b14d44 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts index e52c0c01a5e..df646912d45 100644 --- a/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts b/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts index ebae60598e7..f962af03313 100644 --- a/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_variants.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts index bdee4664a1f..7751b363f5f 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/create_player_reducer.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/test-app/src/module_bindings/index.ts b/sdks/typescript/packages/test-app/src/module_bindings/index.ts index 4845a7731d6..26e0ad3ac7a 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/index.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ @@ -87,7 +87,7 @@ const REMOTE_MODULE = { }, }, versionInfo: { - cliVersion: '1.3.2', + cliVersion: '1.4.0', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts index 471655189a5..bcb387c81a9 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_table.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts index ebfac3b427a..369b45d3269 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/player_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts index 27112d36c1d..361b6d162d8 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/point_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts index 7ec788ac87a..2579083e21a 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_table.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts index 97800bd2232..0d621d89975 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/unindexed_player_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts index 00e1516b716..c5621d4662b 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_table.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */ diff --git a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts index e92ffc6ff4d..9745c9fac23 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/user_type.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.3.2 (commit fa0ebcb1b5626791dd6cca30eb5b3704b959feaa). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* eslint-disable */ /* tslint:disable */