@samva/webhooks 0.51.0 → 0.53.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 +2 -2
- package/dist/{json-schemas.gen-CE5C7st9.js → json-schemas.gen-Du5pts9S.js} +22 -2
- package/dist/promise.js +2 -2
- package/dist/{protocol-COaro8fP.js → protocol-Q3-Vd3-K.js} +386 -384
- package/dist/protocol.js +1 -1
- package/dist/schemas.gen.d.ts +12 -0
- package/dist/schemas.gen.js +9 -1
- package/dist/types.gen.d.ts +10 -0
- package/package.json +1 -1
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-Q3-Vd3-K.js";
|
package/dist/schemas.gen.d.ts
CHANGED
|
@@ -246,7 +246,9 @@ export declare const MessageReceivedEventSchema: Schema.StructWithRest<Schema.St
|
|
|
246
246
|
readonly campaignId: Schema.String;
|
|
247
247
|
readonly runId: Schema.String;
|
|
248
248
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
249
|
+
readonly replyToMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
249
250
|
readonly whatsapp: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
251
|
+
readonly appHandlesFlowSubmission: Schema.optionalKey<Schema.Literal<true>>;
|
|
250
252
|
readonly text: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
251
253
|
readonly template: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
252
254
|
readonly name: Schema.String;
|
|
@@ -279,6 +281,7 @@ export declare const MessageReceivedEventSchema: Schema.StructWithRest<Schema.St
|
|
|
279
281
|
readonly coupon_code: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
280
282
|
readonly action: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
281
283
|
readonly flow_token: Schema.String;
|
|
284
|
+
readonly flow_action_data: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
282
285
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
283
286
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
284
287
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
@@ -454,6 +457,7 @@ export declare const MessageReceivedEventSchema: Schema.StructWithRest<Schema.St
|
|
|
454
457
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
455
458
|
readonly flowResponse: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
456
459
|
readonly flowToken: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
460
|
+
readonly submissionHandler: Schema.optionalKey<Schema.Literal<"app">>;
|
|
457
461
|
readonly response: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
458
462
|
readonly body: Schema.optionalKey<Schema.String>;
|
|
459
463
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
@@ -924,6 +928,7 @@ export declare const MailboxMessageReceivedEventSchema: Schema.StructWithRest<Sc
|
|
|
924
928
|
readonly mailboxId: Schema.String;
|
|
925
929
|
readonly namespaceId: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
926
930
|
readonly message: Schema.StructWithRest<Schema.Struct<{
|
|
931
|
+
readonly flowSubmissionHandledBy: Schema.optionalKey<Schema.Literal<"app">>;
|
|
927
932
|
readonly id: Schema.String;
|
|
928
933
|
readonly campaign: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
929
934
|
readonly campaignId: Schema.String;
|
|
@@ -972,6 +977,7 @@ export declare const MailboxMessageSentEventSchema: Schema.StructWithRest<Schema
|
|
|
972
977
|
readonly source: Schema.Literals<readonly ["humanUi", "externalApi", "externalAgent", "extension", "samvaManagedAgent", "system"]>;
|
|
973
978
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
974
979
|
readonly message: Schema.StructWithRest<Schema.Struct<{
|
|
980
|
+
readonly flowSubmissionHandledBy: Schema.optionalKey<Schema.Literal<"app">>;
|
|
975
981
|
readonly id: Schema.String;
|
|
976
982
|
readonly campaign: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
977
983
|
readonly campaignId: Schema.String;
|
|
@@ -1461,7 +1467,9 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
1461
1467
|
readonly campaignId: Schema.String;
|
|
1462
1468
|
readonly runId: Schema.String;
|
|
1463
1469
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
1470
|
+
readonly replyToMetadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1464
1471
|
readonly whatsapp: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
1472
|
+
readonly appHandlesFlowSubmission: Schema.optionalKey<Schema.Literal<true>>;
|
|
1465
1473
|
readonly text: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
1466
1474
|
readonly template: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
1467
1475
|
readonly name: Schema.String;
|
|
@@ -1494,6 +1502,7 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
1494
1502
|
readonly coupon_code: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
|
|
1495
1503
|
readonly action: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
1496
1504
|
readonly flow_token: Schema.String;
|
|
1505
|
+
readonly flow_action_data: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1497
1506
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>, Schema.Null]>>;
|
|
1498
1507
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
1499
1508
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
@@ -1669,6 +1678,7 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
1669
1678
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
1670
1679
|
readonly flowResponse: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
1671
1680
|
readonly flowToken: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
1681
|
+
readonly submissionHandler: Schema.optionalKey<Schema.Literal<"app">>;
|
|
1672
1682
|
readonly response: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
1673
1683
|
readonly body: Schema.optionalKey<Schema.String>;
|
|
1674
1684
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
@@ -2115,6 +2125,7 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
2115
2125
|
readonly mailboxId: Schema.String;
|
|
2116
2126
|
readonly namespaceId: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
2117
2127
|
readonly message: Schema.StructWithRest<Schema.Struct<{
|
|
2128
|
+
readonly flowSubmissionHandledBy: Schema.optionalKey<Schema.Literal<"app">>;
|
|
2118
2129
|
readonly id: Schema.String;
|
|
2119
2130
|
readonly campaign: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
2120
2131
|
readonly campaignId: Schema.String;
|
|
@@ -2162,6 +2173,7 @@ export declare const SamvaWebhookEventSchema: Schema.Union<readonly [Schema.Stru
|
|
|
2162
2173
|
readonly source: Schema.Literals<readonly ["humanUi", "externalApi", "externalAgent", "extension", "samvaManagedAgent", "system"]>;
|
|
2163
2174
|
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
2164
2175
|
readonly message: Schema.StructWithRest<Schema.Struct<{
|
|
2176
|
+
readonly flowSubmissionHandledBy: Schema.optionalKey<Schema.Literal<"app">>;
|
|
2165
2177
|
readonly id: Schema.String;
|
|
2166
2178
|
readonly campaign: Schema.optionalKey<Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
2167
2179
|
readonly campaignId: Schema.String;
|
package/dist/schemas.gen.js
CHANGED
|
@@ -316,7 +316,9 @@ const MessageReceivedEventSchema = Schema.StructWithRest(Schema.Struct({
|
|
|
316
316
|
campaignId: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^camp_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^camp_[0-9a-hjkmnp-tv-z]{16,24}$" })),
|
|
317
317
|
runId: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^crun_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^crun_[0-9a-hjkmnp-tv-z]{16,24}$" }))
|
|
318
318
|
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]), Schema.Null])),
|
|
319
|
+
replyToMetadata: Schema.optionalKey(Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))),
|
|
319
320
|
whatsapp: Schema.optionalKey(Schema.Union([Schema.StructWithRest(Schema.Struct({
|
|
321
|
+
appHandlesFlowSubmission: Schema.optionalKey(Schema.Literal(true)),
|
|
320
322
|
text: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
|
|
321
323
|
template: Schema.optionalKey(Schema.Union([Schema.StructWithRest(Schema.Struct({
|
|
322
324
|
name: Schema.String,
|
|
@@ -360,7 +362,10 @@ const MessageReceivedEventSchema = Schema.StructWithRest(Schema.Struct({
|
|
|
360
362
|
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]), Schema.Null])),
|
|
361
363
|
video: Schema.optionalKey(Schema.Union([Schema.StructWithRest(Schema.Struct({ link: Schema.String }), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]), Schema.Null])),
|
|
362
364
|
coupon_code: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
|
|
363
|
-
action: Schema.optionalKey(Schema.Union([Schema.StructWithRest(Schema.Struct({
|
|
365
|
+
action: Schema.optionalKey(Schema.Union([Schema.StructWithRest(Schema.Struct({
|
|
366
|
+
flow_token: Schema.String,
|
|
367
|
+
flow_action_data: Schema.optionalKey(Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })))
|
|
368
|
+
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]), Schema.Null]))
|
|
364
369
|
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]))
|
|
365
370
|
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]))
|
|
366
371
|
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]), Schema.Null])),
|
|
@@ -576,6 +581,7 @@ const MessageReceivedEventSchema = Schema.StructWithRest(Schema.Struct({
|
|
|
576
581
|
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))])),
|
|
577
582
|
flowResponse: Schema.optionalKey(Schema.StructWithRest(Schema.Struct({
|
|
578
583
|
flowToken: Schema.Union([Schema.String, Schema.Null]),
|
|
584
|
+
submissionHandler: Schema.optionalKey(Schema.Literal("app")),
|
|
579
585
|
response: Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })),
|
|
580
586
|
body: Schema.optionalKey(Schema.String)
|
|
581
587
|
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))])),
|
|
@@ -1268,6 +1274,7 @@ const MailboxMessageReceivedEventSchema = Schema.StructWithRest(Schema.Struct({
|
|
|
1268
1274
|
mailboxId: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^mbx_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^mbx_[0-9a-hjkmnp-tv-z]{16,24}$" })),
|
|
1269
1275
|
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]),
|
|
1270
1276
|
message: Schema.StructWithRest(Schema.Struct({
|
|
1277
|
+
flowSubmissionHandledBy: Schema.optionalKey(Schema.Literal("app")),
|
|
1271
1278
|
id: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^msg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^msg_[0-9a-hjkmnp-tv-z]{16,24}$" })),
|
|
1272
1279
|
campaign: Schema.optionalKey(Schema.Union([Schema.StructWithRest(Schema.Struct({
|
|
1273
1280
|
campaignId: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^camp_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^camp_[0-9a-hjkmnp-tv-z]{16,24}$" })),
|
|
@@ -1334,6 +1341,7 @@ const MailboxMessageSentEventSchema = Schema.StructWithRest(Schema.Struct({
|
|
|
1334
1341
|
])
|
|
1335
1342
|
}), [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))]),
|
|
1336
1343
|
message: Schema.StructWithRest(Schema.Struct({
|
|
1344
|
+
flowSubmissionHandledBy: Schema.optionalKey(Schema.Literal("app")),
|
|
1337
1345
|
id: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^msg_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^msg_[0-9a-hjkmnp-tv-z]{16,24}$" })),
|
|
1338
1346
|
campaign: Schema.optionalKey(Schema.Union([Schema.StructWithRest(Schema.Struct({
|
|
1339
1347
|
campaignId: Schema.String.check(Schema.isPattern(new globalThis.RegExp("^camp_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({ expected: "a string matching the RegExp ^camp_[0-9a-hjkmnp-tv-z]{16,24}$" })),
|
package/dist/types.gen.d.ts
CHANGED
|
@@ -294,7 +294,11 @@ export type MessageReceivedEvent = {
|
|
|
294
294
|
} & {
|
|
295
295
|
readonly [x: string]: JsonValue;
|
|
296
296
|
}) | null;
|
|
297
|
+
readonly replyToMetadata?: {
|
|
298
|
+
readonly [x: string]: JsonValue;
|
|
299
|
+
};
|
|
297
300
|
readonly whatsapp?: ({
|
|
301
|
+
readonly appHandlesFlowSubmission?: true;
|
|
298
302
|
readonly text?: string | null;
|
|
299
303
|
readonly template?: ({
|
|
300
304
|
readonly name: string;
|
|
@@ -337,6 +341,9 @@ export type MessageReceivedEvent = {
|
|
|
337
341
|
readonly coupon_code?: string | null;
|
|
338
342
|
readonly action?: ({
|
|
339
343
|
readonly flow_token: string;
|
|
344
|
+
readonly flow_action_data?: {
|
|
345
|
+
readonly [x: string]: JsonValue;
|
|
346
|
+
};
|
|
340
347
|
} & {
|
|
341
348
|
readonly [x: string]: JsonValue;
|
|
342
349
|
}) | null;
|
|
@@ -594,6 +601,7 @@ export type MessageReceivedEvent = {
|
|
|
594
601
|
};
|
|
595
602
|
readonly flowResponse?: {
|
|
596
603
|
readonly flowToken: string | null;
|
|
604
|
+
readonly submissionHandler?: "app";
|
|
597
605
|
readonly response: {
|
|
598
606
|
readonly [x: string]: JsonValue;
|
|
599
607
|
};
|
|
@@ -1226,6 +1234,7 @@ export type MailboxMessageReceivedEvent = {
|
|
|
1226
1234
|
readonly mailboxId: string;
|
|
1227
1235
|
readonly namespaceId: string | null;
|
|
1228
1236
|
readonly message: {
|
|
1237
|
+
readonly flowSubmissionHandledBy?: "app";
|
|
1229
1238
|
readonly id: string;
|
|
1230
1239
|
readonly campaign?: ({
|
|
1231
1240
|
readonly campaignId: string;
|
|
@@ -1291,6 +1300,7 @@ export type MailboxMessageSentEvent = {
|
|
|
1291
1300
|
readonly [x: string]: JsonValue;
|
|
1292
1301
|
};
|
|
1293
1302
|
readonly message: {
|
|
1303
|
+
readonly flowSubmissionHandledBy?: "app";
|
|
1294
1304
|
readonly id: string;
|
|
1295
1305
|
readonly campaign?: ({
|
|
1296
1306
|
readonly campaignId: string;
|