expo-backend-types 0.23.0 → 0.24.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 (29) hide show
  1. package/dist/src/i18n/es.d.ts +51 -0
  2. package/dist/src/i18n/es.js +51 -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/message.dto.d.ts +46 -16
  16. package/dist/src/message/dto/message.dto.js +1 -1
  17. package/dist/src/message/dto/send-message-to-phone.dto.d.ts +40 -0
  18. package/dist/src/message/dto/send-message-to-phone.dto.js +23 -0
  19. package/dist/src/message/dto/send-template-to-tags.dto.d.ts +40 -0
  20. package/dist/src/message/dto/send-template-to-tags.dto.js +23 -0
  21. package/dist/src/message/dto/template.dto.d.ts +154 -0
  22. package/dist/src/message/dto/template.dto.js +63 -0
  23. package/dist/src/message/dto/update-template.dto.d.ts +88 -0
  24. package/dist/src/message/dto/update-template.dto.js +23 -0
  25. package/dist/src/message/exports.d.ts +9 -0
  26. package/dist/src/message/exports.js +9 -0
  27. package/dist/src/profile/dto/find-with-active-chat.dto.d.ts +36 -36
  28. package/dist/types/schema.d.ts +401 -2
  29. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FindMessagesByPhoneNumberResponseDto = exports.findMessagesByPhoneResponseSchema = void 0;
