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