@samva/webhooks 0.55.0 → 0.56.1

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.
package/dist/effect.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Clock, Effect } from "effect";
2
- import { a as generateWebhookSecret, c as verifyWebhookAt, d as MalformedWebhookPayloadError, f as WebhookCryptoError, g as isKnownEvent, h as WebhookVerificationError, i as WEBHOOK_TIMESTAMP_HEADER, l as InvalidWebhookHeadersError, m as WebhookTimestampError, n as WEBHOOK_ID_HEADER, p as WebhookSignatureError, r as WEBHOOK_SIGNATURE_HEADER, s as signWebhook, t as DEFAULT_TOLERANCE_SECONDS, u as InvalidWebhookSecretError } from "./protocol-CwGXBskp.js";
3
- import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-t9dUV5my.js";
4
- import { ContactConsentChangedEventSchema, ContactCreatedEventSchema, ContactDeletedEventSchema, ContactResubscribedEventSchema, ContactSubscribedEventSchema, ContactUnsubscribedEventSchema, ContactUpdatedEventSchema, ConversationArchivedEventSchema, ConversationCreatedEventSchema, ConversationUpdatedEventSchema, DomainUpdatedEventSchema, DomainWarmingUpdatedEventSchema, EmailSendingPausedEventSchema, EmailSendingResumedEventSchema, FlowRegistrationUpdatedEventSchema, JourneyWebhookEventSchema, MailboxActionPendingApprovalEventSchema, MailboxActionResolvedEventSchema, MailboxMessageDeliveredEventSchema, MailboxMessageDiscardedEventSchema, MailboxMessageFailedEventSchema, MailboxMessageReadEventSchema, MailboxMessageReceivedEventSchema, MailboxMessageSentEventSchema, MailboxMessageSpamEventSchema, MailboxThreadDeletedEventSchema, MessageBouncedEventSchema, MessageClickedEventSchema, MessageComplainedEventSchema, MessageDeliveredEventSchema, MessageFailedEventSchema, MessageOpenedEventSchema, MessageReadEventSchema, MessageReceivedEventSchema, MessageSentEventSchema, SamvaWebhookEventSchema, TemplateRegistrationUpdatedEventSchema, WebhookCreatedEventSchema, WebhookDeletedEventSchema, WebhookTestEventSchema, WebhookUpdatedEventSchema, WhatsappNumberConnectedEventSchema } from "./schemas.gen.js";
2
+ import { a as generateWebhookSecret, c as verifyWebhookAt, d as MalformedWebhookPayloadError, f as WebhookCryptoError, g as isKnownEvent, h as WebhookVerificationError, i as WEBHOOK_TIMESTAMP_HEADER, l as InvalidWebhookHeadersError, m as WebhookTimestampError, n as WEBHOOK_ID_HEADER, p as WebhookSignatureError, r as WEBHOOK_SIGNATURE_HEADER, s as signWebhook, t as DEFAULT_TOLERANCE_SECONDS, u as InvalidWebhookSecretError } from "./protocol-DNsu129I.js";
3
+ import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-C9ypfxiZ.js";
4
+ import { ContactConsentChangedEventSchema, ContactCreatedEventSchema, ContactDeletedEventSchema, ContactResubscribedEventSchema, ContactSubscribedEventSchema, ContactUnsubscribedEventSchema, ContactUpdatedEventSchema, ConversationArchivedEventSchema, ConversationCreatedEventSchema, ConversationUpdatedEventSchema, DomainUpdatedEventSchema, DomainWarmingUpdatedEventSchema, EmailSendingPausedEventSchema, EmailSendingResumedEventSchema, FlowRegistrationUpdatedEventSchema, JourneyWebhookEventSchema, MailboxActionPendingApprovalEventSchema, MailboxActionResolvedEventSchema, MailboxMessageDeliveredEventSchema, MailboxMessageDiscardedEventSchema, MailboxMessageFailedEventSchema, MailboxMessageReadEventSchema, MailboxMessageReceivedEventSchema, MailboxMessageSentEventSchema, MailboxMessageSpamEventSchema, MailboxThreadDeletedEventSchema, MessageBouncedEventSchema, MessageClickedEventSchema, MessageComplainedEventSchema, MessageDeliveredEventSchema, MessageFailedEventSchema, MessageOpenedEventSchema, MessageReadEventSchema, MessageReceivedEventSchema, MessageSentEventSchema, SamvaWebhookEventSchema, TemplateRegistrationUpdatedEventSchema, WebhookCreatedEventSchema, WebhookDeletedEventSchema, WebhookTestEventSchema, WebhookUpdatedEventSchema, WhatsappNumberConnectedEventSchema, WhatsappNumberUpdatedEventSchema } from "./schemas.gen.js";
5
5
  // src/effect.ts