7
+ const message_dto_1 = require("./message.dto");
8
+ const create_zod_dto_without_date_1 = require("../../shared/dto-modification/create-zod-dto-without-date");
9
+ const zod_1 = __importDefault(require("zod"));
10
+ exports.findMessagesByPhoneResponseSchema = zod_1.default
11
+ .object({
12
+ inChat: zod_1.default.boolean(),
13
+ })
14
+ .merge(zod_1.default.object({
15
+ messages: zod_1.default.array(message_dto_1.messageSchema.pick({
16
+ message: true,
17
+ created_at: true,
18
+ state: true,
19
+ })),
20
+ }));
21
+ class FindMessagesByPhoneNumberResponseDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.findMessagesByPhoneResponseSchema) {
22
+ }
23
+ exports.FindMessagesByPhoneNumberResponseDto = FindMessagesByPhoneNumberResponseDto;
24
+ //# sourceMappingURL=find-messages-by-phone.dto.js.map
@@ -0,0 +1,245 @@
1
+ import z from 'zod';
2
+ export declare const findTemplateByIdResponseSchema: z.ZodObject<{
3
+ template: z.ZodObject<Pick<{
4
+ name: z.ZodEffects<z.ZodString, string, string>;
5
+ content: z.ZodString;
6
+ buttons: z.ZodArray<z.ZodString, "many">;
7
+ id: z.ZodString;
8
+ language: z.ZodString;
9
+ components: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
10
+ type: z.ZodLiteral<"BODY">;
11
+ text: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ type: "BODY";
14
+ text: string;
15
+ }, {
16
+ type: "BODY";
17
+ text: string;
18
+ }>, z.ZodObject<{
19
+ type: z.ZodLiteral<"BUTTONS">;
20
+ buttons: z.ZodArray<z.ZodObject<{
21
+ text: z.ZodString;
22
+ type: z.ZodLiteral<"QUICK_REPLY">;
23
+ }, "strip", z.ZodTypeAny, {
24
+ type: "QUICK_REPLY";
25
+ text: string;
26
+ }, {
27
+ type: "QUICK_REPLY";
28
+ text: string;
29
+ }>, "many">;
30
+ }, "strip", z.ZodTypeAny, {
31
+ type: "BUTTONS";
32
+ buttons: {
33
+ type: "QUICK_REPLY";
34
+ text: string;
35
+ }[];
36
+ }, {
37
+ type: "BUTTONS";
38
+ buttons: {
39
+ type: "QUICK_REPLY";
40
+ text: string;
41
+ }[];
42
+ }>]>, "many">;
43
+ allow_category_change: z.ZodBoolean;
44
+ category: z.ZodNativeEnum<{
45
+ MARKETING: "MARKETING";
46
+ UTILITY: "UTILITY";
47
+ AUTHENTICATION: "AUTHENTICATION";
48
+ }>;
49
+ status: z.ZodNativeEnum<{
50
+ APRROVED: "APRROVED";
51
+ PENDING: "PENDING";
52
+ REJECTED: "REJECTED";
53
+ }>;
54
+ }, "id" | "name" | "status" | "language" | "components" | "category">, "strip", z.ZodTypeAny, {
55
+ id: string;
56
+ name: string;
57
+ status: "APRROVED" | "PENDING" | "REJECTED";
58
+ language: string;
59
+ components: ({
60
+ type: "BUTTONS";
61
+ buttons: {
62
+ type: "QUICK_REPLY";
63
+ text: string;
64
+ }[];
65
+ } | {
66
+ type: "BODY";
67
+ text: string;
68
+ })[];
69
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
70
+ }, {
71
+ id: string;
72
+ name: string;
73
+ status: "APRROVED" | "PENDING" | "REJECTED";
74
+ language: string;
75
+ components: ({
76
+ type: "BUTTONS";
77
+ buttons: {
78
+ type: "QUICK_REPLY";
79
+ text: string;
80
+ }[];
81
+ } | {
82
+ type: "BODY";
83
+ text: string;
84
+ })[];
85
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
86
+ }>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ template: {
89
+ id: string;
90
+ name: string;
91
+ status: "APRROVED" | "PENDING" | "REJECTED";
92
+ language: string;
93
+ components: ({
94
+ type: "BUTTONS";
95
+ buttons: {
96
+ type: "QUICK_REPLY";
97
+ text: string;
98
+ }[];
99
+ } | {
100
+ type: "BODY";
101
+ text: string;
102
+ })[];
103
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
104
+ };
105
+ }, {
106
+ template: {
107
+ id: string;
108
+ name: string;
109
+ status: "APRROVED" | "PENDING" | "REJECTED";
110
+ language: string;
111
+ components: ({
112
+ type: "BUTTONS";
113
+ buttons: {
114
+ type: "QUICK_REPLY";
115
+ text: string;
116
+ }[];
117
+ } | {
118
+ type: "BODY";
119
+ text: string;
120
+ })[];
121
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
122
+ };
123
+ }>;
124
+ declare const FindTemplateByIdResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodObject<{
125
+ template: z.ZodObject<{
126
+ id: z.ZodString;
127
+ name: z.ZodEffects<z.ZodString, string, string>;
128
+ status: z.ZodNativeEnum<{
129
+ APRROVED: "APRROVED";
130
+ PENDING: "PENDING";
131
+ REJECTED: "REJECTED";
132
+ }>;
133
+ language: z.ZodString;
134
+ components: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
135
+ type: z.ZodLiteral<"BODY">;
136
+ text: z.ZodString;
137
+ }, "strip", z.ZodTypeAny, {
138
+ type: "BODY";
139
+ text: string;
140
+ }, {
141
+ type: "BODY";
142
+ text: string;
143
+ }>, z.ZodObject<{
144
+ type: z.ZodLiteral<"BUTTONS">;
145
+ buttons: z.ZodArray<z.ZodObject<{
146
+ text: z.ZodString;
147
+ type: z.ZodLiteral<"QUICK_REPLY">;
148
+ }, "strip", z.ZodTypeAny, {
149
+ type: "QUICK_REPLY";
150
+ text: string;
151
+ }, {
152
+ type: "QUICK_REPLY";
153
+ text: string;
154
+ }>, "many">;
155
+ }, "strip", z.ZodTypeAny, {
156
+ type: "BUTTONS";
157
+ buttons: {
158
+ type: "QUICK_REPLY";
159
+ text: string;
160
+ }[];
161
+ }, {
162
+ type: "BUTTONS";
163
+ buttons: {
164
+ type: "QUICK_REPLY";
165
+ text: string;
166
+ }[];
167
+ }>]>, "many">;
168
+ category: z.ZodNativeEnum<{
169
+ MARKETING: "MARKETING";
170
+ UTILITY: "UTILITY";
171
+ AUTHENTICATION: "AUTHENTICATION";
172
+ }>;
173
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
174
+ id: string;
175
+ name: string;
176
+ status: "APRROVED" | "PENDING" | "REJECTED";
177
+ language: string;
178
+ components: ({
179
+ type: "BUTTONS";
180
+ buttons: {
181
+ type: "QUICK_REPLY";
182
+ text: string;
183
+ }[];
184
+ } | {
185
+ type: "BODY";
186
+ text: string;
187
+ })[];
188
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
189
+ }, {
190
+ id: string;
191
+ name: string;
192
+ status: "APRROVED" | "PENDING" | "REJECTED";
193
+ language: string;
194
+ components: ({
195
+ type: "BUTTONS";
196
+ buttons: {
197
+ type: "QUICK_REPLY";
198
+ text: string;
199
+ }[];
200
+ } | {
201
+ type: "BODY";
202
+ text: string;
203
+ })[];
204
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
205
+ }>;
206
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
207
+ template: {
208
+ id: string;
209
+ name: string;
210
+ status: "APRROVED" | "PENDING" | "REJECTED";
211
+ language: string;
212
+ components: ({
213
+ type: "BUTTONS";
214
+ buttons: {
215
+ type: "QUICK_REPLY";
216
+ text: string;
217
+ }[];
218
+ } | {
219
+ type: "BODY";
220
+ text: string;
221
+ })[];
222
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
223
+ };
224
+ }, {
225
+ template: {
226
+ id: string;
227
+ name: string;
228
+ status: "APRROVED" | "PENDING" | "REJECTED";
229
+ language: string;
230
+ components: ({
231
+ type: "BUTTONS";
232
+ buttons: {
233
+ type: "QUICK_REPLY";
234
+ text: string;
235
+ }[];
236
+ } | {
237
+ type: "BODY";
238
+ text: string;
239
+ })[];
240
+ category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
241
+ };
242
+ }>>;
243
+ export declare class FindTemplateByIdResponseDto extends FindTemplateByIdResponseDto_base {
244
+ }
245
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FindTemplateByIdResponseDto = exports.findTemplateByIdResponseSchema = void 0;
7
+ const template_dto_1 = require("./template.dto");
8
+ const create_zod_dto_without_date_1 = require("../../shared/dto-modification/create-zod-dto-without-date");
9
+ const zod_1 = __importDefault(require("zod"));
10
+ exports.findTemplateByIdResponseSchema = zod_1.default.object({
11
+ template: template_dto_1.templateSchema.pick({
12
+ name: true,
13
+ language: true,
14
+ status: true,
15
+ id: true,
16
+ category: true,
17
+ components: true,
18
+ }),
19
+ });
20
+ class FindTemplateByIdResponseDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.findTemplateByIdResponseSchema) {
21
+ }
22
+ exports.FindTemplateByIdResponseDto = FindTemplateByIdResponseDto;
23
+ //# sourceMappingURL=find-template-by-id.dto.js.map
@@ -0,0 +1,109 @@
1
+ import z from 'zod';
2
+ export declare const findTemplatesResponseSchema: z.ZodObject<{
3
+ templates: z.ZodArray<z.ZodObject<Pick<{
4
+ name: z.ZodEffects<z.ZodString, string, string>;
5
+ content: z.ZodString;
6
+ buttons: z.ZodArray<z.ZodString, "many">;
7
+ id: z.ZodString;
8
+ language: z.ZodString;
9
+ components: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
10
+ type: z.ZodLiteral<"BODY">;
11
+ text: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ type: "BODY";
14
+ text: string;
15
+ }, {
16
+ type: "BODY";
17
+ text: string;
18
+ }>, z.ZodObject<{
19
+ type: z.ZodLiteral<"BUTTONS">;
20
+ buttons: z.ZodArray<z.ZodObject<{
21
+ text: z.ZodString;
22
+ type: z.ZodLiteral<"QUICK_REPLY">;
23
+ }, "strip", z.ZodTypeAny, {
24
+ type: "QUICK_REPLY";
25
+ text: string;
26
+ }, {
27
+ type: "QUICK_REPLY";
28
+ text: string;
29
+ }>, "many">;
30
+ }, "strip", z.ZodTypeAny, {
31
+ type: "BUTTONS";
32
+ buttons: {
33
+ type: "QUICK_REPLY";
34
+ text: string;
35
+ }[];
36
+ }, {
37
+ type: "BUTTONS";
38
+ buttons: {
39
+ type: "QUICK_REPLY";
40
+ text: string;
41
+ }[];
42
+ }>]>, "many">;
43
+ allow_category_change: z.ZodBoolean;
44
+ category: z.ZodNativeEnum<{
45
+ MARKETING: "MARKETING";
46
+ UTILITY: "UTILITY";
47
+ AUTHENTICATION: "AUTHENTICATION";
48
+ }>;
49
+ status: z.ZodNativeEnum<{
50
+ APRROVED: "APRROVED";
51
+ PENDING: "PENDING";
52
+ REJECTED: "REJECTED";
53
+ }>;
54
+ }, "id" | "name" | "status">, "strip", z.ZodTypeAny, {
55
+ id: string;
56
+ name: string;
57
+ status: "APRROVED" | "PENDING" | "REJECTED";
58
+ }, {
59
+ id: string;
60
+ name: string;
61
+ status: "APRROVED" | "PENDING" | "REJECTED";
62
+ }>, "many">;
63
+ }, "strip", z.ZodTypeAny, {
64
+ templates: {
65
+ id: string;
66
+ name: string;
67
+ status: "APRROVED" | "PENDING" | "REJECTED";
68
+ }[];
69
+ }, {
70
+ templates: {
71
+ id: string;
72
+ name: string;
73
+ status: "APRROVED" | "PENDING" | "REJECTED";
74
+ }[];
75
+ }>;
76
+ declare const FindTemplatesResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodObject<{
77
+ templates: z.ZodArray<z.ZodObject<{
78
+ id: z.ZodString;
79
+ name: z.ZodEffects<z.ZodString, string, string>;
80
+ status: z.ZodNativeEnum<{
81
+ APRROVED: "APRROVED";
82
+ PENDING: "PENDING";
83
+ REJECTED: "REJECTED";
84
+ }>;
85
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
86
+ id: string;
87
+ name: string;
88
+ status: "APRROVED" | "PENDING" | "REJECTED";
89
+ }, {
90
+ id: string;
91
+ name: string;
92
+ status: "APRROVED" | "PENDING" | "REJECTED";
93
+ }>, "many">;
94
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
95
+ templates: {
96
+ id: string;
97
+ name: string;
98
+ status: "APRROVED" | "PENDING" | "REJECTED";
99
+ }[];
100
+ }, {
101
+ templates: {
102
+ id: string;
103
+ name: string;
104
+ status: "APRROVED" | "PENDING" | "REJECTED";
105
+ }[];
106
+ }>>;
107
+ export declare class FindTemplatesResponseDto extends FindTemplatesResponseDto_base {
108
+ }
109
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FindTemplatesResponseDto = exports.findTemplatesResponseSchema = void 0;
7
+ const template_dto_1 = require("./template.dto");
8
+ const create_zod_dto_without_date_1 = require("../../shared/dto-modification/create-zod-dto-without-date");
9
+ const zod_1 = __importDefault(require("zod"));
10
+ exports.findTemplatesResponseSchema = zod_1.default.object({
11
+ templates: zod_1.default.array(template_dto_1.templateSchema.pick({
12
+ name: true,
13
+ id: true,
14
+ status: true,
15
+ })),
16
+ });
17
+ class FindTemplatesResponseDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.findTemplatesResponseSchema) {
18
+ }
19
+ exports.FindTemplatesResponseDto = FindTemplatesResponseDto;
20
+ //# sourceMappingURL=find-templates.dto.js.map
@@ -1,9 +1,11 @@
1
+ import { Components } from '@/message/dto/template.dto';
1
2
  import z from 'zod';
