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.
@@ -2355,7 +2355,7 @@ export declare const zCsqAppointmentEventSchema: z.ZodObject<{
2355
2355
  supersedes: z.ZodOptional<z.ZodString>;
2356
2356
  }, "strip", z.ZodTypeAny, {
2357
2357
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
2358
- actor: "automation" | "lead" | "hubia" | "attendant";
2358
+ actor: "lead" | "automation" | "hubia" | "attendant";
2359
2359
  evidence: {
2360
2360
  message_id: string;
2361
2361
  ticket_id: string;
@@ -2370,7 +2370,7 @@ export declare const zCsqAppointmentEventSchema: z.ZodObject<{
2370
2370
  supersedes?: string | undefined;
2371
2371
  }, {
2372
2372
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
2373
- actor: "automation" | "lead" | "hubia" | "attendant";
2373
+ actor: "lead" | "automation" | "hubia" | "attendant";
2374
2374
  evidence: {
2375
2375
  message_id: string;
2376
2376
  ticket_id: string;
@@ -2528,7 +2528,7 @@ export declare const zCsqDetectorReportSchema: z.ZodObject<{
2528
2528
  supersedes: z.ZodOptional<z.ZodString>;
2529
2529
  }, "strip", z.ZodTypeAny, {
2530
2530
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
2531
- actor: "automation" | "lead" | "hubia" | "attendant";
2531
+ actor: "lead" | "automation" | "hubia" | "attendant";
2532
2532
  evidence: {
2533
2533
  message_id: string;
2534
2534
  ticket_id: string;
@@ -2543,7 +2543,7 @@ export declare const zCsqDetectorReportSchema: z.ZodObject<{
2543
2543
  supersedes?: string | undefined;
2544
2544
  }, {
2545
2545
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
2546
- actor: "automation" | "lead" | "hubia" | "attendant";
2546
+ actor: "lead" | "automation" | "hubia" | "attendant";
2547
2547
  evidence: {
2548
2548
  message_id: string;
2549
2549
  ticket_id: string;
@@ -2619,7 +2619,7 @@ export declare const zCsqDetectorReportSchema: z.ZodObject<{
2619
2619
  time_mismatch?: number | undefined;
2620
2620
  event_list?: {
2621
2621
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
2622
- actor: "automation" | "lead" | "hubia" | "attendant";
2622
+ actor: "lead" | "automation" | "hubia" | "attendant";
2623
2623
  evidence: {
2624
2624
  message_id: string;
2625
2625
  ticket_id: string;
@@ -2660,7 +2660,7 @@ export declare const zCsqDetectorReportSchema: z.ZodObject<{
2660
2660
  time_mismatch?: number | undefined;
2661
2661
  event_list?: {
2662
2662
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
2663
- actor: "automation" | "lead" | "hubia" | "attendant";
2663
+ actor: "lead" | "automation" | "hubia" | "attendant";
2664
2664
  evidence: {
2665
2665
  message_id: string;
2666
2666
  ticket_id: string;
@@ -2760,7 +2760,7 @@ export declare const zCsqTranscriptMessageSchema: z.ZodObject<{
2760
2760
  message_id: string;
2761
2761
  ticket_id: string;
2762
2762
  ts: Date;
2763
- author_kind: "human" | "automation" | "lead" | "hubia" | "event" | "note";
2763
+ author_kind: "human" | "lead" | "automation" | "hubia" | "event" | "note";
2764
2764
  author_label: string;
2765
2765
  unattributed?: boolean | undefined;
2766
2766
  }, {
@@ -2768,7 +2768,7 @@ export declare const zCsqTranscriptMessageSchema: z.ZodObject<{
2768
2768
  text: string;
2769
2769
  message_id: string;
2770
2770
  ticket_id: string;
2771
- author_kind: "human" | "automation" | "lead" | "hubia" | "event" | "note";
2771
+ author_kind: "human" | "lead" | "automation" | "hubia" | "event" | "note";
2772
2772
  author_label: string;
2773
2773
  ts?: unknown;
2774
2774
  unattributed?: boolean | undefined;
@@ -7683,7 +7683,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
7683
7683
  supersedes: z.ZodOptional<z.ZodString>;
7684
7684
  }, "strip", z.ZodTypeAny, {
7685
7685
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
7686
- actor: "automation" | "lead" | "hubia" | "attendant";
7686
+ actor: "lead" | "automation" | "hubia" | "attendant";
7687
7687
  evidence: {
7688
7688
  message_id: string;
7689
7689
  ticket_id: string;
@@ -7698,7 +7698,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
7698
7698
  supersedes?: string | undefined;
7699
7699
  }, {
7700
7700
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
7701
- actor: "automation" | "lead" | "hubia" | "attendant";
7701
+ actor: "lead" | "automation" | "hubia" | "attendant";
7702
7702
  evidence: {
7703
7703
  message_id: string;
7704
7704
  ticket_id: string;
@@ -7774,7 +7774,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
7774
7774
  time_mismatch?: number | undefined;
7775
7775
  event_list?: {
7776
7776
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
7777
- actor: "automation" | "lead" | "hubia" | "attendant";
7777
+ actor: "lead" | "automation" | "hubia" | "attendant";
7778
7778
  evidence: {
7779
7779
  message_id: string;
7780
7780
  ticket_id: string;
@@ -7815,7 +7815,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
7815
7815
  time_mismatch?: number | undefined;
7816
7816
  event_list?: {
7817
7817
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
7818
- actor: "automation" | "lead" | "hubia" | "attendant";
7818
+ actor: "lead" | "automation" | "hubia" | "attendant";
7819
7819
  evidence: {
7820
7820
  message_id: string;
7821
7821
  ticket_id: string;
@@ -10148,7 +10148,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10148
10148
  supersedes: z.ZodOptional<z.ZodString>;
10149
10149
  }, "strip", z.ZodTypeAny, {
10150
10150
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
10151
- actor: "automation" | "lead" | "hubia" | "attendant";
10151
+ actor: "lead" | "automation" | "hubia" | "attendant";
10152
10152
  evidence: {
10153
10153
  message_id: string;
10154
10154
  ticket_id: string;
@@ -10163,7 +10163,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10163
10163
  supersedes?: string | undefined;
10164
10164
  }, {
10165
10165
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
10166
- actor: "automation" | "lead" | "hubia" | "attendant";
10166
+ actor: "lead" | "automation" | "hubia" | "attendant";
10167
10167
  evidence: {
10168
10168
  message_id: string;
10169
10169
  ticket_id: string;
@@ -10239,7 +10239,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10239
10239
  time_mismatch?: number | undefined;
10240
10240
  event_list?: {
10241
10241
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
10242
- actor: "automation" | "lead" | "hubia" | "attendant";
10242
+ actor: "lead" | "automation" | "hubia" | "attendant";
10243
10243
  evidence: {
10244
10244
  message_id: string;
10245
10245
  ticket_id: string;
@@ -10280,7 +10280,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10280
10280
  time_mismatch?: number | undefined;
10281
10281
  event_list?: {
10282
10282
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
10283
- actor: "automation" | "lead" | "hubia" | "attendant";
10283
+ actor: "lead" | "automation" | "hubia" | "attendant";
10284
10284
  evidence: {
10285
10285
  message_id: string;
10286
10286
  ticket_id: string;
@@ -12613,7 +12613,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
12613
12613
  supersedes: z.ZodOptional<z.ZodString>;
12614
12614
  }, "strip", z.ZodTypeAny, {
12615
12615
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
12616
- actor: "automation" | "lead" | "hubia" | "attendant";
12616
+ actor: "lead" | "automation" | "hubia" | "attendant";
12617
12617
  evidence: {
12618
12618
  message_id: string;
12619
12619
  ticket_id: string;
@@ -12628,7 +12628,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
12628
12628
  supersedes?: string | undefined;
12629
12629
  }, {
12630
12630
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
12631
- actor: "automation" | "lead" | "hubia" | "attendant";
12631
+ actor: "lead" | "automation" | "hubia" | "attendant";
12632
12632
  evidence: {
12633
12633
  message_id: string;
12634
12634
  ticket_id: string;
@@ -12704,7 +12704,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
12704
12704
  time_mismatch?: number | undefined;
12705
12705
  event_list?: {
12706
12706
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
12707
- actor: "automation" | "lead" | "hubia" | "attendant";
12707
+ actor: "lead" | "automation" | "hubia" | "attendant";
12708
12708
  evidence: {
12709
12709
  message_id: string;
12710
12710
  ticket_id: string;
@@ -12745,7 +12745,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
12745
12745
  time_mismatch?: number | undefined;
12746
12746
  event_list?: {
12747
12747
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
12748
- actor: "automation" | "lead" | "hubia" | "attendant";
12748
+ actor: "lead" | "automation" | "hubia" | "attendant";
12749
12749
  evidence: {
12750
12750
  message_id: string;
12751
12751
  ticket_id: string;
@@ -12847,7 +12847,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
12847
12847
  supersedes: z.ZodOptional<z.ZodString>;
12848
12848
  }, "strip", z.ZodTypeAny, {
12849
12849
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
12850
- actor: "automation" | "lead" | "hubia" | "attendant";
12850
+ actor: "lead" | "automation" | "hubia" | "attendant";
12851
12851
  evidence: {
12852
12852
  message_id: string;
12853
12853
  ticket_id: string;
@@ -12862,7 +12862,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
12862
12862
  supersedes?: string | undefined;
12863
12863
  }, {
12864
12864
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
12865
- actor: "automation" | "lead" | "hubia" | "attendant";
12865
+ actor: "lead" | "automation" | "hubia" | "attendant";
12866
12866
  evidence: {
12867
12867
  message_id: string;
12868
12868
  ticket_id: string;
@@ -12950,7 +12950,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
12950
12950
  supersedes: z.ZodOptional<z.ZodString>;
12951
12951
  }, "strip", z.ZodTypeAny, {
12952
12952
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
12953
- actor: "automation" | "lead" | "hubia" | "attendant";
12953
+ actor: "lead" | "automation" | "hubia" | "attendant";
12954
12954
  evidence: {
12955
12955
  message_id: string;
12956
12956
  ticket_id: string;
@@ -12965,7 +12965,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
12965
12965
  supersedes?: string | undefined;
12966
12966
  }, {
12967
12967
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
12968
- actor: "automation" | "lead" | "hubia" | "attendant";
12968
+ actor: "lead" | "automation" | "hubia" | "attendant";
12969
12969
  evidence: {
12970
12970
  message_id: string;
12971
12971
  ticket_id: string;
@@ -13053,7 +13053,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
13053
13053
  supersedes: z.ZodOptional<z.ZodString>;
13054
13054
  }, "strip", z.ZodTypeAny, {
13055
13055
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
13056
- actor: "automation" | "lead" | "hubia" | "attendant";
13056
+ actor: "lead" | "automation" | "hubia" | "attendant";
13057
13057
  evidence: {
13058
13058
  message_id: string;
13059
13059
  ticket_id: string;
@@ -13068,7 +13068,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
13068
13068
  supersedes?: string | undefined;
13069
13069
  }, {
13070
13070
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
13071
- actor: "automation" | "lead" | "hubia" | "attendant";
13071
+ actor: "lead" | "automation" | "hubia" | "attendant";
13072
13072
  evidence: {
13073
13073
  message_id: string;
13074
13074
  ticket_id: string;
@@ -13169,7 +13169,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
13169
13169
  supersedes: z.ZodOptional<z.ZodString>;
13170
13170
  }, "strip", z.ZodTypeAny, {
13171
13171
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
13172
- actor: "automation" | "lead" | "hubia" | "attendant";
13172
+ actor: "lead" | "automation" | "hubia" | "attendant";
13173
13173
  evidence: {
13174
13174
  message_id: string;
13175
13175
  ticket_id: string;
@@ -13184,7 +13184,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
13184
13184
  supersedes?: string | undefined;
13185
13185
  }, {
13186
13186
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
13187
- actor: "automation" | "lead" | "hubia" | "attendant";
13187
+ actor: "lead" | "automation" | "hubia" | "attendant";
13188
13188
  evidence: {
13189
13189
  message_id: string;
13190
13190
  ticket_id: string;
@@ -13287,7 +13287,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
13287
13287
  supersedes: z.ZodOptional<z.ZodString>;
13288
13288
  }, "strip", z.ZodTypeAny, {
13289
13289
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
13290
- actor: "automation" | "lead" | "hubia" | "attendant";
13290
+ actor: "lead" | "automation" | "hubia" | "attendant";
13291
13291
  evidence: {
13292
13292
  message_id: string;
13293
13293
  ticket_id: string;
@@ -13302,7 +13302,7 @@ export declare const zCsqDryRunResultSchema: z.ZodObject<{
13302
13302
  supersedes?: string | undefined;
13303
13303
  }, {
13304
13304
  kind: "appointment_cancelled" | "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested";
13305
- actor: "automation" | "lead" | "hubia" | "attendant";
13305
+ actor: "lead" | "automation" | "hubia" | "attendant";
13306
13306
  evidence: {
13307
13307
  message_id: string;
13308
13308
  ticket_id: string;
@@ -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;
@@ -278,12 +278,12 @@ export declare const zAppointmentRescheduleSchema: z.ZodObject<{
278
278
  userRef?: any;
279
279
  external_id?: string | null | undefined;
280
280
  user_name?: string | undefined;
281
+ reason?: string | undefined;
281
282
  appointmentSource?: {
282
283
  code: string;
283
284
  name: string;
284
285
  external_id?: string | null | undefined;
285
286
  } | undefined;
286
- reason?: string | undefined;
287
287
  oldStartDate?: Date | undefined;
288
288
  oldEndDate?: Date | undefined;
289
289
  newStartDate?: Date | undefined;
@@ -293,12 +293,12 @@ export declare const zAppointmentRescheduleSchema: z.ZodObject<{
293
293
  userRef?: any;
294
294
  external_id?: string | null | undefined;
295
295
  user_name?: string | undefined;
296
+ reason?: string | undefined;
296
297
  appointmentSource?: {
297
298
  code: string;
298
299
  name: string;
299
300
  external_id?: string | null | undefined;
300
301
  } | undefined;
301
- reason?: string | undefined;
302
302
  oldStartDate?: unknown;
303
303
  oldEndDate?: unknown;
304
304
  newStartDate?: unknown;
@@ -650,12 +650,12 @@ export declare const zAppointmentSchema: z.ZodObject<{
650
650
  userRef?: any;
651
651
  external_id?: string | null | undefined;
652
652
  user_name?: string | undefined;
653
+ reason?: string | undefined;
653
654
  appointmentSource?: {
654
655
  code: string;
655
656
  name: string;
656
657
  external_id?: string | null | undefined;
657
658
  } | undefined;
658
- reason?: string | undefined;
659
659
  oldStartDate?: Date | undefined;
660
660
  oldEndDate?: Date | undefined;
661
661
  newStartDate?: Date | undefined;
@@ -665,12 +665,12 @@ export declare const zAppointmentSchema: z.ZodObject<{
665
665
  userRef?: any;
666
666
  external_id?: string | null | undefined;
667
667
  user_name?: string | undefined;
668
+ reason?: string | undefined;
668
669
  appointmentSource?: {
669
670
  code: string;
670
671
  name: string;
671
672
  external_id?: string | null | undefined;
672
673
  } | undefined;
673
- reason?: string | undefined;
674
674
  oldStartDate?: unknown;
675
675
  oldEndDate?: unknown;
676
676
  newStartDate?: unknown;
@@ -1017,12 +1017,12 @@ export declare const zAppointmentSchema: z.ZodObject<{
1017
1017
  userRef?: any;
1018
1018
  external_id?: string | null | undefined;
1019
1019
  user_name?: string | undefined;
1020
+ reason?: string | undefined;
1020
1021
  appointmentSource?: {
1021
1022
  code: string;
1022
1023
  name: string;
1023
1024
  external_id?: string | null | undefined;
1024
1025
  } | undefined;
1025
- reason?: string | undefined;
1026
1026
  oldStartDate?: Date | undefined;
1027
1027
  oldEndDate?: Date | undefined;
1028
1028
  newStartDate?: Date | undefined;
@@ -1032,12 +1032,12 @@ export declare const zAppointmentSchema: z.ZodObject<{
1032
1032
  userRef?: any;
1033
1033
  external_id?: string | null | undefined;
1034
1034
  user_name?: string | undefined;
1035
+ reason?: string | undefined;
1035
1036
  appointmentSource?: {
1036
1037
  code: string;
1037
1038
  name: string;
1038
1039
  external_id?: string | null | undefined;
1039
1040
  } | undefined;
1040
- reason?: string | undefined;
1041
1041
  oldStartDate?: unknown;
1042
1042
  oldEndDate?: unknown;
1043
1043
  newStartDate?: unknown;
@@ -1384,12 +1384,12 @@ export declare const zAppointmentSchema: z.ZodObject<{
1384
1384
  userRef?: any;
1385
1385
  external_id?: string | null | undefined;
1386
1386
  user_name?: string | undefined;
1387
+ reason?: string | undefined;
1387
1388
  appointmentSource?: {
1388
1389
  code: string;
1389
1390
  name: string;
1390
1391
  external_id?: string | null | undefined;
1391
1392
  } | undefined;
1392
- reason?: string | undefined;
1393
1393
  oldStartDate?: Date | undefined;
1394
1394
  oldEndDate?: Date | undefined;
1395
1395
  newStartDate?: Date | undefined;
@@ -1399,12 +1399,12 @@ export declare const zAppointmentSchema: z.ZodObject<{
1399
1399
  userRef?: any;
1400
1400
  external_id?: string | null | undefined;
1401
1401
  user_name?: string | undefined;
1402
+ reason?: string | undefined;
1402
1403
  appointmentSource?: {
1403
1404
  code: string;
1404
1405
  name: string;
1405
1406
  external_id?: string | null | undefined;
1406
1407
  } | undefined;
1407
- reason?: string | undefined;
1408
1408
  oldStartDate?: unknown;
1409
1409
  oldEndDate?: unknown;
1410
1410
  newStartDate?: unknown;
package/dist/index.d.ts CHANGED
@@ -58,6 +58,7 @@ export * from "./apps/evo-chat/waba-template/zod-schemas";
58
58
  export * from "./apps/evo-chat/waba-setup/zod-schemas";
59
59
  export * from "./apps/evo-chat/ig-setup/zod-schemas";
60
60
  export * from "./apps/evo-chat/quick-reply/zod-schemas";
61
+ export * from "./apps/evo-chat/forward/zod-schemas";
61
62
  export * from "./apps/evo-hub-ia/channel/zod-schemas";
62
63
  export * from "./apps/evo-hub-ia/v1/zod-schemas";
63
64
  export * from "./apps/evo-hub-ia/v1/adapter-tool-registry";
package/dist/index.js CHANGED
@@ -76,6 +76,7 @@ __exportStar(require("./apps/evo-chat/waba-template/zod-schemas"), exports);
76
76
  __exportStar(require("./apps/evo-chat/waba-setup/zod-schemas"), exports);
77
77
  __exportStar(require("./apps/evo-chat/ig-setup/zod-schemas"), exports);
78
78
  __exportStar(require("./apps/evo-chat/quick-reply/zod-schemas"), exports);
79
+ __exportStar(require("./apps/evo-chat/forward/zod-schemas"), exports);
79
80
  __exportStar(require("./apps/evo-hub-ia/channel/zod-schemas"), exports);
80
81
  __exportStar(require("./apps/evo-hub-ia/v1/zod-schemas"), exports);
81
82
  __exportStar(require("./apps/evo-hub-ia/v1/adapter-tool-registry"), exports);
package/dist/index.ts CHANGED
@@ -61,6 +61,7 @@ export * from "./apps/evo-chat/waba-template/zod-schemas";
61
61
  export * from "./apps/evo-chat/waba-setup/zod-schemas";
62
62
  export * from "./apps/evo-chat/ig-setup/zod-schemas";
63
63
  export * from "./apps/evo-chat/quick-reply/zod-schemas";
64
+ export * from "./apps/evo-chat/forward/zod-schemas";
64
65
  export * from "./apps/evo-hub-ia/channel/zod-schemas";
65
66
  export * from "./apps/evo-hub-ia/v1/zod-schemas";
66
67
  export * from "./apps/evo-hub-ia/v1/adapter-tool-registry";
@@ -0,0 +1,213 @@
1
+ import type { IFireDoc } from "../../shared";
2
+ import type { IThreadMessage } from "../thread-message";
3
+ /**
4
+ * feat-282 — encaminhamento de mensagens no Hub Omni.
5
+ *
6
+ * A Cloud API da Meta não tem forward: o encaminhamento é nosso. Cada ação do
7
+ * operador vira um LOTE (`IForwardBatch`) em
8
+ * `tenants/{t}/apps/evo-chat/forwards/{forwardId}`, com um item por
9
+ * (destinatário × mensagem) na subcoleção `items/` e, por destinatário, um item
10
+ * `intro` opcional (texto de apresentação). Cada entrega é uma mensagem NORMAL de
11
+ * saída na thread de destino, com o bloco `forward` (`IMessageForward`) apontando
12
+ * para a origem. A mensagem de origem só ganha `forward_count`.
13
+ */
14
+ export declare const FORWARDS_COLLECTION: "forwards";
15
+ export declare const FORWARD_ITEMS_COLLECTION: "items";
16
+ /** Tetos do lote (plan.md D6). Constantes de plataforma, sem config por tenant. */
17
+ export declare const FORWARD_MAX_MESSAGES = 20;
18
+ export declare const FORWARD_MAX_RECIPIENTS = 10;
19
+ export declare const FORWARD_INTRO_MAX_CHARS = 1000;
20
+ /** Teto do assunto (RFC 5322), igual ao do composer de e-mail do Omni. */
21
+ export declare const FORWARD_EMAIL_SUBJECT_MAX_CHARS = 998;
22
+ /** Lote `running` sem atualização há mais que isto é mostrado como interrompido. */
23
+ export declare const FORWARD_STALE_AFTER_MS: number;
24
+ /** Evento de timeline gravado na thread de ORIGEM ao criar o lote. */
25
+ export declare const FORWARD_TIMELINE_EVENT_TYPE: "messages_forwarded";
26
+ export type ForwardBatchStatus = "running" | "done" | "done_with_failures";
27
+ export type ForwardItemStatus = "pending" | "sending" | "sent" | "failed" | "skipped";
28
+ /** Motivos decididos na pré-validação (item nasce `skipped`, nenhuma chamada ao provedor). */
29
+ export type ForwardSkipReason = "window_closed" | "type_not_supported" | "media_too_large" | "media_unavailable" | "channel_not_supported" | "attachments_over_limit" | "recipient_address_missing" | "email_identity_conflict";
30
+ /** Motivos de falha no envio (item passou por `sending`). */
31
+ export type ForwardFailReason = "provider_error" | "window_closed" | "send_budget_exceeded" | "interrupted";
32
+ export type ForwardItemReason = ForwardSkipReason | ForwardFailReason;
33
+ export type ForwardContentKind = "text" | "image" | "video" | "audio" | "document";
34
+ /** Canais aceitos como DESTINO. E-mail é agregado: um e-mail por destinatário. SMS fica fora. */
35
+ export type ForwardDestinationKind = "whatsapp" | "instagram" | "email";
36
+ /** `hub-waba`, `hub-instagram` ou o provider do canal de e-mail (`smtp`, `amazon-ses`, ...). */
37
+ export type ForwardRecipientProvider = string;
38
+ export type ForwardSpecialKind = "doctor" | "secretary" | "employee";
39
+ export interface IForwardActor {
40
+ user_id: string;
41
+ display_name: string;
42
+ }
43
+ export interface IForwardSource {
44
+ thread_id: string;
45
+ ticket_id: string;
46
+ /** Departamento do ticket de origem: é onde o ticket novo do destino abre (Q4-A). */
47
+ department_id: string | null;
48
+ contact_id: string;
49
+ contact_name: string;
50
+ channel_id: string | null;
51
+ channel_type: string | null;
52
+ }
53
+ export interface IForwardRecipient {
54
+ thread_id: string;
55
+ contact_id: string;
56
+ contact_name: string;
57
+ channel_id: string;
58
+ channel_type: string;
59
+ provider: ForwardRecipientProvider;
60
+ special_kind?: ForwardSpecialKind | null;
61
+ /** Destino e-mail: endereço resolvido na prévia. O worker usa este, não resolve de novo. */
62
+ email_address?: string | null;
63
+ }
64
+ export interface IForwardDispatchState {
65
+ claimed_at: Date;
66
+ finished_at?: Date | null;
67
+ }
68
+ export interface IForwardCounts {
69
+ total: number;
70
+ sent: number;
71
+ failed: number;
72
+ skipped: number;
73
+ }
74
+ export interface IForwardBatch extends IFireDoc {
75
+ forward_id: string;
76
+ tenant: string;
77
+ created_by: IForwardActor;
78
+ source: IForwardSource;
79
+ /** Ordem cronológica da origem (o backend ordena por `created_at`, não pelo payload). */
80
+ message_ids: string[];
81
+ intro_text: string | null;
82
+ recipients: IForwardRecipient[];
83
+ status: ForwardBatchStatus;
84
+ counts: IForwardCounts;
85
+ /** Destinatários com pelo menos um item `pending` (os que recebem mensagem PubSub). */
86
+ recipients_to_dispatch: number;
87
+ recipients_done: number;
88
+ /** Chave = `thread_id` do destinatário. Claim do worker contra entrega duplicada. */
89
+ dispatch?: Record<string, IForwardDispatchState>;
90
+ finished_at?: Date | null;
91
+ /** Um assunto por lote; gravado só quando há destinatário e-mail. */
92
+ email_subject?: string | null;
93
+ }
94
+ export interface IForwardItem {
95
+ /** `${recipient_thread_id}__${message_id}` ou `${recipient_thread_id}__intro`. */
96
+ item_id: string;
97
+ forward_id: string;
98
+ recipient_thread_id: string;
99
+ recipient_index: number;
100
+ /** 0 = intro; 1..N = mensagens na ordem da origem. */
101
+ seq: number;
102
+ kind: "intro" | "message";
103
+ message_id: string | null;
104
+ content_kind: ForwardContentKind;
105
+ status: ForwardItemStatus;
106
+ reason?: ForwardItemReason | null;
107
+ error?: string | null;
108
+ error_code?: number | null;
109
+ dest_message_id?: string | null;
110
+ /** Destino e-mail: o N de `[Anexo N]` no corpo. */
111
+ attachment_index?: number | null;
112
+ dest_notification_message_id?: string | null;
113
+ sent_at?: Date | null;
114
+ updated_at?: Date;
115
+ }
116
+ export type ForwardWindowState = "open" | "human_agent" | "closed";
117
+ export interface IForwardPlanItem {
118
+ item_id: string;
119
+ kind: "intro" | "message";
120
+ message_id: string | null;
121
+ status: "pending" | "skipped";
122
+ reason?: ForwardSkipReason;
123
+ attachment?: {
124
+ index: number | null;
125
+ filename: string;
126
+ size_bytes: number | null;
127
+ } | null;
128
+ }
129
+ export interface IForwardPlanEmailAttachments {
130
+ count: number;
131
+ bytes: number;
132
+ max_count: number;
133
+ max_file_bytes: number;
134
+ max_total_bytes: number;
135
+ }
136
+ export interface IForwardPlanEmail {
137
+ channel_id: string;
138
+ provider: string;
139
+ from_address: string | null;
140
+ address: string | null;
141
+ address_source: "typed" | "contact" | "lead" | null;
142
+ identity: "own" | "attach" | "conflict" | null;
143
+ identity_owner_name?: string | null;
144
+ /** `fill`: lead sem e-mail, que o worker preenche antes do envio. */
145
+ lead_identity: "match" | "fill" | "conflict" | null;
146
+ /** Só no conflito do lead, para o aviso. */
147
+ lead_email?: string | null;
148
+ subject: string;
149
+ attachments: IForwardPlanEmailAttachments;
150
+ }
151
+ export interface IForwardPlanRecipient {
152
+ thread_id: string;
153
+ channel_id: string;
154
+ channel_type: string;
155
+ contact_name: string;
156
+ window: ForwardWindowState;
157
+ needs_ticket: boolean;
158
+ items: IForwardPlanItem[];
159
+ email?: IForwardPlanEmail | null;
160
+ }
161
+ export interface IForwardPlan {
162
+ recipients: IForwardPlanRecipient[];
163
+ counts: {
164
+ total: number;
165
+ pending: number;
166
+ skipped: number;
167
+ };
168
+ }
169
+ export interface IMessageForward {
170
+ forward_id: string;
171
+ /** Ponte para o item do lote (o status-processor reflete falha assíncrona por aqui). */
172
+ item_id: string;
173
+ /** Vazio no item `intro`: o front não mostra selo quando está vazio. */
174
+ source_message_id: string;
175
+ source_thread_id: string;
176
+ source_ticket_id: string;
177
+ source_contact_id: string;
178
+ source_contact_name: string;
179
+ source_channel_type: string | null;
180
+ source_direction: "in" | "out";
181
+ source_created_at: Date;
182
+ forwarded_by: IForwardActor;
183
+ forwarded_at: Date;
184
+ /**
185
+ * Destino e-mail: um e-mail agrega N mensagens. `source_message_id`/`item_id`
186
+ * apontam para a 1ª em ordem cronológica; estes trazem todas, na mesma ordem.
187
+ */
188
+ source_message_ids?: string[];
189
+ item_ids?: string[];
190
+ }
191
+ export type ForwardableMessage = Pick<IThreadMessage, "type" | "direction" | "channel_type" | "body" | "media" | "template"> & {
192
+ revoked?: unknown;
193
+ deleted_at?: unknown;
194
+ };
195
+ export type ForwardContentResolution = {
196
+ ok: true;
197
+ kind: ForwardContentKind;
198
+ text?: string;
199
+ } | {
200
+ ok: false;
201
+ reason: ForwardSkipReason;
202
+ };
203
+ /**
204
+ * Decide se uma mensagem pode ser encaminhada e como vira conteúdo no destino.
205
+ *
206
+ * `dest = null` é a checagem agnóstica do modo de seleção no front (sem canal
207
+ * escolhido). Regras que dependem do destino: documento não vai para Instagram;
208
+ * áudio e vídeo não vão para e-mail. O teto de tamanho e o MIME aceito como
209
+ * anexo NÃO ficam aqui: dependem do objeto no Storage e da allowlist do provider.
210
+ */
211
+ export declare function resolveForwardContent(m: ForwardableMessage, dest: ForwardDestinationKind | null): ForwardContentResolution;
212
+ /** Id determinístico do item: um destinatário aparece uma vez no lote, então é único. */
213
+ export declare function buildForwardItemId(recipientThreadId: string, messageId: string | null): string;