6
6
  /**
7
7
  * Fails with the verification errors `verifyWebhookAt` rejects with. Any other rejection, such as
@@ -74,6 +74,6 @@ const verifyRequest = Effect.fn("Webhooks.verifyRequest")(function* (request, se
74
74
  nowMilliseconds
75
75
  });
76
76
  });
77
- export { ContactConsentChangedEventSchema, ContactCreatedEventSchema, ContactDeletedEventSchema, ContactResubscribedEventSchema, ContactSubscribedEventSchema, ContactUnsubscribedEventSchema, ContactUpdatedEventSchema, ConversationArchivedEventSchema, ConversationCreatedEventSchema, ConversationUpdatedEventSchema, DEFAULT_TOLERANCE_SECONDS, DomainUpdatedEventSchema, DomainWarmingUpdatedEventSchema, EmailSendingPausedEventSchema, EmailSendingResumedEventSchema, FlowRegistrationUpdatedEventSchema, InvalidWebhookHeadersError, InvalidWebhookSecretError, JourneyWebhookEventSchema, MailboxActionPendingApprovalEventSchema, MailboxActionResolvedEventSchema, MailboxMessageDeliveredEventSchema, MailboxMessageDiscardedEventSchema, MailboxMessageFailedEventSchema, MailboxMessageReadEventSchema, MailboxMessageReceivedEventSchema, MailboxMessageSentEventSchema, MailboxMessageSpamEventSchema, MailboxThreadDeletedEventSchema, MalformedWebhookPayloadError, MessageBouncedEventSchema, MessageClickedEventSchema, MessageComplainedEventSchema, MessageDeliveredEventSchema, MessageFailedEventSchema, MessageOpenedEventSchema, MessageReadEventSchema, MessageReceivedEventSchema, MessageSentEventSchema, SamvaWebhookEventSchema, TemplateRegistrationUpdatedEventSchema, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, WebhookCreatedEventSchema, WebhookCryptoError, WebhookDeletedEventSchema, WebhookEventJsonSchemas, WebhookSignatureError, WebhookTestEventSchema, WebhookTimestampError, WebhookUpdatedEventSchema, WebhookVerificationError, WhatsappNumberConnectedEventSchema, generateWebhookSecret, isKnownEvent, signWebhook, verify, verifyRequest };
77
+ export { ContactConsentChangedEventSchema, ContactCreatedEventSchema, ContactDeletedEventSchema, ContactResubscribedEventSchema, ContactSubscribedEventSchema, ContactUnsubscribedEventSchema, ContactUpdatedEventSchema, ConversationArchivedEventSchema, ConversationCreatedEventSchema, ConversationUpdatedEventSchema, DEFAULT_TOLERANCE_SECONDS, DomainUpdatedEventSchema, DomainWarmingUpdatedEventSchema, EmailSendingPausedEventSchema, EmailSendingResumedEventSchema, FlowRegistrationUpdatedEventSchema, InvalidWebhookHeadersError, InvalidWebhookSecretError, JourneyWebhookEventSchema, MailboxActionPendingApprovalEventSchema, MailboxActionResolvedEventSchema, MailboxMessageDeliveredEventSchema, MailboxMessageDiscardedEventSchema, MailboxMessageFailedEventSchema, MailboxMessageReadEventSchema, MailboxMessageReceivedEventSchema, MailboxMessageSentEventSchema, MailboxMessageSpamEventSchema, MailboxThreadDeletedEventSchema, MalformedWebhookPayloadError, MessageBouncedEventSchema, MessageClickedEventSchema, MessageComplainedEventSchema, MessageDeliveredEventSchema, MessageFailedEventSchema, MessageOpenedEventSchema, MessageReadEventSchema, MessageReceivedEventSchema, MessageSentEventSchema, SamvaWebhookEventSchema, TemplateRegistrationUpdatedEventSchema, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, WebhookCreatedEventSchema, WebhookCryptoError, WebhookDeletedEventSchema, WebhookEventJsonSchemas, WebhookSignatureError, WebhookTestEventSchema, WebhookTimestampError, WebhookUpdatedEventSchema, WebhookVerificationError, WhatsappNumberConnectedEventSchema, WhatsappNumberUpdatedEventSchema, generateWebhookSecret, isKnownEvent, signWebhook, verify, verifyRequest };
78
78
 
79
79
  //# sourceMappingURL=effect.js.map
@@ -3174,6 +3174,7 @@ const WebhookEventJsonSchemas = {
3174
3174
  }, { type: "null" }] },
3175
3175
  providerTemplateId: { anyOf: [{ type: "string" }, { type: "null" }] },
3176
3176
  reason: { anyOf: [{ type: "string" }, { type: "null" }] },
3177
+ targetReleasedAt: { type: "string" },
3177
3178
  submittedAt: { anyOf: [{ type: "string" }, { type: "null" }] },
3178
3179
  statusChangedAt: { type: "string" },
3179
3180
  createdAt: { type: "string" },
@@ -3432,6 +3433,63 @@ const WebhookEventJsonSchemas = {
3432
3433
  ],
3433
3434
  additionalProperties: true
3434
3435
  },
3436
+ "whatsapp.number.updated": {
3437
+ type: "object",
3438
+ properties: {
3439
+ type: {
3440
+ type: "string",
3441
+ enum: ["whatsapp.number.updated"]
3442
+ },
3443
+ timestamp: { type: "string" },
3444
+ data: {
3445
+ type: "object",
3446
+ properties: {
3447
+ organizationId: {
3448
+ type: "string",
3449
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
3450
+ },
3451
+ namespaceId: { anyOf: [{
3452
+ type: "string",
3453
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3454
+ }, { type: "null" }] },
3455
+ businessAccountId: {
3456
+ type: "string",
3457
+ pattern: "^waba_[0-9a-hjkmnp-tv-z]{16,24}$"
3458
+ },
3459
+ phoneNumber: { type: "string" },
3460
+ phoneNumberId: { type: "string" },
3461
+ whatsappBusinessAccountId: { type: "string" },
3462
+ displayName: { type: "string" },
3463
+ verificationStatus: {
3464
+ type: "string",
3465
+ enum: [
3466
+ "pending",
3467
+ "verified",
3468
+ "failed",
3469
+ "suspended"
3470
+ ]
3471
+ }
3472
+ },
3473
+ required: [
3474
+ "organizationId",
3475
+ "namespaceId",
3476
+ "businessAccountId",
3477
+ "phoneNumber",
3478
+ "phoneNumberId",
3479
+ "whatsappBusinessAccountId",
3480
+ "displayName",
3481
+ "verificationStatus"
3482
+ ],
3483
+ additionalProperties: true
3484
+ }
3485
+ },
3486
+ required: [
3487
+ "type",
3488
+ "timestamp",
3489
+ "data"
3490
+ ],
3491
+ additionalProperties: true
3492
+ },
3435
3493
  "mailbox.message.received": {
3436
3494
  type: "object",
3437
3495
  properties: {
@@ -4828,4 +4886,4 @@ const WebhookEventJsonSchemas = {
4828
4886
  };
4829
4887
  export { WebhookEventJsonSchemas as t };
4830
4888
 
4831
- //# sourceMappingURL=json-schemas.gen-t9dUV5my.js.map
4889
+ //# sourceMappingURL=json-schemas.gen-C9ypfxiZ.js.map
package/dist/promise.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as generateWebhookSecret, c as verifyWebhookAt, d as MalformedWebhookPayloadError, f as WebhookCryptoError, g as isKnownEvent, h as WebhookVerificationError, i as WEBHOOK_TIMESTAMP_HEADER, l as InvalidWebhookHeadersError, m as WebhookTimestampError, n as WEBHOOK_ID_HEADER, o as readWebhookHeaders, p as WebhookSignatureError, r as WEBHOOK_SIGNATURE_HEADER, s as signWebhook, t as DEFAULT_TOLERANCE_SECONDS, u as InvalidWebhookSecretError } from "./protocol-CwGXBskp.js";
2
- import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-t9dUV5my.js";
1
+ import { a as generateWebhookSecret, c as verifyWebhookAt, d as MalformedWebhookPayloadError, f as WebhookCryptoError, g as isKnownEvent, h as WebhookVerificationError, i as WEBHOOK_TIMESTAMP_HEADER, l as InvalidWebhookHeadersError, m as WebhookTimestampError, n as WEBHOOK_ID_HEADER, o as readWebhookHeaders, p as WebhookSignatureError, r as WEBHOOK_SIGNATURE_HEADER, s as signWebhook, t as DEFAULT_TOLERANCE_SECONDS, u as InvalidWebhookSecretError } from "./protocol-DNsu129I.js";
2
+ import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-C9ypfxiZ.js";
3
3
  // src/promise.ts
4
4
  /**
5
5
  * Verifies a Samva webhook delivery from its body and header values, then returns its ID and
@@ -235,7 +235,7 @@ const validate1376 = (value) => isObject(value) && isObject(value) && Object.has
235
235
  const validate1377 = (value) => typeof value === "string" && value === "email.sending.resumed";
236
236
  const validate1386 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1387(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1389(value["data"]));
237
237
  const validate1387 = (value) => typeof value === "string" && value === "template.registration.updated";
238
- const validate1389 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "templateId") && Object.hasOwn(value, "publicationId") && Object.hasOwn(value, "templateChannelVariantId") && Object.hasOwn(value, "target") && Object.hasOwn(value, "name") && Object.hasOwn(value, "language") && Object.hasOwn(value, "status") && Object.hasOwn(value, "pendingTemplateChannelVariantId") && Object.hasOwn(value, "category") && Object.hasOwn(value, "providerCategory") && Object.hasOwn(value, "providerTemplateId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "submittedAt") && Object.hasOwn(value, "statusChangedAt") && Object.hasOwn(value, "createdAt") && Object.hasOwn(value, "updatedAt") && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "previousStatus") && (!Object.hasOwn(value, "id") || validate1390(value["id"])) && (!Object.hasOwn(value, "templateId") || validate1391(value["templateId"])) && (!Object.hasOwn(value, "publicationId") || validate1392(value["publicationId"])) && (!Object.hasOwn(value, "templateChannelVariantId") || validate1393(value["templateChannelVariantId"])) && (!Object.hasOwn(value, "target") || validate1394(value["target"])) && (!Object.hasOwn(value, "name") || validate2(value["name"])) && (!Object.hasOwn(value, "language") || validate2(value["language"])) && (!Object.hasOwn(value, "status") || validate1404(value["status"])) && (!Object.hasOwn(value, "pendingTemplateChannelVariantId") || validate1405(value["pendingTemplateChannelVariantId"])) && (!Object.hasOwn(value, "category") || validate1408(value["category"])) && (!Object.hasOwn(value, "providerCategory") || validate1409(value["providerCategory"])) && (!Object.hasOwn(value, "providerTemplateId") || validate8(value["providerTemplateId"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"])) && (!Object.hasOwn(value, "submittedAt") || validate8(value["submittedAt"])) && (!Object.hasOwn(value, "statusChangedAt") || validate2(value["statusChangedAt"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"])) && (!Object.hasOwn(value, "updatedAt") || validate2(value["updatedAt"])) && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1404(value["previousStatus"]));
238
+ const validate1389 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "templateId") && Object.hasOwn(value, "publicationId") && Object.hasOwn(value, "templateChannelVariantId") && Object.hasOwn(value, "target") && Object.hasOwn(value, "name") && Object.hasOwn(value, "language") && Object.hasOwn(value, "status") && Object.hasOwn(value, "pendingTemplateChannelVariantId") && Object.hasOwn(value, "category") && Object.hasOwn(value, "providerCategory") && Object.hasOwn(value, "providerTemplateId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "submittedAt") && Object.hasOwn(value, "statusChangedAt") && Object.hasOwn(value, "createdAt") && Object.hasOwn(value, "updatedAt") && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "previousStatus") && (!Object.hasOwn(value, "id") || validate1390(value["id"])) && (!Object.hasOwn(value, "templateId") || validate1391(value["templateId"])) && (!Object.hasOwn(value, "publicationId") || validate1392(value["publicationId"])) && (!Object.hasOwn(value, "templateChannelVariantId") || validate1393(value["templateChannelVariantId"])) && (!Object.hasOwn(value, "target") || validate1394(value["target"])) && (!Object.hasOwn(value, "name") || validate2(value["name"])) && (!Object.hasOwn(value, "language") || validate2(value["language"])) && (!Object.hasOwn(value, "status") || validate1404(value["status"])) && (!Object.hasOwn(value, "pendingTemplateChannelVariantId") || validate1405(value["pendingTemplateChannelVariantId"])) && (!Object.hasOwn(value, "category") || validate1408(value["category"])) && (!Object.hasOwn(value, "providerCategory") || validate1409(value["providerCategory"])) && (!Object.hasOwn(value, "providerTemplateId") || validate8(value["providerTemplateId"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"])) && (!Object.hasOwn(value, "targetReleasedAt") || validate2(value["targetReleasedAt"])) && (!Object.hasOwn(value, "submittedAt") || validate8(value["submittedAt"])) && (!Object.hasOwn(value, "statusChangedAt") || validate2(value["statusChangedAt"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"])) && (!Object.hasOwn(value, "updatedAt") || validate2(value["updatedAt"])) && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1404(value["previousStatus"]));
239
239
  const validate1390 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^treg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
240
240
  const validate1391 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
241
241
  const validate1392 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tpub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
@@ -249,118 +249,121 @@ const validate1404 = (value) => typeof value === "string" && (value === "draft"
249
249
  const validate1405 = (value) => validate1393(value) || validate6(value);
250
250
  const validate1408 = (value) => typeof value === "string" && (value === "marketing" || value === "utility" || value === "authentication" || value === "transactional" || value === "service_implicit" || value === "service_explicit" || value === "promotional");
251
251
  const validate1409 = (value) => validate1408(value) || validate6(value);
252
- const validate1426 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1427(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1429(value["data"]));
253
- const validate1427 = (value) => typeof value === "string" && value === "flow.registration.updated";
254
- const validate1429 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "flowId") && Object.hasOwn(value, "versionId") && Object.hasOwn(value, "versionNumber") && Object.hasOwn(value, "wabaId") && Object.hasOwn(value, "providerFlowId") && Object.hasOwn(value, "name") && Object.hasOwn(value, "status") && Object.hasOwn(value, "validationErrors") && Object.hasOwn(value, "endpointAlerts") && Object.hasOwn(value, "publishedAt") && Object.hasOwn(value, "statusChangedAt") && Object.hasOwn(value, "createdAt") && Object.hasOwn(value, "updatedAt") && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "previousStatus") && (!Object.hasOwn(value, "id") || validate1430(value["id"])) && (!Object.hasOwn(value, "flowId") || validate781(value["flowId"])) && (!Object.hasOwn(value, "versionId") || validate787(value["versionId"])) && (!Object.hasOwn(value, "versionNumber") || validate1311(value["versionNumber"])) && (!Object.hasOwn(value, "wabaId") || validate2(value["wabaId"])) && (!Object.hasOwn(value, "providerFlowId") || validate8(value["providerFlowId"])) && (!Object.hasOwn(value, "name") || validate2(value["name"])) && (!Object.hasOwn(value, "status") || validate1439(value["status"])) && (!Object.hasOwn(value, "validationErrors") || validate1440(value["validationErrors"])) && (!Object.hasOwn(value, "endpointAlerts") || validate1447(value["endpointAlerts"])) && (!Object.hasOwn(value, "publishedAt") || validate8(value["publishedAt"])) && (!Object.hasOwn(value, "statusChangedAt") || validate2(value["statusChangedAt"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"])) && (!Object.hasOwn(value, "updatedAt") || validate2(value["updatedAt"])) && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1465(value["previousStatus"]));
255
- const validate1430 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wafreg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
256
- const validate1439 = (value) => typeof value === "string" && (value === "draft" || value === "published" || value === "throttled" || value === "blocked" || value === "deprecated");
257
- const validate1440 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1441);
258
- const validate1441 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "error") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "error") || validate2(value["error"])) && (!Object.hasOwn(value, "message") || validate2(value["message"])) && (!Object.hasOwn(value, "path") || validate2(value["path"])) && (!Object.hasOwn(value, "line") || validate1311(value["line"])) && (!Object.hasOwn(value, "column") || validate1311(value["column"]));
259
- const validate1447 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1448);
260
- const validate1448 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "message") && Object.hasOwn(value, "value") && Object.hasOwn(value, "threshold") && Object.hasOwn(value, "activatedAt") && (!Object.hasOwn(value, "kind") || validate2(value["kind"])) && (!Object.hasOwn(value, "message") || validate2(value["message"])) && (!Object.hasOwn(value, "value") || validate14(value["value"])) && (!Object.hasOwn(value, "threshold") || validate14(value["threshold"])) && (!Object.hasOwn(value, "activatedAt") || validate2(value["activatedAt"]));
261
- const validate1465 = (value) => validate1439(value) || validate6(value);
262
- const validate1468 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1469(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1471(value["data"]));
263
- const validate1469 = (value) => typeof value === "string" && value === "whatsapp.number.connected";
264
- const validate1471 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "businessAccountId") && Object.hasOwn(value, "phoneNumber") && Object.hasOwn(value, "phoneNumberId") && Object.hasOwn(value, "whatsappBusinessAccountId") && Object.hasOwn(value, "displayName") && Object.hasOwn(value, "verificationStatus") && Object.hasOwn(value, "reconnected") && Object.hasOwn(value, "setupLink") && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "businessAccountId") || validate1476(value["businessAccountId"])) && (!Object.hasOwn(value, "phoneNumber") || validate2(value["phoneNumber"])) && (!Object.hasOwn(value, "phoneNumberId") || validate2(value["phoneNumberId"])) && (!Object.hasOwn(value, "whatsappBusinessAccountId") || validate2(value["whatsappBusinessAccountId"])) && (!Object.hasOwn(value, "displayName") || validate2(value["displayName"])) && (!Object.hasOwn(value, "verificationStatus") || validate1481(value["verificationStatus"])) && (!Object.hasOwn(value, "reconnected") || validate37(value["reconnected"])) && (!Object.hasOwn(value, "setupLink") || validate1483(value["setupLink"]));
265
- const validate1476 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^waba_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
266
- const validate1481 = (value) => typeof value === "string" && (value === "pending" || value === "verified" || value === "failed" || value === "suspended");
267
- const validate1483 = (value) => validate1484(value) || validate6(value);
268
- const validate1484 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "metadata") && (!Object.hasOwn(value, "id") || validate1485(value["id"])) && (!Object.hasOwn(value, "metadata") || validate1486(value["metadata"]));
269
- const validate1485 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wasl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
270
- const validate1486 = (value) => isObject(value) && isObject(value);
271
- const validate1488 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1489(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1491(value["data"]));
272
- const validate1489 = (value) => typeof value === "string" && value === "mailbox.message.received";
273
- const validate1491 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "message") && Object.hasOwn(value, "thread") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "message") || validate1496(value["message"])) && (!Object.hasOwn(value, "thread") || validate1531(value["thread"]));
274
- const validate1496 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "from") && Object.hasOwn(value, "to") && Object.hasOwn(value, "cc") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "text") && Object.hasOwn(value, "replyText") && Object.hasOwn(value, "attachments") && Object.hasOwn(value, "occurredAt") && (!Object.hasOwn(value, "flowSubmissionHandledBy") || validate871(value["flowSubmissionHandledBy"])) && (!Object.hasOwn(value, "id") || validate814(value["id"])) && (!Object.hasOwn(value, "campaign") || validate624(value["campaign"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "threadId") || validate1505(value["threadId"])) && (!Object.hasOwn(value, "from") || validate1506(value["from"])) && (!Object.hasOwn(value, "to") || validate49(value["to"])) && (!Object.hasOwn(value, "cc") || validate49(value["cc"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "text") || validate8(value["text"])) && (!Object.hasOwn(value, "replyText") || validate8(value["replyText"])) && (!Object.hasOwn(value, "attachments") || validate1524(value["attachments"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"]));
275
- const validate1505 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^thread_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
276
- const validate1506 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "address") && (!Object.hasOwn(value, "address") || validate2(value["address"])) && (!Object.hasOwn(value, "name") || validate8(value["name"]));
277
- const validate1524 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1525);
278
- const validate1525 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "filename") && Object.hasOwn(value, "contentType") && Object.hasOwn(value, "size") && (!Object.hasOwn(value, "id") || validate1526(value["id"])) && (!Object.hasOwn(value, "filename") || validate2(value["filename"])) && (!Object.hasOwn(value, "contentType") || validate2(value["contentType"])) && (!Object.hasOwn(value, "size") || validate15(value["size"]));
279
- const validate1526 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
280
- const validate1531 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "preview") && (!Object.hasOwn(value, "id") || validate1505(value["id"])) && (!Object.hasOwn(value, "endpointId") || validate1533(value["endpointId"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "preview") || validate8(value["preview"]));
281
- const validate1533 = (value) => validate1534(value) || validate6(value);
282
- const validate1534 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
283
- const validate1542 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1543(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1545(value["data"]));
284
- const validate1543 = (value) => typeof value === "string" && value === "mailbox.message.sent";
285
- const validate1545 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "actionId") && Object.hasOwn(value, "actor") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "actionId") || validate1550(value["actionId"])) && (!Object.hasOwn(value, "state") || validate1551(value["state"])) && (!Object.hasOwn(value, "acceptedAt") || validate2(value["acceptedAt"])) && (!Object.hasOwn(value, "actor") || validate1553(value["actor"])) && (!Object.hasOwn(value, "message") || validate1496(value["message"]));
286
- const validate1550 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
287
- const validate1551 = (value) => typeof value === "string" && value === "completed";
288
- const validate1553 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && Object.hasOwn(value, "source") && (!Object.hasOwn(value, "kind") || validate1554(value["kind"])) && (!Object.hasOwn(value, "id") || validate2(value["id"])) && (!Object.hasOwn(value, "displayName") || validate8(value["displayName"])) && (!Object.hasOwn(value, "source") || validate1559(value["source"]));
289
- const validate1554 = (value) => typeof value === "string" && (value === "user" || value === "apiKey" || value === "extension" || value === "externalAgent" || value === "samvaAgent" || value === "system");
290
- const validate1559 = (value) => typeof value === "string" && (value === "humanUi" || value === "externalApi" || value === "externalAgent" || value === "extension" || value === "samvaManagedAgent" || value === "system");
291
- const validate1595 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1596(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1598(value["data"]));
292
- const validate1596 = (value) => typeof value === "string" && value === "mailbox.action.pending_approval";
293
- const validate1598 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "action") && Object.hasOwn(value, "draft") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1603(value["action"])) && (!Object.hasOwn(value, "draft") || validate1673(value["draft"])) && (!Object.hasOwn(value, "tool") || validate1683(value["tool"]));
294
- const validate1603 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "type") && Object.hasOwn(value, "reviewRound") && Object.hasOwn(value, "decision") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "proposedBy") && Object.hasOwn(value, "createdAt") && (!Object.hasOwn(value, "id") || validate1550(value["id"])) && (!Object.hasOwn(value, "type") || validate1605(value["type"])) && (!Object.hasOwn(value, "reviewRound") || validate1606(value["reviewRound"])) && (!Object.hasOwn(value, "state") || validate1607(value["state"])) && (!Object.hasOwn(value, "decision") || validate1608(value["decision"])) && (!Object.hasOwn(value, "threadId") || validate1659(value["threadId"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"])) && (!Object.hasOwn(value, "proposedBy") || validate1553(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
295
- const validate1605 = (value) => typeof value === "string" && (value === "sendMessage" || value === "reply" || value === "updateDraft" || value === "createNote" || value === "assignThread" || value === "changeThreadState" || value === "call" || value === "extensionRequest" || value === "toolCall" || value === "handoff");
296
- const validate1606 = (value) => typeof value === "number" && Number.isInteger(value) && typeof value === "number" && value <= 0x1fffffffffffff && typeof value === "number" && value > 0;
297
- const validate1607 = (value) => typeof value === "string" && value === "approvalRequired";
298
- const validate1608 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "reviewRound") && Object.hasOwn(value, "requirement") && Object.hasOwn(value, "decider") && Object.hasOwn(value, "outcome") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "scopes") && (!Object.hasOwn(value, "id") || validate1609(value["id"])) && (!Object.hasOwn(value, "reviewRound") || validate1606(value["reviewRound"])) && (!Object.hasOwn(value, "requirement") || validate1611(value["requirement"])) && (!Object.hasOwn(value, "decider") || validate1612(value["decider"])) && (!Object.hasOwn(value, "outcome") || validate1613(value["outcome"])) && (!Object.hasOwn(value, "reason") || validate1614(value["reason"])) && (!Object.hasOwn(value, "scopes") || validate1615(value["scopes"])) && (!Object.hasOwn(value, "rule") || validate1619(value["rule"])) && (!Object.hasOwn(value, "guard") || validate1626(value["guard"])) && (!Object.hasOwn(value, "guardReason") || validate1626(value["guardReason"])) && (!Object.hasOwn(value, "resolution") || validate1632(value["resolution"]));
299
- const validate1609 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^pdec_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
300
- const validate1611 = (value) => typeof value === "string" && (value === "run" || value === "model" || value === "person" || value === "never");
301
- const validate1612 = (value) => typeof value === "string" && (value === "rule" || value === "model" || value === "person" || value === "agent");
302
- const validate1613 = (value) => typeof value === "string" && (value === "allow" || value === "hold" || value === "refuse");
303
- const validate1614 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1;
304
- const validate1615 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1616);
305
- const validate1616 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && (!Object.hasOwn(value, "kind") || validate1617(value["kind"])) && (!Object.hasOwn(value, "id") || validate1614(value["id"]));
306
- const validate1617 = (value) => typeof value === "string" && (value === "organization" || value === "integration" || value === "mailbox" || value === "agent" || value === "apiKey");
307
- const validate1619 = (value) => validate1620(value) || validate6(value);
308
- const validate1620 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "scope") && Object.hasOwn(value, "index") && (!Object.hasOwn(value, "scope") || validate1616(value["scope"])) && (!Object.hasOwn(value, "index") || validate1624(value["index"]));
309
- const validate1624 = (value) => typeof value === "number" && Number.isInteger(value) && typeof value === "number" && value >= 0 && typeof value === "number" && value <= 0x1fffffffffffff;
310
- const validate1626 = (value) => validate1614(value) || validate6(value);
311
- const validate1632 = (value) => validate1633(value) || validate6(value);
312
- const validate1633 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "by") && Object.hasOwn(value, "at") && Object.hasOwn(value, "as") && (!Object.hasOwn(value, "by") || validate1634(value["by"])) && (!Object.hasOwn(value, "at") || validate2(value["at"])) && (!Object.hasOwn(value, "as") || validate1636(value["as"])) && (!Object.hasOwn(value, "diff") || validate1637(value["diff"]));
313
- const validate1634 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^user_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
314
- const validate1636 = (value) => typeof value === "string" && (value === "approved" || value === "edited" || value === "denied" || value === "alwaysAllowed");
315
- const validate1637 = (value) => validate1638(value) || validate6(value);
316
- const validate1638 = (value) => isObject(value) && isObject(value) && (!Object.hasOwn(value, "text") || validate1639(value["text"])) && (!Object.hasOwn(value, "html") || validate1639(value["html"]));
317
- const validate1639 = (value) => validate1640(value) || validate6(value);
318
- const validate1640 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "before") && Object.hasOwn(value, "after") && (!Object.hasOwn(value, "before") || validate8(value["before"])) && (!Object.hasOwn(value, "after") || validate8(value["after"]));
319
- const validate1659 = (value) => validate1505(value) || validate6(value);
320
- const validate1673 = (value) => validate1674(value) || validate6(value);
321
- const validate1674 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "to") && Object.hasOwn(value, "cc") && Object.hasOwn(value, "subject") && (!Object.hasOwn(value, "to") || validate49(value["to"])) && (!Object.hasOwn(value, "cc") || validate49(value["cc"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"]));
322
- const validate1683 = (value) => validate1684(value) || validate6(value);
323
- const validate1684 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "name") && Object.hasOwn(value, "argumentsHash") && Object.hasOwn(value, "arguments") && (!Object.hasOwn(value, "name") || validate1685(value["name"])) && (!Object.hasOwn(value, "argumentsHash") || validate1686(value["argumentsHash"])) && (!Object.hasOwn(value, "arguments") || validate12(value["arguments"]));
324
- const validate1685 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1 && typeof value === "string" && Array.from(value).length <= 128;
325
- const validate1686 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^[0-9a-f]{64}$", "u")).test(value);
326
- const validate1689 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1690(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1692(value["data"]));
327
- const validate1690 = (value) => typeof value === "string" && value === "mailbox.action.resolved";
328
- const validate1692 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "action") && Object.hasOwn(value, "resolution") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1697(value["action"])) && (!Object.hasOwn(value, "resolution") || validate1712(value["resolution"]));
329
- const validate1697 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "type") && Object.hasOwn(value, "reviewRound") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "proposedBy") && Object.hasOwn(value, "createdAt") && (!Object.hasOwn(value, "id") || validate1550(value["id"])) && (!Object.hasOwn(value, "type") || validate1605(value["type"])) && (!Object.hasOwn(value, "reviewRound") || validate1606(value["reviewRound"])) && (!Object.hasOwn(value, "threadId") || validate1659(value["threadId"])) && (!Object.hasOwn(value, "proposedBy") || validate1553(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
330
- const validate1712 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "outcome") && Object.hasOwn(value, "actor") && Object.hasOwn(value, "resolvedAt") && Object.hasOwn(value, "reason") && (!Object.hasOwn(value, "outcome") || validate1713(value["outcome"])) && (!Object.hasOwn(value, "actor") || validate1553(value["actor"])) && (!Object.hasOwn(value, "resolvedAt") || validate2(value["resolvedAt"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"]));
331
- const validate1713 = (value) => typeof value === "string" && (value === "approved" || value === "denied" || value === "cancelled");
332
- const validate1725 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1726(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1728(value["data"]));
333
- const validate1726 = (value) => typeof value === "string" && value === "mailbox.message.spam";
334
- const validate1728 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "disposition") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "source") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "disposition") || validate1733(value["disposition"])) && (!Object.hasOwn(value, "threadId") || validate1659(value["threadId"])) && (!Object.hasOwn(value, "reason") || validate621(value["reason"])) && (!Object.hasOwn(value, "source") || validate1740(value["source"])) && (!Object.hasOwn(value, "message") || validate1741(value["message"]));
335
- const validate1733 = (value) => typeof value === "string" && (value === "spam" || value === "isolated");
336
- const validate1740 = (value) => typeof value === "string" && (value === "receipt" || value === "classifier" || value === "reader");
337
- const validate1741 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "from") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "receivedAt") && (!Object.hasOwn(value, "id") || validate814(value["id"])) && (!Object.hasOwn(value, "from") || validate1506(value["from"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "receivedAt") || validate2(value["receivedAt"]));
338
- const validate1752 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1753(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1755(value["data"]));
339
- const validate1753 = (value) => typeof value === "string" && value === "mailbox.message.discarded";
340
- const validate1755 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "discardedBy") && Object.hasOwn(value, "disposition") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "discardedBy") || validate1553(value["discardedBy"])) && (!Object.hasOwn(value, "disposition") || validate1767(value["disposition"])) && (!Object.hasOwn(value, "reason") || validate622(value["reason"])) && (!Object.hasOwn(value, "message") || validate1741(value["message"]));
341
- const validate1767 = (value) => typeof value === "string" && (value === "quarantined" || value === "isolated");
342
- const validate1780 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1781(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1783(value["data"]));
343
- const validate1781 = (value) => typeof value === "string" && value === "mailbox.thread.deleted";
344
- const validate1783 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1505(value["threadId"]));
345
- const validate1789 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1790(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1792(value["data"]));
346
- const validate1790 = (value) => typeof value === "string" && value === "mailbox.message.delivered";
347
- const validate1792 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "actionId") && Object.hasOwn(value, "messageId") && Object.hasOwn(value, "channel") && Object.hasOwn(value, "recipient") && Object.hasOwn(value, "occurredAt") && Object.hasOwn(value, "status") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1505(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1550(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate814(value["messageId"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "recipient") || validate2(value["recipient"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"])) && (!Object.hasOwn(value, "status") || validate1803(value["status"]));
348
- const validate1803 = (value) => typeof value === "string" && value === "delivered";
252
+ const validate1427 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1428(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1430(value["data"]));
253
+ const validate1428 = (value) => typeof value === "string" && value === "flow.registration.updated";
254
+ const validate1430 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "flowId") && Object.hasOwn(value, "versionId") && Object.hasOwn(value, "versionNumber") && Object.hasOwn(value, "wabaId") && Object.hasOwn(value, "providerFlowId") && Object.hasOwn(value, "name") && Object.hasOwn(value, "status") && Object.hasOwn(value, "validationErrors") && Object.hasOwn(value, "endpointAlerts") && Object.hasOwn(value, "publishedAt") && Object.hasOwn(value, "statusChangedAt") && Object.hasOwn(value, "createdAt") && Object.hasOwn(value, "updatedAt") && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "previousStatus") && (!Object.hasOwn(value, "id") || validate1431(value["id"])) && (!Object.hasOwn(value, "flowId") || validate781(value["flowId"])) && (!Object.hasOwn(value, "versionId") || validate787(value["versionId"])) && (!Object.hasOwn(value, "versionNumber") || validate1311(value["versionNumber"])) && (!Object.hasOwn(value, "wabaId") || validate2(value["wabaId"])) && (!Object.hasOwn(value, "providerFlowId") || validate8(value["providerFlowId"])) && (!Object.hasOwn(value, "name") || validate2(value["name"])) && (!Object.hasOwn(value, "status") || validate1440(value["status"])) && (!Object.hasOwn(value, "validationErrors") || validate1441(value["validationErrors"])) && (!Object.hasOwn(value, "endpointAlerts") || validate1448(value["endpointAlerts"])) && (!Object.hasOwn(value, "publishedAt") || validate8(value["publishedAt"])) && (!Object.hasOwn(value, "statusChangedAt") || validate2(value["statusChangedAt"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"])) && (!Object.hasOwn(value, "updatedAt") || validate2(value["updatedAt"])) && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1466(value["previousStatus"]));
255
+ const validate1431 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wafreg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
256
+ const validate1440 = (value) => typeof value === "string" && (value === "draft" || value === "published" || value === "throttled" || value === "blocked" || value === "deprecated");
257
+ const validate1441 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1442);
258
+ const validate1442 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "error") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "error") || validate2(value["error"])) && (!Object.hasOwn(value, "message") || validate2(value["message"])) && (!Object.hasOwn(value, "path") || validate2(value["path"])) && (!Object.hasOwn(value, "line") || validate1311(value["line"])) && (!Object.hasOwn(value, "column") || validate1311(value["column"]));
259
+ const validate1448 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1449);
260
+ const validate1449 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "message") && Object.hasOwn(value, "value") && Object.hasOwn(value, "threshold") && Object.hasOwn(value, "activatedAt") && (!Object.hasOwn(value, "kind") || validate2(value["kind"])) && (!Object.hasOwn(value, "message") || validate2(value["message"])) && (!Object.hasOwn(value, "value") || validate14(value["value"])) && (!Object.hasOwn(value, "threshold") || validate14(value["threshold"])) && (!Object.hasOwn(value, "activatedAt") || validate2(value["activatedAt"]));
261
+ const validate1466 = (value) => validate1440(value) || validate6(value);
262
+ const validate1469 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1470(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1472(value["data"]));
263
+ const validate1470 = (value) => typeof value === "string" && value === "whatsapp.number.connected";
264
+ const validate1472 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "businessAccountId") && Object.hasOwn(value, "phoneNumber") && Object.hasOwn(value, "phoneNumberId") && Object.hasOwn(value, "whatsappBusinessAccountId") && Object.hasOwn(value, "displayName") && Object.hasOwn(value, "verificationStatus") && Object.hasOwn(value, "reconnected") && Object.hasOwn(value, "setupLink") && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "businessAccountId") || validate1477(value["businessAccountId"])) && (!Object.hasOwn(value, "phoneNumber") || validate2(value["phoneNumber"])) && (!Object.hasOwn(value, "phoneNumberId") || validate2(value["phoneNumberId"])) && (!Object.hasOwn(value, "whatsappBusinessAccountId") || validate2(value["whatsappBusinessAccountId"])) && (!Object.hasOwn(value, "displayName") || validate2(value["displayName"])) && (!Object.hasOwn(value, "verificationStatus") || validate1482(value["verificationStatus"])) && (!Object.hasOwn(value, "reconnected") || validate37(value["reconnected"])) && (!Object.hasOwn(value, "setupLink") || validate1484(value["setupLink"]));
265
+ const validate1477 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^waba_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
266
+ const validate1482 = (value) => typeof value === "string" && (value === "pending" || value === "verified" || value === "failed" || value === "suspended");
267
+ const validate1484 = (value) => validate1485(value) || validate6(value);
268
+ const validate1485 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "metadata") && (!Object.hasOwn(value, "id") || validate1486(value["id"])) && (!Object.hasOwn(value, "metadata") || validate1487(value["metadata"]));
269
+ const validate1486 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wasl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
270
+ const validate1487 = (value) => isObject(value) && isObject(value);
271
+ const validate1489 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1490(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1492(value["data"]));
272
+ const validate1490 = (value) => typeof value === "string" && value === "whatsapp.number.updated";
273
+ const validate1492 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "businessAccountId") && Object.hasOwn(value, "phoneNumber") && Object.hasOwn(value, "phoneNumberId") && Object.hasOwn(value, "whatsappBusinessAccountId") && Object.hasOwn(value, "displayName") && Object.hasOwn(value, "verificationStatus") && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "businessAccountId") || validate1477(value["businessAccountId"])) && (!Object.hasOwn(value, "phoneNumber") || validate2(value["phoneNumber"])) && (!Object.hasOwn(value, "phoneNumberId") || validate2(value["phoneNumberId"])) && (!Object.hasOwn(value, "whatsappBusinessAccountId") || validate2(value["whatsappBusinessAccountId"])) && (!Object.hasOwn(value, "displayName") || validate2(value["displayName"])) && (!Object.hasOwn(value, "verificationStatus") || validate1482(value["verificationStatus"]));
274
+ const validate1503 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1504(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1506(value["data"]));
275
+ const validate1504 = (value) => typeof value === "string" && value === "mailbox.message.received";
276
+ const validate1506 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "message") && Object.hasOwn(value, "thread") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "message") || validate1511(value["message"])) && (!Object.hasOwn(value, "thread") || validate1546(value["thread"]));
277
+ const validate1511 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "from") && Object.hasOwn(value, "to") && Object.hasOwn(value, "cc") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "text") && Object.hasOwn(value, "replyText") && Object.hasOwn(value, "attachments") && Object.hasOwn(value, "occurredAt") && (!Object.hasOwn(value, "flowSubmissionHandledBy") || validate871(value["flowSubmissionHandledBy"])) && (!Object.hasOwn(value, "id") || validate814(value["id"])) && (!Object.hasOwn(value, "campaign") || validate624(value["campaign"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "threadId") || validate1520(value["threadId"])) && (!Object.hasOwn(value, "from") || validate1521(value["from"])) && (!Object.hasOwn(value, "to") || validate49(value["to"])) && (!Object.hasOwn(value, "cc") || validate49(value["cc"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "text") || validate8(value["text"])) && (!Object.hasOwn(value, "replyText") || validate8(value["replyText"])) && (!Object.hasOwn(value, "attachments") || validate1539(value["attachments"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"]));
278
+ const validate1520 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^thread_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
279
+ const validate1521 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "address") && (!Object.hasOwn(value, "address") || validate2(value["address"])) && (!Object.hasOwn(value, "name") || validate8(value["name"]));
280
+ const validate1539 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1540);
281
+ const validate1540 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "filename") && Object.hasOwn(value, "contentType") && Object.hasOwn(value, "size") && (!Object.hasOwn(value, "id") || validate1541(value["id"])) && (!Object.hasOwn(value, "filename") || validate2(value["filename"])) && (!Object.hasOwn(value, "contentType") || validate2(value["contentType"])) && (!Object.hasOwn(value, "size") || validate15(value["size"]));
282
+ const validate1541 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
283
+ const validate1546 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "preview") && (!Object.hasOwn(value, "id") || validate1520(value["id"])) && (!Object.hasOwn(value, "endpointId") || validate1548(value["endpointId"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "preview") || validate8(value["preview"]));
284
+ const validate1548 = (value) => validate1549(value) || validate6(value);
285
+ const validate1549 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
286
+ const validate1557 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1558(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1560(value["data"]));
287
+ const validate1558 = (value) => typeof value === "string" && value === "mailbox.message.sent";
288
+ const validate1560 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "actionId") && Object.hasOwn(value, "actor") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "actionId") || validate1565(value["actionId"])) && (!Object.hasOwn(value, "state") || validate1566(value["state"])) && (!Object.hasOwn(value, "acceptedAt") || validate2(value["acceptedAt"])) && (!Object.hasOwn(value, "actor") || validate1568(value["actor"])) && (!Object.hasOwn(value, "message") || validate1511(value["message"]));
289
+ const validate1565 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
290
+ const validate1566 = (value) => typeof value === "string" && value === "completed";
291
+ const validate1568 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && Object.hasOwn(value, "source") && (!Object.hasOwn(value, "kind") || validate1569(value["kind"])) && (!Object.hasOwn(value, "id") || validate2(value["id"])) && (!Object.hasOwn(value, "displayName") || validate8(value["displayName"])) && (!Object.hasOwn(value, "source") || validate1574(value["source"]));
292
+ const validate1569 = (value) => typeof value === "string" && (value === "user" || value === "apiKey" || value === "extension" || value === "externalAgent" || value === "samvaAgent" || value === "system");
293
+ const validate1574 = (value) => typeof value === "string" && (value === "humanUi" || value === "externalApi" || value === "externalAgent" || value === "extension" || value === "samvaManagedAgent" || value === "system");
294
+ const validate1610 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1611(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1613(value["data"]));
295
+ const validate1611 = (value) => typeof value === "string" && value === "mailbox.action.pending_approval";
296
+ const validate1613 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "action") && Object.hasOwn(value, "draft") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1618(value["action"])) && (!Object.hasOwn(value, "draft") || validate1688(value["draft"])) && (!Object.hasOwn(value, "tool") || validate1698(value["tool"]));
297
+ const validate1618 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "type") && Object.hasOwn(value, "reviewRound") && Object.hasOwn(value, "decision") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "proposedBy") && Object.hasOwn(value, "createdAt") && (!Object.hasOwn(value, "id") || validate1565(value["id"])) && (!Object.hasOwn(value, "type") || validate1620(value["type"])) && (!Object.hasOwn(value, "reviewRound") || validate1621(value["reviewRound"])) && (!Object.hasOwn(value, "state") || validate1622(value["state"])) && (!Object.hasOwn(value, "decision") || validate1623(value["decision"])) && (!Object.hasOwn(value, "threadId") || validate1674(value["threadId"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"])) && (!Object.hasOwn(value, "proposedBy") || validate1568(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
298
+ const validate1620 = (value) => typeof value === "string" && (value === "sendMessage" || value === "reply" || value === "updateDraft" || value === "createNote" || value === "assignThread" || value === "changeThreadState" || value === "call" || value === "extensionRequest" || value === "toolCall" || value === "handoff");
299
+ const validate1621 = (value) => typeof value === "number" && Number.isInteger(value) && typeof value === "number" && value <= 0x1fffffffffffff && typeof value === "number" && value > 0;
300
+ const validate1622 = (value) => typeof value === "string" && value === "approvalRequired";
301
+ const validate1623 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "reviewRound") && Object.hasOwn(value, "requirement") && Object.hasOwn(value, "decider") && Object.hasOwn(value, "outcome") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "scopes") && (!Object.hasOwn(value, "id") || validate1624(value["id"])) && (!Object.hasOwn(value, "reviewRound") || validate1621(value["reviewRound"])) && (!Object.hasOwn(value, "requirement") || validate1626(value["requirement"])) && (!Object.hasOwn(value, "decider") || validate1627(value["decider"])) && (!Object.hasOwn(value, "outcome") || validate1628(value["outcome"])) && (!Object.hasOwn(value, "reason") || validate1629(value["reason"])) && (!Object.hasOwn(value, "scopes") || validate1630(value["scopes"])) && (!Object.hasOwn(value, "rule") || validate1634(value["rule"])) && (!Object.hasOwn(value, "guard") || validate1641(value["guard"])) && (!Object.hasOwn(value, "guardReason") || validate1641(value["guardReason"])) && (!Object.hasOwn(value, "resolution") || validate1647(value["resolution"]));
302
+ const validate1624 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^pdec_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
303
+ const validate1626 = (value) => typeof value === "string" && (value === "run" || value === "model" || value === "person" || value === "never");
304
+ const validate1627 = (value) => typeof value === "string" && (value === "rule" || value === "model" || value === "person" || value === "agent");
305
+ const validate1628 = (value) => typeof value === "string" && (value === "allow" || value === "hold" || value === "refuse");
306
+ const validate1629 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1;
307
+ const validate1630 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1631);
308
+ const validate1631 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && (!Object.hasOwn(value, "kind") || validate1632(value["kind"])) && (!Object.hasOwn(value, "id") || validate1629(value["id"]));
309
+ const validate1632 = (value) => typeof value === "string" && (value === "organization" || value === "integration" || value === "mailbox" || value === "agent" || value === "apiKey");
310
+ const validate1634 = (value) => validate1635(value) || validate6(value);
311
+ const validate1635 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "scope") && Object.hasOwn(value, "index") && (!Object.hasOwn(value, "scope") || validate1631(value["scope"])) && (!Object.hasOwn(value, "index") || validate1639(value["index"]));
312
+ const validate1639 = (value) => typeof value === "number" && Number.isInteger(value) && typeof value === "number" && value >= 0 && typeof value === "number" && value <= 0x1fffffffffffff;
313
+ const validate1641 = (value) => validate1629(value) || validate6(value);
314
+ const validate1647 = (value) => validate1648(value) || validate6(value);
315
+ const validate1648 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "by") && Object.hasOwn(value, "at") && Object.hasOwn(value, "as") && (!Object.hasOwn(value, "by") || validate1649(value["by"])) && (!Object.hasOwn(value, "at") || validate2(value["at"])) && (!Object.hasOwn(value, "as") || validate1651(value["as"])) && (!Object.hasOwn(value, "diff") || validate1652(value["diff"]));
316
+ const validate1649 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^user_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
317
+ const validate1651 = (value) => typeof value === "string" && (value === "approved" || value === "edited" || value === "denied" || value === "alwaysAllowed");
318
+ const validate1652 = (value) => validate1653(value) || validate6(value);
319
+ const validate1653 = (value) => isObject(value) && isObject(value) && (!Object.hasOwn(value, "text") || validate1654(value["text"])) && (!Object.hasOwn(value, "html") || validate1654(value["html"]));
320
+ const validate1654 = (value) => validate1655(value) || validate6(value);
321
+ const validate1655 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "before") && Object.hasOwn(value, "after") && (!Object.hasOwn(value, "before") || validate8(value["before"])) && (!Object.hasOwn(value, "after") || validate8(value["after"]));
322
+ const validate1674 = (value) => validate1520(value) || validate6(value);
323
+ const validate1688 = (value) => validate1689(value) || validate6(value);
324
+ const validate1689 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "to") && Object.hasOwn(value, "cc") && Object.hasOwn(value, "subject") && (!Object.hasOwn(value, "to") || validate49(value["to"])) && (!Object.hasOwn(value, "cc") || validate49(value["cc"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"]));
325
+ const validate1698 = (value) => validate1699(value) || validate6(value);
326
+ const validate1699 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "name") && Object.hasOwn(value, "argumentsHash") && Object.hasOwn(value, "arguments") && (!Object.hasOwn(value, "name") || validate1700(value["name"])) && (!Object.hasOwn(value, "argumentsHash") || validate1701(value["argumentsHash"])) && (!Object.hasOwn(value, "arguments") || validate12(value["arguments"]));
327
+ const validate1700 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1 && typeof value === "string" && Array.from(value).length <= 128;
328
+ const validate1701 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^[0-9a-f]{64}$", "u")).test(value);
329
+ const validate1704 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1705(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1707(value["data"]));
330
+ const validate1705 = (value) => typeof value === "string" && value === "mailbox.action.resolved";
331
+ const validate1707 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "action") && Object.hasOwn(value, "resolution") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1712(value["action"])) && (!Object.hasOwn(value, "resolution") || validate1727(value["resolution"]));
332
+ const validate1712 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "type") && Object.hasOwn(value, "reviewRound") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "proposedBy") && Object.hasOwn(value, "createdAt") && (!Object.hasOwn(value, "id") || validate1565(value["id"])) && (!Object.hasOwn(value, "type") || validate1620(value["type"])) && (!Object.hasOwn(value, "reviewRound") || validate1621(value["reviewRound"])) && (!Object.hasOwn(value, "threadId") || validate1674(value["threadId"])) && (!Object.hasOwn(value, "proposedBy") || validate1568(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
333
+ const validate1727 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "outcome") && Object.hasOwn(value, "actor") && Object.hasOwn(value, "resolvedAt") && Object.hasOwn(value, "reason") && (!Object.hasOwn(value, "outcome") || validate1728(value["outcome"])) && (!Object.hasOwn(value, "actor") || validate1568(value["actor"])) && (!Object.hasOwn(value, "resolvedAt") || validate2(value["resolvedAt"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"]));
334
+ const validate1728 = (value) => typeof value === "string" && (value === "approved" || value === "denied" || value === "cancelled");
335
+ const validate1740 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1741(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1743(value["data"]));
336
+ const validate1741 = (value) => typeof value === "string" && value === "mailbox.message.spam";
337
+ const validate1743 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "disposition") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "source") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "disposition") || validate1748(value["disposition"])) && (!Object.hasOwn(value, "threadId") || validate1674(value["threadId"])) && (!Object.hasOwn(value, "reason") || validate621(value["reason"])) && (!Object.hasOwn(value, "source") || validate1755(value["source"])) && (!Object.hasOwn(value, "message") || validate1756(value["message"]));
338
+ const validate1748 = (value) => typeof value === "string" && (value === "spam" || value === "isolated");
339
+ const validate1755 = (value) => typeof value === "string" && (value === "receipt" || value === "classifier" || value === "reader");
340
+ const validate1756 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "from") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "receivedAt") && (!Object.hasOwn(value, "id") || validate814(value["id"])) && (!Object.hasOwn(value, "from") || validate1521(value["from"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "receivedAt") || validate2(value["receivedAt"]));
341
+ const validate1767 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1768(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1770(value["data"]));
342
+ const validate1768 = (value) => typeof value === "string" && value === "mailbox.message.discarded";
343
+ const validate1770 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "discardedBy") && Object.hasOwn(value, "disposition") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "discardedBy") || validate1568(value["discardedBy"])) && (!Object.hasOwn(value, "disposition") || validate1782(value["disposition"])) && (!Object.hasOwn(value, "reason") || validate622(value["reason"])) && (!Object.hasOwn(value, "message") || validate1756(value["message"]));
344
+ const validate1782 = (value) => typeof value === "string" && (value === "quarantined" || value === "isolated");
345
+ const validate1795 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1796(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1798(value["data"]));
346
+ const validate1796 = (value) => typeof value === "string" && value === "mailbox.thread.deleted";
347
+ const validate1798 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1520(value["threadId"]));
349
348
  const validate1804 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1805(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1807(value["data"]));
350
- const validate1805 = (value) => typeof value === "string" && value === "mailbox.message.read";
351
- const validate1807 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "actionId") && Object.hasOwn(value, "messageId") && Object.hasOwn(value, "channel") && Object.hasOwn(value, "recipient") && Object.hasOwn(value, "occurredAt") && Object.hasOwn(value, "status") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1505(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1550(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate814(value["messageId"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "recipient") || validate2(value["recipient"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"])) && (!Object.hasOwn(value, "status") || validate1818(value["status"]));
352
- const validate1818 = (value) => typeof value === "string" && value === "read";
349
+ const validate1805 = (value) => typeof value === "string" && value === "mailbox.message.delivered";
350
+ const validate1807 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "actionId") && Object.hasOwn(value, "messageId") && Object.hasOwn(value, "channel") && Object.hasOwn(value, "recipient") && Object.hasOwn(value, "occurredAt") && Object.hasOwn(value, "status") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1520(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1565(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate814(value["messageId"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "recipient") || validate2(value["recipient"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"])) && (!Object.hasOwn(value, "status") || validate1818(value["status"]));
351
+ const validate1818 = (value) => typeof value === "string" && value === "delivered";
353
352
  const validate1819 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1820(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1822(value["data"]));
354
- const validate1820 = (value) => typeof value === "string" && value === "mailbox.message.failed";
355
- const validate1822 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "actionId") && Object.hasOwn(value, "messageId") && Object.hasOwn(value, "channel") && Object.hasOwn(value, "recipient") && Object.hasOwn(value, "occurredAt") && Object.hasOwn(value, "status") && Object.hasOwn(value, "error") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1505(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1550(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate814(value["messageId"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "recipient") || validate2(value["recipient"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"])) && (!Object.hasOwn(value, "status") || validate1833(value["status"])) && (!Object.hasOwn(value, "error") || validate1834(value["error"]));
356
- const validate1833 = (value) => typeof value === "string" && value === "failed";
357
- const validate1834 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "code") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "code") || validate8(value["code"])) && (!Object.hasOwn(value, "message") || validate8(value["message"]));
358
- const validate1841 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1842(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1844(value["data"]));
359
- const validate1842 = (value) => typeof value === "string" && value === "journey.webhook";
360
- const validate1844 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "journeyId") && Object.hasOwn(value, "journeyVersion") && Object.hasOwn(value, "runId") && Object.hasOwn(value, "nodeId") && Object.hasOwn(value, "contact") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "journeyId") || validate1846(value["journeyId"])) && (!Object.hasOwn(value, "journeyVersion") || validate1311(value["journeyVersion"])) && (!Object.hasOwn(value, "runId") || validate1848(value["runId"])) && (!Object.hasOwn(value, "nodeId") || validate2(value["nodeId"])) && (!Object.hasOwn(value, "contact") || validate1850(value["contact"])) && (!Object.hasOwn(value, "data") || validate12(value["data"]));
361
- const validate1846 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrny_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
362
- const validate1848 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
363
- const validate1850 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "externalId") && Object.hasOwn(value, "email") && (!Object.hasOwn(value, "id") || validate986(value["id"])) && (!Object.hasOwn(value, "externalId") || validate8(value["externalId"])) && (!Object.hasOwn(value, "email") || validate8(value["email"]));
353
+ const validate1820 = (value) => typeof value === "string" && value === "mailbox.message.read";
354
+ const validate1822 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "actionId") && Object.hasOwn(value, "messageId") && Object.hasOwn(value, "channel") && Object.hasOwn(value, "recipient") && Object.hasOwn(value, "occurredAt") && Object.hasOwn(value, "status") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1520(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1565(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate814(value["messageId"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "recipient") || validate2(value["recipient"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"])) && (!Object.hasOwn(value, "status") || validate1833(value["status"]));
355
+ const validate1833 = (value) => typeof value === "string" && value === "read";
356
+ const validate1834 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1835(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1837(value["data"]));
357
+ const validate1835 = (value) => typeof value === "string" && value === "mailbox.message.failed";
358
+ const validate1837 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "actionId") && Object.hasOwn(value, "messageId") && Object.hasOwn(value, "channel") && Object.hasOwn(value, "recipient") && Object.hasOwn(value, "occurredAt") && Object.hasOwn(value, "status") && Object.hasOwn(value, "error") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1371(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1520(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1565(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate814(value["messageId"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "recipient") || validate2(value["recipient"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"])) && (!Object.hasOwn(value, "status") || validate1848(value["status"])) && (!Object.hasOwn(value, "error") || validate1849(value["error"]));
359
+ const validate1848 = (value) => typeof value === "string" && value === "failed";
360
+ const validate1849 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "code") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "code") || validate8(value["code"])) && (!Object.hasOwn(value, "message") || validate8(value["message"]));
361
+ const validate1856 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1857(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1859(value["data"]));
362
+ const validate1857 = (value) => typeof value === "string" && value === "journey.webhook";
363
+ const validate1859 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "journeyId") && Object.hasOwn(value, "journeyVersion") && Object.hasOwn(value, "runId") && Object.hasOwn(value, "nodeId") && Object.hasOwn(value, "contact") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "organizationId") || validate887(value["organizationId"])) && (!Object.hasOwn(value, "journeyId") || validate1861(value["journeyId"])) && (!Object.hasOwn(value, "journeyVersion") || validate1311(value["journeyVersion"])) && (!Object.hasOwn(value, "runId") || validate1863(value["runId"])) && (!Object.hasOwn(value, "nodeId") || validate2(value["nodeId"])) && (!Object.hasOwn(value, "contact") || validate1865(value["contact"])) && (!Object.hasOwn(value, "data") || validate12(value["data"]));
364
+ const validate1861 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrny_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
365
+ const validate1863 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
366
+ const validate1865 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "externalId") && Object.hasOwn(value, "email") && (!Object.hasOwn(value, "id") || validate986(value["id"])) && (!Object.hasOwn(value, "externalId") || validate8(value["externalId"])) && (!Object.hasOwn(value, "email") || validate8(value["email"]));
364
367
  /** Narrow an event to a structurally valid payload known to this package. */
