expo-backend-types 0.24.0 → 0.25.0-EXPO-251-EB-Whatsapp.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/dist/src/i18n/es.d.ts +78 -0
  2. package/dist/src/i18n/es.js +78 -0
  3. package/dist/src/i18n/es.js.map +1 -1
  4. package/dist/src/location/dto/arg-city.dto.d.ts +2 -2
  5. package/dist/src/message/dto/create-template.dto.d.ts +93 -0
  6. package/dist/src/message/dto/create-template.dto.js +24 -0
  7. package/dist/src/message/dto/delete-template.dto.d.ts +18 -0
  8. package/dist/src/message/dto/delete-template.dto.js +15 -0
  9. package/dist/src/message/dto/find-messages-by-phone.dto.d.ts +316 -0
  10. package/dist/src/message/dto/find-messages-by-phone.dto.js +24 -0
  11. package/dist/src/message/dto/find-template-by-id.dto.d.ts +245 -0
  12. package/dist/src/message/dto/find-template-by-id.dto.js +23 -0
  13. package/dist/src/message/dto/find-templates.dto.d.ts +109 -0
  14. package/dist/src/message/dto/find-templates.dto.js +20 -0
  15. package/dist/src/message/dto/get-last-message-timestamp.dto.d.ts +18 -0
  16. package/dist/src/message/dto/get-last-message-timestamp.dto.js +15 -0
  17. package/dist/src/message/dto/message.dto.d.ts +46 -16
  18. package/dist/src/message/dto/message.dto.js +1 -1
  19. package/dist/src/message/dto/non-read-messages.dto.d.ts +76 -0
  20. package/dist/src/message/dto/non-read-messages.dto.js +21 -0
  21. package/dist/src/message/dto/read-messages.dto.d.ts +18 -0
  22. package/dist/src/message/dto/read-messages.dto.js +15 -0
  23. package/dist/src/message/dto/send-message-to-phone.dto.d.ts +40 -0
  24. package/dist/src/message/dto/send-message-to-phone.dto.js +23 -0
  25. package/dist/src/message/dto/send-template-to-tags.dto.d.ts +40 -0
  26. package/dist/src/message/dto/send-template-to-tags.dto.js +23 -0
  27. package/dist/src/message/dto/template.dto.d.ts +154 -0
  28. package/dist/src/message/dto/template.dto.js +63 -0
  29. package/dist/src/message/dto/update-template.dto.d.ts +88 -0
  30. package/dist/src/message/dto/update-template.dto.js +23 -0
  31. package/dist/src/message/exports.d.ts +9 -0
  32. package/dist/src/message/exports.js +9 -0
  33. package/dist/src/profile/dto/find-with-active-chat.dto.d.ts +36 -36
  34. package/dist/src/webhook/dto/webhook.dto.d.ts +86 -0
  35. package/dist/src/webhook/dto/webhook.dto.js +3 -0
  36. package/dist/types/schema.d.ts +602 -2
  37. package/package.json +2 -1
