// 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'; // The tagged union or sum type for the algebraic type `AlgebraicType`. export const AlgebraicType: __TypeBuilder< __AlgebraicTypeType, __AlgebraicTypeType > = __t.enum('AlgebraicType', { Ref: __t.u32(), get Sum() { return SumType; }, get Product() { return ProductType; }, get Array() { return AlgebraicType; }, String: __t.unit(), Bool: __t.unit(), I8: __t.unit(), U8: __t.unit(), I16: __t.unit(), U16: __t.unit(), I32: __t.unit(), U32: __t.unit(), I64: __t.unit(), U64: __t.unit(), I128: __t.unit(), U128: __t.unit(), I256: __t.unit(), U256: __t.unit(), F32: __t.unit(), F64: __t.unit(), }); export type AlgebraicType = __Infer; // The tagged union or sum type for the algebraic type `CaseConversionPolicy`. export const CaseConversionPolicy = __t.enum('CaseConversionPolicy', { None: __t.unit(), SnakeCase: __t.unit(), }); export type CaseConversionPolicy = __Infer; // The tagged union or sum type for the algebraic type `ExplicitNameEntry`. export const ExplicitNameEntry = __t.enum('ExplicitNameEntry', { get Table() { return NameMapping; }, get Function() { return NameMapping; }, get Index() { return NameMapping; }, get Namespace() { return NameMapping; }, }); export type ExplicitNameEntry = __Infer; export const ExplicitNames = __t.object('ExplicitNames', { get entries() { return __t.array(ExplicitNameEntry); }, }); export type ExplicitNames = __Infer; // The tagged union or sum type for the algebraic type `FunctionVisibility`. export const FunctionVisibility = __t.enum('FunctionVisibility', { Private: __t.unit(), ClientCallable: __t.unit(), }); export type FunctionVisibility = __Infer; export const HttpHeaderPair = __t.object('HttpHeaderPair', { name: __t.string(), value: __t.byteArray(), }); export type HttpHeaderPair = __Infer; export const HttpHeaders = __t.object('HttpHeaders', { get entries() { return __t.array(HttpHeaderPair); }, }); export type HttpHeaders = __Infer; // The tagged union or sum type for the algebraic type `HttpMethod`. export const HttpMethod = __t.enum('HttpMethod', { Get: __t.unit(), Head: __t.unit(), Post: __t.unit(), Put: __t.unit(), Delete: __t.unit(), Connect: __t.unit(), Options: __t.unit(), Trace: __t.unit(), Patch: __t.unit(), Extension: __t.string(), }); export type HttpMethod = __Infer; export const HttpRequest = __t.object('HttpRequest', { get method() { return HttpMethod; }, get headers() { return HttpHeaders; }, timeout: __t.option(__t.timeDuration()), uri: __t.string(), get version() { return HttpVersion; }, }); export type HttpRequest = __Infer; export const HttpResponse = __t.object('HttpResponse', { get headers() { return HttpHeaders; }, get version() { return HttpVersion; }, code: __t.u16(), }); export type HttpResponse = __Infer; // The tagged union or sum type for the algebraic type `HttpVersion`. export const HttpVersion = __t.enum('HttpVersion', { Http09: __t.unit(), Http10: __t.unit(), Http11: __t.unit(), Http2: __t.unit(), Http3: __t.unit(), }); export type HttpVersion = __Infer; // The tagged union or sum type for the algebraic type `IndexType`. export const IndexType = __t.enum('IndexType', { BTree: __t.unit(), Hash: __t.unit(), }); export type IndexType = __Infer; // The tagged union or sum type for the algebraic type `Lifecycle`. export const Lifecycle = __t.enum('Lifecycle', { Init: __t.unit(), OnConnect: __t.unit(), OnDisconnect: __t.unit(), }); export type Lifecycle = __Infer; // The tagged union or sum type for the algebraic type `MethodOrAny`. export const MethodOrAny = __t.enum('MethodOrAny', { Any: __t.unit(), get Method() { return HttpMethod; }, }); export type MethodOrAny = __Infer; // The tagged union or sum type for the algebraic type `MiscModuleExport`. export const MiscModuleExport = __t.enum('MiscModuleExport', { get TypeAlias() { return TypeAlias; }, }); export type MiscModuleExport = __Infer; export const NameMapping = __t.object('NameMapping', { sourceName: __t.string(), canonicalName: __t.string(), }); export type NameMapping = __Infer; export const ProductType = __t.object('ProductType', { get elements() { return __t.array(ProductTypeElement); }, }); export type ProductType = __Infer; export const ProductTypeElement = __t.object('ProductTypeElement', { name: __t.option(__t.string()), get algebraicType() { return AlgebraicType; }, }); export type ProductTypeElement = __Infer; export const RawColumnDefV8 = __t.object('RawColumnDefV8', { colName: __t.string(), get colType() { return AlgebraicType; }, }); export type RawColumnDefV8 = __Infer; export const RawColumnDefaultValueV10 = __t.object('RawColumnDefaultValueV10', { colId: __t.u16(), value: __t.byteArray(), }); export type RawColumnDefaultValueV10 = __Infer; export const RawColumnDefaultValueV9 = __t.object('RawColumnDefaultValueV9', { table: __t.string(), colId: __t.u16(), value: __t.byteArray(), }); export type RawColumnDefaultValueV9 = __Infer; // The tagged union or sum type for the algebraic type `RawConstraintDataV9`. export const RawConstraintDataV9 = __t.enum('RawConstraintDataV9', { get Unique() { return RawUniqueConstraintDataV9; }, }); export type RawConstraintDataV9 = __Infer; export const RawConstraintDefV10 = __t.object('RawConstraintDefV10', { sourceName: __t.option(__t.string()), get data() { return RawConstraintDataV9; }, }); export type RawConstraintDefV10 = __Infer; export const RawConstraintDefV8 = __t.object('RawConstraintDefV8', { constraintName: __t.string(), constraints: __t.u8(), columns: __t.array(__t.u16()), }); export type RawConstraintDefV8 = __Infer; export const RawConstraintDefV9 = __t.object('RawConstraintDefV9', { name: __t.option(__t.string()), get data() { return RawConstraintDataV9; }, }); export type RawConstraintDefV9 = __Infer; // The tagged union or sum type for the algebraic type `RawEnvVarTypeV10`. export const RawEnvVarTypeV10 = __t.enum('RawEnvVarTypeV10', { String: __t.unit(), StringLiteral: __t.string(), Union: __t.array(__t.string()), }); export type RawEnvVarTypeV10 = __Infer; export const RawEnvironmentDeclarationV10 = __t.object( 'RawEnvironmentDeclarationV10', { name: __t.string(), get ty() { return RawEnvVarTypeV10; }, optional: __t.bool(), } ); export type RawEnvironmentDeclarationV10 = __Infer< typeof RawEnvironmentDeclarationV10 >; export const RawHttpHandlerDefV10 = __t.object('RawHttpHandlerDefV10', { sourceName: __t.string(), }); export type RawHttpHandlerDefV10 = __Infer; export const RawHttpRouteDefV10 = __t.object('RawHttpRouteDefV10', { handlerFunction: __t.string(), get method() { return MethodOrAny; }, path: __t.string(), }); export type RawHttpRouteDefV10 = __Infer; // The tagged union or sum type for the algebraic type `RawIndexAlgorithm`. export const RawIndexAlgorithm = __t.enum('RawIndexAlgorithm', { BTree: __t.array(__t.u16()), Hash: __t.array(__t.u16()), Direct: __t.u16(), }); export type RawIndexAlgorithm = __Infer; export const RawIndexDefV10 = __t.object('RawIndexDefV10', { sourceName: __t.option(__t.string()), accessorName: __t.option(__t.string()), get algorithm() { return RawIndexAlgorithm; }, }); export type RawIndexDefV10 = __Infer; export const RawIndexDefV8 = __t.object('RawIndexDefV8', { indexName: __t.string(), isUnique: __t.bool(), get indexType() { return IndexType; }, columns: __t.array(__t.u16()), }); export type RawIndexDefV8 = __Infer; export const RawIndexDefV9 = __t.object('RawIndexDefV9', { name: __t.option(__t.string()), accessorName: __t.option(__t.string()), get algorithm() { return RawIndexAlgorithm; }, }); export type RawIndexDefV9 = __Infer; export const RawLifeCycleReducerDefV10 = __t.object( 'RawLifeCycleReducerDefV10', { get lifecycleSpec() { return Lifecycle; }, functionName: __t.string(), } ); export type RawLifeCycleReducerDefV10 = __Infer< typeof RawLifeCycleReducerDefV10 >; // The tagged union or sum type for the algebraic type `RawMiscModuleExportV9`. export const RawMiscModuleExportV9 = __t.enum('RawMiscModuleExportV9', { get ColumnDefaultValue() { return RawColumnDefaultValueV9; }, get Procedure() { return RawProcedureDefV9; }, get View() { return RawViewDefV9; }, }); export type RawMiscModuleExportV9 = __Infer; // The tagged union or sum type for the algebraic type `RawModuleDef`. export const RawModuleDef = __t.enum('RawModuleDef', { get V8BackCompat() { return RawModuleDefV8; }, get V9() { return RawModuleDefV9; }, get V10() { return RawModuleDefV10; }, }); export type RawModuleDef = __Infer; export const RawModuleDefV10 = __t.object('RawModuleDefV10', { get sections() { return __t.array(RawModuleDefV10Section); }, }); export type RawModuleDefV10 = __Infer; // The tagged union or sum type for the algebraic type `RawModuleDefV10Section`. export const RawModuleDefV10Section = __t.enum('RawModuleDefV10Section', { get Typespace() { return Typespace; }, get Types() { return __t.array(RawTypeDefV10); }, get Tables() { return __t.array(RawTableDefV10); }, get Reducers() { return __t.array(RawReducerDefV10); }, get Procedures() { return __t.array(RawProcedureDefV10); }, get Views() { return __t.array(RawViewDefV10); }, get Schedules() { return __t.array(RawScheduleDefV10); }, get LifeCycleReducers() { return __t.array(RawLifeCycleReducerDefV10); }, get RowLevelSecurity() { return __t.array(RawRowLevelSecurityDefV9); }, get CaseConversionPolicy() { return CaseConversionPolicy; }, get ExplicitNames() { return ExplicitNames; }, get HttpHandlers() { return __t.array(RawHttpHandlerDefV10); }, get HttpRoutes() { return __t.array(RawHttpRouteDefV10); }, get ViewPrimaryKeys() { return __t.array(RawViewPrimaryKeyDefV10); }, get Submodules() { return __t.array(RawSubmoduleV10); }, get Environment() { return __t.array(RawEnvironmentDeclarationV10); }, get Outboxes() { return __t.array(RawOutboxDefV10); }, get TableCachePolicies() { return __t.array(RawTableCachePolicyV10); }, }); export type RawModuleDefV10Section = __Infer; export const RawModuleDefV8 = __t.object('RawModuleDefV8', { get typespace() { return Typespace; }, get tables() { return __t.array(TableDesc); }, get reducers() { return __t.array(ReducerDef); }, get miscExports() { return __t.array(MiscModuleExport); }, }); export type RawModuleDefV8 = __Infer; export const RawModuleDefV9 = __t.object('RawModuleDefV9', { get typespace() { return Typespace; }, get tables() { return __t.array(RawTableDefV9); }, get reducers() { return __t.array(RawReducerDefV9); }, get types() { return __t.array(RawTypeDefV9); }, get miscExports() { return __t.array(RawMiscModuleExportV9); }, get rowLevelSecurity() { return __t.array(RawRowLevelSecurityDefV9); }, }); export type RawModuleDefV9 = __Infer; export const RawOutboxDefV10 = __t.object('RawOutboxDefV10', { tableName: __t.string(), remoteReducer: __t.string(), targetColumn: __t.u16(), argColumns: __t.array(__t.u16()), onResultReducer: __t.option(__t.string()), signatureHash: __t.u256(), }); export type RawOutboxDefV10 = __Infer; export const RawProcedureDefV10 = __t.object('RawProcedureDefV10', { sourceName: __t.string(), get params() { return ProductType; }, get returnType() { return AlgebraicType; }, get visibility() { return FunctionVisibility; }, }); export type RawProcedureDefV10 = __Infer; export const RawProcedureDefV9 = __t.object('RawProcedureDefV9', { name: __t.string(), get params() { return ProductType; }, get returnType() { return AlgebraicType; }, }); export type RawProcedureDefV9 = __Infer; export const RawReducerDefV10 = __t.object('RawReducerDefV10', { sourceName: __t.string(), get params() { return ProductType; }, get visibility() { return FunctionVisibility; }, get okReturnType() { return AlgebraicType; }, get errReturnType() { return AlgebraicType; }, }); export type RawReducerDefV10 = __Infer; export const RawReducerDefV9 = __t.object('RawReducerDefV9', { name: __t.string(), get params() { return ProductType; }, get lifecycle() { return __t.option(Lifecycle); }, }); export type RawReducerDefV9 = __Infer; export const RawRowLevelSecurityDefV9 = __t.object('RawRowLevelSecurityDefV9', { sql: __t.string(), }); export type RawRowLevelSecurityDefV9 = __Infer; export const RawScheduleDefV10 = __t.object('RawScheduleDefV10', { sourceName: __t.option(__t.string()), tableName: __t.string(), scheduleAtCol: __t.u16(), functionName: __t.string(), }); export type RawScheduleDefV10 = __Infer; export const RawScheduleDefV9 = __t.object('RawScheduleDefV9', { name: __t.option(__t.string()), reducerName: __t.string(), scheduledAtColumn: __t.u16(), }); export type RawScheduleDefV9 = __Infer; export const RawScopedTypeNameV10 = __t.object('RawScopedTypeNameV10', { scope: __t.array(__t.string()), sourceName: __t.string(), }); export type RawScopedTypeNameV10 = __Infer; export const RawScopedTypeNameV9 = __t.object('RawScopedTypeNameV9', { scope: __t.array(__t.string()), name: __t.string(), }); export type RawScopedTypeNameV9 = __Infer; export const RawSequenceDefV10 = __t.object('RawSequenceDefV10', { sourceName: __t.option(__t.string()), column: __t.u16(), start: __t.option(__t.i128()), minValue: __t.option(__t.i128()), maxValue: __t.option(__t.i128()), increment: __t.i128(), }); export type RawSequenceDefV10 = __Infer; export const RawSequenceDefV8 = __t.object('RawSequenceDefV8', { sequenceName: __t.string(), colPos: __t.u16(), increment: __t.i128(), start: __t.option(__t.i128()), minValue: __t.option(__t.i128()), maxValue: __t.option(__t.i128()), allocated: __t.i128(), }); export type RawSequenceDefV8 = __Infer; export const RawSequenceDefV9 = __t.object('RawSequenceDefV9', { name: __t.option(__t.string()), column: __t.u16(), start: __t.option(__t.i128()), minValue: __t.option(__t.i128()), maxValue: __t.option(__t.i128()), increment: __t.i128(), }); export type RawSequenceDefV9 = __Infer; export const RawSubmoduleV10 = __t.object('RawSubmoduleV10', { namespace: __t.string(), get module(): any { return RawModuleDefV10; }, }); export type RawSubmoduleV10 = __Infer; export const RawTableCachePolicyV10 = __t.object('RawTableCachePolicyV10', { tableName: __t.string(), get policy() { return TableCachePolicy; }, }); export type RawTableCachePolicyV10 = __Infer; export const RawTableDefV10 = __t.object('RawTableDefV10', { sourceName: __t.string(), productTypeRef: __t.u32(), primaryKey: __t.array(__t.u16()), get indexes() { return __t.array(RawIndexDefV10); }, get constraints() { return __t.array(RawConstraintDefV10); }, get sequences() { return __t.array(RawSequenceDefV10); }, get tableType() { return TableType; }, get tableAccess() { return TableAccess; }, get defaultValues() { return __t.array(RawColumnDefaultValueV10); }, isEvent: __t.bool(), }); export type RawTableDefV10 = __Infer; export const RawTableDefV8 = __t.object('RawTableDefV8', { tableName: __t.string(), get columns() { return __t.array(RawColumnDefV8); }, get indexes() { return __t.array(RawIndexDefV8); }, get constraints() { return __t.array(RawConstraintDefV8); }, get sequences() { return __t.array(RawSequenceDefV8); }, tableType: __t.string(), tableAccess: __t.string(), scheduled: __t.option(__t.string()), }); export type RawTableDefV8 = __Infer; export const RawTableDefV9 = __t.object('RawTableDefV9', { name: __t.string(), productTypeRef: __t.u32(), primaryKey: __t.array(__t.u16()), get indexes() { return __t.array(RawIndexDefV9); }, get constraints() { return __t.array(RawConstraintDefV9); }, get sequences() { return __t.array(RawSequenceDefV9); }, get schedule() { return __t.option(RawScheduleDefV9); }, get tableType() { return TableType; }, get tableAccess() { return TableAccess; }, }); export type RawTableDefV9 = __Infer; export const RawTypeDefV10 = __t.object('RawTypeDefV10', { get sourceName() { return RawScopedTypeNameV10; }, ty: __t.u32(), customOrdering: __t.bool(), }); export type RawTypeDefV10 = __Infer; export const RawTypeDefV9 = __t.object('RawTypeDefV9', { get name() { return RawScopedTypeNameV9; }, ty: __t.u32(), customOrdering: __t.bool(), }); export type RawTypeDefV9 = __Infer; export const RawUniqueConstraintDataV9 = __t.object( 'RawUniqueConstraintDataV9', { columns: __t.array(__t.u16()), } ); export type RawUniqueConstraintDataV9 = __Infer< typeof RawUniqueConstraintDataV9 >; export const RawViewDefV10 = __t.object('RawViewDefV10', { sourceName: __t.string(), index: __t.u32(), isPublic: __t.bool(), isAnonymous: __t.bool(), get params() { return ProductType; }, get returnType() { return AlgebraicType; }, }); export type RawViewDefV10 = __Infer; export const RawViewDefV9 = __t.object('RawViewDefV9', { name: __t.string(), index: __t.u32(), isPublic: __t.bool(), isAnonymous: __t.bool(), get params() { return ProductType; }, get returnType() { return AlgebraicType; }, }); export type RawViewDefV9 = __Infer; export const RawViewPrimaryKeyDefV10 = __t.object('RawViewPrimaryKeyDefV10', { viewSourceName: __t.string(), columns: __t.array(__t.string()), }); export type RawViewPrimaryKeyDefV10 = __Infer; export const ReducerDef = __t.object('ReducerDef', { name: __t.string(), get args() { return __t.array(ProductTypeElement); }, }); export type ReducerDef = __Infer; export const SumType = __t.object('SumType', { get variants() { return __t.array(SumTypeVariant); }, }); export type SumType = __Infer; export const SumTypeVariant = __t.object('SumTypeVariant', { name: __t.option(__t.string()), get algebraicType() { return AlgebraicType; }, }); export type SumTypeVariant = __Infer; // The tagged union or sum type for the algebraic type `TableAccess`. export const TableAccess = __t.enum('TableAccess', { Public: __t.unit(), Private: __t.unit(), }); export type TableAccess = __Infer; // The tagged union or sum type for the algebraic type `TableCachePolicy`. export const TableCachePolicy = __t.enum('TableCachePolicy', { RequiredInMemory: __t.unit(), RequiredOnDisk: __t.unit(), NoRequirement: __t.unit(), }); export type TableCachePolicy = __Infer; export const TableDesc = __t.object('TableDesc', { get schema() { return RawTableDefV8; }, data: __t.u32(), }); export type TableDesc = __Infer; // The tagged union or sum type for the algebraic type `TableType`. export const TableType = __t.enum('TableType', { System: __t.unit(), User: __t.unit(), }); export type TableType = __Infer; export const TypeAlias = __t.object('TypeAlias', { name: __t.string(), ty: __t.u32(), }); export type TypeAlias = __Infer; export const Typespace = __t.object('Typespace', { get types() { return __t.array(AlgebraicType); }, }); export type Typespace = __Infer; // The tagged union or sum type for the algebraic type `ViewResultHeader`. export const ViewResultHeader = __t.enum('ViewResultHeader', { RowData: __t.unit(), RawSql: __t.string(), }); export type ViewResultHeader = __Infer;