@samva/webhooks 0.15.0 → 0.17.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.
@@ -542,6 +542,7 @@ const WebhookEventJsonSchemas = {
542
542
  errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
543
543
  parts: { anyOf: [{ type: "number" }, { type: "null" }] },
544
544
  carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
545
+ whatsapp: { anyOf: [{ $ref: "#/$defs/WhatsAppMessageContent" }, { type: "null" }] },
545
546
  messageId: { type: "string" },
546
547
  organizationId: { type: "string" }
547
548
  },
@@ -559,10 +560,612 @@ const WebhookEventJsonSchemas = {
559
560
  "data"
560
561
  ],
561
562
  additionalProperties: true,
562
- $defs: { MailboxId: {
563
- type: "string",
564
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
565
- } }
563
+ $defs: {
564
+ MailboxId: {
565
+ type: "string",
566
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
567
+ },
568
+ WhatsAppTextHeader: {
569
+ type: "object",
570
+ properties: {
571
+ type: {
572
+ type: "string",
573
+ enum: ["text"]
574
+ },
575
+ text: {
576
+ type: "string",
577
+ minLength: 1,
578
+ maxLength: 60
579
+ }
580
+ },
581
+ required: ["type", "text"],
582
+ additionalProperties: true
583
+ },
584
+ WhatsAppImageHeaderLink: {
585
+ type: "object",
586
+ properties: {
587
+ type: {
588
+ type: "string",
589
+ enum: ["image"]
590
+ },
591
+ url: { type: "string" }
592
+ },
593
+ required: ["type", "url"],
594
+ additionalProperties: true
595
+ },
596
+ MediaId: {
597
+ type: "string",
598
+ pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
599
+ },
600
+ WhatsAppImageHeaderUpload: {
601
+ type: "object",
602
+ properties: {
603
+ type: {
604
+ type: "string",
605
+ enum: ["image"]
606
+ },
607
+ mediaId: { $ref: "#/$defs/MediaId" }
608
+ },
609
+ required: ["type", "mediaId"],
610
+ additionalProperties: true
611
+ },
612
+ WhatsAppImageHeader: { anyOf: [{ $ref: "#/$defs/WhatsAppImageHeaderLink" }, { $ref: "#/$defs/WhatsAppImageHeaderUpload" }] },
613
+ WhatsAppVideoHeaderLink: {
614
+ type: "object",
615
+ properties: {
616
+ type: {
617
+ type: "string",
618
+ enum: ["video"]
619
+ },
620
+ url: { type: "string" }
621
+ },
622
+ required: ["type", "url"],
623
+ additionalProperties: true
624
+ },
625
+ WhatsAppVideoHeaderUpload: {
626
+ type: "object",
627
+ properties: {
628
+ type: {
629
+ type: "string",
630
+ enum: ["video"]
631
+ },
632
+ mediaId: { $ref: "#/$defs/MediaId" }
633
+ },
634
+ required: ["type", "mediaId"],
635
+ additionalProperties: true
636
+ },
637
+ WhatsAppVideoHeader: { anyOf: [{ $ref: "#/$defs/WhatsAppVideoHeaderLink" }, { $ref: "#/$defs/WhatsAppVideoHeaderUpload" }] },
638
+ WhatsAppDocumentHeaderLink: {
639
+ type: "object",
640
+ properties: {
641
+ type: {
642
+ type: "string",
643
+ enum: ["document"]
644
+ },
645
+ filename: {
646
+ type: "string",
647
+ minLength: 1,
648
+ maxLength: 255
649
+ },
650
+ url: { type: "string" }
651
+ },
652
+ required: ["type", "url"],
653
+ additionalProperties: true
654
+ },
655
+ WhatsAppDocumentHeaderUpload: {
656
+ type: "object",
657
+ properties: {
658
+ type: {
659
+ type: "string",
660
+ enum: ["document"]
661
+ },
662
+ filename: {
663
+ type: "string",
664
+ minLength: 1,
665
+ maxLength: 255
666
+ },
667
+ mediaId: { $ref: "#/$defs/MediaId" }
668
+ },
669
+ required: ["type", "mediaId"],
670
+ additionalProperties: true
671
+ },
672
+ WhatsAppDocumentHeader: { anyOf: [{ $ref: "#/$defs/WhatsAppDocumentHeaderLink" }, { $ref: "#/$defs/WhatsAppDocumentHeaderUpload" }] },
673
+ WhatsAppInteractiveHeader: { anyOf: [
674
+ { $ref: "#/$defs/WhatsAppTextHeader" },
675
+ { $ref: "#/$defs/WhatsAppImageHeader" },
676
+ { $ref: "#/$defs/WhatsAppVideoHeader" },
677
+ { $ref: "#/$defs/WhatsAppDocumentHeader" }
678
+ ] },
679
+ WhatsAppReplyButton: {
680
+ type: "object",
681
+ properties: {
682
+ id: {
683
+ type: "string",
684
+ minLength: 1,
685
+ maxLength: 256
686
+ },
687
+ title: {
688
+ type: "string",
689
+ minLength: 1,
690
+ maxLength: 20
691
+ }
692
+ },
693
+ required: ["id", "title"],
694
+ additionalProperties: true
695
+ },
696
+ WhatsAppButtonsMessage: {
697
+ type: "object",
698
+ properties: {
699
+ type: {
700
+ type: "string",
701
+ enum: ["buttons"]
702
+ },
703
+ header: { $ref: "#/$defs/WhatsAppInteractiveHeader" },
704
+ body: {
705
+ type: "string",
706
+ minLength: 1,
707
+ maxLength: 1024
708
+ },
709
+ footer: {
710
+ type: "string",
711
+ minLength: 1,
712
+ maxLength: 60
713
+ },
714
+ buttons: {
715
+ type: "array",
716
+ items: { $ref: "#/$defs/WhatsAppReplyButton" },
717
+ minItems: 1,
718
+ maxItems: 3
719
+ }
720
+ },
721
+ required: [
722
+ "type",
723
+ "body",
724
+ "buttons"
725
+ ],
726
+ additionalProperties: true
727
+ },
728
+ WhatsAppListRow: {
729
+ type: "object",
730
+ properties: {
731
+ id: {
732
+ type: "string",
733
+ minLength: 1,
734
+ maxLength: 200
735
+ },
736
+ title: {
737
+ type: "string",
738
+ minLength: 1,
739
+ maxLength: 24
740
+ },
741
+ description: {
742
+ type: "string",
743
+ minLength: 1,
744
+ maxLength: 72
745
+ }
746
+ },
747
+ required: ["id", "title"],
748
+ additionalProperties: true
749
+ },
750
+ WhatsAppListSection: {
751
+ type: "object",
752
+ properties: {
753
+ title: {
754
+ type: "string",
755
+ minLength: 1,
756
+ maxLength: 24
757
+ },
758
+ rows: {
759
+ type: "array",
760
+ items: { $ref: "#/$defs/WhatsAppListRow" },
761
+ minItems: 1
762
+ }
763
+ },
764
+ required: ["rows"],
765
+ additionalProperties: true
766
+ },
767
+ WhatsAppListMessage: {
768
+ type: "object",
769
+ properties: {
770
+ type: {
771
+ type: "string",
772
+ enum: ["list"]
773
+ },
774
+ header: { $ref: "#/$defs/WhatsAppTextHeader" },
775
+ body: {
776
+ type: "string",
777
+ minLength: 1,
778
+ maxLength: 4096
779
+ },
780
+ footer: {
781
+ type: "string",
782
+ minLength: 1,
783
+ maxLength: 60
784
+ },
785
+ button: {
786
+ type: "string",
787
+ minLength: 1,
788
+ maxLength: 20
789
+ },
790
+ sections: {
791
+ type: "array",
792
+ items: { $ref: "#/$defs/WhatsAppListSection" },
793
+ minItems: 1,
794
+ maxItems: 10
795
+ }
796
+ },
797
+ required: [
798
+ "type",
799
+ "body",
800
+ "button",
801
+ "sections"
802
+ ],
803
+ additionalProperties: true
804
+ },
805
+ WhatsAppCtaUrlMessage: {
806
+ type: "object",
807
+ properties: {
808
+ type: {
809
+ type: "string",
810
+ enum: ["cta_url"]
811
+ },
812
+ header: { $ref: "#/$defs/WhatsAppInteractiveHeader" },
813
+ body: {
814
+ type: "string",
815
+ minLength: 1,
816
+ maxLength: 1024
817
+ },
818
+ footer: {
819
+ type: "string",
820
+ minLength: 1,
821
+ maxLength: 60
822
+ },
823
+ displayText: {
824
+ type: "string",
825
+ minLength: 1,
826
+ maxLength: 20
827
+ },
828
+ url: { type: "string" }
829
+ },
830
+ required: [
831
+ "type",
832
+ "body",
833
+ "displayText",
834
+ "url"
835
+ ],
836
+ additionalProperties: true
837
+ },
838
+ WhatsAppInteractive: { anyOf: [
839
+ { $ref: "#/$defs/WhatsAppButtonsMessage" },
840
+ { $ref: "#/$defs/WhatsAppListMessage" },
841
+ { $ref: "#/$defs/WhatsAppCtaUrlMessage" }
842
+ ] },
843
+ WhatsAppStoredMedia: { anyOf: [
844
+ {
845
+ type: "object",
846
+ properties: {
847
+ type: {
848
+ type: "string",
849
+ enum: [
850
+ "image",
851
+ "video",
852
+ "audio",
853
+ "document",
854
+ "sticker"
855
+ ]
856
+ },
857
+ url: { type: "string" },
858
+ caption: { type: "string" },
859
+ filename: { type: "string" }
860
+ },
861
+ required: ["type", "url"],
862
+ additionalProperties: true
863
+ },
864
+ {
865
+ type: "object",
866
+ properties: {
867
+ type: {
868
+ type: "string",
869
+ enum: [
870
+ "image",
871
+ "video",
872
+ "audio",
873
+ "document",
874
+ "sticker"
875
+ ]
876
+ },
877
+ mediaId: { $ref: "#/$defs/MediaId" },
878
+ caption: { type: "string" },
879
+ filename: { type: "string" }
880
+ },
881
+ required: ["type", "mediaId"],
882
+ additionalProperties: true
883
+ },
884
+ {
885
+ type: "object",
886
+ properties: {
887
+ type: {
888
+ type: "string",
889
+ enum: [
890
+ "image",
891
+ "video",
892
+ "audio",
893
+ "document",
894
+ "sticker"
895
+ ]
896
+ },
897
+ providerMediaId: { type: "string" },
898
+ mimeType: { anyOf: [{ type: "string" }, { type: "null" }] },
899
+ caption: { anyOf: [{ type: "string" }, { type: "null" }] },
900
+ filename: { type: "string" }
901
+ },
902
+ required: ["type", "providerMediaId"],
903
+ additionalProperties: true
904
+ }
905
+ ] },
906
+ MessageId: {
907
+ type: "string",
908
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
909
+ },
910
+ WhatsAppStoredReaction: {
911
+ type: "object",
912
+ properties: {
913
+ messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
914
+ providerMessageId: { type: "string" },
915
+ emoji: { anyOf: [{ type: "string" }, { type: "null" }] }
916
+ },
917
+ required: [
918
+ "messageId",
919
+ "providerMessageId",
920
+ "emoji"
921
+ ],
922
+ additionalProperties: true
923
+ },
924
+ WhatsAppStoredLocation: {
925
+ type: "object",
926
+ properties: {
927
+ latitude: { type: "number" },
928
+ longitude: { type: "number" },
929
+ name: { type: "string" },
930
+ address: { type: "string" },
931
+ url: { type: "string" }
932
+ },
933
+ required: ["latitude", "longitude"],
934
+ additionalProperties: true
935
+ },
936
+ WhatsAppStoredContactCard: {
937
+ type: "object",
938
+ properties: {
939
+ name: {
940
+ type: "object",
941
+ properties: {
942
+ formattedName: { type: "string" },
943
+ firstName: { type: "string" },
944
+ lastName: { type: "string" },
945
+ middleName: { type: "string" },
946
+ prefix: { type: "string" },
947
+ suffix: { type: "string" }
948
+ },
949
+ additionalProperties: true
950
+ },
951
+ phones: {
952
+ type: "array",
953
+ items: {
954
+ type: "object",
955
+ properties: {
956
+ phone: { type: "string" },
957
+ type: { type: "string" },
958
+ waId: { type: "string" }
959
+ },
960
+ additionalProperties: true
961
+ }
962
+ },
963
+ emails: {
964
+ type: "array",
965
+ items: {
966
+ type: "object",
967
+ properties: {
968
+ email: { type: "string" },
969
+ type: { type: "string" }
970
+ },
971
+ additionalProperties: true
972
+ }
973
+ },
974
+ urls: {
975
+ type: "array",
976
+ items: {
977
+ type: "object",
978
+ properties: {
979
+ url: { type: "string" },
980
+ type: { type: "string" }
981
+ },
982
+ additionalProperties: true
983
+ }
984
+ },
985
+ org: {
986
+ type: "object",
987
+ properties: {
988
+ company: { type: "string" },
989
+ department: { type: "string" },
990
+ title: { type: "string" }
991
+ },
992
+ additionalProperties: true
993
+ },
994
+ addresses: {
995
+ type: "array",
996
+ items: {
997
+ type: "object",
998
+ properties: {
999
+ street: { type: "string" },
1000
+ city: { type: "string" },
1001
+ state: { type: "string" },
1002
+ zip: { type: "string" },
1003
+ country: { type: "string" },
1004
+ countryCode: { type: "string" },
1005
+ type: { type: "string" }
1006
+ },
1007
+ additionalProperties: true
1008
+ }
1009
+ },
1010
+ birthday: { type: "string" }
1011
+ },
1012
+ additionalProperties: true
1013
+ },
1014
+ WhatsAppReceivedReply: {
1015
+ type: "object",
1016
+ properties: {
1017
+ type: {
1018
+ type: "string",
1019
+ enum: [
1020
+ "button",
1021
+ "list",
1022
+ "template_button"
1023
+ ]
1024
+ },
1025
+ id: { type: "string" },
1026
+ title: { type: "string" },
1027
+ description: { type: "string" }
1028
+ },
1029
+ required: [
1030
+ "type",
1031
+ "id",
1032
+ "title"
1033
+ ],
1034
+ additionalProperties: true
1035
+ },
1036
+ WhatsAppMessageReference: {
1037
+ type: "object",
1038
+ properties: {
1039
+ messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
1040
+ providerMessageId: { type: "string" }
1041
+ },
1042
+ required: ["messageId", "providerMessageId"],
1043
+ additionalProperties: true
1044
+ },
1045
+ WhatsAppMessageContent: {
1046
+ type: "object",
1047
+ properties: {
1048
+ text: { anyOf: [{ type: "string" }, { type: "null" }] },
1049
+ template: { anyOf: [{
1050
+ type: "object",
1051
+ properties: {
1052
+ name: { type: "string" },
1053
+ language: { type: "string" },
1054
+ components: {
1055
+ type: "array",
1056
+ items: {
1057
+ type: "object",
1058
+ properties: {
1059
+ type: {
1060
+ type: "string",
1061
+ enum: [
1062
+ "header",
1063
+ "body",
1064
+ "footer",
1065
+ "button"
1066
+ ]
1067
+ },
1068
+ sub_type: { anyOf: [{
1069
+ type: "string",
1070
+ enum: [
1071
+ "url",
1072
+ "quick_reply",
1073
+ "copy_code"
1074
+ ]
1075
+ }, { type: "null" }] },
1076
+ index: { anyOf: [{ type: "string" }, { type: "null" }] },
1077
+ parameters: {
1078
+ type: "array",
1079
+ items: {
1080
+ type: "object",
1081
+ properties: {
1082
+ type: {
1083
+ type: "string",
1084
+ enum: [
1085
+ "text",
1086
+ "currency",
1087
+ "date_time",
1088
+ "image",
1089
+ "document",
1090
+ "video",
1091
+ "coupon_code"
1092
+ ]
1093
+ },
1094
+ text: { anyOf: [{ type: "string" }, { type: "null" }] },
1095
+ currency: { anyOf: [{
1096
+ type: "object",
1097
+ properties: {
1098
+ fallback_value: { type: "string" },
1099
+ code: { type: "string" },
1100
+ amount_1000: { type: "number" }
1101
+ },
1102
+ required: [
1103
+ "fallback_value",
1104
+ "code",
1105
+ "amount_1000"
1106
+ ],
1107
+ additionalProperties: true
1108
+ }, { type: "null" }] },
1109
+ date_time: { anyOf: [{
1110
+ type: "object",
1111
+ properties: { fallback_value: { type: "string" } },
1112
+ required: ["fallback_value"],
1113
+ additionalProperties: true
1114
+ }, { type: "null" }] },
1115
+ image: { anyOf: [{
1116
+ type: "object",
1117
+ properties: { link: { type: "string" } },
1118
+ required: ["link"],
1119
+ additionalProperties: true
1120
+ }, { type: "null" }] },
1121
+ document: { anyOf: [{
1122
+ type: "object",
1123
+ properties: {
1124
+ link: { type: "string" },
1125
+ filename: { anyOf: [{ type: "string" }, { type: "null" }] }
1126
+ },
1127
+ required: ["link"],
1128
+ additionalProperties: true
1129
+ }, { type: "null" }] },
1130
+ video: { anyOf: [{
1131
+ type: "object",
1132
+ properties: { link: { type: "string" } },
1133
+ required: ["link"],
1134
+ additionalProperties: true
1135
+ }, { type: "null" }] },
1136
+ coupon_code: { anyOf: [{ type: "string" }, { type: "null" }] }
1137
+ },
1138
+ required: ["type"],
1139
+ additionalProperties: true
1140
+ }
1141
+ }
1142
+ },
1143
+ required: ["type", "parameters"],
1144
+ additionalProperties: true
1145
+ }
1146
+ }
1147
+ },
1148
+ required: [
1149
+ "name",
1150
+ "language",
1151
+ "components"
1152
+ ],
1153
+ additionalProperties: true
1154
+ }, { type: "null" }] },
1155
+ interactive: { $ref: "#/$defs/WhatsAppInteractive" },
1156
+ media: { anyOf: [{ $ref: "#/$defs/WhatsAppStoredMedia" }, { type: "null" }] },
1157
+ reaction: { $ref: "#/$defs/WhatsAppStoredReaction" },
1158
+ location: { $ref: "#/$defs/WhatsAppStoredLocation" },
1159
+ contacts: {
1160
+ type: "array",
1161
+ items: { $ref: "#/$defs/WhatsAppStoredContactCard" }
1162
+ },
1163
+ reply: { $ref: "#/$defs/WhatsAppReceivedReply" },
1164
+ context: { $ref: "#/$defs/WhatsAppMessageReference" }
1165
+ },
1166
+ additionalProperties: true
1167
+ }
1168
+ }
566
1169
  },
