evo360-types 1.3.715 → 1.3.719

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,171 @@
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
+ "attachments_over_limit",
17
+ "recipient_address_missing",
18
+ "email_identity_conflict",
19
+ ]);
20
+ exports.zForwardFailReasonSchema = zod_1.z.enum([
21
+ "provider_error",
22
+ "window_closed",
23
+ "send_budget_exceeded",
24
+ "interrupted",
25
+ ]);
26
+ exports.zForwardItemReasonSchema = zod_1.z.union([exports.zForwardSkipReasonSchema, exports.zForwardFailReasonSchema]);
27
+ exports.zForwardContentKindSchema = zod_1.z.enum(["text", "image", "video", "audio", "document"]);
28
+ exports.zForwardRecipientProviderSchema = zod_1.z.string().min(1);
29
+ exports.zForwardSpecialKindSchema = zod_1.z.enum(["doctor", "secretary", "employee"]);
30
+ // ── Partes ──
31
+ exports.zForwardActorSchema = zod_1.z.object({
32
+ user_id: zod_1.z.string(),
33
+ display_name: zod_1.z.string(),
34
+ });
35
+ exports.zForwardSourceSchema = zod_1.z.object({
36
+ thread_id: zod_1.z.string(),
37
+ ticket_id: zod_1.z.string(),
38
+ department_id: zod_1.z.string().nullable(),
39
+ contact_id: zod_1.z.string(),
40
+ contact_name: zod_1.z.string(),
41
+ channel_id: zod_1.z.string().nullable(),
42
+ channel_type: zod_1.z.string().nullable(),
43
+ });
44
+ exports.zForwardRecipientSchema = zod_1.z.object({
45
+ thread_id: zod_1.z.string(),
46
+ contact_id: zod_1.z.string(),
47
+ contact_name: zod_1.z.string(),
48
+ channel_id: zod_1.z.string(),
49
+ channel_type: zod_1.z.string(),
50
+ provider: exports.zForwardRecipientProviderSchema,
51
+ special_kind: exports.zForwardSpecialKindSchema.nullable().optional(),
52
+ email_address: zod_1.z.string().nullable().optional(),
53
+ });
54
+ exports.zForwardCountsSchema = zod_1.z.object({
55
+ total: zod_1.z.number().int().nonnegative(),
56
+ sent: zod_1.z.number().int().nonnegative(),
57
+ failed: zod_1.z.number().int().nonnegative(),
58
+ skipped: zod_1.z.number().int().nonnegative(),
59
+ });
60
+ // ── Docs ──
61
+ exports.zForwardBatchSchema = zod_schemas_1.zFireDocSchema
62
+ .extend({
63
+ forward_id: zod_1.z.string(),
64
+ tenant: zod_1.z.string(),
65
+ created_by: exports.zForwardActorSchema,
66
+ source: exports.zForwardSourceSchema,
67
+ message_ids: zod_1.z.array(zod_1.z.string()).min(1).max(forward_1.FORWARD_MAX_MESSAGES),
68
+ intro_text: zod_1.z.string().nullable(),
69
+ recipients: zod_1.z.array(exports.zForwardRecipientSchema).min(1).max(forward_1.FORWARD_MAX_RECIPIENTS),
70
+ status: exports.zForwardBatchStatusSchema,
71
+ counts: exports.zForwardCountsSchema,
72
+ recipients_to_dispatch: zod_1.z.number().int().nonnegative(),
73
+ recipients_done: zod_1.z.number().int().nonnegative(),
74
+ dispatch: zod_1.z
75
+ .record(zod_1.z.string(), zod_1.z.object({
76
+ claimed_at: zod_1.z.coerce.date(),
77
+ finished_at: zod_1.z.coerce.date().nullable().optional(),
78
+ }))
79
+ .optional(),
80
+ finished_at: zod_1.z.coerce.date().nullable().optional(),
81
+ email_subject: zod_1.z.string().nullable().optional(),
82
+ })
83
+ .passthrough();
84
+ exports.zForwardItemSchema = zod_1.z
85
+ .object({
86
+ item_id: zod_1.z.string(),
87
+ forward_id: zod_1.z.string(),
88
+ recipient_thread_id: zod_1.z.string(),
89
+ recipient_index: zod_1.z.number().int().nonnegative(),
90
+ seq: zod_1.z.number().int().nonnegative(),
91
+ kind: zod_1.z.enum(["intro", "message"]),
92
+ message_id: zod_1.z.string().nullable(),
93
+ content_kind: exports.zForwardContentKindSchema,
94
+ status: exports.zForwardItemStatusSchema,
95
+ reason: exports.zForwardItemReasonSchema.nullable().optional(),
96
+ error: zod_1.z.string().nullable().optional(),
97
+ error_code: zod_1.z.number().nullable().optional(),
98
+ dest_message_id: zod_1.z.string().nullable().optional(),
99
+ attachment_index: zod_1.z.number().int().positive().nullable().optional(),
100
+ dest_notification_message_id: zod_1.z.string().nullable().optional(),
101
+ sent_at: zod_1.z.coerce.date().nullable().optional(),
102
+ updated_at: zod_1.z.coerce.date().optional(),
103
+ })
104
+ .passthrough();
105
+ /** Bloco `forward` gravado na mensagem de destino. */
106
+ exports.zMessageForwardSchema = zod_1.z
107
+ .object({
108
+ forward_id: zod_1.z.string(),
109
+ item_id: zod_1.z.string(),
110
+ source_message_id: zod_1.z.string(),
111
+ source_thread_id: zod_1.z.string(),
112
+ source_ticket_id: zod_1.z.string(),
113
+ source_contact_id: zod_1.z.string(),
114
+ source_contact_name: zod_1.z.string(),
115
+ source_channel_type: zod_1.z.string().nullable(),
116
+ source_direction: zod_1.z.enum(["in", "out"]),
117
+ source_created_at: zod_1.z.coerce.date(),
118
+ forwarded_by: exports.zForwardActorSchema,
119
+ forwarded_at: zod_1.z.coerce.date(),
120
+ source_message_ids: zod_1.z.array(zod_1.z.string()).max(forward_1.FORWARD_MAX_MESSAGES).optional(),
121
+ item_ids: zod_1.z.array(zod_1.z.string()).max(forward_1.FORWARD_MAX_MESSAGES).optional(),
122
+ })
123
+ .passthrough();
124
+ // ── Request do `POST /forwards` ──
125
+ /**
126
+ * `.strict()` de propósito: o payload nunca carrega `gcs_uri` nem conteúdo. A
127
+ * mídia é sempre lida da mensagem gravada sob o tenant autenticado.
128
+ */
129
+ exports.zForwardCreateRequestSchema = zod_1.z
130
+ .object({
131
+ client_request_id: zod_1.z.string().uuid(),
132
+ source_thread_id: zod_1.z.string().min(1),
133
+ source_ticket_id: zod_1.z.string().min(1),
134
+ message_ids: zod_1.z.array(zod_1.z.string().min(1)).min(1).max(forward_1.FORWARD_MAX_MESSAGES),
135
+ intro_text: zod_1.z.string().trim().max(forward_1.FORWARD_INTRO_MAX_CHARS).nullable().optional(),
136
+ recipients: zod_1.z
137
+ .array(zod_1.z
138
+ .object({
139
+ thread_id: zod_1.z.string().min(1),
140
+ channel_id: zod_1.z.string().min(1),
141
+ email_address: zod_1.z.string().trim().toLowerCase().email().max(254).optional(),
142
+ })
143
+ .strict())
144
+ .min(1)
145
+ .max(forward_1.FORWARD_MAX_RECIPIENTS),
146
+ email_subject: zod_1.z
147
+ .string()
148
+ .trim()
149
+ .min(1)
150
+ .max(forward_1.FORWARD_EMAIL_SUBJECT_MAX_CHARS)
151
+ .refine((s) => !/[\r\n]/.test(s), { message: "email_subject must be a single line" })
152
+ .optional(),
153
+ dry_run: zod_1.z.boolean().optional(),
154
+ })
155
+ .strict()
156
+ .superRefine((v, ctx) => {
157
+ if (new Set(v.message_ids).size !== v.message_ids.length) {
158
+ ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["message_ids"], message: "message_ids must be unique" });
159
+ }
160
+ const threadIds = v.recipients.map((r) => r.thread_id);
161
+ if (new Set(threadIds).size !== threadIds.length) {
162
+ ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["recipients"], message: "recipients.thread_id must be unique" });
163
+ }
164
+ if (threadIds.indexOf(v.source_thread_id) !== -1) {
165
+ ctx.addIssue({
166
+ code: zod_1.z.ZodIssueCode.custom,
167
+ path: ["recipients"],
168
+ message: "a recipient cannot be the source thread",
169
+ });
170
+ }
171
+ });
@@ -0,0 +1,193 @@
1
+ import { z } from "zod";
2
+ import { zFireDocSchema } from "../../shared/zod-schemas";
3
+ import {
4
+ FORWARD_EMAIL_SUBJECT_MAX_CHARS,
5
+ FORWARD_INTRO_MAX_CHARS,
6
+ FORWARD_MAX_MESSAGES,
7
+ FORWARD_MAX_RECIPIENTS,
8
+ } from "../../../types/evo-chat/forward";
9
+
10
+ // ── Enums ──
11
+
12
+ export const zForwardBatchStatusSchema = z.enum(["running", "done", "done_with_failures"]);
13
+ export const zForwardItemStatusSchema = z.enum(["pending", "sending", "sent", "failed", "skipped"]);
14
+ export const zForwardSkipReasonSchema = z.enum([
15
+ "window_closed",
16
+ "type_not_supported",
17
+ "media_too_large",
18
+ "media_unavailable",
19
+ "channel_not_supported",
20
+ "attachments_over_limit",
21
+ "recipient_address_missing",
22
+ "email_identity_conflict",
23
+ ]);
24
+ export const zForwardFailReasonSchema = z.enum([
25
+ "provider_error",
26
+ "window_closed",
27
+ "send_budget_exceeded",
28
+ "interrupted",
29
+ ]);
30
+ export const zForwardItemReasonSchema = z.union([zForwardSkipReasonSchema, zForwardFailReasonSchema]);
31
+ export const zForwardContentKindSchema = z.enum(["text", "image", "video", "audio", "document"]);
32
+ export const zForwardRecipientProviderSchema = z.string().min(1);
33
+ export const zForwardSpecialKindSchema = z.enum(["doctor", "secretary", "employee"]);
34
+
35
+ // ── Partes ──
36
+
37
+ export const zForwardActorSchema = z.object({
38
+ user_id: z.string(),
39
+ display_name: z.string(),
40
+ });
41
+
42
+ export const zForwardSourceSchema = z.object({
43
+ thread_id: z.string(),
44
+ ticket_id: z.string(),
45
+ department_id: z.string().nullable(),
46
+ contact_id: z.string(),
47
+ contact_name: z.string(),
48
+ channel_id: z.string().nullable(),
49
+ channel_type: z.string().nullable(),
50
+ });
51
+
52
+ export const zForwardRecipientSchema = z.object({
53
+ thread_id: z.string(),
54
+ contact_id: z.string(),
55
+ contact_name: z.string(),
56
+ channel_id: z.string(),
57
+ channel_type: z.string(),
58
+ provider: zForwardRecipientProviderSchema,
59
+ special_kind: zForwardSpecialKindSchema.nullable().optional(),
60
+ email_address: z.string().nullable().optional(),
61
+ });
62
+
63
+ export const zForwardCountsSchema = z.object({
64
+ total: z.number().int().nonnegative(),
65
+ sent: z.number().int().nonnegative(),
66
+ failed: z.number().int().nonnegative(),
67
+ skipped: z.number().int().nonnegative(),
68
+ });
69
+
70
+ // ── Docs ──
71
+
72
+ export const zForwardBatchSchema = zFireDocSchema
73
+ .extend({
74
+ forward_id: z.string(),
75
+ tenant: z.string(),
76
+ created_by: zForwardActorSchema,
77
+ source: zForwardSourceSchema,
78
+ message_ids: z.array(z.string()).min(1).max(FORWARD_MAX_MESSAGES),
79
+ intro_text: z.string().nullable(),
80
+ recipients: z.array(zForwardRecipientSchema).min(1).max(FORWARD_MAX_RECIPIENTS),
81
+ status: zForwardBatchStatusSchema,
82
+ counts: zForwardCountsSchema,
83
+ recipients_to_dispatch: z.number().int().nonnegative(),
84
+ recipients_done: z.number().int().nonnegative(),
85
+ dispatch: z
86
+ .record(
87
+ z.string(),
88
+ z.object({
89
+ claimed_at: z.coerce.date(),
90
+ finished_at: z.coerce.date().nullable().optional(),
91
+ }),
92
+ )
93
+ .optional(),
94
+ finished_at: z.coerce.date().nullable().optional(),
95
+ email_subject: z.string().nullable().optional(),
96
+ })
97
+ .passthrough();
98
+
99
+ export const zForwardItemSchema = z
100
+ .object({
101
+ item_id: z.string(),
102
+ forward_id: z.string(),
103
+ recipient_thread_id: z.string(),
104
+ recipient_index: z.number().int().nonnegative(),
105
+ seq: z.number().int().nonnegative(),
106
+ kind: z.enum(["intro", "message"]),
107
+ message_id: z.string().nullable(),
108
+ content_kind: zForwardContentKindSchema,
109
+ status: zForwardItemStatusSchema,
110
+ reason: zForwardItemReasonSchema.nullable().optional(),
111
+ error: z.string().nullable().optional(),
112
+ error_code: z.number().nullable().optional(),
113
+ dest_message_id: z.string().nullable().optional(),
114
+ attachment_index: z.number().int().positive().nullable().optional(),
115
+ dest_notification_message_id: z.string().nullable().optional(),
116
+ sent_at: z.coerce.date().nullable().optional(),
117
+ updated_at: z.coerce.date().optional(),
118
+ })
119
+ .passthrough();
120
+
121
+ /** Bloco `forward` gravado na mensagem de destino. */
122
+ export const zMessageForwardSchema = z
123
+ .object({
124
+ forward_id: z.string(),
125
+ item_id: z.string(),
126
+ source_message_id: z.string(),
127
+ source_thread_id: z.string(),
128
+ source_ticket_id: z.string(),
129
+ source_contact_id: z.string(),
130
+ source_contact_name: z.string(),
131
+ source_channel_type: z.string().nullable(),
132
+ source_direction: z.enum(["in", "out"]),
133
+ source_created_at: z.coerce.date(),
134
+ forwarded_by: zForwardActorSchema,
135
+ forwarded_at: z.coerce.date(),
136
+ source_message_ids: z.array(z.string()).max(FORWARD_MAX_MESSAGES).optional(),
137
+ item_ids: z.array(z.string()).max(FORWARD_MAX_MESSAGES).optional(),
138
+ })
139
+ .passthrough();
140
+
141
+ // ── Request do `POST /forwards` ──
142
+
143
+ /**
144
+ * `.strict()` de propósito: o payload nunca carrega `gcs_uri` nem conteúdo. A
145
+ * mídia é sempre lida da mensagem gravada sob o tenant autenticado.
146
+ */
147
+ export const zForwardCreateRequestSchema = z
148
+ .object({
149
+ client_request_id: z.string().uuid(),
150
+ source_thread_id: z.string().min(1),
151
+ source_ticket_id: z.string().min(1),
152
+ message_ids: z.array(z.string().min(1)).min(1).max(FORWARD_MAX_MESSAGES),
153
+ intro_text: z.string().trim().max(FORWARD_INTRO_MAX_CHARS).nullable().optional(),
154
+ recipients: z
155
+ .array(
156
+ z
157
+ .object({
158
+ thread_id: z.string().min(1),
159
+ channel_id: z.string().min(1),
160
+ email_address: z.string().trim().toLowerCase().email().max(254).optional(),
161
+ })
162
+ .strict(),
163
+ )
164
+ .min(1)
165
+ .max(FORWARD_MAX_RECIPIENTS),
166
+ email_subject: z
167
+ .string()
168
+ .trim()
169
+ .min(1)
170
+ .max(FORWARD_EMAIL_SUBJECT_MAX_CHARS)
171
+ .refine((s) => !/[\r\n]/.test(s), { message: "email_subject must be a single line" })
172
+ .optional(),
173
+ dry_run: z.boolean().optional(),
174
+ })
175
+ .strict()
176
+ .superRefine((v, ctx) => {
177
+ if (new Set(v.message_ids).size !== v.message_ids.length) {
178
+ ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["message_ids"], message: "message_ids must be unique" });
179
+ }
180
+ const threadIds = v.recipients.map((r) => r.thread_id);
181
+ if (new Set(threadIds).size !== threadIds.length) {
182
+ ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["recipients"], message: "recipients.thread_id must be unique" });
183
+ }
184
+ if (threadIds.indexOf(v.source_thread_id) !== -1) {
185
+ ctx.addIssue({
186
+ code: z.ZodIssueCode.custom,
187
+ path: ["recipients"],
188
+ message: "a recipient cannot be the source thread",
189
+ });
190
+ }
191
+ });
192
+
193
+ export type ForwardCreateRequest = z.infer<typeof zForwardCreateRequestSchema>;
@@ -210,6 +210,80 @@ 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
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
236
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
237
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
238
+ forward_id: z.ZodString;
239
+ item_id: z.ZodString;
240
+ source_message_id: z.ZodString;
241
+ source_thread_id: z.ZodString;
242
+ source_ticket_id: z.ZodString;
243
+ source_contact_id: z.ZodString;
244
+ source_contact_name: z.ZodString;
245
+ source_channel_type: z.ZodNullable<z.ZodString>;
246
+ source_direction: z.ZodEnum<["in", "out"]>;
247
+ source_created_at: z.ZodDate;
248
+ forwarded_by: z.ZodObject<{
249
+ user_id: z.ZodString;
250
+ display_name: z.ZodString;
251
+ }, "strip", z.ZodTypeAny, {
252
+ display_name: string;
253
+ user_id: string;
254
+ }, {
255
+ display_name: string;
256
+ user_id: string;
257
+ }>;
258
+ forwarded_at: z.ZodDate;
259
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
260
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
261
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
262
+ forward_id: z.ZodString;
263
+ item_id: z.ZodString;
264
+ source_message_id: z.ZodString;
265
+ source_thread_id: z.ZodString;
266
+ source_ticket_id: z.ZodString;
267
+ source_contact_id: z.ZodString;
268
+ source_contact_name: z.ZodString;
269
+ source_channel_type: z.ZodNullable<z.ZodString>;
270
+ source_direction: z.ZodEnum<["in", "out"]>;
271
+ source_created_at: z.ZodDate;
272
+ forwarded_by: z.ZodObject<{
273
+ user_id: z.ZodString;
274
+ display_name: z.ZodString;
275
+ }, "strip", z.ZodTypeAny, {
276
+ display_name: string;
277
+ user_id: string;
278
+ }, {
279
+ display_name: string;
280
+ user_id: string;
281
+ }>;
282
+ forwarded_at: z.ZodDate;
283
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
284
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
285
+ }, z.ZodTypeAny, "passthrough">>>;
286
+ forward_count: z.ZodOptional<z.ZodNumber>;
213
287
  provider_message_id: z.ZodOptional<z.ZodString>;
