@happyvertical/smrt-webhooks 0.0.0-stage → 0.55.10

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 (43) hide show
  1. package/AGENTS.md +23 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +141 -2
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/admin.d.ts +25 -0
  8. package/dist/admin.d.ts.map +1 -0
  9. package/dist/admin.js +2 -0
  10. package/dist/change-feed.d.ts +25 -0
  11. package/dist/change-feed.d.ts.map +1 -0
  12. package/dist/chunks/admin-413jve1I.js +318 -0
  13. package/dist/chunks/admin-413jve1I.js.map +1 -0
  14. package/dist/chunks/dispatcher-C5AqtgtK.js +248 -0
  15. package/dist/chunks/dispatcher-C5AqtgtK.js.map +1 -0
  16. package/dist/dispatcher.d.ts +23 -0
  17. package/dist/dispatcher.d.ts.map +1 -0
  18. package/dist/events.d.ts +6 -0
  19. package/dist/events.d.ts.map +1 -0
  20. package/dist/index.d.ts +11 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/index.js +148 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/manifest.json +1032 -0
  25. package/dist/models.d.ts +43 -0
  26. package/dist/models.d.ts.map +1 -0
  27. package/dist/recipes.d.ts +23 -0
  28. package/dist/recipes.d.ts.map +1 -0
  29. package/dist/security.d.ts +15 -0
  30. package/dist/security.d.ts.map +1 -0
  31. package/dist/smrt-knowledge.json +418 -0
  32. package/dist/store.d.ts +26 -0
  33. package/dist/store.d.ts.map +1 -0
  34. package/dist/svelte/WebhookAdmin.svelte +113 -0
  35. package/dist/svelte/WebhookAdmin.svelte.d.ts +22 -0
  36. package/dist/svelte/WebhookAdmin.svelte.d.ts.map +1 -0
  37. package/dist/svelte/index.d.ts +2 -0
  38. package/dist/svelte/index.d.ts.map +1 -0
  39. package/dist/svelte/index.js +1 -0
  40. package/dist/types.d.ts +27 -0
  41. package/dist/types.d.ts.map +1 -0
  42. package/dist/types.js +0 -0
  43. package/package.json +75 -3
