notifkit 0.1.3 → 0.1.5

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 (96) hide show
  1. package/README.md +179 -152
  2. package/dist/index.d.mts +193 -129
  3. package/dist/index.d.mts.map +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/{main-DtHWhueo.mjs → main-40zwq6b0.mjs} +28 -3
  7. package/dist/{main-DtHWhueo.mjs.map → main-40zwq6b0.mjs.map} +1 -1
  8. package/dist/{main-DyfbnJc3.mjs → main-BFre2-HQ.mjs} +2 -2
  9. package/dist/{main-DyfbnJc3.mjs.map → main-BFre2-HQ.mjs.map} +1 -1
  10. package/dist/{main-CAH0_Q6d.mjs → main-BNJtzY61.mjs} +3 -3
  11. package/dist/main-BNJtzY61.mjs.map +1 -0
  12. package/dist/{main-B561M1d3.mjs → main-BOPMYqsW.mjs} +2 -2
  13. package/dist/{main-B561M1d3.mjs.map → main-BOPMYqsW.mjs.map} +1 -1
  14. package/dist/{main-CCfc45ev.mjs → main-CiigNpsP.mjs} +7 -4
  15. package/dist/main-CiigNpsP.mjs.map +1 -0
  16. package/dist/{main-Ce9dcrsg.mjs → main-DeNFQ-UL.mjs} +6 -3
  17. package/dist/{main-Ce9dcrsg.mjs.map → main-DeNFQ-UL.mjs.map} +1 -1
  18. package/dist/{main-B-jwm8ED.mjs → main-DmCPcxOc.mjs} +2 -2
  19. package/dist/{main-B-jwm8ED.mjs.map → main-DmCPcxOc.mjs.map} +1 -1
  20. package/dist/{main-C45e7grq.mjs → main-DvgJSm11.mjs} +2 -2
  21. package/dist/{main-C45e7grq.mjs.map → main-DvgJSm11.mjs.map} +1 -1
  22. package/dist/{src-C-PfEDMY.mjs → src-vG79L-8m.mjs} +57 -26
  23. package/dist/src-vG79L-8m.mjs.map +1 -0
  24. package/drizzle/0002_wide_colleen_wing.sql +2 -0
  25. package/drizzle/0003_skinny_daimon_hellstrom.sql +1 -0
  26. package/drizzle/0004_pretty_bruce_banner.sql +1 -0
  27. package/drizzle/meta/0002_snapshot.json +1460 -0
  28. package/drizzle/meta/0003_snapshot.json +1460 -0
  29. package/drizzle/meta/0004_snapshot.json +1470 -0
  30. package/drizzle/meta/_journal.json +21 -0
  31. package/package.json +7 -1
  32. package/scripts/create-project.mjs +61 -0
  33. package/src/client.ts +412 -0
  34. package/src/config/index.ts +107 -0
  35. package/src/contracts/common.ts +28 -0
  36. package/src/contracts/envelope.ts +31 -0
  37. package/src/contracts/events/notification-ai-pending.ts +18 -0
  38. package/src/contracts/events/notification-canceled.ts +7 -0
  39. package/src/contracts/events/notification-created.ts +14 -0
  40. package/src/contracts/events/notification-delivered.ts +17 -0
  41. package/src/contracts/events/notification-dispatched.ts +45 -0
  42. package/src/contracts/events/notification-enriched.ts +46 -0
  43. package/src/contracts/events/notification-failed.ts +19 -0
  44. package/src/contracts/events/notification-requested.ts +36 -0
  45. package/src/contracts/events/notification-scheduled.ts +9 -0
  46. package/src/contracts/events/notification-skipped.ts +9 -0
  47. package/src/contracts/helpers.ts +21 -0
  48. package/src/contracts/index.ts +46 -0
  49. package/src/contracts/metadata.ts +10 -0
  50. package/src/contracts/registry.ts +88 -0
  51. package/src/contracts/sdk.ts +242 -0
  52. package/src/contracts/streams.ts +62 -0
  53. package/src/db/index.ts +69 -0
  54. package/src/db/schema.ts +412 -0
  55. package/src/idempotency/index.ts +50 -0
  56. package/src/index.ts +19 -0
  57. package/src/logger/index.ts +60 -0
  58. package/src/metrics/index.ts +53 -0
  59. package/src/queue/index.ts +501 -0
  60. package/src/rate-limiter/index.ts +210 -0
  61. package/src/redis/index.ts +89 -0
  62. package/src/repositories/index.ts +1246 -0
  63. package/src/server.ts +277 -0
  64. package/src/services/ai/main.ts +404 -0
  65. package/src/services/api/handlers.ts +1734 -0
  66. package/src/services/api/http.ts +64 -0
  67. package/src/services/api/main.ts +693 -0
  68. package/src/services/api/router.ts +82 -0
  69. package/src/services/delivery/main.ts +842 -0
  70. package/src/services/delivery/throttle.ts +71 -0
  71. package/src/services/engine/main.ts +827 -0
  72. package/src/services/enricher/main.ts +594 -0
  73. package/src/services/events/main.ts +365 -0
  74. package/src/services/scheduler/main.ts +319 -0
  75. package/src/services/workflow/main.ts +627 -0
  76. package/src/shared/batch-processor.ts +67 -0
  77. package/src/shared/cache.ts +47 -0
  78. package/src/shared/circuit-breaker.ts +74 -0
  79. package/src/shared/dataloader.ts +41 -0
  80. package/src/shared/events.ts +3 -0
  81. package/src/shared/index.ts +39 -0
  82. package/src/shared/semaphore.ts +33 -0
  83. package/src/shared/utils.ts +64 -0
  84. package/src/templates/cache.ts +32 -0
  85. package/src/templates/index.ts +69 -0
  86. package/src/templates/render.ts +128 -0
  87. package/src/transport/index.ts +96 -0
  88. package/src/unsubscribe/index.ts +127 -0
  89. package/src/workers/health.ts +31 -0
  90. package/src/workers/index.ts +266 -0
  91. package/src/workflows/index.ts +2 -0
  92. package/src/workflows/registry.ts +21 -0
  93. package/src/workflows/sdk.ts +106 -0
  94. package/dist/main-CAH0_Q6d.mjs.map +0 -1
  95. package/dist/main-CCfc45ev.mjs.map +0 -1
  96. package/dist/src-C-PfEDMY.mjs.map +0 -1