365
368
  const isKnownEvent = (value) => {
366
369
  switch (value.type) {
@@ -392,19 +395,20 @@ const isKnownEvent = (value) => {
392
395
  case "email.sending.paused": return validate1366(value);
393
396
  case "email.sending.resumed": return validate1376(value);
394
397
  case "template.registration.updated": return validate1386(value);
395
- case "flow.registration.updated": return validate1426(value);
396
- case "whatsapp.number.connected": return validate1468(value);
397
- case "mailbox.message.received": return validate1488(value);
398
- case "mailbox.message.sent": return validate1542(value);
399
- case "mailbox.action.pending_approval": return validate1595(value);
400
- case "mailbox.action.resolved": return validate1689(value);
401
- case "mailbox.message.spam": return validate1725(value);
402
- case "mailbox.message.discarded": return validate1752(value);
403
- case "mailbox.thread.deleted": return validate1780(value);
404
- case "mailbox.message.delivered": return validate1789(value);
405
- case "mailbox.message.read": return validate1804(value);
406
- case "mailbox.message.failed": return validate1819(value);
407
- case "journey.webhook": return validate1841(value);
398
+ case "flow.registration.updated": return validate1427(value);
399
+ case "whatsapp.number.connected": return validate1469(value);
400
+ case "whatsapp.number.updated": return validate1489(value);
401
+ case "mailbox.message.received": return validate1503(value);
402
+ case "mailbox.message.sent": return validate1557(value);
403
+ case "mailbox.action.pending_approval": return validate1610(value);
404
+ case "mailbox.action.resolved": return validate1704(value);
405
+ case "mailbox.message.spam": return validate1740(value);
406
+ case "mailbox.message.discarded": return validate1767(value);
407
+ case "mailbox.thread.deleted": return validate1795(value);
408
+ case "mailbox.message.delivered": return validate1804(value);
409
+ case "mailbox.message.read": return validate1819(value);
410
+ case "mailbox.message.failed": return validate1834(value);
411
+ case "journey.webhook": return validate1856(value);
408
412
  default: return false;
409
413
  }
410
414
  };
@@ -439,19 +443,20 @@ const validateEvent = (value) => {
439
443
  case "email.sending.paused": return validate1366(value);
440
444
  case "email.sending.resumed": return validate1376(value);
441
445
  case "template.registration.updated": return validate1386(value);
442
- case "flow.registration.updated": return validate1426(value);
443
- case "whatsapp.number.connected": return validate1468(value);
444
- case "mailbox.message.received": return validate1488(value);
445
- case "mailbox.message.sent": return validate1542(value);
446
- case "mailbox.action.pending_approval": return validate1595(value);
447
- case "mailbox.action.resolved": return validate1689(value);
448
- case "mailbox.message.spam": return validate1725(value);
449
- case "mailbox.message.discarded": return validate1752(value);
450
- case "mailbox.thread.deleted": return validate1780(value);
451
- case "mailbox.message.delivered": return validate1789(value);
452
- case "mailbox.message.read": return validate1804(value);
453
- case "mailbox.message.failed": return validate1819(value);
454
- case "journey.webhook": return validate1841(value);
446
+ case "flow.registration.updated": return validate1427(value);
447
+ case "whatsapp.number.connected": return validate1469(value);
448
+ case "whatsapp.number.updated": return validate1489(value);
449
+ case "mailbox.message.received": return validate1503(value);
450
+ case "mailbox.message.sent": return validate1557(value);
451
+ case "mailbox.action.pending_approval": return validate1610(value);
452
+ case "mailbox.action.resolved": return validate1704(value);
453
+ case "mailbox.message.spam": return validate1740(value);
454
+ case "mailbox.message.discarded": return validate1767(value);
455
+ case "mailbox.thread.deleted": return validate1795(value);
456
+ case "mailbox.message.delivered": return validate1804(value);
457
+ case "mailbox.message.read": return validate1819(value);
458
+ case "mailbox.message.failed": return validate1834(value);
459
+ case "journey.webhook": return validate1856(value);
455
460
  default: return true;
456
461
  }
457
462
  };
