@kl1/contracts 1.0.78 → 1.0.80

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 (66) hide show
  1. package/dist/index.js +1746 -1392
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +1745 -1392
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/src/call-log/schema.d.ts +6 -6
  6. package/dist/src/call-log/validation.d.ts +4 -4
  7. package/dist/src/channel/index.d.ts +59 -59
  8. package/dist/src/channel/schema.d.ts +4 -4
  9. package/dist/src/channel/schema.d.ts.map +1 -1
  10. package/dist/src/channel/validation.d.ts +3 -3
  11. package/dist/src/chat/index.d.ts +6967 -3685
  12. package/dist/src/chat/index.d.ts.map +1 -1
  13. package/dist/src/chat/schema.d.ts +3294 -990
  14. package/dist/src/chat/schema.d.ts.map +1 -1
  15. package/dist/src/chat/validation.d.ts +1947 -306
  16. package/dist/src/chat/validation.d.ts.map +1 -1
  17. package/dist/src/comment/index.d.ts +584 -584
  18. package/dist/src/comment/schema.d.ts +144 -144
  19. package/dist/src/contact/index.d.ts +4 -1
  20. package/dist/src/contact/index.d.ts.map +1 -1
  21. package/dist/src/contact/schema.d.ts +156 -0
  22. package/dist/src/contact/schema.d.ts.map +1 -1
  23. package/dist/src/contract.d.ts +35549 -20637
  24. package/dist/src/contract.d.ts.map +1 -1
  25. package/dist/src/cx-log/index.d.ts +950 -101
  26. package/dist/src/cx-log/index.d.ts.map +1 -1
  27. package/dist/src/cx-log/schema.d.ts +810 -71
  28. package/dist/src/cx-log/schema.d.ts.map +1 -1
  29. package/dist/src/dashboard/index.d.ts +4 -4
  30. package/dist/src/dashboard/schema.d.ts +2 -2
  31. package/dist/src/index.d.ts +0 -1
  32. package/dist/src/index.d.ts.map +1 -1
  33. package/dist/src/instagram/index.d.ts +2162 -343
  34. package/dist/src/instagram/index.d.ts.map +1 -1
  35. package/dist/src/line/index.d.ts +1919 -278
  36. package/dist/src/line/index.d.ts.map +1 -1
  37. package/dist/src/mail/mail-contract.d.ts +130 -130
  38. package/dist/src/mail/message-contract.d.ts +6 -6
  39. package/dist/src/mail/room-contract.d.ts +124 -124
  40. package/dist/src/mail/schemas/message.schema.d.ts +4 -4
  41. package/dist/src/mail/schemas/room-validation.schema.d.ts +40 -40
  42. package/dist/src/mail/schemas/room.schema.d.ts +30 -30
  43. package/dist/src/messenger/index.d.ts +2516 -516
  44. package/dist/src/messenger/index.d.ts.map +1 -1
  45. package/dist/src/messenger/validation.d.ts +1523 -0
  46. package/dist/src/messenger/validation.d.ts.map +1 -1
  47. package/dist/src/notification/index.d.ts +742 -0
  48. package/dist/src/notification/index.d.ts.map +1 -0
  49. package/dist/src/notification/schema.d.ts +48 -0
  50. package/dist/src/notification/schema.d.ts.map +1 -0
  51. package/dist/src/notification/validation.d.ts +148 -0
  52. package/dist/src/notification/validation.d.ts.map +1 -0
  53. package/dist/src/telephony-cdr/index.d.ts +3036 -818
  54. package/dist/src/telephony-cdr/index.d.ts.map +1 -1
  55. package/dist/src/telephony-cdr/schema.d.ts +841 -7
  56. package/dist/src/telephony-cdr/schema.d.ts.map +1 -1
  57. package/dist/src/telephony-cdr/validation.d.ts +4 -4
  58. package/dist/src/ticket/index.d.ts +1106 -1106
  59. package/dist/src/ticket/schema.d.ts +72 -72
  60. package/dist/src/ticket/validation.d.ts +12 -12
  61. package/dist/src/viber/index.d.ts +3525 -1159
  62. package/dist/src/viber/index.d.ts.map +1 -1
  63. package/dist/src/wrap-up-form/index.d.ts +19 -19
  64. package/dist/src/wrap-up-form/schema.d.ts +2 -2
  65. package/dist/src/wrap-up-form/validation.d.ts +3 -3
  66. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/contract.ts
2
- import { initContract as initContract37 } from "@ts-rest/core";
2
+ import { initContract as initContract38 } from "@ts-rest/core";
3
3
 
4
4
  // src/activity-log/index.ts
5
5
  import { initContract } from "@ts-rest/core";
@@ -619,129 +619,113 @@ import { initContract as initContract6 } from "@ts-rest/core";
619
619
  import z32 from "zod";
620
620
 
621
621
  // src/messenger/validation.ts
622
- import z16 from "zod";
623
- var GetFacebookPagesSchema = z16.object({
624
- data: z16.array(
625
- z16.object({
626
- // biome-ignore lint/style/useNamingConvention: <explanation>
627
- access_token: z16.string(),
628
- category: z16.string(),
629
- // biome-ignore lint/style/useNamingConvention: <explanation>
630
- category_list: z16.array(
631
- z16.object({
632
- id: z16.string(),
633
- name: z16.string()
634
- })
635
- ),
636
- id: z16.string(),
637
- name: z16.string(),
638
- tasks: z16.string().array()
639
- })
640
- ),
641
- paging: z16.object({
642
- cursors: z16.object({
643
- before: z16.string().optional(),
644
- after: z16.string().optional()
645
- })
646
- }).optional()
647
- });
648
- var GetFacebookPagesQuerySchema = z16.object({
649
- accessToken: z16.string(),
650
- userId: z16.string()
651
- });
622
+ import z27 from "zod";
652
623
 
653
624
  // src/channel/schema.ts
