@samva/webhooks 0.34.0 → 0.36.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.
@@ -1075,6 +1075,36 @@ export type DomainWarmingUpdatedEvent = {
1075
1075
  readonly [x: string]: JsonValue;
1076
1076
  };
1077
1077
  export type DomainWarmingUpdatedPayload = DomainWarmingUpdatedEvent["data"];
1078
+ export type EmailSendingPausedEvent = {
1079
+ readonly type: "email.sending.paused";
1080
+ readonly timestamp: string;
1081
+ readonly data: {
1082
+ readonly organizationId: string;
1083
+ readonly namespaceId: string | null;
1084
+ readonly channel: "email";
1085
+ readonly occurredAt: string;
1086
+ } & {
1087
+ readonly [x: string]: JsonValue;
1088
+ };
1089
+ } & {
1090
+ readonly [x: string]: JsonValue;
1091
+ };
1092
+ export type EmailSendingPausedPayload = EmailSendingPausedEvent["data"];
1093
+ export type EmailSendingResumedEvent = {
1094
+ readonly type: "email.sending.resumed";
1095
+ readonly timestamp: string;
1096
+ readonly data: {
1097
+ readonly organizationId: string;
1098
+ readonly namespaceId: string | null;
1099
+ readonly channel: "email";
1100
+ readonly occurredAt: string;
1101
+ } & {
1102
+ readonly [x: string]: JsonValue;
1103
+ };
1104
+ } & {
1105
+ readonly [x: string]: JsonValue;
1106
+ };
1107
+ export type EmailSendingResumedPayload = EmailSendingResumedEvent["data"];
1078
1108
  export type TemplateRegistrationUpdatedEvent = {
1079
1109
  readonly type: "template.registration.updated";
1080
1110
  readonly timestamp: string;
@@ -1199,7 +1229,7 @@ export type MailboxMessageReceivedEvent = {
1199
1229
  } & {
1200
1230
  readonly [x: string]: JsonValue;
1201
1231
  }) | null;
1202
- readonly channel?: "email" | "whatsapp" | "sms";
1232
+ readonly channel?: "sms" | "whatsapp" | "email";
1203
1233
  readonly threadId: string;
1204
1234
  readonly from: {
1205
1235
  readonly address: string;
@@ -1264,7 +1294,7 @@ export type MailboxMessageSentEvent = {
1264
1294
  } & {
1265
1295
  readonly [x: string]: JsonValue;
1266
1296
  }) | null;
1267
- readonly channel?: "email" | "whatsapp" | "sms";
1297
+ readonly channel?: "sms" | "whatsapp" | "email";
1268
1298
  readonly threadId: string;
