@checkstack/automation-backend 0.2.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 (47) hide show
  1. package/CHANGELOG.md +453 -0
  2. package/drizzle/0000_acoustic_diamondback.sql +80 -0
  3. package/drizzle/0001_mute_vindicator.sql +12 -0
  4. package/drizzle/0002_silky_omega_red.sql +12 -0
  5. package/drizzle/meta/0000_snapshot.json +688 -0
  6. package/drizzle/meta/0001_snapshot.json +785 -0
  7. package/drizzle/meta/0002_snapshot.json +861 -0
  8. package/drizzle/meta/_journal.json +27 -0
  9. package/drizzle.config.ts +12 -0
  10. package/package.json +41 -0
  11. package/src/action-registry.ts +83 -0
  12. package/src/action-types.ts +324 -0
  13. package/src/artifact-store.ts +140 -0
  14. package/src/artifact-type-registry.ts +64 -0
  15. package/src/automation-store.ts +227 -0
  16. package/src/builtin-actions.test.ts +185 -0
  17. package/src/builtin-actions.ts +132 -0
  18. package/src/builtin-triggers.test.ts +264 -0
  19. package/src/builtin-triggers.ts +365 -0
  20. package/src/dispatch/action-kind.ts +44 -0
  21. package/src/dispatch/condition.ts +61 -0
  22. package/src/dispatch/delay-queue.ts +91 -0
  23. package/src/dispatch/engine.test.ts +1198 -0
  24. package/src/dispatch/engine.ts +1672 -0
  25. package/src/dispatch/path-nav.ts +65 -0
  26. package/src/dispatch/render.test.ts +75 -0
  27. package/src/dispatch/render.ts +136 -0
  28. package/src/dispatch/run-state-store.ts +143 -0
  29. package/src/dispatch/run-state.ts +298 -0
  30. package/src/dispatch/scope.test.ts +40 -0
  31. package/src/dispatch/scope.ts +125 -0
  32. package/src/dispatch/stalled-sweeper.ts +164 -0
  33. package/src/dispatch/test-fixtures.ts +558 -0
  34. package/src/dispatch/trigger-subscriber.ts +397 -0
  35. package/src/dispatch/types.ts +259 -0
  36. package/src/extension-points.ts +88 -0
  37. package/src/index.ts +379 -0
  38. package/src/migration/from-webhook-subscriptions.test.ts +237 -0
  39. package/src/migration/from-webhook-subscriptions.ts +398 -0
  40. package/src/registries.test.ts +357 -0
  41. package/src/router.test.ts +724 -0
  42. package/src/router.ts +556 -0
  43. package/src/schema.ts +310 -0
  44. package/src/trigger-registry.ts +99 -0
  45. package/src/validate-definition.test.ts +306 -0
  46. package/src/validate-definition.ts +304 -0
  47. package/tsconfig.json +41 -0