@@ -0,0 +1,1460 @@
1
+ {
2
+ "id": "2ea4a642-dd6c-4f2a-8b2d-e359335941a9",
3
+ "prevId": "b2263eab-f6fb-46ed-863e-000e5a580f9d",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.contact_topic_preferences": {
8
+ "name": "contact_topic_preferences",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "contact_id": {
19
+ "name": "contact_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "topic": {
25
+ "name": "topic",
26
+ "type": "varchar",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "enabled": {
31
+ "name": "enabled",
32
+ "type": "boolean",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ }
36
+ },
37
+ "indexes": {},
38
+ "foreignKeys": {
39
+ "contact_topic_preferences_contact_id_user_contacts_id_fk": {
40
+ "name": "contact_topic_preferences_contact_id_user_contacts_id_fk",
41
+ "tableFrom": "contact_topic_preferences",
42
+ "tableTo": "user_contacts",
43
+ "columnsFrom": ["contact_id"],
44
+ "columnsTo": ["id"],
45
+ "onDelete": "cascade",
46
+ "onUpdate": "no action"
47
+ }
48
+ },
49
+ "compositePrimaryKeys": {},
50
+ "uniqueConstraints": {
51
+ "contact_topic_preferences_contact_id_topic_unique": {
52
+ "name": "contact_topic_preferences_contact_id_topic_unique",
53
+ "nullsNotDistinct": false,
54
+ "columns": ["contact_id", "topic"]
55
+ }
56
+ },
57
+ "policies": {},
58
+ "checkConstraints": {},
59
+ "isRLSEnabled": false
60
+ },
61
+ "public.delivery_outbox": {
62
+ "name": "delivery_outbox",
63
+ "schema": "",
64
+ "columns": {
65
+ "task_id": {
66
+ "name": "task_id",
67
+ "type": "varchar",
68
+ "primaryKey": false,
69
+ "notNull": true
70
+ },
71
+ "channel": {
72
+ "name": "channel",
73
+ "type": "channel",
74
+ "typeSchema": "public",
75
+ "primaryKey": false,
76
+ "notNull": true
77
+ },
78
+ "destination": {
79
+ "name": "destination",
80
+ "type": "text",
81
+ "primaryKey": false,
82
+ "notNull": true
83
+ },
84
+ "provider_message_id": {
85
+ "name": "provider_message_id",
86
+ "type": "varchar",
87
+ "primaryKey": false,
88
+ "notNull": false
89
+ },
90
+ "created_at": {
91
+ "name": "created_at",
92
+ "type": "timestamp with time zone",
93
+ "primaryKey": false,
94
+ "notNull": true,
95
+ "default": "now()"
96
+ }
97
+ },
98
+ "indexes": {},
99
+ "foreignKeys": {},
100
+ "compositePrimaryKeys": {
101
+ "delivery_outbox_task_id_channel_destination_pk": {
102
+ "name": "delivery_outbox_task_id_channel_destination_pk",
103
+ "columns": ["task_id", "channel", "destination"]
104
+ }
105
+ },
106
+ "uniqueConstraints": {},
107
+ "policies": {},
108
+ "checkConstraints": {},
109
+ "isRLSEnabled": false
110
+ },
111
+ "public.message_logs": {
112
+ "name": "message_logs",
113
+ "schema": "",
114
+ "columns": {
115
+ "id": {
116
+ "name": "id",
117
+ "type": "uuid",
118
+ "primaryKey": true,
119
+ "notNull": true,
120
+ "default": "gen_random_uuid()"
121
+ },
122
+ "project_id": {
123
+ "name": "project_id",
124
+ "type": "uuid",
125
+ "primaryKey": false,
126
+ "notNull": true
127
+ },
128
+ "task_id": {
129
+ "name": "task_id",
130
+ "type": "varchar",
131
+ "primaryKey": false,
132
+ "notNull": true
133
+ },
134
+ "provider_message_id": {
135
+ "name": "provider_message_id",
136
+ "type": "varchar",
137
+ "primaryKey": false,
138
+ "notNull": false
139
+ },
140
+ "template_id": {
141
+ "name": "template_id",
142
+ "type": "varchar",
143
+ "primaryKey": false,
144
+ "notNull": false
145
+ },
146
+ "workflow_instance_id": {
147
+ "name": "workflow_instance_id",
148
+ "type": "uuid",
149
+ "primaryKey": false,
150
+ "notNull": false
151
+ },
152
+ "channel": {
153
+ "name": "channel",
154
+ "type": "channel",
155
+ "typeSchema": "public",
156
+ "primaryKey": false,
157
+ "notNull": true
158
+ },
159
+ "attempt": {
160
+ "name": "attempt",
161
+ "type": "integer",
162
+ "primaryKey": false,
163
+ "notNull": true,
164
+ "default": 1
165
+ },
166
+ "kind": {
167
+ "name": "kind",
168
+ "type": "varchar",
169
+ "primaryKey": false,
170
+ "notNull": true,
171
+ "default": "'attempt'"
172
+ },
173
+ "status": {
174
+ "name": "status",
175
+ "type": "varchar",
176
+ "primaryKey": false,
177
+ "notNull": true
178
+ },
179
+ "campaign_id": {
180
+ "name": "campaign_id",
181
+ "type": "varchar",
182
+ "primaryKey": false,
183
+ "notNull": false
184
+ },
185
+ "metadata": {
186
+ "name": "metadata",
187
+ "type": "jsonb",
188
+ "primaryKey": false,
189
+ "notNull": false
190
+ },
191
+ "timestamp": {
192
+ "name": "timestamp",
193
+ "type": "timestamp with time zone",
194
+ "primaryKey": false,
195
+ "notNull": true,
196
+ "default": "now()"
197
+ }
198
+ },
199
+ "indexes": {
200
+ "message_logs_project_idx": {
201
+ "name": "message_logs_project_idx",
202
+ "columns": [
203
+ {
204
+ "expression": "project_id",
205
+ "isExpression": false,
206
+ "asc": true,
207
+ "nulls": "last"
208
+ }
209
+ ],
210
+ "isUnique": false,
211
+ "concurrently": false,
212
+ "method": "btree",
213
+ "with": {}
214
+ },
215
+ "task_idx": {
216
+ "name": "task_idx",
217
+ "columns": [
218
+ {
219
+ "expression": "task_id",
220
+ "isExpression": false,
221
+ "asc": true,
222
+ "nulls": "last"
223
+ }
224
+ ],
225
+ "isUnique": false,
226
+ "concurrently": false,
227
+ "method": "btree",
228
+ "with": {}
229
+ },
230
+ "message_logs_project_task_idx": {
231
+ "name": "message_logs_project_task_idx",
232
+ "columns": [
233
+ {
234
+ "expression": "project_id",
235
+ "isExpression": false,
236
+ "asc": true,
237
+ "nulls": "last"
238
+ },
239
+ {
240
+ "expression": "task_id",
241
+ "isExpression": false,
242
+ "asc": true,
243
+ "nulls": "last"
244
+ }
245
+ ],
246
+ "isUnique": false,
247
+ "concurrently": false,
248
+ "method": "btree",
249
+ "with": {}
250
+ },
251
+ "provider_msg_idx": {
252
+ "name": "provider_msg_idx",
253
+ "columns": [
254
+ {
255
+ "expression": "provider_message_id",
256
+ "isExpression": false,
257
+ "asc": true,
258
+ "nulls": "last"
259
+ }
260
+ ],
261
+ "isUnique": false,
262
+ "concurrently": false,
263
+ "method": "btree",
264
+ "with": {}
265
+ },
266
+ "msg_log_proj_time_idx": {
267
+ "name": "msg_log_proj_time_idx",
268
+ "columns": [
269
+ {
270
+ "expression": "project_id",
271
+ "isExpression": false,
272
+ "asc": true,
273
+ "nulls": "last"
274
+ },
275
+ {
276
+ "expression": "timestamp",
277
+ "isExpression": false,
278
+ "asc": true,
279
+ "nulls": "last"
280
+ }
281
+ ],
282
+ "isUnique": false,
283
+ "concurrently": false,
284
+ "method": "btree",
285
+ "with": {}
286
+ },
287
+ "msg_log_template_idx": {
288
+ "name": "msg_log_template_idx",
289
+ "columns": [
290
+ {
291
+ "expression": "project_id",
292
+ "isExpression": false,
293
+ "asc": true,
294
+ "nulls": "last"
295
+ },
296
+ {
297
+ "expression": "template_id",
298
+ "isExpression": false,
299
+ "asc": true,
300
+ "nulls": "last"
301
+ }
302
+ ],
303
+ "isUnique": false,
304
+ "concurrently": false,
305
+ "method": "btree",
306
+ "with": {}
307
+ },
308
+ "msg_log_workflow_idx": {
309
+ "name": "msg_log_workflow_idx",
310
+ "columns": [
311
+ {
312
+ "expression": "project_id",
313
+ "isExpression": false,
314
+ "asc": true,
315
+ "nulls": "last"
316
+ },
317
+ {
318
+ "expression": "workflow_instance_id",
319
+ "isExpression": false,
320
+ "asc": true,
321
+ "nulls": "last"
322
+ }
323
+ ],
324
+ "isUnique": false,
325
+ "concurrently": false,
326
+ "method": "btree",
327
+ "with": {}
328
+ },
329
+ "msg_log_campaign_idx": {
330
+ "name": "msg_log_campaign_idx",
331
+ "columns": [
332
+ {
333
+ "expression": "project_id",
334
+ "isExpression": false,
335
+ "asc": true,
336
+ "nulls": "last"
337
+ },
338
+ {
339
+ "expression": "campaign_id",
340
+ "isExpression": false,
341
+ "asc": true,
342
+ "nulls": "last"
343
+ }
344
+ ],
345
+ "isUnique": false,
346
+ "concurrently": false,
347
+ "method": "btree",
348
+ "with": {}
349
+ }
350
+ },
351
+ "foreignKeys": {},
352
+ "compositePrimaryKeys": {},
353
+ "uniqueConstraints": {
354
+ "task_channel_attempt_uidx": {
355
+ "name": "task_channel_attempt_uidx",
356
+ "nullsNotDistinct": false,
357
+ "columns": ["task_id", "channel", "attempt", "kind"]
358
+ }
359
+ },
360
+ "policies": {},
361
+ "checkConstraints": {},
362
+ "isRLSEnabled": false
363
+ },
364
+ "public.project_api_keys": {
365
+ "name": "project_api_keys",
366
+ "schema": "",
367
+ "columns": {
368
+ "id": {
369
+ "name": "id",
370
+ "type": "uuid",
371
+ "primaryKey": true,
372
+ "notNull": true,
373
+ "default": "gen_random_uuid()"
374
+ },
375
+ "project_id": {
376
+ "name": "project_id",
377
+ "type": "uuid",
378
+ "primaryKey": false,
379
+ "notNull": true
380
+ },
381
+ "key_hash": {
382
+ "name": "key_hash",
383
+ "type": "varchar",
384
+ "primaryKey": false,
385
+ "notNull": true
386
+ },
387
+ "role": {
388
+ "name": "role",
389
+ "type": "api_key_role",
390
+ "typeSchema": "public",
391
+ "primaryKey": false,
392
+ "notNull": true,
393
+ "default": "'admin'"
394
+ },
395
+ "created_at": {
396
+ "name": "created_at",
397
+ "type": "timestamp with time zone",
398
+ "primaryKey": false,
399
+ "notNull": true,
400
+ "default": "now()"
401
+ }
402
+ },
403
+ "indexes": {},
404
+ "foreignKeys": {
405
+ "project_api_keys_project_id_projects_id_fk": {
406
+ "name": "project_api_keys_project_id_projects_id_fk",
407
+ "tableFrom": "project_api_keys",
408
+ "tableTo": "projects",
409
+ "columnsFrom": ["project_id"],
410
+ "columnsTo": ["id"],
411
+ "onDelete": "cascade",
412
+ "onUpdate": "no action"
413
+ }
414
+ },
415
+ "compositePrimaryKeys": {},
416
+ "uniqueConstraints": {
417
+ "project_api_keys_key_hash_unique": {
418
+ "name": "project_api_keys_key_hash_unique",
419
+ "nullsNotDistinct": false,
420
+ "columns": ["key_hash"]
421
+ }
422
+ },
423
+ "policies": {},
424
+ "checkConstraints": {},
425
+ "isRLSEnabled": false
426
+ },
427
+ "public.projects": {
428
+ "name": "projects",
429
+ "schema": "",
430
+ "columns": {
431
+ "id": {
432
+ "name": "id",
433
+ "type": "uuid",
434
+ "primaryKey": true,
435
+ "notNull": true,
436
+ "default": "gen_random_uuid()"
437
+ },
438
+ "name": {
439
+ "name": "name",
440
+ "type": "varchar",
441
+ "primaryKey": false,
442
+ "notNull": true
443
+ },
444
+ "rate_limit_rpm": {
445
+ "name": "rate_limit_rpm",
446
+ "type": "integer",
447
+ "primaryKey": false,
448
+ "notNull": false
449
+ },
450
+ "throttle_limit": {
451
+ "name": "throttle_limit",
452
+ "type": "integer",
453
+ "primaryKey": false,
454
+ "notNull": false
455
+ },
456
+ "throttle_window_hours": {
457
+ "name": "throttle_window_hours",
458
+ "type": "integer",
459
+ "primaryKey": false,
460
+ "notNull": false
461
+ },
462
+ "created_at": {
463
+ "name": "created_at",
464
+ "type": "timestamp with time zone",
465
+ "primaryKey": false,
466
+ "notNull": true,
467
+ "default": "now()"
468
+ }
469
+ },
470
+ "indexes": {},
471
+ "foreignKeys": {},
472
+ "compositePrimaryKeys": {},
473
+ "uniqueConstraints": {},
474
+ "policies": {},
475
+ "checkConstraints": {},
476
+ "isRLSEnabled": false
477
+ },
478
+ "public.quiet_hours": {
479
+ "name": "quiet_hours",
480
+ "schema": "",
481
+ "columns": {
482
+ "id": {
483
+ "name": "id",
484
+ "type": "uuid",
485
+ "primaryKey": true,
486
+ "notNull": true,
487
+ "default": "gen_random_uuid()"
488
+ },
489
+ "user_id": {
490
+ "name": "user_id",
491
+ "type": "uuid",
492
+ "primaryKey": false,
493
+ "notNull": false
494
+ },
495
+ "contact_id": {
496
+ "name": "contact_id",
497
+ "type": "uuid",
498
+ "primaryKey": false,
499
+ "notNull": false
500
+ },
501
+ "start_time": {
502
+ "name": "start_time",
503
+ "type": "time",
504
+ "primaryKey": false,
505
+ "notNull": true
506
+ },
507
+ "end_time": {
508
+ "name": "end_time",
509
+ "type": "time",
510
+ "primaryKey": false,
511
+ "notNull": true
512
+ }
513
+ },
514
+ "indexes": {
515
+ "quiet_hours_user_idx": {
516
+ "name": "quiet_hours_user_idx",
517
+ "columns": [
518
+ {
519
+ "expression": "user_id",
520
+ "isExpression": false,
521
+ "asc": true,
522
+ "nulls": "last"
523
+ }
524
+ ],
525
+ "isUnique": false,
526
+ "concurrently": false,
527
+ "method": "btree",
528
+ "with": {}
529
+ }
530
+ },
531
+ "foreignKeys": {
532
+ "quiet_hours_user_id_users_id_fk": {
533
+ "name": "quiet_hours_user_id_users_id_fk",
534
+ "tableFrom": "quiet_hours",
535
+ "tableTo": "users",
536
+ "columnsFrom": ["user_id"],
537
+ "columnsTo": ["id"],
538
+ "onDelete": "cascade",
539
+ "onUpdate": "no action"
540
+ },
541
+ "quiet_hours_contact_id_user_contacts_id_fk": {
542
+ "name": "quiet_hours_contact_id_user_contacts_id_fk",
543
+ "tableFrom": "quiet_hours",
544
+ "tableTo": "user_contacts",
545
+ "columnsFrom": ["contact_id"],
546
+ "columnsTo": ["id"],
547
+ "onDelete": "cascade",
548
+ "onUpdate": "no action"
549
+ }
550
+ },
551
+ "compositePrimaryKeys": {},
552
+ "uniqueConstraints": {},
553
+ "policies": {},
554
+ "checkConstraints": {
555
+ "check_owner": {
556
+ "name": "check_owner",
557
+ "value": "num_nonnulls(user_id, contact_id) = 1"
558
+ }
559
+ },
560
+ "isRLSEnabled": false
561
+ },
562
+ "public.scheduled_payloads": {
563
+ "name": "scheduled_payloads",
564
+ "schema": "",
565
+ "columns": {
566
+ "task_id": {
567
+ "name": "task_id",
568
+ "type": "varchar",
569
+ "primaryKey": true,
570
+ "notNull": true
571
+ },
572
+ "payload": {
573
+ "name": "payload",
574
+ "type": "jsonb",
575
+ "primaryKey": false,
576
+ "notNull": true
577
+ },
578
+ "created_at": {
579
+ "name": "created_at",
580
+ "type": "timestamp with time zone",
581
+ "primaryKey": false,
582
+ "notNull": true,
583
+ "default": "now()"
584
+ }
585
+ },
586
+ "indexes": {},
587
+ "foreignKeys": {},
588
+ "compositePrimaryKeys": {},
589
+ "uniqueConstraints": {},
590
+ "policies": {},
591
+ "checkConstraints": {},
592
+ "isRLSEnabled": false
593
+ },
594
+ "public.suppressions": {
595
+ "name": "suppressions",
596
+ "schema": "",
597
+ "columns": {
598
+ "id": {
599
+ "name": "id",
600
+ "type": "uuid",
601
+ "primaryKey": true,
602
+ "notNull": true,
603
+ "default": "gen_random_uuid()"
604
+ },
605
+ "project_id": {
606
+ "name": "project_id",
607
+ "type": "uuid",
608
+ "primaryKey": false,
609
+ "notNull": true
610
+ },
611
+ "channel": {
612
+ "name": "channel",
613
+ "type": "channel",
614
+ "typeSchema": "public",
615
+ "primaryKey": false,
616
+ "notNull": true
617
+ },
618
+ "target": {
619
+ "name": "target",
620
+ "type": "varchar",
621
+ "primaryKey": false,
622
+ "notNull": true
623
+ },
624
+ "reason": {
625
+ "name": "reason",
626
+ "type": "varchar",
627
+ "primaryKey": false,
628
+ "notNull": true
629
+ },
630
+ "source": {
631
+ "name": "source",
632
+ "type": "varchar",
633
+ "primaryKey": false,
634
+ "notNull": false
635
+ },
636
+ "task_id": {
637
+ "name": "task_id",
638
+ "type": "varchar",
639
+ "primaryKey": false,
640
+ "notNull": false
641
+ },
642
+ "created_at": {
643
+ "name": "created_at",
644
+ "type": "timestamp with time zone",
645
+ "primaryKey": false,
646
+ "notNull": true,
647
+ "default": "now()"
648
+ }
649
+ },
650
+ "indexes": {
651
+ "suppression_project_idx": {
652
+ "name": "suppression_project_idx",
653
+ "columns": [
654
+ {
655
+ "expression": "project_id",
656
+ "isExpression": false,
657
+ "asc": true,
658
+ "nulls": "last"
659
+ }
660
+ ],
661
+ "isUnique": false,
662
+ "concurrently": false,
663
+ "method": "btree",
664
+ "with": {}
665
+ },
666
+ "suppression_lookup_idx": {
667
+ "name": "suppression_lookup_idx",
668
+ "columns": [
669
+ {
670
+ "expression": "project_id",
671
+ "isExpression": false,
672
+ "asc": true,
673
+ "nulls": "last"
674
+ },
675
+ {
676
+ "expression": "channel",
677
+ "isExpression": false,
678
+ "asc": true,
679
+ "nulls": "last"
680
+ },
681
+ {
682
+ "expression": "target",
683
+ "isExpression": false,
684
+ "asc": true,
685
+ "nulls": "last"
686
+ }
687
+ ],
688
+ "isUnique": false,
689
+ "concurrently": false,
690
+ "method": "btree",
691
+ "with": {}
692
+ }
693
+ },
694
+ "foreignKeys": {},
695
+ "compositePrimaryKeys": {},
696
+ "uniqueConstraints": {
697
+ "suppression_project_channel_target_uidx": {
698
+ "name": "suppression_project_channel_target_uidx",
699
+ "nullsNotDistinct": false,
700
+ "columns": ["project_id", "channel", "target"]
701
+ }
702
+ },
703
+ "policies": {},
704
+ "checkConstraints": {},
705
+ "isRLSEnabled": false
706
+ },
707
+ "public.templates": {
708
+ "name": "templates",
709
+ "schema": "",
710
+ "columns": {
711
+ "project_id": {
712
+ "name": "project_id",
713
+ "type": "uuid",
714
+ "primaryKey": false,
715
+ "notNull": true
716
+ },
717
+ "id": {
718
+ "name": "id",
719
+ "type": "varchar",
720
+ "primaryKey": false,
721
+ "notNull": true
722
+ },
723
+ "channel": {
724
+ "name": "channel",
725
+ "type": "channel",
726
+ "typeSchema": "public",
727
+ "primaryKey": false,
728
+ "notNull": true
729
+ },
730
+ "topics": {
731
+ "name": "topics",
732
+ "type": "text[]",
733
+ "primaryKey": false,
734
+ "notNull": true
735
+ },
736
+ "content": {
737
+ "name": "content",
738
+ "type": "jsonb",
739
+ "primaryKey": false,
740
+ "notNull": true
741
+ },
742
+ "ai_prompts": {
743
+ "name": "ai_prompts",
744
+ "type": "jsonb",
745
+ "primaryKey": false,
746
+ "notNull": false
747
+ },
748
+ "updated_at": {
749
+ "name": "updated_at",
750
+ "type": "timestamp with time zone",
751
+ "primaryKey": false,
752
+ "notNull": true,
753
+ "default": "now()"
754
+ }
755
+ },
756
+ "indexes": {},
757
+ "foreignKeys": {
758
+ "templates_project_id_projects_id_fk": {
759
+ "name": "templates_project_id_projects_id_fk",
760
+ "tableFrom": "templates",
761
+ "tableTo": "projects",
762
+ "columnsFrom": ["project_id"],
763
+ "columnsTo": ["id"],
764
+ "onDelete": "cascade",
765
+ "onUpdate": "no action"
766
+ }
767
+ },
768
+ "compositePrimaryKeys": {
769
+ "templates_project_id_id_pk": {
770
+ "name": "templates_project_id_id_pk",
771
+ "columns": ["project_id", "id"]
772
+ }
773
+ },
774
+ "uniqueConstraints": {},
775
+ "policies": {},
776
+ "checkConstraints": {},
777
+ "isRLSEnabled": false
778
+ },
779
+ "public.user_channel_preferences": {
780
+ "name": "user_channel_preferences",
781
+ "schema": "",
782
+ "columns": {
783
+ "user_id": {
784
+ "name": "user_id",
785
+ "type": "uuid",
786
+ "primaryKey": false,
787
+ "notNull": true
788
+ },
789
+ "channel": {
790
+ "name": "channel",
791
+ "type": "channel",
792
+ "typeSchema": "public",
793
+ "primaryKey": false,
794
+ "notNull": true
795
+ },
796
+ "enabled": {
797
+ "name": "enabled",
798
+ "type": "boolean",
799
+ "primaryKey": false,
800
+ "notNull": true
801
+ }
802
+ },
803
+ "indexes": {},
804
+ "foreignKeys": {
805
+ "user_channel_preferences_user_id_users_id_fk": {
806
+ "name": "user_channel_preferences_user_id_users_id_fk",
807
+ "tableFrom": "user_channel_preferences",
808
+ "tableTo": "users",
809
+ "columnsFrom": ["user_id"],
810
+ "columnsTo": ["id"],
811
+ "onDelete": "cascade",
812
+ "onUpdate": "no action"
813
+ }
814
+ },
815
+ "compositePrimaryKeys": {
816
+ "user_channel_preferences_user_id_channel_pk": {
817
+ "name": "user_channel_preferences_user_id_channel_pk",
818
+ "columns": ["user_id", "channel"]
819
+ }
820
+ },
821
+ "uniqueConstraints": {},
822
+ "policies": {},
823
+ "checkConstraints": {},
824
+ "isRLSEnabled": false
825
+ },
826
+ "public.user_contacts": {
827
+ "name": "user_contacts",
828
+ "schema": "",
829
+ "columns": {
830
+ "id": {
831
+ "name": "id",
832
+ "type": "uuid",
833
+ "primaryKey": true,
834
+ "notNull": true,
835
+ "default": "gen_random_uuid()"
836
+ },
837
+ "user_id": {
838
+ "name": "user_id",
839
+ "type": "uuid",
840
+ "primaryKey": false,
841
+ "notNull": true
842
+ },
843
+ "channel": {
844
+ "name": "channel",
845
+ "type": "channel",
846
+ "typeSchema": "public",
847
+ "primaryKey": false,
848
+ "notNull": true
849
+ },
850
+ "target": {
851
+ "name": "target",
852
+ "type": "text",
853
+ "primaryKey": false,
854
+ "notNull": true
855
+ },
856
+ "label": {
857
+ "name": "label",
858
+ "type": "text",
859
+ "primaryKey": false,
860
+ "notNull": false
861
+ },
862
+ "is_primary": {
863
+ "name": "is_primary",
864
+ "type": "boolean",
865
+ "primaryKey": false,
866
+ "notNull": true,
867
+ "default": false
868
+ },
869
+ "enabled": {
870
+ "name": "enabled",
871
+ "type": "boolean",
872
+ "primaryKey": false,
873
+ "notNull": true,
874
+ "default": true
875
+ },
876
+ "created_at": {
877
+ "name": "created_at",
878
+ "type": "timestamp with time zone",
879
+ "primaryKey": false,
880
+ "notNull": true,
881
+ "default": "now()"
882
+ }
883
+ },
884
+ "indexes": {},
885
+ "foreignKeys": {
886
+ "user_contacts_user_id_users_id_fk": {
887
+ "name": "user_contacts_user_id_users_id_fk",
888
+ "tableFrom": "user_contacts",
889
+ "tableTo": "users",
890
+ "columnsFrom": ["user_id"],
891
+ "columnsTo": ["id"],
892
+ "onDelete": "cascade",
893
+ "onUpdate": "no action"
894
+ }
895
+ },
896
+ "compositePrimaryKeys": {},
897
+ "uniqueConstraints": {
898
+ "user_contacts_user_id_channel_target_unique": {
899
+ "name": "user_contacts_user_id_channel_target_unique",
900
+ "nullsNotDistinct": false,
901
+ "columns": ["user_id", "channel", "target"]
902
+ }
903
+ },
904
+ "policies": {},
905
+ "checkConstraints": {},
906
+ "isRLSEnabled": false
907
+ },
908
+ "public.user_segments": {
909
+ "name": "user_segments",
910
+ "schema": "",
911
+ "columns": {
912
+ "id": {
913
+ "name": "id",
914
+ "type": "uuid",
915
+ "primaryKey": true,
916
+ "notNull": true,
917
+ "default": "gen_random_uuid()"
918
+ },
919
+ "user_id": {
920
+ "name": "user_id",
921
+ "type": "uuid",
922
+ "primaryKey": false,
923
+ "notNull": true
924
+ },
925
+ "segment": {
926
+ "name": "segment",
927
+ "type": "varchar",
928
+ "primaryKey": false,
929
+ "notNull": true
930
+ }
931
+ },
932
+ "indexes": {
933
+ "segment_idx": {
934
+ "name": "segment_idx",
935
+ "columns": [
936
+ {
937
+ "expression": "segment",
938
+ "isExpression": false,
939
+ "asc": true,
940
+ "nulls": "last"
941
+ }
942
+ ],
943
+ "isUnique": false,
944
+ "concurrently": false,
945
+ "method": "btree",
946
+ "with": {}
947
+ }
948
+ },
949
+ "foreignKeys": {
950
+ "user_segments_user_id_users_id_fk": {
951
+ "name": "user_segments_user_id_users_id_fk",
952
+ "tableFrom": "user_segments",
953
+ "tableTo": "users",
954
+ "columnsFrom": ["user_id"],
955
+ "columnsTo": ["id"],
956
+ "onDelete": "cascade",
957
+ "onUpdate": "no action"
958
+ }
959
+ },
960
+ "compositePrimaryKeys": {},
961
+ "uniqueConstraints": {
962
+ "user_segments_user_id_segment_unique": {
963
+ "name": "user_segments_user_id_segment_unique",
964
+ "nullsNotDistinct": false,
965
+ "columns": ["user_id", "segment"]
966
+ }
967
+ },
968
+ "policies": {},
969
+ "checkConstraints": {},
970
+ "isRLSEnabled": false
971
+ },
972
+ "public.user_topic_preferences": {
973
+ "name": "user_topic_preferences",
974
+ "schema": "",
975
+ "columns": {
976
+ "id": {
977
+ "name": "id",
978
+ "type": "uuid",
979
+ "primaryKey": true,
980
+ "notNull": true,
981
+ "default": "gen_random_uuid()"
982
+ },
983
+ "user_id": {
984
+ "name": "user_id",
985
+ "type": "uuid",
986
+ "primaryKey": false,
987
+ "notNull": true
988
+ },
989
+ "topic": {
990
+ "name": "topic",
991
+ "type": "varchar",
992
+ "primaryKey": false,
993
+ "notNull": true
994
+ },
995
+ "enabled": {
996
+ "name": "enabled",
997
+ "type": "boolean",
998
+ "primaryKey": false,
999
+ "notNull": true
1000
+ }
1001
+ },
1002
+ "indexes": {},
1003
+ "foreignKeys": {
1004
+ "user_topic_preferences_user_id_users_id_fk": {
1005
+ "name": "user_topic_preferences_user_id_users_id_fk",
1006
+ "tableFrom": "user_topic_preferences",
1007
+ "tableTo": "users",
1008
+ "columnsFrom": ["user_id"],
1009
+ "columnsTo": ["id"],
1010
+ "onDelete": "cascade",
1011
+ "onUpdate": "no action"
1012
+ }
1013
+ },
1014
+ "compositePrimaryKeys": {},
1015
+ "uniqueConstraints": {
1016
+ "user_topic_preferences_user_id_topic_unique": {
1017
+ "name": "user_topic_preferences_user_id_topic_unique",
1018
+ "nullsNotDistinct": false,
1019
+ "columns": ["user_id", "topic"]
1020
+ }
1021
+ },
1022
+ "policies": {},
1023
+ "checkConstraints": {},
1024
+ "isRLSEnabled": false
1025
+ },
1026
+ "public.users": {
1027
+ "name": "users",
1028
+ "schema": "",
1029
+ "columns": {
1030
+ "id": {
1031
+ "name": "id",
1032
+ "type": "uuid",
1033
+ "primaryKey": true,
1034
+ "notNull": true,
1035
+ "default": "gen_random_uuid()"
1036
+ },
1037
+ "project_id": {
1038
+ "name": "project_id",
1039
+ "type": "uuid",
1040
+ "primaryKey": false,
1041
+ "notNull": true
1042
+ },
1043
+ "external_id": {
1044
+ "name": "external_id",
1045
+ "type": "text",
1046
+ "primaryKey": false,
1047
+ "notNull": true
1048
+ },
1049
+ "attributes": {
1050
+ "name": "attributes",
1051
+ "type": "jsonb",
1052
+ "primaryKey": false,
1053
+ "notNull": true,
1054
+ "default": "'{}'::jsonb"
1055
+ },
1056
+ "created_at": {
1057
+ "name": "created_at",
1058
+ "type": "timestamp with time zone",
1059
+ "primaryKey": false,
1060
+ "notNull": true,
1061
+ "default": "now()"
1062
+ },
1063
+ "updated_at": {
1064
+ "name": "updated_at",
1065
+ "type": "timestamp with time zone",
1066
+ "primaryKey": false,
1067
+ "notNull": true,
1068
+ "default": "now()"
1069
+ }
1070
+ },
1071
+ "indexes": {},
1072
+ "foreignKeys": {},
1073
+ "compositePrimaryKeys": {},
1074
+ "uniqueConstraints": {
1075
+ "users_project_id_external_id_unique": {
1076
+ "name": "users_project_id_external_id_unique",
1077
+ "nullsNotDistinct": false,
1078
+ "columns": ["project_id", "external_id"]
1079
+ }
1080
+ },
1081
+ "policies": {},
1082
+ "checkConstraints": {},
1083
+ "isRLSEnabled": false
1084
+ },
1085
+ "public.workflow_definitions": {
1086
+ "name": "workflow_definitions",
1087
+ "schema": "",
1088
+ "columns": {
1089
+ "id": {
1090
+ "name": "id",
1091
+ "type": "uuid",
1092
+ "primaryKey": true,
1093
+ "notNull": true,
1094
+ "default": "gen_random_uuid()"
1095
+ },
1096
+ "project_id": {
1097
+ "name": "project_id",
1098
+ "type": "uuid",
1099
+ "primaryKey": false,
1100
+ "notNull": true
1101
+ },
1102
+ "name": {
1103
+ "name": "name",
1104
+ "type": "varchar",
1105
+ "primaryKey": false,
1106
+ "notNull": true
1107
+ },
1108
+ "steps": {
1109
+ "name": "steps",
1110
+ "type": "jsonb",
1111
+ "primaryKey": false,
1112
+ "notNull": true
1113
+ },
1114
+ "created_at": {
1115
+ "name": "created_at",
1116
+ "type": "timestamp with time zone",
1117
+ "primaryKey": false,
1118
+ "notNull": true,
1119
+ "default": "now()"
1120
+ }
1121
+ },
1122
+ "indexes": {},
1123
+ "foreignKeys": {},
1124
+ "compositePrimaryKeys": {},
1125
+ "uniqueConstraints": {
1126
+ "workflow_definitions_project_id_name_unique": {
1127
+ "name": "workflow_definitions_project_id_name_unique",
1128
+ "nullsNotDistinct": false,
1129
+ "columns": ["project_id", "name"]
1130
+ }
1131
+ },
1132
+ "policies": {},
1133
+ "checkConstraints": {},
1134
+ "isRLSEnabled": false
1135
+ },
1136
+ "public.workflow_instances": {
1137
+ "name": "workflow_instances",
1138
+ "schema": "",
1139
+ "columns": {
1140
+ "id": {
1141
+ "name": "id",
1142
+ "type": "uuid",
1143
+ "primaryKey": true,
1144
+ "notNull": true,
1145
+ "default": "gen_random_uuid()"
1146
+ },
1147
+ "project_id": {
1148
+ "name": "project_id",
1149
+ "type": "uuid",
1150
+ "primaryKey": false,
1151
+ "notNull": true
1152
+ },
1153
+ "name": {
1154
+ "name": "name",
1155
+ "type": "varchar",
1156
+ "primaryKey": false,
1157
+ "notNull": true
1158
+ },
1159
+ "status": {
1160
+ "name": "status",
1161
+ "type": "workflow_status",
1162
+ "typeSchema": "public",
1163
+ "primaryKey": false,
1164
+ "notNull": true,
1165
+ "default": "'pending'"
1166
+ },
1167
+ "input": {
1168
+ "name": "input",
1169
+ "type": "jsonb",
1170
+ "primaryKey": false,
1171
+ "notNull": false,
1172
+ "default": "'{}'::jsonb"
1173
+ },
1174
+ "created_at": {
1175
+ "name": "created_at",
1176
+ "type": "timestamp with time zone",
1177
+ "primaryKey": false,
1178
+ "notNull": true,
1179
+ "default": "now()"
1180
+ },
1181
+ "updated_at": {
1182
+ "name": "updated_at",
1183
+ "type": "timestamp with time zone",
1184
+ "primaryKey": false,
1185
+ "notNull": true,
1186
+ "default": "now()"
1187
+ }
1188
+ },
1189
+ "indexes": {
1190
+ "workflow_name_idx": {
1191
+ "name": "workflow_name_idx",
1192
+ "columns": [
1193
+ {
1194
+ "expression": "name",
1195
+ "isExpression": false,
1196
+ "asc": true,
1197
+ "nulls": "last"
1198
+ }
1199
+ ],
1200
+ "isUnique": false,
1201
+ "concurrently": false,
1202
+ "method": "btree",
1203
+ "with": {}
1204
+ }
1205
+ },
1206
+ "foreignKeys": {},
1207
+ "compositePrimaryKeys": {},
1208
+ "uniqueConstraints": {},
1209
+ "policies": {},
1210
+ "checkConstraints": {},
1211
+ "isRLSEnabled": false
1212
+ },
1213
+ "public.workflow_steps": {
1214
+ "name": "workflow_steps",
1215
+ "schema": "",
1216
+ "columns": {
1217
+ "id": {
1218
+ "name": "id",
1219
+ "type": "uuid",
1220
+ "primaryKey": true,
1221
+ "notNull": true,
1222
+ "default": "gen_random_uuid()"
1223
+ },
1224
+ "project_id": {
1225
+ "name": "project_id",
1226
+ "type": "uuid",
1227
+ "primaryKey": false,
1228
+ "notNull": true
1229
+ },
1230
+ "instance_id": {
1231
+ "name": "instance_id",
1232
+ "type": "uuid",
1233
+ "primaryKey": false,
1234
+ "notNull": true
1235
+ },
1236
+ "step_index": {
1237
+ "name": "step_index",
1238
+ "type": "varchar",
1239
+ "primaryKey": false,
1240
+ "notNull": true
1241
+ },
1242
+ "action": {
1243
+ "name": "action",
1244
+ "type": "varchar",
1245
+ "primaryKey": false,
1246
+ "notNull": true
1247
+ },
1248
+ "output": {
1249
+ "name": "output",
1250
+ "type": "jsonb",
1251
+ "primaryKey": false,
1252
+ "notNull": false
1253
+ },
1254
+ "error": {
1255
+ "name": "error",
1256
+ "type": "text",
1257
+ "primaryKey": false,
1258
+ "notNull": false
1259
+ },
1260
+ "created_at": {
1261
+ "name": "created_at",
1262
+ "type": "timestamp with time zone",
1263
+ "primaryKey": false,
1264
+ "notNull": true,
1265
+ "default": "now()"
1266
+ }
1267
+ },
1268
+ "indexes": {},
1269
+ "foreignKeys": {
1270
+ "workflow_steps_instance_id_workflow_instances_id_fk": {
1271
+ "name": "workflow_steps_instance_id_workflow_instances_id_fk",
1272
+ "tableFrom": "workflow_steps",
1273
+ "tableTo": "workflow_instances",
1274
+ "columnsFrom": ["instance_id"],
1275
+ "columnsTo": ["id"],
1276
+ "onDelete": "cascade",
1277
+ "onUpdate": "no action"
1278
+ }
1279
+ },
1280
+ "compositePrimaryKeys": {},
1281
+ "uniqueConstraints": {
1282
+ "workflow_steps_instance_id_step_index_unique": {
1283
+ "name": "workflow_steps_instance_id_step_index_unique",
1284
+ "nullsNotDistinct": false,
1285
+ "columns": ["instance_id", "step_index"]
1286
+ }
1287
+ },
1288
+ "policies": {},
1289
+ "checkConstraints": {},
1290
+ "isRLSEnabled": false
1291
+ },
1292
+ "public.workflow_waiters": {
1293
+ "name": "workflow_waiters",
1294
+ "schema": "",
1295
+ "columns": {
1296
+ "id": {
1297
+ "name": "id",
1298
+ "type": "uuid",
1299
+ "primaryKey": true,
1300
+ "notNull": true,
1301
+ "default": "gen_random_uuid()"
1302
+ },
1303
+ "project_id": {
1304
+ "name": "project_id",
1305
+ "type": "uuid",
1306
+ "primaryKey": false,
1307
+ "notNull": true
1308
+ },
1309
+ "instance_id": {
1310
+ "name": "instance_id",
1311
+ "type": "uuid",
1312
+ "primaryKey": false,
1313
+ "notNull": true
1314
+ },
1315
+ "event_name": {
1316
+ "name": "event_name",
1317
+ "type": "varchar",
1318
+ "primaryKey": false,
1319
+ "notNull": true
1320
+ },
1321
+ "match_criteria": {
1322
+ "name": "match_criteria",
1323
+ "type": "jsonb",
1324
+ "primaryKey": false,
1325
+ "notNull": true
1326
+ },
1327
+ "expires_at": {
1328
+ "name": "expires_at",
1329
+ "type": "timestamp with time zone",
1330
+ "primaryKey": false,
1331
+ "notNull": true
1332
+ },
1333
+ "created_at": {
1334
+ "name": "created_at",
1335
+ "type": "timestamp with time zone",
1336
+ "primaryKey": false,
1337
+ "notNull": true,
1338
+ "default": "now()"
1339
+ }
1340
+ },
1341
+ "indexes": {
1342
+ "waiter_event_idx": {
1343
+ "name": "waiter_event_idx",
1344
+ "columns": [
1345
+ {
1346
+ "expression": "event_name",
1347
+ "isExpression": false,
1348
+ "asc": true,
1349
+ "nulls": "last"
1350
+ }
1351
+ ],
1352
+ "isUnique": false,
1353
+ "concurrently": false,
1354
+ "method": "btree",
1355
+ "with": {}
1356
+ },
1357
+ "waiter_instance_idx": {
1358
+ "name": "waiter_instance_idx",
1359
+ "columns": [
1360
+ {
1361
+ "expression": "instance_id",
1362
+ "isExpression": false,
1363
+ "asc": true,
1364
+ "nulls": "last"
1365
+ }
1366
+ ],
1367
+ "isUnique": false,
1368
+ "concurrently": false,
1369
+ "method": "btree",
1370
+ "with": {}
1371
+ },
1372
+ "waiter_comp_idx": {
1373
+ "name": "waiter_comp_idx",
1374
+ "columns": [
1375
+ {
1376
+ "expression": "event_name",
1377
+ "isExpression": false,
1378
+ "asc": true,
1379
+ "nulls": "last"
1380
+ },
1381
+ {
1382
+ "expression": "project_id",
1383
+ "isExpression": false,
1384
+ "asc": true,
1385
+ "nulls": "last"
1386
+ },
1387
+ {
1388
+ "expression": "expires_at",
1389
+ "isExpression": false,
1390
+ "asc": true,
1391
+ "nulls": "last"
1392
+ }
1393
+ ],
1394
+ "isUnique": false,
1395
+ "concurrently": false,
1396
+ "method": "btree",
1397
+ "with": {}
1398
+ },
1399
+ "waiter_match_idx": {
1400
+ "name": "waiter_match_idx",
1401
+ "columns": [
1402
+ {
1403
+ "expression": "match_criteria",
1404
+ "isExpression": false,
1405
+ "asc": true,
1406
+ "nulls": "last"
1407
+ }
1408
+ ],
1409
+ "isUnique": false,
1410
+ "concurrently": false,
1411
+ "method": "gin",
1412
+ "with": {}
1413
+ }
1414
+ },
1415
+ "foreignKeys": {
1416
+ "workflow_waiters_instance_id_workflow_instances_id_fk": {
1417
+ "name": "workflow_waiters_instance_id_workflow_instances_id_fk",
1418
+ "tableFrom": "workflow_waiters",
1419
+ "tableTo": "workflow_instances",
1420
+ "columnsFrom": ["instance_id"],
1421
+ "columnsTo": ["id"],
1422
+ "onDelete": "cascade",
1423
+ "onUpdate": "no action"
1424
+ }
1425
+ },
1426
+ "compositePrimaryKeys": {},
1427
+ "uniqueConstraints": {},
1428
+ "policies": {},
1429
+ "checkConstraints": {},
1430
+ "isRLSEnabled": false
1431
+ }
1432
+ },
1433
+ "enums": {
1434
+ "public.api_key_role": {
1435
+ "name": "api_key_role",
1436
+ "schema": "public",
1437
+ "values": ["admin", "read_only"]
1438
+ },
1439
+ "public.channel": {
1440
+ "name": "channel",
1441
+ "schema": "public",
1442
+ "values": ["email", "sms", "push", "webhook", "in-app", "telegram", "discord", "whatsapp"]
1443
+ },
1444
+ "public.workflow_status": {
1445
+ "name": "workflow_status",
1446
+ "schema": "public",
1447
+ "values": ["pending", "running", "completed", "failed"]
1448
+ }
1449
+ },
1450
+ "schemas": {},
1451
+ "sequences": {},
1452
+ "roles": {},
1453
+ "policies": {},
1454
+ "views": {},
1455
+ "_meta": {
1456
+ "columns": {},
1457
+ "schemas": {},
1458
+ "tables": {}
1459
+ }
1460
+ }