@shipfox/api-triggers 13.0.0 → 14.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 (129) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +34 -0
  3. package/README.md +14 -10
  4. package/dist/core/entities/decision.d.ts +3 -2
  5. package/dist/core/entities/decision.d.ts.map +1 -1
  6. package/dist/core/entities/decision.js.map +1 -1
  7. package/dist/core/entities/job-listener-subscription.d.ts +2 -1
  8. package/dist/core/entities/job-listener-subscription.d.ts.map +1 -1
  9. package/dist/core/entities/job-listener-subscription.js.map +1 -1
  10. package/dist/core/entities/received-event.d.ts +14 -1
  11. package/dist/core/entities/received-event.d.ts.map +1 -1
  12. package/dist/core/entities/received-event.js +2 -1
  13. package/dist/core/entities/received-event.js.map +1 -1
  14. package/dist/core/entities/subscription.d.ts +2 -1
  15. package/dist/core/entities/subscription.d.ts.map +1 -1
  16. package/dist/core/entities/subscription.js.map +1 -1
  17. package/dist/core/fire-cron.d.ts.map +1 -1
  18. package/dist/core/fire-cron.js +3 -1
  19. package/dist/core/fire-cron.js.map +1 -1
  20. package/dist/core/fire-manual.d.ts.map +1 -1
  21. package/dist/core/fire-manual.js +3 -1
  22. package/dist/core/fire-manual.js.map +1 -1
  23. package/dist/core/record-trigger-history.d.ts +2 -0
  24. package/dist/core/record-trigger-history.d.ts.map +1 -1
  25. package/dist/core/record-trigger-history.js +13 -1
  26. package/dist/core/record-trigger-history.js.map +1 -1
  27. package/dist/core/route-event-to-job-listeners.js +2 -0
  28. package/dist/core/route-event-to-job-listeners.js.map +1 -1
  29. package/dist/db/db.d.ts +48 -14
  30. package/dist/db/db.d.ts.map +1 -1
  31. package/dist/db/event-history.d.ts +17 -0
  32. package/dist/db/event-history.d.ts.map +1 -1
  33. package/dist/db/event-history.js +45 -1
  34. package/dist/db/event-history.js.map +1 -1
  35. package/dist/db/event-queries.d.ts +5 -1
  36. package/dist/db/event-queries.d.ts.map +1 -1
  37. package/dist/db/event-queries.js +30 -4
  38. package/dist/db/event-queries.js.map +1 -1
  39. package/dist/db/index.d.ts +1 -1
  40. package/dist/db/index.d.ts.map +1 -1
  41. package/dist/db/index.js +1 -1
  42. package/dist/db/index.js.map +1 -1
  43. package/dist/db/job-listener-subscriptions.d.ts +1 -1
  44. package/dist/db/job-listener-subscriptions.d.ts.map +1 -1
  45. package/dist/db/job-listener-subscriptions.js +10 -3
  46. package/dist/db/job-listener-subscriptions.js.map +1 -1
  47. package/dist/db/schema/decisions.d.ts +3 -3
  48. package/dist/db/schema/decisions.d.ts.map +1 -1
  49. package/dist/db/schema/decisions.js +8 -3
  50. package/dist/db/schema/decisions.js.map +1 -1
  51. package/dist/db/schema/job-listener-subscriptions.d.ts +1 -1
  52. package/dist/db/schema/job-listener-subscriptions.d.ts.map +1 -1
  53. package/dist/db/schema/job-listener-subscriptions.js +2 -1
  54. package/dist/db/schema/job-listener-subscriptions.js.map +1 -1
  55. package/dist/db/schema/received-events.d.ts +38 -4
  56. package/dist/db/schema/received-events.d.ts.map +1 -1
  57. package/dist/db/schema/received-events.js +11 -2
  58. package/dist/db/schema/received-events.js.map +1 -1
  59. package/dist/db/schema/subscriptions.d.ts +1 -1
  60. package/dist/db/schema/subscriptions.d.ts.map +1 -1
  61. package/dist/db/schema/subscriptions.js +2 -1
  62. package/dist/db/schema/subscriptions.js.map +1 -1
  63. package/dist/db/subscription-event.d.ts +7 -0
  64. package/dist/db/subscription-event.d.ts.map +1 -0
  65. package/dist/db/subscription-event.js +19 -0
  66. package/dist/db/subscription-event.js.map +1 -0
  67. package/dist/db/subscriptions.d.ts +5 -1
  68. package/dist/db/subscriptions.d.ts.map +1 -1
  69. package/dist/db/subscriptions.js +10 -3
  70. package/dist/db/subscriptions.js.map +1 -1
  71. package/dist/presentation/dto/trigger-events.d.ts +3 -2
  72. package/dist/presentation/dto/trigger-events.d.ts.map +1 -1
  73. package/dist/presentation/dto/trigger-events.js +9 -0
  74. package/dist/presentation/dto/trigger-events.js.map +1 -1
  75. package/dist/presentation/routes/get-trigger-event.d.ts.map +1 -1
  76. package/dist/presentation/routes/get-trigger-event.js +8 -4
  77. package/dist/presentation/routes/get-trigger-event.js.map +1 -1
  78. package/dist/presentation/routes/list-trigger-event-facets.js +1 -1
  79. package/dist/presentation/routes/list-trigger-event-facets.js.map +1 -1
  80. package/dist/presentation/routes/list-trigger-events.d.ts.map +1 -1
  81. package/dist/presentation/routes/list-trigger-events.js +3 -1
  82. package/dist/presentation/routes/list-trigger-events.js.map +1 -1
  83. package/dist/tsconfig.test.tsbuildinfo +1 -1
  84. package/drizzle/0001_nullable_subscription_events.sql +2 -0
  85. package/drizzle/0002_dev_trigger_journal.sql +7 -0
  86. package/drizzle/0003_add_origin_facet_index.sql +1 -0
  87. package/drizzle/meta/0001_snapshot.json +905 -0
  88. package/drizzle/meta/0002_snapshot.json +947 -0
  89. package/drizzle/meta/0003_snapshot.json +968 -0
  90. package/drizzle/meta/_journal.json +21 -0
  91. package/package.json +7 -7
  92. package/src/core/dispatch-integration-event.test.ts +88 -0
  93. package/src/core/entities/decision.ts +3 -2
  94. package/src/core/entities/job-listener-subscription.ts +2 -1
  95. package/src/core/entities/received-event.ts +15 -1
  96. package/src/core/entities/subscription.ts +2 -1
  97. package/src/core/fire-cron.test.ts +20 -0
  98. package/src/core/fire-cron.ts +3 -1
  99. package/src/core/fire-manual.test.ts +25 -0
  100. package/src/core/fire-manual.ts +3 -1
  101. package/src/core/record-trigger-history.test.ts +78 -0
  102. package/src/core/record-trigger-history.ts +19 -0
  103. package/src/core/route-event-to-job-listeners.test.ts +47 -0
  104. package/src/core/route-event-to-job-listeners.ts +2 -0
  105. package/src/db/event-history.test.ts +123 -0
  106. package/src/db/event-history.ts +84 -1
  107. package/src/db/event-queries.ts +56 -3
  108. package/src/db/index.ts +1 -0
  109. package/src/db/job-listener-subscriptions.test.ts +133 -1
  110. package/src/db/job-listener-subscriptions.ts +5 -4
  111. package/src/db/schema/decisions.test.ts +93 -4
  112. package/src/db/schema/decisions.ts +12 -3
  113. package/src/db/schema/job-listener-subscriptions.ts +2 -1
  114. package/src/db/schema/received-events.test.ts +45 -0
  115. package/src/db/schema/received-events.ts +12 -1
  116. package/src/db/schema/subscriptions.ts +2 -1
  117. package/src/db/subscription-event.ts +24 -0
  118. package/src/db/subscriptions.test.ts +137 -0
  119. package/src/db/subscriptions.ts +9 -4
  120. package/src/presentation/dto/trigger-events.test.ts +193 -0
  121. package/src/presentation/dto/trigger-events.ts +12 -0
  122. package/src/presentation/routes/get-trigger-event.test.ts +179 -0
  123. package/src/presentation/routes/get-trigger-event.ts +15 -3
  124. package/src/presentation/routes/list-trigger-event-facets.test.ts +39 -2
  125. package/src/presentation/routes/list-trigger-event-facets.ts +1 -1
  126. package/src/presentation/routes/list-trigger-events.test.ts +99 -0
  127. package/src/presentation/routes/list-trigger-events.ts +4 -0
  128. package/test/factories/received-event.ts +2 -0
  129. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,947 @@