@@ -730,4 +735,4 @@ const readWebhookHeaders = (headers) => requireHeaders({
730
735
  });
731
736
  export { generateWebhookSecret as a, verifyWebhookAt as c, MalformedWebhookPayloadError as d, WebhookCryptoError as f, isKnownEvent as g, WebhookVerificationError as h, WEBHOOK_TIMESTAMP_HEADER as i, InvalidWebhookHeadersError as l, WebhookTimestampError as m, WEBHOOK_ID_HEADER as n, readWebhookHeaders as o, WebhookSignatureError as p, WEBHOOK_SIGNATURE_HEADER as r, signWebhook as s, DEFAULT_TOLERANCE_SECONDS as t, InvalidWebhookSecretError as u };
732
737
 
733
- //# sourceMappingURL=protocol-CwGXBskp.js.map
738
+ //# sourceMappingURL=protocol-DNsu129I.js.map
package/dist/protocol.js CHANGED
@@ -1 +1 @@
1
- export { t as DEFAULT_TOLERANCE_SECONDS, l as InvalidWebhookHeadersError, u as InvalidWebhookSecretError, d as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, r as WEBHOOK_SIGNATURE_HEADER, i as WEBHOOK_TIMESTAMP_HEADER, f as WebhookCryptoError, p as WebhookSignatureError, m as WebhookTimestampError, h as WebhookVerificationError, a as generateWebhookSecret, g as isKnownEvent, o as readWebhookHeaders, s as signWebhook, c as verifyWebhookAt } from "./protocol-CwGXBskp.js";
1
+ export { t as DEFAULT_TOLERANCE_SECONDS, l as InvalidWebhookHeadersError, u as InvalidWebhookSecretError, d as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, r as WEBHOOK_SIGNATURE_HEADER, i as WEBHOOK_TIMESTAMP_HEADER, f as WebhookCryptoError, p as WebhookSignatureError, m as WebhookTimestampError, h as WebhookVerificationError, a as generateWebhookSecret, g as isKnownEvent, o as readWebhookHeaders, s as signWebhook, c as verifyWebhookAt } from "./protocol-DNsu129I.js";
@@ -895,6 +895,7 @@ export declare const TemplateRegistrationUpdatedEventSchema: Schema.StructWithRe
895
895
  readonly providerCategory: Schema.Union<readonly [Schema.Literals<readonly ["marketing", "utility", "authentication", "transactional", "service_implicit", "service_explicit", "promotional"]>, Schema.Null]>;
