@samva/webhooks 0.35.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -219,117 +219,138 @@ const validate1315 = (value) => typeof value === "string" && (value === "active"
219
219
  const validate1319 = (value) => validate1320(value) || validate6(value);
220
220
  const validate1320 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "sequence") && Object.hasOwn(value, "startsAt") && Object.hasOwn(value, "endsAt") && Object.hasOwn(value, "allowanceRecipients") && Object.hasOwn(value, "dailyGrowthPercent") && Object.hasOwn(value, "targetDailyRecipients") && (!Object.hasOwn(value, "id") || validate2(value["id"])) && (!Object.hasOwn(value, "sequence") || validate15(value["sequence"])) && (!Object.hasOwn(value, "startsAt") || validate2(value["startsAt"])) && (!Object.hasOwn(value, "endsAt") || validate2(value["endsAt"])) && (!Object.hasOwn(value, "allowanceRecipients") || validate15(value["allowanceRecipients"])) && (!Object.hasOwn(value, "dailyGrowthPercent") || validate15(value["dailyGrowthPercent"])) && (!Object.hasOwn(value, "targetDailyRecipients") || validate15(value["targetDailyRecipients"]));
221
221
  const validate1330 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1331(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1333(value["data"]));
222
- const validate1331 = (value) => typeof value === "string" && value === "template.registration.updated";
223
- const validate1333 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "templateId") && Object.hasOwn(value, "publicationId") && Object.hasOwn(value, "target") && Object.hasOwn(value, "name") && Object.hasOwn(value, "language") && Object.hasOwn(value, "status") && 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") || validate1334(value["id"])) && (!Object.hasOwn(value, "templateId") || validate1335(value["templateId"])) && (!Object.hasOwn(value, "publicationId") || validate1336(value["publicationId"])) && (!Object.hasOwn(value, "target") || validate1337(value["target"])) && (!Object.hasOwn(value, "name") || validate2(value["name"])) && (!Object.hasOwn(value, "language") || validate2(value["language"])) && (!Object.hasOwn(value, "status") || validate1347(value["status"])) && (!Object.hasOwn(value, "category") || validate1348(value["category"])) && (!Object.hasOwn(value, "providerCategory") || validate1349(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") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1347(value["previousStatus"]));
224
- const validate1334 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^treg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
225
- const validate1335 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
226
- const validate1336 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tpub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
227
- const validate1337 = (value) => validate1338(value) || validate1341(value);
228
- const validate1338 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "provider") && Object.hasOwn(value, "wabaId") && (!Object.hasOwn(value, "provider") || validate1339(value["provider"])) && (!Object.hasOwn(value, "wabaId") || validate2(value["wabaId"]));
229
- const validate1339 = (value) => typeof value === "string" && value === "whatsapp";
230
- const validate1341 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "provider") && Object.hasOwn(value, "entityId") && Object.hasOwn(value, "headerId") && (!Object.hasOwn(value, "provider") || validate1342(value["provider"])) && (!Object.hasOwn(value, "entityId") || validate2(value["entityId"])) && (!Object.hasOwn(value, "headerId") || validate2(value["headerId"]));
231
- const validate1342 = (value) => typeof value === "string" && value === "dlt";
232
- const validate1347 = (value) => typeof value === "string" && (value === "draft" || value === "submitted" || value === "approved" || value === "rejected" || value === "paused" || value === "disabled");
233
- const validate1348 = (value) => typeof value === "string" && (value === "marketing" || value === "utility" || value === "authentication" || value === "transactional" || value === "service_implicit" || value === "service_explicit" || value === "promotional");
234
- const validate1349 = (value) => validate1348(value) || validate6(value);
235
- const validate1366 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1367(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1369(value["data"]));
236
- const validate1367 = (value) => typeof value === "string" && value === "flow.registration.updated";
237
- const validate1369 = (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") || validate1370(value["id"])) && (!Object.hasOwn(value, "flowId") || validate746(value["flowId"])) && (!Object.hasOwn(value, "versionId") || validate752(value["versionId"])) && (!Object.hasOwn(value, "versionNumber") || validate1275(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") || validate1379(value["status"])) && (!Object.hasOwn(value, "validationErrors") || validate1380(value["validationErrors"])) && (!Object.hasOwn(value, "endpointAlerts") || validate1387(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") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1405(value["previousStatus"]));
238
- const validate1370 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wafreg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
239
- const validate1379 = (value) => typeof value === "string" && (value === "draft" || value === "published" || value === "throttled" || value === "blocked" || value === "deprecated");
240
- const validate1380 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1381);
241
- const validate1381 = (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") || validate1275(value["line"])) && (!Object.hasOwn(value, "column") || validate1275(value["column"]));
242
- const validate1387 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1388);
243
- const validate1388 = (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"]));
244
- const validate1405 = (value) => validate1379(value) || validate6(value);
245
- const validate1408 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1409(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1411(value["data"]));
246
- const validate1409 = (value) => typeof value === "string" && value === "whatsapp.number.connected";
247
- const validate1411 = (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") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "namespaceId") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "businessAccountId") || validate1416(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") || validate1421(value["verificationStatus"])) && (!Object.hasOwn(value, "reconnected") || validate33(value["reconnected"])) && (!Object.hasOwn(value, "setupLink") || validate1423(value["setupLink"]));
248
- const validate1413 = (value) => validate1414(value) || validate6(value);
249
- const validate1414 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^ns_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
250
- const validate1416 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^waba_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
251
- const validate1421 = (value) => typeof value === "string" && (value === "pending" || value === "verified" || value === "failed" || value === "suspended");
252
- const validate1423 = (value) => validate1424(value) || validate6(value);
253
- const validate1424 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "metadata") && (!Object.hasOwn(value, "id") || validate1425(value["id"])) && (!Object.hasOwn(value, "metadata") || validate1426(value["metadata"]));
254
- const validate1425 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wasl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
255
- const validate1426 = (value) => isObject(value) && isObject(value);
222
+ const validate1331 = (value) => typeof value === "string" && value === "email.sending.paused";
223
+ const validate1333 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "channel") && Object.hasOwn(value, "occurredAt") && (!Object.hasOwn(value, "organizationId") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "namespaceId") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "channel") || validate852(value["channel"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"]));
224
+ const validate1335 = (value) => validate1336(value) || validate6(value);
225
+ const validate1336 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^ns_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
226
+ const validate1340 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1341(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1333(value["data"]));
227
+ const validate1341 = (value) => typeof value === "string" && value === "email.sending.resumed";
228
+ const validate1350 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1351(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1353(value["data"]));
229
+ const validate1351 = (value) => typeof value === "string" && value === "template.registration.updated";
230
+ const validate1353 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "templateId") && Object.hasOwn(value, "publicationId") && Object.hasOwn(value, "target") && Object.hasOwn(value, "name") && Object.hasOwn(value, "language") && Object.hasOwn(value, "status") && 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") || validate1354(value["id"])) && (!Object.hasOwn(value, "templateId") || validate1355(value["templateId"])) && (!Object.hasOwn(value, "publicationId") || validate1356(value["publicationId"])) && (!Object.hasOwn(value, "target") || validate1357(value["target"])) && (!Object.hasOwn(value, "name") || validate2(value["name"])) && (!Object.hasOwn(value, "language") || validate2(value["language"])) && (!Object.hasOwn(value, "status") || validate1367(value["status"])) && (!Object.hasOwn(value, "category") || validate1368(value["category"])) && (!Object.hasOwn(value, "providerCategory") || validate1369(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") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1367(value["previousStatus"]));
231
+ const validate1354 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^treg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
232
+ const validate1355 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
233
+ const validate1356 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tpub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
234
+ const validate1357 = (value) => validate1358(value) || validate1361(value);
235
+ const validate1358 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "provider") && Object.hasOwn(value, "wabaId") && (!Object.hasOwn(value, "provider") || validate1359(value["provider"])) && (!Object.hasOwn(value, "wabaId") || validate2(value["wabaId"]));
236
+ const validate1359 = (value) => typeof value === "string" && value === "whatsapp";
237
+ const validate1361 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "provider") && Object.hasOwn(value, "entityId") && Object.hasOwn(value, "headerId") && (!Object.hasOwn(value, "provider") || validate1362(value["provider"])) && (!Object.hasOwn(value, "entityId") || validate2(value["entityId"])) && (!Object.hasOwn(value, "headerId") || validate2(value["headerId"]));
238
+ const validate1362 = (value) => typeof value === "string" && value === "dlt";
239
+ const validate1367 = (value) => typeof value === "string" && (value === "draft" || value === "submitted" || value === "approved" || value === "rejected" || value === "paused" || value === "disabled");
240
+ const validate1368 = (value) => typeof value === "string" && (value === "marketing" || value === "utility" || value === "authentication" || value === "transactional" || value === "service_implicit" || value === "service_explicit" || value === "promotional");
241
+ const validate1369 = (value) => validate1368(value) || validate6(value);
242
+ 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"]));
243
+ const validate1387 = (value) => typeof value === "string" && value === "flow.registration.updated";
244
+ const validate1389 = (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") || validate1390(value["id"])) && (!Object.hasOwn(value, "flowId") || validate746(value["flowId"])) && (!Object.hasOwn(value, "versionId") || validate752(value["versionId"])) && (!Object.hasOwn(value, "versionNumber") || validate1275(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") || validate1399(value["status"])) && (!Object.hasOwn(value, "validationErrors") || validate1400(value["validationErrors"])) && (!Object.hasOwn(value, "endpointAlerts") || validate1407(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") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1425(value["previousStatus"]));
245
+ const validate1390 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wafreg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
246
+ const validate1399 = (value) => typeof value === "string" && (value === "draft" || value === "published" || value === "throttled" || value === "blocked" || value === "deprecated");
247
+ const validate1400 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1401);
248
+ const validate1401 = (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") || validate1275(value["line"])) && (!Object.hasOwn(value, "column") || validate1275(value["column"]));
249
+ const validate1407 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1408);
250
+ const validate1408 = (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"]));
251
+ const validate1425 = (value) => validate1399(value) || validate6(value);
256
252
  const validate1428 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1429(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1431(value["data"]));
257
- const validate1429 = (value) => typeof value === "string" && value === "mailbox.message.received";
258
- const validate1431 = (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") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "message") || validate1436(value["message"])) && (!Object.hasOwn(value, "thread") || validate1470(value["thread"]));
259
- const validate1436 = (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, "id") || validate779(value["id"])) && (!Object.hasOwn(value, "campaign") || validate592(value["campaign"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "threadId") || validate1444(value["threadId"])) && (!Object.hasOwn(value, "from") || validate1445(value["from"])) && (!Object.hasOwn(value, "to") || validate45(value["to"])) && (!Object.hasOwn(value, "cc") || validate45(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") || validate1463(value["attachments"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"]));
260
- const validate1444 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^thread_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
261
- const validate1445 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "address") && (!Object.hasOwn(value, "address") || validate2(value["address"])) && (!Object.hasOwn(value, "name") || validate8(value["name"]));
262
- const validate1463 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1464);
263
- const validate1464 = (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") || validate1465(value["id"])) && (!Object.hasOwn(value, "filename") || validate2(value["filename"])) && (!Object.hasOwn(value, "contentType") || validate2(value["contentType"])) && (!Object.hasOwn(value, "size") || validate15(value["size"]));
264
- const validate1465 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
265
- const validate1470 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "preview") && (!Object.hasOwn(value, "id") || validate1444(value["id"])) && (!Object.hasOwn(value, "endpointId") || validate1472(value["endpointId"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "preview") || validate8(value["preview"]));
266
- const validate1472 = (value) => validate1473(value) || validate6(value);
267
- const validate1473 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
268
- const validate1481 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1482(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1484(value["data"]));
269
- const validate1482 = (value) => typeof value === "string" && value === "mailbox.message.sent";
270
- const validate1484 = (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") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "actionId") || validate1489(value["actionId"])) && (!Object.hasOwn(value, "state") || validate1490(value["state"])) && (!Object.hasOwn(value, "acceptedAt") || validate2(value["acceptedAt"])) && (!Object.hasOwn(value, "actor") || validate1492(value["actor"])) && (!Object.hasOwn(value, "message") || validate1436(value["message"]));
271
- const validate1489 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
272
- const validate1490 = (value) => typeof value === "string" && value === "completed";
273
- const validate1492 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && Object.hasOwn(value, "source") && (!Object.hasOwn(value, "kind") || validate1493(value["kind"])) && (!Object.hasOwn(value, "id") || validate2(value["id"])) && (!Object.hasOwn(value, "displayName") || validate8(value["displayName"])) && (!Object.hasOwn(value, "source") || validate1498(value["source"]));
274
- const validate1493 = (value) => typeof value === "string" && (value === "user" || value === "apiKey" || value === "extension" || value === "externalAgent" || value === "samvaAgent" || value === "system");
275
- const validate1498 = (value) => typeof value === "string" && (value === "humanUi" || value === "externalApi" || value === "externalAgent" || value === "extension" || value === "samvaManagedAgent" || value === "system");
276
- const validate1533 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1534(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1536(value["data"]));
277
- const validate1534 = (value) => typeof value === "string" && value === "mailbox.action.pending_approval";
278
- const validate1536 = (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") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1541(value["action"])) && (!Object.hasOwn(value, "draft") || validate1571(value["draft"])) && (!Object.hasOwn(value, "tool") || validate1581(value["tool"]));
279
- const validate1541 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "type") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "proposedBy") && Object.hasOwn(value, "createdAt") && (!Object.hasOwn(value, "id") || validate1489(value["id"])) && (!Object.hasOwn(value, "type") || validate1543(value["type"])) && (!Object.hasOwn(value, "state") || validate1544(value["state"])) && (!Object.hasOwn(value, "decision") || validate1545(value["decision"])) && (!Object.hasOwn(value, "threadId") || validate1557(value["threadId"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"])) && (!Object.hasOwn(value, "proposedBy") || validate1492(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
280
- const validate1543 = (value) => typeof value === "string" && (value === "sendMessage" || value === "reply" || value === "updateDraft" || value === "createNote" || value === "assignThread" || value === "changeThreadState" || value === "call" || value === "extensionRequest" || value === "toolCall");
281
- const validate1544 = (value) => typeof value === "string" && value === "approvalRequired";
282
- const validate1545 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "outcome") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "policyId") && Object.hasOwn(value, "source") && Object.hasOwn(value, "decidedAt") && (!Object.hasOwn(value, "outcome") || validate1546(value["outcome"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"])) && (!Object.hasOwn(value, "policyId") || validate1550(value["policyId"])) && (!Object.hasOwn(value, "source") || validate1553(value["source"])) && (!Object.hasOwn(value, "decidedAt") || validate2(value["decidedAt"]));
283
- const validate1546 = (value) => typeof value === "string" && (value === "allow" || value === "requireApproval" || value === "deny");
284
- const validate1550 = (value) => validate1551(value) || validate6(value);
285
- const validate1551 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
286
- const validate1553 = (value) => validate1554(value) || validate6(value);
287
- const validate1554 = (value) => typeof value === "string" && (value === "grant" || value === "installation" || value === "policy");
288
- const validate1557 = (value) => validate1444(value) || validate6(value);
289
- const validate1571 = (value) => validate1572(value) || validate6(value);
290
- const validate1572 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "to") && Object.hasOwn(value, "cc") && Object.hasOwn(value, "subject") && (!Object.hasOwn(value, "to") || validate45(value["to"])) && (!Object.hasOwn(value, "cc") || validate45(value["cc"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"]));
291
- const validate1581 = (value) => validate1582(value) || validate6(value);
292
- const validate1582 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "name") && Object.hasOwn(value, "argumentsHash") && Object.hasOwn(value, "arguments") && (!Object.hasOwn(value, "name") || validate1583(value["name"])) && (!Object.hasOwn(value, "argumentsHash") || validate1584(value["argumentsHash"])) && (!Object.hasOwn(value, "arguments") || validate12(value["arguments"]));
293
- const validate1583 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1 && typeof value === "string" && Array.from(value).length <= 128;
294
- const validate1584 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^[0-9a-f]{64}$", "u")).test(value);
295
- const validate1587 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1588(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1590(value["data"]));
296
- const validate1588 = (value) => typeof value === "string" && value === "mailbox.action.resolved";
297
- const validate1590 = (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") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1595(value["action"])) && (!Object.hasOwn(value, "resolution") || validate1609(value["resolution"]));
298
- const validate1595 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "type") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "proposedBy") && Object.hasOwn(value, "createdAt") && (!Object.hasOwn(value, "id") || validate1489(value["id"])) && (!Object.hasOwn(value, "type") || validate1543(value["type"])) && (!Object.hasOwn(value, "threadId") || validate1557(value["threadId"])) && (!Object.hasOwn(value, "proposedBy") || validate1492(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
299
- const validate1609 = (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") || validate1610(value["outcome"])) && (!Object.hasOwn(value, "actor") || validate1492(value["actor"])) && (!Object.hasOwn(value, "resolvedAt") || validate2(value["resolvedAt"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"]));
300
- const validate1610 = (value) => typeof value === "string" && (value === "approved" || value === "denied" || value === "cancelled");
301
- const validate1622 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1623(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1625(value["data"]));
302
- const validate1623 = (value) => typeof value === "string" && value === "mailbox.message.quarantined";
303
- const validate1625 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "disposition") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "source") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "disposition") || validate1630(value["disposition"])) && (!Object.hasOwn(value, "reason") || validate1631(value["reason"])) && (!Object.hasOwn(value, "source") || validate1632(value["source"])) && (!Object.hasOwn(value, "message") || validate1633(value["message"]));
304
- const validate1630 = (value) => typeof value === "string" && (value === "quarantined" || value === "isolated");
305
- const validate1631 = (value) => typeof value === "string" && (value === "spam" || value === "dmarc" || value === "virus" || value === "virus_unscanned" || value === "phishing" || value === "fraud" || value === "prompt_injection");
306
- const validate1632 = (value) => typeof value === "string" && (value === "receipt" || value === "classifier");
307
- const validate1633 = (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") || validate779(value["id"])) && (!Object.hasOwn(value, "from") || validate1445(value["from"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "receivedAt") || validate2(value["receivedAt"]));
308
- const validate1644 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1645(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1647(value["data"]));
309
- const validate1645 = (value) => typeof value === "string" && value === "mailbox.message.released";
310
- const validate1647 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "releasedBy") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "message") && Object.hasOwn(value, "thread") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "releasedBy") || validate1492(value["releasedBy"])) && (!Object.hasOwn(value, "reason") || validate1631(value["reason"])) && (!Object.hasOwn(value, "message") || validate1436(value["message"])) && (!Object.hasOwn(value, "thread") || validate1470(value["thread"]));
253
+ const validate1429 = (value) => typeof value === "string" && value === "whatsapp.number.connected";
254
+ const validate1431 = (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") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "namespaceId") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "businessAccountId") || validate1436(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") || validate1441(value["verificationStatus"])) && (!Object.hasOwn(value, "reconnected") || validate33(value["reconnected"])) && (!Object.hasOwn(value, "setupLink") || validate1443(value["setupLink"]));
255
+ const validate1436 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^waba_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
256
+ const validate1441 = (value) => typeof value === "string" && (value === "pending" || value === "verified" || value === "failed" || value === "suspended");
257
+ const validate1443 = (value) => validate1444(value) || validate6(value);
258
+ const validate1444 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "metadata") && (!Object.hasOwn(value, "id") || validate1445(value["id"])) && (!Object.hasOwn(value, "metadata") || validate1446(value["metadata"]));
259
+ const validate1445 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wasl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
260
+ const validate1446 = (value) => isObject(value) && isObject(value);
261
+ const validate1448 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1449(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1451(value["data"]));
262
+ const validate1449 = (value) => typeof value === "string" && value === "mailbox.message.received";
263
+ const validate1451 = (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") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "message") || validate1456(value["message"])) && (!Object.hasOwn(value, "thread") || validate1490(value["thread"]));
264
+ const validate1456 = (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, "id") || validate779(value["id"])) && (!Object.hasOwn(value, "campaign") || validate592(value["campaign"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "threadId") || validate1464(value["threadId"])) && (!Object.hasOwn(value, "from") || validate1465(value["from"])) && (!Object.hasOwn(value, "to") || validate45(value["to"])) && (!Object.hasOwn(value, "cc") || validate45(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") || validate1483(value["attachments"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"]));
265
+ const validate1464 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^thread_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
266
+ const validate1465 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "address") && (!Object.hasOwn(value, "address") || validate2(value["address"])) && (!Object.hasOwn(value, "name") || validate8(value["name"]));
267
+ const validate1483 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1484);
268
+ const validate1484 = (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") || validate1485(value["id"])) && (!Object.hasOwn(value, "filename") || validate2(value["filename"])) && (!Object.hasOwn(value, "contentType") || validate2(value["contentType"])) && (!Object.hasOwn(value, "size") || validate15(value["size"]));
269
+ const validate1485 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
270
+ const validate1490 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "preview") && (!Object.hasOwn(value, "id") || validate1464(value["id"])) && (!Object.hasOwn(value, "endpointId") || validate1492(value["endpointId"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "preview") || validate8(value["preview"]));
271
+ const validate1492 = (value) => validate1493(value) || validate6(value);
272
+ const validate1493 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
273
+ const validate1501 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1502(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1504(value["data"]));
274
+ const validate1502 = (value) => typeof value === "string" && value === "mailbox.message.sent";
275
+ const validate1504 = (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") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "actionId") || validate1509(value["actionId"])) && (!Object.hasOwn(value, "state") || validate1510(value["state"])) && (!Object.hasOwn(value, "acceptedAt") || validate2(value["acceptedAt"])) && (!Object.hasOwn(value, "actor") || validate1512(value["actor"])) && (!Object.hasOwn(value, "message") || validate1456(value["message"]));
276
+ const validate1509 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
277
+ const validate1510 = (value) => typeof value === "string" && value === "completed";
278
+ const validate1512 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && Object.hasOwn(value, "source") && (!Object.hasOwn(value, "kind") || validate1513(value["kind"])) && (!Object.hasOwn(value, "id") || validate2(value["id"])) && (!Object.hasOwn(value, "displayName") || validate8(value["displayName"])) && (!Object.hasOwn(value, "source") || validate1518(value["source"]));
279
+ const validate1513 = (value) => typeof value === "string" && (value === "user" || value === "apiKey" || value === "extension" || value === "externalAgent" || value === "samvaAgent" || value === "system");
280
+ const validate1518 = (value) => typeof value === "string" && (value === "humanUi" || value === "externalApi" || value === "externalAgent" || value === "extension" || value === "samvaManagedAgent" || value === "system");
281
+ const validate1553 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1554(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1556(value["data"]));
282
+ const validate1554 = (value) => typeof value === "string" && value === "mailbox.action.pending_approval";
283
+ const validate1556 = (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") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1561(value["action"])) && (!Object.hasOwn(value, "draft") || validate1631(value["draft"])) && (!Object.hasOwn(value, "tool") || validate1641(value["tool"]));
284
+ const validate1561 = (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") || validate1509(value["id"])) && (!Object.hasOwn(value, "type") || validate1563(value["type"])) && (!Object.hasOwn(value, "reviewRound") || validate1564(value["reviewRound"])) && (!Object.hasOwn(value, "state") || validate1565(value["state"])) && (!Object.hasOwn(value, "decision") || validate1566(value["decision"])) && (!Object.hasOwn(value, "threadId") || validate1617(value["threadId"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"])) && (!Object.hasOwn(value, "proposedBy") || validate1512(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
285
+ const validate1563 = (value) => typeof value === "string" && (value === "sendMessage" || value === "reply" || value === "updateDraft" || value === "createNote" || value === "assignThread" || value === "changeThreadState" || value === "call" || value === "extensionRequest" || value === "toolCall" || value === "handoff");
286
+ const validate1564 = (value) => typeof value === "number" && Number.isInteger(value) && typeof value === "number" && value <= 9007199254740991 && typeof value === "number" && value > 0;
287
+ const validate1565 = (value) => typeof value === "string" && value === "approvalRequired";
288
+ const validate1566 = (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") || validate1567(value["id"])) && (!Object.hasOwn(value, "reviewRound") || validate1564(value["reviewRound"])) && (!Object.hasOwn(value, "requirement") || validate1569(value["requirement"])) && (!Object.hasOwn(value, "decider") || validate1570(value["decider"])) && (!Object.hasOwn(value, "outcome") || validate1571(value["outcome"])) && (!Object.hasOwn(value, "reason") || validate1572(value["reason"])) && (!Object.hasOwn(value, "scopes") || validate1573(value["scopes"])) && (!Object.hasOwn(value, "rule") || validate1577(value["rule"])) && (!Object.hasOwn(value, "guard") || validate1584(value["guard"])) && (!Object.hasOwn(value, "guardReason") || validate1584(value["guardReason"])) && (!Object.hasOwn(value, "resolution") || validate1590(value["resolution"]));
289
+ const validate1567 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^pdec_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
290
+ const validate1569 = (value) => typeof value === "string" && (value === "run" || value === "model" || value === "person" || value === "never");
291
+ const validate1570 = (value) => typeof value === "string" && (value === "rule" || value === "model" || value === "person" || value === "agent");
292
+ const validate1571 = (value) => typeof value === "string" && (value === "allow" || value === "hold" || value === "refuse");
293
+ const validate1572 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1;
294
+ const validate1573 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1574);
295
+ const validate1574 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && (!Object.hasOwn(value, "kind") || validate1575(value["kind"])) && (!Object.hasOwn(value, "id") || validate1572(value["id"]));
296
+ const validate1575 = (value) => typeof value === "string" && (value === "organization" || value === "mailbox" || value === "agent" || value === "apiKey");
297
+ const validate1577 = (value) => validate1578(value) || validate6(value);
298
+ const validate1578 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "scope") && Object.hasOwn(value, "index") && (!Object.hasOwn(value, "scope") || validate1574(value["scope"])) && (!Object.hasOwn(value, "index") || validate1582(value["index"]));
299
+ const validate1582 = (value) => typeof value === "number" && Number.isInteger(value) && typeof value === "number" && value >= 0 && typeof value === "number" && value <= 9007199254740991;
300
+ const validate1584 = (value) => validate1572(value) || validate6(value);
301
+ const validate1590 = (value) => validate1591(value) || validate6(value);
302
+ const validate1591 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "by") && Object.hasOwn(value, "at") && Object.hasOwn(value, "as") && (!Object.hasOwn(value, "by") || validate1592(value["by"])) && (!Object.hasOwn(value, "at") || validate2(value["at"])) && (!Object.hasOwn(value, "as") || validate1594(value["as"])) && (!Object.hasOwn(value, "diff") || validate1595(value["diff"]));
303
+ const validate1592 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^user_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
304
+ const validate1594 = (value) => typeof value === "string" && (value === "approved" || value === "edited" || value === "denied" || value === "alwaysAllowed");
305
+ const validate1595 = (value) => validate1596(value) || validate6(value);
306
+ const validate1596 = (value) => isObject(value) && isObject(value) && (!Object.hasOwn(value, "text") || validate1597(value["text"])) && (!Object.hasOwn(value, "html") || validate1597(value["html"]));
307
+ const validate1597 = (value) => validate1598(value) || validate6(value);
308
+ const validate1598 = (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"]));
309
+ const validate1617 = (value) => validate1464(value) || validate6(value);
310
+ const validate1631 = (value) => validate1632(value) || validate6(value);
311
+ const validate1632 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "to") && Object.hasOwn(value, "cc") && Object.hasOwn(value, "subject") && (!Object.hasOwn(value, "to") || validate45(value["to"])) && (!Object.hasOwn(value, "cc") || validate45(value["cc"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"]));
312
+ const validate1641 = (value) => validate1642(value) || validate6(value);
313
+ const validate1642 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "name") && Object.hasOwn(value, "argumentsHash") && Object.hasOwn(value, "arguments") && (!Object.hasOwn(value, "name") || validate1643(value["name"])) && (!Object.hasOwn(value, "argumentsHash") || validate1644(value["argumentsHash"])) && (!Object.hasOwn(value, "arguments") || validate12(value["arguments"]));
314
+ const validate1643 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1 && typeof value === "string" && Array.from(value).length <= 128;
315
+ const validate1644 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^[0-9a-f]{64}$", "u")).test(value);
316
+ const validate1647 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1648(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1650(value["data"]));
317
+ const validate1648 = (value) => typeof value === "string" && value === "mailbox.action.resolved";
318
+ const validate1650 = (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") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1655(value["action"])) && (!Object.hasOwn(value, "resolution") || validate1670(value["resolution"]));
319
+ const validate1655 = (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") || validate1509(value["id"])) && (!Object.hasOwn(value, "type") || validate1563(value["type"])) && (!Object.hasOwn(value, "reviewRound") || validate1564(value["reviewRound"])) && (!Object.hasOwn(value, "threadId") || validate1617(value["threadId"])) && (!Object.hasOwn(value, "proposedBy") || validate1512(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
320
+ const validate1670 = (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") || validate1671(value["outcome"])) && (!Object.hasOwn(value, "actor") || validate1512(value["actor"])) && (!Object.hasOwn(value, "resolvedAt") || validate2(value["resolvedAt"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"]));
321
+ const validate1671 = (value) => typeof value === "string" && (value === "approved" || value === "denied" || value === "cancelled");
322
+ const validate1683 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1684(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1686(value["data"]));
323
+ const validate1684 = (value) => typeof value === "string" && value === "mailbox.message.quarantined";
324
+ const validate1686 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "disposition") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "source") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "disposition") || validate1691(value["disposition"])) && (!Object.hasOwn(value, "reason") || validate1692(value["reason"])) && (!Object.hasOwn(value, "source") || validate1693(value["source"])) && (!Object.hasOwn(value, "message") || validate1694(value["message"]));
325
+ const validate1691 = (value) => typeof value === "string" && (value === "quarantined" || value === "isolated");
326
+ const validate1692 = (value) => typeof value === "string" && (value === "spam" || value === "dmarc" || value === "virus" || value === "virus_unscanned" || value === "phishing" || value === "fraud" || value === "prompt_injection");
327
+ const validate1693 = (value) => typeof value === "string" && (value === "receipt" || value === "classifier");
328
+ const validate1694 = (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") || validate779(value["id"])) && (!Object.hasOwn(value, "from") || validate1465(value["from"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "receivedAt") || validate2(value["receivedAt"]));
311
329
  const validate1705 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1706(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1708(value["data"]));
312
- const validate1706 = (value) => typeof value === "string" && value === "mailbox.message.discarded";
313
- const validate1708 = (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") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "discardedBy") || validate1492(value["discardedBy"])) && (!Object.hasOwn(value, "disposition") || validate1630(value["disposition"])) && (!Object.hasOwn(value, "reason") || validate1631(value["reason"])) && (!Object.hasOwn(value, "message") || validate1633(value["message"]));
314
- const validate1733 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1734(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1736(value["data"]));
315
- const validate1734 = (value) => typeof value === "string" && value === "mailbox.message.delivered";
316
- const validate1736 = (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") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1444(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1489(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate779(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") || validate1747(value["status"]));
317
- const validate1747 = (value) => typeof value === "string" && value === "delivered";
318
- const validate1748 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1749(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1751(value["data"]));
319
- const validate1749 = (value) => typeof value === "string" && value === "mailbox.message.read";
320
- const validate1751 = (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") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1444(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1489(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate779(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") || validate1762(value["status"]));
321
- const validate1762 = (value) => typeof value === "string" && value === "read";
322
- const validate1763 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1764(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1766(value["data"]));
323
- const validate1764 = (value) => typeof value === "string" && value === "mailbox.message.failed";
324
- const validate1766 = (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") || validate1413(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1444(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1489(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate779(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") || validate1777(value["status"])) && (!Object.hasOwn(value, "error") || validate1778(value["error"]));
325
- const validate1777 = (value) => typeof value === "string" && value === "failed";
326
- const validate1778 = (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"]));
327
- const validate1785 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1786(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1788(value["data"]));
328
- const validate1786 = (value) => typeof value === "string" && value === "journey.webhook";
329
- const validate1788 = (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") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "journeyId") || validate1790(value["journeyId"])) && (!Object.hasOwn(value, "journeyVersion") || validate1275(value["journeyVersion"])) && (!Object.hasOwn(value, "runId") || validate1792(value["runId"])) && (!Object.hasOwn(value, "nodeId") || validate2(value["nodeId"])) && (!Object.hasOwn(value, "contact") || validate1794(value["contact"])) && (!Object.hasOwn(value, "data") || validate12(value["data"]));
330
- const validate1790 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrny_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
331
- const validate1792 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
332
- const validate1794 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "externalId") && Object.hasOwn(value, "email") && (!Object.hasOwn(value, "id") || validate950(value["id"])) && (!Object.hasOwn(value, "externalId") || validate8(value["externalId"])) && (!Object.hasOwn(value, "email") || validate8(value["email"]));
330
+ const validate1706 = (value) => typeof value === "string" && value === "mailbox.message.released";
331
+ const validate1708 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "releasedBy") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "message") && Object.hasOwn(value, "thread") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "releasedBy") || validate1512(value["releasedBy"])) && (!Object.hasOwn(value, "reason") || validate1692(value["reason"])) && (!Object.hasOwn(value, "message") || validate1456(value["message"])) && (!Object.hasOwn(value, "thread") || validate1490(value["thread"]));
332
+ const validate1766 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1767(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1769(value["data"]));
333
+ const validate1767 = (value) => typeof value === "string" && value === "mailbox.message.discarded";
334
+ const validate1769 = (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") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "discardedBy") || validate1512(value["discardedBy"])) && (!Object.hasOwn(value, "disposition") || validate1691(value["disposition"])) && (!Object.hasOwn(value, "reason") || validate1692(value["reason"])) && (!Object.hasOwn(value, "message") || validate1694(value["message"]));
335
+ const validate1794 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1795(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1797(value["data"]));
336
+ const validate1795 = (value) => typeof value === "string" && value === "mailbox.message.delivered";
337
+ const validate1797 = (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") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1464(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1509(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate779(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") || validate1808(value["status"]));
338
+ const validate1808 = (value) => typeof value === "string" && value === "delivered";
339
+ const validate1809 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1810(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1812(value["data"]));
340
+ const validate1810 = (value) => typeof value === "string" && value === "mailbox.message.read";
341
+ const validate1812 = (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") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1464(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1509(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate779(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") || validate1823(value["status"]));
342
+ const validate1823 = (value) => typeof value === "string" && value === "read";
343
+ const validate1824 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1825(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1827(value["data"]));
344
+ const validate1825 = (value) => typeof value === "string" && value === "mailbox.message.failed";
345
+ const validate1827 = (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") || validate1335(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1464(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1509(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate779(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") || validate1838(value["status"])) && (!Object.hasOwn(value, "error") || validate1839(value["error"]));
346
+ const validate1838 = (value) => typeof value === "string" && value === "failed";
347
+ const validate1839 = (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"]));
348
+ const validate1846 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1847(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1849(value["data"]));
349
+ const validate1847 = (value) => typeof value === "string" && value === "journey.webhook";
350
+ const validate1849 = (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") || validate851(value["organizationId"])) && (!Object.hasOwn(value, "journeyId") || validate1851(value["journeyId"])) && (!Object.hasOwn(value, "journeyVersion") || validate1275(value["journeyVersion"])) && (!Object.hasOwn(value, "runId") || validate1853(value["runId"])) && (!Object.hasOwn(value, "nodeId") || validate2(value["nodeId"])) && (!Object.hasOwn(value, "contact") || validate1855(value["contact"])) && (!Object.hasOwn(value, "data") || validate12(value["data"]));
351
+ const validate1851 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrny_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
352
+ const validate1853 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
353
+ const validate1855 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "externalId") && Object.hasOwn(value, "email") && (!Object.hasOwn(value, "id") || validate950(value["id"])) && (!Object.hasOwn(value, "externalId") || validate8(value["externalId"])) && (!Object.hasOwn(value, "email") || validate8(value["email"]));
333
354
  /** Narrow an event to a structurally valid payload known to this package. */
334
355
  const isKnownEvent = (value) => {
335
356
  switch (value.type) {
@@ -358,20 +379,22 @@ const isKnownEvent = (value) => {
358
379
  case "webhook.test": return validate1260(value);
359
380
  case "domain.updated": return validate1264(value);
360
381
  case "domain.warming.updated": return validate1306(value);
361
- case "template.registration.updated": return validate1330(value);
362
- case "flow.registration.updated": return validate1366(value);
363
- case "whatsapp.number.connected": return validate1408(value);
364
- case "mailbox.message.received": return validate1428(value);
365
- case "mailbox.message.sent": return validate1481(value);
366
- case "mailbox.action.pending_approval": return validate1533(value);
367
- case "mailbox.action.resolved": return validate1587(value);
368
- case "mailbox.message.quarantined": return validate1622(value);
369
- case "mailbox.message.released": return validate1644(value);
370
- case "mailbox.message.discarded": return validate1705(value);
371
- case "mailbox.message.delivered": return validate1733(value);
372
- case "mailbox.message.read": return validate1748(value);
373
- case "mailbox.message.failed": return validate1763(value);
374
- case "journey.webhook": return validate1785(value);
382
+ case "email.sending.paused": return validate1330(value);
383
+ case "email.sending.resumed": return validate1340(value);
384
+ case "template.registration.updated": return validate1350(value);
385
+ case "flow.registration.updated": return validate1386(value);
386
+ case "whatsapp.number.connected": return validate1428(value);
387
+ case "mailbox.message.received": return validate1448(value);
388
+ case "mailbox.message.sent": return validate1501(value);
389
+ case "mailbox.action.pending_approval": return validate1553(value);
390
+ case "mailbox.action.resolved": return validate1647(value);
391
+ case "mailbox.message.quarantined": return validate1683(value);
392
+ case "mailbox.message.released": return validate1705(value);
393
+ case "mailbox.message.discarded": return validate1766(value);
394
+ case "mailbox.message.delivered": return validate1794(value);
395
+ case "mailbox.message.read": return validate1809(value);
396
+ case "mailbox.message.failed": return validate1824(value);
397
+ case "journey.webhook": return validate1846(value);
375
398
  default: return false;
376
399
  }
377
400
  };
@@ -403,20 +426,22 @@ const validateEvent = (value) => {
403
426
  case "webhook.test": return validate1260(value);
404
427
  case "domain.updated": return validate1264(value);
405
428
  case "domain.warming.updated": return validate1306(value);
406
- case "template.registration.updated": return validate1330(value);
407
- case "flow.registration.updated": return validate1366(value);
408
- case "whatsapp.number.connected": return validate1408(value);
409
- case "mailbox.message.received": return validate1428(value);
410
- case "mailbox.message.sent": return validate1481(value);
411
- case "mailbox.action.pending_approval": return validate1533(value);
412
- case "mailbox.action.resolved": return validate1587(value);
413
- case "mailbox.message.quarantined": return validate1622(value);
414
- case "mailbox.message.released": return validate1644(value);
415
- case "mailbox.message.discarded": return validate1705(value);
416
- case "mailbox.message.delivered": return validate1733(value);
417
- case "mailbox.message.read": return validate1748(value);
418
- case "mailbox.message.failed": return validate1763(value);
419
- case "journey.webhook": return validate1785(value);
429
+ case "email.sending.paused": return validate1330(value);
430
+ case "email.sending.resumed": return validate1340(value);
431
+ case "template.registration.updated": return validate1350(value);
432
+ case "flow.registration.updated": return validate1386(value);
433
+ case "whatsapp.number.connected": return validate1428(value);
434
+ case "mailbox.message.received": return validate1448(value);
435
+ case "mailbox.message.sent": return validate1501(value);
436
+ case "mailbox.action.pending_approval": return validate1553(value);
437
+ case "mailbox.action.resolved": return validate1647(value);
438
+ case "mailbox.message.quarantined": return validate1683(value);
439
+ case "mailbox.message.released": return validate1705(value);
440
+ case "mailbox.message.discarded": return validate1766(value);
441
+ case "mailbox.message.delivered": return validate1794(value);
442
+ case "mailbox.message.read": return validate1809(value);
443
+ case "mailbox.message.failed": return validate1824(value);
444
+ case "journey.webhook": return validate1846(value);
420
445
  default: return true;
421
446
  }
422
447
  };
@@ -477,8 +502,8 @@ var WebhookTimestampError = class extends WebhookVerificationError {
477
502
  }
478
503
  };