@@ -0,0 +1,86 @@
1
+ export type Contact = {
2
+ profile: {
3
+ name: string;
4
+ };
5
+ wa_id: string;
6
+ };
7
+ export type WebhookImage = {
8
+ id: string;
9
+ sha256: string;
10
+ mime_type: string;
11
+ };
12
+ export type WebhookMessage = {
13
+ from: string;
14
+ id: string;
15
+ timestamp: string;
16
+ } & ({
17
+ type: 'text';
18
+ text: {
19
+ body: string;
20
+ };
21
+ } | {
22
+ type: 'image';
23
+ image: WebhookImage;
24
+ } | {
25
+ type: 'button';
26
+ button: {
27
+ payload: string;
28
+ text: string;
29
+ };
30
+ context: {
31
+ from: string;
32
+ id: string;
33
+ };
34
+ });
35
+ export type WebHookRequest = {
36
+ object: 'whatsapp_business_account';
37
+ entry: [
38
+ {
39
+ id: string;
40
+ changes: [
41
+ {
42
+ field: string;
43
+ value: ReceivedMessage | StatusChange;
44
+ }
45
+ ];
46
+ }
47
+ ];
48
+ };
49
+ export type ReceivedMessage = {
50
+ contacts: [Contact];
51
+ messages: WebhookMessage[];
52
+ };
53
+ export type StatusChange = {
54
+ metadata: {
55
+ display_phone_number: string;
56
+ phone_number_id: string;
57
+ };
58
+ statuses: [
59
+ {
60
+ id: string;
61
+ status: 'delivered' | 'read' | 'sent' | 'failed';
62
+ timestamp: string;
63
+ recipient_id: string;
64
+ conversation: {
65
+ id: string;
66
+ expiration_timestamp: string;
67
+ origin: {
68
+ type: string;
69
+ };
70
+ };
71
+ }
72
+ ];
73
+ };
74
+ export type SendWhatsappResponse = {
75
+ contacts: [
76
+ {
77
+ input: string;
78
+ wa_id: string;
79
+ }
80
+ ];
81
+ messages: [
82
+ {
83
+ id: string;
84
+ }
85
+ ];
86
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=webhook.dto.js.map
@@ -735,6 +735,182 @@ export interface paths {
735
735
  patch?: never;
736
736
  trace?: never;
737
737
  };
738
+ "/message/create-template": {
739
+ parameters: {
740
+ query?: never;
741
+ header?: never;
742
+ path?: never;
743
+ cookie?: never;
744
+ };
745
+ get?: never;
746
+ put?: never;
747
+ post: operations["MessageController_createTemplate"];
748
+ delete?: never;
749
+ options?: never;
750
+ head?: never;
751
+ patch?: never;
752
+ trace?: never;
753
+ };
754
+ "/message/templates": {
755
+ parameters: {
756
+ query?: never;
757
+ header?: never;
758
+ path?: never;
759
+ cookie?: never;
760
+ };
761
+ get: operations["MessageController_findTemplates"];
762
+ put?: never;
763
+ post?: never;
764
+ delete?: never;
765
+ options?: never;
766
+ head?: never;
767
+ patch?: never;
768
+ trace?: never;
769
+ };
770
+ "/message/template/{id}": {
771
+ parameters: {
772
+ query?: never;
773
+ header?: never;
774
+ path?: never;
775
+ cookie?: never;
776
+ };
777
+ get: operations["MessageController_findTemplateById"];
778
+ put?: never;
779
+ post?: never;
780
+ delete?: never;
781
+ options?: never;
782
+ head?: never;
783
+ patch?: never;
784
+ trace?: never;
785
+ };
786
+ "/message/template/{metaId}": {
787
+ parameters: {
788
+ query?: never;
789
+ header?: never;
790
+ path?: never;
791
+ cookie?: never;
792
+ };
793
+ get?: never;
794
+ put?: never;
795
+ post?: never;
796
+ delete: operations["MessageController_deleteTemplate"];
797
+ options?: never;
798
+ head?: never;
799
+ patch: operations["MessageController_updateTemplate"];
800
+ trace?: never;
801
+ };
802
+ "/message/send-message-to-phone": {
803
+ parameters: {
804
+ query?: never;
805
+ header?: never;
806
+ path?: never;
807
+ cookie?: never;
808
+ };
809
+ get?: never;
810
+ put?: never;
811
+ post: operations["MessageController_sendMessageToPhone"];
812
+ delete?: never;
813
+ options?: never;
814
+ head?: never;
815
+ patch?: never;
816
+ trace?: never;
817
+ };
818
+ "/message/send-template-to-tags": {
819
+ parameters: {
820
+ query?: never;
821
+ header?: never;
822
+ path?: never;
823
+ cookie?: never;
824
+ };
825
+ get?: never;
826
+ put?: never;
827
+ post: operations["MessageController_sendTemplateToTags"];
828
+ delete?: never;
829
+ options?: never;
830
+ head?: never;
831
+ patch?: never;
832
+ trace?: never;
833
+ };
834
+ "/message/find-messages-by-phone/{phone}": {
835
+ parameters: {
836
+ query?: never;
837
+ header?: never;
838
+ path?: never;
839
+ cookie?: never;
840
+ };
841
+ get: operations["MessageController_findMessagesByPhone"];
842
+ put?: never;
843
+ post?: never;
844
+ delete?: never;
845
+ options?: never;
846
+ head?: never;
847
+ patch?: never;
848
+ trace?: never;
849
+ };
850
+ "/message/read-messages/{phone}": {
851
+ parameters: {
852
+ query?: never;
853
+ header?: never;
854
+ path?: never;
855
+ cookie?: never;
856
+ };
857
+ get?: never;
858
+ put?: never;
859
+ post: operations["MessageController_readMessages"];
860
+ delete?: never;
861
+ options?: never;
862
+ head?: never;
863
+ patch?: never;
864
+ trace?: never;
865
+ };
866
+ "/message/non-read-messages": {
867
+ parameters: {
868
+ query?: never;
869
+ header?: never;
870
+ path?: never;
871
+ cookie?: never;
872
+ };
873
+ get: operations["MessageController_nonReadMessages"];
874
+ put?: never;
875
+ post?: never;
876
+ delete?: never;
877
+ options?: never;
878
+ head?: never;
879
+ patch?: never;
880
+ trace?: never;
881
+ };
882
+ "/message/last-message-timestamp/{phone}": {
883
+ parameters: {
884
+ query?: never;
885
+ header?: never;
886
+ path?: never;
887
+ cookie?: never;
888
+ };
889
+ get: operations["MessageController_getLastMessageTimestamp"];
890
+ put?: never;
891
+ post?: never;
892
+ delete?: never;
893
+ options?: never;
894
+ head?: never;
895
+ patch?: never;
896
+ trace?: never;
897
+ };
898
+ "/webhook": {
899
+ parameters: {
900
+ query?: never;
901
+ header?: never;
902
+ path?: never;
903
+ cookie?: never;
904
+ };
905
+ get: operations["WebhookController_verify"];
906
+ put?: never;
907
+ post: operations["WebhookController_receiveMessage"];
908
+ delete?: never;
909
+ options?: never;
910
+ head?: never;
911
+ patch?: never;
912
+ trace?: never;
913
+ };
738
914
  }