1269
1299
  readonly from: {
1270
1300
  readonly address: string;
@@ -1304,14 +1334,58 @@ export type MailboxActionPendingApprovalEvent = {
1304
1334
  readonly namespaceId: string | null;
1305
1335
  readonly action: {
1306
1336
  readonly id: string;
1307
- readonly type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall";
1337
+ readonly type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall" | "handoff";
1338
+ readonly reviewRound: number;
1308
1339
  readonly state?: "approvalRequired";
1309
- readonly decision?: {
1310
- readonly outcome: "allow" | "requireApproval" | "deny";
1311
- readonly reason: string | null;
1312
- readonly policyId: string | null;
1313
- readonly source: "grant" | "installation" | "policy" | null;
1314
- readonly decidedAt: string;
1340
+ readonly decision: {
1341
+ readonly id: string;
1342
+ readonly reviewRound: number;
1343
+ readonly requirement: "run" | "model" | "person" | "never";
1344
+ readonly decider: "rule" | "model" | "person" | "agent";
1345
+ readonly outcome: "allow" | "hold" | "refuse";
1346
+ readonly reason: string;
1347
+ readonly scopes: ReadonlyArray<{
1348
+ readonly kind: "organization" | "mailbox" | "agent" | "apiKey";
1349
+ readonly id: string;
1350
+ } & {
1351
+ readonly [x: string]: JsonValue;
1352
+ }>;
1353
+ readonly rule?: ({
1354
+ readonly scope: {
1355
+ readonly kind: "organization" | "mailbox" | "agent" | "apiKey";
1356
+ readonly id: string;
1357
+ } & {
1358
+ readonly [x: string]: JsonValue;
1359
+ };
1360
+ readonly index: number;
1361
+ } & {
1362
+ readonly [x: string]: JsonValue;
1363
+ }) | null;
1364
+ readonly guard?: string | null;
1365
+ readonly guardReason?: string | null;
1366
+ readonly resolution?: ({
1367
+ readonly by: string;
1368
+ readonly at: string;
1369
+ readonly as: "approved" | "edited" | "denied" | "alwaysAllowed";
1370
+ readonly diff?: ({
1371
+ readonly text?: ({
1372
+ readonly before: string | null;
1373
+ readonly after: string | null;
1374
+ } & {
1375
+ readonly [x: string]: JsonValue;
1376
+ }) | null;
1377
+ readonly html?: ({
1378
+ readonly before: string | null;
1379
+ readonly after: string | null;
1380
+ } & {
1381
+ readonly [x: string]: JsonValue;
1382
+ }) | null;
1383
+ } & {
1384
+ readonly [x: string]: JsonValue;
1385
+ }) | null;
1386
+ } & {
1387
+ readonly [x: string]: JsonValue;
1388
+ }) | null;
1315
1389
  } & {
1316
1390
  readonly [x: string]: JsonValue;
1317
1391
  };
@@ -1360,7 +1434,8 @@ export type MailboxActionResolvedEvent = {
1360
1434
  readonly namespaceId: string | null;
1361
1435
  readonly action: {
1362
1436
  readonly id: string;
1363
- readonly type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall";
1437
+ readonly type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall" | "handoff";
1438
+ readonly reviewRound: number;
1364
1439
  readonly threadId: string | null;
1365
1440
  readonly proposedBy: {
1366
1441
  readonly kind: "user" | "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system";
@@ -1448,7 +1523,7 @@ export type MailboxMessageReleasedEvent = {
1448
1523
  } & {
1449
1524
  readonly [x: string]: JsonValue;
1450
1525
  }) | null;
1451
- readonly channel?: "email" | "whatsapp" | "sms";
1526
+ readonly channel?: "sms" | "whatsapp" | "email";
1452
1527
  readonly threadId: string;
1453
1528
  readonly from: {
1454
1529
  readonly address: string;
@@ -1533,7 +1608,7 @@ export type MailboxMessageDeliveredEvent = {
1533
1608
  readonly threadId: string;
1534
1609
  readonly actionId: string;
1535
1610
  readonly messageId: string;
1536
- readonly channel: "email" | "whatsapp" | "sms";
1611
+ readonly channel: "sms" | "whatsapp" | "email";
1537
1612
  readonly recipient: string;
1538
1613
  readonly occurredAt: string;
1539
1614
  readonly status: "delivered";
@@ -1553,7 +1628,7 @@ export type MailboxMessageReadEvent = {
1553
1628
  readonly threadId: string;
1554
1629
  readonly actionId: string;
1555
1630
  readonly messageId: string;
1556
- readonly channel: "email" | "whatsapp" | "sms";
1631
+ readonly channel: "sms" | "whatsapp" | "email";
1557
1632
  readonly recipient: string;
1558
1633
  readonly occurredAt: string;
1559
1634
  readonly status: "read";
@@ -1573,7 +1648,7 @@ export type MailboxMessageFailedEvent = {
1573
1648
  readonly threadId: string;
1574
1649
  readonly actionId: string;
1575
1650
  readonly messageId: string;
1576
- readonly channel: "email" | "whatsapp" | "sms";
1651
+ readonly channel: "sms" | "whatsapp" | "email";
1577
1652
  readonly recipient: string;
1578
1653
  readonly occurredAt: string;
1579
1654
  readonly status: "failed";
@@ -1616,7 +1691,7 @@ export type JourneyWebhookEvent = {
1616
1691
  readonly [x: string]: JsonValue;
1617
1692
  };
1618
1693
  export type JourneyWebhookPayload = JourneyWebhookEvent["data"];
1619
- export type SamvaWebhookEvent = MessageSentEvent | MessageDeliveredEvent | MessageReadEvent | MessageFailedEvent | MessageBouncedEvent | MessageComplainedEvent | MessageReceivedEvent | MessageOpenedEvent | MessageClickedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | ContactSubscribedEvent | ContactUnsubscribedEvent | ContactResubscribedEvent | ContactConsentChangedEvent | ConversationCreatedEvent | ConversationUpdatedEvent | ConversationArchivedEvent | WebhookCreatedEvent | WebhookUpdatedEvent | WebhookDeletedEvent | WebhookTestEvent | DomainUpdatedEvent | DomainWarmingUpdatedEvent | TemplateRegistrationUpdatedEvent | FlowRegistrationUpdatedEvent | WhatsappNumberConnectedEvent | MailboxMessageReceivedEvent | MailboxMessageSentEvent | MailboxActionPendingApprovalEvent | MailboxActionResolvedEvent | MailboxMessageQuarantinedEvent | MailboxMessageReleasedEvent | MailboxMessageDiscardedEvent | MailboxMessageDeliveredEvent | MailboxMessageReadEvent | MailboxMessageFailedEvent | JourneyWebhookEvent;
1694
+ export type SamvaWebhookEvent = MessageSentEvent | MessageDeliveredEvent | MessageReadEvent | MessageFailedEvent | MessageBouncedEvent | MessageComplainedEvent | MessageReceivedEvent | MessageOpenedEvent | MessageClickedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | ContactSubscribedEvent | ContactUnsubscribedEvent | ContactResubscribedEvent | ContactConsentChangedEvent | ConversationCreatedEvent | ConversationUpdatedEvent | ConversationArchivedEvent | WebhookCreatedEvent | WebhookUpdatedEvent | WebhookDeletedEvent | WebhookTestEvent | DomainUpdatedEvent | DomainWarmingUpdatedEvent | EmailSendingPausedEvent | EmailSendingResumedEvent | TemplateRegistrationUpdatedEvent | FlowRegistrationUpdatedEvent | WhatsappNumberConnectedEvent | MailboxMessageReceivedEvent | MailboxMessageSentEvent | MailboxActionPendingApprovalEvent | MailboxActionResolvedEvent | MailboxMessageQuarantinedEvent | MailboxMessageReleasedEvent | MailboxMessageDiscardedEvent | MailboxMessageDeliveredEvent | MailboxMessageReadEvent | MailboxMessageFailedEvent | JourneyWebhookEvent;
1620
1695
  export interface UnknownWebhookEvent {
1621
1696
  readonly type: string;
1622
1697
  readonly timestamp: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samva/webhooks",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "description": "Runtime-neutral verification for Samva webhook deliveries",
5
5
  "keywords": [
6
6
  "samva",
@@ -66,11 +66,11 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@effect/tsgo": "0.63.0",
69
- "@effect/vitest": "4.0.6",
69
+ "@effect/vitest": "^4.1.2",
70
70
  "@samva/openapi": "0.0.0",
71
71
  "ajv": "^8.20.0",
72
72
  "ajv-formats": "^3.0.1",
73
- "effect": "4.0.6",
73
+ "effect": "^4.1.2",
74
74
  "tsdown": "0.23.1",
75
75
  "typescript": "^7.0.2",
76
76
  "vitest": "5.0.3"