@pgfsm/api 0.0.0-stage → 0.0.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.
Files changed (118) hide show
  1. package/esm/_dnt.polyfills.d.ts +17 -0
  2. package/esm/_dnt.polyfills.js +15 -0
  3. package/esm/_dnt.shims.d.ts +5 -0
  4. package/esm/_dnt.shims.js +61 -0
  5. package/esm/database-src/generated/database.types.d.ts +2131 -0
  6. package/esm/database-src/generated/database.types.js +21 -0
  7. package/esm/deps/jsr.io/@std/cli/1.0.31/parse_args.d.ts +342 -0
  8. package/esm/deps/jsr.io/@std/cli/1.0.31/parse_args.js +372 -0
  9. package/esm/fsm-api-ts/env.d.ts +143 -0
  10. package/esm/fsm-api-ts/env.js +72 -0
  11. package/esm/fsm-api-ts/lib/configure-open-api.d.ts +3 -0
  12. package/esm/fsm-api-ts/lib/configure-open-api.js +25 -0
  13. package/esm/fsm-api-ts/lib/constants.d.ts +15 -0
  14. package/esm/fsm-api-ts/lib/constants.js +11 -0
  15. package/esm/fsm-api-ts/lib/create-app.d.ts +19 -0
  16. package/esm/fsm-api-ts/lib/create-app.js +137 -0
  17. package/esm/fsm-api-ts/lib/create-router.d.ts +3 -0
  18. package/esm/fsm-api-ts/lib/create-router.js +10 -0
  19. package/esm/fsm-api-ts/lib/license.d.ts +13 -0
  20. package/esm/fsm-api-ts/lib/license.js +15 -0
  21. package/esm/fsm-api-ts/lib/types.d.ts +19 -0
  22. package/esm/fsm-api-ts/lib/types.js +1 -0
  23. package/esm/fsm-api-ts/logger.d.ts +3 -0
  24. package/esm/fsm-api-ts/logger.js +20 -0
  25. package/esm/fsm-api-ts/middlewares/api-key-auth.d.ts +34 -0
  26. package/esm/fsm-api-ts/middlewares/api-key-auth.js +70 -0
  27. package/esm/fsm-api-ts/middlewares/logtape-logger.d.ts +2 -0
  28. package/esm/fsm-api-ts/middlewares/logtape-logger.js +33 -0
  29. package/esm/fsm-api-ts/middlewares/otel-trace.d.ts +2 -0
  30. package/esm/fsm-api-ts/middlewares/otel-trace.js +29 -0
  31. package/esm/fsm-api-ts/middlewares/supabase.d.ts +10 -0
  32. package/esm/fsm-api-ts/middlewares/supabase.js +34 -0
  33. package/esm/fsm-api-ts/mod.d.ts +2 -0
  34. package/esm/fsm-api-ts/mod.js +6 -0
  35. package/esm/fsm-api-ts/routes/admin/admin.handlers.d.ts +8 -0
  36. package/esm/fsm-api-ts/routes/admin/admin.handlers.js +98 -0
  37. package/esm/fsm-api-ts/routes/admin/admin.index.d.ts +189 -0
  38. package/esm/fsm-api-ts/routes/admin/admin.index.js +11 -0
  39. package/esm/fsm-api-ts/routes/admin/admin.routes.d.ts +473 -0
  40. package/esm/fsm-api-ts/routes/admin/admin.routes.js +130 -0
  41. package/esm/fsm-api-ts/routes/definitions/definitions.handlers.d.ts +5 -0
  42. package/esm/fsm-api-ts/routes/definitions/definitions.handlers.js +29 -0
  43. package/esm/fsm-api-ts/routes/definitions/definitions.index.d.ts +86 -0
  44. package/esm/fsm-api-ts/routes/definitions/definitions.index.js +8 -0
  45. package/esm/fsm-api-ts/routes/definitions/definitions.routes.d.ts +204 -0
  46. package/esm/fsm-api-ts/routes/definitions/definitions.routes.js +56 -0
  47. package/esm/fsm-api-ts/routes/index.route.d.ts +19 -0
  48. package/esm/fsm-api-ts/routes/index.route.js +31 -0
  49. package/esm/fsm-api-ts/routes/instances/instances.handlers.d.ts +8 -0
  50. package/esm/fsm-api-ts/routes/instances/instances.handlers.js +108 -0
  51. package/esm/fsm-api-ts/routes/instances/instances.index.d.ts +237 -0
  52. package/esm/fsm-api-ts/routes/instances/instances.index.js +11 -0
  53. package/esm/fsm-api-ts/routes/instances/instances.routes.d.ts +411 -0
  54. package/esm/fsm-api-ts/routes/instances/instances.routes.js +104 -0
  55. package/esm/fsm-api-ts/src/cli/index.d.ts +2 -0
  56. package/esm/fsm-api-ts/src/cli/index.js +197 -0
  57. package/esm/fsm-api-ts/src/cli/invocation.node.d.ts +1 -0
  58. package/esm/fsm-api-ts/src/cli/invocation.node.js +4 -0
  59. package/esm/fsm-api-ts/src/cli/key-bootstrap.d.ts +14 -0
  60. package/esm/fsm-api-ts/src/cli/key-bootstrap.js +35 -0
  61. package/esm/fsm-api-ts/src/cli/serve.node.d.ts +6 -0
  62. package/esm/fsm-api-ts/src/cli/serve.node.js +20 -0
  63. package/esm/fsm-api-ts/src/cli/version.node.d.ts +1 -0
  64. package/esm/fsm-api-ts/src/cli/version.node.js +2 -0
  65. package/esm/fsm-api-ts/stoker-src/http-status-codes.d.ts +354 -0
  66. package/esm/fsm-api-ts/stoker-src/http-status-codes.js +356 -0
  67. package/esm/fsm-api-ts/stoker-src/http-status-phrases.d.ts +354 -0
  68. package/esm/fsm-api-ts/stoker-src/http-status-phrases.js +356 -0
  69. package/esm/fsm-api-ts/stoker-src/middlewares/index.d.ts +3 -0
  70. package/esm/fsm-api-ts/stoker-src/middlewares/index.js +3 -0
  71. package/esm/fsm-api-ts/stoker-src/middlewares/not-found.d.ts +3 -0
  72. package/esm/fsm-api-ts/stoker-src/middlewares/not-found.js +8 -0
  73. package/esm/fsm-api-ts/stoker-src/middlewares/on-error.d.ts +3 -0
  74. package/esm/fsm-api-ts/stoker-src/middlewares/on-error.js +19 -0
  75. package/esm/fsm-api-ts/stoker-src/middlewares/serve-emoji-favicon.d.ts +3 -0
  76. package/esm/fsm-api-ts/stoker-src/middlewares/serve-emoji-favicon.js +10 -0
  77. package/esm/fsm-api-ts/stoker-src/openapi/default-hook.d.ts +3 -0
  78. package/esm/fsm-api-ts/stoker-src/openapi/default-hook.js +11 -0
  79. package/esm/fsm-api-ts/stoker-src/openapi/helpers/index.d.ts +4 -0
  80. package/esm/fsm-api-ts/stoker-src/openapi/helpers/index.js +4 -0
  81. package/esm/fsm-api-ts/stoker-src/openapi/helpers/json-content-one-of.d.ts +12 -0
  82. package/esm/fsm-api-ts/stoker-src/openapi/helpers/json-content-one-of.js +14 -0
  83. package/esm/fsm-api-ts/stoker-src/openapi/helpers/json-content-required.d.ts +11 -0
  84. package/esm/fsm-api-ts/stoker-src/openapi/helpers/json-content-required.js +8 -0
  85. package/esm/fsm-api-ts/stoker-src/openapi/helpers/json-content.d.ts +10 -0
  86. package/esm/fsm-api-ts/stoker-src/openapi/helpers/json-content.js +11 -0
  87. package/esm/fsm-api-ts/stoker-src/openapi/helpers/one-of.d.ts +3 -0
  88. package/esm/fsm-api-ts/stoker-src/openapi/helpers/one-of.js +13 -0
  89. package/esm/fsm-api-ts/stoker-src/openapi/helpers/types.d.ts +2 -0
  90. package/esm/fsm-api-ts/stoker-src/openapi/helpers/types.js +1 -0
  91. package/esm/fsm-api-ts/stoker-src/openapi/index.d.ts +3 -0
  92. package/esm/fsm-api-ts/stoker-src/openapi/index.js +3 -0
  93. package/esm/fsm-api-ts/stoker-src/openapi/schemas/create-error-schema.d.ts +56 -0
  94. package/esm/fsm-api-ts/stoker-src/openapi/schemas/create-error-schema.js +25 -0
  95. package/esm/fsm-api-ts/stoker-src/openapi/schemas/create-message-object.d.ts +9 -0
  96. package/esm/fsm-api-ts/stoker-src/openapi/schemas/create-message-object.js +11 -0
  97. package/esm/fsm-api-ts/stoker-src/openapi/schemas/id-params.d.ts +9 -0
  98. package/esm/fsm-api-ts/stoker-src/openapi/schemas/id-params.js +13 -0
  99. package/esm/fsm-api-ts/stoker-src/openapi/schemas/id-uuid-params.d.ts +9 -0
  100. package/esm/fsm-api-ts/stoker-src/openapi/schemas/id-uuid-params.js +13 -0
  101. package/esm/fsm-api-ts/stoker-src/openapi/schemas/index.d.ts +5 -0
  102. package/esm/fsm-api-ts/stoker-src/openapi/schemas/index.js +5 -0
  103. package/esm/fsm-api-ts/stoker-src/openapi/schemas/slug-params.d.ts +9 -0
  104. package/esm/fsm-api-ts/stoker-src/openapi/schemas/slug-params.js +18 -0
  105. package/esm/fsm-core-db-ts/src/database.types.d.ts +4 -0
  106. package/esm/fsm-core-db-ts/src/database.types.js +17 -0
  107. package/esm/package.json +3 -0
  108. package/package.json +45 -3
  109. package/script/_dnt.polyfills.d.ts +17 -0
  110. package/script/_dnt.polyfills.js +16 -0
  111. package/script/_dnt.shims.d.ts +5 -0
  112. package/script/_dnt.shims.js +65 -0
  113. package/script/fsm-api-ts/mod.d.ts +2 -0
  114. package/script/fsm-api-ts/mod.js +10 -0
  115. package/script/fsm-api-ts/src/cli/version.node.d.ts +1 -0
  116. package/script/fsm-api-ts/src/cli/version.node.js +5 -0
  117. package/script/package.json +3 -0
  118. package/README.md +0 -3