@@ -0,0 +1,861 @@
1
+ {
2
+ "id": "c963b295-d477-4cbd-af9e-d5dadab41fd7",
3
+ "prevId": "06ae96ff-21b7-4e92-9c8d-22e3b8e3b71e",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.automation_artifacts": {
8
+ "name": "automation_artifacts",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "automation_id": {
18
+ "name": "automation_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "run_id": {
24
+ "name": "run_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "step_id": {
30
+ "name": "step_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "action_id": {
36
+ "name": "action_id",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "artifact_type": {
42
+ "name": "artifact_type",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": true
46
+ },
47
+ "data": {
48
+ "name": "data",
49
+ "type": "jsonb",
50
+ "primaryKey": false,
51
+ "notNull": true
52
+ },
53
+ "context_key": {
54
+ "name": "context_key",
55
+ "type": "text",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "closed_at": {
60
+ "name": "closed_at",
61
+ "type": "timestamp",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "created_at": {
66
+ "name": "created_at",
67
+ "type": "timestamp",
68
+ "primaryKey": false,
69
+ "notNull": true,
70
+ "default": "now()"
71
+ }
72
+ },
73
+ "indexes": {
74
+ "automation_artifacts_context_lookup_idx": {
75
+ "name": "automation_artifacts_context_lookup_idx",
76
+ "columns": [
77
+ {
78
+ "expression": "automation_id",
79
+ "isExpression": false,
80
+ "asc": true,
81
+ "nulls": "last"
82
+ },
83
+ {
84
+ "expression": "context_key",
85
+ "isExpression": false,
86
+ "asc": true,
87
+ "nulls": "last"
88
+ },
89
+ {
90
+ "expression": "artifact_type",
91
+ "isExpression": false,
92
+ "asc": true,
93
+ "nulls": "last"
94
+ },
95
+ {
96
+ "expression": "created_at",
97
+ "isExpression": false,
98
+ "asc": true,
99
+ "nulls": "last"
100
+ }
101
+ ],
102
+ "isUnique": false,
103
+ "concurrently": false,
104
+ "method": "btree",
105
+ "with": {}
106
+ },
107
+ "automation_artifacts_action_lookup_idx": {
108
+ "name": "automation_artifacts_action_lookup_idx",
109
+ "columns": [
110
+ {
111
+ "expression": "automation_id",
112
+ "isExpression": false,
113
+ "asc": true,
114
+ "nulls": "last"
115
+ },
116
+ {
117
+ "expression": "action_id",
118
+ "isExpression": false,
119
+ "asc": true,
120
+ "nulls": "last"
121
+ },
122
+ {
123
+ "expression": "created_at",
124
+ "isExpression": false,
125
+ "asc": true,
126
+ "nulls": "last"
127
+ }
128
+ ],
129
+ "isUnique": false,
130
+ "concurrently": false,
131
+ "method": "btree",
132
+ "with": {}
133
+ },
134
+ "automation_artifacts_open_idx": {
135
+ "name": "automation_artifacts_open_idx",
136
+ "columns": [
137
+ {
138
+ "expression": "automation_id",
139
+ "isExpression": false,
140
+ "asc": true,
141
+ "nulls": "last"
142
+ },
143
+ {
144
+ "expression": "closed_at",
145
+ "isExpression": false,
146
+ "asc": true,
147
+ "nulls": "last"
148
+ }
149
+ ],
150
+ "isUnique": false,
151
+ "concurrently": false,
152
+ "method": "btree",
153
+ "with": {}
154
+ }
155
+ },
156
+ "foreignKeys": {
157
+ "automation_artifacts_automation_id_automations_id_fk": {
158
+ "name": "automation_artifacts_automation_id_automations_id_fk",
159
+ "tableFrom": "automation_artifacts",
160
+ "tableTo": "automations",
161
+ "columnsFrom": [
162
+ "automation_id"
163
+ ],
164
+ "columnsTo": [
165
+ "id"
166
+ ],
167
+ "onDelete": "cascade",
168
+ "onUpdate": "no action"
169
+ },
170
+ "automation_artifacts_run_id_automation_runs_id_fk": {
171
+ "name": "automation_artifacts_run_id_automation_runs_id_fk",
172
+ "tableFrom": "automation_artifacts",
173
+ "tableTo": "automation_runs",
174
+ "columnsFrom": [
175
+ "run_id"
176
+ ],
177
+ "columnsTo": [
178
+ "id"
179
+ ],
180
+ "onDelete": "cascade",
181
+ "onUpdate": "no action"
182
+ },
183
+ "automation_artifacts_step_id_automation_run_steps_id_fk": {
184
+ "name": "automation_artifacts_step_id_automation_run_steps_id_fk",
185
+ "tableFrom": "automation_artifacts",
186
+ "tableTo": "automation_run_steps",
187
+ "columnsFrom": [
188
+ "step_id"
189
+ ],
190
+ "columnsTo": [
191
+ "id"
192
+ ],
193
+ "onDelete": "cascade",
194
+ "onUpdate": "no action"
195
+ }
196
+ },
197
+ "compositePrimaryKeys": {},
198
+ "uniqueConstraints": {},
199
+ "policies": {},
200
+ "checkConstraints": {},
201
+ "isRLSEnabled": false
202
+ },
203
+ "public.automation_migration_failures": {
204
+ "name": "automation_migration_failures",
205
+ "schema": "",
206
+ "columns": {
207
+ "id": {
208
+ "name": "id",
209
+ "type": "text",
210
+ "primaryKey": true,
211
+ "notNull": true
212
+ },
213
+ "subscription_id": {
214
+ "name": "subscription_id",
215
+ "type": "text",
216
+ "primaryKey": false,
217
+ "notNull": true
218
+ },
219
+ "subscription_name": {
220
+ "name": "subscription_name",
221
+ "type": "text",
222
+ "primaryKey": false,
223
+ "notNull": true
224
+ },
225
+ "provider_id": {
226
+ "name": "provider_id",
227
+ "type": "text",
228
+ "primaryKey": false,
229
+ "notNull": true
230
+ },
231
+ "event_id": {
232
+ "name": "event_id",
233
+ "type": "text",
234
+ "primaryKey": false,
235
+ "notNull": true
236
+ },
237
+ "reason": {
238
+ "name": "reason",
239
+ "type": "text",
240
+ "primaryKey": false,
241
+ "notNull": true
242
+ },
243
+ "detail": {
244
+ "name": "detail",
245
+ "type": "text",
246
+ "primaryKey": false,
247
+ "notNull": false
248
+ },
249
+ "provider_config": {
250
+ "name": "provider_config",
251
+ "type": "jsonb",
252
+ "primaryKey": false,
253
+ "notNull": true
254
+ },
255
+ "created_at": {
256
+ "name": "created_at",
257
+ "type": "timestamp",
258
+ "primaryKey": false,
259
+ "notNull": true,
260
+ "default": "now()"
261
+ }
262
+ },
263
+ "indexes": {},
264
+ "foreignKeys": {},
265
+ "compositePrimaryKeys": {},
266
+ "uniqueConstraints": {
267
+ "automation_migration_failures_subscription_id_unique": {
268
+ "name": "automation_migration_failures_subscription_id_unique",
269
+ "nullsNotDistinct": false,
270
+ "columns": [
271
+ "subscription_id"
272
+ ]
273
+ }
274
+ },
275
+ "policies": {},
276
+ "checkConstraints": {},
277
+ "isRLSEnabled": false
278
+ },
279
+ "public.automation_run_state": {
280
+ "name": "automation_run_state",
281
+ "schema": "",
282
+ "columns": {
283
+ "run_id": {
284
+ "name": "run_id",
285
+ "type": "text",
286
+ "primaryKey": true,
287
+ "notNull": true
288
+ },
289
+ "scope_snapshot": {
290
+ "name": "scope_snapshot",
291
+ "type": "jsonb",
292
+ "primaryKey": false,
293
+ "notNull": true
294
+ },
295
+ "last_action_path": {
296
+ "name": "last_action_path",
297
+ "type": "text",
298
+ "primaryKey": false,
299
+ "notNull": false
300
+ },
301
+ "last_heartbeat_at": {
302
+ "name": "last_heartbeat_at",
303
+ "type": "timestamp",
304
+ "primaryKey": false,
305
+ "notNull": true,
306
+ "default": "now()"
307
+ },
308
+ "updated_at": {
309
+ "name": "updated_at",
310
+ "type": "timestamp",
311
+ "primaryKey": false,
312
+ "notNull": true,
313
+ "default": "now()"
314
+ }
315
+ },
316
+ "indexes": {
317
+ "automation_run_state_heartbeat_idx": {
318
+ "name": "automation_run_state_heartbeat_idx",
319
+ "columns": [
320
+ {
321
+ "expression": "last_heartbeat_at",
322
+ "isExpression": false,
323
+ "asc": true,
324
+ "nulls": "last"
325
+ }
326
+ ],
327
+ "isUnique": false,
328
+ "concurrently": false,
329
+ "method": "btree",
330
+ "with": {}
331
+ }
332
+ },
333
+ "foreignKeys": {
334
+ "automation_run_state_run_id_automation_runs_id_fk": {
335
+ "name": "automation_run_state_run_id_automation_runs_id_fk",
336
+ "tableFrom": "automation_run_state",
337
+ "tableTo": "automation_runs",
338
+ "columnsFrom": [
339
+ "run_id"
340
+ ],
341
+ "columnsTo": [
342
+ "id"
343
+ ],
344
+ "onDelete": "cascade",
345
+ "onUpdate": "no action"
346
+ }
347
+ },
348
+ "compositePrimaryKeys": {},
349
+ "uniqueConstraints": {},
350
+ "policies": {},
351
+ "checkConstraints": {},
352
+ "isRLSEnabled": false
353
+ },
354
+ "public.automation_run_steps": {
355
+ "name": "automation_run_steps",
356
+ "schema": "",
357
+ "columns": {
358
+ "id": {
359
+ "name": "id",
360
+ "type": "text",
361
+ "primaryKey": true,
362
+ "notNull": true
363
+ },
364
+ "run_id": {
365
+ "name": "run_id",
366
+ "type": "text",
367
+ "primaryKey": false,
368
+ "notNull": true
369
+ },
370
+ "action_path": {
371
+ "name": "action_path",
372
+ "type": "text",
373
+ "primaryKey": false,
374
+ "notNull": true
375
+ },
376
+ "action_id": {
377
+ "name": "action_id",
378
+ "type": "text",
379
+ "primaryKey": false,
380
+ "notNull": false
381
+ },
382
+ "action_kind": {
383
+ "name": "action_kind",
384
+ "type": "text",
385
+ "primaryKey": false,
386
+ "notNull": true
387
+ },
388
+ "provider_action_id": {
389
+ "name": "provider_action_id",
390
+ "type": "text",
391
+ "primaryKey": false,
392
+ "notNull": false
393
+ },
394
+ "status": {
395
+ "name": "status",
396
+ "type": "text",
397
+ "primaryKey": false,
398
+ "notNull": true,
399
+ "default": "'pending'"
400
+ },
401
+ "attempts": {
402
+ "name": "attempts",
403
+ "type": "integer",
404
+ "primaryKey": false,
405
+ "notNull": true,
406
+ "default": 0
407
+ },
408
+ "error_message": {
409
+ "name": "error_message",
410
+ "type": "text",
411
+ "primaryKey": false,
412
+ "notNull": false
413
+ },
414
+ "result_payload": {
415
+ "name": "result_payload",
416
+ "type": "jsonb",
417
+ "primaryKey": false,
418
+ "notNull": false
419
+ },
420
+ "started_at": {
421
+ "name": "started_at",
422
+ "type": "timestamp",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "default": "now()"
426
+ },
427
+ "finished_at": {
428
+ "name": "finished_at",
429
+ "type": "timestamp",
430
+ "primaryKey": false,
431
+ "notNull": false
432
+ }
433
+ },
434
+ "indexes": {
435
+ "automation_run_steps_run_idx": {
436
+ "name": "automation_run_steps_run_idx",
437
+ "columns": [
438
+ {
439
+ "expression": "run_id",
440
+ "isExpression": false,
441
+ "asc": true,
442
+ "nulls": "last"
443
+ }
444
+ ],
445
+ "isUnique": false,
446
+ "concurrently": false,
447
+ "method": "btree",
448
+ "with": {}
449
+ }
450
+ },
451
+ "foreignKeys": {
452
+ "automation_run_steps_run_id_automation_runs_id_fk": {
453
+ "name": "automation_run_steps_run_id_automation_runs_id_fk",
454
+ "tableFrom": "automation_run_steps",
455
+ "tableTo": "automation_runs",
456
+ "columnsFrom": [
457
+ "run_id"
458
+ ],
459
+ "columnsTo": [
460
+ "id"
461
+ ],
462
+ "onDelete": "cascade",
463
+ "onUpdate": "no action"
464
+ }
465
+ },
466
+ "compositePrimaryKeys": {},
467
+ "uniqueConstraints": {},
468
+ "policies": {},
469
+ "checkConstraints": {},
470
+ "isRLSEnabled": false
471
+ },
472
+ "public.automation_runs": {
473
+ "name": "automation_runs",
474
+ "schema": "",
475
+ "columns": {
476
+ "id": {
477
+ "name": "id",
478
+ "type": "text",
479
+ "primaryKey": true,
480
+ "notNull": true
481
+ },
482
+ "automation_id": {
483
+ "name": "automation_id",
484
+ "type": "text",
485
+ "primaryKey": false,
486
+ "notNull": true
487
+ },
488
+ "trigger_id": {
489
+ "name": "trigger_id",
490
+ "type": "text",
491
+ "primaryKey": false,
492
+ "notNull": true
493
+ },
494
+ "trigger_event_id": {
495
+ "name": "trigger_event_id",
496
+ "type": "text",
497
+ "primaryKey": false,
498
+ "notNull": true
499
+ },
500
+ "trigger_payload": {
501
+ "name": "trigger_payload",
502
+ "type": "jsonb",
503
+ "primaryKey": false,
504
+ "notNull": true
505
+ },
506
+ "context_key": {
507
+ "name": "context_key",
508
+ "type": "text",
509
+ "primaryKey": false,
510
+ "notNull": false
511
+ },
512
+ "status": {
513
+ "name": "status",
514
+ "type": "text",
515
+ "primaryKey": false,
516
+ "notNull": true,
517
+ "default": "'pending'"
518
+ },
519
+ "error_message": {
520
+ "name": "error_message",
521
+ "type": "text",
522
+ "primaryKey": false,
523
+ "notNull": false
524
+ },
525
+ "started_at": {
526
+ "name": "started_at",
527
+ "type": "timestamp",
528
+ "primaryKey": false,
529
+ "notNull": true,
530
+ "default": "now()"
531
+ },
532
+ "finished_at": {
533
+ "name": "finished_at",
534
+ "type": "timestamp",
535
+ "primaryKey": false,
536
+ "notNull": false
537
+ }
538
+ },
539
+ "indexes": {
540
+ "automation_runs_automation_idx": {
541
+ "name": "automation_runs_automation_idx",
542
+ "columns": [
543
+ {
544
+ "expression": "automation_id",
545
+ "isExpression": false,
546
+ "asc": true,
547
+ "nulls": "last"
548
+ },
549
+ {
550
+ "expression": "started_at",
551
+ "isExpression": false,
552
+ "asc": true,
553
+ "nulls": "last"
554
+ }
555
+ ],
556
+ "isUnique": false,
557
+ "concurrently": false,
558
+ "method": "btree",
559
+ "with": {}
560
+ },
561
+ "automation_runs_status_idx": {
562
+ "name": "automation_runs_status_idx",
563
+ "columns": [
564
+ {
565
+ "expression": "status",
566
+ "isExpression": false,
567
+ "asc": true,
568
+ "nulls": "last"
569
+ }
570
+ ],
571
+ "isUnique": false,
572
+ "concurrently": false,
573
+ "method": "btree",
574
+ "with": {}
575
+ },
576
+ "automation_runs_context_key_idx": {
577
+ "name": "automation_runs_context_key_idx",
578
+ "columns": [
579
+ {
580
+ "expression": "automation_id",
581
+ "isExpression": false,
582
+ "asc": true,
583
+ "nulls": "last"
584
+ },
585
+ {
586
+ "expression": "context_key",
587
+ "isExpression": false,
588
+ "asc": true,
589
+ "nulls": "last"
590
+ }
591
+ ],
592
+ "isUnique": false,
593
+ "concurrently": false,
594
+ "method": "btree",
595
+ "with": {}
596
+ }
597
+ },
598
+ "foreignKeys": {
599
+ "automation_runs_automation_id_automations_id_fk": {
600
+ "name": "automation_runs_automation_id_automations_id_fk",
601
+ "tableFrom": "automation_runs",
602
+ "tableTo": "automations",
603
+ "columnsFrom": [
604
+ "automation_id"
605
+ ],
606
+ "columnsTo": [
607
+ "id"
608
+ ],
609
+ "onDelete": "cascade",
610
+ "onUpdate": "no action"
611
+ }
612
+ },
613
+ "compositePrimaryKeys": {},
614
+ "uniqueConstraints": {},
615
+ "policies": {},
616
+ "checkConstraints": {},
617
+ "isRLSEnabled": false
618
+ },
619
+ "public.automation_wait_locks": {
620
+ "name": "automation_wait_locks",
621
+ "schema": "",
622
+ "columns": {
623
+ "id": {
624
+ "name": "id",
625
+ "type": "text",
626
+ "primaryKey": true,
627
+ "notNull": true
628
+ },
629
+ "run_id": {
630
+ "name": "run_id",
631
+ "type": "text",
632
+ "primaryKey": false,
633
+ "notNull": true
634
+ },
635
+ "action_path": {
636
+ "name": "action_path",
637
+ "type": "text",
638
+ "primaryKey": false,
639
+ "notNull": true
640
+ },
641
+ "kind": {
642
+ "name": "kind",
643
+ "type": "text",
644
+ "primaryKey": false,
645
+ "notNull": true,
646
+ "default": "'trigger'"
647
+ },
648
+ "event_id": {
649
+ "name": "event_id",
650
+ "type": "text",
651
+ "primaryKey": false,
652
+ "notNull": true
653
+ },
654
+ "context_key": {
655
+ "name": "context_key",
656
+ "type": "text",
657
+ "primaryKey": false,
658
+ "notNull": false
659
+ },
660
+ "filter_template": {
661
+ "name": "filter_template",
662
+ "type": "text",
663
+ "primaryKey": false,
664
+ "notNull": false
665
+ },
666
+ "timeout_at": {
667
+ "name": "timeout_at",
668
+ "type": "timestamp",
669
+ "primaryKey": false,
670
+ "notNull": false
671
+ },
672
+ "created_at": {
673
+ "name": "created_at",
674
+ "type": "timestamp",
675
+ "primaryKey": false,
676
+ "notNull": true,
677
+ "default": "now()"
678
+ }
679
+ },
680
+ "indexes": {
681
+ "automation_wait_locks_event_lookup_idx": {
682
+ "name": "automation_wait_locks_event_lookup_idx",
683
+ "columns": [
684
+ {
685
+ "expression": "event_id",
686
+ "isExpression": false,
687
+ "asc": true,
688
+ "nulls": "last"
689
+ },
690
+ {
691
+ "expression": "context_key",
692
+ "isExpression": false,
693
+ "asc": true,
694
+ "nulls": "last"
695
+ }
696
+ ],
697
+ "isUnique": false,
698
+ "concurrently": false,
699
+ "method": "btree",
700
+ "with": {}
701
+ },
702
+ "automation_wait_locks_timeout_idx": {
703
+ "name": "automation_wait_locks_timeout_idx",
704
+ "columns": [
705
+ {
706
+ "expression": "timeout_at",
707
+ "isExpression": false,
708
+ "asc": true,
709
+ "nulls": "last"
710
+ }
711
+ ],
712
+ "isUnique": false,
713
+ "concurrently": false,
714
+ "method": "btree",
715
+ "with": {}
716
+ },
717
+ "automation_wait_locks_run_idx": {
718
+ "name": "automation_wait_locks_run_idx",
719
+ "columns": [
720
+ {
721
+ "expression": "run_id",
722
+ "isExpression": false,
723
+ "asc": true,
724
+ "nulls": "last"
725
+ }
726
+ ],
727
+ "isUnique": false,
728
+ "concurrently": false,
729
+ "method": "btree",
730
+ "with": {}
731
+ }
732
+ },
733
+ "foreignKeys": {
734
+ "automation_wait_locks_run_id_automation_runs_id_fk": {
735
+ "name": "automation_wait_locks_run_id_automation_runs_id_fk",
736
+ "tableFrom": "automation_wait_locks",
737
+ "tableTo": "automation_runs",
738
+ "columnsFrom": [
739
+ "run_id"
740
+ ],
741
+ "columnsTo": [
742
+ "id"
743
+ ],
744
+ "onDelete": "cascade",
745
+ "onUpdate": "no action"
746
+ }
747
+ },
748
+ "compositePrimaryKeys": {},
749
+ "uniqueConstraints": {},
750
+ "policies": {},
751
+ "checkConstraints": {},
752
+ "isRLSEnabled": false
753
+ },
754
+ "public.automations": {
755
+ "name": "automations",
756
+ "schema": "",
757
+ "columns": {
758
+ "id": {
759
+ "name": "id",
760
+ "type": "text",
761
+ "primaryKey": true,
762
+ "notNull": true
763
+ },
764
+ "name": {
765
+ "name": "name",
766
+ "type": "text",
767
+ "primaryKey": false,
768
+ "notNull": true
769
+ },
770
+ "description": {
771
+ "name": "description",
772
+ "type": "text",
773
+ "primaryKey": false,
774
+ "notNull": false
775
+ },
776
+ "status": {
777
+ "name": "status",
778
+ "type": "text",
779
+ "primaryKey": false,
780
+ "notNull": true,
781
+ "default": "'enabled'"
782
+ },
783
+ "definition": {
784
+ "name": "definition",
785
+ "type": "jsonb",
786
+ "primaryKey": false,
787
+ "notNull": true
788
+ },
789
+ "managed_by": {
790
+ "name": "managed_by",
791
+ "type": "text",
792
+ "primaryKey": false,
793
+ "notNull": false
794
+ },
795
+ "created_at": {
796
+ "name": "created_at",
797
+ "type": "timestamp",
798
+ "primaryKey": false,
799
+ "notNull": true,
800
+ "default": "now()"
801
+ },
802
+ "updated_at": {
803
+ "name": "updated_at",
804
+ "type": "timestamp",
805
+ "primaryKey": false,
806
+ "notNull": true,
807
+ "default": "now()"
808
+ }
809
+ },
810
+ "indexes": {
811
+ "automations_status_idx": {
812
+ "name": "automations_status_idx",
813
+ "columns": [
814
+ {
815
+ "expression": "status",
816
+ "isExpression": false,
817
+ "asc": true,
818
+ "nulls": "last"
819
+ }
820
+ ],
821
+ "isUnique": false,
822
+ "concurrently": false,
823
+ "method": "btree",
824
+ "with": {}
825
+ },
826
+ "automations_managed_by_idx": {
827
+ "name": "automations_managed_by_idx",
828
+ "columns": [
829
+ {
830
+ "expression": "managed_by",
831
+ "isExpression": false,
832
+ "asc": true,
833
+ "nulls": "last"
834
+ }
835
+ ],
836
+ "isUnique": false,
837
+ "concurrently": false,
838
+ "method": "btree",
839
+ "with": {}
840
+ }
841
+ },
842
+ "foreignKeys": {},
843
+ "compositePrimaryKeys": {},
844
+ "uniqueConstraints": {},
845
+ "policies": {},
846
+ "checkConstraints": {},
847
+ "isRLSEnabled": false
848
+ }
849
+ },
850
+ "enums": {},
851
+ "schemas": {},
852
+ "sequences": {},
853
+ "roles": {},
854
+ "policies": {},
855
+ "views": {},
856
+ "_meta": {
857
+ "columns": {},
858
+ "schemas": {},
859
+ "tables": {}
860
+ }
861
+ }