1
+ {
2
+ "id": "8b1be2f7-0c61-47f4-a738-a35ee1e04a3a",
3
+ "prevId": "afe02293-9f01-43c2-ae93-9de4660f7697",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.triggers_cron_schedules": {
8
+ "name": "triggers_cron_schedules",
9
+ "schema": "",
10
+ "columns": {
11
+ "subscription_id": {
12
+ "name": "subscription_id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "workspace_id": {
18
+ "name": "workspace_id",
19
+ "type": "uuid",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "cron_expression": {
24
+ "name": "cron_expression",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "timezone": {
30
+ "name": "timezone",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "next_fire_at": {
36
+ "name": "next_fire_at",
37
+ "type": "timestamp with time zone",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "last_fired_at": {
42
+ "name": "last_fired_at",
43
+ "type": "timestamp with time zone",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "created_at": {
48
+ "name": "created_at",
49
+ "type": "timestamp with time zone",
50
+ "primaryKey": false,
51
+ "notNull": true,
52
+ "default": "now()"
53
+ },
54
+ "updated_at": {
55
+ "name": "updated_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "default": "now()"
60
+ }
61
+ },
62
+ "indexes": {
63
+ "triggers_cron_schedules_next_fire_at_idx": {
64
+ "name": "triggers_cron_schedules_next_fire_at_idx",
65
+ "columns": [
66
+ {
67
+ "expression": "next_fire_at",
68
+ "isExpression": false,
69
+ "asc": true,
70
+ "nulls": "last"
71
+ }
72
+ ],
73
+ "isUnique": false,
74
+ "concurrently": false,
75
+ "method": "btree",
76
+ "with": {}
77
+ }
78
+ },
79
+ "foreignKeys": {
80
+ "triggers_cron_schedules_subscription_id_triggers_subscriptions_id_fk": {
81
+ "name": "triggers_cron_schedules_subscription_id_triggers_subscriptions_id_fk",
82
+ "tableFrom": "triggers_cron_schedules",
83
+ "tableTo": "triggers_subscriptions",
84
+ "columnsFrom": ["subscription_id"],
85
+ "columnsTo": ["id"],
86
+ "onDelete": "cascade",
87
+ "onUpdate": "no action"
88
+ }
89
+ },
90
+ "compositePrimaryKeys": {},
91
+ "uniqueConstraints": {},
92
+ "policies": {},
93
+ "checkConstraints": {},
94
+ "isRLSEnabled": false
95
+ },
96
+ "public.triggers_decisions": {
97
+ "name": "triggers_decisions",
98
+ "schema": "",
99
+ "columns": {
100
+ "id": {
101
+ "name": "id",
102
+ "type": "uuid",
103
+ "primaryKey": true,
104
+ "notNull": true,
105
+ "default": "uuidv7()"
106
+ },
107
+ "received_event_id": {
108
+ "name": "received_event_id",
109
+ "type": "uuid",
110
+ "primaryKey": false,
111
+ "notNull": true
112
+ },
113
+ "subscription_kind": {
114
+ "name": "subscription_kind",
115
+ "type": "text",
116
+ "primaryKey": false,
117
+ "notNull": true
118
+ },
119
+ "subscription_id": {
120
+ "name": "subscription_id",
121
+ "type": "uuid",
122
+ "primaryKey": false,
123
+ "notNull": false
124
+ },
125
+ "subscription_name": {
126
+ "name": "subscription_name",
127
+ "type": "text",
128
+ "primaryKey": false,
129
+ "notNull": true
130
+ },
131
+ "workflow_definition_id": {
132
+ "name": "workflow_definition_id",
133
+ "type": "uuid",
134
+ "primaryKey": false,
135
+ "notNull": false
136
+ },
137
+ "project_id": {
138
+ "name": "project_id",
139
+ "type": "uuid",
140
+ "primaryKey": false,
141
+ "notNull": false
142
+ },
143
+ "workflow_run_id": {
144
+ "name": "workflow_run_id",
145
+ "type": "uuid",
146
+ "primaryKey": false,
147
+ "notNull": false
148
+ },
149
+ "job_id": {
150
+ "name": "job_id",
151
+ "type": "uuid",
152
+ "primaryKey": false,
153
+ "notNull": false
154
+ },
155
+ "matcher_kind": {
156
+ "name": "matcher_kind",
157
+ "type": "triggers_job_listener_matcher_kind",
158
+ "typeSchema": "public",
159
+ "primaryKey": false,
160
+ "notNull": false
161
+ },
162
+ "matcher_ordinal": {
163
+ "name": "matcher_ordinal",
164
+ "type": "integer",
165
+ "primaryKey": false,
166
+ "notNull": false
167
+ },
168
+ "decision": {
169
+ "name": "decision",
170
+ "type": "text",
171
+ "primaryKey": false,
172
+ "notNull": true
173
+ },
174
+ "run_id": {
175
+ "name": "run_id",
176
+ "type": "uuid",
177
+ "primaryKey": false,
178
+ "notNull": false
179
+ },
180
+ "run_name": {
181
+ "name": "run_name",
182
+ "type": "text",
183
+ "primaryKey": false,
184
+ "notNull": false
185
+ },
186
+ "reason": {
187
+ "name": "reason",
188
+ "type": "text",
189
+ "primaryKey": false,
190
+ "notNull": false
191
+ },
192
+ "created_at": {
193
+ "name": "created_at",
194
+ "type": "timestamp with time zone",
195
+ "primaryKey": false,
196
+ "notNull": true,
197
+ "default": "now()"
198
+ }
199
+ },
200
+ "indexes": {
201
+ "triggers_decisions_event_subscription_unique": {
202
+ "name": "triggers_decisions_event_subscription_unique",
203
+ "columns": [
204
+ {
205
+ "expression": "received_event_id",
206
+ "isExpression": false,
207
+ "asc": true,
208
+ "nulls": "last"
209
+ },
210
+ {
211
+ "expression": "subscription_kind",
212
+ "isExpression": false,
213
+ "asc": true,
214
+ "nulls": "last"
215
+ },
216
+ {
217
+ "expression": "subscription_id",
218
+ "isExpression": false,
219
+ "asc": true,
220
+ "nulls": "last"
221
+ }
222
+ ],
223
+ "isUnique": true,
224
+ "concurrently": false,
225
+ "method": "btree",
226
+ "with": {}
227
+ },
228
+ "triggers_decisions_dev_event_unique": {
229
+ "name": "triggers_decisions_dev_event_unique",
230
+ "columns": [
231
+ {
232
+ "expression": "received_event_id",
233
+ "isExpression": false,
234
+ "asc": true,
235
+ "nulls": "last"
236
+ }
237
+ ],
238
+ "isUnique": true,
239
+ "where": "\"triggers_decisions\".\"subscription_kind\" = 'dev'",
240
+ "concurrently": false,
241
+ "method": "btree",
242
+ "with": {}
243
+ },
244
+ "triggers_decisions_run_idx": {
245
+ "name": "triggers_decisions_run_idx",
246
+ "columns": [
247
+ {
248
+ "expression": "run_id",
249
+ "isExpression": false,
250
+ "asc": true,
251
+ "nulls": "last"
252
+ }
253
+ ],
254
+ "isUnique": false,
255
+ "concurrently": false,
256
+ "method": "btree",
257
+ "with": {}
258
+ }
259
+ },
260
+ "foreignKeys": {
261
+ "triggers_decisions_received_event_id_triggers_received_events_id_fk": {
262
+ "name": "triggers_decisions_received_event_id_triggers_received_events_id_fk",
263
+ "tableFrom": "triggers_decisions",
264
+ "tableTo": "triggers_received_events",
265
+ "columnsFrom": ["received_event_id"],
266
+ "columnsTo": ["id"],
267
+ "onDelete": "cascade",
268
+ "onUpdate": "no action"
269
+ }
270
+ },
271
+ "compositePrimaryKeys": {},
272
+ "uniqueConstraints": {},
273
+ "policies": {},
274
+ "checkConstraints": {
275
+ "triggers_decisions_subscription_kind_ck": {
276
+ "name": "triggers_decisions_subscription_kind_ck",
277
+ "value": "\"triggers_decisions\".\"subscription_kind\" IN ('trigger', 'listener', 'dev')"
278
+ },
279
+ "triggers_decisions_subscription_id_ck": {
280
+ "name": "triggers_decisions_subscription_id_ck",
281
+ "value": "(\"triggers_decisions\".\"subscription_kind\" = 'dev' AND \"triggers_decisions\".\"subscription_id\" IS NULL) OR (\"triggers_decisions\".\"subscription_kind\" IN ('trigger', 'listener') AND \"triggers_decisions\".\"subscription_id\" IS NOT NULL)"
282
+ }
283
+ },
284
+ "isRLSEnabled": false
285
+ },
286
+ "public.triggers_job_listener_subscriptions": {
287
+ "name": "triggers_job_listener_subscriptions",
288
+ "schema": "",
289
+ "columns": {
290
+ "id": {
291
+ "name": "id",
292
+ "type": "uuid",
293
+ "primaryKey": true,
294
+ "notNull": true,
295
+ "default": "uuidv7()"
296
+ },
297
+ "workspace_id": {
298
+ "name": "workspace_id",
299
+ "type": "uuid",
300
+ "primaryKey": false,
301
+ "notNull": true
302
+ },
303
+ "workflow_run_id": {
304
+ "name": "workflow_run_id",
305
+ "type": "uuid",
306
+ "primaryKey": false,
307
+ "notNull": true
308
+ },
309
+ "job_id": {
310
+ "name": "job_id",
311
+ "type": "uuid",
312
+ "primaryKey": false,
313
+ "notNull": true
314
+ },
315
+ "kind": {
316
+ "name": "kind",
317
+ "type": "triggers_job_listener_matcher_kind",
318
+ "typeSchema": "public",
319
+ "primaryKey": false,
320
+ "notNull": true
321
+ },
322
+ "matcher_ordinal": {
323
+ "name": "matcher_ordinal",
324
+ "type": "integer",
325
+ "primaryKey": false,
326
+ "notNull": true
327
+ },
328
+ "source": {
329
+ "name": "source",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": true
333
+ },
334
+ "event": {
335
+ "name": "event",
336
+ "type": "text",
337
+ "primaryKey": false,
338
+ "notNull": false
339
+ },
340
+ "config": {
341
+ "name": "config",
342
+ "type": "jsonb",
343
+ "primaryKey": false,
344
+ "notNull": true
345
+ },
346
+ "created_at": {
347
+ "name": "created_at",
348
+ "type": "timestamp with time zone",
349
+ "primaryKey": false,
350
+ "notNull": true,
351
+ "default": "now()"
352
+ }
353
+ },
354
+ "indexes": {
355
+ "triggers_job_listener_subscriptions_job_kind_ordinal_unique": {
356
+ "name": "triggers_job_listener_subscriptions_job_kind_ordinal_unique",
357
+ "columns": [
358
+ {
359
+ "expression": "job_id",
360
+ "isExpression": false,
361
+ "asc": true,
362
+ "nulls": "last"
363
+ },
364
+ {
365
+ "expression": "kind",
366
+ "isExpression": false,
367
+ "asc": true,
368
+ "nulls": "last"
369
+ },
370
+ {
371
+ "expression": "matcher_ordinal",
372
+ "isExpression": false,
373
+ "asc": true,
374
+ "nulls": "last"
375
+ }
376
+ ],
377
+ "isUnique": true,
378
+ "concurrently": false,
379
+ "method": "btree",
380
+ "with": {}
381
+ },
382
+ "triggers_job_listener_subscriptions_match_idx": {
383
+ "name": "triggers_job_listener_subscriptions_match_idx",
384
+ "columns": [
385
+ {
386
+ "expression": "workspace_id",
387
+ "isExpression": false,
388
+ "asc": true,
389
+ "nulls": "last"
390
+ },
391
+ {
392
+ "expression": "source",
393
+ "isExpression": false,
394
+ "asc": true,
395
+ "nulls": "last"
396
+ },
397
+ {
398
+ "expression": "event",
399
+ "isExpression": false,
400
+ "asc": true,
401
+ "nulls": "last"
402
+ }
403
+ ],
404
+ "isUnique": false,
405
+ "concurrently": false,
406
+ "method": "btree",
407
+ "with": {}
408
+ },
409
+ "triggers_job_listener_subscriptions_job_idx": {
410
+ "name": "triggers_job_listener_subscriptions_job_idx",
411
+ "columns": [
412
+ {
413
+ "expression": "job_id",
414
+ "isExpression": false,
415
+ "asc": true,
416
+ "nulls": "last"
417
+ }
418
+ ],
419
+ "isUnique": false,
420
+ "concurrently": false,
421
+ "method": "btree",
422
+ "with": {}
423
+ }
424
+ },
425
+ "foreignKeys": {},
426
+ "compositePrimaryKeys": {},
427
+ "uniqueConstraints": {},
428
+ "policies": {},
429
+ "checkConstraints": {},
430
+ "isRLSEnabled": false
431
+ },
432
+ "public.triggers_outbox": {
433
+ "name": "triggers_outbox",
434
+ "schema": "",
435
+ "columns": {
436
+ "id": {
437
+ "name": "id",
438
+ "type": "uuid",
439
+ "primaryKey": true,
440
+ "notNull": true,
441
+ "default": "uuidv7()"
442
+ },
443
+ "event_type": {
444
+ "name": "event_type",
445
+ "type": "text",
446
+ "primaryKey": false,
447
+ "notNull": true
448
+ },
449
+ "ordering_key": {
450
+ "name": "ordering_key",
451
+ "type": "text",
452
+ "primaryKey": false,
453
+ "notNull": false
454
+ },
455
+ "payload": {
456
+ "name": "payload",
457
+ "type": "jsonb",
458
+ "primaryKey": false,
459
+ "notNull": true
460
+ },
461
+ "created_at": {
462
+ "name": "created_at",
463
+ "type": "timestamp with time zone",
464
+ "primaryKey": false,
465
+ "notNull": true,
466
+ "default": "now()"
467
+ },
468
+ "dispatched_at": {
469
+ "name": "dispatched_at",
470
+ "type": "timestamp with time zone",
471
+ "primaryKey": false,
472
+ "notNull": false
473
+ },
474
+ "dispatch_attempts": {
475
+ "name": "dispatch_attempts",
476
+ "type": "integer",
477
+ "primaryKey": false,
478
+ "notNull": true,
479
+ "default": 0
480
+ },
481
+ "next_dispatch_at": {
482
+ "name": "next_dispatch_at",
483
+ "type": "timestamp with time zone",
484
+ "primaryKey": false,
485
+ "notNull": true,
486
+ "default": "now()"
487
+ },
488
+ "last_dispatch_error": {
489
+ "name": "last_dispatch_error",
490
+ "type": "jsonb",
491
+ "primaryKey": false,
492
+ "notNull": false
493
+ },
494
+ "last_dispatch_failed_at": {
495
+ "name": "last_dispatch_failed_at",
496
+ "type": "timestamp with time zone",
497
+ "primaryKey": false,
498
+ "notNull": false
499
+ },
500
+ "dead_lettered_at": {
501
+ "name": "dead_lettered_at",
502
+ "type": "timestamp with time zone",
503
+ "primaryKey": false,
504
+ "notNull": false
505
+ }
506
+ },
507
+ "indexes": {
508
+ "triggers_outbox_pending_idx": {
509
+ "name": "triggers_outbox_pending_idx",
510
+ "columns": [
511
+ {
512
+ "expression": "next_dispatch_at",
513
+ "isExpression": false,
514
+ "asc": true,
515
+ "nulls": "last"
516
+ },
517
+ {
518
+ "expression": "created_at",
519
+ "isExpression": false,
520
+ "asc": true,
521
+ "nulls": "last"
522
+ }
523
+ ],
524
+ "isUnique": false,
525
+ "where": "\"dispatched_at\" IS NULL AND \"dead_lettered_at\" IS NULL",
526
+ "concurrently": false,
527
+ "method": "btree",
528
+ "with": {}
529
+ },
530
+ "triggers_outbox_dispatched_retention_idx": {
531
+ "name": "triggers_outbox_dispatched_retention_idx",
532
+ "columns": [
533
+ {
534
+ "expression": "dispatched_at",
535
+ "isExpression": false,
536
+ "asc": true,
537
+ "nulls": "last"
538
+ },
539
+ {
540
+ "expression": "id",
541
+ "isExpression": false,
542
+ "asc": true,
543
+ "nulls": "last"
544
+ }
545
+ ],
546
+ "isUnique": false,
547
+ "where": "\"dispatched_at\" IS NOT NULL",
548
+ "concurrently": false,
549
+ "method": "btree",
550
+ "with": {}
551
+ }
552
+ },
553
+ "foreignKeys": {},
554
+ "compositePrimaryKeys": {},
555
+ "uniqueConstraints": {},
556
+ "policies": {},
557
+ "checkConstraints": {},
558
+ "isRLSEnabled": false
559
+ },
560
+ "public.triggers_received_events": {
561
+ "name": "triggers_received_events",
562
+ "schema": "",
563
+ "columns": {
564
+ "id": {
565
+ "name": "id",
566
+ "type": "uuid",
567
+ "primaryKey": true,
568
+ "notNull": true,
569
+ "default": "uuidv7()"
570
+ },
571
+ "event_ref": {
572
+ "name": "event_ref",
573
+ "type": "text",
574
+ "primaryKey": false,
575
+ "notNull": true
576
+ },
577
+ "origin": {
578
+ "name": "origin",
579
+ "type": "text",
580
+ "primaryKey": false,
581
+ "notNull": true
582
+ },
583
+ "workspace_id": {
584
+ "name": "workspace_id",
585
+ "type": "uuid",
586
+ "primaryKey": false,
587
+ "notNull": true
588
+ },
589
+ "provider": {
590
+ "name": "provider",
591
+ "type": "text",
592
+ "primaryKey": false,
593
+ "notNull": false
594
+ },
595
+ "source": {
596
+ "name": "source",
597
+ "type": "text",
598
+ "primaryKey": false,
599
+ "notNull": true
600
+ },
601
+ "event": {
602
+ "name": "event",
603
+ "type": "text",
604
+ "primaryKey": false,
605
+ "notNull": true
606
+ },
607
+ "replay_of_event_id": {
608
+ "name": "replay_of_event_id",
609
+ "type": "uuid",
610
+ "primaryKey": false,
611
+ "notNull": false
612
+ },
613
+ "delivery_id": {
614
+ "name": "delivery_id",
615
+ "type": "text",
616
+ "primaryKey": false,
617
+ "notNull": false
618
+ },
619
+ "connection_id": {
620
+ "name": "connection_id",
621
+ "type": "uuid",
622
+ "primaryKey": false,
623
+ "notNull": false
624
+ },
625
+ "connection_name": {
626
+ "name": "connection_name",
627
+ "type": "text",
628
+ "primaryKey": false,
629
+ "notNull": false
630
+ },
631
+ "outcome": {
632
+ "name": "outcome",
633
+ "type": "text",
634
+ "primaryKey": false,
635
+ "notNull": true,
636
+ "default": "'received'"
637
+ },
638
+ "matched_count": {
639
+ "name": "matched_count",
640
+ "type": "integer",
641
+ "primaryKey": false,
642
+ "notNull": true,
643
+ "default": 0
644
+ },
645
+ "payload": {
646
+ "name": "payload",
647
+ "type": "jsonb",
648
+ "primaryKey": false,
649
+ "notNull": false
650
+ },
651
+ "received_at": {
652
+ "name": "received_at",
653
+ "type": "timestamp with time zone",
654
+ "primaryKey": false,
655
+ "notNull": true
656
+ },
657
+ "processed_at": {
658
+ "name": "processed_at",
659
+ "type": "timestamp with time zone",
660
+ "primaryKey": false,
661
+ "notNull": false
662
+ },
663
+ "created_at": {
664
+ "name": "created_at",
665
+ "type": "timestamp with time zone",
666
+ "primaryKey": false,
667
+ "notNull": true,
668
+ "default": "now()"
669
+ }
670
+ },
671
+ "indexes": {
672
+ "triggers_received_events_event_ref_unique": {
673
+ "name": "triggers_received_events_event_ref_unique",
674
+ "columns": [
675
+ {
676
+ "expression": "event_ref",
677
+ "isExpression": false,
678
+ "asc": true,
679
+ "nulls": "last"
680
+ }
681
+ ],
682
+ "isUnique": true,
683
+ "concurrently": false,
684
+ "method": "btree",
685
+ "with": {}
686
+ },
687
+ "triggers_received_events_workspace_received_idx": {
688
+ "name": "triggers_received_events_workspace_received_idx",
689
+ "columns": [
690
+ {
691
+ "expression": "workspace_id",
692
+ "isExpression": false,
693
+ "asc": true,
694
+ "nulls": "last"
695
+ },
696
+ {
697
+ "expression": "received_at",
698
+ "isExpression": false,
699
+ "asc": false,
700
+ "nulls": "last"
701
+ }
702
+ ],
703
+ "isUnique": false,
704
+ "concurrently": false,
705
+ "method": "btree",
706
+ "with": {}
707
+ },
708
+ "triggers_received_events_prune_idx": {
709
+ "name": "triggers_received_events_prune_idx",
710
+ "columns": [
711
+ {
712
+ "expression": "created_at",
713
+ "isExpression": false,
714
+ "asc": true,
715
+ "nulls": "last"
716
+ }
717
+ ],
718
+ "isUnique": false,
719
+ "concurrently": false,
720
+ "method": "btree",
721
+ "with": {}
722
+ },
723
+ "triggers_received_events_workspace_source_idx": {
724
+ "name": "triggers_received_events_workspace_source_idx",
725
+ "columns": [
726
+ {
727
+ "expression": "workspace_id",
728
+ "isExpression": false,
729
+ "asc": true,
730
+ "nulls": "last"
731
+ },
732
+ {
733
+ "expression": "source",
734
+ "isExpression": false,
735
+ "asc": true,
736
+ "nulls": "last"
737
+ }
738
+ ],
739
+ "isUnique": false,
740
+ "concurrently": false,
741
+ "method": "btree",
742
+ "with": {}
743
+ },
744
+ "triggers_received_events_workspace_event_idx": {
745
+ "name": "triggers_received_events_workspace_event_idx",
746
+ "columns": [
747
+ {
748
+ "expression": "workspace_id",
749
+ "isExpression": false,
750
+ "asc": true,
751
+ "nulls": "last"
752
+ },
753
+ {
754
+ "expression": "event",
755
+ "isExpression": false,
756
+ "asc": true,
757
+ "nulls": "last"
758
+ }
759
+ ],
760
+ "isUnique": false,
761
+ "concurrently": false,
762
+ "method": "btree",
763
+ "with": {}
764
+ },
765
+ "triggers_received_events_replay_of_event_id_idx": {
766
+ "name": "triggers_received_events_replay_of_event_id_idx",
767
+ "columns": [
768
+ {
769
+ "expression": "replay_of_event_id",
770
+ "isExpression": false,
771
+ "asc": true,
772
+ "nulls": "last"
773
+ }
774
+ ],
775
+ "isUnique": false,
776
+ "where": "\"triggers_received_events\".\"replay_of_event_id\" IS NOT NULL",
777
+ "concurrently": false,
778
+ "method": "btree",
779
+ "with": {}
780
+ }
781
+ },
782
+ "foreignKeys": {},
783
+ "compositePrimaryKeys": {},
784
+ "uniqueConstraints": {},
785
+ "policies": {},
786
+ "checkConstraints": {},
787
+ "isRLSEnabled": false
788
+ },
789
+ "public.triggers_subscriptions": {
790
+ "name": "triggers_subscriptions",
791
+ "schema": "",
792
+ "columns": {
793
+ "id": {
794
+ "name": "id",
795
+ "type": "uuid",
796
+ "primaryKey": true,
797
+ "notNull": true,
798
+ "default": "uuidv7()"
799
+ },
800
+ "workspace_id": {
801
+ "name": "workspace_id",
802
+ "type": "uuid",
803
+ "primaryKey": false,
804
+ "notNull": true
805
+ },
806
+ "project_id": {
807
+ "name": "project_id",
808
+ "type": "uuid",
809
+ "primaryKey": false,
810
+ "notNull": true
811
+ },
812
+ "workflow_definition_id": {
813
+ "name": "workflow_definition_id",
814
+ "type": "uuid",
815
+ "primaryKey": false,
816
+ "notNull": true
817
+ },
818
+ "name": {
819
+ "name": "name",
820
+ "type": "text",
821
+ "primaryKey": false,
822
+ "notNull": true
823
+ },
824
+ "source": {
825
+ "name": "source",
826
+ "type": "text",
827
+ "primaryKey": false,
828
+ "notNull": true
829
+ },
830
+ "event": {
831
+ "name": "event",
832
+ "type": "text",
833
+ "primaryKey": false,
834
+ "notNull": false
835
+ },
836
+ "config": {
837
+ "name": "config",
838
+ "type": "jsonb",
839
+ "primaryKey": false,
840
+ "notNull": true
841
+ },
842
+ "created_at": {
843
+ "name": "created_at",
844
+ "type": "timestamp with time zone",
845
+ "primaryKey": false,
846
+ "notNull": true,
847
+ "default": "now()"
848
+ },
849
+ "updated_at": {
850
+ "name": "updated_at",
851
+ "type": "timestamp with time zone",
852
+ "primaryKey": false,
853
+ "notNull": true,
854
+ "default": "now()"
855
+ }
856
+ },
857
+ "indexes": {
858
+ "triggers_subscriptions_definition_name_unique": {
859
+ "name": "triggers_subscriptions_definition_name_unique",
860
+ "columns": [
861
+ {
862
+ "expression": "workflow_definition_id",
863
+ "isExpression": false,
864
+ "asc": true,
865
+ "nulls": "last"
866
+ },
867
+ {
868
+ "expression": "name",
869
+ "isExpression": false,
870
+ "asc": true,
871
+ "nulls": "last"
872
+ }
873
+ ],
874
+ "isUnique": true,
875
+ "concurrently": false,
876
+ "method": "btree",
877
+ "with": {}
878
+ },
879
+ "triggers_subscriptions_match_idx": {
880
+ "name": "triggers_subscriptions_match_idx",
881
+ "columns": [
882
+ {
883
+ "expression": "workspace_id",
884
+ "isExpression": false,
885
+ "asc": true,
886
+ "nulls": "last"
887
+ },
888
+ {
889
+ "expression": "source",
890
+ "isExpression": false,
891
+ "asc": true,
892
+ "nulls": "last"
893
+ },
894
+ {
895
+ "expression": "event",
896
+ "isExpression": false,
897
+ "asc": true,
898
+ "nulls": "last"
899
+ }
900
+ ],
901
+ "isUnique": false,
902
+ "concurrently": false,
903
+ "method": "btree",
904
+ "with": {}
905
+ },
906
+ "triggers_subscriptions_definition_idx": {
907
+ "name": "triggers_subscriptions_definition_idx",
908
+ "columns": [
909
+ {
910
+ "expression": "workflow_definition_id",
911
+ "isExpression": false,
912
+ "asc": true,
913
+ "nulls": "last"
914
+ }
915
+ ],
916
+ "isUnique": false,
917
+ "concurrently": false,
918
+ "method": "btree",
919
+ "with": {}
920
+ }
921
+ },
922
+ "foreignKeys": {},
923
+ "compositePrimaryKeys": {},
924
+ "uniqueConstraints": {},
925
+ "policies": {},
926
+ "checkConstraints": {},
927
+ "isRLSEnabled": false
928
+ }
929
+ },
930
+ "enums": {
931
+ "public.triggers_job_listener_matcher_kind": {
932
+ "name": "triggers_job_listener_matcher_kind",
933
+ "schema": "public",
934
+ "values": ["on", "until"]
935
+ }
936
+ },
937
+ "schemas": {},
938
+ "sequences": {},
939
+ "roles": {},
940
+ "policies": {},
941
+ "views": {},
942
+ "_meta": {
943
+ "columns": {},
944
+ "schemas": {},
945
+ "tables": {}
946
+ }
947
+ }