@kl1/contracts 1.0.78 → 1.0.79

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