214
288
  status: z.ZodOptional<z.ZodObject<{
215
289
  sent_at: z.ZodOptional<z.ZodDate>;
@@ -395,6 +469,80 @@ export declare const zThreadMessageSchema: z.ZodObject<{
395
469
  message_id: string;
396
470
  from?: string | undefined;
397
471
  }>>;
472
+ forward: z.ZodOptional<z.ZodObject<{
473
+ forward_id: z.ZodString;
474
+ item_id: z.ZodString;
475
+ source_message_id: z.ZodString;
476
+ source_thread_id: z.ZodString;
477
+ source_ticket_id: z.ZodString;
478
+ source_contact_id: z.ZodString;
479
+ source_contact_name: z.ZodString;
480
+ source_channel_type: z.ZodNullable<z.ZodString>;
481
+ source_direction: z.ZodEnum<["in", "out"]>;
482
+ source_created_at: z.ZodDate;
483
+ forwarded_by: z.ZodObject<{
484
+ user_id: z.ZodString;
485
+ display_name: z.ZodString;
486
+ }, "strip", z.ZodTypeAny, {
487
+ display_name: string;
488
+ user_id: string;
489
+ }, {
490
+ display_name: string;
491
+ user_id: string;
492
+ }>;
493
+ forwarded_at: z.ZodDate;
494
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
495
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
496
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
497
+ forward_id: z.ZodString;
498
+ item_id: z.ZodString;
499
+ source_message_id: z.ZodString;
500
+ source_thread_id: z.ZodString;
501
+ source_ticket_id: z.ZodString;
502
+ source_contact_id: z.ZodString;
503
+ source_contact_name: z.ZodString;
504
+ source_channel_type: z.ZodNullable<z.ZodString>;
505
+ source_direction: z.ZodEnum<["in", "out"]>;
506
+ source_created_at: z.ZodDate;
507
+ forwarded_by: z.ZodObject<{
508
+ user_id: z.ZodString;
509
+ display_name: z.ZodString;
510
+ }, "strip", z.ZodTypeAny, {
511
+ display_name: string;
512
+ user_id: string;
513
+ }, {
514
+ display_name: string;
515
+ user_id: string;
516
+ }>;
517
+ forwarded_at: z.ZodDate;
518
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
519
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
520
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
521
+ forward_id: z.ZodString;
522
+ item_id: z.ZodString;
523
+ source_message_id: z.ZodString;
524
+ source_thread_id: z.ZodString;
525
+ source_ticket_id: z.ZodString;
526
+ source_contact_id: z.ZodString;
527
+ source_contact_name: z.ZodString;
528
+ source_channel_type: z.ZodNullable<z.ZodString>;
529
+ source_direction: z.ZodEnum<["in", "out"]>;
530
+ source_created_at: z.ZodDate;
531
+ forwarded_by: z.ZodObject<{
532
+ user_id: z.ZodString;
533
+ display_name: z.ZodString;
534
+ }, "strip", z.ZodTypeAny, {
535
+ display_name: string;
536
+ user_id: string;
537
+ }, {
538
+ display_name: string;
539
+ user_id: string;
540
+ }>;
541
+ forwarded_at: z.ZodDate;
542
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
543
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
544
+ }, z.ZodTypeAny, "passthrough">>>;
545
+ forward_count: z.ZodOptional<z.ZodNumber>;
398
546
  provider_message_id: z.ZodOptional<z.ZodString>;
399
547
  status: z.ZodOptional<z.ZodObject<{
400
548
  sent_at: z.ZodOptional<z.ZodDate>;
@@ -580,6 +728,80 @@ export declare const zThreadMessageSchema: z.ZodObject<{
580
728
  message_id: string;
581
729
  from?: string | undefined;
582
730
  }>>;
731
+ forward: z.ZodOptional<z.ZodObject<{
732
+ forward_id: z.ZodString;
733
+ item_id: z.ZodString;
734
+ source_message_id: z.ZodString;
735
+ source_thread_id: z.ZodString;
736
+ source_ticket_id: z.ZodString;
737
+ source_contact_id: z.ZodString;
738
+ source_contact_name: z.ZodString;
739
+ source_channel_type: z.ZodNullable<z.ZodString>;
740
+ source_direction: z.ZodEnum<["in", "out"]>;
741
+ source_created_at: z.ZodDate;
742
+ forwarded_by: z.ZodObject<{
743
+ user_id: z.ZodString;
744
+ display_name: z.ZodString;
745
+ }, "strip", z.ZodTypeAny, {
746
+ display_name: string;
747
+ user_id: string;
748
+ }, {
749
+ display_name: string;
750
+ user_id: string;
751
+ }>;
752
+ forwarded_at: z.ZodDate;
753
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
754
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
755
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
756
+ forward_id: z.ZodString;
757
+ item_id: z.ZodString;
758
+ source_message_id: z.ZodString;
759
+ source_thread_id: z.ZodString;
760
+ source_ticket_id: z.ZodString;
761
+ source_contact_id: z.ZodString;
762
+ source_contact_name: z.ZodString;
763
+ source_channel_type: z.ZodNullable<z.ZodString>;
764
+ source_direction: z.ZodEnum<["in", "out"]>;
765
+ source_created_at: z.ZodDate;
766
+ forwarded_by: z.ZodObject<{
767
+ user_id: z.ZodString;
768
+ display_name: z.ZodString;
769
+ }, "strip", z.ZodTypeAny, {
770
+ display_name: string;
771
+ user_id: string;
772
+ }, {
773
+ display_name: string;
774
+ user_id: string;
775
+ }>;
776
+ forwarded_at: z.ZodDate;
777
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
778
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
779
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
780
+ forward_id: z.ZodString;
781
+ item_id: z.ZodString;
782
+ source_message_id: z.ZodString;
783
+ source_thread_id: z.ZodString;
784
+ source_ticket_id: z.ZodString;
785
+ source_contact_id: z.ZodString;
786
+ source_contact_name: z.ZodString;
787
+ source_channel_type: z.ZodNullable<z.ZodString>;
788
+ source_direction: z.ZodEnum<["in", "out"]>;
789
+ source_created_at: z.ZodDate;
790
+ forwarded_by: z.ZodObject<{
791
+ user_id: z.ZodString;
792
+ display_name: z.ZodString;
793
+ }, "strip", z.ZodTypeAny, {
794
+ display_name: string;
795
+ user_id: string;
796
+ }, {
797
+ display_name: string;
798
+ user_id: string;
799
+ }>;
800
+ forwarded_at: z.ZodDate;
801
+ source_message_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
802
+ item_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
803
+ }, z.ZodTypeAny, "passthrough">>>;
804
+ forward_count: z.ZodOptional<z.ZodNumber>;
583
805
  provider_message_id: z.ZodOptional<z.ZodString>;
584
806
  status: z.ZodOptional<z.ZodObject<{
585
807
  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(),