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