@samva/webhooks 0.48.0 → 0.49.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.
- package/dist/effect.js +4 -4
- package/dist/{json-schemas.gen-DR7PincU.js → json-schemas.gen-CE5C7st9.js} +46 -188
- package/dist/promise.js +2 -2
- package/dist/{protocol-CwzHnoqu.js → protocol-COaro8fP.js} +149 -146
- package/dist/protocol.js +1 -1
- package/dist/schemas.gen.d.ts +29 -97
- package/dist/schemas.gen.js +23 -80
- package/dist/types.gen.d.ts +20 -66
- package/package.json +1 -1
|
@@ -230,129 +230,132 @@ const validate1344 = (value) => isObject(value) && isObject(value) && Object.has
|
|
|
230
230
|
const validate1345 = (value) => typeof value === "string" && value === "email.sending.resumed";
|
|
231
231
|
const validate1354 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1355(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1357(value["data"]));
|
|
232
232
|
const validate1355 = (value) => typeof value === "string" && value === "template.registration.updated";
|
|
233
|
-
const validate1357 = (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") || validate1358(value["id"])) && (!Object.hasOwn(value, "templateId") || validate1359(value["templateId"])) && (!Object.hasOwn(value, "publicationId") || validate1360(value["publicationId"])) && (!Object.hasOwn(value, "
|
|
233
|
+
const validate1357 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "templateId") && Object.hasOwn(value, "publicationId") && Object.hasOwn(value, "templateChannelVariantId") && Object.hasOwn(value, "target") && Object.hasOwn(value, "name") && Object.hasOwn(value, "language") && Object.hasOwn(value, "status") && Object.hasOwn(value, "pendingTemplateChannelVariantId") && Object.hasOwn(value, "category") && Object.hasOwn(value, "providerCategory") && Object.hasOwn(value, "providerTemplateId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "submittedAt") && Object.hasOwn(value, "statusChangedAt") && Object.hasOwn(value, "createdAt") && Object.hasOwn(value, "updatedAt") && Object.hasOwn(value, "organizationId") && Object.hasOwn(value, "previousStatus") && (!Object.hasOwn(value, "id") || validate1358(value["id"])) && (!Object.hasOwn(value, "templateId") || validate1359(value["templateId"])) && (!Object.hasOwn(value, "publicationId") || validate1360(value["publicationId"])) && (!Object.hasOwn(value, "templateChannelVariantId") || validate1361(value["templateChannelVariantId"])) && (!Object.hasOwn(value, "target") || validate1362(value["target"])) && (!Object.hasOwn(value, "name") || validate2(value["name"])) && (!Object.hasOwn(value, "language") || validate2(value["language"])) && (!Object.hasOwn(value, "status") || validate1372(value["status"])) && (!Object.hasOwn(value, "pendingTemplateChannelVariantId") || validate1373(value["pendingTemplateChannelVariantId"])) && (!Object.hasOwn(value, "category") || validate1376(value["category"])) && (!Object.hasOwn(value, "providerCategory") || validate1377(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") || validate855(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1372(value["previousStatus"]));
|
|
234
234
|
const validate1358 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^treg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
235
235
|
const validate1359 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
236
236
|
const validate1360 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tpub_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
237
|
-
const validate1361 = (value) =>
|
|
238
|
-
const validate1362 = (value) =>
|
|
239
|
-
const validate1363 = (value) =>
|
|
240
|
-
const
|
|
241
|
-
const validate1366 = (value) =>
|
|
242
|
-
const
|
|
243
|
-
const validate1372 = (value) => typeof value === "string" && (value === "
|
|
244
|
-
const validate1373 = (value) =>
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
const
|
|
252
|
-
const
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
const
|
|
256
|
-
const validate1433 = (value) =>
|
|
257
|
-
const
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
const
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
const
|
|
274
|
-
const
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
const
|
|
278
|
-
const
|
|
279
|
-
const
|
|
280
|
-
const
|
|
281
|
-
const
|
|
282
|
-
const
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
const
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
const
|
|
291
|
-
const
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
const
|
|
295
|
-
const
|
|
296
|
-
const
|
|
297
|
-
const
|
|
298
|
-
const
|
|
299
|
-
const
|
|
300
|
-
const
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
const
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
const
|
|
311
|
-
const
|
|
312
|
-
const
|
|
313
|
-
const
|
|
314
|
-
const
|
|
315
|
-
const
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
const
|
|
319
|
-
const validate1651 = (value) =>
|
|
320
|
-
const validate1652 = (value) => typeof value === "string" && value === "
|
|
321
|
-
const
|
|
322
|
-
const
|
|
323
|
-
const
|
|
324
|
-
const
|
|
325
|
-
const
|
|
326
|
-
const
|
|
327
|
-
const
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
const
|
|
331
|
-
const
|
|
332
|
-
const
|
|
333
|
-
const
|
|
237
|
+
const validate1361 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^tvar_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
238
|
+
const validate1362 = (value) => validate1363(value) || validate1366(value);
|
|
239
|
+
const validate1363 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "provider") && Object.hasOwn(value, "wabaId") && (!Object.hasOwn(value, "provider") || validate1364(value["provider"])) && (!Object.hasOwn(value, "wabaId") || validate2(value["wabaId"]));
|
|
240
|
+
const validate1364 = (value) => typeof value === "string" && value === "whatsapp";
|
|
241
|
+
const validate1366 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "provider") && Object.hasOwn(value, "entityId") && Object.hasOwn(value, "headerId") && (!Object.hasOwn(value, "provider") || validate1367(value["provider"])) && (!Object.hasOwn(value, "entityId") || validate2(value["entityId"])) && (!Object.hasOwn(value, "headerId") || validate2(value["headerId"]));
|
|
242
|
+
const validate1367 = (value) => typeof value === "string" && value === "dlt";
|
|
243
|
+
const validate1372 = (value) => typeof value === "string" && (value === "draft" || value === "submitted" || value === "approved" || value === "rejected" || value === "paused" || value === "disabled");
|
|
244
|
+
const validate1373 = (value) => validate1361(value) || validate6(value);
|
|
245
|
+
const validate1376 = (value) => typeof value === "string" && (value === "marketing" || value === "utility" || value === "authentication" || value === "transactional" || value === "service_implicit" || value === "service_explicit" || value === "promotional");
|
|
246
|
+
const validate1377 = (value) => validate1376(value) || validate6(value);
|
|
247
|
+
const validate1394 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1395(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1397(value["data"]));
|
|
248
|
+
const validate1395 = (value) => typeof value === "string" && value === "flow.registration.updated";
|
|
249
|
+
const validate1397 = (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") || validate1398(value["id"])) && (!Object.hasOwn(value, "flowId") || validate750(value["flowId"])) && (!Object.hasOwn(value, "versionId") || validate756(value["versionId"])) && (!Object.hasOwn(value, "versionNumber") || validate1279(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") || validate1407(value["status"])) && (!Object.hasOwn(value, "validationErrors") || validate1408(value["validationErrors"])) && (!Object.hasOwn(value, "endpointAlerts") || validate1415(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") || validate855(value["organizationId"])) && (!Object.hasOwn(value, "previousStatus") || validate1433(value["previousStatus"]));
|
|
250
|
+
const validate1398 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wafreg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
251
|
+
const validate1407 = (value) => typeof value === "string" && (value === "draft" || value === "published" || value === "throttled" || value === "blocked" || value === "deprecated");
|
|
252
|
+
const validate1408 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1409);
|
|
253
|
+
const validate1409 = (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") || validate1279(value["line"])) && (!Object.hasOwn(value, "column") || validate1279(value["column"]));
|
|
254
|
+
const validate1415 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1416);
|
|
255
|
+
const validate1416 = (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"]));
|
|
256
|
+
const validate1433 = (value) => validate1407(value) || validate6(value);
|
|
257
|
+
const validate1436 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1437(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1439(value["data"]));
|
|
258
|
+
const validate1437 = (value) => typeof value === "string" && value === "whatsapp.number.connected";
|
|
259
|
+
const validate1439 = (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") || validate855(value["organizationId"])) && (!Object.hasOwn(value, "namespaceId") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "businessAccountId") || validate1444(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") || validate1449(value["verificationStatus"])) && (!Object.hasOwn(value, "reconnected") || validate33(value["reconnected"])) && (!Object.hasOwn(value, "setupLink") || validate1451(value["setupLink"]));
|
|
260
|
+
const validate1444 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^waba_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
261
|
+
const validate1449 = (value) => typeof value === "string" && (value === "pending" || value === "verified" || value === "failed" || value === "suspended");
|
|
262
|
+
const validate1451 = (value) => validate1452(value) || validate6(value);
|
|
263
|
+
const validate1452 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "metadata") && (!Object.hasOwn(value, "id") || validate1453(value["id"])) && (!Object.hasOwn(value, "metadata") || validate1454(value["metadata"]));
|
|
264
|
+
const validate1453 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^wasl_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
265
|
+
const validate1454 = (value) => isObject(value) && isObject(value);
|
|
266
|
+
const validate1456 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1457(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1459(value["data"]));
|
|
267
|
+
const validate1457 = (value) => typeof value === "string" && value === "mailbox.message.received";
|
|
268
|
+
const validate1459 = (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") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "message") || validate1464(value["message"])) && (!Object.hasOwn(value, "thread") || validate1498(value["thread"]));
|
|
269
|
+
const validate1464 = (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") || validate783(value["id"])) && (!Object.hasOwn(value, "campaign") || validate596(value["campaign"])) && (!Object.hasOwn(value, "channel") || validate7(value["channel"])) && (!Object.hasOwn(value, "threadId") || validate1472(value["threadId"])) && (!Object.hasOwn(value, "from") || validate1473(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") || validate1491(value["attachments"])) && (!Object.hasOwn(value, "occurredAt") || validate2(value["occurredAt"]));
|
|
270
|
+
const validate1472 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^thread_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
271
|
+
const validate1473 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "address") && (!Object.hasOwn(value, "address") || validate2(value["address"])) && (!Object.hasOwn(value, "name") || validate8(value["name"]));
|
|
272
|
+
const validate1491 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1492);
|
|
273
|
+
const validate1492 = (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") || validate1493(value["id"])) && (!Object.hasOwn(value, "filename") || validate2(value["filename"])) && (!Object.hasOwn(value, "contentType") || validate2(value["contentType"])) && (!Object.hasOwn(value, "size") || validate15(value["size"]));
|
|
274
|
+
const validate1493 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^att_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
275
|
+
const validate1498 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "subject") && Object.hasOwn(value, "preview") && (!Object.hasOwn(value, "id") || validate1472(value["id"])) && (!Object.hasOwn(value, "endpointId") || validate1500(value["endpointId"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "preview") || validate8(value["preview"]));
|
|
276
|
+
const validate1500 = (value) => validate1501(value) || validate6(value);
|
|
277
|
+
const validate1501 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
278
|
+
const validate1509 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1510(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1512(value["data"]));
|
|
279
|
+
const validate1510 = (value) => typeof value === "string" && value === "mailbox.message.sent";
|
|
280
|
+
const validate1512 = (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") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "actionId") || validate1517(value["actionId"])) && (!Object.hasOwn(value, "state") || validate1518(value["state"])) && (!Object.hasOwn(value, "acceptedAt") || validate2(value["acceptedAt"])) && (!Object.hasOwn(value, "actor") || validate1520(value["actor"])) && (!Object.hasOwn(value, "message") || validate1464(value["message"]));
|
|
281
|
+
const validate1517 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
282
|
+
const validate1518 = (value) => typeof value === "string" && value === "completed";
|
|
283
|
+
const validate1520 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && Object.hasOwn(value, "source") && (!Object.hasOwn(value, "kind") || validate1521(value["kind"])) && (!Object.hasOwn(value, "id") || validate2(value["id"])) && (!Object.hasOwn(value, "displayName") || validate8(value["displayName"])) && (!Object.hasOwn(value, "source") || validate1526(value["source"]));
|
|
284
|
+
const validate1521 = (value) => typeof value === "string" && (value === "user" || value === "apiKey" || value === "extension" || value === "externalAgent" || value === "samvaAgent" || value === "system");
|
|
285
|
+
const validate1526 = (value) => typeof value === "string" && (value === "humanUi" || value === "externalApi" || value === "externalAgent" || value === "extension" || value === "samvaManagedAgent" || value === "system");
|
|
286
|
+
const validate1561 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1562(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1564(value["data"]));
|
|
287
|
+
const validate1562 = (value) => typeof value === "string" && value === "mailbox.action.pending_approval";
|
|
288
|
+
const validate1564 = (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") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1569(value["action"])) && (!Object.hasOwn(value, "draft") || validate1639(value["draft"])) && (!Object.hasOwn(value, "tool") || validate1649(value["tool"]));
|
|
289
|
+
const validate1569 = (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") || validate1517(value["id"])) && (!Object.hasOwn(value, "type") || validate1571(value["type"])) && (!Object.hasOwn(value, "reviewRound") || validate1572(value["reviewRound"])) && (!Object.hasOwn(value, "state") || validate1573(value["state"])) && (!Object.hasOwn(value, "decision") || validate1574(value["decision"])) && (!Object.hasOwn(value, "threadId") || validate1625(value["threadId"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"])) && (!Object.hasOwn(value, "proposedBy") || validate1520(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
|
|
290
|
+
const validate1571 = (value) => typeof value === "string" && (value === "sendMessage" || value === "reply" || value === "updateDraft" || value === "createNote" || value === "assignThread" || value === "changeThreadState" || value === "call" || value === "extensionRequest" || value === "toolCall" || value === "handoff");
|
|
291
|
+
const validate1572 = (value) => typeof value === "number" && Number.isInteger(value) && typeof value === "number" && value <= 9007199254740991 && typeof value === "number" && value > 0;
|
|
292
|
+
const validate1573 = (value) => typeof value === "string" && value === "approvalRequired";
|
|
293
|
+
const validate1574 = (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") || validate1575(value["id"])) && (!Object.hasOwn(value, "reviewRound") || validate1572(value["reviewRound"])) && (!Object.hasOwn(value, "requirement") || validate1577(value["requirement"])) && (!Object.hasOwn(value, "decider") || validate1578(value["decider"])) && (!Object.hasOwn(value, "outcome") || validate1579(value["outcome"])) && (!Object.hasOwn(value, "reason") || validate1580(value["reason"])) && (!Object.hasOwn(value, "scopes") || validate1581(value["scopes"])) && (!Object.hasOwn(value, "rule") || validate1585(value["rule"])) && (!Object.hasOwn(value, "guard") || validate1592(value["guard"])) && (!Object.hasOwn(value, "guardReason") || validate1592(value["guardReason"])) && (!Object.hasOwn(value, "resolution") || validate1598(value["resolution"]));
|
|
294
|
+
const validate1575 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^pdec_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
295
|
+
const validate1577 = (value) => typeof value === "string" && (value === "run" || value === "model" || value === "person" || value === "never");
|
|
296
|
+
const validate1578 = (value) => typeof value === "string" && (value === "rule" || value === "model" || value === "person" || value === "agent");
|
|
297
|
+
const validate1579 = (value) => typeof value === "string" && (value === "allow" || value === "hold" || value === "refuse");
|
|
298
|
+
const validate1580 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1;
|
|
299
|
+
const validate1581 = (value) => Array.isArray(value) && Array.isArray(value) && value.every(validate1582);
|
|
300
|
+
const validate1582 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "kind") && Object.hasOwn(value, "id") && (!Object.hasOwn(value, "kind") || validate1583(value["kind"])) && (!Object.hasOwn(value, "id") || validate1580(value["id"]));
|
|
301
|
+
const validate1583 = (value) => typeof value === "string" && (value === "organization" || value === "integration" || value === "mailbox" || value === "agent" || value === "apiKey");
|
|
302
|
+
const validate1585 = (value) => validate1586(value) || validate6(value);
|
|
303
|
+
const validate1586 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "scope") && Object.hasOwn(value, "index") && (!Object.hasOwn(value, "scope") || validate1582(value["scope"])) && (!Object.hasOwn(value, "index") || validate1590(value["index"]));
|
|
304
|
+
const validate1590 = (value) => typeof value === "number" && Number.isInteger(value) && typeof value === "number" && value >= 0 && typeof value === "number" && value <= 9007199254740991;
|
|
305
|
+
const validate1592 = (value) => validate1580(value) || validate6(value);
|
|
306
|
+
const validate1598 = (value) => validate1599(value) || validate6(value);
|
|
307
|
+
const validate1599 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "by") && Object.hasOwn(value, "at") && Object.hasOwn(value, "as") && (!Object.hasOwn(value, "by") || validate1600(value["by"])) && (!Object.hasOwn(value, "at") || validate2(value["at"])) && (!Object.hasOwn(value, "as") || validate1602(value["as"])) && (!Object.hasOwn(value, "diff") || validate1603(value["diff"]));
|
|
308
|
+
const validate1600 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^user_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
309
|
+
const validate1602 = (value) => typeof value === "string" && (value === "approved" || value === "edited" || value === "denied" || value === "alwaysAllowed");
|
|
310
|
+
const validate1603 = (value) => validate1604(value) || validate6(value);
|
|
311
|
+
const validate1604 = (value) => isObject(value) && isObject(value) && (!Object.hasOwn(value, "text") || validate1605(value["text"])) && (!Object.hasOwn(value, "html") || validate1605(value["html"]));
|
|
312
|
+
const validate1605 = (value) => validate1606(value) || validate6(value);
|
|
313
|
+
const validate1606 = (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"]));
|
|
314
|
+
const validate1625 = (value) => validate1472(value) || validate6(value);
|
|
315
|
+
const validate1639 = (value) => validate1640(value) || validate6(value);
|
|
316
|
+
const validate1640 = (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"]));
|
|
317
|
+
const validate1649 = (value) => validate1650(value) || validate6(value);
|
|
318
|
+
const validate1650 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "name") && Object.hasOwn(value, "argumentsHash") && Object.hasOwn(value, "arguments") && (!Object.hasOwn(value, "name") || validate1651(value["name"])) && (!Object.hasOwn(value, "argumentsHash") || validate1652(value["argumentsHash"])) && (!Object.hasOwn(value, "arguments") || validate12(value["arguments"]));
|
|
319
|
+
const validate1651 = (value) => typeof value === "string" && typeof value === "string" && Array.from(value).length >= 1 && typeof value === "string" && Array.from(value).length <= 128;
|
|
320
|
+
const validate1652 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^[0-9a-f]{64}$", "u")).test(value);
|
|
321
|
+
const validate1655 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1656(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1658(value["data"]));
|
|
322
|
+
const validate1656 = (value) => typeof value === "string" && value === "mailbox.action.resolved";
|
|
323
|
+
const validate1658 = (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") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "action") || validate1663(value["action"])) && (!Object.hasOwn(value, "resolution") || validate1678(value["resolution"]));
|
|
324
|
+
const validate1663 = (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") || validate1517(value["id"])) && (!Object.hasOwn(value, "type") || validate1571(value["type"])) && (!Object.hasOwn(value, "reviewRound") || validate1572(value["reviewRound"])) && (!Object.hasOwn(value, "threadId") || validate1625(value["threadId"])) && (!Object.hasOwn(value, "proposedBy") || validate1520(value["proposedBy"])) && (!Object.hasOwn(value, "createdAt") || validate2(value["createdAt"]));
|
|
325
|
+
const validate1678 = (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") || validate1679(value["outcome"])) && (!Object.hasOwn(value, "actor") || validate1520(value["actor"])) && (!Object.hasOwn(value, "resolvedAt") || validate2(value["resolvedAt"])) && (!Object.hasOwn(value, "reason") || validate8(value["reason"]));
|
|
326
|
+
const validate1679 = (value) => typeof value === "string" && (value === "approved" || value === "denied" || value === "cancelled");
|
|
327
|
+
const validate1691 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1692(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1694(value["data"]));
|
|
328
|
+
const validate1692 = (value) => typeof value === "string" && value === "mailbox.message.spam";
|
|
329
|
+
const validate1694 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "disposition") && Object.hasOwn(value, "threadId") && Object.hasOwn(value, "reason") && Object.hasOwn(value, "source") && Object.hasOwn(value, "message") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "disposition") || validate1699(value["disposition"])) && (!Object.hasOwn(value, "threadId") || validate1625(value["threadId"])) && (!Object.hasOwn(value, "reason") || validate593(value["reason"])) && (!Object.hasOwn(value, "source") || validate1706(value["source"])) && (!Object.hasOwn(value, "message") || validate1707(value["message"]));
|
|
330
|
+
const validate1699 = (value) => typeof value === "string" && (value === "spam" || value === "isolated");
|
|
331
|
+
const validate1706 = (value) => typeof value === "string" && (value === "receipt" || value === "classifier" || value === "reader");
|
|
332
|
+
const validate1707 = (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") || validate783(value["id"])) && (!Object.hasOwn(value, "from") || validate1473(value["from"])) && (!Object.hasOwn(value, "subject") || validate8(value["subject"])) && (!Object.hasOwn(value, "receivedAt") || validate2(value["receivedAt"]));
|
|
333
|
+
const validate1718 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1719(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1721(value["data"]));
|
|
334
|
+
const validate1719 = (value) => typeof value === "string" && value === "mailbox.message.discarded";
|
|
335
|
+
const validate1721 = (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") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "discardedBy") || validate1520(value["discardedBy"])) && (!Object.hasOwn(value, "disposition") || validate1733(value["disposition"])) && (!Object.hasOwn(value, "reason") || validate594(value["reason"])) && (!Object.hasOwn(value, "message") || validate1707(value["message"]));
|
|
336
|
+
const validate1733 = (value) => typeof value === "string" && (value === "quarantined" || value === "isolated");
|
|
337
|
+
const validate1746 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1747(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1749(value["data"]));
|
|
338
|
+
const validate1747 = (value) => typeof value === "string" && value === "mailbox.thread.deleted";
|
|
339
|
+
const validate1749 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "threadId") && (!Object.hasOwn(value, "mailboxId") || validate5(value["mailboxId"])) && (!Object.hasOwn(value, "namespaceId") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1472(value["threadId"]));
|
|
340
|
+
const validate1755 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1756(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1758(value["data"]));
|
|
341
|
+
const validate1756 = (value) => typeof value === "string" && value === "mailbox.message.delivered";
|
|
342
|
+
const validate1758 = (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") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1472(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1517(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate783(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") || validate1769(value["status"]));
|
|
343
|
+
const validate1769 = (value) => typeof value === "string" && value === "delivered";
|
|
334
344
|
const validate1770 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1771(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1773(value["data"]));
|
|
335
|
-
const validate1771 = (value) => typeof value === "string" && value === "mailbox.message.
|
|
336
|
-
const validate1773 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "
|
|
337
|
-
const
|
|
338
|
-
const
|
|
339
|
-
const
|
|
340
|
-
const
|
|
341
|
-
const
|
|
342
|
-
const
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
const
|
|
346
|
-
const
|
|
347
|
-
const
|
|
348
|
-
const
|
|
349
|
-
const validate1843 = (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"]));
|
|
350
|
-
const validate1850 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1851(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1853(value["data"]));
|
|
351
|
-
const validate1851 = (value) => typeof value === "string" && value === "journey.webhook";
|
|
352
|
-
const validate1853 = (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") || validate855(value["organizationId"])) && (!Object.hasOwn(value, "journeyId") || validate1855(value["journeyId"])) && (!Object.hasOwn(value, "journeyVersion") || validate1279(value["journeyVersion"])) && (!Object.hasOwn(value, "runId") || validate1857(value["runId"])) && (!Object.hasOwn(value, "nodeId") || validate2(value["nodeId"])) && (!Object.hasOwn(value, "contact") || validate1859(value["contact"])) && (!Object.hasOwn(value, "data") || validate12(value["data"]));
|
|
353
|
-
const validate1855 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrny_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
354
|
-
const validate1857 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
355
|
-
const validate1859 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "externalId") && Object.hasOwn(value, "email") && (!Object.hasOwn(value, "id") || validate954(value["id"])) && (!Object.hasOwn(value, "externalId") || validate8(value["externalId"])) && (!Object.hasOwn(value, "email") || validate8(value["email"]));
|
|
345
|
+
const validate1771 = (value) => typeof value === "string" && value === "mailbox.message.read";
|
|
346
|
+
const validate1773 = (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") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1472(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1517(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate783(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") || validate1784(value["status"]));
|
|
347
|
+
const validate1784 = (value) => typeof value === "string" && value === "read";
|
|
348
|
+
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"]));
|
|
349
|
+
const validate1786 = (value) => typeof value === "string" && value === "mailbox.message.failed";
|
|
350
|
+
const validate1788 = (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") || validate1339(value["namespaceId"])) && (!Object.hasOwn(value, "threadId") || validate1472(value["threadId"])) && (!Object.hasOwn(value, "actionId") || validate1517(value["actionId"])) && (!Object.hasOwn(value, "messageId") || validate783(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") || validate1799(value["status"])) && (!Object.hasOwn(value, "error") || validate1800(value["error"]));
|
|
351
|
+
const validate1799 = (value) => typeof value === "string" && value === "failed";
|
|
352
|
+
const validate1800 = (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"]));
|
|
353
|
+
const validate1807 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "type") && Object.hasOwn(value, "timestamp") && Object.hasOwn(value, "data") && (!Object.hasOwn(value, "type") || validate1808(value["type"])) && (!Object.hasOwn(value, "timestamp") || validate2(value["timestamp"])) && (!Object.hasOwn(value, "data") || validate1810(value["data"]));
|
|
354
|
+
const validate1808 = (value) => typeof value === "string" && value === "journey.webhook";
|
|
355
|
+
const validate1810 = (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") || validate855(value["organizationId"])) && (!Object.hasOwn(value, "journeyId") || validate1812(value["journeyId"])) && (!Object.hasOwn(value, "journeyVersion") || validate1279(value["journeyVersion"])) && (!Object.hasOwn(value, "runId") || validate1814(value["runId"])) && (!Object.hasOwn(value, "nodeId") || validate2(value["nodeId"])) && (!Object.hasOwn(value, "contact") || validate1816(value["contact"])) && (!Object.hasOwn(value, "data") || validate12(value["data"]));
|
|
356
|
+
const validate1812 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrny_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
357
|
+
const validate1814 = (value) => typeof value === "string" && typeof value === "string" && (/* @__PURE__ */ new RegExp("^jrun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).test(value);
|
|
358
|
+
const validate1816 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "id") && Object.hasOwn(value, "externalId") && Object.hasOwn(value, "email") && (!Object.hasOwn(value, "id") || validate954(value["id"])) && (!Object.hasOwn(value, "externalId") || validate8(value["externalId"])) && (!Object.hasOwn(value, "email") || validate8(value["email"]));
|
|
356
359
|
/** Narrow an event to a structurally valid payload known to this package. */
|
|
357
360
|
const isKnownEvent = (value) => {
|
|
358
361
|
switch (value.type) {
|
|
@@ -384,19 +387,19 @@ const isKnownEvent = (value) => {
|
|
|
384
387
|
case "email.sending.paused": return validate1334(value);
|
|
385
388
|
case "email.sending.resumed": return validate1344(value);
|
|
386
389
|
case "template.registration.updated": return validate1354(value);
|
|
387
|
-
case "flow.registration.updated": return
|
|
388
|
-
case "whatsapp.number.connected": return
|
|
389
|
-
case "mailbox.message.received": return
|
|
390
|
-
case "mailbox.message.sent": return
|
|
391
|
-
case "mailbox.action.pending_approval": return
|
|
392
|
-
case "mailbox.action.resolved": return
|
|
393
|
-
case "mailbox.message.
|
|
394
|
-
case "mailbox.message.
|
|
395
|
-
case "mailbox.
|
|
396
|
-
case "mailbox.message.delivered": return
|
|
397
|
-
case "mailbox.message.read": return
|
|
398
|
-
case "mailbox.message.failed": return
|
|
399
|
-
case "journey.webhook": return
|
|
390
|
+
case "flow.registration.updated": return validate1394(value);
|
|
391
|
+
case "whatsapp.number.connected": return validate1436(value);
|
|
392
|
+
case "mailbox.message.received": return validate1456(value);
|
|
393
|
+
case "mailbox.message.sent": return validate1509(value);
|
|
394
|
+
case "mailbox.action.pending_approval": return validate1561(value);
|
|
395
|
+
case "mailbox.action.resolved": return validate1655(value);
|
|
396
|
+
case "mailbox.message.spam": return validate1691(value);
|
|
397
|
+
case "mailbox.message.discarded": return validate1718(value);
|
|
398
|
+
case "mailbox.thread.deleted": return validate1746(value);
|
|
399
|
+
case "mailbox.message.delivered": return validate1755(value);
|
|
400
|
+
case "mailbox.message.read": return validate1770(value);
|
|
401
|
+
case "mailbox.message.failed": return validate1785(value);
|
|
402
|
+
case "journey.webhook": return validate1807(value);
|
|
400
403
|
default: return false;
|
|
401
404
|
}
|
|
402
405
|
};
|
|
@@ -431,19 +434,19 @@ const validateEvent = (value) => {
|
|
|
431
434
|
case "email.sending.paused": return validate1334(value);
|
|
432
435
|
case "email.sending.resumed": return validate1344(value);
|
|
433
436
|
case "template.registration.updated": return validate1354(value);
|
|
434
|
-
case "flow.registration.updated": return
|
|
435
|
-
case "whatsapp.number.connected": return
|
|
436
|
-
case "mailbox.message.received": return
|
|
437
|
-
case "mailbox.message.sent": return
|
|
438
|
-
case "mailbox.action.pending_approval": return
|
|
439
|
-
case "mailbox.action.resolved": return
|
|
440
|
-
case "mailbox.message.
|
|
441
|
-
case "mailbox.message.
|
|
442
|
-
case "mailbox.
|
|
443
|
-
case "mailbox.message.delivered": return
|
|
444
|
-
case "mailbox.message.read": return
|
|
445
|
-
case "mailbox.message.failed": return
|
|
446
|
-
case "journey.webhook": return
|
|
437
|
+
case "flow.registration.updated": return validate1394(value);
|
|
438
|
+
case "whatsapp.number.connected": return validate1436(value);
|
|
439
|
+
case "mailbox.message.received": return validate1456(value);
|
|
440
|
+
case "mailbox.message.sent": return validate1509(value);
|
|
441
|
+
case "mailbox.action.pending_approval": return validate1561(value);
|
|
442
|
+
case "mailbox.action.resolved": return validate1655(value);
|
|
443
|
+
case "mailbox.message.spam": return validate1691(value);
|
|
444
|
+
case "mailbox.message.discarded": return validate1718(value);
|
|
445
|
+
case "mailbox.thread.deleted": return validate1746(value);
|
|
446
|
+
case "mailbox.message.delivered": return validate1755(value);
|
|
447
|
+
case "mailbox.message.read": return validate1770(value);
|
|
448
|
+
case "mailbox.message.failed": return validate1785(value);
|
|
449
|
+
case "journey.webhook": return validate1807(value);
|
|
447
450
|
default: return true;
|
|
448
451
|
}
|
|
449
452
|
};
|
|
@@ -722,4 +725,4 @@ const readWebhookHeaders = (headers) => requireHeaders({
|
|
|
722
725
|
});
|
|
723
726
|
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 };
|
|
724
727
|
|
|
725
|
-
//# sourceMappingURL=protocol-
|
|
728
|
+
//# sourceMappingURL=protocol-COaro8fP.js.map
|
package/dist/protocol.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as DEFAULT_TOLERANCE_SECONDS, l as InvalidWebhookHeadersError, u as InvalidWebhookSecretError, d as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, r as WEBHOOK_SIGNATURE_HEADER, i as WEBHOOK_TIMESTAMP_HEADER, f as WebhookCryptoError, p as WebhookSignatureError, m as WebhookTimestampError, h as WebhookVerificationError, a as generateWebhookSecret, g as isKnownEvent, o as readWebhookHeaders, s as signWebhook, c as verifyWebhookAt } from "./protocol-
|
|
1
|
+
export { t as DEFAULT_TOLERANCE_SECONDS, l as InvalidWebhookHeadersError, u as InvalidWebhookSecretError, d as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, r as WEBHOOK_SIGNATURE_HEADER, i as WEBHOOK_TIMESTAMP_HEADER, f as WebhookCryptoError, p as WebhookSignatureError, m as WebhookTimestampError, h as WebhookVerificationError, a as generateWebhookSecret, g as isKnownEvent, o as readWebhookHeaders, s as signWebhook, c as verifyWebhookAt } from "./protocol-COaro8fP.js";
|