evo360-types 1.3.634 → 1.3.637

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.
Files changed (61) hide show
  1. package/dist/apps/evo-activity/zod-schemas.d.ts +6 -6
  2. package/dist/apps/evo-chat/chatbee/zod-schemas.d.ts +6 -6
  3. package/dist/apps/evo-chat/contact/zod-schemas.d.ts +6 -6
  4. package/dist/apps/evo-chat/dic/ticket-close/zod-schemas.d.ts +12 -12
  5. package/dist/apps/evo-chat/message/zod-schemas.d.ts +6 -6
  6. package/dist/apps/evo-crm/dic/zod-schemas.d.ts +70 -18
  7. package/dist/apps/evo-crm/dic/zod-schemas.js +17 -1
  8. package/dist/apps/evo-crm/dic/zod-schemas.ts +20 -0
  9. package/dist/apps/evo-crm/lead/zod-schemas.d.ts +240 -6
  10. package/dist/apps/evo-crm/lead/zod-schemas.js +6 -0
  11. package/dist/apps/evo-crm/lead/zod-schemas.ts +6 -0
  12. package/dist/apps/evo-csq/zod-schemas.d.ts +52 -52
  13. package/dist/apps/evo-finops/zod-schemas.d.ts +439 -7
  14. package/dist/apps/evo-hub-ia/channel/zod-schemas.d.ts +2 -2
  15. package/dist/apps/evo-hub-ia/v1/zod-schemas.d.ts +28 -28
  16. package/dist/apps/evo-integrations/zod-schemas.d.ts +24 -16
  17. package/dist/apps/evo-integrations/zod-schemas.js +8 -1
  18. package/dist/apps/evo-integrations/zod-schemas.ts +9 -0
  19. package/dist/apps/evo-med/appointment/zod-schemas.d.ts +83 -6
  20. package/dist/apps/evo-med/appointment/zod-schemas.js +19 -1
  21. package/dist/apps/evo-med/appointment/zod-schemas.ts +21 -0
  22. package/dist/apps/evo-med/calendar/zod-schemas.d.ts +6 -6
  23. package/dist/apps/evo-med/dic/zod-schemas.d.ts +14 -14
  24. package/dist/apps/evo-med/insurance/zod-schemas.d.ts +6 -6
  25. package/dist/apps/evo-med/people/zod-schemas.d.ts +1118 -20
  26. package/dist/apps/evo-med/people/zod-schemas.js +6 -0
  27. package/dist/apps/evo-med/people/zod-schemas.ts +6 -0
  28. package/dist/apps/evo-med/procedure/zod-schemas.d.ts +12 -12
  29. package/dist/apps/evo-notif-user/zod-schemas.d.ts +18 -18
  30. package/dist/apps/evo-notifications/zod-schemas.d.ts +936 -0
  31. package/dist/apps/evo-people/zod-schemas.d.ts +24 -24
  32. package/dist/apps/evo-survey/zod-schemas.d.ts +79 -79
  33. package/dist/apps/evo-task/zod-schemas.d.ts +453 -78
  34. package/dist/apps/evo-task/zod-schemas.js +66 -1
  35. package/dist/apps/evo-task/zod-schemas.ts +71 -0
  36. package/dist/apps/evo-tenant/zod-schemas.d.ts +18 -5
  37. package/dist/apps/evo-tenant/zod-schemas.js +3 -0
  38. package/dist/apps/evo-tenant/zod-schemas.ts +3 -0
  39. package/dist/apps/hub-automation/zod-schemas.d.ts +327 -327
  40. package/dist/apps/shared/zod-schemas.d.ts +3 -3
  41. package/dist/types/evo-crm/dic/index.d.ts +16 -1
  42. package/dist/types/evo-crm/dic/index.ts +23 -1
  43. package/dist/types/evo-crm/fb_collections.d.ts +1 -0
  44. package/dist/types/evo-crm/fb_collections.js +5 -1
  45. package/dist/types/evo-crm/fb_collections.ts +4 -0
  46. package/dist/types/evo-crm/lead/index.d.ts +6 -0
  47. package/dist/types/evo-crm/lead/index.ts +6 -0
  48. package/dist/types/evo-integrations/index.d.ts +16 -0
  49. package/dist/types/evo-integrations/index.js +18 -1
  50. package/dist/types/evo-integrations/index.ts +26 -0
  51. package/dist/types/evo-med/appointment/index.d.ts +22 -0
  52. package/dist/types/evo-med/appointment/index.js +7 -1
  53. package/dist/types/evo-med/appointment/index.ts +30 -0
  54. package/dist/types/evo-med/people/index.d.ts +6 -0
  55. package/dist/types/evo-med/people/index.ts +6 -0
  56. package/dist/types/evo-tenant/index.d.ts +7 -0
  57. package/dist/types/evo-tenant/index.ts +7 -0
  58. package/dist/types/shared/external-links.d.ts +98 -0
  59. package/dist/types/shared/external-links.js +64 -1
  60. package/dist/types/shared/external-links.ts +118 -0
  61. package/package.json +1 -1