@@ -0,0 +1,2131 @@
1
+ export type Json = string | number | boolean | null | {
2
+ [key: string]: Json | undefined;
3
+ } | Json[];
4
+ export type Database = {
5
+ fsm_core: {
6
+ Tables: {
7
+ api_keys: {
8
+ Row: {
9
+ created_at: string;
10
+ id: string;
11
+ key_hash: string;
12
+ last_used_at: string | null;
13
+ name: string;
14
+ prefix: string;
15
+ revoked_at: string | null;
16
+ role: string;
17
+ };
18
+ Insert: {
19
+ created_at?: string;
20
+ id?: string;
21
+ key_hash: string;
22
+ last_used_at?: string | null;
23
+ name: string;
24
+ prefix: string;
25
+ revoked_at?: string | null;
26
+ role: string;
27
+ };
28
+ Update: {
29
+ created_at?: string;
30
+ id?: string;
31
+ key_hash?: string;
32
+ last_used_at?: string | null;
33
+ name?: string;
34
+ prefix?: string;
35
+ revoked_at?: string | null;
36
+ role?: string;
37
+ };
38
+ Relationships: [];
39
+ };
40
+ async_operation_instance_and_async_operation_workerlet: {
41
+ Row: {
42
+ async_operation_instance_and_async_operation_workerlet_id: string;
43
+ async_operation_instance_id: string;
44
+ async_operation_language: string;
45
+ async_operation_name: string;
46
+ async_operation_type: string;
47
+ async_operation_version: string;
48
+ async_operation_workerlet_id: string | null;
49
+ created_at: string;
50
+ parent_fsm_name: string;
51
+ parent_fsm_version: string;
52
+ scheduled_at: string | null;
53
+ status: string;
54
+ };
55
+ Insert: {
56
+ async_operation_instance_and_async_operation_workerlet_id?: string;
57
+ async_operation_instance_id: string;
58
+ async_operation_language: string;
59
+ async_operation_name: string;
60
+ async_operation_type: string;
61
+ async_operation_version: string;
62
+ async_operation_workerlet_id?: string | null;
63
+ created_at?: string;
64
+ parent_fsm_name: string;
65
+ parent_fsm_version: string;
66
+ scheduled_at?: string | null;
67
+ status?: string;
68
+ };
69
+ Update: {
70
+ async_operation_instance_and_async_operation_workerlet_id?: string;
71
+ async_operation_instance_id?: string;
72
+ async_operation_language?: string;
73
+ async_operation_name?: string;
74
+ async_operation_type?: string;
75
+ async_operation_version?: string;
76
+ async_operation_workerlet_id?: string | null;
77
+ created_at?: string;
78
+ parent_fsm_name?: string;
79
+ parent_fsm_version?: string;
80
+ scheduled_at?: string | null;
81
+ status?: string;
82
+ };
83
+ Relationships: [];
84
+ };
85
+ async_operation_meta: {
86
+ Row: {
87
+ async_operation_language: string;
88
+ async_operation_meta_id: string;
89
+ async_operation_name: string;
90
+ async_operation_type: string;
91
+ async_operation_version: string;
92
+ max_concurrency: number;
93
+ parent_fsm_name: string;
94
+ parent_fsm_version: string;
95
+ updated_at: string;
96
+ updated_by_pid: string;
97
+ };
98
+ Insert: {
99
+ async_operation_language: string;
100
+ async_operation_meta_id?: string;
101
+ async_operation_name: string;
102
+ async_operation_type: string;
103
+ async_operation_version: string;
104
+ max_concurrency?: number;
105
+ parent_fsm_name: string;
106
+ parent_fsm_version: string;
107
+ updated_at?: string;
108
+ updated_by_pid: string;
109
+ };
110
+ Update: {
111
+ async_operation_language?: string;
112
+ async_operation_meta_id?: string;
113
+ async_operation_name?: string;
114
+ async_operation_type?: string;
115
+ async_operation_version?: string;
116
+ max_concurrency?: number;
117
+ parent_fsm_name?: string;
118
+ parent_fsm_version?: string;
119
+ updated_at?: string;
120
+ updated_by_pid?: string;
121
+ };
122
+ Relationships: [];
123
+ };
124
+ async_operation_workerlet: {
125
+ Row: {
126
+ active_pid_number: number;
127
+ async_operation_workerlet_id: string;
128
+ async_operation_workerlet_pid: string;
129
+ last_heartbeat: string;
130
+ max_pid_number: number;
131
+ registered_at: string;
132
+ supported_async_operations: Json;
133
+ };
134
+ Insert: {
135
+ active_pid_number?: number;
136
+ async_operation_workerlet_id?: string;
137
+ async_operation_workerlet_pid: string;
138
+ last_heartbeat?: string;
139
+ max_pid_number: number;
140
+ registered_at?: string;
141
+ supported_async_operations?: Json;
142
+ };
143
+ Update: {
144
+ active_pid_number?: number;
145
+ async_operation_workerlet_id?: string;
146
+ async_operation_workerlet_pid?: string;
147
+ last_heartbeat?: string;
148
+ max_pid_number?: number;
149
+ registered_at?: string;
150
+ supported_async_operations?: Json;
151
+ };
152
+ Relationships: [];
153
+ };
154
+ fsm_async_operation_queue_event_logs: {
155
+ Row: {
156
+ async_operation_fn_name: string | null;
157
+ async_operation_queue_event_log_id: string;
158
+ async_operation_queue_msg_id: number | null;
159
+ async_operation_queue_name: string | null;
160
+ async_operation_queue_type: string | null;
161
+ async_operation_queue_version: string | null;
162
+ error_message: string | null;
163
+ event_data: Json | null;
164
+ event_delay: number | null;
165
+ event_name: string | null;
166
+ event_output: Json | null;
167
+ event_status: string | null;
168
+ execution_duration: number | null;
169
+ execution_finished_at: string | null;
170
+ execution_started_at: string | null;
171
+ send_to_parent_queue_id: string | null;
172
+ send_to_parent_queue_id_event_name: string | null;
173
+ };
174
+ Insert: {
175
+ async_operation_fn_name?: string | null;
176
+ async_operation_queue_event_log_id?: string;
177
+ async_operation_queue_msg_id?: number | null;
178
+ async_operation_queue_name?: string | null;
179
+ async_operation_queue_type?: string | null;
180
+ async_operation_queue_version?: string | null;
181
+ error_message?: string | null;
182
+ event_data?: Json | null;
183
+ event_delay?: number | null;
184
+ event_name?: string | null;
185
+ event_output?: Json | null;
186
+ event_status?: string | null;
187
+ execution_duration?: number | null;
188
+ execution_finished_at?: string | null;
189
+ execution_started_at?: string | null;
190
+ send_to_parent_queue_id?: string | null;
191
+ send_to_parent_queue_id_event_name?: string | null;
192
+ };
193
+ Update: {
194
+ async_operation_fn_name?: string | null;
195
+ async_operation_queue_event_log_id?: string;
196
+ async_operation_queue_msg_id?: number | null;
197
+ async_operation_queue_name?: string | null;
198
+ async_operation_queue_type?: string | null;
199
+ async_operation_queue_version?: string | null;
200
+ error_message?: string | null;
201
+ event_data?: Json | null;
202
+ event_delay?: number | null;
203
+ event_name?: string | null;
204
+ event_output?: Json | null;
205
+ event_status?: string | null;
206
+ execution_duration?: number | null;
207
+ execution_finished_at?: string | null;
208
+ execution_started_at?: string | null;
209
+ send_to_parent_queue_id?: string | null;
210
+ send_to_parent_queue_id_event_name?: string | null;
211
+ };
212
+ Relationships: [];
213
+ };
214
+ fsm_dependencies: {
215
+ Row: {
216
+ child_fsm_name: string;
217
+ child_fsm_version: string;
218
+ parent_fsm_name: string;
219
+ parent_fsm_version: string;
220
+ };
221
+ Insert: {
222
+ child_fsm_name: string;
223
+ child_fsm_version: string;
224
+ parent_fsm_name: string;
225
+ parent_fsm_version: string;
226
+ };
227
+ Update: {
228
+ child_fsm_name?: string;
229
+ child_fsm_version?: string;
230
+ parent_fsm_name?: string;
231
+ parent_fsm_version?: string;
232
+ };
233
+ Relationships: [];
234
+ };
235
+ fsm_instance: {
236
+ Row: {
237
+ childrens: Json | null;
238
+ ended_at: string | null;
239
+ fsm_instance_context: Json | null;
240
+ fsm_instance_error: Json | null;
241
+ fsm_instance_output: Json | null;
242
+ fsm_instance_state: Json | null;
243
+ fsm_instance_status: Json | null;
244
+ fsm_instance_xstate_state: Json | null;
245
+ fsm_name: string | null;
246
+ fsm_type: string | null;
247
+ fsm_version: string | null;
248
+ id: string;
249
+ internal_event_count: number;
250
+ internal_event_queue: Json;
251
+ parent_fsm_instance_id: string | null;
252
+ parent_invoke_id: string | null;
253
+ started_at: string | null;
254
+ total_async_operation_queue_data: Json | null;
255
+ total_schedule_queue_data: Json | null;
256
+ worker_lock_expires_at: string | null;
257
+ worker_locked: boolean | null;
258
+ worker_locked_at: string | null;
259
+ worker_locked_by: string | null;
260
+ };
261
+ Insert: {
262
+ childrens?: Json | null;
263
+ ended_at?: string | null;
264
+ fsm_instance_context?: Json | null;
265
+ fsm_instance_error?: Json | null;
266
+ fsm_instance_output?: Json | null;
267
+ fsm_instance_state?: Json | null;
268
+ fsm_instance_status?: Json | null;
269
+ fsm_instance_xstate_state?: Json | null;
270
+ fsm_name?: string | null;
271
+ fsm_type?: string | null;
272
+ fsm_version?: string | null;
273
+ id?: string;
274
+ internal_event_count?: number;
275
+ internal_event_queue?: Json;
276
+ parent_fsm_instance_id?: string | null;
277
+ parent_invoke_id?: string | null;
278
+ started_at?: string | null;
279
+ total_async_operation_queue_data?: Json | null;
280
+ total_schedule_queue_data?: Json | null;
281
+ worker_lock_expires_at?: string | null;
282
+ worker_locked?: boolean | null;
283
+ worker_locked_at?: string | null;
284
+ worker_locked_by?: string | null;
285
+ };
286
+ Update: {
287
+ childrens?: Json | null;
288
+ ended_at?: string | null;
289
+ fsm_instance_context?: Json | null;
290
+ fsm_instance_error?: Json | null;
291
+ fsm_instance_output?: Json | null;
292
+ fsm_instance_state?: Json | null;
293
+ fsm_instance_status?: Json | null;
294
+ fsm_instance_xstate_state?: Json | null;
295
+ fsm_name?: string | null;
296
+ fsm_type?: string | null;
297
+ fsm_version?: string | null;
298
+ id?: string;
299
+ internal_event_count?: number;
300
+ internal_event_queue?: Json;
301
+ parent_fsm_instance_id?: string | null;
302
+ parent_invoke_id?: string | null;
303
+ started_at?: string | null;
304
+ total_async_operation_queue_data?: Json | null;
305
+ total_schedule_queue_data?: Json | null;
306
+ worker_lock_expires_at?: string | null;
307
+ worker_locked?: boolean | null;
308
+ worker_locked_at?: string | null;
309
+ worker_locked_by?: string | null;
310
+ };
311
+ Relationships: [];
312
+ };
313
+ fsm_instance_and_fsm_workerlet: {
314
+ Row: {
315
+ created_at: string;
316
+ dispatch_type: string;
317
+ fsm_instance_and_fsm_workerlet_id: string;
318
+ fsm_instance_id: string;
319
+ fsm_name: string;
320
+ fsm_version: string;
321
+ fsm_workerlet_id: string | null;
322
+ scheduled_at: string | null;
323
+ status: string;
324
+ };
325
+ Insert: {
326
+ created_at?: string;
327
+ dispatch_type?: string;
328
+ fsm_instance_and_fsm_workerlet_id?: string;
329
+ fsm_instance_id: string;
330
+ fsm_name: string;
331
+ fsm_version: string;
332
+ fsm_workerlet_id?: string | null;
333
+ scheduled_at?: string | null;
334
+ status?: string;
335
+ };
336
+ Update: {
337
+ created_at?: string;
338
+ dispatch_type?: string;
339
+ fsm_instance_and_fsm_workerlet_id?: string;
340
+ fsm_instance_id?: string;
341
+ fsm_name?: string;
342
+ fsm_version?: string;
343
+ fsm_workerlet_id?: string | null;
344
+ scheduled_at?: string | null;
345
+ status?: string;
346
+ };
347
+ Relationships: [];
348
+ };
349
+ fsm_instance_lock: {
350
+ Row: {
351
+ expires_at: string | null;
352
+ fsm_instance_id: string;
353
+ locked: boolean | null;
354
+ locked_at: string | null;
355
+ locked_by: string | null;
356
+ };
357
+ Insert: {
358
+ expires_at?: string | null;
359
+ fsm_instance_id: string;
360
+ locked?: boolean | null;
361
+ locked_at?: string | null;
362
+ locked_by?: string | null;
363
+ };
364
+ Update: {
365
+ expires_at?: string | null;
366
+ fsm_instance_id?: string;
367
+ locked?: boolean | null;
368
+ locked_at?: string | null;
369
+ locked_by?: string | null;
370
+ };
371
+ Relationships: [
372
+ {
373
+ foreignKeyName: "fsm_instance_lock_fsm_instance_id_fkey";
374
+ columns: ["fsm_instance_id"];
375
+ isOneToOne: true;
376
+ referencedRelation: "fsm_instance";
377
+ referencedColumns: ["id"];
378
+ }
379
+ ];
380
+ };
381
+ fsm_instance_queue_event_logs: {
382
+ Row: {
383
+ error_message: string | null;
384
+ event_data: Json | null;
385
+ event_delay: number | null;
386
+ event_name: string | null;
387
+ event_output: Json | null;
388
+ event_source: string;
389
+ event_status: string | null;
390
+ execution_duration: number | null;
391
+ execution_finished_at: string | null;
392
+ execution_started_at: string | null;
393
+ fsm_instance_id: string | null;
394
+ fsm_instance_id_fsm_type: string | null;
395
+ fsm_instance_id_fsm_version: string | null;
396
+ fsm_instance_queue_event_log_id: string;
397
+ fsm_instance_queue_msg_id: number | null;
398
+ };
399
+ Insert: {
400
+ error_message?: string | null;
401
+ event_data?: Json | null;
402
+ event_delay?: number | null;
403
+ event_name?: string | null;
404
+ event_output?: Json | null;
405
+ event_source?: string;
406
+ event_status?: string | null;
407
+ execution_duration?: number | null;
408
+ execution_finished_at?: string | null;
409
+ execution_started_at?: string | null;
410
+ fsm_instance_id?: string | null;
411
+ fsm_instance_id_fsm_type?: string | null;
412
+ fsm_instance_id_fsm_version?: string | null;
413
+ fsm_instance_queue_event_log_id?: string;
414
+ fsm_instance_queue_msg_id?: number | null;
415
+ };
416
+ Update: {
417
+ error_message?: string | null;
418
+ event_data?: Json | null;
419
+ event_delay?: number | null;
420
+ event_name?: string | null;
421
+ event_output?: Json | null;
422
+ event_source?: string;
423
+ event_status?: string | null;
424
+ execution_duration?: number | null;
425
+ execution_finished_at?: string | null;
426
+ execution_started_at?: string | null;
427
+ fsm_instance_id?: string | null;
428
+ fsm_instance_id_fsm_type?: string | null;
429
+ fsm_instance_id_fsm_version?: string | null;
430
+ fsm_instance_queue_event_log_id?: string;
431
+ fsm_instance_queue_msg_id?: number | null;
432
+ };
433
+ Relationships: [
434
+ {
435
+ foreignKeyName: "fsm_instance_queue_event_logs_fsm_instance_id_fkey";
436
+ columns: ["fsm_instance_id"];
437
+ isOneToOne: false;
438
+ referencedRelation: "fsm_instance";
439
+ referencedColumns: ["id"];
440
+ }
441
+ ];
442
+ };
443
+ fsm_instance_transitions_auth: {
444
+ Row: {
445
+ fsm_instance_event_type: string | null;
446
+ fsm_instance_id: string | null;
447
+ fsm_name: string | null;
448
+ fsm_type: string | null;
449
+ fsm_version: string | null;
450
+ groups: Json[] | null;
451
+ id: string;
452
+ meta_info: Json | null;
453
+ module_tag: Json | null;
454
+ users: Json[] | null;
455
+ };
456
+ Insert: {
457
+ fsm_instance_event_type?: string | null;
458
+ fsm_instance_id?: string | null;
459
+ fsm_name?: string | null;
460
+ fsm_type?: string | null;
461
+ fsm_version?: string | null;
462
+ groups?: Json[] | null;
463
+ id?: string;
464
+ meta_info?: Json | null;
465
+ module_tag?: Json | null;
466
+ users?: Json[] | null;
467
+ };
468
+ Update: {
469
+ fsm_instance_event_type?: string | null;
470
+ fsm_instance_id?: string | null;
471
+ fsm_name?: string | null;
472
+ fsm_type?: string | null;
473
+ fsm_version?: string | null;
474
+ groups?: Json[] | null;
475
+ id?: string;
476
+ meta_info?: Json | null;
477
+ module_tag?: Json | null;
478
+ users?: Json[] | null;
479
+ };
480
+ Relationships: [
481
+ {
482
+ foreignKeyName: "fsm_instance_transitions_auth_fsm_instance_id_fkey";
483
+ columns: ["fsm_instance_id"];
484
+ isOneToOne: false;
485
+ referencedRelation: "fsm_instance";
486
+ referencedColumns: ["id"];
487
+ }
488
+ ];
489
+ };
490
+ fsm_json: {
491
+ Row: {
492
+ fsm_json: Json | null;
493
+ fsm_name: string | null;
494
+ fsm_type: string | null;
495
+ fsm_version: string | null;
496
+ id: number;
497
+ };
498
+ Insert: {
499
+ fsm_json?: Json | null;
500
+ fsm_name?: string | null;
501
+ fsm_type?: string | null;
502
+ fsm_version?: string | null;
503
+ id?: number;
504
+ };
505
+ Update: {
506
+ fsm_json?: Json | null;
507
+ fsm_name?: string | null;
508
+ fsm_type?: string | null;
509
+ fsm_version?: string | null;
510
+ id?: number;
511
+ };
512
+ Relationships: [];
513
+ };
514
+ fsm_states: {
515
+ Row: {
516
+ computed_state_id_ltree: unknown;
517
+ computed_state_key_ltree: unknown;
518
+ context: Json | null;
519
+ data: Json | null;
520
+ description: string | null;
521
+ entry: Json | null;
522
+ exit: Json | null;
523
+ fsm_name: string | null;
524
+ fsm_on: Json | null;
525
+ fsm_order: number | null;
526
+ fsm_version: string | null;
527
+ history: string | null;
528
+ id: string;
529
+ initial: Json | null;
530
+ invoke: Json | null;
531
+ key: string;
532
+ parent_node: string | null;
533
+ state_id_with_fsm_name_and_fsm_version: string;
534
+ states: Json | null;
535
+ transitions: Json | null;
536
+ type: Database["fsm_core"]["Enums"]["fsm_state_type"];
537
+ };
538
+ Insert: {
539
+ computed_state_id_ltree: unknown;
540
+ computed_state_key_ltree: unknown;
541
+ context?: Json | null;
542
+ data?: Json | null;
543
+ description?: string | null;
544
+ entry?: Json | null;
545
+ exit?: Json | null;
546
+ fsm_name?: string | null;
547
+ fsm_on?: Json | null;
548
+ fsm_order?: number | null;
549
+ fsm_version?: string | null;
550
+ history?: string | null;
551
+ id: string;
552
+ initial?: Json | null;
553
+ invoke?: Json | null;
554
+ key: string;
555
+ parent_node?: string | null;
556
+ state_id_with_fsm_name_and_fsm_version: string;
557
+ states?: Json | null;
558
+ transitions?: Json | null;
559
+ type: Database["fsm_core"]["Enums"]["fsm_state_type"];
560
+ };
561
+ Update: {
562
+ computed_state_id_ltree?: unknown;
563
+ computed_state_key_ltree?: unknown;
564
+ context?: Json | null;
565
+ data?: Json | null;
566
+ description?: string | null;
567
+ entry?: Json | null;
568
+ exit?: Json | null;
569
+ fsm_name?: string | null;
570
+ fsm_on?: Json | null;
571
+ fsm_order?: number | null;
572
+ fsm_version?: string | null;
573
+ history?: string | null;
574
+ id?: string;
575
+ initial?: Json | null;
576
+ invoke?: Json | null;
577
+ key?: string;
578
+ parent_node?: string | null;
579
+ state_id_with_fsm_name_and_fsm_version?: string;
580
+ states?: Json | null;
581
+ transitions?: Json | null;
582
+ type?: Database["fsm_core"]["Enums"]["fsm_state_type"];
583
+ };
584
+ Relationships: [];
585
+ };
586
+ fsm_transitions: {
587
+ Row: {
588
+ actions: Json | null;
589
+ computed_sanitized_source_ltree: unknown;
590
+ computed_sanitized_target_ltree_array: unknown[] | null;
591
+ computed_transition_domain_lca: string | null;
592
+ cond: Json | null;
593
+ event_type: string;
594
+ fsm_name: string | null;
595
+ fsm_version: string | null;
596
+ id: number;
597
+ reenter: boolean | null;
598
+ source: string;
599
+ target: string[] | null;
600
+ };
601
+ Insert: {
602
+ actions?: Json | null;
603
+ computed_sanitized_source_ltree: unknown;
604
+ computed_sanitized_target_ltree_array?: unknown[] | null;
605
+ computed_transition_domain_lca?: string | null;
606
+ cond?: Json | null;
607
+ event_type: string;
608
+ fsm_name?: string | null;
609
+ fsm_version?: string | null;
610
+ id?: number;
611
+ reenter?: boolean | null;
612
+ source: string;
613
+ target?: string[] | null;
614
+ };
615
+ Update: {
616
+ actions?: Json | null;
617
+ computed_sanitized_source_ltree?: unknown;
618
+ computed_sanitized_target_ltree_array?: unknown[] | null;
619
+ computed_transition_domain_lca?: string | null;
620
+ cond?: Json | null;
621
+ event_type?: string;
622
+ fsm_name?: string | null;
623
+ fsm_version?: string | null;
624
+ id?: number;
625
+ reenter?: boolean | null;
626
+ source?: string;
627
+ target?: string[] | null;
628
+ };
629
+ Relationships: [];
630
+ };
631
+ fsm_workerlet: {
632
+ Row: {
633
+ active_workers: number;
634
+ fsm_modules: Json;
635
+ fsm_workerlet_id: string;
636
+ fsm_workerlet_pid: string;
637
+ last_heartbeat: string;
638
+ max_concurrency: number;
639
+ registered_at: string;
640
+ };
641
+ Insert: {
642
+ active_workers?: number;
643
+ fsm_modules?: Json;
644
+ fsm_workerlet_id?: string;
645
+ fsm_workerlet_pid: string;
646
+ last_heartbeat?: string;
647
+ max_concurrency: number;
648
+ registered_at?: string;
649
+ };
650
+ Update: {
651
+ active_workers?: number;
652
+ fsm_modules?: Json;
653
+ fsm_workerlet_id?: string;
654
+ fsm_workerlet_pid?: string;
655
+ last_heartbeat?: string;
656
+ max_concurrency?: number;
657
+ registered_at?: string;
658
+ };
659
+ Relationships: [];
660
+ };
661
+ };
662
+ Views: {
663
+ [_ in never]: never;
664
+ };
665
+ Functions: {
666
+ api_system_event_name: {
667
+ Args: never;
668
+ Returns: string;
669
+ };
670
+ api_system_queue_type: {
671
+ Args: never;
672
+ Returns: string;
673
+ };
674
+ api_system_queue_uuid: {
675
+ Args: never;
676
+ Returns: string;
677
+ };
678
+ archive_event_from_fsm_type_worker_v2: {
679
+ Args: {
680
+ fsm_instance_data_save_fsm_context: Json;
681
+ fsm_instance_data_save_fsm_error?: Json;
682
+ fsm_instance_data_save_fsm_state: Json;
683
+ fsm_instance_data_save_fsm_status: Json;
684
+ fsm_instance_data_save_fsm_xstate_state: Json;
685
+ input_total_async_operation_queue_data: Json;
686
+ input_total_schedule_queue_data: Json;
687
+ processed_internal_event?: Json;
688
+ raised_events?: Json;
689
+ remove_current_queue_msg_id: number;
690
+ remove_from_current_fsm_instance_queue_id: string;
691
+ to_be_added_async_operation_queue_data: Json;
692
+ to_be_added_schedule_queue_data: Json;
693
+ to_be_removed_async_operation_queue_msg_ids: Json;
694
+ to_be_removed_schedule_queue_msg_ids: Json;
695
+ };
696
+ Returns: Json;
697
+ };
698
+ archive_fsm_instance_queue_messages_v2: {
699
+ Args: {
700
+ input_fsm_instance_id: string;
701
+ };
702
+ Returns: number[];
703
+ };
704
+ async_operation_messages_not_queued_v2: {
705
+ Args: {
706
+ input_messages: Json;
707
+ };
708
+ Returns: Json;
709
+ };
710
+ async_operation_schedule_next_pending: {
711
+ Args: {
712
+ input_stale_threshold_seconds?: number;
713
+ };
714
+ Returns: boolean;
715
+ };
716
+ build_nested_json_recursive: {
717
+ Args: {
718
+ paths: string[];
719
+ };
720
+ Returns: Json;
721
+ };
722
+ check_registry_and_working_for_async_actors_for_fsm_instance_an: {
723
+ Args: {
724
+ input_async_actors: Json;
725
+ input_fsm_name: string;
726
+ input_fsm_version: string;
727
+ };
728
+ Returns: Json;
729
+ };
730
+ check_registry_for_async_actors: {
731
+ Args: {
732
+ input_async_actors: Json;
733
+ input_fsm_name: string;
734
+ input_fsm_version: string;
735
+ };
736
+ Returns: Json;
737
+ };
738
+ claim_pending_async_operation_events_for_workers_v2: {
739
+ Args: {
740
+ input_workers: Json;
741
+ };
742
+ Returns: Json[];
743
+ };
744
+ claim_pending_async_operation_events_with_capacity_v2: {
745
+ Args: {
746
+ input_workers: Json;
747
+ };
748
+ Returns: Json[];
749
+ };
750
+ claim_scheduled_for_async_operation_workerlet: {
751
+ Args: {
752
+ input_workerlet_id: string;
753
+ };
754
+ Returns: Json;
755
+ };
756
+ claim_scheduled_for_fsmlet: {
757
+ Args: {
758
+ input_fsmlet_id: string;
759
+ };
760
+ Returns: Json;
761
+ };
762
+ compute_async_operation_queue_name_v2: {
763
+ Args: {
764
+ input_async_operation_language: string;
765
+ input_async_operation_name: string;
766
+ input_async_operation_type: string;
767
+ input_async_operation_version: string;
768
+ input_parent_fsm_name: string;
769
+ input_parent_fsm_version: string;
770
+ };
771
+ Returns: string;
772
+ };
773
+ compute_child_exit_set_v1: {
774
+ Args: {
775
+ state_node_set: unknown[];
776
+ transition_domain_lca: unknown;
777
+ };
778
+ Returns: string[];
779
+ };
780
+ compute_entry_actions_v1: {
781
+ Args: {
782
+ fsm_name_param: string;
783
+ fsm_version_param: string;
784
+ is_initial_transition: boolean;
785
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
786
+ };
787
+ Returns: Json;
788
+ };
789
+ compute_entry_set_v2: {
790
+ Args: {
791
+ fsm_name_param: string;
792
+ fsm_version_param: string;
793
+ is_initial_transition: boolean;
794
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
795
+ };
796
+ Returns: Json;
797
+ };
798
+ compute_exit_actions_v1: {
799
+ Args: {
800
+ p_fsm_name: string;
801
+ p_fsm_version: string;
802
+ p_state_node_set: string[];
803
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
804
+ };
805
+ Returns: Json;
806
+ };
807
+ compute_full_exit_set_v1: {
808
+ Args: {
809
+ state_node_set: string[];
810
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
811
+ };
812
+ Returns: string[];
813
+ };
814
+ compute_full_exit_set_v2: {
815
+ Args: {
816
+ state_node_set: string[];
817
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
818
+ };
819
+ Returns: string[];
820
+ };
821
+ create_api_key: {
822
+ Args: {
823
+ input_name: string;
824
+ input_role: string;
825
+ };
826
+ Returns: Json;
827
+ };
828
+ create_async_operation_instance_and_notify_async_operation_sche: {
829
+ Args: {
830
+ input_async_operation_instance_id: string;
831
+ input_async_operation_language: string;
832
+ input_async_operation_name: string;
833
+ input_async_operation_type: string;
834
+ input_async_operation_version: string;
835
+ input_parent_fsm_name: string;
836
+ input_parent_fsm_version: string;
837
+ };
838
+ Returns: undefined;
839
+ };
840
+ create_fsm_instance_from_name_v2: {
841
+ Args: {
842
+ create_pgmq_queue?: boolean;
843
+ input_fsm_context: Json;
844
+ input_fsm_name: string;
845
+ input_fsm_version: string;
846
+ input_parent_fsm_instance_id?: string;
847
+ input_parent_invoke_id?: string;
848
+ };
849
+ Returns: Json;
850
+ };
851
+ discard_fsm_macrostep_v2: {
852
+ Args: {
853
+ input_instance_row: Database["fsm_core"]["Tables"]["fsm_instance"]["Row"];
854
+ input_processed_internal_event: Json;
855
+ input_processed_message?: Json;
856
+ input_processed_queue_msg_id: number;
857
+ input_reason: string;
858
+ };
859
+ Returns: Json;
860
+ };
861
+ enqueue_fsm_dispatch_v1: {
862
+ Args: {
863
+ input_dispatch_type?: string;
864
+ input_fsm_name: string;
865
+ input_fsm_version: string;
866
+ input_instance_id: string;
867
+ };
868
+ Returns: undefined;
869
+ };
870
+ enqueue_fsm_dispatch_v2: {
871
+ Args: {
872
+ input_dispatch_type?: string;
873
+ input_fsm_name: string;
874
+ input_fsm_version: string;
875
+ input_instance_id: string;
876
+ };
877
+ Returns: undefined;
878
+ };
879
+ ensure_async_operation_queue_for_worker_v2: {
880
+ Args: {
881
+ input_async_operation_language: string;
882
+ input_async_operation_name: string;
883
+ input_async_operation_type: string;
884
+ input_async_operation_version: string;
885
+ input_parent_fsm_name: string;
886
+ input_parent_fsm_version: string;
887
+ };
888
+ Returns: Json;
889
+ };
890
+ enter_states_v2: {
891
+ Args: {
892
+ fsm_name_param: string;
893
+ fsm_version_param: string;
894
+ is_initial: boolean;
895
+ state_node_set: string[];
896
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
897
+ };
898
+ Returns: Json;
899
+ };
900
+ exit_states_v2: {
901
+ Args: {
902
+ fsm_name_param: string;
903
+ fsm_version_param: string;
904
+ state_node_set: string[];
905
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
906
+ };
907
+ Returns: Json;
908
+ };
909
+ find_least_common_ancestor_v2: {
910
+ Args: {
911
+ input_fsm_name: string;
912
+ input_fsm_version: string;
913
+ input_paths: unknown[];
914
+ };
915
+ Returns: unknown;
916
+ };
917
+ finish_async_operation_event_v2: {
918
+ Args: {
919
+ input_archive_reason: string;
920
+ input_async_operation_queue_msg_id: number;
921
+ input_async_operation_queue_name: string;
922
+ input_async_operation_queue_type?: string;
923
+ input_async_operation_queue_version?: string;
924
+ input_error_message?: string;
925
+ input_event_action_type?: string;
926
+ input_event_data?: Json;
927
+ input_event_delay?: number;
928
+ input_event_name?: string;
929
+ input_event_output?: Json;
930
+ input_event_status?: string;
931
+ input_execution_duration?: number;
932
+ input_execution_finished_at?: string;
933
+ input_execution_started_at?: string;
934
+ input_send_to_parent_queue_id?: string;
935
+ input_send_to_parent_queue_id_event_name?: string;
936
+ };
937
+ Returns: Json;
938
+ };
939
+ fsm_get_all_state_nodes_v1: {
940
+ Args: {
941
+ p_fsm_name: string;
942
+ p_fsm_version: string;
943
+ p_state_paths: string[];
944
+ };
945
+ Returns: string[];
946
+ };
947
+ fsm_get_all_state_nodes_v2: {
948
+ Args: {
949
+ input_fsm_name: string;
950
+ input_fsm_version: string;
951
+ input_state_paths: string[];
952
+ };
953
+ Returns: string[];
954
+ };
955
+ fsm_get_initial_state_nodes_v1: {
956
+ Args: {
957
+ p_fsm_name: string;
958
+ p_fsm_version: string;
959
+ p_state_path: unknown;
960
+ };
961
+ Returns: string[];
962
+ };
963
+ fsm_get_initial_state_nodes_v2: {
964
+ Args: {
965
+ input_fsm_name: string;
966
+ input_fsm_version: string;
967
+ input_state_path: unknown;
968
+ };
969
+ Returns: string[];
970
+ };
971
+ fsm_get_initial_state_nodes_with_ancestors_v1: {
972
+ Args: {
973
+ p_fsm_name: string;
974
+ p_fsm_version: string;
975
+ p_state_path: unknown;
976
+ };
977
+ Returns: string[];
978
+ };
979
+ fsm_get_initial_state_nodes_with_ancestors_v2: {
980
+ Args: {
981
+ input_fsm_name: string;
982
+ input_fsm_version: string;
983
+ input_state_path: unknown;
984
+ };
985
+ Returns: string[];
986
+ };
987
+ fsm_json_schema: {
988
+ Args: never;
989
+ Returns: Json;
990
+ };
991
+ fsm_worker_v1: {
992
+ Args: {
993
+ event_name: string;
994
+ fsm_name_param: string;
995
+ fsm_version_param: string;
996
+ p_state_value: Json;
997
+ };
998
+ Returns: Json;
999
+ };
1000
+ fsm_worker_v2: {
1001
+ Args: {
1002
+ event_name: string;
1003
+ fsm_name_param: string;
1004
+ fsm_version_param: string;
1005
+ input_state_value: Json;
1006
+ };
1007
+ Returns: Json;
1008
+ };
1009
+ get_ancestor_states_for_entry_v1: {
1010
+ Args: {
1011
+ ancestors: string[];
1012
+ fsm_name_param: string;
1013
+ fsm_version_param: string;
1014
+ reentrancy_domain: string;
1015
+ };
1016
+ Returns: Database["fsm_core"]["CompositeTypes"]["ancestor_states_result_v1"];
1017
+ SetofOptions: {
1018
+ from: "*";
1019
+ to: "ancestor_states_result_v1";
1020
+ isOneToOne: true;
1021
+ isSetofReturn: false;
1022
+ };
1023
+ };
1024
+ get_ancestor_states_for_entry_v2: {
1025
+ Args: {
1026
+ ancestors: string[];
1027
+ fsm_name_param: string;
1028
+ fsm_version_param: string;
1029
+ reentrancy_domain: string;
1030
+ };
1031
+ Returns: Database["fsm_core"]["CompositeTypes"]["ancestor_states_result_v2"];
1032
+ SetofOptions: {
1033
+ from: "*";
1034
+ to: "ancestor_states_result_v2";
1035
+ isOneToOne: true;
1036
+ isSetofReturn: false;
1037
+ };
1038
+ };
1039
+ get_descendant_states_for_entry_v1: {
1040
+ Args: {
1041
+ fsm_name_param: string;
1042
+ fsm_version_param: string;
1043
+ input_state_id: string;
1044
+ };
1045
+ Returns: Database["fsm_core"]["CompositeTypes"]["descendant_states_result_v1"];
1046
+ SetofOptions: {
1047
+ from: "*";
1048
+ to: "descendant_states_result_v1";
1049
+ isOneToOne: true;
1050
+ isSetofReturn: false;
1051
+ };
1052
+ };
1053
+ get_descendant_states_for_entry_v2: {
1054
+ Args: {
1055
+ fsm_name_param: string;
1056
+ fsm_version_param: string;
1057
+ input_state_id: string;
1058
+ };
1059
+ Returns: Database["fsm_core"]["CompositeTypes"]["descendant_states_result_v2"];
1060
+ SetofOptions: {
1061
+ from: "*";
1062
+ to: "descendant_states_result_v2";
1063
+ isOneToOne: true;
1064
+ isSetofReturn: false;
1065
+ };
1066
+ };
1067
+ get_entry_actions_v1: {
1068
+ Args: {
1069
+ p_fsm_name: string;
1070
+ p_fsm_version: string;
1071
+ p_state_paths: string[];
1072
+ };
1073
+ Returns: Json;
1074
+ };
1075
+ get_entry_actions_v2: {
1076
+ Args: {
1077
+ input_fsm_name: string;
1078
+ input_fsm_version: string;
1079
+ input_state_paths: string[];
1080
+ };
1081
+ Returns: Json;
1082
+ };
1083
+ get_exit_actions_v1: {
1084
+ Args: {
1085
+ p_fsm_name: string;
1086
+ p_fsm_version: string;
1087
+ p_state_paths: string[];
1088
+ };
1089
+ Returns: Json;
1090
+ };
1091
+ get_exit_actions_v2: {
1092
+ Args: {
1093
+ input_fsm_name: string;
1094
+ input_fsm_version: string;
1095
+ input_state_paths: string[];
1096
+ };
1097
+ Returns: Json;
1098
+ };
1099
+ get_fsm_data_resolve_state_value_v2: {
1100
+ Args: {
1101
+ input_fsm_id: string;
1102
+ };
1103
+ Returns: Json;
1104
+ };
1105
+ get_initial_actions_v1: {
1106
+ Args: {
1107
+ p_fsm_name: string;
1108
+ p_fsm_version: string;
1109
+ p_state_paths: string[];
1110
+ };
1111
+ Returns: Json;
1112
+ };
1113
+ get_initial_actions_v2: {
1114
+ Args: {
1115
+ input_fsm_name: string;
1116
+ input_fsm_version: string;
1117
+ input_state_paths: string[];
1118
+ };
1119
+ Returns: Json;
1120
+ };
1121
+ get_proper_ancestors: {
1122
+ Args: {
1123
+ state_path_ltree: string;
1124
+ to_state_path_ltree: string;
1125
+ };
1126
+ Returns: string[];
1127
+ };
1128
+ get_proper_ancestors_ltree: {
1129
+ Args: {
1130
+ state_path_ltree: unknown;
1131
+ to_state_path_ltree: unknown;
1132
+ };
1133
+ Returns: unknown[];
1134
+ };
1135
+ get_transition_domain_v2: {
1136
+ Args: {
1137
+ input_fsm_name: string;
1138
+ input_fsm_version: string;
1139
+ input_reenter: boolean;
1140
+ input_source: unknown;
1141
+ input_targets: unknown[];
1142
+ };
1143
+ Returns: unknown;
1144
+ };
1145
+ hello: {
1146
+ Args: {
1147
+ input_text: string;
1148
+ };
1149
+ Returns: undefined;
1150
+ };
1151
+ hello_niraj: {
1152
+ Args: {
1153
+ input_text: string;
1154
+ };
1155
+ Returns: undefined;
1156
+ };
1157
+ insert_fsm_dependencies: {
1158
+ Args: {
1159
+ p_dependent_children: Json;
1160
+ p_parent_name: string;
1161
+ p_parent_version: string;
1162
+ };
1163
+ Returns: undefined;
1164
+ };
1165
+ is_descendant: {
1166
+ Args: {
1167
+ input_child: unknown;
1168
+ input_parent: unknown;
1169
+ };
1170
+ Returns: boolean;
1171
+ };
1172
+ is_in_final_state_v2: {
1173
+ Args: {
1174
+ fsm_name_param: string;
1175
+ fsm_version_param: string;
1176
+ state_node_set: string[];
1177
+ state_path: string;
1178
+ };
1179
+ Returns: boolean;
1180
+ };
1181
+ json_matches_schema: {
1182
+ Args: {
1183
+ instance: Json;
1184
+ schema: Json;
1185
+ };
1186
+ Returns: boolean;
1187
+ };
1188
+ jsonb_all_paths: {
1189
+ Args: {
1190
+ j: Json;
1191
+ prefix?: string;
1192
+ };
1193
+ Returns: string[];
1194
+ };
1195
+ jsonb_deep_merge: {
1196
+ Args: {
1197
+ a: Json;
1198
+ b: Json;
1199
+ };
1200
+ Returns: Json;
1201
+ };
1202
+ jsonb_matches_schema: {
1203
+ Args: {
1204
+ instance: Json;
1205
+ schema: Json;
1206
+ };
1207
+ Returns: boolean;
1208
+ };
1209
+ jsonschema_is_valid: {
1210
+ Args: {
1211
+ schema: Json;
1212
+ };
1213
+ Returns: boolean;
1214
+ };
1215
+ jsonschema_validation_errors: {
1216
+ Args: {
1217
+ instance: Json;
1218
+ schema: Json;
1219
+ };
1220
+ Returns: string[];
1221
+ };
1222
+ list_api_keys: {
1223
+ Args: never;
1224
+ Returns: {
1225
+ created_at: string;
1226
+ id: string;
1227
+ last_used_at: string;
1228
+ name: string;
1229
+ prefix: string;
1230
+ revoked_at: string;
1231
+ role: string;
1232
+ }[];
1233
+ };
1234
+ load_async_operation_meta_v2: {
1235
+ Args: {
1236
+ input_async_operation_language: string;
1237
+ input_async_operation_name: string;
1238
+ input_async_operation_type: string;
1239
+ input_async_operation_version: string;
1240
+ input_parent_fsm_name: string;
1241
+ input_parent_fsm_version: string;
1242
+ input_updated_by_pid: string;
1243
+ };
1244
+ Returns: Json;
1245
+ };
1246
+ load_fsm_from_json_v2: {
1247
+ Args: {
1248
+ input_dependent_children?: Json;
1249
+ input_fsm_name: string;
1250
+ input_fsm_version: string;
1251
+ json_input: Json;
1252
+ root_node_text: string;
1253
+ };
1254
+ Returns: Json;
1255
+ };
1256
+ load_fsm_state_from_json_v1: {
1257
+ Args: {
1258
+ input_fsm_name: string;
1259
+ input_fsm_version: string;
1260
+ json_input: Json;
1261
+ root_node_text: string;
1262
+ };
1263
+ Returns: Json;
1264
+ };
1265
+ load_fsm_state_from_json_v2: {
1266
+ Args: {
1267
+ input_fsm_name: string;
1268
+ input_fsm_version: string;
1269
+ json_input: Json;
1270
+ root_node_text: string;
1271
+ };
1272
+ Returns: Json;
1273
+ };
1274
+ load_fsm_transition_from_json_v1: {
1275
+ Args: {
1276
+ fsm_name: string;
1277
+ fsm_version: string;
1278
+ json_input: Json;
1279
+ root_node_text: string;
1280
+ };
1281
+ Returns: Json;
1282
+ };
1283
+ load_fsm_transition_from_json_v2: {
1284
+ Args: {
1285
+ fsm_name: string;
1286
+ fsm_version: string;
1287
+ json_input: Json;
1288
+ root_node_text: string;
1289
+ };
1290
+ Returns: Json;
1291
+ };
1292
+ lock_fsm_instance: {
1293
+ Args: {
1294
+ input_fsm_instance_id: string;
1295
+ input_locked_by: string;
1296
+ };
1297
+ Returns: boolean;
1298
+ };
1299
+ log_async_operation_cancel_ack_v2: {
1300
+ Args: {
1301
+ input_async_operation_queue_msg_id: number;
1302
+ input_async_operation_queue_name: string;
1303
+ input_cancel_to_ack_ms: number;
1304
+ input_invoke_id: string;
1305
+ input_outcome: string;
1306
+ input_reason: string;
1307
+ };
1308
+ Returns: string;
1309
+ };
1310
+ macrostep_v1: {
1311
+ Args: {
1312
+ event_name: string;
1313
+ fsm_name_param: string;
1314
+ fsm_version_param: string;
1315
+ p_state_value: string[];
1316
+ };
1317
+ Returns: Json;
1318
+ };
1319
+ macrostep_v2: {
1320
+ Args: {
1321
+ event_name: string;
1322
+ fsm_name_param: string;
1323
+ fsm_version_param: string;
1324
+ input_state_value: string[];
1325
+ };
1326
+ Returns: Json;
1327
+ };
1328
+ microstep_v1: {
1329
+ Args: {
1330
+ event_name: string;
1331
+ fsm_name_param: string;
1332
+ fsm_version_param: string;
1333
+ state_value_node_set: string[];
1334
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
1335
+ };
1336
+ Returns: Json;
1337
+ };
1338
+ microstep_v2: {
1339
+ Args: {
1340
+ event_name: string;
1341
+ fsm_name_param: string;
1342
+ fsm_version_param: string;
1343
+ state_value_node_set: string[];
1344
+ transition_record: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"];
1345
+ };
1346
+ Returns: Json;
1347
+ };
1348
+ path_string_to_jsonb: {
1349
+ Args: {
1350
+ path: string;
1351
+ };
1352
+ Returns: Json;
1353
+ };
1354
+ pg_advisory_unlock: {
1355
+ Args: {
1356
+ key: number;
1357
+ };
1358
+ Returns: boolean;
1359
+ } | {
1360
+ Args: {
1361
+ key1: number;
1362
+ key2: number;
1363
+ };
1364
+ Returns: boolean;
1365
+ };
1366
+ pg_system_event_name: {
1367
+ Args: never;
1368
+ Returns: string;
1369
+ };
1370
+ pg_system_queue_type: {
1371
+ Args: never;
1372
+ Returns: string;
1373
+ };
1374
+ pg_system_queue_uuid: {
1375
+ Args: never;
1376
+ Returns: string;
1377
+ };
1378
+ pg_try_advisory_lock: {
1379
+ Args: {
1380
+ key: number;
1381
+ };
1382
+ Returns: boolean;
1383
+ } | {
1384
+ Args: {
1385
+ key1: number;
1386
+ key2: number;
1387
+ };
1388
+ Returns: boolean;
1389
+ };
1390
+ register_scheduler_job_v2: {
1391
+ Args: {
1392
+ input_schedule?: string;
1393
+ };
1394
+ Returns: Json;
1395
+ };
1396
+ remove_hashtag_from_text: {
1397
+ Args: {
1398
+ input_text: string;
1399
+ };
1400
+ Returns: string;
1401
+ };
1402
+ require_version: {
1403
+ Args: {
1404
+ input_expected: string;
1405
+ };
1406
+ Returns: undefined;
1407
+ };
1408
+ resolve_state_value_v1: {
1409
+ Args: {
1410
+ input_fsm_name: string;
1411
+ input_fsm_version: string;
1412
+ input_json: Json;
1413
+ };
1414
+ Returns: Json;
1415
+ };
1416
+ resolve_state_value_v2: {
1417
+ Args: {
1418
+ input_fsm_name: string;
1419
+ input_fsm_version: string;
1420
+ input_json: Json;
1421
+ };
1422
+ Returns: Json;
1423
+ };
1424
+ resume_event_for_fsm_worker_v2: {
1425
+ Args: {
1426
+ input_fsm_instance_id: string;
1427
+ };
1428
+ Returns: Json;
1429
+ };
1430
+ revoke_api_key: {
1431
+ Args: {
1432
+ input_id_or_name: string;
1433
+ };
1434
+ Returns: boolean;
1435
+ };
1436
+ sanitize_text_array_to_ltree_array: {
1437
+ Args: {
1438
+ input_array: string[];
1439
+ };
1440
+ Returns: unknown[];
1441
+ };
1442
+ sanitize_text_array_to_ltree_text_array: {
1443
+ Args: {
1444
+ input_array: string[];
1445
+ };
1446
+ Returns: string[];
1447
+ };
1448
+ sanitize_text_to_ltree: {
1449
+ Args: {
1450
+ input_text: string;
1451
+ };
1452
+ Returns: unknown;
1453
+ };
1454
+ schedule_all_pending: {
1455
+ Args: {
1456
+ input_stale_threshold_seconds?: number;
1457
+ };
1458
+ Returns: undefined;
1459
+ };
1460
+ schedule_next_pending: {
1461
+ Args: {
1462
+ input_stale_threshold_seconds?: number;
1463
+ };
1464
+ Returns: boolean;
1465
+ };
1466
+ scheduler_job_status_v2: {
1467
+ Args: never;
1468
+ Returns: Json;
1469
+ };
1470
+ select_all_transitions_v1: {
1471
+ Args: {
1472
+ event_name: string;
1473
+ fsm_name_param: string;
1474
+ fsm_version_param: string;
1475
+ p_state_value: string[];
1476
+ };
1477
+ Returns: Json;
1478
+ };
1479
+ select_all_transitions_v2: {
1480
+ Args: {
1481
+ event_name: string;
1482
+ fsm_name_param: string;
1483
+ fsm_version_param: string;
1484
+ input_state_value: string[];
1485
+ };
1486
+ Returns: Json;
1487
+ };
1488
+ select_transitions_with_guard_eval_v1: {
1489
+ Args: {
1490
+ input_all_transitions: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"][];
1491
+ };
1492
+ Returns: {
1493
+ actions: Json | null;
1494
+ computed_sanitized_source_ltree: unknown;
1495
+ computed_sanitized_target_ltree_array: unknown[] | null;
1496
+ computed_transition_domain_lca: string | null;
1497
+ cond: Json | null;
1498
+ event_type: string;
1499
+ fsm_name: string | null;
1500
+ fsm_version: string | null;
1501
+ id: number;
1502
+ reenter: boolean | null;
1503
+ source: string;
1504
+ target: string[] | null;
1505
+ }[];
1506
+ SetofOptions: {
1507
+ from: "*";
1508
+ to: "fsm_transitions";
1509
+ isOneToOne: false;
1510
+ isSetofReturn: true;
1511
+ };
1512
+ };
1513
+ select_transitions_with_guard_eval_v2: {
1514
+ Args: {
1515
+ input_all_transitions: Database["fsm_core"]["Tables"]["fsm_transitions"]["Row"][];
1516
+ };
1517
+ Returns: {
1518
+ actions: Json | null;
1519
+ computed_sanitized_source_ltree: unknown;
1520
+ computed_sanitized_target_ltree_array: unknown[] | null;
1521
+ computed_transition_domain_lca: string | null;
1522
+ cond: Json | null;
1523
+ event_type: string;
1524
+ fsm_name: string | null;
1525
+ fsm_version: string | null;
1526
+ id: number;
1527
+ reenter: boolean | null;
1528
+ source: string;
1529
+ target: string[] | null;
1530
+ }[];
1531
+ SetofOptions: {
1532
+ from: "*";
1533
+ to: "fsm_transitions";
1534
+ isOneToOne: false;
1535
+ isSetofReturn: true;
1536
+ };
1537
+ };
1538
+ send_event_to_async_operation_queue_with_event_logs_v2: {
1539
+ Args: {
1540
+ input_async_operation_fn_name: string;
1541
+ input_async_operation_queue_name: string;
1542
+ input_async_operation_queue_type: string;
1543
+ input_async_operation_queue_version: string;
1544
+ input_error_message?: string;
1545
+ input_event_action_type: string;
1546
+ input_event_data: Json;
1547
+ input_event_delay?: number;
1548
+ input_event_name: string;
1549
+ input_event_output?: Json;
1550
+ input_event_status?: string;
1551
+ input_execution_duration?: number;
1552
+ input_execution_finished_at?: string;
1553
+ input_execution_started_at?: string;
1554
+ input_send_to_parent_queue_id: string;
1555
+ input_send_to_parent_queue_id_event_name: string;
1556
+ input_send_to_parent_queue_type: string;
1557
+ };
1558
+ Returns: Json;
1559
+ };
1560
+ send_event_to_fsm_queue_with_event_logs_v2: {
1561
+ Args: {
1562
+ input_error_message?: string;
1563
+ input_event_action_type: string;
1564
+ input_event_data: Json;
1565
+ input_event_delay?: number;
1566
+ input_event_name: string;
1567
+ input_event_output?: Json;
1568
+ input_event_source?: Json;
1569
+ input_event_status?: string;
1570
+ input_execution_duration?: number;
1571
+ input_execution_finished_at?: string;
1572
+ input_execution_started_at?: string;
1573
+ input_fsm_instance_id: string;
1574
+ input_fsm_instance_id_fsm_type: string;
1575
+ input_fsm_instance_id_fsm_version: string;
1576
+ };
1577
+ Returns: Json;
1578
+ };
1579
+ sql_lca_for_transition: {
1580
+ Args: {
1581
+ transition: Json;
1582
+ };
1583
+ Returns: unknown;
1584
+ };
1585
+ sql_lca_from_array: {
1586
+ Args: {
1587
+ paths: unknown[];
1588
+ };
1589
+ Returns: unknown;
1590
+ };
1591
+ start_async_operation_for_worker_v2: {
1592
+ Args: {
1593
+ action_type: string;
1594
+ async_operation_language: string;
1595
+ async_operation_type: string;
1596
+ async_operation_version: string;
1597
+ input: Json;
1598
+ invoke_id: string;
1599
+ parent_fsm_instance_id: string;
1600
+ parent_fsm_name: string;
1601
+ parent_fsm_version: string;
1602
+ src: string;
1603
+ };
1604
+ Returns: Json;
1605
+ };
1606
+ start_child_fsm_v2: {
1607
+ Args: {
1608
+ fsm_name: string;
1609
+ fsm_version: string;
1610
+ input: Json;
1611
+ invoke_id: string;
1612
+ parent_fsm_instance_id: string;
1613
+ src: string;
1614
+ };
1615
+ Returns: Json;
1616
+ };
1617
+ start_invoked_async_operation_v2: {
1618
+ Args: {
1619
+ action_type: string;
1620
+ async_operation_language: string;
1621
+ async_operation_type: string;
1622
+ async_operation_version: string;
1623
+ input: Json;
1624
+ invoke_id: string;
1625
+ parent_fsm_instance_id: string;
1626
+ parent_fsm_name: string;
1627
+ parent_fsm_version: string;
1628
+ src: string;
1629
+ };
1630
+ Returns: Json;
1631
+ };
1632
+ stop_child_fsm_v2: {
1633
+ Args: {
1634
+ input_child_fsm_instance_id: string;
1635
+ };
1636
+ Returns: Json;
1637
+ };
1638
+ stop_event_for_fsm_worker_v1: {
1639
+ Args: {
1640
+ input_fsm_instance_id: string;
1641
+ };
1642
+ Returns: Json;
1643
+ };
1644
+ stop_event_for_fsm_worker_v2: {
1645
+ Args: {
1646
+ input_fsm_instance_id: string;
1647
+ };
1648
+ Returns: Json;
1649
+ };
1650
+ stop_fsm_instance_v2: {
1651
+ Args: {
1652
+ input_event_name?: string;
1653
+ input_fsm_instance_id: string;
1654
+ };
1655
+ Returns: Json;
1656
+ };
1657
+ stop_invoked_async_operation_v2: {
1658
+ Args: {
1659
+ input_entry: Json;
1660
+ };
1661
+ Returns: Json;
1662
+ };
1663
+ test_event_transition_for_entry_v1: {
1664
+ Args: {
1665
+ event_name: string;
1666
+ fsm_name_param: string;
1667
+ fsm_version_param: string;
1668
+ };
1669
+ Returns: Json;
1670
+ };
1671
+ test_event_transition_for_entry_v2: {
1672
+ Args: {
1673
+ event_name: string;
1674
+ fsm_name_param: string;
1675
+ fsm_version_param: string;
1676
+ };
1677
+ Returns: Json;
1678
+ };
1679
+ test_jsonb_roundtrip: {
1680
+ Args: {
1681
+ input_jsonb: Json;
1682
+ };
1683
+ Returns: {
1684
+ original: Json;
1685
+ paths: string[];
1686
+ reconstructed: Json;
1687
+ }[];
1688
+ };
1689
+ tx_now: {
1690
+ Args: never;
1691
+ Returns: string;
1692
+ };
1693
+ unlock_fsm_instance: {
1694
+ Args: {
1695
+ input_fsm_instance_id: string;
1696
+ };
1697
+ Returns: boolean;
1698
+ };
1699
+ verify_api_key: {
1700
+ Args: {
1701
+ input_key_hash: string;
1702
+ };
1703
+ Returns: string;
1704
+ };
1705
+ version: {
1706
+ Args: never;
1707
+ Returns: string;
1708
+ };
1709
+ wall_now: {
1710
+ Args: never;
1711
+ Returns: string;
1712
+ };
1713
+ };
1714
+ Enums: {
1715
+ async_operation_language: "typescript" | "python" | "rust" | "go" | "llm";
1716
+ async_operation_type: "internalAsyncOperation" | "sharedAsyncOperation" | "fsm";
1717
+ fsm_history_type: "shallow" | "deep";
1718
+ fsm_root_type: "compound" | "parallel";
1719
+ fsm_state_type: "atomic" | "compound" | "parallel" | "final" | "history";
1720
+ };
1721
+ CompositeTypes: {
1722
+ ancestor_states_result_v1: {
1723
+ ancestor_states_to_enter: string[] | null;
1724
+ ancestor_states_for_default_entry: string[] | null;
1725
+ };
1726
+ ancestor_states_result_v2: {
1727
+ ancestor_states_to_enter: string[] | null;
1728
+ ancestor_states_for_default_entry: string[] | null;
1729
+ };
1730
+ descendant_states_result_v1: {
1731
+ descendant_states_to_enter: string[] | null;
1732
+ descendant_states_for_default_entry: string[] | null;
1733
+ };
1734
+ descendant_states_result_v2: {
1735
+ descendant_states_to_enter: string[] | null;
1736
+ descendant_states_for_default_entry: string[] | null;
1737
+ };
1738
+ fsm_event_data_v2: {
1739
+ eventType: string | null;
1740
+ eventPayload: Json | null;
1741
+ actionType: string | null;
1742
+ };
1743
+ fsm_queue_msg_data_v2: {
1744
+ eventData: Database["fsm_core"]["CompositeTypes"]["fsm_event_data_v2"] | null;
1745
+ queueId: string | null;
1746
+ queueType: string | null;
1747
+ queueVersion: string | null;
1748
+ sendToParentQueueId: string | null;
1749
+ sendToParentQueueType: string | null;
1750
+ sendToParentQueueIdEventName: string | null;
1751
+ queueMsgId: number | null;
1752
+ queueMsgDelay: number | null;
1753
+ queueFnName: string | null;
1754
+ };
1755
+ };
1756
+ };
1757
+ pgmq: {
1758
+ Tables: {
1759
+ meta: {
1760
+ Row: {
1761
+ created_at: string;
1762
+ is_partitioned: boolean;
1763
+ is_unlogged: boolean;
1764
+ queue_name: string;
1765
+ };
1766
+ Insert: {
1767
+ created_at?: string;
1768
+ is_partitioned: boolean;
1769
+ is_unlogged: boolean;
1770
+ queue_name: string;
1771
+ };
1772
+ Update: {
1773
+ created_at?: string;
1774
+ is_partitioned?: boolean;
1775
+ is_unlogged?: boolean;
1776
+ queue_name?: string;
1777
+ };
1778
+ Relationships: [];
1779
+ };
1780
+ };
1781
+ Views: {
1782
+ [_ in never]: never;
1783
+ };
1784
+ Functions: {
1785
+ _belongs_to_pgmq: {
1786
+ Args: {
1787
+ table_name: string;
1788
+ };
1789
+ Returns: boolean;
1790
+ };
1791
+ _ensure_pg_partman_installed: {
1792
+ Args: never;
1793
+ Returns: undefined;
1794
+ };
1795
+ _get_partition_col: {
1796
+ Args: {
1797
+ partition_interval: string;
1798
+ };
1799
+ Returns: string;
1800
+ };
1801
+ _get_pg_partman_major_version: {
1802
+ Args: never;
1803
+ Returns: number;
1804
+ };
1805
+ _get_pg_partman_schema: {
1806
+ Args: never;
1807
+ Returns: string;
1808
+ };
1809
+ archive: {
1810
+ Args: {
1811
+ msg_id: number;
1812
+ queue_name: string;
1813
+ };
1814
+ Returns: boolean;
1815
+ } | {
1816
+ Args: {
1817
+ msg_ids: number[];
1818
+ queue_name: string;
1819
+ };
1820
+ Returns: number[];
1821
+ };
1822
+ convert_archive_partitioned: {
1823
+ Args: {
1824
+ leading_partition?: number;
1825
+ partition_interval?: string;
1826
+ retention_interval?: string;
1827
+ table_name: string;
1828
+ };
1829
+ Returns: undefined;
1830
+ };
1831
+ create: {
1832
+ Args: {
1833
+ queue_name: string;
1834
+ };
1835
+ Returns: undefined;
1836
+ };
1837
+ create_non_partitioned: {
1838
+ Args: {
1839
+ queue_name: string;
1840
+ };
1841
+ Returns: undefined;
1842
+ };
1843
+ create_partitioned: {
1844
+ Args: {
1845
+ partition_interval?: string;
1846
+ queue_name: string;
1847
+ retention_interval?: string;
1848
+ };
1849
+ Returns: undefined;
1850
+ };
1851
+ create_unlogged: {
1852
+ Args: {
1853
+ queue_name: string;
1854
+ };
1855
+ Returns: undefined;
1856
+ };
1857
+ delete: {
1858
+ Args: {
1859
+ msg_id: number;
1860
+ queue_name: string;
1861
+ };
1862
+ Returns: boolean;
1863
+ } | {
1864
+ Args: {
1865
+ msg_ids: number[];
1866
+ queue_name: string;
1867
+ };
1868
+ Returns: number[];
1869
+ };
1870
+ detach_archive: {
1871
+ Args: {
1872
+ queue_name: string;
1873
+ };
1874
+ Returns: undefined;
1875
+ };
1876
+ drop_queue: {
1877
+ Args: {
1878
+ queue_name: string;
1879
+ };
1880
+ Returns: boolean;
1881
+ };
1882
+ format_table_name: {
1883
+ Args: {
1884
+ prefix: string;
1885
+ queue_name: string;
1886
+ };
1887
+ Returns: string;
1888
+ };
1889
+ list_queues: {
1890
+ Args: never;
1891
+ Returns: Database["pgmq"]["CompositeTypes"]["queue_record"][];
1892
+ SetofOptions: {
1893
+ from: "*";
1894
+ to: "queue_record";
1895
+ isOneToOne: false;
1896
+ isSetofReturn: true;
1897
+ };
1898
+ };
1899
+ metrics: {
1900
+ Args: {
1901
+ queue_name: string;
1902
+ };
1903
+ Returns: Database["pgmq"]["CompositeTypes"]["metrics_result"];
1904
+ SetofOptions: {
1905
+ from: "*";
1906
+ to: "metrics_result";
1907
+ isOneToOne: true;
1908
+ isSetofReturn: false;
1909
+ };
1910
+ };
1911
+ metrics_all: {
1912
+ Args: never;
1913
+ Returns: Database["pgmq"]["CompositeTypes"]["metrics_result"][];
1914
+ SetofOptions: {
1915
+ from: "*";
1916
+ to: "metrics_result";
1917
+ isOneToOne: false;
1918
+ isSetofReturn: true;
1919
+ };
1920
+ };
1921
+ pop: {
1922
+ Args: {
1923
+ queue_name: string;
1924
+ };
1925
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
1926
+ SetofOptions: {
1927
+ from: "*";
1928
+ to: "message_record";
1929
+ isOneToOne: false;
1930
+ isSetofReturn: true;
1931
+ };
1932
+ };
1933
+ purge_queue: {
1934
+ Args: {
1935
+ queue_name: string;
1936
+ };
1937
+ Returns: number;
1938
+ };
1939
+ read: {
1940
+ Args: {
1941
+ qty: number;
1942
+ queue_name: string;
1943
+ vt: number;
1944
+ };
1945
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
1946
+ SetofOptions: {
1947
+ from: "*";
1948
+ to: "message_record";
1949
+ isOneToOne: false;
1950
+ isSetofReturn: true;
1951
+ };
1952
+ };
1953
+ read_with_poll: {
1954
+ Args: {
1955
+ max_poll_seconds?: number;
1956
+ poll_interval_ms?: number;
1957
+ qty: number;
1958
+ queue_name: string;
1959
+ vt: number;
1960
+ };
1961
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
1962
+ SetofOptions: {
1963
+ from: "*";
1964
+ to: "message_record";
1965
+ isOneToOne: false;
1966
+ isSetofReturn: true;
1967
+ };
1968
+ };
1969
+ send: {
1970
+ Args: {
1971
+ delay?: number;
1972
+ msg: Json;
1973
+ queue_name: string;
1974
+ };
1975
+ Returns: number[];
1976
+ };
1977
+ send_batch: {
1978
+ Args: {
1979
+ delay?: number;
1980
+ msgs: Json[];
1981
+ queue_name: string;
1982
+ };
1983
+ Returns: number[];
1984
+ };
1985
+ set_vt: {
1986
+ Args: {
1987
+ msg_id: number;
1988
+ queue_name: string;
1989
+ vt: number;
1990
+ };
1991
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
1992
+ SetofOptions: {
1993
+ from: "*";
1994
+ to: "message_record";
1995
+ isOneToOne: false;
1996
+ isSetofReturn: true;
1997
+ };
1998
+ };
1999
+ validate_queue_name: {
2000
+ Args: {
2001
+ queue_name: string;
2002
+ };
2003
+ Returns: undefined;
2004
+ };
2005
+ };
2006
+ Enums: {
2007
+ [_ in never]: never;
2008
+ };
2009
+ CompositeTypes: {
2010
+ message_record: {
2011
+ msg_id: number | null;
2012
+ read_ct: number | null;
2013
+ enqueued_at: string | null;
2014
+ vt: string | null;
2015
+ message: Json | null;
2016
+ };
2017
+ metrics_result: {
2018
+ queue_name: string | null;
2019
+ queue_length: number | null;
2020
+ newest_msg_age_sec: number | null;
2021
+ oldest_msg_age_sec: number | null;
2022
+ total_messages: number | null;
2023
+ scrape_time: string | null;
2024
+ };
2025
+ queue_record: {
2026
+ queue_name: string | null;
2027
+ is_partitioned: boolean | null;
2028
+ is_unlogged: boolean | null;
2029
+ created_at: string | null;
2030
+ };
2031
+ };
2032
+ };
2033
+ public: {
2034
+ Tables: {
2035
+ [_ in never]: never;
2036
+ };
2037
+ Views: {
2038
+ [_ in never]: never;
2039
+ };
2040
+ Functions: {
2041
+ test_event_transition_for_exit_v2: {
2042
+ Args: {
2043
+ event_name: string;
2044
+ fsm_name_param: string;
2045
+ fsm_version_param: string;
2046
+ input_state_node_set: string[];
2047
+ };
2048
+ Returns: Json;
2049
+ };
2050
+ text2ltree: {
2051
+ Args: {
2052
+ "": string;
2053
+ };
2054
+ Returns: unknown;
2055
+ };
2056
+ };
2057
+ Enums: {
2058
+ [_ in never]: never;
2059
+ };
2060
+ CompositeTypes: {
2061
+ [_ in never]: never;
2062
+ };
2063
+ };
2064
+ };
2065
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
2066
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
2067
+ export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
2068
+ schema: keyof DatabaseWithoutInternals;
2069
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
2070
+ schema: keyof DatabaseWithoutInternals;
2071
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
2072
+ schema: keyof DatabaseWithoutInternals;
2073
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2074
+ Row: infer R;
2075
+ } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
2076
+ Row: infer R;
2077
+ } ? R : never : never;
2078
+ export type TablesInsert<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
2079
+ schema: keyof DatabaseWithoutInternals;
2080
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
2081
+ schema: keyof DatabaseWithoutInternals;
2082
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
2083
+ schema: keyof DatabaseWithoutInternals;
2084
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2085
+ Insert: infer I;
2086
+ } ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
2087
+ Insert: infer I;
2088
+ } ? I : never : never;
2089
+ export type TablesUpdate<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
2090
+ schema: keyof DatabaseWithoutInternals;
2091
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
2092
+ schema: keyof DatabaseWithoutInternals;
2093
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
2094
+ schema: keyof DatabaseWithoutInternals;
2095
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2096
+ Update: infer U;
2097
+ } ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
2098
+ Update: infer U;
2099
+ } ? U : never : never;
2100
+ export type Enums<DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] | {
2101
+ schema: keyof DatabaseWithoutInternals;
2102
+ }, EnumName extends DefaultSchemaEnumNameOrOptions extends {
2103
+ schema: keyof DatabaseWithoutInternals;
2104
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] : never = never> = DefaultSchemaEnumNameOrOptions extends {
2105
+ schema: keyof DatabaseWithoutInternals;
2106
+ } ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never;
2107
+ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] | {
2108
+ schema: keyof DatabaseWithoutInternals;
2109
+ }, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
2110
+ schema: keyof DatabaseWithoutInternals;
2111
+ } ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
2112
+ schema: keyof DatabaseWithoutInternals;
2113
+ } ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
2114
+ export declare const Constants: {
2115
+ readonly fsm_core: {
2116
+ readonly Enums: {
2117
+ readonly async_operation_language: readonly ["typescript", "python", "rust", "go", "llm"];
2118
+ readonly async_operation_type: readonly ["internalAsyncOperation", "sharedAsyncOperation", "fsm"];
2119
+ readonly fsm_history_type: readonly ["shallow", "deep"];
2120
+ readonly fsm_root_type: readonly ["compound", "parallel"];
2121
+ readonly fsm_state_type: readonly ["atomic", "compound", "parallel", "final", "history"];
2122
+ };
2123
+ };
2124
+ readonly pgmq: {
2125
+ readonly Enums: {};
2126
+ };
2127
+ readonly public: {
2128
+ readonly Enums: {};
2129
+ };
2130
+ };
2131
+ export {};