739
915
  export type webhooks = Record<string, never>;
740
916
  export interface components {
@@ -1534,7 +1710,7 @@ export interface components {
1534
1710
  id: string;
1535
1711
  from?: string;
1536
1712
  to?: string;
1537
- timestamp: number;
1713
+ timestamp: string;
1538
1714
  text: {
1539
1715
  body: string;
1540
1716
  };
@@ -1543,7 +1719,7 @@ export interface components {
1543
1719
  id: string;
1544
1720
  from?: string;
1545
1721
  to?: string;
1546
- timestamp: number;
1722
+ timestamp: string;
1547
1723
  templateName: string;
1548
1724
  type: "template";
1549
1725
  };
@@ -1845,6 +2021,99 @@ export interface components {
1845
2021
  password: string;
1846
2022
  };
1847
2023
  Buffer: Record<string, never>;
2024
+ CreateTemplateDto: {
2025
+ name: string;
2026
+ content: string;
2027
+ buttons: string[];
2028
+ };
2029
+ CreateTemplateResponseDto: {
2030
+ message: string;
2031
+ };
2032
+ FindTemplatesResponseDto: {
2033
+ templates: {
2034
+ name: string;
2035
+ id: string;
2036
+ status: "APRROVED" | "PENDING" | "REJECTED";
2037
+ }[];
2038
+ };
2039
+ FindTemplateByIdResponseDto: {
2040
+ template: {
2041
+ name: string;
2042
+ language: string;
2043
+ status: "APRROVED" | "PENDING" | "REJECTED";
2044
+ id: string;
2045
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
2046
+ components: ({
2047
+ type: "BODY";
2048
+ text: string;
2049
+ } | {
2050
+ type: "BUTTONS";
2051
+ buttons: {
2052
+ text: string;
2053
+ type: "QUICK_REPLY";
2054
+ }[];
2055
+ })[];
2056
+ };
2057
+ };
2058
+ UpdateTemplateDto: {
2059
+ content: string;
2060
+ buttons: string[];
2061
+ };
2062
+ DeleteTemplateResponseDto: {
2063
+ success: boolean;
2064
+ };
2065
+ SendMessageToPhoneDto: {
2066
+ phone: string;
2067
+ message: string;
2068
+ };
2069
+ SendMessageToPhoneResponseDto: {
2070
+ success: boolean;
2071
+ };
2072
+ SendTemplateToTagsDto: {
2073
+ tags: string[];
2074
+ templateName: string;
2075
+ };
2076
+ SendTemplateToTagsResponseDto: {
2077
+ success: boolean;
2078
+ };
2079
+ FindMessagesByPhoneNumberResponseDto: {
2080
+ inChat: boolean;
2081
+ messages: {
2082
+ message: {
2083
+ id: string;
2084
+ from?: string;
2085
+ to?: string;
2086
+ timestamp: string;
2087
+ text: {
2088
+ body: string;
2089
+ };
2090
+ type: "text";
2091
+ } | {
2092
+ id: string;
2093
+ from?: string;
2094
+ to?: string;
2095
+ timestamp: string;
2096
+ templateName: string;
2097
+ type: "template";
2098
+ };
2099
+ created_at: string;
2100
+ state: "SENT" | "RECEIVED" | "SEEN";
2101
+ }[];
2102
+ };
2103
+ ReadMessagesResponseDto: {
2104
+ success: boolean;
2105
+ };
2106
+ NonReadMessagesDto: {
2107
+ messages: {
2108
+ profilePhoneNumber: string;
2109
+ _count: {
2110
+ id: number;
2111
+ };
2112
+ }[];
2113
+ };
2114
+ GetLastMessageTimestampResponseDto: {
2115
+ timestamp: number;
2116
+ };
1848
2117
  };
1849
2118
  responses: never;
1850
2119
  parameters: never;
@@ -3344,4 +3613,335 @@ export interface operations {
3344
3613
  };
3345
3614
  };