@@ -23,11 +23,11 @@ export declare const zHubIAConfigSchema: z.ZodObject<{
23
23
  allow_reply_mode: boolean;
24
24
  transcribe_audio_when_ai_disabled: boolean;
25
25
  suggest_agenda_action: boolean;
26
- task_creation: "disabled" | "suggestion" | "create";
26
+ task_creation: "create" | "disabled" | "suggestion";
27
27
  system_message_prompt: string;
28
28
  }, {
29
29
  default_operation_mode: "reply" | "suggestion";
30
- task_creation: "disabled" | "suggestion" | "create";
30
+ task_creation: "create" | "disabled" | "suggestion";
31
31
  system_message_prompt: string;
32
32
  active?: boolean | undefined;
33
33
  enabled_for_new_contacts?: boolean | undefined;
@@ -518,21 +518,21 @@ export declare const zHubiaScheduleWindowSchema: z.ZodEffects<z.ZodObject<{
518
518
  start: z.ZodString;
519
519
  end: z.ZodString;
520
520
  }, "strip", z.ZodTypeAny, {
521
- day: number;
522
521
  start: string;
523
522
  end: string;
524
- }, {
525
523
  day: number;
524
+ }, {
526
525
  start: string;
527
526
  end: string;
528
- }>, {
529
527
  day: number;
528
+ }>, {
530
529
  start: string;
531
530
  end: string;
532
- }, {
533
531
  day: number;
532
+ }, {
534
533
  start: string;
535
534
  end: string;
535
+ day: number;
536
536
  }>;
537
537
  /** Agenda semanal — lista de janelas + timezone opcional.
538
538
  * Quando `timezone` ausente, runtime usa a do tenant (`/tenants/{tenant}.timezone`,
@@ -543,35 +543,35 @@ export declare const zHubiaScheduleSchema: z.ZodObject<{
543
543
  start: z.ZodString;
544
544
  end: z.ZodString;
545
545
  }, "strip", z.ZodTypeAny, {
546
- day: number;
547
546
  start: string;
548
547
  end: string;
549
- }, {
550
548
  day: number;
549
+ }, {
551
550
  start: string;
552
551
  end: string;
553
- }>, {
554
552
  day: number;
553
+ }>, {
555
554
  start: string;
556
555
  end: string;
557
- }, {
558
556
  day: number;
557
+ }, {
559
558
  start: string;
560
559
  end: string;
560
+ day: number;
561
561
  }>, "many">;
562
562
  timezone: z.ZodOptional<z.ZodString>;
563
563
  }, "strip", z.ZodTypeAny, {
564
564
  windows: {
565
- day: number;
566
565
  start: string;
567
566
  end: string;
567
+ day: number;
568
568
  }[];
569
569
  timezone?: string | undefined;
570
570
  }, {
571
571
  windows: {
572
- day: number;
573
572
  start: string;
574
573
  end: string;
574
+ day: number;
575
575
  }[];
576
576
  timezone?: string | undefined;
577
577
  }>;
@@ -746,35 +746,35 @@ export declare const zCreateTaskActionInputSchema: z.ZodObject<{
746
746
  start: z.ZodString;
747
747
  end: z.ZodString;
748
748
  }, "strip", z.ZodTypeAny, {
749
- day: number;
750
749
  start: string;
751
750
  end: string;
752
- }, {
753
751
  day: number;
752
+ }, {
754
753
  start: string;
755
754
  end: string;
756
- }>, {
757
755
  day: number;
756
+ }>, {
758
757
  start: string;
759
758
  end: string;
760
- }, {
761
759
  day: number;
760
+ }, {
762
761
  start: string;
763
762
  end: string;
763
+ day: number;
764
764
  }>, "many">;
765
765
  timezone: z.ZodOptional<z.ZodString>;
766
766
  }, "strip", z.ZodTypeAny, {
767
767
  windows: {
768
- day: number;
769
768
  start: string;
770
769
  end: string;
770
+ day: number;
771
771
  }[];
772
772
  timezone?: string | undefined;
773
773
  }, {
774
774
  windows: {
775
- day: number;
776
775
  start: string;
777
776
  end: string;
777
+ day: number;
778
778
  }[];
779
779
  timezone?: string | undefined;
780
780
  }>>;
@@ -803,35 +803,35 @@ export declare const zCreateTaskActionInputSchema: z.ZodObject<{
803
803
  start: z.ZodString;
804
804
  end: z.ZodString;
805
805
  }, "strip", z.ZodTypeAny, {
806
- day: number;
807
806
  start: string;
808
807
  end: string;
809
- }, {
810
808
  day: number;
809
+ }, {
811
810
  start: string;
812
811
  end: string;
813
- }>, {
814
812
  day: number;
813
+ }>, {
815
814
  start: string;
816
815
  end: string;
817
- }, {
818
816
  day: number;
817
+ }, {
819
818
  start: string;
820
819
  end: string;
820
+ day: number;
821
821
  }>, "many">;
822
822
  timezone: z.ZodOptional<z.ZodString>;
823
823
  }, "strip", z.ZodTypeAny, {
824
824
  windows: {
825
- day: number;
826
825
  start: string;
827
826
  end: string;
827
+ day: number;
828
828
  }[];
829
829
  timezone?: string | undefined;
830
830
  }, {
831
831
  windows: {
832
- day: number;
833
832
  start: string;
834
833
  end: string;
834
+ day: number;
835
835
  }[];
836
836
  timezone?: string | undefined;
837
837
  }>>;
@@ -860,35 +860,35 @@ export declare const zCreateTaskActionInputSchema: z.ZodObject<{
860
860
  start: z.ZodString;
861
861
  end: z.ZodString;
862
862
  }, "strip", z.ZodTypeAny, {
863
- day: number;
864
863
  start: string;
865
864
  end: string;
866
- }, {
867
865
  day: number;
866
+ }, {
868
867
  start: string;
869
868
  end: string;
870
- }>, {
871
869
  day: number;
870
+ }>, {
872
871
  start: string;
873
872
  end: string;
874
- }, {
875
873
  day: number;
874
+ }, {
876
875
  start: string;
877
876
  end: string;
877
+ day: number;
878
878
  }>, "many">;
879
879
  timezone: z.ZodOptional<z.ZodString>;
880
880
  }, "strip", z.ZodTypeAny, {
881
881
  windows: {
882
- day: number;
883
882
  start: string;
884
883
  end: string;
884
+ day: number;
885
885
  }[];
886
886
  timezone?: string | undefined;
887
887
  }, {
888
888
  windows: {
889
- day: number;
890
889
  start: string;
891
890
  end: string;
891
+ day: number;
892
892
  }[];
893
893
  timezone?: string | undefined;
894
894
  }>>;
@@ -408,9 +408,9 @@ export declare const zIntegrationsAdapterDocSchema: z.ZodObject<{
408
408
  }, "strip", z.ZodTypeAny, {
409
409
  name: string;
410
410
  id: string;
411
+ status: "active" | "disabled" | "beta";
411
412
  tenant: string;
412
413
  model_ver: number;
413
- status: "active" | "disabled" | "beta";
414
414
  category: "clinic-agenda" | "prontuario" | "misc";
415
415
  adapter_version: string;
416
416
  default_workflow_urls: Partial<Record<"patient.list" | "patient.get" | "appointment.list" | "appointment.create" | "appointment.get" | "appointment.update" | "appointment.confirm" | "appointment.revert_confirm" | "appointment.cancel" | "patient.create" | "patient.update" | "appointment.reschedule" | "patient.document.upload" | "payment.update" | "sync.appointments", string>>;
@@ -458,14 +458,14 @@ export declare const zIntegrationsAdapterDocSchema: z.ZodObject<{
458
458
  }, {
459
459
  name: string;
460
460
  id: string;
461
- tenant: string;
462
461
  status: "active" | "disabled" | "beta";
462
+ tenant: string;
463
463
  category: "clinic-agenda" | "prontuario" | "misc";
464
464
  adapter_version: string;
465
465
  supported_capabilities: ("patient.list" | "patient.get" | "appointment.list" | "appointment.create" | "appointment.get" | "appointment.update" | "appointment.confirm" | "appointment.revert_confirm" | "appointment.cancel" | "patient.create" | "patient.update" | "appointment.reschedule" | "patient.document.upload" | "payment.update" | "sync.appointments")[];
466
466
  ref?: any;
467
- model_ver?: number | undefined;
468
467
  created_at?: Date | null | undefined;
468
+ model_ver?: number | undefined;
469
469
  updated_at?: Date | null | undefined;
470
470
  deleted_at?: Date | null | undefined;
471
471
  description?: string | undefined;
@@ -525,9 +525,9 @@ export declare const zIntegrationsCredentialSchema: z.ZodObject<{
525
525
  }, "strip", z.ZodTypeAny, {
526
526
  name: string;
527
527
  id: string;
528
+ status: "active" | "paused" | "revoked";
528
529
  tenant: string;
529
530
  model_ver: number;
530
- status: "active" | "paused" | "revoked";
531
531
  adapter_id: string;
532
532
  secret_ref: string;
533
533
  config?: Record<string, any> | undefined;
@@ -544,11 +544,11 @@ export declare const zIntegrationsCredentialSchema: z.ZodObject<{
544
544
  secret_ref: string;
545
545
  config?: Record<string, any> | undefined;
546
546
  ref?: any;
547
- model_ver?: number | undefined;
547
+ status?: "active" | "paused" | "revoked" | undefined;
548
548
  created_at?: Date | null | undefined;
549
+ model_ver?: number | undefined;
549
550
  updated_at?: Date | null | undefined;
550
551
  deleted_at?: Date | null | undefined;
551
- status?: "active" | "paused" | "revoked" | undefined;
552
552
  last_used_at?: Date | null | undefined;
553
553
  }>;
554
554
  export declare const zSyncWindowTypeSchema: z.ZodEnum<["hot", "warm", "recent_reconcile", "cold"]>;
@@ -648,8 +648,8 @@ export declare const zSyncStateSchema: z.ZodObject<{
648
648
  appointments?: Record<string, string> | undefined;
649
649
  };
650
650
  ref?: any;
651
- model_ver?: number | undefined;
652
651
  created_at?: Date | null | undefined;
652
+ model_ver?: number | undefined;
653
653
  updated_at?: Date | null | undefined;
654
654
  deleted_at?: Date | null | undefined;
655
655
  last_sync_at?: Date | null | undefined;
@@ -711,8 +711,8 @@ export declare const zSyncRunEventSchema: z.ZodObject<{
711
711
  details?: Record<string, any> | undefined;
712
712
  }>, "many">>;
713
713
  }, "strip", z.ZodTypeAny, {
714
+ status: "error" | "success" | "partial";
714
715
  tenant: string;
715
- status: "success" | "error" | "partial";
716
716
  started_at: Date;
717
717
  finished_at: Date;
718
718
  duration_ms: number;
@@ -728,16 +728,16 @@ export declare const zSyncRunEventSchema: z.ZodObject<{
728
728
  firestore_reads: number;
729
729
  firestore_writes: number;
730
730
  n8n_calls: number;
731
+ coveredWindow_start?: Date | undefined;
732
+ coveredWindow_end?: Date | undefined;
731
733
  errors?: {
732
734
  message: string;
733
735
  code?: string | undefined;
734
736
  details?: Record<string, any> | undefined;
735
737
  }[] | undefined;
736
- coveredWindow_start?: Date | undefined;
737
- coveredWindow_end?: Date | undefined;
738
738
  }, {
739
+ status: "error" | "success" | "partial";
739
740
  tenant: string;
740
- status: "success" | "error" | "partial";
741
741
  started_at: Date;
742
742
  finished_at: Date;
743
743
  adapter_id: string;
@@ -745,11 +745,6 @@ export declare const zSyncRunEventSchema: z.ZodObject<{
745
745
  run_id: string;
746
746
  window_type: "hot" | "warm" | "recent_reconcile" | "cold";
747
747
  duration_ms?: number | undefined;
748
- errors?: {
749
- message: string;
750
- code?: string | undefined;
751
- details?: Record<string, any> | undefined;
752
- }[] | undefined;
753
748
  patients_upserted?: number | undefined;
754
749
  appointments_upserted?: number | undefined;
755
750
  appointments_skipped?: number | undefined;
@@ -760,6 +755,11 @@ export declare const zSyncRunEventSchema: z.ZodObject<{
760
755
  firestore_reads?: number | undefined;
761
756
  firestore_writes?: number | undefined;
762
757
  n8n_calls?: number | undefined;
758
+ errors?: {
759
+ message: string;
760
+ code?: string | undefined;
761
+ details?: Record<string, any> | undefined;
762
+ }[] | undefined;
763
763
  }>;
764
764
  export declare const zMedCalendarIntegrationSchema: z.ZodObject<{
765
765
  adapter_id: z.ZodString;
@@ -1025,3 +1025,11 @@ export declare const zMedCalendarIntegrationSchema: z.ZodObject<{
1025
1025
  } | null | undefined;
1026
1026
  workflow_overrides?: Partial<Record<"patient.list" | "patient.get" | "appointment.list" | "appointment.create" | "appointment.get" | "appointment.update" | "appointment.confirm" | "appointment.revert_confirm" | "appointment.cancel" | "patient.create" | "patient.update" | "appointment.reschedule" | "patient.document.upload" | "payment.update" | "sync.appointments", string>> | undefined;
1027
1027
  }>;
1028
+ export declare const zLinkModeSchema: z.ZodEnum<["off", "shadow", "write"]>;
1029
+ export declare const zTenantIntegrationsConfigSchema: z.ZodObject<{
1030
+ link_mode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["off", "shadow", "write"]>>>;
1031
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1032
+ link_mode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["off", "shadow", "write"]>>>;
1033
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1034
+ link_mode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["off", "shadow", "write"]>>>;
1035
+ }, z.ZodTypeAny, "passthrough">>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zMedCalendarIntegrationSchema = exports.zSyncRunEventSchema = exports.zSyncRunEventErrorSchema = exports.zSyncStateSchema = exports.zSyncedHashesSchema = exports.zCoveredWindowSchema = exports.zSyncWindowTypeSchema = exports.zIntegrationsCredentialSchema = exports.zIntegrationsAdapterDocSchema = exports.zSyncConfigSchema = exports.zSyncWindowConfigSchema = exports.zCapabilityNameSchema = void 0;
3
+ exports.zTenantIntegrationsConfigSchema = exports.zLinkModeSchema = exports.zMedCalendarIntegrationSchema = exports.zSyncRunEventSchema = exports.zSyncRunEventErrorSchema = exports.zSyncStateSchema = exports.zSyncedHashesSchema = exports.zCoveredWindowSchema = exports.zSyncWindowTypeSchema = exports.zIntegrationsCredentialSchema = exports.zIntegrationsAdapterDocSchema = exports.zSyncConfigSchema = exports.zSyncWindowConfigSchema = exports.zCapabilityNameSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../shared/zod-schemas");
6
6
  // ----- Capability name (mantém sincronizado com CapabilityName em types/evo-integrations/index.ts)
@@ -134,3 +134,10 @@ exports.zMedCalendarIntegrationSchema = zod_1.z.object({
134
134
  .record(exports.zCapabilityNameSchema, zod_1.z.string().url())
135
135
  .optional(),
136
136
  });
137
+ // ----- feat-193: config de integração do tenant (`ITenant.integrations`)
138
+ exports.zLinkModeSchema = zod_1.z.enum(["off", "shadow", "write"]);
139
+ exports.zTenantIntegrationsConfigSchema = zod_1.z
140
+ .object({
141
+ link_mode: exports.zLinkModeSchema.nullable().optional(),
142
+ })
143
+ .passthrough();
@@ -147,3 +147,12 @@ export const zMedCalendarIntegrationSchema = z.object({
147
147
  .record(zCapabilityNameSchema, z.string().url())
148
148
  .optional(),
149
149
  });
150
+
151
+ // ----- feat-193: config de integração do tenant (`ITenant.integrations`)
152
+ export const zLinkModeSchema = z.enum(["off", "shadow", "write"]);
153
+
154
+ export const zTenantIntegrationsConfigSchema = z
155
+ .object({
156
+ link_mode: zLinkModeSchema.nullable().optional(),
157
+ })
158
+ .passthrough();
@@ -332,6 +332,26 @@ export declare const zAppointmentSpecialtySchema: z.ZodObject<{
332
332
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
333
  specialtyRef: z.ZodOptional<z.ZodAny>;
334
334
  }, z.ZodTypeAny, "passthrough">>;
335
+ export declare const zAppointmentRequestedBySourceSchema: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
336
+ export declare const zAppointmentRequestedBySchema: z.ZodObject<{
337
+ lead_id: z.ZodNullable<z.ZodString>;
338
+ chat_contact_id: z.ZodNullable<z.ZodString>;
339
+ ticket_id: z.ZodNullable<z.ZodString>;
340
+ display_name: z.ZodNullable<z.ZodString>;
341
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
342
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
343
+ lead_id: z.ZodNullable<z.ZodString>;
344
+ chat_contact_id: z.ZodNullable<z.ZodString>;
345
+ ticket_id: z.ZodNullable<z.ZodString>;
346
+ display_name: z.ZodNullable<z.ZodString>;
347
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
348
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
349
+ lead_id: z.ZodNullable<z.ZodString>;
350
+ chat_contact_id: z.ZodNullable<z.ZodString>;
351
+ ticket_id: z.ZodNullable<z.ZodString>;
352
+ display_name: z.ZodNullable<z.ZodString>;
353
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
354
+ }, z.ZodTypeAny, "passthrough">>;
335
355
  export declare const zAppointmentSchema: z.ZodObject<{
336
356
  id: z.ZodString;
337
357
  ref: z.ZodAny;
@@ -660,6 +680,25 @@ export declare const zAppointmentSchema: z.ZodObject<{
660
680
  draftExpirationMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
661
681
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
662
682
  status_external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
683
+ requested_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
684
+ lead_id: z.ZodNullable<z.ZodString>;
685
+ chat_contact_id: z.ZodNullable<z.ZodString>;
686
+ ticket_id: z.ZodNullable<z.ZodString>;
687
+ display_name: z.ZodNullable<z.ZodString>;
688
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
689
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
690
+ lead_id: z.ZodNullable<z.ZodString>;
691
+ chat_contact_id: z.ZodNullable<z.ZodString>;
692
+ ticket_id: z.ZodNullable<z.ZodString>;
693
+ display_name: z.ZodNullable<z.ZodString>;
694
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
695
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
696
+ lead_id: z.ZodNullable<z.ZodString>;
697
+ chat_contact_id: z.ZodNullable<z.ZodString>;
698
+ ticket_id: z.ZodNullable<z.ZodString>;
699
+ display_name: z.ZodNullable<z.ZodString>;
700
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
701
+ }, z.ZodTypeAny, "passthrough">>>>;
663
702
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
664
703
  name: z.ZodString;
665
704
  color: z.ZodOptional<z.ZodString>;
@@ -670,14 +709,14 @@ export declare const zAppointmentSchema: z.ZodObject<{
670
709
  name: string;
671
710
  hidden: boolean;
672
711
  base?: boolean | undefined;
673
- color?: string | undefined;
674
712
  category?: string | null | undefined;
713
+ color?: string | undefined;
675
714
  }, {
676
715
  name: string;
677
716
  hidden: boolean;
678
717
  base?: boolean | undefined;
679
- color?: string | undefined;
680
718
  category?: string | null | undefined;
719
+ color?: string | undefined;
681
720
  }>, "many">>>;
682
721
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
683
722
  id: z.ZodString;
@@ -1007,6 +1046,25 @@ export declare const zAppointmentSchema: z.ZodObject<{
1007
1046
  draftExpirationMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1008
1047
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1009
1048
  status_external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1049
+ requested_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1050
+ lead_id: z.ZodNullable<z.ZodString>;
1051
+ chat_contact_id: z.ZodNullable<z.ZodString>;
1052
+ ticket_id: z.ZodNullable<z.ZodString>;
1053
+ display_name: z.ZodNullable<z.ZodString>;
1054
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
1055
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1056
+ lead_id: z.ZodNullable<z.ZodString>;
1057
+ chat_contact_id: z.ZodNullable<z.ZodString>;
1058
+ ticket_id: z.ZodNullable<z.ZodString>;
1059
+ display_name: z.ZodNullable<z.ZodString>;
1060
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
1061
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1062
+ lead_id: z.ZodNullable<z.ZodString>;
1063
+ chat_contact_id: z.ZodNullable<z.ZodString>;
1064
+ ticket_id: z.ZodNullable<z.ZodString>;
1065
+ display_name: z.ZodNullable<z.ZodString>;
1066
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
1067
+ }, z.ZodTypeAny, "passthrough">>>>;
1010
1068
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1011
1069
  name: z.ZodString;
1012
1070
  color: z.ZodOptional<z.ZodString>;
@@ -1017,14 +1075,14 @@ export declare const zAppointmentSchema: z.ZodObject<{
1017
1075
  name: string;
1018
1076
  hidden: boolean;
1019
1077
  base?: boolean | undefined;
1020
- color?: string | undefined;
1021
1078
  category?: string | null | undefined;
1079
+ color?: string | undefined;
1022
1080
  }, {
1023
1081
  name: string;
1024
1082
  hidden: boolean;
1025
1083
  base?: boolean | undefined;
1026
- color?: string | undefined;
1027
1084
  category?: string | null | undefined;
1085
+ color?: string | undefined;
1028
1086
  }>, "many">>>;
1029
1087
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1030
1088
  id: z.ZodString;
@@ -1354,6 +1412,25 @@ export declare const zAppointmentSchema: z.ZodObject<{
1354
1412
  draftExpirationMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1355
1413
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1356
1414
  status_external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1415
+ requested_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1416
+ lead_id: z.ZodNullable<z.ZodString>;
1417
+ chat_contact_id: z.ZodNullable<z.ZodString>;
1418
+ ticket_id: z.ZodNullable<z.ZodString>;
1419
+ display_name: z.ZodNullable<z.ZodString>;
1420
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
1421
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1422
+ lead_id: z.ZodNullable<z.ZodString>;
1423
+ chat_contact_id: z.ZodNullable<z.ZodString>;
1424
+ ticket_id: z.ZodNullable<z.ZodString>;
1425
+ display_name: z.ZodNullable<z.ZodString>;
1426
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
1427
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1428
+ lead_id: z.ZodNullable<z.ZodString>;
1429
+ chat_contact_id: z.ZodNullable<z.ZodString>;
1430
+ ticket_id: z.ZodNullable<z.ZodString>;
1431
+ display_name: z.ZodNullable<z.ZodString>;
1432
+ source: z.ZodEnum<["ui_omni", "ui_calendar", "hubia", "mcp"]>;
1433
+ }, z.ZodTypeAny, "passthrough">>>>;
1357
1434
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1358
1435
  name: z.ZodString;
1359
1436
  color: z.ZodOptional<z.ZodString>;
@@ -1364,14 +1441,14 @@ export declare const zAppointmentSchema: z.ZodObject<{
1364
1441
  name: string;
1365
1442
  hidden: boolean;
1366
1443
  base?: boolean | undefined;
1367
- color?: string | undefined;
1368
1444
  category?: string | null | undefined;
1445
+ color?: string | undefined;
1369
1446
  }, {
1370
1447
  name: string;
1371
1448
  hidden: boolean;
1372
1449
  base?: boolean | undefined;
1373
- color?: string | undefined;
1374
1450
  category?: string | null | undefined;
1451
+ color?: string | undefined;
1375
1452
  }>, "many">>>;
1376
1453
  }, z.ZodTypeAny, "passthrough">>;
1377
1454
  export declare const zPatientAppointmentSchema: z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zPatientAppointmentSchema = exports.zAppointmentSchema = exports.zAppointmentSpecialtySchema = exports.zAppointmentRescheduleSchema = exports.zAppointmentAppointmentSourceSchema = exports.zAppointmentAppointmentRequestTypeSchema = exports.zAppointmentProcedureSchema = exports.zAppointmentPaymentSchema = exports.zAppointmentPaymentInvoiceRefSchema = exports.zAppointmentInsuranceSchema = exports.zAppointmentProfessionalSchema = exports.zAppointmentPatientSchema = exports.zAppointmentAddressSchema = exports.zAppointmentTypeBaseSchema = exports.zAppointmentTelemedicineSchema = exports.zTelemedicineProviderSchema = exports.zAppointmentModeSchema = exports.zAppointmentStatusTypeSchema = exports.zAppointmentPaymentStatusSchema = void 0;
3
+ exports.zPatientAppointmentSchema = exports.zAppointmentSchema = exports.zAppointmentRequestedBySchema = exports.zAppointmentRequestedBySourceSchema = exports.zAppointmentSpecialtySchema = exports.zAppointmentRescheduleSchema = exports.zAppointmentAppointmentSourceSchema = exports.zAppointmentAppointmentRequestTypeSchema = exports.zAppointmentProcedureSchema = exports.zAppointmentPaymentSchema = exports.zAppointmentPaymentInvoiceRefSchema = exports.zAppointmentInsuranceSchema = exports.zAppointmentProfessionalSchema = exports.zAppointmentPatientSchema = exports.zAppointmentAddressSchema = exports.zAppointmentTypeBaseSchema = exports.zAppointmentTelemedicineSchema = exports.zTelemedicineProviderSchema = exports.zAppointmentModeSchema = exports.zAppointmentStatusTypeSchema = exports.zAppointmentPaymentStatusSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../../shared/zod-schemas");
6
6
  // Enums para validação
@@ -183,6 +183,22 @@ exports.zAppointmentSpecialtySchema = zod_1.z
183
183
  specialtyRef: zod_1.z.any().optional(), // FirestoreDocumentReference
184
184
  })
185
185
  .passthrough();
186
+ // feat-193 F4 — quem pediu o agendamento (lead da conversa no omni, HubIA, MCP).
187
+ exports.zAppointmentRequestedBySourceSchema = zod_1.z.enum([
188
+ "ui_omni",
189
+ "ui_calendar",
190
+ "hubia",
191
+ "mcp",
192
+ ]);
193
+ exports.zAppointmentRequestedBySchema = zod_1.z
194
+ .object({
195
+ lead_id: zod_1.z.string().nullable(),
196
+ chat_contact_id: zod_1.z.string().nullable(),
197
+ ticket_id: zod_1.z.string().nullable(),
198
+ display_name: zod_1.z.string().nullable(),
199
+ source: exports.zAppointmentRequestedBySourceSchema,
200
+ })
201
+ .passthrough();
186
202
  // Schema principal do Appointment
187
203
  exports.zAppointmentSchema = zod_schemas_1.zFireDocSchema
188
204
  .extend({
@@ -230,6 +246,8 @@ exports.zAppointmentSchema = zod_schemas_1.zFireDocSchema
230
246
  // puro, um `4` faria o write-through reprovar com `contract_violation`.
231
247
  // Nullable/optional resolvem ANTES da coerção — `null` continua `null`.
232
248
  status_external_id: zod_1.z.coerce.string().nullable().optional(),
249
+ // feat-193 F4 — solicitante. Local (a agenda externa não conhece o campo).
250
+ requested_by: exports.zAppointmentRequestedBySchema.nullable().optional(),
233
251
  tags: zod_1.z.array(zod_schemas_1.zTagSchema).nullable().optional(),
234
252
  })
235
253
  .passthrough();
@@ -202,6 +202,24 @@ export const zAppointmentSpecialtySchema = z
202
202
  })
203
203
  .passthrough();
204
204
 
205
+ // feat-193 F4 — quem pediu o agendamento (lead da conversa no omni, HubIA, MCP).
206
+ export const zAppointmentRequestedBySourceSchema = z.enum([
207
+ "ui_omni",
208
+ "ui_calendar",
209
+ "hubia",
210
+ "mcp",
211
+ ]);
212
+
213
+ export const zAppointmentRequestedBySchema = z
214
+ .object({
215
+ lead_id: z.string().nullable(),
216
+ chat_contact_id: z.string().nullable(),
217
+ ticket_id: z.string().nullable(),
218
+ display_name: z.string().nullable(),
219
+ source: zAppointmentRequestedBySourceSchema,
220
+ })
221
+ .passthrough();
222
+
205
223
  // Schema principal do Appointment
206
224
  export const zAppointmentSchema = zFireDocSchema
207
225
  .extend({
@@ -254,6 +272,9 @@ export const zAppointmentSchema = zFireDocSchema
254
272
  // Nullable/optional resolvem ANTES da coerção — `null` continua `null`.
255
273
  status_external_id: z.coerce.string().nullable().optional(),
256
274
 
275
+ // feat-193 F4 — solicitante. Local (a agenda externa não conhece o campo).
276
+ requested_by: zAppointmentRequestedBySchema.nullable().optional(),
277
+
257
278
  tags: z.array(zTagSchema).nullable().optional(),
258
279
  })
259
280
  .passthrough();
@@ -1493,14 +1493,14 @@ export declare const zMedCalendarSchema: z.ZodObject<{
1493
1493
  name: string;
1494
1494
  hidden: boolean;
1495
1495
  base?: boolean | undefined;
1496
- color?: string | undefined;
1497
1496
  category?: string | null | undefined;
1497
+ color?: string | undefined;
1498
1498
  }, {
1499
1499
  name: string;
1500
1500
  hidden: boolean;
1501
1501
  base?: boolean | undefined;
1502
- color?: string | undefined;
1503
1502
  category?: string | null | undefined;
1503
+ color?: string | undefined;
1504
1504
  }>, "many">>>;
1505
1505
  userRef: z.ZodAny;
1506
1506
  appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -3244,14 +3244,14 @@ export declare const zMedCalendarSchema: z.ZodObject<{
3244
3244
  name: string;
3245
3245
  hidden: boolean;
3246
3246
  base?: boolean | undefined;
3247
- color?: string | undefined;
3248
3247
  category?: string | null | undefined;
3248
+ color?: string | undefined;
3249
3249
  }, {
3250
3250
  name: string;
3251
3251
  hidden: boolean;
3252
3252
  base?: boolean | undefined;
3253
- color?: string | undefined;
3254
3253
  category?: string | null | undefined;
3254
+ color?: string | undefined;
3255
3255
  }>, "many">>>;
3256
3256
  userRef: z.ZodAny;
3257
3257
  appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -4995,14 +4995,14 @@ export declare const zMedCalendarSchema: z.ZodObject<{
4995
4995
  name: string;
4996
4996
  hidden: boolean;
4997
4997
  base?: boolean | undefined;
4998
- color?: string | undefined;
4999
4998
  category?: string | null | undefined;
4999
+ color?: string | undefined;
5000
5000
  }, {
5001
5001
  name: string;
5002
5002
  hidden: boolean;
5003
5003
  base?: boolean | undefined;
5004
- color?: string | undefined;
5005
5004
  category?: string | null | undefined;
5005
+ color?: string | undefined;
5006
5006
  }>, "many">>>;
5007
5007
  userRef: z.ZodAny;
5008
5008
  appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{