@samva/webhooks 0.43.3 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/effect.js 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, p as WebhookSignatureError, r as WEBHOOK_SIGNATURE_HEADER, s as signWebhook, t as DEFAULT_TOLERANCE_SECONDS, u as InvalidWebhookSecretError } from "./protocol-Cup4zTAh.js";
2
- import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-DmLfXny0.js";
1
+ import { a as generateWebhookSecret, c as verifyWebhookAt, d as MalformedWebhookPayloadError, f as WebhookCryptoError, g as isKnownEvent, h as WebhookVerificationError, i as WEBHOOK_TIMESTAMP_HEADER, l as InvalidWebhookHeadersError, m as WebhookTimestampError, n as WEBHOOK_ID_HEADER, p as WebhookSignatureError, r as WEBHOOK_SIGNATURE_HEADER, s as signWebhook, t as DEFAULT_TOLERANCE_SECONDS, u as InvalidWebhookSecretError } from "./protocol-CwzHnoqu.js";
2
+ import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-DR7PincU.js";
3
3
  import { ContactConsentChangedEventSchema, ContactCreatedEventSchema, ContactDeletedEventSchema, ContactResubscribedEventSchema, ContactSubscribedEventSchema, ContactUnsubscribedEventSchema, ContactUpdatedEventSchema, ConversationArchivedEventSchema, ConversationCreatedEventSchema, ConversationUpdatedEventSchema, DomainUpdatedEventSchema, DomainWarmingUpdatedEventSchema, EmailSendingPausedEventSchema, EmailSendingResumedEventSchema, FlowRegistrationUpdatedEventSchema, JourneyWebhookEventSchema, MailboxActionPendingApprovalEventSchema, MailboxActionResolvedEventSchema, MailboxMessageDeliveredEventSchema, MailboxMessageDiscardedEventSchema, MailboxMessageFailedEventSchema, MailboxMessageQuarantinedEventSchema, MailboxMessageReadEventSchema, MailboxMessageReceivedEventSchema, MailboxMessageReleasedEventSchema, MailboxMessageSentEventSchema, MessageBouncedEventSchema, MessageClickedEventSchema, MessageComplainedEventSchema, MessageDeliveredEventSchema, MessageFailedEventSchema, MessageOpenedEventSchema, MessageReadEventSchema, MessageReceivedEventSchema, MessageSentEventSchema, SamvaWebhookEventSchema, TemplateRegistrationUpdatedEventSchema, WebhookCreatedEventSchema, WebhookDeletedEventSchema, WebhookTestEventSchema, WebhookUpdatedEventSchema, WhatsappNumberConnectedEventSchema } from "./schemas.gen.js";
4
4
  import { Clock, Effect } from "effect";
5
5
  // src/effect.ts
@@ -539,6 +539,31 @@ const WebhookEventJsonSchemas = {
539
539
  errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
540
540
  parts: { anyOf: [{ type: "number" }, { type: "null" }] },
541
541
  carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
542
+ disposition: {
543
+ type: "string",
544
+ enum: [
545
+ "delivered",
546
+ "quarantined",
547
+ "isolated"
548
+ ],
549
+ description: "The message disposition when this event was committed, before mailbox content screening."
550
+ },
551
+ reason: {
552
+ anyOf: [{
553
+ type: "string",
554
+ enum: [
555
+ "spam",
556
+ "dmarc",
557
+ "virus",
558
+ "virus_unscanned",
559
+ "verdict_missing",
560
+ "phishing",
561
+ "fraud",
562
+ "prompt_injection"
563
+ ]
564
+ }, { type: "null" }],
565
+ description: "Why the message is held, or null when delivered."
566
+ },
542
567
  campaign: { anyOf: [{
543
568
  type: "object",
544
569
  properties: {
@@ -1355,6 +1380,8 @@ const WebhookEventJsonSchemas = {
1355
1380
  },
1356
1381
  required: [
1357
1382
  "channel",
1383
+ "disposition",
1384
+ "reason",
1358
1385
  "messageId",
1359
1386
  "organizationId"
1360
1387
  ],
@@ -4055,6 +4082,7 @@ const WebhookEventJsonSchemas = {
4055
4082
  "dmarc",
4056
4083
  "virus",
4057
4084
  "virus_unscanned",
4085
+ "verdict_missing",
4058
4086
  "phishing",
4059
4087
  "fraud",
4060
4088
  "prompt_injection"
@@ -4171,6 +4199,7 @@ const WebhookEventJsonSchemas = {
4171
4199
  "dmarc",
4172
4200
  "virus",
4173
4201
  "virus_unscanned",
4202
+ "verdict_missing",
4174
4203
  "phishing",
4175
4204
  "fraud",
4176
4205
  "prompt_injection"
@@ -4377,6 +4406,7 @@ const WebhookEventJsonSchemas = {
4377
4406
  "dmarc",
4378
4407
  "virus",
4379
4408
  "virus_unscanned",
4409
+ "verdict_missing",
4380
4410
  "phishing",
4381
4411
  "fraud",
4382
4412
  "prompt_injection"
@@ -4724,4 +4754,4 @@ const WebhookEventJsonSchemas = {
4724
4754
  };
4725
4755
  export { WebhookEventJsonSchemas as t };
4726
4756
 
4727
- //# sourceMappingURL=json-schemas.gen-DmLfXny0.js.map
4757
+ //# sourceMappingURL=json-schemas.gen-DR7PincU.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-Cup4zTAh.js";
2
- import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-DmLfXny0.js";
1
+ import { a as generateWebhookSecret, c as verifyWebhookAt, d as MalformedWebhookPayloadError, f as WebhookCryptoError, g as isKnownEvent, h as WebhookVerificationError, i as WEBHOOK_TIMESTAMP_HEADER, l as InvalidWebhookHeadersError, m as WebhookTimestampError, n as WEBHOOK_ID_HEADER, o as readWebhookHeaders, p as WebhookSignatureError, r as WEBHOOK_SIGNATURE_HEADER, s as signWebhook, t as DEFAULT_TOLERANCE_SECONDS, u as InvalidWebhookSecretError } from "./protocol-CwzHnoqu.js";
2
+ import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-DR7PincU.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