From ab23399c4ef2436865ba6991e497f72586e6b657 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 21 Aug 2025 11:43:50 +0200 Subject: [PATCH 01/28] Remove some dead code (#3189) # Description of Changes This obscured other used code, so let's remove it as its dead. # API and ABI breaking changes None # Expected complexity level and risk -1 # Testing Not applicable. --- crates/lib/src/lib.rs | 64 +--------------------------- crates/schema/src/def/deserialize.rs | 17 +------- 2 files changed, 2 insertions(+), 79 deletions(-) diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs index be542dc853..f533f07698 100644 --- a/crates/lib/src/lib.rs +++ b/crates/lib/src/lib.rs @@ -2,7 +2,7 @@ use crate::db::raw_def::v9::RawModuleDefV9Builder; use crate::db::raw_def::RawTableDefV8; use anyhow::Context; use sats::typespace::TypespaceBuilder; -use spacetimedb_sats::{impl_serialize, WithTypespace}; +use spacetimedb_sats::WithTypespace; use std::any::TypeId; use std::collections::{btree_map, BTreeMap}; @@ -126,68 +126,6 @@ pub struct ReducerDef { pub args: Vec, } -impl ReducerDef { - pub fn encode(&self, writer: &mut impl buffer::BufWriter) { - bsatn::to_writer(writer, self).unwrap() - } - - pub fn serialize_args<'a>(ty: sats::WithTypespace<'a, Self>, value: &'a ProductValue) -> impl ser::Serialize + 'a { - ReducerArgsWithSchema { value, ty } - } - - pub fn deserialize( - ty: sats::WithTypespace<'_, Self>, - ) -> impl for<'de> de::DeserializeSeed<'de, Output = ProductValue> + '_ { - ReducerDeserialize(ty) - } -} - -struct ReducerDeserialize<'a>(sats::WithTypespace<'a, ReducerDef>); - -impl<'de> de::DeserializeSeed<'de> for ReducerDeserialize<'_> { - type Output = ProductValue; - - fn deserialize>(self, deserializer: D) -> Result { - deserializer.deserialize_product(self) - } -} - -impl<'de> de::ProductVisitor<'de> for ReducerDeserialize<'_> { - type Output = ProductValue; - - fn product_name(&self) -> Option<&str> { - Some(&self.0.ty().name) - } - fn product_len(&self) -> usize { - self.0.ty().args.len() - } - fn product_kind(&self) -> de::ProductKind { - de::ProductKind::ReducerArgs - } - - fn visit_seq_product>(self, tup: A) -> Result { - de::visit_seq_product(self.0.map(|r| &*r.args), &self, tup) - } - - fn visit_named_product>(self, tup: A) -> Result { - de::visit_named_product(self.0.map(|r| &*r.args), &self, tup) - } -} - -struct ReducerArgsWithSchema<'a> { - value: &'a ProductValue, - ty: sats::WithTypespace<'a, ReducerDef>, -} -impl_serialize!([] ReducerArgsWithSchema<'_>, (self, ser) => { - use itertools::Itertools; - use ser::SerializeSeqProduct; - let mut seq = ser.serialize_seq_product(self.value.elements.len())?; - for (value, elem) in self.value.elements.iter().zip_eq(&self.ty.ty().args) { - seq.serialize_element(&self.ty.with(&elem.algebraic_type).with_value(value))?; - } - seq.end() -}); - //WARNING: Change this structure (or any of their members) is an ABI change. #[derive(Debug, Clone, Default, SpacetimeType)] #[cfg_attr(feature = "test", derive(PartialEq, Eq, PartialOrd, Ord))] diff --git a/crates/schema/src/def/deserialize.rs b/crates/schema/src/def/deserialize.rs index 5d29122a64..a5a1424058 100644 --- a/crates/schema/src/def/deserialize.rs +++ b/crates/schema/src/def/deserialize.rs @@ -1,8 +1,7 @@ //! Helpers to allow deserializing data using a ReducerDef. use crate::def::ReducerDef; -use spacetimedb_lib::sats::{self, de, ser, ProductValue}; -use spacetimedb_sats::impl_serialize; +use spacetimedb_lib::sats::{self, de, ProductValue}; /// Wrapper around a `ReducerDef` that allows deserializing to a `ProductValue` at the type /// of the reducer's parameter `ProductType`. @@ -45,17 +44,3 @@ impl<'de> de::ProductVisitor<'de> for ReducerArgsDeserializeSeed<'_> { de::visit_named_product(self.0.map(|r| &*r.params.elements), &self, tup) } } - -pub struct ReducerArgsWithSchema<'a> { - value: &'a ProductValue, - ty: sats::WithTypespace<'a, ReducerDef>, -} -impl_serialize!([] ReducerArgsWithSchema<'_>, (self, ser) => { - use itertools::Itertools; - use ser::SerializeSeqProduct; - let mut seq = ser.serialize_seq_product(self.value.elements.len())?; - for (value, elem) in self.value.elements.iter().zip_eq(&*self.ty.ty().params.elements) { - seq.serialize_element(&self.ty.with(&elem.algebraic_type).with_value(value))?; - } - seq.end() -}); From a862ba9373b0d19f7eefbd42b47c49b4e7df3e04 Mon Sep 17 00:00:00 2001 From: Shubham Mishra Date: Thu, 21 Aug 2025 15:41:00 +0530 Subject: [PATCH 02/28] Pretty print: sort hashmap iters (#3188) # Description of Changes Iterating over a HashMap does not guarantee any ordering of the items. To ensure consistent and predictable pretty-printing, explicitly sort entries. # API and ABI breaking changes NA # Expected complexity level and risk 0 --- crates/schema/src/auto_migrate/formatter.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/schema/src/auto_migrate/formatter.rs b/crates/schema/src/auto_migrate/formatter.rs index bd38f52c17..54b4ed87ce 100644 --- a/crates/schema/src/auto_migrate/formatter.rs +++ b/crates/schema/src/auto_migrate/formatter.rs @@ -8,6 +8,7 @@ use crate::{ def::{ConstraintData, ModuleDef, ScheduleDef}, identifier::Identifier, }; +use itertools::Itertools; use spacetimedb_lib::{ db::raw_def::v9::{RawRowLevelSecurityDefV9, TableAccess, TableType}, AlgebraicType, AlgebraicValue, @@ -247,6 +248,7 @@ fn extract_table_info( let constraints = table_def .constraints .values() + .sorted_by_key(|c| c.name.clone()) .map(|constraint| { let ConstraintData::Unique(unique) = &constraint.data; Ok(ConstraintInfo { @@ -267,6 +269,7 @@ fn extract_table_info( let indexes = table_def .indexes .values() + .sorted_by_key(|c| c.name.clone()) .map(|index| { let columns = match &index.algorithm { IndexAlgorithm::BTree(btree) => btree @@ -296,6 +299,7 @@ fn extract_table_info( let sequences = table_def .sequences .values() + .sorted_by_key(|c| c.name.clone()) .map(|sequence| { let column = table_def .get_column(sequence.column) From be1bd22518365e5acea4f29c900032834dd7bc00 Mon Sep 17 00:00:00 2001 From: joshua-spacetime Date: Thu, 21 Aug 2025 10:18:24 -0700 Subject: [PATCH 03/28] Disable column type changes in an automigration (#3178) # Description of Changes Disables automigrations for column type changes # API and ABI breaking changes None # Expected complexity level and risk 0 # Testing - [x] Updated smoketests --- crates/core/src/db/relational_db.rs | 1 + crates/core/src/db/update.rs | 12 ++--- smoketests/tests/auto_migration.py | 72 +++++++---------------------- 3 files changed, 20 insertions(+), 65 deletions(-) diff --git a/crates/core/src/db/relational_db.rs b/crates/core/src/db/relational_db.rs index 6fec0c1b62..388f18138e 100644 --- a/crates/core/src/db/relational_db.rs +++ b/crates/core/src/db/relational_db.rs @@ -1043,6 +1043,7 @@ impl RelationalDB { Ok(self.inner.alter_table_access_mut_tx(tx, name, access)?) } + #[allow(unused)] pub(crate) fn alter_table_row_type( &self, tx: &mut MutTx, diff --git a/crates/core/src/db/update.rs b/crates/core/src/db/update.rs index d2496b5bdb..1be4f434d1 100644 --- a/crates/core/src/db/update.rs +++ b/crates/core/src/db/update.rs @@ -9,7 +9,7 @@ use spacetimedb_lib::AlgebraicValue; use spacetimedb_primitives::{ColSet, TableId}; use spacetimedb_schema::auto_migrate::{AutoMigratePlan, ManualMigratePlan, MigratePlan}; use spacetimedb_schema::def::TableDef; -use spacetimedb_schema::schema::{column_schemas_from_defs, IndexSchema, Schema, SequenceSchema, TableSchema}; +use spacetimedb_schema::schema::{IndexSchema, Schema, SequenceSchema, TableSchema}; use std::sync::Arc; /// The logger used for by [`update_database`] and friends. @@ -222,14 +222,8 @@ fn auto_migrate_database( ); stdb.drop_sequence(tx, sequence_schema.sequence_id)?; } - spacetimedb_schema::auto_migrate::AutoMigrateStep::ChangeColumns(table_name) => { - let table_def = plan.new.stored_in_table_def(table_name).unwrap(); - let table_id = stdb.table_id_from_name_mut(tx, table_name).unwrap().unwrap(); - let column_schemas = column_schemas_from_defs(plan.new, &table_def.columns, table_id); - - log!(logger, "Changing columns of table `{}`", table_name); - - stdb.alter_table_row_type(tx, table_id, column_schemas)?; + spacetimedb_schema::auto_migrate::AutoMigrateStep::ChangeColumns(_table_name) => { + anyhow::bail!("Unsupported: Changing column types"); } spacetimedb_schema::auto_migrate::AutoMigrateStep::ChangeAccess(table_name) => { let table_def = plan.new.stored_in_table_def(table_name).unwrap(); diff --git a/smoketests/tests/auto_migration.py b/smoketests/tests/auto_migration.py index f338e718c2..35c79f270c 100644 --- a/smoketests/tests/auto_migration.py +++ b/smoketests/tests/auto_migration.py @@ -4,27 +4,23 @@ import logging class AddTableAutoMigration(Smoketest): - MODULE_CODE_INIT = """ + MODULE_CODE = """ use spacetimedb::{log, ReducerContext, Table, SpacetimeType}; -use PersonKind::*; #[spacetimedb::table(name = person, public)] pub struct Person { name: String, - kind: PersonKind, } #[spacetimedb::reducer] -pub fn add_person(ctx: &ReducerContext, name: String, kind: String) { - let kind = kind_from_string(kind); - ctx.db.person().insert(Person { name, kind }); +pub fn add_person(ctx: &ReducerContext, name: String) { + ctx.db.person().insert(Person { name }); } #[spacetimedb::reducer] pub fn print_persons(ctx: &ReducerContext, prefix: String) { for person in ctx.db.person().iter() { - let kind = kind_to_string(person.kind); - log::info!("{prefix}: {} - {kind}", person.name); + log::info!("{}: {}", prefix, person.name); } } @@ -43,47 +39,11 @@ pub struct Vector2 { #[spacetimedb::client_visibility_filter] const PERSON_VISIBLE: spacetimedb::Filter = spacetimedb::Filter::Sql("SELECT * FROM person"); -""" - - MODULE_CODE = MODULE_CODE_INIT + """ -#[derive(SpacetimeType, Clone, Copy, PartialEq, Eq)] -pub enum PersonKind { - Student, -} - -fn kind_from_string(_: String) -> PersonKind { - Student -} - -fn kind_to_string(Student: PersonKind) -> &'static str { - "Student" -} """ MODULE_CODE_UPDATED = ( - MODULE_CODE_INIT + MODULE_CODE + """ -#[derive(SpacetimeType, Clone, Copy, PartialEq, Eq)] -pub enum PersonKind { - Student, - Professor, -} - -fn kind_from_string(kind: String) -> PersonKind { - match &*kind { - "Student" => Student, - "Professor" => Professor, - _ => panic!(), - } -} - -fn kind_to_string(kind: PersonKind) -> &'static str { - match kind { - Student => "Student", - Professor => "Professor", - } -} - #[spacetimedb::table(name = book, public)] pub struct Book { isbn: String, @@ -129,14 +89,14 @@ const BOOK_VISIBLE: spacetimedb::Filter = spacetimedb::Filter::Sql("SELECT * FRO logging.info("Initial publish complete") # initial module code is already published by test framework - self.call("add_person", "Robert", "Student") - self.call("add_person", "Julie", "Student") - self.call("add_person", "Samantha", "Student") + self.call("add_person", "Robert") + self.call("add_person", "Julie") + self.call("add_person", "Samantha") self.call("print_persons", "BEFORE") logs = self.logs(100) - self.assertIn("BEFORE: Samantha - Student", logs) - self.assertIn("BEFORE: Julie - Student", logs) - self.assertIn("BEFORE: Robert - Student", logs) + self.assertIn("BEFORE: Samantha", logs) + self.assertIn("BEFORE: Julie", logs) + self.assertIn("BEFORE: Robert", logs) logging.info( "Initial operations complete, updating module without clear", @@ -160,16 +120,16 @@ const BOOK_VISIBLE: spacetimedb::Filter = spacetimedb::Filter::Sql("SELECT * FRO self.logs(100) - self.call("add_person", "Husserl", "Professor") + self.call("add_person", "Husserl") self.call("add_book", "1234567890") self.call("print_persons", "AFTER_PERSON") self.call("print_books", "AFTER_BOOK") logs = self.logs(100) - self.assertIn("AFTER_PERSON: Samantha - Student", logs) - self.assertIn("AFTER_PERSON: Julie - Student", logs) - self.assertIn("AFTER_PERSON: Robert - Student", logs) - self.assertIn("AFTER_PERSON: Husserl - Professor", logs) + self.assertIn("AFTER_PERSON: Samantha", logs) + self.assertIn("AFTER_PERSON: Julie", logs) + self.assertIn("AFTER_PERSON: Robert", logs) + self.assertIn("AFTER_PERSON: Husserl", logs) self.assertIn("AFTER_BOOK: 1234567890", logs) From 2a070360cf8fa014356ce5e7742ad03db606e4ab Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 21 Aug 2025 19:39:47 +0200 Subject: [PATCH 04/28] Refactor and extract `call_reducer` and `update_database` machinery for reuse by V8 (#3190) # Description of Changes Refactors the machinery of call_reducer and update_database to a) have smaller pieces that make up the whole so that the code becomes clearer b) extract all the VM-independent stuff so that it can be reused by V8 modules. This is best reviewed commit by commit. # API and ABI breaking changes None. # Expected complexity level and risk 2, it's an important place, but this is doing just code motion. # Testing No semantic changes, just code motion. --- crates/core/src/host/v8/key_cache.rs | 6 +- crates/core/src/host/v8/mod.rs | 8 +- .../src/host/wasm_common/module_host_actor.rs | 412 +++++++++++------- .../core/src/host/wasmtime/wasmtime_module.rs | 10 +- 4 files changed, 270 insertions(+), 166 deletions(-) diff --git a/crates/core/src/host/v8/key_cache.rs b/crates/core/src/host/v8/key_cache.rs index 4033a358d9..4b4f105c8c 100644 --- a/crates/core/src/host/v8/key_cache.rs +++ b/crates/core/src/host/v8/key_cache.rs @@ -22,7 +22,7 @@ pub(super) struct KeyCache { tag: Option>, /// The `value` property for sum values in JS. value: Option>, - /// The `describe_module` property on the global proxy object. + /// The `__describe_module__` property on the global proxy object. describe_module: Option>, } @@ -37,9 +37,9 @@ impl KeyCache { Self::get_or_create_key(scope, &mut self.value, "value") } - /// Returns the `describe_module` property name. + /// Returns the `__describe_module__` property name. pub(super) fn describe_module<'scope>(&mut self, scope: &mut HandleScope<'scope>) -> Local<'scope, v8::String> { - Self::get_or_create_key(scope, &mut self.describe_module, "describe_module") + Self::get_or_create_key(scope, &mut self.describe_module, "__describe_module__") } /// Returns an interned string corresponding to `string` diff --git a/crates/core/src/host/v8/mod.rs b/crates/core/src/host/v8/mod.rs index 1fe3ee7609..ac0316014e 100644 --- a/crates/core/src/host/v8/mod.rs +++ b/crates/core/src/host/v8/mod.rs @@ -134,9 +134,9 @@ impl ModuleInstance for JsInstance { } } -// Calls the `describe_module` function on the global proxy object to extract a [`RawModuleDef`]. +// Calls the `__describe_module__` function on the global proxy object to extract a [`RawModuleDef`]. fn call_describe_module(scope: &mut HandleScope<'_>) -> anyhow::Result { - // Get a cached version of the `describe_module` property. + // Get a cached version of the `__describe_module__` property. let key_cache = get_or_create_key_cache(scope); let describe_module_key = key_cache.borrow_mut().describe_module(scope).into(); @@ -150,7 +150,7 @@ fn call_describe_module(scope: &mut HandleScope<'_>) -> anyhow::Result &InstanceEnv; - type Trap: Send; + fn call_reducer(&mut self, op: ReducerOp<'_>, budget: ReducerBudget) -> ExecuteResult; - fn call_reducer(&mut self, op: ReducerOp<'_>, budget: ReducerBudget) -> ExecuteResult; - - fn log_traceback(func_type: &str, func: &str, trap: &Self::Trap); + fn log_traceback(func_type: &str, func: &str, trap: &anyhow::Error); } pub struct EnergyStats { @@ -71,11 +71,11 @@ pub struct ExecutionTimings { pub wasm_instance_env_call_times: CallTimes, } -pub struct ExecuteResult { +pub struct ExecuteResult { pub energy: EnergyStats, pub timings: ExecutionTimings, pub memory_allocation: usize, - pub call_result: Result>, E>, + pub call_result: Result>, anyhow::Error>, } pub(crate) struct WasmModuleHostActor { @@ -161,8 +161,7 @@ impl WasmModuleHostActor { impl WasmModuleHostActor { fn make_from_instance(&self, instance: T::Instance) -> WasmModuleInstance { - WasmModuleInstance { - instance, + let common = InstanceCommon { info: self.common.info(), energy_monitor: self.common.energy_monitor(), // will be updated on the first reducer call @@ -171,7 +170,8 @@ impl WasmModuleHostActor { .wasm_memory_bytes .with_label_values(self.common.database_identity()), trapped: false, - } + }; + WasmModuleInstance { instance, common } } } @@ -214,72 +214,29 @@ impl Module for WasmModuleHostActor { pub struct WasmModuleInstance { instance: T, - info: Arc, - energy_monitor: Arc, - allocated_memory: usize, - metric_wasm_memory_bytes: IntGauge, - trapped: bool, + common: InstanceCommon, } impl std::fmt::Debug for WasmModuleInstance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("WasmInstanceActor") - .field("trapped", &self.trapped) + .field("trapped", &self.common.trapped) .finish() } } -impl WasmModuleInstance { - fn replica_context(&self) -> &ReplicaContext { - &self.instance.instance_env().replica_ctx - } -} - impl ModuleInstance for WasmModuleInstance { fn trapped(&self) -> bool { - self.trapped + self.common.trapped } - #[tracing::instrument(level = "trace", skip_all)] fn update_database( &mut self, program: Program, old_module_info: Arc, ) -> Result { - let plan = ponder_migrate(&old_module_info.module_def, &self.info.module_def); - let plan = match plan { - Ok(plan) => plan, - Err(errs) => { - return Ok(UpdateDatabaseResult::AutoMigrateError(errs)); - } - }; - let stdb = &*self.replica_context().relational_db; - - let program_hash = program.hash; - let tx = stdb.begin_mut_tx(IsolationLevel::Serializable, Workload::Internal); - let (mut tx, _) = stdb.with_auto_rollback(tx, |tx| stdb.update_program(tx, HostType::Wasm, program))?; - self.system_logger().info(&format!("Updated program to {program_hash}")); - - let auth_ctx = AuthCtx::for_current(self.replica_context().database.owner_identity); - let res = crate::db::update::update_database(stdb, &mut tx, auth_ctx, plan, self.system_logger()); - - match res { - Err(e) => { - log::warn!("Database update failed: {} @ {}", e, stdb.database_identity()); - self.system_logger().warn(&format!("Database update failed: {e}")); - let (tx_metrics, reducer) = stdb.rollback_mut_tx(tx); - stdb.report_mut_tx_metrics(reducer, tx_metrics, None); - Ok(UpdateDatabaseResult::ErrorExecutingMigration(e)) - } - Ok(()) => { - if let Some((tx_data, tx_metrics, reducer)) = stdb.commit_tx(tx)? { - stdb.report_mut_tx_metrics(reducer, tx_metrics, Some(tx_data)); - } - self.system_logger().info("Database updated"); - log::info!("Database updated, {}", stdb.database_identity()); - Ok(UpdateDatabaseResult::UpdatePerformed) - } - } + let replica_ctx = &self.instance.instance_env().replica_ctx; + self.common.update_database(replica_ctx, program, old_module_info) } fn call_reducer(&mut self, tx: Option, params: CallReducerParams) -> ReducerCallResult { @@ -288,6 +245,78 @@ impl ModuleInstance for WasmModuleInstance { } impl WasmModuleInstance { + #[tracing::instrument(level = "trace", skip_all)] + fn call_reducer_with_tx(&mut self, tx: Option, params: CallReducerParams) -> ReducerCallResult { + self.common.call_reducer_with_tx( + &self.instance.instance_env().replica_ctx.clone(), + tx, + params, + |ty, fun, err| T::log_traceback(ty, fun, err), + |tx, op, budget| { + self.instance + .instance_env() + .tx + .clone() + .set(tx, || self.instance.call_reducer(op, budget)) + }, + ) + } +} + +struct InstanceCommon { + info: Arc, + energy_monitor: Arc, + allocated_memory: usize, + metric_wasm_memory_bytes: IntGauge, + trapped: bool, +} + +impl InstanceCommon { + #[tracing::instrument(level = "trace", skip_all)] + fn update_database( + &mut self, + replica_ctx: &ReplicaContext, + program: Program, + old_module_info: Arc, + ) -> Result { + let system_logger = replica_ctx.logger.system_logger(); + let stdb = &replica_ctx.relational_db; + + let plan = ponder_migrate(&old_module_info.module_def, &self.info.module_def); + let plan = match plan { + Ok(plan) => plan, + Err(errs) => { + return Ok(UpdateDatabaseResult::AutoMigrateError(errs)); + } + }; + + let program_hash = program.hash; + let tx = stdb.begin_mut_tx(IsolationLevel::Serializable, Workload::Internal); + let (mut tx, _) = stdb.with_auto_rollback(tx, |tx| stdb.update_program(tx, HostType::Wasm, program))?; + system_logger.info(&format!("Updated program to {program_hash}")); + + let auth_ctx = AuthCtx::for_current(replica_ctx.database.owner_identity); + let res = crate::db::update::update_database(stdb, &mut tx, auth_ctx, plan, system_logger); + + match res { + Err(e) => { + log::warn!("Database update failed: {} @ {}", e, stdb.database_identity()); + system_logger.warn(&format!("Database update failed: {e}")); + let (tx_metrics, reducer) = stdb.rollback_mut_tx(tx); + stdb.report_mut_tx_metrics(reducer, tx_metrics, None); + Ok(UpdateDatabaseResult::ErrorExecutingMigration(e)) + } + Ok(()) => { + if let Some((tx_data, tx_metrics, reducer)) = stdb.commit_tx(tx)? { + stdb.report_mut_tx_metrics(reducer, tx_metrics, Some(tx_data)); + } + system_logger.info("Database updated"); + log::info!("Database updated, {}", stdb.database_identity()); + Ok(UpdateDatabaseResult::UpdatePerformed) + } + } + } + /// Execute a reducer. /// /// If `Some` [`MutTxId`] is supplied, the reducer is called within the @@ -304,8 +333,14 @@ impl WasmModuleInstance { /// The method also performs various measurements and records energy usage, /// as well as broadcasting a [`ModuleEvent`] containing information about /// the outcome of the call. - #[tracing::instrument(level = "trace", skip_all)] - fn call_reducer_with_tx(&mut self, tx: Option, params: CallReducerParams) -> ReducerCallResult { + fn call_reducer_with_tx( + &mut self, + replica_ctx: &ReplicaContext, + tx: Option, + params: CallReducerParams, + log_traceback: impl FnOnce(&str, &str, &anyhow::Error), + vm_call_reducer: impl FnOnce(MutTxId, ReducerOp<'_>, ReducerBudget) -> (MutTxId, ExecuteResult), + ) -> ReducerCallResult { let CallReducerParams { timestamp, caller_identity, @@ -318,18 +353,17 @@ impl WasmModuleInstance { } = params; let caller_connection_id_opt = (caller_connection_id != ConnectionId::ZERO).then_some(caller_connection_id); - let replica_ctx = self.replica_context(); let stdb = &*replica_ctx.relational_db.clone(); let database_identity = replica_ctx.database_identity; let reducer_def = self.info.module_def.reducer_by_id(reducer_id); let reducer_name = &*reducer_def.name; + let reducer = reducer_name.to_string(); - let _outer_span = tracing::trace_span!("call_reducer", - reducer_name, - %caller_identity, - caller_connection_id = caller_connection_id_opt.map(tracing::field::debug), - ) - .entered(); + // Do some `with_label_values`. + // TODO(perf, centril): consider caching this. + let vm_metrics = VmMetrics::new(&database_identity, reducer_name); + + let _outer_span = start_call_reducer_span(reducer_name, &caller_identity, caller_connection_id_opt); let energy_fingerprint = ReducerFingerprint { module_hash: self.info.module_hash, @@ -348,35 +382,13 @@ impl WasmModuleInstance { arg_bytes: args.get_bsatn().clone(), }; - // Before we take the lock, do some `with_label_values`. - let metric_reducer_plus_query_duration = WORKER_METRICS - .reducer_plus_query_duration - .with_label_values(&database_identity, op.name); - let metric_reducer_wasmtime_fuel_used = DB_METRICS - .reducer_wasmtime_fuel_used - .with_label_values(&database_identity, reducer_name); - let metric_reducer_duration_usec = DB_METRICS - .reducer_duration_usec - .with_label_values(&database_identity, reducer_name); - let metric_reducer_abi_time_usec = DB_METRICS - .reducer_abi_time_usec - .with_label_values(&database_identity, reducer_name); - let workload = Workload::Reducer(ReducerContext::from(op.clone())); let tx = tx.unwrap_or_else(|| stdb.begin_mut_tx(IsolationLevel::Serializable, workload)); - let _guard = metric_reducer_plus_query_duration.with_timer(tx.timer); + let _guard = vm_metrics.timer_guard_for_reducer_plus_query(tx.timer); - let mut tx_slot = self.instance.instance_env().tx.clone(); + let reducer_span = start_run_reducer_span(budget); - let reducer_span = tracing::trace_span!( - "run_reducer", - timings.total_duration = tracing::field::Empty, - energy.budget = budget.get(), - energy.used = tracing::field::Empty, - ) - .entered(); - - let (mut tx, result) = tx_slot.set(tx, || self.instance.call_reducer(op, budget)); + let (mut tx, result) = vm_call_reducer(tx, op, budget); let ExecuteResult { energy, @@ -385,9 +397,11 @@ impl WasmModuleInstance { call_result, } = result; - metric_reducer_wasmtime_fuel_used.inc_by(energy.wasmtime_fuel_used); - metric_reducer_duration_usec.inc_by(timings.total_duration.as_micros() as u64); - metric_reducer_abi_time_usec.inc_by(timings.wasm_instance_env_call_times.sum().as_micros() as u64); + vm_metrics.report( + energy.wasmtime_fuel_used, + timings.total_duration, + &timings.wasm_instance_env_call_times, + ); self.energy_monitor .record_reducer(&energy_fingerprint, energy.used, timings.total_duration); @@ -400,20 +414,12 @@ impl WasmModuleInstance { .record("timings.total_duration", tracing::field::debug(timings.total_duration)) .record("energy.used", tracing::field::debug(energy.used)); - const FRAME_LEN_60FPS: Duration = Duration::from_secs(1).checked_div(60).unwrap(); - if timings.total_duration > FRAME_LEN_60FPS { - // If we can't get your reducer done in a single frame we should debug it. - tracing::debug!( - message = "Long running reducer finished executing", - reducer_name, - ?timings.total_duration, - ); - } + maybe_log_long_running_reducer(reducer_name, timings.total_duration); reducer_span.exit(); let status = match call_result { Err(err) => { - T::log_traceback("reducer", reducer_name, &err); + log_traceback("reducer", reducer_name, &err); WORKER_METRICS .wasm_instance_errors @@ -434,40 +440,24 @@ impl WasmModuleInstance { EventStatus::Failed("The Wasm instance encountered a fatal error.".into()) } } - Ok(Err(errmsg)) => { - log::info!("reducer returned error: {errmsg}"); - - self.replica_context().logger.write( - database_logger::LogLevel::Error, - &database_logger::Record { - ts: chrono::DateTime::from_timestamp_micros(timestamp.to_micros_since_unix_epoch()).unwrap(), - target: Some(reducer_name), - filename: None, - line_number: None, - message: &errmsg, - }, - &(), - ); - EventStatus::Failed(errmsg.into()) - } // We haven't actually committed yet - `commit_and_broadcast_event` will commit // for us and replace this with the actual database update. - // - // Detecting a new client, and inserting it in `st_clients` - // and conversely removing from `st_clients` on disconnect. - Ok(Ok(())) => { - let res = match reducer_def.lifecycle { - Some(Lifecycle::OnConnect) => tx.insert_st_client(caller_identity, caller_connection_id), - Some(Lifecycle::OnDisconnect) => { - tx.delete_st_client(caller_identity, caller_connection_id, database_identity) - } - _ => Ok(()), - }; - match res { - Ok(()) => EventStatus::Committed(DatabaseUpdate::default()), - Err(err) => EventStatus::Failed(err.to_string()), + Ok(res) => match res.and_then(|()| { + lifecyle_modifications_to_tx( + reducer_def.lifecycle, + caller_identity, + caller_connection_id, + database_identity, + &mut tx, + ) + }) { + Ok(()) => EventStatus::Committed(DatabaseUpdate::default()), + Err(err) => { + log::info!("reducer returned error: {err}"); + log_reducer_error(replica_ctx, timestamp, reducer_name, &err); + EventStatus::Failed(err.into()) } - } + }, }; let event = ModuleEvent { @@ -475,7 +465,7 @@ impl WasmModuleInstance { caller_identity, caller_connection_id: caller_connection_id_opt, function_call: ModuleFunctionCall { - reducer: reducer_name.to_owned(), + reducer, reducer_id, args, }, @@ -485,15 +475,7 @@ impl WasmModuleInstance { request_id, timer, }; - let (event, _) = match self - .info - .subscriptions - .commit_and_broadcast_event(client, event, tx) - .unwrap() - { - Ok(ev) => ev, - Err(WriteConflict) => todo!("Write skew, you need to implement retries my man, T-dawg."), - }; + let event = commit_and_broadcast_event(&self.info, client, event, tx); ReducerCallResult { outcome: ReducerOutcome::from(&event.status), @@ -501,10 +483,138 @@ impl WasmModuleInstance { execution_duration: timings.total_duration, } } +} - // Helpers - NOT API - fn system_logger(&self) -> &SystemLogger { - self.replica_context().logger.system_logger() +/// VM-related metrics for reducer execution. +struct VmMetrics { + /// The time spent executing a reducer + plus evaluating its subscription queries. + reducer_plus_query_duration: Histogram, + /// The total VM fuel used. + reducer_fuel_used: IntCounter, + /// The total runtime of reducer calls. + reducer_duration_usec: IntCounter, + /// The total time spent in reducer ABI calls. + reducer_abi_time_usec: IntCounter, +} + +impl VmMetrics { + /// Returns new metrics counters for `database_identity` and `reducer_name`. + fn new(database_identity: &Identity, reducer_name: &str) -> Self { + let reducer_plus_query_duration = WORKER_METRICS + .reducer_plus_query_duration + .with_label_values(database_identity, reducer_name); + let reducer_fuel_used = DB_METRICS + .reducer_wasmtime_fuel_used + .with_label_values(database_identity, reducer_name); + let reducer_duration_usec = DB_METRICS + .reducer_duration_usec + .with_label_values(database_identity, reducer_name); + let reducer_abi_time_usec = DB_METRICS + .reducer_abi_time_usec + .with_label_values(database_identity, reducer_name); + + Self { + reducer_plus_query_duration, + reducer_fuel_used, + reducer_duration_usec, + reducer_abi_time_usec, + } + } + + /// Returns a timer guard for `reducer_plus_query_duration`. + fn timer_guard_for_reducer_plus_query(&self, start: Instant) -> TimerGuard { + self.reducer_plus_query_duration.clone().with_timer(start) + } + + /// Reports some VM metrics. + fn report(&self, fuel_used: u64, reducer_duration: Duration, abi_time: &CallTimes) { + self.reducer_fuel_used.inc_by(fuel_used); + self.reducer_duration_usec.inc_by(reducer_duration.as_micros() as u64); + self.reducer_abi_time_usec.inc_by(abi_time.sum().as_micros() as u64); + } +} + +/// Starts the `call_reducer` span. +fn start_call_reducer_span( + reducer_name: &str, + caller_identity: &Identity, + caller_connection_id_opt: Option, +) -> EnteredSpan { + tracing::trace_span!("call_reducer", + reducer_name, + %caller_identity, + caller_connection_id = caller_connection_id_opt.map(tracing::field::debug), + ) + .entered() +} + +/// Starts the `run_reducer` span. +fn start_run_reducer_span(budget: ReducerBudget) -> EnteredSpan { + tracing::trace_span!( + "run_reducer", + timings.total_duration = tracing::field::Empty, + energy.budget = budget.get(), + energy.used = tracing::field::Empty, + ) + .entered() +} + +/// Logs a tracing message if a reducer doesn't finish in a single frame at 60 FPS. +fn maybe_log_long_running_reducer(reducer_name: &str, total_duration: Duration) { + const FRAME_LEN_60FPS: Duration = Duration::from_secs(1).checked_div(60).unwrap(); + if total_duration > FRAME_LEN_60FPS { + tracing::debug!( + message = "Long running reducer finished executing", + reducer_name, + ?total_duration, + ); + } +} + +/// Logs an error `message` for `reducer` at `timestamp` into `replica_ctx`. +fn log_reducer_error(replica_ctx: &ReplicaContext, timestamp: Timestamp, reducer: &str, message: &str) { + let record = database_logger::Record { + ts: chrono::DateTime::from_timestamp_micros(timestamp.to_micros_since_unix_epoch()).unwrap(), + target: Some(reducer), + filename: None, + line_number: None, + message, + }; + replica_ctx.logger.write(database_logger::LogLevel::Error, &record, &()); +} + +/// Detects lifecycle events for connecting/disconnecting a new client +/// and inserts/removes into `st_clients` depending on which. +fn lifecyle_modifications_to_tx( + lifecycle: Option, + caller_id: Identity, + caller_conn_id: ConnectionId, + db_id: Identity, + tx: &mut MutTxId, +) -> Result<(), Box> { + match lifecycle { + Some(Lifecycle::OnConnect) => tx.insert_st_client(caller_id, caller_conn_id), + Some(Lifecycle::OnDisconnect) => tx.delete_st_client(caller_id, caller_conn_id, db_id), + _ => Ok(()), + } + .map_err(|e| e.to_string().into()) +} + +/// Commits the transaction +/// and evaluates and broadcasts subscriptions updates. +fn commit_and_broadcast_event( + info: &ModuleInfo, + client: Option>, + event: ModuleEvent, + tx: MutTxId, +) -> Arc { + match info + .subscriptions + .commit_and_broadcast_event(client, event, tx) + .unwrap() + { + Ok((event, _)) => event, + Err(WriteConflict) => todo!("Write skew, you need to implement retries my man, T-dawg."), } } diff --git a/crates/core/src/host/wasmtime/wasmtime_module.rs b/crates/core/src/host/wasmtime/wasmtime_module.rs index 38f3cb0333..4995f54157 100644 --- a/crates/core/src/host/wasmtime/wasmtime_module.rs +++ b/crates/core/src/host/wasmtime/wasmtime_module.rs @@ -189,14 +189,8 @@ impl module_host_actor::WasmInstance for WasmtimeInstance { self.store.data().instance_env() } - type Trap = anyhow::Error; - #[tracing::instrument(level = "trace", skip_all)] - fn call_reducer( - &mut self, - op: ReducerOp<'_>, - budget: ReducerBudget, - ) -> module_host_actor::ExecuteResult { + fn call_reducer(&mut self, op: ReducerOp<'_>, budget: ReducerBudget) -> module_host_actor::ExecuteResult { let store = &mut self.store; // note that ReducerBudget being a u64 is load-bearing here - although we convert budget right back into // EnergyQuanta at the end of this function, from_energy_quanta clamps it to a u64 range. @@ -253,7 +247,7 @@ impl module_host_actor::WasmInstance for WasmtimeInstance { } } - fn log_traceback(func_type: &str, func: &str, trap: &Self::Trap) { + fn log_traceback(func_type: &str, func: &str, trap: &anyhow::Error) { log_traceback(func_type, func, trap) } } From d8505596b75864410dacae51f1bf77aea59885b2 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Thu, 21 Aug 2025 11:35:52 -0700 Subject: [PATCH 05/28] CI - Fix caching in C#/Unity testsuite (#3194) # Description of Changes We had weird caching issues in the C#/Unity testsuite. Somehow, they got triggered only as of https://github.com/clockworklabs/SpacetimeDB/pull/3181 merging, and I have no idea why/how. I've restored the `id` field of the checkout step (which is used by the cache step), and this _seems_ to have fixed it. # API and ABI breaking changes None. # Expected complexity level and risk 1 # Testing - [x] It passes on this PR - [x] It passes in a test PR that combines this change with https://github.com/clockworklabs/SpacetimeDB/pull/3182 --------- Co-authored-by: Zeke Foppa --- .github/workflows/csharp-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/csharp-test.yml b/.github/workflows/csharp-test.yml index d6ebcc1bfb..2017060baa 100644 --- a/.github/workflows/csharp-test.yml +++ b/.github/workflows/csharp-test.yml @@ -16,6 +16,7 @@ jobs: timeout-minutes: 30 steps: - name: Checkout repository + id: checkout-stdb uses: actions/checkout@v4 # Run cheap .NET tests first. If those fail, no need to run expensive Unity tests. From 0a46cf5dfe9d5972206a977fa7f983092c1b5be4 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 22 Aug 2025 15:29:02 +0200 Subject: [PATCH 06/28] `alter_table_row_type`: write changes to `st_column` (#3196) # Description of Changes `fn alter_table_row_type` now writes the new row type to `st_column`. This is not a fix for the adding-variants problem, but it does get us closer. # API and ABI breaking changes None # Expected complexity level and risk 2, system tables stuff is always risky. # Testing `test_alter_table_row_type_is_transactional` is amended with assertions. --- .../src/locking_tx_datastore/datastore.rs | 8 +++- .../src/locking_tx_datastore/mut_tx.rs | 38 +++++++++++++------ crates/datastore/src/system_tables.rs | 11 ++++++ 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/crates/datastore/src/locking_tx_datastore/datastore.rs b/crates/datastore/src/locking_tx_datastore/datastore.rs index d9b2ac32fe..1577a379c4 100644 --- a/crates/datastore/src/locking_tx_datastore/datastore.rs +++ b/crates/datastore/src/locking_tx_datastore/datastore.rs @@ -3284,7 +3284,13 @@ mod tests { AlgebraicType::sum([("ba", AlgebraicType::U16), ("bb", AlgebraicType::U8)]) ] ); - commit(&datastore, tx)?; + let tx_data = commit(&datastore, tx)?; + // Ensure the change has been persisted in the commitlog. + let to_product = |col: &ColumnSchema| value_serialize(&StColumnRow::from(col.clone())).into_product().unwrap(); + let (_, inserts) = tx_data.inserts().find(|(id, _)| **id == ST_COLUMN_ID).unwrap(); + assert_eq!(&**inserts, [to_product(&columns[1])].as_slice()); + let (_, deletes) = tx_data.deletes().find(|(id, _)| **id == ST_COLUMN_ID).unwrap(); + assert_eq!(&**deletes, [to_product(&columns_original[1])].as_slice()); // Check that we can successfully scan using the new schema type post commit. let tx = begin_tx(&datastore); diff --git a/crates/datastore/src/locking_tx_datastore/mut_tx.rs b/crates/datastore/src/locking_tx_datastore/mut_tx.rs index e1c92e6d20..c3346cd231 100644 --- a/crates/datastore/src/locking_tx_datastore/mut_tx.rs +++ b/crates/datastore/src/locking_tx_datastore/mut_tx.rs @@ -216,16 +216,8 @@ impl MutTxId { // Generate the full definition of the table, with the generated indexes, constraints, sequences... - // Insert the columns into `st_columns` - for col in table_schema.columns() { - let row = StColumnRow { - table_id: col.table_id, - col_pos: col.col_pos, - col_name: col.col_name.clone(), - col_type: col.col_type.clone().into(), - }; - self.insert_via_serialize_bsatn(ST_COLUMN_ID, &row)?; - } + // Insert the columns into `st_column`. + self.insert_st_column(table_schema.columns())?; let schedule = table_schema.schedule.clone(); let mut schema_internal = table_schema; @@ -279,6 +271,15 @@ impl MutTxId { Ok(table_id) } + /// Insert `columns` into `st_column`. + fn insert_st_column(&mut self, columns: &[ColumnSchema]) -> Result<()> { + columns.iter().try_for_each(|col| { + let row: StColumnRow = col.clone().into(); + self.insert_via_serialize_bsatn(ST_COLUMN_ID, &row)?; + Ok(()) + }) + } + fn create_table_internal(&mut self, schema: Arc) { // Construct the in memory tables. let table_id = schema.table_id; @@ -319,6 +320,11 @@ impl MutTxId { Ok(RowTypeForTable::Arc(self.schema_for_table(table_id)?)) } + /// Drops all the columns of `table_id` in `st_column`. + fn drop_st_column(&mut self, table_id: TableId) -> Result<()> { + self.delete_col_eq(ST_COLUMN_ID, StColumnFields::TableId.col_id(), &table_id.into()) + } + pub fn drop_table(&mut self, table_id: TableId) -> Result<()> { let schema = &*self.schema_for_table(table_id)?; @@ -336,7 +342,7 @@ impl MutTxId { // Drop the table and their columns self.delete_col_eq(ST_TABLE_ID, StTableFields::TableId.col_id(), &table_id.into())?; - self.delete_col_eq(ST_COLUMN_ID, StColumnFields::TableId.col_id(), &table_id.into())?; + self.drop_st_column(table_id)?; if let Some(schedule) = &schema.schedule { self.delete_col_eq( @@ -464,11 +470,19 @@ impl MutTxId { column_schemas.iter_mut().for_each(|c| c.table_id = table_id); // Try to change the tables into what we want. - let old_column_schemas = tx_table.change_columns_to(column_schemas).map_err(TableError::from)?; + let old_column_schemas = tx_table + .change_columns_to(column_schemas.clone()) + .map_err(TableError::from)?; // SAFETY: `commit_table` should have a schema identical to that of `tx_table` // prior to changing it just now. unsafe { commit_table.set_layout_and_schema_to(tx_table) }; + // Update system tables. + // We'll simply remove all rows in `st_columns` and then add the new ones. + // The datastore takes care of not persisting any no-op delete/inserts to the commitlog. + self.drop_st_column(table_id)?; + self.insert_st_column(&column_schemas)?; + // Remember the pending change so we can undo if necessary. self.push_schema_change(PendingSchemaChange::TableAlterRowType(table_id, old_column_schemas)); diff --git a/crates/datastore/src/system_tables.rs b/crates/datastore/src/system_tables.rs index 1c56df19a6..dc0d451ad8 100644 --- a/crates/datastore/src/system_tables.rs +++ b/crates/datastore/src/system_tables.rs @@ -568,6 +568,17 @@ impl From for ColumnSchema { } } +impl From for StColumnRow { + fn from(column: ColumnSchema) -> Self { + Self { + table_id: column.table_id, + col_pos: column.col_pos, + col_name: column.col_name, + col_type: column.col_type.into(), + } + } +} + /// System Table [ST_INDEX_NAME] /// /// | index_id | table_id | index_name | index_algorithm | From 86089e338f74746de4e0b67ee917813d6256e318 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Fri, 22 Aug 2025 10:13:42 -0700 Subject: [PATCH 07/28] Smoketests can run against remote servers (#3012) # Description of Changes This enables smoketests to run against remote servers, such as maincloud / maincloud staging. I also added a `--spacetime-login` param, for servers that require a "proper" spacetime login (such as both servers above). Usage: ```bash python3 -m smoketests \ --remote-server https://maincloud.staging.spacetimedb.com \ --spacetime-login \ -x replication # for some reason this is required, even though I swear it should be disabled by not passing `--docker` ``` # API and ABI breaking changes None. CI only. # Expected complexity level and risk 1 # Testing - [x] Smoketests pass on this PR - [x] Smoketests pass when run against maincloud staging (using the instructions above) - [x] Manual review to check whether I've accidentally de-fanged any "test for negative case" tests --------- Co-authored-by: Zeke Foppa --- smoketests/__init__.py | 32 +++++++++++++++++++++++++++++-- smoketests/__main__.py | 13 ++++++++++++- smoketests/config.toml | 2 +- smoketests/tests/energy.py | 3 ++- smoketests/tests/new_user_flow.py | 3 ++- smoketests/tests/permissions.py | 18 ++++------------- smoketests/tests/replication.py | 1 + smoketests/tests/servers.py | 4 +++- 8 files changed, 55 insertions(+), 21 deletions(-) diff --git a/smoketests/__init__.py b/smoketests/__init__.py index 290ca2bb1b..ed9d16cac6 100644 --- a/smoketests/__init__.py +++ b/smoketests/__init__.py @@ -37,6 +37,14 @@ HAVE_DOCKER = False # and a dotnet installation is detected HAVE_DOTNET = False +# When we pass --spacetime-login, we are running against a server that requires "real" spacetime logins (rather than `--server-issued-login`). +# This is used to skip tests that don't work with that. +USE_SPACETIME_LOGIN = False + +# If we pass `--remote-server`, the server address will be something other than the default. This is used to skip tests that rely on use +# having the default localhost server. +REMOTE_SERVER = False + # default value can be overridden by `--compose-file` flag COMPOSE_FILE = "./docker-compose.yml" @@ -61,6 +69,15 @@ def requires_dotnet(item): return item return unittest.skip("dotnet 8.0 not available")(item) +def requires_anonymous_login(item): + if USE_SPACETIME_LOGIN: + return unittest.skip("using `spacetime login`")(item) + return item + +def requires_local_server(item): + if REMOTE_SERVER: + return unittest.skip("running against a remote server")(item) + return item def build_template_target(): if not TEMPLATE_TARGET_DIR.exists(): @@ -260,9 +277,20 @@ class Smoketest(unittest.TestCase): def api_call(self, method, path, body = None, headers = {}): with open(self.config_path, "rb") as f: config = tomllib.load(f) - host = config['default_server'] token = config['spacetimedb_token'] - conn = http.client.HTTPConnection(host) + server_name = config['default_server'] + server_config = next((c for c in config['server_configs'] if c['nickname'] == server_name), None) + if server_config is None: + raise Exception(f"Unable to find server in config with nickname {server_name}") + host = server_config['host'] + protocol = server_config['protocol'] + conn = None + if protocol == "http": + conn = http.client.HTTPConnection(host) + elif protocol == "https": + conn = http.client.HTTPSConnection(host) + else: + raise Exception(f"Unknown protocol: {protocol}") auth = {"Authorization": f'Bearer {token}'} headers.update(auth) log_cmd([method, path]) diff --git a/smoketests/__main__.py b/smoketests/__main__.py index e073d7d30d..54f6897c42 100644 --- a/smoketests/__main__.py +++ b/smoketests/__main__.py @@ -72,6 +72,8 @@ def main(): parser.add_argument("-x", dest="exclude", nargs="*", default=[]) parser.add_argument("--no-build-cli", action="store_true", help="don't cargo build the cli") parser.add_argument("--list", action="store_true", help="list the tests that would be run, but don't run them") + parser.add_argument("--remote-server", action="store", help="Run against a remote server") + parser.add_argument("--spacetime-login", action="store_true", help="Use `spacetime login` for these tests (and disable tests that don't work with that)") args = parser.parse_args() if not args.no_build_cli: @@ -110,7 +112,16 @@ def main(): subprocess.Popen(["docker", "logs", "-f", docker_container]) smoketests.HAVE_DOCKER = True - smoketests.new_identity(TEST_DIR / 'config.toml') + if args.remote_server is not None: + smoketests.spacetime("--config-path", TEST_DIR / 'config.toml', "server", "edit", "localhost", "--url", args.remote_server, "--yes") + smoketests.REMOTE_SERVER = True + + if args.spacetime_login: + smoketests.spacetime("--config-path", TEST_DIR / 'config.toml', "logout") + smoketests.spacetime("--config-path", TEST_DIR / 'config.toml', "login") + smoketests.USE_SPACETIME_LOGIN = True + else: + smoketests.new_identity(TEST_DIR / 'config.toml') if not args.skip_dotnet: smoketests.HAVE_DOTNET = check_dotnet() diff --git a/smoketests/config.toml b/smoketests/config.toml index b7c4ad31a4..bc7409327e 100644 --- a/smoketests/config.toml +++ b/smoketests/config.toml @@ -1,4 +1,4 @@ -default_server = "127.0.0.1:3000" +default_server = "localhost" spacetimedb_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJoZXhfaWRlbnRpdHkiOiJjMjAwYzc3NDY1NTE5MDM2MTE4M2JiNjFmMWMxYzY3NDUzMzYzY2MxMTY4MmM1NTUwNWZiNjdlYzI0ZWMyMWViIiwic3ViIjoiOTJlMmNkOGQtNTk5Ny00NjZlLWIwNmYtZDNjOGQ1NzU3ODI4IiwiaXNzIjoibG9jYWxob3N0IiwiYXVkIjpbInNwYWNldGltZWRiIl0sImlhdCI6MTc1MjA0NjgwMCwiZXhwIjpudWxsfQ.dgefoxC7eCOONVUufu2JTVFo9876zQ4Mqwm0ivZ0PQK7Hacm3Ip_xqyav4bilZ0vIEf8IM8AB0_xawk8WcbvMg" [[server_configs]] diff --git a/smoketests/tests/energy.py b/smoketests/tests/energy.py index 6a765ef0d7..709e30cd9b 100644 --- a/smoketests/tests/energy.py +++ b/smoketests/tests/energy.py @@ -1,8 +1,9 @@ -from .. import Smoketest +from .. import Smoketest, requires_anonymous_login import time class EnergyFlow(Smoketest): + @requires_anonymous_login def test_energy_balance(self): """Test getting energy balance.""" diff --git a/smoketests/tests/new_user_flow.py b/smoketests/tests/new_user_flow.py index 345dcb77bc..0adacb11d5 100644 --- a/smoketests/tests/new_user_flow.py +++ b/smoketests/tests/new_user_flow.py @@ -1,4 +1,4 @@ -from .. import Smoketest +from .. import Smoketest, requires_anonymous_login import time class NewUserFlow(Smoketest): @@ -25,6 +25,7 @@ pub fn say_hello(ctx: &ReducerContext) { } """ + @requires_anonymous_login def test_new_user_flow(self): """Test the entirety of the new user flow.""" diff --git a/smoketests/tests/permissions.py b/smoketests/tests/permissions.py index 7f08c6d049..39ffca6e02 100644 --- a/smoketests/tests/permissions.py +++ b/smoketests/tests/permissions.py @@ -10,8 +10,6 @@ class Permissions(Smoketest): def test_call(self): """Ensure that anyone has the permission to call any standard reducer""" - self.new_identity() - self.publish_module() self.call("say_hello", anon=True) @@ -21,28 +19,22 @@ class Permissions(Smoketest): def test_delete(self): """Ensure that you cannot delete a database that you do not own""" - self.new_identity() - self.publish_module() - self.reset_config() + self.new_identity() with self.assertRaises(Exception): self.spacetime("delete", self.database_identity) def test_describe(self): """Ensure that anyone can describe any database""" - self.new_identity() self.publish_module() - self.reset_config() - self.new_identity() - self.spacetime("describe", "--json", self.database_identity) + self.spacetime("describe", "--anonymous", "--json", self.database_identity) def test_logs(self): """Ensure that we are not able to view the logs of a module that we don't have permission to view""" - self.new_identity() self.publish_module() self.reset_config() @@ -57,10 +49,9 @@ class Permissions(Smoketest): def test_publish(self): """This test checks to make sure that you cannot publish to an identity that you do not own.""" - self.new_identity() self.publish_module() - self.reset_config() + self.new_identity() with self.assertRaises(Exception): # TODO: This raises for the wrong reason - `--clear-database` doesn't exist anymore! @@ -73,11 +64,10 @@ class Permissions(Smoketest): def test_replace_names(self): """Test that you can't replace names of a database you don't own""" - self.new_identity() name = random_string() self.publish_module(name) - self.reset_config() + self.new_identity() with self.assertRaises(Exception): self.api_call( diff --git a/smoketests/tests/replication.py b/smoketests/tests/replication.py index 168ebe49ef..eb988078d8 100644 --- a/smoketests/tests/replication.py +++ b/smoketests/tests/replication.py @@ -229,6 +229,7 @@ fn send_message(ctx: &ReducerContext, text: String) { self.docker.compose("up", "-d") super().tearDown() + # TODO: This function seems to run even when `--docker` is not passed, leading to errors unless `-x replication` is passed, due to the docker-related code below. def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/smoketests/tests/servers.py b/smoketests/tests/servers.py index 5362ddb5e2..cef5af9eab 100644 --- a/smoketests/tests/servers.py +++ b/smoketests/tests/servers.py @@ -1,6 +1,8 @@ -from .. import Smoketest, extract_field +from .. import Smoketest, extract_field, requires_local_server import re +# We require a local server because these tests have hardcoded server addresses. +@requires_local_server class Servers(Smoketest): AUTOPUBLISH = False From b5eac84cafd7e6ca1c7ec4fa6167a9e525586754 Mon Sep 17 00:00:00 2001 From: rekhoff Date: Fri, 22 Aug 2025 10:43:00 -0700 Subject: [PATCH 08/28] Add a RemoteQuery regression test to C# SDK (#3163) # Description of Changes Add a RemoteQuery regression test to C# SDK to address issue: https://github.com/clockworklabs/SpacetimeDB/issues/3064 This adds on to existing regression tests, creating a rather small change. # API and ABI breaking changes Not breaking change # Expected complexity level and risk 1 # Testing - [X] Ran `dotnet test`, all tests pass --- sdks/csharp/examples~/regression-tests/client/Program.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdks/csharp/examples~/regression-tests/client/Program.cs b/sdks/csharp/examples~/regression-tests/client/Program.cs index 5e79220ccf..6db727e65c 100644 --- a/sdks/csharp/examples~/regression-tests/client/Program.cs +++ b/sdks/csharp/examples~/regression-tests/client/Program.cs @@ -119,6 +119,11 @@ void OnSubscriptionApplied(SubscriptionEventContext context) waiting++; context.Reducers.ThrowError("this is an error"); + // RemoteQuery test + Log.Debug("Calling RemoteQuery"); + var remoteRows = context.Db.ExampleData.RemoteQuery("WHERE Id = 1").Result; + Debug.Assert(remoteRows != null && remoteRows.Length > 0); + // Now unsubscribe and check that the unsubscribe is actually applied. Log.Debug("Calling Unsubscribe"); waiting++; From b9d30991f1d9cf693ef54dd5875d2a0ace7abb21 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Fri, 22 Aug 2025 12:36:47 -0700 Subject: [PATCH 09/28] Fix remaining LICENSE files (#3193) # Description of Changes Apparently, I missed several license files in #3002. I'm not sure what method I was using to find them, but apparently it was insufficient. **This replaces all empty `LICENSE` files with an explicit (symlink to) BSL license, and all apache licenses with symlinks to the root apache license.** This PR does not intentionally change any license terms, so if you see one that changed, **it's a mistake**. # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing ```bash $ find . -name '*LICENSE*' -type f | grep -v '\.meta$' ./crates/sqltest/standards/LICENSE # this one is an external library that we are not allowed to re-license ./LICENSE.txt # this is the root license ``` --------- Co-authored-by: Zeke Foppa --- docs/LICENSE.txt | 177 +---------------- docs/bsatn/LICENSE | 1 + modules/benchmarks-cs/LICENSE | 1 + modules/benchmarks/LICENSE | 1 + modules/keynote-benchmarks/LICENSE | 1 + modules/module-test-cs/LICENSE | 1 + modules/module-test/LICENSE | 1 + modules/perf-test/LICENSE | 1 + modules/quickstart-chat/LICENSE | 1 + .../sdk-test-connect-disconnect-cs/LICENSE | 1 + modules/sdk-test-connect-disconnect/LICENSE | 1 + modules/sdk-test-cs/LICENSE | 1 + modules/sdk-test/LICENSE | 1 + .../tests/connect_disconnect_client/LICENSE | 1 + sdks/rust/tests/test-client/LICENSE | 1 + sdks/rust/tests/test-counter/LICENSE | 1 + sdks/typescript/packages/sdk/LICENSE.txt | 178 +----------------- tools/upgrade-version/LICENSE | 1 + 18 files changed, 18 insertions(+), 353 deletions(-) mode change 100644 => 120000 docs/LICENSE.txt mode change 100644 => 120000 docs/bsatn/LICENSE mode change 100644 => 120000 modules/benchmarks-cs/LICENSE mode change 100644 => 120000 modules/benchmarks/LICENSE mode change 100644 => 120000 modules/keynote-benchmarks/LICENSE mode change 100644 => 120000 modules/module-test-cs/LICENSE mode change 100644 => 120000 modules/module-test/LICENSE mode change 100644 => 120000 modules/perf-test/LICENSE mode change 100644 => 120000 modules/quickstart-chat/LICENSE mode change 100644 => 120000 modules/sdk-test-connect-disconnect-cs/LICENSE mode change 100644 => 120000 modules/sdk-test-connect-disconnect/LICENSE mode change 100644 => 120000 modules/sdk-test-cs/LICENSE mode change 100644 => 120000 modules/sdk-test/LICENSE mode change 100644 => 120000 sdks/rust/tests/connect_disconnect_client/LICENSE mode change 100644 => 120000 sdks/rust/tests/test-client/LICENSE mode change 100644 => 120000 sdks/rust/tests/test-counter/LICENSE mode change 100644 => 120000 sdks/typescript/packages/sdk/LICENSE.txt mode change 100644 => 120000 tools/upgrade-version/LICENSE diff --git a/docs/LICENSE.txt b/docs/LICENSE.txt deleted file mode 100644 index d9a10c0d8e..0000000000 --- a/docs/LICENSE.txt +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/docs/LICENSE.txt b/docs/LICENSE.txt new file mode 120000 index 0000000000..cc1ff9bdd7 --- /dev/null +++ b/docs/LICENSE.txt @@ -0,0 +1 @@ +../licenses/apache2.txt \ No newline at end of file diff --git a/docs/bsatn/LICENSE b/docs/bsatn/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/bsatn/LICENSE b/docs/bsatn/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/docs/bsatn/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/benchmarks-cs/LICENSE b/modules/benchmarks-cs/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/benchmarks-cs/LICENSE b/modules/benchmarks-cs/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/benchmarks-cs/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/benchmarks/LICENSE b/modules/benchmarks/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/benchmarks/LICENSE b/modules/benchmarks/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/benchmarks/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/keynote-benchmarks/LICENSE b/modules/keynote-benchmarks/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/keynote-benchmarks/LICENSE b/modules/keynote-benchmarks/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/keynote-benchmarks/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/module-test-cs/LICENSE b/modules/module-test-cs/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/module-test-cs/LICENSE b/modules/module-test-cs/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/module-test-cs/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/module-test/LICENSE b/modules/module-test/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/module-test/LICENSE b/modules/module-test/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/module-test/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/perf-test/LICENSE b/modules/perf-test/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/perf-test/LICENSE b/modules/perf-test/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/perf-test/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/quickstart-chat/LICENSE b/modules/quickstart-chat/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/quickstart-chat/LICENSE b/modules/quickstart-chat/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/quickstart-chat/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/sdk-test-connect-disconnect-cs/LICENSE b/modules/sdk-test-connect-disconnect-cs/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/sdk-test-connect-disconnect-cs/LICENSE b/modules/sdk-test-connect-disconnect-cs/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/sdk-test-connect-disconnect-cs/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/sdk-test-connect-disconnect/LICENSE b/modules/sdk-test-connect-disconnect/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/sdk-test-connect-disconnect/LICENSE b/modules/sdk-test-connect-disconnect/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/sdk-test-connect-disconnect/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/sdk-test-cs/LICENSE b/modules/sdk-test-cs/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/sdk-test-cs/LICENSE b/modules/sdk-test-cs/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/sdk-test-cs/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/modules/sdk-test/LICENSE b/modules/sdk-test/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/sdk-test/LICENSE b/modules/sdk-test/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/modules/sdk-test/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/sdks/rust/tests/connect_disconnect_client/LICENSE b/sdks/rust/tests/connect_disconnect_client/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sdks/rust/tests/connect_disconnect_client/LICENSE b/sdks/rust/tests/connect_disconnect_client/LICENSE new file mode 120000 index 0000000000..424c4c33df --- /dev/null +++ b/sdks/rust/tests/connect_disconnect_client/LICENSE @@ -0,0 +1 @@ +../../../../licenses/BSL.txt \ No newline at end of file diff --git a/sdks/rust/tests/test-client/LICENSE b/sdks/rust/tests/test-client/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sdks/rust/tests/test-client/LICENSE b/sdks/rust/tests/test-client/LICENSE new file mode 120000 index 0000000000..424c4c33df --- /dev/null +++ b/sdks/rust/tests/test-client/LICENSE @@ -0,0 +1 @@ +../../../../licenses/BSL.txt \ No newline at end of file diff --git a/sdks/rust/tests/test-counter/LICENSE b/sdks/rust/tests/test-counter/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sdks/rust/tests/test-counter/LICENSE b/sdks/rust/tests/test-counter/LICENSE new file mode 120000 index 0000000000..424c4c33df --- /dev/null +++ b/sdks/rust/tests/test-counter/LICENSE @@ -0,0 +1 @@ +../../../../licenses/BSL.txt \ No newline at end of file diff --git a/sdks/typescript/packages/sdk/LICENSE.txt b/sdks/typescript/packages/sdk/LICENSE.txt deleted file mode 100644 index 4a459866a5..0000000000 --- a/sdks/typescript/packages/sdk/LICENSE.txt +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/sdks/typescript/packages/sdk/LICENSE.txt b/sdks/typescript/packages/sdk/LICENSE.txt new file mode 120000 index 0000000000..51a4020f50 --- /dev/null +++ b/sdks/typescript/packages/sdk/LICENSE.txt @@ -0,0 +1 @@ +../../../../licenses/apache2.txt \ No newline at end of file diff --git a/tools/upgrade-version/LICENSE b/tools/upgrade-version/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tools/upgrade-version/LICENSE b/tools/upgrade-version/LICENSE new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/tools/upgrade-version/LICENSE @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file From 434894f73dcc4fcda3b6465280ec08a09b62a9e7 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 26 Aug 2025 17:00:57 +0200 Subject: [PATCH 10/28] Fix adding enum variants (#3200) # Description of Changes First commit reverts disabling adding enum variants (https://github.com/clockworklabs/SpacetimeDB/pull/3178). Second commit makes replay recognize inserts / deletes to `st_column` and triggers a refresh of the in-memory table that was referenced in the `st_column` change. # API and ABI breaking changes None # Expected complexity level and risk 3, small code bug "deep". # Testing I've confirmed manually that a module that couldn't be restarted before this PR can now be restarted. We should probably follow up this PR with a smoketest. --- crates/core/src/db/relational_db.rs | 1 - crates/core/src/db/update.rs | 12 +++- .../locking_tx_datastore/committed_state.rs | 62 +++++++++++++--- .../src/locking_tx_datastore/state_view.rs | 16 +++-- smoketests/tests/auto_migration.py | 72 ++++++++++++++----- 5 files changed, 129 insertions(+), 34 deletions(-) diff --git a/crates/core/src/db/relational_db.rs b/crates/core/src/db/relational_db.rs index 388f18138e..6fec0c1b62 100644 --- a/crates/core/src/db/relational_db.rs +++ b/crates/core/src/db/relational_db.rs @@ -1043,7 +1043,6 @@ impl RelationalDB { Ok(self.inner.alter_table_access_mut_tx(tx, name, access)?) } - #[allow(unused)] pub(crate) fn alter_table_row_type( &self, tx: &mut MutTx, diff --git a/crates/core/src/db/update.rs b/crates/core/src/db/update.rs index 1be4f434d1..d2496b5bdb 100644 --- a/crates/core/src/db/update.rs +++ b/crates/core/src/db/update.rs @@ -9,7 +9,7 @@ use spacetimedb_lib::AlgebraicValue; use spacetimedb_primitives::{ColSet, TableId}; use spacetimedb_schema::auto_migrate::{AutoMigratePlan, ManualMigratePlan, MigratePlan}; use spacetimedb_schema::def::TableDef; -use spacetimedb_schema::schema::{IndexSchema, Schema, SequenceSchema, TableSchema}; +use spacetimedb_schema::schema::{column_schemas_from_defs, IndexSchema, Schema, SequenceSchema, TableSchema}; use std::sync::Arc; /// The logger used for by [`update_database`] and friends. @@ -222,8 +222,14 @@ fn auto_migrate_database( ); stdb.drop_sequence(tx, sequence_schema.sequence_id)?; } - spacetimedb_schema::auto_migrate::AutoMigrateStep::ChangeColumns(_table_name) => { - anyhow::bail!("Unsupported: Changing column types"); + spacetimedb_schema::auto_migrate::AutoMigrateStep::ChangeColumns(table_name) => { + let table_def = plan.new.stored_in_table_def(table_name).unwrap(); + let table_id = stdb.table_id_from_name_mut(tx, table_name).unwrap().unwrap(); + let column_schemas = column_schemas_from_defs(plan.new, &table_def.columns, table_id); + + log!(logger, "Changing columns of table `{}`", table_name); + + stdb.alter_table_row_type(tx, table_id, column_schemas)?; } spacetimedb_schema::auto_migrate::AutoMigrateStep::ChangeAccess(table_name) => { let table_def = plan.new.stored_in_table_def(table_name).unwrap(); diff --git a/crates/datastore/src/locking_tx_datastore/committed_state.rs b/crates/datastore/src/locking_tx_datastore/committed_state.rs index a074d43c12..d1f4fbef29 100644 --- a/crates/datastore/src/locking_tx_datastore/committed_state.rs +++ b/crates/datastore/src/locking_tx_datastore/committed_state.rs @@ -8,8 +8,9 @@ use super::{ }; use crate::{ db_metrics::DB_METRICS, - error::{IndexError, TableError}, + error::{DatastoreError, IndexError, TableError}, execution_context::ExecutionContext, + locking_tx_datastore::state_view::iter_st_column_for_table, system_tables::{ system_tables, StColumnRow, StConstraintData, StConstraintRow, StIndexRow, StSequenceRow, StTableFields, StTableRow, SystemTable, ST_CLIENT_ID, ST_CLIENT_IDX, ST_COLUMN_ID, ST_COLUMN_IDX, ST_COLUMN_NAME, @@ -28,8 +29,8 @@ use spacetimedb_lib::{ db::auth::{StAccess, StTableType}, Identity, }; -use spacetimedb_primitives::{ColList, ColSet, IndexId, TableId}; -use spacetimedb_sats::memory_usage::MemoryUsage; +use spacetimedb_primitives::{ColId, ColList, ColSet, IndexId, TableId}; +use spacetimedb_sats::{algebraic_value::de::ValueDeserializer, memory_usage::MemoryUsage, Deserialize}; use spacetimedb_sats::{AlgebraicValue, ProductValue}; use spacetimedb_schema::{def::IndexAlgorithm, schema::TableSchema}; use spacetimedb_table::{ @@ -339,6 +340,7 @@ impl CommittedState { .delete_equal_row(&self.page_pool, blob_store, rel) .map_err(TableError::Bflatn)? .ok_or_else(|| anyhow!("Delete for non-existent row when replaying transaction"))?; + Ok(()) } @@ -349,11 +351,55 @@ impl CommittedState { row: &ProductValue, ) -> Result<()> { let (table, blob_store, pool) = self.get_table_and_blob_store_or_create(table_id, schema); - table.insert(pool, blob_store, row).map(drop).map_err(|e| match e { - InsertError::Bflatn(e) => TableError::Bflatn(e).into(), - InsertError::Duplicate(e) => TableError::Duplicate(e).into(), - InsertError::IndexError(e) => IndexError::UniqueConstraintViolation(e).into(), - }) + let (_, row_ref) = table.insert(pool, blob_store, row).map_err(|e| -> DatastoreError { + match e { + InsertError::Bflatn(e) => TableError::Bflatn(e).into(), + InsertError::Duplicate(e) => TableError::Duplicate(e).into(), + InsertError::IndexError(e) => IndexError::UniqueConstraintViolation(e).into(), + } + })?; + + if table_id == ST_COLUMN_ID { + // We've made a modification to `st_column`. + // The type of a table has changed, so figure out which. + // The first column in `StColumnRow` is `table_id`. + let row_ptr = row_ref.pointer(); + self.st_column_changed(row, row_ptr)?; + } + + Ok(()) + } + + /// Refreshes the columns and layout of a table + /// when a `row` has been inserted from `st_column`. + /// + /// The `row_ptr` is a pointer to `row`. + fn st_column_changed(&mut self, row: &ProductValue, row_ptr: RowPointer) -> Result<()> { + let target_table_id = TableId::deserialize(ValueDeserializer::from_ref(&row.elements[0])) + .expect("first field in `st_column` should decode to a `TableId`"); + let target_col_id = ColId::deserialize(ValueDeserializer::from_ref(&row.elements[1])) + .expect("second field in `st_column` should decode to a `ColId`"); + + // We're replaying and we don't have unique constraints yet. + // Due to replay handling all inserts first and deletes after, + // when processing `st_column` insert/deletes, + // we may end up with two definitions for the same `col_pos`. + // Of those two, we're interested in the one we just inserted + // and not the other one, as it is being replaced. + let columns = iter_st_column_for_table(self, &target_table_id.into())? + .filter_map(|row_ref| { + StColumnRow::try_from(row_ref) + .map(|c| (c.col_pos != target_col_id || row_ref.pointer() == row_ptr).then(|| c.into())) + .transpose() + }) + .collect::>>()?; + + // Update the columns and layout of the the in-memory table. + if let Some(table) = self.tables.get_mut(&target_table_id) { + table.change_columns_to(columns).map_err(TableError::from)?; + } + + Ok(()) } pub(super) fn build_sequence_state(&mut self, sequence_state: &mut SequencesState) -> Result<()> { diff --git a/crates/datastore/src/locking_tx_datastore/state_view.rs b/crates/datastore/src/locking_tx_datastore/state_view.rs index 81f9f7291f..9815ef8c66 100644 --- a/crates/datastore/src/locking_tx_datastore/state_view.rs +++ b/crates/datastore/src/locking_tx_datastore/state_view.rs @@ -79,12 +79,8 @@ pub trait StateView { let table_primary_key = row.table_primary_key.as_ref().and_then(ColList::as_singleton); // Look up the columns for the table in question. - let mut columns: Vec = self - .iter_by_col_eq(ST_COLUMN_ID, StColumnFields::TableId, value_eq)? - .map(|row| { - let row = StColumnRow::try_from(row)?; - Ok(row.into()) - }) + let mut columns: Vec = iter_st_column_for_table(self, &table_id.into())? + .map(|row| Ok(StColumnRow::try_from(row)?.into())) .collect::>>()?; columns.sort_by_key(|col| col.col_pos); @@ -149,6 +145,14 @@ pub trait StateView { } } +/// Returns an iterator over all `st_column` rows for `table_id`. +pub(crate) fn iter_st_column_for_table<'a>( + this: &'a (impl StateView + ?Sized), + table_id: &'a AlgebraicValue, +) -> Result>> { + this.iter_by_col_eq(ST_COLUMN_ID, StColumnFields::TableId, table_id) +} + pub struct IterMutTx<'a> { tx_state_ins: Option<(&'a Table, &'a HashMapBlobStore)>, stage: ScanStage<'a>, diff --git a/smoketests/tests/auto_migration.py b/smoketests/tests/auto_migration.py index 35c79f270c..f338e718c2 100644 --- a/smoketests/tests/auto_migration.py +++ b/smoketests/tests/auto_migration.py @@ -4,23 +4,27 @@ import logging class AddTableAutoMigration(Smoketest): - MODULE_CODE = """ + MODULE_CODE_INIT = """ use spacetimedb::{log, ReducerContext, Table, SpacetimeType}; +use PersonKind::*; #[spacetimedb::table(name = person, public)] pub struct Person { name: String, + kind: PersonKind, } #[spacetimedb::reducer] -pub fn add_person(ctx: &ReducerContext, name: String) { - ctx.db.person().insert(Person { name }); +pub fn add_person(ctx: &ReducerContext, name: String, kind: String) { + let kind = kind_from_string(kind); + ctx.db.person().insert(Person { name, kind }); } #[spacetimedb::reducer] pub fn print_persons(ctx: &ReducerContext, prefix: String) { for person in ctx.db.person().iter() { - log::info!("{}: {}", prefix, person.name); + let kind = kind_to_string(person.kind); + log::info!("{prefix}: {} - {kind}", person.name); } } @@ -39,11 +43,47 @@ pub struct Vector2 { #[spacetimedb::client_visibility_filter] const PERSON_VISIBLE: spacetimedb::Filter = spacetimedb::Filter::Sql("SELECT * FROM person"); +""" + + MODULE_CODE = MODULE_CODE_INIT + """ +#[derive(SpacetimeType, Clone, Copy, PartialEq, Eq)] +pub enum PersonKind { + Student, +} + +fn kind_from_string(_: String) -> PersonKind { + Student +} + +fn kind_to_string(Student: PersonKind) -> &'static str { + "Student" +} """ MODULE_CODE_UPDATED = ( - MODULE_CODE + MODULE_CODE_INIT + """ +#[derive(SpacetimeType, Clone, Copy, PartialEq, Eq)] +pub enum PersonKind { + Student, + Professor, +} + +fn kind_from_string(kind: String) -> PersonKind { + match &*kind { + "Student" => Student, + "Professor" => Professor, + _ => panic!(), + } +} + +fn kind_to_string(kind: PersonKind) -> &'static str { + match kind { + Student => "Student", + Professor => "Professor", + } +} + #[spacetimedb::table(name = book, public)] pub struct Book { isbn: String, @@ -89,14 +129,14 @@ const BOOK_VISIBLE: spacetimedb::Filter = spacetimedb::Filter::Sql("SELECT * FRO logging.info("Initial publish complete") # initial module code is already published by test framework - self.call("add_person", "Robert") - self.call("add_person", "Julie") - self.call("add_person", "Samantha") + self.call("add_person", "Robert", "Student") + self.call("add_person", "Julie", "Student") + self.call("add_person", "Samantha", "Student") self.call("print_persons", "BEFORE") logs = self.logs(100) - self.assertIn("BEFORE: Samantha", logs) - self.assertIn("BEFORE: Julie", logs) - self.assertIn("BEFORE: Robert", logs) + self.assertIn("BEFORE: Samantha - Student", logs) + self.assertIn("BEFORE: Julie - Student", logs) + self.assertIn("BEFORE: Robert - Student", logs) logging.info( "Initial operations complete, updating module without clear", @@ -120,16 +160,16 @@ const BOOK_VISIBLE: spacetimedb::Filter = spacetimedb::Filter::Sql("SELECT * FRO self.logs(100) - self.call("add_person", "Husserl") + self.call("add_person", "Husserl", "Professor") self.call("add_book", "1234567890") self.call("print_persons", "AFTER_PERSON") self.call("print_books", "AFTER_BOOK") logs = self.logs(100) - self.assertIn("AFTER_PERSON: Samantha", logs) - self.assertIn("AFTER_PERSON: Julie", logs) - self.assertIn("AFTER_PERSON: Robert", logs) - self.assertIn("AFTER_PERSON: Husserl", logs) + self.assertIn("AFTER_PERSON: Samantha - Student", logs) + self.assertIn("AFTER_PERSON: Julie - Student", logs) + self.assertIn("AFTER_PERSON: Robert - Student", logs) + self.assertIn("AFTER_PERSON: Husserl - Professor", logs) self.assertIn("AFTER_BOOK: 1234567890", logs) From 0d2a45b239d3915a26486f422752ad29d7276ac7 Mon Sep 17 00:00:00 2001 From: james gilles Date: Tue, 26 Aug 2025 17:17:46 -0400 Subject: [PATCH 11/28] Fix fields named 'read' (#2525) # Description of Changes Fixes https://github.com/orgs/clockworklabs/projects/22?pane=issue&itemId=102392974&issue=clockworklabs%7Ccom.clockworklabs.spacetimedbsdk%7C276 by renaming `internal` `static` serializer fields so that they do not overlap with user-provided names. Note, however, that some field names still will not work: `ReadFields`, `WriteFields`, `Equals`, and `GetHashCode`. This would require a separate fix since the error would happen in a different place. In this case we would need to change the name of the generated member to something like `ReadFields_` or `Equals_`, which I'm not sure is a good idea. # API and ABI breaking changes N/A # Expected complexity level and risk 0 # Testing SDK tests and `dotnet-verify` tests are passing. --------- Signed-off-by: rekhoff Co-authored-by: rekhoff --- crates/bindings-csharp/BSATN.Codegen/Type.cs | 51 ++-- .../snapshots/Type#CustomClass.verified.cs | 16 +- .../snapshots/Type#CustomStruct.verified.cs | 16 +- .../Type#CustomTaggedEnum.verified.cs | 16 +- .../snapshots/Type#PublicTable.verified.cs | 204 ++++++++-------- .../ExtraCompilationErrors.verified.txt | 2 +- .../diag/snapshots/Module#FFI.verified.cs | 10 +- .../Module#TestAutoIncNotInteger.verified.cs | 16 +- .../Module#TestIndexIssues.verified.cs | 11 +- .../Module#TestScheduleIssues.verified.cs | 36 +-- .../Module#TestTableTaggedEnum.verified.cs | 16 +- .../Module#TestUniqueNotEquatable.verified.cs | 16 +- .../Type#TestTaggedEnumField.verified.cs | 16 +- ...Type#TestTaggedEnumInlineTuple.verified.cs | 8 +- .../Type#TestTypeParams_T_.verified.cs | 8 +- .../Type#TestUnsupportedType.verified.cs | 36 +-- .../Codegen.Tests/fixtures/server/Lib.cs | 13 +- .../Module#BTreeMultiColumn.verified.cs | 24 +- .../snapshots/Module#BTreeViews.verified.cs | 32 +-- .../server/snapshots/Module#FFI.verified.cs | 49 ++-- .../Module#MultiTableRow.verified.cs | 24 +- .../snapshots/Module#PublicTable.verified.cs | 228 +++++++++--------- ...ltipleUniqueIndexesHadSameName.verified.cs | 16 +- ...Module#Timers.SendMessageTimer.verified.cs | 24 +- .../Type#ContainsNestedLists.verified.cs | 72 +++--- .../snapshots/Type#CustomClass.verified.cs | 35 ++- .../Type#CustomNestedClass.verified.cs | 76 +++--- .../snapshots/Type#CustomRecord.verified.cs | 35 ++- .../snapshots/Type#CustomStruct.verified.cs | 35 ++- .../Type#CustomTaggedEnum.verified.cs | 34 +-- ...pe#FormerlyForbiddenFieldNames.verified.cs | 123 ++++++++++ crates/bindings-csharp/Codegen/Module.cs | 14 +- 32 files changed, 718 insertions(+), 594 deletions(-) create mode 100644 crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#FormerlyForbiddenFieldNames.verified.cs diff --git a/crates/bindings-csharp/BSATN.Codegen/Type.cs b/crates/bindings-csharp/BSATN.Codegen/Type.cs index 53f737e369..4bfbf45ec7 100644 --- a/crates/bindings-csharp/BSATN.Codegen/Type.cs +++ b/crates/bindings-csharp/BSATN.Codegen/Type.cs @@ -1,5 +1,14 @@ namespace SpacetimeDB.Codegen; +// Generate code to implement serialization to the BSATN format (https://spacetimedb.com/docs/bsatn). +// C# doesn't support static methods in interfaces, so instead we declare a zero-sized `struct` type that implements +// the serialization interface (IReadWrite) for us. +// +// See BSATN.Runtime for the support code referenced by code generation, +// and see Codegen.Tests/fixtures/*/snapshots for examples of generated code. +// Also, if you set true in a csproj, +// you can find the generated code in obj/Debug/*/generated/SpacetimeDB.BSATN.Codegen. + using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -27,6 +36,14 @@ using static Utils; /// The name of the BSATN struct for the type. public abstract record TypeUse(string Name, string BSATNName) { + internal static string BSATN_FIELD_SUFFIX = "RW"; + + /// + /// The name of the static field containing an IReadWrite in the IReadWrite struct associated with this type. + /// We make sure this is different from the field name so that collisions cannot occur. + /// + public static string BsatnFieldSuffix => $"{BSATN_FIELD_SUFFIX}"; + /// /// Parse a type use for a member. /// @@ -330,14 +347,20 @@ public record MemberDeclaration( var visStr = SyntaxFacts.GetText(visibility); return string.Join( "\n ", - members.Select(m => $"{visStr} static readonly {m.Type.BSATNName} {m.Name} = new();") + members.Select(m => + $"{visStr} static readonly {m.Type.BSATNName} {m.Name}{TypeUse.BsatnFieldSuffix} = new();" + ) ); } public static string GenerateDefs(IEnumerable members) => string.Join( ",\n ", - members.Select(m => $"new(nameof({m.Name}), {m.Name}.GetAlgebraicType(registrar))") + // we can't use nameof(m.Type.BsatnFieldName) because the bsatn field name differs from the logical name + // assigned in the type. + members.Select(m => + $"new(\"{m.Name}\", {m.Name}{TypeUse.BsatnFieldSuffix}.GetAlgebraicType(registrar))" + ) ); } @@ -450,8 +473,6 @@ public abstract record BaseTypeDeclaration var extensions = new Scope.Extensions(Scope, FullName); var bsatnDecls = Members.Cast(); - var fieldNames = bsatnDecls.Select(m => m.Name); - var fieldNamesAndIds = fieldNames.Select((name, i) => (name, i)); extensions.BaseTypes.Add($"System.IEquatable<{ShortName}>"); @@ -480,8 +501,8 @@ public abstract record BaseTypeDeclaration return reader.ReadByte() switch { {{string.Join( "\n ", - fieldNames.Select((name, i) => - $"{i} => new {name}({name}.Read(reader))," + bsatnDecls.Select((m, i) => + $"{i} => new {m.Name}({m.Name}{TypeUse.BsatnFieldSuffix}.Read(reader))," ) )}} _ => throw new System.InvalidOperationException("Invalid tag value, this state should be unreachable.") @@ -492,12 +513,12 @@ public abstract record BaseTypeDeclaration switch (value) { {{string.Join( "\n", - fieldNames.Select((name, i) => $""" - case {name}(var inner): - writer.Write((byte){i}); - {name}.Write(writer, inner); - break; - """))}} + bsatnDecls.Select((m, i) => $""" + case {m.Name}(var inner): + writer.Write((byte){i}); + {m.Name}{TypeUse.BsatnFieldSuffix}.Write(writer, inner); + break; + """))}} } """; @@ -530,14 +551,14 @@ public abstract record BaseTypeDeclaration public void ReadFields(System.IO.BinaryReader reader) { {{string.Join( "\n", - fieldNames.Select(name => $" {name} = BSATN.{name}.Read(reader);") + bsatnDecls.Select(m => $" {m.Name} = BSATN.{m.Name}{TypeUse.BsatnFieldSuffix}.Read(reader);") )}} } public void WriteFields(System.IO.BinaryWriter writer) { {{string.Join( "\n", - fieldNames.Select(name => $" BSATN.{name}.Write(writer, {name});") + bsatnDecls.Select(m => $" BSATN.{m.Name}{TypeUse.BsatnFieldSuffix}.Write(writer, {m.Name});") )}} } @@ -557,7 +578,7 @@ public abstract record BaseTypeDeclaration public override string ToString() => $"{{ShortName}} {{start}} {{string.Join( ", ", - fieldNames.Select(name => $$"""{{name}} = {SpacetimeDB.BSATN.StringUtil.GenericToString({{name}})}""") + bsatnDecls.Select(m => $$"""{{m.Name}} = {SpacetimeDB.BSATN.StringUtil.GenericToString({{m.Name}})}""") )}} {{end}}"; """ ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomClass.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomClass.verified.cs index 512bf49c7c..c3ddd0f9ac 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomClass.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomClass.verified.cs @@ -6,14 +6,14 @@ partial struct CustomClass : System.IEquatable, SpacetimeDB.BSATN.I { public void ReadFields(System.IO.BinaryReader reader) { - IntField = BSATN.IntField.Read(reader); - StringField = BSATN.StringField.Read(reader); + IntField = BSATN.IntFieldRW.Read(reader); + StringField = BSATN.StringFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.IntField.Write(writer, IntField); - BSATN.StringField.Write(writer, StringField); + BSATN.IntFieldRW.Write(writer, IntField); + BSATN.StringFieldRW.Write(writer, StringField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -26,8 +26,8 @@ partial struct CustomClass : System.IEquatable, SpacetimeDB.BSATN.I public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 IntField = new(); - internal static readonly SpacetimeDB.BSATN.String StringField = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringFieldRW = new(); public CustomClass Read(System.IO.BinaryReader reader) { @@ -47,8 +47,8 @@ partial struct CustomClass : System.IEquatable, SpacetimeDB.BSATN.I registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IntField), IntField.GetAlgebraicType(registrar)), - new(nameof(StringField), StringField.GetAlgebraicType(registrar)) + new("IntField", IntFieldRW.GetAlgebraicType(registrar)), + new("StringField", StringFieldRW.GetAlgebraicType(registrar)) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomStruct.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomStruct.verified.cs index ec179e3994..4730a9cb55 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomStruct.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomStruct.verified.cs @@ -8,14 +8,14 @@ partial struct CustomStruct { public void ReadFields(System.IO.BinaryReader reader) { - IntField = BSATN.IntField.Read(reader); - StringField = BSATN.StringField.Read(reader); + IntField = BSATN.IntFieldRW.Read(reader); + StringField = BSATN.StringFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.IntField.Write(writer, IntField); - BSATN.StringField.Write(writer, StringField); + BSATN.IntFieldRW.Write(writer, IntField); + BSATN.StringFieldRW.Write(writer, StringField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -28,8 +28,8 @@ partial struct CustomStruct public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 IntField = new(); - internal static readonly SpacetimeDB.BSATN.String StringField = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringFieldRW = new(); public CustomStruct Read(System.IO.BinaryReader reader) { @@ -49,8 +49,8 @@ partial struct CustomStruct registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IntField), IntField.GetAlgebraicType(registrar)), - new(nameof(StringField), StringField.GetAlgebraicType(registrar)) + new("IntField", IntFieldRW.GetAlgebraicType(registrar)), + new("StringField", StringFieldRW.GetAlgebraicType(registrar)) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomTaggedEnum.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomTaggedEnum.verified.cs index 91843001a9..0f6a93c3c4 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomTaggedEnum.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomTaggedEnum.verified.cs @@ -18,15 +18,15 @@ partial record CustomTaggedEnum : System.IEquatable public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 IntVariant = new(); - internal static readonly SpacetimeDB.BSATN.String StringVariant = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntVariantRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringVariantRW = new(); public CustomTaggedEnum Read(System.IO.BinaryReader reader) { return reader.ReadByte() switch { - 0 => new IntVariant(IntVariant.Read(reader)), - 1 => new StringVariant(StringVariant.Read(reader)), + 0 => new IntVariant(IntVariantRW.Read(reader)), + 1 => new StringVariant(StringVariantRW.Read(reader)), _ => throw new System.InvalidOperationException( "Invalid tag value, this state should be unreachable." @@ -40,11 +40,11 @@ partial record CustomTaggedEnum : System.IEquatable { case IntVariant(var inner): writer.Write((byte)0); - IntVariant.Write(writer, inner); + IntVariantRW.Write(writer, inner); break; case StringVariant(var inner): writer.Write((byte)1); - StringVariant.Write(writer, inner); + StringVariantRW.Write(writer, inner); break; } } @@ -55,8 +55,8 @@ partial record CustomTaggedEnum : System.IEquatable registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Sum( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IntVariant), IntVariant.GetAlgebraicType(registrar)), - new(nameof(StringVariant), StringVariant.GetAlgebraicType(registrar)) + new("IntVariant", IntVariantRW.GetAlgebraicType(registrar)), + new("StringVariant", StringVariantRW.GetAlgebraicType(registrar)) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#PublicTable.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#PublicTable.verified.cs index e2853b9bf1..00222bd019 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#PublicTable.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#PublicTable.verified.cs @@ -6,60 +6,60 @@ partial struct PublicTable : System.IEquatable, SpacetimeDB.BSATN.I { public void ReadFields(System.IO.BinaryReader reader) { - ByteField = BSATN.ByteField.Read(reader); - UshortField = BSATN.UshortField.Read(reader); - UintField = BSATN.UintField.Read(reader); - UlongField = BSATN.UlongField.Read(reader); - U128Field = BSATN.U128Field.Read(reader); - U256Field = BSATN.U256Field.Read(reader); - SbyteField = BSATN.SbyteField.Read(reader); - ShortField = BSATN.ShortField.Read(reader); - IntField = BSATN.IntField.Read(reader); - LongField = BSATN.LongField.Read(reader); - I128Field = BSATN.I128Field.Read(reader); - I256Field = BSATN.I256Field.Read(reader); - BoolField = BSATN.BoolField.Read(reader); - FloatField = BSATN.FloatField.Read(reader); - DoubleField = BSATN.DoubleField.Read(reader); - StringField = BSATN.StringField.Read(reader); - IdentityField = BSATN.IdentityField.Read(reader); - ConnectionIdField = BSATN.ConnectionIdField.Read(reader); - CustomStructField = BSATN.CustomStructField.Read(reader); - CustomClassField = BSATN.CustomClassField.Read(reader); - CustomEnumField = BSATN.CustomEnumField.Read(reader); - CustomTaggedEnumField = BSATN.CustomTaggedEnumField.Read(reader); - ListField = BSATN.ListField.Read(reader); - NullableValueField = BSATN.NullableValueField.Read(reader); - NullableReferenceField = BSATN.NullableReferenceField.Read(reader); + ByteField = BSATN.ByteFieldRW.Read(reader); + UshortField = BSATN.UshortFieldRW.Read(reader); + UintField = BSATN.UintFieldRW.Read(reader); + UlongField = BSATN.UlongFieldRW.Read(reader); + U128Field = BSATN.U128FieldRW.Read(reader); + U256Field = BSATN.U256FieldRW.Read(reader); + SbyteField = BSATN.SbyteFieldRW.Read(reader); + ShortField = BSATN.ShortFieldRW.Read(reader); + IntField = BSATN.IntFieldRW.Read(reader); + LongField = BSATN.LongFieldRW.Read(reader); + I128Field = BSATN.I128FieldRW.Read(reader); + I256Field = BSATN.I256FieldRW.Read(reader); + BoolField = BSATN.BoolFieldRW.Read(reader); + FloatField = BSATN.FloatFieldRW.Read(reader); + DoubleField = BSATN.DoubleFieldRW.Read(reader); + StringField = BSATN.StringFieldRW.Read(reader); + IdentityField = BSATN.IdentityFieldRW.Read(reader); + ConnectionIdField = BSATN.ConnectionIdFieldRW.Read(reader); + CustomStructField = BSATN.CustomStructFieldRW.Read(reader); + CustomClassField = BSATN.CustomClassFieldRW.Read(reader); + CustomEnumField = BSATN.CustomEnumFieldRW.Read(reader); + CustomTaggedEnumField = BSATN.CustomTaggedEnumFieldRW.Read(reader); + ListField = BSATN.ListFieldRW.Read(reader); + NullableValueField = BSATN.NullableValueFieldRW.Read(reader); + NullableReferenceField = BSATN.NullableReferenceFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.ByteField.Write(writer, ByteField); - BSATN.UshortField.Write(writer, UshortField); - BSATN.UintField.Write(writer, UintField); - BSATN.UlongField.Write(writer, UlongField); - BSATN.U128Field.Write(writer, U128Field); - BSATN.U256Field.Write(writer, U256Field); - BSATN.SbyteField.Write(writer, SbyteField); - BSATN.ShortField.Write(writer, ShortField); - BSATN.IntField.Write(writer, IntField); - BSATN.LongField.Write(writer, LongField); - BSATN.I128Field.Write(writer, I128Field); - BSATN.I256Field.Write(writer, I256Field); - BSATN.BoolField.Write(writer, BoolField); - BSATN.FloatField.Write(writer, FloatField); - BSATN.DoubleField.Write(writer, DoubleField); - BSATN.StringField.Write(writer, StringField); - BSATN.IdentityField.Write(writer, IdentityField); - BSATN.ConnectionIdField.Write(writer, ConnectionIdField); - BSATN.CustomStructField.Write(writer, CustomStructField); - BSATN.CustomClassField.Write(writer, CustomClassField); - BSATN.CustomEnumField.Write(writer, CustomEnumField); - BSATN.CustomTaggedEnumField.Write(writer, CustomTaggedEnumField); - BSATN.ListField.Write(writer, ListField); - BSATN.NullableValueField.Write(writer, NullableValueField); - BSATN.NullableReferenceField.Write(writer, NullableReferenceField); + BSATN.ByteFieldRW.Write(writer, ByteField); + BSATN.UshortFieldRW.Write(writer, UshortField); + BSATN.UintFieldRW.Write(writer, UintField); + BSATN.UlongFieldRW.Write(writer, UlongField); + BSATN.U128FieldRW.Write(writer, U128Field); + BSATN.U256FieldRW.Write(writer, U256Field); + BSATN.SbyteFieldRW.Write(writer, SbyteField); + BSATN.ShortFieldRW.Write(writer, ShortField); + BSATN.IntFieldRW.Write(writer, IntField); + BSATN.LongFieldRW.Write(writer, LongField); + BSATN.I128FieldRW.Write(writer, I128Field); + BSATN.I256FieldRW.Write(writer, I256Field); + BSATN.BoolFieldRW.Write(writer, BoolField); + BSATN.FloatFieldRW.Write(writer, FloatField); + BSATN.DoubleFieldRW.Write(writer, DoubleField); + BSATN.StringFieldRW.Write(writer, StringField); + BSATN.IdentityFieldRW.Write(writer, IdentityField); + BSATN.ConnectionIdFieldRW.Write(writer, ConnectionIdField); + BSATN.CustomStructFieldRW.Write(writer, CustomStructField); + BSATN.CustomClassFieldRW.Write(writer, CustomClassField); + BSATN.CustomEnumFieldRW.Write(writer, CustomEnumField); + BSATN.CustomTaggedEnumFieldRW.Write(writer, CustomTaggedEnumField); + BSATN.ListFieldRW.Write(writer, ListField); + BSATN.NullableValueFieldRW.Write(writer, NullableValueField); + BSATN.NullableReferenceFieldRW.Write(writer, NullableReferenceField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -72,38 +72,38 @@ partial struct PublicTable : System.IEquatable, SpacetimeDB.BSATN.I public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.U8 ByteField = new(); - internal static readonly SpacetimeDB.BSATN.U16 UshortField = new(); - internal static readonly SpacetimeDB.BSATN.U32 UintField = new(); - internal static readonly SpacetimeDB.BSATN.U64 UlongField = new(); - internal static readonly SpacetimeDB.BSATN.U128Stdb U128Field = new(); - internal static readonly SpacetimeDB.BSATN.U256 U256Field = new(); - internal static readonly SpacetimeDB.BSATN.I8 SbyteField = new(); - internal static readonly SpacetimeDB.BSATN.I16 ShortField = new(); - internal static readonly SpacetimeDB.BSATN.I32 IntField = new(); - internal static readonly SpacetimeDB.BSATN.I64 LongField = new(); - internal static readonly SpacetimeDB.BSATN.I128Stdb I128Field = new(); - internal static readonly SpacetimeDB.BSATN.I256 I256Field = new(); - internal static readonly SpacetimeDB.BSATN.Bool BoolField = new(); - internal static readonly SpacetimeDB.BSATN.F32 FloatField = new(); - internal static readonly SpacetimeDB.BSATN.F64 DoubleField = new(); - internal static readonly SpacetimeDB.BSATN.String StringField = new(); - internal static readonly SpacetimeDB.Identity.BSATN IdentityField = new(); - internal static readonly SpacetimeDB.ConnectionId.BSATN ConnectionIdField = new(); - internal static readonly CustomStruct.BSATN CustomStructField = new(); - internal static readonly CustomClass.BSATN CustomClassField = new(); - internal static readonly SpacetimeDB.BSATN.Enum CustomEnumField = new(); - internal static readonly CustomTaggedEnum.BSATN CustomTaggedEnumField = new(); - internal static readonly SpacetimeDB.BSATN.List ListField = + internal static readonly SpacetimeDB.BSATN.U8 ByteFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U16 UshortFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 UintFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U64 UlongFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U128Stdb U128FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U256 U256FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I8 SbyteFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I16 ShortFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I64 LongFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I128Stdb I128FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I256 I256FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.Bool BoolFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.F32 FloatFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.F64 DoubleFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringFieldRW = new(); + internal static readonly SpacetimeDB.Identity.BSATN IdentityFieldRW = new(); + internal static readonly SpacetimeDB.ConnectionId.BSATN ConnectionIdFieldRW = new(); + internal static readonly CustomStruct.BSATN CustomStructFieldRW = new(); + internal static readonly CustomClass.BSATN CustomClassFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.Enum CustomEnumFieldRW = new(); + internal static readonly CustomTaggedEnum.BSATN CustomTaggedEnumFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.List ListFieldRW = new(); internal static readonly SpacetimeDB.BSATN.ValueOption< int, SpacetimeDB.BSATN.I32 - > NullableValueField = new(); + > NullableValueFieldRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< string, SpacetimeDB.BSATN.String - > NullableReferenceField = new(); + > NullableReferenceFieldRW = new(); public PublicTable Read(System.IO.BinaryReader reader) { @@ -123,36 +123,36 @@ partial struct PublicTable : System.IEquatable, SpacetimeDB.BSATN.I registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(ByteField), ByteField.GetAlgebraicType(registrar)), - new(nameof(UshortField), UshortField.GetAlgebraicType(registrar)), - new(nameof(UintField), UintField.GetAlgebraicType(registrar)), - new(nameof(UlongField), UlongField.GetAlgebraicType(registrar)), - new(nameof(U128Field), U128Field.GetAlgebraicType(registrar)), - new(nameof(U256Field), U256Field.GetAlgebraicType(registrar)), - new(nameof(SbyteField), SbyteField.GetAlgebraicType(registrar)), - new(nameof(ShortField), ShortField.GetAlgebraicType(registrar)), - new(nameof(IntField), IntField.GetAlgebraicType(registrar)), - new(nameof(LongField), LongField.GetAlgebraicType(registrar)), - new(nameof(I128Field), I128Field.GetAlgebraicType(registrar)), - new(nameof(I256Field), I256Field.GetAlgebraicType(registrar)), - new(nameof(BoolField), BoolField.GetAlgebraicType(registrar)), - new(nameof(FloatField), FloatField.GetAlgebraicType(registrar)), - new(nameof(DoubleField), DoubleField.GetAlgebraicType(registrar)), - new(nameof(StringField), StringField.GetAlgebraicType(registrar)), - new(nameof(IdentityField), IdentityField.GetAlgebraicType(registrar)), - new(nameof(ConnectionIdField), ConnectionIdField.GetAlgebraicType(registrar)), - new(nameof(CustomStructField), CustomStructField.GetAlgebraicType(registrar)), - new(nameof(CustomClassField), CustomClassField.GetAlgebraicType(registrar)), - new(nameof(CustomEnumField), CustomEnumField.GetAlgebraicType(registrar)), + new("ByteField", ByteFieldRW.GetAlgebraicType(registrar)), + new("UshortField", UshortFieldRW.GetAlgebraicType(registrar)), + new("UintField", UintFieldRW.GetAlgebraicType(registrar)), + new("UlongField", UlongFieldRW.GetAlgebraicType(registrar)), + new("U128Field", U128FieldRW.GetAlgebraicType(registrar)), + new("U256Field", U256FieldRW.GetAlgebraicType(registrar)), + new("SbyteField", SbyteFieldRW.GetAlgebraicType(registrar)), + new("ShortField", ShortFieldRW.GetAlgebraicType(registrar)), + new("IntField", IntFieldRW.GetAlgebraicType(registrar)), + new("LongField", LongFieldRW.GetAlgebraicType(registrar)), + new("I128Field", I128FieldRW.GetAlgebraicType(registrar)), + new("I256Field", I256FieldRW.GetAlgebraicType(registrar)), + new("BoolField", BoolFieldRW.GetAlgebraicType(registrar)), + new("FloatField", FloatFieldRW.GetAlgebraicType(registrar)), + new("DoubleField", DoubleFieldRW.GetAlgebraicType(registrar)), + new("StringField", StringFieldRW.GetAlgebraicType(registrar)), + new("IdentityField", IdentityFieldRW.GetAlgebraicType(registrar)), + new("ConnectionIdField", ConnectionIdFieldRW.GetAlgebraicType(registrar)), + new("CustomStructField", CustomStructFieldRW.GetAlgebraicType(registrar)), + new("CustomClassField", CustomClassFieldRW.GetAlgebraicType(registrar)), + new("CustomEnumField", CustomEnumFieldRW.GetAlgebraicType(registrar)), new( - nameof(CustomTaggedEnumField), - CustomTaggedEnumField.GetAlgebraicType(registrar) + "CustomTaggedEnumField", + CustomTaggedEnumFieldRW.GetAlgebraicType(registrar) ), - new(nameof(ListField), ListField.GetAlgebraicType(registrar)), - new(nameof(NullableValueField), NullableValueField.GetAlgebraicType(registrar)), + new("ListField", ListFieldRW.GetAlgebraicType(registrar)), + new("NullableValueField", NullableValueFieldRW.GetAlgebraicType(registrar)), new( - nameof(NullableReferenceField), - NullableReferenceField.GetAlgebraicType(registrar) + "NullableReferenceField", + NullableReferenceFieldRW.GetAlgebraicType(registrar) ) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt index befc302f0f..158020f2fc 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt @@ -116,7 +116,7 @@ SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THI }, {/* { - internal static readonly TRW Field = new(); + internal static readonly TRW FieldRW = new(); ^^^ */ diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs index dc112b7b2b..9b9688f86f 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs @@ -44,13 +44,13 @@ namespace SpacetimeDB { if (row.AutoIncField == default) { - row.AutoIncField = global::TestAutoIncNotInteger.BSATN.AutoIncField.Read( + row.AutoIncField = global::TestAutoIncNotInteger.BSATN.AutoIncFieldRW.Read( reader ); } if (row.IdentityField == default) { - row.IdentityField = global::TestAutoIncNotInteger.BSATN.IdentityField.Read( + row.IdentityField = global::TestAutoIncNotInteger.BSATN.IdentityFieldRW.Read( reader ); } @@ -859,14 +859,14 @@ static class ModuleRegistration class DummyScheduledReducer : SpacetimeDB.Internal.IReducer { - private static readonly TestScheduleIssues.BSATN table = new(); + private static readonly TestScheduleIssues.BSATN tableRW = new(); public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef( SpacetimeDB.BSATN.ITypeRegistrar registrar ) => new( nameof(DummyScheduledReducer), - [new(nameof(table), table.GetAlgebraicType(registrar))], + [new("table", tableRW.GetAlgebraicType(registrar))], null ); @@ -874,7 +874,7 @@ static class ModuleRegistration { TestScheduleIssues.DummyScheduledReducer( (SpacetimeDB.ReducerContext)ctx, - table.Read(reader) + tableRW.Read(reader) ); } } diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestAutoIncNotInteger.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestAutoIncNotInteger.verified.cs index be52ff6aca..7efaa55cdc 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestAutoIncNotInteger.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestAutoIncNotInteger.verified.cs @@ -8,14 +8,14 @@ partial struct TestAutoIncNotInteger { public void ReadFields(System.IO.BinaryReader reader) { - AutoIncField = BSATN.AutoIncField.Read(reader); - IdentityField = BSATN.IdentityField.Read(reader); + AutoIncField = BSATN.AutoIncFieldRW.Read(reader); + IdentityField = BSATN.IdentityFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.AutoIncField.Write(writer, AutoIncField); - BSATN.IdentityField.Write(writer, IdentityField); + BSATN.AutoIncFieldRW.Write(writer, AutoIncField); + BSATN.IdentityFieldRW.Write(writer, IdentityField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -28,8 +28,8 @@ partial struct TestAutoIncNotInteger public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.F32 AutoIncField = new(); - internal static readonly SpacetimeDB.BSATN.String IdentityField = new(); + internal static readonly SpacetimeDB.BSATN.F32 AutoIncFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.String IdentityFieldRW = new(); public TestAutoIncNotInteger Read(System.IO.BinaryReader reader) { @@ -50,8 +50,8 @@ partial struct TestAutoIncNotInteger _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(AutoIncField), AutoIncField.GetAlgebraicType(registrar)), - new(nameof(IdentityField), IdentityField.GetAlgebraicType(registrar)) + new("AutoIncField", AutoIncFieldRW.GetAlgebraicType(registrar)), + new("IdentityField", IdentityFieldRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIndexIssues.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIndexIssues.verified.cs index 5069f4fa3c..d39750331c 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIndexIssues.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIndexIssues.verified.cs @@ -8,12 +8,12 @@ partial struct TestIndexIssues { public void ReadFields(System.IO.BinaryReader reader) { - SelfIndexingColumn = BSATN.SelfIndexingColumn.Read(reader); + SelfIndexingColumn = BSATN.SelfIndexingColumnRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.SelfIndexingColumn.Write(writer, SelfIndexingColumn); + BSATN.SelfIndexingColumnRW.Write(writer, SelfIndexingColumn); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -26,7 +26,7 @@ partial struct TestIndexIssues public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 SelfIndexingColumn = new(); + internal static readonly SpacetimeDB.BSATN.I32 SelfIndexingColumnRW = new(); public TestIndexIssues Read(System.IO.BinaryReader reader) { @@ -47,10 +47,7 @@ partial struct TestIndexIssues _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new( - nameof(SelfIndexingColumn), - SelfIndexingColumn.GetAlgebraicType(registrar) - ) + new("SelfIndexingColumn", SelfIndexingColumnRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.verified.cs index 263a5d6cf9..858ed058a5 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.verified.cs @@ -8,18 +8,18 @@ partial struct TestScheduleIssues { public void ReadFields(System.IO.BinaryReader reader) { - IdWrongType = BSATN.IdWrongType.Read(reader); - IdCorrectType = BSATN.IdCorrectType.Read(reader); - ScheduleAtWrongType = BSATN.ScheduleAtWrongType.Read(reader); - ScheduleAtCorrectType = BSATN.ScheduleAtCorrectType.Read(reader); + IdWrongType = BSATN.IdWrongTypeRW.Read(reader); + IdCorrectType = BSATN.IdCorrectTypeRW.Read(reader); + ScheduleAtWrongType = BSATN.ScheduleAtWrongTypeRW.Read(reader); + ScheduleAtCorrectType = BSATN.ScheduleAtCorrectTypeRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.IdWrongType.Write(writer, IdWrongType); - BSATN.IdCorrectType.Write(writer, IdCorrectType); - BSATN.ScheduleAtWrongType.Write(writer, ScheduleAtWrongType); - BSATN.ScheduleAtCorrectType.Write(writer, ScheduleAtCorrectType); + BSATN.IdWrongTypeRW.Write(writer, IdWrongType); + BSATN.IdCorrectTypeRW.Write(writer, IdCorrectType); + BSATN.ScheduleAtWrongTypeRW.Write(writer, ScheduleAtWrongType); + BSATN.ScheduleAtCorrectTypeRW.Write(writer, ScheduleAtCorrectType); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -32,10 +32,10 @@ partial struct TestScheduleIssues public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.String IdWrongType = new(); - internal static readonly SpacetimeDB.BSATN.I32 IdCorrectType = new(); - internal static readonly SpacetimeDB.BSATN.I32 ScheduleAtWrongType = new(); - internal static readonly SpacetimeDB.ScheduleAt.BSATN ScheduleAtCorrectType = new(); + internal static readonly SpacetimeDB.BSATN.String IdWrongTypeRW = new(); + internal static readonly SpacetimeDB.BSATN.I32 IdCorrectTypeRW = new(); + internal static readonly SpacetimeDB.BSATN.I32 ScheduleAtWrongTypeRW = new(); + internal static readonly SpacetimeDB.ScheduleAt.BSATN ScheduleAtCorrectTypeRW = new(); public TestScheduleIssues Read(System.IO.BinaryReader reader) { @@ -56,15 +56,15 @@ partial struct TestScheduleIssues _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IdWrongType), IdWrongType.GetAlgebraicType(registrar)), - new(nameof(IdCorrectType), IdCorrectType.GetAlgebraicType(registrar)), + new("IdWrongType", IdWrongTypeRW.GetAlgebraicType(registrar)), + new("IdCorrectType", IdCorrectTypeRW.GetAlgebraicType(registrar)), new( - nameof(ScheduleAtWrongType), - ScheduleAtWrongType.GetAlgebraicType(registrar) + "ScheduleAtWrongType", + ScheduleAtWrongTypeRW.GetAlgebraicType(registrar) ), new( - nameof(ScheduleAtCorrectType), - ScheduleAtCorrectType.GetAlgebraicType(registrar) + "ScheduleAtCorrectType", + ScheduleAtCorrectTypeRW.GetAlgebraicType(registrar) ) } ) diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestTableTaggedEnum.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestTableTaggedEnum.verified.cs index 891dea4b9e..7e321681b8 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestTableTaggedEnum.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestTableTaggedEnum.verified.cs @@ -18,15 +18,15 @@ partial record TestTableTaggedEnum : System.IEquatable public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 X = new(); - internal static readonly SpacetimeDB.BSATN.I32 Y = new(); + internal static readonly SpacetimeDB.BSATN.I32 XRW = new(); + internal static readonly SpacetimeDB.BSATN.I32 YRW = new(); public TestTableTaggedEnum Read(System.IO.BinaryReader reader) { return reader.ReadByte() switch { - 0 => new X(X.Read(reader)), - 1 => new Y(Y.Read(reader)), + 0 => new X(XRW.Read(reader)), + 1 => new Y(YRW.Read(reader)), _ => throw new System.InvalidOperationException( "Invalid tag value, this state should be unreachable." @@ -40,11 +40,11 @@ partial record TestTableTaggedEnum : System.IEquatable { case X(var inner): writer.Write((byte)0); - X.Write(writer, inner); + XRW.Write(writer, inner); break; case Y(var inner): writer.Write((byte)1); - Y.Write(writer, inner); + YRW.Write(writer, inner); break; } } @@ -56,8 +56,8 @@ partial record TestTableTaggedEnum : System.IEquatable _ => new SpacetimeDB.BSATN.AlgebraicType.Sum( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(X), X.GetAlgebraicType(registrar)), - new(nameof(Y), Y.GetAlgebraicType(registrar)) + new("X", XRW.GetAlgebraicType(registrar)), + new("Y", YRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestUniqueNotEquatable.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestUniqueNotEquatable.verified.cs index b685bd427c..6d4eab1f2f 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestUniqueNotEquatable.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestUniqueNotEquatable.verified.cs @@ -8,14 +8,14 @@ partial struct TestUniqueNotEquatable { public void ReadFields(System.IO.BinaryReader reader) { - UniqueField = BSATN.UniqueField.Read(reader); - PrimaryKeyField = BSATN.PrimaryKeyField.Read(reader); + UniqueField = BSATN.UniqueFieldRW.Read(reader); + PrimaryKeyField = BSATN.PrimaryKeyFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.UniqueField.Write(writer, UniqueField); - BSATN.PrimaryKeyField.Write(writer, PrimaryKeyField); + BSATN.UniqueFieldRW.Write(writer, UniqueField); + BSATN.PrimaryKeyFieldRW.Write(writer, PrimaryKeyField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -31,8 +31,8 @@ partial struct TestUniqueNotEquatable internal static readonly SpacetimeDB.BSATN.ValueOption< int, SpacetimeDB.BSATN.I32 - > UniqueField = new(); - internal static readonly SpacetimeDB.BSATN.Enum PrimaryKeyField = + > UniqueFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.Enum PrimaryKeyFieldRW = new(); public TestUniqueNotEquatable Read(System.IO.BinaryReader reader) @@ -54,8 +54,8 @@ partial struct TestUniqueNotEquatable _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(UniqueField), UniqueField.GetAlgebraicType(registrar)), - new(nameof(PrimaryKeyField), PrimaryKeyField.GetAlgebraicType(registrar)) + new("UniqueField", UniqueFieldRW.GetAlgebraicType(registrar)), + new("PrimaryKeyField", PrimaryKeyFieldRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumField.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumField.verified.cs index afdaf691de..9f0584e348 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumField.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumField.verified.cs @@ -18,15 +18,15 @@ partial record TestTaggedEnumField : System.IEquatable public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 X = new(); - internal static readonly SpacetimeDB.BSATN.I32 Y = new(); + internal static readonly SpacetimeDB.BSATN.I32 XRW = new(); + internal static readonly SpacetimeDB.BSATN.I32 YRW = new(); public TestTaggedEnumField Read(System.IO.BinaryReader reader) { return reader.ReadByte() switch { - 0 => new X(X.Read(reader)), - 1 => new Y(Y.Read(reader)), + 0 => new X(XRW.Read(reader)), + 1 => new Y(YRW.Read(reader)), _ => throw new System.InvalidOperationException( "Invalid tag value, this state should be unreachable." @@ -40,11 +40,11 @@ partial record TestTaggedEnumField : System.IEquatable { case X(var inner): writer.Write((byte)0); - X.Write(writer, inner); + XRW.Write(writer, inner); break; case Y(var inner): writer.Write((byte)1); - Y.Write(writer, inner); + YRW.Write(writer, inner); break; } } @@ -56,8 +56,8 @@ partial record TestTaggedEnumField : System.IEquatable _ => new SpacetimeDB.BSATN.AlgebraicType.Sum( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(X), X.GetAlgebraicType(registrar)), - new(nameof(Y), Y.GetAlgebraicType(registrar)) + new("X", XRW.GetAlgebraicType(registrar)), + new("Y", YRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumInlineTuple.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumInlineTuple.verified.cs index 5f6ef5df48..761bdacb92 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumInlineTuple.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumInlineTuple.verified.cs @@ -12,13 +12,13 @@ partial record TestTaggedEnumInlineTuple : System.IEquatable { - internal static readonly SpacetimeDB.BSATN.I32 Item1 = new(); + internal static readonly SpacetimeDB.BSATN.I32 Item1RW = new(); public TestTaggedEnumInlineTuple Read(System.IO.BinaryReader reader) { return reader.ReadByte() switch { - 0 => new Item1(Item1.Read(reader)), + 0 => new Item1(Item1RW.Read(reader)), _ => throw new System.InvalidOperationException( "Invalid tag value, this state should be unreachable." @@ -32,7 +32,7 @@ partial record TestTaggedEnumInlineTuple : System.IEquatable new SpacetimeDB.BSATN.AlgebraicType.Sum( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(Item1), Item1.GetAlgebraicType(registrar)) + new("Item1", Item1RW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTypeParams_T_.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTypeParams_T_.verified.cs index a663babc03..8558fa804b 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTypeParams_T_.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTypeParams_T_.verified.cs @@ -8,12 +8,12 @@ partial struct TestTypeParams { public void ReadFields(System.IO.BinaryReader reader) { - Field = BSATN.Field.Read(reader); + Field = BSATN.FieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.Field.Write(writer, Field); + BSATN.FieldRW.Write(writer, Field); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -26,7 +26,7 @@ partial struct TestTypeParams public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite> { - internal static readonly TRW Field = new(); + internal static readonly TRW FieldRW = new(); public TestTypeParams Read(System.IO.BinaryReader reader) { @@ -47,7 +47,7 @@ partial struct TestTypeParams _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(Field), Field.GetAlgebraicType(registrar)) + new("Field", FieldRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestUnsupportedType.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestUnsupportedType.verified.cs index 362f973cc0..83e1269067 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestUnsupportedType.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestUnsupportedType.verified.cs @@ -8,18 +8,18 @@ partial struct TestUnsupportedType { public void ReadFields(System.IO.BinaryReader reader) { - UnsupportedSpecialType = BSATN.UnsupportedSpecialType.Read(reader); - UnsupportedSystemType = BSATN.UnsupportedSystemType.Read(reader); - UnresolvedType = BSATN.UnresolvedType.Read(reader); - UnsupportedEnum = BSATN.UnsupportedEnum.Read(reader); + UnsupportedSpecialType = BSATN.UnsupportedSpecialTypeRW.Read(reader); + UnsupportedSystemType = BSATN.UnsupportedSystemTypeRW.Read(reader); + UnresolvedType = BSATN.UnresolvedTypeRW.Read(reader); + UnsupportedEnum = BSATN.UnsupportedEnumRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.UnsupportedSpecialType.Write(writer, UnsupportedSpecialType); - BSATN.UnsupportedSystemType.Write(writer, UnsupportedSystemType); - BSATN.UnresolvedType.Write(writer, UnresolvedType); - BSATN.UnsupportedEnum.Write(writer, UnsupportedEnum); + BSATN.UnsupportedSpecialTypeRW.Write(writer, UnsupportedSpecialType); + BSATN.UnsupportedSystemTypeRW.Write(writer, UnsupportedSystemType); + BSATN.UnresolvedTypeRW.Write(writer, UnresolvedType); + BSATN.UnsupportedEnumRW.Write(writer, UnsupportedEnum); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -32,12 +32,12 @@ partial struct TestUnsupportedType public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.Unsupported UnsupportedSpecialType = + internal static readonly SpacetimeDB.BSATN.Unsupported UnsupportedSpecialTypeRW = new(); - internal static readonly SpacetimeDB.BSATN.Unsupported UnsupportedSystemType = + internal static readonly SpacetimeDB.BSATN.Unsupported UnsupportedSystemTypeRW = new(); - internal static readonly SpacetimeDB.BSATN.Unsupported UnresolvedType = new(); - internal static readonly SpacetimeDB.BSATN.Unsupported UnsupportedEnum = new(); + internal static readonly SpacetimeDB.BSATN.Unsupported UnresolvedTypeRW = new(); + internal static readonly SpacetimeDB.BSATN.Unsupported UnsupportedEnumRW = new(); public TestUnsupportedType Read(System.IO.BinaryReader reader) { @@ -59,15 +59,15 @@ partial struct TestUnsupportedType new SpacetimeDB.BSATN.AggregateElement[] { new( - nameof(UnsupportedSpecialType), - UnsupportedSpecialType.GetAlgebraicType(registrar) + "UnsupportedSpecialType", + UnsupportedSpecialTypeRW.GetAlgebraicType(registrar) ), new( - nameof(UnsupportedSystemType), - UnsupportedSystemType.GetAlgebraicType(registrar) + "UnsupportedSystemType", + UnsupportedSystemTypeRW.GetAlgebraicType(registrar) ), - new(nameof(UnresolvedType), UnresolvedType.GetAlgebraicType(registrar)), - new(nameof(UnsupportedEnum), UnsupportedEnum.GetAlgebraicType(registrar)) + new("UnresolvedType", UnresolvedTypeRW.GetAlgebraicType(registrar)), + new("UnsupportedEnum", UnsupportedEnumRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/Lib.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/Lib.cs index 132d8b2362..ebfaa60bb2 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/Lib.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/Lib.cs @@ -97,7 +97,7 @@ public partial record CustomTaggedEnum [SpacetimeDB.Table] public partial class PrivateTable { } -[SpacetimeDB.Table] +[SpacetimeDB.Table(Public = true)] public partial struct PublicTable { [SpacetimeDB.AutoInc] @@ -258,6 +258,17 @@ partial struct RegressionMultipleUniqueIndexesHadSameName public uint Unique2; } +/// +/// These used to cause conflicts when generating the BSATN struct for a type. +/// +[SpacetimeDB.Type] +partial struct FormerlyForbiddenFieldNames +{ + public uint Read; + public uint Write; + public uint GetAlgebraicType; +} + public class Module { [SpacetimeDB.ClientVisibilityFilter] diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeMultiColumn.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeMultiColumn.verified.cs index 7dde591c76..f3bef07e88 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeMultiColumn.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeMultiColumn.verified.cs @@ -8,16 +8,16 @@ partial struct BTreeMultiColumn { public void ReadFields(System.IO.BinaryReader reader) { - X = BSATN.X.Read(reader); - Y = BSATN.Y.Read(reader); - Z = BSATN.Z.Read(reader); + X = BSATN.XRW.Read(reader); + Y = BSATN.YRW.Read(reader); + Z = BSATN.ZRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.X.Write(writer, X); - BSATN.Y.Write(writer, Y); - BSATN.Z.Write(writer, Z); + BSATN.XRW.Write(writer, X); + BSATN.YRW.Write(writer, Y); + BSATN.ZRW.Write(writer, Z); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -30,9 +30,9 @@ partial struct BTreeMultiColumn public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.U32 X = new(); - internal static readonly SpacetimeDB.BSATN.U32 Y = new(); - internal static readonly SpacetimeDB.BSATN.U32 Z = new(); + internal static readonly SpacetimeDB.BSATN.U32 XRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 YRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 ZRW = new(); public BTreeMultiColumn Read(System.IO.BinaryReader reader) { @@ -53,9 +53,9 @@ partial struct BTreeMultiColumn _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(X), X.GetAlgebraicType(registrar)), - new(nameof(Y), Y.GetAlgebraicType(registrar)), - new(nameof(Z), Z.GetAlgebraicType(registrar)) + new("X", XRW.GetAlgebraicType(registrar)), + new("Y", YRW.GetAlgebraicType(registrar)), + new("Z", ZRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeViews.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeViews.verified.cs index 9ddb4b98ad..4f2ba4e758 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeViews.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeViews.verified.cs @@ -6,18 +6,18 @@ partial struct BTreeViews : System.IEquatable, SpacetimeDB.BSATN.ISt { public void ReadFields(System.IO.BinaryReader reader) { - Id = BSATN.Id.Read(reader); - X = BSATN.X.Read(reader); - Y = BSATN.Y.Read(reader); - Faction = BSATN.Faction.Read(reader); + Id = BSATN.IdRW.Read(reader); + X = BSATN.XRW.Read(reader); + Y = BSATN.YRW.Read(reader); + Faction = BSATN.FactionRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.Id.Write(writer, Id); - BSATN.X.Write(writer, X); - BSATN.Y.Write(writer, Y); - BSATN.Faction.Write(writer, Faction); + BSATN.IdRW.Write(writer, Id); + BSATN.XRW.Write(writer, X); + BSATN.YRW.Write(writer, Y); + BSATN.FactionRW.Write(writer, Faction); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -30,10 +30,10 @@ partial struct BTreeViews : System.IEquatable, SpacetimeDB.BSATN.ISt public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.Identity.BSATN Id = new(); - internal static readonly SpacetimeDB.BSATN.U32 X = new(); - internal static readonly SpacetimeDB.BSATN.U32 Y = new(); - internal static readonly SpacetimeDB.BSATN.String Faction = new(); + internal static readonly SpacetimeDB.Identity.BSATN IdRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 XRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 YRW = new(); + internal static readonly SpacetimeDB.BSATN.String FactionRW = new(); public BTreeViews Read(System.IO.BinaryReader reader) { @@ -53,10 +53,10 @@ partial struct BTreeViews : System.IEquatable, SpacetimeDB.BSATN.ISt registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(Id), Id.GetAlgebraicType(registrar)), - new(nameof(X), X.GetAlgebraicType(registrar)), - new(nameof(Y), Y.GetAlgebraicType(registrar)), - new(nameof(Faction), Faction.GetAlgebraicType(registrar)) + new("Id", IdRW.GetAlgebraicType(registrar)), + new("X", XRW.GetAlgebraicType(registrar)), + new("Y", YRW.GetAlgebraicType(registrar)), + new("Faction", FactionRW.GetAlgebraicType(registrar)) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs index 720acc8dcf..88c501e4e6 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs @@ -408,7 +408,7 @@ namespace SpacetimeDB { if (row.Foo == default) { - row.Foo = global::MultiTableRow.BSATN.Foo.Read(reader); + row.Foo = global::MultiTableRow.BSATN.FooRW.Read(reader); } return row; } @@ -530,7 +530,7 @@ namespace SpacetimeDB { if (row.Foo == default) { - row.Foo = global::MultiTableRow.BSATN.Foo.Read(reader); + row.Foo = global::MultiTableRow.BSATN.FooRW.Read(reader); } return row; } @@ -652,7 +652,7 @@ namespace SpacetimeDB { if (row.Id == default) { - row.Id = global::PublicTable.BSATN.Id.Read(reader); + row.Id = global::PublicTable.BSATN.IdRW.Read(reader); } return row; } @@ -690,7 +690,7 @@ namespace SpacetimeDB ], Schedule: null, TableType: SpacetimeDB.Internal.TableType.User, - TableAccess: SpacetimeDB.Internal.TableAccess.Private + TableAccess: SpacetimeDB.Internal.TableAccess.Public ); public ulong Count => @@ -870,7 +870,7 @@ namespace SpacetimeDB { if (row.ScheduledId == default) { - row.ScheduledId = global::Timers.SendMessageTimer.BSATN.ScheduledId.Read( + row.ScheduledId = global::Timers.SendMessageTimer.BSATN.ScheduledIdRW.Read( reader ); } @@ -998,89 +998,80 @@ static class ModuleRegistration class InsertData : SpacetimeDB.Internal.IReducer { - private static readonly PublicTable.BSATN data = new(); + private static readonly PublicTable.BSATN dataRW = new(); public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef( SpacetimeDB.BSATN.ITypeRegistrar registrar - ) => new(nameof(InsertData), [new(nameof(data), data.GetAlgebraicType(registrar))], null); + ) => new(nameof(InsertData), [new("data", dataRW.GetAlgebraicType(registrar))], null); public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx) { - Reducers.InsertData((SpacetimeDB.ReducerContext)ctx, data.Read(reader)); + Reducers.InsertData((SpacetimeDB.ReducerContext)ctx, dataRW.Read(reader)); } } class InsertData2 : SpacetimeDB.Internal.IReducer { - private static readonly PublicTable.BSATN data = new(); + private static readonly PublicTable.BSATN dataRW = new(); public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef( SpacetimeDB.BSATN.ITypeRegistrar registrar - ) => new(nameof(InsertData2), [new(nameof(data), data.GetAlgebraicType(registrar))], null); + ) => new(nameof(InsertData2), [new("data", dataRW.GetAlgebraicType(registrar))], null); public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx) { Test.NestingNamespaces.AndClasses.InsertData2( (SpacetimeDB.ReducerContext)ctx, - data.Read(reader) + dataRW.Read(reader) ); } } class InsertMultiData : SpacetimeDB.Internal.IReducer { - private static readonly MultiTableRow.BSATN data = new(); + private static readonly MultiTableRow.BSATN dataRW = new(); public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef( SpacetimeDB.BSATN.ITypeRegistrar registrar - ) => - new( - nameof(InsertMultiData), - [new(nameof(data), data.GetAlgebraicType(registrar))], - null - ); + ) => new(nameof(InsertMultiData), [new("data", dataRW.GetAlgebraicType(registrar))], null); public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx) { - MultiTableRow.InsertMultiData((SpacetimeDB.ReducerContext)ctx, data.Read(reader)); + MultiTableRow.InsertMultiData((SpacetimeDB.ReducerContext)ctx, dataRW.Read(reader)); } } class ScheduleImmediate : SpacetimeDB.Internal.IReducer { - private static readonly PublicTable.BSATN data = new(); + private static readonly PublicTable.BSATN dataRW = new(); public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef( SpacetimeDB.BSATN.ITypeRegistrar registrar ) => - new( - nameof(ScheduleImmediate), - [new(nameof(data), data.GetAlgebraicType(registrar))], - null - ); + new(nameof(ScheduleImmediate), [new("data", dataRW.GetAlgebraicType(registrar))], null); public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx) { - Reducers.ScheduleImmediate((SpacetimeDB.ReducerContext)ctx, data.Read(reader)); + Reducers.ScheduleImmediate((SpacetimeDB.ReducerContext)ctx, dataRW.Read(reader)); } } class SendScheduledMessage : SpacetimeDB.Internal.IReducer { - private static readonly Timers.SendMessageTimer.BSATN arg = new(); + private static readonly Timers.SendMessageTimer.BSATN argRW = new(); public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef( SpacetimeDB.BSATN.ITypeRegistrar registrar ) => new( nameof(SendScheduledMessage), - [new(nameof(arg), arg.GetAlgebraicType(registrar))], + [new("arg", argRW.GetAlgebraicType(registrar))], null ); public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx) { - Timers.SendScheduledMessage((SpacetimeDB.ReducerContext)ctx, arg.Read(reader)); + Timers.SendScheduledMessage((SpacetimeDB.ReducerContext)ctx, argRW.Read(reader)); } } diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#MultiTableRow.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#MultiTableRow.verified.cs index 21f29dc879..7a801bc3b6 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#MultiTableRow.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#MultiTableRow.verified.cs @@ -8,16 +8,16 @@ partial struct MultiTableRow { public void ReadFields(System.IO.BinaryReader reader) { - Name = BSATN.Name.Read(reader); - Foo = BSATN.Foo.Read(reader); - Bar = BSATN.Bar.Read(reader); + Name = BSATN.NameRW.Read(reader); + Foo = BSATN.FooRW.Read(reader); + Bar = BSATN.BarRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.Name.Write(writer, Name); - BSATN.Foo.Write(writer, Foo); - BSATN.Bar.Write(writer, Bar); + BSATN.NameRW.Write(writer, Name); + BSATN.FooRW.Write(writer, Foo); + BSATN.BarRW.Write(writer, Bar); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -30,9 +30,9 @@ partial struct MultiTableRow public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.String Name = new(); - internal static readonly SpacetimeDB.BSATN.U32 Foo = new(); - internal static readonly SpacetimeDB.BSATN.U32 Bar = new(); + internal static readonly SpacetimeDB.BSATN.String NameRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 FooRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 BarRW = new(); public MultiTableRow Read(System.IO.BinaryReader reader) { @@ -52,9 +52,9 @@ partial struct MultiTableRow registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(Name), Name.GetAlgebraicType(registrar)), - new(nameof(Foo), Foo.GetAlgebraicType(registrar)), - new(nameof(Bar), Bar.GetAlgebraicType(registrar)) + new("Name", NameRW.GetAlgebraicType(registrar)), + new("Foo", FooRW.GetAlgebraicType(registrar)), + new("Bar", BarRW.GetAlgebraicType(registrar)) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#PublicTable.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#PublicTable.verified.cs index c9c213c89e..bcd42a2048 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#PublicTable.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#PublicTable.verified.cs @@ -6,66 +6,66 @@ partial struct PublicTable : System.IEquatable, SpacetimeDB.BSATN.I { public void ReadFields(System.IO.BinaryReader reader) { - Id = BSATN.Id.Read(reader); - ByteField = BSATN.ByteField.Read(reader); - UshortField = BSATN.UshortField.Read(reader); - UintField = BSATN.UintField.Read(reader); - UlongField = BSATN.UlongField.Read(reader); - UInt128Field = BSATN.UInt128Field.Read(reader); - U128Field = BSATN.U128Field.Read(reader); - U256Field = BSATN.U256Field.Read(reader); - SbyteField = BSATN.SbyteField.Read(reader); - ShortField = BSATN.ShortField.Read(reader); - IntField = BSATN.IntField.Read(reader); - LongField = BSATN.LongField.Read(reader); - Int128Field = BSATN.Int128Field.Read(reader); - I128Field = BSATN.I128Field.Read(reader); - I256Field = BSATN.I256Field.Read(reader); - BoolField = BSATN.BoolField.Read(reader); - FloatField = BSATN.FloatField.Read(reader); - DoubleField = BSATN.DoubleField.Read(reader); - StringField = BSATN.StringField.Read(reader); - IdentityField = BSATN.IdentityField.Read(reader); - ConnectionIdField = BSATN.ConnectionIdField.Read(reader); - CustomStructField = BSATN.CustomStructField.Read(reader); - CustomClassField = BSATN.CustomClassField.Read(reader); - CustomEnumField = BSATN.CustomEnumField.Read(reader); - CustomTaggedEnumField = BSATN.CustomTaggedEnumField.Read(reader); - ListField = BSATN.ListField.Read(reader); - NullableValueField = BSATN.NullableValueField.Read(reader); - NullableReferenceField = BSATN.NullableReferenceField.Read(reader); + Id = BSATN.IdRW.Read(reader); + ByteField = BSATN.ByteFieldRW.Read(reader); + UshortField = BSATN.UshortFieldRW.Read(reader); + UintField = BSATN.UintFieldRW.Read(reader); + UlongField = BSATN.UlongFieldRW.Read(reader); + UInt128Field = BSATN.UInt128FieldRW.Read(reader); + U128Field = BSATN.U128FieldRW.Read(reader); + U256Field = BSATN.U256FieldRW.Read(reader); + SbyteField = BSATN.SbyteFieldRW.Read(reader); + ShortField = BSATN.ShortFieldRW.Read(reader); + IntField = BSATN.IntFieldRW.Read(reader); + LongField = BSATN.LongFieldRW.Read(reader); + Int128Field = BSATN.Int128FieldRW.Read(reader); + I128Field = BSATN.I128FieldRW.Read(reader); + I256Field = BSATN.I256FieldRW.Read(reader); + BoolField = BSATN.BoolFieldRW.Read(reader); + FloatField = BSATN.FloatFieldRW.Read(reader); + DoubleField = BSATN.DoubleFieldRW.Read(reader); + StringField = BSATN.StringFieldRW.Read(reader); + IdentityField = BSATN.IdentityFieldRW.Read(reader); + ConnectionIdField = BSATN.ConnectionIdFieldRW.Read(reader); + CustomStructField = BSATN.CustomStructFieldRW.Read(reader); + CustomClassField = BSATN.CustomClassFieldRW.Read(reader); + CustomEnumField = BSATN.CustomEnumFieldRW.Read(reader); + CustomTaggedEnumField = BSATN.CustomTaggedEnumFieldRW.Read(reader); + ListField = BSATN.ListFieldRW.Read(reader); + NullableValueField = BSATN.NullableValueFieldRW.Read(reader); + NullableReferenceField = BSATN.NullableReferenceFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.Id.Write(writer, Id); - BSATN.ByteField.Write(writer, ByteField); - BSATN.UshortField.Write(writer, UshortField); - BSATN.UintField.Write(writer, UintField); - BSATN.UlongField.Write(writer, UlongField); - BSATN.UInt128Field.Write(writer, UInt128Field); - BSATN.U128Field.Write(writer, U128Field); - BSATN.U256Field.Write(writer, U256Field); - BSATN.SbyteField.Write(writer, SbyteField); - BSATN.ShortField.Write(writer, ShortField); - BSATN.IntField.Write(writer, IntField); - BSATN.LongField.Write(writer, LongField); - BSATN.Int128Field.Write(writer, Int128Field); - BSATN.I128Field.Write(writer, I128Field); - BSATN.I256Field.Write(writer, I256Field); - BSATN.BoolField.Write(writer, BoolField); - BSATN.FloatField.Write(writer, FloatField); - BSATN.DoubleField.Write(writer, DoubleField); - BSATN.StringField.Write(writer, StringField); - BSATN.IdentityField.Write(writer, IdentityField); - BSATN.ConnectionIdField.Write(writer, ConnectionIdField); - BSATN.CustomStructField.Write(writer, CustomStructField); - BSATN.CustomClassField.Write(writer, CustomClassField); - BSATN.CustomEnumField.Write(writer, CustomEnumField); - BSATN.CustomTaggedEnumField.Write(writer, CustomTaggedEnumField); - BSATN.ListField.Write(writer, ListField); - BSATN.NullableValueField.Write(writer, NullableValueField); - BSATN.NullableReferenceField.Write(writer, NullableReferenceField); + BSATN.IdRW.Write(writer, Id); + BSATN.ByteFieldRW.Write(writer, ByteField); + BSATN.UshortFieldRW.Write(writer, UshortField); + BSATN.UintFieldRW.Write(writer, UintField); + BSATN.UlongFieldRW.Write(writer, UlongField); + BSATN.UInt128FieldRW.Write(writer, UInt128Field); + BSATN.U128FieldRW.Write(writer, U128Field); + BSATN.U256FieldRW.Write(writer, U256Field); + BSATN.SbyteFieldRW.Write(writer, SbyteField); + BSATN.ShortFieldRW.Write(writer, ShortField); + BSATN.IntFieldRW.Write(writer, IntField); + BSATN.LongFieldRW.Write(writer, LongField); + BSATN.Int128FieldRW.Write(writer, Int128Field); + BSATN.I128FieldRW.Write(writer, I128Field); + BSATN.I256FieldRW.Write(writer, I256Field); + BSATN.BoolFieldRW.Write(writer, BoolField); + BSATN.FloatFieldRW.Write(writer, FloatField); + BSATN.DoubleFieldRW.Write(writer, DoubleField); + BSATN.StringFieldRW.Write(writer, StringField); + BSATN.IdentityFieldRW.Write(writer, IdentityField); + BSATN.ConnectionIdFieldRW.Write(writer, ConnectionIdField); + BSATN.CustomStructFieldRW.Write(writer, CustomStructField); + BSATN.CustomClassFieldRW.Write(writer, CustomClassField); + BSATN.CustomEnumFieldRW.Write(writer, CustomEnumField); + BSATN.CustomTaggedEnumFieldRW.Write(writer, CustomTaggedEnumField); + BSATN.ListFieldRW.Write(writer, ListField); + BSATN.NullableValueFieldRW.Write(writer, NullableValueField); + BSATN.NullableReferenceFieldRW.Write(writer, NullableReferenceField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -78,41 +78,41 @@ partial struct PublicTable : System.IEquatable, SpacetimeDB.BSATN.I public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 Id = new(); - internal static readonly SpacetimeDB.BSATN.U8 ByteField = new(); - internal static readonly SpacetimeDB.BSATN.U16 UshortField = new(); - internal static readonly SpacetimeDB.BSATN.U32 UintField = new(); - internal static readonly SpacetimeDB.BSATN.U64 UlongField = new(); - internal static readonly SpacetimeDB.BSATN.U128 UInt128Field = new(); - internal static readonly SpacetimeDB.BSATN.U128Stdb U128Field = new(); - internal static readonly SpacetimeDB.BSATN.U256 U256Field = new(); - internal static readonly SpacetimeDB.BSATN.I8 SbyteField = new(); - internal static readonly SpacetimeDB.BSATN.I16 ShortField = new(); - internal static readonly SpacetimeDB.BSATN.I32 IntField = new(); - internal static readonly SpacetimeDB.BSATN.I64 LongField = new(); - internal static readonly SpacetimeDB.BSATN.I128 Int128Field = new(); - internal static readonly SpacetimeDB.BSATN.I128Stdb I128Field = new(); - internal static readonly SpacetimeDB.BSATN.I256 I256Field = new(); - internal static readonly SpacetimeDB.BSATN.Bool BoolField = new(); - internal static readonly SpacetimeDB.BSATN.F32 FloatField = new(); - internal static readonly SpacetimeDB.BSATN.F64 DoubleField = new(); - internal static readonly SpacetimeDB.BSATN.String StringField = new(); - internal static readonly SpacetimeDB.Identity.BSATN IdentityField = new(); - internal static readonly SpacetimeDB.ConnectionId.BSATN ConnectionIdField = new(); - internal static readonly CustomStruct.BSATN CustomStructField = new(); - internal static readonly CustomClass.BSATN CustomClassField = new(); - internal static readonly SpacetimeDB.BSATN.Enum CustomEnumField = new(); - internal static readonly CustomTaggedEnum.BSATN CustomTaggedEnumField = new(); - internal static readonly SpacetimeDB.BSATN.List ListField = + internal static readonly SpacetimeDB.BSATN.I32 IdRW = new(); + internal static readonly SpacetimeDB.BSATN.U8 ByteFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U16 UshortFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 UintFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U64 UlongFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U128 UInt128FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U128Stdb U128FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.U256 U256FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I8 SbyteFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I16 ShortFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I64 LongFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I128 Int128FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I128Stdb I128FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.I256 I256FieldRW = new(); + internal static readonly SpacetimeDB.BSATN.Bool BoolFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.F32 FloatFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.F64 DoubleFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringFieldRW = new(); + internal static readonly SpacetimeDB.Identity.BSATN IdentityFieldRW = new(); + internal static readonly SpacetimeDB.ConnectionId.BSATN ConnectionIdFieldRW = new(); + internal static readonly CustomStruct.BSATN CustomStructFieldRW = new(); + internal static readonly CustomClass.BSATN CustomClassFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.Enum CustomEnumFieldRW = new(); + internal static readonly CustomTaggedEnum.BSATN CustomTaggedEnumFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.List ListFieldRW = new(); internal static readonly SpacetimeDB.BSATN.ValueOption< int, SpacetimeDB.BSATN.I32 - > NullableValueField = new(); + > NullableValueFieldRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< string, SpacetimeDB.BSATN.String - > NullableReferenceField = new(); + > NullableReferenceFieldRW = new(); public PublicTable Read(System.IO.BinaryReader reader) { @@ -132,39 +132,39 @@ partial struct PublicTable : System.IEquatable, SpacetimeDB.BSATN.I registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(Id), Id.GetAlgebraicType(registrar)), - new(nameof(ByteField), ByteField.GetAlgebraicType(registrar)), - new(nameof(UshortField), UshortField.GetAlgebraicType(registrar)), - new(nameof(UintField), UintField.GetAlgebraicType(registrar)), - new(nameof(UlongField), UlongField.GetAlgebraicType(registrar)), - new(nameof(UInt128Field), UInt128Field.GetAlgebraicType(registrar)), - new(nameof(U128Field), U128Field.GetAlgebraicType(registrar)), - new(nameof(U256Field), U256Field.GetAlgebraicType(registrar)), - new(nameof(SbyteField), SbyteField.GetAlgebraicType(registrar)), - new(nameof(ShortField), ShortField.GetAlgebraicType(registrar)), - new(nameof(IntField), IntField.GetAlgebraicType(registrar)), - new(nameof(LongField), LongField.GetAlgebraicType(registrar)), - new(nameof(Int128Field), Int128Field.GetAlgebraicType(registrar)), - new(nameof(I128Field), I128Field.GetAlgebraicType(registrar)), - new(nameof(I256Field), I256Field.GetAlgebraicType(registrar)), - new(nameof(BoolField), BoolField.GetAlgebraicType(registrar)), - new(nameof(FloatField), FloatField.GetAlgebraicType(registrar)), - new(nameof(DoubleField), DoubleField.GetAlgebraicType(registrar)), - new(nameof(StringField), StringField.GetAlgebraicType(registrar)), - new(nameof(IdentityField), IdentityField.GetAlgebraicType(registrar)), - new(nameof(ConnectionIdField), ConnectionIdField.GetAlgebraicType(registrar)), - new(nameof(CustomStructField), CustomStructField.GetAlgebraicType(registrar)), - new(nameof(CustomClassField), CustomClassField.GetAlgebraicType(registrar)), - new(nameof(CustomEnumField), CustomEnumField.GetAlgebraicType(registrar)), + new("Id", IdRW.GetAlgebraicType(registrar)), + new("ByteField", ByteFieldRW.GetAlgebraicType(registrar)), + new("UshortField", UshortFieldRW.GetAlgebraicType(registrar)), + new("UintField", UintFieldRW.GetAlgebraicType(registrar)), + new("UlongField", UlongFieldRW.GetAlgebraicType(registrar)), + new("UInt128Field", UInt128FieldRW.GetAlgebraicType(registrar)), + new("U128Field", U128FieldRW.GetAlgebraicType(registrar)), + new("U256Field", U256FieldRW.GetAlgebraicType(registrar)), + new("SbyteField", SbyteFieldRW.GetAlgebraicType(registrar)), + new("ShortField", ShortFieldRW.GetAlgebraicType(registrar)), + new("IntField", IntFieldRW.GetAlgebraicType(registrar)), + new("LongField", LongFieldRW.GetAlgebraicType(registrar)), + new("Int128Field", Int128FieldRW.GetAlgebraicType(registrar)), + new("I128Field", I128FieldRW.GetAlgebraicType(registrar)), + new("I256Field", I256FieldRW.GetAlgebraicType(registrar)), + new("BoolField", BoolFieldRW.GetAlgebraicType(registrar)), + new("FloatField", FloatFieldRW.GetAlgebraicType(registrar)), + new("DoubleField", DoubleFieldRW.GetAlgebraicType(registrar)), + new("StringField", StringFieldRW.GetAlgebraicType(registrar)), + new("IdentityField", IdentityFieldRW.GetAlgebraicType(registrar)), + new("ConnectionIdField", ConnectionIdFieldRW.GetAlgebraicType(registrar)), + new("CustomStructField", CustomStructFieldRW.GetAlgebraicType(registrar)), + new("CustomClassField", CustomClassFieldRW.GetAlgebraicType(registrar)), + new("CustomEnumField", CustomEnumFieldRW.GetAlgebraicType(registrar)), new( - nameof(CustomTaggedEnumField), - CustomTaggedEnumField.GetAlgebraicType(registrar) + "CustomTaggedEnumField", + CustomTaggedEnumFieldRW.GetAlgebraicType(registrar) ), - new(nameof(ListField), ListField.GetAlgebraicType(registrar)), - new(nameof(NullableValueField), NullableValueField.GetAlgebraicType(registrar)), + new("ListField", ListFieldRW.GetAlgebraicType(registrar)), + new("NullableValueField", NullableValueFieldRW.GetAlgebraicType(registrar)), new( - nameof(NullableReferenceField), - NullableReferenceField.GetAlgebraicType(registrar) + "NullableReferenceField", + NullableReferenceFieldRW.GetAlgebraicType(registrar) ) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#RegressionMultipleUniqueIndexesHadSameName.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#RegressionMultipleUniqueIndexesHadSameName.verified.cs index 339b6e359c..bf52d45ea0 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#RegressionMultipleUniqueIndexesHadSameName.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#RegressionMultipleUniqueIndexesHadSameName.verified.cs @@ -8,14 +8,14 @@ partial struct RegressionMultipleUniqueIndexesHadSameName { public void ReadFields(System.IO.BinaryReader reader) { - Unique1 = BSATN.Unique1.Read(reader); - Unique2 = BSATN.Unique2.Read(reader); + Unique1 = BSATN.Unique1RW.Read(reader); + Unique2 = BSATN.Unique2RW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.Unique1.Write(writer, Unique1); - BSATN.Unique2.Write(writer, Unique2); + BSATN.Unique1RW.Write(writer, Unique1); + BSATN.Unique2RW.Write(writer, Unique2); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -29,8 +29,8 @@ partial struct RegressionMultipleUniqueIndexesHadSameName public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.U32 Unique1 = new(); - internal static readonly SpacetimeDB.BSATN.U32 Unique2 = new(); + internal static readonly SpacetimeDB.BSATN.U32 Unique1RW = new(); + internal static readonly SpacetimeDB.BSATN.U32 Unique2RW = new(); public RegressionMultipleUniqueIndexesHadSameName Read(System.IO.BinaryReader reader) { @@ -54,8 +54,8 @@ partial struct RegressionMultipleUniqueIndexesHadSameName _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(Unique1), Unique1.GetAlgebraicType(registrar)), - new(nameof(Unique2), Unique2.GetAlgebraicType(registrar)) + new("Unique1", Unique1RW.GetAlgebraicType(registrar)), + new("Unique2", Unique2RW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#Timers.SendMessageTimer.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#Timers.SendMessageTimer.verified.cs index 2d11a98093..de0599768a 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#Timers.SendMessageTimer.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#Timers.SendMessageTimer.verified.cs @@ -10,16 +10,16 @@ partial class Timers { public void ReadFields(System.IO.BinaryReader reader) { - ScheduledId = BSATN.ScheduledId.Read(reader); - ScheduledAt = BSATN.ScheduledAt.Read(reader); - Text = BSATN.Text.Read(reader); + ScheduledId = BSATN.ScheduledIdRW.Read(reader); + ScheduledAt = BSATN.ScheduledAtRW.Read(reader); + Text = BSATN.TextRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.ScheduledId.Write(writer, ScheduledId); - BSATN.ScheduledAt.Write(writer, ScheduledAt); - BSATN.Text.Write(writer, Text); + BSATN.ScheduledIdRW.Write(writer, ScheduledId); + BSATN.ScheduledAtRW.Write(writer, ScheduledAt); + BSATN.TextRW.Write(writer, Text); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -32,9 +32,9 @@ partial class Timers public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.U64 ScheduledId = new(); - internal static readonly SpacetimeDB.ScheduleAt.BSATN ScheduledAt = new(); - internal static readonly SpacetimeDB.BSATN.String Text = new(); + internal static readonly SpacetimeDB.BSATN.U64 ScheduledIdRW = new(); + internal static readonly SpacetimeDB.ScheduleAt.BSATN ScheduledAtRW = new(); + internal static readonly SpacetimeDB.BSATN.String TextRW = new(); public Timers.SendMessageTimer Read(System.IO.BinaryReader reader) { @@ -55,9 +55,9 @@ partial class Timers _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(ScheduledId), ScheduledId.GetAlgebraicType(registrar)), - new(nameof(ScheduledAt), ScheduledAt.GetAlgebraicType(registrar)), - new(nameof(Text), Text.GetAlgebraicType(registrar)) + new("ScheduledId", ScheduledIdRW.GetAlgebraicType(registrar)), + new("ScheduledAt", ScheduledAtRW.GetAlgebraicType(registrar)), + new("Text", TextRW.GetAlgebraicType(registrar)) } ) ); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#ContainsNestedLists.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#ContainsNestedLists.verified.cs index 6ed13d952d..87362d50f8 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#ContainsNestedLists.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#ContainsNestedLists.verified.cs @@ -8,26 +8,26 @@ partial class ContainsNestedLists { public void ReadFields(System.IO.BinaryReader reader) { - IntList = BSATN.IntList.Read(reader); - StringList = BSATN.StringList.Read(reader); - IntArray = BSATN.IntArray.Read(reader); - StringArray = BSATN.StringArray.Read(reader); - IntArrayArrayList = BSATN.IntArrayArrayList.Read(reader); - IntListListArray = BSATN.IntListListArray.Read(reader); - StringArrayArrayList = BSATN.StringArrayArrayList.Read(reader); - StringListListArray = BSATN.StringListListArray.Read(reader); + IntList = BSATN.IntListRW.Read(reader); + StringList = BSATN.StringListRW.Read(reader); + IntArray = BSATN.IntArrayRW.Read(reader); + StringArray = BSATN.StringArrayRW.Read(reader); + IntArrayArrayList = BSATN.IntArrayArrayListRW.Read(reader); + IntListListArray = BSATN.IntListListArrayRW.Read(reader); + StringArrayArrayList = BSATN.StringArrayArrayListRW.Read(reader); + StringListListArray = BSATN.StringListListArrayRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.IntList.Write(writer, IntList); - BSATN.StringList.Write(writer, StringList); - BSATN.IntArray.Write(writer, IntArray); - BSATN.StringArray.Write(writer, StringArray); - BSATN.IntArrayArrayList.Write(writer, IntArrayArrayList); - BSATN.IntListListArray.Write(writer, IntListListArray); - BSATN.StringArrayArrayList.Write(writer, StringArrayArrayList); - BSATN.StringListListArray.Write(writer, StringListListArray); + BSATN.IntListRW.Write(writer, IntList); + BSATN.StringListRW.Write(writer, StringList); + BSATN.IntArrayRW.Write(writer, IntArray); + BSATN.StringArrayRW.Write(writer, StringArray); + BSATN.IntArrayArrayListRW.Write(writer, IntArrayArrayList); + BSATN.IntListListArrayRW.Write(writer, IntListListArray); + BSATN.StringArrayArrayListRW.Write(writer, StringArrayArrayList); + BSATN.StringListListArrayRW.Write(writer, StringListListArray); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -40,42 +40,43 @@ partial class ContainsNestedLists public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.List IntList = new(); + internal static readonly SpacetimeDB.BSATN.List IntListRW = + new(); internal static readonly SpacetimeDB.BSATN.List< string, SpacetimeDB.BSATN.String - > StringList = new(); - internal static readonly SpacetimeDB.BSATN.Array IntArray = + > StringListRW = new(); + internal static readonly SpacetimeDB.BSATN.Array IntArrayRW = new(); internal static readonly SpacetimeDB.BSATN.Array< string, SpacetimeDB.BSATN.String - > StringArray = new(); + > StringArrayRW = new(); internal static readonly SpacetimeDB.BSATN.List< int[][], SpacetimeDB.BSATN.Array> - > IntArrayArrayList = new(); + > IntArrayArrayListRW = new(); internal static readonly SpacetimeDB.BSATN.Array< System.Collections.Generic.List>, SpacetimeDB.BSATN.List< System.Collections.Generic.List, SpacetimeDB.BSATN.List > - > IntListListArray = new(); + > IntListListArrayRW = new(); internal static readonly SpacetimeDB.BSATN.List< string[][], SpacetimeDB.BSATN.Array< string[], SpacetimeDB.BSATN.Array > - > StringArrayArrayList = new(); + > StringArrayArrayListRW = new(); internal static readonly SpacetimeDB.BSATN.Array< System.Collections.Generic.List>, SpacetimeDB.BSATN.List< System.Collections.Generic.List, SpacetimeDB.BSATN.List > - > StringListListArray = new(); + > StringListListArrayRW = new(); public ContainsNestedLists Read(System.IO.BinaryReader reader) { @@ -96,22 +97,19 @@ partial class ContainsNestedLists _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IntList), IntList.GetAlgebraicType(registrar)), - new(nameof(StringList), StringList.GetAlgebraicType(registrar)), - new(nameof(IntArray), IntArray.GetAlgebraicType(registrar)), - new(nameof(StringArray), StringArray.GetAlgebraicType(registrar)), + new("IntList", IntListRW.GetAlgebraicType(registrar)), + new("StringList", StringListRW.GetAlgebraicType(registrar)), + new("IntArray", IntArrayRW.GetAlgebraicType(registrar)), + new("StringArray", StringArrayRW.GetAlgebraicType(registrar)), + new("IntArrayArrayList", IntArrayArrayListRW.GetAlgebraicType(registrar)), + new("IntListListArray", IntListListArrayRW.GetAlgebraicType(registrar)), new( - nameof(IntArrayArrayList), - IntArrayArrayList.GetAlgebraicType(registrar) - ), - new(nameof(IntListListArray), IntListListArray.GetAlgebraicType(registrar)), - new( - nameof(StringArrayArrayList), - StringArrayArrayList.GetAlgebraicType(registrar) + "StringArrayArrayList", + StringArrayArrayListRW.GetAlgebraicType(registrar) ), new( - nameof(StringListListArray), - StringListListArray.GetAlgebraicType(registrar) + "StringListListArray", + StringListListArrayRW.GetAlgebraicType(registrar) ) } ) diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomClass.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomClass.verified.cs index df0fcd84d8..88e7ba6985 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomClass.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomClass.verified.cs @@ -6,18 +6,18 @@ partial class CustomClass : System.IEquatable, SpacetimeDB.BSATN.IS { public void ReadFields(System.IO.BinaryReader reader) { - IntField = BSATN.IntField.Read(reader); - StringField = BSATN.StringField.Read(reader); - NullableIntField = BSATN.NullableIntField.Read(reader); - NullableStringField = BSATN.NullableStringField.Read(reader); + IntField = BSATN.IntFieldRW.Read(reader); + StringField = BSATN.StringFieldRW.Read(reader); + NullableIntField = BSATN.NullableIntFieldRW.Read(reader); + NullableStringField = BSATN.NullableStringFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.IntField.Write(writer, IntField); - BSATN.StringField.Write(writer, StringField); - BSATN.NullableIntField.Write(writer, NullableIntField); - BSATN.NullableStringField.Write(writer, NullableStringField); + BSATN.IntFieldRW.Write(writer, IntField); + BSATN.StringFieldRW.Write(writer, StringField); + BSATN.NullableIntFieldRW.Write(writer, NullableIntField); + BSATN.NullableStringFieldRW.Write(writer, NullableStringField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -30,16 +30,16 @@ partial class CustomClass : System.IEquatable, SpacetimeDB.BSATN.IS public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 IntField = new(); - internal static readonly SpacetimeDB.BSATN.String StringField = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringFieldRW = new(); internal static readonly SpacetimeDB.BSATN.ValueOption< int, SpacetimeDB.BSATN.I32 - > NullableIntField = new(); + > NullableIntFieldRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< string, SpacetimeDB.BSATN.String - > NullableStringField = new(); + > NullableStringFieldRW = new(); public CustomClass Read(System.IO.BinaryReader reader) { @@ -59,13 +59,10 @@ partial class CustomClass : System.IEquatable, SpacetimeDB.BSATN.IS registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IntField), IntField.GetAlgebraicType(registrar)), - new(nameof(StringField), StringField.GetAlgebraicType(registrar)), - new(nameof(NullableIntField), NullableIntField.GetAlgebraicType(registrar)), - new( - nameof(NullableStringField), - NullableStringField.GetAlgebraicType(registrar) - ) + new("IntField", IntFieldRW.GetAlgebraicType(registrar)), + new("StringField", StringFieldRW.GetAlgebraicType(registrar)), + new("NullableIntField", NullableIntFieldRW.GetAlgebraicType(registrar)), + new("NullableStringField", NullableStringFieldRW.GetAlgebraicType(registrar)) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomNestedClass.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomNestedClass.verified.cs index 14c2f13f80..d02d3c63a6 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomNestedClass.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomNestedClass.verified.cs @@ -8,26 +8,26 @@ partial class CustomNestedClass { public void ReadFields(System.IO.BinaryReader reader) { - NestedClass = BSATN.NestedClass.Read(reader); - NestedNullableClass = BSATN.NestedNullableClass.Read(reader); - NestedEnum = BSATN.NestedEnum.Read(reader); - NestedNullableEnum = BSATN.NestedNullableEnum.Read(reader); - NestedTaggedEnum = BSATN.NestedTaggedEnum.Read(reader); - NestedNullableTaggedEnum = BSATN.NestedNullableTaggedEnum.Read(reader); - NestedCustomRecord = BSATN.NestedCustomRecord.Read(reader); - NestedNullableCustomRecord = BSATN.NestedNullableCustomRecord.Read(reader); + NestedClass = BSATN.NestedClassRW.Read(reader); + NestedNullableClass = BSATN.NestedNullableClassRW.Read(reader); + NestedEnum = BSATN.NestedEnumRW.Read(reader); + NestedNullableEnum = BSATN.NestedNullableEnumRW.Read(reader); + NestedTaggedEnum = BSATN.NestedTaggedEnumRW.Read(reader); + NestedNullableTaggedEnum = BSATN.NestedNullableTaggedEnumRW.Read(reader); + NestedCustomRecord = BSATN.NestedCustomRecordRW.Read(reader); + NestedNullableCustomRecord = BSATN.NestedNullableCustomRecordRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.NestedClass.Write(writer, NestedClass); - BSATN.NestedNullableClass.Write(writer, NestedNullableClass); - BSATN.NestedEnum.Write(writer, NestedEnum); - BSATN.NestedNullableEnum.Write(writer, NestedNullableEnum); - BSATN.NestedTaggedEnum.Write(writer, NestedTaggedEnum); - BSATN.NestedNullableTaggedEnum.Write(writer, NestedNullableTaggedEnum); - BSATN.NestedCustomRecord.Write(writer, NestedCustomRecord); - BSATN.NestedNullableCustomRecord.Write(writer, NestedNullableCustomRecord); + BSATN.NestedClassRW.Write(writer, NestedClass); + BSATN.NestedNullableClassRW.Write(writer, NestedNullableClass); + BSATN.NestedEnumRW.Write(writer, NestedEnum); + BSATN.NestedNullableEnumRW.Write(writer, NestedNullableEnum); + BSATN.NestedTaggedEnumRW.Write(writer, NestedTaggedEnum); + BSATN.NestedNullableTaggedEnumRW.Write(writer, NestedNullableTaggedEnum); + BSATN.NestedCustomRecordRW.Write(writer, NestedCustomRecord); + BSATN.NestedNullableCustomRecordRW.Write(writer, NestedNullableCustomRecord); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -40,26 +40,26 @@ partial class CustomNestedClass public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly CustomClass.BSATN NestedClass = new(); + internal static readonly CustomClass.BSATN NestedClassRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< CustomClass, CustomClass.BSATN - > NestedNullableClass = new(); - internal static readonly SpacetimeDB.BSATN.Enum NestedEnum = new(); + > NestedNullableClassRW = new(); + internal static readonly SpacetimeDB.BSATN.Enum NestedEnumRW = new(); internal static readonly SpacetimeDB.BSATN.ValueOption< CustomEnum, SpacetimeDB.BSATN.Enum - > NestedNullableEnum = new(); - internal static readonly CustomTaggedEnum.BSATN NestedTaggedEnum = new(); + > NestedNullableEnumRW = new(); + internal static readonly CustomTaggedEnum.BSATN NestedTaggedEnumRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< CustomTaggedEnum, CustomTaggedEnum.BSATN - > NestedNullableTaggedEnum = new(); - internal static readonly CustomRecord.BSATN NestedCustomRecord = new(); + > NestedNullableTaggedEnumRW = new(); + internal static readonly CustomRecord.BSATN NestedCustomRecordRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< CustomRecord, CustomRecord.BSATN - > NestedNullableCustomRecord = new(); + > NestedNullableCustomRecordRW = new(); public CustomNestedClass Read(System.IO.BinaryReader reader) { @@ -80,28 +80,22 @@ partial class CustomNestedClass _ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(NestedClass), NestedClass.GetAlgebraicType(registrar)), + new("NestedClass", NestedClassRW.GetAlgebraicType(registrar)), new( - nameof(NestedNullableClass), - NestedNullableClass.GetAlgebraicType(registrar) + "NestedNullableClass", + NestedNullableClassRW.GetAlgebraicType(registrar) ), - new(nameof(NestedEnum), NestedEnum.GetAlgebraicType(registrar)), + new("NestedEnum", NestedEnumRW.GetAlgebraicType(registrar)), + new("NestedNullableEnum", NestedNullableEnumRW.GetAlgebraicType(registrar)), + new("NestedTaggedEnum", NestedTaggedEnumRW.GetAlgebraicType(registrar)), new( - nameof(NestedNullableEnum), - NestedNullableEnum.GetAlgebraicType(registrar) + "NestedNullableTaggedEnum", + NestedNullableTaggedEnumRW.GetAlgebraicType(registrar) ), - new(nameof(NestedTaggedEnum), NestedTaggedEnum.GetAlgebraicType(registrar)), + new("NestedCustomRecord", NestedCustomRecordRW.GetAlgebraicType(registrar)), new( - nameof(NestedNullableTaggedEnum), - NestedNullableTaggedEnum.GetAlgebraicType(registrar) - ), - new( - nameof(NestedCustomRecord), - NestedCustomRecord.GetAlgebraicType(registrar) - ), - new( - nameof(NestedNullableCustomRecord), - NestedNullableCustomRecord.GetAlgebraicType(registrar) + "NestedNullableCustomRecord", + NestedNullableCustomRecordRW.GetAlgebraicType(registrar) ) } ) diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomRecord.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomRecord.verified.cs index 2f206093f2..d9498925f4 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomRecord.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomRecord.verified.cs @@ -6,18 +6,18 @@ partial class CustomRecord : System.IEquatable, SpacetimeDB.BSATN. { public void ReadFields(System.IO.BinaryReader reader) { - IntField = BSATN.IntField.Read(reader); - StringField = BSATN.StringField.Read(reader); - NullableIntField = BSATN.NullableIntField.Read(reader); - NullableStringField = BSATN.NullableStringField.Read(reader); + IntField = BSATN.IntFieldRW.Read(reader); + StringField = BSATN.StringFieldRW.Read(reader); + NullableIntField = BSATN.NullableIntFieldRW.Read(reader); + NullableStringField = BSATN.NullableStringFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.IntField.Write(writer, IntField); - BSATN.StringField.Write(writer, StringField); - BSATN.NullableIntField.Write(writer, NullableIntField); - BSATN.NullableStringField.Write(writer, NullableStringField); + BSATN.IntFieldRW.Write(writer, IntField); + BSATN.StringFieldRW.Write(writer, StringField); + BSATN.NullableIntFieldRW.Write(writer, NullableIntField); + BSATN.NullableStringFieldRW.Write(writer, NullableStringField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -30,16 +30,16 @@ partial class CustomRecord : System.IEquatable, SpacetimeDB.BSATN. public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 IntField = new(); - internal static readonly SpacetimeDB.BSATN.String StringField = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringFieldRW = new(); internal static readonly SpacetimeDB.BSATN.ValueOption< int, SpacetimeDB.BSATN.I32 - > NullableIntField = new(); + > NullableIntFieldRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< string, SpacetimeDB.BSATN.String - > NullableStringField = new(); + > NullableStringFieldRW = new(); public CustomRecord Read(System.IO.BinaryReader reader) { @@ -59,13 +59,10 @@ partial class CustomRecord : System.IEquatable, SpacetimeDB.BSATN. registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IntField), IntField.GetAlgebraicType(registrar)), - new(nameof(StringField), StringField.GetAlgebraicType(registrar)), - new(nameof(NullableIntField), NullableIntField.GetAlgebraicType(registrar)), - new( - nameof(NullableStringField), - NullableStringField.GetAlgebraicType(registrar) - ) + new("IntField", IntFieldRW.GetAlgebraicType(registrar)), + new("StringField", StringFieldRW.GetAlgebraicType(registrar)), + new("NullableIntField", NullableIntFieldRW.GetAlgebraicType(registrar)), + new("NullableStringField", NullableStringFieldRW.GetAlgebraicType(registrar)) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomStruct.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomStruct.verified.cs index 033e2257e3..194df4d750 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomStruct.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomStruct.verified.cs @@ -8,18 +8,18 @@ partial struct CustomStruct { public void ReadFields(System.IO.BinaryReader reader) { - IntField = BSATN.IntField.Read(reader); - StringField = BSATN.StringField.Read(reader); - NullableIntField = BSATN.NullableIntField.Read(reader); - NullableStringField = BSATN.NullableStringField.Read(reader); + IntField = BSATN.IntFieldRW.Read(reader); + StringField = BSATN.StringFieldRW.Read(reader); + NullableIntField = BSATN.NullableIntFieldRW.Read(reader); + NullableStringField = BSATN.NullableStringFieldRW.Read(reader); } public void WriteFields(System.IO.BinaryWriter writer) { - BSATN.IntField.Write(writer, IntField); - BSATN.StringField.Write(writer, StringField); - BSATN.NullableIntField.Write(writer, NullableIntField); - BSATN.NullableStringField.Write(writer, NullableStringField); + BSATN.IntFieldRW.Write(writer, IntField); + BSATN.StringFieldRW.Write(writer, StringField); + BSATN.NullableIntFieldRW.Write(writer, NullableIntField); + BSATN.NullableStringFieldRW.Write(writer, NullableStringField); } object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() @@ -32,16 +32,16 @@ partial struct CustomStruct public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 IntField = new(); - internal static readonly SpacetimeDB.BSATN.String StringField = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntFieldRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringFieldRW = new(); internal static readonly SpacetimeDB.BSATN.ValueOption< int, SpacetimeDB.BSATN.I32 - > NullableIntField = new(); + > NullableIntFieldRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< string, SpacetimeDB.BSATN.String - > NullableStringField = new(); + > NullableStringFieldRW = new(); public CustomStruct Read(System.IO.BinaryReader reader) { @@ -61,13 +61,10 @@ partial struct CustomStruct registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IntField), IntField.GetAlgebraicType(registrar)), - new(nameof(StringField), StringField.GetAlgebraicType(registrar)), - new(nameof(NullableIntField), NullableIntField.GetAlgebraicType(registrar)), - new( - nameof(NullableStringField), - NullableStringField.GetAlgebraicType(registrar) - ) + new("IntField", IntFieldRW.GetAlgebraicType(registrar)), + new("StringField", StringFieldRW.GetAlgebraicType(registrar)), + new("NullableIntField", NullableIntFieldRW.GetAlgebraicType(registrar)), + new("NullableStringField", NullableStringFieldRW.GetAlgebraicType(registrar)) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomTaggedEnum.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomTaggedEnum.verified.cs index e8fec5dcdc..78c43d2fb5 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomTaggedEnum.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#CustomTaggedEnum.verified.cs @@ -30,25 +30,25 @@ partial record CustomTaggedEnum : System.IEquatable public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite { - internal static readonly SpacetimeDB.BSATN.I32 IntVariant = new(); - internal static readonly SpacetimeDB.BSATN.String StringVariant = new(); + internal static readonly SpacetimeDB.BSATN.I32 IntVariantRW = new(); + internal static readonly SpacetimeDB.BSATN.String StringVariantRW = new(); internal static readonly SpacetimeDB.BSATN.ValueOption< int, SpacetimeDB.BSATN.I32 - > NullableIntVariant = new(); + > NullableIntVariantRW = new(); internal static readonly SpacetimeDB.BSATN.RefOption< string, SpacetimeDB.BSATN.String - > NullableStringVariant = new(); + > NullableStringVariantRW = new(); public CustomTaggedEnum Read(System.IO.BinaryReader reader) { return reader.ReadByte() switch { - 0 => new IntVariant(IntVariant.Read(reader)), - 1 => new StringVariant(StringVariant.Read(reader)), - 2 => new NullableIntVariant(NullableIntVariant.Read(reader)), - 3 => new NullableStringVariant(NullableStringVariant.Read(reader)), + 0 => new IntVariant(IntVariantRW.Read(reader)), + 1 => new StringVariant(StringVariantRW.Read(reader)), + 2 => new NullableIntVariant(NullableIntVariantRW.Read(reader)), + 3 => new NullableStringVariant(NullableStringVariantRW.Read(reader)), _ => throw new System.InvalidOperationException( "Invalid tag value, this state should be unreachable." @@ -62,19 +62,19 @@ partial record CustomTaggedEnum : System.IEquatable { case IntVariant(var inner): writer.Write((byte)0); - IntVariant.Write(writer, inner); + IntVariantRW.Write(writer, inner); break; case StringVariant(var inner): writer.Write((byte)1); - StringVariant.Write(writer, inner); + StringVariantRW.Write(writer, inner); break; case NullableIntVariant(var inner): writer.Write((byte)2); - NullableIntVariant.Write(writer, inner); + NullableIntVariantRW.Write(writer, inner); break; case NullableStringVariant(var inner): writer.Write((byte)3); - NullableStringVariant.Write(writer, inner); + NullableStringVariantRW.Write(writer, inner); break; } } @@ -85,12 +85,12 @@ partial record CustomTaggedEnum : System.IEquatable registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Sum( new SpacetimeDB.BSATN.AggregateElement[] { - new(nameof(IntVariant), IntVariant.GetAlgebraicType(registrar)), - new(nameof(StringVariant), StringVariant.GetAlgebraicType(registrar)), - new(nameof(NullableIntVariant), NullableIntVariant.GetAlgebraicType(registrar)), + new("IntVariant", IntVariantRW.GetAlgebraicType(registrar)), + new("StringVariant", StringVariantRW.GetAlgebraicType(registrar)), + new("NullableIntVariant", NullableIntVariantRW.GetAlgebraicType(registrar)), new( - nameof(NullableStringVariant), - NullableStringVariant.GetAlgebraicType(registrar) + "NullableStringVariant", + NullableStringVariantRW.GetAlgebraicType(registrar) ) } )); diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#FormerlyForbiddenFieldNames.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#FormerlyForbiddenFieldNames.verified.cs new file mode 100644 index 0000000000..8c9d2c5f5b --- /dev/null +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Type#FormerlyForbiddenFieldNames.verified.cs @@ -0,0 +1,123 @@ +//HintName: FormerlyForbiddenFieldNames.cs +// +#nullable enable + +partial struct FormerlyForbiddenFieldNames + : System.IEquatable, + SpacetimeDB.BSATN.IStructuralReadWrite +{ + public void ReadFields(System.IO.BinaryReader reader) + { + Read = BSATN.ReadRW.Read(reader); + Write = BSATN.WriteRW.Read(reader); + GetAlgebraicType = BSATN.GetAlgebraicTypeRW.Read(reader); + } + + public void WriteFields(System.IO.BinaryWriter writer) + { + BSATN.ReadRW.Write(writer, Read); + BSATN.WriteRW.Write(writer, Write); + BSATN.GetAlgebraicTypeRW.Write(writer, GetAlgebraicType); + } + + object SpacetimeDB.BSATN.IStructuralReadWrite.GetSerializer() + { + return new BSATN(); + } + + public override string ToString() => + $"FormerlyForbiddenFieldNames {{ Read = {SpacetimeDB.BSATN.StringUtil.GenericToString(Read)}, Write = {SpacetimeDB.BSATN.StringUtil.GenericToString(Write)}, GetAlgebraicType = {SpacetimeDB.BSATN.StringUtil.GenericToString(GetAlgebraicType)} }}"; + + public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite + { + internal static readonly SpacetimeDB.BSATN.U32 ReadRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 WriteRW = new(); + internal static readonly SpacetimeDB.BSATN.U32 GetAlgebraicTypeRW = new(); + + public FormerlyForbiddenFieldNames Read(System.IO.BinaryReader reader) + { + var ___result = new FormerlyForbiddenFieldNames(); + ___result.ReadFields(reader); + return ___result; + } + + public void Write(System.IO.BinaryWriter writer, FormerlyForbiddenFieldNames value) + { + value.WriteFields(writer); + } + + public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType( + SpacetimeDB.BSATN.ITypeRegistrar registrar + ) => + registrar.RegisterType( + _ => new SpacetimeDB.BSATN.AlgebraicType.Product( + new SpacetimeDB.BSATN.AggregateElement[] + { + new("Read", ReadRW.GetAlgebraicType(registrar)), + new("Write", WriteRW.GetAlgebraicType(registrar)), + new("GetAlgebraicType", GetAlgebraicTypeRW.GetAlgebraicType(registrar)) + } + ) + ); + + SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType( + SpacetimeDB.BSATN.ITypeRegistrar registrar + ) => GetAlgebraicType(registrar); + } + + public override int GetHashCode() + { + var ___hashRead = Read.GetHashCode(); + var ___hashWrite = Write.GetHashCode(); + var ___hashGetAlgebraicType = GetAlgebraicType.GetHashCode(); + return ___hashRead ^ ___hashWrite ^ ___hashGetAlgebraicType; + } + +#nullable enable + public bool Equals(FormerlyForbiddenFieldNames that) + { + var ___eqRead = this.Read.Equals(that.Read); + var ___eqWrite = this.Write.Equals(that.Write); + var ___eqGetAlgebraicType = this.GetAlgebraicType.Equals(that.GetAlgebraicType); + return ___eqRead && ___eqWrite && ___eqGetAlgebraicType; + } + + public override bool Equals(object? that) + { + if (that == null) + { + return false; + } + var that_ = that as FormerlyForbiddenFieldNames?; + if (((object?)that_) == null) + { + return false; + } + return Equals(that_); + } + + public static bool operator ==( + FormerlyForbiddenFieldNames this_, + FormerlyForbiddenFieldNames that + ) + { + if (((object?)this_) == null || ((object?)that) == null) + { + return object.Equals(this_, that); + } + return this_.Equals(that); + } + + public static bool operator !=( + FormerlyForbiddenFieldNames this_, + FormerlyForbiddenFieldNames that + ) + { + if (((object?)this_) == null || ((object?)that) == null) + { + return !object.Equals(this_, that); + } + return !this_.Equals(that); + } +#nullable restore +} // FormerlyForbiddenFieldNames diff --git a/crates/bindings-csharp/Codegen/Module.cs b/crates/bindings-csharp/Codegen/Module.cs index 6a4fbf3629..fb9f1d6fd7 100644 --- a/crates/bindings-csharp/Codegen/Module.cs +++ b/crates/bindings-csharp/Codegen/Module.cs @@ -144,7 +144,7 @@ record ColumnDeclaration : MemberDeclaration // For the `TableDesc` constructor. public string GenerateColumnDef() => - $"new (nameof({Name}), BSATN.{Name}.GetAlgebraicType(registrar))"; + $"new (nameof({Name}), BSATN.{Name}{TypeUse.BsatnFieldSuffix}.GetAlgebraicType(registrar))"; } record Scheduled(string ReducerName, int ScheduledAtColumn); @@ -478,9 +478,7 @@ record TableDeclaration : BaseTypeDeclaration } foreach (var v in Views) { - var autoIncFields = Members - .Where(f => f.GetAttrs(v).HasFlag(ColumnAttrs.AutoInc)) - .Select(f => f.Name); + var autoIncFields = Members.Where(m => m.GetAttrs(v).HasFlag(ColumnAttrs.AutoInc)); var globalName = $"global::{FullName}"; var iTable = $"SpacetimeDB.Internal.ITableView<{v.Name}, {globalName}>"; @@ -492,11 +490,11 @@ record TableDeclaration : BaseTypeDeclaration static {{globalName}} {{iTable}}.ReadGenFields(System.IO.BinaryReader reader, {{globalName}} row) { {{string.Join( "\n", - autoIncFields.Select(name => + autoIncFields.Select(m => $$""" - if (row.{{name}} == default) + if (row.{{m.Name}} == default) { - row.{{name}} = {{globalName}}.BSATN.{{name}}.Read(reader); + row.{{m.Name}} = {{globalName}}.BSATN.{{m.Name}}{{TypeUse.BsatnFieldSuffix}}.Read(reader); } """ ) @@ -638,7 +636,7 @@ record ReducerDeclaration ? "throw new System.InvalidOperationException()" : $"{FullName}({string.Join( ", ", - Args.Select(a => $"{a.Name}.Read(reader)").Prepend("(SpacetimeDB.ReducerContext)ctx") + Args.Select(a => $"{a.Name}{TypeUse.BsatnFieldSuffix}.Read(reader)").Prepend("(SpacetimeDB.ReducerContext)ctx") )})"; return $$""" From 86c6d3b00928ffab707ae057220c27683f8650da Mon Sep 17 00:00:00 2001 From: rekhoff Date: Tue, 26 Aug 2025 14:19:01 -0700 Subject: [PATCH 12/28] Updated C# quickstart-chat to pattern match variable assignment (#3173) # Description of Changes To address user issue https://github.com/clockworklabs/SpacetimeDB/issues/2647 , the C# implementation of quickstart-chat files and documentation have been updated to pattern match the variable assignment of User. This has the benefit of the variables never being perceived by the analyzers as a nullable types. # API and ABI breaking changes Not API breaking # Expected complexity level and risk 1 # Testing - [X] Tested updated module code locally, following instructions from the documentation. Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com> --- docs/docs/modules/c-sharp/quickstart.md | 12 ++++------ .../examples~/quickstart-chat/server/Lib.cs | 24 ++++++++----------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/docs/docs/modules/c-sharp/quickstart.md b/docs/docs/modules/c-sharp/quickstart.md index 7828bbe7e7..a6e3a42e11 100644 --- a/docs/docs/modules/c-sharp/quickstart.md +++ b/docs/docs/modules/c-sharp/quickstart.md @@ -120,8 +120,7 @@ public static void SetName(ReducerContext ctx, string name) { name = ValidateName(name); - var user = ctx.Db.user.Identity.Find(ctx.Sender); - if (user is not null) + if (ctx.Db.user.Identity.Find(ctx.Sender) is User user) { user.Name = name; ctx.Db.user.Identity.Update(user); @@ -208,9 +207,8 @@ In `server/Lib.cs`, add the definition of the connect reducer to the `Module` cl public static void ClientConnected(ReducerContext ctx) { Log.Info($"Connect {ctx.Sender}"); - var user = ctx.Db.user.Identity.Find(ctx.Sender); - - if (user is not null) + + if (ctx.Db.user.Identity.Find(ctx.Sender) is User user) { // If this is a returning user, i.e., we already have a `User` with this `Identity`, // set `Online: true`, but leave `Name` and `Identity` unchanged. @@ -241,9 +239,7 @@ Add the following code after the `OnConnect` handler: [Reducer(ReducerKind.ClientDisconnected)] public static void ClientDisconnected(ReducerContext ctx) { - var user = ctx.Db.user.Identity.Find(ctx.Sender); - - if (user is not null) + if (ctx.Db.user.Identity.Find(ctx.Sender) is User user) { // This user should exist, so set `Online: false`. user.Online = false; diff --git a/sdks/csharp/examples~/quickstart-chat/server/Lib.cs b/sdks/csharp/examples~/quickstart-chat/server/Lib.cs index b00ac93a92..79a56520cd 100644 --- a/sdks/csharp/examples~/quickstart-chat/server/Lib.cs +++ b/sdks/csharp/examples~/quickstart-chat/server/Lib.cs @@ -10,7 +10,7 @@ public static partial class Module public string? Name; public bool Online; } - + [Table(Name = "message", Public = true)] public partial class Message { @@ -18,20 +18,19 @@ public static partial class Module public Timestamp Sent; public string Text = ""; } - + [Reducer] public static void SetName(ReducerContext ctx, string name) { name = ValidateName(name); - var user = ctx.Db.user.Identity.Find(ctx.Sender); - if (user is not null) + if (ctx.Db.user.Identity.Find(ctx.Sender) is User user) { user.Name = name; ctx.Db.user.Identity.Update(user); } } - + /// Takes a name and checks if it's acceptable as a user's name. private static string ValidateName(string name) { @@ -41,7 +40,7 @@ public static partial class Module } return name; } - + [Reducer] public static void SendMessage(ReducerContext ctx, string text) { @@ -56,7 +55,7 @@ public static partial class Module } ); } - + /// Takes a message's text and checks if it's acceptable to send. private static string ValidateMessage(string text) { @@ -66,14 +65,13 @@ public static partial class Module } return text; } - + [Reducer(ReducerKind.ClientConnected)] public static void ClientConnected(ReducerContext ctx) { Log.Info($"Connect {ctx.Sender}"); - var user = ctx.Db.user.Identity.Find(ctx.Sender); - if (user is not null) + if (ctx.Db.user.Identity.Find(ctx.Sender) is User user) { // If this is a returning user, i.e., we already have a `User` with this `Identity`, // set `Online: true`, but leave `Name` and `Identity` unchanged. @@ -94,13 +92,11 @@ public static partial class Module ); } } - + [Reducer(ReducerKind.ClientDisconnected)] public static void ClientDisconnected(ReducerContext ctx) { - var user = ctx.Db.user.Identity.Find(ctx.Sender); - - if (user is not null) + if (ctx.Db.user.Identity.Find(ctx.Sender) is User user) { // This user should exist, so set `Online: false`. user.Online = false; From 833f750c12e49006a04ac29e4591ee49978ab7f0 Mon Sep 17 00:00:00 2001 From: rekhoff Date: Tue, 26 Aug 2025 14:19:42 -0700 Subject: [PATCH 13/28] Uncommented out 'delete by index' test code (#3156) # Description of Changes Uncommented out code from test, in order to have "delete row by index" test of C# module code ran. This is the implementation of a fix for issue https://github.com/clockworklabs/SpacetimeDB/issues/2233 # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing - [X] Ran `dotnet run` and `dotnet test`, both returned no errors. --- modules/module-test-cs/Lib.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/module-test-cs/Lib.cs b/modules/module-test-cs/Lib.cs index 6e0975f48f..aeb339cdd0 100644 --- a/modules/module-test-cs/Lib.cs +++ b/modules/module-test-cs/Lib.cs @@ -294,12 +294,11 @@ static partial class Module var rowCountBeforeDelete = ctx.Db.test_a.Count; Log.Info($"Row count before delete: {rowCountBeforeDelete}"); - uint numDeleted = 0; + ulong numDeleted = 0; // Delete rows using the "foo" index (from 5 up to, but not including, 10). for (uint row = 5; row < 10; row++) { - // FIXME: Apparently in Rust you can delete by index, but in C# you can't. - // numDeleted += ctx.Db.test_a.foo.Delete(row); + numDeleted += ctx.Db.test_a.foo.Delete(row); } var rowCountAfterDelete = ctx.Db.test_a.Count; From eb105ad392ac7a89b3e53300001e85ac50e4d8a2 Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Wed, 27 Aug 2025 11:17:48 -0400 Subject: [PATCH 14/28] Sort columns in `st_column_changed` before automigrating. (#3203) # Description of Changes In `st_column_changed`, `iter_st_column_for_table` returns rows in physical storage order. In simple cases (without unrelated deletes) this will be the same as insertion order, and therefore also the same as sorted order, but in cases with multiple column-changing automigrations the physical storage order of the rows diverges from the correct sorted order. Because this isn't a hot path, we can just call `.sort()` and not worry about it. # API and ABI breaking changes N/a # Expected complexity level and risk 1 # Testing None yet. Needs manual testing with BitCraft update. --------- Signed-off-by: Mazdak Farrokhzad Co-authored-by: Mazdak Farrokhzad Co-authored-by: Shubham Mishra --- .../src/locking_tx_datastore/committed_state.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/datastore/src/locking_tx_datastore/committed_state.rs b/crates/datastore/src/locking_tx_datastore/committed_state.rs index d1f4fbef29..ad3c98ca2b 100644 --- a/crates/datastore/src/locking_tx_datastore/committed_state.rs +++ b/crates/datastore/src/locking_tx_datastore/committed_state.rs @@ -32,7 +32,10 @@ use spacetimedb_lib::{ use spacetimedb_primitives::{ColId, ColList, ColSet, IndexId, TableId}; use spacetimedb_sats::{algebraic_value::de::ValueDeserializer, memory_usage::MemoryUsage, Deserialize}; use spacetimedb_sats::{AlgebraicValue, ProductValue}; -use spacetimedb_schema::{def::IndexAlgorithm, schema::TableSchema}; +use spacetimedb_schema::{ + def::IndexAlgorithm, + schema::{ColumnSchema, TableSchema}, +}; use spacetimedb_table::{ blob_store::{BlobStore, HashMapBlobStore}, indexes::{RowPointer, SquashedOffset}, @@ -386,7 +389,7 @@ impl CommittedState { // we may end up with two definitions for the same `col_pos`. // Of those two, we're interested in the one we just inserted // and not the other one, as it is being replaced. - let columns = iter_st_column_for_table(self, &target_table_id.into())? + let mut columns = iter_st_column_for_table(self, &target_table_id.into())? .filter_map(|row_ref| { StColumnRow::try_from(row_ref) .map(|c| (c.col_pos != target_col_id || row_ref.pointer() == row_ptr).then(|| c.into())) @@ -394,6 +397,11 @@ impl CommittedState { }) .collect::>>()?; + // Columns in `st_column` are not in general sorted by their `col_pos`, + // though they will happen to be for tables which have never undergone migrations + // because their initial insertion order matches their `col_pos` order. + columns.sort_by_key(|col: &ColumnSchema| col.col_pos); + // Update the columns and layout of the the in-memory table. if let Some(table) = self.tables.get_mut(&target_table_id) { table.change_columns_to(columns).map_err(TableError::from)?; From 6bd815f43ba1bf875b0af98ac3cf2b975b89d11d Mon Sep 17 00:00:00 2001 From: Mario Montoya Date: Wed, 27 Aug 2025 11:26:38 -0500 Subject: [PATCH 15/28] Smoke test for Rust quickstart-chat app #2100 (#3155) # Description of Changes Closes #2100 Replay the `quickstart-chat` guide steps for the `Rust/C#` client & server, and confirm the connection and `set_name`, `send_message` commands. # Expected complexity level and risk 1 # Testing - [x] Added a smoke test --- smoketests/tests/quickstart.py | 252 +++++++++++++++++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 smoketests/tests/quickstart.py diff --git a/smoketests/tests/quickstart.py b/smoketests/tests/quickstart.py new file mode 100644 index 0000000000..7cf80c7bb4 --- /dev/null +++ b/smoketests/tests/quickstart.py @@ -0,0 +1,252 @@ +import logging +import re +import shutil +from pathlib import Path +import tempfile + +import smoketests +from .. import Smoketest, STDB_DIR, run_cmd, TEMPLATE_CARGO_TOML + + +def _write_file(path: Path, content: str): + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(content) + + +def _append_to_file(path: Path, content: str): + with open(path, "a", encoding="utf-8") as f: + f.write(content) + + +def _parse_quickstart(doc_path: Path, language: str) -> str: + """Extract code blocks from `quickstart.md` docs. + This will replicate the steps in the quickstart guide, so if it fails the quickstart guide is broken. + """ + content = Path(doc_path).read_text() + blocks = re.findall(rf"```{language}\n(.*?)\n```", content, re.DOTALL) + + end = "" + if language == "csharp": + found = False + filtered_blocks = [] + for block in blocks: + # The doc first create an empy class Module, so we need to fixup the closing + if "partial class Module" in block: + block = block.replace("}", "") + end = "\n}" + # Remove the first `OnConnected` block, which body is later updated + if "OnConnected(DbConnection conn" in block and not found: + found = True + continue + filtered_blocks.append(block) + blocks = filtered_blocks + # So we could have a different db for each language + return "\n".join(blocks).replace("quickstart-chat", f"quickstart-chat-{language}") + end + + +def _dotnet_add_package(project_path: Path, package_name: str, source_path: Path): + """Add a local NuGet package to a .NET project""" + sources = run_cmd("dotnet", "nuget", "list", "source", cwd=project_path, capture_stderr=True) + # Is the source already added? + if package_name in sources: + run_cmd("dotnet", "nuget", "remove", "source", package_name, cwd=project_path, capture_stderr=True) + run_cmd("dotnet", "nuget", "add", "source", source_path, "--name", package_name, cwd=project_path, + capture_stderr=True) + run_cmd("dotnet", "add", "package", package_name, cwd=project_path, capture_stderr=True) + + +class BaseQuickstart(Smoketest): + AUTOPUBLISH = False + MODULE_CODE = "" + + lang = None + server_doc = None + client_doc = None + server_file = None + client_file = None + module_bindings = None + extra_code = None + replacements = {} + connected_str = None + run_cmd = [] + build_cmd = [] + + def project_init(self, path: Path): + raise NotImplementedError + + def sdk_setup(self, path: Path): + raise NotImplementedError + + def _publish(self) -> Path: + base_path = Path(self.enterClassContext(tempfile.TemporaryDirectory())) + server_path = base_path / "server" + self.project_path = server_path + self.config_path = server_path / "config.toml" + + self.generate_server(server_path) + self.publish_module(f"quickstart-chat-{self.lang}", capture_stderr=True, clear=True) + return base_path / "client" + + def generate_server(self, server_path: Path): + """Generate the server code from the quickstart documentation.""" + logging.info(f"Generating server code {self.lang}: {server_path}...") + self.spacetime("init", "--lang", self.lang, server_path, capture_stderr=True) + shutil.copy2(STDB_DIR / "rust-toolchain.toml", server_path) + # Replay the quickstart guide steps + _write_file(server_path / self.server_file, _parse_quickstart(self.server_doc, self.lang)) + self.server_postprocess(server_path) + self.spacetime("build", "-d", "-p", server_path, capture_stderr=True) + + def server_postprocess(self, server_path: Path): + """Optional per-language hook.""" + pass + + def check(self, input_cmd: str, client_path: Path, contains: str): + """Run the client command and check if the output contains the expected string.""" + output = run_cmd(*self.run_cmd, input=input_cmd, cwd=client_path, capture_stderr=True, text=True) + print(f"Output for {self.lang} client:\n{output}") + self.assertIn(contains, output) + + def _test_quickstart(self): + """Run the quickstart client.""" + client_path = self._publish() + self.project_init(client_path) + self.sdk_setup(client_path) + + run_cmd(*self.build_cmd, cwd=client_path, capture_stderr=True) + + self.spacetime( + "generate", "--lang", self.lang, + "--out-dir", client_path / self.module_bindings, + "--project-path", self.project_path, capture_stderr=True + ) + # Replay the quickstart guide steps + main = _parse_quickstart(self.client_doc, self.lang) + for src, dst in self.replacements.items(): + main = main.replace(src, dst) + main += "\n" + self.extra_code + _write_file(client_path / self.client_file, main) + + self.check("", client_path, self.connected_str) + self.check("/name Alice", client_path, "Alice") + self.check("Hello World", client_path, "Hello World") + + +class Rust(BaseQuickstart): + lang = "rust" + server_doc = STDB_DIR / "docs/docs/modules/rust/quickstart.md" + client_doc = STDB_DIR / "docs/docs/sdks/rust/quickstart.md" + server_file = "src/lib.rs" + client_file = "src/main.rs" + module_bindings = "src/module_bindings" + run_cmd = ["cargo", "run"] + build_cmd = ["cargo", "build"] + + # Replace the interactive user input to allow direct testing + replacements = { + "user_input_loop(&ctx)": "user_input_direct(&ctx)" + } + extra_code = """ +fn user_input_direct(ctx: &DbConnection) { + let mut line = String::new(); + std::io::stdin().read_line(&mut line).expect("Failed to read from stdin."); + if let Some(name) = line.strip_prefix("/name ") { + ctx.reducers.set_name(name.to_string()).unwrap(); + } else { + ctx.reducers.send_message(line).unwrap(); + } + std::thread::sleep(std::time::Duration::from_secs(1)); + std::process::exit(0); +} +""" + connected_str = "connected" + + def project_init(self, path: Path): + run_cmd("cargo", "new", "--bin", "--name", "quickstart_chat_client", "client", cwd=path.parent, + capture_stderr=True) + + def sdk_setup(self, path: Path): + sdk_rust_path = (STDB_DIR / "sdks/rust").absolute() + sdk_rust_toml_escaped = str(sdk_rust_path).replace('\\', '\\\\\\\\') # double escape for re.sub + toml + sdk_rust_toml = f'spacetimedb-sdk = {{ path = "{sdk_rust_toml_escaped}" }}\nlog = "0.4"\nhex = "0.4"\n' + _append_to_file(path / "Cargo.toml", sdk_rust_toml) + + def server_postprocess(self, server_path: Path): + _write_file(server_path / "Cargo.toml", self.cargo_manifest(TEMPLATE_CARGO_TOML)) + + def test_quickstart(self): + """Run the Rust quickstart guides for server and client.""" + self._test_quickstart() + + +class CSharp(BaseQuickstart): + lang = "csharp" + server_doc = STDB_DIR / "docs/docs/modules/c-sharp/quickstart.md" + client_doc = STDB_DIR / "docs/docs/sdks/c-sharp/quickstart.md" + server_file = "Lib.cs" + client_file = "Program.cs" + module_bindings = "module_bindings" + run_cmd = ["dotnet", "run"] + build_cmd = ["dotnet", "build"] + + # Replace the interactive user input to allow direct testing + replacements = { + "InputLoop();": "UserInputDirect();", + ".OnConnect(OnConnected)": ".OnConnect(OnConnectedSignal)", + ".OnConnectError(OnConnectError)": ".OnConnectError(OnConnectErrorSignal)", + "Main();": "" # To put the main function at the end so it can see the new functions + } + # So we can wait for the connection to be established... + extra_code = """ +var connectedEvent = new ManualResetEventSlim(false); +var connectionFailed = new ManualResetEventSlim(false); +void OnConnectErrorSignal(Exception e) +{ + OnConnectError(e); + connectionFailed.Set(); +} +void OnConnectedSignal(DbConnection conn, Identity identity, string authToken) +{ + OnConnected(conn, identity, authToken); + connectedEvent.Set(); +} + +void UserInputDirect() { + string? line = Console.In.ReadToEnd()?.Trim(); + if (line == null) Environment.Exit(0); + + if (!WaitHandle.WaitAny( + new[] { connectedEvent.WaitHandle, connectionFailed.WaitHandle }, + TimeSpan.FromSeconds(5) + ).Equals(0)) + { + Console.WriteLine("Failed to connect to server within timeout."); + Environment.Exit(1); + } + + if (line.StartsWith("/name ")) { + input_queue.Enqueue(("name", line[6..])); + } else { + input_queue.Enqueue(("message", line)); + } + Thread.Sleep(1000); +} +Main(); +""" + connected_str = "Connected" + + def project_init(self, path: Path): + run_cmd("dotnet", "new", "console", "--name", "QuickstartChatClient", "--output", path, capture_stderr=True) + + def sdk_setup(self, path: Path): + _dotnet_add_package(path, "SpacetimeDB.ClientSDK", (STDB_DIR / "sdks/csharp").absolute()) + + def server_postprocess(self, server_path: Path): + _dotnet_add_package(server_path, "SpacetimeDB.Runtime", + (STDB_DIR / "crates/bindings-csharp/Runtime").absolute()) + + def test_quickstart(self): + """Run the C# quickstart guides for server and client.""" + if not smoketests.HAVE_DOTNET: + self.skipTest("C# SDK requires .NET to be installed.") + self._test_quickstart() From b4a839b544243f72f5520b11e7a69f93c0a1dc25 Mon Sep 17 00:00:00 2001 From: John Detter <4099508+jdetter@users.noreply.github.com> Date: Fri, 29 Aug 2025 11:52:30 -0500 Subject: [PATCH 16/28] Version upgrade to 1.3.2 (#3207) # Description of Changes - Simple patch version bump. Because we forgot to bump the version number for 1.3.1 this is bumping from 1.3.0 => 1.3.2 # API and ABI breaking changes 0 # Testing - Verified that the version number in the license has been updated - Verified the output of `spacetime --version`: ``` $ spacetime --version spacetime Path: C:\Users\boppy\AppData\Local\SpacetimeDB\bin\current\spacetimedb-cli.exe Commit: 0027d094e1216119d22b767d8e6dc41d674d1bca spacetimedb tool version 1.3.2; spacetimedb-lib version 1.3.2; ``` --------- Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com> --- Cargo.lock | 78 +++++++++---------- Cargo.toml | 64 +++++++-------- LICENSE.txt | 4 +- .../src/subcommands/project/rust/Cargo._toml | 2 +- .../identity_connected_reducer.ts | 2 +- .../identity_disconnected_reducer.ts | 2 +- .../src/module_bindings/index.ts | 4 +- .../src/module_bindings/message_table.ts | 2 +- .../src/module_bindings/message_type.ts | 2 +- .../module_bindings/send_message_reducer.ts | 2 +- .../src/module_bindings/set_name_reducer.ts | 2 +- .../src/module_bindings/user_table.ts | 2 +- .../src/module_bindings/user_type.ts | 2 +- 13 files changed, 84 insertions(+), 84 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e10c07951e..286f665ec1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -950,7 +950,7 @@ dependencies = [ [[package]] name = "connect_disconnect_client" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "spacetimedb-sdk", @@ -5260,7 +5260,7 @@ dependencies = [ [[package]] name = "spacetimedb" -version = "1.3.0" +version = "1.3.2" dependencies = [ "bytemuck", "derive_more", @@ -5278,7 +5278,7 @@ dependencies = [ [[package]] name = "spacetimedb-auth" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "serde", @@ -5290,7 +5290,7 @@ dependencies = [ [[package]] name = "spacetimedb-bench" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "anymap", @@ -5337,7 +5337,7 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-macro" -version = "1.3.0" +version = "1.3.2" dependencies = [ "heck 0.4.1", "humantime", @@ -5349,14 +5349,14 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-sys" -version = "1.3.0" +version = "1.3.2" dependencies = [ "spacetimedb-primitives", ] [[package]] name = "spacetimedb-cli" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "base64 0.21.7", @@ -5417,7 +5417,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "async-stream", @@ -5470,7 +5470,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api-messages" -version = "1.3.0" +version = "1.3.2" dependencies = [ "bytes", "bytestring", @@ -5493,7 +5493,7 @@ dependencies = [ [[package]] name = "spacetimedb-codegen" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -5510,7 +5510,7 @@ dependencies = [ [[package]] name = "spacetimedb-commitlog" -version = "1.3.0" +version = "1.3.2" dependencies = [ "async-stream", "bitflags 2.9.0", @@ -5542,7 +5542,7 @@ dependencies = [ [[package]] name = "spacetimedb-core" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "arrayvec", @@ -5661,7 +5661,7 @@ dependencies = [ [[package]] name = "spacetimedb-data-structures" -version = "1.3.0" +version = "1.3.2" dependencies = [ "ahash 0.8.12", "crossbeam-queue", @@ -5675,7 +5675,7 @@ dependencies = [ [[package]] name = "spacetimedb-datastore" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "bytes", @@ -5710,7 +5710,7 @@ dependencies = [ [[package]] name = "spacetimedb-durability" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "itertools 0.12.1", @@ -5724,7 +5724,7 @@ dependencies = [ [[package]] name = "spacetimedb-execution" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "itertools 0.12.1", @@ -5739,7 +5739,7 @@ dependencies = [ [[package]] name = "spacetimedb-expr" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "bigdecimal", @@ -5757,7 +5757,7 @@ dependencies = [ [[package]] name = "spacetimedb-fs-utils" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "hex", @@ -5799,7 +5799,7 @@ dependencies = [ [[package]] name = "spacetimedb-lib" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "bitflags 2.9.0", @@ -5827,7 +5827,7 @@ dependencies = [ [[package]] name = "spacetimedb-memory-usage" -version = "1.3.0" +version = "1.3.2" dependencies = [ "decorum", "ethnum", @@ -5837,7 +5837,7 @@ dependencies = [ [[package]] name = "spacetimedb-metrics" -version = "1.3.0" +version = "1.3.2" dependencies = [ "arrayvec", "itertools 0.12.1", @@ -5847,7 +5847,7 @@ dependencies = [ [[package]] name = "spacetimedb-paths" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "chrono", @@ -5863,7 +5863,7 @@ dependencies = [ [[package]] name = "spacetimedb-physical-plan" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "derive_more", @@ -5879,7 +5879,7 @@ dependencies = [ [[package]] name = "spacetimedb-primitives" -version = "1.3.0" +version = "1.3.2" dependencies = [ "bitflags 2.9.0", "either", @@ -5891,7 +5891,7 @@ dependencies = [ [[package]] name = "spacetimedb-query" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "itertools 0.12.1", @@ -5908,7 +5908,7 @@ dependencies = [ [[package]] name = "spacetimedb-sats" -version = "1.3.0" +version = "1.3.2" dependencies = [ "ahash 0.8.12", "anyhow", @@ -5941,7 +5941,7 @@ dependencies = [ [[package]] name = "spacetimedb-schema" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "derive_more", @@ -5971,7 +5971,7 @@ dependencies = [ [[package]] name = "spacetimedb-sdk" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anymap", "base64 0.21.7", @@ -6001,7 +6001,7 @@ dependencies = [ [[package]] name = "spacetimedb-snapshot" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "blake3", @@ -6034,7 +6034,7 @@ dependencies = [ [[package]] name = "spacetimedb-sql-parser" -version = "1.3.0" +version = "1.3.2" dependencies = [ "derive_more", "spacetimedb-lib", @@ -6044,7 +6044,7 @@ dependencies = [ [[package]] name = "spacetimedb-standalone" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "async-trait", @@ -6083,7 +6083,7 @@ dependencies = [ [[package]] name = "spacetimedb-subscription" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "spacetimedb-execution", @@ -6096,7 +6096,7 @@ dependencies = [ [[package]] name = "spacetimedb-table" -version = "1.3.0" +version = "1.3.2" dependencies = [ "ahash 0.8.12", "blake3", @@ -6122,7 +6122,7 @@ dependencies = [ [[package]] name = "spacetimedb-testing" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "clap 4.5.37", @@ -6149,7 +6149,7 @@ dependencies = [ [[package]] name = "spacetimedb-update" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "bytes", @@ -6174,7 +6174,7 @@ dependencies = [ [[package]] name = "spacetimedb-vm" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "arrayvec", @@ -6265,7 +6265,7 @@ dependencies = [ [[package]] name = "sqltest" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "async-trait", @@ -6603,7 +6603,7 @@ dependencies = [ [[package]] name = "test-client" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "env_logger 0.10.2", @@ -6615,7 +6615,7 @@ dependencies = [ [[package]] name = "test-counter" -version = "1.3.0" +version = "1.3.2" dependencies = [ "anyhow", "spacetimedb-data-structures", diff --git a/Cargo.toml b/Cargo.toml index e438cccf83..9f4145c0fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,43 +88,43 @@ inherits = "release" debug = true [workspace.package] -version = "1.3.0" +version = "1.3.2" edition = "2021" # update rust-toolchain.toml too! rust-version = "1.88.0" [workspace.dependencies] -spacetimedb = { path = "crates/bindings", version = "1.3.0" } -spacetimedb-auth = { path = "crates/auth", version = "1.3.0" } -spacetimedb-bindings-macro = { path = "crates/bindings-macro", version = "1.3.0" } -spacetimedb-bindings-sys = { path = "crates/bindings-sys", version = "1.3.0" } -spacetimedb-cli = { path = "crates/cli", version = "1.3.0" } -spacetimedb-client-api = { path = "crates/client-api", version = "1.3.0" } -spacetimedb-client-api-messages = { path = "crates/client-api-messages", version = "1.3.0" } -spacetimedb-codegen = { path = "crates/codegen", version = "1.3.0" } -spacetimedb-commitlog = { path = "crates/commitlog", version = "1.3.0" } -spacetimedb-core = { path = "crates/core", version = "1.3.0" } -spacetimedb-data-structures = { path = "crates/data-structures", version = "1.3.0" } -spacetimedb-datastore = { path = "crates/datastore", version = "1.3.0" } -spacetimedb-durability = { path = "crates/durability", version = "1.3.0" } -spacetimedb-execution = { path = "crates/execution", version = "1.3.0" } -spacetimedb-expr = { path = "crates/expr", version = "1.3.0" } -spacetimedb-lib = { path = "crates/lib", default-features = false, version = "1.3.0" } -spacetimedb-memory-usage = { path = "crates/memory-usage", version = "1.3.0", default-features = false } -spacetimedb-metrics = { path = "crates/metrics", version = "1.3.0" } -spacetimedb-paths = { path = "crates/paths", version = "1.3.0" } -spacetimedb-physical-plan = { path = "crates/physical-plan", version = "1.3.0" } -spacetimedb-primitives = { path = "crates/primitives", version = "1.3.0" } -spacetimedb-query = { path = "crates/query", version = "1.3.0" } -spacetimedb-sats = { path = "crates/sats", version = "1.3.0" } -spacetimedb-schema = { path = "crates/schema", version = "1.3.0" } -spacetimedb-standalone = { path = "crates/standalone", version = "1.3.0" } -spacetimedb-sql-parser = { path = "crates/sql-parser", version = "1.3.0" } -spacetimedb-table = { path = "crates/table", version = "1.3.0" } -spacetimedb-vm = { path = "crates/vm", version = "1.3.0" } -spacetimedb-fs-utils = { path = "crates/fs-utils", version = "1.3.0" } -spacetimedb-snapshot = { path = "crates/snapshot", version = "1.3.0" } -spacetimedb-subscription = { path = "crates/subscription", version = "1.3.0" } +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" } # 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 cab9895df8..1d9fdced3b 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.0 +Licensed Work: SpacetimeDB 1.3.2 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-07-30 +Change Date: 2030-08-27 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 0e4f667307..d27d186c9e 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.0" +spacetimedb = "1.3.2" log = "0.4" 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 f48a557e63..113201844e 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* 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 54c9432e68..33f7a6403f 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* 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 0d6bf6db0f..fe3b6deb40 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* eslint-disable */ /* tslint:disable */ @@ -91,7 +91,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. 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 f7e66b91fe..19ce1d7afe 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* 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 c600a53430..577574da5e 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* 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 46f3272ddb..98c1913332 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* 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 65013ae06a..f377481297 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* 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 9b68d845c2..d59979009e 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* 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 23da72cc1b..8946f9c01e 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.0 (commit e18b2dc4dd1debb07349a53a515ca2ef07fbcb2b). +// This was generated using spacetimedb cli version 1.3.2 (commit 0027d094e1216119d22b767d8e6dc41d674d1bca). /* eslint-disable */ /* tslint:disable */ From aeeb35f0bbce28430aeeb22691976813dd469e1e Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Fri, 29 Aug 2025 13:02:27 -0400 Subject: [PATCH 17/28] Improve error reporting for invalid column-type-changing automigrations (#3202) # Description of Changes Title. When validating column type changes in `Table::change_columns_to` and comparing layouts in `RowTypeLayout::is_compatible_with`, return structured error objects which describe the mismatch. I made this change while debugging the issue that led to #3203 , where `change_columns_to` returned an error during replay of an automigration which had succeeded the first time. The original error contained enough information to debug, but it was presented in a noisy and unhelpful way, so I wrote this patch to get better diagnostics. Per @Centril 's comments, these errors are for internal assertions, not user-facing error reporting, so we value fail-fast rather than error hygiene and choose not to use the `ErrorStream` combinator. Also note that I sprinkled `Box`es around some large-ish error types to quiet https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err . # API and ABI breaking changes N/a # Expected complexity level and risk 1. # Testing Manual testing with BitCraft. As this is purely altering the error reporting for non-user-facing assertions, I don't believe any further testing is necessary. --- crates/datastore/src/error.rs | 3 +- crates/sats/src/layout.rs | 153 ++++++++++++++++++++++++++++------ crates/table/src/table.rs | 92 +++++++++++++++----- 3 files changed, 201 insertions(+), 47 deletions(-) diff --git a/crates/datastore/src/error.rs b/crates/datastore/src/error.rs index cd7469679b..144a62788d 100644 --- a/crates/datastore/src/error.rs +++ b/crates/datastore/src/error.rs @@ -79,7 +79,8 @@ pub enum TableError { #[error(transparent)] ReadColTypeError(#[from] read_column::TypeError), #[error(transparent)] - ChangeColumnsError(#[from] table::ChangeColumnsError), + // Error here is `Box`ed to avoid triggering https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err . + ChangeColumnsError(#[from] Box), } #[derive(Error, Debug, PartialEq, Eq)] diff --git a/crates/sats/src/layout.rs b/crates/sats/src/layout.rs index d784196e42..9b857258a9 100644 --- a/crates/sats/src/layout.rs +++ b/crates/sats/src/layout.rs @@ -189,11 +189,22 @@ impl AlgebraicTypeLayout { pub const String: Self = Self::VarLen(VarLenType::String); /// Can `self` be changed compatibly to `new`? - fn is_compatible_with(&self, new: &Self) -> bool { + /// + /// See comment on [`IncompatibleTypeLayoutError`] about [`Box`]ing the error return. + fn ensure_compatible_with(&self, new: &Self) -> Result<(), Box> { match (self, new) { - (Self::Sum(old), Self::Sum(new)) => old.is_compatible_with(new), - (Self::Product(old), Self::Product(new)) => old.view().is_compatible_with(new.view()), - (Self::Primitive(old), Self::Primitive(new)) => old == new, + (Self::Sum(old), Self::Sum(new)) => old.ensure_compatible_with(new), + (Self::Product(old), Self::Product(new)) => old.view().ensure_compatible_with(new.view()), + (Self::Primitive(old), Self::Primitive(new)) => { + if old == new { + Ok(()) + } else { + Err(Box::new(IncompatibleTypeLayoutError::DifferentPrimitiveTypes { + old: old.algebraic_type(), + new: new.algebraic_type(), + })) + } + } (Self::VarLen(VarLenType::Array(old)), Self::VarLen(VarLenType::Array(new))) => { // NOTE(perf, centril): This might clone and heap allocate, // but we don't care to avoid that and optimize right now, @@ -201,10 +212,19 @@ impl AlgebraicTypeLayout { // and that doesn't need to be fast right now. let old = AlgebraicTypeLayout::from(old.elem_ty.deref().clone()); let new = AlgebraicTypeLayout::from(new.elem_ty.deref().clone()); - old.is_compatible_with(&new) + old.ensure_compatible_with(&new).map_err(|err| { + Box::new(IncompatibleTypeLayoutError::IncompatibleArrayElements { + old: old.algebraic_type(), + new: new.algebraic_type(), + err, + }) + }) } - (Self::VarLen(VarLenType::String), Self::VarLen(VarLenType::String)) => true, - _ => false, + (Self::VarLen(VarLenType::String), Self::VarLen(VarLenType::String)) => Ok(()), + _ => Err(Box::new(IncompatibleTypeLayoutError::DifferentKind { + old: self.algebraic_type(), + new: new.algebraic_type(), + })), } } } @@ -274,11 +294,60 @@ impl RowTypeLayout { } /// Can `self` be changed compatibly to `new`? - pub fn is_compatible_with(&self, new: &RowTypeLayout) -> bool { - self.layout == new.layout && self.product().is_compatible_with(new.product()) + /// + /// If the types are incompatible, returns the incompatible sub-part and the reason. + /// See comment on [`IncompatibleTypeLayoutError`] about [`Box`]ing the error return. + pub fn ensure_compatible_with(&self, new: &RowTypeLayout) -> Result<(), Box> { + if self.layout != new.layout { + return Err(Box::new(IncompatibleTypeLayoutError::LayoutsNotEqual { + old: self.layout, + new: self.layout, + })); + } + self.product().ensure_compatible_with(new.product()) } } +/// Reason why two [`RowTypeLayout`]s are incompatible for an auto-migration. +/// +/// Reported by [`RowTypeLayout::ensure_compatible_with`] and friends. +/// These methods are expected to return `Ok(())` except in the case of internal SpacetimeDB bugs, +/// as migrations are validated by `spacetimedb_schema::auto_migrate` before executing, +/// so we will [`Box`] these errors to keep the returned [`Result`] small and the happy path fast. +#[derive(thiserror::Error, Debug, Clone)] +pub enum IncompatibleTypeLayoutError { + #[error("Layout of new type {new:?} does not match layout of old type {old:?}")] + LayoutsNotEqual { old: Layout, new: Layout }, + #[error("Product type elements at index {index} are incompatible: {err}")] + IncompatibleProductElements { + index: usize, + err: Box, + }, + #[error("Sum type elements in variant {index} are incompatible: {err}")] + IncompatibleSumVariants { + index: usize, + err: Box, + }, + #[error("New product type {new:?} has {} elements while old product type {old:?} has {} elements", .new.elements.len(), .old.elements.len())] + DifferentElementCounts { old: ProductType, new: ProductType }, + #[error("New sum type {new:?} has {} variants, which is fewer than old sum type {old:?} with {} variants", .new.variants.len(), .old.variants.len())] + RemovedVariants { old: SumType, new: SumType }, + #[error("New primitive type {new:?} is not the same as old primitive type {old:?}")] + DifferentPrimitiveTypes { old: AlgebraicType, new: AlgebraicType }, + #[error("New array element type {new:?} is incompatible with old array element type {old:?}: {err}")] + IncompatibleArrayElements { + new: AlgebraicType, + old: AlgebraicType, + err: Box, + }, + #[error("New type {new:?} is not the same kind (sum, product, primitive, etc.) as old type {old:?}")] + DifferentKind { old: AlgebraicType, new: AlgebraicType }, +} + +pub enum IncompatibleTypeReason { + LayoutsNotEqual, +} + impl HasLayout for RowTypeLayout { fn layout(&self) -> &Layout { &self.layout @@ -309,13 +378,29 @@ impl HasLayout for ProductTypeLayoutView<'_> { impl ProductTypeLayoutView<'_> { /// Can `self` be changed compatibly to `new`? - fn is_compatible_with(self, new: Self) -> bool { - self.elements.len() == new.elements.len() - && self - .elements - .iter() - .zip(new.elements.iter()) - .all(|(old, new)| old.ty.is_compatible_with(&new.ty)) + /// + /// See comment on [`IncompatibleTypeLayoutError`] about [`Box`]ing the error return. + // Intentionally fail fast rather than combining errors with [`spacetimedb_data_structures::error_stream`] + // because we've (at least theoretically) already passed through + // `spacetimedb_schema::auto_migrate::ensure_old_ty_upgradable_to_new` to get here, + // and that method has proper pretty error reporting with `ErrorStream`. + // The error here is for internal debugging. + fn ensure_compatible_with(self, new: Self) -> Result<(), Box> { + if self.elements.len() != new.elements.len() { + return Err(Box::new(IncompatibleTypeLayoutError::DifferentElementCounts { + old: self.product_type(), + new: new.product_type(), + })); + } + for (index, (old, new)) in self.elements.iter().zip(new.elements.iter()).enumerate() { + if let Err(err) = old.ty.ensure_compatible_with(&new.ty) { + return Err(Box::new(IncompatibleTypeLayoutError::IncompatibleProductElements { + index, + err, + })); + } + } + Ok(()) } } @@ -744,13 +829,29 @@ impl SumTypeLayout { /// Can `self` be changed compatibly to `new`? /// /// In the case of sums, the old variants need only be a prefix of the new. - fn is_compatible_with(&self, new: &SumTypeLayout) -> bool { - self.variants.len() <= new.variants.len() - && self - .variants - .iter() - .zip(self.variants.iter()) - .all(|(old, new)| old.ty.is_compatible_with(&new.ty)) + /// + /// See comment on [`IncompatibleTypeLayoutError`] about [`Box`]ing the error return. + // Intentionally fail fast rather than combining errors with [`spacetimedb_data_structures::error_stream`] + // because we've (at least theoretically) already passed through + // `spacetimedb_schema::auto_migrate::ensure_old_ty_upgradable_to_new` to get here, + // and that method has proper pretty error reporting with `ErrorStream`. + // The error here is for internal debugging. + fn ensure_compatible_with(&self, new: &SumTypeLayout) -> Result<(), Box> { + if self.variants.len() > new.variants.len() { + return Err(Box::new(IncompatibleTypeLayoutError::RemovedVariants { + old: self.sum_type(), + new: new.sum_type(), + })); + } + for (index, (old, new)) in self.variants.iter().zip(self.variants.iter()).enumerate() { + if let Err(err) = old.ty.ensure_compatible_with(&new.ty) { + return Err(Box::new(IncompatibleTypeLayoutError::IncompatibleSumVariants { + index, + err, + })); + } + } + Ok(()) } } @@ -1120,13 +1221,13 @@ mod test { } #[test] - fn infinite_recursion_in_is_compatible_with_with_array_type() { + fn infinite_recursion_in_ensure_compatible_with_with_array_type() { let ty = AlgebraicTypeLayout::from(AlgebraicType::array(AlgebraicType::U64)); // This would previously cause an infinite recursion / stack overflow // due the setup where `AlgebraicTypeLayout::VarLen(Array(x))` stored // `x = Box::new(AlgebraicType::Array(elem_ty))`. - // The method `AlgebraicTypeLayout::is_compatible_with` was not setup to handle that. + // The method `AlgebraicTypeLayout::ensure_compatible_with` was not setup to handle that. // To avoid such bugs in the future, `x` is now `elem_ty` instead. - assert!(ty.is_compatible_with(&ty)); + assert!(ty.ensure_compatible_with(&ty).is_ok()); } } diff --git a/crates/table/src/table.rs b/crates/table/src/table.rs index e14e60fa55..11493edddc 100644 --- a/crates/table/src/table.rs +++ b/crates/table/src/table.rs @@ -29,7 +29,7 @@ use enum_as_inner::EnumAsInner; use smallvec::SmallVec; use spacetimedb_lib::{bsatn::DecodeError, de::DeserializeOwned}; use spacetimedb_primitives::{ColId, ColList, IndexId, SequenceId, TableId}; -use spacetimedb_sats::layout::{AlgebraicTypeLayout, PrimitiveType, RowTypeLayout, Size}; +use spacetimedb_sats::layout::{AlgebraicTypeLayout, IncompatibleTypeLayoutError, PrimitiveType, RowTypeLayout, Size}; use spacetimedb_sats::memory_usage::MemoryUsage; use spacetimedb_sats::{ algebraic_value::ser::ValueSerializer, @@ -261,13 +261,41 @@ pub enum ReadViaBsatnError { DecodeError(#[from] DecodeError), } +/// Error that can occur when attempting to [`Table::change_columns_to`] a different row type. +/// +/// This will usually be [`Box`]ed, as it's large enough to trigger +/// [Clippy's `result_large_err` lint](https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err). +/// +/// Seeing this error represents a bug in SpacetimeDB, as incompatible column-type-changing migrations +/// are supposed to be detected by the checks in [`spacetimedb_schema::auto_migrate`]. #[derive(Error, Debug)] -#[error("Cannot change the columns of table `{table_name}` with id {table_id} from `{old:?}` to `{new:?}`")] +#[error("Cannot change the columns of table `{table_name}` with id {table_id} from `{old:?}` to `{new:?}`: {reason}")] pub struct ChangeColumnsError { table_id: TableId, table_name: Box, old: Vec, new: Vec, + reason: ChangeColumnsErrorReason, +} + +/// More specific reason that a [`Table::change_columns_to`] resulted in a [`ChangeColumnsError`], +/// contained in that error alongside the table metadata and new and old schemas. +#[derive(Error, Debug)] +pub enum ChangeColumnsErrorReason { + #[error("Layout of schedule table's at column changed from {old:?} to {new:?}")] + ScheduleAtColumnChanged { + index: usize, + old: AlgebraicTypeLayout, + new: AlgebraicTypeLayout, + }, + #[error("Layout of schedule table's id column changed from {old:?} to {new:?}")] + ScheduleIdColumnChanged { + index: usize, + old: AlgebraicTypeLayout, + new: AlgebraicTypeLayout, + }, + #[error(transparent)] + IncompatibleRowLayout(#[from] IncompatibleTypeLayoutError), } /// Computes the parts of a table definition, that are row type dependent, from the row type. @@ -298,34 +326,58 @@ impl Table { pub fn change_columns_to( &mut self, column_schemas: Vec, - ) -> Result, ChangeColumnsError> { + ) -> Result, Box> { + /// Validate that the old row type layout can be changed to the new. + // Intentionally fail fast rather than combining errors with [`spacetimedb_data_structures::error_stream`] + // because we've (at least theoretically) already passed through + // `spacetimedb_schema::auto_migrate::ensure_old_ty_upgradable_to_new` to get here, + // and that method has proper pretty error reporting with `ErrorStream`. + // The error here is for internal debugging. fn validate( this: &Table, new_row_layout: &RowTypeLayout, column_schemas: &[ColumnSchema], - ) -> Result<(), ChangeColumnsError> { - // Validate that the old row type layout can be changed to the new. + ) -> Result<(), Box> { let schema = this.get_schema(); let row_layout = this.row_layout(); - // Require that a scheduler table doesn't change the `id` and `at` fields. - let schedule_compat = schema.schedule.as_ref().zip(schema.pk()).is_none_or(|(schedule, pk)| { - let at_col = schedule.at_column.idx(); - let id_col = pk.col_pos.idx(); - row_layout[at_col] == new_row_layout[at_col] && row_layout[id_col] == new_row_layout[id_col] - }); + let make_err = |reason| { + Box::new(ChangeColumnsError { + table_id: schema.table_id, + table_name: schema.table_name.clone(), + old: schema.columns().to_vec(), + new: column_schemas.to_vec(), + reason, + }) + }; - // The `row_layout` must also be compatible with the new. - if schedule_compat && row_layout.is_compatible_with(new_row_layout) { - return Ok(()); + // Require that a scheduler table doesn't change the `id` and `at` fields. + if let Some((schedule, pk)) = schema.schedule.as_ref().zip(schema.pk()) { + let at_col = schedule.at_column.idx(); + if row_layout[at_col] != new_row_layout[at_col] { + return Err(make_err(ChangeColumnsErrorReason::ScheduleAtColumnChanged { + index: at_col, + old: row_layout[at_col].clone(), + new: new_row_layout[at_col].clone(), + })); + } + + let id_col = pk.col_pos.idx(); + if row_layout[id_col] != new_row_layout[id_col] { + return Err(make_err(ChangeColumnsErrorReason::ScheduleIdColumnChanged { + index: id_col, + old: row_layout[id_col].clone(), + new: new_row_layout[id_col].clone(), + })); + } } - Err(ChangeColumnsError { - table_id: schema.table_id, - table_name: schema.table_name.clone(), - old: schema.columns().to_vec(), - new: column_schemas.to_vec(), - }) + // The `row_layout` must also be compatible with the new. + if let Err(reason) = row_layout.ensure_compatible_with(new_row_layout) { + return Err(make_err((*reason).into())); + } + + Ok(()) } unsafe { self.change_columns_to_unchecked(column_schemas, validate) } From e4735d7adaf01c89b35207c36b0c6672675de55e Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Wed, 3 Sep 2025 18:52:57 +0200 Subject: [PATCH 18/28] V8: Add `call_call_reducer` incl with stack traces + wire update_database (#3212) # Description of Changes For V8 modules: - Add `call_call_reducer` - Add stack traces for traps. - Wire `update_database` It remains to wire up `call_call_reducer`, but this shouldn't be that much work, but I'll do that in a follow up. # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing Tests for `call_call_reducer` are added. --- crates/core/src/host/v8/error.rs | 130 +++++++++++++- crates/core/src/host/v8/key_cache.rs | 7 + crates/core/src/host/v8/mod.rs | 159 +++++++++++++++--- crates/core/src/host/v8/ser.rs | 2 +- crates/core/src/host/v8/to_value.rs | 1 + .../src/host/wasm_common/module_host_actor.rs | 8 +- 6 files changed, 274 insertions(+), 33 deletions(-) diff --git a/crates/core/src/host/v8/error.rs b/crates/core/src/host/v8/error.rs index b490af1cf9..1021f9c5f1 100644 --- a/crates/core/src/host/v8/error.rs +++ b/crates/core/src/host/v8/error.rs @@ -1,6 +1,7 @@ //! Utilities for error handling when dealing with V8. -use v8::{Exception, HandleScope, Local, TryCatch, Value}; +use core::fmt; +use v8::{Exception, HandleScope, Local, StackFrame, StackTrace, TryCatch, Value}; /// The result of trying to convert a [`Value`] in scope `'scope` to some type `T`. pub(super) type ValueResult<'scope, T> = Result>; @@ -117,19 +118,134 @@ impl From> for anyhow::Error { /// A JS exception turned into an error. #[derive(thiserror::Error, Debug)] -#[error("js error: {msg:?}")] pub(super) struct JsError { msg: String, + trace: JsStackTrace, +} + +impl fmt::Display for JsError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + writeln!(f, "js error {}", self.msg)?; + writeln!(f, "{}", self.trace)?; + Ok(()) + } +} + +/// A V8 stack trace that is independent of a `'scope`. +#[derive(Debug, Default)] +pub(super) struct JsStackTrace { + frames: Box<[JsStackTraceFrame]>, +} + +impl JsStackTrace { + /// Converts a V8 [`StackTrace`] into one independent of `'scope`. + fn from_trace<'scope>(scope: &mut HandleScope<'scope>, trace: Local<'scope, StackTrace>) -> Self { + let frames = (0..trace.get_frame_count()) + .map(|index| { + let frame = trace.get_frame(scope, index).unwrap(); + JsStackTraceFrame::from_frame(scope, frame) + }) + .collect::>(); + Self { frames } + } +} + +impl fmt::Display for JsStackTrace { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + for frame in self.frames.iter() { + writeln!(f, "\t{frame}")?; + } + + Ok(()) + } +} + +/// A V8 stack trace frame that is independent of a `'scope`. +#[derive(Debug)] +pub(super) struct JsStackTraceFrame { + line: usize, + column: usize, + script_id: usize, + script_name: Option, + fn_name: Option, + is_eval: bool, + is_ctor: bool, + is_wasm: bool, + is_user_js: bool, +} + +impl JsStackTraceFrame { + /// Converts a V8 [`StackFrame`] into one independent of `'scope`. + fn from_frame<'scope>(scope: &mut HandleScope<'scope>, frame: Local<'scope, StackFrame>) -> Self { + let script_name = frame + .get_script_name_or_source_url(scope) + .map(|s| s.to_rust_string_lossy(scope)); + + let fn_name = frame.get_function_name(scope).map(|s| s.to_rust_string_lossy(scope)); + + Self { + line: frame.get_line_number(), + column: frame.get_column(), + script_id: frame.get_script_id(), + script_name, + fn_name, + is_eval: frame.is_eval(), + is_ctor: frame.is_constructor(), + is_wasm: frame.is_wasm(), + is_user_js: frame.is_user_javascript(), + } + } +} + +impl fmt::Display for JsStackTraceFrame { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let fn_name = self.fn_name.as_deref().unwrap_or(""); + let script_name = self.script_name.as_deref().unwrap_or(""); + + // This isn't exactly the same format as chrome uses, + // but it's close enough for now. + // TODO(centril): make it more like chrome in the future. + f.write_fmt(format_args!( + "at {} ({}:{}:{})", + fn_name, script_name, &self.line, &self.column + ))?; + + if self.is_ctor { + f.write_str(" (constructor)")?; + } + + if self.is_eval { + f.write_str(" (eval)")?; + } + + if self.is_wasm { + f.write_str(" (wasm)")?; + } + + if !self.is_user_js { + f.write_str(" (native)")?; + } + + Ok(()) + } } impl JsError { /// Turns a caught JS exception in `scope` into a [`JSError`]. fn from_caught(scope: &mut TryCatch<'_, HandleScope<'_>>) -> Self { - let msg = match scope.message() { - Some(msg) => msg.get(scope).to_rust_string_lossy(scope), - None => "unknown error".to_owned(), - }; - Self { msg } + match scope.message() { + Some(message) => Self { + trace: message + .get_stack_trace(scope) + .map(|trace| JsStackTrace::from_trace(scope, trace)) + .unwrap_or_default(), + msg: message.get(scope).to_rust_string_lossy(scope), + }, + None => Self { + trace: JsStackTrace::default(), + msg: "unknown error".to_owned(), + }, + } } } diff --git a/crates/core/src/host/v8/key_cache.rs b/crates/core/src/host/v8/key_cache.rs index 4b4f105c8c..bd0356d8ec 100644 --- a/crates/core/src/host/v8/key_cache.rs +++ b/crates/core/src/host/v8/key_cache.rs @@ -24,6 +24,8 @@ pub(super) struct KeyCache { value: Option>, /// The `__describe_module__` property on the global proxy object. describe_module: Option>, + /// The `__call_reducer__` property on the global proxy object. + call_reducer: Option>, } impl KeyCache { @@ -42,6 +44,11 @@ impl KeyCache { Self::get_or_create_key(scope, &mut self.describe_module, "__describe_module__") } + /// Returns the `__call_reducer__` property name. + pub(super) fn call_reducer<'scope>(&mut self, scope: &mut HandleScope<'scope>) -> Local<'scope, v8::String> { + Self::get_or_create_key(scope, &mut self.call_reducer, "__call_reducer__") + } + /// Returns an interned string corresponding to `string` /// and memoizes the creation on the v8 side. fn get_or_create_key<'scope>( diff --git a/crates/core/src/host/v8/mod.rs b/crates/core/src/host/v8/mod.rs index ac0316014e..265f1ead6b 100644 --- a/crates/core/src/host/v8/mod.rs +++ b/crates/core/src/host/v8/mod.rs @@ -2,17 +2,21 @@ use super::module_common::{build_common_module_from_raw, ModuleCommon}; use super::module_host::{CallReducerParams, DynModule, Module, ModuleInfo, ModuleInstance, ModuleRuntime}; -use crate::host::v8::error::{exception_already_thrown, Throwable}; +use super::UpdateDatabaseResult; +use crate::host::wasm_common::module_host_actor::InstanceCommon; +use crate::host::ArgsTuple; use crate::{host::Scheduler, module_host_context::ModuleCreationContext, replica_context::ReplicaContext}; use anyhow::anyhow; use de::deserialize_js; -use error::catch_exception; +use error::{catch_exception, exception_already_thrown, ExcResult, Throwable}; use from_value::cast; use key_cache::get_or_create_key_cache; +use ser::serialize_to_js; use spacetimedb_datastore::locking_tx_datastore::MutTxId; -use spacetimedb_lib::RawModuleDef; +use spacetimedb_datastore::traits::Program; +use spacetimedb_lib::{ConnectionId, Identity, RawModuleDef}; use std::sync::{Arc, LazyLock}; -use v8::{Function, HandleScope}; +use v8::{Function, HandleScope, Local, Value}; mod de; mod error; @@ -114,19 +118,23 @@ impl Module for JsModule { } } -struct JsInstance; +struct JsInstance { + common: InstanceCommon, + replica_ctx: Arc, +} impl ModuleInstance for JsInstance { fn trapped(&self) -> bool { - todo!() + self.common.trapped } fn update_database( &mut self, - _program: spacetimedb_datastore::traits::Program, - _old_module_info: Arc, - ) -> anyhow::Result { - todo!() + program: Program, + old_module_info: Arc, + ) -> anyhow::Result { + let replica_ctx = &self.replica_ctx; + self.common.update_database(replica_ctx, program, old_module_info) } fn call_reducer(&mut self, _tx: Option, _params: CallReducerParams) -> super::ReducerCallResult { @@ -134,27 +142,79 @@ impl ModuleInstance for JsInstance { } } +/// Returns the global property `key`. +fn get_global_property<'scope>( + scope: &mut HandleScope<'scope>, + key: Local<'scope, v8::String>, +) -> ExcResult> { + scope + .get_current_context() + .global(scope) + .get(scope, key.into()) + .ok_or_else(exception_already_thrown) +} + +fn call_free_fun<'scope>( + scope: &mut HandleScope<'scope>, + fun: Local<'scope, Function>, + args: &[Local<'scope, Value>], +) -> ExcResult> { + let receiver = v8::undefined(scope).into(); + fun.call(scope, receiver, args).ok_or_else(exception_already_thrown) +} + +// Calls the `__call_reducer__` function on the global proxy object. +fn call_call_reducer( + scope: &mut HandleScope<'_>, + reducer_id: u32, + sender: &Identity, + conn_id: &ConnectionId, + timestamp: u64, + reducer_args: &ArgsTuple, +) -> anyhow::Result>> { + // Get a cached version of the `__call_reducer__` property. + let key_cache = get_or_create_key_cache(scope); + let call_reducer_key = key_cache.borrow_mut().call_reducer(scope); + + catch_exception(scope, |scope| { + // Serialize the arguments. + let reducer_id = serialize_to_js(scope, &reducer_id)?; + let sender = serialize_to_js(scope, &sender.to_u256())?; + let conn_id: v8::Local<'_, v8::Value> = serialize_to_js(scope, &conn_id.to_u128())?; + let timestamp = serialize_to_js(scope, ×tamp)?; + let reducer_args = serialize_to_js(scope, &reducer_args.tuple.elements)?; + let args = &[reducer_id, sender, conn_id, timestamp, reducer_args]; + + // Get the function on the global proxy object and convert to a function. + let object = get_global_property(scope, call_reducer_key)?; + let fun = + cast!(scope, object, Function, "function export for `__call_reducer__`").map_err(|e| e.throw(scope))?; + + // Call the function. + let ret = call_free_fun(scope, fun, args)?; + + // Deserialize the user result. + let user_res = deserialize_js(scope, ret)?; + + Ok(user_res) + }) + .map_err(Into::into) +} + // Calls the `__describe_module__` function on the global proxy object to extract a [`RawModuleDef`]. fn call_describe_module(scope: &mut HandleScope<'_>) -> anyhow::Result { // Get a cached version of the `__describe_module__` property. let key_cache = get_or_create_key_cache(scope); - let describe_module_key = key_cache.borrow_mut().describe_module(scope).into(); + let describe_module_key = key_cache.borrow_mut().describe_module(scope); catch_exception(scope, |scope| { - // Get the function on the global proxy object. - let object = scope - .get_current_context() - .global(scope) - .get(scope, describe_module_key) - .ok_or_else(exception_already_thrown)?; - - // Convert to a function. + // Get the function on the global proxy object and convert to a function. + let object = get_global_property(scope, describe_module_key)?; let fun = cast!(scope, object, Function, "function export for `__describe_module__`").map_err(|e| e.throw(scope))?; // Call the function. - let receiver = v8::undefined(scope).into(); - let raw_mod_js = fun.call(scope, receiver, &[]).ok_or_else(exception_already_thrown)?; + let raw_mod_js = call_free_fun(scope, fun, &[])?; // Deserialize the raw module. let raw_mod: RawModuleDef = deserialize_js(scope, raw_mod_js)?; @@ -180,6 +240,63 @@ mod test { }) } + #[test] + fn call_call_reducer_works() { + let call = |code| { + with_script(code, |scope, _| { + call_call_reducer( + scope, + 42, + &Identity::ONE, + &ConnectionId::ZERO, + 24, + &ArgsTuple::nullary(), + ) + }) + }; + + // Test the trap case. + let ret = call( + r#" + function __call_reducer__(reducer_id, sender, conn_id, timestamp, args) { + throw new Error("foobar"); + } + "#, + ); + let actual = format!("{}", ret.expect_err("should trap")).replace("\t", " "); + let expected = r#" +js error Uncaught Error: foobar + at __call_reducer__ (:3:23) + "#; + assert_eq!(actual.trim(), expected.trim()); + + // Test the error case. + let ret = call( + r#" + function __call_reducer__(reducer_id, sender, conn_id, timestamp, args) { + return { + "tag": "err", + "value": "foobar", + }; + } + "#, + ); + assert_eq!(&*ret.expect("should not trap").expect_err("should error"), "foobar"); + + // Test the error case. + let ret = call( + r#" + function __call_reducer__(reducer_id, sender, conn_id, timestamp, args) { + return { + "tag": "ok", + "value": {}, + }; + } + "#, + ); + ret.expect("should not trap").expect("should not error"); + } + #[test] fn call_describe_module_works() { let code = r#" diff --git a/crates/core/src/host/v8/ser.rs b/crates/core/src/host/v8/ser.rs index 3e1be4eb61..62f6130ba0 100644 --- a/crates/core/src/host/v8/ser.rs +++ b/crates/core/src/host/v8/ser.rs @@ -92,7 +92,7 @@ macro_rules! serialize_primitive { /// However, the values of existing properties may be modified, /// which can be useful if the module wants to modify a property /// and then send the object back. -fn seal_object(scope: &mut HandleScope<'_>, object: &Object) -> Result<(), ExceptionThrown> { +fn seal_object(scope: &mut HandleScope<'_>, object: &Object) -> ExcResult<()> { let _ = object .set_integrity_level(scope, IntegrityLevel::Sealed) .ok_or_else(exception_already_thrown)?; diff --git a/crates/core/src/host/v8/to_value.rs b/crates/core/src/host/v8/to_value.rs index 18c230724d..e97dd491eb 100644 --- a/crates/core/src/host/v8/to_value.rs +++ b/crates/core/src/host/v8/to_value.rs @@ -116,6 +116,7 @@ pub(in super::super) mod test { pub(in super::super) fn with_scope(logic: impl FnOnce(&mut HandleScope<'_>) -> R) -> R { V8Runtime::init_for_test(); let isolate = &mut Isolate::new(<_>::default()); + isolate.set_capture_stack_trace_for_uncaught_exceptions(true, 1024); let scope = &mut HandleScope::new(isolate); let context = Context::new(scope, Default::default()); let scope = &mut ContextScope::new(scope, context); diff --git a/crates/core/src/host/wasm_common/module_host_actor.rs b/crates/core/src/host/wasm_common/module_host_actor.rs index 7b1f2f5048..73a637be4a 100644 --- a/crates/core/src/host/wasm_common/module_host_actor.rs +++ b/crates/core/src/host/wasm_common/module_host_actor.rs @@ -234,7 +234,7 @@ impl ModuleInstance for WasmModuleInstance { &mut self, program: Program, old_module_info: Arc, - ) -> Result { + ) -> anyhow::Result { let replica_ctx = &self.instance.instance_env().replica_ctx; self.common.update_database(replica_ctx, program, old_module_info) } @@ -263,17 +263,17 @@ impl WasmModuleInstance { } } -struct InstanceCommon { +pub(crate) struct InstanceCommon { info: Arc, energy_monitor: Arc, allocated_memory: usize, metric_wasm_memory_bytes: IntGauge, - trapped: bool, + pub(crate) trapped: bool, } impl InstanceCommon { #[tracing::instrument(level = "trace", skip_all)] - fn update_database( + pub(crate) fn update_database( &mut self, replica_ctx: &ReplicaContext, program: Program, From 726345206f23c38a860fc6c40a661e3e882a9ee6 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:55:41 -0700 Subject: [PATCH 19/28] CI - License checks (#3197) # Description of Changes - Checks that all `LICENSE`/`LICENSE.txt` files are symlinks to something in `licenses/` - Checks that all license symlinks are valid - Adds Tyler as a codeowner for `LICENSE` # API and ABI breaking changes None. # Expected complexity level and risk 2 # Testing - [x] new CI fails on this PR (because https://github.com/clockworklabs/SpacetimeDB/pull/3193 isn't merged yet) - [x] new CI passes on a test PR with https://github.com/clockworklabs/SpacetimeDB/pull/3193 merged in (https://github.com/clockworklabs/SpacetimeDB/pull/3198) --------- Co-authored-by: Zeke Foppa --- .github/CODEOWNERS | 2 + .github/workflows/ci.yml | 27 ++++++++ Cargo.lock | 9 +++ Cargo.toml | 4 +- tools/license-check/Cargo.toml | 13 ++++ tools/license-check/main.rs | 120 +++++++++++++++++++++++++++++++++ 6 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 tools/license-check/Cargo.toml create mode 100644 tools/license-check/main.rs diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c4938dced5..1a6d5ef639 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,7 +1,9 @@ /crates/core/src/db/datastore/traits.rs @cloutiertyler /rust-toolchain.toml @cloutiertyler /.github/CODEOWNERS @cloutiertyler +LICENSE @cloutiertyler LICENSE.txt @cloutiertyler +/licenses/ @cloutiertyler /crates/client-api-messages/src/websocket.rs @centril @gefjon /crates/cli/src/ @bfops @cloutiertyler @jdetter diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bad98fda0..92f698f7b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -274,3 +274,30 @@ jobs: echo "It looks like the CLI docs have changed:" exit 1 fi + + license_check: + name: Check licenses + permissions: read-all + runs-on: ubuntu-latest + steps: + - name: Find Git ref + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + PR_NUMBER="${{ github.event.inputs.pr_number || null }}" + if test -n "${PR_NUMBER}"; then + GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" + else + GIT_REF="${{ github.ref }}" + fi + echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" + - name: Checkout sources + uses: actions/checkout@v4 + with: + ref: ${{ env.GIT_REF }} + - uses: dsherret/rust-toolchain-file@v1 + - name: Check for invalid licenses + run: | + cd tools/license-check + cargo run diff --git a/Cargo.lock b/Cargo.lock index 286f665ec1..2d62de6b9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -753,6 +753,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "check-license-symlinks" +version = "0.1.0" +dependencies = [ + "anyhow", + "log", + "walkdir", +] + [[package]] name = "chrono" version = "0.4.41" diff --git a/Cargo.toml b/Cargo.toml index 9f4145c0fd..9c9e061605 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,9 @@ members = [ "sdks/rust/tests/test-client", "sdks/rust/tests/test-counter", "sdks/rust/tests/connect_disconnect_client", - "tools/upgrade-version", "crates/codegen", + "tools/upgrade-version", + "tools/license-check", + "crates/codegen", ] default-members = ["crates/cli", "crates/standalone", "crates/update"] # cargo feature graph resolver. v3 is default in edition2024 but workspace diff --git a/tools/license-check/Cargo.toml b/tools/license-check/Cargo.toml new file mode 100644 index 0000000000..b8485f164e --- /dev/null +++ b/tools/license-check/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "check-license-symlinks" +version = "0.1.0" +edition = "2021" + +[[bin]] +name = "license-check" +path = "main.rs" + +[dependencies] +anyhow = "1.0" +log.workspace = true +walkdir = "2.5" diff --git a/tools/license-check/main.rs b/tools/license-check/main.rs new file mode 100644 index 0000000000..db50c220d8 --- /dev/null +++ b/tools/license-check/main.rs @@ -0,0 +1,120 @@ +use anyhow::{bail, Context, Result}; +use std::env; +use std::fs; +use std::path::{Path, PathBuf}; +use walkdir::WalkDir; + +fn main() -> Result<()> { + let repo_root = find_repo_root().context("Could not locate repo root (looked for `.git/` or `licenses/`)")?; + + check_license_symlinks(&repo_root)?; + log::info!("All LICENSE files are valid symlinks into `licenses/`."); + Ok(()) +} + +fn find_repo_root() -> Option { + let mut dir = env::current_dir().ok()?.to_path_buf(); + loop { + if dir.join(".git").is_dir() || dir.join("licenses").is_dir() { + return Some(dir); + } + if !dir.pop() { + return None; + } + } +} + +fn relative_to(path: &Path, root: &Path) -> String { + match path.strip_prefix(root) { + Ok(rel) => rel.display().to_string(), + Err(_) => path.display().to_string(), // fallback if not under repo_root + } +} + +fn check_license_symlinks(repo_root: &Path) -> Result<()> { + let licenses_dir = repo_root.join("licenses"); + if !licenses_dir.is_dir() { + bail!( + "Required directory 'licenses/' not found at the repo root: {}", + licenses_dir.display() + ); + } + + let licenses_dir_canon = fs::canonicalize(&licenses_dir) + .with_context(|| format!("Could not canonicalize licenses dir: {}", licenses_dir.display()))?; + + let ignore_list = ["LICENSE.txt", "crates/sqltest/standards/LICENSE"]; + let mut errors: Vec = Vec::new(); + + for entry in WalkDir::new(repo_root).into_iter().filter_map(Result::ok) { + let name = entry.file_name().to_string_lossy(); + if name != "LICENSE" && name != "LICENSE.txt" { + continue; + } + + let path = entry.into_path(); + let rel_str = relative_to(&path, repo_root); + if ignore_list.contains(&rel_str.as_str()) { + continue; + } + + if let Err(e) = validate_one_license(path, repo_root, &licenses_dir_canon) { + // include the relative path to make the report easy to scan + errors.push(e.to_string()); + } + } + + if !errors.is_empty() { + bail!("Found invalid LICENSE symlinks:\n{}", errors.join("\n")); + } + + Ok(()) +} + +fn validate_one_license(path: PathBuf, repo_root: &Path, licenses_dir_canon: &Path) -> Result<()> { + let meta = fs::symlink_metadata(&path) + .with_context(|| format!("Could not stat file {}", relative_to(&path, repo_root)))?; + + if !meta.file_type().is_symlink() { + bail!( + "{}: Must be a symlink pointing into 'licenses/'.", + relative_to(&path, repo_root) + ); + } + + let raw_target = fs::read_link(&path) + .with_context(|| format!("Could not read symlink target {}", relative_to(&path, repo_root)))?; + + let resolved = + fs::canonicalize(resolve_relative_target(&raw_target, path.parent().unwrap())).with_context(|| { + format!( + "{}: Broken symlink (target {}).", + relative_to(&path, repo_root), + raw_target.display() + ) + })?; + + if !is_within(&resolved, licenses_dir_canon) { + bail!( + "{}: Symlink target must be inside 'licenses/' (got {}).", + relative_to(&path, repo_root), + relative_to(&resolved, repo_root) + ); + } + + Ok(()) +} + +/// Is `child` inside `base`? +fn is_within(child: &Path, base: &Path) -> bool { + child.ancestors().any(|a| a == base) +} + +/// Resolve a relative symlink target against its parent directory. +fn resolve_relative_target(target: &Path, link_parent: &Path) -> PathBuf { + if target.is_absolute() { + target.to_path_buf() + } else { + link_parent.join(target) + } +} From 5901fb5063808c4dbf2030beb935441a19f37102 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 3 Sep 2025 17:12:14 -0400 Subject: [PATCH 20/28] Separate out TypeScript module library from the SDK (#3182) # Description of Changes Please note, much of the code changed in this PR is generated code. This change updates the TypeScript SDK to use a new `spacetimedb` TypeScript library which lives under the `/crates/bindings-typescript` folder alongside `/crates/bindings-csharp`. Just like with the C# bindings library, the types for `AlgebraicType` and `RawModuleDef` are now code generated with a script in `/crates/codegen/examples`. Pulling this out into a library allows us to use the same types and serialization code on both the server and the client for TypeScript modules. In the process of making this change I also found and fixed several issues with the TypeScript code generation. Namely an issue with recursive types and an issue with the `never` type. I also removed any use of `namespace`s since those are a TypeScript only feature, and we want to have JavaScript + types so that we can use the generated code with ESBuild without TSC. I have also improved the npm/pnpm scripts to be able to generate TypeScript code for us automatically by running `pnpm generate` for any place that we have to generate typescript code. Namely: - Quickstart module bindings - AlgebraicType/ModuleDef for TypeScript module library - Client API messages for the TypeScript API - TestApp module bindings # API and ABI breaking changes IMPORTANT! This is an API breaking change for clients, as such it should be a major version change. However, I am going to see if I can shim in the old API as best as possible to make it compatible. Notably, we were previously exporting APIs that end users do not need, and I don't think it would ever occur to them to use, namely the whole `AlgebraicValue` API and also the `AlgebraicType` API. In principle, no one should have a need for these, although it was technically possible for them to use it. Indeed, we could potentially even just remove AlgebraicType completely from the API by directly code generating the serialization code. Listed below are all of the **BREAKING** changes to the API and their effect: - `AlgebraicType` is now a structural union literal type instead of a class (nominal type), this is a consequence of generating the type with our code gen. Users did not have a reason to use `AlgebraicType` directly. - The `AlgebraicValue` type has been removed entirely. This was previously a class that was exported from the SDK, but very unlikely to be used by users. - The `ProductValue` type has been removed. - The `ReducerArgsAdapter` and `ValueAdapter` types, which were used with AlgebraicValues have been removed. - Generated code has changed incompatibly so users will have to regenerate code when upgrading to this version. Technically a breaking change, but pretty easy to fix. Listed below are the non-breaking API changes: - I am now exporting generated product types as the default export in addition to how I was exporting them before - For generated sum type `T`, I am now exporting a `TVariants` namespace which has the types of all the variants for `T`. This was previously exposed on the namespace `T`, but was inaccessible in modules other than the one it was defined in because I also export a type `T` in addition to namespace `T` and in the type position `T` was being interpreted as a type rather than a namespace. It's unclear why TypeScript resolved it as the `T` namespace within the module in which is was defined previously. Anyway, since the old types were apparently unobservable to users, I've replaced them with the types in `TVariants`. (Open to other names for this namespace). - I fixed a bug where never types (sum types with no variants) were not correctly generated. # Expected complexity level and risk 3. The most complex thing about the PR are the potential impacts to the API. I am reasonably certain, but not 100% certain that I have accounted for everything above. # Testing - [x] I ran `pnpm test` which runs all the tests in the repo including an integration test which tests the connection to SpacetimeDB. I also fixed broken tests. --------- Co-authored-by: Zeke Foppa --- .../.prettierignore => .prettierignore | 2 +- sdks/typescript/.prettierrc => .prettierrc | 0 Cargo.lock | 328 +- Cargo.toml | 66 +- LICENSE.txt | 4 +- crates/bindings-typescript/LICENSE.txt | 1 + crates/bindings-typescript/eslint.config.js | 41 + crates/bindings-typescript/package.json | 62 + .../bindings-typescript/src/algebraic_type.ts | 482 +++ .../src/algebraic_value.ts | 10 + .../src/autogen/algebraic_type_type.ts | 185 + .../src/autogen/algebraic_type_variants.ts | 54 + .../src/autogen/index_type_type.ts | 78 + .../src/autogen/index_type_variants.ts | 33 + .../src/autogen/lifecycle_type.ts | 86 + .../src/autogen/lifecycle_variants.ts | 34 + .../src/autogen/misc_module_export_type.ts | 78 + .../autogen/misc_module_export_variants.ts | 33 + .../src/autogen/product_type_element_type.ts | 78 + .../src/autogen/product_type_type.ts | 73 + .../src/autogen/raw_column_def_v_8_type.ts | 73 + .../raw_column_default_value_v_9_type.ts | 74 + .../autogen/raw_constraint_data_v_9_type.ts | 78 + .../raw_constraint_data_v_9_variants.ts | 33 + .../autogen/raw_constraint_def_v_8_type.ts | 74 + .../autogen/raw_constraint_def_v_9_type.ts | 78 + .../src/autogen/raw_index_algorithm_type.ts | 83 + .../autogen/raw_index_algorithm_variants.ts | 34 + .../src/autogen/raw_index_def_v_8_type.ts | 80 + .../src/autogen/raw_index_def_v_9_type.ts | 85 + .../raw_misc_module_export_v_9_type.ts | 78 + .../raw_misc_module_export_v_9_variants.ts | 36 + .../src/autogen/raw_module_def_type.ts | 86 + .../src/autogen/raw_module_def_v_8_type.ts | 95 + .../src/autogen/raw_module_def_v_9_type.ts | 111 + .../src/autogen/raw_module_def_variants.ts | 35 + .../src/autogen/raw_reducer_def_v_9_type.ts | 81 + .../raw_row_level_security_def_v_9_type.ts | 65 + .../src/autogen/raw_schedule_def_v_9_type.ts | 76 + .../autogen/raw_scoped_type_name_v_9_type.ts | 74 + .../src/autogen/raw_sequence_def_v_8_type.ts | 94 + .../src/autogen/raw_sequence_def_v_9_type.ts | 97 + .../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 | 75 + .../raw_unique_constraint_data_v_9_type.ts | 70 + .../src/autogen/reducer_def_type.ts | 75 + .../src/autogen/sum_type_type.ts | 73 + .../src/autogen/sum_type_variant_type.ts | 78 + .../src/autogen/table_access_type.ts | 80 + .../src/autogen/table_access_variants.ts | 33 + .../src/autogen/table_desc_type.ts | 73 + .../src/autogen/table_type_type.ts | 78 + .../src/autogen/table_type_variants.ts | 33 + .../src/autogen/type_alias_type.ts | 69 + .../src/autogen/typespace_type.ts | 73 + .../bindings-typescript}/src/binary_reader.ts | 0 .../bindings-typescript}/src/binary_writer.ts | 0 .../bindings-typescript}/src/connection_id.ts | 2 +- .../bindings-typescript}/src/identity.ts | 2 - crates/bindings-typescript/src/index.ts | 10 + crates/bindings-typescript/src/schedule_at.ts | 37 + .../bindings-typescript}/src/time_duration.ts | 0 .../bindings-typescript}/src/timestamp.ts | 0 .../bindings-typescript}/src/utils.ts | 12 +- crates/bindings-typescript/tsconfig.json | 28 + crates/cli/src/subcommands/generate.rs | 6 +- .../src/subcommands/project/rust/Cargo._toml | 2 +- crates/client-api-messages/DEVELOP.md | 2 +- .../examples/regen-csharp-moduledef.rs | 4 +- .../examples/regen-typescript-moduledef.rs | 47 + crates/codegen/src/csharp.rs | 57 +- crates/codegen/src/lib.rs | 41 +- crates/codegen/src/rust.rs | 45 +- crates/codegen/src/typescript.rs | 414 +- crates/codegen/tests/codegen.rs | 5 +- .../codegen__codegen_typescript.snap | 3256 +++++++-------- licenses/BSL.txt | 4 +- .../pnpm-lock.yaml => pnpm-lock.yaml | 3656 ++++++++--------- pnpm-workspace.yaml | 6 + .../examples/quickstart-chat/package.json | 12 +- .../examples/quickstart-chat/src/index.css | 10 +- .../identity_connected_reducer.ts | 85 +- .../identity_disconnected_reducer.ts | 87 +- .../src/module_bindings/index.ts | 96 +- .../src/module_bindings/message_table.ts | 50 +- .../src/module_bindings/message_type.ts | 101 +- .../module_bindings/send_message_reducer.ts | 84 +- .../src/module_bindings/set_name_reducer.ts | 84 +- .../src/module_bindings/user_table.ts | 54 +- .../src/module_bindings/user_type.ts | 104 +- sdks/typescript/package.json | 3 +- sdks/typescript/packages/sdk/package.json | 12 +- .../packages/sdk/src/algebraic_type.ts | 672 --- .../packages/sdk/src/algebraic_value.ts | 331 -- .../sdk/src/client_api/bsatn_row_list_type.ts | 104 +- .../sdk/src/client_api/call_reducer_type.ts | 99 +- .../sdk/src/client_api/client_message_type.ts | 220 +- .../src/client_api/client_message_variants.ts | 54 + .../compressable_query_update_type.ts | 141 +- .../compressable_query_update_variants.ts | 35 + .../src/client_api/database_update_type.ts | 100 +- .../sdk/src/client_api/energy_quanta_type.ts | 85 +- .../sdk/src/client_api/identity_token_type.ts | 108 +- .../packages/sdk/src/client_api/index.ts | 80 +- .../client_api/initial_subscription_type.ts | 111 +- .../client_api/one_off_query_response_type.ts | 131 +- .../sdk/src/client_api/one_off_query_type.ts | 95 +- .../sdk/src/client_api/one_off_table_type.ts | 98 +- .../sdk/src/client_api/query_id_type.ts | 85 +- .../sdk/src/client_api/query_update_type.ts | 106 +- .../src/client_api/reducer_call_info_type.ts | 102 +- .../sdk/src/client_api/row_size_hint_type.ts | 115 +- .../src/client_api/row_size_hint_variants.ts | 33 + .../sdk/src/client_api/server_message_type.ts | 315 +- .../src/client_api/server_message_variants.ts | 78 + .../src/client_api/subscribe_applied_type.ts | 118 +- .../subscribe_multi_applied_type.ts | 120 +- .../src/client_api/subscribe_multi_type.ts | 105 +- .../sdk/src/client_api/subscribe_rows_type.ts | 100 +- .../src/client_api/subscribe_single_type.ts | 100 +- .../sdk/src/client_api/subscribe_type.ts | 97 +- .../src/client_api/subscription_error_type.ts | 128 +- .../sdk/src/client_api/table_update_type.ts | 106 +- .../transaction_update_light_type.ts | 98 +- .../src/client_api/transaction_update_type.ts | 160 +- .../client_api/unsubscribe_applied_type.ts | 118 +- .../unsubscribe_multi_applied_type.ts | 115 +- .../src/client_api/unsubscribe_multi_type.ts | 98 +- .../sdk/src/client_api/unsubscribe_type.ts | 95 +- .../sdk/src/client_api/update_status_type.ts | 128 +- .../src/client_api/update_status_variants.ts | 35 + .../packages/sdk/src/db_connection_builder.ts | 2 +- .../packages/sdk/src/db_connection_impl.ts | 44 +- sdks/typescript/packages/sdk/src/index.ts | 6 +- .../packages/sdk/src/message_types.ts | 6 +- .../packages/sdk/src/reducer_event.ts | 6 +- .../packages/sdk/src/schedule_at.ts | 55 - .../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/version.ts | 2 +- .../sdk/src/websocket_test_adapter.ts | 18 +- .../packages/sdk/tests/algebraic_type.test.ts | 168 + .../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 | 85 +- sdks/typescript/packages/sdk/tsconfig.json | 9 +- sdks/typescript/packages/sdk/tsup.config.ts | 90 + sdks/typescript/packages/sdk/vitest.config.ts | 15 + .../typescript/packages/test-app/package.json | 6 +- .../packages/test-app/server/Cargo.toml | 2 +- .../module_bindings/create_player_reducer.ts | 92 +- .../test-app/src/module_bindings/index.ts | 95 +- .../src/module_bindings/player_table.ts | 54 +- .../src/module_bindings/player_type.ts | 94 +- .../src/module_bindings/point_type.ts | 89 +- .../module_bindings/unindexed_player_table.ts | 52 +- .../module_bindings/unindexed_player_type.ts | 97 +- .../src/module_bindings/user_table.ts | 54 +- .../test-app/src/module_bindings/user_type.ts | 94 +- sdks/typescript/pnpm-workspace.yaml | 3 - sdks/typescript/tsup.config.ts | 56 - sdks/typescript/vitest.config.ts | 11 + 165 files changed, 11412 insertions(+), 7932 deletions(-) rename sdks/typescript/.prettierignore => .prettierignore (81%) rename sdks/typescript/.prettierrc => .prettierrc (100%) create mode 120000 crates/bindings-typescript/LICENSE.txt create mode 100644 crates/bindings-typescript/eslint.config.js create mode 100644 crates/bindings-typescript/package.json create mode 100644 crates/bindings-typescript/src/algebraic_type.ts create mode 100644 crates/bindings-typescript/src/algebraic_value.ts create mode 100644 crates/bindings-typescript/src/autogen/algebraic_type_type.ts create mode 100644 crates/bindings-typescript/src/autogen/algebraic_type_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/index_type_type.ts create mode 100644 crates/bindings-typescript/src/autogen/index_type_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/lifecycle_type.ts create mode 100644 crates/bindings-typescript/src/autogen/lifecycle_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/misc_module_export_type.ts create mode 100644 crates/bindings-typescript/src/autogen/misc_module_export_variants.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_column_default_value_v_9_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_data_v_9_variants.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_algorithm_variants.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_misc_module_export_v_9_variants.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_module_def_variants.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_access_variants.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/table_type_variants.ts create mode 100644 crates/bindings-typescript/src/autogen/type_alias_type.ts create mode 100644 crates/bindings-typescript/src/autogen/typespace_type.ts 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 (97%) 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/schedule_at.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 (91%) create mode 100644 crates/bindings-typescript/tsconfig.json create mode 100644 crates/codegen/examples/regen-typescript-moduledef.rs rename sdks/typescript/pnpm-lock.yaml => pnpm-lock.yaml (54%) create mode 100644 pnpm-workspace.yaml delete mode 100644 sdks/typescript/packages/sdk/src/algebraic_type.ts delete mode 100644 sdks/typescript/packages/sdk/src/algebraic_value.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 delete mode 100644 sdks/typescript/packages/sdk/src/schedule_at.ts create mode 100644 sdks/typescript/packages/sdk/tests/algebraic_type.test.ts delete mode 100644 sdks/typescript/packages/sdk/tests/algebraic_value.test.ts create mode 100644 sdks/typescript/packages/sdk/tsup.config.ts create mode 100644 sdks/typescript/packages/sdk/vitest.config.ts delete mode 100644 sdks/typescript/pnpm-workspace.yaml delete mode 100644 sdks/typescript/tsup.config.ts diff --git a/sdks/typescript/.prettierignore b/.prettierignore similarity index 81% rename from sdks/typescript/.prettierignore rename to .prettierignore index 3592bad75b..a544b13e5b 100644 --- a/sdks/typescript/.prettierignore +++ b/.prettierignore @@ -2,4 +2,4 @@ node_modules pnpm-lock.yaml dist target -/.github +.github diff --git a/sdks/typescript/.prettierrc b/.prettierrc similarity index 100% rename from sdks/typescript/.prettierrc rename to .prettierrc diff --git a/Cargo.lock b/Cargo.lock index 2d62de6b9d..705c0f9b24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -404,7 +404,7 @@ name = "benchmarks-module" version = "0.1.0" dependencies = [ "anyhow", - "spacetimedb", + "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", + "spacetimedb 1.4.0", ] [[package]] @@ -3281,7 +3281,7 @@ version = "0.0.0" dependencies = [ "anyhow", "log", - "spacetimedb", + "spacetimedb 1.4.0", ] [[package]] @@ -3764,7 +3764,7 @@ name = "perf-test-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb", + "spacetimedb 1.4.0", ] [[package]] @@ -4223,7 +4223,7 @@ name = "quickstart-chat-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb", + "spacetimedb 1.4.0", ] [[package]] @@ -4903,7 +4903,7 @@ dependencies = [ "anyhow", "log", "paste", - "spacetimedb", + "spacetimedb 1.4.0", ] [[package]] @@ -5264,12 +5264,30 @@ name = "spacetime-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb", + "spacetimedb 1.4.0", ] [[package]] name = "spacetimedb" -version = "1.3.2" +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]] +name = "spacetimedb" +version = "1.4.0" dependencies = [ "bytemuck", "derive_more", @@ -5278,28 +5296,28 @@ dependencies = [ "log", "rand 0.8.5", "scoped-tls", - "spacetimedb-bindings-macro", - "spacetimedb-bindings-sys", - "spacetimedb-lib", - "spacetimedb-primitives", + "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", + "spacetimedb-lib 1.4.0", ] [[package]] name = "spacetimedb-bench" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "anymap", @@ -5327,11 +5345,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-execution", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", - "spacetimedb-primitives", + "spacetimedb-primitives 1.4.0", "spacetimedb-query", - "spacetimedb-sats", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-standalone", "spacetimedb-table", @@ -5346,26 +5364,49 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-macro" -version = "1.3.2" +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", + "spacetimedb-primitives 1.3.0", + "syn 2.0.101", +] + +[[package]] +name = "spacetimedb-bindings-macro" +version = "1.4.0" +dependencies = [ + "heck 0.4.1", + "humantime", + "proc-macro2", + "quote", + "spacetimedb-primitives 1.4.0", "syn 2.0.101", ] [[package]] name = "spacetimedb-bindings-sys" -version = "1.3.2" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "969e77710b67e7db3e86bb4e195ba325f5f288efd1bfd6b1997ca9c389d22b04" dependencies = [ - "spacetimedb-primitives", + "spacetimedb-primitives 1.3.0", +] + +[[package]] +name = "spacetimedb-bindings-sys" +version = "1.4.0" +dependencies = [ + "spacetimedb-primitives 1.4.0", ] [[package]] name = "spacetimedb-cli" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "base64 0.21.7", @@ -5401,9 +5442,9 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", - "spacetimedb-primitives", + "spacetimedb-primitives 1.4.0", "spacetimedb-schema", "syntect", "tabled", @@ -5426,7 +5467,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "async-stream", @@ -5462,7 +5503,7 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-jsonwebtoken", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", "spacetimedb-schema", "tempfile", @@ -5479,7 +5520,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api-messages" -version = "1.3.2" +version = "1.4.0" dependencies = [ "bytes", "bytestring", @@ -5493,16 +5534,16 @@ dependencies = [ "serde_json", "serde_with", "smallvec", - "spacetimedb-lib", - "spacetimedb-primitives", - "spacetimedb-sats", + "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", @@ -5511,15 +5552,15 @@ dependencies = [ "itertools 0.12.1", "regex", "spacetimedb-data-structures", - "spacetimedb-lib", - "spacetimedb-primitives", + "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", @@ -5539,8 +5580,8 @@ dependencies = [ "spacetimedb-commitlog", "spacetimedb-fs-utils", "spacetimedb-paths", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "tempfile", "thiserror 1.0.69", "tokio", @@ -5551,7 +5592,7 @@ dependencies = [ [[package]] name = "spacetimedb-core" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "arrayvec", @@ -5628,14 +5669,14 @@ dependencies = [ "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", "spacetimedb-jwks", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-memory-usage", "spacetimedb-metrics", "spacetimedb-paths", "spacetimedb-physical-plan", - "spacetimedb-primitives", + "spacetimedb-primitives 1.4.0", "spacetimedb-query", - "spacetimedb-sats", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-subscription", @@ -5670,7 +5711,7 @@ dependencies = [ [[package]] name = "spacetimedb-data-structures" -version = "1.3.2" +version = "1.4.0" dependencies = [ "ahash 0.8.12", "crossbeam-queue", @@ -5684,7 +5725,7 @@ dependencies = [ [[package]] name = "spacetimedb-datastore" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "bytes", @@ -5704,11 +5745,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-durability", "spacetimedb-execution", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-metrics", "spacetimedb-paths", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-table", @@ -5719,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", + "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", + "spacetimedb-lib 1.4.0", "spacetimedb-physical-plan", - "spacetimedb-primitives", - "spacetimedb-sats", + "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", - "spacetimedb-lib", - "spacetimedb-primitives", - "spacetimedb-sats", + "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", @@ -5766,7 +5807,7 @@ dependencies = [ [[package]] name = "spacetimedb-fs-utils" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "hex", @@ -5808,7 +5849,27 @@ dependencies = [ [[package]] name = "spacetimedb-lib" -version = "1.3.2" +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.4.0" dependencies = [ "anyhow", "bitflags 2.9.0", @@ -5826,17 +5887,17 @@ dependencies = [ "ron", "serde", "serde_json", - "spacetimedb-bindings-macro", + "spacetimedb-bindings-macro 1.4.0", "spacetimedb-memory-usage", "spacetimedb-metrics", - "spacetimedb-primitives", - "spacetimedb-sats", + "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", @@ -5846,7 +5907,7 @@ dependencies = [ [[package]] name = "spacetimedb-metrics" -version = "1.3.2" +version = "1.4.0" dependencies = [ "arrayvec", "itertools 0.12.1", @@ -5856,7 +5917,7 @@ dependencies = [ [[package]] name = "spacetimedb-paths" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "chrono", @@ -5872,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", - "spacetimedb-primitives", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", "spacetimedb-schema", "spacetimedb-sql-parser", "spacetimedb-table", @@ -5888,7 +5949,19 @@ dependencies = [ [[package]] name = "spacetimedb-primitives" -version = "1.3.2" +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.4.0" dependencies = [ "bitflags 2.9.0", "either", @@ -5900,7 +5973,7 @@ dependencies = [ [[package]] name = "spacetimedb-query" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "itertools 0.12.1", @@ -5908,16 +5981,42 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-physical-plan", - "spacetimedb-primitives", + "spacetimedb-primitives 1.4.0", "spacetimedb-sql-parser", "spacetimedb-table", ] [[package]] name = "spacetimedb-sats" -version = "1.3.2" +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.4.0" dependencies = [ "ahash 0.8.12", "anyhow", @@ -5941,16 +6040,16 @@ dependencies = [ "serde", "sha3", "smallvec", - "spacetimedb-bindings-macro", + "spacetimedb-bindings-macro 1.4.0", "spacetimedb-memory-usage", "spacetimedb-metrics", - "spacetimedb-primitives", + "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", @@ -5967,9 +6066,9 @@ dependencies = [ "serial_test", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-sql-parser", "spacetimedb-testing", "termcolor", @@ -5980,7 +6079,7 @@ dependencies = [ [[package]] name = "spacetimedb-sdk" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anymap", "base64 0.21.7", @@ -5999,9 +6098,9 @@ dependencies = [ "rand 0.9.1", "spacetimedb-client-api-messages", "spacetimedb-data-structures", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-metrics", - "spacetimedb-sats", + "spacetimedb-sats 1.4.0", "spacetimedb-testing", "thiserror 1.0.69", "tokio", @@ -6010,7 +6109,7 @@ dependencies = [ [[package]] name = "spacetimedb-snapshot" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "blake3", @@ -6027,10 +6126,10 @@ dependencies = [ "spacetimedb-datastore", "spacetimedb-durability", "spacetimedb-fs-utils", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -6043,17 +6142,17 @@ dependencies = [ [[package]] name = "spacetimedb-sql-parser" -version = "1.3.2" +version = "1.4.0" dependencies = [ "derive_more", - "spacetimedb-lib", + "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", @@ -6077,7 +6176,7 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", "spacetimedb-table", "tempfile", @@ -6092,20 +6191,20 @@ dependencies = [ [[package]] name = "spacetimedb-subscription" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-physical-plan", - "spacetimedb-primitives", + "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", @@ -6121,17 +6220,17 @@ dependencies = [ "rand 0.9.1", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-memory-usage", - "spacetimedb-primitives", - "spacetimedb-sats", + "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", @@ -6147,7 +6246,7 @@ dependencies = [ "spacetimedb-client-api", "spacetimedb-core", "spacetimedb-data-structures", - "spacetimedb-lib", + "spacetimedb-lib 1.4.0", "spacetimedb-paths", "spacetimedb-schema", "spacetimedb-standalone", @@ -6158,7 +6257,7 @@ dependencies = [ [[package]] name = "spacetimedb-update" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "bytes", @@ -6183,7 +6282,7 @@ dependencies = [ [[package]] name = "spacetimedb-vm" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "arrayvec", @@ -6193,9 +6292,9 @@ dependencies = [ "smallvec", "spacetimedb-data-structures", "spacetimedb-execution", - "spacetimedb-lib", - "spacetimedb-primitives", - "spacetimedb-sats", + "spacetimedb-lib 1.4.0", + "spacetimedb-primitives 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -6274,7 +6373,7 @@ dependencies = [ [[package]] name = "sqltest" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "async-trait", @@ -6293,8 +6392,8 @@ dependencies = [ "rust_decimal", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib", - "spacetimedb-sats", + "spacetimedb-lib 1.4.0", + "spacetimedb-sats 1.4.0", "spacetimedb-vm", "sqllogictest", "sqllogictest-engines", @@ -6612,7 +6711,7 @@ dependencies = [ [[package]] name = "test-client" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "env_logger 0.10.2", @@ -6624,7 +6723,7 @@ dependencies = [ [[package]] name = "test-counter" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "spacetimedb-data-structures", @@ -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 9c9e061605..e6cbb963f0 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 @@ -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 1d9fdced3b..a95276a044 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/bindings-typescript/LICENSE.txt b/crates/bindings-typescript/LICENSE.txt new file mode 120000 index 0000000000..8540cf8a99 --- /dev/null +++ b/crates/bindings-typescript/LICENSE.txt @@ -0,0 +1 @@ +../../licenses/BSL.txt \ No newline at end of file diff --git a/crates/bindings-typescript/eslint.config.js b/crates/bindings-typescript/eslint.config.js new file mode 100644 index 0000000000..f330f33e73 --- /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 new file mode 100644 index 0000000000..5d938ac822 --- /dev/null +++ b/crates/bindings-typescript/package.json @@ -0,0 +1,62 @@ +{ + "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", + "development": "./src/index.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + } + }, + "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": { + "build": "tsc", + "compile": "pnpm run build", + "format": "prettier --write .", + "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 new file mode 100644 index 0000000000..2e6fcc9d05 --- /dev/null +++ b/crates/bindings-typescript/src/algebraic_type.ts @@ -0,0 +1,482 @@ +import { TimeDuration } from './time_duration'; +import { Timestamp } from './timestamp'; +import { ConnectionId } from './connection_id'; +import type BinaryReader from './binary_reader'; +import BinaryWriter from './binary_writer'; +import { Identity } from './identity'; +import { + AlgebraicType as AlgebraicTypeType, + AlgebraicType as AlgebraicTypeValue, +} from './autogen/algebraic_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'; + +/** + * 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'; + +/** + * The variant types of the Algebraic Type tagged union. + */ +export type * as AlgebraicTypeVariants from './autogen/algebraic_type_variants'; + +/** + * 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; + +/** + * 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}`); + } + }, + 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}`); + } + }, + /** + * 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(); + } + } + }, +}; + +/** + * 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; + +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 === '__timestamp_micros_since_unix_epoch__') { + return new Timestamp(reader.readI64()); + } + + if (ty.elements[0].name === '__identity__') { + return new Identity(reader.readU256()); + } + + if (ty.elements[0].name === '__connection_id__') { + return new ConnectionId(reader.readU128()); + } + } + + for (const element of ty.elements) { + result[element.name!] = AlgebraicType.deserializeValue( + reader, + element.algebraicType + ); + } + 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__; + } + + if (ty.elements[0].name === '__timestamp_micros_since_unix_epoch__') { + return (value as Timestamp).__timestamp_micros_since_unix_epoch__; + } + + if (ty.elements[0].name === '__identity__') { + return (value as Identity).__identity__; + } + + 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(); + }, +}; + +/** + * 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 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 ComparablePrimitive = number | string | boolean | bigint; diff --git a/crates/bindings-typescript/src/algebraic_value.ts b/crates/bindings-typescript/src/algebraic_value.ts new file mode 100644 index 0000000000..558f48a2a0 --- /dev/null +++ b/crates/bindings-typescript/src/algebraic_value.ts @@ -0,0 +1,10 @@ +import BinaryReader from './binary_reader'; + +export interface ParseableType { + deserialize: (reader: BinaryReader) => T; +} + +export function parseValue(ty: ParseableType, src: Uint8Array): T { + const reader = new BinaryReader(src); + return ty.deserialize(reader); +} 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 0000000000..feab7f22b4 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts @@ -0,0 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as AlgebraicTypeVariants from './algebraic_type_variants'; + +// 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); + // ``` + 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, + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { name: 'Ref', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'Sum', algebraicType: SumType.getTypeScriptAlgebraicType() }, + { + name: 'Product', + algebraicType: ProductType.getTypeScriptAlgebraicType(), + }, + { + name: 'Array', + algebraicType: AlgebraicType.getTypeScriptAlgebraicType(), + }, + { + name: 'String', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'Bool', + 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: 'I128', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'U128', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'I256', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'U256', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'F32', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'F64', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: AlgebraicType): void { + __AlgebraicTypeValue.serializeValue( + writer, + AlgebraicType.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): AlgebraicType { + return __AlgebraicTypeValue.deserializeValue( + reader, + AlgebraicType.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..df1992c048 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { 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: 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' }; +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 new file mode 100644 index 0000000000..ff61a7cc6a --- /dev/null +++ b/crates/bindings-typescript/src/autogen/index_type_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as IndexTypeVariants from './index_type_variants'; + +// 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); + // ``` + BTree: { tag: 'BTree' } as const, + Hash: { tag: 'Hash' } as const, + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'BTree', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'Hash', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: IndexType): void { + __AlgebraicTypeValue.serializeValue( + writer, + IndexType.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): IndexType { + return __AlgebraicTypeValue.deserializeValue( + reader, + IndexType.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..30e120ae9a --- /dev/null +++ b/crates/bindings-typescript/src/autogen/index_type_variants.ts @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 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 new file mode 100644 index 0000000000..950f5d110d --- /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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as LifecycleVariants from './lifecycle_variants'; + +// 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); + // ``` + Init: { tag: 'Init' } as const, + OnConnect: { tag: 'OnConnect' } as const, + OnDisconnect: { tag: 'OnDisconnect' } as const, + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'Init', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'OnConnect', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'OnDisconnect', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: Lifecycle): void { + __AlgebraicTypeValue.serializeValue( + writer, + Lifecycle.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): Lifecycle { + return __AlgebraicTypeValue.deserializeValue( + reader, + Lifecycle.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..f08120a97e --- /dev/null +++ b/crates/bindings-typescript/src/autogen/lifecycle_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 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 new file mode 100644 index 0000000000..a904ba7fd5 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/misc_module_export_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as MiscModuleExportVariants from './misc_module_export_variants'; + +// 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); + // ``` + TypeAlias: (value: TypeAlias): MiscModuleExport => ({ + tag: 'TypeAlias', + value, + }), + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'TypeAlias', + algebraicType: TypeAlias.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: MiscModuleExport): void { + __AlgebraicTypeValue.serializeValue( + writer, + MiscModuleExport.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): MiscModuleExport { + return __AlgebraicTypeValue.deserializeValue( + reader, + MiscModuleExport.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..5bca056d4d --- /dev/null +++ b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 as TypeAliasType } from './type_alias_type'; + +export type TypeAlias = { tag: 'TypeAlias'; value: TypeAliasType }; 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 0000000000..bf8ed63332 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/product_type_element_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { AlgebraicType } from './algebraic_type_type'; + +export type ProductTypeElement = { + name: string | undefined; + algebraicType: AlgebraicType; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'name', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { + name: 'algebraicType', + algebraicType: AlgebraicType.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: ProductTypeElement): void { + __AlgebraicTypeValue.serializeValue( + writer, + ProductTypeElement.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): ProductTypeElement { + return __AlgebraicTypeValue.deserializeValue( + reader, + ProductTypeElement.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..a19be70fe4 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/product_type_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { ProductTypeElement } from './product_type_element_type'; + +export type ProductType = { + elements: ProductTypeElement[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'elements', + algebraicType: __AlgebraicTypeValue.Array( + ProductTypeElement.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: ProductType): void { + __AlgebraicTypeValue.serializeValue( + writer, + ProductType.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): ProductType { + return __AlgebraicTypeValue.deserializeValue( + reader, + ProductType.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..da026b6e18 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_column_def_v_8_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { AlgebraicType } from './algebraic_type_type'; + +export type RawColumnDefV8 = { + colName: string; + colType: AlgebraicType; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'colName', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'colType', + algebraicType: AlgebraicType.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawColumnDefV8): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawColumnDefV8.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawColumnDefV8 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawColumnDefV8.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..1287d2d766 --- /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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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; +}; +/** + * An object 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() + ); + }, +}; + +export default RawColumnDefaultValueV9; 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 0000000000..d5df3e0e10 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as RawConstraintDataV9Variants from './raw_constraint_data_v_9_variants'; + +// 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); + // ``` + Unique: (value: RawUniqueConstraintDataV9): RawConstraintDataV9 => ({ + tag: 'Unique', + value, + }), + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'Unique', + algebraicType: RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawConstraintDataV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawConstraintDataV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawConstraintDataV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawConstraintDataV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..d71210f564 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_constraint_data_v_9_variants.ts @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 as RawUniqueConstraintDataV9Type } from './raw_unique_constraint_data_v_9_type'; + +export type Unique = { tag: 'Unique'; value: RawUniqueConstraintDataV9Type }; 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 0000000000..58bf26292b --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_constraint_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawConstraintDefV8 = { + constraintName: string; + constraints: number; + columns: number[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'constraintName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'constraints', algebraicType: __AlgebraicTypeValue.U8 }, + { + name: 'columns', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawConstraintDefV8): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawConstraintDefV8.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawConstraintDefV8 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawConstraintDefV8.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..a2ef77c6cb --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_constraint_def_v_9_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { RawConstraintDataV9 } from './raw_constraint_data_v_9_type'; + +export type RawConstraintDefV9 = { + name: string | undefined; + data: RawConstraintDataV9; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'name', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { + name: 'data', + algebraicType: RawConstraintDataV9.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawConstraintDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawConstraintDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawConstraintDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawConstraintDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +export default RawConstraintDefV9; 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 0000000000..c839cbb70f --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as RawIndexAlgorithmVariants from './raw_index_algorithm_variants'; + +// 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); + // ``` + BTree: (value: number[]): RawIndexAlgorithm => ({ tag: 'BTree', value }), + Hash: (value: number[]): RawIndexAlgorithm => ({ tag: 'Hash', value }), + Direct: (value: number): RawIndexAlgorithm => ({ tag: 'Direct', value }), + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'BTree', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), + }, + { + name: 'Hash', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), + }, + { name: 'Direct', algebraicType: __AlgebraicTypeValue.U16 }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawIndexAlgorithm): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawIndexAlgorithm.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawIndexAlgorithm { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawIndexAlgorithm.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..3319c94afa --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 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 new file mode 100644 index 0000000000..722d25763a --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_8_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawIndexDefV8 = { + indexName: string; + isUnique: boolean; + indexType: IndexType; + columns: number[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'indexName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'isUnique', algebraicType: __AlgebraicTypeValue.Bool }, + { + name: 'indexType', + algebraicType: IndexType.getTypeScriptAlgebraicType(), + }, + { + name: 'columns', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawIndexDefV8): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawIndexDefV8.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawIndexDefV8 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawIndexDefV8.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..8e025d9f99 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_index_def_v_9_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawIndexDefV9 = { + name: string | undefined; + accessorName: string | undefined; + algorithm: RawIndexAlgorithm; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'name', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { + name: 'accessorName', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { + name: 'algorithm', + algebraicType: RawIndexAlgorithm.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawIndexDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawIndexDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawIndexDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawIndexDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +export default RawIndexDefV9; 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 0000000000..ad225023ba --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * 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 }), + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'ColumnDefaultValue', + algebraicType: RawColumnDefaultValueV9.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawMiscModuleExportV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawMiscModuleExportV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawMiscModuleExportV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawMiscModuleExportV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..3e15b9f03e --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_misc_module_export_v_9_variants.ts @@ -0,0 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 as RawColumnDefaultValueV9Type } from './raw_column_default_value_v_9_type'; + +export type ColumnDefaultValue = { + tag: 'ColumnDefaultValue'; + value: RawColumnDefaultValueV9Type; +}; 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 0000000000..2d49ba95a0 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_module_def_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as RawModuleDefVariants from './raw_module_def_variants'; + +// 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); + // ``` + V8BackCompat: (value: RawModuleDefV8): RawModuleDef => ({ + tag: 'V8BackCompat', + value, + }), + V9: (value: RawModuleDefV9): RawModuleDef => ({ tag: 'V9', value }), + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'V8BackCompat', + algebraicType: RawModuleDefV8.getTypeScriptAlgebraicType(), + }, + { + name: 'V9', + algebraicType: RawModuleDefV9.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawModuleDef): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawModuleDef.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawModuleDef { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawModuleDef.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..47c4c3e93c --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_8_type.ts @@ -0,0 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { 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[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'typespace', + algebraicType: Typespace.getTypeScriptAlgebraicType(), + }, + { + name: 'tables', + algebraicType: __AlgebraicTypeValue.Array( + TableDesc.getTypeScriptAlgebraicType() + ), + }, + { + name: 'reducers', + algebraicType: __AlgebraicTypeValue.Array( + ReducerDef.getTypeScriptAlgebraicType() + ), + }, + { + name: 'miscExports', + algebraicType: __AlgebraicTypeValue.Array( + MiscModuleExport.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawModuleDefV8): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawModuleDefV8.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawModuleDefV8 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawModuleDefV8.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..ce498ca27f --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_module_def_v_9_type.ts @@ -0,0 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { 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[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'typespace', + algebraicType: Typespace.getTypeScriptAlgebraicType(), + }, + { + name: 'tables', + algebraicType: __AlgebraicTypeValue.Array( + RawTableDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'reducers', + algebraicType: __AlgebraicTypeValue.Array( + RawReducerDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'types', + algebraicType: __AlgebraicTypeValue.Array( + RawTypeDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'miscExports', + algebraicType: __AlgebraicTypeValue.Array( + RawMiscModuleExportV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'rowLevelSecurity', + algebraicType: __AlgebraicTypeValue.Array( + RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawModuleDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawModuleDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawModuleDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawModuleDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +export default RawModuleDefV9; 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 0000000000..017e8abb3f --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_module_def_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 as RawModuleDefV8Type } from './raw_module_def_v_8_type'; +import { RawModuleDefV9 as RawModuleDefV9Type } from './raw_module_def_v_9_type'; + +export type V8BackCompat = { tag: 'V8BackCompat'; value: RawModuleDefV8Type }; +export type V9 = { tag: 'V9'; value: RawModuleDefV9Type }; 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 0000000000..58f662325a --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_reducer_def_v_9_type.ts @@ -0,0 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { ProductType } from './product_type_type'; +import { Lifecycle } from './lifecycle_type'; + +export type RawReducerDefV9 = { + name: string; + params: ProductType; + lifecycle: Lifecycle | undefined; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'params', + algebraicType: ProductType.getTypeScriptAlgebraicType(), + }, + { + name: 'lifecycle', + algebraicType: __AlgebraicTypeValue.createOptionType( + Lifecycle.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawReducerDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawReducerDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawReducerDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawReducerDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..61ddf168f0 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_row_level_security_def_v_9_type.ts @@ -0,0 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawRowLevelSecurityDefV9 = { + sql: string; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [{ name: 'sql', algebraicType: __AlgebraicTypeValue.String }], + }); + }, + + serialize(writer: __BinaryWriter, value: RawRowLevelSecurityDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawRowLevelSecurityDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawRowLevelSecurityDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..6ae9374b3a --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_schedule_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawScheduleDefV9 = { + name: string | undefined; + reducerName: string; + scheduledAtColumn: number; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'name', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { name: 'reducerName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'scheduledAtColumn', algebraicType: __AlgebraicTypeValue.U16 }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawScheduleDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawScheduleDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawScheduleDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawScheduleDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..1973b4beac --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_scoped_type_name_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawScopedTypeNameV9 = { + scope: string[]; + name: string; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'scope', + algebraicType: __AlgebraicTypeValue.Array( + __AlgebraicTypeValue.String + ), + }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawScopedTypeNameV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawScopedTypeNameV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawScopedTypeNameV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawScopedTypeNameV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..d6ce72bfe7 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_8_type.ts @@ -0,0 +1,94 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawSequenceDefV8 = { + sequenceName: string; + colPos: number; + increment: bigint; + start: bigint | undefined; + minValue: bigint | undefined; + maxValue: bigint | undefined; + allocated: bigint; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'sequenceName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'colPos', algebraicType: __AlgebraicTypeValue.U16 }, + { name: 'increment', algebraicType: __AlgebraicTypeValue.I128 }, + { + name: 'start', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), + }, + { + name: 'minValue', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), + }, + { + name: 'maxValue', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), + }, + { name: 'allocated', algebraicType: __AlgebraicTypeValue.I128 }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawSequenceDefV8): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawSequenceDefV8.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawSequenceDefV8 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawSequenceDefV8.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..acc62576c0 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_sequence_def_v_9_type.ts @@ -0,0 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawSequenceDefV9 = { + name: string | undefined; + column: number; + start: bigint | undefined; + minValue: bigint | undefined; + maxValue: bigint | undefined; + increment: bigint; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'name', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { name: 'column', algebraicType: __AlgebraicTypeValue.U16 }, + { + name: 'start', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), + }, + { + name: 'minValue', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), + }, + { + name: 'maxValue', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.I128 + ), + }, + { name: 'increment', algebraicType: __AlgebraicTypeValue.I128 }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawSequenceDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawSequenceDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawSequenceDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawSequenceDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..e107796688 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_8_type.ts @@ -0,0 +1,110 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { 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[]; + tableType: string; + tableAccess: string; + scheduled: string | undefined; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'tableName', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'columns', + algebraicType: __AlgebraicTypeValue.Array( + RawColumnDefV8.getTypeScriptAlgebraicType() + ), + }, + { + name: 'indexes', + algebraicType: __AlgebraicTypeValue.Array( + RawIndexDefV8.getTypeScriptAlgebraicType() + ), + }, + { + name: 'constraints', + algebraicType: __AlgebraicTypeValue.Array( + RawConstraintDefV8.getTypeScriptAlgebraicType() + ), + }, + { + name: 'sequences', + algebraicType: __AlgebraicTypeValue.Array( + RawSequenceDefV8.getTypeScriptAlgebraicType() + ), + }, + { name: 'tableType', algebraicType: __AlgebraicTypeValue.String }, + { name: 'tableAccess', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'scheduled', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawTableDefV8): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawTableDefV8.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawTableDefV8 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawTableDefV8.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..34da2e5f65 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_table_def_v_9_type.ts @@ -0,0 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { 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; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'productTypeRef', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'primaryKey', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), + }, + { + name: 'indexes', + algebraicType: __AlgebraicTypeValue.Array( + RawIndexDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'constraints', + algebraicType: __AlgebraicTypeValue.Array( + RawConstraintDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'sequences', + algebraicType: __AlgebraicTypeValue.Array( + RawSequenceDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'schedule', + algebraicType: __AlgebraicTypeValue.createOptionType( + RawScheduleDefV9.getTypeScriptAlgebraicType() + ), + }, + { + name: 'tableType', + algebraicType: TableType.getTypeScriptAlgebraicType(), + }, + { + name: 'tableAccess', + algebraicType: TableAccess.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawTableDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawTableDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawTableDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawTableDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..84cd101c66 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_type_def_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { RawScopedTypeNameV9 } from './raw_scoped_type_name_v_9_type'; + +export type RawTypeDefV9 = { + name: RawScopedTypeNameV9; + ty: number; + customOrdering: boolean; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'name', + algebraicType: RawScopedTypeNameV9.getTypeScriptAlgebraicType(), + }, + { name: 'ty', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'customOrdering', algebraicType: __AlgebraicTypeValue.Bool }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawTypeDefV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawTypeDefV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawTypeDefV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawTypeDefV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..8a505a021b --- /dev/null +++ b/crates/bindings-typescript/src/autogen/raw_unique_constraint_data_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 RawUniqueConstraintDataV9 = { + columns: number[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'columns', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: RawUniqueConstraintDataV9): void { + __AlgebraicTypeValue.serializeValue( + writer, + RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): RawUniqueConstraintDataV9 { + return __AlgebraicTypeValue.deserializeValue( + reader, + RawUniqueConstraintDataV9.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..e5b814cec0 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/reducer_def_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { ProductTypeElement } from './product_type_element_type'; + +export type ReducerDef = { + name: string; + args: ProductTypeElement[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'args', + algebraicType: __AlgebraicTypeValue.Array( + ProductTypeElement.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: ReducerDef): void { + __AlgebraicTypeValue.serializeValue( + writer, + ReducerDef.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): ReducerDef { + return __AlgebraicTypeValue.deserializeValue( + reader, + ReducerDef.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..d0b4b0d7d7 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/sum_type_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { SumTypeVariant } from './sum_type_variant_type'; + +export type SumType = { + variants: SumTypeVariant[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'variants', + algebraicType: __AlgebraicTypeValue.Array( + SumTypeVariant.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: SumType): void { + __AlgebraicTypeValue.serializeValue( + writer, + SumType.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): SumType { + return __AlgebraicTypeValue.deserializeValue( + reader, + SumType.getTypeScriptAlgebraicType() + ); + }, +}; + +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 new file mode 100644 index 0000000000..9b32920922 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { AlgebraicType } from './algebraic_type_type'; + +export type SumTypeVariant = { + name: string | undefined; + algebraicType: AlgebraicType; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'name', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { + name: 'algebraicType', + algebraicType: AlgebraicType.getTypeScriptAlgebraicType(), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: SumTypeVariant): void { + __AlgebraicTypeValue.serializeValue( + writer, + SumTypeVariant.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): SumTypeVariant { + return __AlgebraicTypeValue.deserializeValue( + reader, + SumTypeVariant.getTypeScriptAlgebraicType() + ); + }, +}; + +export default SumTypeVariant; 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 0000000000..1046355d4b --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_access_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as TableAccessVariants from './table_access_variants'; + +// 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); + // ``` + Public: { tag: 'Public' } as const, + Private: { tag: 'Private' } as const, + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'Public', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'Private', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: TableAccess): void { + __AlgebraicTypeValue.serializeValue( + writer, + TableAccess.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): TableAccess { + return __AlgebraicTypeValue.deserializeValue( + reader, + TableAccess.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..f1e870b26d --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_access_variants.ts @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 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 new file mode 100644 index 0000000000..3f5ffdfb4c --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_desc_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { RawTableDefV8 } from './raw_table_def_v_8_type'; + +export type TableDesc = { + schema: RawTableDefV8; + data: number; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'schema', + algebraicType: RawTableDefV8.getTypeScriptAlgebraicType(), + }, + { name: 'data', algebraicType: __AlgebraicTypeValue.U32 }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: TableDesc): void { + __AlgebraicTypeValue.serializeValue( + writer, + TableDesc.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): TableDesc { + return __AlgebraicTypeValue.deserializeValue( + reader, + TableDesc.getTypeScriptAlgebraicType() + ); + }, +}; + +export default TableDesc; 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 0000000000..521e5482d1 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_type_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 * as TableTypeVariants from './table_type_variants'; + +// 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); + // ``` + System: { tag: 'System' } as const, + User: { tag: 'User' } as const, + + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'System', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + { + name: 'User', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: TableType): void { + __AlgebraicTypeValue.serializeValue( + writer, + TableType.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): TableType { + return __AlgebraicTypeValue.deserializeValue( + reader, + TableType.getTypeScriptAlgebraicType() + ); + }, +}; + +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 0000000000..4452eeb364 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/table_type_variants.ts @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 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 new file mode 100644 index 0000000000..3979a8ca78 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -0,0 +1,69 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 TypeAlias = { + name: string; + ty: number; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'ty', algebraicType: __AlgebraicTypeValue.U32 }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: TypeAlias): void { + __AlgebraicTypeValue.serializeValue( + writer, + TypeAlias.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): TypeAlias { + return __AlgebraicTypeValue.deserializeValue( + reader, + TypeAlias.getTypeScriptAlgebraicType() + ); + }, +}; + +export default TypeAlias; 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 0000000000..940777acc8 --- /dev/null +++ b/crates/bindings-typescript/src/autogen/typespace_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 { AlgebraicType } from './algebraic_type_type'; + +export type Typespace = { + types: AlgebraicType[]; +}; +/** + * An object for generated helper functions. + */ +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. + */ + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'types', + algebraicType: __AlgebraicTypeValue.Array( + AlgebraicType.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, + + serialize(writer: __BinaryWriter, value: Typespace): void { + __AlgebraicTypeValue.serializeValue( + writer, + Typespace.getTypeScriptAlgebraicType(), + value + ); + }, + + deserialize(reader: __BinaryReader): Typespace { + return __AlgebraicTypeValue.deserializeValue( + reader, + Typespace.getTypeScriptAlgebraicType() + ); + }, +}; + +export default Typespace; 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 97% rename from sdks/typescript/packages/sdk/src/connection_id.ts rename to crates/bindings-typescript/src/connection_id.ts index c8d95016c1..9428069e79 100644 --- a/sdks/typescript/packages/sdk/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/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 9ce25dccbd..41df6bbced 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 0000000000..8f22f4c304 --- /dev/null +++ b/crates/bindings-typescript/src/index.ts @@ -0,0 +1,10 @@ +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/schedule_at.ts b/crates/bindings-typescript/src/schedule_at.ts new file mode 100644 index 0000000000..be1d8962e4 --- /dev/null +++ b/crates/bindings-typescript/src/schedule_at.ts @@ -0,0 +1,37 @@ +import { AlgebraicType } from './algebraic_type'; + +export const ScheduleAt: { + getAlgebraicType(): AlgebraicType; +} = { + getAlgebraicType(): AlgebraicType { + return AlgebraicType.Sum({ + variants: [ + { + name: 'Interval', + algebraicType: AlgebraicType.createTimeDurationType(), + }, + { 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 ScheduleAt = Interval | Time; +export default ScheduleAt; 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 91% rename from sdks/typescript/packages/sdk/src/utils.ts rename to crates/bindings-typescript/src/utils.ts index 4ab3b4609a..b29c3d05c6 100644 --- a/sdks/typescript/packages/sdk/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 new file mode 100644 index 0000000000..1c25ed3d79 --- /dev/null +++ b/crates/bindings-typescript/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + + "strict": true, + "declaration": true, + "emitDeclarationOnly": false, + "noEmit": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "allowImportingTsExtensions": true, + "noImplicitAny": true, + "moduleResolution": "Bundler", + "isolatedDeclarations": 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 cce0d353dd..6e60cd00c2 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/cli/src/subcommands/project/rust/Cargo._toml b/crates/cli/src/subcommands/project/rust/Cargo._toml index d27d186c9e..360377c7fb 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/crates/client-api-messages/DEVELOP.md b/crates/client-api-messages/DEVELOP.md index 554fe37f65..cc568be474 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-csharp-moduledef.rs b/crates/codegen/examples/regen-csharp-moduledef.rs index 11510d4e26..74db4b9de9 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 new file mode 100644 index 0000000000..fcf098bcda --- /dev/null +++ b/crates/codegen/examples/regen-typescript-moduledef.rs @@ -0,0 +1,47 @@ +//! 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, OutputFile}; +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(|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"); + fs::write(dir.join(filename), code.as_bytes()) + })?; + + Ok(()) +} diff --git a/crates/codegen/src/csharp.rs b/crates/codegen/src/csharp.rs index 884600b2d8..0bae17a05f 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() - } - - fn generate_type(&self, module: &ModuleDef, typ: &TypeDef) -> String { - 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), + OutputFile { + filename: format!("Tables/{}.g.cs", table.name.deref().to_case(Case::Pascal)), + code: output.into_inner(), } } - fn generate_reducer(&self, module: &ModuleDef, reducer: &spacetimedb_schema::def::ReducerDef) -> String { + fn generate_type_files(&self, module: &ModuleDef, typ: &TypeDef) -> Vec { + let name = collect_case(Case::Pascal, typ.name.name_segments()); + 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_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 d595af6023..25ba367d84 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; - - 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 struct OutputFile { + pub filename: String, + pub code: 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 853f924d3f..3fae8de736 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 ce074dcf26..be2706c024 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,72 @@ 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 type_filename(&self, type_name: &ScopedTypeName) -> String { - type_module_name(type_name) + ".ts" - } - - fn reducer_filename(&self, reducer_name: &Identifier) -> String { - reducer_module_name(reducer_name) + ".ts" - } - - 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 + 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); - let out = &mut output; + let define_type_for_product = |product: &ProductTypeDef| { + let mut output = CodeIndenter::new(String::new(), INDENT); + let out = &mut output; - print_file_header(out); + print_file_header(out); + 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(); + OutputFile { + filename: type_module_name(&typ.name) + ".ts", + code: output.into_inner(), + } + }; + + let define_variants_for_sum = |variants: &[(Identifier, AlgebraicTypeUse)]| { + let mut output = CodeIndenter::new(String::new(), INDENT); + let out = &mut output; + + print_file_header(out); + // 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(); + OutputFile { + filename: variants_module_name(&typ.name) + ".ts", + code: output.into_inner(), + } + }; + + 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], None); + 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 +100,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"); @@ -102,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!( @@ -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; @@ -257,16 +290,20 @@ 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); - 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 +369,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 __AlgebraicTypeVariants.Product).value.elements[{}].algebraicType,", pk.col_pos.0 ); out.dedent(1); @@ -373,16 +410,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 +457,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 +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(); @@ -462,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 += ", "; } @@ -486,7 +526,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 +575,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 +591,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 +618,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 +663,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 +721,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, @@ -709,40 +747,45 @@ fn define_namespace_and_object_type_for_product( writeln!(out, "}};"); } - out.newline(); - writeln!( out, "/** - * A namespace for generated helper functions. + * An object 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, "serialize(writer: __BinaryWriter, value: {name}): void {{"); + out.indent(1); writeln!( out, - "export function serialize(writer: BinaryWriter, value: {name}): void {{" + "__AlgebraicTypeValue.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value);" ); - out.indent(1); - writeln!(out, "{name}.getTypeScriptAlgebraicType().serialize(writer, 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 {name}.getTypeScriptAlgebraicType().deserialize(reader);"); + writeln!( + out, + "return __AlgebraicTypeValue.deserializeValue(reader, {name}.getTypeScriptAlgebraicType());" + ); out.dedent(1); - writeln!(out, "}}"); + writeln!(out, "}},"); writeln!(out); out.dedent(1); writeln!(out, "}}"); out.newline(); + + writeln!(out, "export default {name};"); + + out.newline(); } fn write_arglist_no_delimiters( @@ -764,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, ",")?; } @@ -785,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, " }};"); @@ -828,16 +871,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" }; + // Foo: { tag: "Foo" } = { tag: "Foo" } as const, // ``` - write!(out, "export const {ident} = "); - writeln!(out, "{{ 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, None, None).unwrap(); + writeln!(out, "): {name} => ({{ tag: \"{variant_name}\", value }}),"); } } @@ -846,35 +889,43 @@ 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, name: &str, variants: &[(Identifier, AlgebraicTypeUse)], ) { - writeln!(out, "// A namespace for generated variants and helper functions."); - writeln!(out, "export namespace {name} {{"); - out.indent(1); + writeln!(out, "// The tagged union or sum type for the algebraic type `{name}`."); + write!(out, "export type {name} = "); - // 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." - ); - write_variant_types(module, out, variants); - writeln!(out); + 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(); + + // 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. writeln!( @@ -895,17 +946,17 @@ fn define_namespace_and_types_for_sum( writeln!( out, - "export function serialize(writer: BinaryWriter, value: {name}): void {{ - {name}.getTypeScriptAlgebraicType().serialize(writer, value); -}}" + "serialize(writer: __BinaryWriter, value: {name}): void {{ + __AlgebraicTypeValue.serializeValue(writer, {name}.getTypeScriptAlgebraicType(), value); +}}," ); writeln!(out); writeln!( out, - "export function deserialize(reader: BinaryReader): {name} {{ - return {name}.getTypeScriptAlgebraicType().deserialize(reader); -}}" + "deserialize(reader: __BinaryReader): {name} {{ + return __AlgebraicTypeValue.deserializeValue(reader, {name}.getTypeScriptAlgebraicType()); +}}," ); writeln!(out); @@ -914,19 +965,9 @@ fn define_namespace_and_types_for_sum( writeln!(out, "}}"); out.newline(); - 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}.{}", ident.deref().to_case(Case::Pascal))) - .collect::>() - .join(" | "); - - writeln!(out, "{names};"); - out.newline(); - writeln!(out, "export default {name};"); + + out.newline(); } fn type_ref_module_name(module: &ModuleDef, type_ref: AlgebraicTypeRef) -> String { @@ -938,6 +979,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" } @@ -964,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 } @@ -996,20 +1041,21 @@ 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")?, 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)?; + write_type(module, out, inner_ty, ref_prefix, ref_suffix)?; write!(out, " | undefined")?; } AlgebraicTypeUse::Primitive(prim) => match prim { @@ -1039,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, ")")?; } @@ -1050,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(()) @@ -1062,18 +1111,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.createArrayType("); + write!(out, "__AlgebraicTypeValue.Array("); convert_algebraic_type(module, out, ty, ref_prefix); write!(out, ")"); } @@ -1083,11 +1132,11 @@ fn convert_algebraic_type<'a>( type_ref_name(module, *r) ), AlgebraicTypeUse::Primitive(prim) => { - write!(out, "AlgebraicType.create{prim:?}Type()"); + write!(out, "__AlgebraicTypeValue.{prim:?}"); } - AlgebraicTypeUse::Unit => write!(out, "AlgebraicType.createProductType([])"), + AlgebraicTypeUse::Unit => write!(out, "__AlgebraicTypeValue.Product({{ elements: [] }})"), AlgebraicTypeUse::Never => unimplemented!(), - AlgebraicTypeUse::String => write!(out, "AlgebraicType.createStringType()"), + AlgebraicTypeUse::String => write!(out, "__AlgebraicTypeValue.String"), } } @@ -1097,15 +1146,19 @@ fn convert_sum_type<'a>( variants: &'a [(Identifier, AlgebraicTypeUse)], ref_prefix: &'a str, ) { - writeln!(out, "AlgebraicType.createSumType(["); + writeln!(out, "__AlgebraicTypeValue.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,30 +1167,38 @@ fn convert_product_type<'a>( elements: &'a [(Identifier, AlgebraicTypeUse)], ref_prefix: &'a str, ) { - writeln!(out, "AlgebraicType.createProductType(["); + writeln!(out, "__AlgebraicTypeValue.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`. -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} as __{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}\";"); + } } } @@ -1151,6 +1212,7 @@ fn gen_and_print_imports( out: &mut Indenter, roots: &[(Identifier, AlgebraicTypeUse)], dont_import: &[AlgebraicTypeRef], + suffix: Option<&str>, ) { let mut imports = BTreeSet::new(); @@ -1164,7 +1226,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/crates/codegen/tests/codegen.rs b/crates/codegen/tests/codegen.rs index 27b08d0c6f..f9912ca44c 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.code)) + .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/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index 43caad9b21..d064c60121 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -12,60 +12,59 @@ 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 = { name: string, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: AddPlayer): void { - AddPlayer.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: AddPlayer): void { + __AlgebraicTypeValue.serializeValue(writer, AddPlayer.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): AddPlayer { - return AddPlayer.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): AddPlayer { + return __AlgebraicTypeValue.deserializeValue(reader, AddPlayer.getTypeScriptAlgebraicType()); + }, } +export default AddPlayer; + ''' "add_private_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -77,60 +76,59 @@ 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 = { name: string, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: AddPrivate): void { - AddPrivate.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: AddPrivate): void { + __AlgebraicTypeValue.serializeValue(writer, AddPrivate.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): AddPrivate { - return AddPrivate.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): AddPrivate { + return __AlgebraicTypeValue.deserializeValue(reader, AddPrivate.getTypeScriptAlgebraicType()); + }, } +export default AddPrivate; + ''' "add_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -142,62 +140,61 @@ 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 = { name: string, age: number, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - new ProductTypeElement("age", AlgebraicType.createU8Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + { name: "age", algebraicType: __AlgebraicTypeValue.U8}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: Add): void { - Add.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Add): void { + __AlgebraicTypeValue.serializeValue(writer, Add.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Add { - return Add.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): Add { + return __AlgebraicTypeValue.deserializeValue(reader, Add.getTypeScriptAlgebraicType()); + }, } +export default Add; + ''' "assert_caller_identity_is_module_identity_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -209,57 +206,56 @@ 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 = {}; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + ] + }); + }, - export function serialize(writer: BinaryWriter, value: AssertCallerIdentityIsModuleIdentity): void { - AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: AssertCallerIdentityIsModuleIdentity): void { + __AlgebraicTypeValue.serializeValue(writer, AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): AssertCallerIdentityIsModuleIdentity { - return AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): AssertCallerIdentityIsModuleIdentity { + return __AlgebraicTypeValue.deserializeValue(reader, AssertCallerIdentityIsModuleIdentity.getTypeScriptAlgebraicType()); + }, } +export default AssertCallerIdentityIsModuleIdentity; + ''' "baz_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -271,59 +267,59 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("field", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "field", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: Baz): void { - Baz.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Baz): void { + __AlgebraicTypeValue.serializeValue(writer, Baz.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Baz { - return Baz.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): Baz { + return __AlgebraicTypeValue.deserializeValue(reader, Baz.getTypeScriptAlgebraicType()); + }, } +export default Baz; + ''' "client_connected_reducer.ts" = ''' @@ -336,57 +332,56 @@ 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 = {}; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + ] + }); + }, - export function serialize(writer: BinaryWriter, value: ClientConnected): void { - ClientConnected.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: ClientConnected): void { + __AlgebraicTypeValue.serializeValue(writer, ClientConnected.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): ClientConnected { - return ClientConnected.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): ClientConnected { + return __AlgebraicTypeValue.deserializeValue(reader, ClientConnected.getTypeScriptAlgebraicType()); + }, } +export default ClientConnected; + ''' "delete_player_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -398,60 +393,59 @@ 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 = { id: bigint, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("id", AlgebraicType.createU64Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "id", algebraicType: __AlgebraicTypeValue.U64}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: DeletePlayer): void { - DeletePlayer.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: DeletePlayer): void { + __AlgebraicTypeValue.serializeValue(writer, DeletePlayer.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): DeletePlayer { - return DeletePlayer.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): DeletePlayer { + return __AlgebraicTypeValue.deserializeValue(reader, DeletePlayer.getTypeScriptAlgebraicType()); + }, } +export default DeletePlayer; + ''' "delete_players_by_name_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -463,60 +457,59 @@ 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 = { name: string, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: DeletePlayersByName): void { - DeletePlayersByName.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: DeletePlayersByName): void { + __AlgebraicTypeValue.serializeValue(writer, DeletePlayersByName.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): DeletePlayersByName { - return DeletePlayersByName.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): DeletePlayersByName { + return __AlgebraicTypeValue.deserializeValue(reader, DeletePlayersByName.getTypeScriptAlgebraicType()); + }, } +export default DeletePlayersByName; + ''' "foobar_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -528,75 +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"; +import { 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. - export type Baz = { tag: "Baz", value: __Baz }; - export type Bar = { tag: "Bar" }; - export type Har = { tag: "Har", value: number }; +import * as FoobarVariants from './foobar_variants' +// 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" }; - 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.createSumType([ - new SumTypeVariant("Baz", __Baz.getTypeScriptAlgebraicType()), - new SumTypeVariant("Bar", AlgebraicType.createProductType([])), - new SumTypeVariant("Har", AlgebraicType.createU32Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { name: "Baz", algebraicType: Baz.getTypeScriptAlgebraicType() }, + { name: "Bar", algebraicType: __AlgebraicTypeValue.Product({ elements: [] }) }, + { name: "Har", algebraicType: __AlgebraicTypeValue.U32 }, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: Foobar): void { - Foobar.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Foobar): void { + __AlgebraicTypeValue.serializeValue(writer, Foobar.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Foobar { - return Foobar.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): Foobar { + return __AlgebraicTypeValue.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 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 as BazType } from "./baz_type"; + + +export type Baz = { tag: "Baz", value: BazType }; +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 @@ -608,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 "."; @@ -647,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; } @@ -688,61 +712,61 @@ 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, -}; +export type HasSpecialStuff = { + identity: __Identity, + connectionId: __ConnectionId, +}; /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("identity", AlgebraicType.createIdentityType()), - new ProductTypeElement("connectionId", AlgebraicType.createConnectionIdType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "identity", algebraicType: __AlgebraicTypeValue.createIdentityType()}, + { name: "connectionId", algebraicType: __AlgebraicTypeValue.createConnectionIdType()}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: HasSpecialStuff): void { - HasSpecialStuff.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: HasSpecialStuff): void { + __AlgebraicTypeValue.serializeValue(writer, HasSpecialStuff.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): HasSpecialStuff { - return HasSpecialStuff.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): HasSpecialStuff { + return __AlgebraicTypeValue.deserializeValue(reader, HasSpecialStuff.getTypeScriptAlgebraicType()); + }, } +export default HasSpecialStuff; + ''' "index.ts" = ''' @@ -755,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 @@ -883,7 +903,7 @@ const REMOTE_MODULE = { primaryKey: "identity", primaryKeyInfo: { colName: "identity", - colType: Player.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (Player.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, person: { @@ -892,7 +912,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: Person.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (Person.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, pk_multi_identity: { @@ -901,7 +921,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: PkMultiIdentity.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (PkMultiIdentity.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, player: { @@ -910,7 +930,7 @@ const REMOTE_MODULE = { primaryKey: "identity", primaryKeyInfo: { colName: "identity", - colType: Player.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (Player.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, points: { @@ -927,7 +947,7 @@ const REMOTE_MODULE = { primaryKey: "scheduledId", primaryKeyInfo: { colName: "scheduledId", - colType: RepeatingTestArg.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (RepeatingTestArg.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, test_a: { @@ -944,7 +964,7 @@ const REMOTE_MODULE = { primaryKey: "id", primaryKeyInfo: { colName: "id", - colType: TestE.getTypeScriptAlgebraicType().product.elements[0].algebraicType, + colType: (TestE.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, test_f: { @@ -1020,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: () => { @@ -1056,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); @@ -1076,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); @@ -1092,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); @@ -1128,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); @@ -1144,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); @@ -1160,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); @@ -1200,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); @@ -1228,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); @@ -1257,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)); @@ -1376,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 @@ -1402,60 +1422,59 @@ 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 = { age: number, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("age", AlgebraicType.createU8Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "age", algebraicType: __AlgebraicTypeValue.U8}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: ListOverAge): void { - ListOverAge.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: ListOverAge): void { + __AlgebraicTypeValue.serializeValue(writer, ListOverAge.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): ListOverAge { - return ListOverAge.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): ListOverAge { + return __AlgebraicTypeValue.deserializeValue(reader, ListOverAge.getTypeScriptAlgebraicType()); + }, } +export default ListOverAge; + ''' "log_module_identity_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1467,57 +1486,56 @@ 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 = {}; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + ] + }); + }, - export function serialize(writer: BinaryWriter, value: LogModuleIdentity): void { - LogModuleIdentity.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: LogModuleIdentity): void { + __AlgebraicTypeValue.serializeValue(writer, LogModuleIdentity.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): LogModuleIdentity { - return LogModuleIdentity.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): LogModuleIdentity { + return __AlgebraicTypeValue.deserializeValue(reader, LogModuleIdentity.getTypeScriptAlgebraicType()); + }, } +export default LogModuleIdentity; + ''' "logged_out_player_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1529,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 "."; @@ -1568,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; } @@ -1595,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; } } @@ -1619,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; } } @@ -1641,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; } } @@ -1683,70 +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"; -// 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. - export type Foo = { tag: "Foo" }; - export type Bar = { tag: "Bar" }; +import * as NamespaceTestCVariants from './namespace_test_c_variants' +// 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" }; - export const Bar = { tag: "Bar" }; + Foo: { tag: "Foo" } as const, + Bar: { tag: "Bar" } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant("Foo", AlgebraicType.createProductType([])), - new SumTypeVariant("Bar", AlgebraicType.createProductType([])), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { name: "Foo", algebraicType: __AlgebraicTypeValue.Product({ elements: [] }) }, + { name: "Bar", algebraicType: __AlgebraicTypeValue.Product({ elements: [] }) }, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: NamespaceTestC): void { - NamespaceTestC.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: NamespaceTestC): void { + __AlgebraicTypeValue.serializeValue(writer, NamespaceTestC.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): NamespaceTestC { - return NamespaceTestC.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): NamespaceTestC { + return __AlgebraicTypeValue.deserializeValue(reader, NamespaceTestC.getTypeScriptAlgebraicType()); + }, } -// The tagged union or sum type for the algebraic type `NamespaceTestC`. -export type NamespaceTestC = NamespaceTestC.Foo | NamespaceTestC.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"; + +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 @@ -1758,73 +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"; -// 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. - 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 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" }; - export const 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.createSumType([ - new SumTypeVariant("Foo", AlgebraicType.createProductType([])), - new SumTypeVariant("Bar", AlgebraicType.createProductType([])), - new SumTypeVariant("Baz", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { 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 { - NamespaceTestF.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: NamespaceTestF): void { + __AlgebraicTypeValue.serializeValue(writer, NamespaceTestF.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): NamespaceTestF { - return NamespaceTestF.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): NamespaceTestF { + return __AlgebraicTypeValue.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 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"; + +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 @@ -1836,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 "."; @@ -1875,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; } @@ -1904,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; } } @@ -1946,63 +2021,63 @@ 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, age: number, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("id", AlgebraicType.createU32Type()), - new ProductTypeElement("name", AlgebraicType.createStringType()), - new ProductTypeElement("age", AlgebraicType.createU8Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "id", algebraicType: __AlgebraicTypeValue.U32}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + { name: "age", algebraicType: __AlgebraicTypeValue.U8}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: Person): void { - Person.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Person): void { + __AlgebraicTypeValue.serializeValue(writer, Person.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Person { - return Person.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): Person { + return __AlgebraicTypeValue.deserializeValue(reader, Person.getTypeScriptAlgebraicType()); + }, } +export default Person; + ''' "pk_multi_identity_table.ts" = ''' @@ -2015,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 "."; @@ -2054,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; } @@ -2083,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; } } @@ -2105,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; } } @@ -2147,61 +2218,61 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("id", AlgebraicType.createU32Type()), - new ProductTypeElement("other", AlgebraicType.createU32Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "id", algebraicType: __AlgebraicTypeValue.U32}, + { name: "other", algebraicType: __AlgebraicTypeValue.U32}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: PkMultiIdentity): void { - PkMultiIdentity.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: PkMultiIdentity): void { + __AlgebraicTypeValue.serializeValue(writer, PkMultiIdentity.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): PkMultiIdentity { - return PkMultiIdentity.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): PkMultiIdentity { + return __AlgebraicTypeValue.deserializeValue(reader, PkMultiIdentity.getTypeScriptAlgebraicType()); + }, } +export default PkMultiIdentity; + ''' "player_table.ts" = ''' @@ -2214,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 "."; @@ -2253,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; } @@ -2280,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; } } @@ -2304,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; } } @@ -2326,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; } } @@ -2368,63 +2435,63 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("identity", AlgebraicType.createIdentityType()), - new ProductTypeElement("playerId", AlgebraicType.createU64Type()), - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "identity", algebraicType: __AlgebraicTypeValue.createIdentityType()}, + { name: "playerId", algebraicType: __AlgebraicTypeValue.U64}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: Player): void { - Player.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Player): void { + __AlgebraicTypeValue.serializeValue(writer, Player.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Player { - return Player.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): Player { + return __AlgebraicTypeValue.deserializeValue(reader, Player.getTypeScriptAlgebraicType()); + }, } +export default Player; + ''' "point_type.ts" = ''' @@ -2437,61 +2504,61 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("x", AlgebraicType.createI64Type()), - new ProductTypeElement("y", AlgebraicType.createI64Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "x", algebraicType: __AlgebraicTypeValue.I64}, + { name: "y", algebraicType: __AlgebraicTypeValue.I64}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: Point): void { - Point.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Point): void { + __AlgebraicTypeValue.serializeValue(writer, Point.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Point { - return Point.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): Point { + return __AlgebraicTypeValue.deserializeValue(reader, Point.getTypeScriptAlgebraicType()); + }, } +export default Point; + ''' "points_table.ts" = ''' @@ -2504,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 "."; @@ -2543,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; } @@ -2584,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 "."; @@ -2623,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; } @@ -2664,59 +2723,59 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: PrivateTable): void { - PrivateTable.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: PrivateTable): void { + __AlgebraicTypeValue.serializeValue(writer, PrivateTable.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): PrivateTable { - return PrivateTable.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): PrivateTable { + return __AlgebraicTypeValue.deserializeValue(reader, PrivateTable.getTypeScriptAlgebraicType()); + }, } +export default PrivateTable; + ''' "query_private_reducer.ts" = ''' @@ -2729,57 +2788,56 @@ 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 = {}; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + ] + }); + }, - export function serialize(writer: BinaryWriter, value: QueryPrivate): void { - QueryPrivate.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: QueryPrivate): void { + __AlgebraicTypeValue.serializeValue(writer, QueryPrivate.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): QueryPrivate { - return QueryPrivate.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): QueryPrivate { + return __AlgebraicTypeValue.deserializeValue(reader, QueryPrivate.getTypeScriptAlgebraicType()); + }, } +export default QueryPrivate; + ''' "repeating_test_arg_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -2791,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 "."; @@ -2830,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; } @@ -2859,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; } } @@ -2901,63 +2955,63 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("scheduledId", AlgebraicType.createU64Type()), - new ProductTypeElement("scheduledAt", AlgebraicType.createScheduleAtType()), - new ProductTypeElement("prevTime", AlgebraicType.createTimestampType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "scheduledId", algebraicType: __AlgebraicTypeValue.U64}, + { name: "scheduledAt", algebraicType: __AlgebraicTypeValue.createScheduleAtType()}, + { name: "prevTime", algebraicType: __AlgebraicTypeValue.createTimestampType()}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: RepeatingTestArg): void { - RepeatingTestArg.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: RepeatingTestArg): void { + __AlgebraicTypeValue.serializeValue(writer, RepeatingTestArg.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): RepeatingTestArg { - return RepeatingTestArg.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): RepeatingTestArg { + return __AlgebraicTypeValue.deserializeValue(reader, RepeatingTestArg.getTypeScriptAlgebraicType()); + }, } +export default RepeatingTestArg; + ''' "repeating_test_reducer.ts" = ''' @@ -2970,62 +3024,61 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("arg", __RepeatingTestArg.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "arg", algebraicType: RepeatingTestArg.getTypeScriptAlgebraicType()}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: RepeatingTest): void { - RepeatingTest.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: RepeatingTest): void { + __AlgebraicTypeValue.serializeValue(writer, RepeatingTest.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): RepeatingTest { - return RepeatingTest.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): RepeatingTest { + return __AlgebraicTypeValue.deserializeValue(reader, RepeatingTest.getTypeScriptAlgebraicType()); + }, } +export default RepeatingTest; + ''' "say_hello_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -3037,57 +3090,56 @@ 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 = {}; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + ] + }); + }, - export function serialize(writer: BinaryWriter, value: SayHello): void { - SayHello.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: SayHello): void { + __AlgebraicTypeValue.serializeValue(writer, SayHello.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): SayHello { - return SayHello.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): SayHello { + return __AlgebraicTypeValue.deserializeValue(reader, SayHello.getTypeScriptAlgebraicType()); + }, } +export default SayHello; + ''' "test_a_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -3099,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 "."; @@ -3138,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; } @@ -3179,63 +3227,63 @@ 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, z: string, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("x", AlgebraicType.createU32Type()), - new ProductTypeElement("y", AlgebraicType.createU32Type()), - new ProductTypeElement("z", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "x", algebraicType: __AlgebraicTypeValue.U32}, + { name: "y", algebraicType: __AlgebraicTypeValue.U32}, + { name: "z", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: TestA): void { - TestA.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: TestA): void { + __AlgebraicTypeValue.serializeValue(writer, TestA.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestA { - return TestA.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): TestA { + return __AlgebraicTypeValue.deserializeValue(reader, TestA.getTypeScriptAlgebraicType()); + }, } +export default TestA; + ''' "test_b_type.ts" = ''' @@ -3248,59 +3296,59 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("foo", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "foo", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: TestB): void { - TestB.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: TestB): void { + __AlgebraicTypeValue.serializeValue(writer, TestB.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestB { - return TestB.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): TestB { + return __AlgebraicTypeValue.deserializeValue(reader, TestB.getTypeScriptAlgebraicType()); + }, } +export default TestB; + ''' "test_btree_index_args_reducer.ts" = ''' @@ -3313,57 +3361,56 @@ 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 = {}; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + ] + }); + }, - export function serialize(writer: BinaryWriter, value: TestBtreeIndexArgs): void { - TestBtreeIndexArgs.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: TestBtreeIndexArgs): void { + __AlgebraicTypeValue.serializeValue(writer, TestBtreeIndexArgs.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestBtreeIndexArgs { - return TestBtreeIndexArgs.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): TestBtreeIndexArgs { + return __AlgebraicTypeValue.deserializeValue(reader, TestBtreeIndexArgs.getTypeScriptAlgebraicType()); + }, } +export default TestBtreeIndexArgs; + ''' "test_d_table.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -3375,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 "."; @@ -3416,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; } @@ -3457,61 +3500,61 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("testC", AlgebraicType.createOptionType(__NamespaceTestC.getTypeScriptAlgebraicType())), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "testC", algebraicType: __AlgebraicTypeValue.createOptionType(NamespaceTestC.getTypeScriptAlgebraicType())}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: TestD): void { - TestD.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: TestD): void { + __AlgebraicTypeValue.serializeValue(writer, TestD.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestD { - return TestD.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): TestD { + return __AlgebraicTypeValue.deserializeValue(reader, TestD.getTypeScriptAlgebraicType()); + }, } +export default TestD; + ''' "test_e_table.ts" = ''' @@ -3524,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 "."; @@ -3563,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; } @@ -3592,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; } } @@ -3634,61 +3673,61 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("id", AlgebraicType.createU64Type()), - new ProductTypeElement("name", AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "id", algebraicType: __AlgebraicTypeValue.U64}, + { name: "name", algebraicType: __AlgebraicTypeValue.String}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: TestE): void { - TestE.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: TestE): void { + __AlgebraicTypeValue.serializeValue(writer, TestE.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestE { - return TestE.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): TestE { + return __AlgebraicTypeValue.deserializeValue(reader, TestE.getTypeScriptAlgebraicType()); + }, } +export default TestE; + ''' "test_f_table.ts" = ''' @@ -3701,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 "."; @@ -3742,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; } @@ -3783,61 +3818,61 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("field", __Foobar.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: "field", algebraicType: Foobar.getTypeScriptAlgebraicType()}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: TestFoobar): void { - TestFoobar.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: TestFoobar): void { + __AlgebraicTypeValue.serializeValue(writer, TestFoobar.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): TestFoobar { - return TestFoobar.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): TestFoobar { + return __AlgebraicTypeValue.deserializeValue(reader, TestFoobar.getTypeScriptAlgebraicType()); + }, } +export default TestFoobar; + ''' "test_reducer.ts" = ''' @@ -3850,69 +3885,68 @@ 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, }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement("arg", __TestA.getTypeScriptAlgebraicType()), - new ProductTypeElement("arg2", __TestB.getTypeScriptAlgebraicType()), - new ProductTypeElement("arg3", __NamespaceTestC.getTypeScriptAlgebraicType()), - new ProductTypeElement("arg4", __NamespaceTestF.getTypeScriptAlgebraicType()), - ]); - } + 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()}, + ] + }); + }, - export function serialize(writer: BinaryWriter, value: Test): void { - Test.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Test): void { + __AlgebraicTypeValue.serializeValue(writer, Test.getTypeScriptAlgebraicType(), value); + }, - export function deserialize(reader: BinaryReader): Test { - return Test.getTypeScriptAlgebraicType().deserialize(reader); - } + deserialize(reader: __BinaryReader): Test { + return __AlgebraicTypeValue.deserializeValue(reader, Test.getTypeScriptAlgebraicType()); + }, } +export default Test; + ''' diff --git a/licenses/BSL.txt b/licenses/BSL.txt index ca1f88fefd..125fcf25a1 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 diff --git a/sdks/typescript/pnpm-lock.yaml b/pnpm-lock.yaml similarity index 54% rename from sdks/typescript/pnpm-lock.yaml rename to pnpm-lock.yaml index 3b8919b815..63dfa2a141 100644 --- a/sdks/typescript/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,37 +6,80 @@ 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 + 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.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + 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: 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 +93,60 @@ importers: 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)) + 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.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 + prettier: + specifier: ^3.3.3 + version: 3.6.2 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) + 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) - 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 - '@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) - - packages/sdk: + sdks/typescript/packages/sdk: dependencies: '@zxing/text-encoding': specifier: ^0.9.0 @@ -176,18 +154,27 @@ 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 + prettier: + specifier: ^3.3.3 + version: 3.6.2 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.9.2) undici: specifier: ^6.19.2 - version: 6.19.8 + 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) - packages/test-app: + sdks/typescript/packages/test-app: dependencies: '@clockworklabs/spacetimedb-sdk': specifier: workspace:* @@ -201,296 +188,210 @@ 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==} + '@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-module-transforms@7.26.0': - resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-plugin-utils@7.25.7': - resolution: {integrity: sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==} + '@babel/helper-plugin-utils@7.27.1': + resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.26.5': - resolution: {integrity: sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==} + '@babel/helper-string-parser@7.27.1': + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} - '@babel/helper-simple-access@7.25.7': - resolution: {integrity: sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==} + '@babel/helper-validator-identifier@7.27.1': + resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.25.7': - resolution: {integrity: sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==} + '@babel/helper-validator-option@7.27.1': + resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.25.9': - resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} + '@babel/helpers@7.28.3': + resolution: {integrity: sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==} 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==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-option@7.25.9': - resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==} - engines: {node: '>=6.9.0'} - - '@babel/helpers@7.25.7': - resolution: {integrity: sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==} - engines: {node: '>=6.9.0'} - - '@babel/helpers@7.26.0': - resolution: {integrity: sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==} - engines: {node: '>=6.9.0'} - - '@babel/highlight@7.25.7': - resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==} - 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'} + '@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.27.1': + resolution: {integrity: sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/runtime@7.28.3': + resolution: {integrity: sha512-9uIQ10o0WGdpP6GDhXcdOJPJuDgFtIDtN/9+ArJQ2NAfAmiuhTQdzkaTGR33v43GYS2UrSA0eX2pPPHoFVvpxA==} + engines: {node: '>=6.9.0'} + + '@babel/template@7.27.2': + resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.28.3': + resolution: {integrity: sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.28.2': + resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==} + engines: {node: '>=6.9.0'} + + '@changesets/apply-release-plan@7.0.12': + resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==} + + '@changesets/assemble-release-plan@6.0.9': + resolution: {integrity: sha512-tPgeeqCHIwNo8sypKlS3gOPmsS3wP0zHt67JDuL20P4QcXiw/O4Hl7oXiuLnP9yg+rXLQ2sScdV1Kkzde61iSQ==} + + '@changesets/changelog-git@0.2.1': + resolution: {integrity: sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==} + + '@changesets/changelog-github@0.5.1': + resolution: {integrity: sha512-BVuHtF+hrhUScSoHnJwTELB4/INQxVFc+P/Qdt20BLiBFIHFJDDUaGsZw+8fQeJTRP5hJZrzpt3oZWh0G19rAQ==} + + '@changesets/cli@2.29.6': + resolution: {integrity: sha512-6qCcVsIG1KQLhpQ5zE8N0PckIx4+9QlHK3z6/lwKnw7Tir71Bjw8BeOZaxA/4Jt00pcgCnCSWZnyuZf5Il05QQ==} 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==} - 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==} - 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==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/runtime@7.25.7': - resolution: {integrity: sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==} - engines: {node: '>=6.9.0'} - - '@babel/template@7.25.7': - resolution: {integrity: sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==} - engines: {node: '>=6.9.0'} - - '@babel/template@7.25.9': - resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} - engines: {node: '>=6.9.0'} - - '@babel/traverse@7.25.7': - resolution: {integrity: sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==} - engines: {node: '>=6.9.0'} - - '@babel/traverse@7.26.5': - resolution: {integrity: sha512-rkOSPOw+AXbgtwUga3U4u8RpoK9FEFWBNAlTpcnkLFjL5CT+oyHNuUUC/xx6XefEJ16r38r8Bc/lfp6rYuHeJQ==} - engines: {node: '>=6.9.0'} - - '@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/apply-release-plan@7.0.5': - resolution: {integrity: sha512-1cWCk+ZshEkSVEZrm2fSj1Gz8sYvxgUL4Q78+1ZZqeqfuevPTPk033/yUZ3df8BKMohkqqHfzj0HOOrG0KtXTw==} - - '@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==} - 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/types@6.1.0': + resolution: {integrity: sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==} - '@changesets/write@0.3.2': - resolution: {integrity: sha512-kDxDrPNpUgsjDbWBvUo27PzKX4gqeKOlhibaOXDJA6kuBisGqNHv/HwGJrAu8U/dSf8ZEFIeHIPtvSlZI1kULw==} - - '@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 +400,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 +412,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 +424,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 +436,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 +448,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 +460,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 +472,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 +484,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 +496,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 +508,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 +520,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 +532,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 +544,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 +556,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 +568,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 +580,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 +592,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 +610,14 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.23.1': - resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + '@esbuild/netbsd-x64@0.25.9': + resolution: {integrity: sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.24.2': - resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} - 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 +628,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 +646,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 +658,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 +670,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 +682,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 +698,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/core@0.10.0': - resolution: {integrity: sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==} + '@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/eslintrc@3.2.0': - resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} + '@eslint/core@0.15.2': + resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==} 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/eslintrc@3.3.1': + resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} 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/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/plugin-kit@0.2.5': - resolution: {integrity: sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==} + '@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.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 +742,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,26 +771,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.11': + resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} - '@jridgewell/source-map@0.3.6': - resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - '@jridgewell/sourcemap-codec@1.5.0': - resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} - - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@jridgewell/trace-mapping@0.3.30': + resolution: {integrity: sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==} '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} @@ -1041,99 +812,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-s390x-gnu@4.24.0': - resolution: {integrity: sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==} + '@rollup/rollup-linux-riscv64-musl@4.46.3': + resolution: {integrity: sha512-7tnUcDvN8DHm/9ra+/nF7lLzYHDeODKKKrh6JmZejbh1FnCNZS8zMkZY5J4sEipy2OW1d1Ncc4gNHUd0DLqkSg==} + cpu: [riscv64] + os: [linux] + + '@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 @@ -1171,17 +965,23 @@ packages: '@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/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==} '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} @@ -1201,25 +1001,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/node@24.3.0': + resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==} - '@types/prop-types@15.7.13': - resolution: {integrity: sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==} + '@types/prop-types@15.7.15': + resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} - '@types/react-dom@18.3.0': - resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==} - - '@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 +1024,87 @@ 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/scope-manager@8.21.0': - resolution: {integrity: sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==} + '@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/type-utils@8.21.0': - resolution: {integrity: sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ==} + '@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.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.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.3.4': - resolution: {integrity: sha512-SCCPBJtYLdE8PX/7ZQAs1QAZ8Jqwih+0VBLum1EGqmCCQal+MIUqLCzj3ZUy8ufbC0cAM4LRlSTm7IQJwWT4ug==} + '@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 || ^6.0.0 + vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 - '@vitest/expect@2.1.2': - resolution: {integrity: sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==} + '@vitest/expect@2.1.9': + resolution: {integrity: sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==} - '@vitest/mocker@2.1.2': - resolution: {integrity: sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==} + '@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: - '@vitest/spy': 2.1.2 - msw: ^2.3.5 + msw: ^2.4.9 vite: ^5.0.0 peerDependenciesMeta: msw: @@ -1304,20 +1112,46 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.2': - resolution: {integrity: sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==} + '@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/runner@2.1.2': - resolution: {integrity: sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==} + '@vitest/pretty-format@2.1.9': + resolution: {integrity: sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==} - '@vitest/snapshot@2.1.2': - resolution: {integrity: sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==} + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} - '@vitest/spy@2.1.2': - resolution: {integrity: sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==} + '@vitest/runner@2.1.9': + resolution: {integrity: sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==} - '@vitest/utils@2.1.2': - resolution: {integrity: sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==} + '@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==} @@ -1331,18 +1165,13 @@ packages: 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 +1185,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,10 +1204,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==} @@ -1407,9 +1228,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 +1238,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.12: + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - 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 +1257,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 +1279,39 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - caniuse-lite@1.0.30001667: - resolution: {integrity: sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==} + caniuse-lite@1.0.30001735: + resolution: {integrity: sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w==} - 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'} - - 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,8 +1322,11 @@ 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: @@ -1536,13 +1335,6 @@ packages: 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 +1342,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 +1356,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 +1365,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 +1375,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'} @@ -1623,8 +1411,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 +1424,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 +1445,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 +1453,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 +1486,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 +1514,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 +1525,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 +1538,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 +1566,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 +1597,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 +1612,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 +1630,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 +1646,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 +1658,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 +1674,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 +1693,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'} @@ -1979,6 +1734,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 @@ -1987,8 +1745,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 +1754,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 +1783,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 +1811,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,15 +1828,12 @@ packages: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true - magic-string@0.30.11: - resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} + magic-string@0.30.17: + resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -2093,18 +1842,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 +1857,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 +1870,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 +1887,20 @@ packages: encoding: optional: true - node-releases@2.0.18: - resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} + node-releases@2.0.19: + resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - - 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 +1935,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 +1964,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 +1978,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 +2011,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 +2024,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 +2041,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==} @@ -2348,6 +2066,10 @@ packages: 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'} + react@18.3.1: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} @@ -2356,17 +2078,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 +2097,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 +2130,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 +2146,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'} @@ -2460,9 +2168,10 @@ 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@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 +2183,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 +2206,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'} @@ -2509,15 +2214,14 @@ 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'} 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 +2233,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,46 +2248,46 @@ 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: 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'} - tldts-core@6.1.75: - resolution: {integrity: sha512-AOvV5YYIAFFBfransBzSTyztkc3IMfz5Eq3YluaRiEu55nn43Fzaufx70UqEKYr8BoLCach4q8g/bg6e5+/aFw==} + tinyspy@4.0.3: + resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + engines: {node: '>=14.0.0'} - tldts@6.1.75: - resolution: {integrity: sha512-+lFzEXhpl7JXgWYaXcB6DqTYXbUArvrWAE/5ioq/X3CdWLbDjpPP4XTrQBmEJ91y3xbe4Fkw7Lxv4P3GWeJaNg==} + tldts-core@6.1.86: + resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} + + 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 +2296,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' @@ -2623,8 +2327,8 @@ packages: '@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 +2346,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 +2355,39 @@ 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==} + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} engines: {node: '>=14.17'} hasBin: true - undici-types@6.21.0: - resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + ufo@1.6.1: + resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} - undici@6.19.8: - resolution: {integrity: sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==} + undici-types@7.10.0: + resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} + + 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' @@ -2691,13 +2398,18 @@ packages: 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-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} hasBin: true peerDependencies: @@ -2727,8 +2439,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 +2479,55 @@ packages: yaml: optional: true - vitest@2.1.2: - resolution: {integrity: sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==} + 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} 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: @@ -2792,6 +2544,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'} @@ -2814,8 +2594,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 +2604,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 +2626,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 @@ -2869,9 +2645,6 @@ packages: 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==} @@ -2885,266 +2658,142 @@ packages: snapshots: - '@adobe/css-tools@4.4.1': {} + '@adobe/css-tools@4.4.4': {} '@ampproject/remapping@2.3.0': 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 - '@asamuzakjp/css-color@2.8.3': + '@asamuzakjp/css-color@3.2.0': 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 + '@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/code-frame@7.25.7': + '@babel/code-frame@7.27.1': dependencies: - '@babel/highlight': 7.25.7 - picocolors: 1.1.0 - - '@babel/code-frame@7.26.2': - dependencies: - '@babel/helper-validator-identifier': 7.25.9 + '@babel/helper-validator-identifier': 7.27.1 js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/compat-data@7.25.7': {} + '@babel/compat-data@7.28.0': {} - '@babel/compat-data@7.26.5': {} - - '@babel/core@7.25.7': + '@babel/core@7.28.3': 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 + '@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.3.7 + debug: 4.4.1 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/core@7.26.0': + '@babel/generator@7.28.3': 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/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/generator@7.25.7': + '@babel/helper-compilation-targets@7.27.2': 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 + '@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/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-globals@7.28.0': {} - '@babel/helper-module-imports@7.25.7': + '@babel/helper-module-imports@7.27.1': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 + '@babel/traverse': 7.28.3 + '@babel/types': 7.28.2 transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.25.9': + '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.3)': dependencies: - '@babel/traverse': 7.26.5 - '@babel/types': 7.26.5 + '@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-module-transforms@7.25.7(@babel/core@7.25.7)': + '@babel/helper-plugin-utils@7.27.1': {} + + '@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.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 + '@babel/template': 7.27.2 + '@babel/types': 7.28.2 + + '@babel/parser@7.28.3': + dependencies: + '@babel/types': 7.28.2 + + '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.28.3)': + dependencies: + '@babel/core': 7.28.3 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.28.3)': + dependencies: + '@babel/core': 7.28.3 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/runtime@7.28.3': {} + + '@babel/template@7.27.2': + dependencies: + '@babel/code-frame': 7.27.1 + '@babel/parser': 7.28.3 + '@babel/types': 7.28.2 + + '@babel/traverse@7.28.3': + dependencies: + '@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/helper-module-transforms@7.26.0(@babel/core@7.26.0)': + '@babel/types@7.28.2': 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-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 - '@babel/helper-plugin-utils@7.25.7': {} - - '@babel/helper-plugin-utils@7.26.5': {} - - '@babel/helper-simple-access@7.25.7': + '@changesets/apply-release-plan@7.0.12': dependencies: - '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-string-parser@7.25.7': {} - - '@babel/helper-string-parser@7.25.9': {} - - '@babel/helper-validator-identifier@7.25.7': {} - - '@babel/helper-validator-identifier@7.25.9': {} - - '@babel/helper-validator-option@7.25.7': {} - - '@babel/helper-validator-option@7.25.9': {} - - '@babel/helpers@7.25.7': - dependencies: - '@babel/template': 7.25.7 - '@babel/types': 7.25.7 - - '@babel/helpers@7.26.0': - dependencies: - '@babel/template': 7.25.9 - '@babel/types': 7.26.5 - - '@babel/highlight@7.25.7': - dependencies: - '@babel/helper-validator-identifier': 7.25.7 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.1.0 - - '@babel/parser@7.25.7': - dependencies: - '@babel/types': 7.25.7 - - '@babel/parser@7.26.5': - dependencies: - '@babel/types': 7.26.5 - - '@babel/plugin-transform-react-jsx-self@7.25.7(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-react-jsx-self@7.25.9(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.26.5 - - '@babel/plugin-transform-react-jsx-source@7.25.7(@babel/core@7.25.7)': - dependencies: - '@babel/core': 7.25.7 - '@babel/helper-plugin-utils': 7.25.7 - - '@babel/plugin-transform-react-jsx-source@7.25.9(@babel/core@7.26.0)': - dependencies: - '@babel/core': 7.26.0 - '@babel/helper-plugin-utils': 7.26.5 - - '@babel/runtime@7.25.7': - dependencies: - regenerator-runtime: 0.14.1 - - '@babel/template@7.25.7': - dependencies: - '@babel/code-frame': 7.25.7 - '@babel/parser': 7.25.7 - '@babel/types': 7.25.7 - - '@babel/template@7.25.9': - dependencies: - '@babel/code-frame': 7.26.2 - '@babel/parser': 7.26.5 - '@babel/types': 7.26.5 - - '@babel/traverse@7.25.7': - 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/traverse@7.26.5': - 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 - 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': - dependencies: - '@babel/helper-string-parser': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 - - '@changesets/apply-release-plan@7.0.5': - 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 +2801,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 +2871,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 +2885,280 @@ 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': + '@esbuild/netbsd-x64@0.25.9': optional: true - '@esbuild/netbsd-x64@0.24.2': - 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 +3172,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 +3203,44 @@ 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/sourcemap-codec': 1.5.5 '@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,95 +3257,108 @@ 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.24.0': + '@rollup/rollup-android-arm64@4.46.3': optional: true - '@rollup/rollup-darwin-arm64@4.24.0': + '@rollup/rollup-darwin-arm64@4.46.3': optional: true - '@rollup/rollup-darwin-x64@4.24.0': + '@rollup/rollup-darwin-x64@4.46.3': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.24.0': + '@rollup/rollup-freebsd-arm64@4.46.3': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.24.0': + '@rollup/rollup-freebsd-x64@4.46.3': optional: true - '@rollup/rollup-linux-arm64-gnu@4.24.0': + '@rollup/rollup-linux-arm-gnueabihf@4.46.3': optional: true - '@rollup/rollup-linux-arm64-musl@4.24.0': + '@rollup/rollup-linux-arm-musleabihf@4.46.3': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': + '@rollup/rollup-linux-arm64-gnu@4.46.3': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.24.0': + '@rollup/rollup-linux-arm64-musl@4.46.3': optional: true - '@rollup/rollup-linux-s390x-gnu@4.24.0': + '@rollup/rollup-linux-loongarch64-gnu@4.46.3': optional: true - '@rollup/rollup-linux-x64-gnu@4.24.0': + '@rollup/rollup-linux-ppc64-gnu@4.46.3': optional: true - '@rollup/rollup-linux-x64-musl@4.24.0': + '@rollup/rollup-linux-riscv64-gnu@4.46.3': optional: true - '@rollup/rollup-win32-arm64-msvc@4.24.0': + '@rollup/rollup-linux-riscv64-musl@4.46.3': optional: true - '@rollup/rollup-win32-ia32-msvc@4.24.0': + '@rollup/rollup-linux-s390x-gnu@4.46.3': optional: true - '@rollup/rollup-win32-x64-msvc@4.24.0': + '@rollup/rollup-linux-x64-gnu@4.46.3': + optional: true + + '@rollup/rollup-linux-x64-musl@4.46.3': + optional: true + + '@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 + '@testing-library/dom': 10.4.1 '@tsconfig/node10@1.0.11': {} @@ -3777,26 +3372,32 @@ snapshots: '@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/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': {} @@ -3817,28 +3418,19 @@ snapshots: '@types/node@12.20.55': {} - '@types/node@22.15.0': + '@types/node@24.3.0': dependencies: - undici-types: 6.21.0 + undici-types: 7.10.0 - '@types/prop-types@15.7.13': {} + '@types/prop-types@15.7.15': {} - '@types/react-dom@18.3.0': + '@types/react-dom@18.3.7(@types/react@18.3.23)': dependencies: - '@types/react': 18.3.11 + '@types/react': 18.3.23 - '@types/react-dom@18.3.5(@types/react@18.3.18)': + '@types/react@18.3.23': dependencies: - '@types/react': 18.3.18 - - '@types/react@18.3.11': - dependencies: - '@types/prop-types': 15.7.13 - csstype: 3.1.3 - - '@types/react@18.3.18': - 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 +3441,298 @@ 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.21.0(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.9.2))(eslint@9.33.0)(typescript@5.9.2)': 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 + '@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/scope-manager@8.21.0': + '@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.6.3)': dependencies: - '@typescript-eslint/types': 8.21.0 - '@typescript-eslint/visitor-keys': 8.21.0 - - '@typescript-eslint/type-utils@8.21.0(eslint@9.18.0)(typescript@5.6.2)': - 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/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/types@8.21.0': {} - - '@typescript-eslint/typescript-estree@8.21.0(typescript@5.6.2)': + '@typescript-eslint/parser@8.40.0(eslint@9.33.0)(typescript@5.9.2)': 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/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) + '@typescript-eslint/types': 8.40.0 + debug: 4.4.1 + typescript: 5.6.3 + 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 + '@typescript-eslint/visitor-keys': 8.40.0 + + '@typescript-eslint/tsconfig-utils@8.40.0(typescript@5.6.3)': + 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 + '@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/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)': + dependencies: + '@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/typescript-estree@8.40.0(typescript@5.9.2)': 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 + '@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/visitor-keys@8.21.0': + '@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.6.3)': dependencies: - '@typescript-eslint/types': 8.21.0 - eslint-visitor-keys: 4.2.0 + '@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 - '@vitejs/plugin-react@4.3.2(vite@5.4.8(@types/node@22.15.0)(terser@5.34.1))': + '@typescript-eslint/utils@8.40.0(eslint@9.33.0)(typescript@5.9.2)': 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) + '@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 + eslint-visitor-keys: 4.2.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) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.8(@types/node@22.15.0)(terser@5.34.1) + vite: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) 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@5.4.19(@types/node@24.3.0)(terser@5.43.1))': 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: 5.4.19(@types/node@24.3.0)(terser@5.43.1) 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/expect@3.2.4': dependencies: - '@vitest/spy': 2.1.2 + '@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 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/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/runner@2.1.2': + '@vitest/pretty-format@3.2.4': dependencies: - '@vitest/utils': 2.1.2 + tinyrainbow: 2.0.0 + + '@vitest/runner@2.1.9': + dependencies: + '@vitest/utils': 2.1.9 pathe: 1.1.2 - '@vitest/snapshot@2.1.2': + '@vitest/runner@3.2.4': dependencies: - '@vitest/pretty-format': 2.1.2 - magic-string: 0.30.11 + '@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/spy@2.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/utils@2.1.2': + '@vitest/spy@3.2.4': dependencies: - '@vitest/pretty-format': 2.1.2 - loupe: 3.1.2 + 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.14.0): + acorn-jsx@5.3.2(acorn@8.15.0): dependencies: - acorn: 8.14.0 + acorn: 8.15.0 acorn-walk@8.3.4: dependencies: - acorn: 8.14.0 + acorn: 8.15.0 - acorn@8.12.1: {} + acorn@8.15.0: {} - acorn@8.14.0: {} - - agent-base@7.1.3: {} + agent-base@7.1.4: {} ajv@6.12.6: dependencies: @@ -4015,11 +3745,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,11 +3757,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: @@ -4054,8 +3775,6 @@ snapshots: assertion-error@2.0.1: {} - asynckit@0.4.0: {} - balanced-match@1.0.2: {} base64-js@1.5.1: {} @@ -4064,14 +3783,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,108 +3806,69 @@ 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: {} + confbox@0.1.8: {} + + consola@3.4.2: {} convert-source-map@2.0.0: {} create-require@1.1.1: {} - cross-spawn@5.1.0: - dependencies: - lru-cache: 4.1.5 - shebang-command: 1.2.0 - which: 1.3.1 - - cross-spawn@7.0.3: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -4199,9 +3877,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,22 +3887,20 @@ 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: {} @@ -4247,7 +3923,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 +3934,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 +3964,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 +4056,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 +4076,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 +4092,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 +4106,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 +4132,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 +4167,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 +4181,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 +4205,6 @@ snapshots: graphemer@1.4.0: {} - has-flag@3.0.0: {} - has-flag@4.0.0: {} html-encoding-sniffer@4.0.0: @@ -4584,25 +4213,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 +4233,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 +4244,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 +4256,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 +4288,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 +4301,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 @@ -4692,6 +4311,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + js-yaml@3.14.1: dependencies: argparse: 1.0.10 @@ -4701,35 +4322,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 +4372,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,35 +4392,26 @@ 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 + '@jridgewell/sourcemap-codec': 1.5.5 make-error@1.3.6: {} - merge-stream@2.0.0: {} - merge2@1.4.1: {} micromatch@4.0.8: @@ -4808,26 +4419,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 +4448,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 +4456,12 @@ snapshots: dependencies: whatwg-url: 5.0.0 - node-releases@2.0.18: {} + node-releases@2.0.19: {} - normalize-path@3.0.0: {} - - 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 +4471,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 +4499,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 +4524,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 + confbox: 0.1.8 + mlly: 1.7.4 + pathe: 2.0.3 + + postcss-load-config@6.0.1(postcss@8.5.6)(tsx@4.20.4): + dependencies: + lilconfig: 3.1.3 optionalDependencies: - postcss: 8.5.1 - tsx: 4.19.1 + postcss: 8.5.6 + tsx: 4.20.4 - postcss@8.4.47: + postcss@8.5.6: dependencies: - nanoid: 3.3.7 - picocolors: 1.1.0 - source-map-js: 1.2.1 - - postcss@8.5.1: - dependencies: - nanoid: 3.3.8 + nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -4963,7 +4561,7 @@ snapshots: prettier@2.8.8: {} - prettier@3.3.3: {} + prettier@3.6.2: {} pretty-bytes@5.6.0: {} @@ -4979,10 +4577,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): @@ -4997,6 +4595,8 @@ snapshots: react-refresh@0.14.2: {} + react-refresh@0.17.0: {} + react@18.3.1: dependencies: loose-envify: 1.4.0 @@ -5008,45 +4608,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 +4671,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 +4698,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 +4711,7 @@ snapshots: stackback@0.0.2: {} - std-env@3.7.0: {} + std-env@3.9.0: {} string-width@4.2.3: dependencies: @@ -5139,32 +4731,30 @@ 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 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.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 +4763,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 +4780,36 @@ 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: {} + tinyrainbow@2.0.0: {} + tinyspy@3.0.2: {} - tldts-core@6.1.75: {} + tinyspy@4.0.3: {} - tldts@6.1.75: + tldts-core@6.1.86: {} + + 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 +4817,100 @@ 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-api-utils@2.1.0(typescript@5.9.2): + dependencies: + typescript: 5.9.2 ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@22.15.0)(typescript@5.8.3): + 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': 22.15.0 - acorn: 8.14.0 + '@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.8.3 + typescript: 5.9.2 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): + 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.6.2 + postcss: 8.5.6 + typescript: 5.6.3 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.9.2): 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.9.2 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,31 +4918,45 @@ 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-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.8.3: {} + typescript@5.6.3: {} - undici-types@6.21.0: {} + typescript@5.9.2: {} - undici@6.19.8: {} + ufo@1.6.1: {} + + undici-types@7.10.0: {} + + 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: @@ -5356,12 +4964,13 @@ snapshots: 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 +4982,90 @@ snapshots: - supports-color - terser - vite@5.4.8(@types/node@22.15.0)(terser@5.34.1): + 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 - 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 + terser: 5.43.1 + tsx: 4.20.4 - vitest@2.1.2(@types/node@22.15.0)(jsdom@26.0.0)(terser@5.34.1): + vite@7.1.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4): 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 + 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 + '@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 @@ -5429,6 +5077,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 @@ -5445,9 +5135,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 +5151,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,14 +5174,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: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000000..b901c33a57 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,6 @@ +packages: + - 'crates/bindings-typescript' + - 'sdks/typescript' + - '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/examples/quickstart-chat/package.json b/sdks/typescript/examples/quickstart-chat/package.json index bf138510c8..1b2c0ee75c 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" }, @@ -26,14 +28,16 @@ "@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", "globals": "^15.14.0", "jsdom": "^26.0.0", + "prettier": "^3.3.3", "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/examples/quickstart-chat/src/index.css b/sdks/typescript/examples/quickstart-chat/src/index.css index 9390800cc7..12a6ed0082 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/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts b/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts index 113201844e..f8475bcf68 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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 = {}; - /** - * A namespace for generated helper functions. + * An object 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() + ); + }, +}; + +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 33f7a6403f..30040f9ce0 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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 = {}; - /** - * A namespace for generated helper functions. + * An object 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); - } - - export function deserialize(reader: BinaryReader): IdentityDisconnected { - return IdentityDisconnected.getTypeScriptAlgebraicType().deserialize( - reader + serialize(writer: __BinaryWriter, value: IdentityDisconnected): void { + __AlgebraicTypeValue.serializeValue( + writer, + IdentityDisconnected.getTypeScriptAlgebraicType(), + value ); - } -} + }, + + deserialize(reader: __BinaryReader): IdentityDisconnected { + return __AlgebraicTypeValue.deserializeValue( + reader, + IdentityDisconnected.getTypeScriptAlgebraicType() + ); + }, +}; + +export default IdentityDisconnected; 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 fe3b6deb40..34640f577e 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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, }, }, }, @@ -91,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. @@ -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,7 +130,7 @@ export type Reducer = export class RemoteReducers { constructor( - private connection: DbConnectionImpl, + private connection: __DbConnectionImpl, private setCallReducerFlags: SetReducerFlags ) {} @@ -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 19ce1d7afe..25d18af1e5 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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 577574da5e..51ee540553 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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() + ); + }, +}; + +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 98c1913332..77abc3ba6f 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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() + ); + }, +}; + +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 f377481297..ba20079cdc 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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() + ); + }, +}; + +export default SetName; 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 d59979009e..c5621d4662 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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 8946f9c01e..2d4ef93d4a 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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() + ); + }, +}; + +export default User; diff --git a/sdks/typescript/package.json b/sdks/typescript/package.json index 85428c188b..82c865001f 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 4f88a47286..df928ba277 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": { @@ -42,12 +45,15 @@ "undici": "^6.19.2" }, "devDependencies": { - "@clockworklabs/test-app": "file:../test-app", + "@clockworklabs/test-app": "workspace:^", + "prettier": "^3.3.3", "tsup": "^8.1.0", - "undici": "^6.19.2" + "undici": "^6.19.2", + "vitest": "^3.2.4" }, "dependencies": { "@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/src/algebraic_type.ts b/sdks/typescript/packages/sdk/src/algebraic_type.ts deleted file mode 100644 index 0c9846fede..0000000000 --- a/sdks/typescript/packages/sdk/src/algebraic_type.ts +++ /dev/null @@ -1,672 +0,0 @@ -import { TimeDuration } from './time_duration'; -import { Timestamp } from './timestamp'; -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'; - -/** - * 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/sdks/typescript/packages/sdk/src/algebraic_value.ts b/sdks/typescript/packages/sdk/src/algebraic_value.ts deleted file mode 100644 index b91a1de5a5..0000000000 --- a/sdks/typescript/packages/sdk/src/algebraic_value.ts +++ /dev/null @@ -1,331 +0,0 @@ -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; -} - -export function parseValue(ty: ParseableType, src: Uint8Array): T { - const reader = new BinaryReader(src); - return ty.deserialize(reader); -} 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 800837cc87..06c9f1046a 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,68 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement( - 'sizeHint', - __RowSizeHint.getTypeScriptAlgebraicType() - ), - new ProductTypeElement( - 'rowsData', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'sizeHint', + algebraicType: RowSizeHint.getTypeScriptAlgebraicType(), + }, + { + name: 'rowsData', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: BsatnRowList): void { - BsatnRowList.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: BsatnRowList): void { + __AlgebraicTypeValue.serializeValue( + writer, + BsatnRowList.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): BsatnRowList { - return BsatnRowList.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 d3bc69d59e..9c64ab288c 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,67 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('reducer', AlgebraicType.createStringType()), - new ProductTypeElement( - 'args', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('flags', AlgebraicType.createU8Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { 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 { - CallReducer.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: CallReducer): void { + __AlgebraicTypeValue.serializeValue( + writer, + CallReducer.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): CallReducer { - return CallReducer.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 024fb466d5..cec53446b3 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,146 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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'; -// 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; - }; +import * as ClientMessageVariants from './client_message_variants'; +// 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.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() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.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); - } + serialize(writer: __BinaryWriter, value: ClientMessage): void { + __AlgebraicTypeValue.serializeValue( + writer, + ClientMessage.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): ClientMessage { - return ClientMessage.getTypeScriptAlgebraicType().deserialize(reader); - } -} - -// 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; + deserialize(reader: __BinaryReader): ClientMessage { + return __AlgebraicTypeValue.deserializeValue( + reader, + ClientMessage.getTypeScriptAlgebraicType() + ); + }, +}; 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 0000000000..1966e580ad --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/client_message_variants.ts @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 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'; + +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: SubscribeSingleType; +}; +export type SubscribeMulti = { + tag: 'SubscribeMulti'; + value: SubscribeMultiType; +}; +export type Unsubscribe = { tag: 'Unsubscribe'; value: UnsubscribeType }; +export type UnsubscribeMulti = { + tag: 'UnsubscribeMulti'; + value: UnsubscribeMultiType; +}; 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 a172741917..971b48d57a 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,102 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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'; -// 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 }; +import * as CompressableQueryUpdateVariants from './compressable_query_update_variants'; +// 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.createSumType([ - new SumTypeVariant( - 'Uncompressed', - __QueryUpdate.getTypeScriptAlgebraicType() - ), - new SumTypeVariant( - 'Brotli', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new SumTypeVariant( - 'Gzip', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'Uncompressed', + algebraicType: QueryUpdate.getTypeScriptAlgebraicType(), + }, + { + name: 'Brotli', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + { + name: 'Gzip', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: CompressableQueryUpdate - ): void { - CompressableQueryUpdate.getTypeScriptAlgebraicType().serialize( + serialize(writer: __BinaryWriter, value: CompressableQueryUpdate): void { + __AlgebraicTypeValue.serializeValue( writer, + CompressableQueryUpdate.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): CompressableQueryUpdate { - return CompressableQueryUpdate.getTypeScriptAlgebraicType().deserialize( - reader + deserialize(reader: __BinaryReader): CompressableQueryUpdate { + return __AlgebraicTypeValue.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 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 0000000000..334f7554a1 --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/compressable_query_update_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 as QueryUpdateType } from './query_update_type'; + +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/database_update_type.ts b/sdks/typescript/packages/sdk/src/client_api/database_update_type.ts index 3a133f50b6..4f474aa0dd 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,65 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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[]; }; - /** - * 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.createProductType([ - new ProductTypeElement( - 'tables', - AlgebraicType.createArrayType( - __TableUpdate.getTypeScriptAlgebraicType() - ) - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'tables', + algebraicType: __AlgebraicTypeValue.Array( + TableUpdate.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: DatabaseUpdate): void { - DatabaseUpdate.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: DatabaseUpdate): void { + __AlgebraicTypeValue.serializeValue( + writer, + DatabaseUpdate.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): DatabaseUpdate { - return DatabaseUpdate.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 686ca504d8..5c63a4a9d8 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,58 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('quanta', AlgebraicType.createU128Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [{ name: 'quanta', algebraicType: __AlgebraicTypeValue.U128 }], + }); + }, - export function serialize(writer: BinaryWriter, value: EnergyQuanta): void { - EnergyQuanta.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: EnergyQuanta): void { + __AlgebraicTypeValue.serializeValue( + writer, + EnergyQuanta.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): EnergyQuanta { - return EnergyQuanta.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 11dd455da0..8aa6ffe158 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,65 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; - token: string; - connectionId: ConnectionId; -}; +export type IdentityToken = { + identity: __Identity; + token: string; + connectionId: __ConnectionId; +}; /** - * 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.createProductType([ - new ProductTypeElement('identity', AlgebraicType.createIdentityType()), - new ProductTypeElement('token', AlgebraicType.createStringType()), - new ProductTypeElement( - 'connectionId', - AlgebraicType.createConnectionIdType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'identity', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { name: 'token', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'connectionId', + algebraicType: __AlgebraicTypeValue.createConnectionIdType(), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: IdentityToken): void { - IdentityToken.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: IdentityToken): void { + __AlgebraicTypeValue.serializeValue( + writer, + IdentityToken.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): IdentityToken { - return IdentityToken.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 4274ff8c8e..2a85ea7879 100644 --- a/sdks/typescript/packages/sdk/src/client_api/index.ts +++ b/sdks/typescript/packages/sdk/src/client_api/index.ts @@ -1,34 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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 @@ -102,6 +100,9 @@ export { UpdateStatus }; const REMOTE_MODULE = { tables: {}, reducers: {}, + versionInfo: { + cliVersion: '1.4.0', + }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. // @@ -109,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); @@ -134,7 +138,7 @@ export type Reducer = never; export class RemoteReducers { constructor( - private connection: DbConnectionImpl, + private connection: __DbConnectionImpl, private setCallReducerFlags: SetReducerFlags ) {} } @@ -142,54 +146,54 @@ export class RemoteReducers { 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 266ac6833e..c61c64e85d 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,73 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement( - 'databaseUpdate', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDuration', - AlgebraicType.createTimeDurationType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'databaseUpdate', + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'totalHostExecutionDuration', + algebraicType: __AlgebraicTypeValue.createTimeDurationType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: InitialSubscription - ): void { - InitialSubscription.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: InitialSubscription): void { + __AlgebraicTypeValue.serializeValue( + writer, + InitialSubscription.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): InitialSubscription { - return InitialSubscription.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 885f980936..50fcbfa0e1 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,83 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.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() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'messageId', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + { + name: 'error', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { + name: 'tables', + algebraicType: __AlgebraicTypeValue.Array( + OneOffTable.getTypeScriptAlgebraicType() + ), + }, + { + name: 'totalHostExecutionDuration', + algebraicType: __AlgebraicTypeValue.createTimeDurationType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: OneOffQueryResponse - ): void { - OneOffQueryResponse.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: OneOffQueryResponse): void { + __AlgebraicTypeValue.serializeValue( + writer, + OneOffQueryResponse.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): OneOffQueryResponse { - return OneOffQueryResponse.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 8fb2fdc881..3cc954693d 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,63 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement( - 'messageId', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new ProductTypeElement('queryString', AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'messageId', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U8), + }, + { name: 'queryString', algebraicType: __AlgebraicTypeValue.String }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: OneOffQuery): void { - OneOffQuery.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: OneOffQuery): void { + __AlgebraicTypeValue.serializeValue( + writer, + OneOffQuery.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): OneOffQuery { - return OneOffQuery.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 32c8abb64b..b8336eae96 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,65 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('tableName', AlgebraicType.createStringType()), - new ProductTypeElement( - 'rows', - __BsatnRowList.getTypeScriptAlgebraicType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'tableName', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'rows', + algebraicType: BsatnRowList.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: OneOffTable): void { - OneOffTable.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: OneOffTable): void { + __AlgebraicTypeValue.serializeValue( + writer, + OneOffTable.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): OneOffTable { - return OneOffTable.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 1f41bf5e3a..4b29a61b1f 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,58 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('id', AlgebraicType.createU32Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [{ name: 'id', algebraicType: __AlgebraicTypeValue.U32 }], + }); + }, - export function serialize(writer: BinaryWriter, value: QueryId): void { - QueryId.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: QueryId): void { + __AlgebraicTypeValue.serializeValue( + writer, + QueryId.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): QueryId { - return QueryId.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 10e0147f04..4103309ee7 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,68 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement( - 'deletes', - __BsatnRowList.getTypeScriptAlgebraicType() - ), - new ProductTypeElement( - 'inserts', - __BsatnRowList.getTypeScriptAlgebraicType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.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); - } + serialize(writer: __BinaryWriter, value: QueryUpdate): void { + __AlgebraicTypeValue.serializeValue( + writer, + QueryUpdate.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): QueryUpdate { - return QueryUpdate.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 337fb073e2..8bc6c14654 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,70 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('reducerName', AlgebraicType.createStringType()), - new ProductTypeElement('reducerId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'args', - AlgebraicType.createArrayType(AlgebraicType.createU8Type()) - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { 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 { - ReducerCallInfo.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: ReducerCallInfo): void { + __AlgebraicTypeValue.serializeValue( + writer, + ReducerCallInfo.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): ReducerCallInfo { - return ReducerCallInfo.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 7f6830bcc5..3aea4b97f9 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,78 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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'; -// 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[] }; +import * as RowSizeHintVariants from './row_size_hint_variants'; +// 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.createSumType([ - new SumTypeVariant('FixedSize', AlgebraicType.createU16Type()), - new SumTypeVariant( - 'RowOffsets', - AlgebraicType.createArrayType(AlgebraicType.createU64Type()) - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { name: 'FixedSize', algebraicType: __AlgebraicTypeValue.U16 }, + { + name: 'RowOffsets', + algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U64), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: RowSizeHint): void { - RowSizeHint.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: RowSizeHint): void { + __AlgebraicTypeValue.serializeValue( + writer, + RowSizeHint.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): RowSizeHint { - return RowSizeHint.getTypeScriptAlgebraicType().deserialize(reader); - } -} - -// The tagged union or sum type for the algebraic type `RowSizeHint`. -export type RowSizeHint = RowSizeHint.FixedSize | RowSizeHint.RowOffsets; + deserialize(reader: __BinaryReader): RowSizeHint { + return __AlgebraicTypeValue.deserializeValue( + reader, + RowSizeHint.getTypeScriptAlgebraicType() + ); + }, +}; 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 0000000000..f412f78bba --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/row_size_hint_variants.ts @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 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 c88b76f43f..0f02237db1 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,192 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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'; -// 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; - }; +import * as ServerMessageVariants from './server_message_variants'; +// 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.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() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.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); - } + serialize(writer: __BinaryWriter, value: ServerMessage): void { + __AlgebraicTypeValue.serializeValue( + writer, + ServerMessage.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): ServerMessage { - return ServerMessage.getTypeScriptAlgebraicType().deserialize(reader); - } -} - -// 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; + deserialize(reader: __BinaryReader): ServerMessage { + return __AlgebraicTypeValue.deserializeValue( + reader, + ServerMessage.getTypeScriptAlgebraicType() + ); + }, +}; 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 0000000000..a71b79bc50 --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/server_message_variants.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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 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: InitialSubscriptionType; +}; +export type TransactionUpdate = { + tag: 'TransactionUpdate'; + value: TransactionUpdateType; +}; +export type TransactionUpdateLight = { + tag: 'TransactionUpdateLight'; + value: TransactionUpdateLightType; +}; +export type IdentityToken = { tag: 'IdentityToken'; value: IdentityTokenType }; +export type OneOffQueryResponse = { + tag: 'OneOffQueryResponse'; + value: OneOffQueryResponseType; +}; +export type SubscribeApplied = { + tag: 'SubscribeApplied'; + value: SubscribeAppliedType; +}; +export type UnsubscribeApplied = { + tag: 'UnsubscribeApplied'; + value: UnsubscribeAppliedType; +}; +export type SubscriptionError = { + tag: 'SubscriptionError'; + value: SubscriptionErrorType; +}; +export type SubscribeMultiApplied = { + tag: 'SubscribeMultiApplied'; + value: SubscribeMultiAppliedType; +}; +export type UnsubscribeMultiApplied = { + tag: 'UnsubscribeMultiApplied'; + value: UnsubscribeMultiAppliedType; +}; 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 fbd3dfb9c5..2fcf409059 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,76 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - new ProductTypeElement( - 'rows', - __SubscribeRows.getTypeScriptAlgebraicType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'totalHostExecutionDurationMicros', + algebraicType: __AlgebraicTypeValue.U64, + }, + { + name: 'queryId', + algebraicType: QueryId.getTypeScriptAlgebraicType(), + }, + { + name: 'rows', + algebraicType: SubscribeRows.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: SubscribeApplied - ): void { - SubscribeApplied.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: SubscribeApplied): void { + __AlgebraicTypeValue.serializeValue( + writer, + SubscribeApplied.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): SubscribeApplied { - return SubscribeApplied.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 54b7881795..004c57cf55 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,78 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - new ProductTypeElement( - 'update', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'totalHostExecutionDurationMicros', + algebraicType: __AlgebraicTypeValue.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 deserialize(reader: BinaryReader): SubscribeMultiApplied { - return SubscribeMultiApplied.getTypeScriptAlgebraicType().deserialize( - reader + serialize(writer: __BinaryWriter, value: SubscribeMultiApplied): void { + __AlgebraicTypeValue.serializeValue( + writer, + SubscribeMultiApplied.getTypeScriptAlgebraicType(), + value ); - } -} + }, + + 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 349f9f1a05..c0244e62df 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,67 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement( - 'queryStrings', - AlgebraicType.createArrayType(AlgebraicType.createStringType()) - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'queryStrings', + algebraicType: __AlgebraicTypeValue.Array( + __AlgebraicTypeValue.String + ), + }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'queryId', + algebraicType: QueryId.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: SubscribeMulti): void { - SubscribeMulti.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: SubscribeMulti): void { + __AlgebraicTypeValue.serializeValue( + writer, + SubscribeMulti.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): SubscribeMulti { - return SubscribeMulti.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 b1c6d6295e..0e09b3aa8e 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,67 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('tableId', AlgebraicType.createU32Type()), - new ProductTypeElement('tableName', AlgebraicType.createStringType()), - new ProductTypeElement( - 'tableRows', - __TableUpdate.getTypeScriptAlgebraicType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'tableId', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'tableName', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'tableRows', + algebraicType: TableUpdate.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: SubscribeRows): void { - SubscribeRows.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: SubscribeRows): void { + __AlgebraicTypeValue.serializeValue( + writer, + SubscribeRows.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): SubscribeRows { - return SubscribeRows.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 2f564678c7..72e9b53d28 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,67 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('query', AlgebraicType.createStringType()), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'query', algebraicType: __AlgebraicTypeValue.String }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'queryId', + algebraicType: QueryId.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: SubscribeSingle - ): void { - SubscribeSingle.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: SubscribeSingle): void { + __AlgebraicTypeValue.serializeValue( + writer, + SubscribeSingle.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): SubscribeSingle { - return SubscribeSingle.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 cb6e4edb6a..ba481b91c4 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts @@ -1,63 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement( - 'queryStrings', - AlgebraicType.createArrayType(AlgebraicType.createStringType()) - ), - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'queryStrings', + algebraicType: __AlgebraicTypeValue.Array( + __AlgebraicTypeValue.String + ), + }, + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: Subscribe): void { - Subscribe.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Subscribe): void { + __AlgebraicTypeValue.serializeValue( + writer, + Subscribe.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): Subscribe { - return Subscribe.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 d8e0a792ee..7738c95b39 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,35 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; @@ -37,45 +36,58 @@ export type SubscriptionError = { tableId: number | undefined; error: string; }; - /** - * 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.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()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'totalHostExecutionDurationMicros', + algebraicType: __AlgebraicTypeValue.U64, + }, + { + name: 'requestId', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.U32 + ), + }, + { + name: 'queryId', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.U32 + ), + }, + { + name: 'tableId', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.U32 + ), + }, + { name: 'error', algebraicType: __AlgebraicTypeValue.String }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: SubscriptionError - ): void { - SubscriptionError.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: SubscriptionError): void { + __AlgebraicTypeValue.serializeValue( + writer, + SubscriptionError.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): SubscriptionError { - return SubscriptionError.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 cc4999cb9f..6199f4538c 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,71 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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[]; }; - /** - * 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.createProductType([ - new ProductTypeElement('tableId', AlgebraicType.createU32Type()), - new ProductTypeElement('tableName', AlgebraicType.createStringType()), - new ProductTypeElement('numRows', AlgebraicType.createU64Type()), - new ProductTypeElement( - 'updates', - AlgebraicType.createArrayType( - __CompressableQueryUpdate.getTypeScriptAlgebraicType() - ) - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'tableId', algebraicType: __AlgebraicTypeValue.U32 }, + { name: 'tableName', algebraicType: __AlgebraicTypeValue.String }, + { name: 'numRows', algebraicType: __AlgebraicTypeValue.U64 }, + { + name: 'updates', + algebraicType: __AlgebraicTypeValue.Array( + CompressableQueryUpdate.getTypeScriptAlgebraicType() + ), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: TableUpdate): void { - TableUpdate.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: TableUpdate): void { + __AlgebraicTypeValue.serializeValue( + writer, + TableUpdate.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): TableUpdate { - return TableUpdate.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 567fe4b332..409a5ca91e 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,73 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'update', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'update', + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: TransactionUpdateLight - ): void { - TransactionUpdateLight.getTypeScriptAlgebraicType().serialize( + serialize(writer: __BinaryWriter, value: TransactionUpdateLight): void { + __AlgebraicTypeValue.serializeValue( writer, + TransactionUpdateLight.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): TransactionUpdateLight { - return TransactionUpdateLight.getTypeScriptAlgebraicType().deserialize( - reader + 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 6391ba98d6..b83c63dfa9 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,95 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.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() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'status', + algebraicType: UpdateStatus.getTypeScriptAlgebraicType(), + }, + { + name: 'timestamp', + algebraicType: __AlgebraicTypeValue.createTimestampType(), + }, + { + name: 'callerIdentity', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { + name: 'callerConnectionId', + algebraicType: __AlgebraicTypeValue.createConnectionIdType(), + }, + { + name: 'reducerCall', + algebraicType: ReducerCallInfo.getTypeScriptAlgebraicType(), + }, + { + name: 'energyQuantaUsed', + algebraicType: EnergyQuanta.getTypeScriptAlgebraicType(), + }, + { + name: 'totalHostExecutionDuration', + algebraicType: __AlgebraicTypeValue.createTimeDurationType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: TransactionUpdate - ): void { - TransactionUpdate.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: TransactionUpdate): void { + __AlgebraicTypeValue.serializeValue( + writer, + TransactionUpdate.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): TransactionUpdate { - return TransactionUpdate.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 ab63a797d5..8aa1983eb1 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,76 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - new ProductTypeElement( - 'rows', - __SubscribeRows.getTypeScriptAlgebraicType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'totalHostExecutionDurationMicros', + algebraicType: __AlgebraicTypeValue.U64, + }, + { + name: 'queryId', + algebraicType: QueryId.getTypeScriptAlgebraicType(), + }, + { + name: 'rows', + algebraicType: SubscribeRows.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: UnsubscribeApplied - ): void { - UnsubscribeApplied.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: UnsubscribeApplied): void { + __AlgebraicTypeValue.serializeValue( + writer, + UnsubscribeApplied.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): UnsubscribeApplied { - return UnsubscribeApplied.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 9212605796..f98c40c806 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,81 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement( - 'totalHostExecutionDurationMicros', - AlgebraicType.createU64Type() - ), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - new ProductTypeElement( - 'update', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'totalHostExecutionDurationMicros', + algebraicType: __AlgebraicTypeValue.U64, + }, + { + name: 'queryId', + algebraicType: QueryId.getTypeScriptAlgebraicType(), + }, + { + name: 'update', + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: UnsubscribeMultiApplied - ): void { - UnsubscribeMultiApplied.getTypeScriptAlgebraicType().serialize( + serialize(writer: __BinaryWriter, value: UnsubscribeMultiApplied): void { + __AlgebraicTypeValue.serializeValue( writer, + UnsubscribeMultiApplied.getTypeScriptAlgebraicType(), value ); - } + }, - export function deserialize(reader: BinaryReader): UnsubscribeMultiApplied { - return UnsubscribeMultiApplied.getTypeScriptAlgebraicType().deserialize( - reader + 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 32d02ba14c..ed6c54d2b7 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,65 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'queryId', + algebraicType: QueryId.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: UnsubscribeMulti - ): void { - UnsubscribeMulti.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: UnsubscribeMulti): void { + __AlgebraicTypeValue.serializeValue( + writer, + UnsubscribeMulti.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): UnsubscribeMulti { - return UnsubscribeMulti.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 368f68c4d8..ac996b14d4 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts @@ -1,62 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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; }; - /** - * 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.createProductType([ - new ProductTypeElement('requestId', AlgebraicType.createU32Type()), - new ProductTypeElement('queryId', __QueryId.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'requestId', algebraicType: __AlgebraicTypeValue.U32 }, + { + name: 'queryId', + algebraicType: QueryId.getTypeScriptAlgebraicType(), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: Unsubscribe): void { - Unsubscribe.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Unsubscribe): void { + __AlgebraicTypeValue.serializeValue( + writer, + Unsubscribe.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): Unsubscribe { - return Unsubscribe.getTypeScriptAlgebraicType().deserialize(reader); - } -} + 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 68aa8865f5..df646912d4 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,86 +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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + /* eslint-disable */ /* tslint:disable */ // @ts-nocheck import { - AlgebraicType, - AlgebraicValue, - BinaryReader, - BinaryWriter, - CallReducerFlags, - ConnectionId, - DbConnectionBuilder, - DbConnectionImpl, - DbContext, - ErrorContextInterface, - Event, - EventContextInterface, - Identity, - ProductType, - ProductTypeElement, - ReducerEventContextInterface, - SubscriptionBuilderImpl, - SubscriptionEventContextInterface, - SumType, - SumTypeVariant, - TableCache, - TimeDuration, - Timestamp, - deepEqual, + 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'; -// 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' }; +import * as UpdateStatusVariants from './update_status_variants'; +// 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' }; + }), + Failed: (value: string): UpdateStatus => ({ tag: 'Failed', value }), + OutOfEnergy: { tag: 'OutOfEnergy' } as const, - export function getTypeScriptAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant( - 'Committed', - __DatabaseUpdate.getTypeScriptAlgebraicType() - ), - new SumTypeVariant('Failed', AlgebraicType.createStringType()), - new SumTypeVariant('OutOfEnergy', AlgebraicType.createProductType([])), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Sum({ + variants: [ + { + name: 'Committed', + algebraicType: DatabaseUpdate.getTypeScriptAlgebraicType(), + }, + { name: 'Failed', algebraicType: __AlgebraicTypeValue.String }, + { + name: 'OutOfEnergy', + algebraicType: __AlgebraicTypeValue.Product({ elements: [] }), + }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: UpdateStatus): void { - UpdateStatus.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: UpdateStatus): void { + __AlgebraicTypeValue.serializeValue( + writer, + UpdateStatus.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): UpdateStatus { - return UpdateStatus.getTypeScriptAlgebraicType().deserialize(reader); - } -} - -// The tagged union or sum type for the algebraic type `UpdateStatus`. -export type UpdateStatus = - | UpdateStatus.Committed - | UpdateStatus.Failed - | UpdateStatus.OutOfEnergy; + deserialize(reader: __BinaryReader): UpdateStatus { + return __AlgebraicTypeValue.deserializeValue( + reader, + UpdateStatus.getTypeScriptAlgebraicType() + ); + }, +}; 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 0000000000..f962af0331 --- /dev/null +++ b/sdks/typescript/packages/sdk/src/client_api/update_status_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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). + +/* 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 as DatabaseUpdateType } from './database_update_type'; + +export type Committed = { tag: 'Committed'; value: DatabaseUpdateType }; +export type Failed = { tag: 'Failed'; value: string }; +export type OutOfEnergy = { tag: 'OutOfEnergy' }; diff --git a/sdks/typescript/packages/sdk/src/db_connection_builder.ts b/sdks/typescript/packages/sdk/src/db_connection_builder.ts index ed62b93eff..5461019aea 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 24075e0ed9..5dcf88c133 100644 --- a/sdks/typescript/packages/sdk/src/db_connection_impl.ts +++ b/sdks/typescript/packages/sdk/src/db_connection_impl.ts @@ -1,28 +1,22 @@ -import { ConnectionId } from './connection_id'; +import { ConnectionId } from 'spacetimedb'; import { AlgebraicType, + type AlgebraicTypeVariants, ProductType, ProductTypeElement, SumType, SumTypeVariant, type ComparablePrimitive, -} from './algebraic_type.ts'; -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 { parseValue } 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 +29,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 +44,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 { @@ -65,21 +59,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 { @@ -323,10 +313,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 { @@ -422,7 +413,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': @@ -618,7 +609,10 @@ 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 @@ -681,8 +675,10 @@ 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 7aa615aaeb..ee1df19fe1 100644 --- a/sdks/typescript/packages/sdk/src/index.ts +++ b/sdks/typescript/packages/sdk/src/index.ts @@ -1,10 +1,6 @@ // 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 './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/message_types.ts b/sdks/typescript/packages/sdk/src/message_types.ts index 3ce1f9ca98..f3af8f700e 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 8711dbfb13..f91717d316 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/schedule_at.ts b/sdks/typescript/packages/sdk/src/schedule_at.ts deleted file mode 100644 index 0cbbac2944..0000000000 --- a/sdks/typescript/packages/sdk/src/schedule_at.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { AlgebraicType, SumTypeVariant } from './algebraic_type'; -import type { AlgebraicValue } from './algebraic_value'; - -export namespace ScheduleAt { - export function getAlgebraicType(): AlgebraicType { - return AlgebraicType.createSumType([ - new SumTypeVariant('Interval', AlgebraicType.createTimeDurationType()), - new SumTypeVariant('Time', 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 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; -export default ScheduleAt; diff --git a/sdks/typescript/packages/sdk/src/serializer.ts b/sdks/typescript/packages/sdk/src/serializer.ts index ca1130adbd..8736e38944 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 1ccefe2deb..b7e4d81074 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 'spacetimedb'; 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 8763c2189f..54067f21a1 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/version.ts b/sdks/typescript/packages/sdk/src/version.ts index 9221a12199..f3d7a67b1d 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 ); diff --git a/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts b/sdks/typescript/packages/sdk/src/websocket_test_adapter.ts index fe151c89d9..2bdbd4ed01 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,11 @@ 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 +43,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 0000000000..913f9eb83d --- /dev/null +++ b/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts @@ -0,0 +1,168 @@ +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 12e778223e..0000000000 --- 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 993f6675a9..8108eb0e56 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 8339256c9a..5d61d7369e 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 1e666af4e4..e2a97cbc98 100644 --- a/sdks/typescript/packages/sdk/tests/table_cache.test.ts +++ b/sdks/typescript/packages/sdk/tests/table_cache.test.ts @@ -1,10 +1,14 @@ -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 +103,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 +410,32 @@ 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 +770,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 +790,8 @@ 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/packages/sdk/tsconfig.json b/sdks/typescript/packages/sdk/tsconfig.json index 8c28df00aa..c0e0365fca 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 0000000000..352e9f84db --- /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/packages/sdk/vitest.config.ts b/sdks/typescript/packages/sdk/vitest.config.ts new file mode 100644 index 0000000000..02bfd1afcd --- /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'], + }, +}); diff --git a/sdks/typescript/packages/test-app/package.json b/sdks/typescript/packages/test-app/package.json index a98f264263..056d810cca 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" diff --git a/sdks/typescript/packages/test-app/server/Cargo.toml b/sdks/typescript/packages/test-app/server/Cargo.toml index 9b27858510..f47518024d 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 55285852c9..7751b363f5 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,65 +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.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', __Point.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'location', algebraicType: Point.getTypeScriptAlgebraicType() }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: CreatePlayer): void { - CreatePlayer.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: CreatePlayer): void { + __AlgebraicTypeValue.serializeValue( + writer, + CreatePlayer.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): CreatePlayer { - return CreatePlayer.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): CreatePlayer { + return __AlgebraicTypeValue.deserializeValue( + reader, + CreatePlayer.getTypeScriptAlgebraicType() + ); + }, +}; + +export default CreatePlayer; 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 86fcf287d7..26e0ad3ac7 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.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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().product.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().product.elements[0].algebraicType, + colType: ( + User.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product + ).value.elements[0].algebraicType, }, }, }, @@ -89,7 +87,7 @@ const REMOTE_MODULE = { }, }, versionInfo: { - cliVersion: '1.2.0', + cliVersion: '1.4.0', }, // 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 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 7eec606c5d..bcb387c81a 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.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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 884e63551b..369b45d326 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,66 +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.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement('ownerId', AlgebraicType.createStringType()), - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', __Point.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'ownerId', algebraicType: __AlgebraicTypeValue.String }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'location', algebraicType: Point.getTypeScriptAlgebraicType() }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: Player): void { - Player.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Player): void { + __AlgebraicTypeValue.serializeValue( + writer, + Player.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): Player { - return Player.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): Player { + return __AlgebraicTypeValue.deserializeValue( + reader, + Player.getTypeScriptAlgebraicType() + ); + }, +}; + +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 c74f56ad62..361b6d162d 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,62 +1,69 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement('x', AlgebraicType.createU16Type()), - new ProductTypeElement('y', AlgebraicType.createU16Type()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'x', algebraicType: __AlgebraicTypeValue.U16 }, + { name: 'y', algebraicType: __AlgebraicTypeValue.U16 }, + ], + }); + }, - export function serialize(writer: BinaryWriter, value: Point): void { - Point.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: Point): void { + __AlgebraicTypeValue.serializeValue( + writer, + Point.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): Point { - return Point.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): Point { + return __AlgebraicTypeValue.deserializeValue( + reader, + Point.getTypeScriptAlgebraicType() + ); + }, +}; + +export default Point; 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 a0b3c754db..2579083e21 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.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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 82f2530701..0d621d8997 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,69 +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.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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.createProductType([ - new ProductTypeElement('ownerId', AlgebraicType.createStringType()), - new ProductTypeElement('name', AlgebraicType.createStringType()), - new ProductTypeElement('location', __Point.getTypeScriptAlgebraicType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { name: 'ownerId', algebraicType: __AlgebraicTypeValue.String }, + { name: 'name', algebraicType: __AlgebraicTypeValue.String }, + { name: 'location', algebraicType: Point.getTypeScriptAlgebraicType() }, + ], + }); + }, - export function serialize( - writer: BinaryWriter, - value: UnindexedPlayer - ): void { - UnindexedPlayer.getTypeScriptAlgebraicType().serialize(writer, value); - } + serialize(writer: __BinaryWriter, value: UnindexedPlayer): void { + __AlgebraicTypeValue.serializeValue( + writer, + UnindexedPlayer.getTypeScriptAlgebraicType(), + value + ); + }, - export function deserialize(reader: BinaryReader): UnindexedPlayer { - return UnindexedPlayer.getTypeScriptAlgebraicType().deserialize(reader); - } -} + deserialize(reader: __BinaryReader): UnindexedPlayer { + return __AlgebraicTypeValue.deserializeValue( + reader, + UnindexedPlayer.getTypeScriptAlgebraicType() + ); + }, +}; + +export default UnindexedPlayer; 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 605a14bc30..c5621d4662 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.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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 4a3943a26b..9745c9fac2 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,62 +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.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0). +// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). /* 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; }; - /** - * A namespace for generated helper functions. + * An object 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('username', AlgebraicType.createStringType()), - ]); - } + getTypeScriptAlgebraicType(): __AlgebraicTypeType { + return __AlgebraicTypeValue.Product({ + elements: [ + { + name: 'identity', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { name: 'username', algebraicType: __AlgebraicTypeValue.String }, + ], + }); + }, - 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() + ); + }, +}; + +export default User; diff --git a/sdks/typescript/pnpm-workspace.yaml b/sdks/typescript/pnpm-workspace.yaml deleted file mode 100644 index 0249556127..0000000000 --- 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 779fe900a4..0000000000 --- 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'], - }, -]); diff --git a/sdks/typescript/vitest.config.ts b/sdks/typescript/vitest.config.ts index 4ac6027d57..7de9bbad8a 100644 --- a/sdks/typescript/vitest.config.ts +++ b/sdks/typescript/vitest.config.ts @@ -3,5 +3,16 @@ 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'], }, }); From 413c8cbf3cc701fd9448f23e86e8996e559a2c13 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Wed, 3 Sep 2025 22:23:29 -0400 Subject: [PATCH 21/28] Unifies TypeScript packages and command names (#3195) # Description of Changes This PR: - standardizes the prettier config across all TypeScript projects - adds a root level package.json - standardizes all `pnpm` commands to be the same - updates documentation accordingly - adds some additional typescript testing for serialization and deserialization **IMPORTANT!** Once this PR merges we will need to change the `compile-and-test` required check to `build-and-test` # API and ABI breaking changes No breaking changes. # Expected complexity level and risk 2 - It in principle doesn't change any code, but could affect deploy processes. # Testing - [x] Just the automated testing that we had previously - [x] I added additional automated tests --------- Co-authored-by: Zeke Foppa --- .github/workflows/ci.yml | 58 +- .github/workflows/docs-validate-nav-build.yml | 31 +- .github/workflows/typescript-lint.yml | 1 - .github/workflows/typescript-test.yml | 7 +- crates/bindings-typescript/package.json | 1 - .../bindings-typescript/src/connection_id.ts | 16 +- crates/bindings-typescript/src/identity.ts | 12 +- docs/.prettierignore | 2 + docs/.prettierrc | 11 - docs/docs/cli-reference.md | 87 +-- docs/docs/nav.js | 142 ++-- docs/nav.ts | 24 +- docs/package.json | 9 +- docs/scripts/checkLinks.ts | 39 +- docs/scripts/checkNav.mjs | 33 +- docs/tools/markdown-fix.mjs | 99 +++ package.json | 28 + pnpm-lock.yaml | 696 +++++++++++++++++- pnpm-workspace.yaml | 3 +- sdks/typescript/.github/workflows/cr.yml | 2 +- sdks/typescript/.github/workflows/release.yml | 2 +- .../examples/quickstart-chat/README.md | 6 +- .../examples/quickstart-chat/package.json | 6 +- .../examples/quickstart-chat/vitest.config.ts | 4 +- sdks/typescript/package.json | 6 +- sdks/typescript/packages/sdk/README.md | 2 +- sdks/typescript/packages/sdk/package.json | 2 +- .../packages/sdk/tests/algebraic_type.test.ts | 168 ----- .../packages/sdk/tests/serde.test.ts | 154 ++++ sdks/typescript/vitest.config.ts | 18 - 30 files changed, 1200 insertions(+), 469 deletions(-) create mode 100644 docs/.prettierignore delete mode 100644 docs/.prettierrc create mode 100755 docs/tools/markdown-fix.mjs create mode 100644 package.json delete mode 100644 sdks/typescript/packages/sdk/tests/algebraic_type.test.ts create mode 100644 sdks/typescript/packages/sdk/tests/serde.test.ts delete mode 100644 sdks/typescript/vitest.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92f698f7b8..62edf2d64a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,19 +254,41 @@ jobs: GIT_REF="${{ github.ref }}" fi echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" + - name: Checkout sources uses: actions/checkout@v4 with: ref: ${{ env.GIT_REF }} + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - uses: pnpm/action-setup@v4 + with: + run_install: true + + - name: Get pnpm store directory + shell: bash + working-directory: sdks/typescript + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - uses: dsherret/rust-toolchain-file@v1 + - name: Check for docs change run: | cargo run --features markdown-docs -p spacetimedb-cli > docs/docs/cli-reference.md - cd docs - # This is needed because our website doesn't render markdown quite properly. - # See the README in docs for more details. - sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md - sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 \2!' docs/cli-reference.md + pnpm format git status if git diff --exit-code HEAD; then echo "No docs changes detected" @@ -275,29 +297,3 @@ jobs: exit 1 fi - license_check: - name: Check licenses - permissions: read-all - runs-on: ubuntu-latest - steps: - - name: Find Git ref - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash - run: | - PR_NUMBER="${{ github.event.inputs.pr_number || null }}" - if test -n "${PR_NUMBER}"; then - GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" - else - GIT_REF="${{ github.ref }}" - fi - echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" - - name: Checkout sources - uses: actions/checkout@v4 - with: - ref: ${{ env.GIT_REF }} - - uses: dsherret/rust-toolchain-file@v1 - - name: Check for invalid licenses - run: | - cd tools/license-check - cargo run diff --git a/.github/workflows/docs-validate-nav-build.yml b/.github/workflows/docs-validate-nav-build.yml index 5232f4c0b4..574870203a 100644 --- a/.github/workflows/docs-validate-nav-build.yml +++ b/.github/workflows/docs-validate-nav-build.yml @@ -18,12 +18,35 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '18' + + - uses: pnpm/action-setup@v4 + with: + run_install: true + + - name: Get pnpm store directory + working-directory: sdks/typescript + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install dependencies working-directory: docs run: | - npm install + pnpm install + + - name: Lint + working-directory: docs + run: | + pnpm lint - name: Backup existing nav.js working-directory: docs @@ -33,12 +56,12 @@ jobs: - name: Build nav.ts working-directory: docs run: | - npm run build + pnpm build - name: Compare generated nav.js with original nav.js working-directory: docs run: | - diff -q docs/nav.js docs/nav.js.original || (echo "Generated nav.js differs from committed version. Run 'npm run build' and commit the updated file." && exit 1) + diff -q docs/nav.js docs/nav.js.original || (echo "Generated nav.js differs from committed version. Run 'pnpm build' and commit the updated file." && exit 1) # We do this after checking that nav.js matches nav.ts, to avoid confusing error messages if an author updates one but not the other. # If the .ts and .js are in sync, it doesn't matter which one we check against here. diff --git a/.github/workflows/typescript-lint.yml b/.github/workflows/typescript-lint.yml index 98d169e9a2..4260e1fcda 100644 --- a/.github/workflows/typescript-lint.yml +++ b/.github/workflows/typescript-lint.yml @@ -22,7 +22,6 @@ jobs: - uses: pnpm/action-setup@v4 with: - version: 9.7 run_install: true - name: Get pnpm store directory diff --git a/.github/workflows/typescript-test.yml b/.github/workflows/typescript-test.yml index 520adccbe2..c2317abfd3 100644 --- a/.github/workflows/typescript-test.yml +++ b/.github/workflows/typescript-test.yml @@ -8,7 +8,7 @@ on: merge_group: jobs: - compile-and-test: + build-and-test: runs-on: ubuntu-latest steps: @@ -22,7 +22,6 @@ jobs: - uses: pnpm/action-setup@v4 with: - version: 9.7 run_install: true - name: Get pnpm store directory @@ -39,9 +38,9 @@ jobs: restore-keys: | ${{ runner.os }}-pnpm-store- - - name: Compile + - name: Build working-directory: sdks/typescript - run: pnpm compile + run: pnpm build - name: Run sdk tests working-directory: sdks/typescript/packages/sdk diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index 5d938ac822..f1c458d1da 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -35,7 +35,6 @@ "type": "module", "scripts": { "build": "tsc", - "compile": "pnpm run build", "format": "prettier --write .", "lint": "eslint . && prettier . --check", "test": "vitest run", diff --git a/crates/bindings-typescript/src/connection_id.ts b/crates/bindings-typescript/src/connection_id.ts index 9428069e79..0676c63514 100644 --- a/crates/bindings-typescript/src/connection_id.ts +++ b/crates/bindings-typescript/src/connection_id.ts @@ -4,21 +4,17 @@ import { hexStringToU128, u128ToHexString, u128ToUint8Array } from './utils'; * A unique identifier for a client connected to a database. */ export class ConnectionId { - data: bigint; - - get __connection_id__(): bigint { - return this.data; - } + __connection_id__: bigint; /** * Creates a new `ConnectionId`. */ constructor(data: bigint) { - this.data = data; + this.__connection_id__ = data; } isZero(): boolean { - return this.data === BigInt(0); + return this.__connection_id__ === BigInt(0); } static nullIfZero(addr: ConnectionId): ConnectionId | null { @@ -44,21 +40,21 @@ export class ConnectionId { * Compare two connection IDs for equality. */ isEqual(other: ConnectionId): boolean { - return this.data == other.data; + return this.__connection_id__ == other.__connection_id__; } /** * Print the connection ID as a hexadecimal string. */ toHexString(): string { - return u128ToHexString(this.data); + return u128ToHexString(this.__connection_id__); } /** * Convert the connection ID to a Uint8Array. */ toUint8Array(): Uint8Array { - return u128ToUint8Array(this.data); + return u128ToUint8Array(this.__connection_id__); } /** diff --git a/crates/bindings-typescript/src/identity.ts b/crates/bindings-typescript/src/identity.ts index 41df6bbced..8a74a0c72d 100644 --- a/crates/bindings-typescript/src/identity.ts +++ b/crates/bindings-typescript/src/identity.ts @@ -4,11 +4,7 @@ import { hexStringToU256, u256ToHexString, u256ToUint8Array } from './utils'; * A unique identifier for a user connected to a database. */ export class Identity { - data: bigint; - - get __identity__(): bigint { - return this.data; - } + __identity__: bigint; /** * Creates a new `Identity`. @@ -18,7 +14,7 @@ export class Identity { constructor(data: string | bigint) { // we get a JSON with __identity__ when getting a token with a JSON API // and an bigint when using BSATN - this.data = typeof data === 'string' ? hexStringToU256(data) : data; + this.__identity__ = typeof data === 'string' ? hexStringToU256(data) : data; } /** @@ -32,14 +28,14 @@ export class Identity { * Print the identity as a hexadecimal string. */ toHexString(): string { - return u256ToHexString(this.data); + return u256ToHexString(this.__identity__); } /** * Convert the address to a Uint8Array. */ toUint8Array(): Uint8Array { - return u256ToUint8Array(this.data); + return u256ToUint8Array(this.__identity__); } /** diff --git a/docs/.prettierignore b/docs/.prettierignore new file mode 100644 index 0000000000..b4c5d94035 --- /dev/null +++ b/docs/.prettierignore @@ -0,0 +1,2 @@ +**/*.md +**/*.html diff --git a/docs/.prettierrc b/docs/.prettierrc deleted file mode 100644 index 2921455b32..0000000000 --- a/docs/.prettierrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tabWidth": 2, - "useTabs": false, - "semi": true, - "singleQuote": true, - "arrowParens": "avoid", - "jsxSingleQuote": false, - "trailingComma": "es5", - "endOfLine": "auto", - "printWidth": 80 -} diff --git a/docs/docs/cli-reference.md b/docs/docs/cli-reference.md index 69ebbbd5cc..a346ed2374 100644 --- a/docs/docs/cli-reference.md +++ b/docs/docs/cli-reference.md @@ -51,7 +51,7 @@ This document contains the help content for the `spacetime` command-line program * `generate` — Generate client files for a spacetime module. * `list` — Lists the databases attached to an identity. WARNING: This command is UNSTABLE and subject to breaking changes. * `login` — Manage your login to the SpacetimeDB CLI -* `logout` — +* `logout` — * `init` — Initializes a new spacetime project. WARNING: This command is UNSTABLE and subject to breaking changes. * `build` — Builds a spacetime module. * `server` — Manage the connection to the SpacetimeDB server. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -64,8 +64,6 @@ This document contains the help content for the `spacetime` command-line program * `--root-dir ` — The root directory to store all spacetime files in. * `--config-path ` — The path to the cli.toml config file - - ## spacetime publish Create and update a SpacetimeDB database @@ -78,15 +76,15 @@ Run `spacetime help publish` for more detailed information. * `` — A valid domain or identity for this database. - Database names must match the regex `/^[a-z0-9]+(-[a-z0-9]+)*$/`, - i.e. only lowercase ASCII letters and numbers, separated by dashes. + Database names must match the regex `/^[a-z0-9]+(-[a-z0-9]+)*$/`, + i.e. only lowercase ASCII letters and numbers, separated by dashes. ###### Options: * `-c`, `--delete-data` — When publishing to an existing database identity, first DESTROY all data associated with the module * `--build-options ` — Options to pass to the build command, for example --build-options='--lint-dir=' - Default value: `` + Default value: \`\` * `-p`, `--project-path ` — The system path (absolute or relative) to the module project Default value: `.` @@ -95,8 +93,6 @@ Run `spacetime help publish` for more detailed information. * `-s`, `--server ` — The nickname, domain name or URL of the server to host the database. * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime delete Deletes a SpacetimeDB database @@ -105,7 +101,6 @@ Deletes a SpacetimeDB database Run `spacetime help delete` for more detailed information. - ###### Arguments: * `` — The name or identity of the database to delete @@ -115,8 +110,6 @@ Run `spacetime help delete` for more detailed information. * `-s`, `--server ` — The nickname, host name or URL of the server hosting the database * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime logs Prints logs from a SpacetimeDB database @@ -125,7 +118,6 @@ Prints logs from a SpacetimeDB database Run `spacetime help logs` for more detailed information. - ###### Arguments: * `` — The name or identity of the database to print logs from @@ -140,11 +132,8 @@ Run `spacetime help logs` for more detailed information. Default value: `text` Possible values: `text`, `json` - * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime call Invokes a reducer function in a database. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -153,7 +142,6 @@ Invokes a reducer function in a database. WARNING: This command is UNSTABLE and Run `spacetime help call` for more detailed information. - ###### Arguments: * `` — The database name or identity to use to invoke the call @@ -166,8 +154,6 @@ Run `spacetime help call` for more detailed information. * `--anonymous` — Perform this action with an anonymous identity * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime describe Describe the structure of a database or entities within it. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -176,14 +162,12 @@ Describe the structure of a database or entities within it. WARNING: This comman Run `spacetime help describe` for more detailed information. - ###### Arguments: * `` — The name or identity of the database to describe * `` — Whether to describe a reducer or table Possible values: `reducer`, `table` - * `` — The name of the entity to describe ###### Options: @@ -193,8 +177,6 @@ Run `spacetime help describe` for more detailed information. * `-s`, `--server ` — The nickname, host name or URL of the server hosting the database * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime energy Invokes commands related to database budgets. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -206,8 +188,6 @@ Invokes commands related to database budgets. WARNING: This command is UNSTABLE * `balance` — Show current energy balance for an identity - - ## spacetime energy balance Show current energy balance for an identity @@ -220,8 +200,6 @@ Show current energy balance for an identity * `-s`, `--server ` — The nickname, host name or URL of the server from which to request balance information * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime sql Runs a SQL query on the database. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -240,8 +218,6 @@ Runs a SQL query on the database. WARNING: This command is UNSTABLE and subject * `-s`, `--server ` — The nickname, host name or URL of the server hosting the database * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime rename Rename a database @@ -250,7 +226,6 @@ Rename a database Run `spacetime rename --help` for more detailed information. - ###### Arguments: * `` — The database identity to rename @@ -261,8 +236,6 @@ Run `spacetime rename --help` for more detailed information. * `-s`, `--server ` — The nickname, host name or URL of the server on which to set the name * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime generate Generate client files for a spacetime module. @@ -284,14 +257,11 @@ Run `spacetime help publish` for more detailed information. * `-l`, `--lang ` — The language to generate Possible values: `csharp`, `typescript`, `rust` - * `--build-options ` — Options to pass to the build command, for example --build-options='--lint-dir=' - Default value: `` + Default value: \`\` * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime list Lists the databases attached to an identity. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -303,8 +273,6 @@ Lists the databases attached to an identity. WARNING: This command is UNSTABLE a * `-s`, `--server ` — The nickname, host name or URL of the server from which to list databases * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime login Manage your login to the SpacetimeDB CLI @@ -324,8 +292,6 @@ Manage your login to the SpacetimeDB CLI * `--server-issued-login ` — Log in to a SpacetimeDB server directly, without going through a global auth server * `--token ` — Bypass the login flow and use a login token directly - - ## spacetime login show Show the current login info @@ -336,8 +302,6 @@ Show the current login info * `--token` — Also show the auth token - - ## spacetime logout **Usage:** `spacetime logout [OPTIONS]` @@ -348,8 +312,6 @@ Show the current login info Default value: `https://spacetimedb.com` - - ## spacetime init Initializes a new spacetime project. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -368,9 +330,6 @@ Initializes a new spacetime project. WARNING: This command is UNSTABLE and subje Possible values: `csharp`, `rust` - - - ## spacetime build Builds a spacetime module. @@ -387,8 +346,6 @@ Builds a spacetime module. Default value: `src` * `-d`, `--debug` — Builds the module using debug instead of release (intended to speed up local iteration, not recommended for CI) - - ## spacetime server Manage the connection to the SpacetimeDB server. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -407,16 +364,12 @@ Manage the connection to the SpacetimeDB server. WARNING: This command is UNSTAB * `edit` — Update a saved server's nickname, host name or protocol * `clear` — Deletes all data from all local databases - - ## spacetime server list List stored server configurations **Usage:** `spacetime server list` - - ## spacetime server set-default Set the default server for future operations @@ -427,8 +380,6 @@ Set the default server for future operations * `` — The nickname, host name or URL of the new default server - - ## spacetime server add Add a new server configuration @@ -445,8 +396,6 @@ Add a new server configuration * `-d`, `--default` — Make the new server the default server for future operations * `--no-fingerprint` — Skip fingerprinting the server - - ## spacetime server remove Remove a saved server configuration @@ -461,8 +410,6 @@ Remove a saved server configuration * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime server fingerprint Show or update a saved server's fingerprint @@ -477,8 +424,6 @@ Show or update a saved server's fingerprint * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime server ping Checks to see if a SpacetimeDB host is online @@ -489,8 +434,6 @@ Checks to see if a SpacetimeDB host is online * `` — The nickname, host name or URL of the server to ping - - ## spacetime server edit Update a saved server's nickname, host name or protocol @@ -508,8 +451,6 @@ Update a saved server's nickname, host name or protocol * `--no-fingerprint` — Skip fingerprinting the server * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime server clear Deletes all data from all local databases @@ -518,11 +459,9 @@ Deletes all data from all local databases ###### Options: -* `--data-dir ` — The path to the server data directory to clear [default: that of the selected spacetime instance] +* `--data-dir ` — The path to the server data directory to clear \[default: that of the selected spacetime instance] * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). - - ## spacetime subscribe Subscribe to SQL queries on the database. WARNING: This command is UNSTABLE and subject to breaking changes. @@ -538,14 +477,12 @@ Subscribe to SQL queries on the database. WARNING: This command is UNSTABLE and * `-n`, `--num-updates ` — The number of subscription updates to receive before exiting * `-t`, `--timeout ` — The timeout, in seconds, after which to disconnect and stop receiving subscription messages. If `-n` is specified, it will stop after whichever - one comes first. + one comes first. * `--print-initial-update` — Print the initial update for the queries. * `--anonymous` — Perform this action with an anonymous identity * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). * `-s`, `--server ` — The nickname, host name or URL of the server hosting the database - - ## spacetime start Start a local SpacetimeDB instance @@ -566,9 +503,6 @@ Run `spacetime start --help` to see all options. Possible values: `standalone`, `cloud` - - - ## spacetime version Manage installed spacetime versions @@ -581,12 +515,7 @@ Run `spacetime version --help` to see all options. * `` — The args to pass to spacetimedb-update - -
- This document was generated automatically by - clap-markdown. - - +This document was generated automatically by clap-markdown. diff --git a/docs/docs/nav.js b/docs/docs/nav.js index 5b6e3d1a96..df06bbfb69 100644 --- a/docs/docs/nav.js +++ b/docs/docs/nav.js @@ -1,60 +1,96 @@ function page(title, slug, path, props) { - return { type: 'page', path, slug, title, ...props }; + return { type: 'page', path, slug, title, ...props }; } function section(title) { - return { type: 'section', title }; + return { type: 'section', title }; } const nav = { - items: [ - section('Intro'), - page('Overview', 'index', 'index.md'), // TODO(BREAKING): For consistency & clarity, 'index' slug should be renamed 'intro'? - page('Getting Started', 'getting-started', 'getting-started.md'), - section('Deploying'), - page('Maincloud', 'deploying/maincloud', 'deploying/maincloud.md'), - page('Self-Hosting SpacetimeDB', 'deploying/spacetimedb-standalone', 'deploying/spacetimedb-standalone.md'), - section('Unity Tutorial - Basic Multiplayer'), - page('Overview', 'unity', 'unity/index.md'), - page('1 - Setup', 'unity/part-1', 'unity/part-1.md'), - page('2 - Connecting to SpacetimeDB', 'unity/part-2', 'unity/part-2.md'), - page('3 - Gameplay', 'unity/part-3', 'unity/part-3.md'), - page('4 - Moving and Colliding', 'unity/part-4', 'unity/part-4.md'), - section('CLI Reference'), - page('CLI Reference', 'cli-reference', 'cli-reference.md'), - page('SpacetimeDB Standalone Configuration', 'cli-reference/standalone-config', 'cli-reference/standalone-config.md'), - section('Server Module Languages'), - page('Overview', 'modules', 'modules/index.md'), - page('Rust Quickstart', 'modules/rust/quickstart', 'modules/rust/quickstart.md'), - page('Rust Reference', 'modules/rust', 'modules/rust/index.md'), - page('C# Quickstart', 'modules/c-sharp/quickstart', 'modules/c-sharp/quickstart.md'), - page('C# Reference', 'modules/c-sharp', 'modules/c-sharp/index.md'), - section('Client SDK Languages'), - page('Overview', 'sdks', 'sdks/index.md'), - page('C# Quickstart', 'sdks/c-sharp/quickstart', 'sdks/c-sharp/quickstart.md'), - page('C# Reference', 'sdks/c-sharp', 'sdks/c-sharp/index.md'), - page('Rust Quickstart', 'sdks/rust/quickstart', 'sdks/rust/quickstart.md'), - page('Rust Reference', 'sdks/rust', 'sdks/rust/index.md'), - page('TypeScript Quickstart', 'sdks/typescript/quickstart', 'sdks/typescript/quickstart.md'), - page('TypeScript Reference', 'sdks/typescript', 'sdks/typescript/index.md'), - section('SQL'), - page('SQL Reference', 'sql', 'sql/index.md'), - section('Subscriptions'), - page('Subscription Reference', 'subscriptions', 'subscriptions/index.md'), - page('Subscription Semantics', 'subscriptions/semantics', 'subscriptions/semantics.md'), - section('Row Level Security'), - page('Row Level Security', 'rls', 'rls/index.md'), - section('How To'), - page('Incremental Migrations', 'how-to/incremental-migrations', 'how-to/incremental-migrations.md'), - page('Reject Client Connections', 'how-to/reject-client-connections', 'how-to/reject-client-connections.md'), - section('HTTP API'), - page('Authorization', 'http/authorization', 'http/authorization.md'), - page('`/identity`', 'http/identity', 'http/identity.md'), - page('`/database`', 'http/database', 'http/database.md'), - section('Internals'), - page('Module ABI Reference', 'webassembly-abi', 'webassembly-abi/index.md'), - page('SATS-JSON Data Format', 'sats-json', 'sats-json.md'), - page('BSATN Data Format', 'bsatn', 'bsatn.md'), - section('Appendix'), - page('Appendix', 'appendix', 'appendix.md'), - ], + items: [ + section('Intro'), + page('Overview', 'index', 'index.md'), // TODO(BREAKING): For consistency & clarity, 'index' slug should be renamed 'intro'? + page('Getting Started', 'getting-started', 'getting-started.md'), + section('Deploying'), + page('Maincloud', 'deploying/maincloud', 'deploying/maincloud.md'), + page( + 'Self-Hosting SpacetimeDB', + 'deploying/spacetimedb-standalone', + 'deploying/spacetimedb-standalone.md' + ), + section('Unity Tutorial - Basic Multiplayer'), + page('Overview', 'unity', 'unity/index.md'), + page('1 - Setup', 'unity/part-1', 'unity/part-1.md'), + page('2 - Connecting to SpacetimeDB', 'unity/part-2', 'unity/part-2.md'), + page('3 - Gameplay', 'unity/part-3', 'unity/part-3.md'), + page('4 - Moving and Colliding', 'unity/part-4', 'unity/part-4.md'), + section('CLI Reference'), + page('CLI Reference', 'cli-reference', 'cli-reference.md'), + page( + 'SpacetimeDB Standalone Configuration', + 'cli-reference/standalone-config', + 'cli-reference/standalone-config.md' + ), + section('Server Module Languages'), + page('Overview', 'modules', 'modules/index.md'), + page( + 'Rust Quickstart', + 'modules/rust/quickstart', + 'modules/rust/quickstart.md' + ), + page('Rust Reference', 'modules/rust', 'modules/rust/index.md'), + page( + 'C# Quickstart', + 'modules/c-sharp/quickstart', + 'modules/c-sharp/quickstart.md' + ), + page('C# Reference', 'modules/c-sharp', 'modules/c-sharp/index.md'), + section('Client SDK Languages'), + page('Overview', 'sdks', 'sdks/index.md'), + page( + 'C# Quickstart', + 'sdks/c-sharp/quickstart', + 'sdks/c-sharp/quickstart.md' + ), + page('C# Reference', 'sdks/c-sharp', 'sdks/c-sharp/index.md'), + page('Rust Quickstart', 'sdks/rust/quickstart', 'sdks/rust/quickstart.md'), + page('Rust Reference', 'sdks/rust', 'sdks/rust/index.md'), + page( + 'TypeScript Quickstart', + 'sdks/typescript/quickstart', + 'sdks/typescript/quickstart.md' + ), + page('TypeScript Reference', 'sdks/typescript', 'sdks/typescript/index.md'), + section('SQL'), + page('SQL Reference', 'sql', 'sql/index.md'), + section('Subscriptions'), + page('Subscription Reference', 'subscriptions', 'subscriptions/index.md'), + page( + 'Subscription Semantics', + 'subscriptions/semantics', + 'subscriptions/semantics.md' + ), + section('Row Level Security'), + page('Row Level Security', 'rls', 'rls/index.md'), + section('How To'), + page( + 'Incremental Migrations', + 'how-to/incremental-migrations', + 'how-to/incremental-migrations.md' + ), + page( + 'Reject Client Connections', + 'how-to/reject-client-connections', + 'how-to/reject-client-connections.md' + ), + section('HTTP API'), + page('Authorization', 'http/authorization', 'http/authorization.md'), + page('`/identity`', 'http/identity', 'http/identity.md'), + page('`/database`', 'http/database', 'http/database.md'), + section('Internals'), + page('Module ABI Reference', 'webassembly-abi', 'webassembly-abi/index.md'), + page('SATS-JSON Data Format', 'sats-json', 'sats-json.md'), + page('BSATN Data Format', 'bsatn', 'bsatn.md'), + section('Appendix'), + page('Appendix', 'appendix', 'appendix.md'), + ], }; export default nav; diff --git a/docs/nav.ts b/docs/nav.ts index b5e854ca80..a1024b4327 100644 --- a/docs/nav.ts +++ b/docs/nav.ts @@ -35,7 +35,11 @@ const nav: Nav = { section('Deploying'), page('Maincloud', 'deploying/maincloud', 'deploying/maincloud.md'), - page('Self-Hosting SpacetimeDB', 'deploying/spacetimedb-standalone', 'deploying/spacetimedb-standalone.md'), + page( + 'Self-Hosting SpacetimeDB', + 'deploying/spacetimedb-standalone', + 'deploying/spacetimedb-standalone.md' + ), section('Unity Tutorial - Basic Multiplayer'), page('Overview', 'unity', 'unity/index.md'), @@ -89,14 +93,26 @@ const nav: Nav = { section('Subscriptions'), page('Subscription Reference', 'subscriptions', 'subscriptions/index.md'), - page('Subscription Semantics', 'subscriptions/semantics', 'subscriptions/semantics.md'), + page( + 'Subscription Semantics', + 'subscriptions/semantics', + 'subscriptions/semantics.md' + ), section('Row Level Security'), page('Row Level Security', 'rls', 'rls/index.md'), section('How To'), - page('Incremental Migrations', 'how-to/incremental-migrations', 'how-to/incremental-migrations.md'), - page('Reject Client Connections', 'how-to/reject-client-connections', 'how-to/reject-client-connections.md'), + page( + 'Incremental Migrations', + 'how-to/incremental-migrations', + 'how-to/incremental-migrations.md' + ), + page( + 'Reject Client Connections', + 'how-to/reject-client-connections', + 'how-to/reject-client-connections.md' + ), section('HTTP API'), page('Authorization', 'http/authorization', 'http/authorization.md'), diff --git a/docs/package.json b/docs/package.json index 6aa3861d28..3b8ca488c9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -8,14 +8,19 @@ }, "devDependencies": { "@types/node": "^22.10.2", + "prettier": "^3.3.3", "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", "tsx": "^4.19.2", - "typescript": "^5.3.2", + "typescript": "^5.6.3", "unified": "^11.0.5", "unist-util-visit": "^5.0.0" }, "scripts": { - "build": "tsc --project ./tsconfig.json", + "build": "tsc --project ./tsconfig.json && pnpm fix-markdown && prettier --write docs/nav.js", + "fix-markdown": "tools/markdown-fix.mjs docs/cli-reference.md", + "format": "pnpm fix-markdown && prettier --write .", + "lint": "prettier . --check --verbose", "check-links": "tsx scripts/checkLinks.ts" }, "author": "Clockwork Labs", diff --git a/docs/scripts/checkLinks.ts b/docs/scripts/checkLinks.ts index b7d4ead725..a31c03c06d 100644 --- a/docs/scripts/checkLinks.ts +++ b/docs/scripts/checkLinks.ts @@ -11,7 +11,7 @@ function extractSlugToPathMap(nav: { items: any[] }): Map { const slugToPath = new Map(); function traverseNav(items: any[]): void { - items.forEach((item) => { + items.forEach(item => { if (item.type === 'page' && item.slug && item.path) { const resolvedPath = path.resolve(__dirname, '../docs', item.path); slugToPath.set(`/docs/${item.slug}`, resolvedPath); @@ -29,13 +29,17 @@ function extractSlugToPathMap(nav: { items: any[] }): Map { function validatePathsExist(slugToPath: Map): void { slugToPath.forEach((filePath, slug) => { if (!fs.existsSync(filePath)) { - throw new Error(`File not found: ${filePath} (Referenced by slug: ${slug})`); + throw new Error( + `File not found: ${filePath} (Referenced by slug: ${slug})` + ); } }); } // Function to extract links and images from markdown files with line numbers -function extractLinksAndImagesFromMarkdown(filePath: string): { link: string; type: 'image' | 'link'; line: number }[] { +function extractLinksAndImagesFromMarkdown( + filePath: string +): { link: string; type: 'image' | 'link'; line: number }[] { const content = fs.readFileSync(filePath, 'utf-8'); const tree = unified().use(remarkParse).parse(content); @@ -45,7 +49,11 @@ function extractLinksAndImagesFromMarkdown(filePath: string): { link: string; ty const link = node.url; const line = node.position?.start?.line ?? 0; if (link) { - results.push({ link, type: node.type === 'image' ? 'image' : 'link', line }); + results.push({ + link, + type: node.type === 'image' ? 'image' : 'link', + line, + }); } }); @@ -66,13 +74,22 @@ function resolveLink(link: string, currentSlug: string): string { // Resolve relative links based on slug const currentSlugDir = path.dirname(currentSlug); - const resolvedSlug = path.normalize(path.join(currentSlugDir, link)).replace(/\\/g, '/'); - return resolvedSlug.startsWith('/docs') ? resolvedSlug : `/docs${resolvedSlug}`; + const resolvedSlug = path + .normalize(path.join(currentSlugDir, link)) + .replace(/\\/g, '/'); + return resolvedSlug.startsWith('/docs') + ? resolvedSlug + : `/docs${resolvedSlug}`; } // Function to check if the links in .md files match the slugs in nav.ts and validate fragments/images function checkLinks(): void { - const brokenLinks: { file: string; link: string; type: 'image' | 'link'; line: number }[] = []; + const brokenLinks: { + file: string; + link: string; + type: 'image' | 'link'; + line: number; + }[] = []; let totalFiles = 0; let totalLinks = 0; let validLinks = 0; @@ -106,7 +123,7 @@ function checkLinks(): void { totalFiles = mdFiles.length; - mdFiles.forEach((file) => { + mdFiles.forEach(file => { const linksAndImages = extractLinksAndImagesFromMarkdown(file); totalLinks += linksAndImages.length; @@ -127,7 +144,9 @@ function checkLinks(): void { if (type === 'image') { // Validate image paths - const normalizedLink = resolvedLink.startsWith('/') ? resolvedLink.slice(1) : resolvedLink; + const normalizedLink = resolvedLink.startsWith('/') + ? resolvedLink.slice(1) + : resolvedLink; const imagePath = path.resolve(__dirname, '../', normalizedLink); if (!fs.existsSync(imagePath)) { @@ -229,7 +248,7 @@ function getMarkdownFiles(dir: string): string[] { let files: string[] = []; const items = fs.readdirSync(dir); - items.forEach((item) => { + items.forEach(item => { const fullPath = path.join(dir, item); const stat = fs.lstatSync(fullPath); diff --git a/docs/scripts/checkNav.mjs b/docs/scripts/checkNav.mjs index 62f745ba69..0e07da3a40 100644 --- a/docs/scripts/checkNav.mjs +++ b/docs/scripts/checkNav.mjs @@ -11,23 +11,24 @@ const navPath = '../docs/nav.mjs'; const mdListPath = process.argv[2]; if (!mdListPath) { - console.error('Usage: node checkNav.mjs '); - process.exit(1); + console.error('Usage: node checkNav.mjs '); + process.exit(1); } const navFile = path.resolve(__dirname, navPath); const nav = await import(pathToFileURL(navFile).href).then(mod => mod.default); -const extractPathsFromNav = (items) => - items.filter(item => item.type === 'page').map(page => page.path); +const extractPathsFromNav = items => + items.filter(item => item.type === 'page').map(page => page.path); const navPaths = extractPathsFromNav(nav.items); const navPathSet = new Set(navPaths); -const expectedMdPaths = fs.readFileSync(path.resolve(__dirname, mdListPath), 'utf8') - .split('\n') - .map(line => line.trim()) - .filter(Boolean); +const expectedMdPaths = fs + .readFileSync(path.resolve(__dirname, mdListPath), 'utf8') + .split('\n') + .map(line => line.trim()) + .filter(Boolean); const expectedPathSet = new Set(expectedMdPaths); const missingInNav = expectedMdPaths.filter(p => !navPathSet.has(p)); @@ -36,19 +37,19 @@ const extraInNav = navPaths.filter(p => !expectedPathSet.has(p)); let failed = false; if (missingInNav.length > 0) { - console.error('❌ These docs are missing from nav:'); - missingInNav.forEach(p => console.error(`- ${p}`)); - failed = true; + console.error('❌ These docs are missing from nav:'); + missingInNav.forEach(p => console.error(`- ${p}`)); + failed = true; } if (extraInNav.length > 0) { - console.error('❌ These docs are listed in nav but not found under docs/:'); - extraInNav.forEach(p => console.error(`- ${p}`)); - failed = true; + console.error('❌ These docs are listed in nav but not found under docs/:'); + extraInNav.forEach(p => console.error(`- ${p}`)); + failed = true; } if (!failed) { - console.log('✅ nav list matches filesystem.'); + console.log('✅ nav list matches filesystem.'); } else { - process.exit(1); + process.exit(1); } diff --git a/docs/tools/markdown-fix.mjs b/docs/tools/markdown-fix.mjs new file mode 100755 index 0000000000..678aa4ac91 --- /dev/null +++ b/docs/tools/markdown-fix.mjs @@ -0,0 +1,99 @@ +#!/usr/bin/env node +import { readFileSync, writeFileSync } from 'fs'; +import { unified } from 'unified'; +import remarkParse from 'remark-parse'; +import remarkStringify from 'remark-stringify'; + +/** + * Plugin that: + * 1) ## `Title` -> ## Title + * 2) ###### **Heading** -> ###### Heading + */ +function pluginTransform() { + return (tree, file) => { + const visit = (node, fn, parent = null, index = -1) => { + fn(node, parent, index); + if (node.children) { + node.children.forEach((child, i) => visit(child, fn, node, i)); + } + }; + + // Normalize lists to "tight" so Prettier won't remove blank lines later + visit(tree, node => { + if (node.type === 'list') { + node.spread = false; + if (Array.isArray(node.children)) { + for (const li of node.children) { + if (li && li.type === 'listItem') { + li.spread = false; + } + } + } + } + }); + + visit(tree, node => { + if (node.type !== 'heading') return; + + // Case 1: H2 with a single inlineCode -> replace with plain text + if ( + node.depth === 2 && + node.children?.length === 1 && + node.children[0].type === 'inlineCode' + ) { + node.children = [{ type: 'text', value: node.children[0].value }]; + } + + // Case 2: H6 with a single strong -> wrap in HTML ... + if ( + node.depth === 6 && + node.children?.length === 1 && + node.children[0].type === 'strong' + ) { + const strong = node.children[0]; + const textOnly = + strong.children?.length === 1 && strong.children[0].type === 'text' + ? strong.children[0].value + : null; + + if (textOnly !== null) { + // Emit raw HTML inside the heading + node.children = [{ type: 'html', value: `${textOnly}` }]; + } + } + }); + }; +} + +function transformMarkdown(input) { + return unified() + .use(remarkParse) + .use(pluginTransform) + .use(remarkStringify, { + // Keep HTML the way we injected it + handlers: {}, + }) + .processSync(input) + .toString(); +} + +function main(argv) { + const files = argv.slice(2); + if (files.length === 0) { + console.error('Usage: markdown-fix.mjs [more.md]'); + process.exit(2); + } + + for (const f of files) { + const before = readFileSync(f, 'utf8'); + const after = transformMarkdown(before); + if (after !== before) { + writeFileSync(f, after, 'utf8'); + console.log(`Updated: ${f}`); + } else { + console.log(`OK (no change): ${f}`); + } + } +} + +main(process.argv); diff --git a/package.json b/package.json new file mode 100644 index 0000000000..4b94ba5cf0 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "spacetimedb-monorepo", + "private": true, + "packageManager": "pnpm@9.7.0", + "engines": { "node": ">=18.0.0", "pnpm": ">=9.0.0" }, + "scripts": { + "format": "pnpm --filter ./crates/bindings-typescript run format && pnpm --filter ./docs run format && pnpm --filter ./sdks/typescript run format", + "lint": "pnpm --filter ./crates/bindings-typescript run lint && pnpm --filter ./docs run lint && pnpm --filter ./sdks/typescript run lint", + "build": "pnpm --filter ./crates/bindings-typescript run build && pnpm --filter ./docs run build && pnpm --filter ./sdks/typescript run build", + "test": "pnpm --filter ./crates/bindings-typescript run test && pnpm --filter ./docs run test && pnpm --filter ./sdks/typescript run test", + "generate": "pnpm --filter ./crates/bindings-typescript run generate && pnpm --filter ./docs run generate && pnpm --filter ./sdks/typescript run generate", + "clean": "pnpm -r exec rimraf dist .tsbuildinfo coverage" + }, + "devDependencies": { + "@eslint/js": "^9.17.0", + "@types/node": "^22.10.2", + "@typescript-eslint/eslint-plugin": "^8.18.2", + "@typescript-eslint/parser": "^8.18.2", + "eslint": "^9.17.0", + "eslint-plugin-react-hooks": "^5.0.0", + "eslint-plugin-react-refresh": "^0.4.16", + "globals": "^15.14.0", + "prettier": "^3.3.3", + "rimraf": "^6.0.1", + "typescript": "~5.6.2", + "vitest": "^2.1.9" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 63dfa2a141..da64f81448 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,45 @@ settings: importers: + .: + devDependencies: + '@eslint/js': + specifier: ^9.17.0 + version: 9.33.0 + '@types/node': + specifier: ^22.10.2 + version: 22.18.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.6.3))(eslint@9.33.0)(typescript@5.6.3) + '@typescript-eslint/parser': + specifier: ^8.18.2 + version: 8.40.0(eslint@9.33.0)(typescript@5.6.3) + eslint: + specifier: ^9.17.0 + version: 9.33.0 + eslint-plugin-react-hooks: + specifier: ^5.0.0 + version: 5.2.0(eslint@9.33.0) + eslint-plugin-react-refresh: + specifier: ^0.4.16 + version: 0.4.20(eslint@9.33.0) + globals: + specifier: ^15.14.0 + version: 15.15.0 + prettier: + specifier: ^3.3.3 + version: 3.6.2 + rimraf: + specifier: ^6.0.1 + version: 6.0.1 + typescript: + specifier: ~5.6.2 + version: 5.6.3 + vitest: + specifier: ^2.1.9 + version: 2.1.9(@types/node@22.18.0)(jsdom@26.1.0)(terser@5.43.1) + crates/bindings-typescript: dependencies: '@zxing/text-encoding': @@ -47,7 +86,38 @@ importers: 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/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.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.18.0 + 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.9.2 + unified: + specifier: ^11.0.5 + version: 11.0.5 + unist-util-visit: + specifier: ^5.0.0 + version: 5.0.0 sdks/typescript: devDependencies: @@ -113,8 +183,8 @@ importers: specifier: ^18.3.5 version: 18.3.7(@types/react@18.3.23) '@vitejs/plugin-react': - 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)) + specifier: ^5.0.1 + version: 5.0.2(vite@7.1.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4)) eslint: specifier: ^9.17.0 version: 9.33.0 @@ -140,8 +210,8 @@ importers: specifier: ^8.18.2 version: 8.40.0(eslint@9.33.0)(typescript@5.6.3) vite: - specifier: ^6.3.5 - version: 6.3.5(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + specifier: ^7.1.3 + version: 7.1.4(@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) @@ -172,7 +242,7 @@ importers: 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) + 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) sdks/typescript/packages/test-app: dependencies: @@ -755,6 +825,14 @@ packages: '@types/node': optional: true + '@isaacs/balanced-match@4.0.1': + resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} + engines: {node: 20 || >=22} + + '@isaacs/brace-expansion@5.0.0': + resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==} + engines: {node: 20 || >=22} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -815,6 +893,9 @@ packages: '@rolldown/pluginutils@1.0.0-beta.27': resolution: {integrity: sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==} + '@rolldown/pluginutils@1.0.0-beta.34': + resolution: {integrity: sha512-LyAREkZHP5pMom7c24meKmJCdhf2hEyvam2q0unr3or9ydwDL+DJ8chTF6Av/RFPb3rH8UFBdMzO5MxTZW97oA==} + '@rollup/rollup-android-arm-eabi@4.46.3': resolution: {integrity: sha512-UmTdvXnLlqQNOCJnyksjPs1G4GqXNGW1LrzCe8+8QoaLhhDeTXYBgJ3k6x61WIhlHX2U+VzEJ55TtIjR/HTySA==} cpu: [arm] @@ -977,6 +1058,9 @@ packages: '@types/chai@5.2.2': resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} + '@types/debug@4.1.12': + resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/deep-eql@4.0.2': resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} @@ -998,9 +1082,18 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/mdast@4.0.4': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + + '@types/ms@2.1.0': + resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + '@types/node@22.18.0': + resolution: {integrity: sha512-m5ObIqwsUp6BZzyiy4RdZpzWGub9bqLJMvZDD0QMXhxjqMHMENlj+SqF5QxoUwaQNFe+8kz8XM8ZQhqkQPTgMQ==} + '@types/node@24.3.0': resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==} @@ -1018,6 +1111,9 @@ packages: '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/unist@3.0.3': + resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} @@ -1083,18 +1179,18 @@ 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} peerDependencies: vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + '@vitejs/plugin-react@5.0.2': + resolution: {integrity: sha512-tmyFgixPZCx2+e6VO9TNITWcCQl8+Nl/E8YbAyPVv85QCc7/A3JrdfG2A8gIzvVhWuzMOVrFW1aReaNxrI6tbw==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + '@vitest/expect@2.1.9': resolution: {integrity: sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==} @@ -1228,6 +1324,9 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + bail@2.0.2: + resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1290,6 +1389,9 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + character-entities@2.0.2: + resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + chardet@2.1.0: resolution: {integrity: sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==} @@ -1368,6 +1470,9 @@ packages: decimal.js@10.6.0: resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} + decode-named-character-reference@1.2.0: + resolution: {integrity: sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==} + deep-eql@5.0.2: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} @@ -1383,6 +1488,9 @@ packages: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} + devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1522,6 +1630,9 @@ packages: resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + extendable-error@0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} @@ -1600,6 +1711,9 @@ packages: get-tsconfig@4.10.1: resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==} + github-slugger@2.0.0: + resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1612,6 +1726,11 @@ packages: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true + glob@11.0.3: + resolution: {integrity: sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==} + engines: {node: 20 || >=22} + hasBin: true + globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -1690,6 +1809,10 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} @@ -1707,6 +1830,10 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jackspeak@4.1.1: + resolution: {integrity: sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==} + engines: {node: 20 || >=22} + jest-diff@29.7.0: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1811,6 +1938,9 @@ packages: lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + longest-streak@3.1.0: + resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} + loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -1821,6 +1951,10 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@11.1.0: + resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==} + engines: {node: 20 || >=22} + lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -1834,10 +1968,85 @@ packages: make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + mdast-util-from-markdown@2.0.2: + resolution: {integrity: sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==} + + mdast-util-phrasing@4.1.0: + resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + + mdast-util-to-markdown@2.1.2: + resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==} + + mdast-util-to-string@4.0.0: + resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + micromark-core-commonmark@2.0.3: + resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==} + + micromark-factory-destination@2.0.1: + resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==} + + micromark-factory-label@2.0.1: + resolution: {integrity: sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==} + + micromark-factory-space@2.0.1: + resolution: {integrity: sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==} + + micromark-factory-title@2.0.1: + resolution: {integrity: sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==} + + micromark-factory-whitespace@2.0.1: + resolution: {integrity: sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==} + + micromark-util-character@2.1.1: + resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} + + micromark-util-chunked@2.0.1: + resolution: {integrity: sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==} + + micromark-util-classify-character@2.0.1: + resolution: {integrity: sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==} + + micromark-util-combine-extensions@2.0.1: + resolution: {integrity: sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==} + + micromark-util-decode-numeric-character-reference@2.0.2: + resolution: {integrity: sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==} + + micromark-util-decode-string@2.0.1: + resolution: {integrity: sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==} + + micromark-util-encode@2.0.1: + resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==} + + micromark-util-html-tag-name@2.0.1: + resolution: {integrity: sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==} + + micromark-util-normalize-identifier@2.0.1: + resolution: {integrity: sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==} + + micromark-util-resolve-all@2.0.1: + resolution: {integrity: sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==} + + micromark-util-sanitize-uri@2.0.1: + resolution: {integrity: sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==} + + micromark-util-subtokenize@2.1.0: + resolution: {integrity: sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==} + + micromark-util-symbol@2.0.1: + resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==} + + micromark-util-types@2.0.2: + resolution: {integrity: sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==} + + micromark@4.0.2: + resolution: {integrity: sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==} + micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -1846,6 +2055,10 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} + minimatch@10.0.3: + resolution: {integrity: sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==} + engines: {node: 20 || >=22} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -1957,6 +2170,10 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.0: + resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} + engines: {node: 20 || >=22} + path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -2062,10 +2279,6 @@ 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'} @@ -2086,6 +2299,12 @@ packages: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} + remark-parse@11.0.0: + resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} + + remark-stringify@11.0.0: + resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -2101,6 +2320,11 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + rimraf@6.0.1: + resolution: {integrity: sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==} + engines: {node: 20 || >=22} + hasBin: true + rollup@4.46.3: resolution: {integrity: sha512-RZn2XTjXb8t5g13f5YclGoilU/kwT696DIkY3sywjdZidNSi3+vseaQov7D7BZXVJCPv3pDWUN69C78GGbXsKw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -2304,6 +2528,9 @@ packages: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true + trough@2.2.0: + resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} + ts-api-utils@2.1.0: resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} engines: {node: '>=18.12'} @@ -2375,6 +2602,9 @@ packages: 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==} @@ -2382,6 +2612,21 @@ packages: resolution: {integrity: sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==} engines: {node: '>=18.17'} + unified@11.0.5: + resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} + + unist-util-is@6.0.0: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + + unist-util-stringify-position@4.0.0: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + + unist-util-visit-parents@6.0.1: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} + + unist-util-visit@5.0.0: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -2398,6 +2643,12 @@ packages: v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + vfile-message@4.0.3: + resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==} + + vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + vite-node@2.1.9: resolution: {integrity: sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -2656,6 +2907,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zwitch@2.0.4: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} + snapshots: '@adobe/css-tools@4.4.4': {} @@ -3181,6 +3435,12 @@ snapshots: optionalDependencies: '@types/node': 24.3.0 + '@isaacs/balanced-match@4.0.1': {} + + '@isaacs/brace-expansion@5.0.0': + dependencies: + '@isaacs/balanced-match': 4.0.1 + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -3203,7 +3463,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 24.3.0 + '@types/node': 22.18.0 '@types/yargs': 17.0.33 chalk: 4.1.2 @@ -3264,6 +3524,8 @@ snapshots: '@rolldown/pluginutils@1.0.0-beta.27': {} + '@rolldown/pluginutils@1.0.0-beta.34': {} + '@rollup/rollup-android-arm-eabi@4.46.3': optional: true @@ -3395,6 +3657,10 @@ snapshots: dependencies: '@types/deep-eql': 4.0.2 + '@types/debug@4.1.12': + dependencies: + '@types/ms': 2.1.0 + '@types/deep-eql@4.0.2': {} '@types/estree@1.0.8': {} @@ -3416,8 +3682,18 @@ snapshots: '@types/json-schema@7.0.15': {} + '@types/mdast@4.0.4': + dependencies: + '@types/unist': 3.0.3 + + '@types/ms@2.1.0': {} + '@types/node@12.20.55': {} + '@types/node@22.18.0': + dependencies: + undici-types: 6.21.0 + '@types/node@24.3.0': dependencies: undici-types: 7.10.0 @@ -3435,6 +3711,8 @@ snapshots: '@types/stack-utils@2.0.3': {} + '@types/unist@3.0.3': {} + '@types/yargs-parser@21.0.3': {} '@types/yargs@17.0.33': @@ -3615,17 +3893,6 @@ snapshots: '@typescript-eslint/types': 8.40.0 eslint-visitor-keys: 4.2.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) - '@types/babel__core': 7.20.5 - 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@5.4.19(@types/node@24.3.0)(terser@5.43.1))': dependencies: '@babel/core': 7.28.3 @@ -3638,6 +3905,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@vitejs/plugin-react@5.0.2(vite@7.1.4(@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.34 + '@types/babel__core': 7.20.5 + react-refresh: 0.17.0 + vite: 7.1.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) + transitivePeerDependencies: + - supports-color + '@vitest/expect@2.1.9': dependencies: '@vitest/spy': 2.1.9 @@ -3653,6 +3932,14 @@ snapshots: chai: 5.3.1 tinyrainbow: 2.0.0 + '@vitest/mocker@2.1.9(vite@5.4.19(@types/node@22.18.0)(terser@5.43.1))': + dependencies: + '@vitest/spy': 2.1.9 + estree-walker: 3.0.3 + magic-string: 0.30.17 + optionalDependencies: + vite: 5.4.19(@types/node@22.18.0)(terser@5.43.1) + '@vitest/mocker@2.1.9(vite@5.4.19(@types/node@24.3.0)(terser@5.43.1))': dependencies: '@vitest/spy': 2.1.9 @@ -3775,6 +4062,8 @@ snapshots: assertion-error@2.0.1: {} + bail@2.0.2: {} + balanced-match@1.0.2: {} base64-js@1.5.1: {} @@ -3839,6 +4128,8 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + character-entities@2.0.2: {} + chardet@2.1.0: {} check-error@2.1.1: {} @@ -3897,6 +4188,10 @@ snapshots: decimal.js@10.6.0: {} + decode-named-character-reference@1.2.0: + dependencies: + character-entities: 2.0.2 + deep-eql@5.0.2: {} deep-is@0.1.4: {} @@ -3905,6 +4200,10 @@ snapshots: detect-indent@6.1.0: {} + devlop@1.1.0: + dependencies: + dequal: 2.0.3 + diff-sequences@29.6.3: {} diff@4.0.2: {} @@ -4090,6 +4389,8 @@ snapshots: jest-message-util: 29.7.0 jest-util: 29.7.0 + extend@3.0.2: {} + extendable-error@0.1.7: {} fast-deep-equal@3.1.3: {} @@ -4171,6 +4472,8 @@ snapshots: dependencies: resolve-pkg-maps: 1.0.0 + github-slugger@2.0.0: {} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -4188,6 +4491,15 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 + glob@11.0.3: + dependencies: + foreground-child: 3.3.1 + jackspeak: 4.1.1 + minimatch: 10.0.3 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 2.0.0 + globals@14.0.0: {} globals@15.15.0: {} @@ -4254,6 +4566,8 @@ snapshots: is-number@7.0.0: {} + is-plain-obj@4.1.0: {} + is-potential-custom-element-name@1.0.1: {} is-subdir@1.2.0: @@ -4270,6 +4584,10 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jackspeak@4.1.1: + dependencies: + '@isaacs/cliui': 8.0.2 + jest-diff@29.7.0: dependencies: chalk: 4.1.2 @@ -4301,7 +4619,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 24.3.0 + '@types/node': 22.18.0 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -4392,6 +4710,8 @@ snapshots: lodash.startcase@4.4.0: {} + longest-streak@3.1.0: {} + loose-envify@1.4.0: dependencies: js-tokens: 4.0.0 @@ -4400,6 +4720,8 @@ snapshots: lru-cache@10.4.3: {} + lru-cache@11.1.0: {} + lru-cache@5.1.1: dependencies: yallist: 3.1.1 @@ -4412,8 +4734,179 @@ snapshots: make-error@1.3.6: {} + mdast-util-from-markdown@2.0.2: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + decode-named-character-reference: 1.2.0 + devlop: 1.1.0 + mdast-util-to-string: 4.0.0 + micromark: 4.0.2 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-decode-string: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + unist-util-stringify-position: 4.0.0 + transitivePeerDependencies: + - supports-color + + mdast-util-phrasing@4.1.0: + dependencies: + '@types/mdast': 4.0.4 + unist-util-is: 6.0.0 + + mdast-util-to-markdown@2.1.2: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + longest-streak: 3.1.0 + mdast-util-phrasing: 4.1.0 + mdast-util-to-string: 4.0.0 + micromark-util-classify-character: 2.0.1 + micromark-util-decode-string: 2.0.1 + unist-util-visit: 5.0.0 + zwitch: 2.0.4 + + mdast-util-to-string@4.0.0: + dependencies: + '@types/mdast': 4.0.4 + merge2@1.4.1: {} + micromark-core-commonmark@2.0.3: + dependencies: + decode-named-character-reference: 1.2.0 + devlop: 1.1.0 + micromark-factory-destination: 2.0.1 + micromark-factory-label: 2.0.1 + micromark-factory-space: 2.0.1 + micromark-factory-title: 2.0.1 + micromark-factory-whitespace: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-classify-character: 2.0.1 + micromark-util-html-tag-name: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-subtokenize: 2.1.0 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-factory-destination@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-factory-label@2.0.1: + dependencies: + devlop: 1.1.0 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-factory-space@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-types: 2.0.2 + + micromark-factory-title@2.0.1: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-factory-whitespace@2.0.1: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-character@2.1.1: + dependencies: + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-chunked@2.0.1: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-classify-character@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-combine-extensions@2.0.1: + dependencies: + micromark-util-chunked: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-decode-numeric-character-reference@2.0.2: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-decode-string@2.0.1: + dependencies: + decode-named-character-reference: 1.2.0 + micromark-util-character: 2.1.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-symbol: 2.0.1 + + micromark-util-encode@2.0.1: {} + + micromark-util-html-tag-name@2.0.1: {} + + micromark-util-normalize-identifier@2.0.1: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-resolve-all@2.0.1: + dependencies: + micromark-util-types: 2.0.2 + + micromark-util-sanitize-uri@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-encode: 2.0.1 + micromark-util-symbol: 2.0.1 + + micromark-util-subtokenize@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-util-symbol@2.0.1: {} + + micromark-util-types@2.0.2: {} + + micromark@4.0.2: + dependencies: + '@types/debug': 4.1.12 + debug: 4.4.1 + decode-named-character-reference: 1.2.0 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.3 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-combine-extensions: 2.0.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-encode: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-subtokenize: 2.1.0 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + transitivePeerDependencies: + - supports-color + micromatch@4.0.8: dependencies: braces: 3.0.3 @@ -4421,6 +4914,10 @@ snapshots: min-indent@1.0.1: {} + minimatch@10.0.3: + dependencies: + '@isaacs/brace-expansion': 5.0.0 + minimatch@3.1.2: dependencies: brace-expansion: 1.1.12 @@ -4520,6 +5017,11 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-scurry@2.0.0: + dependencies: + lru-cache: 11.1.0 + minipass: 7.1.2 + path-type@4.0.0: {} pathe@1.1.2: {} @@ -4593,8 +5095,6 @@ snapshots: react-is@18.3.1: {} - react-refresh@0.14.2: {} - react-refresh@0.17.0: {} react@18.3.1: @@ -4615,6 +5115,21 @@ snapshots: indent-string: 4.0.0 strip-indent: 3.0.0 + remark-parse@11.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.2 + micromark-util-types: 2.0.2 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + + remark-stringify@11.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-to-markdown: 2.1.2 + unified: 11.0.5 + resolve-from@4.0.0: {} resolve-from@5.0.0: {} @@ -4623,6 +5138,11 @@ snapshots: reusify@1.1.0: {} + rimraf@6.0.1: + dependencies: + glob: 11.0.3 + package-json-from-dist: 1.0.1 + rollup@4.46.3: dependencies: '@types/estree': 1.0.8 @@ -4823,6 +5343,8 @@ snapshots: tree-kill@1.2.2: {} + trough@2.2.0: {} + ts-api-utils@2.1.0(typescript@5.6.3): dependencies: typescript: 5.6.3 @@ -4946,10 +5468,41 @@ snapshots: ufo@1.6.1: {} + undici-types@6.21.0: {} + undici-types@7.10.0: {} undici@6.21.3: {} + unified@11.0.5: + dependencies: + '@types/unist': 3.0.3 + bail: 2.0.2 + devlop: 1.1.0 + extend: 3.0.2 + is-plain-obj: 4.1.0 + trough: 2.2.0 + vfile: 6.0.3 + + unist-util-is@6.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-stringify-position@4.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-visit-parents@6.0.1: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + + unist-util-visit@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + universalify@0.1.2: {} update-browserslist-db@1.1.3(browserslist@4.25.2): @@ -4964,6 +5517,34 @@ snapshots: v8-compile-cache-lib@3.0.1: {} + vfile-message@4.0.3: + dependencies: + '@types/unist': 3.0.3 + unist-util-stringify-position: 4.0.0 + + vfile@6.0.3: + dependencies: + '@types/unist': 3.0.3 + vfile-message: 4.0.3 + + vite-node@2.1.9(@types/node@22.18.0)(terser@5.43.1): + dependencies: + cac: 6.7.14 + debug: 4.4.1 + es-module-lexer: 1.7.0 + pathe: 1.1.2 + vite: 5.4.19(@types/node@22.18.0)(terser@5.43.1) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vite-node@2.1.9(@types/node@24.3.0)(terser@5.43.1): dependencies: cac: 6.7.14 @@ -4988,7 +5569,7 @@ snapshots: 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) + vite: 7.1.4(@types/node@24.3.0)(terser@5.43.1)(tsx@4.20.4) transitivePeerDependencies: - '@types/node' - jiti @@ -5003,6 +5584,16 @@ snapshots: - tsx - yaml + vite@5.4.19(@types/node@22.18.0)(terser@5.43.1): + dependencies: + esbuild: 0.21.5 + postcss: 8.5.6 + rollup: 4.46.3 + optionalDependencies: + '@types/node': 22.18.0 + fsevents: 2.3.3 + terser: 5.43.1 + vite@5.4.19(@types/node@24.3.0)(terser@5.43.1): dependencies: esbuild: 0.21.5 @@ -5041,6 +5632,42 @@ snapshots: terser: 5.43.1 tsx: 4.20.4 + vitest@2.1.9(@types/node@22.18.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@22.18.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.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinypool: 1.1.1 + tinyrainbow: 1.2.0 + vite: 5.4.19(@types/node@22.18.0)(terser@5.43.1) + vite-node: 2.1.9(@types/node@22.18.0)(terser@5.43.1) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 22.18.0 + jsdom: 26.1.0 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vitest@2.1.9(@types/node@24.3.0)(jsdom@26.1.0)(terser@5.43.1): dependencies: '@vitest/expect': 2.1.9 @@ -5077,7 +5704,7 @@ 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): + vitest@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): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 @@ -5103,6 +5730,7 @@ snapshots: 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/debug': 4.1.12 '@types/node': 24.3.0 jsdom: 26.1.0 transitivePeerDependencies: @@ -5185,3 +5813,5 @@ snapshots: yn@3.1.1: {} yocto-queue@0.1.0: {} + + zwitch@2.0.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index b901c33a57..b025bf4203 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,4 +3,5 @@ packages: - 'sdks/typescript' - 'sdks/typescript/packages/sdk' - 'sdks/typescript/packages/test-app' - - 'sdks/typescript/examples/quickstart-chat' \ No newline at end of file + - 'sdks/typescript/examples/quickstart-chat' + - 'docs' \ No newline at end of file diff --git a/sdks/typescript/.github/workflows/cr.yml b/sdks/typescript/.github/workflows/cr.yml index 01353168c4..44c4c98849 100644 --- a/sdks/typescript/.github/workflows/cr.yml +++ b/sdks/typescript/.github/workflows/cr.yml @@ -18,7 +18,7 @@ jobs: run_install: true - name: Build - run: pnpm compile + run: pnpm build - name: Release run: cd packages/sdk && pnpm dlx pkg-pr-new publish --compact --pnpm diff --git a/sdks/typescript/.github/workflows/release.yml b/sdks/typescript/.github/workflows/release.yml index 5f97085ad9..9514288968 100644 --- a/sdks/typescript/.github/workflows/release.yml +++ b/sdks/typescript/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: node-version: 18.x cache: 'pnpm' - - run: pnpm compile + - run: pnpm build - name: Create Release Pull Request or Publish id: changesets diff --git a/sdks/typescript/examples/quickstart-chat/README.md b/sdks/typescript/examples/quickstart-chat/README.md index 195abec459..92a1c58637 100644 --- a/sdks/typescript/examples/quickstart-chat/README.md +++ b/sdks/typescript/examples/quickstart-chat/README.md @@ -8,10 +8,10 @@ You can follow the instructions for creating your own SpacetimeDB module here: [ In order to run this example, you need to: -- `pnpm compile` in the root directory (`spacetimedb-typescriptsdk`) +- `pnpm build` in the root directory (`spacetimedb-typescriptsdk`) - `pnpm install` in this directory -- `pnpm run build` in this directory -- `pnpm run dev` in this directory to run the example +- `pnpm build` in this directory +- `pnpm dev` in this directory to run the example Below is copied from the original template README: diff --git a/sdks/typescript/examples/quickstart-chat/package.json b/sdks/typescript/examples/quickstart-chat/package.json index 1b2c0ee75c..f7fd77f90d 100644 --- a/sdks/typescript/examples/quickstart-chat/package.json +++ b/sdks/typescript/examples/quickstart-chat/package.json @@ -9,7 +9,7 @@ "format": "prettier --write .", "lint": "eslint . && prettier . --check", "preview": "vite preview", - "test": "vitest", + "test": "vitest run", "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", @@ -28,7 +28,7 @@ "@types/jest": "^29.5.14", "@types/react": "^18.3.18", "@types/react-dom": "^18.3.5", - "@vitejs/plugin-react": "^4.2.1", + "@vitejs/plugin-react": "^5.0.1", "eslint": "^9.17.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.16", @@ -37,7 +37,7 @@ "prettier": "^3.3.3", "typescript": "~5.6.2", "typescript-eslint": "^8.18.2", - "vite": "^6.3.5", + "vite": "^7.1.3", "vitest": "2.1.9" } } diff --git a/sdks/typescript/examples/quickstart-chat/vitest.config.ts b/sdks/typescript/examples/quickstart-chat/vitest.config.ts index 150380175e..34d8192ff2 100644 --- a/sdks/typescript/examples/quickstart-chat/vitest.config.ts +++ b/sdks/typescript/examples/quickstart-chat/vitest.config.ts @@ -7,7 +7,7 @@ export default defineConfig({ globals: true, environment: 'jsdom', // or "node" if you're not testing DOM setupFiles: './src/setupTests.ts', - testTimeout: 30_000, // give extra time for real connections - hookTimeout: 30_000, + testTimeout: 15_000, // give extra time for real connections + hookTimeout: 15_000, }, }); diff --git a/sdks/typescript/package.json b/sdks/typescript/package.json index 82c865001f..ac61030c7f 100644 --- a/sdks/typescript/package.json +++ b/sdks/typescript/package.json @@ -6,14 +6,14 @@ "pnpm": ">=9.0.0" }, "scripts": { - "compile": "cd packages/sdk && pnpm compile", + "build": "cd packages/sdk && pnpm build", "changeset": "changeset", "ci:release": "changeset publish", "ci:version": "changeset version", "format": "prettier --write .", "lint": "prettier . --check", - "test": "pnpm -r test", - "generate": "pnpm --filter ./examples/quickstart-chat generate && pnpm --filter ./packages/sdks generate && pnpm --filter ./packages/test-app generate" + "test": "pnpm -r --filter \"./packages/*\" run test", + "generate": "pnpm -r --filter \"./packages/*\" run generate" }, "devDependencies": { "@changesets/changelog-github": "^0.5.0", diff --git a/sdks/typescript/packages/sdk/README.md b/sdks/typescript/packages/sdk/README.md index 884c2a9262..62068de7dc 100644 --- a/sdks/typescript/packages/sdk/README.md +++ b/sdks/typescript/packages/sdk/README.md @@ -69,5 +69,5 @@ connection.reducers.createPlayer(); To run the tests, do: ```sh -pnpm compile && pnpm test +pnpm build && pnpm test ``` diff --git a/sdks/typescript/packages/sdk/package.json b/sdks/typescript/packages/sdk/package.json index df928ba277..2b1ab13f42 100644 --- a/sdks/typescript/packages/sdk/package.json +++ b/sdks/typescript/packages/sdk/package.json @@ -24,7 +24,7 @@ "./package.json": "./package.json" }, "scripts": { - "compile": "tsup", + "build": "tsup", "format": "prettier --write .", "lint": "prettier . --check", "test": "vitest run", diff --git a/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts b/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts deleted file mode 100644 index 913f9eb83d..0000000000 --- a/sdks/typescript/packages/sdk/tests/algebraic_type.test.ts +++ /dev/null @@ -1,168 +0,0 @@ -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/serde.test.ts b/sdks/typescript/packages/sdk/tests/serde.test.ts new file mode 100644 index 0000000000..cb9759c1b6 --- /dev/null +++ b/sdks/typescript/packages/sdk/tests/serde.test.ts @@ -0,0 +1,154 @@ +import { describe, expect, test } from 'vitest'; +import { AlgebraicType, BinaryReader, BinaryWriter } from 'spacetimedb'; + +describe('it correctly serializes and deserializes algebraic values', () => { + test('when it serializes and deserializes with a product type', () => { + 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(); + + expect(buffer).toEqual( + new Uint8Array([6, 0, 0, 0, 102, 111, 111, 98, 97, 114]) + ); + + const deserializedValue = AlgebraicType.deserializeValue( + new BinaryReader(buffer), + algebraic_type + ); + + expect(deserializedValue).toEqual(value); + }); + + test('when it serializes and deserializes with a sum type', () => { + const value = { tag: 'bar', value: 5 }; + const algebraic_type = AlgebraicType.Sum({ + variants: [ + { name: 'bar', algebraicType: AlgebraicType.U32 }, + { name: 'foo', algebraicType: AlgebraicType.String }, + ], + }); + const binaryWriter = new BinaryWriter(1024); + AlgebraicType.serializeValue(binaryWriter, algebraic_type, value); + + const buffer = binaryWriter.getBuffer(); + + expect(buffer).toEqual(new Uint8Array([0, 5, 0, 0, 0])); + + const deserializedValue = AlgebraicType.deserializeValue( + new BinaryReader(buffer), + algebraic_type + ); + + expect(deserializedValue).toEqual(value); + }); + + test('when it serializes and deserializes an Identity type', () => { + const value = { + __identity__: BigInt(1234567890123456789012345678901234567890n), + }; + + const algebraic_type = AlgebraicType.createIdentityType(); + const binaryWriter = new BinaryWriter(1024); + AlgebraicType.serializeValue(binaryWriter, algebraic_type, value); + + const buffer = binaryWriter.getBuffer(); + + // Little endian encoding of the number 1234567890123456789012345678901234567890n + expect(buffer).toEqual( + new Uint8Array([ + 210, 10, 63, 206, 150, 95, 188, 172, 184, 243, 219, 192, 117, 32, 201, + 160, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ]) + ); + + const deserializedValue = AlgebraicType.deserializeValue( + new BinaryReader(buffer), + algebraic_type + ); + + expect(deserializedValue).toEqual(value); + }); + + test('when it serializes and deserializes an Interval ScheduleAt', () => { + const value = { + tag: 'Interval', + value: { + __time_duration_micros__: BigInt(1234567890123456789n), + }, + }; + + const algebraic_type = AlgebraicType.createScheduleAtType(); + const binaryWriter = new BinaryWriter(1024); + AlgebraicType.serializeValue(binaryWriter, algebraic_type, value); + + const buffer = binaryWriter.getBuffer(); + expect(buffer).toEqual( + new Uint8Array([0, 21, 129, 233, 125, 244, 16, 34, 17]) + ); + + const deserializedValue = AlgebraicType.deserializeValue( + new BinaryReader(buffer), + algebraic_type + ); + + expect(deserializedValue).toEqual(value); + }); + + test('when it serializes and deserializes a Time ScheduleAt', () => { + const value = { + tag: 'Time', + value: { + __timestamp_micros_since_unix_epoch__: BigInt(1234567890123456789n), + }, + }; + + const algebraic_type = AlgebraicType.createScheduleAtType(); + const binaryWriter = new BinaryWriter(1024); + AlgebraicType.serializeValue(binaryWriter, algebraic_type, value); + + const buffer = binaryWriter.getBuffer(); + expect(buffer).toEqual( + new Uint8Array([1, 21, 129, 233, 125, 244, 16, 34, 17]) + ); + + const deserializedValue = AlgebraicType.deserializeValue( + new BinaryReader(buffer), + algebraic_type + ); + + expect(deserializedValue).toEqual(value); + }); + + test('when it serializes and deserializes a ConnectionId ', () => { + const U128_MAX = (1n << 128n) - 1n; + const value = { + __connection_id__: U128_MAX, + }; + + const algebraic_type = AlgebraicType.createConnectionIdType(); + const binaryWriter = new BinaryWriter(1024); + AlgebraicType.serializeValue(binaryWriter, algebraic_type, value); + + const buffer = binaryWriter.getBuffer(); + expect(buffer).toEqual( + new Uint8Array([ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, + ]) + ); + + const deserializedValue = AlgebraicType.deserializeValue( + new BinaryReader(buffer), + algebraic_type + ); + + console.log(deserializedValue); + + expect(deserializedValue).toEqual(value); + }); +}); diff --git a/sdks/typescript/vitest.config.ts b/sdks/typescript/vitest.config.ts deleted file mode 100644 index 7de9bbad8a..0000000000 --- a/sdks/typescript/vitest.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -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'], - }, -}); From adbfe3b0bd5fcdc1eef86e5814d14f4fe7e46610 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Thu, 4 Sep 2025 13:08:24 -0700 Subject: [PATCH 22/28] Tidy up CLI reference generation flow (#3226) # Description of Changes Some minor cleanups in the flow for regenerating the CLI reference. # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing - [x] Existing CI passes Co-authored-by: Zeke Foppa --- docs/README.md | 9 ++------- docs/package.json | 2 +- docs/{tools => scripts}/markdown-fix.mjs | 0 3 files changed, 3 insertions(+), 8 deletions(-) rename docs/{tools => scripts}/markdown-fix.mjs (100%) diff --git a/docs/README.md b/docs/README.md index 1b7bcbf42d..bb44a5b80f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -37,13 +37,8 @@ git push -u origin a-branch-name-that-describes-my-change > NOTE! If you make a change to `nav.ts` you will have to run `npm run build` to generate a new `docs/nav.js` file. #### CLI Reference Section -1. Run `cargo run --features markdown-docs -p spacetimedb-cli > cli-reference.md` - -We currently don't properly render markdown backticks and bolding that are inside of headers, so do these two manual replacements to make them look okay (these have only been tested on Linux): -```bash -sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md -sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 \2!' docs/cli-reference.md -``` +1. Run `cargo run --features markdown-docs -p spacetimedb-cli > docs/cli-reference.md` +2. Run `pnpm format` ### Checking Links diff --git a/docs/package.json b/docs/package.json index 3b8ca488c9..9e90ebf22f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -18,7 +18,7 @@ }, "scripts": { "build": "tsc --project ./tsconfig.json && pnpm fix-markdown && prettier --write docs/nav.js", - "fix-markdown": "tools/markdown-fix.mjs docs/cli-reference.md", + "fix-markdown": "scripts/markdown-fix.mjs docs/cli-reference.md", "format": "pnpm fix-markdown && prettier --write .", "lint": "prettier . --check --verbose", "check-links": "tsx scripts/checkLinks.ts" diff --git a/docs/tools/markdown-fix.mjs b/docs/scripts/markdown-fix.mjs similarity index 100% rename from docs/tools/markdown-fix.mjs rename to docs/scripts/markdown-fix.mjs From 8d14efa2261a3aa0c8740d99fd17a1d7881f414c Mon Sep 17 00:00:00 2001 From: Mario Montoya Date: Thu, 4 Sep 2025 15:19:44 -0500 Subject: [PATCH 23/28] Fix the smoke test so it take the server URL from the config.toml (#3227) # Description of Changes Closes https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1998#event-19488677475 Now the smoke test parse the `config.toml` for the correct address for connecting. # API and ABI breaking changes # Expected complexity level and risk 1 # Testing - [x] Run the smoke both on public / private --- smoketests/__init__.py | 51 +++++++++++++++++++--------------- smoketests/tests/quickstart.py | 13 +++++++-- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/smoketests/__init__.py b/smoketests/__init__.py index ed9d16cac6..4c4dc6e895 100644 --- a/smoketests/__init__.py +++ b/smoketests/__init__.py @@ -270,11 +270,7 @@ class Smoketest(unittest.TestCase): # and **not raise any exceptions to the caller**. return ReturnThread(run).join - # Make an HTTP call with `method` to `path`. - # - # If the response is 200, return the body. - # Otherwise, throw an `Exception` constructed with two arguments, the response object and the body. - def api_call(self, method, path, body = None, headers = {}): + def get_server_address(self): with open(self.config_path, "rb") as f: config = tomllib.load(f) token = config['spacetimedb_token'] @@ -284,24 +280,35 @@ class Smoketest(unittest.TestCase): raise Exception(f"Unable to find server in config with nickname {server_name}") host = server_config['host'] protocol = server_config['protocol'] - conn = None - if protocol == "http": - conn = http.client.HTTPConnection(host) - elif protocol == "https": - conn = http.client.HTTPSConnection(host) - else: - raise Exception(f"Unknown protocol: {protocol}") - auth = {"Authorization": f'Bearer {token}'} - headers.update(auth) - log_cmd([method, path]) - conn.request(method, path, body, headers) - resp = conn.getresponse() - body = resp.read() - logging.debug(f"{resp.status} {body}") - if resp.status != 200: - raise Exception(resp, body) - return body + return dict(host=host, protocol=protocol, token=token) + + # Make an HTTP call with `method` to `path`. + # + # If the response is 200, return the body. + # Otherwise, throw an `Exception` constructed with two arguments, the response object and the body. + def api_call(self, method, path, body=None, headers={}): + server = self.get_server_address() + host = server["host"] + protocol = server["protocol"] + token = server["token"] + conn = None + if protocol == "http": + conn = http.client.HTTPConnection(host) + elif protocol == "https": + conn = http.client.HTTPSConnection(host) + else: + raise Exception(f"Unknown protocol: {protocol}") + auth = {"Authorization": f'Bearer {token}'} + headers.update(auth) + log_cmd([method, path]) + conn.request(method, path, body, headers) + resp = conn.getresponse() + body = resp.read() + logging.debug(f"{resp.status} {body}") + if resp.status != 200: + raise Exception(resp, body) + return body @classmethod def write_module_code(cls, module_code): diff --git a/smoketests/tests/quickstart.py b/smoketests/tests/quickstart.py index 7cf80c7bb4..59a2d2fe1f 100644 --- a/smoketests/tests/quickstart.py +++ b/smoketests/tests/quickstart.py @@ -81,7 +81,6 @@ class BaseQuickstart(Smoketest): base_path = Path(self.enterClassContext(tempfile.TemporaryDirectory())) server_path = base_path / "server" self.project_path = server_path - self.config_path = server_path / "config.toml" self.generate_server(server_path) self.publish_module(f"quickstart-chat-{self.lang}", capture_stderr=True, clear=True) @@ -125,6 +124,10 @@ class BaseQuickstart(Smoketest): for src, dst in self.replacements.items(): main = main.replace(src, dst) main += "\n" + self.extra_code + server = self.get_server_address() + host = server["host"] + protocol = server["protocol"] + main = main.replace("http://localhost:3000", f"{protocol}://{host}") _write_file(client_path / self.client_file, main) self.check("", client_path, self.connected_str) @@ -142,9 +145,11 @@ class Rust(BaseQuickstart): run_cmd = ["cargo", "run"] build_cmd = ["cargo", "build"] - # Replace the interactive user input to allow direct testing replacements = { - "user_input_loop(&ctx)": "user_input_direct(&ctx)" + # Replace the interactive user input to allow direct testing + "user_input_loop(&ctx)": "user_input_direct(&ctx)", + # Don't cache the token, because it will cause the test to fail if we run against a non-default server (because we don't cache the corresponding signing keypair) + ".with_token(creds_store()": "//.with_token(creds_store()" } extra_code = """ fn user_input_direct(ctx: &DbConnection) { @@ -194,6 +199,8 @@ class CSharp(BaseQuickstart): "InputLoop();": "UserInputDirect();", ".OnConnect(OnConnected)": ".OnConnect(OnConnectedSignal)", ".OnConnectError(OnConnectError)": ".OnConnectError(OnConnectErrorSignal)", + # Don't cache the token, because it will cause the test to fail if we run against a non-default server (because we don't cache the corresponding signing keypair) + ".WithToken(AuthToken.Token)": "//.WithToken(AuthToken.Token)", "Main();": "" # To put the main function at the end so it can see the new functions } # So we can wait for the connection to be established... From 953ea94e570ec836676128102bf9b926ea1cac83 Mon Sep 17 00:00:00 2001 From: joshua-spacetime Date: Thu, 4 Sep 2025 15:13:46 -0700 Subject: [PATCH 24/28] utilities for archiving snapshots (#3224) # Description of Changes Adds utilities for marking and deleting snapshot directories that have been archived # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing Testing will be handled by the patch that adds archival --- crates/paths/src/server.rs | 11 +++++++++++ crates/snapshot/src/lib.rs | 27 ++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/crates/paths/src/server.rs b/crates/paths/src/server.rs index 5da628544d..6aa7bec13a 100644 --- a/crates/paths/src/server.rs +++ b/crates/paths/src/server.rs @@ -206,6 +206,11 @@ path_type! { SnapshotDirPath: dir } +path_type! { + /// An archived snapshot directory. `{data-dir}/replica/$replica_id/snapshots/$tx_offset.archived_snapshot` + ArchivedSnapshotDirPath: dir +} + impl SnapshotDirPath { pub fn snapshot_file(&self, tx_offset: u64) -> SnapshotFilePath { let file_name = format!("{tx_offset:0>20}.snapshot_bsatn"); @@ -221,6 +226,12 @@ impl SnapshotDirPath { fs::rename(self, invalid_path) } + pub fn rename_as_archived(&self) -> io::Result { + let path = self.0.with_extension("archived_snapshot"); + fs::rename(self, &path)?; + Ok(ArchivedSnapshotDirPath(path)) + } + pub fn tx_offset(&self) -> Option { self.0 .file_stem() diff --git a/crates/snapshot/src/lib.rs b/crates/snapshot/src/lib.rs index 3fa32cb33f..5f0c8eabf2 100644 --- a/crates/snapshot/src/lib.rs +++ b/crates/snapshot/src/lib.rs @@ -30,7 +30,7 @@ use spacetimedb_fs_utils::{ lockfile::{Lockfile, LockfileError}, }; use spacetimedb_lib::Identity; -use spacetimedb_paths::server::{SnapshotDirPath, SnapshotFilePath, SnapshotsPath}; +use spacetimedb_paths::server::{ArchivedSnapshotDirPath, SnapshotDirPath, SnapshotFilePath, SnapshotsPath}; use spacetimedb_paths::FromPathUnchecked; use spacetimedb_primitives::TableId; use spacetimedb_sats::{bsatn, de::Deserialize, ser::Serialize}; @@ -40,6 +40,7 @@ use spacetimedb_table::{ page_pool::PagePool, table::Table, }; +use std::fs; use std::{ collections::BTreeMap, collections::HashMap, @@ -145,6 +146,9 @@ pub const SNAPSHOT_FILE_EXT: &str = "snapshot_bsatn"; /// File extension of snapshots which have been marked invalid by [`SnapshotRepository::invalidate_newer_snapshots`]. pub const INVALID_SNAPSHOT_DIR_EXT: &str = "invalid_snapshot"; +/// File extension of snapshots which have been archived +pub const ARCHIVED_SNAPSHOT_EXT: &str = "archived_snapshot"; + #[derive(Clone, Serialize, Deserialize)] /// The hash and refcount of a single blob in the blob store. struct BlobEntry { @@ -890,6 +894,27 @@ impl SnapshotRepository { })) } + /// Return an interator of [`ArchivedSnapshotDirPath`] for all the archived snapshot directories on disk + pub fn all_archived_snapshots(&self) -> Result, SnapshotError> { + Ok(self + .root + // Item = Result + .read_dir()? + // Item = DirEntry + .filter_map(Result::ok) + // Item = PathBuf + .map(|dirent| dirent.path()) + // Ignore entries not shaped like snapshot directories. + .filter(|path| path.extension() == Some(OsStr::new(ARCHIVED_SNAPSHOT_EXT))) + // Item = ArchivedSnapshotDirPath + .map(ArchivedSnapshotDirPath::from_path_unchecked)) + } + + /// Delete an archived snapshot from disk + pub fn remove_archived_snapshot(path: &ArchivedSnapshotDirPath) -> Result<(), SnapshotError> { + fs::remove_dir_all(path).map_err(SnapshotError::Io) + } + /// Return the `TxOffset` of the highest-offset complete snapshot in the repository. /// /// Does not verify that the snapshot of the returned `TxOffset` is valid and uncorrupted, From 8b0e5b1ee3fc3aa3119f5f95b1dc659ec7024361 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Thu, 4 Sep 2025 20:44:20 -0400 Subject: [PATCH 25/28] Remove version number and git commit from all but one file in codegen (#3216) # Description of Changes Closes https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1987 # API and ABI breaking changes This does not affect any APIs but it does affect the code generated # Expected complexity level and risk 1 # Testing - [ ] Snap tests --- .../Runtime/Internal/Autogen/IndexType.g.cs | 2 - .../Runtime/Internal/Autogen/Lifecycle.g.cs | 2 - .../Internal/Autogen/MiscModuleExport.g.cs | 2 - .../Internal/Autogen/RawColumnDefV8.g.cs | 2 - .../Autogen/RawColumnDefaultValueV9.g.cs | 2 - .../Internal/Autogen/RawConstraintDataV9.g.cs | 2 - .../Internal/Autogen/RawConstraintDefV8.g.cs | 2 - .../Internal/Autogen/RawConstraintDefV9.g.cs | 2 - .../Internal/Autogen/RawIndexAlgorithm.g.cs | 2 - .../Internal/Autogen/RawIndexDefV8.g.cs | 2 - .../Internal/Autogen/RawIndexDefV9.g.cs | 2 - .../Autogen/RawMiscModuleExportV9.g.cs | 2 - .../Internal/Autogen/RawModuleDef.g.cs | 2 - .../Internal/Autogen/RawModuleDefV8.g.cs | 2 - .../Internal/Autogen/RawModuleDefV9.g.cs | 2 - .../Internal/Autogen/RawReducerDefV9.g.cs | 2 - .../Autogen/RawRowLevelSecurityDefV9.g.cs | 2 - .../Internal/Autogen/RawScheduleDefV9.g.cs | 2 - .../Internal/Autogen/RawScopedTypeNameV9.g.cs | 2 - .../Internal/Autogen/RawSequenceDefV8.g.cs | 2 - .../Internal/Autogen/RawSequenceDefV9.g.cs | 2 - .../Internal/Autogen/RawTableDefV8.g.cs | 2 - .../Internal/Autogen/RawTableDefV9.g.cs | 2 - .../Internal/Autogen/RawTypeDefV9.g.cs | 2 - .../Autogen/RawUniqueConstraintDataV9.g.cs | 2 - .../Runtime/Internal/Autogen/ReducerDef.g.cs | 2 - .../Runtime/Internal/Autogen/TableAccess.g.cs | 2 - .../Runtime/Internal/Autogen/TableDesc.g.cs | 2 - .../Runtime/Internal/Autogen/TableType.g.cs | 2 - .../Runtime/Internal/Autogen/TypeAlias.g.cs | 2 - .../Runtime/Internal/Autogen/Typespace.g.cs | 2 - .../src/autogen/algebraic_type_type.ts | 2 - .../src/autogen/algebraic_type_variants.ts | 2 - .../src/autogen/index_type_type.ts | 2 - .../src/autogen/index_type_variants.ts | 2 - .../src/autogen/lifecycle_type.ts | 2 - .../src/autogen/lifecycle_variants.ts | 2 - .../src/autogen/misc_module_export_type.ts | 2 - .../autogen/misc_module_export_variants.ts | 2 - .../src/autogen/product_type_element_type.ts | 2 - .../src/autogen/product_type_type.ts | 2 - .../src/autogen/raw_column_def_v_8_type.ts | 2 - .../raw_column_default_value_v_9_type.ts | 2 - .../autogen/raw_constraint_data_v_9_type.ts | 2 - .../raw_constraint_data_v_9_variants.ts | 2 - .../autogen/raw_constraint_def_v_8_type.ts | 2 - .../autogen/raw_constraint_def_v_9_type.ts | 2 - .../src/autogen/raw_index_algorithm_type.ts | 2 - .../autogen/raw_index_algorithm_variants.ts | 2 - .../src/autogen/raw_index_def_v_8_type.ts | 2 - .../src/autogen/raw_index_def_v_9_type.ts | 2 - .../raw_misc_module_export_v_9_type.ts | 2 - .../raw_misc_module_export_v_9_variants.ts | 2 - .../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 - .../raw_row_level_security_def_v_9_type.ts | 2 - .../src/autogen/raw_schedule_def_v_9_type.ts | 2 - .../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 - .../src/autogen/raw_table_def_v_8_type.ts | 2 - .../src/autogen/raw_table_def_v_9_type.ts | 2 - .../src/autogen/raw_type_def_v_9_type.ts | 2 - .../raw_unique_constraint_data_v_9_type.ts | 2 - .../src/autogen/reducer_def_type.ts | 2 - .../src/autogen/sum_type_type.ts | 2 - .../src/autogen/sum_type_variant_type.ts | 2 - .../src/autogen/table_access_type.ts | 2 - .../src/autogen/table_access_variants.ts | 2 - .../src/autogen/table_desc_type.ts | 2 - .../src/autogen/table_type_type.ts | 2 - .../src/autogen/table_type_variants.ts | 2 - .../src/autogen/type_alias_type.ts | 2 - .../src/autogen/typespace_type.ts | 2 - crates/codegen/src/csharp.rs | 15 +++- crates/codegen/src/rust.rs | 17 ++-- crates/codegen/src/typescript.rs | 22 +++-- crates/codegen/src/util.rs | 3 + .../snapshots/codegen__codegen_csharp.snap | 84 ----------------- .../snapshots/codegen__codegen_rust.snap | 84 ----------------- .../codegen__codegen_typescript.snap | 90 ------------------- .../Scripts/autogen/Reducers/CircleDecay.g.cs | 2 - .../autogen/Reducers/CircleRecombine.g.cs | 2 - .../Scripts/autogen/Reducers/Connect.g.cs | 2 - .../autogen/Reducers/ConsumeEntity.g.cs | 2 - .../Scripts/autogen/Reducers/Disconnect.g.cs | 2 - .../Scripts/autogen/Reducers/EnterGame.g.cs | 2 - .../autogen/Reducers/MoveAllPlayers.g.cs | 2 - .../Scripts/autogen/Reducers/PlayerSplit.g.cs | 2 - .../Scripts/autogen/Reducers/Respawn.g.cs | 2 - .../Scripts/autogen/Reducers/SpawnFood.g.cs | 2 - .../Scripts/autogen/Reducers/Suicide.g.cs | 2 - .../autogen/Reducers/UpdatePlayerInput.g.cs | 2 - .../Scripts/autogen/SpacetimeDBClient.g.cs | 2 +- .../Assets/Scripts/autogen/Tables/Circle.g.cs | 2 - .../autogen/Tables/CircleDecayTimer.g.cs | 2 - .../autogen/Tables/CircleRecombineTimer.g.cs | 2 - .../Assets/Scripts/autogen/Tables/Config.g.cs | 2 - .../autogen/Tables/ConsumeEntityTimer.g.cs | 2 - .../Assets/Scripts/autogen/Tables/Entity.g.cs | 2 - .../Assets/Scripts/autogen/Tables/Food.g.cs | 2 - .../autogen/Tables/LoggedOutCircle.g.cs | 2 - .../autogen/Tables/LoggedOutEntity.g.cs | 2 - .../autogen/Tables/LoggedOutPlayer.g.cs | 2 - .../autogen/Tables/MoveAllPlayersTimer.g.cs | 2 - .../Assets/Scripts/autogen/Tables/Player.g.cs | 2 - .../autogen/Tables/SpawnFoodTimer.g.cs | 2 - .../Assets/Scripts/autogen/Types/Circle.g.cs | 2 - .../autogen/Types/CircleDecayTimer.g.cs | 2 - .../autogen/Types/CircleRecombineTimer.g.cs | 2 - .../Assets/Scripts/autogen/Types/Config.g.cs | 2 - .../autogen/Types/ConsumeEntityTimer.g.cs | 2 - .../Scripts/autogen/Types/DbVector2.g.cs | 2 - .../Assets/Scripts/autogen/Types/Entity.g.cs | 2 - .../Assets/Scripts/autogen/Types/Food.g.cs | 2 - .../autogen/Types/MoveAllPlayersTimer.g.cs | 2 - .../Assets/Scripts/autogen/Types/Player.g.cs | 2 - .../Scripts/autogen/Types/SpawnFoodTimer.g.cs | 2 - .../Reducers/ClientConnected.g.cs | 2 - .../Reducers/ClientDisconnected.g.cs | 2 - .../module_bindings/Reducers/SendMessage.g.cs | 2 - .../module_bindings/Reducers/SetName.g.cs | 2 - .../module_bindings/SpacetimeDBClient.g.cs | 2 +- .../module_bindings/Tables/Message.g.cs | 2 - .../client/module_bindings/Tables/User.g.cs | 2 - .../client/module_bindings/Types/Message.g.cs | 2 - .../client/module_bindings/Types/User.g.cs | 2 - .../src/module_bindings/connected_table.rs | 2 - .../src/module_bindings/connected_type.rs | 2 - .../src/module_bindings/disconnected_table.rs | 2 - .../src/module_bindings/disconnected_type.rs | 2 - .../identity_connected_reducer.rs | 2 - .../identity_disconnected_reducer.rs | 2 - .../src/module_bindings/mod.rs | 2 +- .../src/module_bindings/b_tree_u_32_type.rs | 2 - .../src/module_bindings/btree_u_32_table.rs | 2 - .../src/module_bindings/byte_struct_type.rs | 2 - .../delete_from_btree_u_32_reducer.rs | 2 - .../delete_large_table_reducer.rs | 2 - .../module_bindings/delete_pk_bool_reducer.rs | 2 - .../delete_pk_connection_id_reducer.rs | 2 - .../delete_pk_i_128_reducer.rs | 2 - .../module_bindings/delete_pk_i_16_reducer.rs | 2 - .../delete_pk_i_256_reducer.rs | 2 - .../module_bindings/delete_pk_i_32_reducer.rs | 2 - .../module_bindings/delete_pk_i_64_reducer.rs | 2 - .../module_bindings/delete_pk_i_8_reducer.rs | 2 - .../delete_pk_identity_reducer.rs | 2 - .../delete_pk_string_reducer.rs | 2 - .../delete_pk_u_128_reducer.rs | 2 - .../module_bindings/delete_pk_u_16_reducer.rs | 2 - .../delete_pk_u_256_reducer.rs | 2 - ...lete_pk_u_32_insert_pk_u_32_two_reducer.rs | 2 - .../module_bindings/delete_pk_u_32_reducer.rs | 2 - .../delete_pk_u_32_two_reducer.rs | 2 - .../module_bindings/delete_pk_u_64_reducer.rs | 2 - .../module_bindings/delete_pk_u_8_reducer.rs | 2 - .../delete_unique_bool_reducer.rs | 2 - .../delete_unique_connection_id_reducer.rs | 2 - .../delete_unique_i_128_reducer.rs | 2 - .../delete_unique_i_16_reducer.rs | 2 - .../delete_unique_i_256_reducer.rs | 2 - .../delete_unique_i_32_reducer.rs | 2 - .../delete_unique_i_64_reducer.rs | 2 - .../delete_unique_i_8_reducer.rs | 2 - .../delete_unique_identity_reducer.rs | 2 - .../delete_unique_string_reducer.rs | 2 - .../delete_unique_u_128_reducer.rs | 2 - .../delete_unique_u_16_reducer.rs | 2 - .../delete_unique_u_256_reducer.rs | 2 - .../delete_unique_u_32_reducer.rs | 2 - .../delete_unique_u_64_reducer.rs | 2 - .../delete_unique_u_8_reducer.rs | 2 - .../module_bindings/enum_with_payload_type.rs | 2 - .../every_primitive_struct_type.rs | 2 - .../module_bindings/every_vec_struct_type.rs | 2 - .../indexed_simple_enum_table.rs | 2 - .../indexed_simple_enum_type.rs | 2 - .../module_bindings/indexed_table_2_table.rs | 2 - .../module_bindings/indexed_table_2_type.rs | 2 - .../module_bindings/indexed_table_table.rs | 2 - .../src/module_bindings/indexed_table_type.rs | 2 - .../insert_call_timestamp_reducer.rs | 2 - ...insert_caller_one_connection_id_reducer.rs | 2 - .../insert_caller_one_identity_reducer.rs | 2 - .../insert_caller_pk_connection_id_reducer.rs | 2 - .../insert_caller_pk_identity_reducer.rs | 2 - ...ert_caller_unique_connection_id_reducer.rs | 2 - .../insert_caller_unique_identity_reducer.rs | 2 - ...insert_caller_vec_connection_id_reducer.rs | 2 - .../insert_caller_vec_identity_reducer.rs | 2 - .../insert_into_btree_u_32_reducer.rs | 2 - ...insert_into_indexed_simple_enum_reducer.rs | 2 - .../insert_into_pk_btree_u_32_reducer.rs | 2 - .../insert_large_table_reducer.rs | 2 - .../insert_one_bool_reducer.rs | 2 - .../insert_one_byte_struct_reducer.rs | 2 - .../insert_one_connection_id_reducer.rs | 2 - .../insert_one_enum_with_payload_reducer.rs | 2 - ...sert_one_every_primitive_struct_reducer.rs | 2 - .../insert_one_every_vec_struct_reducer.rs | 2 - .../insert_one_f_32_reducer.rs | 2 - .../insert_one_f_64_reducer.rs | 2 - .../insert_one_i_128_reducer.rs | 2 - .../insert_one_i_16_reducer.rs | 2 - .../insert_one_i_256_reducer.rs | 2 - .../insert_one_i_32_reducer.rs | 2 - .../insert_one_i_64_reducer.rs | 2 - .../module_bindings/insert_one_i_8_reducer.rs | 2 - .../insert_one_identity_reducer.rs | 2 - .../insert_one_simple_enum_reducer.rs | 2 - .../insert_one_string_reducer.rs | 2 - .../insert_one_timestamp_reducer.rs | 2 - .../insert_one_u_128_reducer.rs | 2 - .../insert_one_u_16_reducer.rs | 2 - .../insert_one_u_256_reducer.rs | 2 - .../insert_one_u_32_reducer.rs | 2 - .../insert_one_u_64_reducer.rs | 2 - .../module_bindings/insert_one_u_8_reducer.rs | 2 - .../insert_one_unit_struct_reducer.rs | 2 - ...t_option_every_primitive_struct_reducer.rs | 2 - .../insert_option_i_32_reducer.rs | 2 - .../insert_option_identity_reducer.rs | 2 - .../insert_option_simple_enum_reducer.rs | 2 - .../insert_option_string_reducer.rs | 2 - .../insert_option_vec_option_i_32_reducer.rs | 2 - .../module_bindings/insert_pk_bool_reducer.rs | 2 - .../insert_pk_connection_id_reducer.rs | 2 - .../insert_pk_i_128_reducer.rs | 2 - .../module_bindings/insert_pk_i_16_reducer.rs | 2 - .../insert_pk_i_256_reducer.rs | 2 - .../module_bindings/insert_pk_i_32_reducer.rs | 2 - .../module_bindings/insert_pk_i_64_reducer.rs | 2 - .../module_bindings/insert_pk_i_8_reducer.rs | 2 - .../insert_pk_identity_reducer.rs | 2 - .../insert_pk_simple_enum_reducer.rs | 2 - .../insert_pk_string_reducer.rs | 2 - .../insert_pk_u_128_reducer.rs | 2 - .../module_bindings/insert_pk_u_16_reducer.rs | 2 - .../insert_pk_u_256_reducer.rs | 2 - .../module_bindings/insert_pk_u_32_reducer.rs | 2 - .../insert_pk_u_32_two_reducer.rs | 2 - .../module_bindings/insert_pk_u_64_reducer.rs | 2 - .../module_bindings/insert_pk_u_8_reducer.rs | 2 - .../insert_primitives_as_strings_reducer.rs | 2 - .../insert_table_holds_table_reducer.rs | 2 - .../insert_unique_bool_reducer.rs | 2 - .../insert_unique_connection_id_reducer.rs | 2 - .../insert_unique_i_128_reducer.rs | 2 - .../insert_unique_i_16_reducer.rs | 2 - .../insert_unique_i_256_reducer.rs | 2 - .../insert_unique_i_32_reducer.rs | 2 - .../insert_unique_i_64_reducer.rs | 2 - .../insert_unique_i_8_reducer.rs | 2 - .../insert_unique_identity_reducer.rs | 2 - .../insert_unique_string_reducer.rs | 2 - .../insert_unique_u_128_reducer.rs | 2 - .../insert_unique_u_16_reducer.rs | 2 - .../insert_unique_u_256_reducer.rs | 2 - .../insert_unique_u_32_reducer.rs | 2 - ...sert_unique_u_32_update_pk_u_32_reducer.rs | 2 - .../insert_unique_u_64_reducer.rs | 2 - .../insert_unique_u_8_reducer.rs | 2 - .../module_bindings/insert_user_reducer.rs | 2 - .../insert_vec_bool_reducer.rs | 2 - .../insert_vec_byte_struct_reducer.rs | 2 - .../insert_vec_connection_id_reducer.rs | 2 - .../insert_vec_enum_with_payload_reducer.rs | 2 - ...sert_vec_every_primitive_struct_reducer.rs | 2 - .../insert_vec_every_vec_struct_reducer.rs | 2 - .../insert_vec_f_32_reducer.rs | 2 - .../insert_vec_f_64_reducer.rs | 2 - .../insert_vec_i_128_reducer.rs | 2 - .../insert_vec_i_16_reducer.rs | 2 - .../insert_vec_i_256_reducer.rs | 2 - .../insert_vec_i_32_reducer.rs | 2 - .../insert_vec_i_64_reducer.rs | 2 - .../module_bindings/insert_vec_i_8_reducer.rs | 2 - .../insert_vec_identity_reducer.rs | 2 - .../insert_vec_simple_enum_reducer.rs | 2 - .../insert_vec_string_reducer.rs | 2 - .../insert_vec_timestamp_reducer.rs | 2 - .../insert_vec_u_128_reducer.rs | 2 - .../insert_vec_u_16_reducer.rs | 2 - .../insert_vec_u_256_reducer.rs | 2 - .../insert_vec_u_32_reducer.rs | 2 - .../insert_vec_u_64_reducer.rs | 2 - .../module_bindings/insert_vec_u_8_reducer.rs | 2 - .../insert_vec_unit_struct_reducer.rs | 2 - .../src/module_bindings/large_table_table.rs | 2 - .../src/module_bindings/large_table_type.rs | 2 - .../test-client/src/module_bindings/mod.rs | 2 +- .../module_bindings/no_op_succeeds_reducer.rs | 2 - .../src/module_bindings/one_bool_table.rs | 2 - .../src/module_bindings/one_bool_type.rs | 2 - .../module_bindings/one_byte_struct_table.rs | 2 - .../module_bindings/one_byte_struct_type.rs | 2 - .../one_connection_id_table.rs | 2 - .../module_bindings/one_connection_id_type.rs | 2 - .../one_enum_with_payload_table.rs | 2 - .../one_enum_with_payload_type.rs | 2 - .../one_every_primitive_struct_table.rs | 2 - .../one_every_primitive_struct_type.rs | 2 - .../one_every_vec_struct_table.rs | 2 - .../one_every_vec_struct_type.rs | 2 - .../src/module_bindings/one_f_32_table.rs | 2 - .../src/module_bindings/one_f_32_type.rs | 2 - .../src/module_bindings/one_f_64_table.rs | 2 - .../src/module_bindings/one_f_64_type.rs | 2 - .../src/module_bindings/one_i_128_table.rs | 2 - .../src/module_bindings/one_i_128_type.rs | 2 - .../src/module_bindings/one_i_16_table.rs | 2 - .../src/module_bindings/one_i_16_type.rs | 2 - .../src/module_bindings/one_i_256_table.rs | 2 - .../src/module_bindings/one_i_256_type.rs | 2 - .../src/module_bindings/one_i_32_table.rs | 2 - .../src/module_bindings/one_i_32_type.rs | 2 - .../src/module_bindings/one_i_64_table.rs | 2 - .../src/module_bindings/one_i_64_type.rs | 2 - .../src/module_bindings/one_i_8_table.rs | 2 - .../src/module_bindings/one_i_8_type.rs | 2 - .../src/module_bindings/one_identity_table.rs | 2 - .../src/module_bindings/one_identity_type.rs | 2 - .../module_bindings/one_simple_enum_table.rs | 2 - .../module_bindings/one_simple_enum_type.rs | 2 - .../src/module_bindings/one_string_table.rs | 2 - .../src/module_bindings/one_string_type.rs | 2 - .../module_bindings/one_timestamp_table.rs | 2 - .../src/module_bindings/one_timestamp_type.rs | 2 - .../src/module_bindings/one_u_128_table.rs | 2 - .../src/module_bindings/one_u_128_type.rs | 2 - .../src/module_bindings/one_u_16_table.rs | 2 - .../src/module_bindings/one_u_16_type.rs | 2 - .../src/module_bindings/one_u_256_table.rs | 2 - .../src/module_bindings/one_u_256_type.rs | 2 - .../src/module_bindings/one_u_32_table.rs | 2 - .../src/module_bindings/one_u_32_type.rs | 2 - .../src/module_bindings/one_u_64_table.rs | 2 - .../src/module_bindings/one_u_64_type.rs | 2 - .../src/module_bindings/one_u_8_table.rs | 2 - .../src/module_bindings/one_u_8_type.rs | 2 - .../module_bindings/one_unit_struct_table.rs | 2 - .../module_bindings/one_unit_struct_type.rs | 2 - .../option_every_primitive_struct_table.rs | 2 - .../option_every_primitive_struct_type.rs | 2 - .../src/module_bindings/option_i_32_table.rs | 2 - .../src/module_bindings/option_i_32_type.rs | 2 - .../module_bindings/option_identity_table.rs | 2 - .../module_bindings/option_identity_type.rs | 2 - .../option_simple_enum_table.rs | 2 - .../option_simple_enum_type.rs | 2 - .../module_bindings/option_string_table.rs | 2 - .../src/module_bindings/option_string_type.rs | 2 - .../option_vec_option_i_32_table.rs | 2 - .../option_vec_option_i_32_type.rs | 2 - .../src/module_bindings/pk_bool_table.rs | 2 - .../src/module_bindings/pk_bool_type.rs | 2 - .../module_bindings/pk_connection_id_table.rs | 2 - .../module_bindings/pk_connection_id_type.rs | 2 - .../src/module_bindings/pk_i_128_table.rs | 2 - .../src/module_bindings/pk_i_128_type.rs | 2 - .../src/module_bindings/pk_i_16_table.rs | 2 - .../src/module_bindings/pk_i_16_type.rs | 2 - .../src/module_bindings/pk_i_256_table.rs | 2 - .../src/module_bindings/pk_i_256_type.rs | 2 - .../src/module_bindings/pk_i_32_table.rs | 2 - .../src/module_bindings/pk_i_32_type.rs | 2 - .../src/module_bindings/pk_i_64_table.rs | 2 - .../src/module_bindings/pk_i_64_type.rs | 2 - .../src/module_bindings/pk_i_8_table.rs | 2 - .../src/module_bindings/pk_i_8_type.rs | 2 - .../src/module_bindings/pk_identity_table.rs | 2 - .../src/module_bindings/pk_identity_type.rs | 2 - .../module_bindings/pk_simple_enum_table.rs | 2 - .../module_bindings/pk_simple_enum_type.rs | 2 - .../src/module_bindings/pk_string_table.rs | 2 - .../src/module_bindings/pk_string_type.rs | 2 - .../src/module_bindings/pk_u_128_table.rs | 2 - .../src/module_bindings/pk_u_128_type.rs | 2 - .../src/module_bindings/pk_u_16_table.rs | 2 - .../src/module_bindings/pk_u_16_type.rs | 2 - .../src/module_bindings/pk_u_256_table.rs | 2 - .../src/module_bindings/pk_u_256_type.rs | 2 - .../src/module_bindings/pk_u_32_table.rs | 2 - .../src/module_bindings/pk_u_32_two_table.rs | 2 - .../src/module_bindings/pk_u_32_two_type.rs | 2 - .../src/module_bindings/pk_u_32_type.rs | 2 - .../src/module_bindings/pk_u_64_table.rs | 2 - .../src/module_bindings/pk_u_64_type.rs | 2 - .../src/module_bindings/pk_u_8_table.rs | 2 - .../src/module_bindings/pk_u_8_type.rs | 2 - .../module_bindings/scheduled_table_table.rs | 2 - .../module_bindings/scheduled_table_type.rs | 2 - .../send_scheduled_message_reducer.rs | 2 - .../src/module_bindings/simple_enum_type.rs | 2 - .../table_holds_table_table.rs | 2 - .../module_bindings/table_holds_table_type.rs | 2 - .../src/module_bindings/unique_bool_table.rs | 2 - .../src/module_bindings/unique_bool_type.rs | 2 - .../unique_connection_id_table.rs | 2 - .../unique_connection_id_type.rs | 2 - .../src/module_bindings/unique_i_128_table.rs | 2 - .../src/module_bindings/unique_i_128_type.rs | 2 - .../src/module_bindings/unique_i_16_table.rs | 2 - .../src/module_bindings/unique_i_16_type.rs | 2 - .../src/module_bindings/unique_i_256_table.rs | 2 - .../src/module_bindings/unique_i_256_type.rs | 2 - .../src/module_bindings/unique_i_32_table.rs | 2 - .../src/module_bindings/unique_i_32_type.rs | 2 - .../src/module_bindings/unique_i_64_table.rs | 2 - .../src/module_bindings/unique_i_64_type.rs | 2 - .../src/module_bindings/unique_i_8_table.rs | 2 - .../src/module_bindings/unique_i_8_type.rs | 2 - .../module_bindings/unique_identity_table.rs | 2 - .../module_bindings/unique_identity_type.rs | 2 - .../module_bindings/unique_string_table.rs | 2 - .../src/module_bindings/unique_string_type.rs | 2 - .../src/module_bindings/unique_u_128_table.rs | 2 - .../src/module_bindings/unique_u_128_type.rs | 2 - .../src/module_bindings/unique_u_16_table.rs | 2 - .../src/module_bindings/unique_u_16_type.rs | 2 - .../src/module_bindings/unique_u_256_table.rs | 2 - .../src/module_bindings/unique_u_256_type.rs | 2 - .../src/module_bindings/unique_u_32_table.rs | 2 - .../src/module_bindings/unique_u_32_type.rs | 2 - .../src/module_bindings/unique_u_64_table.rs | 2 - .../src/module_bindings/unique_u_64_type.rs | 2 - .../src/module_bindings/unique_u_8_table.rs | 2 - .../src/module_bindings/unique_u_8_type.rs | 2 - .../src/module_bindings/unit_struct_type.rs | 2 - .../update_indexed_simple_enum_reducer.rs | 2 - .../module_bindings/update_pk_bool_reducer.rs | 2 - .../update_pk_connection_id_reducer.rs | 2 - .../update_pk_i_128_reducer.rs | 2 - .../module_bindings/update_pk_i_16_reducer.rs | 2 - .../update_pk_i_256_reducer.rs | 2 - .../module_bindings/update_pk_i_32_reducer.rs | 2 - .../module_bindings/update_pk_i_64_reducer.rs | 2 - .../module_bindings/update_pk_i_8_reducer.rs | 2 - .../update_pk_identity_reducer.rs | 2 - .../update_pk_simple_enum_reducer.rs | 2 - .../update_pk_string_reducer.rs | 2 - .../update_pk_u_128_reducer.rs | 2 - .../module_bindings/update_pk_u_16_reducer.rs | 2 - .../update_pk_u_256_reducer.rs | 2 - .../module_bindings/update_pk_u_32_reducer.rs | 2 - .../update_pk_u_32_two_reducer.rs | 2 - .../module_bindings/update_pk_u_64_reducer.rs | 2 - .../module_bindings/update_pk_u_8_reducer.rs | 2 - .../update_unique_bool_reducer.rs | 2 - .../update_unique_connection_id_reducer.rs | 2 - .../update_unique_i_128_reducer.rs | 2 - .../update_unique_i_16_reducer.rs | 2 - .../update_unique_i_256_reducer.rs | 2 - .../update_unique_i_32_reducer.rs | 2 - .../update_unique_i_64_reducer.rs | 2 - .../update_unique_i_8_reducer.rs | 2 - .../update_unique_identity_reducer.rs | 2 - .../update_unique_string_reducer.rs | 2 - .../update_unique_u_128_reducer.rs | 2 - .../update_unique_u_16_reducer.rs | 2 - .../update_unique_u_256_reducer.rs | 2 - .../update_unique_u_32_reducer.rs | 2 - .../update_unique_u_64_reducer.rs | 2 - .../update_unique_u_8_reducer.rs | 2 - .../src/module_bindings/users_table.rs | 2 - .../src/module_bindings/users_type.rs | 2 - .../src/module_bindings/vec_bool_table.rs | 2 - .../src/module_bindings/vec_bool_type.rs | 2 - .../module_bindings/vec_byte_struct_table.rs | 2 - .../module_bindings/vec_byte_struct_type.rs | 2 - .../vec_connection_id_table.rs | 2 - .../module_bindings/vec_connection_id_type.rs | 2 - .../vec_enum_with_payload_table.rs | 2 - .../vec_enum_with_payload_type.rs | 2 - .../vec_every_primitive_struct_table.rs | 2 - .../vec_every_primitive_struct_type.rs | 2 - .../vec_every_vec_struct_table.rs | 2 - .../vec_every_vec_struct_type.rs | 2 - .../src/module_bindings/vec_f_32_table.rs | 2 - .../src/module_bindings/vec_f_32_type.rs | 2 - .../src/module_bindings/vec_f_64_table.rs | 2 - .../src/module_bindings/vec_f_64_type.rs | 2 - .../src/module_bindings/vec_i_128_table.rs | 2 - .../src/module_bindings/vec_i_128_type.rs | 2 - .../src/module_bindings/vec_i_16_table.rs | 2 - .../src/module_bindings/vec_i_16_type.rs | 2 - .../src/module_bindings/vec_i_256_table.rs | 2 - .../src/module_bindings/vec_i_256_type.rs | 2 - .../src/module_bindings/vec_i_32_table.rs | 2 - .../src/module_bindings/vec_i_32_type.rs | 2 - .../src/module_bindings/vec_i_64_table.rs | 2 - .../src/module_bindings/vec_i_64_type.rs | 2 - .../src/module_bindings/vec_i_8_table.rs | 2 - .../src/module_bindings/vec_i_8_type.rs | 2 - .../src/module_bindings/vec_identity_table.rs | 2 - .../src/module_bindings/vec_identity_type.rs | 2 - .../module_bindings/vec_simple_enum_table.rs | 2 - .../module_bindings/vec_simple_enum_type.rs | 2 - .../src/module_bindings/vec_string_table.rs | 2 - .../src/module_bindings/vec_string_type.rs | 2 - .../module_bindings/vec_timestamp_table.rs | 2 - .../src/module_bindings/vec_timestamp_type.rs | 2 - .../src/module_bindings/vec_u_128_table.rs | 2 - .../src/module_bindings/vec_u_128_type.rs | 2 - .../src/module_bindings/vec_u_16_table.rs | 2 - .../src/module_bindings/vec_u_16_type.rs | 2 - .../src/module_bindings/vec_u_256_table.rs | 2 - .../src/module_bindings/vec_u_256_type.rs | 2 - .../src/module_bindings/vec_u_32_table.rs | 2 - .../src/module_bindings/vec_u_32_type.rs | 2 - .../src/module_bindings/vec_u_64_table.rs | 2 - .../src/module_bindings/vec_u_64_type.rs | 2 - .../src/module_bindings/vec_u_8_table.rs | 2 - .../src/module_bindings/vec_u_8_type.rs | 2 - .../module_bindings/vec_unit_struct_table.rs | 2 - .../module_bindings/vec_unit_struct_type.rs | 2 - .../identity_connected_reducer.ts | 2 - .../identity_disconnected_reducer.ts | 2 - .../src/module_bindings/index.ts | 2 +- .../src/module_bindings/message_table.ts | 2 - .../src/module_bindings/message_type.ts | 2 - .../module_bindings/send_message_reducer.ts | 2 - .../src/module_bindings/set_name_reducer.ts | 2 - .../src/module_bindings/user_table.ts | 2 - .../src/module_bindings/user_type.ts | 2 - .../sdk/src/client_api/bsatn_row_list_type.ts | 2 - .../sdk/src/client_api/call_reducer_type.ts | 2 - .../sdk/src/client_api/client_message_type.ts | 2 - .../src/client_api/client_message_variants.ts | 2 - .../compressable_query_update_type.ts | 2 - .../compressable_query_update_variants.ts | 2 - .../src/client_api/database_update_type.ts | 2 - .../sdk/src/client_api/energy_quanta_type.ts | 2 - .../sdk/src/client_api/identity_token_type.ts | 2 - .../packages/sdk/src/client_api/index.ts | 2 +- .../client_api/initial_subscription_type.ts | 2 - .../client_api/one_off_query_response_type.ts | 2 - .../sdk/src/client_api/one_off_query_type.ts | 2 - .../sdk/src/client_api/one_off_table_type.ts | 2 - .../sdk/src/client_api/query_id_type.ts | 2 - .../sdk/src/client_api/query_update_type.ts | 2 - .../src/client_api/reducer_call_info_type.ts | 2 - .../sdk/src/client_api/row_size_hint_type.ts | 2 - .../src/client_api/row_size_hint_variants.ts | 2 - .../sdk/src/client_api/server_message_type.ts | 2 - .../src/client_api/server_message_variants.ts | 2 - .../src/client_api/subscribe_applied_type.ts | 2 - .../subscribe_multi_applied_type.ts | 2 - .../src/client_api/subscribe_multi_type.ts | 2 - .../sdk/src/client_api/subscribe_rows_type.ts | 2 - .../src/client_api/subscribe_single_type.ts | 2 - .../sdk/src/client_api/subscribe_type.ts | 2 - .../src/client_api/subscription_error_type.ts | 2 - .../sdk/src/client_api/table_update_type.ts | 2 - .../transaction_update_light_type.ts | 2 - .../src/client_api/transaction_update_type.ts | 2 - .../client_api/unsubscribe_applied_type.ts | 2 - .../unsubscribe_multi_applied_type.ts | 2 - .../src/client_api/unsubscribe_multi_type.ts | 2 - .../sdk/src/client_api/unsubscribe_type.ts | 2 - .../sdk/src/client_api/update_status_type.ts | 2 - .../src/client_api/update_status_variants.ts | 2 - .../module_bindings/create_player_reducer.ts | 2 - .../test-app/src/module_bindings/index.ts | 2 +- .../src/module_bindings/player_table.ts | 2 - .../src/module_bindings/player_type.ts | 2 - .../src/module_bindings/point_type.ts | 2 - .../module_bindings/unindexed_player_table.ts | 2 - .../module_bindings/unindexed_player_type.ts | 2 - .../src/module_bindings/user_table.ts | 2 - .../test-app/src/module_bindings/user_type.ts | 2 - 575 files changed, 46 insertions(+), 1405 deletions(-) diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/IndexType.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/IndexType.g.cs index 3da796b868..4dcea66972 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/IndexType.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/IndexType.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/Lifecycle.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/Lifecycle.g.cs index 6d65c56932..de0e7ea220 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/Lifecycle.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/Lifecycle.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/MiscModuleExport.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/MiscModuleExport.g.cs index 0e4d64351a..a608927793 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/MiscModuleExport.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/MiscModuleExport.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefV8.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefV8.g.cs index 127789bb8b..ed73c77d98 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefV8.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefV8.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV9.g.cs index 475d5b03e9..8e08749392 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDataV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDataV9.g.cs index 2ff1c6b358..bea5309411 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDataV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDataV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV8.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV8.g.cs index f1aa5d706f..5b245ba0a4 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV8.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV8.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV9.g.cs index 3eb7ad7faa..042687b059 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexAlgorithm.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexAlgorithm.g.cs index 4378beed59..6e93c908b5 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexAlgorithm.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexAlgorithm.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV8.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV8.g.cs index 7949c68da0..8fe8940588 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV8.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV8.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV9.g.cs index 5bf20c51fe..85f2524b96 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawMiscModuleExportV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawMiscModuleExportV9.g.cs index 8c720392f6..b2887f2b49 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawMiscModuleExportV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawMiscModuleExportV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs index f6f9f80d13..132e6910bc 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV8.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV8.g.cs index 225d217074..ff03785d36 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV8.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV8.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV9.g.cs index 66173638fe..f8447ce68e 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV9.g.cs index b85972339c..964c24d833 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawRowLevelSecurityDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawRowLevelSecurityDefV9.g.cs index 86022728d3..0b3e26f3af 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawRowLevelSecurityDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawRowLevelSecurityDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV9.g.cs index 01423322c4..00f88884d4 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV9.g.cs index 3e414d08a4..e6bde866c4 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV8.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV8.g.cs index 5d8b78e0ee..c0ccd834c9 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV8.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV8.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV9.g.cs index 3d64c3fec6..002b7d6a79 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV8.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV8.g.cs index edc06e1967..7306480a4d 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV8.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV8.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV9.g.cs index b21da87a88..5d928a7418 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV9.g.cs index 8ffa0de2bd..1e34556422 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawUniqueConstraintDataV9.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawUniqueConstraintDataV9.g.cs index 8e8ebf357e..eea2961ae8 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawUniqueConstraintDataV9.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawUniqueConstraintDataV9.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/ReducerDef.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/ReducerDef.g.cs index 920bcc2716..0a010c1834 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/ReducerDef.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/ReducerDef.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/TableAccess.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/TableAccess.g.cs index 502b555912..0ba303b913 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/TableAccess.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/TableAccess.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/TableDesc.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/TableDesc.g.cs index 7e6993fbdd..9e3e157e60 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/TableDesc.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/TableDesc.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/TableType.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/TableType.g.cs index bc76eb9ef1..8b935aa640 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/TableType.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/TableType.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/TypeAlias.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/TypeAlias.g.cs index 3f5861933f..ab0fe6b202 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/TypeAlias.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/TypeAlias.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/Typespace.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/Typespace.g.cs index 536d150a62..c9ef1fee94 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/Typespace.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/Typespace.g.cs @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. 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 1814483514681baeedb23e1dadd342dac4697ac5). - #nullable enable using System; diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts index feab7f22b4..86382ebc6e 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts index df1992c048..e6233b5f40 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/index_type_type.ts b/crates/bindings-typescript/src/autogen/index_type_type.ts index ff61a7cc6a..bae2e283ca 100644 --- a/crates/bindings-typescript/src/autogen/index_type_type.ts +++ b/crates/bindings-typescript/src/autogen/index_type_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/index_type_variants.ts b/crates/bindings-typescript/src/autogen/index_type_variants.ts index 30e120ae9a..0c5d59e705 100644 --- a/crates/bindings-typescript/src/autogen/index_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/index_type_variants.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/lifecycle_type.ts b/crates/bindings-typescript/src/autogen/lifecycle_type.ts index 950f5d110d..2df3181ffc 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_type.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts index f08120a97e..825dc3f24a 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 a904ba7fd5..fa26b3fb12 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 5bca056d4d..f4b9b9f68e 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 bf8ed63332..b3d0d7b6d8 100644 --- a/crates/bindings-typescript/src/autogen/product_type_element_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/product_type_type.ts b/crates/bindings-typescript/src/autogen/product_type_type.ts index a19be70fe4..dc5ead7673 100644 --- a/crates/bindings-typescript/src/autogen/product_type_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 da026b6e18..144f49ff7f 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 1287d2d766..507780b61e 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 d5df3e0e10..bb8035147f 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 d71210f564..e6520fa0a2 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 58bf26292b..e3fb96b161 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 a2ef77c6cb..43a4f27a51 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 c839cbb70f..34ab3f6baf 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 3319c94afa..fca00bf0b4 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 722d25763a..9ae2c2f0c4 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 8e025d9f99..687c16e89d 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 ad225023ba..87d1ddc3f5 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 3e15b9f03e..9eee45ea6b 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 2d49ba95a0..bcbf79852b 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 47c4c3e93c..c5e101d48d 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 ce498ca27f..effd047ac1 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 017e8abb3f..48b7371f22 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 58f662325a..bc1cd8f258 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 61ddf168f0..ad0a7c508b 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 6ae9374b3a..b92f7a5888 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 1973b4beac..dc40fdadd1 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 d6ce72bfe7..ae5504d114 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 acc62576c0..1757f1b73b 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 e107796688..6c82d1f1ce 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 34da2e5f65..01662f38eb 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 84cd101c66..142914c439 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 8a505a021b..fbcfcb34de 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,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/reducer_def_type.ts b/crates/bindings-typescript/src/autogen/reducer_def_type.ts index e5b814cec0..4599f53e35 100644 --- a/crates/bindings-typescript/src/autogen/reducer_def_type.ts +++ b/crates/bindings-typescript/src/autogen/reducer_def_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/sum_type_type.ts b/crates/bindings-typescript/src/autogen/sum_type_type.ts index d0b4b0d7d7..9e93939f5f 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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 9b32920922..7028deedb0 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/table_access_type.ts b/crates/bindings-typescript/src/autogen/table_access_type.ts index 1046355d4b..1da696b60f 100644 --- a/crates/bindings-typescript/src/autogen/table_access_type.ts +++ b/crates/bindings-typescript/src/autogen/table_access_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/table_access_variants.ts b/crates/bindings-typescript/src/autogen/table_access_variants.ts index f1e870b26d..fc218c98ed 100644 --- a/crates/bindings-typescript/src/autogen/table_access_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_access_variants.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/table_desc_type.ts b/crates/bindings-typescript/src/autogen/table_desc_type.ts index 3f5ffdfb4c..469e637714 100644 --- a/crates/bindings-typescript/src/autogen/table_desc_type.ts +++ b/crates/bindings-typescript/src/autogen/table_desc_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/table_type_type.ts b/crates/bindings-typescript/src/autogen/table_type_type.ts index 521e5482d1..1d5cbdaa31 100644 --- a/crates/bindings-typescript/src/autogen/table_type_type.ts +++ b/crates/bindings-typescript/src/autogen/table_type_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/table_type_variants.ts b/crates/bindings-typescript/src/autogen/table_type_variants.ts index 4452eeb364..2731730daf 100644 --- a/crates/bindings-typescript/src/autogen/table_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_type_variants.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/type_alias_type.ts b/crates/bindings-typescript/src/autogen/type_alias_type.ts index 3979a8ca78..25d4d8efa5 100644 --- a/crates/bindings-typescript/src/autogen/type_alias_type.ts +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts index 940777acc8..7f797c1ba3 100644 --- a/crates/bindings-typescript/src/autogen/typespace_type.ts +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -1,8 +1,6 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit c9276358a10fa5dcbee7683260a68b8f9aef3361). - /* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/crates/codegen/src/csharp.rs b/crates/codegen/src/csharp.rs index 0bae17a05f..f4511c89a6 100644 --- a/crates/codegen/src/csharp.rs +++ b/crates/codegen/src/csharp.rs @@ -8,7 +8,7 @@ use super::code_indenter::CodeIndenter; use super::Lang; use crate::util::{ collect_case, is_reducer_invokable, iter_indexes, iter_reducers, iter_tables, print_auto_generated_file_comment, - type_ref_name, + print_auto_generated_version_comment, type_ref_name, }; use crate::{indent_scope, OutputFile}; use convert_case::{Case, Casing}; @@ -442,6 +442,7 @@ impl Lang for Csharp<'_> { "System.Collections.Generic", "System.Runtime.Serialization", ], + false, ); writeln!(output, "public sealed partial class RemoteTables"); @@ -587,6 +588,7 @@ impl Lang for Csharp<'_> { "System.Collections.Generic", "System.Runtime.Serialization", ], + false, ); writeln!(output, "public sealed partial class RemoteReducers : RemoteBase"); @@ -713,6 +715,7 @@ impl Lang for Csharp<'_> { "System.Collections.Generic", "System.Runtime.Serialization", ], + true, // print the version in the globals file ); writeln!(output, "public sealed partial class RemoteReducers : RemoteBase"); @@ -945,10 +948,13 @@ impl std::ops::DerefMut for CsharpAutogen { } impl CsharpAutogen { - pub fn new(namespace: &str, extra_usings: &[&str]) -> Self { + pub fn new(namespace: &str, extra_usings: &[&str], include_version: bool) -> Self { let mut output = CodeIndenter::new(String::new(), INDENT); print_auto_generated_file_comment(&mut output); + if include_version { + print_auto_generated_version_comment(&mut output); + } writeln!(output, "#nullable enable"); writeln!(output); @@ -984,7 +990,7 @@ impl CsharpAutogen { } fn autogen_csharp_sum(module: &ModuleDef, sum_type_name: String, sum_type: &SumTypeDef, namespace: &str) -> String { - let mut output = CsharpAutogen::new(namespace, &[]); + let mut output = CsharpAutogen::new(namespace, &[], false); writeln!(output, "[SpacetimeDB.Type]"); write!( @@ -1021,7 +1027,7 @@ fn autogen_csharp_sum(module: &ModuleDef, sum_type_name: String, sum_type: &SumT } fn autogen_csharp_plain_enum(enum_type_name: String, enum_type: &PlainEnumTypeDef, namespace: &str) -> String { - let mut output = CsharpAutogen::new(namespace, &[]); + let mut output = CsharpAutogen::new(namespace, &[], false); writeln!(output, "[SpacetimeDB.Type]"); writeln!(output, "public enum {enum_type_name}"); @@ -1038,6 +1044,7 @@ fn autogen_csharp_tuple(module: &ModuleDef, name: String, tuple: &ProductTypeDef let mut output = CsharpAutogen::new( namespace, &["System.Collections.Generic", "System.Runtime.Serialization"], + false, ); autogen_csharp_product_common(module, &mut output, name, tuple, "", |_| {}); diff --git a/crates/codegen/src/rust.rs b/crates/codegen/src/rust.rs index 3fae8de736..7dabb84f2c 100644 --- a/crates/codegen/src/rust.rs +++ b/crates/codegen/src/rust.rs @@ -1,7 +1,9 @@ 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::util::{ + iter_tables, iter_types, iter_unique_cols, print_auto_generated_file_comment, print_auto_generated_version_comment, +}; use crate::OutputFile; use convert_case::{Case, Casing}; use spacetimedb_lib::sats::layout::PrimitiveType; @@ -28,7 +30,7 @@ impl Lang for Rust { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, false); out.newline(); match &module.typespace_for_generate()[typ.ty] { @@ -78,7 +80,7 @@ impl __sdk::InModule for {type_name} {{ let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, false); let row_type = type_ref_name(module, type_ref); let row_type_module = type_ref_module_name(module, type_ref); @@ -298,7 +300,7 @@ pub(super) fn parse_table_update( let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, false); out.newline(); @@ -489,7 +491,7 @@ impl {set_reducer_flags_trait} for super::SetReducerFlags {{ let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, true); out.newline(); @@ -600,8 +602,11 @@ fn print_spacetimedb_imports(output: &mut Indenter) { print_lines(output, SPACETIMEDB_IMPORTS); } -fn print_file_header(output: &mut Indenter) { +fn print_file_header(output: &mut Indenter, include_version: bool) { print_auto_generated_file_comment(output); + if include_version { + print_auto_generated_version_comment(output); + } writeln!(output, "{ALLOW_LINTS}"); print_spacetimedb_imports(output); } diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index be2706c024..104793979e 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -1,4 +1,7 @@ -use crate::util::{is_reducer_invokable, iter_reducers, iter_tables, iter_types, iter_unique_cols}; +use crate::util::{ + is_reducer_invokable, iter_reducers, iter_tables, iter_types, iter_unique_cols, + print_auto_generated_version_comment, +}; use crate::{indent_scope, OutputFile}; use super::util::{collect_case, print_auto_generated_file_comment, type_ref_name}; @@ -33,7 +36,7 @@ impl Lang for TypeScript { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, false); gen_and_print_imports(module, out, &product.elements, &[typ.ty], None); writeln!(out); define_body_for_product(module, out, &type_name, &product.elements); @@ -48,7 +51,7 @@ impl Lang for TypeScript { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, false); // Note that the current type is not included in dont_import below. gen_and_print_imports(module, out, variants, &[], Some("Type")); writeln!(out); @@ -64,7 +67,7 @@ impl Lang for TypeScript { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, false); gen_and_print_imports(module, out, variants, &[typ.ty], None); writeln!( out, @@ -113,7 +116,7 @@ impl Lang for TypeScript { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, false); let type_ref = table.product_type_ref; let row_type = type_ref_name(module, type_ref); @@ -280,7 +283,7 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, false); out.newline(); @@ -307,7 +310,7 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; - print_file_header(out); + print_file_header(out, true); out.newline(); @@ -697,8 +700,11 @@ fn print_spacetimedb_imports(out: &mut Indenter) { writeln!(out, "}} from \"@clockworklabs/spacetimedb-sdk\";"); } -fn print_file_header(output: &mut Indenter) { +fn print_file_header(output: &mut Indenter, include_version: bool) { print_auto_generated_file_comment(output); + if include_version { + print_auto_generated_version_comment(output); + } print_lint_suppression(output); print_spacetimedb_imports(output); } diff --git a/crates/codegen/src/util.rs b/crates/codegen/src/util.rs index 87bc781347..a00a7daa02 100644 --- a/crates/codegen/src/util.rs +++ b/crates/codegen/src/util.rs @@ -55,6 +55,9 @@ const AUTO_GENERATED_FILE_COMMENT: &[&str] = &[ pub(super) fn print_auto_generated_file_comment(output: &mut Indenter) { print_lines(output, AUTO_GENERATED_FILE_COMMENT); +} + +pub(super) fn print_auto_generated_version_comment(output: &mut Indenter) { writeln!( output, "// This was generated using spacetimedb cli version {} (commit {}).", diff --git a/crates/codegen/tests/snapshots/codegen__codegen_csharp.snap b/crates/codegen/tests/snapshots/codegen__codegen_csharp.snap index 2a438d3c80..0937300d1a 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_csharp.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_csharp.snap @@ -6,8 +6,6 @@ expression: outfiles // 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 - #nullable enable using System; @@ -90,8 +88,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -167,8 +163,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -244,8 +238,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -307,8 +299,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -359,8 +349,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -435,8 +423,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -512,8 +498,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -588,8 +572,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -651,8 +633,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -714,8 +694,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -791,8 +769,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -854,8 +830,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -950,8 +924,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1542,8 +1514,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1573,8 +1543,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1636,8 +1604,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1689,8 +1655,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1742,8 +1706,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1805,8 +1767,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1846,8 +1806,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1877,8 +1835,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1920,8 +1876,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1961,8 +1915,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -1992,8 +1944,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2045,8 +1995,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2076,8 +2024,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2109,8 +2055,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2129,8 +2073,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2167,8 +2109,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2187,8 +2127,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2207,8 +2145,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2250,8 +2186,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2288,8 +2222,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2331,8 +2263,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2369,8 +2299,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2402,8 +2330,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2445,8 +2371,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2488,8 +2412,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2521,8 +2443,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2553,8 +2473,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; @@ -2592,8 +2510,6 @@ namespace SpacetimeDB // 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 - #nullable enable using System; diff --git a/crates/codegen/tests/snapshots/codegen__codegen_rust.snap b/crates/codegen/tests/snapshots/codegen__codegen_rust.snap index a9b3076f38..79ecb333d8 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_rust.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_rust.snap @@ -6,8 +6,6 @@ expression: outfiles // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -117,8 +115,6 @@ impl set_flags_for_add_player for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -228,8 +224,6 @@ impl set_flags_for_add_private for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -343,8 +337,6 @@ impl set_flags_for_add for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -449,8 +441,6 @@ impl set_flags_for_assert_caller_identity_is_module_identity for super::SetReduc // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -476,8 +466,6 @@ impl __sdk::InModule for Baz { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -582,8 +570,6 @@ impl set_flags_for_client_connected for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -693,8 +679,6 @@ impl set_flags_for_delete_player for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -804,8 +788,6 @@ impl set_flags_for_delete_players_by_name for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -838,8 +820,6 @@ impl __sdk::InModule for Foobar { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -940,8 +920,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -968,8 +946,6 @@ impl __sdk::InModule for HasSpecialStuff { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -1079,8 +1055,6 @@ impl set_flags_for_list_over_age for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -1185,8 +1159,6 @@ impl set_flags_for_log_module_identity for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2305,8 +2277,6 @@ fn register_tables(client_cache: &mut __sdk::ClientCache) { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2336,8 +2306,6 @@ impl __sdk::InModule for NamespaceTestC { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2369,8 +2337,6 @@ impl __sdk::InModule for NamespaceTestF { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2519,8 +2485,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2548,8 +2512,6 @@ impl __sdk::InModule for Person { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2729,8 +2691,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2757,8 +2717,6 @@ impl __sdk::InModule for PkMultiIdentity { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2969,8 +2927,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -2998,8 +2954,6 @@ impl __sdk::InModule for Player { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3026,8 +2980,6 @@ impl __sdk::InModule for Point { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3128,8 +3080,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3230,8 +3180,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3257,8 +3205,6 @@ impl __sdk::InModule for PrivateTable { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3363,8 +3309,6 @@ impl set_flags_for_query_private for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3513,8 +3457,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3542,8 +3484,6 @@ impl __sdk::InModule for RepeatingTestArg { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3654,8 +3594,6 @@ impl set_flags_for_repeating_test for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3760,8 +3698,6 @@ impl set_flags_for_say_hello for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3862,8 +3798,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3891,8 +3825,6 @@ impl __sdk::InModule for TestA { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -3918,8 +3850,6 @@ impl __sdk::InModule for TestB { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -4024,8 +3954,6 @@ impl set_flags_for_test_btree_index_args for super::SetReducerFlags { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -4127,8 +4055,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -4155,8 +4081,6 @@ impl __sdk::InModule for TestD { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -4305,8 +4229,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -4333,8 +4255,6 @@ impl __sdk::InModule for TestE { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -4436,8 +4356,6 @@ pub(super) fn parse_table_update( // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, @@ -4464,8 +4382,6 @@ impl __sdk::InModule for TestFoobar { // 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 - #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{ self as __sdk, diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index d064c60121..6bd713ca7b 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -6,8 +6,6 @@ expression: outfiles // 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 @@ -70,8 +68,6 @@ export default AddPlayer; // 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 @@ -134,8 +130,6 @@ export default AddPrivate; // 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 @@ -200,8 +194,6 @@ export default Add; // 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 @@ -261,8 +253,6 @@ export default AssertCallerIdentityIsModuleIdentity; // 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 @@ -326,8 +316,6 @@ export default Baz; // 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 @@ -387,8 +375,6 @@ export default ClientConnected; // 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 @@ -451,8 +437,6 @@ export default DeletePlayer; // 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 @@ -515,8 +499,6 @@ export default DeletePlayersByName; // 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 @@ -591,8 +573,6 @@ export default Foobar; // 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 @@ -630,8 +610,6 @@ export type Har = { tag: "Har", value: number }; // 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 @@ -706,8 +684,6 @@ export class HasSpecialStuffTableHandle { // 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 @@ -1416,8 +1392,6 @@ export type ErrorContext = __ErrorContextInterface Date: Fri, 5 Sep 2025 14:21:12 +0200 Subject: [PATCH 26/28] V8: wire more of `call_reducer` (#3225) # Description of Changes Wire `call_reducer` to `call_reducer_with_tx` and leave some TODOs for future work. Also fixes some small misc. # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing Not in a testable state yet, future PRs will add tests. --- crates/core/src/host/v8/mod.rs | 63 +++++++++++++++++-- .../src/host/wasm_common/module_host_actor.rs | 15 +++-- .../core/src/host/wasmtime/wasmtime_module.rs | 3 +- 3 files changed, 66 insertions(+), 15 deletions(-) diff --git a/crates/core/src/host/v8/mod.rs b/crates/core/src/host/v8/mod.rs index 265f1ead6b..9cff258732 100644 --- a/crates/core/src/host/v8/mod.rs +++ b/crates/core/src/host/v8/mod.rs @@ -3,20 +3,25 @@ use super::module_common::{build_common_module_from_raw, ModuleCommon}; use super::module_host::{CallReducerParams, DynModule, Module, ModuleInfo, ModuleInstance, ModuleRuntime}; use super::UpdateDatabaseResult; -use crate::host::wasm_common::module_host_actor::InstanceCommon; +use crate::host::wasm_common::instrumentation::CallTimes; +use crate::host::wasm_common::module_host_actor::{ + EnergyStats, ExecuteResult, ExecutionTimings, InstanceCommon, ReducerOp, +}; use crate::host::ArgsTuple; use crate::{host::Scheduler, module_host_context::ModuleCreationContext, replica_context::ReplicaContext}; use anyhow::anyhow; +use core::time::Duration; use de::deserialize_js; use error::{catch_exception, exception_already_thrown, ExcResult, Throwable}; use from_value::cast; use key_cache::get_or_create_key_cache; use ser::serialize_to_js; +use spacetimedb_client_api_messages::energy::{EnergyQuanta, ReducerBudget}; use spacetimedb_datastore::locking_tx_datastore::MutTxId; use spacetimedb_datastore::traits::Program; use spacetimedb_lib::{ConnectionId, Identity, RawModuleDef}; use std::sync::{Arc, LazyLock}; -use v8::{Function, HandleScope, Local, Value}; +use v8::{Context, ContextOptions, ContextScope, Function, HandleScope, Isolate, Local, Value}; mod de; mod error; @@ -110,7 +115,7 @@ impl Module for JsModule { } fn info(&self) -> Arc { - todo!() + self.common.info().clone() } fn create_instance(&self) -> Self::Instance { @@ -137,8 +142,42 @@ impl ModuleInstance for JsInstance { self.common.update_database(replica_ctx, program, old_module_info) } - fn call_reducer(&mut self, _tx: Option, _params: CallReducerParams) -> super::ReducerCallResult { - todo!() + fn call_reducer(&mut self, tx: Option, params: CallReducerParams) -> super::ReducerCallResult { + // TODO(centril): snapshots, module->host calls + let mut isolate = Isolate::new(<_>::default()); + let scope = &mut HandleScope::new(&mut isolate); + let context = Context::new(scope, ContextOptions::default()); + let scope = &mut ContextScope::new(scope, context); + + self.common.call_reducer_with_tx( + &self.replica_ctx.clone(), + tx, + params, + // TODO(centril): logging. + |_ty, _fun, _err| {}, + |tx, op, _budget| { + let call_result = call_call_reducer_from_op(scope, op); + // TODO(centril): energy metrering. + let energy = EnergyStats { + used: EnergyQuanta::ZERO, + wasmtime_fuel_used: 0, + remaining: ReducerBudget::ZERO, + }; + // TODO(centril): timings. + let timings = ExecutionTimings { + total_duration: Duration::ZERO, + wasm_instance_env_call_times: CallTimes::new(), + }; + let exec_result = ExecuteResult { + energy, + timings, + // TODO(centril): memory allocation. + memory_allocation: 0, + call_result, + }; + (tx, exec_result) + }, + ) } } @@ -163,13 +202,25 @@ fn call_free_fun<'scope>( fun.call(scope, receiver, args).ok_or_else(exception_already_thrown) } +// Calls the `__call_reducer__` function on the global proxy object using `op`. +fn call_call_reducer_from_op(scope: &mut HandleScope<'_>, op: ReducerOp<'_>) -> anyhow::Result>> { + call_call_reducer( + scope, + op.id.into(), + op.caller_identity, + op.caller_connection_id, + op.timestamp.to_micros_since_unix_epoch(), + op.args, + ) +} + // Calls the `__call_reducer__` function on the global proxy object. fn call_call_reducer( scope: &mut HandleScope<'_>, reducer_id: u32, sender: &Identity, conn_id: &ConnectionId, - timestamp: u64, + timestamp: i64, reducer_args: &ArgsTuple, ) -> anyhow::Result>> { // Get a cached version of the `__call_reducer__` property. diff --git a/crates/core/src/host/wasm_common/module_host_actor.rs b/crates/core/src/host/wasm_common/module_host_actor.rs index 73a637be4a..f6dc7145a0 100644 --- a/crates/core/src/host/wasm_common/module_host_actor.rs +++ b/crates/core/src/host/wasm_common/module_host_actor.rs @@ -1,4 +1,3 @@ -use bytes::Bytes; use prometheus::{Histogram, IntCounter, IntGauge}; use spacetimedb_lib::db::raw_def::v9::Lifecycle; use spacetimedb_schema::auto_migrate::ponder_migrate; @@ -16,7 +15,7 @@ use crate::host::module_host::{ CallReducerParams, DatabaseUpdate, DynModule, EventStatus, Module, ModuleEvent, ModuleFunctionCall, ModuleInfo, ModuleInstance, }; -use crate::host::{ReducerCallResult, ReducerId, ReducerOutcome, Scheduler, UpdateDatabaseResult}; +use crate::host::{ArgsTuple, ReducerCallResult, ReducerId, ReducerOutcome, Scheduler, UpdateDatabaseResult}; use crate::identity::Identity; use crate::messages::control_db::HostType; use crate::module_host_context::ModuleCreationContext; @@ -333,7 +332,7 @@ impl InstanceCommon { /// The method also performs various measurements and records energy usage, /// as well as broadcasting a [`ModuleEvent`] containing information about /// the outcome of the call. - fn call_reducer_with_tx( + pub(crate) fn call_reducer_with_tx( &mut self, replica_ctx: &ReplicaContext, tx: Option, @@ -379,7 +378,7 @@ impl InstanceCommon { caller_identity: &caller_identity, caller_connection_id: &caller_connection_id, timestamp, - arg_bytes: args.get_bsatn().clone(), + args: &args, }; let workload = Workload::Reducer(ReducerContext::from(op.clone())); @@ -626,8 +625,8 @@ pub struct ReducerOp<'a> { pub caller_identity: &'a Identity, pub caller_connection_id: &'a ConnectionId, pub timestamp: Timestamp, - /// The BSATN-serialized arguments passed to the reducer. - pub arg_bytes: Bytes, + /// The arguments passed to the reducer. + pub args: &'a ArgsTuple, } impl From> for execution_context::ReducerContext { @@ -638,7 +637,7 @@ impl From> for execution_context::ReducerContext { caller_identity, caller_connection_id, timestamp, - arg_bytes, + args, }: ReducerOp<'_>, ) -> Self { Self { @@ -646,7 +645,7 @@ impl From> for execution_context::ReducerContext { caller_identity: *caller_identity, caller_connection_id: *caller_connection_id, timestamp, - arg_bsatn: arg_bytes.clone(), + arg_bsatn: args.get_bsatn().clone(), } } } diff --git a/crates/core/src/host/wasmtime/wasmtime_module.rs b/crates/core/src/host/wasmtime/wasmtime_module.rs index 4995f54157..141f745551 100644 --- a/crates/core/src/host/wasmtime/wasmtime_module.rs +++ b/crates/core/src/host/wasmtime/wasmtime_module.rs @@ -204,7 +204,8 @@ impl module_host_actor::WasmInstance for WasmtimeInstance { let [conn_id_0, conn_id_1] = bytemuck::must_cast(op.caller_connection_id.as_le_byte_array()); // Prepare arguments to the reducer + the error sink & start timings. - let (args_source, errors_sink) = store.data_mut().start_reducer(op.name, op.arg_bytes, op.timestamp); + let args_bytes = op.args.get_bsatn().clone(); + let (args_source, errors_sink) = store.data_mut().start_reducer(op.name, args_bytes, op.timestamp); let call_result = self.call_reducer.call( &mut *store, From df82bd8f46251ff6579802eada75bff5d8906b89 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Fri, 5 Sep 2025 10:47:12 -0400 Subject: [PATCH 27/28] Removed // @ts-ignore directive from generated files and fixes associated errors (#3228) # Description of Changes Previously all TypeScript generated code had a `// @ts-ignore` directive at the top to suppress unused variable errors that users may have run into with their generated code. This worked to suppress unused, but it was too broad and suppressed actual errors with our generated code. This PR removes that directive and fixes the latent errors. Most notably this fixes the issue in the quickstart where we were getting `serialize` is not a function. # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing - [x] This PR increases the test surface only by now typechecking the typescript generated code within our repository --- .../src/autogen/algebraic_type_type.ts | 15 +- .../src/autogen/algebraic_type_variants.ts | 17 +- .../src/autogen/index_type_type.ts | 11 -- .../src/autogen/index_type_variants.ts | 11 -- .../src/autogen/lifecycle_type.ts | 11 -- .../src/autogen/lifecycle_variants.ts | 11 -- .../src/autogen/misc_module_export_type.ts | 13 +- .../autogen/misc_module_export_variants.ts | 13 +- .../src/autogen/product_type_element_type.ts | 13 +- .../src/autogen/product_type_type.ts | 13 +- .../src/autogen/raw_column_def_v_8_type.ts | 13 +- .../raw_column_default_value_v_9_type.ts | 11 -- .../autogen/raw_constraint_data_v_9_type.ts | 13 +- .../raw_constraint_data_v_9_variants.ts | 14 +- .../autogen/raw_constraint_def_v_8_type.ts | 11 -- .../autogen/raw_constraint_def_v_9_type.ts | 13 +- .../src/autogen/raw_index_algorithm_type.ts | 11 -- .../autogen/raw_index_algorithm_variants.ts | 11 -- .../src/autogen/raw_index_def_v_8_type.ts | 13 +- .../src/autogen/raw_index_def_v_9_type.ts | 13 +- .../raw_misc_module_export_v_9_type.ts | 13 +- .../raw_misc_module_export_v_9_variants.ts | 13 +- .../src/autogen/raw_module_def_type.ts | 15 +- .../src/autogen/raw_module_def_v_8_type.ts | 19 +- .../src/autogen/raw_module_def_v_9_type.ts | 23 +-- .../src/autogen/raw_module_def_variants.ts | 15 +- .../src/autogen/raw_reducer_def_v_9_type.ts | 15 +- .../raw_row_level_security_def_v_9_type.ts | 11 -- .../src/autogen/raw_schedule_def_v_9_type.ts | 11 -- .../autogen/raw_scoped_type_name_v_9_type.ts | 11 -- .../src/autogen/raw_sequence_def_v_8_type.ts | 11 -- .../src/autogen/raw_sequence_def_v_9_type.ts | 11 -- .../src/autogen/raw_table_def_v_8_type.ts | 19 +- .../src/autogen/raw_table_def_v_9_type.ts | 23 +-- .../src/autogen/raw_type_def_v_9_type.ts | 13 +- .../raw_unique_constraint_data_v_9_type.ts | 11 -- .../src/autogen/reducer_def_type.ts | 13 +- .../src/autogen/sum_type_type.ts | 13 +- .../src/autogen/sum_type_variant_type.ts | 13 +- .../src/autogen/table_access_type.ts | 11 -- .../src/autogen/table_access_variants.ts | 11 -- .../src/autogen/table_desc_type.ts | 13 +- .../src/autogen/table_type_type.ts | 11 -- .../src/autogen/table_type_variants.ts | 11 -- .../src/autogen/type_alias_type.ts | 11 -- .../src/autogen/typespace_type.ts | 13 +- .../examples/regen-typescript-moduledef.rs | 21 +++ crates/codegen/src/typescript.rs | 17 +- .../codegen__codegen_typescript.snap | 178 +++++++++++------- .../identity_connected_reducer.ts | 2 +- .../identity_disconnected_reducer.ts | 2 +- .../src/module_bindings/index.ts | 22 ++- .../src/module_bindings/message_table.ts | 3 +- .../src/module_bindings/message_type.ts | 2 +- .../module_bindings/send_message_reducer.ts | 2 +- .../src/module_bindings/set_name_reducer.ts | 2 +- .../src/module_bindings/user_table.ts | 3 +- .../src/module_bindings/user_type.ts | 2 +- sdks/typescript/package.json | 6 +- .../sdk/src/client_api/bsatn_row_list_type.ts | 4 +- .../sdk/src/client_api/call_reducer_type.ts | 2 +- .../sdk/src/client_api/client_message_type.ts | 16 +- .../src/client_api/client_message_variants.ts | 16 +- .../compressable_query_update_type.ts | 4 +- .../compressable_query_update_variants.ts | 4 +- .../src/client_api/database_update_type.ts | 4 +- .../sdk/src/client_api/energy_quanta_type.ts | 2 +- .../sdk/src/client_api/identity_token_type.ts | 2 +- .../packages/sdk/src/client_api/index.ts | 4 +- .../client_api/initial_subscription_type.ts | 4 +- .../client_api/one_off_query_response_type.ts | 4 +- .../sdk/src/client_api/one_off_query_type.ts | 2 +- .../sdk/src/client_api/one_off_table_type.ts | 4 +- .../sdk/src/client_api/query_id_type.ts | 2 +- .../sdk/src/client_api/query_update_type.ts | 4 +- .../src/client_api/reducer_call_info_type.ts | 2 +- .../sdk/src/client_api/row_size_hint_type.ts | 2 +- .../src/client_api/row_size_hint_variants.ts | 2 +- .../sdk/src/client_api/server_message_type.ts | 22 ++- .../src/client_api/server_message_variants.ts | 22 ++- .../src/client_api/subscribe_applied_type.ts | 6 +- .../subscribe_multi_applied_type.ts | 6 +- .../src/client_api/subscribe_multi_type.ts | 4 +- .../sdk/src/client_api/subscribe_rows_type.ts | 4 +- .../src/client_api/subscribe_single_type.ts | 4 +- .../sdk/src/client_api/subscribe_type.ts | 2 +- .../src/client_api/subscription_error_type.ts | 2 +- .../sdk/src/client_api/table_update_type.ts | 4 +- .../transaction_update_light_type.ts | 4 +- .../src/client_api/transaction_update_type.ts | 8 +- .../client_api/unsubscribe_applied_type.ts | 6 +- .../unsubscribe_multi_applied_type.ts | 6 +- .../src/client_api/unsubscribe_multi_type.ts | 4 +- .../sdk/src/client_api/unsubscribe_type.ts | 4 +- .../sdk/src/client_api/update_status_type.ts | 4 +- .../src/client_api/update_status_variants.ts | 4 +- .../module_bindings/create_player_reducer.ts | 4 +- .../test-app/src/module_bindings/index.ts | 25 ++- .../src/module_bindings/player_table.ts | 5 +- .../src/module_bindings/player_type.ts | 4 +- .../src/module_bindings/point_type.ts | 2 +- .../module_bindings/unindexed_player_table.ts | 5 +- .../module_bindings/unindexed_player_type.ts | 4 +- .../src/module_bindings/user_table.ts | 3 +- .../test-app/src/module_bindings/user_type.ts | 2 +- 105 files changed, 469 insertions(+), 652 deletions(-) diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts index 86382ebc6e..8669e75809 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_type.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_type.ts @@ -3,31 +3,24 @@ /* 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'; +// Mark import as potentially unused +declare type __keep_SumType = SumType; import { ProductType } from './product_type_type'; +// Mark import as potentially unused +declare type __keep_ProductType = ProductType; import * as AlgebraicTypeVariants from './algebraic_type_variants'; diff --git a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts index e6233b5f40..4028b9ef48 100644 --- a/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/algebraic_type_variants.ts @@ -3,32 +3,27 @@ /* 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 { AlgebraicType as AlgebraicTypeType } from './algebraic_type_type'; +// Mark import as potentially unused +declare type __keep_AlgebraicTypeType = AlgebraicTypeType; import { SumType as SumTypeType } from './sum_type_type'; +// Mark import as potentially unused +declare type __keep_SumTypeType = SumTypeType; import { ProductType as ProductTypeType } from './product_type_type'; +// Mark import as potentially unused +declare type __keep_ProductTypeType = ProductTypeType; export type Ref = { tag: 'Ref'; value: number }; export type Sum = { tag: 'Sum'; value: SumTypeType }; diff --git a/crates/bindings-typescript/src/autogen/index_type_type.ts b/crates/bindings-typescript/src/autogen/index_type_type.ts index bae2e283ca..2e96e84dca 100644 --- a/crates/bindings-typescript/src/autogen/index_type_type.ts +++ b/crates/bindings-typescript/src/autogen/index_type_type.ts @@ -3,28 +3,17 @@ /* 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 * as IndexTypeVariants from './index_type_variants'; diff --git a/crates/bindings-typescript/src/autogen/index_type_variants.ts b/crates/bindings-typescript/src/autogen/index_type_variants.ts index 0c5d59e705..7a2e916fd0 100644 --- a/crates/bindings-typescript/src/autogen/index_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/index_type_variants.ts @@ -3,28 +3,17 @@ /* 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 BTree = { tag: 'BTree' }; diff --git a/crates/bindings-typescript/src/autogen/lifecycle_type.ts b/crates/bindings-typescript/src/autogen/lifecycle_type.ts index 2df3181ffc..c5ae6a341a 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_type.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_type.ts @@ -3,28 +3,17 @@ /* 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 * as LifecycleVariants from './lifecycle_variants'; diff --git a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts index 825dc3f24a..b7a8dbae39 100644 --- a/crates/bindings-typescript/src/autogen/lifecycle_variants.ts +++ b/crates/bindings-typescript/src/autogen/lifecycle_variants.ts @@ -3,28 +3,17 @@ /* 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 Init = { tag: 'Init' }; 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 fa26b3fb12..c2e405164e 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_type.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_type.ts @@ -3,30 +3,21 @@ /* 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'; +// Mark import as potentially unused +declare type __keep_TypeAlias = TypeAlias; import * as MiscModuleExportVariants from './misc_module_export_variants'; 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 f4b9b9f68e..50f7eef484 100644 --- a/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts +++ b/crates/bindings-typescript/src/autogen/misc_module_export_variants.ts @@ -3,29 +3,20 @@ /* 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 as TypeAliasType } from './type_alias_type'; +// Mark import as potentially unused +declare type __keep_TypeAliasType = TypeAliasType; export type TypeAlias = { tag: 'TypeAlias'; value: TypeAliasType }; 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 b3d0d7b6d8..ca92f41049 100644 --- a/crates/bindings-typescript/src/autogen/product_type_element_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_element_type.ts @@ -3,30 +3,21 @@ /* 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 { AlgebraicType } from './algebraic_type_type'; +// Mark import as potentially unused +declare type __keep_AlgebraicType = AlgebraicType; export type ProductTypeElement = { name: string | undefined; diff --git a/crates/bindings-typescript/src/autogen/product_type_type.ts b/crates/bindings-typescript/src/autogen/product_type_type.ts index dc5ead7673..03b41b72cf 100644 --- a/crates/bindings-typescript/src/autogen/product_type_type.ts +++ b/crates/bindings-typescript/src/autogen/product_type_type.ts @@ -3,30 +3,21 @@ /* 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 { ProductTypeElement } from './product_type_element_type'; +// Mark import as potentially unused +declare type __keep_ProductTypeElement = ProductTypeElement; export type ProductType = { elements: ProductTypeElement[]; 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 144f49ff7f..5536ca6211 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 @@ -3,30 +3,21 @@ /* 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 { AlgebraicType } from './algebraic_type_type'; +// Mark import as potentially unused +declare type __keep_AlgebraicType = AlgebraicType; export type RawColumnDefV8 = { colName: string; 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 507780b61e..4e4ecc9a16 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 @@ -3,28 +3,17 @@ /* 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 = { 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 bb8035147f..11113105ba 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 @@ -3,30 +3,21 @@ /* 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'; +// Mark import as potentially unused +declare type __keep_RawUniqueConstraintDataV9 = RawUniqueConstraintDataV9; import * as RawConstraintDataV9Variants from './raw_constraint_data_v_9_variants'; 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 e6520fa0a2..998f86c779 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 @@ -3,29 +3,21 @@ /* 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 as RawUniqueConstraintDataV9Type } from './raw_unique_constraint_data_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawUniqueConstraintDataV9Type = + RawUniqueConstraintDataV9Type; export type Unique = { tag: 'Unique'; value: RawUniqueConstraintDataV9Type }; 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 e3fb96b161..d2d298e901 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 @@ -3,28 +3,17 @@ /* 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 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 43a4f27a51..f28c0f31ad 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 @@ -3,30 +3,21 @@ /* 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 { RawConstraintDataV9 } from './raw_constraint_data_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawConstraintDataV9 = RawConstraintDataV9; export type RawConstraintDefV9 = { name: string | undefined; 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 34ab3f6baf..d42a6bc1aa 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_type.ts @@ -3,28 +3,17 @@ /* 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 * as RawIndexAlgorithmVariants from './raw_index_algorithm_variants'; 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 fca00bf0b4..6071fd9cf5 100644 --- a/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_index_algorithm_variants.ts @@ -3,28 +3,17 @@ /* 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 BTree = { tag: 'BTree'; 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 9ae2c2f0c4..5a0cd394ed 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 @@ -3,30 +3,21 @@ /* 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'; +// Mark import as potentially unused +declare type __keep_IndexType = IndexType; export type RawIndexDefV8 = { indexName: string; 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 687c16e89d..6795e29d6e 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 @@ -3,30 +3,21 @@ /* 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'; +// Mark import as potentially unused +declare type __keep_RawIndexAlgorithm = RawIndexAlgorithm; export type RawIndexDefV9 = { name: string | undefined; 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 87d1ddc3f5..f364c0248e 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 @@ -3,30 +3,21 @@ /* 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'; +// Mark import as potentially unused +declare type __keep_RawColumnDefaultValueV9 = RawColumnDefaultValueV9; import * as RawMiscModuleExportV9Variants from './raw_misc_module_export_v_9_variants'; 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 9eee45ea6b..50be1b32b5 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 @@ -3,30 +3,21 @@ /* 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 as RawColumnDefaultValueV9Type } from './raw_column_default_value_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawColumnDefaultValueV9Type = RawColumnDefaultValueV9Type; export type ColumnDefaultValue = { tag: 'ColumnDefaultValue'; 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 bcbf79852b..9867752713 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_type.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_type.ts @@ -3,31 +3,24 @@ /* 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'; +// Mark import as potentially unused +declare type __keep_RawModuleDefV8 = RawModuleDefV8; import { RawModuleDefV9 } from './raw_module_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawModuleDefV9 = RawModuleDefV9; import * as RawModuleDefVariants from './raw_module_def_variants'; 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 c5e101d48d..b0df7645e2 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 @@ -3,33 +3,30 @@ /* 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 { Typespace } from './typespace_type'; +// Mark import as potentially unused +declare type __keep_Typespace = Typespace; import { TableDesc } from './table_desc_type'; +// Mark import as potentially unused +declare type __keep_TableDesc = TableDesc; import { ReducerDef } from './reducer_def_type'; +// Mark import as potentially unused +declare type __keep_ReducerDef = ReducerDef; import { MiscModuleExport } from './misc_module_export_type'; +// Mark import as potentially unused +declare type __keep_MiscModuleExport = MiscModuleExport; export type RawModuleDefV8 = { typespace: Typespace; 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 effd047ac1..5ad145d204 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 @@ -3,35 +3,36 @@ /* 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 { Typespace } from './typespace_type'; +// Mark import as potentially unused +declare type __keep_Typespace = Typespace; import { RawTableDefV9 } from './raw_table_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawTableDefV9 = RawTableDefV9; import { RawReducerDefV9 } from './raw_reducer_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawReducerDefV9 = RawReducerDefV9; import { RawTypeDefV9 } from './raw_type_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawTypeDefV9 = RawTypeDefV9; import { RawMiscModuleExportV9 } from './raw_misc_module_export_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawMiscModuleExportV9 = RawMiscModuleExportV9; import { RawRowLevelSecurityDefV9 } from './raw_row_level_security_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawRowLevelSecurityDefV9 = RawRowLevelSecurityDefV9; export type RawModuleDefV9 = { typespace: Typespace; 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 48b7371f22..e81b5dbef6 100644 --- a/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts +++ b/crates/bindings-typescript/src/autogen/raw_module_def_variants.ts @@ -3,31 +3,24 @@ /* 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 as RawModuleDefV8Type } from './raw_module_def_v_8_type'; +// Mark import as potentially unused +declare type __keep_RawModuleDefV8Type = RawModuleDefV8Type; import { RawModuleDefV9 as RawModuleDefV9Type } from './raw_module_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawModuleDefV9Type = RawModuleDefV9Type; export type V8BackCompat = { tag: 'V8BackCompat'; value: RawModuleDefV8Type }; export type V9 = { tag: 'V9'; value: RawModuleDefV9Type }; 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 bc1cd8f258..7583ee9daa 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 @@ -3,31 +3,24 @@ /* 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 { ProductType } from './product_type_type'; +// Mark import as potentially unused +declare type __keep_ProductType = ProductType; import { Lifecycle } from './lifecycle_type'; +// Mark import as potentially unused +declare type __keep_Lifecycle = Lifecycle; export type RawReducerDefV9 = { name: string; 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 ad0a7c508b..fc71a0a1f7 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 @@ -3,28 +3,17 @@ /* 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 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 b92f7a5888..c0e395a917 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 @@ -3,28 +3,17 @@ /* 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 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 dc40fdadd1..7426e239aa 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 @@ -3,28 +3,17 @@ /* 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 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 ae5504d114..9f2ac0ef63 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 @@ -3,28 +3,17 @@ /* 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 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 1757f1b73b..0fb7655775 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 @@ -3,28 +3,17 @@ /* 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 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 6c82d1f1ce..8ffc66be80 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 @@ -3,33 +3,30 @@ /* 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 { RawColumnDefV8 } from './raw_column_def_v_8_type'; +// Mark import as potentially unused +declare type __keep_RawColumnDefV8 = RawColumnDefV8; import { RawIndexDefV8 } from './raw_index_def_v_8_type'; +// Mark import as potentially unused +declare type __keep_RawIndexDefV8 = RawIndexDefV8; import { RawConstraintDefV8 } from './raw_constraint_def_v_8_type'; +// Mark import as potentially unused +declare type __keep_RawConstraintDefV8 = RawConstraintDefV8; import { RawSequenceDefV8 } from './raw_sequence_def_v_8_type'; +// Mark import as potentially unused +declare type __keep_RawSequenceDefV8 = RawSequenceDefV8; export type RawTableDefV8 = { tableName: string; 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 01662f38eb..e084a35dda 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 @@ -3,35 +3,36 @@ /* 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 { RawIndexDefV9 } from './raw_index_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawIndexDefV9 = RawIndexDefV9; import { RawConstraintDefV9 } from './raw_constraint_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawConstraintDefV9 = RawConstraintDefV9; import { RawSequenceDefV9 } from './raw_sequence_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawSequenceDefV9 = RawSequenceDefV9; import { RawScheduleDefV9 } from './raw_schedule_def_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawScheduleDefV9 = RawScheduleDefV9; import { TableType } from './table_type_type'; +// Mark import as potentially unused +declare type __keep_TableType = TableType; import { TableAccess } from './table_access_type'; +// Mark import as potentially unused +declare type __keep_TableAccess = TableAccess; export type RawTableDefV9 = { name: string; 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 142914c439..f71548f0e3 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 @@ -3,30 +3,21 @@ /* 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 { RawScopedTypeNameV9 } from './raw_scoped_type_name_v_9_type'; +// Mark import as potentially unused +declare type __keep_RawScopedTypeNameV9 = RawScopedTypeNameV9; export type RawTypeDefV9 = { name: RawScopedTypeNameV9; 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 fbcfcb34de..4836697f17 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 @@ -3,28 +3,17 @@ /* 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 RawUniqueConstraintDataV9 = { diff --git a/crates/bindings-typescript/src/autogen/reducer_def_type.ts b/crates/bindings-typescript/src/autogen/reducer_def_type.ts index 4599f53e35..96afd3a475 100644 --- a/crates/bindings-typescript/src/autogen/reducer_def_type.ts +++ b/crates/bindings-typescript/src/autogen/reducer_def_type.ts @@ -3,30 +3,21 @@ /* 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 { ProductTypeElement } from './product_type_element_type'; +// Mark import as potentially unused +declare type __keep_ProductTypeElement = ProductTypeElement; export type ReducerDef = { name: string; diff --git a/crates/bindings-typescript/src/autogen/sum_type_type.ts b/crates/bindings-typescript/src/autogen/sum_type_type.ts index 9e93939f5f..9251ccebaa 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_type.ts @@ -3,30 +3,21 @@ /* 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 { SumTypeVariant } from './sum_type_variant_type'; +// Mark import as potentially unused +declare type __keep_SumTypeVariant = SumTypeVariant; export type SumType = { variants: SumTypeVariant[]; 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 7028deedb0..ef3f01cbd8 100644 --- a/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts +++ b/crates/bindings-typescript/src/autogen/sum_type_variant_type.ts @@ -3,30 +3,21 @@ /* 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 { AlgebraicType } from './algebraic_type_type'; +// Mark import as potentially unused +declare type __keep_AlgebraicType = AlgebraicType; export type SumTypeVariant = { name: string | undefined; diff --git a/crates/bindings-typescript/src/autogen/table_access_type.ts b/crates/bindings-typescript/src/autogen/table_access_type.ts index 1da696b60f..ab67524118 100644 --- a/crates/bindings-typescript/src/autogen/table_access_type.ts +++ b/crates/bindings-typescript/src/autogen/table_access_type.ts @@ -3,28 +3,17 @@ /* 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 * as TableAccessVariants from './table_access_variants'; diff --git a/crates/bindings-typescript/src/autogen/table_access_variants.ts b/crates/bindings-typescript/src/autogen/table_access_variants.ts index fc218c98ed..92585ee62e 100644 --- a/crates/bindings-typescript/src/autogen/table_access_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_access_variants.ts @@ -3,28 +3,17 @@ /* 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 Public = { tag: 'Public' }; diff --git a/crates/bindings-typescript/src/autogen/table_desc_type.ts b/crates/bindings-typescript/src/autogen/table_desc_type.ts index 469e637714..43e8cbf61c 100644 --- a/crates/bindings-typescript/src/autogen/table_desc_type.ts +++ b/crates/bindings-typescript/src/autogen/table_desc_type.ts @@ -3,30 +3,21 @@ /* 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 { RawTableDefV8 } from './raw_table_def_v_8_type'; +// Mark import as potentially unused +declare type __keep_RawTableDefV8 = RawTableDefV8; export type TableDesc = { schema: RawTableDefV8; diff --git a/crates/bindings-typescript/src/autogen/table_type_type.ts b/crates/bindings-typescript/src/autogen/table_type_type.ts index 1d5cbdaa31..240d6e1ecd 100644 --- a/crates/bindings-typescript/src/autogen/table_type_type.ts +++ b/crates/bindings-typescript/src/autogen/table_type_type.ts @@ -3,28 +3,17 @@ /* 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 * as TableTypeVariants from './table_type_variants'; diff --git a/crates/bindings-typescript/src/autogen/table_type_variants.ts b/crates/bindings-typescript/src/autogen/table_type_variants.ts index 2731730daf..145ee815bd 100644 --- a/crates/bindings-typescript/src/autogen/table_type_variants.ts +++ b/crates/bindings-typescript/src/autogen/table_type_variants.ts @@ -3,28 +3,17 @@ /* 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 System = { tag: 'System' }; diff --git a/crates/bindings-typescript/src/autogen/type_alias_type.ts b/crates/bindings-typescript/src/autogen/type_alias_type.ts index 25d4d8efa5..645bc20347 100644 --- a/crates/bindings-typescript/src/autogen/type_alias_type.ts +++ b/crates/bindings-typescript/src/autogen/type_alias_type.ts @@ -3,28 +3,17 @@ /* 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 TypeAlias = { diff --git a/crates/bindings-typescript/src/autogen/typespace_type.ts b/crates/bindings-typescript/src/autogen/typespace_type.ts index 7f797c1ba3..b3c7c923ee 100644 --- a/crates/bindings-typescript/src/autogen/typespace_type.ts +++ b/crates/bindings-typescript/src/autogen/typespace_type.ts @@ -3,30 +3,21 @@ /* 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 { AlgebraicType } from './algebraic_type_type'; +// Mark import as potentially unused +declare type __keep_AlgebraicType = AlgebraicType; export type Typespace = { types: AlgebraicType[]; diff --git a/crates/codegen/examples/regen-typescript-moduledef.rs b/crates/codegen/examples/regen-typescript-moduledef.rs index fcf098bcda..20678c44e8 100644 --- a/crates/codegen/examples/regen-typescript-moduledef.rs +++ b/crates/codegen/examples/regen-typescript-moduledef.rs @@ -40,6 +40,27 @@ fn main() -> anyhow::Result<()> { return Ok(()); } let code = regex_replace!(&code, r"@clockworklabs/spacetimedb-sdk", "../index"); + + // Elide types which are related to client-side only things + let code = regex_replace!(&code, r"type CallReducerFlags as __CallReducerFlags,", r""); + let code = regex_replace!(&code, r"type ErrorContextInterface as __ErrorContextInterface,", r""); + let code = regex_replace!(&code, r"type Event as __Event,", r""); + let code = regex_replace!(&code, r"type EventContextInterface as __EventContextInterface,", r""); + let code = regex_replace!( + &code, + r"type ReducerEventContextInterface as __ReducerEventContextInterface,", + r"" + ); + let code = regex_replace!( + &code, + r"type SubscriptionEventContextInterface as __SubscriptionEventContextInterface,", + r"" + ); + let code = regex_replace!(&code, r"DbConnectionBuilder as __DbConnectionBuilder,", r""); + let code = regex_replace!(&code, r"DbConnectionImpl as __DbConnectionImpl,", r""); + let code = regex_replace!(&code, r"SubscriptionBuilderImpl as __SubscriptionBuilderImpl,", r""); + let code = regex_replace!(&code, r"TableCache as __TableCache,", r""); + let code = regex_replace!(&code, r"ClientCache as __ClientCache,", r""); fs::write(dir.join(filename), code.as_bytes()) })?; diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index 104793979e..761195b878 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -142,6 +142,12 @@ impl Lang for TypeScript { "import {{ type EventContext, type Reducer, RemoteReducers, RemoteTables }} from \".\";" ); + // Mark potentially unused types + writeln!( + out, + "declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables];" + ); + let table_name = table.name.deref(); let table_name_pascalcase = table.name.deref().to_case(Case::Pascal); let table_handle = table_name_pascalcase.clone() + "TableHandle"; @@ -532,7 +538,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { writeln!(out, "let __writer = new __BinaryWriter(1024);"); writeln!( out, - "{reducer_variant}.getTypeScriptAlgebraicType().serialize(__writer, __args);" + "{reducer_variant}.serialize(__writer, __args);" ); writeln!(out, "let __argsBuffer = __writer.getBuffer();"); writeln!(out, "this.connection.callReducer(\"{reducer_name}\", __argsBuffer, this.setCallReducerFlags.{reducer_function_name}Flags);"); @@ -606,9 +612,10 @@ fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) { let row_type = type_ref_name(module, type_ref); writeln!(out, "get {table_name_camelcase}(): {table_handle} {{"); out.with_indent(|out| { + writeln!(out, "// clientCache is a private property"); writeln!( out, - "return new {table_handle}(this.connection.clientCache.getOrCreateTable<{row_type}>(REMOTE_MODULE.tables.{table_name}));" + "return new {table_handle}((this.connection as unknown as {{ clientCache: __ClientCache }}).clientCache.getOrCreateTable<{row_type}>(REMOTE_MODULE.tables.{table_name}));" ); }); writeln!(out, "}}"); @@ -673,6 +680,7 @@ fn print_spacetimedb_imports(out: &mut Indenter) { "AlgebraicType as __AlgebraicTypeValue", "type AlgebraicTypeVariants as __AlgebraicTypeVariants", "Identity as __Identity", + "ClientCache as __ClientCache", "ConnectionId as __ConnectionId", "Timestamp as __Timestamp", "TimeDuration as __TimeDuration", @@ -712,7 +720,6 @@ fn print_file_header(output: &mut Indenter, include_version: bool) { fn print_lint_suppression(output: &mut Indenter) { writeln!(output, "/* eslint-disable */"); writeln!(output, "/* tslint:disable */"); - writeln!(output, "// @ts-nocheck"); } fn write_get_algebraic_type_for_product( @@ -1202,8 +1209,12 @@ fn print_imports(module: &ModuleDef, out: &mut Indenter, imports: Imports, suffi out, "import {{ {type_name} as {type_name}{suffix} }} from \"./{module_name}\";" ); + writeln!(out, "// Mark import as potentially unused"); + writeln!(out, "declare type __keep_{type_name}{suffix} = {type_name}{suffix};"); } else { writeln!(out, "import {{ {type_name} }} from \"./{module_name}\";"); + writeln!(out, "// Mark import as potentially unused"); + writeln!(out, "declare type __keep_{type_name} = {type_name};"); } } } diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index 6bd713ca7b..e2422bdeb1 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -8,11 +8,11 @@ expression: outfiles /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -70,11 +70,11 @@ export default AddPlayer; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -132,11 +132,11 @@ export default AddPrivate; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -196,11 +196,11 @@ export default Add; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -255,11 +255,11 @@ export default AssertCallerIdentityIsModuleIdentity; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -318,11 +318,11 @@ export default Baz; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -377,11 +377,11 @@ export default ClientConnected; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -439,11 +439,11 @@ export default DeletePlayer; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -501,11 +501,11 @@ export default DeletePlayersByName; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -525,6 +525,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { Baz } from "./baz_type"; +// Mark import as potentially unused +declare type __keep_Baz = Baz; import * as FoobarVariants from './foobar_variants' @@ -575,11 +577,11 @@ export default Foobar; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -599,6 +601,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from "@clockworklabs/spacetimedb-sdk"; import { Baz as BazType } from "./baz_type"; +// Mark import as potentially unused +declare type __keep_BazType = BazType; export type Baz = { tag: "Baz", value: BazType }; @@ -612,11 +616,11 @@ export type Har = { tag: "Har", value: number }; /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -637,6 +641,7 @@ import { } from "@clockworklabs/spacetimedb-sdk"; import { HasSpecialStuff } from "./has_special_stuff_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; +declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** * Table handle for the table `has_special_stuff`. @@ -686,11 +691,11 @@ export class HasSpecialStuffTableHandle { /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -753,11 +758,11 @@ VERSION_COMMENT /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -1057,7 +1062,7 @@ export class RemoteReducers { add(name: string, age: number) { const __args = { name, age }; let __writer = new __BinaryWriter(1024); - Add.getTypeScriptAlgebraicType().serialize(__writer, __args); + Add.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("add", __argsBuffer, this.setCallReducerFlags.addFlags); } @@ -1073,7 +1078,7 @@ export class RemoteReducers { addPlayer(name: string) { const __args = { name }; let __writer = new __BinaryWriter(1024); - AddPlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); + AddPlayer.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("add_player", __argsBuffer, this.setCallReducerFlags.addPlayerFlags); } @@ -1089,7 +1094,7 @@ export class RemoteReducers { addPrivate(name: string) { const __args = { name }; let __writer = new __BinaryWriter(1024); - AddPrivate.getTypeScriptAlgebraicType().serialize(__writer, __args); + AddPrivate.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("add_private", __argsBuffer, this.setCallReducerFlags.addPrivateFlags); } @@ -1125,7 +1130,7 @@ export class RemoteReducers { deletePlayer(id: bigint) { const __args = { id }; let __writer = new __BinaryWriter(1024); - DeletePlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); + DeletePlayer.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("delete_player", __argsBuffer, this.setCallReducerFlags.deletePlayerFlags); } @@ -1141,7 +1146,7 @@ export class RemoteReducers { deletePlayersByName(name: string) { const __args = { name }; let __writer = new __BinaryWriter(1024); - DeletePlayersByName.getTypeScriptAlgebraicType().serialize(__writer, __args); + DeletePlayersByName.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("delete_players_by_name", __argsBuffer, this.setCallReducerFlags.deletePlayersByNameFlags); } @@ -1157,7 +1162,7 @@ export class RemoteReducers { listOverAge(age: number) { const __args = { age }; let __writer = new __BinaryWriter(1024); - ListOverAge.getTypeScriptAlgebraicType().serialize(__writer, __args); + ListOverAge.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("list_over_age", __argsBuffer, this.setCallReducerFlags.listOverAgeFlags); } @@ -1197,7 +1202,7 @@ export class RemoteReducers { repeatingTest(arg: RepeatingTestArg) { const __args = { arg }; let __writer = new __BinaryWriter(1024); - RepeatingTest.getTypeScriptAlgebraicType().serialize(__writer, __args); + RepeatingTest.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("repeating_test", __argsBuffer, this.setCallReducerFlags.repeatingTestFlags); } @@ -1225,7 +1230,7 @@ export class RemoteReducers { test(arg: TestA, arg2: TestB, arg3: NamespaceTestC, arg4: NamespaceTestF) { const __args = { arg, arg2, arg3, arg4 }; let __writer = new __BinaryWriter(1024); - Test.getTypeScriptAlgebraicType().serialize(__writer, __args); + Test.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer("test", __argsBuffer, this.setCallReducerFlags.testFlags); } @@ -1324,51 +1329,63 @@ export class RemoteTables { constructor(private connection: __DbConnectionImpl) {} get hasSpecialStuff(): HasSpecialStuffTableHandle { - return new HasSpecialStuffTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.has_special_stuff)); + // clientCache is a private property + return new HasSpecialStuffTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.has_special_stuff)); } get loggedOutPlayer(): LoggedOutPlayerTableHandle { - return new LoggedOutPlayerTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.logged_out_player)); + // clientCache is a private property + return new LoggedOutPlayerTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.logged_out_player)); } get person(): PersonTableHandle { - return new PersonTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.person)); + // clientCache is a private property + return new PersonTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.person)); } get pkMultiIdentity(): PkMultiIdentityTableHandle { - return new PkMultiIdentityTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.pk_multi_identity)); + // clientCache is a private property + return new PkMultiIdentityTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.pk_multi_identity)); } get player(): PlayerTableHandle { - return new PlayerTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.player)); + // clientCache is a private property + return new PlayerTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.player)); } get points(): PointsTableHandle { - return new PointsTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.points)); + // clientCache is a private property + return new PointsTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.points)); } get privateTable(): PrivateTableTableHandle { - return new PrivateTableTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.private_table)); + // clientCache is a private property + return new PrivateTableTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.private_table)); } get repeatingTestArg(): RepeatingTestArgTableHandle { - return new RepeatingTestArgTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.repeating_test_arg)); + // clientCache is a private property + return new RepeatingTestArgTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.repeating_test_arg)); } get testA(): TestATableHandle { - return new TestATableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.test_a)); + // clientCache is a private property + return new TestATableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.test_a)); } get testD(): TestDTableHandle { - return new TestDTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.test_d)); + // clientCache is a private property + return new TestDTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.test_d)); } get testE(): TestETableHandle { - return new TestETableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.test_e)); + // clientCache is a private property + return new TestETableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.test_e)); } get testF(): TestFTableHandle { - return new TestFTableHandle(this.connection.clientCache.getOrCreateTable(REMOTE_MODULE.tables.test_f)); + // clientCache is a private property + return new TestFTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.test_f)); } } @@ -1394,11 +1411,11 @@ export type ErrorContext = __ErrorContextInterface( - REMOTE_MODULE.tables.message - ) + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.message) ); } get user(): UserTableHandle { + // clientCache is a private property return new UserTableHandle( - this.connection.clientCache.getOrCreateTable( - REMOTE_MODULE.tables.user - ) + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.user) ); } } 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 7d200e76b2..337aa691f8 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -33,6 +33,7 @@ import { RemoteReducers, RemoteTables, } from '.'; +declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** * Table handle for the table `message`. 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 1745f1011d..da203406e6 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 9fff4b10c6..cda151bcd8 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 f5fffde6dc..f424cec065 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 567c19cc13..efc16e926a 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -33,6 +33,7 @@ import { RemoteReducers, RemoteTables, } from '.'; +declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** * Table handle for the table `user`. 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 e1b35ac585..2f30963f7a 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, diff --git a/sdks/typescript/package.json b/sdks/typescript/package.json index ac61030c7f..a13ee1e524 100644 --- a/sdks/typescript/package.json +++ b/sdks/typescript/package.json @@ -6,14 +6,14 @@ "pnpm": ">=9.0.0" }, "scripts": { - "build": "cd packages/sdk && pnpm build", "changeset": "changeset", "ci:release": "changeset publish", "ci:version": "changeset version", "format": "prettier --write .", "lint": "prettier . --check", - "test": "pnpm -r --filter \"./packages/*\" run test", - "generate": "pnpm -r --filter \"./packages/*\" run generate" + "build": "pnpm --filter ./packages/sdk run build && pnpm --filter ./packages/test-app run build && pnpm --filter ./examples/quickstart-chat run build", + "test": "pnpm --filter ./packages/sdk run test && pnpm --filter ./packages/test-app run test && pnpm --filter ./examples/quickstart-chat run test", + "generate": "pnpm --filter ./packages/sdk run generate && pnpm --filter ./packages/test-app run generate && pnpm --filter ./examples/quickstart-chat run generate" }, "devDependencies": { "@changesets/changelog-github": "^0.5.0", 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 1c282b973d..08ee0af1e7 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { RowSizeHint } from './row_size_hint_type'; +// Mark import as potentially unused +declare type __keep_RowSizeHint = RowSizeHint; export type BsatnRowList = { sizeHint: RowSizeHint; 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 e846ce8740..4253fc0f5f 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 085812fce9..4d231b8197 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,12 +27,26 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { CallReducer } from './call_reducer_type'; +// Mark import as potentially unused +declare type __keep_CallReducer = CallReducer; import { Subscribe } from './subscribe_type'; +// Mark import as potentially unused +declare type __keep_Subscribe = Subscribe; import { OneOffQuery } from './one_off_query_type'; +// Mark import as potentially unused +declare type __keep_OneOffQuery = OneOffQuery; import { SubscribeSingle } from './subscribe_single_type'; +// Mark import as potentially unused +declare type __keep_SubscribeSingle = SubscribeSingle; import { SubscribeMulti } from './subscribe_multi_type'; +// Mark import as potentially unused +declare type __keep_SubscribeMulti = SubscribeMulti; import { Unsubscribe } from './unsubscribe_type'; +// Mark import as potentially unused +declare type __keep_Unsubscribe = Unsubscribe; import { UnsubscribeMulti } from './unsubscribe_multi_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeMulti = UnsubscribeMulti; import * as ClientMessageVariants from './client_message_variants'; 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 efbb726c8a..b64e364695 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,12 +27,26 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { CallReducer as CallReducerType } from './call_reducer_type'; +// Mark import as potentially unused +declare type __keep_CallReducerType = CallReducerType; import { Subscribe as SubscribeType } from './subscribe_type'; +// Mark import as potentially unused +declare type __keep_SubscribeType = SubscribeType; import { OneOffQuery as OneOffQueryType } from './one_off_query_type'; +// Mark import as potentially unused +declare type __keep_OneOffQueryType = OneOffQueryType; import { SubscribeSingle as SubscribeSingleType } from './subscribe_single_type'; +// Mark import as potentially unused +declare type __keep_SubscribeSingleType = SubscribeSingleType; import { SubscribeMulti as SubscribeMultiType } from './subscribe_multi_type'; +// Mark import as potentially unused +declare type __keep_SubscribeMultiType = SubscribeMultiType; import { Unsubscribe as UnsubscribeType } from './unsubscribe_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeType = UnsubscribeType; import { UnsubscribeMulti as UnsubscribeMultiType } from './unsubscribe_multi_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeMultiType = UnsubscribeMultiType; export type CallReducer = { tag: 'CallReducer'; value: CallReducerType }; export type Subscribe = { tag: 'Subscribe'; value: SubscribeType }; 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 7fdca9d205..a24ee24428 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryUpdate } from './query_update_type'; +// Mark import as potentially unused +declare type __keep_QueryUpdate = QueryUpdate; import * as CompressableQueryUpdateVariants from './compressable_query_update_variants'; 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 d0278af5f6..9ba3938e59 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryUpdate as QueryUpdateType } from './query_update_type'; +// Mark import as potentially unused +declare type __keep_QueryUpdateType = QueryUpdateType; export type Uncompressed = { tag: 'Uncompressed'; value: QueryUpdateType }; export type Brotli = { tag: 'Brotli'; 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 5d3a30f98f..bd1955b121 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { TableUpdate } from './table_update_type'; +// Mark import as potentially unused +declare type __keep_TableUpdate = TableUpdate; export type DatabaseUpdate = { tables: TableUpdate[]; 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 89f3459d5f..b49990bf69 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 c49672e91e..d484705a93 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, diff --git a/sdks/typescript/packages/sdk/src/client_api/index.ts b/sdks/typescript/packages/sdk/src/client_api/index.ts index cbd8f78efe..e83eccbcd5 100644 --- a/sdks/typescript/packages/sdk/src/client_api/index.ts +++ b/sdks/typescript/packages/sdk/src/client_api/index.ts @@ -1,15 +1,15 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit 5901fb5063808c4dbf2030beb935441a19f37102). +// This was generated using spacetimedb cli version 1.4.0 (commit 9e4684ee0f7b78689c60efbdcb7a9e23e34eea15). /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 baed661250..05fc69ef0c 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { DatabaseUpdate } from './database_update_type'; +// Mark import as potentially unused +declare type __keep_DatabaseUpdate = DatabaseUpdate; export type InitialSubscription = { databaseUpdate: DatabaseUpdate; 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 03fbf4ac26..c1e3372089 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { OneOffTable } from './one_off_table_type'; +// Mark import as potentially unused +declare type __keep_OneOffTable = OneOffTable; export type OneOffQueryResponse = { messageId: Uint8Array; 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 6a3edcd353..439ffbcb19 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 36a3bab83a..73573492da 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { BsatnRowList } from './bsatn_row_list_type'; +// Mark import as potentially unused +declare type __keep_BsatnRowList = BsatnRowList; export type OneOffTable = { tableName: string; 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 8fec5d3b40..25596732bd 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 5c3bdf6263..eb17d1b040 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { BsatnRowList } from './bsatn_row_list_type'; +// Mark import as potentially unused +declare type __keep_BsatnRowList = BsatnRowList; export type QueryUpdate = { deletes: BsatnRowList; 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 39241e623d..c48d6248e6 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 32717a01c4..915272af6c 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 32525f5158..6772c4f3bf 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 b2d20cb8ab..d3736e6b46 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,15 +27,35 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { InitialSubscription } from './initial_subscription_type'; +// Mark import as potentially unused +declare type __keep_InitialSubscription = InitialSubscription; import { TransactionUpdate } from './transaction_update_type'; +// Mark import as potentially unused +declare type __keep_TransactionUpdate = TransactionUpdate; import { TransactionUpdateLight } from './transaction_update_light_type'; +// Mark import as potentially unused +declare type __keep_TransactionUpdateLight = TransactionUpdateLight; import { IdentityToken } from './identity_token_type'; +// Mark import as potentially unused +declare type __keep_IdentityToken = IdentityToken; import { OneOffQueryResponse } from './one_off_query_response_type'; +// Mark import as potentially unused +declare type __keep_OneOffQueryResponse = OneOffQueryResponse; import { SubscribeApplied } from './subscribe_applied_type'; +// Mark import as potentially unused +declare type __keep_SubscribeApplied = SubscribeApplied; import { UnsubscribeApplied } from './unsubscribe_applied_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeApplied = UnsubscribeApplied; import { SubscriptionError } from './subscription_error_type'; +// Mark import as potentially unused +declare type __keep_SubscriptionError = SubscriptionError; import { SubscribeMultiApplied } from './subscribe_multi_applied_type'; +// Mark import as potentially unused +declare type __keep_SubscribeMultiApplied = SubscribeMultiApplied; import { UnsubscribeMultiApplied } from './unsubscribe_multi_applied_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeMultiApplied = UnsubscribeMultiApplied; import * as ServerMessageVariants from './server_message_variants'; 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 298eb9fdc3..a0c86ce68b 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,15 +27,35 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { InitialSubscription as InitialSubscriptionType } from './initial_subscription_type'; +// Mark import as potentially unused +declare type __keep_InitialSubscriptionType = InitialSubscriptionType; import { TransactionUpdate as TransactionUpdateType } from './transaction_update_type'; +// Mark import as potentially unused +declare type __keep_TransactionUpdateType = TransactionUpdateType; import { TransactionUpdateLight as TransactionUpdateLightType } from './transaction_update_light_type'; +// Mark import as potentially unused +declare type __keep_TransactionUpdateLightType = TransactionUpdateLightType; import { IdentityToken as IdentityTokenType } from './identity_token_type'; +// Mark import as potentially unused +declare type __keep_IdentityTokenType = IdentityTokenType; import { OneOffQueryResponse as OneOffQueryResponseType } from './one_off_query_response_type'; +// Mark import as potentially unused +declare type __keep_OneOffQueryResponseType = OneOffQueryResponseType; import { SubscribeApplied as SubscribeAppliedType } from './subscribe_applied_type'; +// Mark import as potentially unused +declare type __keep_SubscribeAppliedType = SubscribeAppliedType; import { UnsubscribeApplied as UnsubscribeAppliedType } from './unsubscribe_applied_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeAppliedType = UnsubscribeAppliedType; import { SubscriptionError as SubscriptionErrorType } from './subscription_error_type'; +// Mark import as potentially unused +declare type __keep_SubscriptionErrorType = SubscriptionErrorType; import { SubscribeMultiApplied as SubscribeMultiAppliedType } from './subscribe_multi_applied_type'; +// Mark import as potentially unused +declare type __keep_SubscribeMultiAppliedType = SubscribeMultiAppliedType; import { UnsubscribeMultiApplied as UnsubscribeMultiAppliedType } from './unsubscribe_multi_applied_type'; +// Mark import as potentially unused +declare type __keep_UnsubscribeMultiAppliedType = UnsubscribeMultiAppliedType; export type InitialSubscription = { tag: 'InitialSubscription'; 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 66f737e09a..f2ee3d8dcd 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,7 +27,11 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryId } from './query_id_type'; +// Mark import as potentially unused +declare type __keep_QueryId = QueryId; import { SubscribeRows } from './subscribe_rows_type'; +// Mark import as potentially unused +declare type __keep_SubscribeRows = SubscribeRows; export type SubscribeApplied = { requestId: number; 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 85bcebea99..509921cf73 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,7 +27,11 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryId } from './query_id_type'; +// Mark import as potentially unused +declare type __keep_QueryId = QueryId; import { DatabaseUpdate } from './database_update_type'; +// Mark import as potentially unused +declare type __keep_DatabaseUpdate = DatabaseUpdate; export type SubscribeMultiApplied = { requestId: number; 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 71dbf0cb66..4f5fc72082 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryId } from './query_id_type'; +// Mark import as potentially unused +declare type __keep_QueryId = QueryId; export type SubscribeMulti = { queryStrings: string[]; 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 7642a8dcde..a4ce823f66 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { TableUpdate } from './table_update_type'; +// Mark import as potentially unused +declare type __keep_TableUpdate = TableUpdate; export type SubscribeRows = { tableId: number; 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 e1b6f88ff8..e935cfea07 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryId } from './query_id_type'; +// Mark import as potentially unused +declare type __keep_QueryId = QueryId; export type SubscribeSingle = { query: string; 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 e1b75044d1..de0a2d08c1 100644 --- a/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/subscribe_type.ts @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 0a848440c4..623731e609 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 eda02f8c09..83e3309bbd 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { CompressableQueryUpdate } from './compressable_query_update_type'; +// Mark import as potentially unused +declare type __keep_CompressableQueryUpdate = CompressableQueryUpdate; export type TableUpdate = { tableId: number; 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 f0fb4ca184..4f9690ca1a 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { DatabaseUpdate } from './database_update_type'; +// Mark import as potentially unused +declare type __keep_DatabaseUpdate = DatabaseUpdate; export type TransactionUpdateLight = { requestId: number; 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 03df8a9383..2728e96349 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,8 +27,14 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { UpdateStatus } from './update_status_type'; +// Mark import as potentially unused +declare type __keep_UpdateStatus = UpdateStatus; import { ReducerCallInfo } from './reducer_call_info_type'; +// Mark import as potentially unused +declare type __keep_ReducerCallInfo = ReducerCallInfo; import { EnergyQuanta } from './energy_quanta_type'; +// Mark import as potentially unused +declare type __keep_EnergyQuanta = EnergyQuanta; export type TransactionUpdate = { status: UpdateStatus; 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 9667820ed9..7fdadecc0c 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,7 +27,11 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryId } from './query_id_type'; +// Mark import as potentially unused +declare type __keep_QueryId = QueryId; import { SubscribeRows } from './subscribe_rows_type'; +// Mark import as potentially unused +declare type __keep_SubscribeRows = SubscribeRows; export type UnsubscribeApplied = { requestId: number; 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 13270b459b..a73e58014b 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,7 +27,11 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryId } from './query_id_type'; +// Mark import as potentially unused +declare type __keep_QueryId = QueryId; import { DatabaseUpdate } from './database_update_type'; +// Mark import as potentially unused +declare type __keep_DatabaseUpdate = DatabaseUpdate; export type UnsubscribeMultiApplied = { requestId: number; 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 48fa0e0704..7cf4f9d541 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryId } from './query_id_type'; +// Mark import as potentially unused +declare type __keep_QueryId = QueryId; export type UnsubscribeMulti = { requestId: number; 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 ddd053b828..c6f4f59bc3 100644 --- a/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts +++ b/sdks/typescript/packages/sdk/src/client_api/unsubscribe_type.ts @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { QueryId } from './query_id_type'; +// Mark import as potentially unused +declare type __keep_QueryId = QueryId; export type Unsubscribe = { requestId: number; 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 cbe096930e..093b096f9f 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { DatabaseUpdate } from './database_update_type'; +// Mark import as potentially unused +declare type __keep_DatabaseUpdate = DatabaseUpdate; import * as UpdateStatusVariants from './update_status_variants'; 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 f6bd2c4d73..75ff3c6735 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '../index'; import { DatabaseUpdate as DatabaseUpdateType } from './database_update_type'; +// Mark import as potentially unused +declare type __keep_DatabaseUpdateType = DatabaseUpdateType; export type Committed = { tag: 'Committed'; value: DatabaseUpdateType }; export type Failed = { tag: 'Failed'; value: string }; 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 66463907c7..0d12996904 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -28,6 +28,8 @@ import { } from '@clockworklabs/spacetimedb-sdk'; import { Point } from './point_type'; +// Mark import as potentially unused +declare type __keep_Point = Point; export type CreatePlayer = { name: string; 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 f71cb9cef9..4e51db613c 100644 --- a/sdks/typescript/packages/test-app/src/module_bindings/index.ts +++ b/sdks/typescript/packages/test-app/src/module_bindings/index.ts @@ -1,15 +1,15 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit 5901fb5063808c4dbf2030beb935441a19f37102). +// This was generated using spacetimedb cli version 1.4.0 (commit 9e4684ee0f7b78689c60efbdcb7a9e23e34eea15). /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -131,7 +131,7 @@ export class RemoteReducers { createPlayer(name: string, location: Point) { const __args = { name, location }; let __writer = new __BinaryWriter(1024); - CreatePlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); + CreatePlayer.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); this.connection.callReducer( 'create_player', @@ -164,26 +164,31 @@ export class RemoteTables { constructor(private connection: __DbConnectionImpl) {} get player(): PlayerTableHandle { + // clientCache is a private property return new PlayerTableHandle( - this.connection.clientCache.getOrCreateTable( - REMOTE_MODULE.tables.player - ) + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.player) ); } get unindexedPlayer(): UnindexedPlayerTableHandle { + // clientCache is a private property return new UnindexedPlayerTableHandle( - this.connection.clientCache.getOrCreateTable( + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable( REMOTE_MODULE.tables.unindexed_player ) ); } get user(): UserTableHandle { + // clientCache is a private property return new UserTableHandle( - this.connection.clientCache.getOrCreateTable( - REMOTE_MODULE.tables.user - ) + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.user) ); } } 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 973cc5c635..3432b01ff0 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -28,6 +28,8 @@ import { } from '@clockworklabs/spacetimedb-sdk'; import { Player } from './player_type'; import { Point } from './point_type'; +// Mark import as potentially unused +declare type __keep_Point = Point; import { type EventContext, @@ -35,6 +37,7 @@ import { RemoteReducers, RemoteTables, } from '.'; +declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** * Table handle for the table `player`. 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 e0b2c22d31..e203c44fb0 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; import { Point } from './point_type'; +// Mark import as potentially unused +declare type __keep_Point = Point; export type Player = { ownerId: string; 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 65b74418e3..648a10181c 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, 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 fd191daa43..0c7e885aa7 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -28,6 +28,8 @@ import { } from '@clockworklabs/spacetimedb-sdk'; import { UnindexedPlayer } from './unindexed_player_type'; import { Point } from './point_type'; +// Mark import as potentially unused +declare type __keep_Point = Point; import { type EventContext, @@ -35,6 +37,7 @@ import { RemoteReducers, RemoteTables, } from '.'; +declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** * Table handle for the table `unindexed_player`. 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 c4d2bb00c2..eefdd79a4c 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -27,6 +27,8 @@ import { type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, } from '@clockworklabs/spacetimedb-sdk'; import { Point } from './point_type'; +// Mark import as potentially unused +declare type __keep_Point = Point; export type UnindexedPlayer = { ownerId: string; 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 567c19cc13..efc16e926a 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, @@ -33,6 +33,7 @@ import { RemoteReducers, RemoteTables, } from '.'; +declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** * Table handle for the table `user`. 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 ceb72e9d1a..96ce32b5dc 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 @@ -3,11 +3,11 @@ /* eslint-disable */ /* tslint:disable */ -// @ts-nocheck import { AlgebraicType as __AlgebraicTypeValue, BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, + ClientCache as __ClientCache, ConnectionId as __ConnectionId, DbConnectionBuilder as __DbConnectionBuilder, DbConnectionImpl as __DbConnectionImpl, From ad1bd5821d82569a0d94e2f702c478963c6f88e5 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Fri, 5 Sep 2025 11:56:59 -0700 Subject: [PATCH 28/28] `tools/upgrade-version` works properly on Windows (#3232) # Description of Changes Fixed how the multi-line regexps worked on Windows (with `\r\n` line endings). # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing - [x] `cargo run -- 1.4.1` works properly on Linux still - [x] Applying the same diff and running on Windows, now updates the license files properly. Co-authored-by: Zeke Foppa --- tools/upgrade-version/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/upgrade-version/src/main.rs b/tools/upgrade-version/src/main.rs index 332edaa4a1..a15e5d8b92 100644 --- a/tools/upgrade-version/src/main.rs +++ b/tools/upgrade-version/src/main.rs @@ -12,10 +12,10 @@ use std::path::PathBuf; fn process_license_file(path: &str, version: &str) { let file = fs::read_to_string(path).unwrap(); - let version_re = Regex::new(r"(?m)^(Licensed Work:\s+SpacetimeDB )([\d\.]+)$").unwrap(); + let version_re = Regex::new(r"(?m)^(Licensed Work:\s+SpacetimeDB )([\d\.]+)\r?$").unwrap(); let file = version_re.replace_all(&file, |caps: ®ex::Captures| format!("{}{}", &caps[1], version)); - let date_re = Regex::new(r"(?m)^Change Date:\s+\d{4}-\d{2}-\d{2}$").unwrap(); + let date_re = Regex::new(r"(?m)^Change Date:\s+\d{4}-\d{2}-\d{2}\r?$").unwrap(); let new_date = Local::now() .with_year(Local::now().year() + 5) .unwrap()