@radishbot/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,175 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
2
+ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
3
+
4
+ // This was generated using spacetimedb cli version 2.0.3 (commit 5836c268a7307f864b33636357b0869ecc40bc0a).
5
+
6
+ /* eslint-disable */
7
+ /* tslint:disable */
8
+ import {
9
+ DbConnectionBuilder as __DbConnectionBuilder,
10
+ DbConnectionImpl as __DbConnectionImpl,
11
+ SubscriptionBuilderImpl as __SubscriptionBuilderImpl,
12
+ TypeBuilder as __TypeBuilder,
13
+ Uuid as __Uuid,
14
+ convertToAccessorMap as __convertToAccessorMap,
15
+ makeQueryBuilder as __makeQueryBuilder,
16
+ procedureSchema as __procedureSchema,
17
+ procedures as __procedures,
18
+ reducerSchema as __reducerSchema,
19
+ reducers as __reducers,
20
+ schema as __schema,
21
+ t as __t,
22
+ table as __table,
23
+ type AlgebraicTypeType as __AlgebraicTypeType,
24
+ type DbConnectionConfig as __DbConnectionConfig,
25
+ type ErrorContextInterface as __ErrorContextInterface,
26
+ type Event as __Event,
27
+ type EventContextInterface as __EventContextInterface,
28
+ type Infer as __Infer,
29
+ type QueryBuilder as __QueryBuilder,
30
+ type ReducerEventContextInterface as __ReducerEventContextInterface,
31
+ type RemoteModule as __RemoteModule,
32
+ type SubscriptionEventContextInterface as __SubscriptionEventContextInterface,
33
+ type SubscriptionHandleImpl as __SubscriptionHandleImpl,
34
+ } from "spacetimedb";
35
+
36
+ // Import all reducer arg schemas
37
+ import AddLogReducer from "./add_log_reducer";
38
+ import AddLogsBatchReducer from "./add_logs_batch_reducer";
39
+ import CheckTimeoutsReducer from "./check_timeouts_reducer";
40
+ import CreateRootFlowReducer from "./create_root_flow_reducer";
41
+ import CreateSubFlowReducer from "./create_sub_flow_reducer";
42
+ import FinishActionReducer from "./finish_action_reducer";
43
+ import FinishFlowReducer from "./finish_flow_reducer";
44
+ import RegisterKeyReducer from "./register_key_reducer";
45
+ import StartActionReducer from "./start_action_reducer";
46
+
47
+ // Import all procedure arg schemas
48
+
49
+ // Import all table schema definitions
50
+ import ActionRow from "./action_table";
51
+ import ApiKeyRow from "./api_key_table";
52
+ import FlowRow from "./flow_table";
53
+ import LogEntryRow from "./log_entry_table";
54
+
55
+ /** Type-only namespace exports for generated type groups. */
56
+
57
+ /** The schema information for all tables in this module. This is defined the same was as the tables would have been defined in the server. */
58
+ const tablesSchema = __schema({
59
+ action: __table({
60
+ name: 'action',
61
+ indexes: [
62
+ { name: 'id', algorithm: 'btree', columns: [
63
+ 'id',
64
+ ] },
65
+ ],
66
+ constraints: [
67
+ { name: 'action_id_key', constraint: 'unique', columns: ['id'] },
68
+ ],
69
+ }, ActionRow),
70
+ apiKey: __table({
71
+ name: 'api_key',
72
+ indexes: [
73
+ { name: 'keyHash', algorithm: 'btree', columns: [
74
+ 'keyHash',
75
+ ] },
76
+ ],
77
+ constraints: [
78
+ { name: 'api_key_key_hash_key', constraint: 'unique', columns: ['keyHash'] },
79
+ ],
80
+ }, ApiKeyRow),
81
+ flow: __table({
82
+ name: 'flow',
83
+ indexes: [
84
+ { name: 'exportToken', algorithm: 'btree', columns: [
85
+ 'exportToken',
86
+ ] },
87
+ { name: 'id', algorithm: 'btree', columns: [
88
+ 'id',
89
+ ] },
90
+ ],
91
+ constraints: [
92
+ { name: 'flow_export_token_key', constraint: 'unique', columns: ['exportToken'] },
93
+ { name: 'flow_id_key', constraint: 'unique', columns: ['id'] },
94
+ ],
95
+ }, FlowRow),
96
+ logEntry: __table({
97
+ name: 'log_entry',
98
+ indexes: [
99
+ { name: 'id', algorithm: 'btree', columns: [
100
+ 'id',
101
+ ] },
102
+ ],
103
+ constraints: [
104
+ { name: 'log_entry_id_key', constraint: 'unique', columns: ['id'] },
105
+ ],
106
+ }, LogEntryRow),
107
+ });
108
+
109
+ /** The schema information for all reducers in this module. This is defined the same way as the reducers would have been defined in the server, except the body of the reducer is omitted in code generation. */
110
+ const reducersSchema = __reducers(
111
+ __reducerSchema("add_log", AddLogReducer),
112
+ __reducerSchema("add_logs_batch", AddLogsBatchReducer),
113
+ __reducerSchema("check_timeouts", CheckTimeoutsReducer),
114
+ __reducerSchema("create_root_flow", CreateRootFlowReducer),
115
+ __reducerSchema("create_sub_flow", CreateSubFlowReducer),
116
+ __reducerSchema("finish_action", FinishActionReducer),
117
+ __reducerSchema("finish_flow", FinishFlowReducer),
118
+ __reducerSchema("register_key", RegisterKeyReducer),
119
+ __reducerSchema("start_action", StartActionReducer),
120
+ );
121
+
122
+ /** The schema information for all procedures in this module. This is defined the same way as the procedures would have been defined in the server. */
123
+ const proceduresSchema = __procedures(
124
+ );
125
+
126
+ /** The remote SpacetimeDB module schema, both runtime and type information. */
127
+ const REMOTE_MODULE = {
128
+ versionInfo: {
129
+ cliVersion: "2.0.3" as const,
130
+ },
131
+ tables: tablesSchema.schemaType.tables,
132
+ reducers: reducersSchema.reducersType.reducers,
133
+ ...proceduresSchema,
134
+ } satisfies __RemoteModule<
135
+ typeof tablesSchema.schemaType,
136
+ typeof reducersSchema.reducersType,
137
+ typeof proceduresSchema
138
+ >;
139
+
140
+ /** The tables available in this remote SpacetimeDB module. Each table reference doubles as a query builder. */
141
+ export const tables: __QueryBuilder<typeof tablesSchema.schemaType> = __makeQueryBuilder(tablesSchema.schemaType);
142
+
143
+ /** The reducers available in this remote SpacetimeDB module. */
144
+ export const reducers = __convertToAccessorMap(reducersSchema.reducersType.reducers);
145
+
146
+ /** The context type returned in callbacks for all possible events. */
147
+ export type EventContext = __EventContextInterface<typeof REMOTE_MODULE>;
148
+ /** The context type returned in callbacks for reducer events. */
149
+ export type ReducerEventContext = __ReducerEventContextInterface<typeof REMOTE_MODULE>;
150
+ /** The context type returned in callbacks for subscription events. */
151
+ export type SubscriptionEventContext = __SubscriptionEventContextInterface<typeof REMOTE_MODULE>;
152
+ /** The context type returned in callbacks for error events. */
153
+ export type ErrorContext = __ErrorContextInterface<typeof REMOTE_MODULE>;
154
+ /** The subscription handle type to manage active subscriptions created from a {@link SubscriptionBuilder}. */
155
+ export type SubscriptionHandle = __SubscriptionHandleImpl<typeof REMOTE_MODULE>;
156
+
157
+ /** Builder class to configure a new subscription to the remote SpacetimeDB instance. */
158
+ export class SubscriptionBuilder extends __SubscriptionBuilderImpl<typeof REMOTE_MODULE> {}
159
+
160
+ /** Builder class to configure a new database connection to the remote SpacetimeDB instance. */
161
+ export class DbConnectionBuilder extends __DbConnectionBuilder<DbConnection> {}
162
+
163
+ /** The typed database connection to manage connections to the remote SpacetimeDB instance. This class has type information specific to the generated module. */
164
+ export class DbConnection extends __DbConnectionImpl<typeof REMOTE_MODULE> {
165
+ /** Creates a new {@link DbConnectionBuilder} to configure and connect to the remote SpacetimeDB instance. */
166
+ static builder = (): DbConnectionBuilder => {
167
+ return new DbConnectionBuilder(REMOTE_MODULE, (config: __DbConnectionConfig<typeof REMOTE_MODULE>) => new DbConnection(config));
168
+ };
169
+
170
+ /** Creates a new {@link SubscriptionBuilder} to configure a subscription to the remote SpacetimeDB instance. */
171
+ override subscriptionBuilder = (): SubscriptionBuilder => {
172
+ return new SubscriptionBuilder(this);
173
+ };
174
+ }
175
+
@@ -0,0 +1,20 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
2
+ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
3
+
4
+ /* eslint-disable */
5
+ /* tslint:disable */
6
+ import {
7
+ TypeBuilder as __TypeBuilder,
8
+ t as __t,
9
+ type AlgebraicTypeType as __AlgebraicTypeType,
10
+ type Infer as __Infer,
11
+ } from "spacetimedb";
12
+
13
+ export default __t.row({
14
+ id: __t.u64().primaryKey(),
15
+ flowId: __t.u64().name("flow_id"),
16
+ level: __t.string(),
17
+ message: __t.string(),
18
+ data: __t.string(),
19
+ createdAt: __t.timestamp().name("created_at"),
20
+ });
@@ -0,0 +1,16 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
2
+ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
3
+
4
+ /* eslint-disable */
5
+ /* tslint:disable */
6
+ import {
7
+ TypeBuilder as __TypeBuilder,
8
+ t as __t,
9
+ type AlgebraicTypeType as __AlgebraicTypeType,
10
+ type Infer as __Infer,
11
+ } from "spacetimedb";
12
+
13
+ export default {
14
+ keyHash: __t.string(),
15
+ label: __t.string(),
16
+ };
@@ -0,0 +1,17 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
2
+ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
3
+
4
+ /* eslint-disable */
5
+ /* tslint:disable */
6
+ import {
7
+ TypeBuilder as __TypeBuilder,
8
+ t as __t,
9
+ type AlgebraicTypeType as __AlgebraicTypeType,
10
+ type Infer as __Infer,
11
+ } from "spacetimedb";
12
+
13
+ export default {
14
+ keyHash: __t.string(),
15
+ flowId: __t.u64(),
16
+ name: __t.string(),
17
+ };
@@ -0,0 +1,10 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
2
+ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
3
+
4
+ /* eslint-disable */
5
+ /* tslint:disable */
6
+ import { type Infer as __Infer } from "spacetimedb";
7
+
8
+ // Import all procedure arg schemas
9
+
10
+
@@ -0,0 +1,28 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
2
+ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
3
+
4
+ /* eslint-disable */
5
+ /* tslint:disable */
6
+ import { type Infer as __Infer } from "spacetimedb";
7
+
8
+ // Import all reducer arg schemas
9
+ import AddLogReducer from "../add_log_reducer";
10
+ import AddLogsBatchReducer from "../add_logs_batch_reducer";
11
+ import CheckTimeoutsReducer from "../check_timeouts_reducer";
12
+ import CreateRootFlowReducer from "../create_root_flow_reducer";
13
+ import CreateSubFlowReducer from "../create_sub_flow_reducer";
14
+ import FinishActionReducer from "../finish_action_reducer";
15
+ import FinishFlowReducer from "../finish_flow_reducer";
16
+ import RegisterKeyReducer from "../register_key_reducer";
17
+ import StartActionReducer from "../start_action_reducer";
18
+
19
+ export type AddLogParams = __Infer<typeof AddLogReducer>;
20
+ export type AddLogsBatchParams = __Infer<typeof AddLogsBatchReducer>;
21
+ export type CheckTimeoutsParams = __Infer<typeof CheckTimeoutsReducer>;
22
+ export type CreateRootFlowParams = __Infer<typeof CreateRootFlowReducer>;
23
+ export type CreateSubFlowParams = __Infer<typeof CreateSubFlowReducer>;
24
+ export type FinishActionParams = __Infer<typeof FinishActionReducer>;
25
+ export type FinishFlowParams = __Infer<typeof FinishFlowReducer>;
26
+ export type RegisterKeyParams = __Infer<typeof RegisterKeyReducer>;
27
+ export type StartActionParams = __Infer<typeof StartActionReducer>;
28
+
@@ -0,0 +1,53 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
2
+ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
3
+
4
+ /* eslint-disable */
5
+ /* tslint:disable */
6
+ import {
7
+ TypeBuilder as __TypeBuilder,
8
+ t as __t,
9
+ type AlgebraicTypeType as __AlgebraicTypeType,
10
+ type Infer as __Infer,
11
+ } from "spacetimedb";
12
+
13
+ export const Action = __t.object("Action", {
14
+ id: __t.u64(),
15
+ flowId: __t.u64(),
16
+ name: __t.string(),
17
+ status: __t.string(),
18
+ createdAt: __t.timestamp(),
19
+ finishedAt: __t.u64(),
20
+ });
21
+ export type Action = __Infer<typeof Action>;
22
+
23
+ export const ApiKey = __t.object("ApiKey", {
24
+ keyHash: __t.string(),
25
+ label: __t.string(),
26
+ createdAt: __t.timestamp(),
27
+ });
28
+ export type ApiKey = __Infer<typeof ApiKey>;
29
+
30
+ export const Flow = __t.object("Flow", {
31
+ id: __t.u64(),
32
+ keyHash: __t.string(),
33
+ parentFlowId: __t.u64(),
34
+ name: __t.string(),
35
+ path: __t.string(),
36
+ status: __t.string(),
37
+ timeoutSeconds: __t.u64(),
38
+ createdAt: __t.timestamp(),
39
+ finishedAt: __t.u64(),
40
+ exportToken: __t.string(),
41
+ });
42
+ export type Flow = __Infer<typeof Flow>;
43
+
44
+ export const LogEntry = __t.object("LogEntry", {
45
+ id: __t.u64(),
46
+ flowId: __t.u64(),
47
+ level: __t.string(),
48
+ message: __t.string(),
49
+ data: __t.string(),
50
+ createdAt: __t.timestamp(),
51
+ });
52
+ export type LogEntry = __Infer<typeof LogEntry>;
53
+