3346
3615
  };
3616
+ MessageController_createTemplate: {
3617
+ parameters: {
3618
+ query?: never;
3619
+ header?: never;
3620
+ path?: never;
3621
+ cookie?: never;
3622
+ };
3623
+ requestBody: {
3624
+ content: {
3625
+ "application/json": components["schemas"]["CreateTemplateDto"];
3626
+ };
3627
+ };
3628
+ responses: {
3629
+ 201: {
3630
+ headers: {
3631
+ [name: string]: unknown;
3632
+ };
3633
+ content: {
3634
+ "application/json": components["schemas"]["CreateTemplateResponseDto"];
3635
+ };
3636
+ };
3637
+ };
3638
+ };
3639
+ MessageController_findTemplates: {
3640
+ parameters: {
3641
+ query?: never;
3642
+ header?: never;
3643
+ path?: never;
3644
+ cookie?: never;
3645
+ };
3646
+ requestBody?: never;
3647
+ responses: {
3648
+ 200: {
3649
+ headers: {
3650
+ [name: string]: unknown;
3651
+ };
3652
+ content: {
3653
+ "application/json": components["schemas"]["FindTemplatesResponseDto"];
3654
+ };
3655
+ };
3656
+ };
3657
+ };
3658
+ MessageController_findTemplateById: {
3659
+ parameters: {
3660
+ query?: never;
3661
+ header?: never;
3662
+ path: {
3663
+ id: string;
3664
+ };
3665
+ cookie?: never;
3666
+ };
3667
+ requestBody?: never;
3668
+ responses: {
3669
+ 200: {
3670
+ headers: {
3671
+ [name: string]: unknown;
3672
+ };
3673
+ content: {
3674
+ "application/json": components["schemas"]["FindTemplateByIdResponseDto"];
3675
+ };
3676
+ };
3677
+ };
3678
+ };
3679
+ MessageController_deleteTemplate: {
3680
+ parameters: {
3681
+ query?: never;
3682
+ header?: never;
3683
+ path: {
3684
+ metaId: string;
3685
+ };
3686
+ cookie?: never;
3687
+ };
3688
+ requestBody?: never;
3689
+ responses: {
3690
+ 200: {
3691
+ headers: {
3692
+ [name: string]: unknown;
3693
+ };
3694
+ content: {
3695
+ "application/json": components["schemas"]["DeleteTemplateResponseDto"];
3696
+ };
3697
+ };
3698
+ 404: {
3699
+ headers: {
3700
+ [name: string]: unknown;
3701
+ };
3702
+ content: {
3703
+ "application/json": components["schemas"]["ErrorDto"];
3704
+ };
3705
+ };
3706
+ };
3707
+ };
3708
+ MessageController_updateTemplate: {
3709
+ parameters: {
3710
+ query?: never;
3711
+ header?: never;
3712
+ path: {
3713
+ metaId: string;
3714
+ };
3715
+ cookie?: never;
3716
+ };
3717
+ requestBody: {
3718
+ content: {
3719
+ "application/json": components["schemas"]["UpdateTemplateDto"];
3720
+ };
3721
+ };
3722
+ responses: {
3723
+ 200: {
3724
+ headers: {
3725
+ [name: string]: unknown;
3726
+ };
3727
+ content: {
3728
+ "application/json": components["schemas"]["UpdateTemplateDto"];
3729
+ };
3730
+ };
3731
+ 404: {
3732
+ headers: {
3733
+ [name: string]: unknown;
3734
+ };
3735
+ content: {
3736
+ "application/json": components["schemas"]["ErrorDto"];
3737
+ };
3738
+ };
3739
+ };
3740
+ };
3741
+ MessageController_sendMessageToPhone: {
3742
+ parameters: {
3743
+ query?: never;
3744
+ header?: never;
3745
+ path?: never;
3746
+ cookie?: never;
3747
+ };
3748
+ requestBody: {
3749
+ content: {
3750
+ "application/json": components["schemas"]["SendMessageToPhoneDto"];
3751
+ };
3752
+ };
3753
+ responses: {
3754
+ 200: {
3755
+ headers: {
3756
+ [name: string]: unknown;
3757
+ };
3758
+ content: {
3759
+ "application/json": components["schemas"]["SendMessageToPhoneResponseDto"];
3760
+ };
3761
+ };
3762
+ 500: {
3763
+ headers: {
3764
+ [name: string]: unknown;
3765
+ };
3766
+ content: {
3767
+ "application/json": components["schemas"]["ErrorDto"];
3768
+ };
3769
+ };
3770
+ };
3771
+ };
3772
+ MessageController_sendTemplateToTags: {
3773
+ parameters: {
3774
+ query?: never;
3775
+ header?: never;
3776
+ path?: never;
3777
+ cookie?: never;
3778
+ };
3779
+ requestBody: {
3780
+ content: {
3781
+ "application/json": components["schemas"]["SendTemplateToTagsDto"];
3782
+ };
3783
+ };
3784
+ responses: {
3785
+ 200: {
3786
+ headers: {
3787
+ [name: string]: unknown;
3788
+ };
3789
+ content: {
3790
+ "application/json": components["schemas"]["SendTemplateToTagsResponseDto"];
3791
+ };
3792
+ };
3793
+ };
3794
+ };
3795
+ MessageController_findMessagesByPhone: {
3796
+ parameters: {
3797
+ query?: never;
3798
+ header?: never;
3799
+ path: {
3800
+ phone: string;
3801
+ };
3802
+ cookie?: never;
3803
+ };
3804
+ requestBody?: never;
3805
+ responses: {
3806
+ 200: {
3807
+ headers: {
3808
+ [name: string]: unknown;
3809
+ };
3810
+ content: {
3811
+ "application/json": components["schemas"]["FindMessagesByPhoneNumberResponseDto"];
3812
+ };
3813
+ };
3814
+ 404: {
3815
+ headers: {
3816
+ [name: string]: unknown;
3817
+ };
3818
+ content: {
3819
+ "application/json": components["schemas"]["ErrorDto"];
3820
+ };
3821
+ };
3822
+ };
3823
+ };
3824
+ MessageController_readMessages: {
3825
+ parameters: {
3826
+ query?: never;
3827
+ header?: never;
3828
+ path: {
3829
+ phone: string;
3830
+ };
3831
+ cookie?: never;
3832
+ };
3833
+ requestBody?: never;
3834
+ responses: {
3835
+ 200: {
3836
+ headers: {
3837
+ [name: string]: unknown;
3838
+ };
3839
+ content: {
3840
+ "application/json": components["schemas"]["ReadMessagesResponseDto"];
3841
+ };
3842
+ };
3843
+ 500: {
3844
+ headers: {
3845
+ [name: string]: unknown;
3846
+ };
3847
+ content: {
3848
+ "application/json": components["schemas"]["ErrorDto"];
3849
+ };
3850
+ };
3851
+ };
3852
+ };
3853
+ MessageController_nonReadMessages: {
3854
+ parameters: {
3855
+ query?: never;
3856
+ header?: never;
3857
+ path?: never;
3858
+ cookie?: never;
3859
+ };
3860
+ requestBody?: never;
3861
+ responses: {
3862
+ 200: {
3863
+ headers: {
3864
+ [name: string]: unknown;
3865
+ };
3866
+ content: {
3867
+ "application/json": components["schemas"]["NonReadMessagesDto"];
3868
+ };
3869
+ };
3870
+ };
3871
+ };
3872
+ MessageController_getLastMessageTimestamp: {
3873
+ parameters: {
3874
+ query?: never;
3875
+ header?: never;
3876
+ path: {
3877
+ phone: string;
3878
+ };
3879
+ cookie?: never;
3880
+ };
3881
+ requestBody?: never;
3882
+ responses: {
3883
+ 200: {
3884
+ headers: {
3885
+ [name: string]: unknown;
3886
+ };
3887
+ content: {
3888
+ "application/json": components["schemas"]["GetLastMessageTimestampResponseDto"];
3889
+ };
3890
+ };
3891
+ };
3892
+ };
3893
+ WebhookController_verify: {
3894
+ parameters: {
3895
+ query: {
3896
+ "hub.mode": string;
3897
+ "hub.verify_token": string;
3898
+ "hub.challenge": string;
3899
+ };
3900
+ header?: never;
3901
+ path?: never;
3902
+ cookie?: never;
3903
+ };
3904
+ requestBody?: never;
3905
+ responses: {
3906
+ 200: {
3907
+ headers: {
3908
+ [name: string]: unknown;
3909
+ };
3910
+ content: {
3911
+ "application/json": string;
3912
+ };
3913
+ };
3914
+ 400: {
3915
+ headers: {
3916
+ [name: string]: unknown;
3917
+ };
3918
+ content?: never;
3919
+ };
3920
+ 403: {
3921
+ headers: {
3922
+ [name: string]: unknown;
3923
+ };
3924
+ content?: never;
3925
+ };
3926
+ };
3927
+ };
3928
+ WebhookController_receiveMessage: {
3929
+ parameters: {
3930
+ query?: never;
3931
+ header: {
3932
+ "x-hub-signature-256": string;
3933
+ };
3934
+ path?: never;
3935
+ cookie?: never;
3936
+ };
3937
+ requestBody?: never;
3938
+ responses: {
3939
+ 201: {
3940
+ headers: {
3941
+ [name: string]: unknown;
3942
+ };
3943
+ content?: never;
3944
+ };
3945
+ };
3946
+ };
3347
3947
  }