evo360-types 1.3.715 → 1.3.717

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.
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.zForwardCreateRequestSchema = exports.zMessageForwardSchema = exports.zForwardItemSchema = exports.zForwardBatchSchema = exports.zForwardCountsSchema = exports.zForwardRecipientSchema = exports.zForwardSourceSchema = exports.zForwardActorSchema = exports.zForwardSpecialKindSchema = exports.zForwardRecipientProviderSchema = exports.zForwardContentKindSchema = exports.zForwardItemReasonSchema = exports.zForwardFailReasonSchema = exports.zForwardSkipReasonSchema = exports.zForwardItemStatusSchema = exports.zForwardBatchStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const zod_schemas_1 = require("../../shared/zod-schemas");
6
+ const forward_1 = require("../../../types/evo-chat/forward");
7
+ // ── Enums ──
8
+ exports.zForwardBatchStatusSchema = zod_1.z.enum(["running", "done", "done_with_failures"]);
9
+ exports.zForwardItemStatusSchema = zod_1.z.enum(["pending", "sending", "sent", "failed", "skipped"]);
10
+ exports.zForwardSkipReasonSchema = zod_1.z.enum([
11
+ "window_closed",
12
+ "type_not_supported",
13
+ "media_too_large",
14
+ "media_unavailable",
15
+ "channel_not_supported",
16
+ ]);
17
+ exports.zForwardFailReasonSchema = zod_1.z.enum([
18
+ "provider_error",
19
+ "window_closed",
20
+ "send_budget_exceeded",
21
+ "interrupted",
22
+ ]);
23
+ exports.zForwardItemReasonSchema = zod_1.z.union([exports.zForwardSkipReasonSchema, exports.zForwardFailReasonSchema]);
24
+ exports.zForwardContentKindSchema = zod_1.z.enum(["text", "image", "video", "audio", "document"]);
25
+ exports.zForwardRecipientProviderSchema = zod_1.z.enum(["hub-waba", "hub-instagram"]);
26
+ exports.zForwardSpecialKindSchema = zod_1.z.enum(["doctor", "secretary", "employee"]);
27
+ // ── Partes ──
28
+ exports.zForwardActorSchema = zod_1.z.object({
29
+ user_id: zod_1.z.string(),
30
+ display_name: zod_1.z.string(),
31
+ });
32
+ exports.zForwardSourceSchema = zod_1.z.object({
33
+ thread_id: zod_1.z.string(),
34
+ ticket_id: zod_1.z.string(),
35
+ department_id: zod_1.z.string().nullable(),
36
+ contact_id: zod_1.z.string(),
37
+ contact_name: zod_1.z.string(),
38
+ channel_id: zod_1.z.string().nullable(),
39
+ channel_type: zod_1.z.string().nullable(),
40
+ });
41
+ exports.zForwardRecipientSchema = zod_1.z.object({
42
+ thread_id: zod_1.z.string(),
43
+ contact_id: zod_1.z.string(),
44
+ contact_name: zod_1.z.string(),
45
+ channel_id: zod_1.z.string(),
46
+ channel_type: zod_1.z.string(),
47
+ provider: exports.zForwardRecipientProviderSchema,
48
+ special_kind: exports.zForwardSpecialKindSchema.nullable().optional(),
49
+ });
50
+ exports.zForwardCountsSchema = zod_1.z.object({
51
+ total: zod_1.z.number().int().nonnegative(),
52
+ sent: zod_1.z.number().int().nonnegative(),
53
+ failed: zod_1.z.number().int().nonnegative(),
54
+ skipped: zod_1.z.number().int().nonnegative(),
55
+ });
56
+ // ── Docs ──
57
+ exports.zForwardBatchSchema = zod_schemas_1.zFireDocSchema
58
+ .extend({
59
+ forward_id: zod_1.z.string(),
60
+ tenant: zod_1.z.string(),
61
+ created_by: exports.zForwardActorSchema,
62
+ source: exports.zForwardSourceSchema,
63
+ message_ids: zod_1.z.array(zod_1.z.string()).min(1).max(forward_1.FORWARD_MAX_MESSAGES),
64
+ intro_text: zod_1.z.string().nullable(),
65
+ recipients: zod_1.z.array(exports.zForwardRecipientSchema).min(1).max(forward_1.FORWARD_MAX_RECIPIENTS),
66
+ status: exports.zForwardBatchStatusSchema,
67
+ counts: exports.zForwardCountsSchema,
68
+ recipients_to_dispatch: zod_1.z.number().int().nonnegative(),
69
+ recipients_done: zod_1.z.number().int().nonnegative(),
70
+ dispatch: zod_1.z
71
+ .record(zod_1.z.string(), zod_1.z.object({
72
+ claimed_at: zod_1.z.coerce.date(),
73
+ finished_at: zod_1.z.coerce.date().nullable().optional(),
74
+ }))
75
+ .optional(),
76
+ finished_at: zod_1.z.coerce.date().nullable().optional(),
77
+ })
78
+ .passthrough();
79
+ exports.zForwardItemSchema = zod_1.z
80
+ .object({
81
+ item_id: zod_1.z.string(),
82
+ forward_id: zod_1.z.string(),
83
+ recipient_thread_id: zod_1.z.string(),
84
+ recipient_index: zod_1.z.number().int().nonnegative(),
85
+ seq: zod_1.z.number().int().nonnegative(),
86
+ kind: zod_1.z.enum(["intro", "message"]),
87
+ message_id: zod_1.z.string().nullable(),
88
+ content_kind: exports.zForwardContentKindSchema,
89
+ status: exports.zForwardItemStatusSchema,
90
+ reason: exports.zForwardItemReasonSchema.nullable().optional(),
91
+ error: zod_1.z.string().nullable().optional(),
92
+ error_code: zod_1.z.number().nullable().optional(),
93
+ dest_message_id: zod_1.z.string().nullable().optional(),
94
+ sent_at: zod_1.z.coerce.date().nullable().optional(),
95
+ updated_at: zod_1.z.coerce.date().optional(),
96
+ })
97
+ .passthrough();
98
+ /** Bloco `forward` gravado na mensagem de destino. */
99
+ exports.zMessageForwardSchema = zod_1.z
100
+ .object({
101
+ forward_id: zod_1.z.string(),
102
+ item_id: zod_1.z.string(),
103
+ source_message_id: zod_1.z.string(),
104
+ source_thread_id: zod_1.z.string(),
105
+ source_ticket_id: zod_1.z.string(),
106
+ source_contact_id: zod_1.z.string(),
107
+ source_contact_name: zod_1.z.string(),
108
+ source_channel_type: zod_1.z.string().nullable(),
109
+ source_direction: zod_1.z.enum(["in", "out"]),
110
+ source_created_at: zod_1.z.coerce.date(),
111
+ forwarded_by: exports.zForwardActorSchema,
112
+ forwarded_at: zod_1.z.coerce.date(),
113
+ })
114
+ .passthrough();
115
+ // ── Request do `POST /forwards` ──
116
+ /**
117
+ * `.strict()` de propósito: o payload nunca carrega `gcs_uri` nem conteúdo. A
118
+ * mídia é sempre lida da mensagem gravada sob o tenant autenticado.
119
+ */
120
+ exports.zForwardCreateRequestSchema = zod_1.z
121
+ .object({
122
+ client_request_id: zod_1.z.string().uuid(),
123
+ source_thread_id: zod_1.z.string().min(1),
124
+ source_ticket_id: zod_1.z.string().min(1),
125
+ message_ids: zod_1.z.array(zod_1.z.string().min(1)).min(1).max(forward_1.FORWARD_MAX_MESSAGES),
126
+ intro_text: zod_1.z.string().trim().max(forward_1.FORWARD_INTRO_MAX_CHARS).nullable().optional(),
127
+ recipients: zod_1.z
128
+ .array(zod_1.z
129
+ .object({
130
+ thread_id: zod_1.z.string().min(1),
131
+ channel_id: zod_1.z.string().min(1),
132
+ })
133
+ .strict())
134
+ .min(1)
135
+ .max(forward_1.FORWARD_MAX_RECIPIENTS),
136
+ dry_run: zod_1.z.boolean().optional(),
137
+ })
138
+ .strict()
139
+ .superRefine((v, ctx) => {
140
+ if (new Set(v.message_ids).size !== v.message_ids.length) {
141
+ ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["message_ids"], message: "message_ids must be unique" });
142
+ }
143
+ const threadIds = v.recipients.map((r) => r.thread_id);
144
+ if (new Set(threadIds).size !== threadIds.length) {
145
+ ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["recipients"], message: "recipients.thread_id must be unique" });
146
+ }
147
+ if (threadIds.indexOf(v.source_thread_id) !== -1) {
148
+ ctx.addIssue({
149
+ code: zod_1.z.ZodIssueCode.custom,
150
+ path: ["recipients"],
151
+ message: "a recipient cannot be the source thread",
152
+ });
153
+ }
154
+ });
@@ -0,0 +1,175 @@
1
+ import { z } from "zod";
2
+ import { zFireDocSchema } from "../../shared/zod-schemas";
3
+ import {
4
+ FORWARD_INTRO_MAX_CHARS,
5
+ FORWARD_MAX_MESSAGES,
6
+ FORWARD_MAX_RECIPIENTS,
7
+ } from "../../../types/evo-chat/forward";
8
+
9
+ // ── Enums ──
10
+
11
+ export const zForwardBatchStatusSchema = z.enum(["running", "done", "done_with_failures"]);
12
+ export const zForwardItemStatusSchema = z.enum(["pending", "sending", "sent", "failed", "skipped"]);
13
+ export const zForwardSkipReasonSchema = z.enum([
14
+ "window_closed",
15
+ "type_not_supported",
16
+ "media_too_large",
17
+ "media_unavailable",
18
+ "channel_not_supported",
19
+ ]);
20
+ export const zForwardFailReasonSchema = z.enum([
21
+ "provider_error",
22
+ "window_closed",
23
+ "send_budget_exceeded",
24
+ "interrupted",
25
+ ]);
26
+ export const zForwardItemReasonSchema = z.union([zForwardSkipReasonSchema, zForwardFailReasonSchema]);
27
+ export const zForwardContentKindSchema = z.enum(["text", "image", "video", "audio", "document"]);
28
+ export const zForwardRecipientProviderSchema = z.enum(["hub-waba", "hub-instagram"]);
29
+ export const zForwardSpecialKindSchema = z.enum(["doctor", "secretary", "employee"]);
30
+
31
+ // ── Partes ──
32
+
33
+ export const zForwardActorSchema = z.object({
34
+ user_id: z.string(),
35
+ display_name: z.string(),
36
+ });
37
+
38
+ export const zForwardSourceSchema = z.object({
39
+ thread_id: z.string(),
40
+ ticket_id: z.string(),
41
+ department_id: z.string().nullable(),
42
+ contact_id: z.string(),
43
+ contact_name: z.string(),
44
+ channel_id: z.string().nullable(),
45
+ channel_type: z.string().nullable(),
46
+ });
47
+
48
+ export const zForwardRecipientSchema = z.object({
49
+ thread_id: z.string(),
50
+ contact_id: z.string(),
51
+ contact_name: z.string(),
52
+ channel_id: z.string(),
53
+ channel_type: z.string(),
54
+ provider: zForwardRecipientProviderSchema,
55
+ special_kind: zForwardSpecialKindSchema.nullable().optional(),
56
+ });
57
+
58
+ export const zForwardCountsSchema = z.object({
59
+ total: z.number().int().nonnegative(),
60
+ sent: z.number().int().nonnegative(),
61
+ failed: z.number().int().nonnegative(),
62
+ skipped: z.number().int().nonnegative(),
63
+ });
64
+
65
+ // ── Docs ──
66
+
67
+ export const zForwardBatchSchema = zFireDocSchema
68
+ .extend({
69
+ forward_id: z.string(),
70
+ tenant: z.string(),
71
+ created_by: zForwardActorSchema,
72
+ source: zForwardSourceSchema,
73
+ message_ids: z.array(z.string()).min(1).max(FORWARD_MAX_MESSAGES),
74
+ intro_text: z.string().nullable(),
75
+ recipients: z.array(zForwardRecipientSchema).min(1).max(FORWARD_MAX_RECIPIENTS),
76
+ status: zForwardBatchStatusSchema,
77
+ counts: zForwardCountsSchema,
78
+ recipients_to_dispatch: z.number().int().nonnegative(),
79
+ recipients_done: z.number().int().nonnegative(),
80
+ dispatch: z
81
+ .record(
82
+ z.string(),
83
+ z.object({
84
+ claimed_at: z.coerce.date(),
85
+ finished_at: z.coerce.date().nullable().optional(),
86
+ }),
87
+ )
88
+ .optional(),
89
+ finished_at: z.coerce.date().nullable().optional(),
90
+ })
91
+ .passthrough();
92
+
93
+ export const zForwardItemSchema = z
94
+ .object({
95
+ item_id: z.string(),
96
+ forward_id: z.string(),
97
+ recipient_thread_id: z.string(),
98
+ recipient_index: z.number().int().nonnegative(),
99
+ seq: z.number().int().nonnegative(),
100
+ kind: z.enum(["intro", "message"]),
101
+ message_id: z.string().nullable(),
102
+ content_kind: zForwardContentKindSchema,
103
+ status: zForwardItemStatusSchema,
104
+ reason: zForwardItemReasonSchema.nullable().optional(),
105
+ error: z.string().nullable().optional(),
106
+ error_code: z.number().nullable().optional(),
107
+ dest_message_id: z.string().nullable().optional(),
108
+ sent_at: z.coerce.date().nullable().optional(),
109
+ updated_at: z.coerce.date().optional(),
110
+ })
111
+ .passthrough();
112
+
113
+ /** Bloco `forward` gravado na mensagem de destino. */
114
+ export const zMessageForwardSchema = z
115
+ .object({
116
+ forward_id: z.string(),
117
+ item_id: z.string(),
118
+ source_message_id: z.string(),
119
+ source_thread_id: z.string(),
120
+ source_ticket_id: z.string(),
121
+ source_contact_id: z.string(),
122
+ source_contact_name: z.string(),
123
+ source_channel_type: z.string().nullable(),
124
+ source_direction: z.enum(["in", "out"]),
125
+ source_created_at: z.coerce.date(),
126
+ forwarded_by: zForwardActorSchema,
127
+ forwarded_at: z.coerce.date(),
128
+ })
129
+ .passthrough();
130
+
131
+ // ── Request do `POST /forwards` ──
132
+
133
+ /**
134
+ * `.strict()` de propósito: o payload nunca carrega `gcs_uri` nem conteúdo. A
135
+ * mídia é sempre lida da mensagem gravada sob o tenant autenticado.
136
+ */
137
+ export const zForwardCreateRequestSchema = z
138
+ .object({
139
+ client_request_id: z.string().uuid(),
140
+ source_thread_id: z.string().min(1),
141
+ source_ticket_id: z.string().min(1),
142
+ message_ids: z.array(z.string().min(1)).min(1).max(FORWARD_MAX_MESSAGES),
143
+ intro_text: z.string().trim().max(FORWARD_INTRO_MAX_CHARS).nullable().optional(),
144
+ recipients: z
145
+ .array(
146
+ z
147
+ .object({
148
+ thread_id: z.string().min(1),
149
+ channel_id: z.string().min(1),
150
+ })
151
+ .strict(),
152
+ )
153
+ .min(1)
154
+ .max(FORWARD_MAX_RECIPIENTS),
155
+ dry_run: z.boolean().optional(),
156
+ })
157
+ .strict()
158
+ .superRefine((v, ctx) => {
159
+ if (new Set(v.message_ids).size !== v.message_ids.length) {
160
+ ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["message_ids"], message: "message_ids must be unique" });
161
+ }
162
+ const threadIds = v.recipients.map((r) => r.thread_id);
163
+ if (new Set(threadIds).size !== threadIds.length) {
164
+ ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["recipients"], message: "recipients.thread_id must be unique" });
165
+ }
166
+ if (threadIds.indexOf(v.source_thread_id) !== -1) {
167
+ ctx.addIssue({
168
+ code: z.ZodIssueCode.custom,
169
+ path: ["recipients"],
170
+ message: "a recipient cannot be the source thread",
171
+ });
172
+ }
173
+ });
174
+
175
+ export type ForwardCreateRequest = z.infer<typeof zForwardCreateRequestSchema>;
@@ -210,6 +210,74 @@ export declare const zThreadMessageSchema: z.ZodObject<{
210
210
  message_id: string;
211
211
  from?: string | undefined;
212
212
  }>>;
