@samva/webhooks 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/effect.js +4 -4
- package/dist/{json-schemas.gen-eaxxbAJh.js → json-schemas.gen-C5nX_b5f.js} +259 -32
- package/dist/promise.js +2 -2
- package/dist/{protocol-Di63Knu8.js → protocol-Cqf7JfeH.js} +163 -139
- package/dist/protocol.js +1 -1
- package/dist/schemas.gen.d.ts +130 -30
- package/dist/schemas.gen.js +248 -172
- package/dist/types.gen.d.ts +90 -15
- package/package.json +3 -3
|
@@ -219,118 +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 === "
|
|
223
|
-
const validate1333 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
const
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
const
|
|
230
|
-
const
|
|
231
|
-
const
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
const
|
|
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 === "
|
|
258
|
-
const validate1431 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "
|
|
259
|
-
const validate1436 = (value) =>
|
|
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
|
|
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"]));
|
|
312
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"]));
|
|
313
|
-
const validate1706 = (value) => typeof value === "string" && value === "mailbox.message.
|
|
314
|
-
const validate1708 = (value) => isObject(value) && isObject(value) && Object.hasOwn(value, "mailboxId") && Object.hasOwn(value, "namespaceId") && Object.hasOwn(value, "
|
|
315
|
-
const
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
const
|
|
319
|
-
const
|
|
320
|
-
const
|
|
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
|
|
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"]));
|
|
334
354
|
/** Narrow an event to a structurally valid payload known to this package. */
|
|
335
355
|
const isKnownEvent = (value) => {
|
|
336
356
|
switch (value.type) {
|
|
@@ -359,20 +379,22 @@ const isKnownEvent = (value) => {
|
|
|
359
379
|
case "webhook.test": return validate1260(value);
|
|
360
380
|
case "domain.updated": return validate1264(value);
|
|
361
381
|
case "domain.warming.updated": return validate1306(value);
|
|
362
|
-
case "
|
|
363
|
-
case "
|
|
364
|
-
case "
|
|
365
|
-
case "
|
|
366
|
-
case "
|
|
367
|
-
case "mailbox.
|
|
368
|
-
case "mailbox.
|
|
369
|
-
case "mailbox.
|
|
370
|
-
case "mailbox.
|
|
371
|
-
case "mailbox.message.
|
|
372
|
-
case "mailbox.message.
|
|
373
|
-
case "mailbox.message.
|
|
374
|
-
case "mailbox.message.
|
|
375
|
-
case "
|
|
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);
|
|
376
398
|
default: return false;
|
|
377
399
|
}
|
|
378
400
|
};
|
|
@@ -404,20 +426,22 @@ const validateEvent = (value) => {
|
|
|
404
426
|
case "webhook.test": return validate1260(value);
|
|
405
427
|
case "domain.updated": return validate1264(value);
|
|
406
428
|
case "domain.warming.updated": return validate1306(value);
|
|
407
|
-
case "
|
|
408
|
-
case "
|
|
409
|
-
case "
|
|
410
|
-
case "
|
|
411
|
-
case "
|
|
412
|
-
case "mailbox.
|
|
413
|
-
case "mailbox.
|
|
414
|
-
case "mailbox.
|
|
415
|
-
case "mailbox.
|
|
416
|
-
case "mailbox.message.
|
|
417
|
-
case "mailbox.message.
|
|
418
|
-
case "mailbox.message.
|
|
419
|
-
case "mailbox.message.
|
|
420
|
-
case "
|
|
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);
|
|
421
445
|
default: return true;
|
|
422
446
|
}
|
|
423
447
|
};
|
|
@@ -745,4 +769,4 @@ const readWebhookHeaders = (headers) => requireHeaders({
|
|
|
745
769
|
});
|
|
746
770
|
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 };
|
|
747
771
|
|
|
748
|
-
//# sourceMappingURL=protocol-
|
|
772
|
+
//# sourceMappingURL=protocol-Cqf7JfeH.js.map
|
package/dist/protocol.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as DEFAULT_TOLERANCE_SECONDS, f as InvalidWebhookHeadersError, p as InvalidWebhookSecretError, m as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, r as WEBHOOK_SIGNATURE_HEADER, i as WEBHOOK_TIMESTAMP_HEADER, h as WebhookCryptoError, g as WebhookSignatureError, _ as WebhookTimestampError, v as WebhookVerificationError, a as encodeWebhookSignature, o as generateWebhookSecret, y as isKnownEvent, s as readWebhookHeaders, c as signWebhook, l as verifyWebhookAt, u as verifyWebhookAtWithPublicKeys, d as webhookSignedContent } from "./protocol-
|
|
1
|
+
export { t as DEFAULT_TOLERANCE_SECONDS, f as InvalidWebhookHeadersError, p as InvalidWebhookSecretError, m as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, r as WEBHOOK_SIGNATURE_HEADER, i as WEBHOOK_TIMESTAMP_HEADER, h as WebhookCryptoError, g as WebhookSignatureError, _ as WebhookTimestampError, v as WebhookVerificationError, a as encodeWebhookSignature, o as generateWebhookSecret, y as isKnownEvent, s as readWebhookHeaders, c as signWebhook, l as verifyWebhookAt, u as verifyWebhookAtWithPublicKeys, d as webhookSignedContent } from "./protocol-Cqf7JfeH.js";
|