expo-backend-types 0.25.0 → 0.26.0

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 +80 -0
  2. package/dist/src/i18n/es.js +80 -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
@@ -767,6 +767,182 @@ export interface paths {
767
767
  patch?: never;
768
768
  trace?: never;
769
769
  };
770
+ "/message/create-template": {
771
+ parameters: {
772
+ query?: never;
773
+ header?: never;
774
+ path?: never;
775
+ cookie?: never;
776
+ };
777
+ get?: never;
778
+ put?: never;
779
+ post: operations["MessageController_createTemplate"];
780
+ delete?: never;
781
+ options?: never;
782
+ head?: never;
783
+ patch?: never;
784
+ trace?: never;
785
+ };
786
+ "/message/templates": {
787
+ parameters: {
788
+ query?: never;
789
+ header?: never;
790
+ path?: never;
791
+ cookie?: never;
792
+ };
793
+ get: operations["MessageController_findTemplates"];
794
+ put?: never;
795
+ post?: never;
796
+ delete?: never;
797
+ options?: never;
798
+ head?: never;
799
+ patch?: never;
800
+ trace?: never;
801
+ };
802
+ "/message/template/{id}": {
803
+ parameters: {
804
+ query?: never;
805
+ header?: never;
806
+ path?: never;
807
+ cookie?: never;
808
+ };
809
+ get: operations["MessageController_findTemplateById"];
810
+ put?: never;
811
+ post?: never;
812
+ delete?: never;
813
+ options?: never;
814
+ head?: never;
815
+ patch?: never;
816
+ trace?: never;
817
+ };
818
+ "/message/template/{metaId}": {
819
+ parameters: {
820
+ query?: never;
821
+ header?: never;
822
+ path?: never;
823
+ cookie?: never;
824
+ };
825
+ get?: never;
826
+ put?: never;
827
+ post?: never;
828
+ delete: operations["MessageController_deleteTemplate"];
829
+ options?: never;
830
+ head?: never;
831
+ patch: operations["MessageController_updateTemplate"];
832
+ trace?: never;
833
+ };
834
+ "/message/send-message-to-phone": {
835
+ parameters: {
836
+ query?: never;
837
+ header?: never;
838
+ path?: never;
839
+ cookie?: never;
840
+ };
841
+ get?: never;
842
+ put?: never;
843
+ post: operations["MessageController_sendMessageToPhone"];
844
+ delete?: never;
845
+ options?: never;
846
+ head?: never;
847
+ patch?: never;
848
+ trace?: never;
849
+ };
850
+ "/message/send-template-to-tags": {
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_sendTemplateToTags"];
860
+ delete?: never;
861
+ options?: never;
862
+ head?: never;
863
+ patch?: never;
864
+ trace?: never;
865
+ };
866
+ "/message/find-messages-by-phone/{phone}": {
867
+ parameters: {
868
+ query?: never;
869
+ header?: never;
870
+ path?: never;
871
+ cookie?: never;
872
+ };
873
+ get: operations["MessageController_findMessagesByPhone"];
874
+ put?: never;
875
+ post?: never;
876
+ delete?: never;
877
+ options?: never;
878
+ head?: never;
879
+ patch?: never;
880
+ trace?: never;
881
+ };
882
+ "/message/read-messages/{phone}": {
883
+ parameters: {
884
+ query?: never;
885
+ header?: never;
886
+ path?: never;
887
+ cookie?: never;
888
+ };
889
+ get?: never;
890
+ put?: never;
891
+ post: operations["MessageController_readMessages"];
892
+ delete?: never;
893
+ options?: never;
894
+ head?: never;
895
+ patch?: never;
896
+ trace?: never;
897
+ };
898
+ "/message/non-read-messages": {
899
+ parameters: {
900
+ query?: never;
901
+ header?: never;
902
+ path?: never;
903
+ cookie?: never;
904
+ };
905
+ get: operations["MessageController_nonReadMessages"];
906
+ put?: never;
907
+ post?: never;
908
+ delete?: never;
909
+ options?: never;
910
+ head?: never;
911
+ patch?: never;
912
+ trace?: never;
913
+ };
914
+ "/message/last-message-timestamp/{phone}": {
915
+ parameters: {
916
+ query?: never;
917
+ header?: never;
918
+ path?: never;
919
+ cookie?: never;
920
+ };
921
+ get: operations["MessageController_getLastMessageTimestamp"];
922
+ put?: never;
923
+ post?: never;
924
+ delete?: never;
925
+ options?: never;
926
+ head?: never;
927
+ patch?: never;
928
+ trace?: never;
929
+ };
930
+ "/webhook": {
931
+ parameters: {
932
+ query?: never;
933
+ header?: never;
934
+ path?: never;
935
+ cookie?: never;
936
+ };
937
+ get: operations["WebhookController_verify"];
938
+ put?: never;
939
+ post: operations["WebhookController_receiveMessage"];
940
+ delete?: never;
941
+ options?: never;
942
+ head?: never;
943
+ patch?: never;
944
+ trace?: never;
945
+ };
770
946
  }
