// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. /* eslint-disable */ /* tslint:disable */ import { TypeBuilder as __TypeBuilder, t as __t, type AlgebraicTypeType as __AlgebraicTypeType, type Infer as __Infer, } from '../../lib/type_builders.ts'; export const BsatnRowList = __t.object('BsatnRowList', { get sizeHint() { return RowSizeHint; }, rowsData: __t.byteArray(), }); export type BsatnRowList = __Infer; export const CallProcedure = __t.object('CallProcedure', { requestId: __t.u32(), flags: __t.u8(), procedure: __t.string(), args: __t.byteArray(), }); export type CallProcedure = __Infer; export const CallReducer = __t.object('CallReducer', { requestId: __t.u32(), flags: __t.u8(), reducer: __t.string(), args: __t.byteArray(), }); export type CallReducer = __Infer; // The tagged union or sum type for the algebraic type `ClientMessage`. export const ClientMessage = __t.enum('ClientMessage', { get Subscribe() { return Subscribe; }, get Unsubscribe() { return Unsubscribe; }, get OneOffQuery() { return OneOffQuery; }, get CallReducer() { return CallReducer; }, get CallProcedure() { return CallProcedure; }, get SubscribeBatch() { return SubscribeBatch; }, }); export type ClientMessage = __Infer; export const EventTableRows = __t.object('EventTableRows', { get events() { return BsatnRowList; }, }); export type EventTableRows = __Infer; export const InitialConnection = __t.object('InitialConnection', { identity: __t.identity(), connectionId: __t.connectionId(), token: __t.string(), }); export type InitialConnection = __Infer; export const OneOffQuery = __t.object('OneOffQuery', { requestId: __t.u32(), queryString: __t.string(), }); export type OneOffQuery = __Infer; export const OneOffQueryResult = __t.object('OneOffQueryResult', { requestId: __t.u32(), get result() { return __t.result(QueryRows, __t.string()); }, }); export type OneOffQueryResult = __Infer; export const PersistentTableRows = __t.object('PersistentTableRows', { get inserts() { return BsatnRowList; }, get deletes() { return BsatnRowList; }, }); export type PersistentTableRows = __Infer; export const ProcedureResult = __t.object('ProcedureResult', { get status() { return ProcedureStatus; }, timestamp: __t.timestamp(), totalHostExecutionDuration: __t.timeDuration(), requestId: __t.u32(), }); export type ProcedureResult = __Infer; // The tagged union or sum type for the algebraic type `ProcedureStatus`. export const ProcedureStatus = __t.enum('ProcedureStatus', { Returned: __t.byteArray(), InternalError: __t.string(), }); export type ProcedureStatus = __Infer; export const QueryRows = __t.object('QueryRows', { get tables() { return __t.array(SingleTableRows); }, }); export type QueryRows = __Infer; export const QuerySetId = __t.object('QuerySetId', { id: __t.u32(), }); export type QuerySetId = __Infer; export const QuerySetUpdate = __t.object('QuerySetUpdate', { get querySetId() { return QuerySetId; }, get tables() { return __t.array(TableUpdate); }, }); export type QuerySetUpdate = __Infer; export const ReducerOk = __t.object('ReducerOk', { retValue: __t.byteArray(), get transactionUpdate() { return TransactionUpdate; }, }); export type ReducerOk = __Infer; // The tagged union or sum type for the algebraic type `ReducerOutcome`. export const ReducerOutcome = __t.enum('ReducerOutcome', { get Ok() { return ReducerOk; }, OkEmpty: __t.unit(), Err: __t.byteArray(), InternalError: __t.string(), }); export type ReducerOutcome = __Infer; export const ReducerResult = __t.object('ReducerResult', { requestId: __t.u32(), timestamp: __t.timestamp(), get result() { return ReducerOutcome; }, }); export type ReducerResult = __Infer; // The tagged union or sum type for the algebraic type `RowSizeHint`. export const RowSizeHint = __t.enum('RowSizeHint', { FixedSize: __t.u16(), RowOffsets: __t.array(__t.u64()), }); export type RowSizeHint = __Infer; // The tagged union or sum type for the algebraic type `ServerMessage`. export const ServerMessage = __t.enum('ServerMessage', { get InitialConnection() { return InitialConnection; }, get SubscribeApplied() { return SubscribeApplied; }, get UnsubscribeApplied() { return UnsubscribeApplied; }, get SubscriptionError() { return SubscriptionError; }, get TransactionUpdate() { return TransactionUpdate; }, get OneOffQueryResult() { return OneOffQueryResult; }, get ReducerResult() { return ReducerResult; }, get ProcedureResult() { return ProcedureResult; }, get SubscribeBatchApplied() { return SubscribeBatchApplied; }, }); export type ServerMessage = __Infer; export const SingleTableRows = __t.object('SingleTableRows', { table: __t.string(), get rows() { return BsatnRowList; }, }); export type SingleTableRows = __Infer; export const Subscribe = __t.object('Subscribe', { requestId: __t.u32(), get querySetId() { return QuerySetId; }, queryStrings: __t.array(__t.string()), }); export type Subscribe = __Infer; export const SubscribeApplied = __t.object('SubscribeApplied', { requestId: __t.u32(), get querySetId() { return QuerySetId; }, get rows() { return QueryRows; }, }); export type SubscribeApplied = __Infer; export const SubscribeBatch = __t.object('SubscribeBatch', { requestId: __t.u32(), get sets() { return __t.array(SubscribeSet); }, }); export type SubscribeBatch = __Infer; export const SubscribeBatchApplied = __t.object('SubscribeBatchApplied', { requestId: __t.u32(), get results() { return __t.array(SubscribeSetResult); }, }); export type SubscribeBatchApplied = __Infer; export const SubscribeSet = __t.object('SubscribeSet', { get querySetId() { return QuerySetId; }, queryStrings: __t.array(__t.string()), }); export type SubscribeSet = __Infer; // The tagged union or sum type for the algebraic type `SubscribeSetOutcome`. export const SubscribeSetOutcome = __t.enum('SubscribeSetOutcome', { get Applied() { return QueryRows; }, Error: __t.string(), }); export type SubscribeSetOutcome = __Infer; export const SubscribeSetResult = __t.object('SubscribeSetResult', { get querySetId() { return QuerySetId; }, get outcome() { return SubscribeSetOutcome; }, }); export type SubscribeSetResult = __Infer; export const SubscriptionError = __t.object('SubscriptionError', { requestId: __t.option(__t.u32()), get querySetId() { return QuerySetId; }, error: __t.string(), }); export type SubscriptionError = __Infer; export const TableUpdate = __t.object('TableUpdate', { tableName: __t.string(), get rows() { return __t.array(TableUpdateRows); }, }); export type TableUpdate = __Infer; // The tagged union or sum type for the algebraic type `TableUpdateRows`. export const TableUpdateRows = __t.enum('TableUpdateRows', { get PersistentTable() { return PersistentTableRows; }, get EventTable() { return EventTableRows; }, }); export type TableUpdateRows = __Infer; export const TransactionUpdate = __t.object('TransactionUpdate', { get querySets() { return __t.array(QuerySetUpdate); }, }); export type TransactionUpdate = __Infer; export const Unsubscribe = __t.object('Unsubscribe', { requestId: __t.u32(), get querySetId() { return QuerySetId; }, get flags() { return UnsubscribeFlags; }, }); export type Unsubscribe = __Infer; export const UnsubscribeApplied = __t.object('UnsubscribeApplied', { requestId: __t.u32(), get querySetId() { return QuerySetId; }, get rows() { return __t.option(QueryRows); }, }); export type UnsubscribeApplied = __Infer; // The tagged union or sum type for the algebraic type `UnsubscribeFlags`. export const UnsubscribeFlags = __t.enum('UnsubscribeFlags', { Default: __t.unit(), SendDroppedRows: __t.unit(), }); export type UnsubscribeFlags = __Infer;