567
1170
  "message.opened": {
568
1171
  type: "object",
@@ -1899,6 +2502,154 @@ const WebhookEventJsonSchemas = {
1899
2502
  additionalProperties: true,
1900
2503
  $defs: {}
1901
2504
  },
2505
+ "template.registration.updated": {
2506
+ type: "object",
2507
+ properties: {
2508
+ type: {
2509
+ type: "string",
2510
+ enum: ["template.registration.updated"]
2511
+ },
2512
+ timestamp: { type: "string" },
2513
+ data: {
2514
+ type: "object",
2515
+ properties: {
2516
+ id: { $ref: "#/$defs/TemplateRegistrationId" },
2517
+ templateId: { $ref: "#/$defs/TemplateId" },
2518
+ publicationId: { $ref: "#/$defs/TemplatePublicationId" },
2519
+ target: { $ref: "#/$defs/TemplateRegistrationTarget" },
2520
+ name: { type: "string" },
2521
+ language: { type: "string" },
2522
+ status: {
2523
+ type: "string",
2524
+ enum: [
2525
+ "draft",
2526
+ "submitted",
2527
+ "approved",
2528
+ "rejected",
2529
+ "paused",
2530
+ "disabled"
2531
+ ]
2532
+ },
2533
+ category: {
2534
+ type: "string",
2535
+ enum: [
2536
+ "marketing",
2537
+ "utility",
2538
+ "authentication",
2539
+ "transactional",
2540
+ "service_implicit",
2541
+ "service_explicit",
2542
+ "promotional"
2543
+ ]
2544
+ },
2545
+ providerCategory: { anyOf: [{
2546
+ type: "string",
2547
+ enum: [
2548
+ "marketing",
2549
+ "utility",
2550
+ "authentication",
2551
+ "transactional",
2552
+ "service_implicit",
2553
+ "service_explicit",
2554
+ "promotional"
2555
+ ]
2556
+ }, { type: "null" }] },
2557
+ providerTemplateId: { anyOf: [{ type: "string" }, { type: "null" }] },
2558
+ reason: { anyOf: [{ type: "string" }, { type: "null" }] },
2559
+ submittedAt: { anyOf: [{ type: "string" }, { type: "null" }] },
2560
+ statusChangedAt: { type: "string" },
2561
+ createdAt: { type: "string" },
2562
+ updatedAt: { type: "string" },
2563
+ organizationId: { $ref: "#/$defs/OrganizationId" },
2564
+ previousStatus: {
2565
+ type: "string",
2566
+ enum: [
2567
+ "draft",
2568
+ "submitted",
2569
+ "approved",
2570
+ "rejected",
2571
+ "paused",
2572
+ "disabled"
2573
+ ]
2574
+ }
2575
+ },
2576
+ required: [
2577
+ "id",
2578
+ "templateId",
2579
+ "publicationId",
2580
+ "target",
2581
+ "name",
2582
+ "language",
2583
+ "status",
2584
+ "category",
2585
+ "providerCategory",
2586
+ "providerTemplateId",
2587
+ "reason",
2588
+ "submittedAt",
2589
+ "statusChangedAt",
2590
+ "createdAt",
2591
+ "updatedAt",
2592
+ "organizationId",
2593
+ "previousStatus"
2594
+ ],
2595
+ additionalProperties: true
2596
+ }
2597
+ },
2598
+ required: [
2599
+ "type",
2600
+ "timestamp",
2601
+ "data"
2602
+ ],
2603
+ additionalProperties: true,
2604
+ $defs: {
2605
+ TemplateRegistrationId: {
2606
+ type: "string",
2607
+ pattern: "^treg_[0-9a-hjkmnp-tv-z]{16,24}$"
2608
+ },
2609
+ TemplateId: {
2610
+ type: "string",
2611
+ pattern: "^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$"
2612
+ },
2613
+ TemplatePublicationId: {
2614
+ type: "string",
2615
+ pattern: "^tpub_[0-9a-hjkmnp-tv-z]{16,24}$"
2616
+ },
2617
+ WhatsAppRegistrationTarget: {
2618
+ type: "object",
2619
+ properties: {
2620
+ provider: {
2621
+ type: "string",
2622
+ enum: ["whatsapp"]
2623
+ },
2624
+ wabaId: { type: "string" }
2625
+ },
2626
+ required: ["provider", "wabaId"],
2627
+ additionalProperties: true
2628
+ },
2629
+ DltRegistrationTarget: {
2630
+ type: "object",
2631
+ properties: {
2632
+ provider: {
2633
+ type: "string",
2634
+ enum: ["dlt"]
2635
+ },
2636
+ entityId: { type: "string" },
2637
+ headerId: { type: "string" }
2638
+ },
2639
+ required: [
2640
+ "provider",
2641
+ "entityId",
2642
+ "headerId"
2643
+ ],
2644
+ additionalProperties: true
2645
+ },
2646
+ TemplateRegistrationTarget: { anyOf: [{ $ref: "#/$defs/WhatsAppRegistrationTarget" }, { $ref: "#/$defs/DltRegistrationTarget" }] },
2647
+ OrganizationId: {
2648
+ type: "string",
2649
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2650
+ }
2651
+ }
2652
+ },
1902
2653
  "mailbox.message.received": {
1903
2654
  type: "object",
1904
2655
  properties: {
@@ -1916,6 +2667,7 @@ const WebhookEventJsonSchemas = {
1916
2667
  type: "object",
1917
2668
  properties: {
1918
2669
  id: { $ref: "#/$defs/MessageId" },
2670
+ channel: { $ref: "#/$defs/MailboxChannel" },
1919
2671
  threadId: { $ref: "#/$defs/MailboxThreadId" },
1920
2672
  from: {
1921
2673
  type: "object",
@@ -1976,6 +2728,10 @@ const WebhookEventJsonSchemas = {
1976
2728
  type: "object",
1977
2729
  properties: {
1978
2730
  id: { $ref: "#/$defs/MailboxThreadId" },
2731
+ endpointId: {
2732
+ anyOf: [{ $ref: "#/$defs/MailboxEndpointId" }, { type: "null" }],
2733
+ description: "The endpoint the message arrived at; null once it is removed. Deliveries recorded before this field existed omit it."
2734
+ },
1979
2735
  subject: { anyOf: [{ type: "string" }, { type: "null" }] },
1980
2736
  preview: { anyOf: [{ type: "string" }, { type: "null" }] }
1981
2737
  },
@@ -2015,6 +2771,15 @@ const WebhookEventJsonSchemas = {
2015
2771
  type: "string",
2016
2772
  pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2017
2773
  },
2774
+ MailboxChannel: {
2775
+ type: "string",
2776
+ enum: [
2777
+ "email",
2778
+ "whatsapp",
2779
+ "sms"
2780
+ ],
2781
+ description: "Deliveries recorded before this field existed omit it; they are email."
2782
+ },
2018
2783
  MailboxThreadId: {
2019
2784
  type: "string",
2020
2785
  pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
@@ -2022,6 +2787,10 @@ const WebhookEventJsonSchemas = {
2022
2787
  AttachmentId: {
2023
2788
  type: "string",
2024
2789
  pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
2790
+ },
2791
+ MailboxEndpointId: {
2792
+ type: "string",
2793
+ pattern: "^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$"
2025
2794
  }
2026
2795
  }
2027
2796
  },
@@ -2083,6 +2852,7 @@ const WebhookEventJsonSchemas = {
2083
2852
  type: "object",
2084
2853
  properties: {
2085
2854
  id: { $ref: "#/$defs/MessageId" },
2855
+ channel: { $ref: "#/$defs/MailboxChannel" },
2086
2856
  threadId: { $ref: "#/$defs/MailboxThreadId" },
2087
2857
  from: {
2088
2858
  type: "object",
@@ -2173,6 +2943,15 @@ const WebhookEventJsonSchemas = {
2173
2943
  type: "string",
2174
2944
  pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2175
2945
  },
2946
+ MailboxChannel: {
2947
+ type: "string",
2948
+ enum: [
2949
+ "email",
2950
+ "whatsapp",
2951
+ "sms"
2952
+ ],
2953
+ description: "Deliveries recorded before this field existed omit it; they are email."
2954
+ },
2176
2955
  MailboxThreadId: {
2177
2956
  type: "string",
2178
2957
  pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
@@ -2512,6 +3291,7 @@ const WebhookEventJsonSchemas = {
2512
3291
  type: "object",
2513
3292
  properties: {
2514
3293
  id: { $ref: "#/$defs/MessageId" },
3294
+ channel: { $ref: "#/$defs/MailboxChannel" },
2515
3295
  threadId: { $ref: "#/$defs/MailboxThreadId" },
2516
3296
  from: {
2517
3297
  type: "object",
@@ -2572,6 +3352,10 @@ const WebhookEventJsonSchemas = {
2572
3352
  type: "object",
2573
3353
  properties: {
2574
3354
  id: { $ref: "#/$defs/MailboxThreadId" },
3355
+ endpointId: {
3356
+ anyOf: [{ $ref: "#/$defs/MailboxEndpointId" }, { type: "null" }],
3357
+ description: "The endpoint the message arrived at; null once it is removed. Deliveries recorded before this field existed omit it."
3358
+ },
2575
3359
  subject: { anyOf: [{ type: "string" }, { type: "null" }] },
2576
3360
  preview: { anyOf: [{ type: "string" }, { type: "null" }] }
2577
3361
  },
@@ -2613,6 +3397,15 @@ const WebhookEventJsonSchemas = {
2613
3397
  type: "string",
2614
3398
  pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2615
3399
  },
3400
+ MailboxChannel: {
3401
+ type: "string",
3402
+ enum: [
3403
+ "email",
3404
+ "whatsapp",
3405
+ "sms"
3406
+ ],
3407
+ description: "Deliveries recorded before this field existed omit it; they are email."
3408
+ },
2616
3409
  MailboxThreadId: {
2617
3410
  type: "string",
2618
3411
  pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
@@ -2620,6 +3413,10 @@ const WebhookEventJsonSchemas = {
2620
3413
  AttachmentId: {
2621
3414
  type: "string",
2622
3415
  pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
3416
+ },
3417
+ MailboxEndpointId: {
3418
+ type: "string",
3419
+ pattern: "^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$"
2623
3420
  }
2624
3421
  }
2625
3422
  },
@@ -2742,9 +3539,79 @@ const WebhookEventJsonSchemas = {
2742
3539
  pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2743
3540
  }
2744
3541
  }
3542
+ },
3543
+ "journey.webhook": {
3544
+ type: "object",
3545
+ properties: {
3546
+ type: {
3547
+ type: "string",
3548
+ enum: ["journey.webhook"]
3549
+ },
3550
+ timestamp: { type: "string" },
3551
+ data: {
3552
+ type: "object",
3553
+ properties: {
3554
+ organizationId: { $ref: "#/$defs/OrganizationId" },
3555
+ journeyId: { $ref: "#/$defs/JourneyId" },
3556
+ journeyVersion: { type: "integer" },
3557
+ runId: { $ref: "#/$defs/JourneyRunId" },
3558
+ nodeId: { type: "string" },
3559
+ contact: {
3560
+ type: "object",
3561
+ properties: {
3562
+ id: { $ref: "#/$defs/ContactId" },
3563
+ externalId: { anyOf: [{ type: "string" }, { type: "null" }] },
3564
+ email: { anyOf: [{ type: "string" }, { type: "null" }] }
3565
+ },
3566
+ required: [
3567
+ "id",
3568
+ "externalId",
3569
+ "email"
3570
+ ],
3571
+ additionalProperties: true
3572
+ },
3573
+ data: { $ref: "#/$defs/JsonObject" }
3574
+ },
3575
+ required: [
3576
+ "organizationId",
3577
+ "journeyId",
3578
+ "journeyVersion",
3579
+ "runId",
3580
+ "nodeId",
3581
+ "contact",
3582
+ "data"
3583
+ ],
3584
+ additionalProperties: true
3585
+ }
3586
+ },
3587
+ required: [
3588
+ "type",
3589
+ "timestamp",
3590
+ "data"
3591
+ ],
3592
+ additionalProperties: true,
3593
+ $defs: {
3594
+ OrganizationId: {
3595
+ type: "string",
3596
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
3597
+ },
3598
+ JourneyId: {
3599
+ type: "string",
3600
+ pattern: "^jrny_[0-9a-hjkmnp-tv-z]{16,24}$"
3601
+ },
3602
+ JourneyRunId: {
3603
+ type: "string",
3604
+ pattern: "^jrun_[0-9a-hjkmnp-tv-z]{16,24}$"
3605
+ },
3606
+ ContactId: {
3607
+ type: "string",
3608
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
3609
+ },
3610
+ JsonObject: { type: "object" }
3611
+ }
2745
3612
  }
2746
3613
  };
2747
3614
  //#endregion
2748
3615
  export { WebhookEventJsonSchemas as t };
2749
3616
 
2750
- //# sourceMappingURL=json-schemas.gen-eya_ZDps.js.map
3617
+ //# sourceMappingURL=json-schemas.gen-DC_ZmYw2.js.map