3
+ import { type TemplateCategory, type TemplateStatus } from '~/types/prisma-schema';
2
4
  export declare const jsonMessage: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3
5
  id: z.ZodString;
4
6
  from: z.ZodOptional<z.ZodString>;
5
7
  to: z.ZodOptional<z.ZodString>;
6
- timestamp: z.ZodNumber;
8
+ timestamp: z.ZodString;
7
9
  }, {
8
10
  text: z.ZodObject<{
9
11
  body: z.ZodString;
@@ -17,26 +19,26 @@ export declare const jsonMessage: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z
17
19
  }>, "strip", z.ZodTypeAny, {
18
20
  id: string;
19
21
  type: "text";
20
- timestamp: number;
21
22
  text: {
22
23
  body: string;
23
24
  };
25
+ timestamp: string;
24
26
  from?: string | undefined;
25
27
  to?: string | undefined;
26
28
  }, {
27
29
  id: string;
28
30
  type: "text";
29
- timestamp: number;
30
31
  text: {
31
32
  body: string;
32
33
  };
34
+ timestamp: string;
33
35
  from?: string | undefined;
34
36
  to?: string | undefined;
35
37
  }>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
36
38
  id: z.ZodString;
37
39
  from: z.ZodOptional<z.ZodString>;
38
40
  to: z.ZodOptional<z.ZodString>;
39
- timestamp: z.ZodNumber;
41
+ timestamp: z.ZodString;
40
42
  }, {
41
43
  templateName: z.ZodString;
42
44
  }>, {
@@ -44,14 +46,14 @@ export declare const jsonMessage: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z
44
46
  }>, "strip", z.ZodTypeAny, {
45
47
  id: string;
46
48
  type: "template";
47
- timestamp: number;
49
+ timestamp: string;
48
50
  templateName: string;
49
51
  from?: string | undefined;
50
52
  to?: string | undefined;
51
53
  }, {
52
54
  id: string;
53
55
  type: "template";
54
- timestamp: number;
56
+ timestamp: string;
55
57
  templateName: string;
56
58
  from?: string | undefined;
57
59
  to?: string | undefined;
@@ -64,7 +66,7 @@ export declare const messageSchema: z.ZodObject<{
64
66
  id: z.ZodString;
65
67
  from: z.ZodOptional<z.ZodString>;
66
68
  to: z.ZodOptional<z.ZodString>;
67
- timestamp: z.ZodNumber;
69
+ timestamp: z.ZodString;
68
70
  }, {
69
71
  text: z.ZodObject<{
70
72
  body: z.ZodString;
@@ -78,26 +80,26 @@ export declare const messageSchema: z.ZodObject<{
78
80
  }>, "strip", z.ZodTypeAny, {
79
81
  id: string;
80
82
  type: "text";
81
- timestamp: number;
82
83
  text: {
83
84
  body: string;
84
85
  };
86
+ timestamp: string;
85
87
  from?: string | undefined;
86
88
  to?: string | undefined;
87
89
  }, {
88
90
  id: string;
89
91
  type: "text";
90
- timestamp: number;
91
92
  text: {
92
93
  body: string;
93
94
  };
95
+ timestamp: string;
94
96
  from?: string | undefined;
95
97
  to?: string | undefined;
96
98
  }>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
97
99
  id: z.ZodString;
98
100
  from: z.ZodOptional<z.ZodString>;
99
101
  to: z.ZodOptional<z.ZodString>;
100
- timestamp: z.ZodNumber;
102
+ timestamp: z.ZodString;
101
103
  }, {
102
104
  templateName: z.ZodString;
103
105
  }>, {
@@ -105,14 +107,14 @@ export declare const messageSchema: z.ZodObject<{
105
107
  }>, "strip", z.ZodTypeAny, {
106
108
  id: string;
107
109
  type: "template";
108
- timestamp: number;
110
+ timestamp: string;
109
111
  templateName: string;
110
112
  from?: string | undefined;
111
113
  to?: string | undefined;
112
114
  }, {
113
115
  id: string;
114
116
  type: "template";
115
- timestamp: number;
117
+ timestamp: string;
116
118
  templateName: string;
117
119
  from?: string | undefined;
118
120
  to?: string | undefined;
@@ -128,16 +130,16 @@ export declare const messageSchema: z.ZodObject<{
128
130
  message: {
129
131
  id: string;
130
132
  type: "text";
131
- timestamp: number;
132
133
  text: {
133
134
  body: string;
134
135
  };
136
+ timestamp: string;
135
137
  from?: string | undefined;
136
138
  to?: string | undefined;
137
139
  } | {
138
140
  id: string;
139
141
  type: "template";
140
- timestamp: number;
142
+ timestamp: string;
141
143
  templateName: string;
142
144
  from?: string | undefined;
143
145
  to?: string | undefined;
@@ -151,16 +153,16 @@ export declare const messageSchema: z.ZodObject<{
151
153
  message: {
152
154
  id: string;
153
155
  type: "text";
154
- timestamp: number;
155
156
  text: {
156
157
  body: string;
157
158
  };
159
+ timestamp: string;
158
160
  from?: string | undefined;
159
161
  to?: string | undefined;
160
162
  } | {
161
163
  id: string;
162
164
  type: "template";
163
- timestamp: number;
165
+ timestamp: string;
164
166
  templateName: string;
165
167
  from?: string | undefined;
166
168
  to?: string | undefined;
@@ -171,3 +173,31 @@ export declare const messageSchema: z.ZodObject<{
171
173
  wamId: string;
172
174
  state: "SENT" | "RECEIVED" | "SEEN";
173
175
  }>;
176
+ export type MessageJson = {
177
+ id: string;
178
+ timestamp: string;
179
+ to?: string;
180
+ from?: string;
181
+ } & ({
182
+ type: 'text';
183
+ text: {
184
+ body: string;
185
+ };
186
+ } | {
187
+ type: 'template';
188
+ templateName: string;
189
+ });
190
+ export type TemplateMessage = MessageJson & {
191
+ type: 'template';
192
+ templateName: string;
193
+ };
194
+ export type GetTemplateResponse = {
195
+ data: {
196
+ name: string;
197
+ components: Components[];
198
+ language: string;
199
+ status: TemplateStatus;
200
+ category: TemplateCategory;
201
+ id: string;
202
+ }[];
203
+ };
@@ -11,7 +11,7 @@ const whatsappMessageSchema = zod_1.default.object({
11
11
  id: zod_1.default.string(),
12
12
  from: zod_1.default.string().optional(),
13
13
  to: zod_1.default.string().optional(),
14
- timestamp: zod_1.default.coerce.number(),
14
+ timestamp: zod_1.default.string(),
15
15
  });
16
16
  const textMessageSchema = whatsappMessageSchema.merge(zod_1.default.object({
17
17
  text: zod_1.default.object({
@@ -0,0 +1,40 @@
1
+ import z from 'zod';
2
+ export declare const sendMessageToPhoneSchema: z.ZodObject<{
3
+ phone: z.ZodEffects<z.ZodString, string, string>;
4
+ message: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ message: string;
7
+ phone: string;
8
+ }, {
9
+ message: string;
10
+ phone: string;
11
+ }>;
12
+ declare const SendMessageToPhoneDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodObject<{
13
+ phone: z.ZodEffects<z.ZodString, string, string>;
14
+ message: z.ZodString;
15
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
16
+ message: string;
17
+ phone: string;
18
+ }, {
19
+ message: string;
20
+ phone: string;
21
+ }>>;
22
+ export declare class SendMessageToPhoneDto extends SendMessageToPhoneDto_base {
23
+ }
24
+ export declare const sendMessageToPhoneResponseSchema: z.ZodObject<{
25
+ success: z.ZodBoolean;
26
+ }, "strip", z.ZodTypeAny, {
27
+ success: boolean;
28
+ }, {
29
+ success: boolean;
30
+ }>;
31
+ declare const SendMessageToPhoneResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodObject<{
32
+ success: z.ZodBoolean;
33
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
34
+ success: boolean;
35
+ }, {
36
+ success: boolean;
37
+ }>>;
38
+ export declare class SendMessageToPhoneResponseDto extends SendMessageToPhoneResponseDto_base {
39
+ }
40
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SendMessageToPhoneResponseDto = exports.sendMessageToPhoneResponseSchema = exports.SendMessageToPhoneDto = exports.sendMessageToPhoneSchema = void 0;
7
+ const profile_dto_1 = require("../../profile/dto/profile.dto");
8
+ const create_zod_dto_without_date_1 = require("../../shared/dto-modification/create-zod-dto-without-date");
9
+ const zod_1 = __importDefault(require("zod"));
10
+ exports.sendMessageToPhoneSchema = zod_1.default.object({
11
+ phone: profile_dto_1.profileSchema.shape.phoneNumber,
12
+ message: zod_1.default.string(),
13
+ });
14
+ class SendMessageToPhoneDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.sendMessageToPhoneSchema) {
15
+ }
16
+ exports.SendMessageToPhoneDto = SendMessageToPhoneDto;
17
+ exports.sendMessageToPhoneResponseSchema = zod_1.default.object({
18
+ success: zod_1.default.boolean(),
19
+ });
20
+ class SendMessageToPhoneResponseDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.sendMessageToPhoneResponseSchema) {
21
+ }
22
+ exports.SendMessageToPhoneResponseDto = SendMessageToPhoneResponseDto;
23
+ //# sourceMappingURL=send-message-to-phone.dto.js.map