896
896
  readonly providerTemplateId: Schema.Union<readonly [Schema.String, Schema.Null]>;
897
897
  readonly reason: Schema.Union<readonly [Schema.String, Schema.Null]>;
898
+ readonly targetReleasedAt: Schema.optionalKey<Schema.String>;
898
899
  readonly submittedAt: Schema.Union<readonly [Schema.String, Schema.Null]>;
899
900
  readonly statusChangedAt: Schema.String;
900
901
  readonly createdAt: Schema.String;
@@ -956,6 +957,20 @@ export declare const WhatsappNumberConnectedEventSchema: Schema.StructWithRest<S
956
957
  }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>;
957
958
  }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
958
959
  }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
960
+ export declare const WhatsappNumberUpdatedEventSchema: Schema.StructWithRest<Schema.Struct<{
961
+ readonly type: Schema.Literal<"whatsapp.number.updated">;
962
+ readonly timestamp: Schema.String;
963
+ readonly data: Schema.StructWithRest<Schema.Struct<{
964
+ readonly organizationId: Schema.String;
965
+ readonly namespaceId: Schema.Union<readonly [Schema.String, Schema.Null]>;
966
+ readonly businessAccountId: Schema.String;
967
+ readonly phoneNumber: Schema.String;
968
+ readonly phoneNumberId: Schema.String;
969
+ readonly whatsappBusinessAccountId: Schema.String;
970
+ readonly displayName: Schema.String;
971
+ readonly verificationStatus: Schema.Literals<readonly ["pending", "verified", "failed", "suspended"]>;
972
+ }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
973
+ }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
959
974
  export declare const MailboxMessageReceivedEventSchema: Schema.StructWithRest<Schema.Struct<{
960
975
  readonly type: Schema.Literal<"mailbox.message.received">;
961
976
  readonly timestamp: Schema.String;
@@ -2130,6 +2145,7 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
2130
2145
  readonly providerCategory: Schema.Union<readonly [Schema.Literals<readonly ["marketing", "utility", "authentication", "transactional", "service_implicit", "service_explicit", "promotional"]>, Schema.Null]>;
2131
2146
  readonly providerTemplateId: Schema.Union<readonly [Schema.String, Schema.Null]>;
2132
2147
  readonly reason: Schema.Union<readonly [Schema.String, Schema.Null]>;
2148
+ readonly targetReleasedAt: Schema.optionalKey<Schema.String>;
2133
2149
  readonly submittedAt: Schema.Union<readonly [Schema.String, Schema.Null]>;
2134
2150
  readonly statusChangedAt: Schema.String;
2135
2151
  readonly createdAt: Schema.String;
@@ -2188,6 +2204,19 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
2188
2204
  readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
2189
2205
  }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>;
