@samva/webhooks 0.31.0 → 0.33.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 { _ as WebhookTimestampError, c as signWebhook, f as InvalidWebhookHeadersError, g as WebhookSignatureError, h as WebhookCryptoError, i as WEBHOOK_TIMESTAMP_HEADER, l as verifyWebhookAt, m as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, o as generateWebhookSecret, p as InvalidWebhookSecretError, r as WEBHOOK_SIGNATURE_HEADER, t as DEFAULT_TOLERANCE_SECONDS, v as WebhookVerificationError, y as isKnownEvent } from "./protocol-Dxbwh-ml.js";
2
- import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-Bqz0To0S.js";
1
+ import { _ as WebhookTimestampError, c as signWebhook, f as InvalidWebhookHeadersError, g as WebhookSignatureError, h as WebhookCryptoError, i as WEBHOOK_TIMESTAMP_HEADER, l as verifyWebhookAt, m as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, o as generateWebhookSecret, p as InvalidWebhookSecretError, r as WEBHOOK_SIGNATURE_HEADER, t as DEFAULT_TOLERANCE_SECONDS, v as WebhookVerificationError, y as isKnownEvent } from "./protocol-Di63Knu8.js";
2
+ import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-eaxxbAJh.js";
3
3
  import { ContactConsentChangedEventSchema, ContactCreatedEventSchema, ContactDeletedEventSchema, ContactResubscribedEventSchema, ContactSubscribedEventSchema, ContactUnsubscribedEventSchema, ContactUpdatedEventSchema, ConversationArchivedEventSchema, ConversationCreatedEventSchema, ConversationUpdatedEventSchema, DomainUpdatedEventSchema, DomainWarmingUpdatedEventSchema, 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
@@ -1563,7 +1563,11 @@ const WebhookEventJsonSchemas = {
1563
1563
  ]
1564
1564
  },
1565
1565
  name: { type: "string" },
1566
- displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1566
+ displayName: { anyOf: [
1567
+ { type: "string" },
1568
+ { type: "null" },
1569
+ { type: "null" }
1570
+ ] },
1567
1571
  identities: {
1568
1572
  type: "array",
1569
1573
  items: {
@@ -1588,7 +1592,11 @@ const WebhookEventJsonSchemas = {
1588
1592
  type: "array",
1589
1593
  items: { type: "string" }
1590
1594
  },
1591
- externalId: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1595
+ externalId: { anyOf: [
1596
+ { type: "string" },
1597
+ { type: "null" },
1598
+ { type: "null" }
1599
+ ] },
1592
1600
  createdAt: { type: "string" },
1593
1601
  updatedAt: { type: "string" }
1594
1602
  },
@@ -1636,7 +1644,11 @@ const WebhookEventJsonSchemas = {
1636
1644
  ]
1637
1645
  },
1638
1646
  name: { type: "string" },
1639
- displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1647
+ displayName: { anyOf: [
1648
+ { type: "string" },
1649
+ { type: "null" },
1650
+ { type: "null" }
1651
+ ] },
1640
1652
  identities: {
1641
1653
  type: "array",
1642
1654
  items: {
@@ -1661,7 +1673,11 @@ const WebhookEventJsonSchemas = {
1661
1673
  type: "array",
1662
1674
  items: { type: "string" }
1663
1675
  },
1664
- externalId: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1676
+ externalId: { anyOf: [
1677
+ { type: "string" },
1678
+ { type: "null" },
1679
+ { type: "null" }
1680
+ ] },
1665
1681
  createdAt: { type: "string" },
1666
1682
  updatedAt: { type: "string" }
1667
1683
  },
@@ -1709,7 +1725,11 @@ const WebhookEventJsonSchemas = {
1709
1725
  ]
1710
1726
  },
1711
1727
  name: { type: "string" },