771
947
  export type webhooks = Record<string, never>;
772
948
  export interface components {
@@ -1566,7 +1742,7 @@ export interface components {
1566
1742
  id: string;
1567
1743
  from?: string;
1568
1744
  to?: string;
1569
- timestamp: number;
1745
+ timestamp: string;
1570
1746
  text: {
1571
1747
  body: string;
1572
1748
  };
@@ -1575,7 +1751,7 @@ export interface components {
1575
1751
  id: string;
1576
1752
  from?: string;
1577
1753
  to?: string;
1578
- timestamp: number;
1754
+ timestamp: string;
1579
1755
  templateName: string;
1580
1756
  type: "template";
1581
1757
  };
@@ -1883,6 +2059,99 @@ export interface components {
1883
2059
  password: string;
1884
2060
  };
1885
2061
  Buffer: Record<string, never>;
2062
+ CreateTemplateDto: {
2063
+ name: string;
2064
+ content: string;
2065
+ buttons: string[];
2066
+ };
2067
+ CreateTemplateResponseDto: {
2068
+ message: string;
2069
+ };
2070
+ FindTemplatesResponseDto: {
2071
+ templates: {
2072
+ name: string;
2073
+ id: string;
2074
+ status: "APRROVED" | "PENDING" | "REJECTED";
2075
+ }[];
2076
+ };
2077
+ FindTemplateByIdResponseDto: {
2078
+ template: {
2079
+ name: string;
2080
+ language: string;
2081
+ status: "APRROVED" | "PENDING" | "REJECTED";
2082
+ id: string;
2083
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
2084
+ components: ({
2085
+ type: "BODY";
2086
+ text: string;
2087
+ } | {
2088
+ type: "BUTTONS";
2089
+ buttons: {
2090
+ text: string;
2091
+ type: "QUICK_REPLY";
2092
+ }[];
2093
+ })[];
2094
+ };
2095
+ };
2096
+ UpdateTemplateDto: {
2097
+ content: string;
2098
+ buttons: string[];
2099
+ };
2100
+ DeleteTemplateResponseDto: {
2101
+ success: boolean;
2102
+ };
2103
+ SendMessageToPhoneDto: {
2104
+ phone: string;
2105
+ message: string;
2106
+ };
2107
+ SendMessageToPhoneResponseDto: {
2108
+ success: boolean;
2109
+ };
2110
+ SendTemplateToTagsDto: {
2111
+ tags: string[];
2112
+ templateName: string;
2113
+ };
2114
+ SendTemplateToTagsResponseDto: {
2115
+ success: boolean;
2116
+ };
2117
+ FindMessagesByPhoneNumberResponseDto: {
2118
+ inChat: boolean;
2119
+ messages: {
2120
+ message: {
2121
+ id: string;
2122
+ from?: string;
2123
+ to?: string;
2124
+ timestamp: string;
2125
+ text: {
2126
+ body: string;
2127
+ };
2128
+ type: "text";
2129
+ } | {
2130
+ id: string;
2131
+ from?: string;
2132
+ to?: string;
2133
+ timestamp: string;
2134
+ templateName: string;
2135
+ type: "template";
2136
+ };
2137
+ created_at: string;
2138
+ state: "SENT" | "RECEIVED" | "SEEN";
2139
+ }[];
2140
+ };
2141
+ ReadMessagesResponseDto: {
2142
+ success: boolean;
2143
+ };
2144
+ NonReadMessagesDto: {
2145
+ messages: {
2146
+ profilePhoneNumber: string;
2147
+ _count: {
2148
+ id: number;
2149
+ };
2150
+ }[];
2151
+ };
2152
+ GetLastMessageTimestampResponseDto: {
2153
+ timestamp: number;
2154
+ };
1886
2155
  };
1887
2156
  responses: never;
1888
2157
  parameters: never;
@@ -3464,4 +3733,335 @@ export interface operations {
3464
3733
  };
3465
3734
  };
3466
3735
  };