@@ -0,0 +1,1032 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "timestamp": 0,
4
+ "packageName": "@happyvertical/smrt-webhooks",
5
+ "packageVersion": "0.55.10",
6
+ "objects": {
7
+ "@happyvertical/smrt-webhooks:WebhookSubscription": {
8
+ "name": "webhooksubscription",
9
+ "className": "WebhookSubscription",
10
+ "qualifiedName": "@happyvertical/smrt-webhooks:WebhookSubscription",
11
+ "collection": "webhooksubscriptions",
12
+ "description": "Server-only subscription. Hosts authorize administration before accessing it.",
13
+ "filePath": "/home/runner/work/smrt/smrt/packages/webhooks/src/models.ts",
14
+ "packageName": "@happyvertical/smrt-webhooks",
15
+ "fields": {
16
+ "tenantId": {
17
+ "type": "text",
18
+ "required": true,
19
+ "_meta": {
20
+ "sqlType": "UUID",
21
+ "__tenancy": {
22
+ "isTenantIdField": true,
23
+ "autoFilter": true,
24
+ "required": true,
25
+ "autoPopulate": true,
26
+ "nullable": false,
27
+ "mode": "required",
28
+ "field": "tenantId",
29
+ "allowSuperAdminBypass": false
30
+ }
31
+ }
32
+ },
33
+ "url": {
34
+ "type": "text",
35
+ "required": true,
36
+ "_meta": {
37
+ "required": true
38
+ }
39
+ },
40
+ "events": {
41
+ "type": "json",
42
+ "required": false,
43
+ "_meta": {}
44
+ },
45
+ "models": {
46
+ "type": "json",
47
+ "required": false,
48
+ "_meta": {}
49
+ },
50
+ "secret": {
51
+ "type": "text",
52
+ "required": true,
53
+ "_meta": {
54
+ "sensitive": true,
55
+ "required": true
56
+ },
57
+ "sensitive": true
58
+ },
59
+ "enabled": {
60
+ "type": "boolean",
61
+ "required": false,
62
+ "default": true,
63
+ "_meta": {
64
+ "default": true
65
+ }
66
+ }
67
+ },
68
+ "methods": {
69
+ "save": {
70
+ "name": "save",
71
+ "async": true,
72
+ "parameters": [],
73
+ "returnType": "Promise<this>",
74
+ "isStatic": false,
75
+ "isPublic": true
76
+ }
77
+ },
78
+ "decoratorConfig": {
79
+ "tableName": "_smrt_webhook_subscriptions",
80
+ "api": false,
81
+ "cli": false,
82
+ "mcp": false,
83
+ "tenantScoped": {
84
+ "mode": "required"
85
+ },
86
+ "conflictColumns": [
87
+ "tenant_id",
88
+ "slug",
89
+ "context"
90
+ ]
91
+ },
92
+ "extends": "SmrtObject",
93
+ "exportName": "WebhookSubscription",
94
+ "collectionExportName": "WebhookSubscriptionCollection",
95
+ "validationRules": [
96
+ {
97
+ "field": "url",
98
+ "rule": "required",
99
+ "fieldType": "text"
100
+ },
101
+ {
102
+ "field": "secret",
103
+ "rule": "required",
104
+ "fieldType": "text"
105
+ }
106
+ ],
107
+ "schema": {
108
+ "tableName": "_smrt_webhook_subscriptions",
109
+ "ddl": "CREATE TABLE IF NOT EXISTS \"_smrt_webhook_subscriptions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"url\" TEXT NOT NULL,\n \"events\" JSON,\n \"models\" JSON,\n \"secret\" TEXT NOT NULL,\n \"enabled\" BOOLEAN DEFAULT TRUE\n);",
110
+ "columns": {
111
+ "id": {
112
+ "type": "UUID",
113
+ "primaryKey": true,
114
+ "referenceKind": "id",
115
+ "notNull": true
116
+ },
117
+ "slug": {
118
+ "type": "TEXT",
119
+ "notNull": true
120
+ },
121
+ "context": {
122
+ "type": "TEXT",
123
+ "notNull": true,
124
+ "default": ""
125
+ },
126
+ "created_at": {
127
+ "type": "TIMESTAMP",
128
+ "notNull": true,
129
+ "default": "current_timestamp"
130
+ },
131
+ "updated_at": {
132
+ "type": "TIMESTAMP",
133
+ "notNull": true,
134
+ "default": "current_timestamp"
135
+ },
136
+ "tenant_id": {
137
+ "type": "UUID",
138
+ "referenceKind": "tenantId",
139
+ "notNull": true,
140
+ "unique": false
141
+ },
142
+ "url": {
143
+ "type": "TEXT",
144
+ "notNull": true,
145
+ "unique": false
146
+ },
147
+ "events": {
148
+ "type": "JSON",
149
+ "notNull": false,
150
+ "unique": false
151
+ },
152
+ "models": {
153
+ "type": "JSON",
154
+ "notNull": false,
155
+ "unique": false
156
+ },
157
+ "secret": {
158
+ "type": "TEXT",
159
+ "notNull": true,
160
+ "unique": false
161
+ },
162
+ "enabled": {
163
+ "type": "BOOLEAN",
164
+ "notNull": false,
165
+ "unique": false,
166
+ "default": true
167
+ }
168
+ },
169
+ "indexes": [
170
+ {
171
+ "name": "_smrt_webhook_subscriptions_slug_context_idx",
172
+ "columns": [
173
+ "tenant_id",
174
+ "slug",
175
+ "context"
176
+ ],
177
+ "unique": true
178
+ },
179
+ {
180
+ "name": "_smrt_webhook_subscriptions_tenant_id_created_at_idx",
181
+ "columns": [
182
+ "tenant_id",
183
+ "created_at"
184
+ ]
185
+ }
186
+ ],
187
+ "version": "4e9ebebe"
188
+ },
189
+ "importPath": "@happyvertical/smrt-webhooks"
190
+ },
191
+ "@happyvertical/smrt-webhooks:WebhookSubscriptionCollection": {
192
+ "name": "webhooksubscriptioncollection",
193
+ "className": "WebhookSubscriptionCollection",
194
+ "qualifiedName": "@happyvertical/smrt-webhooks:WebhookSubscriptionCollection",
195
+ "collection": "webhooksubscriptions",
196
+ "filePath": "/home/runner/work/smrt/smrt/packages/webhooks/src/models.ts",
197
+ "packageName": "@happyvertical/smrt-webhooks",
198
+ "fields": {},
199
+ "methods": {},
200
+ "decoratorConfig": {
201
+ "tableName": "_smrt_webhook_subscriptions",
202
+ "api": false,
203
+ "mcp": false,
204
+ "cli": false
205
+ },
206
+ "extends": "SmrtCollection",
207
+ "extendsTypeArg": "WebhookSubscription",
208
+ "exportName": "WebhookSubscriptionCollection",
209
+ "collectionExportName": "WebhookSubscriptionCollectionCollection",
210
+ "schema": {
211
+ "tableName": "_smrt_webhook_subscriptions",
212
+ "ddl": "CREATE TABLE IF NOT EXISTS \"_smrt_webhook_subscriptions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"url\" TEXT NOT NULL,\n \"events\" JSON,\n \"models\" JSON,\n \"secret\" TEXT NOT NULL,\n \"enabled\" BOOLEAN DEFAULT TRUE\n);",
213
+ "columns": {
214
+ "id": {
215
+ "type": "UUID",
216
+ "primaryKey": true,
217
+ "referenceKind": "id",
218
+ "notNull": true
219
+ },
220
+ "slug": {
221
+ "type": "TEXT",
222
+ "notNull": true
223
+ },
224
+ "context": {
225
+ "type": "TEXT",
226
+ "notNull": true,
227
+ "default": ""
228
+ },
229
+ "created_at": {
230
+ "type": "TIMESTAMP",
231
+ "notNull": true,
232
+ "default": "current_timestamp"
233
+ },
234
+ "updated_at": {
235
+ "type": "TIMESTAMP",
236
+ "notNull": true,
237
+ "default": "current_timestamp"
238
+ },
239
+ "tenant_id": {
240
+ "type": "UUID",
241
+ "referenceKind": "tenantId",
242
+ "notNull": true,
243
+ "unique": false
244
+ },
245
+ "url": {
246
+ "type": "TEXT",
247
+ "notNull": true,
248
+ "unique": false
249
+ },
250
+ "events": {
251
+ "type": "JSON",
252
+ "notNull": false,
253
+ "unique": false
254
+ },
255
+ "models": {
256
+ "type": "JSON",
257
+ "notNull": false,
258
+ "unique": false
259
+ },
260
+ "secret": {
261
+ "type": "TEXT",
262
+ "notNull": true,
263
+ "unique": false
264
+ },
265
+ "enabled": {
266
+ "type": "BOOLEAN",
267
+ "notNull": false,
268
+ "unique": false,
269
+ "default": true
270
+ }
271
+ },
272
+ "indexes": [
273
+ {
274
+ "name": "_smrt_webhook_subscriptions_slug_context_idx",
275
+ "columns": [
276
+ "tenant_id",
277
+ "slug",
278
+ "context"
279
+ ],
280
+ "unique": true
281
+ },
282
+ {
283
+ "name": "_smrt_webhook_subscriptions_tenant_id_created_at_idx",
284
+ "columns": [
285
+ "tenant_id",
286
+ "created_at"
287
+ ]
288
+ }
289
+ ],
290
+ "version": "4e9ebebe"
291
+ },
292
+ "importPath": "@happyvertical/smrt-webhooks"
293
+ },
294
+ "@happyvertical/smrt-webhooks:WebhookDelivery": {
295
+ "name": "webhookdelivery",
296
+ "className": "WebhookDelivery",
297
+ "qualifiedName": "@happyvertical/smrt-webhooks:WebhookDelivery",
298
+ "collection": "webhookdeliveries",
299
+ "description": "Durable outbox and safe outcome metadata; payload never appears in public projections.",
300
+ "filePath": "/home/runner/work/smrt/smrt/packages/webhooks/src/models.ts",
301
+ "packageName": "@happyvertical/smrt-webhooks",
302
+ "fields": {
303
+ "tenantId": {
304
+ "type": "text",
305
+ "required": true,
306
+ "_meta": {
307
+ "sqlType": "UUID",
308
+ "__tenancy": {
309
+ "isTenantIdField": true,
310
+ "autoFilter": true,
311
+ "required": true,
312
+ "autoPopulate": true,
313
+ "nullable": false,
314
+ "mode": "required",
315
+ "field": "tenantId",
316
+ "allowSuperAdminBypass": false
317
+ }
318
+ }
319
+ },
320
+ "subscriptionId": {
321
+ "type": "foreignKey",
322
+ "required": false,
323
+ "related": "WebhookSubscription",
324
+ "_meta": {
325
+ "onDelete": "RESTRICT",
326
+ "onUpdate": "RESTRICT"
327
+ }
328
+ },
329
+ "eventId": {
330
+ "type": "text",
331
+ "required": true,
332
+ "_meta": {
333
+ "required": true
334
+ }
335
+ },
336
+ "payload": {
337
+ "type": "text",
338
+ "required": true,
339
+ "_meta": {
340
+ "required": true,
341
+ "sensitive": true
342
+ },
343
+ "sensitive": true
344
+ },
345
+ "status": {
346
+ "type": "text",
347
+ "required": false,
348
+ "default": "pending",
349
+ "_meta": {
350
+ "default": "pending"
351
+ }
352
+ },
353
+ "generation": {
354
+ "type": "integer",
355
+ "required": false,
356
+ "default": 0,
357
+ "_meta": {
358
+ "default": 0
359
+ }
360
+ },
361
+ "attempts": {
362
+ "type": "integer",
363
+ "required": false,
364
+ "default": 0,
365
+ "_meta": {
366
+ "default": 0
367
+ }
368
+ },
369
+ "responseStatus": {
370
+ "type": "integer",
371
+ "required": false,
372
+ "_meta": {
373
+ "nullable": true
374
+ }
375
+ },
376
+ "error": {
377
+ "type": "text",
378
+ "required": false,
379
+ "_meta": {
380
+ "nullable": true
381
+ }
382
+ },
383
+ "leaseToken": {
384
+ "type": "text",
385
+ "required": false,
386
+ "_meta": {
387
+ "nullable": true,
388
+ "sensitive": true
389
+ },
390
+ "sensitive": true
391
+ },
392
+ "leaseUntil": {
393
+ "type": "datetime",
394
+ "required": false,
395
+ "_meta": {
396
+ "nullable": true
397
+ }
398
+ }
399
+ },
400
+ "methods": {},
401
+ "decoratorConfig": {
402
+ "tableName": "_smrt_webhook_deliveries",
403
+ "api": false,
404
+ "cli": false,
405
+ "mcp": false,
406
+ "indexes": [
407
+ {
408
+ "name": "_smrt_webhook_delivery_identity",
409
+ "columns": [
410
+ "tenantId",
411
+ "subscriptionId",
412
+ "eventId"
413
+ ],
414
+ "unique": true
415
+ }
416
+ ],
417
+ "tenantScoped": {
418
+ "mode": "required"
419
+ },
420
+ "conflictColumns": [
421
+ "tenant_id",
422
+ "slug",
423
+ "context"
424
+ ]
425
+ },
426
+ "extends": "SmrtObject",
427
+ "exportName": "WebhookDelivery",
428
+ "collectionExportName": "WebhookDeliveryCollection",
429
+ "validationRules": [
430
+ {
431
+ "field": "eventId",
432
+ "rule": "required",
433
+ "fieldType": "text"
434
+ },
435
+ {
436
+ "field": "payload",
437
+ "rule": "required",
438
+ "fieldType": "text"
439
+ }
440
+ ],
441
+ "schema": {
442
+ "tableName": "_smrt_webhook_deliveries",
443
+ "ddl": "CREATE TABLE IF NOT EXISTS \"_smrt_webhook_deliveries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"subscription_id\" UUID,\n \"event_id\" TEXT NOT NULL,\n \"payload\" TEXT NOT NULL,\n \"status\" TEXT DEFAULT 'pending',\n \"generation\" INTEGER DEFAULT 0,\n \"attempts\" INTEGER DEFAULT 0,\n \"response_status\" INTEGER,\n \"error\" TEXT,\n \"lease_token\" TEXT,\n \"lease_until\" TIMESTAMP\n);",
444
+ "columns": {
445
+ "id": {
446
+ "type": "UUID",
447
+ "primaryKey": true,
448
+ "referenceKind": "id",
449
+ "notNull": true
450
+ },
451
+ "slug": {
452
+ "type": "TEXT",
453
+ "notNull": true
454
+ },
455
+ "context": {
456
+ "type": "TEXT",
457
+ "notNull": true,
458
+ "default": ""
459
+ },
460
+ "created_at": {
461
+ "type": "TIMESTAMP",
462
+ "notNull": true,
463
+ "default": "current_timestamp"
464
+ },
465
+ "updated_at": {
466
+ "type": "TIMESTAMP",
467
+ "notNull": true,
468
+ "default": "current_timestamp"
469
+ },
470
+ "tenant_id": {
471
+ "type": "UUID",
472
+ "referenceKind": "tenantId",
473
+ "notNull": true,
474
+ "unique": false
475
+ },
476
+ "subscription_id": {
477
+ "type": "UUID",
478
+ "referenceKind": "foreignKey",
479
+ "notNull": false,
480
+ "unique": false,
481
+ "foreignKey": {
482
+ "table": "_smrt_webhook_subscriptions",
483
+ "column": "id",
484
+ "onDelete": "RESTRICT",
485
+ "onUpdate": "RESTRICT"
486
+ }
487
+ },
488
+ "event_id": {
489
+ "type": "TEXT",
490
+ "notNull": true,
491
+ "unique": false
492
+ },
493
+ "payload": {
494
+ "type": "TEXT",
495
+ "notNull": true,
496
+ "unique": false
497
+ },
498
+ "status": {
499
+ "type": "TEXT",
500
+ "notNull": false,
501
+ "unique": false,
502
+ "default": "pending"
503
+ },
504
+ "generation": {
505
+ "type": "INTEGER",
506
+ "notNull": false,
507
+ "unique": false,
508
+ "default": 0
509
+ },
510
+ "attempts": {
511
+ "type": "INTEGER",
512
+ "notNull": false,
513
+ "unique": false,
514
+ "default": 0
515
+ },
516
+ "response_status": {
517
+ "type": "INTEGER",
518
+ "notNull": false,
519
+ "unique": false
520
+ },
521
+ "error": {
522
+ "type": "TEXT",
523
+ "notNull": false,
524
+ "unique": false
525
+ },
526
+ "lease_token": {
527
+ "type": "TEXT",
528
+ "notNull": false,
529
+ "unique": false
530
+ },
531
+ "lease_until": {
532
+ "type": "TIMESTAMP",
533
+ "notNull": false,
534
+ "unique": false
535
+ }
536
+ },
537
+ "indexes": [
538
+ {
539
+ "name": "_smrt_webhook_deliveries_slug_context_idx",
540
+ "columns": [
541
+ "tenant_id",
542
+ "slug",
543
+ "context"
544
+ ],
545
+ "unique": true
546
+ },
547
+ {
548
+ "name": "_smrt_webhook_delivery_identity",
549
+ "columns": [
550
+ "tenant_id",
551
+ "subscription_id",
552
+ "event_id"
553
+ ],
554
+ "unique": true
555
+ },
556
+ {
557
+ "name": "_smrt_webhook_deliveries_tenant_id_created_at_idx",
558
+ "columns": [
559
+ "tenant_id",
560
+ "created_at"
561
+ ]
562
+ },
563
+ {
564
+ "name": "_smrt_webhook_deliveries_subscription_id_idx",
565
+ "columns": [
566
+ "subscription_id"
567
+ ]
568
+ }
569
+ ],
570
+ "version": "17d7bd27"
571
+ },
572
+ "importPath": "@happyvertical/smrt-webhooks"
573
+ },
574
+ "@happyvertical/smrt-webhooks:WebhookDeliveryCollection": {
575
+ "name": "webhookdeliverycollection",
576
+ "className": "WebhookDeliveryCollection",
577
+ "qualifiedName": "@happyvertical/smrt-webhooks:WebhookDeliveryCollection",
578
+ "collection": "webhookdeliveries",
579
+ "filePath": "/home/runner/work/smrt/smrt/packages/webhooks/src/models.ts",
580
+ "packageName": "@happyvertical/smrt-webhooks",
581
+ "fields": {},
582
+ "methods": {},
583
+ "decoratorConfig": {
584
+ "tableName": "_smrt_webhook_deliveries",
585
+ "api": false,
586
+ "mcp": false,
587
+ "cli": false
588
+ },
589
+ "extends": "SmrtCollection",
590
+ "extendsTypeArg": "WebhookDelivery",
591
+ "exportName": "WebhookDeliveryCollection",
592
+ "collectionExportName": "WebhookDeliveryCollectionCollection",
593
+ "schema": {
594
+ "tableName": "_smrt_webhook_deliveries",
595
+ "ddl": "CREATE TABLE IF NOT EXISTS \"_smrt_webhook_deliveries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"subscription_id\" UUID,\n \"event_id\" TEXT NOT NULL,\n \"payload\" TEXT NOT NULL,\n \"status\" TEXT DEFAULT 'pending',\n \"generation\" INTEGER DEFAULT 0,\n \"attempts\" INTEGER DEFAULT 0,\n \"response_status\" INTEGER,\n \"error\" TEXT,\n \"lease_token\" TEXT,\n \"lease_until\" TIMESTAMP\n);",
596
+ "columns": {
597
+ "id": {
598
+ "type": "UUID",
599
+ "primaryKey": true,
600
+ "referenceKind": "id",
601
+ "notNull": true
602
+ },
603
+ "slug": {
604
+ "type": "TEXT",
605
+ "notNull": true
606
+ },
607
+ "context": {
608
+ "type": "TEXT",
609
+ "notNull": true,
610
+ "default": ""
611
+ },
612
+ "created_at": {
613
+ "type": "TIMESTAMP",
614
+ "notNull": true,
615
+ "default": "current_timestamp"
616
+ },
617
+ "updated_at": {
618
+ "type": "TIMESTAMP",
619
+ "notNull": true,
620
+ "default": "current_timestamp"
621
+ },
622
+ "tenant_id": {
623
+ "type": "UUID",
624
+ "referenceKind": "tenantId",
625
+ "notNull": true,
626
+ "unique": false
627
+ },
628
+ "subscription_id": {
629
+ "type": "UUID",
630
+ "referenceKind": "foreignKey",
631
+ "notNull": false,
632
+ "unique": false,
633
+ "foreignKey": {
634
+ "table": "_smrt_webhook_subscriptions",
635
+ "column": "id",
636
+ "onDelete": "RESTRICT",
637
+ "onUpdate": "RESTRICT"
638
+ }
639
+ },
640
+ "event_id": {
641
+ "type": "TEXT",
642
+ "notNull": true,
643
+ "unique": false
644
+ },
645
+ "payload": {
646
+ "type": "TEXT",
647
+ "notNull": true,
648
+ "unique": false
649
+ },
650
+ "status": {
651
+ "type": "TEXT",
652
+ "notNull": false,
653
+ "unique": false,
654
+ "default": "pending"
655
+ },
656
+ "generation": {
657
+ "type": "INTEGER",
658
+ "notNull": false,
659
+ "unique": false,
660
+ "default": 0
661
+ },
662
+ "attempts": {
663
+ "type": "INTEGER",
664
+ "notNull": false,
665
+ "unique": false,
666
+ "default": 0
667
+ },
668
+ "response_status": {
669
+ "type": "INTEGER",
670
+ "notNull": false,
671
+ "unique": false
672
+ },
673
+ "error": {
674
+ "type": "TEXT",
675
+ "notNull": false,
676
+ "unique": false
677
+ },
678
+ "lease_token": {
679
+ "type": "TEXT",
680
+ "notNull": false,
681
+ "unique": false
682
+ },
683
+ "lease_until": {
684
+ "type": "TIMESTAMP",
685
+ "notNull": false,
686
+ "unique": false
687
+ }
688
+ },
689
+ "indexes": [
690
+ {
691
+ "name": "_smrt_webhook_deliveries_slug_context_idx",
692
+ "columns": [
693
+ "tenant_id",
694
+ "slug",
695
+ "context"
696
+ ],
697
+ "unique": true
698
+ },
699
+ {
700
+ "name": "_smrt_webhook_delivery_identity",
701
+ "columns": [
702
+ "tenant_id",
703
+ "subscription_id",
704
+ "event_id"
705
+ ],
706
+ "unique": true
707
+ },
708
+ {
709
+ "name": "_smrt_webhook_deliveries_tenant_id_created_at_idx",
710
+ "columns": [
711
+ "tenant_id",
712
+ "created_at"
713
+ ]
714
+ },
715
+ {
716
+ "name": "_smrt_webhook_deliveries_subscription_id_idx",
717
+ "columns": [
718
+ "subscription_id"
719
+ ]
720
+ }
721
+ ],
722
+ "version": "17d7bd27"
723
+ },
724
+ "importPath": "@happyvertical/smrt-webhooks"
725
+ },
726
+ "@happyvertical/smrt-webhooks:WebhookDeliveryTask": {
727
+ "name": "webhookdeliverytask",
728
+ "className": "WebhookDeliveryTask",
729
+ "qualifiedName": "@happyvertical/smrt-webhooks:WebhookDeliveryTask",
730
+ "collection": "webhookdeliverytasks",
731
+ "description": "Jobs queue entry point; persisted arguments contain IDs only.",
732
+ "filePath": "/home/runner/work/smrt/smrt/packages/webhooks/src/models.ts",
733
+ "packageName": "@happyvertical/smrt-webhooks",
734
+ "fields": {},
735
+ "methods": {
736
+ "deliver": {
737
+ "name": "deliver",
738
+ "async": true,
739
+ "parameters": [
740
+ {
741
+ "name": "args",
742
+ "type": "Record<string, unknown>",
743
+ "optional": true
744
+ },
745
+ {
746
+ "name": "_context",
747
+ "type": "JobExecutionContext",
748
+ "optional": true
749
+ }
750
+ ],
751
+ "returnType": "Promise<void>",
752
+ "isStatic": false,
753
+ "isPublic": true
754
+ }
755
+ },
756
+ "decoratorConfig": {
757
+ "tableName": "_smrt_webhook_delivery_tasks",
758
+ "api": false,
759
+ "cli": false,
760
+ "mcp": false
761
+ },
762
+ "extends": "SmrtObject",
763
+ "exportName": "WebhookDeliveryTask",
764
+ "collectionExportName": "WebhookDeliveryTaskCollection",
765
+ "schema": {
766
+ "tableName": "_smrt_webhook_delivery_tasks",
767
+ "ddl": "CREATE TABLE IF NOT EXISTS \"_smrt_webhook_delivery_tasks\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
768
+ "columns": {
769
+ "id": {
770
+ "type": "UUID",
771
+ "primaryKey": true,
772
+ "referenceKind": "id",
773
+ "notNull": true
774
+ },
775
+ "slug": {
776
+ "type": "TEXT",
777
+ "notNull": true
778
+ },
779
+ "context": {
780
+ "type": "TEXT",
781
+ "notNull": true,
782
+ "default": ""
783
+ },
784
+ "created_at": {
785
+ "type": "TIMESTAMP",
786
+ "notNull": true,
787
+ "default": "current_timestamp"
788
+ },
789
+ "updated_at": {
790
+ "type": "TIMESTAMP",
791
+ "notNull": true,
792
+ "default": "current_timestamp"
793
+ }
794
+ },
795
+ "indexes": [
796
+ {
797
+ "name": "_smrt_webhook_delivery_tasks_slug_context_idx",
798
+ "columns": [
799
+ "slug",
800
+ "context"
801
+ ],
802
+ "unique": true
803
+ },
804
+ {
805
+ "name": "_smrt_webhook_delivery_tasks_created_at_idx",
806
+ "columns": [
807
+ "created_at"
808
+ ]
809
+ }
810
+ ],
811
+ "version": "17ba7c43"
812
+ },
813
+ "importPath": "@happyvertical/smrt-webhooks"
814
+ },
815
+ "@happyvertical/smrt-webhooks:WebhookCursor": {
816
+ "name": "webhookcursor",
817
+ "className": "WebhookCursor",
818
+ "qualifiedName": "@happyvertical/smrt-webhooks:WebhookCursor",
819
+ "collection": "webhookcursors",
820
+ "description": "Tenant-bound durable cursor for replayable model change-feed publication.",
821
+ "filePath": "/home/runner/work/smrt/smrt/packages/webhooks/src/models.ts",
822
+ "packageName": "@happyvertical/smrt-webhooks",
823
+ "fields": {
824
+ "tenantId": {
825
+ "type": "text",
826
+ "required": true,
827
+ "_meta": {
828
+ "sqlType": "UUID",
829
+ "__tenancy": {
830
+ "isTenantIdField": true,
831
+ "autoFilter": true,
832
+ "required": true,
833
+ "autoPopulate": true,
834
+ "nullable": false,
835
+ "mode": "required",
836
+ "field": "tenantId",
837
+ "allowSuperAdminBypass": false
838
+ }
839
+ }
840
+ },
841
+ "runtime": {
842
+ "type": "text",
843
+ "required": true,
844
+ "_meta": {
845
+ "required": true
846
+ }
847
+ },
848
+ "position": {
849
+ "type": "integer",
850
+ "required": false,
851
+ "default": 0,
852
+ "_meta": {
853
+ "default": 0
854
+ }
855
+ }
856
+ },
857
+ "methods": {},
858
+ "decoratorConfig": {
859
+ "tableName": "_smrt_webhook_cursors",
860
+ "api": false,
861
+ "cli": false,
862
+ "mcp": false,
863
+ "indexes": [
864
+ {
865
+ "name": "_smrt_webhook_cursor_identity",
866
+ "columns": [
867
+ "tenantId",
868
+ "runtime"
869
+ ],
870
+ "unique": true
871
+ }
872
+ ],
873
+ "tenantScoped": {
874
+ "mode": "required"
875
+ },
876
+ "conflictColumns": [
877
+ "tenant_id",
878
+ "slug",
879
+ "context"
880
+ ]
881
+ },
882
+ "extends": "SmrtObject",
883
+ "exportName": "WebhookCursor",
884
+ "collectionExportName": "WebhookCursorCollection",
885
+ "validationRules": [
886
+ {
887
+ "field": "runtime",
888
+ "rule": "required",
889
+ "fieldType": "text"
890
+ }
891
+ ],
892
+ "schema": {
893
+ "tableName": "_smrt_webhook_cursors",
894
+ "ddl": "CREATE TABLE IF NOT EXISTS \"_smrt_webhook_cursors\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"runtime\" TEXT NOT NULL,\n \"position\" INTEGER DEFAULT 0\n);",
895
+ "columns": {
896
+ "id": {
897
+ "type": "UUID",
898
+ "primaryKey": true,
899
+ "referenceKind": "id",
900
+ "notNull": true
901
+ },
902
+ "slug": {
903
+ "type": "TEXT",
904
+ "notNull": true
905
+ },
906
+ "context": {
907
+ "type": "TEXT",
908
+ "notNull": true,
909
+ "default": ""
910
+ },
911
+ "created_at": {
912
+ "type": "TIMESTAMP",
913
+ "notNull": true,
914
+ "default": "current_timestamp"
915
+ },
916
+ "updated_at": {
917
+ "type": "TIMESTAMP",
918
+ "notNull": true,
919
+ "default": "current_timestamp"
920
+ },
921
+ "tenant_id": {
922
+ "type": "UUID",
923
+ "referenceKind": "tenantId",
924
+ "notNull": true,
925
+ "unique": false
926
+ },
927
+ "runtime": {
928
+ "type": "TEXT",
929
+ "notNull": true,
930
+ "unique": false
931
+ },
932
+ "position": {
933
+ "type": "INTEGER",
934
+ "notNull": false,
935
+ "unique": false,
936
+ "default": 0
937
+ }
938
+ },
939
+ "indexes": [
940
+ {
941
+ "name": "_smrt_webhook_cursors_slug_context_idx",
942
+ "columns": [
943
+ "tenant_id",
944
+ "slug",
945
+ "context"
946
+ ],
947
+ "unique": true
948
+ },
949
+ {
950
+ "name": "_smrt_webhook_cursor_identity",
951
+ "columns": [
952
+ "tenant_id",
953
+ "runtime"
954
+ ],
955
+ "unique": true
956
+ },
957
+ {
958
+ "name": "_smrt_webhook_cursors_tenant_id_created_at_idx",
959
+ "columns": [
960
+ "tenant_id",
961
+ "created_at"
962
+ ]
963
+ }
964
+ ],
965
+ "version": "ba1ea19d"
966
+ },
967
+ "importPath": "@happyvertical/smrt-webhooks"
968
+ }
969
+ },
970
+ "moduleType": "smrt",
971
+ "recipes": [
972
+ {
973
+ "id": "integrations.webhooks",
974
+ "className": "WebhooksRecipe",
975
+ "label": "Outbound webhooks",
976
+ "summary": "Deliver signed model events and inspect delivery attempts from a server.",
977
+ "synonyms": [],
978
+ "models": [
979
+ "@happyvertical/smrt-webhooks:WebhookSubscription",
980
+ "@happyvertical/smrt-webhooks:WebhookDelivery",
981
+ "@happyvertical/smrt-webhooks:WebhookDeliveryTask",
982
+ "@happyvertical/smrt-webhooks:WebhookCursor"
983
+ ],
984
+ "nav": [],
985
+ "requires": [],
986
+ "group": {
987
+ "id": "integrations",
988
+ "label": "Integrations",
989
+ "summary": "Connect your application to external services."
990
+ },
991
+ "help": {
992
+ "markdown": "## Overview\n\nSend signed event notifications to an external HTTPS endpoint. Administrators\ncan pause subscriptions and inspect delivery attempts. This integration requires\na server and a running background worker.\n\n## Tasks\n\n- Add a subscription with a public HTTPS endpoint, signing secret, and event/model filters.\n- Disable a subscription to cancel unsent deliveries.\n- Inspect the delivery log, then retry failed deliveries after correcting their endpoint.\n- Ask the endpoint owner to verify signatures and deduplicate delivery IDs.\n",
993
+ "fieldRefs": []
994
+ },
995
+ "surfaces": [
996
+ {
997
+ "kind": "settings-panel",
998
+ "export": "@happyvertical/smrt-webhooks/svelte#WebhookAdmin",
999
+ "label": "Outbound webhooks"
1000
+ }
1001
+ ],
1002
+ "runtime": "server",
1003
+ "demo": {
1004
+ "mode": "server",
1005
+ "reasons": [
1006
+ "The recipe declares runtime \"server\".",
1007
+ "Needs a server because its package does not build for a browser: Intentionally server-only outbound delivery: node:crypto HMAC and node:https/dns/net pinned transport enforce signing and SSRF protection. Browser hosts use the separate /svelte admin export with authenticated server callbacks.; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3627, #3717)."
1008
+ ]
1009
+ }
1010
+ }
1011
+ ],
1012
+ "smrtDependencies": [
1013
+ "@happyvertical/smrt-core",
1014
+ "@happyvertical/smrt-jobs",
1015
+ "@happyvertical/smrt-tenancy"
1016
+ ],
1017
+ "browser": {
1018
+ "status": "server-only",
1019
+ "issues": [
1020
+ "#3615",
1021
+ "#3624",
1022
+ "#3627",
1023
+ "#3717"
1024
+ ],
1025
+ "reason": "Intentionally server-only outbound delivery: node:crypto HMAC and node:https/dns/net pinned transport enforce signing and SSRF protection. Browser hosts use the separate /svelte admin export with authenticated server callbacks.",
1026
+ "via": [
1027
+ "@happyvertical/smrt-jobs",
1028
+ "@happyvertical/smrt-tenancy"
1029
+ ]
1030
+ },
1031
+ "stampsConstructors": true
1032
+ }