1712
- displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1728
+ displayName: { anyOf: [
1729
+ { type: "string" },
1730
+ { type: "null" },
1731
+ { type: "null" }
1732
+ ] },
1713
1733
  identities: {
1714
1734
  type: "array",
1715
1735
  items: {
@@ -1734,7 +1754,11 @@ const WebhookEventJsonSchemas = {
1734
1754
  type: "array",
1735
1755
  items: { type: "string" }
1736
1756
  },
1737
- externalId: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1757
+ externalId: { anyOf: [
1758
+ { type: "string" },
1759
+ { type: "null" },
1760
+ { type: "null" }
1761
+ ] },
1738
1762
  createdAt: { type: "string" },
1739
1763
  updatedAt: { type: "string" }
1740
1764
  },
@@ -2070,7 +2094,11 @@ const WebhookEventJsonSchemas = {
2070
2094
  type: "string",
2071
2095
  pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2072
2096
  },
2073
- title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
2097
+ title: { anyOf: [
2098
+ { type: "string" },
2099
+ { type: "null" },
2100
+ { type: "null" }
2101
+ ] },
2074
2102
  channels: {
2075
2103
  type: "array",
2076
2104
  items: {
@@ -2100,10 +2128,14 @@ const WebhookEventJsonSchemas = {
2100
2128
  "archived"
2101
2129
  ]
2102
2130
  },
2103
- primaryContactId: { anyOf: [{ anyOf: [{
2104
- type: "string",
2105
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2106
- }, { type: "null" }] }, { type: "null" }] },
2131
+ primaryContactId: { anyOf: [
2132
+ {
2133
+ type: "string",
2134
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2135
+ },
2136
+ { type: "null" },
2137
+ { type: "null" }
2138
+ ] },
2107
2139
  createdAt: { type: "string" },
2108
2140
  updatedAt: { type: "string" }
2109
2141
  },
@@ -2145,7 +2177,11 @@ const WebhookEventJsonSchemas = {
2145
2177
  type: "string",
2146
2178
  pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2147
2179
  },
2148
- title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
2180
+ title: { anyOf: [
2181
+ { type: "string" },
2182
+ { type: "null" },
2183
+ { type: "null" }
2184
+ ] },
2149
2185
  channels: {
2150
2186
  type: "array",
2151
2187
  items: {
@@ -2175,10 +2211,14 @@ const WebhookEventJsonSchemas = {
2175
2211
  "archived"
2176
2212
  ]
2177
2213
  },
2178
- primaryContactId: { anyOf: [{ anyOf: [{
2179
- type: "string",
2180
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2181
- }, { type: "null" }] }, { type: "null" }] },
2214
+ primaryContactId: { anyOf: [
2215
+ {
2216
+ type: "string",
2217
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2218
+ },
2219
+ { type: "null" },
2220
+ { type: "null" }
2221
+ ] },
2182
2222
  createdAt: { type: "string" },
2183
2223
  updatedAt: { type: "string" }
2184
2224
  },
@@ -2220,7 +2260,11 @@ const WebhookEventJsonSchemas = {
2220
2260
  type: "string",
2221
2261
  pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2222
2262
  },
2223
- title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
2263
+ title: { anyOf: [
2264
+ { type: "string" },
2265
+ { type: "null" },
2266
+ { type: "null" }
2267
+ ] },
2224
2268
  channels: {
2225
2269
  type: "array",
2226
2270
  items: {
@@ -2250,10 +2294,14 @@ const WebhookEventJsonSchemas = {
2250
2294
  "archived"
2251
2295
  ]
2252
2296
  },
2253
- primaryContactId: { anyOf: [{ anyOf: [{
2254
- type: "string",
2255
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2256
- }, { type: "null" }] }, { type: "null" }] },
2297
+ primaryContactId: { anyOf: [
2298
+ {
2299
+ type: "string",
2300
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2301
+ },
2302
+ { type: "null" },
2303
+ { type: "null" }
2304
+ ] },
2257
2305
  createdAt: { type: "string" },
2258
2306
  updatedAt: { type: "string" }
2259
2307
  },
@@ -4447,4 +4495,4 @@ const WebhookEventJsonSchemas = {
4447
4495
  };
4448
4496
  export { WebhookEventJsonSchemas as t };
4449
4497
 
4450
- //# sourceMappingURL=json-schemas.gen-Bqz0To0S.js.map
4498
+ //# sourceMappingURL=json-schemas.gen-eaxxbAJh.js.map
package/dist/promise.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as WebhookTimestampError, c as signWebhook, f as InvalidWebhookHeadersError, g as WebhookSignatureError, h as WebhookCryptoError, i as WEBHOOK_TIMESTAMP_HEADER, l as verifyWebhookAt, m as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, o as generateWebhookSecret, p as InvalidWebhookSecretError, r as WEBHOOK_SIGNATURE_HEADER, s as readWebhookHeaders, t as DEFAULT_TOLERANCE_SECONDS, v as WebhookVerificationError, y as isKnownEvent } from "./protocol-Dxbwh-ml.js";
2
- import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-Bqz0To0S.js";
1
+ import { _ as WebhookTimestampError, c as signWebhook, f as InvalidWebhookHeadersError, g as WebhookSignatureError, h as WebhookCryptoError, i as WEBHOOK_TIMESTAMP_HEADER, l as verifyWebhookAt, m as MalformedWebhookPayloadError, n as WEBHOOK_ID_HEADER, o as generateWebhookSecret, p as InvalidWebhookSecretError, r as WEBHOOK_SIGNATURE_HEADER, s as readWebhookHeaders, t as DEFAULT_TOLERANCE_SECONDS, v as WebhookVerificationError, y as isKnownEvent } from "./protocol-Di63Knu8.js";
2
+ import { t as WebhookEventJsonSchemas } from "./json-schemas.gen-eaxxbAJh.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