3736
+ MessageController_createTemplate: {
3737
+ parameters: {
3738
+ query?: never;
3739
+ header?: never;
3740
+ path?: never;
3741
+ cookie?: never;
3742
+ };
3743
+ requestBody: {
3744
+ content: {
3745
+ "application/json": components["schemas"]["CreateTemplateDto"];
3746
+ };
3747
+ };
3748
+ responses: {
3749
+ 201: {
3750
+ headers: {
3751
+ [name: string]: unknown;
3752
+ };
3753
+ content: {
3754
+ "application/json": components["schemas"]["CreateTemplateResponseDto"];
3755
+ };
3756
+ };
3757
+ };
3758
+ };
3759
+ MessageController_findTemplates: {
3760
+ parameters: {
3761
+ query?: never;
3762
+ header?: never;
3763
+ path?: never;
3764
+ cookie?: never;
3765
+ };
3766
+ requestBody?: never;
3767
+ responses: {
3768
+ 200: {
3769
+ headers: {
3770
+ [name: string]: unknown;
3771
+ };
3772
+ content: {
3773
+ "application/json": components["schemas"]["FindTemplatesResponseDto"];
3774
+ };
3775
+ };
3776
+ };
3777
+ };
3778
+ MessageController_findTemplateById: {
3779
+ parameters: {
3780
+ query?: never;
3781
+ header?: never;
3782
+ path: {
3783
+ id: string;
3784
+ };
3785
+ cookie?: never;
3786
+ };
3787
+ requestBody?: never;
3788
+ responses: {
3789
+ 200: {
3790
+ headers: {
3791
+ [name: string]: unknown;
3792
+ };
3793
+ content: {
3794
+ "application/json": components["schemas"]["FindTemplateByIdResponseDto"];
3795
+ };
3796
+ };
3797
+ };
3798
+ };
3799
+ MessageController_deleteTemplate: {
3800
+ parameters: {
3801
+ query?: never;
3802
+ header?: never;
3803
+ path: {
3804
+ metaId: string;
3805
+ };
3806
+ cookie?: never;
3807
+ };
3808
+ requestBody?: never;
3809
+ responses: {
3810
+ 200: {
3811
+ headers: {
3812
+ [name: string]: unknown;
3813
+ };
3814
+ content: {
3815
+ "application/json": components["schemas"]["DeleteTemplateResponseDto"];
3816
+ };
3817
+ };
3818
+ 404: {
3819
+ headers: {
3820
+ [name: string]: unknown;
3821
+ };
3822
+ content: {
3823
+ "application/json": components["schemas"]["ErrorDto"];
3824
+ };
3825
+ };
3826
+ };
3827
+ };
3828
+ MessageController_updateTemplate: {
3829
+ parameters: {
3830
+ query?: never;
3831
+ header?: never;
3832
+ path: {
3833
+ metaId: string;
3834
+ };
3835
+ cookie?: never;
3836
+ };
3837
+ requestBody: {
3838
+ content: {
3839
+ "application/json": components["schemas"]["UpdateTemplateDto"];
3840
+ };
3841
+ };
3842
+ responses: {
3843
+ 200: {
3844
+ headers: {
3845
+ [name: string]: unknown;
3846
+ };
3847
+ content: {
3848
+ "application/json": components["schemas"]["UpdateTemplateDto"];
3849
+ };
3850
+ };
3851
+ 404: {
3852
+ headers: {
3853
+ [name: string]: unknown;
3854
+ };
3855
+ content: {
3856
+ "application/json": components["schemas"]["ErrorDto"];
3857
+ };
3858
+ };
3859
+ };
3860
+ };
3861
+ MessageController_sendMessageToPhone: {
3862
+ parameters: {
3863
+ query?: never;
3864
+ header?: never;
3865
+ path?: never;
3866
+ cookie?: never;
3867
+ };
3868
+ requestBody: {
3869
+ content: {
3870
+ "application/json": components["schemas"]["SendMessageToPhoneDto"];
3871
+ };
3872
+ };
3873
+ responses: {
3874
+ 200: {
3875
+ headers: {
3876
+ [name: string]: unknown;
3877
+ };
3878
+ content: {
3879
+ "application/json": components["schemas"]["SendMessageToPhoneResponseDto"];
3880
+ };
3881
+ };
3882
+ 500: {
3883
+ headers: {
3884
+ [name: string]: unknown;
3885
+ };
3886
+ content: {
3887
+ "application/json": components["schemas"]["ErrorDto"];
3888
+ };
3889
+ };
3890
+ };
3891
+ };
3892
+ MessageController_sendTemplateToTags: {
3893
+ parameters: {
3894
+ query?: never;
3895
+ header?: never;
3896
+ path?: never;
3897
+ cookie?: never;
3898
+ };
3899
+ requestBody: {
3900
+ content: {
3901
+ "application/json": components["schemas"]["SendTemplateToTagsDto"];
3902
+ };
3903
+ };
3904
+ responses: {
3905
+ 200: {
3906
+ headers: {
3907
+ [name: string]: unknown;
3908
+ };
3909
+ content: {
3910
+ "application/json": components["schemas"]["SendTemplateToTagsResponseDto"];
3911
+ };
3912
+ };
3913
+ };
3914
+ };
3915
+ MessageController_findMessagesByPhone: {
3916
+ parameters: {
3917
+ query?: never;
3918
+ header?: never;
3919
+ path: {
3920
+ phone: string;
3921
+ };
3922
+ cookie?: never;
3923
+ };
3924
+ requestBody?: never;
3925
+ responses: {
3926
+ 200: {
3927
+ headers: {
3928
+ [name: string]: unknown;
3929
+ };
3930
+ content: {
3931
+ "application/json": components["schemas"]["FindMessagesByPhoneNumberResponseDto"];
3932
+ };
3933
+ };
3934
+ 404: {
3935
+ headers: {
3936
+ [name: string]: unknown;
3937
+ };
3938
+ content: {
3939
+ "application/json": components["schemas"]["ErrorDto"];
3940
+ };
3941
+ };
3942
+ };
3943
+ };
3944
+ MessageController_readMessages: {
3945
+ parameters: {
3946
+ query?: never;
3947
+ header?: never;
3948
+ path: {
3949
+ phone: string;
3950
+ };
3951
+ cookie?: never;
3952
+ };
3953
+ requestBody?: never;
3954
+ responses: {
3955
+ 200: {
3956
+ headers: {
3957
+ [name: string]: unknown;
3958
+ };
3959
+ content: {
3960
+ "application/json": components["schemas"]["ReadMessagesResponseDto"];
3961
+ };
3962
+ };
3963
+ 500: {
3964
+ headers: {
3965
+ [name: string]: unknown;
3966
+ };
3967
+ content: {
3968
+ "application/json": components["schemas"]["ErrorDto"];
3969
+ };
3970
+ };
3971
+ };
3972
+ };
3973
+ MessageController_nonReadMessages: {
3974
+ parameters: {
3975
+ query?: never;
3976
+ header?: never;
3977
+ path?: never;
3978
+ cookie?: never;
3979
+ };
3980
+ requestBody?: never;
3981
+ responses: {
3982
+ 200: {
3983
+ headers: {
3984
+ [name: string]: unknown;
3985
+ };
3986
+ content: {
3987
+ "application/json": components["schemas"]["NonReadMessagesDto"];
3988
+ };
3989
+ };
3990
+ };
3991
+ };
3992
+ MessageController_getLastMessageTimestamp: {
3993
+ parameters: {
3994
+ query?: never;
3995
+ header?: never;
3996
+ path: {
3997
+ phone: string;
3998
+ };
3999
+ cookie?: never;
4000
+ };
4001
+ requestBody?: never;
4002
+ responses: {
4003
+ 200: {
4004
+ headers: {
4005
+ [name: string]: unknown;
4006
+ };
4007
+ content: {
4008
+ "application/json": components["schemas"]["GetLastMessageTimestampResponseDto"];
4009
+ };
4010
+ };
4011
+ };
4012
+ };
4013
+ WebhookController_verify: {
4014
+ parameters: {
4015
+ query: {
4016
+ "hub.mode": string;
4017
+ "hub.verify_token": string;
4018
+ "hub.challenge": string;
4019
+ };
4020
+ header?: never;
4021
+ path?: never;
4022
+ cookie?: never;
4023
+ };
4024
+ requestBody?: never;
4025
+ responses: {
4026
+ 200: {
4027
+ headers: {
4028
+ [name: string]: unknown;
4029
+ };
4030
+ content: {
4031
+ "application/json": string;
4032
+ };
4033
+ };
4034
+ 400: {
4035
+ headers: {
4036
+ [name: string]: unknown;
4037
+ };
4038
+ content?: never;
4039
+ };
4040
+ 403: {
4041
+ headers: {
4042
+ [name: string]: unknown;
4043
+ };
4044
+ content?: never;
4045
+ };
4046
+ };
4047
+ };
4048
+ WebhookController_receiveMessage: {
4049
+ parameters: {
4050
+ query?: never;
4051
+ header: {
4052
+ "x-hub-signature-256": string;
4053
+ };
4054
+ path?: never;
4055
+ cookie?: never;
4056
+ };
4057
+ requestBody?: never;
4058
+ responses: {
4059
+ 201: {
4060
+ headers: {
4061
+ [name: string]: unknown;
4062
+ };
4063
+ content?: never;
4064
+ };
4065
+ };
4066
+ };
3467
4067
  }