@kl1/contracts 1.0.30 → 1.0.32

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 (54) hide show
  1. package/dist/index.js +1649 -1713
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +1647 -1711
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/src/app/index.d.ts +17 -0
  6. package/dist/src/app/index.d.ts.map +1 -0
  7. package/dist/src/channel/index.d.ts +20 -200
  8. package/dist/src/channel/index.d.ts.map +1 -1
  9. package/dist/src/channel/validation.d.ts +12 -6
  10. package/dist/src/channel/validation.d.ts.map +1 -1
  11. package/dist/src/chat/index.d.ts +32 -32
  12. package/dist/src/chat/index.d.ts.map +1 -1
  13. package/dist/src/chat/schema.d.ts +4 -4
  14. package/dist/src/chat/schema.d.ts.map +1 -1
  15. package/dist/src/chat/validation.d.ts +57 -168
  16. package/dist/src/chat/validation.d.ts.map +1 -1
  17. package/dist/src/company/index.d.ts +5 -8
  18. package/dist/src/company/index.d.ts.map +1 -1
  19. package/dist/src/company/schema.d.ts +0 -137
  20. package/dist/src/company/schema.d.ts.map +1 -1
  21. package/dist/src/contact/index.d.ts +1103 -1103
  22. package/dist/src/contract.d.ts +1835 -2012
  23. package/dist/src/contract.d.ts.map +1 -1
  24. package/dist/src/dashboard/index.d.ts +7 -11
  25. package/dist/src/dashboard/index.d.ts.map +1 -1
  26. package/dist/src/dashboard/schema.d.ts +2 -127
  27. package/dist/src/dashboard/schema.d.ts.map +1 -1
  28. package/dist/src/index.d.ts +1 -3
  29. package/dist/src/index.d.ts.map +1 -1
  30. package/dist/src/mail/mail-contract.d.ts +42 -42
  31. package/dist/src/mail/mail-server.d.ts +216 -0
  32. package/dist/src/mail/mail-server.d.ts.map +1 -0
  33. package/dist/src/mail/room-contract.d.ts +42 -42
  34. package/dist/src/mail/schemas/room-validation.schema.d.ts +14 -14
  35. package/dist/src/mail/schemas/room.schema.d.ts +10 -10
  36. package/dist/src/messenger/index.d.ts +703 -1185
  37. package/dist/src/messenger/index.d.ts.map +1 -1
  38. package/dist/src/messenger/validation.d.ts +1 -108
  39. package/dist/src/messenger/validation.d.ts.map +1 -1
  40. package/dist/src/platform-contact/schema.d.ts +30 -0
  41. package/dist/src/platform-contact/schema.d.ts.map +1 -0
  42. package/dist/src/telephony-cdr/index.d.ts +458 -1
  43. package/dist/src/telephony-cdr/index.d.ts.map +1 -1
  44. package/dist/src/telephony-cdr/validation.d.ts +74 -0
  45. package/dist/src/telephony-cdr/validation.d.ts.map +1 -1
  46. package/dist/src/ticket/index.d.ts +342 -207
  47. package/dist/src/ticket/index.d.ts.map +1 -1
  48. package/dist/src/ticket/validation.d.ts +338 -168
  49. package/dist/src/ticket/validation.d.ts.map +1 -1
  50. package/dist/src/widget/index.d.ts +1 -72
  51. package/dist/src/widget/index.d.ts.map +1 -1
  52. package/dist/src/widget/validation.d.ts +0 -10
  53. package/dist/src/widget/validation.d.ts.map +1 -1
  54. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -573,41 +573,9 @@ var categoryContract = initContract4().router(
573
573
  // src/channel/index.ts
574
574
  import { initContract as initContract5 } from "@ts-rest/core";
575
575
 
576
- // src/messenger/validation.ts
577
- import z15 from "zod";
578
- var GetFacebookPagesSchema = z15.object({
579
- data: z15.array(
580
- z15.object({
581
- // biome-ignore lint/style/useNamingConvention: <explanation>
582
- access_token: z15.string(),
583
- category: z15.string(),
584
- // biome-ignore lint/style/useNamingConvention: <explanation>
585
- category_list: z15.array(
586
- z15.object({
587
- id: z15.string(),
588
- name: z15.string()
589
- })
590
- ),
591
- id: z15.string(),
592
- name: z15.string(),
593
- tasks: z15.string().array()
594
- })
595
- ),
596
- paging: z15.object({
597
- cursors: z15.object({
598
- before: z15.string().optional(),
599
- after: z15.string().optional()
600
- })
601
- }).optional()
602
- });
603
- var GetFacebookPagesQuerySchema = z15.object({
604
- accessToken: z15.string(),
605
- userId: z15.string()
606
- });
607
-
608
576
  // src/channel/schema.ts
609
- import z16 from "zod";
610
- var ChannelTypeSchema = z16.enum([
577
+ import z15 from "zod";
578
+ var ChannelTypeSchema = z15.enum([
611
579
  "whatsapp",
612
580
  "messenger",
613
581
  "telegram",
@@ -618,61 +586,45 @@ var ChannelTypeSchema = z16.enum([
618
586
  "lazada",
619
587
  "instagram"
620
588
  ]);
621
- var ChannelStatusTypeSchema = z16.union([
622
- z16.literal(true),
589
+ var ChannelStatusTypeSchema = z15.union([
590
+ z15.literal(true),
623
591
  // on
624
- z16.literal(false)
592
+ z15.literal(false)
625
593
  // off
626
594
  ]);
627
- var ChannelMetadataSchema = z16.object({
628
- id: z16.string(),
629
- name: z16.string(),
630
- accessToken: z16.string(),
631
- additionalCredentials: z16.any().optional()
595
+ var ChannelMetadataSchema = z15.object({
596
+ id: z15.string(),
597
+ name: z15.string(),
598
+ accessToken: z15.string(),
599
+ additionalCredentials: z15.any().optional()
632
600
  });
633
601
  var ChannelSchema = DefaultEntitySchema.extend({
634
- name: z16.string(),
602
+ name: z15.string(),
635
603
  type: ChannelTypeSchema,
636
604
  metadata: ChannelMetadataSchema,
637
- brandName: z16.string(),
638
- platformId: z16.string(),
605
+ brandName: z15.string(),
606
+ platformId: z15.string(),
639
607
  status: ChannelStatusTypeSchema,
640
- isReloginRequired: z16.boolean(),
641
- connectedUserName: z16.string(),
642
- connectedUserId: z16.string(),
608
+ isReloginRequired: z15.boolean(),
609
+ connectedUserName: z15.string(),
610
+ connectedUserId: z15.string(),
643
611
  actor: UserSchema
644
612
  }).partial().optional();
645
613
 
646
614
  // src/channel/validation.ts
647
- import z17 from "zod";
648
- var ConnectChannelSchema = z17.object({
649
- name: z17.string(),
615
+ import z16 from "zod";
616
+ var ConnectChannelSchema = z16.object({
617
+ name: z16.string(),
650
618
  type: ChannelTypeSchema,
651
619
  metadata: ChannelMetadataSchema,
652
- platformId: z17.string(),
653
- connectedUserId: z17.string(),
654
- actor: UserSchema.optional()
620
+ platformId: z16.string(),
621
+ brandName: z16.string(),
622
+ connectedUserName: z16.string(),
623
+ connectedUserId: z16.string(),
624
+ actor: UserSchema
655
625
  });
656
626
 
657
627
  // src/channel/index.ts
658
- var messenger = initContract5().router(
659
- {
660
- getPages: {
661
- method: "GET",
662
- path: "/pages",
663
- query: GetFacebookPagesQuerySchema,
664
- responses: {
665
- 200: DefaultSuccessResponseSchema.extend({
666
- data: GetFacebookPagesSchema
667
- }),
668
- 500: DefaultErrorResponseSchema
669
- }
670
- }
671
- },
672
- {
673
- pathPrefix: "/messenger"
674
- }
675
- );
676
628
  var channelContract = initContract5().router(
677
629
  {
678
630
  connectChannel: {
@@ -689,226 +641,224 @@ var channelContract = initContract5().router(
689
641
  },
690
642
  getChannels: {
691
643
  method: "GET",
692
- path: "/",
644
+ path: "/channels",
693
645
  responses: {
694
646
  200: DefaultSuccessResponseSchema.extend({
695
- channels: ChannelSchema.array()
647
+ channels: ChannelSchema
696
648
  })
697
649
  },
698
650
  summary: "Get Channels"
699
- },
700
- messenger
651
+ }
701
652
  },
702
653
  {
703
- baseHeaders: DefaultHeaderSchema,
704
- pathPrefix: "channel"
654
+ baseHeaders: DefaultHeaderSchema
705
655
  }
706
656
  );
707
657
 
708
658
  // src/chat/index.ts
709
659
  import { initContract as initContract6 } from "@ts-rest/core";
710
- import z29 from "zod";
660
+ import z28 from "zod";
711
661
 
712
662
  // src/contact/schema.ts
713
- import z21 from "zod";
663
+ import z20 from "zod";
714
664
 
715
665
  // src/tag/schema.ts
716
- import z18 from "zod";
666
+ import z17 from "zod";
717
667
  var TagSchema = DefaultEntitySchema.extend({
718
- name: z18.string()
668
+ name: z17.string()
719
669
  });
720
- var TagGroupSchema = z18.union([
721
- z18.literal("general"),
722
- z18.literal("contact")
670
+ var TagGroupSchema = z17.union([
671
+ z17.literal("general"),
672
+ z17.literal("contact")
723
673
  ]);
724
674
 
725
675
  // src/company/schema.ts
726
- import z19 from "zod";
676
+ import z18 from "zod";
727
677
  var CompanyCustomFieldSchema = DefaultEntitySchema.extend({
728
- textValue: z19.string().nullable(),
729
- booleanValue: z19.boolean().nullable(),
730
- numberValue: z19.number().nullable(),
731
- dateValue: z19.date().nullable(),
678
+ textValue: z18.string().nullable(),
679
+ booleanValue: z18.boolean().nullable(),
680
+ numberValue: z18.number().nullable(),
681
+ dateValue: z18.date().nullable(),
732
682
  attribute: AttributeSchema.omit({ options: true, group: true })
733
683
  });
734
684
  var CompanySchema = DefaultEntitySchema.extend({
735
- name: z19.string().optional(),
736
- phone: z19.string().nullable().optional(),
737
- address: z19.string().nullable().optional(),
738
- industry: z19.string().nullable().optional(),
739
- customFields: z19.array(CompanyCustomFieldSchema).optional()
685
+ name: z18.string().optional(),
686
+ phone: z18.string().nullable().optional(),
687
+ address: z18.string().nullable().optional(),
688
+ industry: z18.string().nullable().optional(),
689
+ customFields: z18.array(CompanyCustomFieldSchema).optional()
740
690
  });
741
691
 
742
692
  // src/upload/schema.ts
743
- import z20 from "zod";
693
+ import z19 from "zod";
744
694
  var UploadSchema = DefaultEntitySchema.extend({
745
- bucketName: z20.string(),
746
- fileName: z20.string(),
747
- fileSize: z20.number(),
748
- fileKey: z20.string()
695
+ bucketName: z19.string(),
696
+ fileName: z19.string(),
697
+ fileSize: z19.number(),
698
+ fileKey: z19.string()
749
699
  });
750
700
 
751
701
  // src/contact/schema.ts
752
- var ContactPhonesSchema = z21.object({
753
- id: z21.string().uuid(),
754
- createdAt: z21.date(),
755
- updatedAt: z21.date(),
756
- deletedAt: z21.date().nullable(),
757
- phone: z21.string(),
758
- isPrimary: z21.boolean()
759
- });
760
- var ContactEmailsSchema = z21.object({
761
- id: z21.string().uuid(),
762
- createdAt: z21.date(),
763
- updatedAt: z21.date(),
764
- deletedAt: z21.date().nullable(),
765
- email: z21.string(),
766
- isPrimary: z21.boolean()
767
- });
768
- var ContactCustomFieldSchema = z21.object({
769
- id: z21.string().uuid(),
770
- createdAt: z21.date(),
771
- updatedAt: z21.date(),
772
- deletedAt: z21.date().nullable(),
773
- textValue: z21.string().nullable(),
774
- booleanValue: z21.boolean().nullable(),
775
- numberValue: z21.number().nullable(),
776
- dateValue: z21.date().nullable(),
702
+ var ContactPhonesSchema = z20.object({
703
+ id: z20.string().uuid(),
704
+ createdAt: z20.date(),
705
+ updatedAt: z20.date(),
706
+ deletedAt: z20.date().nullable(),
707
+ phone: z20.string(),
708
+ isPrimary: z20.boolean()
709
+ });
710
+ var ContactEmailsSchema = z20.object({
711
+ id: z20.string().uuid(),
712
+ createdAt: z20.date(),
713
+ updatedAt: z20.date(),
714
+ deletedAt: z20.date().nullable(),
715
+ email: z20.string(),
716
+ isPrimary: z20.boolean()
717
+ });
718
+ var ContactCustomFieldSchema = z20.object({
719
+ id: z20.string().uuid(),
720
+ createdAt: z20.date(),
721
+ updatedAt: z20.date(),
722
+ deletedAt: z20.date().nullable(),
723
+ textValue: z20.string().nullable(),
724
+ booleanValue: z20.boolean().nullable(),
725
+ numberValue: z20.number().nullable(),
726
+ dateValue: z20.date().nullable(),
777
727
  attribute: AttributeSchema.omit({ options: true, group: true }),
778
- uploads: z21.array(
728
+ uploads: z20.array(
779
729
  DefaultEntitySchema.extend({
780
- customFieldId: z21.string(),
730
+ customFieldId: z20.string(),
781
731
  upload: UploadSchema
782
732
  })
783
733
  )
784
734
  });
785
- var ContactEntityTypesSchema = z21.object({
786
- id: z21.string().uuid(),
787
- createdAt: z21.date(),
788
- updatedAt: z21.date(),
789
- deletedAt: z21.date().nullable(),
790
- entity: z21.string(),
791
- description: z21.string().nullable()
792
- });
793
- var ContactActivitySchema = z21.object({
794
- id: z21.string().uuid(),
795
- createdAt: z21.date(),
796
- updatedAt: z21.date(),
797
- deletedAt: z21.date().nullable(),
798
- entityId: z21.string(),
799
- description: z21.string(),
735
+ var ContactEntityTypesSchema = z20.object({
736
+ id: z20.string().uuid(),
737
+ createdAt: z20.date(),
738
+ updatedAt: z20.date(),
739
+ deletedAt: z20.date().nullable(),
740
+ entity: z20.string(),
741
+ description: z20.string().nullable()
742
+ });
743
+ var ContactActivitySchema = z20.object({
744
+ id: z20.string().uuid(),
745
+ createdAt: z20.date(),
746
+ updatedAt: z20.date(),
747
+ deletedAt: z20.date().nullable(),
748
+ entityId: z20.string(),
749
+ description: z20.string(),
800
750
  entityType: ContactEntityTypesSchema
801
751
  });
802
- var ContactSchema = z21.object({
803
- id: z21.string().uuid(),
804
- createdAt: z21.date(),
805
- updatedAt: z21.date(),
806
- deletedAt: z21.date().nullable(),
807
- name: z21.string(),
808
- address: z21.string().nullable(),
809
- channel: z21.string().nullable(),
810
- notes: z21.string().nullable(),
811
- contactProfile: z21.string().nullable(),
812
- socialProfileUrl: z21.string().nullable(),
813
- tags: z21.array(TagSchema),
752
+ var ContactSchema = z20.object({
753
+ id: z20.string().uuid(),
754
+ createdAt: z20.date(),
755
+ updatedAt: z20.date(),
756
+ deletedAt: z20.date().nullable(),
757
+ name: z20.string(),
758
+ address: z20.string().nullable(),
759
+ channel: z20.string().nullable(),
760
+ notes: z20.string().nullable(),
761
+ contactProfile: z20.string().nullable(),
762
+ socialProfileUrl: z20.string().nullable(),
763
+ tags: z20.array(TagSchema),
814
764
  company: CompanySchema.omit({ customFields: true }).nullable(),
815
765
  // room: z.array(RoomSchema).optional(),
816
- customFields: z21.array(ContactCustomFieldSchema),
817
- contactEmails: z21.array(ContactEmailsSchema),
818
- contactPhones: z21.array(ContactPhonesSchema),
819
- activityLogs: z21.array(ContactActivitySchema).optional()
766
+ customFields: z20.array(ContactCustomFieldSchema),
767
+ contactEmails: z20.array(ContactEmailsSchema),
768
+ contactPhones: z20.array(ContactPhonesSchema),
769
+ activityLogs: z20.array(ContactActivitySchema).optional()
820
770
  });
821
771
 
822
772
  // src/chat/schema.ts
823
- import z26 from "zod";
773
+ import z25 from "zod";
824
774
 
825
775
  // src/cx-log/schema.ts
826
- import z25 from "zod";
776
+ import z24 from "zod";
827
777
 
828
778
  // src/evaluate-form/schema.ts
829
- import z22 from "zod";
779
+ import z21 from "zod";
830
780
  var EvaluateFormSchema = DefaultEntitySchema.extend({
831
- cxLogId: z22.string().uuid(),
832
- sentimentScore: z22.string().nullable(),
833
- csatScore: z22.string().nullable()
781
+ cxLogId: z21.string().uuid(),
782
+ sentimentScore: z21.string().nullable(),
783
+ csatScore: z21.string().nullable()
834
784
  });
835
785
 
836
786
  // src/telephony-cdr/schema.ts
837
- import z23 from "zod";
787
+ import z22 from "zod";
838
788
  var TelephonyCdrSchema = DefaultEntitySchema.extend({
839
- uniqueCallId: z23.string(),
840
- timeStart: z23.string(),
841
- callFrom: z23.string(),
842
- callTo: z23.string(),
843
- callDuration: z23.number().nullable(),
844
- talkDuration: z23.number().nullable(),
845
- srcTrunkName: z23.string().nullable(),
846
- dstTrunkName: z23.string().nullable(),
847
- pinCode: z23.string().nullable(),
848
- status: z23.string(),
849
- type: z23.string(),
850
- recording: z23.string().nullable(),
851
- didNumber: z23.string().nullable(),
852
- agentRingTime: z23.number().nullable(),
853
- uploadId: z23.string().nullable(),
854
- serialNumber: z23.string().nullable(),
855
- extensionId: z23.string().uuid().nullable(),
856
- telephonyQueueId: z23.string().uuid().nullable(),
857
- contactId: z23.string().nullable()
789
+ uniqueCallId: z22.string(),
790
+ timeStart: z22.string(),
791
+ callFrom: z22.string(),
792
+ callTo: z22.string(),
793
+ callDuration: z22.number().nullable(),
794
+ talkDuration: z22.number().nullable(),
795
+ srcTrunkName: z22.string().nullable(),
796
+ dstTrunkName: z22.string().nullable(),
797
+ pinCode: z22.string().nullable(),
798
+ status: z22.string(),
799
+ type: z22.string(),
800
+ recording: z22.string().nullable(),
801
+ didNumber: z22.string().nullable(),
802
+ agentRingTime: z22.number().nullable(),
803
+ uploadId: z22.string().nullable(),
804
+ serialNumber: z22.string().nullable(),
805
+ extensionId: z22.string().uuid().nullable(),
806
+ telephonyQueueId: z22.string().uuid().nullable(),
807
+ contactId: z22.string().nullable()
858
808
  });
859
809
 
860
810
  // src/wrap-up-form/schema.ts
861
- import z24 from "zod";
811
+ import z23 from "zod";
862
812
  var WrapUpFormSchema = DefaultEntitySchema.extend({
863
- note: z24.string().nullable(),
864
- disposition: z24.string().nullable(),
865
- callFrom: z24.string().nullable(),
866
- callTo: z24.string().nullable(),
867
- tags: z24.array(TagSchema)
813
+ note: z23.string().nullable(),
814
+ disposition: z23.string().nullable(),
815
+ callFrom: z23.string().nullable(),
816
+ callTo: z23.string().nullable(),
817
+ tags: z23.array(TagSchema)
868
818
  });
869
819
 
870
820
  // src/cx-log/schema.ts
871
821
  var CxLogSchema = DefaultEntitySchema.extend({
872
- caseId: z25.number(),
873
- entityId: z25.string().uuid(),
874
- entityName: z25.string(),
875
- contactId: z25.string().uuid().nullable(),
876
- channel: z25.string().nullable(),
877
- queueId: z25.string().uuid().nullable(),
878
- agentId: z25.string().uuid().nullable(),
879
- direction: z25.string().nullable(),
880
- startedDate: z25.date().nullable(),
881
- handledTime: z25.number().nullable(),
882
- firstResponseTime: z25.number().nullable(),
883
- disposition: z25.string().nullable(),
822
+ caseId: z24.number(),
823
+ entityId: z24.string().uuid(),
824
+ entityName: z24.string(),
825
+ contactId: z24.string().uuid().nullable(),
826
+ channel: z24.string().nullable(),
827
+ queueId: z24.string().uuid().nullable(),
828
+ agentId: z24.string().uuid().nullable(),
829
+ direction: z24.string().nullable(),
830
+ startedDate: z24.date().nullable(),
831
+ handledTime: z24.number().nullable(),
832
+ firstResponseTime: z24.number().nullable(),
833
+ disposition: z24.string().nullable(),
884
834
  wrapUpForm: WrapUpFormSchema.nullable()
885
835
  });
886
836
  var CxLogSchemaWithRelations = DefaultEntitySchema.extend({
887
- caseId: z25.number(),
888
- entityId: z25.string().uuid(),
889
- entityName: z25.string(),
890
- channelType: z25.string().nullable(),
891
- channel: z25.string().nullable(),
892
- direction: z25.string().nullable(),
893
- startedDate: z25.string().nullable(),
894
- handledTime: z25.string().nullable(),
895
- firstResponseTime: z25.string().nullable(),
896
- disposition: z25.string().nullable(),
897
- slaMeet: z25.string().nullable(),
837
+ caseId: z24.number(),
838
+ entityId: z24.string().uuid(),
839
+ entityName: z24.string(),
840
+ channelType: z24.string().nullable(),
841
+ channel: z24.string().nullable(),
842
+ direction: z24.string().nullable(),
843
+ startedDate: z24.string().nullable(),
844
+ handledTime: z24.string().nullable(),
845
+ firstResponseTime: z24.string().nullable(),
846
+ disposition: z24.string().nullable(),
847
+ slaMeet: z24.string().nullable(),
898
848
  evaluateForm: EvaluateFormSchema.nullable(),
899
849
  wrapUpForm: WrapUpFormSchema.nullable(),
900
- room: z25.object({
901
- id: z25.string().uuid(),
902
- createdAt: z25.date(),
903
- updatedAt: z25.date(),
904
- deletedAt: z25.date().nullable(),
905
- lastMessage: z25.string(),
906
- handleTime: z25.number(),
907
- closeAt: z25.date(),
908
- unreadCount: z25.number(),
909
- firstResponseAt: z25.date(),
910
- firstResponseTime: z25.number(),
911
- isLatest: z25.boolean(),
850
+ room: z24.object({
851
+ id: z24.string().uuid(),
852
+ createdAt: z24.date(),
853
+ updatedAt: z24.date(),
854
+ deletedAt: z24.date().nullable(),
855
+ lastMessage: z24.string(),
856
+ handleTime: z24.number(),
857
+ closeAt: z24.date(),
858
+ unreadCount: z24.number(),
859
+ firstResponseAt: z24.date(),
860
+ firstResponseTime: z24.number(),
861
+ isLatest: z24.boolean(),
912
862
  direction: MessageDirectionTypeSchema,
913
863
  platformContact: PlatformContactSchema,
914
864
  actor: UserSchema,
@@ -916,20 +866,20 @@ var CxLogSchemaWithRelations = DefaultEntitySchema.extend({
916
866
  channel: ChannelSchema
917
867
  }).nullable(),
918
868
  telephonyCdr: TelephonyCdrSchema.nullable(),
919
- queue: z25.object({
920
- queueName: z25.string().nullable().optional()
869
+ queue: z24.object({
870
+ queueName: z24.string().nullable().optional()
921
871
  }).nullable(),
922
872
  contact: ContactSchema.nullable(),
923
873
  agent: UserSchema.nullable()
924
874
  });
925
875
 
926
876
  // src/chat/schema.ts
927
- var MessageDirectionTypeSchema = z26.enum([
877
+ var MessageDirectionTypeSchema = z25.enum([
928
878
  "incoming",
929
879
  "outgoing",
930
880
  "system"
931
881
  ]);
932
- var MessageTypeSchema = z26.enum([
882
+ var MessageTypeSchema = z25.enum([
933
883
  "text",
934
884
  "image",
935
885
  "video",
@@ -938,39 +888,39 @@ var MessageTypeSchema = z26.enum([
938
888
  "imagemap",
939
889
  "fallback",
940
890
  "location",
941
- "sticker",
942
- // system
891
+ "attachment",
943
892
  "assign",
944
893
  "solve",
945
894
  "reopen",
946
895
  "open",
896
+ "sticker",
947
897
  "closed",
948
898
  "handed_over",
949
899
  "updated",
950
900
  "started"
951
901
  ]);
952
- var MessageLocaleTypeSchema = z26.enum(["mm", "en", "th", ""]);
953
- var PlatformContactMetadataSchema = z26.object({
954
- id: z26.string(),
955
- name: z26.string(),
956
- picture: z26.string().optional(),
957
- additionalCredentials: z26.any()
902
+ var MessageLocaleTypeSchema = z25.enum(["mm", "en", "th", ""]);
903
+ var PlatformContactMetadataSchema = z25.object({
904
+ id: z25.string(),
905
+ name: z25.string(),
906
+ picture: z25.string().optional(),
907
+ additionalCredentials: z25.any()
958
908
  });
959
909
  var PlatformContactSchema = DefaultEntitySchema.extend({
960
- channelId: z26.string().uuid(),
961
- socialPlatformId: z26.string(),
910
+ channelId: z25.string().uuid(),
911
+ socialPlatformId: z25.string(),
962
912
  type: ChannelTypeSchema,
963
913
  metadata: PlatformContactMetadataSchema,
964
914
  contact: ContactSchema
965
915
  });
966
916
  var RoomSchema = DefaultEntitySchema.extend({
967
- lastMessage: z26.string(),
968
- handleTime: z26.number(),
969
- closeAt: z26.date(),
970
- unreadCount: z26.number(),
971
- firstResponseAt: z26.date(),
972
- firstResponseTime: z26.number(),
973
- isLatest: z26.boolean(),
917
+ lastMessage: z25.string(),
918
+ handleTime: z25.number(),
919
+ closeAt: z25.date(),
920
+ unreadCount: z25.number(),
921
+ firstResponseAt: z25.date(),
922
+ firstResponseTime: z25.number(),
923
+ isLatest: z25.boolean(),
974
924
  direction: MessageDirectionTypeSchema,
975
925
  platformContact: PlatformContactSchema,
976
926
  actor: UserSchema,
@@ -979,177 +929,170 @@ var RoomSchema = DefaultEntitySchema.extend({
979
929
  cxlog: CxLogSchema
980
930
  });
981
931
  var MessageSchema = DefaultEntitySchema.extend({
982
- message: z26.string(),
932
+ message: z25.string(),
983
933
  direction: MessageDirectionTypeSchema,
984
934
  type: MessageTypeSchema,
985
- readAt: z26.date(),
986
- metadata: z26.any(),
987
- platformId: z26.string(),
988
- platformMessageId: z26.string(),
989
- replyPlatformMessageId: z26.string(),
990
- template: z26.any(),
935
+ readAt: z25.date(),
936
+ metadata: z25.any(),
937
+ platformId: z25.string(),
938
+ platformMessageId: z25.string(),
939
+ replyPlatformMessageId: z25.string(),
940
+ template: z25.any(),
991
941
  locale: MessageLocaleTypeSchema,
992
- url: z26.string(),
993
- previewUrl: z26.string(),
994
- imageSetId: z26.string(),
942
+ url: z25.string(),
943
+ previewUrl: z25.string(),
944
+ imageSetId: z25.string(),
995
945
  room: RoomSchema,
996
946
  upload: UploadSchema,
997
947
  actor: UserSchema,
998
948
  assignee: UserSchema,
999
949
  sender: UserSchema
1000
950
  });
1001
- var UnreadCountsByAssigneeSchema = z26.object({
1002
- assigneeId: z26.string(),
1003
- totalUnreadCount: z26.number()
951
+ var UnreadCountsByAssigneeSchema = z25.object({
952
+ assigneeId: z25.string(),
953
+ totalUnreadCount: z25.number()
1004
954
  });
1005
955
 
1006
956
  // src/chat/validation.ts
1007
- import z28 from "zod";
957
+ import z27 from "zod";
1008
958
 
1009
959
  // src/custom-field/schema.ts
1010
- import z27 from "zod";
960
+ import z26 from "zod";
1011
961
  var CustomFieldSchema = DefaultEntitySchema.extend({
1012
- textValue: z27.string().nullable(),
1013
- booleanValue: z27.boolean().nullable(),
1014
- numberValue: z27.number().nullable(),
1015
- dateValue: z27.date().nullable(),
1016
- entityId: z27.string().uuid(),
1017
- attributeId: z27.string().uuid()
962
+ textValue: z26.string().nullable(),
963
+ booleanValue: z26.boolean().nullable(),
964
+ numberValue: z26.number().nullable(),
965
+ dateValue: z26.date().nullable(),
966
+ entityId: z26.string().uuid(),
967
+ attributeId: z26.string().uuid()
1018
968
  });
1019
969
 
1020
970
  // src/chat/validation.ts
1021
- var GetRoomsSchema = z28.object({
1022
- page: z28.coerce.number().positive().default(1),
1023
- pageSize: z28.coerce.number().positive().default(20),
1024
- contactTagIds: z28.string().array().optional(),
1025
- contactIds: z28.string().array().optional(),
1026
- agentIds: z28.string().array().optional(),
1027
- roomTagIds: z28.string().array().optional(),
1028
- keyword: z28.string().optional(),
1029
- company: z28.string().array().optional(),
1030
- channel: z28.string().array().optional(),
1031
- name: z28.string().optional(),
1032
- address: z28.string().optional(),
1033
- contactGroups: z28.string().array().optional(),
1034
- selectedDate: z28.string().optional(),
1035
- customFields: z28.array(CustomFieldSchema).optional(),
1036
- tags: z28.string().array().optional(),
1037
- phone: z28.string().optional(),
1038
- email: z28.string().optional(),
1039
- notes: z28.string().optional(),
1040
- tab: z28.string().optional()
1041
- });
1042
- var UpdateRoomTagsAndNotesSchema = z28.object({
1043
- note: z28.string().optional(),
971
+ var GetRoomsSchema = z27.object({
972
+ page: z27.coerce.number().positive().default(1),
973
+ pageSize: z27.coerce.number().positive().default(20),
974
+ contactTagIds: z27.string().array().optional(),
975
+ contactIds: z27.string().array().optional(),
976
+ agentIds: z27.string().array().optional(),
977
+ roomTagIds: z27.string().array().optional(),
978
+ keyword: z27.string().optional(),
979
+ company: z27.string().array().optional(),
980
+ channel: z27.string().array().optional(),
981
+ name: z27.string().optional(),
982
+ address: z27.string().optional(),
983
+ contactGroups: z27.string().array().optional(),
984
+ selectedDate: z27.string().optional(),
985
+ customFields: z27.array(CustomFieldSchema).optional(),
986
+ tags: z27.string().array().optional(),
987
+ phone: z27.string().optional(),
988
+ email: z27.string().optional(),
989
+ notes: z27.string().optional(),
990
+ tab: z27.string().optional()
991
+ });
992
+ var UpdateRoomTagsAndNotesSchema = z27.object({
993
+ note: z27.string().optional(),
1044
994
  tags: TagSchema.array().optional()
1045
995
  });
1046
996
  var UpdateRoomAttributesSchema = UpdateRoomTagsAndNotesSchema.extend({
1047
- roomId: z28.string().uuid()
1048
- });
1049
- var MessageAttachmentSchema = z28.object({
1050
- bucketName: z28.string(),
1051
- fileKey: z28.string(),
1052
- fileName: z28.string(),
1053
- fileSize: z28.number(),
1054
- url: z28.string(),
997
+ roomId: z27.string().uuid()
998
+ });
999
+ var MessageAttachmentSchema = z27.object({
1000
+ bucketName: z27.string(),
1001
+ fileKey: z27.string(),
1002
+ fileName: z27.string(),
1003
+ fileSize: z27.number(),
1004
+ url: z27.string(),
1055
1005
  fileType: MessageTypeSchema,
1056
- thumbnailUrl: z28.string().optional()
1006
+ thumbnailUrl: z27.string().optional()
1057
1007
  });
1058
- var SendMessageSchema = z28.object({
1059
- roomId: z28.string().uuid(),
1008
+ var SendMessageSchema = z27.object({
1009
+ roomId: z27.string().uuid(),
1060
1010
  messageType: MessageTypeSchema,
1061
- message: z28.string().optional(),
1011
+ message: z27.string().optional(),
1062
1012
  messageAttachments: MessageAttachmentSchema.optional(),
1063
1013
  user: UserSchema.optional(),
1064
- packageId: z28.number().optional(),
1065
- stickerId: z28.number().optional()
1014
+ packageId: z27.number().optional(),
1015
+ stickerId: z27.number().optional()
1066
1016
  });
1067
- var SolveRoomSchema = z28.object({
1068
- roomId: z28.string()
1017
+ var SolveRoomSchema = z27.object({
1018
+ roomId: z27.string()
1069
1019
  });
1070
1020
  var UpdateAssigneeSchema = SolveRoomSchema.extend({
1071
- assigneeId: z28.string().uuid()
1021
+ assigneeId: z27.string().uuid()
1072
1022
  });
1073
1023
  var SearchRoomsSchema = DefaultQueryParamsSchema.extend({
1074
- query: z28.string()
1024
+ query: z27.string()
1075
1025
  });
1076
- var ChannelSchema2 = z28.object({
1077
- name: z28.string(),
1026
+ var ChannelSchema2 = z27.object({
1027
+ name: z27.string(),
1078
1028
  type: ChannelTypeSchema,
1079
1029
  metadata: ChannelMetadataSchema,
1080
- platformId: z28.string(),
1030
+ brandName: z27.string(),
1031
+ platformId: z27.string(),
1081
1032
  status: ChannelStatusTypeSchema,
1082
- connectedUserName: z28.string().optional().nullable(),
1083
- connectedUserId: z28.string().optional().nullable(),
1084
- actor: z28.object({
1085
- id: z28.string().uuid(),
1086
- name: z28.string(),
1087
- email: z28.string().email(),
1088
- address: z28.string().nullable(),
1089
- phone: z28.string().nullable()
1090
- })
1091
- });
1092
- var SendMessageToPlatformSchema = z28.object({
1093
- room: z28.object({
1094
- id: z28.string().uuid(),
1095
- lastMessage: z28.string().optional(),
1096
- handleTime: z28.number().optional(),
1097
- isLatest: z28.boolean(),
1033
+ isReloginRequired: z27.boolean(),
1034
+ connectedUserName: z27.string().optional().nullable(),
1035
+ connectedUserId: z27.string().optional().nullable()
1036
+ });
1037
+ var SendMessageToPlatformSchema = z27.object({
1038
+ room: z27.object({
1039
+ id: z27.string().uuid(),
1040
+ lastMessage: z27.string().optional(),
1041
+ handleTime: z27.number().optional(),
1042
+ isLatest: z27.boolean(),
1098
1043
  direction: MessageDirectionTypeSchema,
1099
- platformContact: z28.object({
1100
- channelId: z28.string().uuid(),
1101
- socialPlatformId: z28.string().nullable(),
1044
+ platformContact: z27.object({
1045
+ channelId: z27.string().uuid(),
1046
+ socialPlatformId: z27.string().nullable(),
1102
1047
  type: ChannelTypeSchema,
1103
1048
  metadata: PlatformContactMetadataSchema,
1104
- contact: z28.object({
1105
- name: z28.string(),
1106
- address: z28.string().nullable(),
1107
- channel: z28.string().nullable(),
1108
- notes: z28.string().nullable(),
1109
- contactProfile: z28.string().nullable(),
1110
- socialProfileUrl: z28.string().nullable()
1049
+ contact: z27.object({
1050
+ name: z27.string(),
1051
+ address: z27.string().nullable(),
1052
+ channel: z27.string().nullable(),
1053
+ notes: z27.string().nullable(),
1054
+ contactProfile: z27.string().nullable(),
1055
+ socialProfileUrl: z27.string().nullable()
1111
1056
  })
1112
1057
  }),
1113
- actor: z28.object({
1114
- name: z28.string(),
1115
- email: z28.string().email(),
1116
- address: z28.string().nullable(),
1117
- phone: z28.string().nullable()
1058
+ actor: z27.object({
1059
+ name: z27.string(),
1060
+ email: z27.string().email(),
1061
+ address: z27.string().nullable(),
1062
+ phone: z27.string().nullable()
1118
1063
  }).nullable(),
1119
1064
  channel: ChannelSchema2
1120
1065
  }),
1121
- message: z28.object({
1122
- message: z28.string().optional(),
1066
+ message: z27.object({
1067
+ message: z27.string().optional(),
1123
1068
  direction: MessageDirectionTypeSchema,
1124
1069
  type: MessageTypeSchema,
1125
- readAt: z28.date().optional(),
1126
- metadata: z28.any().optional(),
1127
- platformId: z28.string().optional(),
1128
- platformMessageId: z28.string().optional(),
1129
- replyPlatformMessageId: z28.string().optional(),
1130
- template: z28.any().optional(),
1070
+ readAt: z27.date().optional(),
1071
+ metadata: z27.any().optional(),
1072
+ platformId: z27.string().optional(),
1073
+ platformMessageId: z27.string().optional(),
1074
+ replyPlatformMessageId: z27.string().optional(),
1075
+ template: z27.any().optional(),
1131
1076
  locale: MessageLocaleTypeSchema.optional(),
1132
- url: z28.string().optional(),
1133
- previewUrl: z28.string().optional(),
1134
- imageSetId: z28.string().optional(),
1077
+ url: z27.string().optional(),
1078
+ previewUrl: z27.string().optional(),
1079
+ imageSetId: z27.string().optional(),
1135
1080
  upload: UploadSchema.optional(),
1136
- sender: z28.object({
1137
- name: z28.string(),
1138
- email: z28.string().email(),
1139
- address: z28.string().nullable(),
1140
- phone: z28.string().nullable()
1081
+ sender: z27.object({
1082
+ name: z27.string(),
1083
+ email: z27.string().email(),
1084
+ address: z27.string().nullable(),
1085
+ phone: z27.string().nullable()
1141
1086
  })
1142
1087
  })
1143
1088
  });
1144
1089
  var SendMessageResponseSchema = DefaultSuccessResponseSchema.extend({
1145
1090
  data: MessageSchema
1146
1091
  });
1147
- var ChannelServiceResponseSchema = DefaultSuccessResponseSchema.extend(
1148
- {
1149
- data: ChannelSchema2
1150
- }
1151
- );
1152
- var ReceiveMessageSchema = z28.object({
1092
+ var ConnectChannelServiceResponseSchema = DefaultSuccessResponseSchema.extend({
1093
+ data: ChannelSchema2
1094
+ });
1095
+ var ReceiveMessageSchema = z27.object({
1153
1096
  message: MessageSchema
1154
1097
  });
1155
1098
 
@@ -1161,11 +1104,11 @@ var mainChatContract = initContract6().router(
1161
1104
  path: "/rooms",
1162
1105
  responses: {
1163
1106
  200: DefaultSuccessResponseSchema.extend({
1164
- total: z29.number(),
1165
- page: z29.number(),
1166
- pageSize: z29.number(),
1167
- data: z29.array(RoomSchema),
1168
- unreadCountsByAssignee: z29.array(UnreadCountsByAssigneeSchema)
1107
+ total: z28.number(),
1108
+ page: z28.number(),
1109
+ pageSize: z28.number(),
1110
+ data: z28.array(RoomSchema),
1111
+ unreadCountsByAssignee: z28.array(UnreadCountsByAssigneeSchema)
1169
1112
  }),
1170
1113
  401: DefaultUnauthorizedSchema
1171
1114
  },
@@ -1175,8 +1118,8 @@ var mainChatContract = initContract6().router(
1175
1118
  getRoomContact: {
1176
1119
  method: "GET",
1177
1120
  path: "/contact/:contactId",
1178
- pathParams: z29.object({
1179
- contactId: z29.string().uuid()
1121
+ pathParams: z28.object({
1122
+ contactId: z28.string().uuid()
1180
1123
  }),
1181
1124
  responses: {
1182
1125
  200: DefaultSuccessResponseSchema.extend({
@@ -1220,32 +1163,30 @@ var mainChatContract = initContract6().router(
1220
1163
  getRoomsByPlatformContactId: {
1221
1164
  method: "GET",
1222
1165
  path: "/rooms/:platformContactId",
1223
- pathParams: z29.object({
1224
- platformContactId: z29.string()
1166
+ pathParams: z28.object({
1167
+ platformContactId: z28.string()
1225
1168
  }),
1226
1169
  responses: {
1227
1170
  200: DefaultSuccessResponseSchema.extend({
1228
- data: z29.array(
1229
- z29.object({
1230
- id: z29.string().uuid()
1231
- })
1232
- ),
1233
- total: z29.number()
1171
+ data: z28.object({
1172
+ id: z28.string().uuid().array()
1173
+ }),
1174
+ total: z28.number()
1234
1175
  })
1235
1176
  }
1236
1177
  },
1237
1178
  getMessages: {
1238
1179
  method: "GET",
1239
1180
  path: "/message/:roomId",
1240
- pathParams: z29.object({
1241
- roomId: z29.string().uuid()
1181
+ pathParams: z28.object({
1182
+ roomId: z28.string().uuid()
1242
1183
  }),
1243
1184
  responses: {
1244
1185
  200: DefaultSuccessResponseSchema.extend({
1245
- total: z29.number(),
1246
- page: z29.number(),
1247
- pageSize: z29.number(),
1248
- data: z29.array(MessageSchema)
1186
+ total: z28.number(),
1187
+ page: z28.number(),
1188
+ pageSize: z28.number(),
1189
+ data: z28.array(MessageSchema)
1249
1190
  })
1250
1191
  },
1251
1192
  query: DefaultQueryParamsSchema,
@@ -1258,7 +1199,7 @@ var mainChatContract = initContract6().router(
1258
1199
  responses: {
1259
1200
  200: DefaultSuccessResponseSchema.extend({
1260
1201
  data: RoomSchema.extend({
1261
- solveMessage: z29.string()
1202
+ solveMessage: z28.string()
1262
1203
  })
1263
1204
  }),
1264
1205
  409: DefaultErrorResponseSchema
@@ -1279,8 +1220,8 @@ var mainChatContract = initContract6().router(
1279
1220
  getRoom: {
1280
1221
  method: "GET",
1281
1222
  path: "/room/:roomId",
1282
- pathParams: z29.object({
1283
- roomId: z29.string().uuid()
1223
+ pathParams: z28.object({
1224
+ roomId: z28.string().uuid()
1284
1225
  }),
1285
1226
  responses: {
1286
1227
  200: DefaultSuccessResponseSchema.extend({
@@ -1293,14 +1234,14 @@ var mainChatContract = initContract6().router(
1293
1234
  createRoom: {
1294
1235
  method: "POST",
1295
1236
  path: "/room/create/:platformContactId",
1296
- pathParams: z29.object({
1297
- platformContactId: z29.string().uuid()
1237
+ pathParams: z28.object({
1238
+ platformContactId: z28.string().uuid()
1298
1239
  }),
1299
1240
  responses: {
1300
1241
  200: DefaultSuccessResponseSchema.extend({
1301
1242
  data: RoomSchema.extend({
1302
1243
  contact: ContactSchema,
1303
- openMessage: z29.string()
1244
+ openMessage: z28.string()
1304
1245
  })
1305
1246
  })
1306
1247
  },
@@ -1310,13 +1251,13 @@ var mainChatContract = initContract6().router(
1310
1251
  readRoom: {
1311
1252
  method: "POST",
1312
1253
  path: "/room/:roomid/read",
1313
- pathParams: z29.object({
1314
- roomId: z29.string().uuid()
1254
+ pathParams: z28.object({
1255
+ roomId: z28.string().uuid()
1315
1256
  }),
1316
1257
  responses: {
1317
1258
  200: DefaultSuccessResponseSchema.extend({
1318
1259
  data: RoomSchema.extend({
1319
- description: z29.string().nullable()
1260
+ description: z28.string().nullable()
1320
1261
  })
1321
1262
  })
1322
1263
  },
@@ -1328,10 +1269,10 @@ var mainChatContract = initContract6().router(
1328
1269
  path: "/search",
1329
1270
  responses: {
1330
1271
  200: DefaultSuccessResponseSchema.extend({
1331
- total: z29.number(),
1332
- page: z29.number(),
1333
- pageSize: z29.number(),
1334
- data: z29.array(RoomSchema)
1272
+ total: z28.number(),
1273
+ page: z28.number(),
1274
+ pageSize: z28.number(),
1275
+ data: z28.array(RoomSchema)
1335
1276
  })
1336
1277
  },
1337
1278
  query: SearchRoomsSchema,
@@ -1346,99 +1287,99 @@ var mainChatContract = initContract6().router(
1346
1287
 
1347
1288
  // src/contact/index.ts
1348
1289
  import { initContract as initContract7 } from "@ts-rest/core";
1349
- import z31 from "zod";
1290
+ import z30 from "zod";
1350
1291
 
1351
1292
  // src/contact/validation.ts
1352
- import z30 from "zod";
1353
- var BaseSchema = z30.object({
1354
- isRequired: z30.boolean(),
1355
- attributeId: z30.string()
1293
+ import z29 from "zod";
1294
+ var BaseSchema = z29.object({
1295
+ isRequired: z29.boolean(),
1296
+ attributeId: z29.string()
1356
1297
  });
1357
1298
  var SingleValue = {
1358
- value: z30.string()
1299
+ value: z29.string()
1359
1300
  };
1360
1301
  var ContactContractValidationSchema = {
1361
1302
  create: {
1362
- request: z30.object({
1303
+ request: z29.object({
1363
1304
  name: BaseSchema.extend(SingleValue),
1364
1305
  email: BaseSchema.extend({
1365
- value: z30.array(
1366
- z30.object({
1367
- email: z30.string(),
1368
- isPrimary: z30.boolean()
1306
+ value: z29.array(
1307
+ z29.object({
1308
+ email: z29.string(),
1309
+ isPrimary: z29.boolean()
1369
1310
  })
1370
1311
  )
1371
1312
  }),
1372
1313
  channel: BaseSchema.extend(SingleValue),
1373
1314
  address: BaseSchema.extend(SingleValue),
1374
1315
  phone: BaseSchema.extend({
1375
- value: z30.array(
1376
- z30.object({
1377
- phone: z30.string(),
1378
- isPrimary: z30.boolean()
1316
+ value: z29.array(
1317
+ z29.object({
1318
+ phone: z29.string(),
1319
+ isPrimary: z29.boolean()
1379
1320
  })
1380
1321
  )
1381
1322
  }).optional(),
1382
1323
  notes: BaseSchema.extend(SingleValue),
1383
1324
  tags: BaseSchema.extend({
1384
- value: z30.array(z30.string())
1325
+ value: z29.array(z29.string())
1385
1326
  }),
1386
1327
  company: BaseSchema.extend(SingleValue),
1387
- customFields: z30.array(
1328
+ customFields: z29.array(
1388
1329
  BaseSchema.extend({
1389
- value: z30.union([z30.string(), z30.array(z30.string())]),
1390
- type: z30.string(),
1391
- isDefaultAttribute: z30.boolean()
1330
+ value: z29.union([z29.string(), z29.array(z29.string())]),
1331
+ type: z29.string(),
1332
+ isDefaultAttribute: z29.boolean()
1392
1333
  })
1393
1334
  )
1394
1335
  }),
1395
- response: z30.string()
1336
+ response: z29.string()
1396
1337
  },
1397
1338
  getById: {
1398
- request: z30.object({
1399
- id: z30.string().uuid()
1339
+ request: z29.object({
1340
+ id: z29.string().uuid()
1400
1341
  }),
1401
1342
  response: ContactSchema
1402
1343
  },
1403
1344
  delete: {
1404
- request: z30.object({
1405
- id: z30.string().uuid()
1345
+ request: z29.object({
1346
+ id: z29.string().uuid()
1406
1347
  }),
1407
- response: z30.string()
1348
+ response: z29.string()
1408
1349
  },
1409
1350
  getAll: {
1410
- request: z30.object({
1411
- page: z30.coerce.number().default(1),
1412
- pageSize: z30.coerce.number().default(10),
1413
- keyword: z30.string().optional(),
1414
- company: z30.array(z30.string().uuid()),
1415
- name: z30.string(),
1416
- address: z30.string(),
1417
- channel: z30.array(z30.string()),
1418
- selectedDate: z30.string(),
1419
- customFields: z30.array(
1420
- z30.object({
1421
- attributeId: z30.string().uuid(),
1422
- type: z30.string(),
1423
- value: z30.union([z30.string(), z30.array(z30.string())])
1351
+ request: z29.object({
1352
+ page: z29.coerce.number().default(1),
1353
+ pageSize: z29.coerce.number().default(10),
1354
+ keyword: z29.string().optional(),
1355
+ company: z29.array(z29.string().uuid()),
1356
+ name: z29.string(),
1357
+ address: z29.string(),
1358
+ channel: z29.array(z29.string()),
1359
+ selectedDate: z29.string(),
1360
+ customFields: z29.array(
1361
+ z29.object({
1362
+ attributeId: z29.string().uuid(),
1363
+ type: z29.string(),
1364
+ value: z29.union([z29.string(), z29.array(z29.string())])
1424
1365
  })
1425
1366
  ),
1426
- tags: z30.array(z30.string().uuid()),
1427
- phone: z30.string(),
1428
- email: z30.string(),
1429
- notes: z30.string()
1367
+ tags: z29.array(z29.string().uuid()),
1368
+ phone: z29.string(),
1369
+ email: z29.string(),
1370
+ notes: z29.string()
1430
1371
  }).partial(),
1431
1372
  response: {
1432
- page: z30.number(),
1433
- pageSize: z30.number(),
1434
- total: z30.number(),
1435
- lastPage: z30.number(),
1436
- data: z30.array(ContactSchema)
1373
+ page: z29.number(),
1374
+ pageSize: z29.number(),
1375
+ total: z29.number(),
1376
+ lastPage: z29.number(),
1377
+ data: z29.array(ContactSchema)
1437
1378
  }
1438
1379
  },
1439
1380
  createContactByPhone: {
1440
- request: z30.object({
1441
- phoneNumber: z30.string().refine(
1381
+ request: z29.object({
1382
+ phoneNumber: z29.string().refine(
1442
1383
  (value) => {
1443
1384
  const numericValue = value.replace(/\s/g, "");
1444
1385
  return /^\d+$/.test(numericValue);
@@ -1451,8 +1392,8 @@ var ContactContractValidationSchema = {
1451
1392
  response: ContactSchema
1452
1393
  },
1453
1394
  updateContactByPhone: {
1454
- request: z30.object({
1455
- phoneNumber: z30.string().refine(
1395
+ request: z29.object({
1396
+ phoneNumber: z29.string().refine(
1456
1397
  (value) => {
1457
1398
  const numericValue = value.replace(/\s/g, "");
1458
1399
  return /^\d+$/.test(numericValue);
@@ -1465,68 +1406,68 @@ var ContactContractValidationSchema = {
1465
1406
  response: ContactSchema
1466
1407
  },
1467
1408
  updateFromOngoingCall: {
1468
- request: z30.object({
1469
- name: z30.string(),
1470
- companyId: z30.string().uuid()
1409
+ request: z29.object({
1410
+ name: z29.string(),
1411
+ companyId: z29.string().uuid()
1471
1412
  }).partial(),
1472
1413
  response: ContactSchema
1473
1414
  },
1474
1415
  merge: {
1475
- request: z30.object({
1476
- primaryContactId: z30.string().uuid(),
1477
- emails: z30.array(
1478
- z30.object({
1479
- email: z30.string(),
1480
- isPrimary: z30.boolean()
1416
+ request: z29.object({
1417
+ primaryContactId: z29.string().uuid(),
1418
+ emails: z29.array(
1419
+ z29.object({
1420
+ email: z29.string(),
1421
+ isPrimary: z29.boolean()
1481
1422
  })
1482
1423
  ),
1483
- phones: z30.array(
1484
- z30.object({
1485
- phone: z30.string(),
1486
- isPrimary: z30.boolean()
1424
+ phones: z29.array(
1425
+ z29.object({
1426
+ phone: z29.string(),
1427
+ isPrimary: z29.boolean()
1487
1428
  })
1488
1429
  ),
1489
- otherContacts: z30.array(z30.string().uuid())
1430
+ otherContacts: z29.array(z29.string().uuid())
1490
1431
  }),
1491
1432
  response: ContactSchema
1492
1433
  },
1493
1434
  checkContactPhone: {
1494
- request: z30.object({
1495
- contactId: z30.string().uuid().optional(),
1496
- phoneNumber: z30.string()
1435
+ request: z29.object({
1436
+ contactId: z29.string().uuid().optional(),
1437
+ phoneNumber: z29.string()
1497
1438
  }),
1498
- response: z30.boolean()
1439
+ response: z29.boolean()
1499
1440
  },
1500
1441
  checkContactEmail: {
1501
- request: z30.object({
1502
- contactId: z30.string().uuid().optional(),
1503
- email: z30.string()
1442
+ request: z29.object({
1443
+ contactId: z29.string().uuid().optional(),
1444
+ email: z29.string()
1504
1445
  }),
1505
- response: z30.boolean()
1446
+ response: z29.boolean()
1506
1447
  },
1507
1448
  filterContacts: {
1508
- request: z30.object({
1509
- page: z30.coerce.number().default(1),
1510
- pageSize: z30.coerce.number().default(10),
1511
- keyword: z30.string()
1449
+ request: z29.object({
1450
+ page: z29.coerce.number().default(1),
1451
+ pageSize: z29.coerce.number().default(10),
1452
+ keyword: z29.string()
1512
1453
  }).partial(),
1513
1454
  response: {
1514
- page: z30.number(),
1515
- pageSize: z30.number(),
1516
- total: z30.number(),
1517
- lastPage: z30.number(),
1518
- data: z30.array(ContactSchema)
1455
+ page: z29.number(),
1456
+ pageSize: z29.number(),
1457
+ total: z29.number(),
1458
+ lastPage: z29.number(),
1459
+ data: z29.array(ContactSchema)
1519
1460
  }
1520
1461
  },
1521
1462
  addAttachments: {
1522
- request: z30.object({
1523
- attributeId: z30.string().uuid(),
1524
- attachments: z30.array(
1525
- z30.object({
1526
- bucketName: z30.string(),
1527
- fileKey: z30.string(),
1528
- fileName: z30.string(),
1529
- fileSize: z30.coerce.number()
1463
+ request: z29.object({
1464
+ attributeId: z29.string().uuid(),
1465
+ attachments: z29.array(
1466
+ z29.object({
1467
+ bucketName: z29.string(),
1468
+ fileKey: z29.string(),
1469
+ fileName: z29.string(),
1470
+ fileSize: z29.coerce.number()
1530
1471
  })
1531
1472
  ).optional()
1532
1473
  }),
@@ -1544,14 +1485,14 @@ var contactContract = initContract7().router(
1544
1485
  201: DefaultSuccessResponseSchema.extend({
1545
1486
  message: ContactContractValidationSchema.create.response
1546
1487
  }),
1547
- 400: z31.object({
1548
- message: z31.string()
1488
+ 400: z30.object({
1489
+ message: z30.string()
1549
1490
  }),
1550
- 409: z31.object({
1551
- message: z31.string()
1491
+ 409: z30.object({
1492
+ message: z30.string()
1552
1493
  }),
1553
- 500: z31.object({
1554
- message: z31.string()
1494
+ 500: z30.object({
1495
+ message: z30.string()
1555
1496
  }),
1556
1497
  401: DefaultUnauthorizedSchema,
1557
1498
  404: DefaultNotFoundSchema,
@@ -1560,6 +1501,29 @@ var contactContract = initContract7().router(
1560
1501
  body: ContactContractValidationSchema.create.request,
1561
1502
  summary: "Create a new contact"
1562
1503
  },
1504
+ getById: {
1505
+ method: "GET",
1506
+ path: "/:id",
1507
+ pathParams: ContactContractValidationSchema.getById.request,
1508
+ responses: {
1509
+ 200: DefaultSuccessResponseSchema.extend({
1510
+ data: ContactContractValidationSchema.getById.response
1511
+ }),
1512
+ 400: z30.object({
1513
+ message: z30.string()
1514
+ }),
1515
+ 409: z30.object({
1516
+ message: z30.string()
1517
+ }),
1518
+ 500: z30.object({
1519
+ message: z30.string()
1520
+ }),
1521
+ 401: DefaultUnauthorizedSchema,
1522
+ 404: DefaultNotFoundSchema,
1523
+ 422: DefaultUnprocessibleSchema
1524
+ },
1525
+ summary: "Get a contact by id"
1526
+ },
1563
1527
  getAll: {
1564
1528
  method: "GET",
1565
1529
  path: "",
@@ -1568,14 +1532,14 @@ var contactContract = initContract7().router(
1568
1532
  200: DefaultSuccessResponseSchema.extend(
1569
1533
  ContactContractValidationSchema.getAll.response
1570
1534
  ),
1571
- 400: z31.object({
1572
- message: z31.string()
1535
+ 400: z30.object({
1536
+ message: z30.string()
1573
1537
  }),
1574
- 409: z31.object({
1575
- message: z31.string()
1538
+ 409: z30.object({
1539
+ message: z30.string()
1576
1540
  }),
1577
- 500: z31.object({
1578
- message: z31.string()
1541
+ 500: z30.object({
1542
+ message: z30.string()
1579
1543
  }),
1580
1544
  401: DefaultUnauthorizedSchema,
1581
1545
  404: DefaultNotFoundSchema,
@@ -1585,20 +1549,20 @@ var contactContract = initContract7().router(
1585
1549
  },
1586
1550
  filterContacts: {
1587
1551
  method: "GET",
1588
- path: "/filter/list",
1552
+ path: "/filter",
1589
1553
  query: ContactContractValidationSchema.filterContacts.request,
1590
1554
  responses: {
1591
1555
  200: DefaultSuccessResponseSchema.extend(
1592
1556
  ContactContractValidationSchema.filterContacts.response
1593
1557
  ),
1594
- 400: z31.object({
1595
- message: z31.string()
1558
+ 400: z30.object({
1559
+ message: z30.string()
1596
1560
  }),
1597
- 409: z31.object({
1598
- message: z31.string()
1561
+ 409: z30.object({
1562
+ message: z30.string()
1599
1563
  }),
1600
- 500: z31.object({
1601
- message: z31.string()
1564
+ 500: z30.object({
1565
+ message: z30.string()
1602
1566
  }),
1603
1567
  401: DefaultUnauthorizedSchema,
1604
1568
  404: DefaultNotFoundSchema,
@@ -1614,14 +1578,14 @@ var contactContract = initContract7().router(
1614
1578
  200: DefaultSuccessResponseSchema.extend({
1615
1579
  data: ContactContractValidationSchema.getById.response
1616
1580
  }),
1617
- 400: z31.object({
1618
- message: z31.string()
1581
+ 400: z30.object({
1582
+ message: z30.string()
1619
1583
  }),
1620
- 409: z31.object({
1621
- message: z31.string()
1584
+ 409: z30.object({
1585
+ message: z30.string()
1622
1586
  }),
1623
- 500: z31.object({
1624
- message: z31.string()
1587
+ 500: z30.object({
1588
+ message: z30.string()
1625
1589
  }),
1626
1590
  401: DefaultUnauthorizedSchema,
1627
1591
  404: DefaultNotFoundSchema,
@@ -1638,14 +1602,14 @@ var contactContract = initContract7().router(
1638
1602
  200: DefaultSuccessResponseSchema.extend({
1639
1603
  message: ContactContractValidationSchema.delete.response
1640
1604
  }),
1641
- 400: z31.object({
1642
- message: z31.string()
1605
+ 400: z30.object({
1606
+ message: z30.string()
1643
1607
  }),
1644
- 409: z31.object({
1645
- message: z31.string()
1608
+ 409: z30.object({
1609
+ message: z30.string()
1646
1610
  }),
1647
- 500: z31.object({
1648
- message: z31.string()
1611
+ 500: z30.object({
1612
+ message: z30.string()
1649
1613
  }),
1650
1614
  401: DefaultUnauthorizedSchema,
1651
1615
  404: DefaultNotFoundSchema,
@@ -1661,14 +1625,14 @@ var contactContract = initContract7().router(
1661
1625
  201: DefaultSuccessResponseSchema.extend({
1662
1626
  data: ContactContractValidationSchema.createContactByPhone.response
1663
1627
  }),
1664
- 400: z31.object({
1665
- message: z31.string()
1628
+ 400: z30.object({
1629
+ message: z30.string()
1666
1630
  }),
1667
- 409: z31.object({
1668
- message: z31.string()
1631
+ 409: z30.object({
1632
+ message: z30.string()
1669
1633
  }),
1670
- 500: z31.object({
1671
- message: z31.string()
1634
+ 500: z30.object({
1635
+ message: z30.string()
1672
1636
  }),
1673
1637
  401: DefaultUnauthorizedSchema,
1674
1638
  404: DefaultNotFoundSchema,
@@ -1684,14 +1648,14 @@ var contactContract = initContract7().router(
1684
1648
  201: DefaultSuccessResponseSchema.extend({
1685
1649
  data: ContactContractValidationSchema.updateFromOngoingCall.response
1686
1650
  }),
1687
- 400: z31.object({
1688
- message: z31.string()
1651
+ 400: z30.object({
1652
+ message: z30.string()
1689
1653
  }),
1690
- 409: z31.object({
1691
- message: z31.string()
1654
+ 409: z30.object({
1655
+ message: z30.string()
1692
1656
  }),
1693
- 500: z31.object({
1694
- message: z31.string()
1657
+ 500: z30.object({
1658
+ message: z30.string()
1695
1659
  }),
1696
1660
  401: DefaultUnauthorizedSchema,
1697
1661
  404: DefaultNotFoundSchema,
@@ -1707,14 +1671,14 @@ var contactContract = initContract7().router(
1707
1671
  200: DefaultSuccessResponseSchema.extend({
1708
1672
  data: ContactContractValidationSchema.merge.response
1709
1673
  }),
1710
- 400: z31.object({
1711
- message: z31.string()
1674
+ 400: z30.object({
1675
+ message: z30.string()
1712
1676
  }),
1713
- 409: z31.object({
1714
- message: z31.string()
1677
+ 409: z30.object({
1678
+ message: z30.string()
1715
1679
  }),
1716
- 500: z31.object({
1717
- message: z31.string()
1680
+ 500: z30.object({
1681
+ message: z30.string()
1718
1682
  }),
1719
1683
  401: DefaultUnauthorizedSchema,
1720
1684
  404: DefaultNotFoundSchema,
@@ -1730,14 +1694,14 @@ var contactContract = initContract7().router(
1730
1694
  200: DefaultSuccessResponseSchema.extend({
1731
1695
  existed: ContactContractValidationSchema.checkContactPhone.response
1732
1696
  }),
1733
- 400: z31.object({
1734
- message: z31.string()
1697
+ 400: z30.object({
1698
+ message: z30.string()
1735
1699
  }),
1736
- 409: z31.object({
1737
- message: z31.string()
1700
+ 409: z30.object({
1701
+ message: z30.string()
1738
1702
  }),
1739
- 500: z31.object({
1740
- message: z31.string()
1703
+ 500: z30.object({
1704
+ message: z30.string()
1741
1705
  }),
1742
1706
  401: DefaultUnauthorizedSchema,
1743
1707
  404: DefaultNotFoundSchema,
@@ -1753,14 +1717,14 @@ var contactContract = initContract7().router(
1753
1717
  200: DefaultSuccessResponseSchema.extend({
1754
1718
  existed: ContactContractValidationSchema.checkContactEmail.response
1755
1719
  }),
1756
- 400: z31.object({
1757
- message: z31.string()
1720
+ 400: z30.object({
1721
+ message: z30.string()
1758
1722
  }),
1759
- 409: z31.object({
1760
- message: z31.string()
1723
+ 409: z30.object({
1724
+ message: z30.string()
1761
1725
  }),
1762
- 500: z31.object({
1763
- message: z31.string()
1726
+ 500: z30.object({
1727
+ message: z30.string()
1764
1728
  }),
1765
1729
  401: DefaultUnauthorizedSchema,
1766
1730
  404: DefaultNotFoundSchema,
@@ -1772,21 +1736,21 @@ var contactContract = initContract7().router(
1772
1736
  addAttachments: {
1773
1737
  method: "POST",
1774
1738
  path: "/:id/attachments",
1775
- pathParams: z31.object({
1776
- id: z31.string().uuid()
1739
+ pathParams: z30.object({
1740
+ id: z30.string().uuid()
1777
1741
  }),
1778
1742
  responses: {
1779
1743
  201: DefaultSuccessResponseSchema.extend({
1780
1744
  message: ContactContractValidationSchema.addAttachments.response
1781
1745
  }),
1782
- 400: z31.object({
1783
- message: z31.string()
1746
+ 400: z30.object({
1747
+ message: z30.string()
1784
1748
  }),
1785
- 409: z31.object({
1786
- message: z31.string()
1749
+ 409: z30.object({
1750
+ message: z30.string()
1787
1751
  }),
1788
- 500: z31.object({
1789
- message: z31.string()
1752
+ 500: z30.object({
1753
+ message: z30.string()
1790
1754
  }),
1791
1755
  401: DefaultUnauthorizedSchema,
1792
1756
  404: DefaultNotFoundSchema,
@@ -1794,29 +1758,6 @@ var contactContract = initContract7().router(
1794
1758
  },
1795
1759
  body: ContactContractValidationSchema.addAttachments.request,
1796
1760
  summary: " attachment information from pre-uploaded files in AWS S3 to contacts."
1797
- },
1798
- getById: {
1799
- method: "GET",
1800
- path: "/:id",
1801
- pathParams: ContactContractValidationSchema.getById.request,
1802
- responses: {
1803
- 200: DefaultSuccessResponseSchema.extend({
1804
- data: ContactContractValidationSchema.getById.response
1805
- }),
1806
- 400: z31.object({
1807
- message: z31.string()
1808
- }),
1809
- 409: z31.object({
1810
- message: z31.string()
1811
- }),
1812
- 500: z31.object({
1813
- message: z31.string()
1814
- }),
1815
- 401: DefaultUnauthorizedSchema,
1816
- 404: DefaultNotFoundSchema,
1817
- 422: DefaultUnprocessibleSchema
1818
- },
1819
- summary: "Get a contact by id"
1820
1761
  }
1821
1762
  },
1822
1763
  {
@@ -1827,185 +1768,143 @@ var contactContract = initContract7().router(
1827
1768
 
1828
1769
  // src/ticket/index.ts
1829
1770
  import { initContract as initContract8 } from "@ts-rest/core";
1830
- import z34 from "zod";
1771
+ import z33 from "zod";
1831
1772
 
1832
1773
  // src/ticket/schema.ts
1833
- import z32 from "zod";
1774
+ import z31 from "zod";
1834
1775
  var TicketCustomFieldSchema = DefaultEntitySchema.extend({
1835
- textValue: z32.string().nullable(),
1836
- booleanValue: z32.boolean().nullable(),
1837
- numberValue: z32.coerce.number().nullable(),
1838
- dateValue: z32.date().nullable(),
1776
+ textValue: z31.string().nullable(),
1777
+ booleanValue: z31.boolean().nullable(),
1778
+ numberValue: z31.coerce.number().nullable(),
1779
+ dateValue: z31.date().nullable(),
1839
1780
  attribute: AttributeSchema.omit({ options: true, group: true }),
1840
- uploads: z32.array(
1841
- z32.object({
1842
- id: z32.string().uuid(),
1843
- createdAt: z32.date(),
1844
- updatedAt: z32.date(),
1845
- deletedAt: z32.date().nullable(),
1846
- customFieldId: z32.string(),
1781
+ uploads: z31.array(
1782
+ z31.object({
1783
+ id: z31.string().uuid(),
1784
+ createdAt: z31.date(),
1785
+ updatedAt: z31.date(),
1786
+ deletedAt: z31.date().nullable(),
1787
+ customFieldId: z31.string(),
1847
1788
  upload: UploadSchema
1848
1789
  })
1849
1790
  )
1850
1791
  });
1851
- var TicketEntityTypesSchema = z32.object({
1852
- id: z32.string().uuid(),
1853
- createdAt: z32.date(),
1854
- updatedAt: z32.date(),
1855
- deletedAt: z32.date().nullable(),
1856
- entity: z32.string(),
1857
- description: z32.string().nullable()
1858
- });
1859
- var TicketActivitySchema = z32.object({
1860
- id: z32.string().uuid(),
1861
- createdAt: z32.date(),
1862
- updatedAt: z32.date(),
1863
- deletedAt: z32.date().nullable(),
1864
- entityId: z32.string(),
1865
- description: z32.string(),
1792
+ var TicketEntityTypesSchema = z31.object({
1793
+ id: z31.string().uuid(),
1794
+ createdAt: z31.date(),
1795
+ updatedAt: z31.date(),
1796
+ deletedAt: z31.date().nullable(),
1797
+ entity: z31.string(),
1798
+ description: z31.string().nullable()
1799
+ });
1800
+ var TicketActivitySchema = z31.object({
1801
+ id: z31.string().uuid(),
1802
+ createdAt: z31.date(),
1803
+ updatedAt: z31.date(),
1804
+ deletedAt: z31.date().nullable(),
1805
+ entityId: z31.string(),
1806
+ description: z31.string(),
1866
1807
  entityType: TicketEntityTypesSchema
1867
1808
  });
1868
1809
  var TicketSchema = DefaultEntitySchema.extend({
1869
- title: z32.string(),
1870
- description: z32.string().nullable(),
1871
- type: z32.string(),
1872
- channel: z32.string(),
1873
- priority: z32.string(),
1874
- status: z32.string(),
1875
- contactId: z32.string().uuid(),
1876
- creatorId: z32.string().uuid(),
1877
- assigneeId: z32.string().uuid(),
1878
- reasonToAssign: z32.string().nullable(),
1879
- ticketNumber: z32.coerce.number().optional(),
1880
- customFields: z32.array(TicketCustomFieldSchema)
1881
- });
1882
- var TicketCountByContactSchema = z32.object({
1883
- total: z32.coerce.number(),
1884
- open: z32.coerce.number(),
1885
- pending: z32.coerce.number(),
1886
- closed: z32.coerce.number(),
1887
- solved: z32.coerce.number()
1810
+ title: z31.string(),
1811
+ description: z31.string().nullable(),
1812
+ type: z31.string(),
1813
+ channel: z31.string(),
1814
+ priority: z31.string(),
1815
+ status: z31.string(),
1816
+ contactId: z31.string().uuid(),
1817
+ creatorId: z31.string().uuid(),
1818
+ assigneeId: z31.string().uuid(),
1819
+ reasonToAssign: z31.string().nullable(),
1820
+ ticketNumber: z31.coerce.number().optional(),
1821
+ customFields: z31.array(TicketCustomFieldSchema)
1822
+ });
1823
+ var TicketCountByContactSchema = z31.object({
1824
+ total: z31.coerce.number(),
1825
+ open: z31.coerce.number(),
1826
+ pending: z31.coerce.number(),
1827
+ closed: z31.coerce.number(),
1828
+ solved: z31.coerce.number()
1888
1829
  });
1889
1830
 
1890
1831
  // src/ticket/validation.ts
1891
- import z33 from "zod";
1892
- var addErrorMessage = (field) => {
1893
- return field.refine(
1894
- ({ isRequired, value }) => {
1895
- if (isRequired) {
1896
- if (Array.isArray(value) && value.length === 0) {
1897
- return false;
1898
- }
1899
- if (isRequired && typeof value === "string" && !value.trim())
1900
- return false;
1901
- }
1902
- return true;
1903
- },
1904
- {
1905
- message: "This is a required field. You can not leave it empty."
1906
- }
1907
- );
1908
- };
1909
- var BaseSchema2 = z33.object({
1910
- isRequired: z33.boolean(),
1911
- attributeId: z33.string()
1832
+ import z32 from "zod";
1833
+ var BaseSchema2 = z32.object({
1834
+ isRequired: z32.boolean(),
1835
+ attributeId: z32.string()
1912
1836
  });
1913
- var SingleValue2 = addErrorMessage(
1914
- BaseSchema2.extend({
1915
- value: z33.string()
1916
- })
1917
- );
1918
- var CreateTicketValidationSchema = z33.object({
1919
- title: SingleValue2,
1920
- description: SingleValue2,
1921
- status: SingleValue2,
1922
- type: SingleValue2,
1923
- priority: SingleValue2,
1924
- contact: SingleValue2,
1925
- assignee: z33.object({
1926
- isRequired: z33.boolean(),
1927
- attributeId: z33.string(),
1928
- value: z33.string()
1837
+ var SingleValue2 = {
1838
+ value: z32.string()
1839
+ };
1840
+ var CreateTicketValidationSchema = z32.object({
1841
+ title: BaseSchema2.extend(SingleValue2),
1842
+ description: BaseSchema2.extend(SingleValue2),
1843
+ status: BaseSchema2.extend(SingleValue2),
1844
+ type: BaseSchema2.extend(SingleValue2),
1845
+ priority: BaseSchema2.extend(SingleValue2),
1846
+ contact: BaseSchema2.extend(SingleValue2),
1847
+ assignee: z32.object({
1848
+ isRequired: z32.boolean(),
1849
+ attributeId: z32.string().optional(),
1850
+ value: z32.string().optional()
1929
1851
  }),
1930
- channel: SingleValue2,
1931
- tags: addErrorMessage(BaseSchema2.extend({ value: z33.array(z33.string()) })),
1932
- categories: BaseSchema2.extend({ value: z33.array(z33.string()) }),
1933
- customFields: z33.array(
1934
- addErrorMessage(
1935
- BaseSchema2.extend({
1936
- value: z33.union([z33.string(), z33.array(z33.string())]),
1937
- type: z33.string(),
1938
- isDefaultAttribute: z33.boolean()
1939
- })
1940
- )
1852
+ channel: BaseSchema2.extend(SingleValue2),
1853
+ tags: BaseSchema2.extend({ value: z32.array(z32.string()) }),
1854
+ categories: BaseSchema2.extend({ value: z32.array(z32.string()) }),
1855
+ customFields: z32.array(
1856
+ BaseSchema2.extend({
1857
+ value: z32.union([z32.string(), z32.array(z32.string())]),
1858
+ // value: z.string(),
1859
+ type: z32.string(),
1860
+ isDefaultAttribute: z32.boolean()
1861
+ })
1941
1862
  ),
1942
- reasonToAssign: z33.object({ value: z33.string() }).optional()
1863
+ reasonToAssign: z32.object({ value: z32.string() }).optional()
1943
1864
  });
1944
1865
  var UpdateTicketValidationSchema = CreateTicketValidationSchema;
1945
- var TicketAttachmentRecordSchema = z33.object({
1946
- bucketName: z33.string(),
1947
- fileKey: z33.string(),
1948
- fileName: z33.string(),
1949
- fileSize: z33.coerce.number(),
1950
- url: z33.string()
1951
- });
1952
- var CreateTicketAttachmentRecordsSchema = z33.object({
1953
- ticketId: z33.string(),
1954
- attributeId: z33.string(),
1955
- ticketAttachmentRecords: z33.array(TicketAttachmentRecordSchema)
1956
- });
1957
- var TicketParamsSchema = z33.object({
1958
- page: z33.coerce.number().default(1),
1959
- pageSize: z33.coerce.number().default(10)
1960
- });
1961
- var CustomFieldQuery = z33.object({
1962
- attributeId: z33.string(),
1963
- type: z33.string(),
1964
- value: z33.union([z33.string(), z33.array(z33.string())])
1965
- });
1966
- var GetAllTicketQuerySchema = z33.object({
1967
- page: z33.string().transform((value) => Number(value)),
1968
- pageSize: z33.string().transform((value) => Number(value)),
1969
- agent: z33.array(z33.string()),
1970
- selectedDate: z33.string(),
1971
- keyword: z33.string(),
1972
- title: z33.string(),
1973
- description: z33.string(),
1974
- status: z33.array(z33.string()),
1975
- priority: z33.array(z33.string()),
1976
- channel: z33.array(z33.string()),
1977
- type: z33.array(z33.string()),
1978
- ticketType: z33.array(z33.string()),
1979
- contact: z33.array(z33.string()),
1980
- tags: z33.array(z33.string()),
1981
- categories: z33.array(z33.string()),
1982
- customFields: z33.array(
1983
- z33.object({
1984
- attributeId: z33.string().uuid(),
1985
- type: z33.string(),
1986
- value: z33.union([z33.string(), z33.array(z33.string())])
1987
- })
1988
- )
1989
- }).partial();
1990
- var ExportAllTicketQuerySchema = z33.object({
1991
- agent: z33.array(z33.string()),
1992
- selectedDate: z33.string(),
1993
- keyword: z33.string(),
1994
- title: z33.string(),
1995
- description: z33.string(),
1996
- status: z33.array(z33.string()),
1997
- priority: z33.array(z33.string()),
1998
- channel: z33.array(z33.string()),
1999
- type: z33.array(z33.string()),
2000
- ticketType: z33.array(z33.string()),
2001
- contact: z33.array(z33.string()),
2002
- tags: z33.array(z33.string()),
2003
- categories: z33.array(z33.string()),
2004
- customFields: z33.array(
2005
- z33.object({
2006
- attributeId: z33.string().uuid(),
2007
- type: z33.string(),
2008
- value: z33.union([z33.string(), z33.array(z33.string())])
1866
+ var TicketAttachmentRecordSchema = z32.object({
1867
+ bucketName: z32.string(),
1868
+ fileKey: z32.string(),
1869
+ fileName: z32.string(),
1870
+ fileSize: z32.coerce.number(),
1871
+ url: z32.string()
1872
+ });
1873
+ var CreateTicketAttachmentRecordsSchema = z32.object({
1874
+ ticketId: z32.string(),
1875
+ attributeId: z32.string(),
1876
+ ticketAttachmentRecords: z32.array(TicketAttachmentRecordSchema)
1877
+ });
1878
+ var TicketParamsSchema = z32.object({
1879
+ page: z32.coerce.number().default(1),
1880
+ pageSize: z32.coerce.number().default(10)
1881
+ });
1882
+ var CustomFieldQuery = z32.object({
1883
+ attributeId: z32.string(),
1884
+ type: z32.string(),
1885
+ value: z32.union([z32.string(), z32.array(z32.string())])
1886
+ });
1887
+ var GetAllTicketQuerySchema = z32.object({
1888
+ page: z32.string().transform((value) => Number(value)),
1889
+ pageSize: z32.string().transform((value) => Number(value)),
1890
+ agent: z32.array(z32.string()),
1891
+ selectedDate: z32.string(),
1892
+ keyword: z32.string(),
1893
+ title: z32.string(),
1894
+ description: z32.string(),
1895
+ status: z32.array(z32.string()),
1896
+ priority: z32.array(z32.string()),
1897
+ channel: z32.array(z32.string()),
1898
+ type: z32.array(z32.string()),
1899
+ ticketType: z32.array(z32.string()),
1900
+ contact: z32.array(z32.string()),
1901
+ tags: z32.array(z32.string()),
1902
+ categories: z32.array(z32.string()),
1903
+ customFields: z32.array(
1904
+ z32.object({
1905
+ attributeId: z32.string().uuid(),
1906
+ type: z32.string(),
1907
+ value: z32.union([z32.string(), z32.array(z32.string())])
2009
1908
  })
2010
1909
  )
2011
1910
  }).partial();
@@ -2019,16 +1918,16 @@ var ticketContract = initContract8().router(
2019
1918
  headers: DefaultHeaderSchema,
2020
1919
  responses: {
2021
1920
  201: DefaultSuccessResponseSchema.extend({
2022
- data: TicketSchema
1921
+ message: TicketSchema
2023
1922
  }),
2024
- 400: z34.object({
2025
- message: z34.string()
1923
+ 400: z33.object({
1924
+ message: z33.string()
2026
1925
  }),
2027
- 409: z34.object({
2028
- message: z34.string()
1926
+ 409: z33.object({
1927
+ message: z33.string()
2029
1928
  }),
2030
- 500: z34.object({
2031
- message: z34.string()
1929
+ 500: z33.object({
1930
+ message: z33.string()
2032
1931
  }),
2033
1932
  401: DefaultUnauthorizedSchema,
2034
1933
  404: DefaultNotFoundSchema,
@@ -2047,8 +1946,8 @@ var ticketContract = initContract8().router(
2047
1946
  // The response data should contain the user relation.
2048
1947
  TicketSchema
2049
1948
  ),
2050
- 400: z34.object({
2051
- message: z34.string()
1949
+ 400: z33.object({
1950
+ message: z33.string()
2052
1951
  }),
2053
1952
  401: DefaultUnauthorizedSchema,
2054
1953
  500: DefaultErrorResponseSchema
@@ -2058,12 +1957,12 @@ var ticketContract = initContract8().router(
2058
1957
  getTicketById: {
2059
1958
  method: "GET",
2060
1959
  path: "/:id",
2061
- pathParams: z34.object({ id: z34.string() }),
1960
+ pathParams: z33.object({ id: z33.string() }),
2062
1961
  headers: DefaultHeaderSchema,
2063
1962
  responses: {
2064
1963
  200: TicketSchema,
2065
- 400: z34.object({
2066
- message: z34.string()
1964
+ 400: z33.object({
1965
+ message: z33.string()
2067
1966
  }),
2068
1967
  401: DefaultUnauthorizedSchema,
2069
1968
  500: DefaultErrorResponseSchema
@@ -2073,13 +1972,13 @@ var ticketContract = initContract8().router(
2073
1972
  getTicketByContactId: {
2074
1973
  method: "GET",
2075
1974
  path: "/contact/:id",
2076
- pathParams: z34.object({ id: z34.string() }),
1975
+ pathParams: z33.object({ id: z33.string() }),
2077
1976
  query: TicketParamsSchema,
2078
1977
  headers: DefaultHeaderSchema,
2079
1978
  responses: {
2080
1979
  200: WithPagination(TicketSchema),
2081
- 400: z34.object({
2082
- message: z34.string()
1980
+ 400: z33.object({
1981
+ message: z33.string()
2083
1982
  }),
2084
1983
  401: DefaultUnauthorizedSchema,
2085
1984
  500: DefaultErrorResponseSchema
@@ -2089,21 +1988,21 @@ var ticketContract = initContract8().router(
2089
1988
  updateTicket: {
2090
1989
  method: "PATCH",
2091
1990
  path: "/:id",
2092
- pathParams: z34.object({ id: z34.string() }),
1991
+ pathParams: z33.object({ id: z33.string() }),
2093
1992
  body: UpdateTicketValidationSchema,
2094
1993
  headers: DefaultHeaderSchema,
2095
1994
  responses: {
2096
1995
  201: DefaultSuccessResponseSchema.extend({
2097
1996
  message: TicketSchema
2098
1997
  }),
2099
- 400: z34.object({
2100
- message: z34.string()
1998
+ 400: z33.object({
1999
+ message: z33.string()
2101
2000
  }),
2102
- 409: z34.object({
2103
- message: z34.string()
2001
+ 409: z33.object({
2002
+ message: z33.string()
2104
2003
  }),
2105
- 500: z34.object({
2106
- message: z34.string()
2004
+ 500: z33.object({
2005
+ message: z33.string()
2107
2006
  }),
2108
2007
  401: DefaultUnauthorizedSchema,
2109
2008
  404: DefaultNotFoundSchema,
@@ -2114,11 +2013,11 @@ var ticketContract = initContract8().router(
2114
2013
  deleteTicket: {
2115
2014
  method: "DELETE",
2116
2015
  path: "/:id",
2117
- pathParams: z34.object({ id: z34.string() }),
2016
+ pathParams: z33.object({ id: z33.string() }),
2118
2017
  headers: DefaultHeaderSchema,
2119
2018
  body: null,
2120
2019
  responses: {
2121
- 200: DefaultSuccessResponseSchema.extend({ message: z34.string() }),
2020
+ 200: DefaultSuccessResponseSchema.extend({ message: z33.string() }),
2122
2021
  500: DefaultErrorResponseSchema
2123
2022
  },
2124
2023
  summary: "Delete a extension."
@@ -2126,19 +2025,19 @@ var ticketContract = initContract8().router(
2126
2025
  updateDescription: {
2127
2026
  method: "PATCH",
2128
2027
  path: "/description/update/:id",
2129
- pathParams: z34.object({ id: z34.string() }),
2130
- body: z34.object({ description: z34.string() }),
2028
+ pathParams: z33.object({ id: z33.string() }),
2029
+ body: z33.object({ description: z33.string() }),
2131
2030
  headers: DefaultHeaderSchema,
2132
2031
  responses: {
2133
- 201: DefaultSuccessResponseSchema.extend({ message: z34.string() }),
2134
- 400: z34.object({
2135
- message: z34.string()
2032
+ 201: DefaultSuccessResponseSchema.extend({ message: z33.string() }),
2033
+ 400: z33.object({
2034
+ message: z33.string()
2136
2035
  }),
2137
- 409: z34.object({
2138
- message: z34.string()
2036
+ 409: z33.object({
2037
+ message: z33.string()
2139
2038
  }),
2140
- 500: z34.object({
2141
- message: z34.string()
2039
+ 500: z33.object({
2040
+ message: z33.string()
2142
2041
  }),
2143
2042
  401: DefaultUnauthorizedSchema,
2144
2043
  404: DefaultNotFoundSchema,
@@ -2149,19 +2048,19 @@ var ticketContract = initContract8().router(
2149
2048
  updateTitle: {
2150
2049
  method: "PATCH",
2151
2050
  path: "/title/update/:id",
2152
- pathParams: z34.object({ id: z34.string() }),
2153
- body: z34.object({ title: z34.string() }),
2051
+ pathParams: z33.object({ id: z33.string() }),
2052
+ body: z33.object({ title: z33.string() }),
2154
2053
  headers: DefaultHeaderSchema,
2155
2054
  responses: {
2156
- 200: DefaultSuccessResponseSchema.extend({ message: z34.string() }),
2157
- 400: z34.object({
2158
- message: z34.string()
2055
+ 200: DefaultSuccessResponseSchema.extend({ message: z33.string() }),
2056
+ 400: z33.object({
2057
+ message: z33.string()
2159
2058
  }),
2160
- 409: z34.object({
2161
- message: z34.string()
2059
+ 409: z33.object({
2060
+ message: z33.string()
2162
2061
  }),
2163
- 500: z34.object({
2164
- message: z34.string()
2062
+ 500: z33.object({
2063
+ message: z33.string()
2165
2064
  }),
2166
2065
  401: DefaultUnauthorizedSchema,
2167
2066
  404: DefaultNotFoundSchema,
@@ -2172,19 +2071,19 @@ var ticketContract = initContract8().router(
2172
2071
  updateType: {
2173
2072
  method: "PATCH",
2174
2073
  path: "/type/update/:id",
2175
- pathParams: z34.object({ id: z34.string() }),
2176
- body: z34.object({ type: z34.string() }),
2074
+ pathParams: z33.object({ id: z33.string() }),
2075
+ body: z33.object({ type: z33.string() }),
2177
2076
  headers: DefaultHeaderSchema,
2178
2077
  responses: {
2179
- 200: DefaultSuccessResponseSchema.extend({ message: z34.string() }),
2180
- 400: z34.object({
2181
- message: z34.string()
2078
+ 200: DefaultSuccessResponseSchema.extend({ message: z33.string() }),
2079
+ 400: z33.object({
2080
+ message: z33.string()
2182
2081
  }),
2183
- 409: z34.object({
2184
- message: z34.string()
2082
+ 409: z33.object({
2083
+ message: z33.string()
2185
2084
  }),
2186
- 500: z34.object({
2187
- message: z34.string()
2085
+ 500: z33.object({
2086
+ message: z33.string()
2188
2087
  }),
2189
2088
  401: DefaultUnauthorizedSchema,
2190
2089
  404: DefaultNotFoundSchema,
@@ -2195,19 +2094,19 @@ var ticketContract = initContract8().router(
2195
2094
  updateStatus: {
2196
2095
  method: "PATCH",
2197
2096
  path: "/status/update/:id",
2198
- pathParams: z34.object({ id: z34.string() }),
2199
- body: z34.object({ status: z34.string() }),
2097
+ pathParams: z33.object({ id: z33.string() }),
2098
+ body: z33.object({ status: z33.string() }),
2200
2099
  headers: DefaultHeaderSchema,
2201
2100
  responses: {
2202
- 200: DefaultSuccessResponseSchema.extend({ message: z34.string() }),
2203
- 400: z34.object({
2204
- message: z34.string()
2101
+ 200: DefaultSuccessResponseSchema.extend({ message: z33.string() }),
2102
+ 400: z33.object({
2103
+ message: z33.string()
2205
2104
  }),
2206
- 409: z34.object({
2207
- message: z34.string()
2105
+ 409: z33.object({
2106
+ message: z33.string()
2208
2107
  }),
2209
- 500: z34.object({
2210
- message: z34.string()
2108
+ 500: z33.object({
2109
+ message: z33.string()
2211
2110
  }),
2212
2111
  401: DefaultUnauthorizedSchema,
2213
2112
  404: DefaultNotFoundSchema,
@@ -2218,19 +2117,19 @@ var ticketContract = initContract8().router(
2218
2117
  updatePriority: {
2219
2118
  method: "PATCH",
2220
2119
  path: "/priority/update/:id",
2221
- pathParams: z34.object({ id: z34.string() }),
2222
- body: z34.object({ priority: z34.string() }),
2120
+ pathParams: z33.object({ id: z33.string() }),
2121
+ body: z33.object({ priority: z33.string() }),
2223
2122
  headers: DefaultHeaderSchema,
2224
2123
  responses: {
2225
- 200: DefaultSuccessResponseSchema.extend({ message: z34.string() }),
2226
- 400: z34.object({
2227
- message: z34.string()
2124
+ 200: DefaultSuccessResponseSchema.extend({ message: z33.string() }),
2125
+ 400: z33.object({
2126
+ message: z33.string()
2228
2127
  }),
2229
- 409: z34.object({
2230
- message: z34.string()
2128
+ 409: z33.object({
2129
+ message: z33.string()
2231
2130
  }),
2232
- 500: z34.object({
2233
- message: z34.string()
2131
+ 500: z33.object({
2132
+ message: z33.string()
2234
2133
  }),
2235
2134
  401: DefaultUnauthorizedSchema,
2236
2135
  404: DefaultNotFoundSchema,
@@ -2241,19 +2140,19 @@ var ticketContract = initContract8().router(
2241
2140
  updateChannel: {
2242
2141
  method: "PATCH",
2243
2142
  path: "/channel/update/:id",
2244
- pathParams: z34.object({ id: z34.string() }),
2245
- body: z34.object({ channel: z34.string() }),
2143
+ pathParams: z33.object({ id: z33.string() }),
2144
+ body: z33.object({ channel: z33.string() }),
2246
2145
  headers: DefaultHeaderSchema,
2247
2146
  responses: {
2248
- 200: DefaultSuccessResponseSchema.extend({ message: z34.string() }),
2249
- 400: z34.object({
2250
- message: z34.string()
2147
+ 200: DefaultSuccessResponseSchema.extend({ message: z33.string() }),
2148
+ 400: z33.object({
2149
+ message: z33.string()
2251
2150
  }),
2252
- 409: z34.object({
2253
- message: z34.string()
2151
+ 409: z33.object({
2152
+ message: z33.string()
2254
2153
  }),
2255
- 500: z34.object({
2256
- message: z34.string()
2154
+ 500: z33.object({
2155
+ message: z33.string()
2257
2156
  }),
2258
2157
  401: DefaultUnauthorizedSchema,
2259
2158
  404: DefaultNotFoundSchema,
@@ -2264,19 +2163,19 @@ var ticketContract = initContract8().router(
2264
2163
  updateTags: {
2265
2164
  method: "PATCH",
2266
2165
  path: "/tags/update/:id",
2267
- pathParams: z34.object({ id: z34.string() }),
2268
- body: z34.object({ tags: z34.array(z34.string()) }),
2166
+ pathParams: z33.object({ id: z33.string() }),
2167
+ body: z33.object({ tags: z33.array(z33.string()) }),
2269
2168
  headers: DefaultHeaderSchema,
2270
2169
  responses: {
2271
- 200: DefaultSuccessResponseSchema.extend({ message: z34.string() }),
2272
- 400: z34.object({
2273
- message: z34.string()
2170
+ 200: DefaultSuccessResponseSchema.extend({ message: z33.string() }),
2171
+ 400: z33.object({
2172
+ message: z33.string()
2274
2173
  }),
2275
- 409: z34.object({
2276
- message: z34.string()
2174
+ 409: z33.object({
2175
+ message: z33.string()
2277
2176
  }),
2278
- 500: z34.object({
2279
- message: z34.string()
2177
+ 500: z33.object({
2178
+ message: z33.string()
2280
2179
  }),
2281
2180
  401: DefaultUnauthorizedSchema,
2282
2181
  404: DefaultNotFoundSchema,
@@ -2287,19 +2186,19 @@ var ticketContract = initContract8().router(
2287
2186
  changeAssignee: {
2288
2187
  method: "PATCH",
2289
2188
  path: "/assignee/update/:id",
2290
- pathParams: z34.object({ id: z34.string() }),
2291
- body: z34.object({ ticketId: z34.string(), assigneeId: z34.string() }),
2189
+ pathParams: z33.object({ id: z33.string() }),
2190
+ body: z33.object({ ticketId: z33.string(), assigneeId: z33.string() }),
2292
2191
  headers: DefaultHeaderSchema,
2293
2192
  responses: {
2294
2193
  200: TicketSchema,
2295
- 400: z34.object({
2296
- message: z34.string()
2194
+ 400: z33.object({
2195
+ message: z33.string()
2297
2196
  }),
2298
- 409: z34.object({
2299
- message: z34.string()
2197
+ 409: z33.object({
2198
+ message: z33.string()
2300
2199
  }),
2301
- 500: z34.object({
2302
- message: z34.string()
2200
+ 500: z33.object({
2201
+ message: z33.string()
2303
2202
  }),
2304
2203
  401: DefaultUnauthorizedSchema,
2305
2204
  404: DefaultNotFoundSchema,
@@ -2310,12 +2209,12 @@ var ticketContract = initContract8().router(
2310
2209
  getTicketCountByContact: {
2311
2210
  method: "GET",
2312
2211
  path: "/ticket_count/contact/:id",
2313
- pathParams: z34.object({ id: z34.string() }),
2212
+ pathParams: z33.object({ id: z33.string() }),
2314
2213
  headers: DefaultHeaderSchema,
2315
2214
  responses: {
2316
2215
  200: TicketCountByContactSchema,
2317
- 400: z34.object({
2318
- message: z34.string()
2216
+ 400: z33.object({
2217
+ message: z33.string()
2319
2218
  }),
2320
2219
  401: DefaultUnauthorizedSchema,
2321
2220
  500: DefaultErrorResponseSchema
@@ -2325,16 +2224,16 @@ var ticketContract = initContract8().router(
2325
2224
  getTicketByContact: {
2326
2225
  method: "GET",
2327
2226
  path: "/contact/:id",
2328
- pathParams: z34.object({ id: z34.string() }),
2329
- query: z34.object({
2330
- page: z34.coerce.number().default(1),
2331
- pageSize: z34.coerce.number().default(10)
2227
+ pathParams: z33.object({ id: z33.string() }),
2228
+ query: z33.object({
2229
+ page: z33.coerce.number().default(1),
2230
+ pageSize: z33.coerce.number().default(10)
2332
2231
  }).optional(),
2333
2232
  headers: DefaultHeaderSchema,
2334
2233
  responses: {
2335
2234
  200: WithPagination(TicketSchema),
2336
- 400: z34.object({
2337
- message: z34.string()
2235
+ 400: z33.object({
2236
+ message: z33.string()
2338
2237
  }),
2339
2238
  401: DefaultUnauthorizedSchema,
2340
2239
  500: DefaultErrorResponseSchema
@@ -2348,31 +2247,20 @@ var ticketContract = initContract8().router(
2348
2247
  body: CreateTicketAttachmentRecordsSchema,
2349
2248
  responses: {
2350
2249
  201: TicketCustomFieldSchema,
2351
- 400: z34.object({
2352
- message: z34.string()
2250
+ 400: z33.object({
2251
+ message: z33.string()
2353
2252
  }),
2354
- 409: z34.object({
2355
- message: z34.string()
2253
+ 409: z33.object({
2254
+ message: z33.string()
2356
2255
  }),
2357
- 500: z34.object({
2358
- message: z34.string()
2256
+ 500: z33.object({
2257
+ message: z33.string()
2359
2258
  }),
2360
2259
  401: DefaultUnauthorizedSchema,
2361
2260
  404: DefaultNotFoundSchema,
2362
2261
  422: DefaultUnprocessibleSchema
2363
2262
  },
2364
2263
  summary: "Create a new ticket attachment"
2365
- },
2366
- exportTicket: {
2367
- method: "GET",
2368
- path: "/export",
2369
- headers: DefaultHeaderSchema,
2370
- responses: {
2371
- 200: null,
2372
- 401: DefaultUnauthorizedSchema
2373
- },
2374
- query: ExportAllTicketQuerySchema,
2375
- summary: "Export tickets"
2376
2264
  }
2377
2265
  },
2378
2266
  { pathPrefix: "ticket" }
@@ -2380,45 +2268,45 @@ var ticketContract = initContract8().router(
2380
2268
 
2381
2269
  // src/cx-log/index.ts
2382
2270
  import { initContract as initContract9 } from "@ts-rest/core";
2383
- import z36 from "zod";
2271
+ import z35 from "zod";
2384
2272
 
2385
2273
  // src/cx-log/validation.ts
2386
- import z35 from "zod";
2387
- var sentimentScoreSchema = z35.union([
2388
- z35.literal("positive"),
2389
- z35.literal("negative")
2274
+ import z34 from "zod";
2275
+ var sentimentScoreSchema = z34.union([
2276
+ z34.literal("positive"),
2277
+ z34.literal("negative")
2390
2278
  ]);
2391
- var CustomFieldQueryParamsSchema = z35.object({
2392
- attributeId: z35.string(),
2393
- value: z35.union([z35.string(), z35.array(z35.string())]),
2394
- type: z35.string().optional()
2279
+ var CustomFieldQueryParamsSchema = z34.object({
2280
+ attributeId: z34.string(),
2281
+ value: z34.union([z34.string(), z34.array(z34.string())]),
2282
+ type: z34.string().optional()
2395
2283
  });
2396
2284
  var GetAllCxLogQueryParamsSchema = DefaultQueryParamsSchema.extend({
2397
- contactId: z35.string().uuid(),
2398
- caseId: z35.string(),
2399
- channelIds: z35.array(z35.string().uuid()),
2400
- queueId: z35.array(z35.string()),
2401
- agentIds: z35.array(z35.string()),
2402
- direction: z35.array(z35.union([z35.literal("inbound"), z35.literal("outbound")])),
2403
- disposition: z35.array(z35.string()),
2404
- sentimentScore: z35.array(sentimentScoreSchema),
2405
- csatScore: z35.string(),
2406
- sla: z35.array(z35.union([z35.literal("meet"), z35.literal("unmeet")])),
2407
- tags: z35.array(z35.string()),
2285
+ contactId: z34.string().uuid(),
2286
+ caseId: z34.string(),
2287
+ channelIds: z34.array(z34.string().uuid()),
2288
+ queueId: z34.array(z34.string()),
2289
+ agentIds: z34.array(z34.string()),
2290
+ direction: z34.array(z34.union([z34.literal("inbound"), z34.literal("outbound")])),
2291
+ disposition: z34.array(z34.string()),
2292
+ sentimentScore: z34.array(sentimentScoreSchema),
2293
+ csatScore: z34.string(),
2294
+ sla: z34.array(z34.union([z34.literal("meet"), z34.literal("unmeet")])),
2295
+ tags: z34.array(z34.string()),
2408
2296
  // General tags
2409
2297
  // Default contact attributes
2410
- name: z35.string(),
2411
- contactLabels: z35.array(z35.string()),
2412
- email: z35.string(),
2413
- channel: z35.array(z35.string()),
2414
- phone: z35.string(),
2415
- notes: z35.string(),
2416
- address: z35.string(),
2417
- company: z35.array(z35.string()),
2298
+ name: z34.string(),
2299
+ contactLabels: z34.array(z34.string()),
2300
+ email: z34.string(),
2301
+ channel: z34.array(z34.string()),
2302
+ phone: z34.string(),
2303
+ notes: z34.string(),
2304
+ address: z34.string(),
2305
+ company: z34.array(z34.string()),
2418
2306
  // Custom fields
2419
- customFields: z35.array(CustomFieldQueryParamsSchema),
2307
+ customFields: z34.array(CustomFieldQueryParamsSchema),
2420
2308
  // Date filter
2421
- selectedDate: z35.string()
2309
+ selectedDate: z34.string()
2422
2310
  }).partial().optional();
2423
2311
 
2424
2312
  // src/cx-log/index.ts
@@ -2429,10 +2317,10 @@ var cxLogContract = initContract9().router({
2429
2317
  headers: DefaultHeaderSchema,
2430
2318
  responses: {
2431
2319
  200: DefaultSuccessResponseSchema.extend({
2432
- total: z36.number(),
2433
- page: z36.number(),
2434
- pageSize: z36.number(),
2435
- cxLogs: z36.array(CxLogSchemaWithRelations)
2320
+ total: z35.number(),
2321
+ page: z35.number(),
2322
+ pageSize: z35.number(),
2323
+ cxLogs: z35.array(CxLogSchemaWithRelations)
2436
2324
  }),
2437
2325
  401: DefaultUnauthorizedSchema
2438
2326
  },
@@ -2454,16 +2342,16 @@ var cxLogContract = initContract9().router({
2454
2342
 
2455
2343
  // src/extension/index.ts
2456
2344
  import { initContract as initContract10 } from "@ts-rest/core";
2457
- import z38 from "zod";
2345
+ import z37 from "zod";
2458
2346
 
2459
2347
  // src/extension/validation.ts
2460
- import { z as z37 } from "zod";
2461
- var CreateExtensionSchema = z37.object({
2462
- userId: z37.string().nullable(),
2463
- sipUserName: z37.string(),
2464
- extensionId: z37.coerce.number().nullable(),
2465
- extensionName: z37.string().nullable(),
2466
- telephonySignature: z37.string().nullable().optional()
2348
+ import { z as z36 } from "zod";
2349
+ var CreateExtensionSchema = z36.object({
2350
+ userId: z36.string().nullable(),
2351
+ sipUserName: z36.string(),
2352
+ extensionId: z36.coerce.number().nullable(),
2353
+ extensionName: z36.string().nullable(),
2354
+ telephonySignature: z36.string().nullable().optional()
2467
2355
  });
2468
2356
  var UpdateExtensionSchema = CreateExtensionSchema;
2469
2357
 
@@ -2479,8 +2367,8 @@ var extensionContract = initContract10().router(
2479
2367
  201: DefaultSuccessResponseSchema.extend({
2480
2368
  extension: ExtensionSchema
2481
2369
  }),
2482
- 400: z38.object({
2483
- message: z38.string()
2370
+ 400: z37.object({
2371
+ message: z37.string()
2484
2372
  }),
2485
2373
  401: DefaultUnauthorizedSchema,
2486
2374
  500: DefaultErrorResponseSchema
@@ -2490,10 +2378,10 @@ var extensionContract = initContract10().router(
2490
2378
  getExtensions: {
2491
2379
  method: "GET",
2492
2380
  path: "",
2493
- query: z38.object({
2494
- page: z38.coerce.number().default(1),
2495
- pageSize: z38.coerce.number().default(10),
2496
- keyword: z38.string().optional()
2381
+ query: z37.object({
2382
+ page: z37.coerce.number().default(1),
2383
+ pageSize: z37.coerce.number().default(10),
2384
+ keyword: z37.string().optional()
2497
2385
  }).optional(),
2498
2386
  headers: DefaultHeaderSchema,
2499
2387
  responses: {
@@ -2503,8 +2391,8 @@ var extensionContract = initContract10().router(
2503
2391
  user: UserSchema
2504
2392
  })
2505
2393
  ),
2506
- 400: z38.object({
2507
- message: z38.string()
2394
+ 400: z37.object({
2395
+ message: z37.string()
2508
2396
  }),
2509
2397
  401: DefaultUnauthorizedSchema,
2510
2398
  500: DefaultErrorResponseSchema
@@ -2514,12 +2402,12 @@ var extensionContract = initContract10().router(
2514
2402
  getExtensionByUserId: {
2515
2403
  method: "GET",
2516
2404
  path: "/user/:userId",
2517
- pathParams: z38.object({ userId: z38.string() }),
2405
+ pathParams: z37.object({ userId: z37.string() }),
2518
2406
  headers: DefaultHeaderSchema,
2519
2407
  responses: {
2520
2408
  200: ExtensionSchema,
2521
- 400: z38.object({
2522
- message: z38.string()
2409
+ 400: z37.object({
2410
+ message: z37.string()
2523
2411
  }),
2524
2412
  401: DefaultUnauthorizedSchema,
2525
2413
  500: DefaultErrorResponseSchema
@@ -2529,17 +2417,17 @@ var extensionContract = initContract10().router(
2529
2417
  getExtensionByDialpad: {
2530
2418
  method: "GET",
2531
2419
  path: "/dialpad",
2532
- query: z38.object({
2533
- page: z38.coerce.number().default(1),
2534
- pageSize: z38.coerce.number().default(10),
2535
- keyword: z38.string().optional()
2420
+ query: z37.object({
2421
+ page: z37.coerce.number().default(1),
2422
+ pageSize: z37.coerce.number().default(10),
2423
+ keyword: z37.string().optional()
2536
2424
  }).optional(),
2537
2425
  headers: DefaultHeaderSchema,
2538
2426
  responses: {
2539
2427
  200: WithPagination(ExtensionSchema),
2540
2428
  500: DefaultErrorResponseSchema,
2541
- 400: z38.object({
2542
- message: z38.string()
2429
+ 400: z37.object({
2430
+ message: z37.string()
2543
2431
  }),
2544
2432
  401: DefaultUnauthorizedSchema
2545
2433
  },
@@ -2548,7 +2436,7 @@ var extensionContract = initContract10().router(
2548
2436
  updateExtension: {
2549
2437
  method: "PATCH",
2550
2438
  path: "/:id",
2551
- pathParams: z38.object({ id: z38.string() }),
2439
+ pathParams: z37.object({ id: z37.string() }),
2552
2440
  headers: DefaultHeaderSchema,
2553
2441
  body: UpdateExtensionSchema,
2554
2442
  responses: {
@@ -2562,11 +2450,11 @@ var extensionContract = initContract10().router(
2562
2450
  deleteExtension: {
2563
2451
  method: "DELETE",
2564
2452
  path: "/:id",
2565
- pathParams: z38.object({ id: z38.string() }),
2453
+ pathParams: z37.object({ id: z37.string() }),
2566
2454
  headers: DefaultHeaderSchema,
2567
2455
  body: null,
2568
2456
  responses: {
2569
- 200: DefaultSuccessResponseSchema.extend({ message: z38.string() }),
2457
+ 200: DefaultSuccessResponseSchema.extend({ message: z37.string() }),
2570
2458
  500: DefaultErrorResponseSchema
2571
2459
  },
2572
2460
  summary: "Delete a extension."
@@ -2577,22 +2465,22 @@ var extensionContract = initContract10().router(
2577
2465
 
2578
2466
  // src/line/index.ts
2579
2467
  import { initContract as initContract11 } from "@ts-rest/core";
2580
- import z41 from "zod";
2468
+ import z40 from "zod";
2581
2469
 
2582
2470
  // src/line/schema.ts
2583
- import z39 from "zod";
2584
- var ConnectLineSchema = z39.object({
2585
- id: z39.string(),
2586
- accessToken: z39.string()
2471
+ import z38 from "zod";
2472
+ var ConnectLineSchema = z38.object({
2473
+ id: z38.string(),
2474
+ accessToken: z38.string()
2587
2475
  });
2588
2476
 
2589
2477
  // src/line/validation.ts
2590
- import z40 from "zod";
2591
- var SendLineStickerSchema = z40.object({
2592
- userId: z40.string().uuid(),
2593
- packageId: z40.string(),
2594
- stickerId: z40.string(),
2595
- accessToken: z40.string()
2478
+ import z39 from "zod";
2479
+ var SendLineStickerSchema = z39.object({
2480
+ userId: z39.string().uuid(),
2481
+ packageId: z39.string(),
2482
+ stickerId: z39.string(),
2483
+ accessToken: z39.string()
2596
2484
  });
2597
2485
 
2598
2486
  // src/line/index.ts
@@ -2602,7 +2490,7 @@ var lineContract = initContract11().router({
2602
2490
  path: "sticker",
2603
2491
  responses: {
2604
2492
  200: DefaultSuccessResponseSchema.extend({
2605
- data: z41.any()
2493
+ data: z40.any()
2606
2494
  }),
2607
2495
  500: DefaultErrorResponseSchema
2608
2496
  },
@@ -2614,7 +2502,7 @@ var lineContract = initContract11().router({
2614
2502
  path: "connect",
2615
2503
  responses: {
2616
2504
  200: DefaultSuccessResponseSchema.extend({
2617
- data: z41.any()
2505
+ data: z40.any()
2618
2506
  }),
2619
2507
  500: DefaultErrorResponseSchema
2620
2508
  },
@@ -2625,7 +2513,7 @@ var lineContract = initContract11().router({
2625
2513
 
2626
2514
  // src/mail/email-engine-webhooks-events.contract.ts
2627
2515
  import { initContract as initContract12 } from "@ts-rest/core";
2628
- import z42 from "zod";
2516
+ import z41 from "zod";
2629
2517
  var emailEngineWebhooksEventsContract = initContract12().router({
2630
2518
  handleWebhooksEvents: {
2631
2519
  method: "POST",
@@ -2633,7 +2521,7 @@ var emailEngineWebhooksEventsContract = initContract12().router({
2633
2521
  // we don't need to respone anything but added responses just for solving type error
2634
2522
  responses: {
2635
2523
  200: DefaultSuccessResponseSchema.extend({
2636
- message: z42.string()
2524
+ message: z41.string()
2637
2525
  })
2638
2526
  },
2639
2527
  body: null,
@@ -2646,173 +2534,173 @@ import { initContract as initContract17 } from "@ts-rest/core";
2646
2534
 
2647
2535
  // src/mail/room-contract.ts
2648
2536
  import { initContract as initContract13 } from "@ts-rest/core";
2649
- import z46 from "zod";
2537
+ import z45 from "zod";
2650
2538
 
2651
2539
  // src/mail/schemas/room.schema.ts
2652
- import z45 from "zod";
2540
+ import z44 from "zod";
2653
2541
 
2654
2542
  // src/mail/schemas/account.schema.ts
2543
+ import z42 from "zod";
2544
+ var MailServerSchema = z42.object({
2545
+ id: z42.string(),
2546
+ createdAt: z42.date(),
2547
+ updatedAt: z42.date(),
2548
+ deletedAt: z42.date().nullable(),
2549
+ name: z42.string(),
2550
+ smtpHost: z42.string(),
2551
+ smtpPort: z42.string(),
2552
+ smtpTlsPort: z42.string(),
2553
+ useTlsForSmtp: z42.boolean(),
2554
+ imapHost: z42.string(),
2555
+ imapPort: z42.string(),
2556
+ imapTlsPort: z42.string(),
2557
+ useTlsForImap: z42.boolean()
2558
+ });
2559
+ var MailAccountSchema = z42.object({
2560
+ id: z42.string(),
2561
+ createdAt: z42.date(),
2562
+ updatedAt: z42.date(),
2563
+ deletedAt: z42.date().nullable(),
2564
+ name: z42.string(),
2565
+ address: z42.string(),
2566
+ accountId: z42.string(),
2567
+ mailServerId: z42.string(),
2568
+ mailServer: MailServerSchema,
2569
+ state: z42.union([
2570
+ z42.literal("init"),
2571
+ z42.literal("syncing"),
2572
+ z42.literal("connecting"),
2573
+ z42.literal("connected"),
2574
+ z42.literal("disconnected"),
2575
+ z42.literal("authenticationError"),
2576
+ z42.literal("connectError"),
2577
+ z42.literal("unset")
2578
+ ])
2579
+ });
2580
+
2581
+ // src/mail/schemas/message.schema.ts
2655
2582
  import z43 from "zod";
2656
- var MailServerSchema = z43.object({
2583
+ var AttachmentSchema = z43.object({
2657
2584
  id: z43.string(),
2658
2585
  createdAt: z43.date(),
2659
2586
  updatedAt: z43.date(),
2660
- deletedAt: z43.date().nullable(),
2661
- name: z43.string(),
2662
- smtpHost: z43.string(),
2663
- smtpPort: z43.string(),
2664
- smtpTlsPort: z43.string(),
2665
- useTlsForSmtp: z43.boolean(),
2666
- imapHost: z43.string(),
2667
- imapPort: z43.string(),
2668
- imapTlsPort: z43.string(),
2669
- useTlsForImap: z43.boolean()
2670
- });
2671
- var MailAccountSchema = z43.object({
2587
+ deletedAt: z43.nullable(z43.date()),
2588
+ roomId: z43.string(),
2589
+ messageId: z43.string(),
2590
+ fileName: z43.string(),
2591
+ fileType: z43.string(),
2592
+ emailEngineAttachmentId: z43.string(),
2593
+ uploadId: z43.string(),
2594
+ upload: z43.object({
2595
+ id: z43.string(),
2596
+ createdAt: z43.date(),
2597
+ updatedAt: z43.date(),
2598
+ deletedAt: z43.nullable(z43.date()),
2599
+ bucket_name: z43.string(),
2600
+ file_name: z43.string(),
2601
+ file_key: z43.string(),
2602
+ file_size: z43.number(),
2603
+ file_url: z43.string(),
2604
+ extension_name: z43.string()
2605
+ })
2606
+ });
2607
+ var MessageSchema2 = z43.object({
2672
2608
  id: z43.string(),
2673
2609
  createdAt: z43.date(),
2674
2610
  updatedAt: z43.date(),
2675
- deletedAt: z43.date().nullable(),
2676
- name: z43.string(),
2677
- address: z43.string(),
2678
- accountId: z43.string(),
2679
- mailServerId: z43.string(),
2680
- mailServer: MailServerSchema,
2681
- state: z43.union([
2682
- z43.literal("init"),
2683
- z43.literal("syncing"),
2684
- z43.literal("connecting"),
2685
- z43.literal("connected"),
2686
- z43.literal("disconnected"),
2687
- z43.literal("authenticationError"),
2688
- z43.literal("connectError"),
2689
- z43.literal("unset")
2690
- ])
2611
+ deletedAt: z43.nullable(z43.date()),
2612
+ roomId: z43.string(),
2613
+ subject: z43.string(),
2614
+ textPlain: z43.string(),
2615
+ textHtml: z43.string(),
2616
+ textId: z43.string(),
2617
+ emailEngineEmailId: z43.string(),
2618
+ emailEngineMessageId: z43.string(),
2619
+ emailEngineReplyTo: z43.nullable(z43.string()),
2620
+ direction: z43.string(),
2621
+ date: z43.date(),
2622
+ action: z43.string(),
2623
+ unseen: z43.boolean(),
2624
+ seemsLikeNew: z43.boolean(),
2625
+ from: z43.array(MailUserSchema),
2626
+ to: z43.array(MailUserSchema),
2627
+ cc: z43.array(MailUserSchema),
2628
+ bcc: z43.array(MailUserSchema),
2629
+ attachments: z43.array(AttachmentSchema)
2691
2630
  });
2692
2631
 
2693
- // src/mail/schemas/message.schema.ts
2694
- import z44 from "zod";
2695
- var AttachmentSchema = z44.object({
2632
+ // src/mail/schemas/room.schema.ts
2633
+ var MailUserSchema = z44.object({
2696
2634
  id: z44.string(),
2697
2635
  createdAt: z44.date(),
2698
2636
  updatedAt: z44.date(),
2699
- deletedAt: z44.nullable(z44.date()),
2700
- roomId: z44.string(),
2701
- messageId: z44.string(),
2702
- fileName: z44.string(),
2703
- fileType: z44.string(),
2704
- emailEngineAttachmentId: z44.string(),
2705
- uploadId: z44.string(),
2706
- upload: z44.object({
2707
- id: z44.string(),
2708
- createdAt: z44.date(),
2709
- updatedAt: z44.date(),
2710
- deletedAt: z44.nullable(z44.date()),
2711
- bucket_name: z44.string(),
2712
- file_name: z44.string(),
2713
- file_key: z44.string(),
2714
- file_size: z44.number(),
2715
- file_url: z44.string(),
2716
- extension_name: z44.string()
2717
- })
2637
+ deletedAt: z44.date().nullable(),
2638
+ name: z44.string(),
2639
+ address: z44.string()
2718
2640
  });
2719
- var MessageSchema2 = z44.object({
2641
+ var TagSchema2 = z44.object({
2642
+ color: z44.string(),
2720
2643
  id: z44.string(),
2721
2644
  createdAt: z44.date(),
2722
2645
  updatedAt: z44.date(),
2723
- deletedAt: z44.nullable(z44.date()),
2646
+ deletedAt: z44.date().nullable(),
2647
+ name: z44.string()
2648
+ });
2649
+ var UserModel = z44.object({
2650
+ id: z44.string().uuid(),
2651
+ createdAt: z44.date(),
2652
+ updatedAt: z44.date(),
2653
+ deletedAt: z44.date().nullable(),
2654
+ name: z44.string(),
2655
+ email: z44.string(),
2656
+ address: z44.string().nullable(),
2657
+ phone: z44.string().nullable(),
2658
+ notification_count: z44.number().nullable()
2659
+ });
2660
+ var ActivityLogModel = z44.object({
2661
+ id: z44.string(),
2662
+ createdAt: z44.string(),
2663
+ updatedAt: z44.string(),
2664
+ deletedAt: z44.nullable(z44.string()),
2665
+ description: z44.string(),
2666
+ actorId: z44.string(),
2724
2667
  roomId: z44.string(),
2668
+ actor: UserModel
2669
+ });
2670
+ var MessagesAndLogs = z44.array(z44.union([MessageSchema2, ActivityLogModel]));
2671
+ var MailRoomSchema = z44.object({
2672
+ id: z44.string(),
2673
+ createdAt: z44.date(),
2674
+ updatedAt: z44.date(),
2675
+ deletedAt: z44.date().nullable(),
2725
2676
  subject: z44.string(),
2726
- textPlain: z44.string(),
2727
- textHtml: z44.string(),
2728
- textId: z44.string(),
2729
- emailEngineEmailId: z44.string(),
2730
- emailEngineMessageId: z44.string(),
2731
- emailEngineReplyTo: z44.nullable(z44.string()),
2677
+ resolved: z44.boolean(),
2678
+ assigneeId: z44.string().nullable(),
2679
+ note: z44.string(),
2680
+ mailId: z44.string(),
2732
2681
  direction: z44.string(),
2733
- date: z44.date(),
2734
- action: z44.string(),
2735
- unseen: z44.boolean(),
2736
- seemsLikeNew: z44.boolean(),
2682
+ lastMessageId: z44.string(),
2683
+ firstMessageId: z44.string(),
2737
2684
  from: z44.array(MailUserSchema),
2738
2685
  to: z44.array(MailUserSchema),
2739
2686
  cc: z44.array(MailUserSchema),
2740
2687
  bcc: z44.array(MailUserSchema),
2741
- attachments: z44.array(AttachmentSchema)
2742
- });
2743
-
2744
- // src/mail/schemas/room.schema.ts
2745
- var MailUserSchema = z45.object({
2746
- id: z45.string(),
2747
- createdAt: z45.date(),
2748
- updatedAt: z45.date(),
2749
- deletedAt: z45.date().nullable(),
2750
- name: z45.string(),
2751
- address: z45.string()
2752
- });
2753
- var TagSchema2 = z45.object({
2754
- color: z45.string(),
2755
- id: z45.string(),
2756
- createdAt: z45.date(),
2757
- updatedAt: z45.date(),
2758
- deletedAt: z45.date().nullable(),
2759
- name: z45.string()
2760
- });
2761
- var UserModel = z45.object({
2762
- id: z45.string().uuid(),
2763
- createdAt: z45.date(),
2764
- updatedAt: z45.date(),
2765
- deletedAt: z45.date().nullable(),
2766
- name: z45.string(),
2767
- email: z45.string(),
2768
- address: z45.string().nullable(),
2769
- phone: z45.string().nullable(),
2770
- notification_count: z45.number().nullable()
2771
- });
2772
- var ActivityLogModel = z45.object({
2773
- id: z45.string(),
2774
- createdAt: z45.date(),
2775
- updatedAt: z45.date(),
2776
- deletedAt: z45.nullable(z45.string()),
2777
- description: z45.string(),
2778
- actorId: z45.string(),
2779
- roomId: z45.string(),
2780
- actor: UserModel
2781
- });
2782
- var MessagesAndLogs = z45.array(z45.union([MessageSchema2, ActivityLogModel]));
2783
- var MailRoomSchema = z45.object({
2784
- id: z45.string(),
2785
- createdAt: z45.date(),
2786
- updatedAt: z45.date(),
2787
- deletedAt: z45.date().nullable(),
2788
- subject: z45.string(),
2789
- resolved: z45.boolean(),
2790
- assigneeId: z45.string().nullable(),
2791
- note: z45.string(),
2792
- mailId: z45.string(),
2793
- direction: z45.string(),
2794
- lastMessageId: z45.string(),
2795
- firstMessageId: z45.string(),
2796
- from: z45.array(MailUserSchema),
2797
- to: z45.array(MailUserSchema),
2798
- cc: z45.array(MailUserSchema),
2799
- bcc: z45.array(MailUserSchema),
2800
2688
  firstMessage: MessageSchema2,
2801
2689
  lastMessage: MessageSchema2,
2802
- tags: z45.array(TagSchema2),
2690
+ tags: z44.array(TagSchema2),
2803
2691
  assignee: UserModel,
2804
- messages: z45.array(MessageSchema2),
2692
+ messages: z44.array(MessageSchema2),
2805
2693
  messagesAndLogs: MessagesAndLogs,
2806
2694
  mail: MailAccountSchema,
2807
- unReadMessageCount: z45.number()
2808
- });
2809
- var AttachmentSchema2 = z45.object({
2810
- fileName: z45.string(),
2811
- fileType: z45.string(),
2812
- emailEngineAttachmentId: z45.string(),
2813
- uploadId: z45.string(),
2814
- messageId: z45.string(),
2815
- roomId: z45.string(),
2695
+ unReadMessageCount: z44.number()
2696
+ });
2697
+ var AttachmentSchema2 = z44.object({
2698
+ fileName: z44.string(),
2699
+ fileType: z44.string(),
2700
+ emailEngineAttachmentId: z44.string(),
2701
+ uploadId: z44.string(),
2702
+ messageId: z44.string(),
2703
+ roomId: z44.string(),
2816
2704
  upload: UploadSchema
2817
2705
  });
2818
2706
 
@@ -2824,7 +2712,7 @@ var roomContract = initContract13().router(
2824
2712
  path: "/",
2825
2713
  responses: {
2826
2714
  200: DefaultSuccessResponseSchema.extend({
2827
- message: z46.string()
2715
+ message: z45.string()
2828
2716
  }),
2829
2717
  ...DefaultResponses
2830
2718
  },
@@ -2834,19 +2722,19 @@ var roomContract = initContract13().router(
2834
2722
  getAll: {
2835
2723
  method: "GET",
2836
2724
  path: "",
2837
- query: z46.object({
2838
- page: z46.coerce.number().default(1),
2839
- pageSize: z46.coerce.number().default(10),
2840
- keyword: z46.string().optional(),
2841
- assigneeId: z46.string().uuid().optional().nullable(),
2842
- resolved: z46.boolean().or(z46.string().transform((value) => value.toLowerCase() === "true")).optional().nullable()
2725
+ query: z45.object({
2726
+ page: z45.coerce.number().default(1),
2727
+ pageSize: z45.coerce.number().default(10),
2728
+ keyword: z45.string().optional(),
2729
+ assigneeId: z45.string().uuid().optional().nullable(),
2730
+ resolved: z45.boolean().or(z45.string().transform((value) => value.toLowerCase() === "true")).optional().nullable()
2843
2731
  }),
2844
2732
  responses: {
2845
2733
  200: DefaultSuccessResponseSchema.extend({
2846
- data: z46.array(MailRoomSchema),
2847
- total: z46.number(),
2848
- page: z46.number(),
2849
- pageSize: z46.number()
2734
+ data: z45.array(MailRoomSchema),
2735
+ total: z45.number(),
2736
+ page: z45.number(),
2737
+ pageSize: z45.number()
2850
2738
  }),
2851
2739
  ...DefaultResponses
2852
2740
  },
@@ -2855,8 +2743,8 @@ var roomContract = initContract13().router(
2855
2743
  getById: {
2856
2744
  method: "GET",
2857
2745
  path: "/:id",
2858
- pathParams: z46.object({
2859
- id: z46.string().uuid()
2746
+ pathParams: z45.object({
2747
+ id: z45.string().uuid()
2860
2748
  }),
2861
2749
  responses: {
2862
2750
  200: DefaultSuccessResponseSchema.extend({
@@ -2869,12 +2757,12 @@ var roomContract = initContract13().router(
2869
2757
  getAttachments: {
2870
2758
  method: "GET",
2871
2759
  path: "/:id/attachments",
2872
- pathParams: z46.object({
2873
- id: z46.string().uuid()
2760
+ pathParams: z45.object({
2761
+ id: z45.string().uuid()
2874
2762
  }),
2875
2763
  responses: {
2876
2764
  200: DefaultSuccessResponseSchema.extend({
2877
- data: z46.array(AttachmentSchema2)
2765
+ data: z45.array(AttachmentSchema2)
2878
2766
  }),
2879
2767
  ...DefaultResponses
2880
2768
  },
@@ -2883,12 +2771,12 @@ var roomContract = initContract13().router(
2883
2771
  getParticipants: {
2884
2772
  method: "GET",
2885
2773
  path: "/:id/participants",
2886
- pathParams: z46.object({
2887
- id: z46.string().uuid()
2774
+ pathParams: z45.object({
2775
+ id: z45.string().uuid()
2888
2776
  }),
2889
2777
  responses: {
2890
2778
  200: DefaultSuccessResponseSchema.extend({
2891
- data: z46.array(MailUserSchema)
2779
+ data: z45.array(MailUserSchema)
2892
2780
  }),
2893
2781
  ...DefaultResponses
2894
2782
  },
@@ -2897,8 +2785,8 @@ var roomContract = initContract13().router(
2897
2785
  update: {
2898
2786
  method: "PATCH",
2899
2787
  path: "/:id",
2900
- pathParams: z46.object({
2901
- id: z46.string()
2788
+ pathParams: z45.object({
2789
+ id: z45.string()
2902
2790
  }),
2903
2791
  responses: {
2904
2792
  200: DefaultSuccessResponseSchema.extend({
@@ -2906,15 +2794,15 @@ var roomContract = initContract13().router(
2906
2794
  }),
2907
2795
  ...DefaultResponses
2908
2796
  },
2909
- body: z46.object({
2910
- resolved: z46.boolean().or(
2911
- z46.union([z46.literal("true"), z46.literal("false")]).transform((value) => value.toLowerCase() === "true")
2797
+ body: z45.object({
2798
+ resolved: z45.boolean().or(
2799
+ z45.union([z45.literal("true"), z45.literal("false")]).transform((value) => value.toLowerCase() === "true")
2912
2800
  ).optional().nullable(),
2913
- assigneeId: z46.string().uuid().optional().nullable(),
2914
- note: z46.string().optional(),
2915
- tags: z46.array(z46.string().uuid()).optional(),
2916
- handover: z46.boolean().or(
2917
- z46.union([z46.literal("true"), z46.literal("false")]).transform((value) => value.toLowerCase() === "true")
2801
+ assigneeId: z45.string().uuid().optional().nullable(),
2802
+ note: z45.string().optional(),
2803
+ tags: z45.array(z45.string().uuid()).optional(),
2804
+ handover: z45.boolean().or(
2805
+ z45.union([z45.literal("true"), z45.literal("false")]).transform((value) => value.toLowerCase() === "true")
2918
2806
  ).optional().nullable()
2919
2807
  }),
2920
2808
  summary: "Update a mail room by id"
@@ -2922,12 +2810,12 @@ var roomContract = initContract13().router(
2922
2810
  markAsRead: {
2923
2811
  method: "GET",
2924
2812
  path: "/:id",
2925
- pathParams: z46.object({
2926
- id: z46.string().uuid()
2813
+ pathParams: z45.object({
2814
+ id: z45.string().uuid()
2927
2815
  }),
2928
2816
  responses: {
2929
2817
  200: DefaultSuccessResponseSchema.extend({
2930
- message: z46.string()
2818
+ message: z45.string()
2931
2819
  }),
2932
2820
  ...DefaultResponses
2933
2821
  },
@@ -2941,47 +2829,47 @@ var roomContract = initContract13().router(
2941
2829
 
2942
2830
  // src/mail/account-contract.ts
2943
2831
  import { initContract as initContract14 } from "@ts-rest/core";
2944
- import z48 from "zod";
2832
+ import z47 from "zod";
2945
2833
 
2946
2834
  // src/mail/schemas/account-validation.schema.ts
2947
- import z47 from "zod";
2835
+ import z46 from "zod";
2948
2836
  var AccountContractsValidationSchemas = {
2949
2837
  create: {
2950
- input: z47.object({
2951
- address: z47.string().email("Email address must be valid email."),
2952
- name: z47.string().min(1, "Account name cannot be empty."),
2953
- password: z47.string().min(1, "Password cannot be empty."),
2954
- mailServerId: z47.string().uuid("Invalid mail_server_id")
2838
+ input: z46.object({
2839
+ address: z46.string().email("Email address must be valid email."),
2840
+ name: z46.string().min(1, "Account name cannot be empty."),
2841
+ password: z46.string().min(1, "Password cannot be empty."),
2842
+ mailServerId: z46.string().uuid("Invalid mail_server_id")
2955
2843
  })
2956
2844
  },
2957
2845
  getById: {
2958
- input: z47.object({
2959
- id: z47.string().uuid()
2846
+ input: z46.object({
2847
+ id: z46.string().uuid()
2960
2848
  }),
2961
2849
  output: MailAccountSchema
2962
2850
  },
2963
2851
  getAll: {
2964
- output: z47.array(MailAccountSchema)
2852
+ output: z46.array(MailAccountSchema)
2965
2853
  },
2966
2854
  update: {
2967
2855
  input: MailAccountSchema,
2968
2856
  output: MailAccountSchema
2969
2857
  },
2970
2858
  disconnect: {
2971
- input: z47.object({
2972
- id: z47.string().uuid()
2859
+ input: z46.object({
2860
+ id: z46.string().uuid()
2973
2861
  }),
2974
2862
  output: MailAccountSchema
2975
2863
  },
2976
2864
  reconnect: {
2977
- input: z47.object({
2978
- id: z47.string()
2865
+ input: z46.object({
2866
+ id: z46.string()
2979
2867
  }),
2980
2868
  output: MailAccountSchema
2981
2869
  },
2982
2870
  delete: {
2983
- input: z47.object({
2984
- id: z47.string()
2871
+ input: z46.object({
2872
+ id: z46.string()
2985
2873
  }),
2986
2874
  output: MailAccountSchema
2987
2875
  }
@@ -2997,16 +2885,16 @@ var accountContract = initContract14().router(
2997
2885
  responses: {
2998
2886
  201: DefaultSuccessResponseSchema.extend({
2999
2887
  // data: AccountContractsValidationSchemas.create.output,
3000
- message: z48.string()
2888
+ message: z47.string()
3001
2889
  }),
3002
- 400: z48.object({
3003
- message: z48.string()
2890
+ 400: z47.object({
2891
+ message: z47.string()
3004
2892
  }),
3005
- 409: z48.object({
3006
- message: z48.string()
2893
+ 409: z47.object({
2894
+ message: z47.string()
3007
2895
  }),
3008
- 500: z48.object({
3009
- message: z48.string()
2896
+ 500: z47.object({
2897
+ message: z47.string()
3010
2898
  }),
3011
2899
  ...DefaultResponses
3012
2900
  },
@@ -3035,7 +2923,7 @@ var accountContract = initContract14().router(
3035
2923
  path: "",
3036
2924
  responses: {
3037
2925
  200: DefaultSuccessResponseSchema.extend({
3038
- data: z48.any()
2926
+ data: z47.any()
3039
2927
  // data: AccountContractsValidationSchemas.getAll.output,
3040
2928
  }),
3041
2929
  ...DefaultResponses
@@ -3047,8 +2935,8 @@ var accountContract = initContract14().router(
3047
2935
  update: {
3048
2936
  method: "PATCH",
3049
2937
  path: "/:id",
3050
- pathParams: z48.object({
3051
- id: z48.string().uuid()
2938
+ pathParams: z47.object({
2939
+ id: z47.string().uuid()
3052
2940
  }),
3053
2941
  responses: {
3054
2942
  201: DefaultSuccessResponseSchema.extend({
@@ -3097,7 +2985,7 @@ var accountContract = initContract14().router(
3097
2985
  pathParams: AccountContractsValidationSchemas.delete.input,
3098
2986
  responses: {
3099
2987
  200: DefaultSuccessResponseSchema.extend({
3100
- message: z48.string()
2988
+ message: z47.string()
3101
2989
  }),
3102
2990
  ...DefaultResponses
3103
2991
  },
@@ -3114,7 +3002,7 @@ var accountContract = initContract14().router(
3114
3002
 
3115
3003
  // src/mail/mail-server-contract.ts
3116
3004
  import { initContract as initContract15 } from "@ts-rest/core";
3117
- import z49 from "zod";
3005
+ import z48 from "zod";
3118
3006
  var serverContract = initContract15().router(
3119
3007
  {
3120
3008
  create: {
@@ -3122,7 +3010,7 @@ var serverContract = initContract15().router(
3122
3010
  path: "/",
3123
3011
  responses: {
3124
3012
  200: DefaultSuccessResponseSchema.extend({
3125
- message: z49.string()
3013
+ message: z48.string()
3126
3014
  }),
3127
3015
  ...DefaultResponses
3128
3016
  },
@@ -3132,12 +3020,12 @@ var serverContract = initContract15().router(
3132
3020
  get: {
3133
3021
  method: "GET",
3134
3022
  path: "/:id",
3135
- pathParams: z49.object({
3136
- id: z49.string()
3023
+ pathParams: z48.object({
3024
+ id: z48.string()
3137
3025
  }),
3138
3026
  responses: {
3139
3027
  200: DefaultSuccessResponseSchema.extend({
3140
- message: z49.string()
3028
+ message: z48.string()
3141
3029
  }),
3142
3030
  ...DefaultResponses
3143
3031
  },
@@ -3146,12 +3034,12 @@ var serverContract = initContract15().router(
3146
3034
  update: {
3147
3035
  method: "PATCH",
3148
3036
  path: "/:id",
3149
- pathParams: z49.object({
3150
- id: z49.string()
3037
+ pathParams: z48.object({
3038
+ id: z48.string()
3151
3039
  }),
3152
3040
  responses: {
3153
3041
  200: DefaultSuccessResponseSchema.extend({
3154
- message: z49.string()
3042
+ message: z48.string()
3155
3043
  }),
3156
3044
  ...DefaultResponses
3157
3045
  },
@@ -3161,12 +3049,12 @@ var serverContract = initContract15().router(
3161
3049
  delete: {
3162
3050
  method: "PATCH",
3163
3051
  path: "/:id",
3164
- pathParams: z49.object({
3165
- id: z49.string()
3052
+ pathParams: z48.object({
3053
+ id: z48.string()
3166
3054
  }),
3167
3055
  responses: {
3168
3056
  200: DefaultSuccessResponseSchema.extend({
3169
- message: z49.string()
3057
+ message: z48.string()
3170
3058
  }),
3171
3059
  ...DefaultResponses
3172
3060
  },
@@ -3181,44 +3069,44 @@ var serverContract = initContract15().router(
3181
3069
 
3182
3070
  // src/mail/message-contract.ts
3183
3071
  import { initContract as initContract16 } from "@ts-rest/core";
3184
- import z51 from "zod";
3072
+ import z50 from "zod";
3185
3073
 
3186
3074
  // src/mail/schemas/message-validation.schema.ts
3187
- import z50 from "zod";
3188
- var MailParticipant = z50.object({
3189
- name: z50.string().optional(),
3190
- address: z50.string().email()
3075
+ import z49 from "zod";
3076
+ var MailParticipant = z49.object({
3077
+ name: z49.string().optional(),
3078
+ address: z49.string().email()
3191
3079
  });
3192
3080
  var MessageContractsValidationsSchema = {
3193
3081
  submit: {
3194
- input: z50.object({
3195
- subject: z50.string(),
3196
- text: z50.string(),
3197
- html: z50.string(),
3082
+ input: z49.object({
3083
+ subject: z49.string(),
3084
+ text: z49.string(),
3085
+ html: z49.string(),
3198
3086
  from: MailParticipant,
3199
- to: z50.array(MailParticipant),
3200
- cc: z50.array(MailParticipant).optional(),
3201
- bcc: z50.array(MailParticipant).optional(),
3202
- reference: z50.object({
3203
- messageId: z50.string(),
3204
- action: z50.union([z50.literal("reply"), z50.literal("forward")])
3087
+ to: z49.array(MailParticipant),
3088
+ cc: z49.array(MailParticipant).optional(),
3089
+ bcc: z49.array(MailParticipant).optional(),
3090
+ reference: z49.object({
3091
+ messageId: z49.string(),
3092
+ action: z49.union([z49.literal("reply"), z49.literal("forward")])
3205
3093
  }).optional(),
3206
- attachments: z50.array(
3207
- z50.object({
3208
- fileType: z50.string(),
3209
- fileName: z50.string(),
3210
- fileKey: z50.string(),
3211
- fileSize: z50.number(),
3212
- bucketName: z50.string(),
3213
- presignedUrl: z50.string()
3094
+ attachments: z49.array(
3095
+ z49.object({
3096
+ fileType: z49.string(),
3097
+ fileName: z49.string(),
3098
+ fileKey: z49.string(),
3099
+ fileSize: z49.number(),
3100
+ bucketName: z49.string(),
3101
+ presignedUrl: z49.string()
3214
3102
  })
3215
3103
  ).optional()
3216
3104
  }),
3217
- output: z50.object({
3218
- response: z50.string(),
3219
- messageId: z50.string(),
3220
- sendAt: z50.string(),
3221
- queueId: z50.string()
3105
+ output: z49.object({
3106
+ response: z49.string(),
3107
+ messageId: z49.string(),
3108
+ sendAt: z49.string(),
3109
+ queueId: z49.string()
3222
3110
  })
3223
3111
  }
3224
3112
  };
@@ -3243,8 +3131,8 @@ var messageContract = initContract16().router(
3243
3131
  getById: {
3244
3132
  method: "GET",
3245
3133
  path: "/:id",
3246
- pathParams: z51.object({
3247
- id: z51.string()
3134
+ pathParams: z50.object({
3135
+ id: z50.string()
3248
3136
  }),
3249
3137
  responses: {
3250
3138
  200: DefaultSuccessResponseSchema.extend({
@@ -3284,37 +3172,18 @@ var messengerContract = initContract18().router({
3284
3172
  connectToService: {
3285
3173
  method: "POST",
3286
3174
  path: "/connect",
3287
- body: ChannelSchema2.partial(),
3175
+ body: ChannelSchema2,
3288
3176
  responses: {
3289
- 200: ChannelServiceResponseSchema,
3177
+ 200: ConnectChannelServiceResponseSchema,
3290
3178
  500: DefaultErrorResponseSchema,
3291
3179
  400: DefaultErrorResponseSchema
3292
3180
  }
3293
- },
3294
- disconnectToService: {
3295
- method: "POST",
3296
- path: "/disconnect",
3297
- body: ChannelSchema2.partial(),
3298
- responses: {
3299
- 200: ChannelServiceResponseSchema,
3300
- 500: DefaultErrorResponseSchema,
3301
- 400: DefaultErrorResponseSchema
3302
- }
3303
- },
3304
- getFacebookPages: {
3305
- method: "GET",
3306
- path: "/pages",
3307
- query: GetFacebookPagesQuerySchema,
3308
- responses: {
3309
- 200: DefaultSuccessResponseSchema.merge(GetFacebookPagesSchema),
3310
- 500: DefaultErrorResponseSchema
3311
- }
3312
3181
  }
3313
3182
  });
3314
3183
 
3315
3184
  // src/permission/index.ts
3316
3185
  import { initContract as initContract19 } from "@ts-rest/core";
3317
- import z52 from "zod";
3186
+ import z51 from "zod";
3318
3187
  var permissionContract = initContract19().router(
3319
3188
  {
3320
3189
  getPermissions: {
@@ -3322,9 +3191,9 @@ var permissionContract = initContract19().router(
3322
3191
  path: "",
3323
3192
  headers: DefaultHeaderSchema,
3324
3193
  responses: {
3325
- 200: z52.object({ permissions: PermissionSchema.array() }),
3326
- 400: z52.object({
3327
- message: z52.string()
3194
+ 200: z51.object({ permissions: PermissionSchema.array() }),
3195
+ 400: z51.object({
3196
+ message: z51.string()
3328
3197
  }),
3329
3198
  401: DefaultUnauthorizedSchema,
3330
3199
  500: DefaultErrorResponseSchema
@@ -3337,15 +3206,15 @@ var permissionContract = initContract19().router(
3337
3206
 
3338
3207
  // src/role/index.ts
3339
3208
  import { initContract as initContract20 } from "@ts-rest/core";
3340
- import z54 from "zod";
3209
+ import z53 from "zod";
3341
3210
 
3342
3211
  // src/role/validation.ts
3343
- import { z as z53 } from "zod";
3344
- var CreateRoleSchema = z53.object({
3345
- systemName: z53.string(),
3346
- displayName: z53.string(),
3347
- description: z53.string().nullable(),
3348
- permissions: z53.array(z53.string())
3212
+ import { z as z52 } from "zod";
3213
+ var CreateRoleSchema = z52.object({
3214
+ systemName: z52.string(),
3215
+ displayName: z52.string(),
3216
+ description: z52.string().nullable(),
3217
+ permissions: z52.array(z52.string())
3349
3218
  });
3350
3219
  var UpdateRoleSchema = CreateRoleSchema;
3351
3220
 
@@ -3361,8 +3230,8 @@ var roleContract = initContract20().router(
3361
3230
  201: DefaultSuccessResponseSchema.extend({
3362
3231
  role: RoleSchema
3363
3232
  }),
3364
- 400: z54.object({
3365
- message: z54.string()
3233
+ 400: z53.object({
3234
+ message: z53.string()
3366
3235
  }),
3367
3236
  401: DefaultUnauthorizedSchema,
3368
3237
  500: DefaultErrorResponseSchema
@@ -3372,15 +3241,15 @@ var roleContract = initContract20().router(
3372
3241
  getRoles: {
3373
3242
  method: "GET",
3374
3243
  path: "",
3375
- query: z54.object({
3376
- page: z54.coerce.number().default(1),
3377
- pageSize: z54.coerce.number().default(10)
3244
+ query: z53.object({
3245
+ page: z53.coerce.number().default(1),
3246
+ pageSize: z53.coerce.number().default(10)
3378
3247
  }).optional(),
3379
3248
  headers: DefaultHeaderSchema,
3380
3249
  responses: {
3381
3250
  200: WithPagination(RoleSchema),
3382
- 400: z54.object({
3383
- message: z54.string()
3251
+ 400: z53.object({
3252
+ message: z53.string()
3384
3253
  }),
3385
3254
  401: DefaultUnauthorizedSchema,
3386
3255
  500: DefaultErrorResponseSchema
@@ -3390,15 +3259,15 @@ var roleContract = initContract20().router(
3390
3259
  updateRole: {
3391
3260
  method: "PATCH",
3392
3261
  path: "/:id",
3393
- pathParams: z54.object({ id: z54.string() }),
3262
+ pathParams: z53.object({ id: z53.string() }),
3394
3263
  headers: DefaultHeaderSchema,
3395
3264
  body: UpdateRoleSchema,
3396
3265
  responses: {
3397
3266
  201: DefaultSuccessResponseSchema.extend({
3398
3267
  role: RoleSchema
3399
3268
  }),
3400
- 400: z54.object({
3401
- message: z54.string()
3269
+ 400: z53.object({
3270
+ message: z53.string()
3402
3271
  }),
3403
3272
  401: DefaultUnauthorizedSchema,
3404
3273
  500: DefaultErrorResponseSchema
@@ -3408,11 +3277,11 @@ var roleContract = initContract20().router(
3408
3277
  deleteRole: {
3409
3278
  method: "DELETE",
3410
3279
  path: "/:id",
3411
- pathParams: z54.object({ id: z54.string() }),
3280
+ pathParams: z53.object({ id: z53.string() }),
3412
3281
  headers: DefaultHeaderSchema,
3413
3282
  body: null,
3414
3283
  responses: {
3415
- 200: DefaultSuccessResponseSchema.extend({ message: z54.string() }),
3284
+ 200: DefaultSuccessResponseSchema.extend({ message: z53.string() }),
3416
3285
  500: DefaultErrorResponseSchema
3417
3286
  },
3418
3287
  summary: "Delete a role."
@@ -3423,19 +3292,19 @@ var roleContract = initContract20().router(
3423
3292
 
3424
3293
  // src/tag/index.ts
3425
3294
  import { initContract as initContract21 } from "@ts-rest/core";
3426
- import z56 from "zod";
3295
+ import z55 from "zod";
3427
3296
 
3428
3297
  // src/tag/validation.ts
3429
- import { z as z55 } from "zod";
3430
- var CreateTagSchema = z55.object({
3431
- name: z55.string(),
3298
+ import { z as z54 } from "zod";
3299
+ var CreateTagSchema = z54.object({
3300
+ name: z54.string(),
3432
3301
  group: TagGroupSchema
3433
3302
  });
3434
- var GetTagsSchema = z55.object({
3303
+ var GetTagsSchema = z54.object({
3435
3304
  group: TagGroupSchema.default("general"),
3436
- keyword: z55.string()
3305
+ keyword: z54.string()
3437
3306
  }).partial().optional();
3438
- var UpdateTagSchema = z55.object({ name: z55.string() });
3307
+ var UpdateTagSchema = z54.object({ name: z54.string() });
3439
3308
 
3440
3309
  // src/tag/index.ts
3441
3310
  var tagContract = initContract21().router(
@@ -3458,7 +3327,7 @@ var tagContract = initContract21().router(
3458
3327
  query: GetTagsSchema,
3459
3328
  responses: {
3460
3329
  200: DefaultSuccessResponseSchema.extend({
3461
- tags: z56.array(TagSchema)
3330
+ tags: z55.array(TagSchema)
3462
3331
  }),
3463
3332
  500: DefaultErrorResponseSchema
3464
3333
  },
@@ -3467,7 +3336,7 @@ var tagContract = initContract21().router(
3467
3336
  updateTag: {
3468
3337
  method: "PATCH",
3469
3338
  path: "/:id",
3470
- pathParams: z56.object({ id: z56.string() }),
3339
+ pathParams: z55.object({ id: z55.string() }),
3471
3340
  body: UpdateTagSchema,
3472
3341
  responses: {
3473
3342
  200: DefaultSuccessResponseSchema.extend({
@@ -3480,11 +3349,11 @@ var tagContract = initContract21().router(
3480
3349
  deleteTag: {
3481
3350
  method: "DELETE",
3482
3351
  path: "/:id",
3483
- pathParams: z56.object({ id: z56.string() }),
3484
- body: z56.any().optional(),
3352
+ pathParams: z55.object({ id: z55.string() }),
3353
+ body: z55.any().optional(),
3485
3354
  // We don't need the body.
3486
3355
  responses: {
3487
- 200: DefaultSuccessResponseSchema.extend({ message: z56.string() }),
3356
+ 200: DefaultSuccessResponseSchema.extend({ message: z55.string() }),
3488
3357
  500: DefaultErrorResponseSchema
3489
3358
  },
3490
3359
  headers: DefaultHeaderSchema
@@ -3497,27 +3366,27 @@ var tagContract = initContract21().router(
3497
3366
 
3498
3367
  // src/telephony-agent-presence-status/index.ts
3499
3368
  import { initContract as initContract22 } from "@ts-rest/core";
3500
- import z59 from "zod";
3369
+ import z58 from "zod";
3501
3370
 
3502
3371
  // src/telephony-agent-presence-status/schema.ts
3503
- import z57 from "zod";
3372
+ import z56 from "zod";
3504
3373
  var PresenceStatusSchema = DefaultEntitySchema.extend({
3505
- status: z57.string(),
3506
- description: z57.string()
3374
+ status: z56.string(),
3375
+ description: z56.string()
3507
3376
  });
3508
3377
  var UserPresenceStatusSchema = DefaultEntitySchema.extend({
3509
3378
  user: UserSchema,
3510
3379
  presenceStatus: PresenceStatusSchema,
3511
- customPresenceStatus: z57.string().nullable().optional()
3380
+ customPresenceStatus: z56.string().nullable().optional()
3512
3381
  });
3513
3382
 
3514
3383
  // src/telephony-agent-presence-status/validation.ts
3515
- import { z as z58 } from "zod";
3516
- var UpdateUserStatusSchema = z58.object({
3517
- userId: z58.string(),
3518
- presenceStatusId: z58.string().nullable().optional(),
3519
- customPreseneStatus: z58.string().nullable().optional(),
3520
- reason: z58.string()
3384
+ import { z as z57 } from "zod";
3385
+ var UpdateUserStatusSchema = z57.object({
3386
+ userId: z57.string(),
3387
+ presenceStatusId: z57.string().nullable().optional(),
3388
+ customPreseneStatus: z57.string().nullable().optional(),
3389
+ reason: z57.string()
3521
3390
  });
3522
3391
 
3523
3392
  // src/telephony-agent-presence-status/index.ts
@@ -3528,9 +3397,9 @@ var telephonyAgentPresenceStatusContract = initContract22().router(
3528
3397
  path: "/presence_status",
3529
3398
  headers: DefaultHeaderSchema,
3530
3399
  responses: {
3531
- 200: z59.array(PresenceStatusSchema),
3532
- 400: z59.object({
3533
- message: z59.string()
3400
+ 200: z58.array(PresenceStatusSchema),
3401
+ 400: z58.object({
3402
+ message: z58.string()
3534
3403
  }),
3535
3404
  401: DefaultUnauthorizedSchema,
3536
3405
  500: DefaultErrorResponseSchema
@@ -3542,9 +3411,9 @@ var telephonyAgentPresenceStatusContract = initContract22().router(
3542
3411
  path: "/agents/presence_status",
3543
3412
  headers: DefaultHeaderSchema,
3544
3413
  responses: {
3545
- 200: z59.array(UserPresenceStatusSchema),
3546
- 400: z59.object({
3547
- message: z59.string()
3414
+ 200: z58.array(UserPresenceStatusSchema),
3415
+ 400: z58.object({
3416
+ message: z58.string()
3548
3417
  }),
3549
3418
  401: DefaultUnauthorizedSchema,
3550
3419
  500: DefaultErrorResponseSchema
@@ -3554,12 +3423,12 @@ var telephonyAgentPresenceStatusContract = initContract22().router(
3554
3423
  getAgentStatus: {
3555
3424
  method: "GET",
3556
3425
  path: "/presence_status/check_update/:userId",
3557
- pathParams: z59.object({ userId: z59.string() }),
3426
+ pathParams: z58.object({ userId: z58.string() }),
3558
3427
  headers: DefaultHeaderSchema,
3559
3428
  responses: {
3560
3429
  200: UserPresenceStatusSchema,
3561
- 400: z59.object({
3562
- message: z59.string()
3430
+ 400: z58.object({
3431
+ message: z58.string()
3563
3432
  }),
3564
3433
  401: DefaultUnauthorizedSchema,
3565
3434
  500: DefaultErrorResponseSchema
@@ -3575,8 +3444,8 @@ var telephonyAgentPresenceStatusContract = initContract22().router(
3575
3444
  200: DefaultSuccessResponseSchema.extend({
3576
3445
  userPresenceStatu: UserPresenceStatusSchema
3577
3446
  }),
3578
- 400: z59.object({
3579
- message: z59.string()
3447
+ 400: z58.object({
3448
+ message: z58.string()
3580
3449
  }),
3581
3450
  401: DefaultUnauthorizedSchema,
3582
3451
  500: DefaultErrorResponseSchema
@@ -3589,35 +3458,35 @@ var telephonyAgentPresenceStatusContract = initContract22().router(
3589
3458
 
3590
3459
  // src/telephony-extension/index.ts
3591
3460
  import { initContract as initContract23 } from "@ts-rest/core";
3592
- import z61 from "zod";
3461
+ import z60 from "zod";
3593
3462
 
3594
3463
  // src/telephony-extension/schema.ts
3595
- import z60 from "zod";
3596
- var TelephonyExtensionSchema = z60.object({
3597
- errcode: z60.coerce.number(),
3598
- errmsg: z60.string(),
3599
- total_number: z60.coerce.number(),
3600
- data: z60.array(
3601
- z60.object({
3602
- id: z60.coerce.number(),
3603
- online_status: z60.object({
3604
- fx_phone: z60.object({ status: z60.coerce.number() }),
3605
- sip_phone: z60.object({
3606
- status: z60.coerce.number(),
3607
- ext_dev_type: z60.string().optional()
3608
- }),
3609
- linkus_desktop: z60.object({ status: z60.coerce.number() }),
3610
- linkus_mobile: z60.object({ status: z60.coerce.number() }),
3611
- linkus_web: z60.object({
3612
- status: z60.coerce.number(),
3613
- ext_dev_type: z60.string().optional()
3464
+ import z59 from "zod";
3465
+ var TelephonyExtensionSchema = z59.object({
3466
+ errcode: z59.coerce.number(),
3467
+ errmsg: z59.string(),
3468
+ total_number: z59.coerce.number(),
3469
+ data: z59.array(
3470
+ z59.object({
3471
+ id: z59.coerce.number(),
3472
+ online_status: z59.object({
3473
+ fx_phone: z59.object({ status: z59.coerce.number() }),
3474
+ sip_phone: z59.object({
3475
+ status: z59.coerce.number(),
3476
+ ext_dev_type: z59.string().optional()
3477
+ }),
3478
+ linkus_desktop: z59.object({ status: z59.coerce.number() }),
3479
+ linkus_mobile: z59.object({ status: z59.coerce.number() }),
3480
+ linkus_web: z59.object({
3481
+ status: z59.coerce.number(),
3482
+ ext_dev_type: z59.string().optional()
3614
3483
  })
3615
3484
  }).optional(),
3616
- presence_status: z60.string().optional(),
3617
- number: z60.string().optional(),
3618
- caller_id_name: z60.string().optional(),
3619
- role_name: z60.string().optional(),
3620
- email_addr: z60.string().optional()
3485
+ presence_status: z59.string().optional(),
3486
+ number: z59.string().optional(),
3487
+ caller_id_name: z59.string().optional(),
3488
+ role_name: z59.string().optional(),
3489
+ email_addr: z59.string().optional()
3621
3490
  })
3622
3491
  )
3623
3492
  });
@@ -3632,8 +3501,8 @@ var telephonyExtensionContract = initContract23().router(
3632
3501
  query: null,
3633
3502
  responses: {
3634
3503
  200: TelephonyExtensionSchema,
3635
- 400: z61.object({
3636
- message: z61.string()
3504
+ 400: z60.object({
3505
+ message: z60.string()
3637
3506
  }),
3638
3507
  401: DefaultUnauthorizedSchema,
3639
3508
  500: DefaultErrorResponseSchema
@@ -3646,21 +3515,21 @@ var telephonyExtensionContract = initContract23().router(
3646
3515
 
3647
3516
  // src/user/index.ts
3648
3517
  import { initContract as initContract24 } from "@ts-rest/core";
3649
- import z63 from "zod";
3518
+ import z62 from "zod";
3650
3519
 
3651
3520
  // src/user/validation.ts
3652
- import { z as z62 } from "zod";
3653
- var CreateUserSchema = z62.object({
3654
- name: z62.string(),
3655
- email: z62.string().email(),
3656
- address: z62.string().nullable(),
3657
- phone: z62.string().nullable(),
3658
- password: z62.string(),
3659
- notificationCount: z62.number().nullable().optional(),
3660
- roles: z62.array(z62.string())
3521
+ import { z as z61 } from "zod";
3522
+ var CreateUserSchema = z61.object({
3523
+ name: z61.string(),
3524
+ email: z61.string().email(),
3525
+ address: z61.string().nullable(),
3526
+ phone: z61.string().nullable(),
3527
+ password: z61.string(),
3528
+ notificationCount: z61.number().nullable().optional(),
3529
+ roles: z61.array(z61.string())
3661
3530
  });
3662
3531
  var UpdateUserSchema = CreateUserSchema.extend({
3663
- newPassword: z62.string()
3532
+ newPassword: z61.string()
3664
3533
  });
3665
3534
 
3666
3535
  // src/user/index.ts
@@ -3675,8 +3544,8 @@ var userContract = initContract24().router(
3675
3544
  201: DefaultSuccessResponseSchema.extend({
3676
3545
  user: UserSchema
3677
3546
  }),
3678
- 400: z63.object({
3679
- message: z63.string()
3547
+ 400: z62.object({
3548
+ message: z62.string()
3680
3549
  }),
3681
3550
  401: DefaultUnauthorizedSchema
3682
3551
  },
@@ -3686,15 +3555,15 @@ var userContract = initContract24().router(
3686
3555
  method: "GET",
3687
3556
  path: "",
3688
3557
  headers: DefaultHeaderSchema,
3689
- query: z63.object({
3690
- page: z63.coerce.number().default(1),
3691
- pageSize: z63.coerce.number().default(10),
3692
- keyword: z63.string().optional()
3558
+ query: z62.object({
3559
+ page: z62.coerce.number().default(1),
3560
+ pageSize: z62.coerce.number().default(10),
3561
+ keyword: z62.string().optional()
3693
3562
  }).optional(),
3694
3563
  responses: {
3695
3564
  200: WithPagination(UserSchema),
3696
- 400: z63.object({
3697
- message: z63.string()
3565
+ 400: z62.object({
3566
+ message: z62.string()
3698
3567
  }),
3699
3568
  401: DefaultUnauthorizedSchema,
3700
3569
  500: DefaultErrorResponseSchema
@@ -3704,12 +3573,12 @@ var userContract = initContract24().router(
3704
3573
  getUserById: {
3705
3574
  method: "GET",
3706
3575
  path: "/:id",
3707
- pathParams: z63.object({ id: z63.string() }),
3576
+ pathParams: z62.object({ id: z62.string() }),
3708
3577
  headers: DefaultHeaderSchema,
3709
3578
  responses: {
3710
3579
  200: UserSchema,
3711
- 400: z63.object({
3712
- message: z63.string()
3580
+ 400: z62.object({
3581
+ message: z62.string()
3713
3582
  }),
3714
3583
  401: DefaultUnauthorizedSchema
3715
3584
  },
@@ -3718,15 +3587,15 @@ var userContract = initContract24().router(
3718
3587
  updateUser: {
3719
3588
  method: "PATCH",
3720
3589
  path: "/:id",
3721
- pathParams: z63.object({ id: z63.string() }),
3590
+ pathParams: z62.object({ id: z62.string() }),
3722
3591
  headers: DefaultHeaderSchema,
3723
3592
  body: UpdateUserSchema,
3724
3593
  responses: {
3725
3594
  201: DefaultSuccessResponseSchema.extend({
3726
3595
  role: UserSchema
3727
3596
  }),
3728
- 400: z63.object({
3729
- message: z63.string()
3597
+ 400: z62.object({
3598
+ message: z62.string()
3730
3599
  }),
3731
3600
  401: DefaultUnauthorizedSchema
3732
3601
  },
@@ -3735,11 +3604,11 @@ var userContract = initContract24().router(
3735
3604
  deleteUser: {
3736
3605
  method: "DELETE",
3737
3606
  path: "/:id",
3738
- pathParams: z63.object({ id: z63.string() }),
3607
+ pathParams: z62.object({ id: z62.string() }),
3739
3608
  headers: DefaultHeaderSchema,
3740
3609
  body: null,
3741
3610
  responses: {
3742
- 200: DefaultSuccessResponseSchema.extend({ message: z63.string() }),
3611
+ 200: DefaultSuccessResponseSchema.extend({ message: z62.string() }),
3743
3612
  500: DefaultErrorResponseSchema
3744
3613
  },
3745
3614
  summary: "Delete a user."
@@ -3750,23 +3619,23 @@ var userContract = initContract24().router(
3750
3619
 
3751
3620
  // src/user-presence-status-log/index.ts
3752
3621
  import { initContract as initContract25 } from "@ts-rest/core";
3753
- import z66 from "zod";
3622
+ import z65 from "zod";
3754
3623
 
3755
3624
  // src/user-presence-status-log/schema.ts
3756
- import z64 from "zod";
3625
+ import z63 from "zod";
3757
3626
  var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
3758
3627
  user: UserSchema,
3759
3628
  previousPresenceStatus: PresenceStatusSchema,
3760
3629
  newPresenceStatus: PresenceStatusSchema,
3761
- reason: z64.string()
3630
+ reason: z63.string()
3762
3631
  });
3763
3632
 
3764
3633
  // src/user-presence-status-log/validation.ts
3765
- import z65 from "zod";
3766
- var UserPresenceStatusLogParamsSchema = z65.object({
3767
- page: z65.coerce.number().default(1),
3768
- pageSize: z65.coerce.number().default(10),
3769
- selectedDate: z65.string().optional()
3634
+ import z64 from "zod";
3635
+ var UserPresenceStatusLogParamsSchema = z64.object({
3636
+ page: z64.coerce.number().default(1),
3637
+ pageSize: z64.coerce.number().default(10),
3638
+ selectedDate: z64.string().optional()
3770
3639
  }).optional();
3771
3640
 
3772
3641
  // src/user-presence-status-log/index.ts
@@ -3779,8 +3648,8 @@ var userPresenceStatusLogContract = initContract25().router(
3779
3648
  headers: DefaultHeaderSchema,
3780
3649
  responses: {
3781
3650
  200: WithPagination(UserPresenceStatusLogSchema),
3782
- 400: z66.object({
3783
- message: z66.string()
3651
+ 400: z65.object({
3652
+ message: z65.string()
3784
3653
  }),
3785
3654
  401: DefaultUnauthorizedSchema,
3786
3655
  500: DefaultErrorResponseSchema
@@ -3793,45 +3662,39 @@ var userPresenceStatusLogContract = initContract25().router(
3793
3662
 
3794
3663
  // src/widget/index.ts
3795
3664
  import { initContract as initContract26 } from "@ts-rest/core";
3796
- import z69 from "zod";
3665
+ import z68 from "zod";
3797
3666
 
3798
3667
  // src/widget/schema.ts
3799
- import z67 from "zod";
3800
- var FieldsSchema = z67.object({ data: z67.array(z67.string()) });
3801
- var WidgetPositionSchema = z67.union([
3802
- z67.literal("menu"),
3803
- z67.literal("ticket_detail"),
3804
- z67.literal("contact_detail")
3668
+ import z66 from "zod";
3669
+ var FieldsSchema = z66.object({ data: z66.array(z66.string()) });
3670
+ var WidgetPositionSchema = z66.union([
3671
+ z66.literal("menu"),
3672
+ z66.literal("ticket_detail"),
3673
+ z66.literal("contact_detail")
3805
3674
  ]);
3806
3675
  var WidgetSchema = DefaultEntitySchema.extend({
3807
- name: z67.string(),
3808
- description: z67.string().nullable(),
3676
+ name: z66.string(),
3677
+ description: z66.string().nullable(),
3809
3678
  position: WidgetPositionSchema.nullable(),
3810
3679
  fields: FieldsSchema,
3811
- url: z67.string()
3680
+ url: z66.string()
3812
3681
  });
3813
3682
 
3814
3683
  // src/widget/validation.ts
3815
- import z68 from "zod";
3816
- var CreateWidgetSchema = z68.object({
3817
- name: z68.string(),
3818
- description: z68.string(),
3819
- url: z68.string(),
3684
+ import z67 from "zod";
3685
+ var CreateWidgetSchema = z67.object({
3686
+ name: z67.string(),
3687
+ description: z67.string(),
3688
+ url: z67.string(),
3820
3689
  position: WidgetPositionSchema,
3821
- fields: z68.object({
3690
+ fields: z67.object({
3822
3691
  data: (
3823
3692
  // Array of attribute system names
3824
- z68.array(z68.string())
3693
+ z67.array(z67.string())
3825
3694
  )
3826
3695
  }).optional()
3827
3696
  });
3828
3697
  var UpdateWidgetSchema = CreateWidgetSchema;
3829
- var GetWidgetUrlPathQuerySchema = z68.object({
3830
- widgetId: z68.string(),
3831
- // Position ID is ticket ID, contact ID, etc.
3832
- // TODO: The name "Position ID" is confusing. Think of a better name.
3833
- positionId: z68.string()
3834
- });
3835
3698
 
3836
3699
  // src/widget/index.ts
3837
3700
  var widgetContract = initContract26().router(
@@ -3845,8 +3708,8 @@ var widgetContract = initContract26().router(
3845
3708
  201: DefaultSuccessResponseSchema.extend({
3846
3709
  widget: WidgetSchema
3847
3710
  }),
3848
- 400: z69.object({
3849
- message: z69.string()
3711
+ 400: z68.object({
3712
+ message: z68.string()
3850
3713
  }),
3851
3714
  401: DefaultUnauthorizedSchema,
3852
3715
  500: DefaultErrorResponseSchema
@@ -3856,17 +3719,17 @@ var widgetContract = initContract26().router(
3856
3719
  getWidgets: {
3857
3720
  method: "GET",
3858
3721
  path: "",
3859
- query: z69.object({
3860
- page: z69.coerce.number().default(1),
3861
- pageSize: z69.coerce.number().default(10),
3862
- keyword: z69.coerce.string().optional()
3722
+ query: z68.object({
3723
+ page: z68.coerce.number().default(1),
3724
+ pageSize: z68.coerce.number().default(10),
3725
+ keyword: z68.coerce.string().optional()
3863
3726
  }).optional(),
3864
3727
  headers: DefaultHeaderSchema,
3865
3728
  responses: {
3866
3729
  200: WithPagination(WidgetSchema),
3867
3730
  500: DefaultErrorResponseSchema,
3868
- 400: z69.object({
3869
- message: z69.string()
3731
+ 400: z68.object({
3732
+ message: z68.string()
3870
3733
  }),
3871
3734
  401: DefaultUnauthorizedSchema
3872
3735
  },
@@ -3877,9 +3740,9 @@ var widgetContract = initContract26().router(
3877
3740
  path: "/menu",
3878
3741
  headers: DefaultHeaderSchema,
3879
3742
  responses: {
3880
- 200: z69.array(WidgetSchema),
3881
- 400: z69.object({
3882
- message: z69.string()
3743
+ 200: z68.array(WidgetSchema),
3744
+ 400: z68.object({
3745
+ message: z68.string()
3883
3746
  }),
3884
3747
  401: DefaultUnauthorizedSchema,
3885
3748
  500: DefaultErrorResponseSchema
@@ -3891,9 +3754,9 @@ var widgetContract = initContract26().router(
3891
3754
  path: "/ticket_detail",
3892
3755
  headers: DefaultHeaderSchema,
3893
3756
  responses: {
3894
- 200: z69.array(WidgetSchema),
3895
- 400: z69.object({
3896
- message: z69.string()
3757
+ 200: z68.array(WidgetSchema),
3758
+ 400: z68.object({
3759
+ message: z68.string()
3897
3760
  }),
3898
3761
  401: DefaultUnauthorizedSchema,
3899
3762
  500: DefaultErrorResponseSchema
@@ -3905,9 +3768,9 @@ var widgetContract = initContract26().router(
3905
3768
  path: "/contact_detail",
3906
3769
  headers: DefaultHeaderSchema,
3907
3770
  responses: {
3908
- 200: z69.array(WidgetSchema),
3909
- 400: z69.object({
3910
- message: z69.string()
3771
+ 200: z68.array(WidgetSchema),
3772
+ 400: z68.object({
3773
+ message: z68.string()
3911
3774
  }),
3912
3775
  401: DefaultUnauthorizedSchema,
3913
3776
  500: DefaultErrorResponseSchema
@@ -3917,47 +3780,53 @@ var widgetContract = initContract26().router(
3917
3780
  getWidgetById: {
3918
3781
  method: "GET",
3919
3782
  path: "/:id",
3920
- pathParams: z69.object({ id: z69.string() }),
3783
+ pathParams: z68.object({ id: z68.string() }),
3921
3784
  headers: DefaultHeaderSchema,
3922
3785
  responses: {
3923
3786
  200: WidgetSchema,
3924
- 400: z69.object({
3925
- message: z69.string()
3787
+ 400: z68.object({
3788
+ message: z68.string()
3926
3789
  }),
3927
3790
  401: DefaultUnauthorizedSchema,
3928
3791
  500: DefaultErrorResponseSchema
3929
3792
  },
3930
3793
  summary: "Get widget by id"
3931
3794
  },
3932
- getWidgetUrl: {
3933
- method: "GET",
3934
- path: "/url_token/generate",
3935
- query: GetWidgetUrlPathQuerySchema,
3936
- headers: DefaultHeaderSchema,
3937
- responses: {
3938
- 201: DefaultSuccessResponseSchema.extend({
3939
- widget: z69.object({
3940
- url: z69.string()
3941
- })
3942
- }),
3943
- 400: z69.object({
3944
- message: z69.string()
3945
- }),
3946
- 401: DefaultUnauthorizedSchema
3947
- },
3948
- summary: "Generate url token for widget."
3949
- },
3795
+ // Hold
3796
+ // getWidgetUrl: {
3797
+ // method: 'GET',
3798
+ // path: '/url_token/generate',
3799
+ // pathParams: z.object({
3800
+ // widgetId: z.string(),
3801
+ // // Position ID is ticket ID, contact ID, etc.
3802
+ // // TODO: The name "Position ID" is confusing. Think of a better name.
3803
+ // positionId: z.string(),
3804
+ // }),
3805
+ // headers: DefaultHeaderSchema,
3806
+ // responses: {
3807
+ // 201: DefaultSuccessResponseSchema.extend({
3808
+ // widget: z.object({
3809
+ // url: z.string(),
3810
+ // }),
3811
+ // }),
3812
+ // 400: z.object({
3813
+ // message: z.string(),
3814
+ // }),
3815
+ // 401: DefaultUnauthorizedSchema,
3816
+ // },
3817
+ // summary: 'Generate url token for widget.',
3818
+ // },
3950
3819
  updateWidget: {
3951
3820
  method: "PATCH",
3952
3821
  path: "/:id",
3953
- pathParams: z69.object({ id: z69.string() }),
3822
+ pathParams: z68.object({ id: z68.string() }),
3954
3823
  headers: DefaultHeaderSchema,
3955
3824
  responses: {
3956
3825
  201: DefaultSuccessResponseSchema.extend({
3957
3826
  widget: WidgetSchema
3958
3827
  }),
3959
- 400: z69.object({
3960
- message: z69.string()
3828
+ 400: z68.object({
3829
+ message: z68.string()
3961
3830
  }),
3962
3831
  401: DefaultUnauthorizedSchema
3963
3832
  },
@@ -3967,11 +3836,11 @@ var widgetContract = initContract26().router(
3967
3836
  deleteWidget: {
3968
3837
  method: "DELETE",
3969
3838
  path: "/:id",
3970
- pathParams: z69.object({ id: z69.string() }),
3839
+ pathParams: z68.object({ id: z68.string() }),
3971
3840
  headers: DefaultHeaderSchema,
3972
3841
  body: null,
3973
3842
  responses: {
3974
- 200: DefaultSuccessResponseSchema.extend({ message: z69.string() }),
3843
+ 200: DefaultSuccessResponseSchema.extend({ message: z68.string() }),
3975
3844
  500: DefaultErrorResponseSchema
3976
3845
  },
3977
3846
  summary: "Delete a widget."
@@ -3982,18 +3851,18 @@ var widgetContract = initContract26().router(
3982
3851
 
3983
3852
  // src/wrap-up-form/index.ts
3984
3853
  import { initContract as initContract27 } from "@ts-rest/core";
3985
- import z71 from "zod";
3854
+ import z70 from "zod";
3986
3855
 
3987
3856
  // src/wrap-up-form/validation.ts
3988
- import { z as z70 } from "zod";
3989
- var CreateWrapUpFormSchema = z70.object({
3990
- note: z70.string().nullable().optional(),
3991
- disposition: z70.string().nullable().optional(),
3992
- callFrom: z70.string().nullable().optional(),
3993
- callTo: z70.string().nullable().optional()
3857
+ import { z as z69 } from "zod";
3858
+ var CreateWrapUpFormSchema = z69.object({
3859
+ note: z69.string().nullable().optional(),
3860
+ disposition: z69.string().nullable().optional(),
3861
+ callFrom: z69.string().nullable().optional(),
3862
+ callTo: z69.string().nullable().optional()
3994
3863
  });
3995
3864
  var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
3996
- tags: z70.array(z70.string()).optional()
3865
+ tags: z69.array(z69.string()).optional()
3997
3866
  });
3998
3867
 
3999
3868
  // src/wrap-up-form/index.ts
@@ -4008,8 +3877,8 @@ var wrapUpFormContract = initContract27().router(
4008
3877
  201: DefaultSuccessResponseSchema.extend({
4009
3878
  wrapUpForm: WrapUpFormSchema
4010
3879
  }),
4011
- 400: z71.object({
4012
- message: z71.string()
3880
+ 400: z70.object({
3881
+ message: z70.string()
4013
3882
  }),
4014
3883
  401: DefaultUnauthorizedSchema,
4015
3884
  500: DefaultErrorResponseSchema
@@ -4019,15 +3888,15 @@ var wrapUpFormContract = initContract27().router(
4019
3888
  getWrapUpForms: {
4020
3889
  method: "GET",
4021
3890
  path: "",
4022
- query: z71.object({
4023
- page: z71.coerce.number().default(1),
4024
- pageSize: z71.coerce.number().default(10)
3891
+ query: z70.object({
3892
+ page: z70.coerce.number().default(1),
3893
+ pageSize: z70.coerce.number().default(10)
4025
3894
  }).optional(),
4026
3895
  headers: DefaultHeaderSchema,
4027
3896
  responses: {
4028
3897
  200: WithPagination(WrapUpFormSchema),
4029
- 400: z71.object({
4030
- message: z71.string()
3898
+ 400: z70.object({
3899
+ message: z70.string()
4031
3900
  }),
4032
3901
  401: DefaultUnauthorizedSchema,
4033
3902
  500: DefaultErrorResponseSchema
@@ -4037,15 +3906,15 @@ var wrapUpFormContract = initContract27().router(
4037
3906
  updateWrapUpForm: {
4038
3907
  method: "PATCH",
4039
3908
  path: "/:id",
4040
- pathParams: z71.object({ id: z71.string() }),
3909
+ pathParams: z70.object({ id: z70.string() }),
4041
3910
  headers: DefaultHeaderSchema,
4042
3911
  body: UpdateWrapUpFormSchema,
4043
3912
  responses: {
4044
3913
  201: DefaultSuccessResponseSchema.extend({
4045
3914
  wrapUpForm: WrapUpFormSchema
4046
3915
  }),
4047
- 400: z71.object({
4048
- message: z71.string()
3916
+ 400: z70.object({
3917
+ message: z70.string()
4049
3918
  }),
4050
3919
  401: DefaultUnauthorizedSchema,
4051
3920
  500: DefaultErrorResponseSchema
@@ -4058,64 +3927,64 @@ var wrapUpFormContract = initContract27().router(
4058
3927
 
4059
3928
  // src/company/index.ts
4060
3929
  import { initContract as initContract28 } from "@ts-rest/core";
4061
- import z73 from "zod";
3930
+ import z72 from "zod";
4062
3931
 
4063
3932
  // src/company/validation.ts
4064
- import z72 from "zod";
4065
- var BaseSchema3 = z72.object({
4066
- isRequired: z72.boolean(),
4067
- attributeId: z72.string().uuid()
3933
+ import z71 from "zod";
3934
+ var BaseSchema3 = z71.object({
3935
+ isRequired: z71.boolean(),
3936
+ attributeId: z71.string().uuid()
4068
3937
  });
4069
3938
  var StringValue = {
4070
- value: z72.string()
3939
+ value: z71.string()
4071
3940
  };
4072
3941
  var CompanyContractsValidationSchema = {
4073
3942
  create: {
4074
- request: z72.object({
3943
+ request: z71.object({
4075
3944
  name: BaseSchema3.extend(StringValue),
4076
3945
  phone: BaseSchema3.extend(StringValue),
4077
3946
  address: BaseSchema3.extend(StringValue),
4078
3947
  industry: BaseSchema3.extend(StringValue),
4079
- customFields: z72.array(
3948
+ customFields: z71.array(
4080
3949
  BaseSchema3.extend({
4081
- value: z72.union([z72.string(), z72.array(z72.string())]),
4082
- type: z72.string(),
4083
- isDefaultAttribute: z72.boolean()
3950
+ value: z71.union([z71.string(), z71.array(z71.string())]),
3951
+ type: z71.string(),
3952
+ isDefaultAttribute: z71.boolean()
4084
3953
  })
4085
3954
  )
4086
3955
  }),
4087
3956
  response: CompanySchema
4088
3957
  },
4089
3958
  getById: {
4090
- request: z72.object({
4091
- id: z72.string().uuid()
3959
+ request: z71.object({
3960
+ id: z71.string().uuid()
4092
3961
  }),
4093
3962
  response: CompanySchema
4094
3963
  },
4095
3964
  getAll: {
4096
- request: z72.object({
4097
- page: z72.coerce.number().default(1),
4098
- pageSize: z72.coerce.number().default(10),
4099
- keyword: z72.string().optional(),
4100
- industry: z72.array(z72.string()),
4101
- name: z72.string(),
4102
- address: z72.string(),
4103
- phone: z72.string(),
4104
- selectedDate: z72.string(),
4105
- customFields: z72.array(
4106
- z72.object({
4107
- attributeId: z72.string().uuid(),
4108
- type: z72.string(),
4109
- value: z72.union([z72.string(), z72.array(z72.string())])
3965
+ request: z71.object({
3966
+ page: z71.coerce.number().default(1),
3967
+ pageSize: z71.coerce.number().default(10),
3968
+ keyword: z71.string().optional(),
3969
+ industry: z71.array(z71.string()),
3970
+ name: z71.string(),
3971
+ address: z71.string(),
3972
+ phone: z71.string(),
3973
+ selectedDate: z71.string(),
3974
+ customFields: z71.array(
3975
+ z71.object({
3976
+ attributeId: z71.string().uuid(),
3977
+ type: z71.string(),
3978
+ value: z71.union([z71.string(), z71.array(z71.string())])
4110
3979
  })
4111
3980
  )
4112
3981
  }).partial(),
4113
3982
  response: {
4114
- page: z72.number(),
4115
- pageSize: z72.number(),
4116
- total: z72.number(),
4117
- lastPage: z72.number(),
4118
- data: z72.array(CompanySchema)
3983
+ page: z71.number(),
3984
+ pageSize: z71.number(),
3985
+ total: z71.number(),
3986
+ lastPage: z71.number(),
3987
+ data: z71.array(CompanySchema)
4119
3988
  }
4120
3989
  }
4121
3990
  };
@@ -4130,14 +3999,14 @@ var companyContract = initContract28().router(
4130
3999
  201: DefaultSuccessResponseSchema.extend({
4131
4000
  data: CompanyContractsValidationSchema.create.response
4132
4001
  }),
4133
- 400: z73.object({
4134
- message: z73.string()
4002
+ 400: z72.object({
4003
+ message: z72.string()
4135
4004
  }),
4136
- 409: z73.object({
4137
- message: z73.string()
4005
+ 409: z72.object({
4006
+ message: z72.string()
4138
4007
  }),
4139
- 500: z73.object({
4140
- message: z73.string()
4008
+ 500: z72.object({
4009
+ message: z72.string()
4141
4010
  }),
4142
4011
  401: DefaultUnauthorizedSchema,
4143
4012
  404: DefaultNotFoundSchema,
@@ -4149,21 +4018,21 @@ var companyContract = initContract28().router(
4149
4018
  update: {
4150
4019
  method: "PATCH",
4151
4020
  path: "/:id",
4152
- pathParams: z73.object({
4153
- id: z73.string().uuid()
4021
+ pathParams: z72.object({
4022
+ id: z72.string().uuid()
4154
4023
  }),
4155
4024
  responses: {
4156
4025
  201: DefaultSuccessResponseSchema.extend({
4157
4026
  data: CompanyContractsValidationSchema.create.response
4158
4027
  }),
4159
- 400: z73.object({
4160
- message: z73.string()
4028
+ 400: z72.object({
4029
+ message: z72.string()
4161
4030
  }),
4162
- 409: z73.object({
4163
- message: z73.string()
4031
+ 409: z72.object({
4032
+ message: z72.string()
4164
4033
  }),
4165
- 500: z73.object({
4166
- message: z73.string()
4034
+ 500: z72.object({
4035
+ message: z72.string()
4167
4036
  }),
4168
4037
  401: DefaultUnauthorizedSchema,
4169
4038
  404: DefaultNotFoundSchema,
@@ -4175,21 +4044,21 @@ var companyContract = initContract28().router(
4175
4044
  delete: {
4176
4045
  method: "DELETE",
4177
4046
  path: "/:id",
4178
- pathParams: z73.object({
4179
- id: z73.string().uuid()
4047
+ pathParams: z72.object({
4048
+ id: z72.string().uuid()
4180
4049
  }),
4181
4050
  responses: {
4182
4051
  201: DefaultSuccessResponseSchema.extend({
4183
- message: z73.string()
4052
+ message: z72.string()
4184
4053
  }),
4185
- 400: z73.object({
4186
- message: z73.string()
4054
+ 400: z72.object({
4055
+ message: z72.string()
4187
4056
  }),
4188
- 409: z73.object({
4189
- message: z73.string()
4057
+ 409: z72.object({
4058
+ message: z72.string()
4190
4059
  }),
4191
- 500: z73.object({
4192
- message: z73.string()
4060
+ 500: z72.object({
4061
+ message: z72.string()
4193
4062
  }),
4194
4063
  401: DefaultUnauthorizedSchema,
4195
4064
  404: DefaultNotFoundSchema,
@@ -4206,14 +4075,14 @@ var companyContract = initContract28().router(
4206
4075
  200: DefaultSuccessResponseSchema.extend({
4207
4076
  data: CompanyContractsValidationSchema.create.response
4208
4077
  }),
4209
- 400: z73.object({
4210
- message: z73.string()
4078
+ 400: z72.object({
4079
+ message: z72.string()
4211
4080
  }),
4212
- 409: z73.object({
4213
- message: z73.string()
4081
+ 409: z72.object({
4082
+ message: z72.string()
4214
4083
  }),
4215
- 500: z73.object({
4216
- message: z73.string()
4084
+ 500: z72.object({
4085
+ message: z72.string()
4217
4086
  }),
4218
4087
  401: DefaultUnauthorizedSchema,
4219
4088
  404: DefaultNotFoundSchema,
@@ -4229,14 +4098,14 @@ var companyContract = initContract28().router(
4229
4098
  200: DefaultSuccessResponseSchema.extend({
4230
4099
  ...CompanyContractsValidationSchema.getAll.response
4231
4100
  }),
4232
- 400: z73.object({
4233
- message: z73.string()
4101
+ 400: z72.object({
4102
+ message: z72.string()
4234
4103
  }),
4235
- 409: z73.object({
4236
- message: z73.string()
4104
+ 409: z72.object({
4105
+ message: z72.string()
4237
4106
  }),
4238
- 500: z73.object({
4239
- message: z73.string()
4107
+ 500: z72.object({
4108
+ message: z72.string()
4240
4109
  }),
4241
4110
  401: DefaultUnauthorizedSchema,
4242
4111
  404: DefaultNotFoundSchema,
@@ -4246,7 +4115,7 @@ var companyContract = initContract28().router(
4246
4115
  }
4247
4116
  },
4248
4117
  {
4249
- pathPrefix: "companies"
4118
+ pathPrefix: "company"
4250
4119
  }
4251
4120
  );
4252
4121
 
@@ -4254,214 +4123,214 @@ var companyContract = initContract28().router(
4254
4123
  import { initContract as initContract29 } from "@ts-rest/core";
4255
4124
 
4256
4125
  // src/dashboard/validation.ts
4257
- import z74 from "zod";
4258
- var GetDashboardQueryParamsSchema = z74.object({
4259
- selectedDate: z74.string()
4126
+ import z73 from "zod";
4127
+ var GetDashboardQueryParamsSchema = z73.object({
4128
+ selectedDate: z73.string()
4260
4129
  });
4261
4130
  var GetDashboardQueryDetailParamsSchema = GetDashboardQueryParamsSchema.merge(
4262
- z74.object({
4263
- agentId: z74.string().uuid().optional()
4131
+ z73.object({
4132
+ agentId: z73.string().uuid().optional()
4264
4133
  })
4265
4134
  ).optional();
4266
4135
 
4267
4136
  // src/dashboard/index.ts
4268
- import z76 from "zod";
4137
+ import z75 from "zod";
4269
4138
 
4270
4139
  // src/dashboard/schema.ts
4271
- import z75 from "zod";
4272
- var InboundCountSchema = z75.object({
4273
- totalCallCount: z75.number(),
4274
- answeredCallCount: z75.number(),
4275
- missedCallCount: z75.number()
4276
- });
4277
- var OutboundCountSchema = z75.object({
4278
- totalCallCount: z75.number(),
4279
- answeredCallCount: z75.number(),
4280
- noAnsweredCallCount: z75.number()
4281
- });
4282
- var TwoAxiosCountSchema = z75.object({
4283
- x: z75.string(),
4284
- y: z75.string()
4285
- });
4286
- var ReceivedTicketCountDataSchema = z75.object({
4287
- name: z75.string(),
4288
- data: z75.array(TwoAxiosCountSchema)
4289
- });
4290
- var ResolvedTicketCountDataSchema = z75.object({
4291
- name: z75.string(),
4292
- data: z75.array(TwoAxiosCountSchema)
4293
- });
4294
- var TotalCallLogCountDataSchema = z75.object({
4295
- name: z75.string(),
4296
- data: z75.array(TwoAxiosCountSchema)
4297
- });
4298
- var AnsweredCallLogCountDataSchema = z75.object({
4299
- name: z75.string(),
4300
- data: z75.array(TwoAxiosCountSchema)
4301
- });
4302
- var CallLogCountByResultDaumSchema = z75.object({
4303
- result: z75.string(),
4304
- count: z75.string()
4305
- });
4306
- var DashboardDataSchema = z75.object({
4307
- receivedTicketCount: z75.number(),
4308
- pendingTicketCount: z75.number(),
4309
- openTicketCount: z75.number(),
4310
- resolvedTicketCount: z75.number(),
4311
- unResolvedTicketCount: z75.number(),
4312
- closedTicketCount: z75.number(),
4313
- unAssignedTicketCount: z75.number(),
4140
+ import z74 from "zod";
4141
+ var InboundCountSchema = z74.object({
4142
+ totalCallCount: z74.number(),
4143
+ answeredCallCount: z74.number(),
4144
+ missedCallCount: z74.number()
4145
+ });
4146
+ var OutboundCountSchema = z74.object({
4147
+ totalCallCount: z74.number(),
4148
+ answeredCallCount: z74.number(),
4149
+ noAnsweredCallCount: z74.number()
4150
+ });
4151
+ var TwoAxiosCountSchema = z74.object({
4152
+ x: z74.string(),
4153
+ y: z74.string()
4154
+ });
4155
+ var ReceivedTicketCountDataSchema = z74.object({
4156
+ name: z74.string(),
4157
+ data: z74.array(TwoAxiosCountSchema)
4158
+ });
4159
+ var ResolvedTicketCountDataSchema = z74.object({
4160
+ name: z74.string(),
4161
+ data: z74.array(TwoAxiosCountSchema)
4162
+ });
4163
+ var TotalCallLogCountDataSchema = z74.object({
4164
+ name: z74.string(),
4165
+ data: z74.array(TwoAxiosCountSchema)
4166
+ });
4167
+ var AnsweredCallLogCountDataSchema = z74.object({
4168
+ name: z74.string(),
4169
+ data: z74.array(TwoAxiosCountSchema)
4170
+ });
4171
+ var CallLogCountByResultDaumSchema = z74.object({
4172
+ result: z74.string(),
4173
+ count: z74.string()
4174
+ });
4175
+ var DashboardDataSchema = z74.object({
4176
+ receivedTicketCount: z74.number(),
4177
+ pendingTicketCount: z74.number(),
4178
+ openTicketCount: z74.number(),
4179
+ resolvedTicketCount: z74.number(),
4180
+ unResolvedTicketCount: z74.number(),
4181
+ closedTicketCount: z74.number(),
4182
+ unAssignedTicketCount: z74.number(),
4314
4183
  receivedTicketCountData: ReceivedTicketCountDataSchema,
4315
4184
  resolvedTicketCountData: ResolvedTicketCountDataSchema
4316
4185
  });
4317
4186
  var DashboardDataWithCallSchema = DashboardDataSchema.extend({
4318
- missedCallCount: z75.number(),
4319
- answeredCallCount: z75.number(),
4320
- noAnsweredCallCount: z75.number(),
4321
- totalCallCount: z75.number(),
4187
+ missedCallCount: z74.number(),
4188
+ answeredCallCount: z74.number(),
4189
+ noAnsweredCallCount: z74.number(),
4190
+ totalCallCount: z74.number(),
4322
4191
  inbound: InboundCountSchema,
4323
4192
  outbound: OutboundCountSchema,
4324
4193
  totalCallLogCountData: TotalCallLogCountDataSchema,
4325
4194
  answeredCallLogCountData: AnsweredCallLogCountDataSchema,
4326
- callLogCountByResultData: z75.array(CallLogCountByResultDaumSchema).optional()
4327
- });
4328
- var TotalTelephonyQueueCallCountListSchema = z75.object({
4329
- totalQueueCall: z75.string(),
4330
- totalMissedQueueCall: z75.string(),
4331
- totalAnsweredQueueCall: z75.string(),
4332
- totalAbandonedQueueCall: z75.string(),
4333
- totalAverageRingDuration: z75.string(),
4334
- totalAverageTalkDuration: z75.string(),
4335
- totalAverageCallDuration: z75.string(),
4336
- totalSla: z75.string(),
4337
- totalMissedCallPercent: z75.string(),
4338
- totalMaximumRingDuration: z75.string()
4339
- });
4340
- var TelephonyQueueCallCountListSchema = z75.object({
4341
- totalQueueCall: z75.string(),
4342
- totalMissedQueueCall: z75.string(),
4343
- totalAnsweredQueueCall: z75.string(),
4344
- totalAbandonedQueueCall: z75.string(),
4345
- totalAverageTalkDuration: z75.string(),
4346
- totalAverageCallDuration: z75.string(),
4347
- totalAverageRingDuration: z75.string(),
4348
- totalSla: z75.string(),
4349
- totalMissedCallPercent: z75.string(),
4350
- totalMaximumRingDuration: z75.string()
4351
- });
4352
- var TelephonyQueueCallCountListByQueueNumberSchema = z75.object({
4353
- queueNumber: z75.string(),
4354
- queueName: z75.string(),
4195
+ callLogCountByResultData: z74.array(CallLogCountByResultDaumSchema).optional()
4196
+ });
4197
+ var TotalTelephonyQueueCallCountListSchema = z74.object({
4198
+ totalQueueCall: z74.string(),
4199
+ totalMissedQueueCall: z74.string(),
4200
+ totalAnsweredQueueCall: z74.string(),
4201
+ totalAbandonedQueueCall: z74.string(),
4202
+ totalAverageRingDuration: z74.string(),
4203
+ totalAverageTalkDuration: z74.string(),
4204
+ totalAverageCallDuration: z74.string(),
4205
+ totalSla: z74.string(),
4206
+ totalMissedCallPercent: z74.string(),
4207
+ totalMaximumRingDuration: z74.string()
4208
+ });
4209
+ var TelephonyQueueCallCountListSchema = z74.object({
4210
+ totalQueueCall: z74.string(),
4211
+ totalMissedQueueCall: z74.string(),
4212
+ totalAnsweredQueueCall: z74.string(),
4213
+ totalAbandonedQueueCall: z74.string(),
4214
+ totalAverageTalkDuration: z74.string(),
4215
+ totalAverageCallDuration: z74.string(),
4216
+ totalAverageRingDuration: z74.string(),
4217
+ totalSla: z74.string(),
4218
+ totalMissedCallPercent: z74.string(),
4219
+ totalMaximumRingDuration: z74.string()
4220
+ });
4221
+ var TelephonyQueueCallCountListByQueueNumberSchema = z74.object({
4222
+ queueNumber: z74.string(),
4223
+ queueName: z74.string(),
4355
4224
  yeastarQueueCallCountList: TelephonyQueueCallCountListSchema
4356
4225
  });
4357
- var queueCallDashboardDataSchema = z75.object({
4226
+ var queueCallDashboardDataSchema = z74.object({
4358
4227
  totalTelephonyQueueCallCountList: TotalTelephonyQueueCallCountListSchema,
4359
- telephonyQueueCallCountListByQueueNumber: z75.array(
4228
+ telephonyQueueCallCountListByQueueNumber: z74.array(
4360
4229
  TelephonyQueueCallCountListByQueueNumberSchema
4361
4230
  )
4362
4231
  });
4363
- var TotalQueueLiveCallStatusSchema = z75.object({
4364
- activeCallCount: z75.number(),
4365
- waitingCallCount: z75.number()
4232
+ var TotalQueueLiveCallStatusSchema = z74.object({
4233
+ activeCallCount: z74.number(),
4234
+ waitingCallCount: z74.number()
4366
4235
  });
4367
- var QueueLiveCallListByQueueSchema = z75.object({
4368
- queueNumber: z75.string(),
4369
- activeCallCount: z75.number(),
4370
- waitingCallCount: z75.number()
4236
+ var QueueLiveCallListByQueueSchema = z74.object({
4237
+ queueNumber: z74.string(),
4238
+ activeCallCount: z74.number(),
4239
+ waitingCallCount: z74.number()
4371
4240
  });
4372
- var queueLiveCallCountListSchema = z75.object({
4241
+ var queueLiveCallCountListSchema = z74.object({
4373
4242
  totalQueueLiveCallStatus: TotalQueueLiveCallStatusSchema,
4374
- queueLiveCallListByQueue: z75.array(QueueLiveCallListByQueueSchema)
4375
- });
4376
- var TicketCountByStatusSchema = z75.object({
4377
- total: z75.number(),
4378
- open: z75.number(),
4379
- pending: z75.number(),
4380
- duration: z75.object({
4381
- day: z75.string().nullable(),
4382
- hour: z75.string().nullable()
4243
+ queueLiveCallListByQueue: z74.array(QueueLiveCallListByQueueSchema)
4244
+ });
4245
+ var TicketCountByStatusSchema = z74.object({
4246
+ total: z74.number(),
4247
+ open: z74.number(),
4248
+ pending: z74.number(),
4249
+ duration: z74.object({
4250
+ day: z74.string().nullable(),
4251
+ hour: z74.string().nullable()
4383
4252
  }),
4384
- solved: z75.number(),
4385
- others: z75.number(),
4386
- closed: z75.number(),
4387
- unassigneed: z75.number()
4388
- });
4389
- var ExpiredTicketSchema = z75.array(
4390
- z75.object({
4391
- id: z75.string(),
4392
- ticketNumber: z75.number(),
4393
- title: z75.string(),
4394
- priority: z75.string(),
4395
- expiredDays: z75.number()
4253
+ solved: z74.number(),
4254
+ others: z74.number(),
4255
+ closed: z74.number(),
4256
+ unassigneed: z74.number()
4257
+ });
4258
+ var ExpiredTicketSchema = z74.array(
4259
+ z74.object({
4260
+ id: z74.string(),
4261
+ ticketNumber: z74.number(),
4262
+ title: z74.string(),
4263
+ priority: z74.string(),
4264
+ expiredDays: z74.number()
4396
4265
  })
4397
4266
  );
4398
- var TagCountObjSchema = z75.array(
4399
- z75.object({
4400
- id: z75.string(),
4401
- name: z75.string(),
4402
- count: z75.number()
4267
+ var TagCountObjSchema = z74.array(
4268
+ z74.object({
4269
+ id: z74.string(),
4270
+ name: z74.string(),
4271
+ count: z74.number()
4403
4272
  })
4404
4273
  );
4405
- var MessageCountsByChannelObjSchema = z75.record(
4406
- z75.array(
4407
- z75.object({
4408
- platform: z75.string(),
4409
- messageCount: z75.number()
4274
+ var MessageCountsByChannelObjSchema = z74.record(
4275
+ z74.array(
4276
+ z74.object({
4277
+ platform: z74.string(),
4278
+ messageCount: z74.number()
4410
4279
  })
4411
4280
  )
4412
4281
  );
4413
- var CallEndResultSchema = z75.array(
4414
- z75.object({ result: z75.string().nullable(), count: z75.string().nullable() }).optional()
4282
+ var CallEndResultSchema = z74.array(
4283
+ z74.object({ result: z74.string().nullable(), count: z74.string().nullable() }).optional()
4415
4284
  ).optional();
4416
- var ConversationCountStatusSchema = z75.object({
4417
- newContactCount: z75.number().nullable(),
4418
- oldContactCount: z75.number().nullable()
4419
- });
4420
- var MessageStatusSchema = z75.object({
4421
- total: z75.number().nullable(),
4422
- closed: z75.number().nullable(),
4423
- unassignedOpen: z75.number().nullable(),
4424
- assignedOpen: z75.number().nullable()
4425
- });
4426
- var MessageAverageSchema = z75.object({
4427
- selectedWeekAvgByDay: z75.array(
4428
- z75.object({
4429
- day: z75.string().nullable(),
4430
- avgResolutionTime: z75.string().nullable(),
4431
- avgResponseTime: z75.string().nullable()
4285
+ var ConversationCountStatusSchema = z74.object({
4286
+ newContactCount: z74.number().nullable(),
4287
+ oldContactCount: z74.number().nullable()
4288
+ });
4289
+ var MessageStatusSchema = z74.object({
4290
+ total: z74.number().nullable(),
4291
+ closed: z74.number().nullable(),
4292
+ unassignedOpen: z74.number().nullable(),
4293
+ assignedOpen: z74.number().nullable()
4294
+ });
4295
+ var MessageAverageSchema = z74.object({
4296
+ selectedWeekAvgByDay: z74.array(
4297
+ z74.object({
4298
+ day: z74.string().nullable(),
4299
+ avgResolutionTime: z74.string().nullable(),
4300
+ avgResponseTime: z74.string().nullable()
4432
4301
  })
4433
4302
  ).optional().nullable(),
4434
- previousWeekAvg: z75.object({
4435
- avgResolutionTime: z75.string().nullable(),
4436
- avgResponseTime: z75.string().nullable()
4303
+ previousWeekAvg: z74.object({
4304
+ avgResolutionTime: z74.string().nullable(),
4305
+ avgResponseTime: z74.string().nullable()
4437
4306
  }).nullable().optional(),
4438
- selectedWeekAvg: z75.object({
4439
- avgResolutionTime: z75.string().nullable(),
4440
- avgResponseTime: z75.string().nullable()
4307
+ selectedWeekAvg: z74.object({
4308
+ avgResolutionTime: z74.string().nullable(),
4309
+ avgResponseTime: z74.string().nullable()
4441
4310
  }).nullable().optional()
4442
4311
  });
4443
- var MessagePlatformDataSchema = z75.object({
4444
- messengerCount: z75.object({ count: z75.number().nullable() }).nullable(),
4445
- lineCount: z75.object({ count: z75.number() }).nullable(),
4446
- viberCount: z75.object({ count: z75.number() }).nullable(),
4447
- instagramCount: z75.object({ count: z75.number() }).nullable()
4448
- });
4449
- var MessageDispositionSchema = z75.object({
4450
- resolvedDispositionCount: z75.number().nullable(),
4451
- prankDispositionCount: z75.number().nullable(),
4452
- followUpDispositionCount: z75.number().nullable(),
4453
- blankDispositionCount: z75.number().nullable(),
4454
- escalatedDispositionCount: z75.number().nullable()
4455
- });
4456
- var MessageIncomingDataSchema = z75.array(
4457
- z75.object({
4458
- platform: z75.string().nullable(),
4459
- hour: z75.string().nullable(),
4460
- messageCount: z75.string().nullable()
4461
- })
4312
+ var MessagePlatformDataSchema = z74.object({
4313
+ messengerCount: z74.object({ count: z74.number().nullable() }).nullable(),
4314
+ lineCount: z74.object({ count: z74.number() }).nullable(),
4315
+ viberCount: z74.object({ count: z74.number() }).nullable(),
4316
+ instagramCount: z74.object({ count: z74.number() }).nullable()
4317
+ });
4318
+ var MessageDispositionSchema = z74.object({
4319
+ resolvedDispositionCount: z74.number().nullable(),
4320
+ prankDispositionCount: z74.number().nullable(),
4321
+ followUpDispositionCount: z74.number().nullable(),
4322
+ blankDispositionCount: z74.number().nullable(),
4323
+ escalatedDispositionCount: z74.number().nullable()
4324
+ });
4325
+ var MessageIncomingDataSchema = z74.array(
4326
+ z74.object({
4327
+ platform: z74.string().nullable(),
4328
+ hour: z74.string().nullable(),
4329
+ messageCount: z74.string().nullable()
4330
+ }).nullable().optional()
4462
4331
  );
4463
- var MessageTotalIncomingDataSchema = z75.array(
4464
- z75.object({ name: z75.string(), data: z75.array(z75.number()) }).nullable()
4332
+ var MessageTotalIncomingDataSchema = z74.array(
4333
+ z74.object({ name: z74.string(), data: z74.array(z74.number()) }).nullable()
4465
4334
  );
4466
4335
 
4467
4336
  // src/dashboard/index.ts
@@ -4477,8 +4346,8 @@ var dashboardContract = initContract29().router(
4477
4346
  200: DefaultSuccessResponseSchema.extend({
4478
4347
  dashboard: DashboardDataSchema
4479
4348
  }),
4480
- 400: z76.object({
4481
- message: z76.string()
4349
+ 400: z75.object({
4350
+ message: z75.string()
4482
4351
  }),
4483
4352
  401: DefaultUnauthorizedSchema
4484
4353
  }
@@ -4493,8 +4362,8 @@ var dashboardContract = initContract29().router(
4493
4362
  200: DefaultSuccessResponseSchema.extend({
4494
4363
  queuecallDashboard: queueCallDashboardDataSchema
4495
4364
  }),
4496
- 400: z76.object({
4497
- message: z76.string()
4365
+ 400: z75.object({
4366
+ message: z75.string()
4498
4367
  }),
4499
4368
  401: DefaultUnauthorizedSchema
4500
4369
  }
@@ -4720,54 +4589,54 @@ var dashboardContract = initContract29().router(
4720
4589
 
4721
4590
  // src/comment/index.ts
4722
4591
  import { initContract as initContract30 } from "@ts-rest/core";
4723
- import z80 from "zod";
4592
+ import z79 from "zod";
4724
4593
 
4725
4594
  // src/comment/validation.ts
4726
- import { z as z77 } from "zod";
4727
- var CreateCommentSchema = z77.object({
4728
- ticketId: z77.string(),
4729
- comment: z77.string(),
4730
- mentions: z77.array(z77.string()).optional()
4595
+ import { z as z76 } from "zod";
4596
+ var CreateCommentSchema = z76.object({
4597
+ ticketId: z76.string(),
4598
+ comment: z76.string(),
4599
+ mentions: z76.array(z76.string()).optional()
4731
4600
  });
4732
4601
  var UpdateCommentSchema = CreateCommentSchema;
4733
- var GetCommentQuerySchema = z77.object({
4734
- ticketId: z77.string().optional(),
4735
- deleted: z77.enum(["true", "false"]).default("false").transform((v) => v === "true" ? true : false)
4602
+ var GetCommentQuerySchema = z76.object({
4603
+ ticketId: z76.string().optional(),
4604
+ deleted: z76.enum(["true", "false"]).default("false").transform((v) => v === "true" ? true : false)
4736
4605
  }).optional();
4737
4606
 
4738
4607
  // src/comment/schema.ts
4739
- import z79 from "zod";
4608
+ import z78 from "zod";
4740
4609
 
4741
4610
  // src/activity-log/schema.ts
4742
- import z78 from "zod";
4743
- var EntitySchema = z78.object({
4744
- id: z78.string().uuid(),
4745
- createdAt: z78.date(),
4746
- updatedAt: z78.date(),
4747
- deletedAt: z78.date().nullable(),
4748
- entity: z78.string(),
4749
- description: z78.string()
4750
- });
4751
- var ActivityLogSchema = z78.object({
4752
- id: z78.string().uuid(),
4753
- createdAt: z78.date(),
4754
- updatedAt: z78.date(),
4755
- deletedAt: z78.date().nullable(),
4611
+ import z77 from "zod";
4612
+ var EntitySchema = z77.object({
4613
+ id: z77.string().uuid(),
4614
+ createdAt: z77.date(),
4615
+ updatedAt: z77.date(),
4616
+ deletedAt: z77.date().nullable(),
4617
+ entity: z77.string(),
4618
+ description: z77.string()
4619
+ });
4620
+ var ActivityLogSchema = z77.object({
4621
+ id: z77.string().uuid(),
4622
+ createdAt: z77.date(),
4623
+ updatedAt: z77.date(),
4624
+ deletedAt: z77.date().nullable(),
4756
4625
  actor: UserSchema,
4757
- entityId: z78.string(),
4758
- description: z78.string(),
4626
+ entityId: z77.string(),
4627
+ description: z77.string(),
4759
4628
  entityType: EntitySchema
4760
4629
  });
4761
4630
 
4762
4631
  // src/comment/schema.ts
4763
- var CommentSchema = z79.object({
4764
- id: z79.string().uuid(),
4765
- createdAt: z79.date(),
4766
- updatedAt: z79.date(),
4767
- deletedAt: z79.date().nullable(),
4768
- activityLogs: z79.array(ActivityLogSchema),
4769
- comment: z79.string(),
4770
- mentions: z79.array(z79.string()),
4632
+ var CommentSchema = z78.object({
4633
+ id: z78.string().uuid(),
4634
+ createdAt: z78.date(),
4635
+ updatedAt: z78.date(),
4636
+ deletedAt: z78.date().nullable(),
4637
+ activityLogs: z78.array(ActivityLogSchema),
4638
+ comment: z78.string(),
4639
+ mentions: z78.array(z78.string()),
4771
4640
  ticket: TicketSchema,
4772
4641
  agent: UserSchema
4773
4642
  });
@@ -4784,8 +4653,8 @@ var commentContract = initContract30().router(
4784
4653
  201: DefaultSuccessResponseSchema.extend({
4785
4654
  comment: CommentSchema
4786
4655
  }),
4787
- 400: z80.object({
4788
- message: z80.string()
4656
+ 400: z79.object({
4657
+ message: z79.string()
4789
4658
  }),
4790
4659
  401: DefaultUnauthorizedSchema,
4791
4660
  500: DefaultErrorResponseSchema
@@ -4798,9 +4667,9 @@ var commentContract = initContract30().router(
4798
4667
  headers: DefaultHeaderSchema,
4799
4668
  query: GetCommentQuerySchema,
4800
4669
  responses: {
4801
- 201: z80.array(CommentSchema),
4802
- 400: z80.object({
4803
- message: z80.string()
4670
+ 201: z79.array(CommentSchema),
4671
+ 400: z79.object({
4672
+ message: z79.string()
4804
4673
  }),
4805
4674
  401: DefaultUnauthorizedSchema,
4806
4675
  500: DefaultErrorResponseSchema
@@ -4810,7 +4679,7 @@ var commentContract = initContract30().router(
4810
4679
  updateComment: {
4811
4680
  method: "PATCH",
4812
4681
  path: "/:id",
4813
- pathParams: z80.object({ id: z80.string() }),
4682
+ pathParams: z79.object({ id: z79.string() }),
4814
4683
  headers: DefaultHeaderSchema,
4815
4684
  body: UpdateCommentSchema,
4816
4685
  responses: {
@@ -4824,11 +4693,11 @@ var commentContract = initContract30().router(
4824
4693
  deleteComment: {
4825
4694
  method: "DELETE",
4826
4695
  path: "/:id",
4827
- pathParams: z80.object({ id: z80.string() }),
4696
+ pathParams: z79.object({ id: z79.string() }),
4828
4697
  headers: DefaultHeaderSchema,
4829
4698
  body: null,
4830
4699
  responses: {
4831
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
4700
+ 200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
4832
4701
  500: DefaultErrorResponseSchema
4833
4702
  },
4834
4703
  summary: "Delete a comment."
@@ -4839,7 +4708,7 @@ var commentContract = initContract30().router(
4839
4708
 
4840
4709
  // src/activity-log/index.ts
4841
4710
  import { initContract as initContract31 } from "@ts-rest/core";
4842
- import z81 from "zod";
4711
+ import z80 from "zod";
4843
4712
  var activityLogContract = initContract31().router(
4844
4713
  {
4845
4714
  getActivityLogs: {
@@ -4847,9 +4716,9 @@ var activityLogContract = initContract31().router(
4847
4716
  path: "",
4848
4717
  headers: DefaultHeaderSchema,
4849
4718
  responses: {
4850
- 200: z81.array(ActivityLogSchema),
4851
- 400: z81.object({
4852
- message: z81.string()
4719
+ 200: z80.array(ActivityLogSchema),
4720
+ 400: z80.object({
4721
+ message: z80.string()
4853
4722
  }),
4854
4723
  401: DefaultUnauthorizedSchema,
4855
4724
  500: DefaultErrorResponseSchema
@@ -4860,36 +4729,101 @@ var activityLogContract = initContract31().router(
4860
4729
  { pathPrefix: "activity-log" }
4861
4730
  );
4862
4731
 
4863
- // src/evaluate-form/index.ts
4864
- import z83 from "zod";
4865
-
4866
- // src/evaluate-form/validation.ts
4732
+ // src/telephony-cdr/index.ts
4867
4733
  import z82 from "zod";
4868
- var CreateEvaluateFormSchema = z82.object({
4869
- cxLogId: z82.string().uuid(),
4870
- sentimentScore: z82.string().nullable(),
4871
- csatScore: z82.string().nullable()
4734
+
4735
+ // src/telephony-cdr/validation.ts
4736
+ import z81 from "zod";
4737
+ var CreateTelephonyCdrSchema = z81.object({
4738
+ uniqueCallId: z81.string({ required_error: "uniqueCallId is required" }),
4739
+ timeStart: z81.string({ required_error: "timeStart is required" }),
4740
+ callFrom: z81.string({ required_error: "callFrom is required" }),
4741
+ callTo: z81.string({ required_error: "callTo is required" }),
4742
+ callDuration: z81.number().nullable(),
4743
+ talkDuration: z81.number().nullable(),
4744
+ srcTrunkName: z81.string().nullable(),
4745
+ dstTrunkName: z81.string().nullable(),
4746
+ pinCode: z81.string().nullable(),
4747
+ status: z81.string(),
4748
+ type: z81.string(),
4749
+ recording: z81.string().nullable(),
4750
+ didNumber: z81.string().nullable(),
4751
+ agentRingTime: z81.number().nullable()
4752
+ });
4753
+ var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
4754
+ selectedDate: z81.string().optional(),
4755
+ type: z81.array(z81.string()).optional(),
4756
+ status: z81.array(z81.string()).optional(),
4757
+ callFrom: z81.string().optional(),
4758
+ callTo: z81.string().optional(),
4759
+ trunk: z81.array(z81.string()).optional()
4760
+ });
4761
+ var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
4762
+ type: z81.array(z81.string()).optional(),
4763
+ status: z81.array(z81.string()).optional(),
4764
+ callFrom: z81.string().optional(),
4765
+ callTo: z81.string().optional(),
4766
+ result: z81.array(z81.string()).optional(),
4767
+ callTags: z81.array(z81.string()).optional(),
4768
+ selectedDate: z81.string().optional(),
4769
+ agentId: z81.string().optional(),
4770
+ contact: z81.array(z81.string()).optional(),
4771
+ callStatus: z81.array(z81.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
4772
+ queueIds: z81.array(z81.string()).optional(),
4773
+ notes: z81.string().optional()
4872
4774
  });
4873
- var UpdateEvaluateFormSchema = CreateEvaluateFormSchema.partial();
4874
4775
 
4875
- // src/evaluate-form/index.ts
4776
+ // src/telephony-cdr/index.ts
4876
4777
  import { initContract as initContract32 } from "@ts-rest/core";
4877
- var evaluateFormContract = initContract32().router(
4778
+ var telephonyCdrContract = initContract32().router(
4878
4779
  {
4879
- create: {
4780
+ findAll: {
4781
+ method: "GET",
4880
4782
  path: "/",
4881
- method: "POST",
4882
- body: CreateEvaluateFormSchema,
4783
+ headers: DefaultHeaderSchema,
4784
+ query: GetAllTelephonyCdrSchema,
4883
4785
  responses: {
4884
- 201: DefaultSuccessResponseSchema.extend({
4885
- message: z83.string()
4886
- }),
4887
- 401: DefaultUnauthorizedSchema
4786
+ 200: DefaultSuccessResponseSchema.extend({
4787
+ total: z82.number(),
4788
+ page: z82.number(),
4789
+ pageSize: z82.number(),
4790
+ telephonyCdrs: z82.array(CreateTelephonyCdrSchema)
4791
+ })
4888
4792
  },
4889
- summary: "Create evaluate form"
4793
+ summary: "Get all telephony cdr."
4794
+ },
4795
+ getRecordings: {
4796
+ method: "GET",
4797
+ path: "/recordings",
4798
+ headers: DefaultHeaderSchema,
4799
+ query: GetAllTelephonyCdrSchema,
4800
+ responses: {
4801
+ 200: DefaultSuccessResponseSchema.extend({
4802
+ total: z82.number(),
4803
+ page: z82.number(),
4804
+ pageSize: z82.number(),
4805
+ telephonyCdrs: z82.array(CreateTelephonyCdrSchema)
4806
+ })
4807
+ },
4808
+ summary: "Get all telephony cdr."
4809
+ },
4810
+ getRecentCall: {
4811
+ method: "GET",
4812
+ path: "/recent-calls",
4813
+ headers: DefaultHeaderSchema,
4814
+ query: GetRecentTelephonyCdrSchema,
4815
+ responses: {
4816
+ 200: DefaultSuccessResponseSchema.extend({
4817
+ total: z82.number(),
4818
+ page: z82.number(),
4819
+ pageSize: z82.number(),
4820
+ telephonyCdrs: z82.array(CreateTelephonyCdrSchema)
4821
+ })
4822
+ },
4823
+ summary: "Get recent telephony cdr."
4890
4824
  }
4891
4825
  },
4892
- { pathPrefix: "evaluate-forms" }
4826
+ { pathPrefix: "telephony-cdr" }
4893
4827
  );
4894
4828
 
4895
4829
  // src/contract.ts
@@ -4915,8 +4849,7 @@ var apiContract = initContract33().router({
4915
4849
  userPresenceStatusLog: userPresenceStatusLogContract,
4916
4850
  contact: contactContract,
4917
4851
  ticket: ticketContract,
4918
- company: companyContract,
4919
- evaluateForm: evaluateFormContract
4852
+ company: companyContract
4920
4853
  });
4921
4854
  var commentActivityContract = initContract33().router({
4922
4855
  comment: commentContract,
@@ -4929,6 +4862,9 @@ var platformContract = initContract33().router({
4929
4862
  var chatContract = initContract33().router({
4930
4863
  main: mainChatContract
4931
4864
  });
4865
+ var telephonyContract = initContract33().router({
4866
+ telephonyCdr: telephonyCdrContract
4867
+ });
4932
4868
  export {
4933
4869
  activityLogContract,
4934
4870
  apiContract,
@@ -4937,12 +4873,12 @@ export {
4937
4873
  chatContract,
4938
4874
  commentActivityContract,
4939
4875
  commentContract,
4940
- companyContract,
4941
4876
  cxLogContract,
4942
4877
  dashboardContract,
4943
- evaluateFormContract,
4944
4878
  platformContract,
4945
4879
  tagContract,
4880
+ telephonyCdrContract,
4881
+ telephonyContract,
4946
4882
  ticketContract,
4947
4883
  userContract,
4948
4884
  userPresenceStatusLogContract,