479
504
  /**
480
- * No signature in the `webhook-signature` header matches the delivery, or no verification key was
481
- * supplied. Treat the request as forged and reject it. When genuine deliveries fail, the usual
505
+ * No signature in the `webhook-signature` header matches the delivery. Treat the request as forged
506
+ * and reject it. When genuine deliveries fail, the usual
482
507
  * causes are the wrong endpoint secret or a body that was parsed and re-serialized before
483
508
  * verification instead of passed through as the exact bytes received.
484
509
  */
@@ -497,9 +522,9 @@ var MalformedWebhookPayloadError = class extends WebhookVerificationError {
497
522
  }
498
523
  };
499
524
  /**
500
- * The runtime's Web Crypto implementation could not import a key or compute a signature, none of
501
- * the supplied public keys could be imported, or the Effect entrypoint could not read the request
502
- * body. Points at the runtime or its configuration rather than at the delivery.
525
+ * The runtime's Web Crypto implementation could not import a key or compute a signature, or the
526
+ * Effect entrypoint could not read the request body. Points at the runtime or its configuration
527
+ * rather than at the delivery.
503
528
  */
504
529
  var WebhookCryptoError = class extends WebhookVerificationError {
505
530
  constructor(options) {
@@ -527,10 +552,6 @@ const WEBHOOK_SIGNATURE_HEADER = "webhook-signature";
527
552
  */
528
553
  const DEFAULT_TOLERANCE_SECONDS = 300;
529
554
  const SECRET_PREFIX = "whsec_";
530
- const ASYMMETRIC_ALGORITHM = {
531
- name: "RSASSA-PKCS1-v1_5",
532
- hash: "SHA-256"
533
- };
534
555
  const MINIMUM_SECRET_BYTES = 24;
535
556
  const MAXIMUM_SECRET_BYTES = 64;
536
557
  const GENERATED_SECRET_BYTES = 32;
@@ -569,13 +590,6 @@ const importHmacKey = async (secret) => {
569
590
  throw new WebhookCryptoError({ detail: `Unable to import webhook signing key: ${cause instanceof Error ? cause.message : String(cause)}` });
570
591
  }
571
592
  };
572
- const importVerificationKey = async (publicKey) => {
573
- try {
574
- return await crypto.subtle.importKey("spki", toCryptoBytes(base64ToBytes(publicKey.trim())), ASYMMETRIC_ALGORITHM, false, ["verify"]);
575
- } catch {
576
- return;
577
- }
578
- };
579
593
  const signedBytes = (id, timestamp, body) => {
580
594
  const prefix = encoder.encode(`${id}.${timestamp}.`);
581
595
  const material = new Uint8Array(prefix.byteLength + body.byteLength);
@@ -591,21 +605,14 @@ const hmac = async (secret, id, timestamp, body) => {
591
605
  throw new WebhookCryptoError({ detail: `Unable to sign webhook: ${cause instanceof Error ? cause.message : String(cause)}` });
592
606
  }
593
607
  };
594
- const asymmetricMatch = async (key, candidate, content) => {
595
- try {
596
- return await crypto.subtle.verify(ASYMMETRIC_ALGORITHM, key, toCryptoBytes(candidate), content);
597
- } catch {
598
- return false;
599
- }
600
- };
601
608
  const timingSafeEqual = (left, right) => {
602
609
  if (left.byteLength !== right.byteLength) return false;
603
610
  let difference = 0;
604
611
  for (let index = 0; index < left.byteLength; index += 1) difference |= (left[index] ?? 0) ^ (right[index] ?? 0);
605
612
  return difference === 0;
606
613
  };
607
- const signatureCandidates = (header, expected) => header.split(" ").map((candidate) => candidate.split(",", 2)).flatMap(([version, encoded]) => {
608
- if (version !== expected || encoded === void 0) return [];
614
+ const signatureCandidates = (header) => header.split(" ").map((candidate) => candidate.split(",", 2)).flatMap(([version, encoded]) => {
615
+ if (version !== "v1" || encoded === void 0) return [];
609
616
  try {
610
617
  return [base64ToBytes(encoded)];
611
618
  } catch {
@@ -634,14 +641,6 @@ const generateWebhookSecret = () => {
634
641
  return `${SECRET_PREFIX}${bytesToBase64(bytes)}`;
635
642
  };
636
643
  /**
637
- * Builds the bytes every signature version covers: `<id>.<timestamp>.<body>`. Use it to verify a
638
- * signature with your own crypto code; {@link verifyWebhookAt} and
639
- * {@link verifyWebhookAtWithPublicKeys} build it for you.
640
- */
641
- const webhookSignedContent = (input) => signedBytes(input.id, input.timestamp, toBytes(input.body));
642
- /** Formats raw signature bytes as one `<version>,<base64>` entry of the `webhook-signature` header. */
643
- const encodeWebhookSignature = (version, signature) => `${version},${bytesToBase64(signature)}`;
644
- /**
645
644
  * Computes the `v1` HMAC-SHA256 signature Samva sends, formatted as one `webhook-signature`
646
645
  * entry. Use it to produce signed test deliveries for your handler.
647
646
  *
@@ -652,7 +651,7 @@ const encodeWebhookSignature = (version, signature) => `${version},${bytesToBase
652
651
  const signWebhook = async (input) => {
653
652
  const timestamp = String(input.timestamp);
654
653
  const signature = await hmac(input.secret, input.id, timestamp, toBytes(input.body));
655
- return encodeWebhookSignature("v1", signature);
654
+ return `v1,${bytesToBase64(signature)}`;
656
655
  };
657
656
  const requireHeader = (header, value) => {
658
657
  if (value === null || value === void 0) throw new InvalidWebhookHeadersError({
@@ -702,30 +701,7 @@ const verifyWebhookAt = async (input) => {
702
701
  const { id, timestamp, signature } = freshHeaders(input);
703
702
  const body = toBytes(input.body);
704
703
  const expected = await hmac(input.secret, id, timestamp, body);
705
- if (!signatureCandidates(signature, "v1").some((candidate) => timingSafeEqual(expected, candidate))) throw new WebhookSignatureError({ detail: "Webhook signature verification failed" });
706
- return {
707
- id,
708
- event: parseEvent(body)
709
- };
710
- };
711
- /**
712
- * Verifies a `v2` (RSASSA-PKCS1-v1_5, SHA-256) delivery against one or more public keys, each a
713
- * Base64-encoded SPKI DER key. Pass several keys during a key rotation; the delivery verifies when
714
- * any `v2` signature entry matches any key.
715
- *
716
- * Header, timestamp, and envelope checks match {@link verifyWebhookAt}. Keys that fail to import
717
- * are skipped. Rejects with {@link WebhookSignatureError} when `publicKeys` is empty or nothing
718
- * matches, and {@link WebhookCryptoError} when none of the keys imports.
719
- */
720
- const verifyWebhookAtWithPublicKeys = async (input) => {
721
- const { id, timestamp, signature } = freshHeaders(input);
722
- if (input.publicKeys.length === 0) throw new WebhookSignatureError({ detail: "No webhook verification key is available" });
723
- const keys = (await Promise.all(input.publicKeys.map(importVerificationKey))).filter((key) => key !== void 0);
724
- if (keys.length === 0) throw new WebhookCryptoError({ detail: "Unable to import any webhook verification key: keys must be Base64 SPKI DER" });
725
- const body = toBytes(input.body);
726
- const content = toCryptoBytes(signedBytes(id, timestamp, body));
727
- const candidates = signatureCandidates(signature, "v2");
728
- if (!(await Promise.all(keys.flatMap((key) => candidates.map((candidate) => asymmetricMatch(key, candidate, content))))).includes(true)) throw new WebhookSignatureError({ detail: "Webhook signature verification failed" });
704
+ if (!signatureCandidates(signature).some((candidate) => timingSafeEqual(expected, candidate))) throw new WebhookSignatureError({ detail: "Webhook signature verification failed" });
729
705
  return {
730
706
  id,
731
707
  event: parseEvent(body)
@@ -742,6 +718,6 @@ const readWebhookHeaders = (headers) => requireHeaders({
742
718
  timestamp: headers.get(WEBHOOK_TIMESTAMP_HEADER),
743
719
  signature: headers.get(WEBHOOK_SIGNATURE_HEADER)
744
720
  });
745
- export { WebhookTimestampError as _, encodeWebhookSignature as a, signWebhook as c, webhookSignedContent as d, InvalidWebhookHeadersError as f, WebhookSignatureError as g, WebhookCryptoError as h, WEBHOOK_TIMESTAMP_HEADER as i, verifyWebhookAt as l, MalformedWebhookPayloadError as m, WEBHOOK_ID_HEADER as n, generateWebhookSecret as o, InvalidWebhookSecretError as p, WEBHOOK_SIGNATURE_HEADER as r, readWebhookHeaders as s, DEFAULT_TOLERANCE_SECONDS as t, verifyWebhookAtWithPublicKeys as u, WebhookVerificationError as v, isKnownEvent as y };
721
+ 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 };
746
722
 
747
- //# sourceMappingURL=protocol-D6py4UMl.js.map
723
+ //# sourceMappingURL=protocol-IJ8lllqW.js.map