@samva/webhooks 0.20.0 → 0.22.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.
@@ -293,10 +293,10 @@ export type MessageReceivedEvent = {
293
293
  readonly language: string;
294
294
  readonly components: ReadonlyArray<{
295
295
  readonly type: "header" | "body" | "footer" | "button";
296
- readonly sub_type?: "url" | "quick_reply" | "copy_code" | null;
296
+ readonly sub_type?: "url" | "quick_reply" | "copy_code" | "flow" | null;
297
297
  readonly index?: string | null;
298
298
  readonly parameters: ReadonlyArray<{
299
- readonly type: "text" | "currency" | "date_time" | "image" | "document" | "video" | "coupon_code";
299
+ readonly type: "text" | "currency" | "date_time" | "image" | "document" | "video" | "coupon_code" | "action";
300
300
  readonly text?: string | null;
301
301
  readonly currency?: ({
302
302
  readonly fallback_value: string;
@@ -327,6 +327,11 @@ export type MessageReceivedEvent = {
327
327
  readonly [x: string]: JsonValue;
328
328
  }) | null;
329
329
  readonly coupon_code?: string | null;
330
+ readonly action?: ({
331
+ readonly flow_token: string;
332
+ } & {
333
+ readonly [x: string]: JsonValue;
334
+ }) | null;
330
335
  } & {
331
336
  readonly [x: string]: JsonValue;
332
337
  }>;
@@ -470,6 +475,7 @@ export type MessageReceivedEvent = {
470
475
  readonly flowId: string;
471
476
  readonly cta: string;
472
477
  readonly token?: string;
478
+ readonly action?: "navigate" | "data_exchange";
473
479
  readonly screen?: string;
474
480
  readonly data?: {
475
481
  readonly [x: string]: JsonValue;
@@ -1117,6 +1123,15 @@ export type FlowRegistrationUpdatedEvent = {
1117
1123
  } & {
1118
1124
  readonly [x: string]: JsonValue;
1119
1125
  }>;
1126
+ readonly endpointAlerts: ReadonlyArray<{
1127
+ readonly kind: string;
1128
+ readonly message: string;
1129
+ readonly value: number | null;
1130
+ readonly threshold: number | null;
1131
+ readonly activatedAt: string;
1132
+ } & {
1133
+ readonly [x: string]: JsonValue;
1134
+ }>;
1120
1135
  readonly publishedAt: string | null;
1121
1136
  readonly statusChangedAt: string;
1122
1137
  readonly createdAt: string;
@@ -1130,6 +1145,34 @@ export type FlowRegistrationUpdatedEvent = {
1130
1145
  readonly [x: string]: JsonValue;
1131
1146
  };
1132
1147
  export type FlowRegistrationUpdatedPayload = FlowRegistrationUpdatedEvent["data"];
1148
+ export type WhatsappNumberConnectedEvent = {
1149
+ readonly type: "whatsapp.number.connected";
1150
+ readonly timestamp: string;
1151
+ readonly data: {
1152
+ readonly organizationId: string;
1153
+ readonly namespaceId: string | null;
1154
+ readonly businessAccountId: string;
1155
+ readonly phoneNumber: string;
1156
+ readonly phoneNumberId: string;
1157
+ readonly whatsappBusinessAccountId: string;
1158
+ readonly displayName: string;
1159
+ readonly verificationStatus: "pending" | "verified" | "failed" | "suspended";
1160
+ readonly reconnected: boolean;
1161
+ readonly setupLink: ({
1162
+ readonly id: string;
1163
+ readonly metadata: {
1164
+ readonly [x: string]: JsonValue;
1165
+ };
1166
+ } & {
1167
+ readonly [x: string]: JsonValue;
1168
+ }) | null;
1169
+ } & {
1170
+ readonly [x: string]: JsonValue;
1171
+ };
1172
+ } & {
1173
+ readonly [x: string]: JsonValue;
1174
+ };
1175
+ export type WhatsappNumberConnectedPayload = WhatsappNumberConnectedEvent["data"];
1133
1176
  export type MailboxMessageReceivedEvent = {
1134
1177
  readonly type: "mailbox.message.received";
1135
1178
  readonly timestamp: string;
@@ -1468,7 +1511,7 @@ export type JourneyWebhookEvent = {
1468
1511
  readonly [x: string]: JsonValue;
1469
1512
  };
1470
1513
  export type JourneyWebhookPayload = JourneyWebhookEvent["data"];
1471
- 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 | MailboxMessageReceivedEvent | MailboxMessageSentEvent | MailboxActionPendingApprovalEvent | MailboxActionResolvedEvent | MailboxMessageQuarantinedEvent | MailboxMessageReleasedEvent | MailboxMessageDiscardedEvent | JourneyWebhookEvent;
1514
+ 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 | JourneyWebhookEvent;
1472
1515
  export interface UnknownWebhookEvent {
1473
1516
  readonly type: string;
1474
1517
  readonly timestamp: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samva/webhooks",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Runtime-neutral verification for Samva webhook deliveries",
5
5
  "keywords": [
6
6
  "samva",
@@ -60,13 +60,12 @@
60
60
  "prepack": "bun run build",
61
61
  "test": "bun run test:generation && vitest run --root ../.. --project packages packages/webhooks/tests",
62
62
  "typecheck": "tsc --noEmit",
63
- "generate": "bun run scripts/generate.ts",
64
- "test:generation": "bun run scripts/generate.ts --check",
63
+ "generate": "bun run --filter samva openapi:fetch && bun run scripts/generate.ts",
64
+ "test:generation": "bun run --filter samva openapi:fetch && bun run scripts/generate.ts --check",
65
65
  "test:bundle": "bun run build && bun run scripts/check-bundle.ts"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@effect/vitest": "4.0.0",
69
- "@samva/core": "0.0.0",
70
69
  "ajv": "^8.20.0",
71
70
  "ajv-formats": "^3.0.1",
72
71
  "effect": "4.0.0",