@samva/webhooks 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/effect.js +4 -4
- package/dist/{json-schemas.gen-CzhmDgcj.js → json-schemas.gen-CPzGmYvg.js} +1562 -1523
- package/dist/promise.js +2 -2
- package/dist/{protocol-BSGksDha.js → protocol-8ERuoP0F.js} +323 -307
- package/dist/protocol.js +1 -1
- package/dist/schemas.gen.d.ts +63 -4
- package/dist/schemas.gen.js +206 -545
- package/dist/types.gen.d.ts +46 -3
- package/package.json +3 -4
package/dist/protocol.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as WebhookTimestampError, a as encodeWebhookSignature, c as signWebhook, d as webhookSignedContent, 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, u as verifyWebhookAtWithPublicKeys, v as WebhookVerificationError, y as isKnownEvent } from "./protocol-
|
|
1
|
+
import { _ as WebhookTimestampError, a as encodeWebhookSignature, c as signWebhook, d as webhookSignedContent, 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, u as verifyWebhookAtWithPublicKeys, v as WebhookVerificationError, y as isKnownEvent } from "./protocol-8ERuoP0F.js";
|
|
2
2
|
export { DEFAULT_TOLERANCE_SECONDS, InvalidWebhookHeadersError, InvalidWebhookSecretError, MalformedWebhookPayloadError, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, WebhookCryptoError, WebhookSignatureError, WebhookTimestampError, WebhookVerificationError, encodeWebhookSignature, generateWebhookSecret, isKnownEvent, readWebhookHeaders, signWebhook, verifyWebhookAt, verifyWebhookAtWithPublicKeys, webhookSignedContent };
|
package/dist/schemas.gen.d.ts
CHANGED
|
@@ -247,10 +247,10 @@ export declare const MessageReceivedEventSchema: Schema.StructWithRest<Schema.St
|
|
|
247
247
|
readonly language: Schema.String;
|
|
248
248
|
readonly components: Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
249
249
|
readonly type: Schema.Literals<readonly ["header", "body", "footer", "button"]>;
|
|
250
|
-
readonly sub_type: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["url", "quick_reply", "copy_code"]>, Schema.Null]>>;
|
|
250
|
+
readonly sub_type: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["url", "quick_reply", "copy_code", "flow"]>, Schema.Null]>>;
|
|
251
251
|
readonly index: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
252
252
|
readonly parameters: Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
253
|
-
readonly type: Schema.Literals<readonly ["text", "currency", "date_time", "image", "document", "video", "coupon_code"]>;
|
|
253
|
+
readonly type: Schema.Literals<readonly ["text", "currency", "date_time", "image", "document", "video", "coupon_code", "action"]>;
|
|
254
254
|
readonly text: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
255
255
|
readonly currency: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
256
256
|
readonly fallback_value: Schema.String;
|
|
@@ -271,6 +271,9 @@ export declare const MessageReceivedEventSchema: Schema.StructWithRest<Schema.St
|
|
|
271
271
|
readonly link: Schema.String;
|
|
272
272
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
273
273
|
readonly coupon_code: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
274
|
+
readonly action: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
275
|
+
readonly flow_token: Schema.String;
|
|
276
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
274
277
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
275
278
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
276
279
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
@@ -364,6 +367,7 @@ export declare const MessageReceivedEventSchema: Schema.StructWithRest<Schema.St
|
|
|
364
367
|
readonly flowId: Schema.String;
|
|
365
368
|
readonly cta: Schema.String;
|
|
366
369
|
readonly token: Schema.optionalKey<Schema.String>;
|
|
370
|
+
readonly action: Schema.optionalKey<Schema.Literals<readonly ["navigate", "data_exchange"]>>;
|
|
367
371
|
readonly screen: Schema.optionalKey<Schema.String>;
|
|
368
372
|
readonly data: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
369
373
|
readonly flowVersionId: Schema.String;
|
|
@@ -845,6 +849,13 @@ export declare const FlowRegistrationUpdatedEventSchema: Schema.StructWithRest<S
|
|
|
845
849
|
readonly line: Schema.optionalKey<Schema.Finite>;
|
|
846
850
|
readonly column: Schema.optionalKey<Schema.Finite>;
|
|
847
851
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
852
|
+
readonly endpointAlerts: Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
853
|
+
readonly kind: Schema.String;
|
|
854
|
+
readonly message: Schema.String;
|
|
855
|
+
readonly value: Schema.Union<readonly [Schema.Finite, Schema.Null]>;
|
|
856
|
+
readonly threshold: Schema.Union<readonly [Schema.Finite, Schema.Null]>;
|
|
857
|
+
readonly activatedAt: Schema.String;
|
|
858
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
848
859
|
readonly publishedAt: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
849
860
|
readonly statusChangedAt: Schema.String;
|
|
850
861
|
readonly createdAt: Schema.String;
|
|
@@ -853,6 +864,25 @@ export declare const FlowRegistrationUpdatedEventSchema: Schema.StructWithRest<S
|
|
|
853
864
|
readonly previousStatus: Schema.Union<readonly [Schema.Literals<readonly ["draft", "published", "throttled", "blocked", "deprecated"]>, Schema.Null]>;
|
|
854
865
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
855
866
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
867
|
+
export declare const WhatsappNumberConnectedEventSchema: Schema.StructWithRest<Schema.Struct<{
|
|
868
|
+
readonly type: Schema.Literal<"whatsapp.number.connected">;
|
|
869
|
+
readonly timestamp: Schema.String;
|
|
870
|
+
readonly data: Schema.StructWithRest<Schema.Struct<{
|
|
871
|
+
readonly organizationId: Schema.String;
|
|
872
|
+
readonly namespaceId: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
873
|
+
readonly businessAccountId: Schema.String;
|
|
874
|
+
readonly phoneNumber: Schema.String;
|
|
875
|
+
readonly phoneNumberId: Schema.String;
|
|
876
|
+
readonly whatsappBusinessAccountId: Schema.String;
|
|
877
|
+
readonly displayName: Schema.String;
|
|
878
|
+
readonly verificationStatus: Schema.Literals<readonly ["pending", "verified", "failed", "suspended"]>;
|
|
879
|
+
readonly reconnected: Schema.Boolean;
|
|
880
|
+
readonly setupLink: Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
881
|
+
readonly id: Schema.String;
|
|
882
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
883
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>;
|
|
884
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
885
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
856
886
|
export declare const MailboxMessageReceivedEventSchema: Schema.StructWithRest<Schema.Struct<{
|
|
857
887
|
readonly type: Schema.Literal<"mailbox.message.received">;
|
|
858
888
|
readonly timestamp: Schema.String;
|
|
@@ -1337,10 +1367,10 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
1337
1367
|
readonly language: Schema.String;
|
|
1338
1368
|
readonly components: Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
1339
1369
|
readonly type: Schema.Literals<readonly ["header", "body", "footer", "button"]>;
|
|
1340
|
-
readonly sub_type: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["url", "quick_reply", "copy_code"]>, Schema.Null]>>;
|
|
1370
|
+
readonly sub_type: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["url", "quick_reply", "copy_code", "flow"]>, Schema.Null]>>;
|
|
1341
1371
|
readonly index: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
1342
1372
|
readonly parameters: Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
1343
|
-
readonly type: Schema.Literals<readonly ["text", "currency", "date_time", "image", "document", "video", "coupon_code"]>;
|
|
1373
|
+
readonly type: Schema.Literals<readonly ["text", "currency", "date_time", "image", "document", "video", "coupon_code", "action"]>;
|
|
1344
1374
|
readonly text: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
1345
1375
|
readonly currency: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
1346
1376
|
readonly fallback_value: Schema.String;
|
|
@@ -1361,6 +1391,9 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
1361
1391
|
readonly link: Schema.String;
|
|
1362
1392
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
1363
1393
|
readonly coupon_code: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
1394
|
+
readonly action: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
1395
|
+
readonly flow_token: Schema.String;
|
|
1396
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
1364
1397
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
1365
1398
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
1366
1399
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
@@ -1454,6 +1487,7 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
1454
1487
|
readonly flowId: Schema.String;
|
|
1455
1488
|
readonly cta: Schema.String;
|
|
1456
1489
|
readonly token: Schema.optionalKey<Schema.String>;
|
|
1490
|
+
readonly action: Schema.optionalKey<Schema.Literals<readonly ["navigate", "data_exchange"]>>;
|
|
1457
1491
|
readonly screen: Schema.optionalKey<Schema.String>;
|
|
1458
1492
|
readonly data: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1459
1493
|
readonly flowVersionId: Schema.String;
|
|
@@ -1915,6 +1949,13 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
1915
1949
|
readonly line: Schema.optionalKey<Schema.Finite>;
|
|
1916
1950
|
readonly column: Schema.optionalKey<Schema.Finite>;
|
|
1917
1951
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
1952
|
+
readonly endpointAlerts: Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
1953
|
+
readonly kind: Schema.String;
|
|
1954
|
+
readonly message: Schema.String;
|
|
1955
|
+
readonly value: Schema.Union<readonly [Schema.Finite, Schema.Null]>;
|
|
1956
|
+
readonly threshold: Schema.Union<readonly [Schema.Finite, Schema.Null]>;
|
|
1957
|
+
readonly activatedAt: Schema.String;
|
|
1958
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
1918
1959
|
readonly publishedAt: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
1919
1960
|
readonly statusChangedAt: Schema.String;
|
|
1920
1961
|
readonly createdAt: Schema.String;
|
|
@@ -1922,6 +1963,24 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
1922
1963
|
readonly organizationId: Schema.String;
|
|
1923
1964
|
readonly previousStatus: Schema.Union<readonly [Schema.Literals<readonly ["draft", "published", "throttled", "blocked", "deprecated"]>, Schema.Null]>;
|
|
1924
1965
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
1966
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.StructWithRest<Schema.Struct<{
|
|
1967
|
+
readonly type: Schema.Literal<"whatsapp.number.connected">;
|
|
1968
|
+
readonly timestamp: Schema.String;
|
|
1969
|
+
readonly data: Schema.StructWithRest<Schema.Struct<{
|
|
1970
|
+
readonly organizationId: Schema.String;
|
|
1971
|
+
readonly namespaceId: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
1972
|
+
readonly businessAccountId: Schema.String;
|
|
1973
|
+
readonly phoneNumber: Schema.String;
|
|
1974
|
+
readonly phoneNumberId: Schema.String;
|
|
1975
|
+
readonly whatsappBusinessAccountId: Schema.String;
|
|
1976
|
+
readonly displayName: Schema.String;
|
|
1977
|
+
readonly verificationStatus: Schema.Literals<readonly ["pending", "verified", "failed", "suspended"]>;
|
|
1978
|
+
readonly reconnected: Schema.Boolean;
|
|
1979
|
+
readonly setupLink: Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
1980
|
+
readonly id: Schema.String;
|
|
1981
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
1982
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>;
|
|
1983
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
1925
1984
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.StructWithRest<Schema.Struct<{
|
|
1926
1985
|
readonly type: Schema.Literal<"mailbox.message.received">;
|
|
1927
1986
|
readonly timestamp: Schema.String;
|