2190
2206
  }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
2207
+ }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.StructWithRest<Schema.Struct<{
2208
+ readonly type: Schema.Literal<"whatsapp.number.updated">;
2209
+ readonly timestamp: Schema.String;
2210
+ readonly data: Schema.StructWithRest<Schema.Struct<{
2211
+ readonly organizationId: Schema.String;
2212
+ readonly namespaceId: Schema.Union<readonly [Schema.String, Schema.Null]>;
2213
+ readonly businessAccountId: Schema.String;
2214
+ readonly phoneNumber: Schema.String;
2215
+ readonly phoneNumberId: Schema.String;
2216
+ readonly whatsappBusinessAccountId: Schema.String;
2217
+ readonly displayName: Schema.String;
2218
+ readonly verificationStatus: Schema.Literals<readonly ["pending", "verified", "failed", "suspended"]>;
2219
+ }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
2191
2220
  }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.StructWithRest<Schema.Struct<{
2192
2221
  readonly type: Schema.Literal<"mailbox.message.received">;
2193
2222
  readonly timestamp: Schema.String;
@@ -1252,6 +1252,7 @@ const TemplateRegistrationUpdatedEventSchema = Schema.StructWithRest(Schema.Stru
1252
1252
  ]), Schema.Null]),
1253
1253
  providerTemplateId: Schema.Union([Schema.String, Schema.Null]),