213
+ forward: z.ZodOptional<z.ZodObject<{
214
+ forward_id: z.ZodString;
215
+ item_id: z.ZodString;
216
+ source_message_id: z.ZodString;
217
+ source_thread_id: z.ZodString;
218
+ source_ticket_id: z.ZodString;
219
+ source_contact_id: z.ZodString;
220
+ source_contact_name: z.ZodString;
221
+ source_channel_type: z.ZodNullable<z.ZodString>;
222
+ source_direction: z.ZodEnum<["in", "out"]>;
223
+ source_created_at: z.ZodDate;
224
+ forwarded_by: z.ZodObject<{
225
+ user_id: z.ZodString;
226
+ display_name: z.ZodString;
227
+ }, "strip", z.ZodTypeAny, {
228
+ display_name: string;
229
+ user_id: string;
230
+ }, {
231
+ display_name: string;
232
+ user_id: string;
233
+ }>;
234
+ forwarded_at: z.ZodDate;
235
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
236
+ forward_id: z.ZodString;
237
+ item_id: z.ZodString;
238
+ source_message_id: z.ZodString;
239
+ source_thread_id: z.ZodString;
240
+ source_ticket_id: z.ZodString;
241
+ source_contact_id: z.ZodString;
242
+ source_contact_name: z.ZodString;
243
+ source_channel_type: z.ZodNullable<z.ZodString>;
244
+ source_direction: z.ZodEnum<["in", "out"]>;
245
+ source_created_at: z.ZodDate;
246
+ forwarded_by: z.ZodObject<{
247
+ user_id: z.ZodString;
248
+ display_name: z.ZodString;
249
+ }, "strip", z.ZodTypeAny, {
250
+ display_name: string;
251
+ user_id: string;
252
+ }, {
253
+ display_name: string;
254
+ user_id: string;
255
+ }>;
256
+ forwarded_at: z.ZodDate;
257
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
258
+ forward_id: z.ZodString;
259
+ item_id: z.ZodString;
260
+ source_message_id: z.ZodString;
261
+ source_thread_id: z.ZodString;
262
+ source_ticket_id: z.ZodString;
263
+ source_contact_id: z.ZodString;
264
+ source_contact_name: z.ZodString;
265
+ source_channel_type: z.ZodNullable<z.ZodString>;
266
+ source_direction: z.ZodEnum<["in", "out"]>;
267
+ source_created_at: z.ZodDate;
268
+ forwarded_by: z.ZodObject<{
269
+ user_id: z.ZodString;
270
+ display_name: z.ZodString;
271
+ }, "strip", z.ZodTypeAny, {
272
+ display_name: string;
273
+ user_id: string;
274
+ }, {
275
+ display_name: string;
276
+ user_id: string;
277
+ }>;
278
+ forwarded_at: z.ZodDate;
279
+ }, z.ZodTypeAny, "passthrough">>>;
280
+ forward_count: z.ZodOptional<z.ZodNumber>;
213
281
  provider_message_id: z.ZodOptional<z.ZodString>;