654
- import z17 from "zod";
655
- var ChannelTypeSchema = z17.enum([
625
+ import z16 from "zod";
626
+ var ChannelTypeSchema = z16.enum([
656
627
  "whatsapp",
657
628
  "messenger",
658
629
  "telegram",
630
+ "instagram",
659
631
  "line",
660
632
  "viber",
661
633
  "kakao",
662
634
  "shopee",
663
- "lazada",
664
- "instagram"
635
+ "lazada"
665
636
  ]);
666
- var ChannelStatusTypeSchema = z17.union([
667
- z17.literal(true),
637
+ var ChannelStatusTypeSchema = z16.union([
638
+ z16.literal(true),
668
639
  // on
669
- z17.literal(false)
640
+ z16.literal(false)
670
641
  // off
671
642
  ]);
672
- var ChannelMetadataSchema = z17.object({
673
- id: z17.string(),
674
- name: z17.string(),
675
- accessToken: z17.string(),
676
- channelSecret: z17.string().optional(),
677
- additionalCredentials: z17.any().optional()
678
- });
679
- var ChannelSchema = z17.object({
680
- id: z17.string().uuid(),
681
- createdAt: z17.date(),
682
- updatedAt: z17.date(),
683
- deletedAt: z17.date().nullable(),
684
- name: z17.string(),
643
+ var ChannelMetadataSchema = z16.object({
644
+ id: z16.string(),
645
+ name: z16.string(),
646
+ accessToken: z16.string(),
647
+ channelSecret: z16.string().optional(),
648
+ additionalCredentials: z16.any().optional()
649
+ });
650
+ var ChannelSchema = z16.object({
651
+ id: z16.string().uuid(),
652
+ createdAt: z16.date(),
653
+ updatedAt: z16.date(),
654
+ deletedAt: z16.date().nullable(),
655
+ name: z16.string(),
685
656
  type: ChannelTypeSchema,
686
657
  metadata: ChannelMetadataSchema,
687
- brandName: z17.string(),
688
- platformId: z17.string(),
658
+ brandName: z16.string(),
659
+ platformId: z16.string(),
689
660
  status: ChannelStatusTypeSchema,
690
- isReloginRequired: z17.boolean(),
691
- connectedUserName: z17.string(),
692
- connectedUserId: z17.string(),
693
- actor: z17.object({
694
- id: z17.string().uuid(),
695
- createdAt: z17.date(),
696
- updatedAt: z17.date(),
697
- deletedAt: z17.date().nullable(),
698
- name: z17.string(),
699
- email: z17.string().email(),
700
- emailVerifiedAt: z17.date().nullable(),
701
- password: z17.string(),
702
- address: z17.string().nullable(),
703
- phone: z17.string().nullable(),
704
- notificationCount: z17.number().nullable(),
705
- roles: z17.array(
706
- z17.object({
707
- id: z17.string().uuid(),
708
- createdAt: z17.date(),
709
- updatedAt: z17.date(),
710
- deletedAt: z17.date().nullable(),
711
- systemName: z17.string(),
712
- displayName: z17.string(),
713
- description: z17.string().nullable(),
714
- permissions: z17.array(
715
- z17.object({
716
- id: z17.string().uuid(),
717
- createdAt: z17.date(),
718
- updatedAt: z17.date(),
719
- deletedAt: z17.date().nullable(),
720
- systemName: z17.string(),
721
- displayName: z17.string(),
722
- description: z17.string().nullable()
661
+ isReloginRequired: z16.boolean(),
662
+ connectedUserName: z16.string(),
663
+ connectedUserId: z16.string(),
664
+ actor: z16.object({
665
+ id: z16.string().uuid(),
666
+ createdAt: z16.date(),
667
+ updatedAt: z16.date(),
668
+ deletedAt: z16.date().nullable(),
669
+ name: z16.string(),
670
+ email: z16.string().email(),
671
+ emailVerifiedAt: z16.date().nullable(),
672
+ password: z16.string(),
673
+ address: z16.string().nullable(),
674
+ phone: z16.string().nullable(),
675
+ notificationCount: z16.number().nullable(),
676
+ roles: z16.array(
677
+ z16.object({
678
+ id: z16.string().uuid(),
679
+ createdAt: z16.date(),
680
+ updatedAt: z16.date(),
681
+ deletedAt: z16.date().nullable(),
682
+ systemName: z16.string(),
683
+ displayName: z16.string(),
684
+ description: z16.string().nullable(),
685
+ permissions: z16.array(
686
+ z16.object({
687
+ id: z16.string().uuid(),
688
+ createdAt: z16.date(),
689
+ updatedAt: z16.date(),
690
+ deletedAt: z16.date().nullable(),
691
+ systemName: z16.string(),
692
+ displayName: z16.string(),
693
+ description: z16.string().nullable()
723
694
  })
724
695
  )
725
696
  })
726
697
  ),
727
- extension: z17.object({
728
- id: z17.string().uuid(),
729
- createdAt: z17.date(),
730
- updatedAt: z17.date(),
731
- deletedAt: z17.date().nullable(),
732
- userId: z17.string().nullable(),
733
- sipServerUrl: z17.string(),
734
- sipUserName: z17.string(),
735
- webphoneLoginUser: z17.string(),
736
- extensionId: z17.coerce.string().nullable(),
737
- extensionName: z17.string(),
738
- telephonySignature: z17.string().nullable()
698
+ extension: z16.object({
699
+ id: z16.string().uuid(),
700
+ createdAt: z16.date(),
701
+ updatedAt: z16.date(),
702
+ deletedAt: z16.date().nullable(),
703
+ userId: z16.string().nullable(),
704
+ sipServerUrl: z16.string(),
705
+ sipUserName: z16.string(),
706
+ webphoneLoginUser: z16.string(),
707
+ extensionId: z16.coerce.string().nullable(),
708
+ extensionName: z16.string(),
709
+ telephonySignature: z16.string().nullable()
739
710
  })
740
711
  })
741
712
  });
742
713
 
743
- // src/chat/validation.ts
744
- import z29 from "zod";
714
+ // src/chat/schema.ts
715
+ import z26 from "zod";
716
+
717
+ // src/contact/schema.ts
718
+ import z20 from "zod";
719
+
720
+ // src/tag/schema.ts
721
+ import z17 from "zod";
722
+ var TagSchema = DefaultEntitySchema.extend({
723
+ name: z17.string()
724
+ });
725
+ var TagGroupSchema = z17.union([
726
+ z17.literal("general"),
727
+ z17.literal("contact")
728
+ ]);
745
729
 
746
730
  // src/company/schema.ts
747
731
  import z18 from "zod";
@@ -760,128 +744,319 @@ var CompanySchema = DefaultEntitySchema.extend({
760
744
  customFields: z18.array(CompanyCustomFieldSchema).optional()
761
745
  });
762
746
 
763
- // src/contact/schema.ts
764
- import z21 from "zod";
765
-
766
- // src/tag/schema.ts
767
- import z19 from "zod";
768
- var TagSchema = DefaultEntitySchema.extend({
769
- name: z19.string()
770
- });
771
- var TagGroupSchema = z19.union([
772
- z19.literal("general"),
773
- z19.literal("contact")
774
- ]);
775
-
776
747
  // src/upload/schema.ts
777
- import z20 from "zod";
748
+ import z19 from "zod";
778
749
  var UploadSchema = DefaultEntitySchema.extend({
779
- bucketName: z20.string(),
780
- fileName: z20.string(),
781
- fileSize: z20.number(),
782
- fileKey: z20.string(),
783
- fileUrl: z20.string().nullable(),
784
- status: z20.string().optional()
785
- });
786
- var RenameAttachmentSchema = z20.object({
787
- newName: z20.string()
788
- });
789
- var DeleteAttachmentSchema = z20.object({
790
- group: z20.union([
791
- z20.literal("ticket"),
792
- z20.literal("contact"),
793
- z20.literal("company")
750
+ bucketName: z19.string(),
751
+ fileName: z19.string(),
752
+ fileSize: z19.number(),
753
+ fileKey: z19.string(),
754
+ fileUrl: z19.string().nullable(),
755
+ status: z19.string().optional()
756
+ });
757
+ var RenameAttachmentSchema = z19.object({
758
+ newName: z19.string()
759
+ });
760
+ var DeleteAttachmentSchema = z19.object({
761
+ group: z19.union([
762
+ z19.literal("ticket"),
763
+ z19.literal("contact"),
764
+ z19.literal("company")
794
765
  ])
795
766
  });
796
767
 
797
768
  // src/contact/schema.ts
798
- var ContactPhonesSchema = z21.object({
799
- id: z21.string().uuid(),
800
- createdAt: z21.date(),
801
- updatedAt: z21.date(),
802
- deletedAt: z21.date().nullable(),
803
- phone: z21.string(),
804
- isPrimary: z21.boolean()
805
- });
806
- var ContactEmailsSchema = z21.object({
807
- id: z21.string().uuid(),
808
- createdAt: z21.date(),
809
- updatedAt: z21.date(),
810
- deletedAt: z21.date().nullable(),
811
- email: z21.string(),
812
- isPrimary: z21.boolean()
813
- });
814
- var ContactCustomFieldSchema = z21.object({
815
- id: z21.string().uuid(),
816
- createdAt: z21.date(),
817
- updatedAt: z21.date(),
818
- deletedAt: z21.date().nullable(),
819
- textValue: z21.string().nullable(),
820
- booleanValue: z21.boolean().nullable(),
821
- numberValue: z21.number().nullable(),
822
- dateValue: z21.date().nullable(),
769
+ var ContactPhonesSchema = z20.object({
770
+ id: z20.string().uuid(),
771
+ createdAt: z20.date(),
772
+ updatedAt: z20.date(),
773
+ deletedAt: z20.date().nullable(),
774
+ phone: z20.string(),
775
+ isPrimary: z20.boolean()
776
+ });
777
+ var ContactEmailsSchema = z20.object({
778
+ id: z20.string().uuid(),
779
+ createdAt: z20.date(),
780
+ updatedAt: z20.date(),
781
+ deletedAt: z20.date().nullable(),
782
+ email: z20.string(),
783
+ isPrimary: z20.boolean()
784
+ });
785
+ var ContactCustomFieldSchema = z20.object({
786
+ id: z20.string().uuid(),
787
+ createdAt: z20.date(),
788
+ updatedAt: z20.date(),
789
+ deletedAt: z20.date().nullable(),
790
+ textValue: z20.string().nullable(),
791
+ booleanValue: z20.boolean().nullable(),
792
+ numberValue: z20.number().nullable(),
793
+ dateValue: z20.date().nullable(),
823
794
  attribute: AttributeSchema.omit({ options: true, group: true }),
824
- uploads: z21.array(UploadSchema)
825
- });
826
- var ContactEntityTypesSchema = z21.object({
827
- id: z21.string().uuid(),
828
- createdAt: z21.date(),
829
- updatedAt: z21.date(),
830
- deletedAt: z21.date().nullable(),
831
- entity: z21.string(),
832
- description: z21.string().nullable()
833
- });
834
- var ContactActivitySchema = z21.object({
835
- id: z21.string().uuid(),
836
- createdAt: z21.date(),
837
- updatedAt: z21.date(),
838
- deletedAt: z21.date().nullable(),
839
- entityId: z21.string(),
840
- description: z21.string(),
795
+ uploads: z20.array(UploadSchema)
796
+ });
797
+ var ContactEntityTypesSchema = z20.object({
798
+ id: z20.string().uuid(),
799
+ createdAt: z20.date(),
800
+ updatedAt: z20.date(),
801
+ deletedAt: z20.date().nullable(),
802
+ entity: z20.string(),
803
+ description: z20.string().nullable()
804
+ });
805
+ var ContactActivitySchema = z20.object({
806
+ id: z20.string().uuid(),
807
+ createdAt: z20.date(),
808
+ updatedAt: z20.date(),
809
+ deletedAt: z20.date().nullable(),
810
+ entityId: z20.string(),
811
+ description: z20.string(),
841
812
  entityType: ContactEntityTypesSchema
842
813
  });
843
- var ContactSchema = z21.object({
844
- id: z21.string().uuid(),
845
- createdAt: z21.date(),
846
- updatedAt: z21.date(),
847
- deletedAt: z21.date().nullable(),
848
- name: z21.string(),
849
- address: z21.string().nullable(),
850
- channel: z21.string().nullable(),
851
- notes: z21.string().nullable(),
852
- contactProfile: z21.string().nullable(),
853
- socialProfileUrl: z21.string().nullable(),
854
- tags: z21.array(TagSchema),
814
+ var ContactSchema = z20.object({
815
+ id: z20.string().uuid(),
816
+ createdAt: z20.date(),
817
+ updatedAt: z20.date(),
818
+ deletedAt: z20.date().nullable(),
819
+ name: z20.string(),
820
+ address: z20.string().nullable(),
821
+ channel: z20.string().nullable(),
822
+ notes: z20.string().nullable(),
823
+ contactProfile: z20.string().nullable(),
824
+ socialProfileUrl: z20.string().nullable(),
825
+ tags: z20.array(TagSchema),
855
826
  company: CompanySchema.omit({ customFields: true }).nullable(),
856
827
  // room: z.array(RoomSchema).optional(),
857
- customFields: z21.array(ContactCustomFieldSchema),
858
- contactEmails: z21.array(ContactEmailsSchema),
859
- contactPhones: z21.array(ContactPhonesSchema),
860
- activityLogs: z21.array(ContactActivitySchema).optional()
828
+ customFields: z20.array(ContactCustomFieldSchema),
829
+ contactEmails: z20.array(ContactEmailsSchema),
830
+ contactPhones: z20.array(ContactPhonesSchema),
831
+ activityLogs: z20.array(ContactActivitySchema).optional()
832
+ });
833
+ var ContactRowSchema = z20.object({
834
+ name: z20.string(),
835
+ address: z20.string().nullable(),
836
+ channel: z20.string().nullable(),
837
+ email: z20.string().nullable(),
838
+ phone: z20.string().nullable(),
839
+ notes: z20.string().nullable(),
840
+ company: z20.string().nullable(),
841
+ "CPE no.": z20.string(),
842
+ "Internet Subscription": z20.string(),
843
+ others: z20.null(),
844
+ _dynamic_data: z20.any().optional()
845
+ });
846
+ var CustomSchema = z20.object({
847
+ attriuteId: z20.string().optional(),
848
+ systemName: z20.string().optional(),
849
+ displayName: z20.string().optional(),
850
+ isRequired: z20.string().optional(),
851
+ type: z20.string().optional()
852
+ });
853
+ var ImportBodySchema = z20.object({
854
+ import_id: z20.number(),
855
+ sheet_id: z20.number(),
856
+ sheet_name: z20.string(),
857
+ row_number: z20.number(),
858
+ total_rows: z20.number(),
859
+ custom_fields: z20.object({
860
+ user_id: z20.string().optional(),
861
+ custom: z20.any().optional()
862
+ }).partial(),
863
+ row_data: ContactRowSchema
861
864
  });
862
865
 
863
- // src/custom-field/schema.ts
866
+ // src/cx-log/schema.ts
867
+ import z25 from "zod";
868
+
869
+ // src/evaluate-form/schema.ts
870
+ import z21 from "zod";
871
+ var EvaluateFormSchema = DefaultEntitySchema.extend({
872
+ cxLogId: z21.string().uuid(),
873
+ sentimentScore: z21.string().nullable().optional(),
874
+ csatScore: z21.string().nullable().optional()
875
+ });
876
+
877
+ // src/telephony-cdr/schema.ts
878
+ import z23 from "zod";
879
+
880
+ // src/extension/schema.ts
864
881
  import z22 from "zod";
865
- var CustomFieldSchema = DefaultEntitySchema.extend({
866
- textValue: z22.string().nullable(),
867
- booleanValue: z22.boolean().nullable(),
868
- numberValue: z22.number().nullable(),
869
- dateValue: z22.date().nullable(),
870
- entityId: z22.string().uuid(),
871
- attributeId: z22.string().uuid()
882
+ var ExtensionSchema = z22.object({
883
+ id: z22.string().uuid(),
884
+ createdAt: z22.date(),
885
+ updatedAt: z22.date(),
886
+ deletedAt: z22.date().nullable(),
887
+ userId: z22.string().nullable(),
888
+ sipServerUrl: z22.string(),
889
+ sipUserName: z22.string(),
890
+ webphoneLoginUser: z22.string(),
891
+ extensionId: z22.string().nullable(),
892
+ extensionName: z22.string(),
893
+ telephonySignature: z22.string().nullable()
894
+ });
895
+
896
+ // src/telephony-cdr/schema.ts
897
+ var CallUserSchema = z23.object({
898
+ id: z23.string(),
899
+ user: UserSchema.omit({
900
+ extension: true,
901
+ roles: true
902
+ }).nullable(),
903
+ userId: z23.string(),
904
+ createdAt: z23.string().optional(),
905
+ deletedAt: z23.string().nullable(),
906
+ updatedAt: z23.string().optional(),
907
+ extensionId: z23.string().nullable(),
908
+ sipUserName: z23.string().nullable(),
909
+ sipServerUrl: z23.string().nullable(),
910
+ extensionName: z23.string().nullable(),
911
+ webphoneLoginUser: z23.string().nullable(),
912
+ telephonySignature: z23.string().nullable()
913
+ }).nullable().optional();
914
+ var TelephonyCdrSchema = DefaultEntitySchema.extend({
915
+ uniqueCallId: z23.string(),
916
+ timeStart: z23.string(),
917
+ callFrom: z23.string(),
918
+ callTo: z23.string(),
919
+ callDuration: z23.number().nullable(),
920
+ talkDuration: z23.number().nullable(),
921
+ srcTrunkName: z23.string().nullable(),
922
+ dstTrunkName: z23.string().nullable(),
923
+ contact: ContactSchema.optional(),
924
+ // TODO: refactor this zod schema using TelephonyQueue entity schema
925
+ telephonyQueue: DefaultEntitySchema.extend({
926
+ queueId: z23.number(),
927
+ queueName: z23.string(),
928
+ queueNumber: z23.string(),
929
+ maximumWaitingTime: z23.number()
930
+ }).optional().nullable(),
931
+ pinCode: z23.string().nullable(),
932
+ status: z23.string(),
933
+ type: z23.string(),
934
+ recording: z23.string().nullable(),
935
+ didNumber: z23.string().nullable(),
936
+ agentRingTime: z23.number().nullable(),
937
+ uploadId: z23.string().nullable(),
938
+ serialNumber: z23.string().nullable(),
939
+ upload: UploadSchema.optional().nullable(),
940
+ callParticipants: z23.object({
941
+ callTo: CallUserSchema,
942
+ callFrom: CallUserSchema
943
+ }).nullable(),
944
+ isQueueMissedCall: z23.boolean(),
945
+ extensionId: z23.string().uuid().nullable(),
946
+ extension: ExtensionSchema.extend({
947
+ user: UserSchema.optional().nullable()
948
+ }).optional().nullable(),
949
+ telephonyQueueId: z23.string().uuid().nullable(),
950
+ contactId: z23.string().nullable()
951
+ });
952
+ var TelephonyTrunkSchema = DefaultEntitySchema.extend({
953
+ trunkId: z23.string().nullable(),
954
+ trunkName: z23.string().nullable()
955
+ });
956
+ var TelephonyTrunkListSchema = z23.array(TelephonyTrunkSchema);
957
+ var TelephonyQueueSchema = DefaultEntitySchema.extend({
958
+ queueId: z23.number(),
959
+ queueName: z23.string(),
960
+ queueNumber: z23.string(),
961
+ maximumWaitingTime: z23.number()
962
+ });
963
+ var TelephonyQueueListSchmea = z23.array(TelephonyQueueSchema);
964
+ var TelephonyExtensionSchema = DefaultEntitySchema.extend({
965
+ user: UserSchema.omit({ extension: true }).optional().nullable(),
966
+ // extension not needed in this schema
967
+ sipServerUrl: z23.string().nullable(),
968
+ sipUserName: z23.string().nullable(),
969
+ sipPassword: z23.string().nullable(),
970
+ yeastarSignature: z23.string().nullable(),
971
+ userId: z23.string().uuid().nullable(),
972
+ extensionId: z23.string().nullable(),
973
+ extensionName: z23.string().nullable()
974
+ });
975
+ var TelephonyExtensionListSchema = z23.array(TelephonyExtensionSchema);
976
+ var TelephonyDropdownListSchema = z23.object({
977
+ trunks: z23.array(
978
+ z23.object({
979
+ id: z23.string().uuid(),
980
+ trunkName: z23.string()
981
+ })
982
+ ),
983
+ status: z23.array(z23.enum(["ANSWERED", "NO ANSWER", "FAILED"])),
984
+ type: z23.array(z23.enum(["Inbound", "Outbound", "Internal"]))
985
+ });
986
+
987
+ // src/wrap-up-form/schema.ts
988
+ import z24 from "zod";
989
+ var WrapUpFormSchema = DefaultEntitySchema.extend({
990
+ note: z24.string().nullable(),
991
+ disposition: z24.string().nullable(),
992
+ callFrom: z24.string().nullable(),
993
+ callTo: z24.string().nullable(),
994
+ tags: z24.array(TagSchema)
872
995
  });
873
996
 
874
997
  // src/cx-log/schema.ts
875
- import z28 from "zod";
998
+ var CxLogSchema = DefaultEntitySchema.extend({
999
+ caseId: z25.number(),
1000
+ entityId: z25.string().uuid(),
1001
+ entityName: z25.string(),
1002
+ contactId: z25.string().uuid().nullable(),
1003
+ channel: z25.string().nullable(),
1004
+ queueId: z25.string().uuid().nullable(),
1005
+ agentId: z25.string().uuid().nullable(),
1006
+ direction: z25.string().nullable(),
1007
+ startedDate: z25.date().nullable(),
1008
+ handledTime: z25.number().nullable(),
1009
+ firstResponseTime: z25.number().nullable(),
1010
+ wrapUpForm: WrapUpFormSchema.nullable()
1011
+ });
1012
+ var CxLogSchemaWithRelations = DefaultEntitySchema.extend({
1013
+ caseId: z25.number(),
1014
+ entityId: z25.string().uuid(),
1015
+ entityName: z25.string(),
1016
+ customerPhone: z25.string().nullable(),
1017
+ channelType: z25.string().nullable(),
1018
+ channel: z25.string().nullable(),
1019
+ direction: z25.string().nullable(),
1020
+ startedDate: z25.string().nullable(),
1021
+ handledTime: z25.string().nullable(),
1022
+ firstResponseTime: z25.string().nullable(),
1023
+ slaMeet: z25.string().nullable(),
1024
+ evaluateForm: EvaluateFormSchema.nullable(),
1025
+ wrapUpForm: WrapUpFormSchema.nullable(),
1026
+ room: z25.object({
1027
+ id: z25.string().uuid(),
1028
+ createdAt: z25.date(),
1029
+ updatedAt: z25.date(),
1030
+ deletedAt: z25.date().nullable(),
1031
+ lastMessage: z25.string(),
1032
+ handleTime: z25.number(),
1033
+ closeAt: z25.date(),
1034
+ unreadCount: z25.number(),
1035
+ firstResponseAt: z25.date(),
1036
+ firstResponseTime: z25.number(),
1037
+ isLatest: z25.boolean(),
1038
+ direction: MessageDirectionTypeSchema,
1039
+ platformContact: PlatformContactSchema,
1040
+ actor: UserSchema,
1041
+ assignee: UserSchema,
1042
+ channel: ChannelSchema
1043
+ }).nullable(),
1044
+ telephonyCdr: TelephonyCdrSchema.nullable(),
1045
+ queue: z25.object({
1046
+ queueName: z25.string().nullable().optional()
1047
+ }).nullable(),
1048
+ contact: ContactSchema.nullable(),
1049
+ agent: UserSchema.nullable(),
1050
+ contactLabel: z25.array(z25.string())
1051
+ });
876
1052
 
877
1053
  // src/chat/schema.ts
878
- import z23 from "zod";
879
- var MessageDirectionTypeSchema = z23.enum([
1054
+ var MessageDirectionTypeSchema = z26.enum([
880
1055
  "incoming",
881
1056
  "outgoing",
882
1057
  "system"
883
1058
  ]);
884
- var MessageTypeSchema = z23.enum([
1059
+ var MessageTypeSchema = z26.enum([
885
1060
  "text",
886
1061
  "image",
887
1062
  "video",
@@ -902,350 +1077,321 @@ var MessageTypeSchema = z23.enum([
902
1077
  "updated",
903
1078
  "started"
904
1079
  ]);
905
- var MessageLocaleTypeSchema = z23.enum(["mm", "en", "th", ""]);
906
- var PlatformContactMetadataSchema = z23.object({
907
- id: z23.string(),
908
- name: z23.string(),
909
- picture: z23.string().optional(),
910
- additionalCredentials: z23.any()
911
- });
912
- var PlatformContactSchema = DefaultEntitySchema.extend({
913
- channelId: z23.string().uuid(),
914
- socialPlatformId: z23.string(),
1080
+ var MessageLocaleTypeSchema = z26.enum(["mm", "en", "th", ""]);
1081
+ var PlatformContactMetadataSchema = z26.object({
1082
+ id: z26.string(),
1083
+ name: z26.string(),
1084
+ picture: z26.string().optional(),
1085
+ additionalCredentials: z26.any()
1086
+ });
1087
+ var PlatformContactSchema = z26.object({
1088
+ id: z26.string().uuid(),
1089
+ createdAt: z26.date(),
1090
+ updatedAt: z26.date(),
1091
+ deletedAt: z26.date().nullable(),
1092
+ channelId: z26.string().uuid(),
1093
+ socialPlatformId: z26.string(),
915
1094
  type: ChannelTypeSchema,
916
1095
  metadata: PlatformContactMetadataSchema,
917
1096
  contact: ContactSchema
918
1097
  });
919
1098
  var RoomSchema = DefaultEntitySchema.extend({
920
- lastMessage: z23.string(),
921
- handleTime: z23.number(),
922
- closeAt: z23.date(),
923
- unreadCount: z23.number(),
924
- firstResponseAt: z23.date(),
925
- firstResponseTime: z23.number(),
926
- isLatest: z23.boolean(),
1099
+ lastMessage: z26.string(),
1100
+ handleTime: z26.number(),
1101
+ closeAt: z26.date(),
1102
+ unreadCount: z26.number(),
1103
+ firstResponseAt: z26.date(),
1104
+ firstResponseTime: z26.number(),
1105
+ isLatest: z26.boolean(),
927
1106
  direction: MessageDirectionTypeSchema,
928
1107
  platformContact: PlatformContactSchema,
929
- actor: z23.object({
930
- id: z23.string().uuid(),
931
- createdAt: z23.date(),
932
- updatedAt: z23.date(),
933
- deletedAt: z23.date().nullable(),
934
- name: z23.string(),
935
- email: z23.string().email(),
936
- emailVerifiedAt: z23.date().nullable(),
937
- password: z23.string(),
938
- address: z23.string().nullable(),
939
- phone: z23.string().nullable(),
940
- notificationCount: z23.number().nullable(),
941
- roles: z23.array(RoleSchema),
942
- extension: z23.object({
943
- id: z23.string().uuid(),
944
- createdAt: z23.date(),
945
- updatedAt: z23.date(),
946
- deletedAt: z23.date().nullable(),
947
- userId: z23.string().nullable(),
948
- sipServerUrl: z23.string(),
949
- sipUserName: z23.string(),
950
- webphoneLoginUser: z23.string(),
951
- extensionId: z23.string().nullable(),
952
- extensionName: z23.string(),
953
- telephonySignature: z23.string().nullable()
1108
+ actor: z26.object({
1109
+ id: z26.string().uuid(),
1110
+ createdAt: z26.date(),
1111
+ updatedAt: z26.date(),
1112
+ deletedAt: z26.date().nullable(),
1113
+ name: z26.string(),
1114
+ email: z26.string().email(),
1115
+ emailVerifiedAt: z26.date().nullable(),
1116
+ password: z26.string(),
1117
+ address: z26.string().nullable(),
1118
+ phone: z26.string().nullable(),
1119
+ notificationCount: z26.number().nullable(),
1120
+ roles: z26.array(RoleSchema),
1121
+ extension: z26.object({
1122
+ id: z26.string().uuid(),
1123
+ createdAt: z26.date(),
1124
+ updatedAt: z26.date(),
1125
+ deletedAt: z26.date().nullable(),
1126
+ userId: z26.string().nullable(),
1127
+ sipServerUrl: z26.string(),
1128
+ sipUserName: z26.string(),
1129
+ webphoneLoginUser: z26.string(),
1130
+ extensionId: z26.string().nullable(),
1131
+ extensionName: z26.string(),
1132
+ telephonySignature: z26.string().nullable()
954
1133
  })
955
1134
  }),
956
- assignee: z23.object({
957
- id: z23.string().uuid(),
958
- createdAt: z23.date(),
959
- updatedAt: z23.date(),
960
- deletedAt: z23.date().nullable(),
961
- name: z23.string(),
962
- email: z23.string().email(),
963
- emailVerifiedAt: z23.date().nullable(),
964
- password: z23.string(),
965
- address: z23.string().nullable(),
966
- phone: z23.string().nullable(),
967
- notificationCount: z23.number().nullable(),
968
- roles: z23.array(RoleSchema),
969
- extension: z23.object({
970
- id: z23.string().uuid(),
971
- createdAt: z23.date(),
972
- updatedAt: z23.date(),
973
- deletedAt: z23.date().nullable(),
974
- userId: z23.string().nullable(),
975
- sipServerUrl: z23.string(),
976
- sipUserName: z23.string(),
977
- webphoneLoginUser: z23.string(),
978
- extensionId: z23.string().nullable(),
979
- extensionName: z23.string(),
980
- telephonySignature: z23.string().nullable()
1135
+ assignee: z26.object({
1136
+ id: z26.string().uuid(),
1137
+ createdAt: z26.date(),
1138
+ updatedAt: z26.date(),
1139
+ deletedAt: z26.date().nullable(),
1140
+ name: z26.string(),
1141
+ email: z26.string().email(),
1142
+ emailVerifiedAt: z26.date().nullable(),
1143
+ password: z26.string(),
1144
+ address: z26.string().nullable(),
1145
+ phone: z26.string().nullable(),
1146
+ notificationCount: z26.number().nullable(),
1147
+ roles: z26.array(RoleSchema),
1148
+ extension: z26.object({
1149
+ id: z26.string().uuid(),
1150
+ createdAt: z26.date(),
1151
+ updatedAt: z26.date(),
1152
+ deletedAt: z26.date().nullable(),
1153
+ userId: z26.string().nullable(),
1154
+ sipServerUrl: z26.string(),
1155
+ sipUserName: z26.string(),
1156
+ webphoneLoginUser: z26.string(),
1157
+ extensionId: z26.string().nullable(),
1158
+ extensionName: z26.string(),
1159
+ telephonySignature: z26.string().nullable()
981
1160
  })
982
1161
  }),
983
1162
  channel: ChannelSchema,
984
1163
  cxlog: CxLogSchema
985
1164
  });
986
1165
  var MessageSchema = DefaultEntitySchema.extend({
987
- message: z23.string(),
1166
+ message: z26.string(),
988
1167
  direction: MessageDirectionTypeSchema,
989
1168
  type: MessageTypeSchema,
990
- readAt: z23.date(),
991
- metadata: z23.any(),
992
- platformId: z23.string(),
993
- platformMessageId: z23.string(),
994
- replyPlatformMessageId: z23.string(),
995
- template: z23.any(),
1169
+ readAt: z26.date(),
1170
+ metadata: z26.any(),
1171
+ platformId: z26.string(),
1172
+ platformMessageId: z26.string(),
1173
+ replyPlatformMessageId: z26.string(),
1174
+ template: z26.any(),
996
1175
  locale: MessageLocaleTypeSchema,
997
- url: z23.string(),
998
- previewUrl: z23.string(),
999
- imageSetId: z23.string(),
1176
+ url: z26.string(),
1177
+ previewUrl: z26.string(),
1178
+ imageSetId: z26.string(),
1000
1179
  room: RoomSchema,
1001
1180
  upload: UploadSchema,
1002
- actor: z23.object({
1003
- id: z23.string().uuid(),
1004
- createdAt: z23.date(),
1005
- updatedAt: z23.date(),
1006
- deletedAt: z23.date().nullable(),
1007
- name: z23.string(),
1008
- email: z23.string().email(),
1009
- emailVerifiedAt: z23.date().nullable(),
1010
- password: z23.string(),
1011
- address: z23.string().nullable(),
1012
- phone: z23.string().nullable(),
1013
- notificationCount: z23.number().nullable(),
1014
- roles: z23.array(RoleSchema),
1015
- extension: z23.object({
1016
- id: z23.string().uuid(),
1017
- createdAt: z23.date(),
1018
- updatedAt: z23.date(),
1019
- deletedAt: z23.date().nullable(),
1020
- userId: z23.string().nullable(),
1021
- sipServerUrl: z23.string(),
1022
- sipUserName: z23.string(),
1023
- webphoneLoginUser: z23.string(),
1024
- extensionId: z23.string().nullable(),
1025
- extensionName: z23.string(),
1026
- telephonySignature: z23.string().nullable()
1181
+ repliedMessage: z26.lazy(() => RepliedMessageSchema),
1182
+ actor: z26.object({
1183
+ id: z26.string().uuid(),
1184
+ createdAt: z26.date(),
1185
+ updatedAt: z26.date(),
1186
+ deletedAt: z26.date().nullable(),
1187
+ name: z26.string(),
1188
+ email: z26.string().email(),
1189
+ emailVerifiedAt: z26.date().nullable(),
1190
+ password: z26.string(),
1191
+ address: z26.string().nullable(),
1192
+ phone: z26.string().nullable(),
1193
+ notificationCount: z26.number().nullable(),
1194
+ roles: z26.array(RoleSchema),
1195
+ extension: z26.object({
1196
+ id: z26.string().uuid(),
1197
+ createdAt: z26.date(),
1198
+ updatedAt: z26.date(),
1199
+ deletedAt: z26.date().nullable(),
1200
+ userId: z26.string().nullable(),
1201
+ sipServerUrl: z26.string(),
1202
+ sipUserName: z26.string(),
1203
+ webphoneLoginUser: z26.string(),
1204
+ extensionId: z26.string().nullable(),
1205
+ extensionName: z26.string(),
1206
+ telephonySignature: z26.string().nullable()
1027
1207
  })
1028
1208
  }),
1029
- assignee: z23.object({
1030
- id: z23.string().uuid(),
1031
- createdAt: z23.date(),
1032
- updatedAt: z23.date(),
1033
- deletedAt: z23.date().nullable(),
1034
- name: z23.string(),
1035
- email: z23.string().email(),
1036
- emailVerifiedAt: z23.date().nullable(),
1037
- password: z23.string(),
1038
- address: z23.string().nullable(),
1039
- phone: z23.string().nullable(),
1040
- notificationCount: z23.number().nullable(),
1041
- roles: z23.array(RoleSchema),
1042
- extension: z23.object({
1043
- id: z23.string().uuid(),
1044
- createdAt: z23.date(),
1045
- updatedAt: z23.date(),
1046
- deletedAt: z23.date().nullable(),
1047
- userId: z23.string().nullable(),
1048
- sipServerUrl: z23.string(),
1049
- sipUserName: z23.string(),
1050
- webphoneLoginUser: z23.string(),
1051
- extensionId: z23.string().nullable(),
1052
- extensionName: z23.string(),
1053
- telephonySignature: z23.string().nullable()
1209
+ assignee: z26.object({
1210
+ id: z26.string().uuid(),
1211
+ createdAt: z26.date(),
1212
+ updatedAt: z26.date(),
1213
+ deletedAt: z26.date().nullable(),
1214
+ name: z26.string(),
1215
+ email: z26.string().email(),
1216
+ emailVerifiedAt: z26.date().nullable(),
1217
+ password: z26.string(),
1218
+ address: z26.string().nullable(),
1219
+ phone: z26.string().nullable(),
1220
+ notificationCount: z26.number().nullable(),
1221
+ roles: z26.array(RoleSchema),
1222
+ extension: z26.object({
1223
+ id: z26.string().uuid(),
1224
+ createdAt: z26.date(),
1225
+ updatedAt: z26.date(),
1226
+ deletedAt: z26.date().nullable(),
1227
+ userId: z26.string().nullable(),
1228
+ sipServerUrl: z26.string(),
1229
+ sipUserName: z26.string(),
1230
+ webphoneLoginUser: z26.string(),
1231
+ extensionId: z26.string().nullable(),
1232
+ extensionName: z26.string(),
1233
+ telephonySignature: z26.string().nullable()
1054
1234
  })
1055
1235
  }),
1056
- sender: z23.object({
1057
- id: z23.string().uuid(),
1058
- createdAt: z23.date(),
1059
- updatedAt: z23.date(),
1060
- deletedAt: z23.date().nullable(),
1061
- name: z23.string(),
1062
- email: z23.string().email(),
1063
- emailVerifiedAt: z23.date().nullable(),
1064
- password: z23.string(),
1065
- address: z23.string().nullable(),
1066
- phone: z23.string().nullable(),
1067
- notificationCount: z23.number().nullable(),
1068
- roles: z23.array(RoleSchema),
1069
- extension: z23.object({
1070
- id: z23.string().uuid(),
1071
- createdAt: z23.date(),
1072
- updatedAt: z23.date(),
1073
- deletedAt: z23.date().nullable(),
1074
- userId: z23.string().nullable(),
1075
- sipServerUrl: z23.string(),
1076
- sipUserName: z23.string(),
1077
- webphoneLoginUser: z23.string(),
1078
- extensionId: z23.string().nullable(),
1079
- extensionName: z23.string(),
1080
- telephonySignature: z23.string().nullable()
1236
+ sender: z26.object({
1237
+ id: z26.string().uuid(),
1238
+ createdAt: z26.date(),
1239
+ updatedAt: z26.date(),
1240
+ deletedAt: z26.date().nullable(),
1241
+ name: z26.string(),
1242
+ email: z26.string().email(),
1243
+ emailVerifiedAt: z26.date().nullable(),
1244
+ password: z26.string(),
1245
+ address: z26.string().nullable(),
1246
+ phone: z26.string().nullable(),
1247
+ notificationCount: z26.number().nullable(),
1248
+ roles: z26.array(RoleSchema),
1249
+ extension: z26.object({
1250
+ id: z26.string().uuid(),
1251
+ createdAt: z26.date(),
1252
+ updatedAt: z26.date(),
1253
+ deletedAt: z26.date().nullable(),
1254
+ userId: z26.string().nullable(),
1255
+ sipServerUrl: z26.string(),
1256
+ sipUserName: z26.string(),
1257
+ webphoneLoginUser: z26.string(),
1258
+ extensionId: z26.string().nullable(),
1259
+ extensionName: z26.string(),
1260
+ telephonySignature: z26.string().nullable()
1081
1261
  })
1082
1262
  })
1083
1263
  });
1084
- var UnreadCountsByAssigneeSchema = z23.object({
1085
- assigneeId: z23.string(),
1086
- totalUnreadCount: z23.number()
1087
- });
1088
-
1089
- // src/evaluate-form/schema.ts
1090
- import z24 from "zod";
1091
- var EvaluateFormSchema = DefaultEntitySchema.extend({
1092
- cxLogId: z24.string().uuid(),
1093
- sentimentScore: z24.string().nullable().optional(),
1094
- csatScore: z24.string().nullable().optional()
1095
- });
1096
-
1097
- // src/telephony-cdr/schema.ts
1098
- import z26 from "zod";
1099
-
1100
- // src/extension/schema.ts
1101
- import z25 from "zod";
1102
- var ExtensionSchema = z25.object({
1103
- id: z25.string().uuid(),
1104
- createdAt: z25.date(),
1105
- updatedAt: z25.date(),
1106
- deletedAt: z25.date().nullable(),
1107
- userId: z25.string().nullable(),
1108
- sipServerUrl: z25.string(),
1109
- sipUserName: z25.string(),
1110
- webphoneLoginUser: z25.string(),
1111
- extensionId: z25.string().nullable(),
1112
- extensionName: z25.string(),
1113
- telephonySignature: z25.string().nullable()
1264
+ var RepliedMessageSchema = DefaultEntitySchema.extend({
1265
+ message: z26.string(),
1266
+ direction: MessageDirectionTypeSchema,
1267
+ type: MessageTypeSchema,
1268
+ readAt: z26.date(),
1269
+ metadata: z26.any(),
1270
+ platformId: z26.string(),
1271
+ platformMessageId: z26.string(),
1272
+ replyPlatformMessageId: z26.string(),
1273
+ template: z26.any(),
1274
+ locale: MessageLocaleTypeSchema,
1275
+ url: z26.string(),
1276
+ previewUrl: z26.string(),
1277
+ imageSetId: z26.string(),
1278
+ // room: RoomSchema,
1279
+ upload: UploadSchema,
1280
+ // id: z.string().uuid(),
1281
+ // createdAt: z.date(),
1282
+ // updatedAt: z.date(),
1283
+ // deletedAt: z.date().nullable(),
1284
+ // name: z.string(),
1285
+ // email: z.string().email(),
1286
+ // emailVerifiedAt: z.date().nullable(),
1287
+ // password: z.string(),
1288
+ // address: z.string().nullable(),
1289
+ // phone: z.string().nullable(),
1290
+ // notificationCount: z.number().nullable(),
1291
+ // roles: z.array(RoleSchema),
1292
+ // extension: z.object({
1293
+ // id: z.string().uuid(),
1294
+ // createdAt: z.date(),
1295
+ // updatedAt: z.date(),
1296
+ // deletedAt: z.date().nullable(),
1297
+ // userId: z.string().nullable(),
1298
+ // sipServerUrl: z.string(),
1299
+ // sipUserName: z.string(),
1300
+ // webphoneLoginUser: z.string(),
1301
+ // extensionId: z.string().nullable(),
1302
+ // extensionName: z.string(),
1303
+ // telephonySignature: z.string().nullable(),
1304
+ // }),
1305
+ // }),
1306
+ actor: UserSchema,
1307
+ // id: z.string().uuid(),
1308
+ // createdAt: z.date(),
1309
+ // updatedAt: z.date(),
1310
+ // deletedAt: z.date().nullable(),
1311
+ // name: z.string(),
1312
+ // email: z.string().email(),
1313
+ // emailVerifiedAt: z.date().nullable(),
1314
+ // password: z.string(),
1315
+ // address: z.string().nullable(),
1316
+ // phone: z.string().nullable(),
1317
+ // notificationCount: z.number().nullable(),
1318
+ // roles: z.array(RoleSchema),
1319
+ // extension: z.object({
1320
+ // id: z.string().uuid(),
1321
+ // createdAt: z.date(),
1322
+ // updatedAt: z.date(),
1323
+ // deletedAt: z.date().nullable(),
1324
+ // userId: z.string().nullable(),
1325
+ // sipServerUrl: z.string(),
1326
+ // sipUserName: z.string(),
1327
+ // webphoneLoginUser: z.string(),
1328
+ // extensionId: z.string().nullable(),
1329
+ // extensionName: z.string(),
1330
+ // telephonySignature: z.string().nullable(),
1331
+ // }),
1332
+ // }),
1333
+ assignee: UserSchema,
1334
+ sender: UserSchema
1335
+ });
1336
+ var UnreadCountsByAssigneeSchema = z26.object({
1337
+ assigneeId: z26.string(),
1338
+ totalUnreadCount: z26.number()
1114
1339
  });
1115
1340
 
1116
- // src/telephony-cdr/schema.ts
1117
- var TelephonyCdrSchema = DefaultEntitySchema.extend({
1118
- uniqueCallId: z26.string(),
1119
- timeStart: z26.string(),
1120
- callFrom: z26.string(),
1121
- callTo: z26.string(),
1122
- callDuration: z26.number().nullable(),
1123
- talkDuration: z26.number().nullable(),
1124
- srcTrunkName: z26.string().nullable(),
1125
- dstTrunkName: z26.string().nullable(),
1126
- contact: ContactSchema.optional(),
1127
- // TODO: refactor this zod schema using TelephonyQueue entity schema
1128
- telephonyQueue: DefaultEntitySchema.extend({
1129
- queueId: z26.number(),
1130
- queueName: z26.string(),
1131
- queueNumber: z26.string(),
1132
- maximumWaitingTime: z26.number()
1133
- }).optional().nullable(),
1134
- pinCode: z26.string().nullable(),
1135
- status: z26.string(),
1136
- type: z26.string(),
1137
- recording: z26.string().nullable(),
1138
- didNumber: z26.string().nullable(),
1139
- agentRingTime: z26.number().nullable(),
1140
- uploadId: z26.string().nullable(),
1141
- upload: UploadSchema.optional().nullable(),
1142
- serialNumber: z26.string().nullable(),
1143
- extensionId: z26.string().uuid().nullable(),
1144
- extension: ExtensionSchema.extend({
1145
- user: UserSchema.optional().nullable()
1146
- }).optional().nullable(),
1147
- telephonyQueueId: z26.string().uuid().nullable(),
1148
- contactId: z26.string().nullable()
1149
- });
1150
- var TelephonyTrunkSchema = DefaultEntitySchema.extend({
1151
- trunkId: z26.string().nullable(),
1152
- trunkName: z26.string().nullable()
1153
- });
1154
- var TelephonyTrunkListSchema = z26.array(TelephonyTrunkSchema);
1155
- var TelephonyQueueSchema = DefaultEntitySchema.extend({
1156
- queueId: z26.number(),
1157
- queueName: z26.string(),
1158
- queueNumber: z26.string(),
1159
- maximumWaitingTime: z26.number()
1160
- });
1161
- var TelephonyQueueListSchmea = z26.array(TelephonyQueueSchema);
1162
- var TelephonyExtensionSchema = DefaultEntitySchema.extend({
1163
- user: UserSchema.omit({ extension: true }).optional().nullable(),
1164
- // extension not needed in this schema
1165
- sipServerUrl: z26.string().nullable(),
1166
- sipUserName: z26.string().nullable(),
1167
- sipPassword: z26.string().nullable(),
1168
- yeastarSignature: z26.string().nullable(),
1169
- userId: z26.string().uuid().nullable(),
1170
- extensionId: z26.string().nullable(),
1171
- extensionName: z26.string().nullable()
1172
- });
1173
- var TelephonyExtensionListSchema = z26.array(TelephonyExtensionSchema);
1174
- var TelephonyDropdownListSchema = z26.object({
1175
- trunks: z26.array(
1176
- z26.object({
1177
- id: z26.string().uuid(),
1178
- trunkName: z26.string()
1341
+ // src/messenger/validation.ts
1342
+ var GetFacebookPagesSchema = z27.object({
1343
+ data: z27.array(
1344
+ z27.object({
1345
+ // biome-ignore lint/style/useNamingConvention: <explanation>
1346
+ access_token: z27.string(),
1347
+ category: z27.string(),
1348
+ // biome-ignore lint/style/useNamingConvention: <explanation>
1349
+ category_list: z27.array(
1350
+ z27.object({
1351
+ id: z27.string(),
1352
+ name: z27.string()
1353
+ })
1354
+ ),
1355
+ id: z27.string(),
1356
+ name: z27.string(),
1357
+ tasks: z27.string().array()
1179
1358
  })
1180
1359
  ),
1181
- status: z26.array(z26.enum(["ANSWERED", "NO ANSWER", "FAILED"])),
1182
- type: z26.array(z26.enum(["Inbound", "Outbound", "Internal"]))
1360
+ paging: z27.object({
1361
+ cursors: z27.object({
1362
+ before: z27.string().optional(),
1363
+ after: z27.string().optional()
1364
+ })
1365
+ }).optional()
1183
1366
  });
1367
+ var GetFacebookPagesQuerySchema = z27.object({
1368
+ accessToken: z27.string(),
1369
+ userId: z27.string()
1370
+ });
1371
+ var ReconnectMessengerSchema = ChannelSchema.merge(
1372
+ z27.object({
1373
+ isReloginRequired: z27.boolean(),
1374
+ platformContacts: z27.array(PlatformContactSchema),
1375
+ id: z27.string().uuid(),
1376
+ name: z27.string(),
1377
+ createdAt: z27.date(),
1378
+ updatedAt: z27.date(),
1379
+ deletedAt: z27.date().nullable()
1380
+ })
1381
+ );
1184
1382
 
1185
- // src/wrap-up-form/schema.ts
1186
- import z27 from "zod";
1187
- var WrapUpFormSchema = DefaultEntitySchema.extend({
1188
- note: z27.string().nullable(),
1189
- disposition: z27.string().nullable(),
1190
- callFrom: z27.string().nullable(),
1191
- callTo: z27.string().nullable(),
1192
- tags: z27.array(TagSchema)
1193
- });
1383
+ // src/chat/validation.ts
1384
+ import z29 from "zod";
1194
1385
 
1195
- // src/cx-log/schema.ts
1196
- var CxLogSchema = DefaultEntitySchema.extend({
1197
- caseId: z28.number(),
1198
- entityId: z28.string().uuid(),
1199
- entityName: z28.string(),
1200
- contactId: z28.string().uuid().nullable(),
1201
- channel: z28.string().nullable(),
1202
- queueId: z28.string().uuid().nullable(),
1203
- agentId: z28.string().uuid().nullable(),
1204
- direction: z28.string().nullable(),
1205
- startedDate: z28.date().nullable(),
1206
- handledTime: z28.number().nullable(),
1207
- firstResponseTime: z28.number().nullable(),
1208
- wrapUpForm: WrapUpFormSchema.nullable()
1209
- });
1210
- var CxLogSchemaWithRelations = DefaultEntitySchema.extend({
1211
- caseId: z28.number(),
1386
+ // src/custom-field/schema.ts
1387
+ import z28 from "zod";
1388
+ var CustomFieldSchema = DefaultEntitySchema.extend({
1389
+ textValue: z28.string().nullable(),
1390
+ booleanValue: z28.boolean().nullable(),
1391
+ numberValue: z28.number().nullable(),
1392
+ dateValue: z28.date().nullable(),
1212
1393
  entityId: z28.string().uuid(),
1213
- entityName: z28.string(),
1214
- customerPhone: z28.string().nullable(),
1215
- channelType: z28.string().nullable(),
1216
- channel: z28.string().nullable(),
1217
- direction: z28.string().nullable(),
1218
- startedDate: z28.string().nullable(),
1219
- handledTime: z28.string().nullable(),
1220
- firstResponseTime: z28.string().nullable(),
1221
- slaMeet: z28.string().nullable(),
1222
- evaluateForm: EvaluateFormSchema.nullable(),
1223
- wrapUpForm: WrapUpFormSchema.nullable(),
1224
- room: z28.object({
1225
- id: z28.string().uuid(),
1226
- createdAt: z28.date(),
1227
- updatedAt: z28.date(),
1228
- deletedAt: z28.date().nullable(),
1229
- lastMessage: z28.string(),
1230
- handleTime: z28.number(),
1231
- closeAt: z28.date(),
1232
- unreadCount: z28.number(),
1233
- firstResponseAt: z28.date(),
1234
- firstResponseTime: z28.number(),
1235
- isLatest: z28.boolean(),
1236
- direction: MessageDirectionTypeSchema,
1237
- platformContact: PlatformContactSchema,
1238
- actor: UserSchema,
1239
- assignee: UserSchema,
1240
- channel: ChannelSchema
1241
- }).nullable(),
1242
- telephonyCdr: TelephonyCdrSchema.nullable(),
1243
- queue: z28.object({
1244
- queueName: z28.string().nullable().optional()
1245
- }).nullable(),
1246
- contact: ContactSchema.nullable(),
1247
- agent: UserSchema.nullable(),
1248
- contactLabel: z28.array(z28.string())
1394
+ attributeId: z28.string().uuid()
1249
1395
  });
1250
1396
 
1251
1397
  // src/chat/validation.ts
@@ -3584,6 +3730,7 @@ var extensionContract = initContract14().router(
3584
3730
 
3585
3731
  // src/instagram/index.ts
3586
3732
  import { initContract as initContract15 } from "@ts-rest/core";
3733
+ import z51 from "zod";
3587
3734
  var instagramContract = initContract15().router({
3588
3735
  sendMessage: {
3589
3736
  method: "POST",
@@ -3624,6 +3771,19 @@ var instagramContract = initContract15().router({
3624
3771
  400: DefaultErrorResponseSchema
3625
3772
  }
3626
3773
  },
3774
+ delete: {
3775
+ method: "DELETE",
3776
+ path: "/delete/:channelId",
3777
+ pathParams: z51.object({
3778
+ channelId: z51.string().uuid()
3779
+ }),
3780
+ body: null,
3781
+ responses: {
3782
+ 200: ChannelServiceResponseSchema,
3783
+ 500: DefaultErrorResponseSchema,
3784
+ 400: DefaultErrorResponseSchema
3785
+ }
3786
+ },
3627
3787
  getInstagramPages: {
3628
3788
  method: "GET",
3629
3789
  path: "/pages",
@@ -3637,27 +3797,27 @@ var instagramContract = initContract15().router({
3637
3797
 
3638
3798
  // src/line/index.ts
3639
3799
  import { initContract as initContract16 } from "@ts-rest/core";
3640
- import z53 from "zod";
3800
+ import z54 from "zod";
3641
3801
 
3642
3802
  // src/line/schema.ts
3643
- import z51 from "zod";
3803
+ import z52 from "zod";
3644
3804
  var ConnectLineService = ConnectLineChannelSchema.extend({
3645
- actor: z51.object({
3646
- id: z51.string().uuid(),
3647
- name: z51.string(),
3648
- email: z51.string().email(),
3649
- address: z51.string().nullable(),
3650
- phone: z51.string().nullable()
3805
+ actor: z52.object({
3806
+ id: z52.string().uuid(),
3807
+ name: z52.string(),
3808
+ email: z52.string().email(),
3809
+ address: z52.string().nullable(),
3810
+ phone: z52.string().nullable()
3651
3811
  }).optional()
3652
3812
  });
3653
3813
 
3654
3814
  // src/line/validation.ts
3655
- import z52 from "zod";
3656
- var SendLineStickerSchema = z52.object({
3657
- userId: z52.string().uuid(),
3658
- packageId: z52.string(),
3659
- stickerId: z52.string(),
3660
- accessToken: z52.string()
3815
+ import z53 from "zod";
3816
+ var SendLineStickerSchema = z53.object({
3817
+ userId: z53.string().uuid(),
3818
+ packageId: z53.string(),
3819
+ stickerId: z53.string(),
3820
+ accessToken: z53.string()
3661
3821
  });
3662
3822
 
3663
3823
  // src/line/index.ts
@@ -3667,7 +3827,7 @@ var lineContract = initContract16().router({
3667
3827
  path: "sticker",
3668
3828
  responses: {
3669
3829
  200: DefaultSuccessResponseSchema.extend({
3670
- data: z53.any()
3830
+ data: z54.any()
3671
3831
  }),
3672
3832
  500: DefaultErrorResponseSchema
3673
3833
  },
@@ -3679,7 +3839,7 @@ var lineContract = initContract16().router({
3679
3839
  path: "/connect",
3680
3840
  responses: {
3681
3841
  200: DefaultSuccessResponseSchema.extend({
3682
- data: z53.any()
3842
+ data: z54.any()
3683
3843
  }),
3684
3844
  500: DefaultErrorResponseSchema
3685
3845
  },
@@ -3699,7 +3859,7 @@ var lineContract = initContract16().router({
3699
3859
 
3700
3860
  // src/mail/email-engine-webhooks-events.contract.ts
3701
3861
  import { initContract as initContract17 } from "@ts-rest/core";
3702
- import z54 from "zod";
3862
+ import z55 from "zod";
3703
3863
  var emailEngineWebhooksEventsContract = initContract17().router({
3704
3864
  handleWebhooksEvents: {
3705
3865
  method: "POST",
@@ -3707,7 +3867,7 @@ var emailEngineWebhooksEventsContract = initContract17().router({
3707
3867
  // we don't need to respone anything but added responses just for solving type error
3708
3868
  responses: {
3709
3869
  200: DefaultSuccessResponseSchema.extend({
3710
- message: z54.string()
3870
+ message: z55.string()
3711
3871
  })
3712
3872
  },
3713
3873
  body: null,
@@ -3720,173 +3880,173 @@ import { initContract as initContract22 } from "@ts-rest/core";
3720
3880
 
3721
3881
  // src/mail/room-contract.ts
3722
3882
  import { initContract as initContract18 } from "@ts-rest/core";
3723
- import z58 from "zod";
3883
+ import z59 from "zod";
3724
3884
 
3725
3885
  // src/mail/schemas/room.schema.ts
3726
- import z57 from "zod";
3886
+ import z58 from "zod";
3727
3887
 
3728
3888
  // src/mail/schemas/account.schema.ts
3729
- import z55 from "zod";
3730
- var MailServerSchema = z55.object({
3731
- id: z55.string(),
3732
- createdAt: z55.date(),
3733
- updatedAt: z55.date(),
3734
- deletedAt: z55.date().nullable(),
3735
- name: z55.string(),
3736
- smtpHost: z55.string(),
3737
- smtpPort: z55.string(),
3738
- smtpTlsPort: z55.string(),
3739
- useTlsForSmtp: z55.boolean(),
3740
- imapHost: z55.string(),
3741
- imapPort: z55.string(),
3742
- imapTlsPort: z55.string(),
3743
- useTlsForImap: z55.boolean()
3744
- });
3745
- var MailAccountSchema = z55.object({
3746
- id: z55.string(),
3747
- createdAt: z55.date(),
3748
- updatedAt: z55.date(),
3749
- deletedAt: z55.date().nullable(),
3750
- name: z55.string(),
3751
- address: z55.string(),
3752
- accountId: z55.string(),
3753
- mailServerId: z55.string(),
3754
- mailServer: MailServerSchema,
3755
- state: z55.union([
3756
- z55.literal("init"),
3757
- z55.literal("syncing"),
3758
- z55.literal("connecting"),
3759
- z55.literal("connected"),
3760
- z55.literal("disconnected"),
3761
- z55.literal("authenticationError"),
3762
- z55.literal("connectError"),
3763
- z55.literal("unset")
3764
- ])
3765
- });
3766
-
3767
- // src/mail/schemas/message.schema.ts
3768
3889
  import z56 from "zod";
3769
- var AttachmentSchema = z56.object({
3890
+ var MailServerSchema = z56.object({
3770
3891
  id: z56.string(),
3771
3892
  createdAt: z56.date(),
3772
3893
  updatedAt: z56.date(),
3773
- deletedAt: z56.nullable(z56.date()),
3774
- roomId: z56.string(),
3775
- messageId: z56.string(),
3776
- fileName: z56.string(),
3777
- fileType: z56.string(),
3778
- emailEngineAttachmentId: z56.string(),
3779
- uploadId: z56.string(),
3780
- upload: z56.object({
3781
- id: z56.string(),
3782
- createdAt: z56.date(),
3783
- updatedAt: z56.date(),
3784
- deletedAt: z56.nullable(z56.date()),
3785
- bucket_name: z56.string(),
3786
- file_name: z56.string(),
3787
- file_key: z56.string(),
3788
- file_size: z56.number(),
3789
- file_url: z56.string(),
3790
- extension_name: z56.string()
3791
- })
3792
- });
3793
- var MessageSchema2 = z56.object({
3894
+ deletedAt: z56.date().nullable(),
3895
+ name: z56.string(),
3896
+ smtpHost: z56.string(),
3897
+ smtpPort: z56.string(),
3898
+ smtpTlsPort: z56.string(),
3899
+ useTlsForSmtp: z56.boolean(),
3900
+ imapHost: z56.string(),
3901
+ imapPort: z56.string(),
3902
+ imapTlsPort: z56.string(),
3903
+ useTlsForImap: z56.boolean()
3904
+ });
3905
+ var MailAccountSchema = z56.object({
3794
3906
  id: z56.string(),
3795
3907
  createdAt: z56.date(),
3796
3908
  updatedAt: z56.date(),
3797
- deletedAt: z56.nullable(z56.date()),
3798
- roomId: z56.string(),
3799
- subject: z56.string(),
3800
- textPlain: z56.string(),
3801
- textHtml: z56.string(),
3802
- textId: z56.string(),
3803
- emailEngineEmailId: z56.string(),
3804
- emailEngineMessageId: z56.string(),
3805
- emailEngineReplyTo: z56.nullable(z56.string()),
3806
- direction: z56.string(),
3807
- date: z56.date(),
3808
- action: z56.string(),
3809
- unseen: z56.boolean(),
3810
- seemsLikeNew: z56.boolean(),
3811
- from: z56.array(MailUserSchema),
3812
- to: z56.array(MailUserSchema),
3813
- cc: z56.array(MailUserSchema),
3814
- bcc: z56.array(MailUserSchema),
3815
- attachments: z56.array(AttachmentSchema)
3909
+ deletedAt: z56.date().nullable(),
3910
+ name: z56.string(),
3911
+ address: z56.string(),
3912
+ accountId: z56.string(),
3913
+ mailServerId: z56.string(),
3914
+ mailServer: MailServerSchema,
3915
+ state: z56.union([
3916
+ z56.literal("init"),
3917
+ z56.literal("syncing"),
3918
+ z56.literal("connecting"),
3919
+ z56.literal("connected"),
3920
+ z56.literal("disconnected"),
3921
+ z56.literal("authenticationError"),
3922
+ z56.literal("connectError"),
3923
+ z56.literal("unset")
3924
+ ])
3816
3925
  });
3817
3926
 
3818
- // src/mail/schemas/room.schema.ts
3819
- var MailUserSchema = z57.object({
3820
- id: z57.string(),
3821
- createdAt: z57.date(),
3822
- updatedAt: z57.date(),
3823
- deletedAt: z57.date().nullable(),
3824
- name: z57.string(),
3825
- address: z57.string()
3826
- });
3827
- var TagSchema2 = z57.object({
3828
- color: z57.string(),
3829
- id: z57.string(),
3830
- createdAt: z57.date(),
3831
- updatedAt: z57.date(),
3832
- deletedAt: z57.date().nullable(),
3833
- name: z57.string()
3834
- });
3835
- var UserModel = z57.object({
3836
- id: z57.string().uuid(),
3837
- createdAt: z57.date(),
3838
- updatedAt: z57.date(),
3839
- deletedAt: z57.date().nullable(),
3840
- name: z57.string(),
3841
- email: z57.string(),
3842
- address: z57.string().nullable(),
3843
- phone: z57.string().nullable(),
3844
- notification_count: z57.number().nullable()
3845
- });
3846
- var ActivityLogModel = z57.object({
3927
+ // src/mail/schemas/message.schema.ts
3928
+ import z57 from "zod";
3929
+ var AttachmentSchema = z57.object({
3847
3930
  id: z57.string(),
3848
3931
  createdAt: z57.date(),
3849
3932
  updatedAt: z57.date(),
3850
- deletedAt: z57.nullable(z57.string()),
3851
- description: z57.string(),
3852
- actorId: z57.string(),
3933
+ deletedAt: z57.nullable(z57.date()),
3853
3934
  roomId: z57.string(),
3854
- actor: UserModel
3935
+ messageId: z57.string(),
3936
+ fileName: z57.string(),
3937
+ fileType: z57.string(),
3938
+ emailEngineAttachmentId: z57.string(),
3939
+ uploadId: z57.string(),
3940
+ upload: z57.object({
3941
+ id: z57.string(),
3942
+ createdAt: z57.date(),
3943
+ updatedAt: z57.date(),
3944
+ deletedAt: z57.nullable(z57.date()),
3945
+ bucket_name: z57.string(),
3946
+ file_name: z57.string(),
3947
+ file_key: z57.string(),
3948
+ file_size: z57.number(),
3949
+ file_url: z57.string(),
3950
+ extension_name: z57.string()
3951
+ })
3855
3952
  });
3856
- var MessagesAndLogs = z57.array(z57.union([MessageSchema2, ActivityLogModel]));
3857
- var MailRoomSchema = z57.object({
3953
+ var MessageSchema2 = z57.object({
3858
3954
  id: z57.string(),
3859
3955
  createdAt: z57.date(),
3860
3956
  updatedAt: z57.date(),
3861
- deletedAt: z57.date().nullable(),
3957
+ deletedAt: z57.nullable(z57.date()),
3958
+ roomId: z57.string(),
3862
3959
  subject: z57.string(),
3863
- resolved: z57.boolean(),
3864
- assigneeId: z57.string().nullable(),
3865
- note: z57.string(),
3866
- mailId: z57.string(),
3960
+ textPlain: z57.string(),
3961
+ textHtml: z57.string(),
3962
+ textId: z57.string(),
3963
+ emailEngineEmailId: z57.string(),
3964
+ emailEngineMessageId: z57.string(),
3965
+ emailEngineReplyTo: z57.nullable(z57.string()),
3867
3966
  direction: z57.string(),
3868
- lastMessageId: z57.string(),
3869
- firstMessageId: z57.string(),
3967
+ date: z57.date(),
3968
+ action: z57.string(),
3969
+ unseen: z57.boolean(),
3970
+ seemsLikeNew: z57.boolean(),
3870
3971
  from: z57.array(MailUserSchema),
3871
3972
  to: z57.array(MailUserSchema),
3872
3973
  cc: z57.array(MailUserSchema),
3873
3974
  bcc: z57.array(MailUserSchema),
3975
+ attachments: z57.array(AttachmentSchema)
3976
+ });
3977
+
3978
+ // src/mail/schemas/room.schema.ts
3979
+ var MailUserSchema = z58.object({
3980
+ id: z58.string(),
3981
+ createdAt: z58.date(),
3982
+ updatedAt: z58.date(),
3983
+ deletedAt: z58.date().nullable(),
3984
+ name: z58.string(),
3985
+ address: z58.string()
3986
+ });
3987
+ var TagSchema2 = z58.object({
3988
+ color: z58.string(),
3989
+ id: z58.string(),
3990
+ createdAt: z58.date(),
3991
+ updatedAt: z58.date(),
3992
+ deletedAt: z58.date().nullable(),
3993
+ name: z58.string()
3994
+ });
3995
+ var UserModel = z58.object({
3996
+ id: z58.string().uuid(),
3997
+ createdAt: z58.date(),
3998
+ updatedAt: z58.date(),
3999
+ deletedAt: z58.date().nullable(),
4000
+ name: z58.string(),
4001
+ email: z58.string(),
4002
+ address: z58.string().nullable(),
4003
+ phone: z58.string().nullable(),
4004
+ notification_count: z58.number().nullable()
4005
+ });
4006
+ var ActivityLogModel = z58.object({
4007
+ id: z58.string(),
4008
+ createdAt: z58.date(),
4009
+ updatedAt: z58.date(),
4010
+ deletedAt: z58.nullable(z58.string()),
4011
+ description: z58.string(),
4012
+ actorId: z58.string(),
4013
+ roomId: z58.string(),
4014
+ actor: UserModel
4015
+ });
4016
+ var MessagesAndLogs = z58.array(z58.union([MessageSchema2, ActivityLogModel]));
4017
+ var MailRoomSchema = z58.object({
4018
+ id: z58.string(),
4019
+ createdAt: z58.date(),
4020
+ updatedAt: z58.date(),
4021
+ deletedAt: z58.date().nullable(),
4022
+ subject: z58.string(),
4023
+ resolved: z58.boolean(),
4024
+ assigneeId: z58.string().nullable(),
4025
+ note: z58.string(),
4026
+ mailId: z58.string(),
4027
+ direction: z58.string(),
4028
+ lastMessageId: z58.string(),
4029
+ firstMessageId: z58.string(),
4030
+ from: z58.array(MailUserSchema),
4031
+ to: z58.array(MailUserSchema),
4032
+ cc: z58.array(MailUserSchema),
4033
+ bcc: z58.array(MailUserSchema),
3874
4034
  firstMessage: MessageSchema2,
3875
4035
  lastMessage: MessageSchema2,
3876
- tags: z57.array(TagSchema2),
4036
+ tags: z58.array(TagSchema2),
3877
4037
  assignee: UserModel,
3878
- messages: z57.array(MessageSchema2),
4038
+ messages: z58.array(MessageSchema2),
3879
4039
  messagesAndLogs: MessagesAndLogs,
3880
4040
  mail: MailAccountSchema,
3881
- unReadMessageCount: z57.number()
3882
- });
3883
- var AttachmentSchema2 = z57.object({
3884
- fileName: z57.string(),
3885
- fileType: z57.string(),
3886
- emailEngineAttachmentId: z57.string(),
3887
- uploadId: z57.string(),
3888
- messageId: z57.string(),
3889
- roomId: z57.string(),
4041
+ unReadMessageCount: z58.number()
4042
+ });
4043
+ var AttachmentSchema2 = z58.object({
4044
+ fileName: z58.string(),
4045
+ fileType: z58.string(),
4046
+ emailEngineAttachmentId: z58.string(),
4047
+ uploadId: z58.string(),
4048
+ messageId: z58.string(),
4049
+ roomId: z58.string(),
3890
4050
  upload: UploadSchema
3891
4051
  });
3892
4052
 
@@ -3898,7 +4058,7 @@ var roomContract = initContract18().router(
3898
4058
  path: "/",
3899
4059
  responses: {
3900
4060
  200: DefaultSuccessResponseSchema.extend({
3901
- message: z58.string()
4061
+ message: z59.string()
3902
4062
  }),
3903
4063
  ...DefaultResponses
3904
4064
  },
@@ -3908,19 +4068,19 @@ var roomContract = initContract18().router(
3908
4068
  getAll: {
3909
4069
  method: "GET",
3910
4070
  path: "",
3911
- query: z58.object({
3912
- page: z58.coerce.number().default(1),
3913
- pageSize: z58.coerce.number().default(10),
3914
- keyword: z58.string().optional(),
3915
- assigneeId: z58.string().uuid().optional().nullable(),
3916
- resolved: z58.boolean().or(z58.string().transform((value) => value.toLowerCase() === "true")).optional().nullable()
4071
+ query: z59.object({
4072
+ page: z59.coerce.number().default(1),
4073
+ pageSize: z59.coerce.number().default(10),
4074
+ keyword: z59.string().optional(),
4075
+ assigneeId: z59.string().uuid().optional().nullable(),
4076
+ resolved: z59.boolean().or(z59.string().transform((value) => value.toLowerCase() === "true")).optional().nullable()
3917
4077
  }),
3918
4078
  responses: {
3919
4079
  200: DefaultSuccessResponseSchema.extend({
3920
- data: z58.array(MailRoomSchema),
3921
- total: z58.number(),
3922
- page: z58.number(),
3923
- pageSize: z58.number()
4080
+ data: z59.array(MailRoomSchema),
4081
+ total: z59.number(),
4082
+ page: z59.number(),
4083
+ pageSize: z59.number()
3924
4084
  }),
3925
4085
  ...DefaultResponses
3926
4086
  },
@@ -3929,8 +4089,8 @@ var roomContract = initContract18().router(
3929
4089
  getById: {
3930
4090
  method: "GET",
3931
4091
  path: "/:id",
3932
- pathParams: z58.object({
3933
- id: z58.string().uuid()
4092
+ pathParams: z59.object({
4093
+ id: z59.string().uuid()
3934
4094
  }),
3935
4095
  responses: {
3936
4096
  200: DefaultSuccessResponseSchema.extend({
@@ -3943,12 +4103,12 @@ var roomContract = initContract18().router(
3943
4103
  getAttachments: {
3944
4104
  method: "GET",
3945
4105
  path: "/:id/attachments",
3946
- pathParams: z58.object({
3947
- id: z58.string().uuid()
4106
+ pathParams: z59.object({
4107
+ id: z59.string().uuid()
3948
4108
  }),
3949
4109
  responses: {
3950
4110
  200: DefaultSuccessResponseSchema.extend({
3951
- data: z58.array(AttachmentSchema2)
4111
+ data: z59.array(AttachmentSchema2)
3952
4112
  }),
3953
4113
  ...DefaultResponses
3954
4114
  },
@@ -3957,12 +4117,12 @@ var roomContract = initContract18().router(
3957
4117
  getParticipants: {
3958
4118
  method: "GET",
3959
4119
  path: "/:id/participants",
3960
- pathParams: z58.object({
3961
- id: z58.string().uuid()
4120
+ pathParams: z59.object({
4121
+ id: z59.string().uuid()
3962
4122
  }),
3963
4123
  responses: {
3964
4124
  200: DefaultSuccessResponseSchema.extend({
3965
- data: z58.array(MailUserSchema)
4125
+ data: z59.array(MailUserSchema)
3966
4126
  }),
3967
4127
  ...DefaultResponses
3968
4128
  },
@@ -3971,8 +4131,8 @@ var roomContract = initContract18().router(
3971
4131
  update: {
3972
4132
  method: "PATCH",
3973
4133
  path: "/:id",
3974
- pathParams: z58.object({
3975
- id: z58.string()
4134
+ pathParams: z59.object({
4135
+ id: z59.string()
3976
4136
  }),
3977
4137
  responses: {
3978
4138
  200: DefaultSuccessResponseSchema.extend({
@@ -3980,15 +4140,15 @@ var roomContract = initContract18().router(
3980
4140
  }),
3981
4141
  ...DefaultResponses
3982
4142
  },
3983
- body: z58.object({
3984
- resolved: z58.boolean().or(
3985
- z58.union([z58.literal("true"), z58.literal("false")]).transform((value) => value.toLowerCase() === "true")
4143
+ body: z59.object({
4144
+ resolved: z59.boolean().or(
4145
+ z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
3986
4146
  ).optional().nullable(),
3987
- assigneeId: z58.string().uuid().optional().nullable(),
3988
- note: z58.string().optional(),
3989
- tags: z58.array(z58.string().uuid()).optional(),
3990
- handover: z58.boolean().or(
3991
- z58.union([z58.literal("true"), z58.literal("false")]).transform((value) => value.toLowerCase() === "true")
4147
+ assigneeId: z59.string().uuid().optional().nullable(),
4148
+ note: z59.string().optional(),
4149
+ tags: z59.array(z59.string().uuid()).optional(),
4150
+ handover: z59.boolean().or(
4151
+ z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
3992
4152
  ).optional().nullable()
3993
4153
  }),
3994
4154
  summary: "Update a mail room by id"
@@ -3996,12 +4156,12 @@ var roomContract = initContract18().router(
3996
4156
  markAsRead: {
3997
4157
  method: "GET",
3998
4158
  path: "/:id",
3999
- pathParams: z58.object({
4000
- id: z58.string().uuid()
4159
+ pathParams: z59.object({
4160
+ id: z59.string().uuid()
4001
4161
  }),
4002
4162
  responses: {
4003
4163
  200: DefaultSuccessResponseSchema.extend({
4004
- message: z58.string()
4164
+ message: z59.string()
4005
4165
  }),
4006
4166
  ...DefaultResponses
4007
4167
  },
@@ -4015,47 +4175,47 @@ var roomContract = initContract18().router(
4015
4175
 
4016
4176
  // src/mail/account-contract.ts
4017
4177
  import { initContract as initContract19 } from "@ts-rest/core";
4018
- import z60 from "zod";
4178
+ import z61 from "zod";
4019
4179
 
4020
4180
  // src/mail/schemas/account-validation.schema.ts
4021
- import z59 from "zod";
4181
+ import z60 from "zod";
4022
4182
  var AccountContractsValidationSchemas = {
4023
4183
  create: {
4024
- input: z59.object({
4025
- address: z59.string().email("Email address must be valid email."),
4026
- name: z59.string().min(1, "Account name cannot be empty."),
4027
- password: z59.string().min(1, "Password cannot be empty."),
4028
- mailServerId: z59.string().uuid("Invalid mail_server_id")
4184
+ input: z60.object({
4185
+ address: z60.string().email("Email address must be valid email."),
4186
+ name: z60.string().min(1, "Account name cannot be empty."),
4187
+ password: z60.string().min(1, "Password cannot be empty."),
4188
+ mailServerId: z60.string().uuid("Invalid mail_server_id")
4029
4189
  })
4030
4190
  },
4031
4191
  getById: {
4032
- input: z59.object({
4033
- id: z59.string().uuid()
4192
+ input: z60.object({
4193
+ id: z60.string().uuid()
4034
4194
  }),
4035
4195
  output: MailAccountSchema
4036
4196
  },
4037
4197
  getAll: {
4038
- output: z59.array(MailAccountSchema)
4198
+ output: z60.array(MailAccountSchema)
4039
4199
  },
4040
4200
  update: {
4041
4201
  input: MailAccountSchema,
4042
4202
  output: MailAccountSchema
4043
4203
  },
4044
4204
  disconnect: {
4045
- input: z59.object({
4046
- id: z59.string().uuid()
4205
+ input: z60.object({
4206
+ id: z60.string().uuid()
4047
4207
  }),
4048
4208
  output: MailAccountSchema
4049
4209
  },
4050
4210
  reconnect: {
4051
- input: z59.object({
4052
- id: z59.string()
4211
+ input: z60.object({
4212
+ id: z60.string()
4053
4213
  }),
4054
4214
  output: MailAccountSchema
4055
4215
  },
4056
4216
  delete: {
4057
- input: z59.object({
4058
- id: z59.string()
4217
+ input: z60.object({
4218
+ id: z60.string()
4059
4219
  }),
4060
4220
  output: MailAccountSchema
4061
4221
  }
@@ -4071,16 +4231,16 @@ var accountContract = initContract19().router(
4071
4231
  responses: {
4072
4232
  201: DefaultSuccessResponseSchema.extend({
4073
4233
  // data: AccountContractsValidationSchemas.create.output,
4074
- message: z60.string()
4234
+ message: z61.string()
4075
4235
  }),
4076
- 400: z60.object({
4077
- message: z60.string()
4236
+ 400: z61.object({
4237
+ message: z61.string()
4078
4238
  }),
4079
- 409: z60.object({
4080
- message: z60.string()
4239
+ 409: z61.object({
4240
+ message: z61.string()
4081
4241
  }),
4082
- 500: z60.object({
4083
- message: z60.string()
4242
+ 500: z61.object({
4243
+ message: z61.string()
4084
4244
  }),
4085
4245
  ...DefaultResponses
4086
4246
  },
@@ -4109,7 +4269,7 @@ var accountContract = initContract19().router(
4109
4269
  path: "",
4110
4270
  responses: {
4111
4271
  200: DefaultSuccessResponseSchema.extend({
4112
- data: z60.any()
4272
+ data: z61.any()
4113
4273
  // data: AccountContractsValidationSchemas.getAll.output,
4114
4274
  }),
4115
4275
  ...DefaultResponses
@@ -4121,8 +4281,8 @@ var accountContract = initContract19().router(
4121
4281
  update: {
4122
4282
  method: "PATCH",
4123
4283
  path: "/:id",
4124
- pathParams: z60.object({
4125
- id: z60.string().uuid()
4284
+ pathParams: z61.object({
4285
+ id: z61.string().uuid()
4126
4286
  }),
4127
4287
  responses: {
4128
4288
  201: DefaultSuccessResponseSchema.extend({
@@ -4171,7 +4331,7 @@ var accountContract = initContract19().router(
4171
4331
  pathParams: AccountContractsValidationSchemas.delete.input,
4172
4332
  responses: {
4173
4333
  200: DefaultSuccessResponseSchema.extend({
4174
- message: z60.string()
4334
+ message: z61.string()
4175
4335
  }),
4176
4336
  ...DefaultResponses
4177
4337
  },
@@ -4188,7 +4348,7 @@ var accountContract = initContract19().router(
4188
4348
 
4189
4349
  // src/mail/mail-server-contract.ts
4190
4350
  import { initContract as initContract20 } from "@ts-rest/core";
4191
- import z61 from "zod";
4351
+ import z62 from "zod";
4192
4352
  var serverContract = initContract20().router(
4193
4353
  {
4194
4354
  create: {
@@ -4196,7 +4356,7 @@ var serverContract = initContract20().router(
4196
4356
  path: "/",
4197
4357
  responses: {
4198
4358
  200: DefaultSuccessResponseSchema.extend({
4199
- message: z61.string()
4359
+ message: z62.string()
4200
4360
  }),
4201
4361
  ...DefaultResponses
4202
4362
  },
@@ -4206,12 +4366,12 @@ var serverContract = initContract20().router(
4206
4366
  get: {
4207
4367
  method: "GET",
4208
4368
  path: "/:id",
4209
- pathParams: z61.object({
4210
- id: z61.string()
4369
+ pathParams: z62.object({
4370
+ id: z62.string()
4211
4371
  }),
4212
4372
  responses: {
4213
4373
  200: DefaultSuccessResponseSchema.extend({
4214
- message: z61.string()
4374
+ message: z62.string()
4215
4375
  }),
4216
4376
  ...DefaultResponses
4217
4377
  },
@@ -4220,12 +4380,12 @@ var serverContract = initContract20().router(
4220
4380
  update: {
4221
4381
  method: "PATCH",
4222
4382
  path: "/:id",
4223
- pathParams: z61.object({
4224
- id: z61.string()
4383
+ pathParams: z62.object({
4384
+ id: z62.string()
4225
4385
  }),
4226
4386
  responses: {
4227
4387
  200: DefaultSuccessResponseSchema.extend({
4228
- message: z61.string()
4388
+ message: z62.string()
4229
4389
  }),
4230
4390
  ...DefaultResponses
4231
4391
  },
@@ -4235,12 +4395,12 @@ var serverContract = initContract20().router(
4235
4395
  delete: {
4236
4396
  method: "PATCH",
4237
4397
  path: "/:id",
4238
- pathParams: z61.object({
4239
- id: z61.string()
4398
+ pathParams: z62.object({
4399
+ id: z62.string()
4240
4400
  }),
4241
4401
  responses: {
4242
4402
  200: DefaultSuccessResponseSchema.extend({
4243
- message: z61.string()
4403
+ message: z62.string()
4244
4404
  }),
4245
4405
  ...DefaultResponses
4246
4406
  },
@@ -4255,44 +4415,44 @@ var serverContract = initContract20().router(
4255
4415
 
4256
4416
  // src/mail/message-contract.ts
4257
4417
  import { initContract as initContract21 } from "@ts-rest/core";
4258
- import z63 from "zod";
4418
+ import z64 from "zod";
4259
4419
 
4260
4420
  // src/mail/schemas/message-validation.schema.ts
4261
- import z62 from "zod";
4262
- var MailParticipant = z62.object({
4263
- name: z62.string().optional(),
4264
- address: z62.string().email()
4421
+ import z63 from "zod";
4422
+ var MailParticipant = z63.object({
4423
+ name: z63.string().optional(),
4424
+ address: z63.string().email()
4265
4425
  });
4266
4426
  var MessageContractsValidationsSchema = {
4267
4427
  submit: {
4268
- input: z62.object({
4269
- subject: z62.string(),
4270
- text: z62.string(),
4271
- html: z62.string(),
4428
+ input: z63.object({
4429
+ subject: z63.string(),
4430
+ text: z63.string(),
4431
+ html: z63.string(),
4272
4432
  from: MailParticipant,
4273
- to: z62.array(MailParticipant),
4274
- cc: z62.array(MailParticipant).optional(),
4275
- bcc: z62.array(MailParticipant).optional(),
4276
- reference: z62.object({
4277
- messageId: z62.string(),
4278
- action: z62.union([z62.literal("reply"), z62.literal("forward")])
4433
+ to: z63.array(MailParticipant),
4434
+ cc: z63.array(MailParticipant).optional(),
4435
+ bcc: z63.array(MailParticipant).optional(),
4436
+ reference: z63.object({
4437
+ messageId: z63.string(),
4438
+ action: z63.union([z63.literal("reply"), z63.literal("forward")])
4279
4439
  }).optional(),
4280
- attachments: z62.array(
4281
- z62.object({
4282
- fileType: z62.string(),
4283
- fileName: z62.string(),
4284
- fileKey: z62.string(),
4285
- fileSize: z62.number(),
4286
- bucketName: z62.string(),
4287
- presignedUrl: z62.string()
4440
+ attachments: z63.array(
4441
+ z63.object({
4442
+ fileType: z63.string(),
4443
+ fileName: z63.string(),
4444
+ fileKey: z63.string(),
4445
+ fileSize: z63.number(),
4446
+ bucketName: z63.string(),
4447
+ presignedUrl: z63.string()
4288
4448
  })
4289
4449
  ).optional()
4290
4450
  }),
4291
- output: z62.object({
4292
- response: z62.string(),
4293
- messageId: z62.string(),
4294
- sendAt: z62.string(),
4295
- queueId: z62.string()
4451
+ output: z63.object({
4452
+ response: z63.string(),
4453
+ messageId: z63.string(),
4454
+ sendAt: z63.string(),
4455
+ queueId: z63.string()
4296
4456
  })
4297
4457
  }
4298
4458
  };
@@ -4317,8 +4477,8 @@ var messageContract = initContract21().router(
4317
4477
  getById: {
4318
4478
  method: "GET",
4319
4479
  path: "/:id",
4320
- pathParams: z63.object({
4321
- id: z63.string()
4480
+ pathParams: z64.object({
4481
+ id: z64.string()
4322
4482
  }),
4323
4483
  responses: {
4324
4484
  200: DefaultSuccessResponseSchema.extend({
@@ -4345,6 +4505,7 @@ var mailContract = initContract22().router({
4345
4505
 
4346
4506
  // src/messenger/index.ts
4347
4507
  import { initContract as initContract23 } from "@ts-rest/core";
4508
+ import z65 from "zod";
4348
4509
  var messengerContract = initContract23().router({
4349
4510
  sendMessage: {
4350
4511
  method: "POST",
@@ -4375,6 +4536,32 @@ var messengerContract = initContract23().router({
4375
4536
  400: DefaultErrorResponseSchema
4376
4537
  }
4377
4538
  },
4539
+ reconnect: {
4540
+ method: "POST",
4541
+ path: "/reconnect/:channelId",
4542
+ pathParams: z65.object({
4543
+ channelId: z65.string().uuid()
4544
+ }),
4545
+ body: null,
4546
+ responses: {
4547
+ 200: ChannelServiceResponseSchema,
4548
+ 500: DefaultErrorResponseSchema,
4549
+ 400: DefaultErrorResponseSchema
4550
+ }
4551
+ },
4552
+ delete: {
4553
+ method: "DELETE",
4554
+ path: "/delete/:channelId",
4555
+ pathParams: z65.object({
4556
+ channelId: z65.string().uuid()
4557
+ }),
4558
+ body: null,
4559
+ responses: {
4560
+ 200: ChannelServiceResponseSchema,
4561
+ 500: DefaultErrorResponseSchema,
4562
+ 400: DefaultErrorResponseSchema
4563
+ }
4564
+ },
4378
4565
  relogin: {
4379
4566
  method: "POST",
4380
4567
  path: "/relogin",
@@ -4398,7 +4585,7 @@ var messengerContract = initContract23().router({
4398
4585
 
4399
4586
  // src/permission/index.ts
4400
4587
  import { initContract as initContract24 } from "@ts-rest/core";
4401
- import z64 from "zod";
4588
+ import z66 from "zod";
4402
4589
  var permissionContract = initContract24().router(
4403
4590
  {
4404
4591
  getPermissions: {
@@ -4406,9 +4593,9 @@ var permissionContract = initContract24().router(
4406
4593
  path: "",
4407
4594
  headers: DefaultHeaderSchema,
4408
4595
  responses: {
4409
- 200: z64.object({ permissions: PermissionSchema.array() }),
4410
- 400: z64.object({
4411
- message: z64.string()
4596
+ 200: z66.object({ permissions: PermissionSchema.array() }),
4597
+ 400: z66.object({
4598
+ message: z66.string()
4412
4599
  }),
4413
4600
  401: DefaultUnauthorizedSchema,
4414
4601
  500: DefaultErrorResponseSchema
@@ -4421,15 +4608,15 @@ var permissionContract = initContract24().router(
4421
4608
 
4422
4609
  // src/role/index.ts
4423
4610
  import { initContract as initContract25 } from "@ts-rest/core";
4424
- import z66 from "zod";
4611
+ import z68 from "zod";
4425
4612
 
4426
4613
  // src/role/validation.ts
4427
- import { z as z65 } from "zod";
4428
- var CreateRoleSchema = z65.object({
4429
- systemName: z65.string(),
4430
- displayName: z65.string(),
4431
- description: z65.string().nullable(),
4432
- permissions: z65.array(z65.string())
4614
+ import { z as z67 } from "zod";
4615
+ var CreateRoleSchema = z67.object({
4616
+ systemName: z67.string(),
4617
+ displayName: z67.string(),
4618
+ description: z67.string().nullable(),
4619
+ permissions: z67.array(z67.string())
4433
4620
  });
4434
4621
  var UpdateRoleSchema = CreateRoleSchema;
4435
4622
 
@@ -4445,8 +4632,8 @@ var roleContract = initContract25().router(
4445
4632
  201: DefaultSuccessResponseSchema.extend({
4446
4633
  role: RoleSchema
4447
4634
  }),
4448
- 400: z66.object({
4449
- message: z66.string()
4635
+ 400: z68.object({
4636
+ message: z68.string()
4450
4637
  }),
4451
4638
  401: DefaultUnauthorizedSchema,
4452
4639
  500: DefaultErrorResponseSchema
@@ -4456,15 +4643,15 @@ var roleContract = initContract25().router(
4456
4643
  getRoles: {
4457
4644
  method: "GET",
4458
4645
  path: "",
4459
- query: z66.object({
4460
- page: z66.coerce.number().default(1),
4461
- pageSize: z66.coerce.number().default(10)
4646
+ query: z68.object({
4647
+ page: z68.coerce.number().default(1),
4648
+ pageSize: z68.coerce.number().default(10)
4462
4649
  }).optional(),
4463
4650
  headers: DefaultHeaderSchema,
4464
4651
  responses: {
4465
4652
  200: WithPagination(RoleSchema),
4466
- 400: z66.object({
4467
- message: z66.string()
4653
+ 400: z68.object({
4654
+ message: z68.string()
4468
4655
  }),
4469
4656
  401: DefaultUnauthorizedSchema,
4470
4657
  500: DefaultErrorResponseSchema
@@ -4474,15 +4661,15 @@ var roleContract = initContract25().router(
4474
4661
  updateRole: {
4475
4662
  method: "PATCH",
4476
4663
  path: "/:id",
4477
- pathParams: z66.object({ id: z66.string() }),
4664
+ pathParams: z68.object({ id: z68.string() }),
4478
4665
  headers: DefaultHeaderSchema,
4479
4666
  body: UpdateRoleSchema,
4480
4667
  responses: {
4481
4668
  201: DefaultSuccessResponseSchema.extend({
4482
4669
  role: RoleSchema
4483
4670
  }),
4484
- 400: z66.object({
4485
- message: z66.string()
4671
+ 400: z68.object({
4672
+ message: z68.string()
4486
4673
  }),
4487
4674
  401: DefaultUnauthorizedSchema,
4488
4675
  500: DefaultErrorResponseSchema
@@ -4492,11 +4679,11 @@ var roleContract = initContract25().router(
4492
4679
  deleteRole: {
4493
4680
  method: "DELETE",
4494
4681
  path: "/:id",
4495
- pathParams: z66.object({ id: z66.string() }),
4682
+ pathParams: z68.object({ id: z68.string() }),
4496
4683
  headers: DefaultHeaderSchema,
4497
4684
  body: null,
4498
4685
  responses: {
4499
- 200: DefaultSuccessResponseSchema.extend({ message: z66.string() }),
4686
+ 200: DefaultSuccessResponseSchema.extend({ message: z68.string() }),
4500
4687
  500: DefaultErrorResponseSchema
4501
4688
  },
4502
4689
  summary: "Delete a role."
@@ -4507,19 +4694,19 @@ var roleContract = initContract25().router(
4507
4694
 
4508
4695
  // src/tag/index.ts
4509
4696
  import { initContract as initContract26 } from "@ts-rest/core";
4510
- import z68 from "zod";
4697
+ import z70 from "zod";
4511
4698
 
4512
4699
  // src/tag/validation.ts
4513
- import { z as z67 } from "zod";
4514
- var CreateTagSchema = z67.object({
4515
- name: z67.string(),
4700
+ import { z as z69 } from "zod";
4701
+ var CreateTagSchema = z69.object({
4702
+ name: z69.string(),
4516
4703
  group: TagGroupSchema
4517
4704
  });
4518
- var GetTagsSchema = z67.object({
4705
+ var GetTagsSchema = z69.object({
4519
4706
  group: TagGroupSchema.default("general"),
4520
- keyword: z67.string()
4707
+ keyword: z69.string()
4521
4708
  }).partial().optional();
4522
- var UpdateTagSchema = z67.object({ name: z67.string() });
4709
+ var UpdateTagSchema = z69.object({ name: z69.string() });
4523
4710
 
4524
4711
  // src/tag/index.ts
4525
4712
  var tagContract = initContract26().router(
@@ -4542,7 +4729,7 @@ var tagContract = initContract26().router(
4542
4729
  query: GetTagsSchema,
4543
4730
  responses: {
4544
4731
  200: DefaultSuccessResponseSchema.extend({
4545
- tags: z68.array(TagSchema)
4732
+ tags: z70.array(TagSchema)
4546
4733
  }),
4547
4734
  500: DefaultErrorResponseSchema
4548
4735
  },
@@ -4551,7 +4738,7 @@ var tagContract = initContract26().router(
4551
4738
  updateTag: {
4552
4739
  method: "PATCH",
4553
4740
  path: "/:id",
4554
- pathParams: z68.object({ id: z68.string() }),
4741
+ pathParams: z70.object({ id: z70.string() }),
4555
4742
  body: UpdateTagSchema,
4556
4743
  responses: {
4557
4744
  200: DefaultSuccessResponseSchema.extend({
@@ -4564,11 +4751,11 @@ var tagContract = initContract26().router(
4564
4751
  deleteTag: {
4565
4752
  method: "DELETE",
4566
4753
  path: "/:id",
4567
- pathParams: z68.object({ id: z68.string() }),
4568
- body: z68.any().optional(),
4754
+ pathParams: z70.object({ id: z70.string() }),
4755
+ body: z70.any().optional(),
4569
4756
  // We don't need the body.
4570
4757
  responses: {
4571
- 200: DefaultSuccessResponseSchema.extend({ message: z68.string() }),
4758
+ 200: DefaultSuccessResponseSchema.extend({ message: z70.string() }),
4572
4759
  500: DefaultErrorResponseSchema
4573
4760
  },
4574
4761
  headers: DefaultHeaderSchema
@@ -4581,27 +4768,27 @@ var tagContract = initContract26().router(
4581
4768
 
4582
4769
  // src/telephony-agent-presence-status/index.ts
4583
4770
  import { initContract as initContract27 } from "@ts-rest/core";
4584
- import z71 from "zod";
4771
+ import z73 from "zod";
4585
4772
 
4586
4773
  // src/telephony-agent-presence-status/schema.ts
4587
- import z69 from "zod";
4774
+ import z71 from "zod";
4588
4775
  var PresenceStatusSchema = DefaultEntitySchema.extend({
4589
- status: z69.string(),
4590
- description: z69.string()
4776
+ status: z71.string(),
4777
+ description: z71.string()
4591
4778
  });
4592
4779
  var UserPresenceStatusSchema = DefaultEntitySchema.extend({
4593
4780
  user: UserSchema,
4594
4781
  presenceStatus: PresenceStatusSchema,
4595
- customPresenceStatus: z69.string().nullable().optional()
4782
+ customPresenceStatus: z71.string().nullable().optional()
4596
4783
  });
4597
4784
 
4598
4785
  // src/telephony-agent-presence-status/validation.ts
4599
- import { z as z70 } from "zod";
4600
- var UpdateUserStatusSchema = z70.object({
4601
- userId: z70.string(),
4602
- presenceStatusId: z70.string().nullable().optional(),
4603
- customPreseneStatus: z70.string().nullable().optional(),
4604
- reason: z70.string()
4786
+ import { z as z72 } from "zod";
4787
+ var UpdateUserStatusSchema = z72.object({
4788
+ userId: z72.string(),
4789
+ presenceStatusId: z72.string().nullable().optional(),
4790
+ customPreseneStatus: z72.string().nullable().optional(),
4791
+ reason: z72.string()
4605
4792
  });
4606
4793
 
4607
4794
  // src/telephony-agent-presence-status/index.ts
@@ -4612,9 +4799,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4612
4799
  path: "/presence_status",
4613
4800
  headers: DefaultHeaderSchema,
4614
4801
  responses: {
4615
- 200: z71.array(PresenceStatusSchema),
4616
- 400: z71.object({
4617
- message: z71.string()
4802
+ 200: z73.array(PresenceStatusSchema),
4803
+ 400: z73.object({
4804
+ message: z73.string()
4618
4805
  }),
4619
4806
  401: DefaultUnauthorizedSchema,
4620
4807
  500: DefaultErrorResponseSchema
@@ -4626,9 +4813,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4626
4813
  path: "/agents/presence_status",
4627
4814
  headers: DefaultHeaderSchema,
4628
4815
  responses: {
4629
- 200: z71.array(UserPresenceStatusSchema),
4630
- 400: z71.object({
4631
- message: z71.string()
4816
+ 200: z73.array(UserPresenceStatusSchema),
4817
+ 400: z73.object({
4818
+ message: z73.string()
4632
4819
  }),
4633
4820
  401: DefaultUnauthorizedSchema,
4634
4821
  500: DefaultErrorResponseSchema
@@ -4638,12 +4825,12 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4638
4825
  getAgentStatus: {
4639
4826
  method: "GET",
4640
4827
  path: "/presence_status/check_update/:userId",
4641
- pathParams: z71.object({ userId: z71.string() }),
4828
+ pathParams: z73.object({ userId: z73.string() }),
4642
4829
  headers: DefaultHeaderSchema,
4643
4830
  responses: {
4644
4831
  200: UserPresenceStatusSchema,
4645
- 400: z71.object({
4646
- message: z71.string()
4832
+ 400: z73.object({
4833
+ message: z73.string()
4647
4834
  }),
4648
4835
  401: DefaultUnauthorizedSchema,
4649
4836
  500: DefaultErrorResponseSchema
@@ -4659,8 +4846,8 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4659
4846
  200: DefaultSuccessResponseSchema.extend({
4660
4847
  userPresenceStatu: UserPresenceStatusSchema
4661
4848
  }),
4662
- 400: z71.object({
4663
- message: z71.string()
4849
+ 400: z73.object({
4850
+ message: z73.string()
4664
4851
  }),
4665
4852
  401: DefaultUnauthorizedSchema,
4666
4853
  500: DefaultErrorResponseSchema
@@ -4672,58 +4859,58 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4672
4859
  );
4673
4860
 
4674
4861
  // src/telephony-cdr/index.ts
4675
- import z74 from "zod";
4862
+ import z76 from "zod";
4676
4863
 
4677
4864
  // src/telephony-cdr/validation.ts
4678
- import z72 from "zod";
4679
- var CreateTelephonyCdrSchema = z72.object({
4680
- uniqueCallId: z72.string({ required_error: "uniqueCallId is required" }),
4681
- timeStart: z72.string({ required_error: "timeStart is required" }),
4682
- callFrom: z72.string({ required_error: "callFrom is required" }),
4683
- callTo: z72.string({ required_error: "callTo is required" }),
4684
- callDuration: z72.number().nullable(),
4685
- talkDuration: z72.number().nullable(),
4686
- srcTrunkName: z72.string().nullable(),
4687
- dstTrunkName: z72.string().nullable(),
4688
- pinCode: z72.string().nullable(),
4689
- status: z72.string(),
4690
- type: z72.string(),
4691
- recording: z72.string().nullable(),
4692
- didNumber: z72.string().nullable(),
4693
- agentRingTime: z72.number().nullable()
4865
+ import z74 from "zod";
4866
+ var CreateTelephonyCdrSchema = z74.object({
4867
+ uniqueCallId: z74.string({ required_error: "uniqueCallId is required" }),
4868
+ timeStart: z74.string({ required_error: "timeStart is required" }),
4869
+ callFrom: z74.string({ required_error: "callFrom is required" }),
4870
+ callTo: z74.string({ required_error: "callTo is required" }),
4871
+ callDuration: z74.number().nullable(),
4872
+ talkDuration: z74.number().nullable(),
4873
+ srcTrunkName: z74.string().nullable(),
4874
+ dstTrunkName: z74.string().nullable(),
4875
+ pinCode: z74.string().nullable(),
4876
+ status: z74.string(),
4877
+ type: z74.string(),
4878
+ recording: z74.string().nullable(),
4879
+ didNumber: z74.string().nullable(),
4880
+ agentRingTime: z74.number().nullable()
4694
4881
  });
4695
4882
  var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
4696
- selectedDate: z72.string().optional(),
4697
- type: z72.array(z72.string()).optional(),
4698
- status: z72.array(z72.string()).optional(),
4699
- callFrom: z72.string().optional(),
4700
- callTo: z72.string().optional(),
4701
- trunk: z72.array(z72.string()).optional()
4883
+ selectedDate: z74.string().optional(),
4884
+ type: z74.array(z74.string()).optional(),
4885
+ status: z74.array(z74.string()).optional(),
4886
+ callFrom: z74.string().optional(),
4887
+ callTo: z74.string().optional(),
4888
+ trunk: z74.array(z74.string()).optional()
4702
4889
  });
4703
4890
  var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
4704
- type: z72.array(z72.string()).optional(),
4705
- status: z72.array(z72.string()).optional(),
4706
- callFrom: z72.string().optional(),
4707
- callTo: z72.string().optional(),
4708
- result: z72.array(z72.string()).optional(),
4709
- callTags: z72.array(z72.string()).optional(),
4710
- selectedDate: z72.string().optional(),
4711
- agentId: z72.string().optional(),
4712
- contact: z72.array(z72.string()).optional(),
4713
- callStatus: z72.array(z72.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
4714
- queueIds: z72.array(z72.string()).optional(),
4715
- notes: z72.string().optional()
4891
+ type: z74.array(z74.string()).optional(),
4892
+ status: z74.array(z74.string()).optional(),
4893
+ callFrom: z74.string().optional(),
4894
+ callTo: z74.string().optional(),
4895
+ result: z74.array(z74.string()).optional(),
4896
+ callTags: z74.array(z74.string()).optional(),
4897
+ selectedDate: z74.string().optional(),
4898
+ agentId: z74.string().optional(),
4899
+ contact: z74.array(z74.string()).optional(),
4900
+ callStatus: z74.array(z74.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
4901
+ queueIds: z74.array(z74.string()).optional(),
4902
+ notes: z74.string().optional()
4716
4903
  });
4717
4904
  var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
4718
- z72.object({
4719
- page: z72.coerce.number().positive().optional(),
4720
- pageSize: z72.coerce.number().positive().optional()
4905
+ z74.object({
4906
+ page: z74.coerce.number().positive().optional(),
4907
+ pageSize: z74.coerce.number().positive().optional()
4721
4908
  })
4722
4909
  );
4723
4910
  var NullEmptyStringUndefined = ["", null, void 0];
4724
4911
  var EmtptyArrayUndefined = [[], void 0];
4725
4912
  var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
4726
- reportType: z72.enum([
4913
+ reportType: z74.enum([
4727
4914
  "extcallstatistics",
4728
4915
  "extcallactivity",
4729
4916
  "trunkactivity",
@@ -4733,59 +4920,59 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
4733
4920
  "queueagentmisscalls",
4734
4921
  "queueagentinoutcalls"
4735
4922
  ]),
4736
- selectedDate: z72.string().optional(),
4737
- communicationType: z72.union([z72.literal("Inbound"), z72.literal("Outbound"), z72.literal("Internal")]).optional(),
4738
- time: z72.string().optional(),
4739
- queueList: z72.array(z72.string()).optional(),
4740
- queueId: z72.string().optional(),
4741
- trunkList: z72.array(z72.string()).optional(),
4742
- extensionList: z72.array(z72.string()).optional()
4923
+ selectedDate: z74.string().optional(),
4924
+ communicationType: z74.union([z74.literal("Inbound"), z74.literal("Outbound"), z74.literal("Internal")]).optional(),
4925
+ time: z74.string().optional(),
4926
+ queueList: z74.array(z74.string()).optional(),
4927
+ queueId: z74.string().optional(),
4928
+ trunkList: z74.array(z74.string()).optional(),
4929
+ extensionList: z74.array(z74.string()).optional()
4743
4930
  }).superRefine((input, ctx) => {
4744
4931
  if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
4745
4932
  ctx.addIssue({
4746
- code: z72.ZodIssueCode.custom,
4933
+ code: z74.ZodIssueCode.custom,
4747
4934
  path: ["selectedDate"],
4748
4935
  message: "selectedDate is required."
4749
4936
  });
4750
4937
  }
4751
4938
  if (input.reportType === "extcallstatistics" && !NullEmptyStringUndefined.includes(input.communicationType)) {
4752
4939
  ctx.addIssue({
4753
- code: z72.ZodIssueCode.custom,
4940
+ code: z74.ZodIssueCode.custom,
4754
4941
  path: ["communicationType"],
4755
4942
  message: "communicationType is required."
4756
4943
  });
4757
4944
  }
4758
4945
  if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
4759
4946
  ctx.addIssue({
4760
- code: z72.ZodIssueCode.custom,
4947
+ code: z74.ZodIssueCode.custom,
4761
4948
  path: ["time"],
4762
4949
  message: "time is required."
4763
4950
  });
4764
4951
  }
4765
4952
  if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
4766
4953
  ctx.addIssue({
4767
- code: z72.ZodIssueCode.custom,
4954
+ code: z74.ZodIssueCode.custom,
4768
4955
  path: ["queueList"],
4769
4956
  message: "queueList is required."
4770
4957
  });
4771
4958
  }
4772
4959
  if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
4773
4960
  ctx.addIssue({
4774
- code: z72.ZodIssueCode.custom,
4961
+ code: z74.ZodIssueCode.custom,
4775
4962
  path: ["queueId"],
4776
4963
  message: "queueId is required."
4777
4964
  });
4778
4965
  }
4779
4966
  if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
4780
4967
  ctx.addIssue({
4781
- code: z72.ZodIssueCode.custom,
4968
+ code: z74.ZodIssueCode.custom,
4782
4969
  path: ["trunkList"],
4783
4970
  message: "trunkList is required."
4784
4971
  });
4785
4972
  }
4786
4973
  if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
4787
4974
  ctx.addIssue({
4788
- code: z72.ZodIssueCode.custom,
4975
+ code: z74.ZodIssueCode.custom,
4789
4976
  path: ["extensionList"],
4790
4977
  message: "extensionList is required."
4791
4978
  });
@@ -4796,161 +4983,161 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
4796
4983
  import { initContract as initContract28 } from "@ts-rest/core";
4797
4984
 
4798
4985
  // src/telephony-cdr/call-report.schema.ts
4799
- import z73 from "zod";
4800
- var ExtCallStatisticsListSchema = z73.object({
4986
+ import z75 from "zod";
4987
+ var ExtCallStatisticsListSchema = z75.object({
4801
4988
  /** @example "ext_num" */
4802
- ext_num: z73.string(),
4989
+ ext_num: z75.string(),
4803
4990
  /** @example "ext_name" */
4804
- ext_name: z73.string(),
4991
+ ext_name: z75.string(),
4805
4992
  /** @example 0 */
4806
- answered_calls: z73.number(),
4993
+ answered_calls: z75.number(),
4807
4994
  /** @example 0 */
4808
- no_answer_calls: z73.number(),
4995
+ no_answer_calls: z75.number(),
4809
4996
  /** @example 0 */
4810
- busy_calls: z73.number(),
4997
+ busy_calls: z75.number(),
4811
4998
  /** @example 0 */
4812
- failed_calls: z73.number(),
4999
+ failed_calls: z75.number(),
4813
5000
  /** @example 0 */
4814
- voicemail_calls: z73.number(),
5001
+ voicemail_calls: z75.number(),
4815
5002
  /** @example 0 */
4816
- total_holding_time: z73.number(),
5003
+ total_holding_time: z75.number(),
4817
5004
  /** @example 0 */
4818
- total_talking_time: z73.number(),
5005
+ total_talking_time: z75.number(),
4819
5006
  /** @example "src_name" */
4820
- src_name: z73.string(),
5007
+ src_name: z75.string(),
4821
5008
  /** @example 0 */
4822
- total_call_count: z73.number(),
5009
+ total_call_count: z75.number(),
4823
5010
  /** @example "mobile" */
4824
- mobile: z73.string()
4825
- });
4826
- var ExtStatisticSchema = z73.object({
4827
- ext_num: z73.string(),
4828
- ext_name: z73.string(),
4829
- answered_calls: z73.number(),
4830
- no_answer_calls: z73.number(),
4831
- busy_calls: z73.number(),
4832
- failed_calls: z73.number(),
4833
- voicemail_calls: z73.number(),
4834
- total_holding_time: z73.number(),
4835
- total_talking_time: z73.number(),
4836
- time: z73.number(),
4837
- mobile: z73.string()
4838
- });
4839
- var ExtCallActivityListSchema = z73.object({
4840
- time: z73.number(),
4841
- answered_calls: z73.number(),
4842
- no_answer_calls: z73.number(),
4843
- busy_calls: z73.number(),
4844
- failed_calls: z73.number(),
4845
- voicemail_calls: z73.number(),
4846
- total_holding_time: z73.number(),
4847
- total_talking_time: z73.number(),
4848
- ext_statistics: z73.array(ExtStatisticSchema)
4849
- });
4850
- var TrunkList = z73.object({
4851
- trunk_name: z73.string(),
4852
- total_calls: z73.number()
4853
- });
4854
- var TrunkActivityListSchema = z73.object({
4855
- time: z73.number(),
4856
- trunk_list: z73.array(TrunkList)
4857
- });
4858
- var QueueAvgWaitTalkTimeListSchema = z73.object({
4859
- time: z73.number(),
4860
- avg_wait_time: z73.number(),
4861
- avg_talk_time: z73.number()
4862
- });
4863
- var SatisfactionListSchema = z73.object({
4864
- press_key: z73.string(),
4865
- total: z73.number(),
4866
- key_point: z73.number().optional()
4867
- });
4868
- var agentListSchema = z73.object({
4869
- agent_name: z73.string(),
4870
- agent_num: z73.string(),
4871
- satisfaction_list: z73.array(SatisfactionListSchema).optional(),
4872
- total_key: z73.number().optional(),
4873
- total_point: z73.number().optional(),
4874
- average_point: z73.number().optional()
4875
- });
4876
- var QueueSatisfactionSchema = z73.object({
4877
- queue_name: z73.string(),
4878
- queue_num: z73.string(),
4879
- satisfaction_list: z73.array(SatisfactionListSchema).optional(),
4880
- agent_list: z73.array(agentListSchema).optional(),
4881
- total_key: z73.number().optional(),
4882
- total_point: z73.number().optional(),
4883
- average_point: z73.number().optional()
4884
- });
4885
- var QueuePerformanceListSchema = z73.object({
4886
- queue: z73.string(),
4887
- total_calls: z73.number(),
4888
- answered_calls: z73.number(),
4889
- missed_calls: z73.number(),
4890
- abandoned_calls: z73.number(),
4891
- average_waiting_time: z73.number(),
4892
- average_talking_time: z73.number(),
4893
- max_waiting_time: z73.number(),
4894
- answered_rate: z73.number(),
4895
- missed_rate: z73.number(),
4896
- abandoned_rate: z73.number(),
4897
- sla: z73.number()
4898
- });
4899
- var QueueAgentMissCallsListSchema = z73.object({
4900
- agent_name: z73.string(),
4901
- agent_num: z73.string(),
4902
- time: z73.string(),
4903
- total_wait_time: z73.number(),
4904
- src_name: z73.string(),
4905
- src_num: z73.string(),
4906
- queue_status: z73.string(),
4907
- polling_attempts: z73.number(),
4908
- missed_reason: z73.string()
4909
- });
4910
- var QueueAgentInOutCallsListSchema = z73.object({
4911
- agent_name: z73.string(),
4912
- agent_num: z73.string(),
4913
- inbound_calls: z73.number(),
4914
- inbound_duration: z73.number(),
4915
- outbound_calls: z73.number(),
4916
- outbound_duration: z73.number(),
4917
- total_calls: z73.number(),
4918
- total_duration: z73.number(),
4919
- average_talk_duration: z73.number()
4920
- });
4921
- var CallReportModel = z73.object({
4922
- errcode: z73.number(),
4923
- errmsg: z73.string(),
4924
- total_number: z73.number(),
4925
- is_12hour: z73.number().optional(),
4926
- ext_call_statistics_list: z73.array(ExtCallStatisticsListSchema).optional(),
4927
- ext_call_activity_list: z73.array(ExtCallActivityListSchema).optional(),
4928
- trunk_activity_list: z73.array(TrunkActivityListSchema).optional(),
4929
- queue_avg_wait_talk_time_list: z73.array(QueueAvgWaitTalkTimeListSchema).optional(),
5011
+ mobile: z75.string()
5012
+ });
5013
+ var ExtStatisticSchema = z75.object({
5014
+ ext_num: z75.string(),
5015
+ ext_name: z75.string(),
5016
+ answered_calls: z75.number(),
5017
+ no_answer_calls: z75.number(),
5018
+ busy_calls: z75.number(),
5019
+ failed_calls: z75.number(),
5020
+ voicemail_calls: z75.number(),
5021
+ total_holding_time: z75.number(),
5022
+ total_talking_time: z75.number(),
5023
+ time: z75.number(),
5024
+ mobile: z75.string()
5025
+ });
5026
+ var ExtCallActivityListSchema = z75.object({
5027
+ time: z75.number(),
5028
+ answered_calls: z75.number(),
5029
+ no_answer_calls: z75.number(),
5030
+ busy_calls: z75.number(),
5031
+ failed_calls: z75.number(),
5032
+ voicemail_calls: z75.number(),
5033
+ total_holding_time: z75.number(),
5034
+ total_talking_time: z75.number(),
5035
+ ext_statistics: z75.array(ExtStatisticSchema)
5036
+ });
5037
+ var TrunkList = z75.object({
5038
+ trunk_name: z75.string(),
5039
+ total_calls: z75.number()
5040
+ });
5041
+ var TrunkActivityListSchema = z75.object({
5042
+ time: z75.number(),
5043
+ trunk_list: z75.array(TrunkList)
5044
+ });
5045
+ var QueueAvgWaitTalkTimeListSchema = z75.object({
5046
+ time: z75.number(),
5047
+ avg_wait_time: z75.number(),
5048
+ avg_talk_time: z75.number()
5049
+ });
5050
+ var SatisfactionListSchema = z75.object({
5051
+ press_key: z75.string(),
5052
+ total: z75.number(),
5053
+ key_point: z75.number().optional()
5054
+ });
5055
+ var agentListSchema = z75.object({
5056
+ agent_name: z75.string(),
5057
+ agent_num: z75.string(),
5058
+ satisfaction_list: z75.array(SatisfactionListSchema).optional(),
5059
+ total_key: z75.number().optional(),
5060
+ total_point: z75.number().optional(),
5061
+ average_point: z75.number().optional()
5062
+ });
5063
+ var QueueSatisfactionSchema = z75.object({
5064
+ queue_name: z75.string(),
5065
+ queue_num: z75.string(),
5066
+ satisfaction_list: z75.array(SatisfactionListSchema).optional(),
5067
+ agent_list: z75.array(agentListSchema).optional(),
5068
+ total_key: z75.number().optional(),
5069
+ total_point: z75.number().optional(),
5070
+ average_point: z75.number().optional()
5071
+ });
5072
+ var QueuePerformanceListSchema = z75.object({
5073
+ queue: z75.string(),
5074
+ total_calls: z75.number(),
5075
+ answered_calls: z75.number(),
5076
+ missed_calls: z75.number(),
5077
+ abandoned_calls: z75.number(),
5078
+ average_waiting_time: z75.number(),
5079
+ average_talking_time: z75.number(),
5080
+ max_waiting_time: z75.number(),
5081
+ answered_rate: z75.number(),
5082
+ missed_rate: z75.number(),
5083
+ abandoned_rate: z75.number(),
5084
+ sla: z75.number()
5085
+ });
5086
+ var QueueAgentMissCallsListSchema = z75.object({
5087
+ agent_name: z75.string(),
5088
+ agent_num: z75.string(),
5089
+ time: z75.string(),
5090
+ total_wait_time: z75.number(),
5091
+ src_name: z75.string(),
5092
+ src_num: z75.string(),
5093
+ queue_status: z75.string(),
5094
+ polling_attempts: z75.number(),
5095
+ missed_reason: z75.string()
5096
+ });
5097
+ var QueueAgentInOutCallsListSchema = z75.object({
5098
+ agent_name: z75.string(),
5099
+ agent_num: z75.string(),
5100
+ inbound_calls: z75.number(),
5101
+ inbound_duration: z75.number(),
5102
+ outbound_calls: z75.number(),
5103
+ outbound_duration: z75.number(),
5104
+ total_calls: z75.number(),
5105
+ total_duration: z75.number(),
5106
+ average_talk_duration: z75.number()
5107
+ });
5108
+ var CallReportModel = z75.object({
5109
+ errcode: z75.number(),
5110
+ errmsg: z75.string(),
5111
+ total_number: z75.number(),
5112
+ is_12hour: z75.number().optional(),
5113
+ ext_call_statistics_list: z75.array(ExtCallStatisticsListSchema).optional(),
5114
+ ext_call_activity_list: z75.array(ExtCallActivityListSchema).optional(),
5115
+ trunk_activity_list: z75.array(TrunkActivityListSchema).optional(),
5116
+ queue_avg_wait_talk_time_list: z75.array(QueueAvgWaitTalkTimeListSchema).optional(),
4930
5117
  queue_satisfaction: QueueSatisfactionSchema.optional(),
4931
- queue_performance_list: z73.array(QueuePerformanceListSchema).optional(),
4932
- queue_agent_miss_calls_list: z73.array(QueueAgentMissCallsListSchema).optional(),
4933
- queue_agent_in_out_calls_list: z73.array(QueueAgentInOutCallsListSchema).optional(),
4934
- callback_result: z73.string(),
4935
- page: z73.number().optional(),
4936
- pageSize: z73.number().optional()
4937
- });
4938
- var CallReportSchema = z73.object({
4939
- errcode: z73.number(),
4940
- errmsg: z73.string(),
4941
- total_number: z73.number(),
4942
- is_12hour: z73.number().optional(),
4943
- ext_call_statistics_list: z73.array(ExtCallStatisticsListSchema).optional(),
4944
- ext_call_activity_list: z73.array(ExtCallActivityListSchema).optional(),
4945
- trunk_activity_list: z73.array(TrunkActivityListSchema).optional(),
4946
- queue_avg_wait_talk_time_list: z73.array(QueueAvgWaitTalkTimeListSchema).optional(),
5118
+ queue_performance_list: z75.array(QueuePerformanceListSchema).optional(),
5119
+ queue_agent_miss_calls_list: z75.array(QueueAgentMissCallsListSchema).optional(),
5120
+ queue_agent_in_out_calls_list: z75.array(QueueAgentInOutCallsListSchema).optional(),
5121
+ callback_result: z75.string(),
5122
+ page: z75.number().optional(),
5123
+ pageSize: z75.number().optional()
5124
+ });
5125
+ var CallReportSchema = z75.object({
5126
+ errcode: z75.number(),
5127
+ errmsg: z75.string(),
5128
+ total_number: z75.number(),
5129
+ is_12hour: z75.number().optional(),
5130
+ ext_call_statistics_list: z75.array(ExtCallStatisticsListSchema).optional(),
5131
+ ext_call_activity_list: z75.array(ExtCallActivityListSchema).optional(),
5132
+ trunk_activity_list: z75.array(TrunkActivityListSchema).optional(),
5133
+ queue_avg_wait_talk_time_list: z75.array(QueueAvgWaitTalkTimeListSchema).optional(),
4947
5134
  queue_satisfaction: QueueSatisfactionSchema.optional(),
4948
- queue_performance_list: z73.array(QueuePerformanceListSchema).optional(),
4949
- queue_agent_miss_calls_list: z73.array(QueueAgentMissCallsListSchema).optional(),
4950
- queue_agent_in_out_calls_list: z73.array(QueueAgentInOutCallsListSchema).optional(),
4951
- callback_result: z73.string(),
4952
- page: z73.number().optional(),
4953
- pageSize: z73.number().optional()
5135
+ queue_performance_list: z75.array(QueuePerformanceListSchema).optional(),
5136
+ queue_agent_miss_calls_list: z75.array(QueueAgentMissCallsListSchema).optional(),
5137
+ queue_agent_in_out_calls_list: z75.array(QueueAgentInOutCallsListSchema).optional(),
5138
+ callback_result: z75.string(),
5139
+ page: z75.number().optional(),
5140
+ pageSize: z75.number().optional()
4954
5141
  });
4955
5142
 
4956
5143
  // src/telephony-cdr/index.ts
@@ -4963,10 +5150,10 @@ var telephonyCdrContract = initContract28().router(
4963
5150
  query: GetAllTelephonyCdrSchema,
4964
5151
  responses: {
4965
5152
  200: DefaultSuccessResponseSchema.extend({
4966
- total: z74.number(),
4967
- page: z74.number(),
4968
- pageSize: z74.number(),
4969
- telephonyCdrs: z74.array(TelephonyCdrSchema)
5153
+ total: z76.number(),
5154
+ page: z76.number(),
5155
+ pageSize: z76.number(),
5156
+ telephonyCdrs: z76.array(TelephonyCdrSchema)
4970
5157
  }),
4971
5158
  401: DefaultUnauthorizedSchema
4972
5159
  },
@@ -4979,10 +5166,10 @@ var telephonyCdrContract = initContract28().router(
4979
5166
  query: GetAllTelephonyCdrSchema,
4980
5167
  responses: {
4981
5168
  200: DefaultSuccessResponseSchema.extend({
4982
- total: z74.number(),
4983
- page: z74.number(),
4984
- pageSize: z74.number(),
4985
- telephonyCdrs: z74.array(TelephonyCdrSchema)
5169
+ total: z76.number(),
5170
+ page: z76.number(),
5171
+ pageSize: z76.number(),
5172
+ telephonyCdrs: z76.array(TelephonyCdrSchema)
4986
5173
  }),
4987
5174
  401: DefaultUnauthorizedSchema
4988
5175
  },
@@ -4995,10 +5182,10 @@ var telephonyCdrContract = initContract28().router(
4995
5182
  query: GetRecentTelephonyCdrSchema,
4996
5183
  responses: {
4997
5184
  200: DefaultSuccessResponseSchema.extend({
4998
- total: z74.number(),
4999
- page: z74.number(),
5000
- pageSize: z74.number(),
5001
- telephonyCdrs: z74.array(TelephonyCdrSchema)
5185
+ total: z76.number(),
5186
+ page: z76.number(),
5187
+ pageSize: z76.number(),
5188
+ telephonyCdrs: z76.array(TelephonyCdrSchema)
5002
5189
  }),
5003
5190
  401: DefaultUnauthorizedSchema
5004
5191
  },
@@ -5090,35 +5277,35 @@ var telephonyCdrContract = initContract28().router(
5090
5277
 
5091
5278
  // src/telephony-extension/index.ts
5092
5279
  import { initContract as initContract29 } from "@ts-rest/core";
5093
- import z76 from "zod";
5280
+ import z78 from "zod";
5094
5281
 
5095
5282
  // src/telephony-extension/schema.ts
5096
- import z75 from "zod";
5097
- var TelephonyExtensionSchema3 = z75.object({
5098
- errcode: z75.coerce.number(),
5099
- errmsg: z75.string(),
5100
- total_number: z75.coerce.number(),
5101
- data: z75.array(
5102
- z75.object({
5103
- id: z75.coerce.number(),
5104
- online_status: z75.object({
5105
- fx_phone: z75.object({ status: z75.coerce.number() }),
5106
- sip_phone: z75.object({
5107
- status: z75.coerce.number(),
5108
- ext_dev_type: z75.string().optional()
5109
- }),
5110
- linkus_desktop: z75.object({ status: z75.coerce.number() }),
5111
- linkus_mobile: z75.object({ status: z75.coerce.number() }),
5112
- linkus_web: z75.object({
5113
- status: z75.coerce.number(),
5114
- ext_dev_type: z75.string().optional()
5283
+ import z77 from "zod";
5284
+ var TelephonyExtensionSchema3 = z77.object({
5285
+ errcode: z77.coerce.number(),
5286
+ errmsg: z77.string(),
5287
+ total_number: z77.coerce.number(),
5288
+ data: z77.array(
5289
+ z77.object({
5290
+ id: z77.coerce.number(),
5291
+ online_status: z77.object({
5292
+ fx_phone: z77.object({ status: z77.coerce.number() }),
5293
+ sip_phone: z77.object({
5294
+ status: z77.coerce.number(),
5295
+ ext_dev_type: z77.string().optional()
5296
+ }),
5297
+ linkus_desktop: z77.object({ status: z77.coerce.number() }),
5298
+ linkus_mobile: z77.object({ status: z77.coerce.number() }),
5299
+ linkus_web: z77.object({
5300
+ status: z77.coerce.number(),
5301
+ ext_dev_type: z77.string().optional()
5115
5302
  })
5116
5303
  }).optional(),
5117
- presence_status: z75.string().optional(),
5118
- number: z75.string().optional(),
5119
- caller_id_name: z75.string().optional(),
5120
- role_name: z75.string().optional(),
5121
- email_addr: z75.string().optional()
5304
+ presence_status: z77.string().optional(),
5305
+ number: z77.string().optional(),
5306
+ caller_id_name: z77.string().optional(),
5307
+ role_name: z77.string().optional(),
5308
+ email_addr: z77.string().optional()
5122
5309
  })
5123
5310
  )
5124
5311
  });
@@ -5133,8 +5320,8 @@ var telephonyExtensionContract = initContract29().router(
5133
5320
  query: null,
5134
5321
  responses: {
5135
5322
  200: TelephonyExtensionSchema3,
5136
- 400: z76.object({
5137
- message: z76.string()
5323
+ 400: z78.object({
5324
+ message: z78.string()
5138
5325
  }),
5139
5326
  401: DefaultUnauthorizedSchema,
5140
5327
  500: DefaultErrorResponseSchema
@@ -5147,10 +5334,10 @@ var telephonyExtensionContract = initContract29().router(
5147
5334
 
5148
5335
  // src/ticket/index.ts
5149
5336
  import { initContract as initContract30 } from "@ts-rest/core";
5150
- import z78 from "zod";
5337
+ import z80 from "zod";
5151
5338
 
5152
5339
  // src/ticket/validation.ts
5153
- import z77 from "zod";
5340
+ import z79 from "zod";
5154
5341
  var addErrorMessage2 = (field) => {
5155
5342
  return field.refine(
5156
5343
  ({ isRequired, value }) => {
@@ -5168,106 +5355,106 @@ var addErrorMessage2 = (field) => {
5168
5355
  }
5169
5356
  );
5170
5357
  };
5171
- var BaseSchema3 = z77.object({
5172
- isRequired: z77.boolean(),
5173
- attributeId: z77.string()
5358
+ var BaseSchema3 = z79.object({
5359
+ isRequired: z79.boolean(),
5360
+ attributeId: z79.string()
5174
5361
  });
5175
5362
  var SingleValue2 = addErrorMessage2(
5176
5363
  BaseSchema3.extend({
5177
- value: z77.string()
5364
+ value: z79.string()
5178
5365
  })
5179
5366
  );
5180
- var CreateTicketValidationSchema = z77.object({
5367
+ var CreateTicketValidationSchema = z79.object({
5181
5368
  title: SingleValue2,
5182
5369
  description: SingleValue2,
5183
5370
  status: SingleValue2,
5184
5371
  type: SingleValue2,
5185
5372
  priority: SingleValue2,
5186
5373
  contact: SingleValue2,
5187
- assignee: z77.object({
5188
- isRequired: z77.boolean(),
5189
- attributeId: z77.string(),
5190
- value: z77.string()
5374
+ assignee: z79.object({
5375
+ isRequired: z79.boolean(),
5376
+ attributeId: z79.string(),
5377
+ value: z79.string()
5191
5378
  }),
5192
5379
  channel: SingleValue2,
5193
- tags: addErrorMessage2(BaseSchema3.extend({ value: z77.array(z77.string()) })),
5194
- categories: BaseSchema3.extend({ value: z77.array(z77.string()) }),
5195
- customFields: z77.array(
5380
+ tags: addErrorMessage2(BaseSchema3.extend({ value: z79.array(z79.string()) })),
5381
+ categories: BaseSchema3.extend({ value: z79.array(z79.string()) }),
5382
+ customFields: z79.array(
5196
5383
  addErrorMessage2(
5197
5384
  BaseSchema3.extend({
5198
- value: z77.union([z77.string(), z77.array(z77.string())]),
5199
- type: z77.string(),
5200
- isDefaultAttribute: z77.boolean()
5385
+ value: z79.union([z79.string(), z79.array(z79.string())]),
5386
+ type: z79.string(),
5387
+ isDefaultAttribute: z79.boolean()
5201
5388
  })
5202
5389
  )
5203
5390
  ),
5204
- reasonToAssign: z77.object({ value: z77.string() }).optional()
5391
+ reasonToAssign: z79.object({ value: z79.string() }).optional()
5205
5392
  });
5206
5393
  var UpdateTicketValidationSchema = CreateTicketValidationSchema;
5207
- var TicketAttachmentRecordSchema = z77.object({
5208
- bucketName: z77.string(),
5209
- fileKey: z77.string(),
5210
- fileName: z77.string(),
5211
- fileSize: z77.coerce.number(),
5212
- url: z77.string()
5213
- });
5214
- var CreateTicketAttachmentRecordsSchema = z77.object({
5215
- ticketId: z77.string(),
5216
- attributeId: z77.string(),
5217
- ticketAttachmentRecords: z77.array(TicketAttachmentRecordSchema)
5218
- });
5219
- var TicketParamsSchema = z77.object({
5220
- page: z77.coerce.number().default(1),
5221
- pageSize: z77.coerce.number().default(10)
5222
- });
5223
- var CustomFieldQuery = z77.object({
5224
- attributeId: z77.string(),
5225
- type: z77.string(),
5226
- value: z77.union([z77.string(), z77.array(z77.string())])
5227
- });
5228
- var GetAllTicketQuerySchema = z77.object({
5229
- page: z77.string().transform((value) => Number(value)),
5230
- pageSize: z77.string().transform((value) => Number(value)),
5231
- selectedDate: z77.string(),
5232
- keyword: z77.string(),
5233
- title: z77.string(),
5234
- description: z77.string(),
5235
- status: z77.array(z77.string()),
5236
- priority: z77.array(z77.string()),
5237
- channel: z77.array(z77.string()),
5238
- type: z77.array(z77.string()),
5239
- ticketType: z77.array(z77.string()),
5240
- contact: z77.array(z77.string()),
5241
- tags: z77.array(z77.string().uuid()),
5242
- categories: z77.array(z77.string().uuid()),
5243
- assignee: z77.array(z77.string().uuid()),
5244
- customFields: z77.array(
5245
- z77.object({
5246
- attributeId: z77.string().uuid(),
5247
- type: z77.string(),
5248
- value: z77.union([z77.string(), z77.array(z77.string())])
5394
+ var TicketAttachmentRecordSchema = z79.object({
5395
+ bucketName: z79.string(),
5396
+ fileKey: z79.string(),
5397
+ fileName: z79.string(),
5398
+ fileSize: z79.coerce.number(),
5399
+ url: z79.string()
5400
+ });
5401
+ var CreateTicketAttachmentRecordsSchema = z79.object({
5402
+ ticketId: z79.string(),
5403
+ attributeId: z79.string(),
5404
+ ticketAttachmentRecords: z79.array(TicketAttachmentRecordSchema)
5405
+ });
5406
+ var TicketParamsSchema = z79.object({
5407
+ page: z79.coerce.number().default(1),
5408
+ pageSize: z79.coerce.number().default(10)
5409
+ });
5410
+ var CustomFieldQuery = z79.object({
5411
+ attributeId: z79.string(),
5412
+ type: z79.string(),
5413
+ value: z79.union([z79.string(), z79.array(z79.string())])
5414
+ });
5415
+ var GetAllTicketQuerySchema = z79.object({
5416
+ page: z79.string().transform((value) => Number(value)),
5417
+ pageSize: z79.string().transform((value) => Number(value)),
5418
+ selectedDate: z79.string(),
5419
+ keyword: z79.string(),
5420
+ title: z79.string(),
5421
+ description: z79.string(),
5422
+ status: z79.array(z79.string()),
5423
+ priority: z79.array(z79.string()),
5424
+ channel: z79.array(z79.string()),
5425
+ type: z79.array(z79.string()),
5426
+ ticketType: z79.array(z79.string()),
5427
+ contact: z79.array(z79.string()),
5428
+ tags: z79.array(z79.string().uuid()),
5429
+ categories: z79.array(z79.string().uuid()),
5430
+ assignee: z79.array(z79.string().uuid()),
5431
+ customFields: z79.array(
5432
+ z79.object({
5433
+ attributeId: z79.string().uuid(),
5434
+ type: z79.string(),
5435
+ value: z79.union([z79.string(), z79.array(z79.string())])
5249
5436
  })
5250
5437
  )
5251
5438
  }).partial();
5252
- var ExportAllTicketQuerySchema = z77.object({
5253
- agent: z77.array(z77.string()),
5254
- selectedDate: z77.string(),
5255
- keyword: z77.string(),
5256
- title: z77.string(),
5257
- description: z77.string(),
5258
- status: z77.array(z77.string()),
5259
- priority: z77.array(z77.string()),
5260
- channel: z77.array(z77.string()),
5261
- type: z77.array(z77.string()),
5262
- ticketType: z77.array(z77.string()),
5263
- contact: z77.array(z77.string()),
5264
- tags: z77.array(z77.string()),
5265
- categories: z77.array(z77.string()),
5266
- customFields: z77.array(
5267
- z77.object({
5268
- attributeId: z77.string().uuid(),
5269
- type: z77.string(),
5270
- value: z77.union([z77.string(), z77.array(z77.string())])
5439
+ var ExportAllTicketQuerySchema = z79.object({
5440
+ agent: z79.array(z79.string()),
5441
+ selectedDate: z79.string(),
5442
+ keyword: z79.string(),
5443
+ title: z79.string(),
5444
+ description: z79.string(),
5445
+ status: z79.array(z79.string()),
5446
+ priority: z79.array(z79.string()),
5447
+ channel: z79.array(z79.string()),
5448
+ type: z79.array(z79.string()),
5449
+ ticketType: z79.array(z79.string()),
5450
+ contact: z79.array(z79.string()),
5451
+ tags: z79.array(z79.string()),
5452
+ categories: z79.array(z79.string()),
5453
+ customFields: z79.array(
5454
+ z79.object({
5455
+ attributeId: z79.string().uuid(),
5456
+ type: z79.string(),
5457
+ value: z79.union([z79.string(), z79.array(z79.string())])
5271
5458
  })
5272
5459
  )
5273
5460
  }).partial();
@@ -5283,14 +5470,14 @@ var ticketContract = initContract30().router(
5283
5470
  201: DefaultSuccessResponseSchema.extend({
5284
5471
  data: TicketSchema
5285
5472
  }),
5286
- 400: z78.object({
5287
- message: z78.string()
5473
+ 400: z80.object({
5474
+ message: z80.string()
5288
5475
  }),
5289
- 409: z78.object({
5290
- message: z78.string()
5476
+ 409: z80.object({
5477
+ message: z80.string()
5291
5478
  }),
5292
- 500: z78.object({
5293
- message: z78.string()
5479
+ 500: z80.object({
5480
+ message: z80.string()
5294
5481
  }),
5295
5482
  401: DefaultUnauthorizedSchema,
5296
5483
  404: DefaultNotFoundSchema,
@@ -5311,8 +5498,8 @@ var ticketContract = initContract30().router(
5311
5498
  TicketSchema
5312
5499
  )
5313
5500
  }),
5314
- 400: z78.object({
5315
- message: z78.string()
5501
+ 400: z80.object({
5502
+ message: z80.string()
5316
5503
  }),
5317
5504
  401: DefaultUnauthorizedSchema,
5318
5505
  500: DefaultErrorResponseSchema
@@ -5322,14 +5509,14 @@ var ticketContract = initContract30().router(
5322
5509
  getTicketById: {
5323
5510
  method: "GET",
5324
5511
  path: "/:id",
5325
- pathParams: z78.object({ id: z78.string() }),
5512
+ pathParams: z80.object({ id: z80.string() }),
5326
5513
  headers: DefaultHeaderSchema,
5327
5514
  responses: {
5328
5515
  200: DefaultSuccessResponseSchema.extend({
5329
5516
  data: TicketSchema
5330
5517
  }),
5331
- 400: z78.object({
5332
- message: z78.string()
5518
+ 400: z80.object({
5519
+ message: z80.string()
5333
5520
  }),
5334
5521
  401: DefaultUnauthorizedSchema,
5335
5522
  500: DefaultErrorResponseSchema
@@ -5339,15 +5526,15 @@ var ticketContract = initContract30().router(
5339
5526
  getTicketByContactId: {
5340
5527
  method: "GET",
5341
5528
  path: "/contact/:id",
5342
- pathParams: z78.object({ id: z78.string() }),
5529
+ pathParams: z80.object({ id: z80.string() }),
5343
5530
  query: TicketParamsSchema,
5344
5531
  headers: DefaultHeaderSchema,
5345
5532
  responses: {
5346
5533
  200: DefaultSuccessResponseSchema.extend({
5347
5534
  data: WithPagination(TicketSchema)
5348
5535
  }),
5349
- 400: z78.object({
5350
- message: z78.string()
5536
+ 400: z80.object({
5537
+ message: z80.string()
5351
5538
  }),
5352
5539
  401: DefaultUnauthorizedSchema,
5353
5540
  500: DefaultErrorResponseSchema
@@ -5357,21 +5544,21 @@ var ticketContract = initContract30().router(
5357
5544
  updateTicket: {
5358
5545
  method: "PATCH",
5359
5546
  path: "/:id",
5360
- pathParams: z78.object({ id: z78.string() }),
5547
+ pathParams: z80.object({ id: z80.string() }),
5361
5548
  body: UpdateTicketValidationSchema,
5362
5549
  headers: DefaultHeaderSchema,
5363
5550
  responses: {
5364
5551
  201: DefaultSuccessResponseSchema.extend({
5365
5552
  data: TicketSchema
5366
5553
  }),
5367
- 400: z78.object({
5368
- message: z78.string()
5554
+ 400: z80.object({
5555
+ message: z80.string()
5369
5556
  }),
5370
- 409: z78.object({
5371
- message: z78.string()
5557
+ 409: z80.object({
5558
+ message: z80.string()
5372
5559
  }),
5373
- 500: z78.object({
5374
- message: z78.string()
5560
+ 500: z80.object({
5561
+ message: z80.string()
5375
5562
  }),
5376
5563
  401: DefaultUnauthorizedSchema,
5377
5564
  404: DefaultNotFoundSchema,
@@ -5382,11 +5569,11 @@ var ticketContract = initContract30().router(
5382
5569
  deleteTicket: {
5383
5570
  method: "DELETE",
5384
5571
  path: "/:id",
5385
- pathParams: z78.object({ id: z78.string() }),
5572
+ pathParams: z80.object({ id: z80.string() }),
5386
5573
  headers: DefaultHeaderSchema,
5387
5574
  body: null,
5388
5575
  responses: {
5389
- 200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
5576
+ 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5390
5577
  500: DefaultErrorResponseSchema
5391
5578
  },
5392
5579
  summary: "Delete a extension."
@@ -5394,19 +5581,19 @@ var ticketContract = initContract30().router(
5394
5581
  updateDescription: {
5395
5582
  method: "PATCH",
5396
5583
  path: "/description/update/:id",
5397
- pathParams: z78.object({ id: z78.string() }),
5398
- body: z78.object({ description: z78.string() }),
5584
+ pathParams: z80.object({ id: z80.string() }),
5585
+ body: z80.object({ description: z80.string() }),
5399
5586
  headers: DefaultHeaderSchema,
5400
5587
  responses: {
5401
- 201: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
5402
- 400: z78.object({
5403
- message: z78.string()
5588
+ 201: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5589
+ 400: z80.object({
5590
+ message: z80.string()
5404
5591
  }),
5405
- 409: z78.object({
5406
- message: z78.string()
5592
+ 409: z80.object({
5593
+ message: z80.string()
5407
5594
  }),
5408
- 500: z78.object({
5409
- message: z78.string()
5595
+ 500: z80.object({
5596
+ message: z80.string()
5410
5597
  }),
5411
5598
  401: DefaultUnauthorizedSchema,
5412
5599
  404: DefaultNotFoundSchema,
@@ -5417,19 +5604,19 @@ var ticketContract = initContract30().router(
5417
5604
  updateTitle: {
5418
5605
  method: "PATCH",
5419
5606
  path: "/title/update/:id",
5420
- pathParams: z78.object({ id: z78.string() }),
5421
- body: z78.object({ title: z78.string() }),
5607
+ pathParams: z80.object({ id: z80.string() }),
5608
+ body: z80.object({ title: z80.string() }),
5422
5609
  headers: DefaultHeaderSchema,
5423
5610
  responses: {
5424
- 200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
5425
- 400: z78.object({
5426
- message: z78.string()
5611
+ 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5612
+ 400: z80.object({
5613
+ message: z80.string()
5427
5614
  }),
5428
- 409: z78.object({
5429
- message: z78.string()
5615
+ 409: z80.object({
5616
+ message: z80.string()
5430
5617
  }),
5431
- 500: z78.object({
5432
- message: z78.string()
5618
+ 500: z80.object({
5619
+ message: z80.string()
5433
5620
  }),
5434
5621
  401: DefaultUnauthorizedSchema,
5435
5622
  404: DefaultNotFoundSchema,
@@ -5440,19 +5627,19 @@ var ticketContract = initContract30().router(
5440
5627
  updateType: {
5441
5628
  method: "PATCH",
5442
5629
  path: "/type/update/:id",
5443
- pathParams: z78.object({ id: z78.string() }),
5444
- body: z78.object({ type: z78.string() }),
5630
+ pathParams: z80.object({ id: z80.string() }),
5631
+ body: z80.object({ type: z80.string() }),
5445
5632
  headers: DefaultHeaderSchema,
5446
5633
  responses: {
5447
- 200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
5448
- 400: z78.object({
5449
- message: z78.string()
5634
+ 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5635
+ 400: z80.object({
5636
+ message: z80.string()
5450
5637
  }),
5451
- 409: z78.object({
5452
- message: z78.string()
5638
+ 409: z80.object({
5639
+ message: z80.string()
5453
5640
  }),
5454
- 500: z78.object({
5455
- message: z78.string()
5641
+ 500: z80.object({
5642
+ message: z80.string()
5456
5643
  }),
5457
5644
  401: DefaultUnauthorizedSchema,
5458
5645
  404: DefaultNotFoundSchema,
@@ -5463,19 +5650,19 @@ var ticketContract = initContract30().router(
5463
5650
  updateStatus: {
5464
5651
  method: "PATCH",
5465
5652
  path: "/status/update/:id",
5466
- pathParams: z78.object({ id: z78.string() }),
5467
- body: z78.object({ status: z78.string() }),
5653
+ pathParams: z80.object({ id: z80.string() }),
5654
+ body: z80.object({ status: z80.string() }),
5468
5655
  headers: DefaultHeaderSchema,
5469
5656
  responses: {
5470
- 200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
5471
- 400: z78.object({
5472
- message: z78.string()
5657
+ 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5658
+ 400: z80.object({
5659
+ message: z80.string()
5473
5660
  }),
5474
- 409: z78.object({
5475
- message: z78.string()
5661
+ 409: z80.object({
5662
+ message: z80.string()
5476
5663
  }),
5477
- 500: z78.object({
5478
- message: z78.string()
5664
+ 500: z80.object({
5665
+ message: z80.string()
5479
5666
  }),
5480
5667
  401: DefaultUnauthorizedSchema,
5481
5668
  404: DefaultNotFoundSchema,
@@ -5486,19 +5673,19 @@ var ticketContract = initContract30().router(
5486
5673
  updatePriority: {
5487
5674
  method: "PATCH",
5488
5675
  path: "/priority/update/:id",
5489
- pathParams: z78.object({ id: z78.string() }),
5490
- body: z78.object({ priority: z78.string() }),
5676
+ pathParams: z80.object({ id: z80.string() }),
5677
+ body: z80.object({ priority: z80.string() }),
5491
5678
  headers: DefaultHeaderSchema,
5492
5679
  responses: {
5493
- 200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
5494
- 400: z78.object({
5495
- message: z78.string()
5680
+ 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5681
+ 400: z80.object({
5682
+ message: z80.string()
5496
5683
  }),
5497
- 409: z78.object({
5498
- message: z78.string()
5684
+ 409: z80.object({
5685
+ message: z80.string()
5499
5686
  }),
5500
- 500: z78.object({
5501
- message: z78.string()
5687
+ 500: z80.object({
5688
+ message: z80.string()
5502
5689
  }),
5503
5690
  401: DefaultUnauthorizedSchema,
5504
5691
  404: DefaultNotFoundSchema,
@@ -5509,19 +5696,19 @@ var ticketContract = initContract30().router(
5509
5696
  updateChannel: {
5510
5697
  method: "PATCH",
5511
5698
  path: "/channel/update/:id",
5512
- pathParams: z78.object({ id: z78.string() }),
5513
- body: z78.object({ channel: z78.string() }),
5699
+ pathParams: z80.object({ id: z80.string() }),
5700
+ body: z80.object({ channel: z80.string() }),
5514
5701
  headers: DefaultHeaderSchema,
5515
5702
  responses: {
5516
- 200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
5517
- 400: z78.object({
5518
- message: z78.string()
5703
+ 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5704
+ 400: z80.object({
5705
+ message: z80.string()
5519
5706
  }),
5520
- 409: z78.object({
5521
- message: z78.string()
5707
+ 409: z80.object({
5708
+ message: z80.string()
5522
5709
  }),
5523
- 500: z78.object({
5524
- message: z78.string()
5710
+ 500: z80.object({
5711
+ message: z80.string()
5525
5712
  }),
5526
5713
  401: DefaultUnauthorizedSchema,
5527
5714
  404: DefaultNotFoundSchema,
@@ -5532,19 +5719,19 @@ var ticketContract = initContract30().router(
5532
5719
  updateTags: {
5533
5720
  method: "PATCH",
5534
5721
  path: "/tags/update/:id",
5535
- pathParams: z78.object({ id: z78.string() }),
5536
- body: z78.object({ tags: z78.array(z78.string()) }),
5722
+ pathParams: z80.object({ id: z80.string() }),
5723
+ body: z80.object({ tags: z80.array(z80.string()) }),
5537
5724
  headers: DefaultHeaderSchema,
5538
5725
  responses: {
5539
- 200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
5540
- 400: z78.object({
5541
- message: z78.string()
5726
+ 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5727
+ 400: z80.object({
5728
+ message: z80.string()
5542
5729
  }),
5543
- 409: z78.object({
5544
- message: z78.string()
5730
+ 409: z80.object({
5731
+ message: z80.string()
5545
5732
  }),
5546
- 500: z78.object({
5547
- message: z78.string()
5733
+ 500: z80.object({
5734
+ message: z80.string()
5548
5735
  }),
5549
5736
  401: DefaultUnauthorizedSchema,
5550
5737
  404: DefaultNotFoundSchema,
@@ -5555,25 +5742,25 @@ var ticketContract = initContract30().router(
5555
5742
  changeAssignee: {
5556
5743
  method: "PATCH",
5557
5744
  path: "/assignee/update/:id",
5558
- pathParams: z78.object({ id: z78.string() }),
5559
- body: z78.object({
5560
- ticketId: z78.string(),
5561
- assigneeId: z78.string(),
5562
- reason: z78.string().optional()
5745
+ pathParams: z80.object({ id: z80.string() }),
5746
+ body: z80.object({
5747
+ ticketId: z80.string(),
5748
+ assigneeId: z80.string(),
5749
+ reason: z80.string().optional()
5563
5750
  }),
5564
5751
  headers: DefaultHeaderSchema,
5565
5752
  responses: {
5566
5753
  200: DefaultSuccessResponseSchema.extend({
5567
5754
  data: TicketSchema
5568
5755
  }),
5569
- 400: z78.object({
5570
- message: z78.string()
5756
+ 400: z80.object({
5757
+ message: z80.string()
5571
5758
  }),
5572
- 409: z78.object({
5573
- message: z78.string()
5759
+ 409: z80.object({
5760
+ message: z80.string()
5574
5761
  }),
5575
- 500: z78.object({
5576
- message: z78.string()
5762
+ 500: z80.object({
5763
+ message: z80.string()
5577
5764
  }),
5578
5765
  401: DefaultUnauthorizedSchema,
5579
5766
  404: DefaultNotFoundSchema,
@@ -5584,14 +5771,14 @@ var ticketContract = initContract30().router(
5584
5771
  getTicketCountByContact: {
5585
5772
  method: "GET",
5586
5773
  path: "/ticket_count/contact/:id",
5587
- pathParams: z78.object({ id: z78.string() }),
5774
+ pathParams: z80.object({ id: z80.string() }),
5588
5775
  headers: DefaultHeaderSchema,
5589
5776
  responses: {
5590
5777
  200: DefaultSuccessResponseSchema.extend({
5591
5778
  data: TicketCountByContactSchema
5592
5779
  }),
5593
- 400: z78.object({
5594
- message: z78.string()
5780
+ 400: z80.object({
5781
+ message: z80.string()
5595
5782
  }),
5596
5783
  401: DefaultUnauthorizedSchema,
5597
5784
  500: DefaultErrorResponseSchema
@@ -5607,14 +5794,14 @@ var ticketContract = initContract30().router(
5607
5794
  201: DefaultSuccessResponseSchema.extend({
5608
5795
  data: TicketCustomFieldSchema
5609
5796
  }),
5610
- 400: z78.object({
5611
- message: z78.string()
5797
+ 400: z80.object({
5798
+ message: z80.string()
5612
5799
  }),
5613
- 409: z78.object({
5614
- message: z78.string()
5800
+ 409: z80.object({
5801
+ message: z80.string()
5615
5802
  }),
5616
- 500: z78.object({
5617
- message: z78.string()
5803
+ 500: z80.object({
5804
+ message: z80.string()
5618
5805
  }),
5619
5806
  401: DefaultUnauthorizedSchema,
5620
5807
  404: DefaultNotFoundSchema,
@@ -5639,21 +5826,21 @@ var ticketContract = initContract30().router(
5639
5826
 
5640
5827
  // src/user/index.ts
5641
5828
  import { initContract as initContract31 } from "@ts-rest/core";
5642
- import z80 from "zod";
5829
+ import z82 from "zod";
5643
5830
 
5644
5831
  // src/user/validation.ts
5645
- import { z as z79 } from "zod";
5646
- var CreateUserSchema = z79.object({
5647
- name: z79.string(),
5648
- email: z79.string().email(),
5649
- address: z79.string().nullable(),
5650
- phone: z79.string().nullable(),
5651
- password: z79.string(),
5652
- notificationCount: z79.number().nullable().optional(),
5653
- roles: z79.array(z79.string())
5832
+ import { z as z81 } from "zod";
5833
+ var CreateUserSchema = z81.object({
5834
+ name: z81.string(),
5835
+ email: z81.string().email(),
5836
+ address: z81.string().nullable(),
5837
+ phone: z81.string().nullable(),
5838
+ password: z81.string(),
5839
+ notificationCount: z81.number().nullable().optional(),
5840
+ roles: z81.array(z81.string())
5654
5841
  });
5655
5842
  var UpdateUserSchema = CreateUserSchema.extend({
5656
- newPassword: z79.string()
5843
+ newPassword: z81.string()
5657
5844
  });
5658
5845
 
5659
5846
  // src/user/index.ts
@@ -5668,8 +5855,8 @@ var userContract = initContract31().router(
5668
5855
  201: DefaultSuccessResponseSchema.extend({
5669
5856
  user: UserSchema
5670
5857
  }),
5671
- 400: z80.object({
5672
- message: z80.string()
5858
+ 400: z82.object({
5859
+ message: z82.string()
5673
5860
  }),
5674
5861
  401: DefaultUnauthorizedSchema
5675
5862
  },
@@ -5679,16 +5866,16 @@ var userContract = initContract31().router(
5679
5866
  method: "GET",
5680
5867
  path: "",
5681
5868
  headers: DefaultHeaderSchema,
5682
- query: z80.object({
5683
- page: z80.coerce.number().optional(),
5684
- pageSize: z80.coerce.number().optional(),
5869
+ query: z82.object({
5870
+ page: z82.coerce.number().optional(),
5871
+ pageSize: z82.coerce.number().optional(),
5685
5872
  // Don't add default 10. In some places, we need to fetch all users.
5686
- keyword: z80.string().optional()
5873
+ keyword: z82.string().optional()
5687
5874
  }).optional(),
5688
5875
  responses: {
5689
5876
  200: WithPagination(UserSchema),
5690
- 400: z80.object({
5691
- message: z80.string()
5877
+ 400: z82.object({
5878
+ message: z82.string()
5692
5879
  }),
5693
5880
  401: DefaultUnauthorizedSchema,
5694
5881
  500: DefaultErrorResponseSchema
@@ -5698,12 +5885,12 @@ var userContract = initContract31().router(
5698
5885
  getUserById: {
5699
5886
  method: "GET",
5700
5887
  path: "/:id",
5701
- pathParams: z80.object({ id: z80.string() }),
5888
+ pathParams: z82.object({ id: z82.string() }),
5702
5889
  headers: DefaultHeaderSchema,
5703
5890
  responses: {
5704
5891
  200: UserSchema,
5705
- 400: z80.object({
5706
- message: z80.string()
5892
+ 400: z82.object({
5893
+ message: z82.string()
5707
5894
  }),
5708
5895
  401: DefaultUnauthorizedSchema
5709
5896
  },
@@ -5712,15 +5899,15 @@ var userContract = initContract31().router(
5712
5899
  updateUser: {
5713
5900
  method: "PATCH",
5714
5901
  path: "/:id",
5715
- pathParams: z80.object({ id: z80.string() }),
5902
+ pathParams: z82.object({ id: z82.string() }),
5716
5903
  headers: DefaultHeaderSchema,
5717
5904
  body: UpdateUserSchema,
5718
5905
  responses: {
5719
5906
  201: DefaultSuccessResponseSchema.extend({
5720
5907
  role: UserSchema
5721
5908
  }),
5722
- 400: z80.object({
5723
- message: z80.string()
5909
+ 400: z82.object({
5910
+ message: z82.string()
5724
5911
  }),
5725
5912
  401: DefaultUnauthorizedSchema
5726
5913
  },
@@ -5729,11 +5916,11 @@ var userContract = initContract31().router(
5729
5916
  deleteUser: {
5730
5917
  method: "DELETE",
5731
5918
  path: "/:id",
5732
- pathParams: z80.object({ id: z80.string() }),
5919
+ pathParams: z82.object({ id: z82.string() }),
5733
5920
  headers: DefaultHeaderSchema,
5734
5921
  body: null,
5735
5922
  responses: {
5736
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5923
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5737
5924
  500: DefaultErrorResponseSchema
5738
5925
  },
5739
5926
  summary: "Delete a user."
@@ -5744,26 +5931,26 @@ var userContract = initContract31().router(
5744
5931
 
5745
5932
  // src/user-presence-status-log/index.ts
5746
5933
  import { initContract as initContract32 } from "@ts-rest/core";
5747
- import z83 from "zod";
5934
+ import z85 from "zod";
5748
5935
 
5749
5936
  // src/user-presence-status-log/schema.ts
5750
- import z81 from "zod";
5937
+ import z83 from "zod";
5751
5938
  var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
5752
5939
  user: UserSchema,
5753
5940
  previousPresenceStatus: PresenceStatusSchema,
5754
5941
  newPresenceStatus: PresenceStatusSchema,
5755
- reason: z81.string()
5942
+ reason: z83.string()
5756
5943
  });
5757
5944
 
5758
5945
  // src/user-presence-status-log/validation.ts
5759
- import z82 from "zod";
5760
- var UserPresenceStatusLogParamsSchema = z82.object({
5761
- page: z82.coerce.number().default(1),
5762
- pageSize: z82.coerce.number().default(10),
5763
- selectedDate: z82.string().optional()
5946
+ import z84 from "zod";
5947
+ var UserPresenceStatusLogParamsSchema = z84.object({
5948
+ page: z84.coerce.number().default(1),
5949
+ pageSize: z84.coerce.number().default(10),
5950
+ selectedDate: z84.string().optional()
5764
5951
  }).optional();
5765
- var UserPresenceStatusLogExportParamsSchema = z82.object({
5766
- selectedDate: z82.string().optional()
5952
+ var UserPresenceStatusLogExportParamsSchema = z84.object({
5953
+ selectedDate: z84.string().optional()
5767
5954
  });
5768
5955
 
5769
5956
  // src/user-presence-status-log/index.ts
@@ -5776,8 +5963,8 @@ var userPresenceStatusLogContract = initContract32().router(
5776
5963
  headers: DefaultHeaderSchema,
5777
5964
  responses: {
5778
5965
  200: WithPagination(UserPresenceStatusLogSchema),
5779
- 400: z83.object({
5780
- message: z83.string()
5966
+ 400: z85.object({
5967
+ message: z85.string()
5781
5968
  }),
5782
5969
  401: DefaultUnauthorizedSchema,
5783
5970
  500: DefaultErrorResponseSchema
@@ -5791,8 +5978,8 @@ var userPresenceStatusLogContract = initContract32().router(
5791
5978
  headers: DefaultHeaderSchema,
5792
5979
  responses: {
5793
5980
  200: null,
5794
- 400: z83.object({
5795
- message: z83.string()
5981
+ 400: z85.object({
5982
+ message: z85.string()
5796
5983
  }),
5797
5984
  401: DefaultUnauthorizedSchema,
5798
5985
  500: DefaultErrorResponseSchema
@@ -5804,44 +5991,44 @@ var userPresenceStatusLogContract = initContract32().router(
5804
5991
 
5805
5992
  // src/widget/index.ts
5806
5993
  import { initContract as initContract33 } from "@ts-rest/core";
5807
- import z86 from "zod";
5994
+ import z88 from "zod";
5808
5995
 
5809
5996
  // src/widget/schema.ts
5810
- import z84 from "zod";
5811
- var FieldsSchema = z84.object({ data: z84.array(z84.string()) });
5812
- var WidgetPositionSchema = z84.union([
5813
- z84.literal("menu"),
5814
- z84.literal("ticket_detail"),
5815
- z84.literal("contact_detail")
5997
+ import z86 from "zod";
5998
+ var FieldsSchema = z86.object({ data: z86.array(z86.string()) });
5999
+ var WidgetPositionSchema = z86.union([
6000
+ z86.literal("menu"),
6001
+ z86.literal("ticket_detail"),
6002
+ z86.literal("contact_detail")
5816
6003
  ]);
5817
6004
  var WidgetSchema = DefaultEntitySchema.extend({
5818
- name: z84.string(),
5819
- description: z84.string().nullable(),
6005
+ name: z86.string(),
6006
+ description: z86.string().nullable(),
5820
6007
  position: WidgetPositionSchema.nullable(),
5821
6008
  fields: FieldsSchema,
5822
- url: z84.string()
6009
+ url: z86.string()
5823
6010
  });
5824
6011
 
5825
6012
  // src/widget/validation.ts
5826
- import z85 from "zod";
5827
- var CreateWidgetSchema = z85.object({
5828
- name: z85.string(),
5829
- description: z85.string(),
5830
- url: z85.string(),
6013
+ import z87 from "zod";
6014
+ var CreateWidgetSchema = z87.object({
6015
+ name: z87.string(),
6016
+ description: z87.string(),
6017
+ url: z87.string(),
5831
6018
  position: WidgetPositionSchema,
5832
- fields: z85.object({
6019
+ fields: z87.object({
5833
6020
  data: (
5834
6021
  // Array of attribute system names
5835
- z85.array(z85.string())
6022
+ z87.array(z87.string())
5836
6023
  )
5837
6024
  }).optional()
5838
6025
  });
5839
6026
  var UpdateWidgetSchema = CreateWidgetSchema;
5840
- var GetWidgetUrlPathQuerySchema = z85.object({
5841
- widgetId: z85.string(),
6027
+ var GetWidgetUrlPathQuerySchema = z87.object({
6028
+ widgetId: z87.string(),
5842
6029
  // Position ID is ticket ID, contact ID, etc.
5843
6030
  // TODO: The name "Position ID" is confusing. Think of a better name.
5844
- positionId: z85.string()
6031
+ positionId: z87.string()
5845
6032
  });
5846
6033
 
5847
6034
  // src/widget/index.ts
@@ -5856,8 +6043,8 @@ var widgetContract = initContract33().router(
5856
6043
  201: DefaultSuccessResponseSchema.extend({
5857
6044
  widget: WidgetSchema
5858
6045
  }),
5859
- 400: z86.object({
5860
- message: z86.string()
6046
+ 400: z88.object({
6047
+ message: z88.string()
5861
6048
  }),
5862
6049
  401: DefaultUnauthorizedSchema,
5863
6050
  500: DefaultErrorResponseSchema
@@ -5867,17 +6054,17 @@ var widgetContract = initContract33().router(
5867
6054
  getWidgets: {
5868
6055
  method: "GET",
5869
6056
  path: "",
5870
- query: z86.object({
5871
- page: z86.coerce.number().default(1),
5872
- pageSize: z86.coerce.number().default(10),
5873
- keyword: z86.coerce.string().optional()
6057
+ query: z88.object({
6058
+ page: z88.coerce.number().default(1),
6059
+ pageSize: z88.coerce.number().default(10),
6060
+ keyword: z88.coerce.string().optional()
5874
6061
  }).optional(),
5875
6062
  headers: DefaultHeaderSchema,
5876
6063
  responses: {
5877
6064
  200: WithPagination(WidgetSchema),
5878
6065
  500: DefaultErrorResponseSchema,
5879
- 400: z86.object({
5880
- message: z86.string()
6066
+ 400: z88.object({
6067
+ message: z88.string()
5881
6068
  }),
5882
6069
  401: DefaultUnauthorizedSchema
5883
6070
  },
@@ -5888,9 +6075,9 @@ var widgetContract = initContract33().router(
5888
6075
  path: "/menu",
5889
6076
  headers: DefaultHeaderSchema,
5890
6077
  responses: {
5891
- 200: z86.array(WidgetSchema),
5892
- 400: z86.object({
5893
- message: z86.string()
6078
+ 200: z88.array(WidgetSchema),
6079
+ 400: z88.object({
6080
+ message: z88.string()
5894
6081
  }),
5895
6082
  401: DefaultUnauthorizedSchema,
5896
6083
  500: DefaultErrorResponseSchema
@@ -5902,9 +6089,9 @@ var widgetContract = initContract33().router(
5902
6089
  path: "/ticket_detail",
5903
6090
  headers: DefaultHeaderSchema,
5904
6091
  responses: {
5905
- 200: z86.array(WidgetSchema),
5906
- 400: z86.object({
5907
- message: z86.string()
6092
+ 200: z88.array(WidgetSchema),
6093
+ 400: z88.object({
6094
+ message: z88.string()
5908
6095
  }),
5909
6096
  401: DefaultUnauthorizedSchema,
5910
6097
  500: DefaultErrorResponseSchema
@@ -5916,9 +6103,9 @@ var widgetContract = initContract33().router(
5916
6103
  path: "/contact_detail",
5917
6104
  headers: DefaultHeaderSchema,
5918
6105
  responses: {
5919
- 200: z86.array(WidgetSchema),
5920
- 400: z86.object({
5921
- message: z86.string()
6106
+ 200: z88.array(WidgetSchema),
6107
+ 400: z88.object({
6108
+ message: z88.string()
5922
6109
  }),
5923
6110
  401: DefaultUnauthorizedSchema,
5924
6111
  500: DefaultErrorResponseSchema
@@ -5928,12 +6115,12 @@ var widgetContract = initContract33().router(
5928
6115
  getWidgetById: {
5929
6116
  method: "GET",
5930
6117
  path: "/:id",
5931
- pathParams: z86.object({ id: z86.string() }),
6118
+ pathParams: z88.object({ id: z88.string() }),
5932
6119
  headers: DefaultHeaderSchema,
5933
6120
  responses: {
5934
6121
  200: WidgetSchema,
5935
- 400: z86.object({
5936
- message: z86.string()
6122
+ 400: z88.object({
6123
+ message: z88.string()
5937
6124
  }),
5938
6125
  401: DefaultUnauthorizedSchema,
5939
6126
  500: DefaultErrorResponseSchema
@@ -5947,10 +6134,10 @@ var widgetContract = initContract33().router(
5947
6134
  headers: DefaultHeaderSchema,
5948
6135
  responses: {
5949
6136
  201: DefaultSuccessResponseSchema.extend({
5950
- url: z86.string()
6137
+ url: z88.string()
5951
6138
  }),
5952
- 400: z86.object({
5953
- message: z86.string()
6139
+ 400: z88.object({
6140
+ message: z88.string()
5954
6141
  }),
5955
6142
  401: DefaultUnauthorizedSchema
5956
6143
  },
@@ -5959,14 +6146,14 @@ var widgetContract = initContract33().router(
5959
6146
  updateWidget: {
5960
6147
  method: "PATCH",
5961
6148
  path: "/:id",
5962
- pathParams: z86.object({ id: z86.string() }),
6149
+ pathParams: z88.object({ id: z88.string() }),
5963
6150
  headers: DefaultHeaderSchema,
5964
6151
  responses: {
5965
6152
  201: DefaultSuccessResponseSchema.extend({
5966
6153
  widget: WidgetSchema
5967
6154
  }),
5968
- 400: z86.object({
5969
- message: z86.string()
6155
+ 400: z88.object({
6156
+ message: z88.string()
5970
6157
  }),
5971
6158
  401: DefaultUnauthorizedSchema
5972
6159
  },
@@ -5976,11 +6163,11 @@ var widgetContract = initContract33().router(
5976
6163
  deleteWidget: {
5977
6164
  method: "DELETE",
5978
6165
  path: "/:id",
5979
- pathParams: z86.object({ id: z86.string() }),
6166
+ pathParams: z88.object({ id: z88.string() }),
5980
6167
  headers: DefaultHeaderSchema,
5981
6168
  body: null,
5982
6169
  responses: {
5983
- 200: DefaultSuccessResponseSchema.extend({ message: z86.string() }),
6170
+ 200: DefaultSuccessResponseSchema.extend({ message: z88.string() }),
5984
6171
  500: DefaultErrorResponseSchema
5985
6172
  },
5986
6173
  summary: "Delete a widget."
@@ -5991,24 +6178,24 @@ var widgetContract = initContract33().router(
5991
6178
 
5992
6179
  // src/wrap-up-form/index.ts
5993
6180
  import { initContract as initContract34 } from "@ts-rest/core";
5994
- import z88 from "zod";
6181
+ import z90 from "zod";
5995
6182
 
5996
6183
  // src/wrap-up-form/validation.ts
5997
- import { z as z87 } from "zod";
5998
- var CreateWrapUpFormSchema = z87.object({
5999
- note: z87.string().nullable().optional(),
6000
- disposition: z87.string().nullable().optional(),
6001
- callFrom: z87.string().nullable().optional(),
6002
- callTo: z87.string().nullable().optional()
6184
+ import { z as z89 } from "zod";
6185
+ var CreateWrapUpFormSchema = z89.object({
6186
+ note: z89.string().nullable().optional(),
6187
+ disposition: z89.string().nullable().optional(),
6188
+ callFrom: z89.string().nullable().optional(),
6189
+ callTo: z89.string().nullable().optional()
6003
6190
  });
6004
6191
  var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
6005
- tags: z87.array(z87.string()).optional()
6192
+ tags: z89.array(z89.string()).optional()
6006
6193
  });
6007
- var CreateCXLogWrapUpFormSchema = z87.object({
6008
- cxLogId: z87.string().uuid(),
6009
- disposition: z87.string().optional(),
6010
- tagIds: z87.array(z87.string().uuid()).optional(),
6011
- note: z87.string().optional()
6194
+ var CreateCXLogWrapUpFormSchema = z89.object({
6195
+ cxLogId: z89.string().uuid(),
6196
+ disposition: z89.string().optional(),
6197
+ tagIds: z89.array(z89.string().uuid()).optional(),
6198
+ note: z89.string().optional()
6012
6199
  });
6013
6200
 
6014
6201
  // src/wrap-up-form/index.ts
@@ -6023,8 +6210,8 @@ var wrapUpFormContract = initContract34().router(
6023
6210
  201: DefaultSuccessResponseSchema.extend({
6024
6211
  wrapUpForm: WrapUpFormSchema
6025
6212
  }),
6026
- 400: z88.object({
6027
- message: z88.string()
6213
+ 400: z90.object({
6214
+ message: z90.string()
6028
6215
  }),
6029
6216
  401: DefaultUnauthorizedSchema,
6030
6217
  500: DefaultErrorResponseSchema
@@ -6046,15 +6233,15 @@ var wrapUpFormContract = initContract34().router(
6046
6233
  getWrapUpForms: {
6047
6234
  method: "GET",
6048
6235
  path: "",
6049
- query: z88.object({
6050
- page: z88.coerce.number().default(1),
6051
- pageSize: z88.coerce.number().default(10)
6236
+ query: z90.object({
6237
+ page: z90.coerce.number().default(1),
6238
+ pageSize: z90.coerce.number().default(10)
6052
6239
  }).optional(),
6053
6240
  headers: DefaultHeaderSchema,
6054
6241
  responses: {
6055
6242
  200: WithPagination(WrapUpFormSchema),
6056
- 400: z88.object({
6057
- message: z88.string()
6243
+ 400: z90.object({
6244
+ message: z90.string()
6058
6245
  }),
6059
6246
  401: DefaultUnauthorizedSchema,
6060
6247
  500: DefaultErrorResponseSchema
@@ -6064,15 +6251,15 @@ var wrapUpFormContract = initContract34().router(
6064
6251
  updateWrapUpForm: {
6065
6252
  method: "PATCH",
6066
6253
  path: "/:id",
6067
- pathParams: z88.object({ id: z88.string() }),
6254
+ pathParams: z90.object({ id: z90.string() }),
6068
6255
  headers: DefaultHeaderSchema,
6069
6256
  body: UpdateWrapUpFormSchema,
6070
6257
  responses: {
6071
6258
  201: DefaultSuccessResponseSchema.extend({
6072
6259
  wrapUpForm: WrapUpFormSchema
6073
6260
  }),
6074
- 400: z88.object({
6075
- message: z88.string()
6261
+ 400: z90.object({
6262
+ message: z90.string()
6076
6263
  }),
6077
6264
  401: DefaultUnauthorizedSchema,
6078
6265
  500: DefaultErrorResponseSchema
@@ -6085,28 +6272,28 @@ var wrapUpFormContract = initContract34().router(
6085
6272
 
6086
6273
  // src/upload/index.ts
6087
6274
  import { initContract as initContract35 } from "@ts-rest/core";
6088
- import z89 from "zod";
6275
+ import z91 from "zod";
6089
6276
  var uploadContract = initContract35().router(
6090
6277
  {
6091
6278
  rename: {
6092
6279
  method: "POST",
6093
6280
  path: "/:id/rename",
6094
- pathParams: z89.object({
6095
- id: z89.string()
6281
+ pathParams: z91.object({
6282
+ id: z91.string()
6096
6283
  }),
6097
6284
  headers: DefaultHeaderSchema,
6098
6285
  responses: {
6099
6286
  201: DefaultSuccessResponseSchema.extend({
6100
- message: z89.string()
6287
+ message: z91.string()
6101
6288
  }),
6102
- 400: z89.object({
6103
- message: z89.string()
6289
+ 400: z91.object({
6290
+ message: z91.string()
6104
6291
  }),
6105
- 409: z89.object({
6106
- message: z89.string()
6292
+ 409: z91.object({
6293
+ message: z91.string()
6107
6294
  }),
6108
- 500: z89.object({
6109
- message: z89.string()
6295
+ 500: z91.object({
6296
+ message: z91.string()
6110
6297
  }),
6111
6298
  401: DefaultUnauthorizedSchema,
6112
6299
  404: DefaultNotFoundSchema,
@@ -6118,23 +6305,23 @@ var uploadContract = initContract35().router(
6118
6305
  delete: {
6119
6306
  method: "DELETE",
6120
6307
  path: "/:id",
6121
- pathParams: z89.object({
6122
- id: z89.string()
6308
+ pathParams: z91.object({
6309
+ id: z91.string()
6123
6310
  }),
6124
6311
  headers: DefaultHeaderSchema,
6125
6312
  body: null,
6126
6313
  responses: {
6127
6314
  201: DefaultSuccessResponseSchema.extend({
6128
- message: z89.string()
6315
+ message: z91.string()
6129
6316
  }),
6130
- 400: z89.object({
6131
- message: z89.string()
6317
+ 400: z91.object({
6318
+ message: z91.string()
6132
6319
  }),
6133
- 409: z89.object({
6134
- message: z89.string()
6320
+ 409: z91.object({
6321
+ message: z91.string()
6135
6322
  }),
6136
- 500: z89.object({
6137
- message: z89.string()
6323
+ 500: z91.object({
6324
+ message: z91.string()
6138
6325
  }),
6139
6326
  401: DefaultUnauthorizedSchema,
6140
6327
  404: DefaultNotFoundSchema,
@@ -6149,19 +6336,19 @@ var uploadContract = initContract35().router(
6149
6336
  );
6150
6337
 
6151
6338
  // src/viber/index.ts
6152
- import z91 from "zod";
6339
+ import z93 from "zod";
6153
6340
 
6154
6341
  // src/viber/validation.ts
6155
- import z90 from "zod";
6156
- var ViberChannelSchema = z90.object({
6157
- name: z90.string(),
6158
- accessToken: z90.string(),
6159
- actor: z90.object({
6160
- id: z90.string().uuid(),
6161
- name: z90.string(),
6162
- email: z90.string().email(),
6163
- address: z90.string().nullable(),
6164
- phone: z90.string().nullable()
6342
+ import z92 from "zod";
6343
+ var ViberChannelSchema = z92.object({
6344
+ name: z92.string(),
6345
+ accessToken: z92.string(),
6346
+ actor: z92.object({
6347
+ id: z92.string().uuid(),
6348
+ name: z92.string(),
6349
+ email: z92.string().email(),
6350
+ address: z92.string().nullable(),
6351
+ phone: z92.string().nullable()
6165
6352
  }).optional()
6166
6353
  });
6167
6354
 
@@ -6175,10 +6362,11 @@ var viberContract = initContract36().router({
6175
6362
  200: DefaultSuccessResponseSchema.extend({
6176
6363
  channel: ChannelSchema
6177
6364
  }),
6178
- 400: DefaultErrorResponseSchema
6365
+ 400: DefaultErrorResponseSchema,
6366
+ 408: DefaultErrorResponseSchema
6179
6367
  },
6180
6368
  body: ViberChannelSchema,
6181
- summary: "Connect message channel"
6369
+ summary: "Connect viber channel"
6182
6370
  },
6183
6371
  disconnect: {
6184
6372
  method: "POST",
@@ -6189,10 +6377,10 @@ var viberContract = initContract36().router({
6189
6377
  }),
6190
6378
  400: DefaultErrorResponseSchema
6191
6379
  },
6192
- body: z91.object({
6193
- id: z91.string().uuid()
6380
+ body: z93.object({
6381
+ id: z93.string().uuid()
6194
6382
  }),
6195
- summary: "Connect message channel"
6383
+ summary: "Connect viber channel"
6196
6384
  },
6197
6385
  sendMessage: {
6198
6386
  method: "POST",
@@ -6202,11 +6390,170 @@ var viberContract = initContract36().router({
6202
6390
  200: SendMessageResponseSchema,
6203
6391
  500: DefaultErrorResponseSchema
6204
6392
  }
6393
+ },
6394
+ reconnect: {
6395
+ method: "POST",
6396
+ path: "/reconnect/:channelId",
6397
+ pathParams: z93.object({
6398
+ channelId: z93.string().uuid()
6399
+ }),
6400
+ responses: {
6401
+ 200: DefaultSuccessResponseSchema.extend({
6402
+ channel: ChannelSchema
6403
+ }),
6404
+ 500: DefaultErrorResponseSchema,
6405
+ 400: DefaultErrorResponseSchema
6406
+ },
6407
+ body: null,
6408
+ summary: "Reconnect viber channel"
6409
+ },
6410
+ delete: {
6411
+ method: "DELETE",
6412
+ path: "/delete/:channelId",
6413
+ pathParams: z93.object({
6414
+ channelId: z93.string().uuid()
6415
+ }),
6416
+ body: null,
6417
+ responses: {
6418
+ 200: ChannelServiceResponseSchema,
6419
+ 500: DefaultErrorResponseSchema,
6420
+ 400: DefaultErrorResponseSchema
6421
+ }
6205
6422
  }
6206
6423
  });
6207
6424
 
6425
+ // src/notification/index.ts
6426
+ import { initContract as initContract37 } from "@ts-rest/core";
6427
+ import z96 from "zod";
6428
+
6429
+ // src/notification/validation.ts
6430
+ import z95 from "zod";
6431
+
6432
+ // src/notification/schema.ts
6433
+ import z94 from "zod";
6434
+ var NotificationObjectSchema = z94.object({
6435
+ data: z94.string()
6436
+ });
6437
+ var NotificationChangeSchema = z94.object({
6438
+ actorId: z94.string().uuid(),
6439
+ notificationObjectId: z94.string().uuid(),
6440
+ readAt: z94.date()
6441
+ });
6442
+ var NotificationSchema = z94.object({
6443
+ notificationObjectId: z94.string().uuid(),
6444
+ notifierId: z94.string().uuid(),
6445
+ notificationObject: NotificationObjectSchema,
6446
+ readAt: z94.date()
6447
+ });
6448
+
6449
+ // src/notification/validation.ts
6450
+ var GetNotificationsRequestSchema = z95.object({
6451
+ page: z95.coerce.number().default(1),
6452
+ pageSize: z95.coerce.number().default(10)
6453
+ });
6454
+ var GetNotificationsResponseSchema = z95.object({
6455
+ notificationCount: z95.number(),
6456
+ notifications: z95.object({
6457
+ data: z95.array(NotificationSchema),
6458
+ total: z95.number(),
6459
+ page: z95.number(),
6460
+ pageSize: z95.number(),
6461
+ lastPage: z95.number(),
6462
+ totalUnreadCount: z95.number().optional(),
6463
+ unreadRoomCount: z95.number().optional(),
6464
+ unreadCountsByAssigneeList: z95.array(
6465
+ z95.object({
6466
+ assigneeId: z95.string().optional(),
6467
+ totalUnreadCount: z95.string().optional()
6468
+ })
6469
+ )
6470
+ })
6471
+ });
6472
+ var ResetNotificationRequestSchema = z95.object({
6473
+ userId: z95.string()
6474
+ });
6475
+
6476
+ // src/notification/index.ts
6477
+ var userNotificationContract = initContract37().router(
6478
+ {
6479
+ getNotifications: {
6480
+ method: "GET",
6481
+ path: "",
6482
+ query: GetNotificationsRequestSchema,
6483
+ responses: {
6484
+ 201: DefaultSuccessResponseSchema.extend({
6485
+ GetNotificationsResponseSchema
6486
+ }),
6487
+ 400: z96.object({
6488
+ message: z96.string()
6489
+ }),
6490
+ 409: z96.object({
6491
+ message: z96.string()
6492
+ }),
6493
+ 500: z96.object({
6494
+ message: z96.string()
6495
+ }),
6496
+ 401: DefaultUnauthorizedSchema,
6497
+ 404: DefaultNotFoundSchema,
6498
+ 422: DefaultUnprocessibleSchema
6499
+ },
6500
+ summary: "Get user's notification"
6501
+ },
6502
+ resetNotifications: {
6503
+ method: "POST",
6504
+ path: "/reset",
6505
+ responses: {
6506
+ 201: DefaultSuccessResponseSchema.extend({
6507
+ data: UserSchema
6508
+ }),
6509
+ 400: z96.object({
6510
+ message: z96.string()
6511
+ }),
6512
+ 409: z96.object({
6513
+ message: z96.string()
6514
+ }),
6515
+ 500: z96.object({
6516
+ message: z96.string()
6517
+ }),
6518
+ 401: DefaultUnauthorizedSchema,
6519
+ 404: DefaultNotFoundSchema,
6520
+ 422: DefaultUnprocessibleSchema
6521
+ },
6522
+ body: ResetNotificationRequestSchema,
6523
+ summary: "Reset notification count to zero"
6524
+ },
6525
+ readNotification: {
6526
+ method: "POST",
6527
+ path: "/read/:id",
6528
+ pathParams: z96.object({ id: z96.string() }),
6529
+ responses: {
6530
+ 201: DefaultSuccessResponseSchema.extend({
6531
+ data: NotificationSchema
6532
+ }),
6533
+ 400: z96.object({
6534
+ message: z96.string()
6535
+ }),
6536
+ 409: z96.object({
6537
+ message: z96.string()
6538
+ }),
6539
+ 500: z96.object({
6540
+ message: z96.string()
6541
+ }),
6542
+ 401: DefaultUnauthorizedSchema,
6543
+ 404: DefaultNotFoundSchema,
6544
+ 422: DefaultUnprocessibleSchema
6545
+ },
6546
+ body: ResetNotificationRequestSchema,
6547
+ summary: "Mark a notification as read"
6548
+ }
6549
+ },
6550
+ {
6551
+ pathPrefix: "notification"
6552
+ }
6553
+ );
6554
+
6208
6555
  // src/contract.ts
6209
- var apiContract = initContract37().router({
6556
+ var apiContract = initContract38().router({
6210
6557
  auth: authContract,
6211
6558
  mail: mailContract,
6212
6559
  cxLog: cxLogContract,
@@ -6225,33 +6572,38 @@ var apiContract = initContract37().router({
6225
6572
  aws: awsContract,
6226
6573
  agentPresenceStatus: telephonyAgentPresenceStatusContract,
6227
6574
  userPresenceStatusLog: userPresenceStatusLogContract,
6228
- contact: contactContract,
6229
6575
  company: companyContract,
6230
6576
  evaluateForm: evaluateFormContract,
6231
6577
  upload: uploadContract
6232
6578
  });
6233
- var ticketContract2 = initContract37().router({
6579
+ var contactContract2 = initContract38().router({
6580
+ contact: contactContract
6581
+ });
6582
+ var ticketContract2 = initContract38().router({
6234
6583
  ticket: ticketContract
6235
6584
  });
6236
- var extensionContract2 = initContract37().router({
6585
+ var extensionContract2 = initContract38().router({
6237
6586
  extension: extensionContract
6238
6587
  });
6239
- var commentActivityContract = initContract37().router({
6588
+ var commentActivityContract = initContract38().router({
6240
6589
  comment: commentContract,
6241
6590
  activityLog: activityLogContract
6242
6591
  });
6243
- var platformContract = initContract37().router({
6592
+ var platformContract = initContract38().router({
6244
6593
  line: lineContract,
6245
6594
  messenger: messengerContract,
6246
6595
  instagram: instagramContract,
6247
6596
  viber: viberContract
6248
6597
  });
6249
- var chatContract = initContract37().router({
6598
+ var chatContract = initContract38().router({
6250
6599
  main: mainChatContract
6251
6600
  });
6252
- var telephonyContract = initContract37().router({
6601
+ var telephonyContract = initContract38().router({
6253
6602
  telephonyCdr: telephonyCdrContract
6254
6603
  });
6604
+ var notificationContract = initContract38().router({
6605
+ notification: userNotificationContract
6606
+ });
6255
6607
  export {
6256
6608
  activityLogContract,
6257
6609
  apiContract,
@@ -6262,12 +6614,13 @@ export {
6262
6614
  commentActivityContract,
6263
6615
  commentContract,
6264
6616
  companyContract,
6265
- contactContract,
6617
+ contactContract2 as contactContract,
6266
6618
  cxLogContract,
6267
6619
  dashboardContract,
6268
6620
  evaluateFormContract,
6269
6621
  extensionContract2 as extensionContract,
6270
6622
  mainChatContract,
6623
+ notificationContract,
6271
6624
  permissionContract,
6272
6625
  platformContract,
6273
6626
  receiveMessageContract,