1254
1254
  reason: Schema.Union([Schema.String, Schema.Null]),
1255
+ targetReleasedAt: Schema.optionalKey(Schema.String),
1255
1256
  submittedAt: Schema.Union([Schema.String, Schema.Null]),
1256
1257
  statusChangedAt: Schema.String,
1257
1258
  createdAt: Schema.String,
@@ -1337,6 +1338,25 @@ const WhatsappNumberConnectedEventSchema = Schema.StructWithRest(Schema.Struct({
1337
1338
  }), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]), Schema.Null])
1338
1339
  }), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))])
1339
1340
  }), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]);
1341
+ const WhatsappNumberUpdatedEventSchema = Schema.StructWithRest(Schema.Struct({
1342
+ type: Schema.Literal("whatsapp.number.updated"),
1343
+ timestamp: Schema.String,
1344
+ data: Schema.StructWithRest(Schema.Struct({
1345
+ organizationId: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^org_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^org_[0-9a-hjkmnp-tv-z]{16,24}$" })),
1346
+ namespaceId: Schema.Union([Schema.String.check(Schema.isPattern(new globalThis.RegExp("^ns_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^ns_[0-9a-hjkmnp-tv-z]{16,24}$" })), Schema.Null]),
1347
+ businessAccountId: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^waba_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^waba_[0-9a-hjkmnp-tv-z]{16,24}$" })),
1348
+ phoneNumber: Schema.String,
1349
+ phoneNumberId: Schema.String,
1350
+ whatsappBusinessAccountId: Schema.String,
1351
+ displayName: Schema.String,
1352
+ verificationStatus: Schema.Literals([
1353
+ "pending",
1354
+ "verified",
1355
+ "failed",
1356
+ "suspended"
1357
+ ])
1358
+ }), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))])
1359
+ }), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]);
1340
1360
  const MailboxMessageReceivedEventSchema = Schema.StructWithRest(Schema.Struct({
1341
1361
  type: Schema.Literal("mailbox.message.received"),
1342
1362
  timestamp: Schema.String,
@@ -1842,6 +1862,7 @@ const SamvaWebhookEventSchema = Schema.Union([
1842
1862
  TemplateRegistrationUpdatedEventSchema,
1843
1863
  FlowRegistrationUpdatedEventSchema,
1844
1864
  WhatsappNumberConnectedEventSchema,
1865
+ WhatsappNumberUpdatedEventSchema,
1845
1866
  MailboxMessageReceivedEventSchema,
1846
1867
  MailboxMessageSentEventSchema,
1847
1868
  MailboxActionPendingApprovalEventSchema,
@@ -1854,6 +1875,6 @@ const SamvaWebhookEventSchema = Schema.Union([
1854
1875
  MailboxMessageFailedEventSchema,
1855
1876
  JourneyWebhookEventSchema
1856
1877
  ]);
1857
- export { ContactConsentChangedEventSchema, ContactCreatedEventSchema, ContactDeletedEventSchema, ContactResubscribedEventSchema, ContactSubscribedEventSchema, ContactUnsubscribedEventSchema, ContactUpdatedEventSchema, ConversationArchivedEventSchema, ConversationCreatedEventSchema, ConversationUpdatedEventSchema, DomainUpdatedEventSchema, DomainWarmingUpdatedEventSchema, EmailSendingPausedEventSchema, EmailSendingResumedEventSchema, FlowRegistrationUpdatedEventSchema, JourneyWebhookEventSchema, MailboxActionPendingApprovalEventSchema, MailboxActionResolvedEventSchema, MailboxMessageDeliveredEventSchema, MailboxMessageDiscardedEventSchema, MailboxMessageFailedEventSchema, MailboxMessageReadEventSchema, MailboxMessageReceivedEventSchema, MailboxMessageSentEventSchema, MailboxMessageSpamEventSchema, MailboxThreadDeletedEventSchema, MessageBouncedEventSchema, MessageClickedEventSchema, MessageComplainedEventSchema, MessageDeliveredEventSchema, MessageFailedEventSchema, MessageOpenedEventSchema, MessageReadEventSchema, MessageReceivedEventSchema, MessageSentEventSchema, SamvaWebhookEventSchema, TemplateRegistrationUpdatedEventSchema, WebhookCreatedEventSchema, WebhookDeletedEventSchema, WebhookTestEventSchema, WebhookUpdatedEventSchema, WhatsappNumberConnectedEventSchema };
1878
+ export { ContactConsentChangedEventSchema, ContactCreatedEventSchema, ContactDeletedEventSchema, ContactResubscribedEventSchema, ContactSubscribedEventSchema, ContactUnsubscribedEventSchema, ContactUpdatedEventSchema, ConversationArchivedEventSchema, ConversationCreatedEventSchema, ConversationUpdatedEventSchema, DomainUpdatedEventSchema, DomainWarmingUpdatedEventSchema, EmailSendingPausedEventSchema, EmailSendingResumedEventSchema, FlowRegistrationUpdatedEventSchema, JourneyWebhookEventSchema, MailboxActionPendingApprovalEventSchema, MailboxActionResolvedEventSchema, MailboxMessageDeliveredEventSchema, MailboxMessageDiscardedEventSchema, MailboxMessageFailedEventSchema, MailboxMessageReadEventSchema, MailboxMessageReceivedEventSchema, MailboxMessageSentEventSchema, MailboxMessageSpamEventSchema, MailboxThreadDeletedEventSchema, MessageBouncedEventSchema, MessageClickedEventSchema, MessageComplainedEventSchema, MessageDeliveredEventSchema, MessageFailedEventSchema, MessageOpenedEventSchema, MessageReadEventSchema, MessageReceivedEventSchema, MessageSentEventSchema, SamvaWebhookEventSchema, TemplateRegistrationUpdatedEventSchema, WebhookCreatedEventSchema, WebhookDeletedEventSchema, WebhookTestEventSchema, WebhookUpdatedEventSchema, WhatsappNumberConnectedEventSchema, WhatsappNumberUpdatedEventSchema };
1858
1879
 
1859
1880
  //# sourceMappingURL=schemas.gen.js.map
@@ -1192,6 +1192,7 @@ export type TemplateRegistrationUpdatedEvent = {
1192
1192
  readonly providerCategory: "marketing" | "utility" | "authentication" | "transactional" | "service_implicit" | "service_explicit" | "promotional" | null;
1193
1193
  readonly providerTemplateId: string | null;
1194
1194
  readonly reason: string | null;
1195
+ readonly targetReleasedAt?: string;
1195
1196
  readonly submittedAt: string | null;
1196
1197
  readonly statusChangedAt: string;
1197
1198
  readonly createdAt: string;
@@ -1276,6 +1277,25 @@ export type WhatsappNumberConnectedEvent = {
1276
1277
  readonly [x: string]: JsonValue;
1277
1278
  };
1278
1279
  export type WhatsappNumberConnectedPayload = WhatsappNumberConnectedEvent["data"];
1280
+ export type WhatsappNumberUpdatedEvent = {
1281
+ readonly type: "whatsapp.number.updated";
1282
+ readonly timestamp: string;
1283
+ readonly data: {
1284
+ readonly organizationId: string;
1285
+ readonly namespaceId: string | null;
1286
+ readonly businessAccountId: string;
1287
+ readonly phoneNumber: string;
1288
+ readonly phoneNumberId: string;
1289
+ readonly whatsappBusinessAccountId: string;
1290
+ readonly displayName: string;
1291
+ readonly verificationStatus: "pending" | "verified" | "failed" | "suspended";
1292
+ } & {
1293
+ readonly [x: string]: JsonValue;
1294
+ };
1295
+ } & {
1296
+ readonly [x: string]: JsonValue;
1297
+ };
1298
+ export type WhatsappNumberUpdatedPayload = WhatsappNumberUpdatedEvent["data"];
1279
1299
  export type MailboxMessageReceivedEvent = {
1280
1300
  readonly type: "mailbox.message.received";
1281
1301
  readonly timestamp: string;
@@ -1706,7 +1726,7 @@ export type JourneyWebhookEvent = {
1706
1726
  readonly [x: string]: JsonValue;
1707
1727
  };
1708
1728
  export type JourneyWebhookPayload = JourneyWebhookEvent["data"];
1709
- 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 | MailboxMessageSpamEvent | MailboxMessageDiscardedEvent | MailboxThreadDeletedEvent | MailboxMessageDeliveredEvent | MailboxMessageReadEvent | MailboxMessageFailedEvent | JourneyWebhookEvent;
1729
+ 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 | WhatsappNumberUpdatedEvent | MailboxMessageReceivedEvent | MailboxMessageSentEvent | MailboxActionPendingApprovalEvent | MailboxActionResolvedEvent | MailboxMessageSpamEvent | MailboxMessageDiscardedEvent | MailboxThreadDeletedEvent | MailboxMessageDeliveredEvent | MailboxMessageReadEvent | MailboxMessageFailedEvent | JourneyWebhookEvent;
1710
1730
  export interface UnknownWebhookEvent {
1711
1731
  readonly type: string;
1712
1732
  readonly timestamp: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samva/webhooks",
3
- "version": "0.55.0",
3
+ "version": "0.56.1",
4
4
  "description": "Runtime-neutral verification for Samva webhook deliveries",
5
5
  "keywords": [
6
6
  "samva",