214
282
  status: z.ZodOptional<z.ZodObject<{
215
283
  sent_at: z.ZodOptional<z.ZodDate>;
@@ -395,6 +463,74 @@ export declare const zThreadMessageSchema: z.ZodObject<{
395
463
  message_id: string;
396
464
  from?: string | undefined;
397
465
  }>>;
466
+ forward: z.ZodOptional<z.ZodObject<{
467
+ forward_id: z.ZodString;
468
+ item_id: z.ZodString;
469
+ source_message_id: z.ZodString;
470
+ source_thread_id: z.ZodString;
471
+ source_ticket_id: z.ZodString;
472
+ source_contact_id: z.ZodString;
473
+ source_contact_name: z.ZodString;
474
+ source_channel_type: z.ZodNullable<z.ZodString>;
475
+ source_direction: z.ZodEnum<["in", "out"]>;
476
+ source_created_at: z.ZodDate;
477
+ forwarded_by: z.ZodObject<{
478
+ user_id: z.ZodString;
479
+ display_name: z.ZodString;
480
+ }, "strip", z.ZodTypeAny, {
481
+ display_name: string;
482
+ user_id: string;
483
+ }, {
484
+ display_name: string;
485
+ user_id: string;
486
+ }>;
487
+ forwarded_at: z.ZodDate;
488
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
489
+ forward_id: z.ZodString;
490
+ item_id: z.ZodString;
491
+ source_message_id: z.ZodString;
492
+ source_thread_id: z.ZodString;
493
+ source_ticket_id: z.ZodString;
494
+ source_contact_id: z.ZodString;
495
+ source_contact_name: z.ZodString;
496
+ source_channel_type: z.ZodNullable<z.ZodString>;
497
+ source_direction: z.ZodEnum<["in", "out"]>;
498
+ source_created_at: z.ZodDate;
499
+ forwarded_by: z.ZodObject<{
500
+ user_id: z.ZodString;
501
+ display_name: z.ZodString;
502
+ }, "strip", z.ZodTypeAny, {
503
+ display_name: string;
504
+ user_id: string;
505
+ }, {
506
+ display_name: string;
507
+ user_id: string;
508
+ }>;
509
+ forwarded_at: z.ZodDate;
510
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
511
+ forward_id: z.ZodString;
512
+ item_id: z.ZodString;
513
+ source_message_id: z.ZodString;
514
+ source_thread_id: z.ZodString;
515
+ source_ticket_id: z.ZodString;
516
+ source_contact_id: z.ZodString;
517
+ source_contact_name: z.ZodString;
518
+ source_channel_type: z.ZodNullable<z.ZodString>;
519
+ source_direction: z.ZodEnum<["in", "out"]>;
520
+ source_created_at: z.ZodDate;
521
+ forwarded_by: z.ZodObject<{
522
+ user_id: z.ZodString;
523
+ display_name: z.ZodString;
524
+ }, "strip", z.ZodTypeAny, {
525
+ display_name: string;
526
+ user_id: string;
527
+ }, {
528
+ display_name: string;
529
+ user_id: string;
530
+ }>;
531
+ forwarded_at: z.ZodDate;
532
+ }, z.ZodTypeAny, "passthrough">>>;
533
+ forward_count: z.ZodOptional<z.ZodNumber>;
398
534
  provider_message_id: z.ZodOptional<z.ZodString>;
399
535
  status: z.ZodOptional<z.ZodObject<{
400
536
  sent_at: z.ZodOptional<z.ZodDate>;
@@ -580,6 +716,74 @@ export declare const zThreadMessageSchema: z.ZodObject<{
580
716
  message_id: string;
581
717
  from?: string | undefined;
582
718
  }>>;
719
+ forward: z.ZodOptional<z.ZodObject<{
720
+ forward_id: z.ZodString;
721
+ item_id: z.ZodString;
722
+ source_message_id: z.ZodString;
723
+ source_thread_id: z.ZodString;
724
+ source_ticket_id: z.ZodString;
725
+ source_contact_id: z.ZodString;
726
+ source_contact_name: z.ZodString;
727
+ source_channel_type: z.ZodNullable<z.ZodString>;
728
+ source_direction: z.ZodEnum<["in", "out"]>;
729
+ source_created_at: z.ZodDate;
730
+ forwarded_by: z.ZodObject<{
731
+ user_id: z.ZodString;
732
+ display_name: z.ZodString;
733
+ }, "strip", z.ZodTypeAny, {
734
+ display_name: string;
735
+ user_id: string;
736
+ }, {
737
+ display_name: string;
738
+ user_id: string;
739
+ }>;
740
+ forwarded_at: z.ZodDate;
741
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
742
+ forward_id: z.ZodString;
743
+ item_id: z.ZodString;
744
+ source_message_id: z.ZodString;
745
+ source_thread_id: z.ZodString;
746
+ source_ticket_id: z.ZodString;
747
+ source_contact_id: z.ZodString;
748
+ source_contact_name: z.ZodString;
749
+ source_channel_type: z.ZodNullable<z.ZodString>;
750
+ source_direction: z.ZodEnum<["in", "out"]>;
751
+ source_created_at: z.ZodDate;
752
+ forwarded_by: z.ZodObject<{
753
+ user_id: z.ZodString;
754
+ display_name: z.ZodString;
755
+ }, "strip", z.ZodTypeAny, {
756
+ display_name: string;
757
+ user_id: string;
758
+ }, {
759
+ display_name: string;
760
+ user_id: string;
761
+ }>;
762
+ forwarded_at: z.ZodDate;
763
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
764
+ forward_id: z.ZodString;
765
+ item_id: z.ZodString;
766
+ source_message_id: z.ZodString;
767
+ source_thread_id: z.ZodString;
768
+ source_ticket_id: z.ZodString;
769
+ source_contact_id: z.ZodString;
770
+ source_contact_name: z.ZodString;
771
+ source_channel_type: z.ZodNullable<z.ZodString>;
772
+ source_direction: z.ZodEnum<["in", "out"]>;
773
+ source_created_at: z.ZodDate;
774
+ forwarded_by: z.ZodObject<{
775
+ user_id: z.ZodString;
776
+ display_name: z.ZodString;
777
+ }, "strip", z.ZodTypeAny, {
778
+ display_name: string;
779
+ user_id: string;
780
+ }, {
781
+ display_name: string;
782
+ user_id: string;
783
+ }>;
784
+ forwarded_at: z.ZodDate;
785
+ }, z.ZodTypeAny, "passthrough">>>;
786
+ forward_count: z.ZodOptional<z.ZodNumber>;
583
787
  provider_message_id: z.ZodOptional<z.ZodString>;
584
788
  status: z.ZodOptional<z.ZodObject<{
585
789
  sent_at: z.ZodOptional<z.ZodDate>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.zThreadMessageSchema = exports.zMessagePricingSchema = exports.zMessageCreatedBySchema = exports.zMessageMediaSchema = exports.zMessageStatusSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../../shared/zod-schemas");
6
+ const zod_schemas_2 = require("../forward/zod-schemas");
6
7
  exports.zMessageStatusSchema = zod_1.z.object({
7
8
  sent_at: zod_1.z.coerce.date().optional(),
8
9
  delivered_at: zod_1.z.coerce.date().optional(),
@@ -66,6 +67,8 @@ exports.zThreadMessageSchema = zod_schemas_1.zFireDocSchema
66
67
  message_id: zod_1.z.string(),
67
68
  from: zod_1.z.string().optional(),
68
69
  }).optional(),
70
+ forward: zod_schemas_2.zMessageForwardSchema.optional(),
71
+ forward_count: zod_1.z.number().optional(),
69
72
  provider_message_id: zod_1.z.string().optional(),
70
73
  status: exports.zMessageStatusSchema.optional(),
71
74
  reactions: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { zFireDocSchema } from "../../shared/zod-schemas";
3
+ import { zMessageForwardSchema } from "../forward/zod-schemas";
3
4
 
4
5
  export const zMessageStatusSchema = z.object({
5
6
  sent_at: z.coerce.date().optional(),
@@ -68,6 +69,8 @@ export const zThreadMessageSchema = zFireDocSchema
68
69
  message_id: z.string(),
69
70
  from: z.string().optional(),
70
71
  }).optional(),
72
+ forward: zMessageForwardSchema.optional(),
73
+ forward_count: z.number().optional(),
71
74
  provider_message_id: z.string().optional(),
72
75
  status: zMessageStatusSchema.optional(),
73
76
  reactions: z.record(z.string(), z.any()).optional(),
@@ -14303,7 +14303,7 @@ export declare const zNexFinopsProposalSchema: z.ZodObject<{
14303
14303
  currency: z.ZodLiteral<"BRL">;
14304
14304
  }, "strip", z.ZodTypeAny, {
14305
14305
  currency: "BRL";
14306
- status: "draft" | "expired" | "accepted" | "canceled" | "sent" | "viewed";
14306
+ status: "draft" | "expired" | "accepted" | "sent" | "canceled" | "viewed";
14307
14307
  short_code: string;
14308
14308
  name?: string | null | undefined;
14309
14309
  notes?: string | null | undefined;
@@ -14337,7 +14337,7 @@ export declare const zNexFinopsProposalSchema: z.ZodObject<{
14337
14337
  valid_until?: string | undefined;
14338
14338
  }, {
14339
14339
  currency: "BRL";
14340
- status: "draft" | "expired" | "accepted" | "canceled" | "sent" | "viewed";
14340
+ status: "draft" | "expired" | "accepted" | "sent" | "canceled" | "viewed";
14341
14341
  short_code: string;
14342
14342
  name?: string | null | undefined;
14343
14343
  notes?: string | null | undefined;