@kl1/contracts 1.0.51 → 1.0.53

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.
package/dist/index.mjs CHANGED
@@ -616,7 +616,7 @@ var categoryContract = initContract5().router(
616
616
 
617
617
  // src/channel/index.ts
618
618
  import { initContract as initContract6 } from "@ts-rest/core";
619
- import z19 from "zod";
619
+ import z20 from "zod";
620
620
 
621
621
  // src/messenger/validation.ts
622
622
  import z16 from "zod";
@@ -724,6 +724,15 @@ var ConnectChannelSchema = z18.object({
724
724
  connectedUserId: z18.string()
725
725
  });
726
726
 
727
+ // src/line/schema.ts
728
+ import z19 from "zod";
729
+ var ConnectLineSchema = z19.object({
730
+ lineId: z19.string().optional(),
731
+ accessToken: z19.string().optional(),
732
+ lineSecret: z19.string().optional(),
733
+ actor: UserSchema
734
+ });
735
+
727
736
  // src/channel/index.ts
728
737
  var messenger = initContract6().router(
729
738
  {
@@ -737,15 +746,8 @@ var messenger = initContract6().router(
737
746
  }),
738
747
  500: DefaultErrorResponseSchema
739
748
  }
740
- }
741
- },
742
- {
743
- pathPrefix: "/messenger"
744
- }
745
- );
746
- var channelContract = initContract6().router(
747
- {
748
- connectChannel: {
749
+ },
750
+ connect: {
749
751
  method: "POST",
750
752
  path: "/connect",
751
753
  responses: {
@@ -757,11 +759,23 @@ var channelContract = initContract6().router(
757
759
  body: ConnectChannelSchema,
758
760
  summary: "Connect message channel"
759
761
  },
760
- disconnectChannel: {
762
+ relogin: {
763
+ method: "POST",
764
+ path: "/relogin",
765
+ responses: {
766
+ 200: DefaultSuccessResponseSchema.extend({
767
+ channel: ChannelSchema
768
+ }),
769
+ 408: DefaultErrorResponseSchema
770
+ },
771
+ body: ConnectChannelSchema,
772
+ summary: "Relogin message channel"
773
+ },
774
+ disconnect: {
761
775
  method: "POST",
762
776
  path: "/disconnect/:channelId",
763
- pathParams: z19.object({
764
- channelId: z19.string().uuid()
777
+ pathParams: z20.object({
778
+ channelId: z20.string().uuid()
765
779
  }),
766
780
  responses: {
767
781
  200: DefaultSuccessResponseSchema.extend({
@@ -771,19 +785,60 @@ var channelContract = initContract6().router(
771
785
  },
772
786
  body: null,
773
787
  summary: "Disconnect message channel"
774
- },
775
- reloginChannel: {
788
+ }
789
+ },
790
+ {
791
+ pathPrefix: "/messenger"
792
+ }
793
+ );
794
+ var line = initContract6().router(
795
+ {
796
+ connect: {
776
797
  method: "POST",
777
- path: "/relogin",
798
+ path: "/connect",
778
799
  responses: {
779
800
  200: DefaultSuccessResponseSchema.extend({
780
801
  channel: ChannelSchema
781
802
  }),
782
803
  408: DefaultErrorResponseSchema
783
804
  },
784
- body: ConnectChannelSchema,
785
- summary: "Relogin message channel"
786
- },
805
+ body: ConnectLineSchema,
806
+ summary: "Connect line channel"
807
+ }
808
+ },
809
+ {
810
+ pathPrefix: "/line"
811
+ }
812
+ );
813
+ var channelContract = initContract6().router(
814
+ {
815
+ // connectChannel: {
816
+ // method: 'POST',
817
+ // path: '/connect',
818
+ // responses: {
819
+ // 200: DefaultSuccessResponseSchema.extend({
820
+ // channel: ChannelSchema,
821
+ // }),
822
+ // 408: DefaultErrorResponseSchema,
823
+ // },
824
+ // body: ConnectChannelSchema,
825
+ // summary: 'Connect message channel',
826
+ // },
827
+ // disconnectChannel: {
828
+ // method: 'POST',
829
+ // path: '/disconnect/:channelId',
830
+ // pathParams: z.object({
831
+ // channelId: z.string().uuid(),
832
+ // }),
833
+ // responses: {
834
+ // 200: DefaultSuccessResponseSchema.extend({
835
+ // channel: ChannelSchema,
836
+ // }),
837
+ // 408: DefaultErrorResponseSchema,
838
+ // },
839
+ // body: null,
840
+ // summary: 'Disconnect message channel',
841
+ // },
787
842
  getChannels: {
788
843
  method: "GET",
789
844
  path: "/",
@@ -794,7 +849,8 @@ var channelContract = initContract6().router(
794
849
  },
795
850
  summary: "Get Channels"
796
851
  },
797
- messenger
852
+ messenger,
853
+ line
798
854
  },
799
855
  {
800
856
  baseHeaders: DefaultHeaderSchema,
@@ -804,274 +860,274 @@ var channelContract = initContract6().router(
804
860
 
805
861
  // src/chat/index.ts
806
862
  import { initContract as initContract7 } from "@ts-rest/core";
807
- import z32 from "zod";
863
+ import z33 from "zod";
808
864
 
809
865
  // src/contact/schema.ts
810
- import z23 from "zod";
866
+ import z24 from "zod";
811
867
 
812
868
  // src/tag/schema.ts
813
- import z20 from "zod";
869
+ import z21 from "zod";
814
870
  var TagSchema = DefaultEntitySchema.extend({
815
- name: z20.string()
871
+ name: z21.string()
816
872
  });
817
- var TagGroupSchema = z20.union([
818
- z20.literal("general"),
819
- z20.literal("contact")
873
+ var TagGroupSchema = z21.union([
874
+ z21.literal("general"),
875
+ z21.literal("contact")
820
876
  ]);
821
877
 
822
878
  // src/company/schema.ts
823
- import z21 from "zod";
879
+ import z22 from "zod";
824
880
  var CompanyCustomFieldSchema = DefaultEntitySchema.extend({
825
- textValue: z21.string().nullable(),
826
- booleanValue: z21.boolean().nullable(),
827
- numberValue: z21.number().nullable(),
828
- dateValue: z21.date().nullable(),
881
+ textValue: z22.string().nullable(),
882
+ booleanValue: z22.boolean().nullable(),
883
+ numberValue: z22.number().nullable(),
884
+ dateValue: z22.date().nullable(),
829
885
  attribute: AttributeSchema.omit({ options: true, group: true })
830
886
  });
831
887
  var CompanySchema = DefaultEntitySchema.extend({
832
- name: z21.string().optional(),
833
- phone: z21.string().nullable().optional(),
834
- address: z21.string().nullable().optional(),
835
- industry: z21.string().nullable().optional(),
836
- customFields: z21.array(CompanyCustomFieldSchema).optional()
888
+ name: z22.string().optional(),
889
+ phone: z22.string().nullable().optional(),
890
+ address: z22.string().nullable().optional(),
891
+ industry: z22.string().nullable().optional(),
892
+ customFields: z22.array(CompanyCustomFieldSchema).optional()
837
893
  });
838
894
 
839
895
  // src/upload/schema.ts
840
- import z22 from "zod";
896
+ import z23 from "zod";
841
897
  var UploadSchema = DefaultEntitySchema.extend({
842
- bucketName: z22.string(),
843
- fileName: z22.string(),
844
- fileSize: z22.number(),
845
- fileKey: z22.string(),
846
- fileUrl: z22.string().nullable(),
847
- status: z22.string().optional()
898
+ bucketName: z23.string(),
899
+ fileName: z23.string(),
900
+ fileSize: z23.number(),
901
+ fileKey: z23.string(),
902
+ fileUrl: z23.string().nullable(),
903
+ status: z23.string().optional()
848
904
  });
849
905
 
850
906
  // src/contact/schema.ts
851
- var ContactPhonesSchema = z23.object({
852
- id: z23.string().uuid(),
853
- createdAt: z23.date(),
854
- updatedAt: z23.date(),
855
- deletedAt: z23.date().nullable(),
856
- phone: z23.string(),
857
- isPrimary: z23.boolean()
858
- });
859
- var ContactEmailsSchema = z23.object({
860
- id: z23.string().uuid(),
861
- createdAt: z23.date(),
862
- updatedAt: z23.date(),
863
- deletedAt: z23.date().nullable(),
864
- email: z23.string(),
865
- isPrimary: z23.boolean()
866
- });
867
- var ContactCustomFieldSchema = z23.object({
868
- id: z23.string().uuid(),
869
- createdAt: z23.date(),
870
- updatedAt: z23.date(),
871
- deletedAt: z23.date().nullable(),
872
- textValue: z23.string().nullable(),
873
- booleanValue: z23.boolean().nullable(),
874
- numberValue: z23.number().nullable(),
875
- dateValue: z23.date().nullable(),
907
+ var ContactPhonesSchema = z24.object({
908
+ id: z24.string().uuid(),
909
+ createdAt: z24.date(),
910
+ updatedAt: z24.date(),
911
+ deletedAt: z24.date().nullable(),
912
+ phone: z24.string(),
913
+ isPrimary: z24.boolean()
914
+ });
915
+ var ContactEmailsSchema = z24.object({
916
+ id: z24.string().uuid(),
917
+ createdAt: z24.date(),
918
+ updatedAt: z24.date(),
919
+ deletedAt: z24.date().nullable(),
920
+ email: z24.string(),
921
+ isPrimary: z24.boolean()
922
+ });
923
+ var ContactCustomFieldSchema = z24.object({
924
+ id: z24.string().uuid(),
925
+ createdAt: z24.date(),
926
+ updatedAt: z24.date(),
927
+ deletedAt: z24.date().nullable(),
928
+ textValue: z24.string().nullable(),
929
+ booleanValue: z24.boolean().nullable(),
930
+ numberValue: z24.number().nullable(),
931
+ dateValue: z24.date().nullable(),
876
932
  attribute: AttributeSchema.omit({ options: true, group: true }),
877
- uploads: z23.array(
933
+ uploads: z24.array(
878
934
  DefaultEntitySchema.extend({
879
- customFieldId: z23.string(),
935
+ customFieldId: z24.string(),
880
936
  upload: UploadSchema
881
937
  })
882
938
  )
883
939
  });
884
- var ContactEntityTypesSchema = z23.object({
885
- id: z23.string().uuid(),
886
- createdAt: z23.date(),
887
- updatedAt: z23.date(),
888
- deletedAt: z23.date().nullable(),
889
- entity: z23.string(),
890
- description: z23.string().nullable()
891
- });
892
- var ContactActivitySchema = z23.object({
893
- id: z23.string().uuid(),
894
- createdAt: z23.date(),
895
- updatedAt: z23.date(),
896
- deletedAt: z23.date().nullable(),
897
- entityId: z23.string(),
898
- description: z23.string(),
940
+ var ContactEntityTypesSchema = z24.object({
941
+ id: z24.string().uuid(),
942
+ createdAt: z24.date(),
943
+ updatedAt: z24.date(),
944
+ deletedAt: z24.date().nullable(),
945
+ entity: z24.string(),
946
+ description: z24.string().nullable()
947
+ });
948
+ var ContactActivitySchema = z24.object({
949
+ id: z24.string().uuid(),
950
+ createdAt: z24.date(),
951
+ updatedAt: z24.date(),
952
+ deletedAt: z24.date().nullable(),
953
+ entityId: z24.string(),
954
+ description: z24.string(),
899
955
  entityType: ContactEntityTypesSchema
900
956
  });
901
- var ContactSchema = z23.object({
902
- id: z23.string().uuid(),
903
- createdAt: z23.date(),
904
- updatedAt: z23.date(),
905
- deletedAt: z23.date().nullable(),
906
- name: z23.string(),
907
- address: z23.string().nullable(),
908
- channel: z23.string().nullable(),
909
- notes: z23.string().nullable(),
910
- contactProfile: z23.string().nullable(),
911
- socialProfileUrl: z23.string().nullable(),
912
- tags: z23.array(TagSchema),
957
+ var ContactSchema = z24.object({
958
+ id: z24.string().uuid(),
959
+ createdAt: z24.date(),
960
+ updatedAt: z24.date(),
961
+ deletedAt: z24.date().nullable(),
962
+ name: z24.string(),
963
+ address: z24.string().nullable(),
964
+ channel: z24.string().nullable(),
965
+ notes: z24.string().nullable(),
966
+ contactProfile: z24.string().nullable(),
967
+ socialProfileUrl: z24.string().nullable(),
968
+ tags: z24.array(TagSchema),
913
969
  company: CompanySchema.omit({ customFields: true }).nullable(),
914
970
  // room: z.array(RoomSchema).optional(),
915
- customFields: z23.array(ContactCustomFieldSchema),
916
- contactEmails: z23.array(ContactEmailsSchema),
917
- contactPhones: z23.array(ContactPhonesSchema),
918
- activityLogs: z23.array(ContactActivitySchema).optional()
971
+ customFields: z24.array(ContactCustomFieldSchema),
972
+ contactEmails: z24.array(ContactEmailsSchema),
973
+ contactPhones: z24.array(ContactPhonesSchema),
974
+ activityLogs: z24.array(ContactActivitySchema).optional()
919
975
  });
920
976
 
921
977
  // src/chat/schema.ts
922
- import z29 from "zod";
978
+ import z30 from "zod";
923
979
 
924
980
  // src/cx-log/schema.ts
925
- import z28 from "zod";
981
+ import z29 from "zod";
926
982
 
927
983
  // src/evaluate-form/schema.ts
928
- import z24 from "zod";
984
+ import z25 from "zod";
929
985
  var EvaluateFormSchema = DefaultEntitySchema.extend({
930
- cxLogId: z24.string().uuid(),
931
- sentimentScore: z24.string().nullable().optional(),
932
- csatScore: z24.string().nullable().optional()
986
+ cxLogId: z25.string().uuid(),
987
+ sentimentScore: z25.string().nullable().optional(),
988
+ csatScore: z25.string().nullable().optional()
933
989
  });
934
990
 
935
991
  // src/telephony-cdr/schema.ts
936
- import z26 from "zod";
992
+ import z27 from "zod";
937
993
 
938
994
  // src/extension/schema.ts
939
- import z25 from "zod";
940
- var ExtensionSchema = z25.object({
941
- id: z25.string().uuid(),
942
- createdAt: z25.date(),
943
- updatedAt: z25.date(),
944
- deletedAt: z25.date().nullable(),
945
- userId: z25.string().nullable(),
946
- sipServerUrl: z25.string(),
947
- sipUserName: z25.string(),
948
- webphoneLoginUser: z25.string(),
949
- extensionId: z25.string().nullable(),
950
- extensionName: z25.string(),
951
- telephonySignature: z25.string().nullable()
995
+ import z26 from "zod";
996
+ var ExtensionSchema = z26.object({
997
+ id: z26.string().uuid(),
998
+ createdAt: z26.date(),
999
+ updatedAt: z26.date(),
1000
+ deletedAt: z26.date().nullable(),
1001
+ userId: z26.string().nullable(),
1002
+ sipServerUrl: z26.string(),
1003
+ sipUserName: z26.string(),
1004
+ webphoneLoginUser: z26.string(),
1005
+ extensionId: z26.string().nullable(),
1006
+ extensionName: z26.string(),
1007
+ telephonySignature: z26.string().nullable()
952
1008
  });
953
1009
 
954
1010
  // src/telephony-cdr/schema.ts
955
1011
  var TelephonyCdrSchema = DefaultEntitySchema.extend({
956
- uniqueCallId: z26.string(),
957
- timeStart: z26.string(),
958
- callFrom: z26.string(),
959
- callTo: z26.string(),
960
- callDuration: z26.number().nullable(),
961
- talkDuration: z26.number().nullable(),
962
- srcTrunkName: z26.string().nullable(),
963
- dstTrunkName: z26.string().nullable(),
1012
+ uniqueCallId: z27.string(),
1013
+ timeStart: z27.string(),
1014
+ callFrom: z27.string(),
1015
+ callTo: z27.string(),
1016
+ callDuration: z27.number().nullable(),
1017
+ talkDuration: z27.number().nullable(),
1018
+ srcTrunkName: z27.string().nullable(),
1019
+ dstTrunkName: z27.string().nullable(),
964
1020
  contact: ContactSchema.optional(),
965
1021
  // TODO: refactor this zod schema using TelephonyQueue entity schema
966
1022
  telephonyQueue: DefaultEntitySchema.extend({
967
- queueId: z26.number(),
968
- queueName: z26.string(),
969
- queueNumber: z26.string(),
970
- maximumWaitingTime: z26.number()
1023
+ queueId: z27.number(),
1024
+ queueName: z27.string(),
1025
+ queueNumber: z27.string(),
1026
+ maximumWaitingTime: z27.number()
971
1027
  }).optional().nullable(),
972
- pinCode: z26.string().nullable(),
973
- status: z26.string(),
974
- type: z26.string(),
975
- recording: z26.string().nullable(),
976
- didNumber: z26.string().nullable(),
977
- agentRingTime: z26.number().nullable(),
978
- uploadId: z26.string().nullable(),
1028
+ pinCode: z27.string().nullable(),
1029
+ status: z27.string(),
1030
+ type: z27.string(),
1031
+ recording: z27.string().nullable(),
1032
+ didNumber: z27.string().nullable(),
1033
+ agentRingTime: z27.number().nullable(),
1034
+ uploadId: z27.string().nullable(),
979
1035
  upload: UploadSchema.optional().nullable(),
980
- serialNumber: z26.string().nullable(),
981
- extensionId: z26.string().uuid().nullable(),
1036
+ serialNumber: z27.string().nullable(),
1037
+ extensionId: z27.string().uuid().nullable(),
982
1038
  extension: ExtensionSchema.extend({
983
1039
  user: UserSchema.optional().nullable()
984
1040
  }).optional().nullable(),
985
- telephonyQueueId: z26.string().uuid().nullable(),
986
- contactId: z26.string().nullable()
1041
+ telephonyQueueId: z27.string().uuid().nullable(),
1042
+ contactId: z27.string().nullable()
987
1043
  });
988
1044
  var TelephonyTrunkSchema = DefaultEntitySchema.extend({
989
- trunkId: z26.string().nullable(),
990
- trunk: z26.string().nullable()
1045
+ trunkId: z27.string().nullable(),
1046
+ trunk: z27.string().nullable()
991
1047
  });
992
- var TelephonyTrunkListSchema = z26.array(TelephonyTrunkSchema);
1048
+ var TelephonyTrunkListSchema = z27.array(TelephonyTrunkSchema);
993
1049
  var TelephonyQueueSchema = DefaultEntitySchema.extend({
994
- queueId: z26.number(),
995
- queueName: z26.string(),
996
- queueNumber: z26.string(),
997
- maximumWaitingTime: z26.number()
1050
+ queueId: z27.number(),
1051
+ queueName: z27.string(),
1052
+ queueNumber: z27.string(),
1053
+ maximumWaitingTime: z27.number()
998
1054
  });
999
- var TelephonyQueueListSchmea = z26.array(TelephonyQueueSchema);
1055
+ var TelephonyQueueListSchmea = z27.array(TelephonyQueueSchema);
1000
1056
  var TelephonyExtensionSchema = DefaultEntitySchema.extend({
1001
1057
  user: UserSchema.omit({ extension: true }).optional().nullable(),
1002
1058
  // extension not needed in this schema
1003
- sipServerUrl: z26.string().nullable(),
1004
- sipUserName: z26.string().nullable(),
1005
- sipPassword: z26.string().nullable(),
1006
- yeastarSignature: z26.string().nullable(),
1007
- userId: z26.string().uuid().nullable(),
1008
- extensionId: z26.string().nullable(),
1009
- extensionName: z26.string().nullable()
1010
- });
1011
- var TelephonyExtensionListSchema = z26.array(TelephonyExtensionSchema);
1012
- var TelephonyDropdownListSchema = z26.object({
1013
- trunks: z26.array(
1014
- z26.object({
1015
- id: z26.string().uuid(),
1016
- trunk: z26.string()
1059
+ sipServerUrl: z27.string().nullable(),
1060
+ sipUserName: z27.string().nullable(),
1061
+ sipPassword: z27.string().nullable(),
1062
+ yeastarSignature: z27.string().nullable(),
1063
+ userId: z27.string().uuid().nullable(),
1064
+ extensionId: z27.string().nullable(),
1065
+ extensionName: z27.string().nullable()
1066
+ });
1067
+ var TelephonyExtensionListSchema = z27.array(TelephonyExtensionSchema);
1068
+ var TelephonyDropdownListSchema = z27.object({
1069
+ trunks: z27.array(
1070
+ z27.object({
1071
+ id: z27.string().uuid(),
1072
+ trunk: z27.string()
1017
1073
  })
1018
1074
  ),
1019
- status: z26.array(z26.enum(["ANSWERED", "NO ANSWER", "FAILED"])),
1020
- type: z26.array(z26.enum(["Inbound", "Outbound", "Internal"]))
1075
+ status: z27.array(z27.enum(["ANSWERED", "NO ANSWER", "FAILED"])),
1076
+ type: z27.array(z27.enum(["Inbound", "Outbound", "Internal"]))
1021
1077
  });
1022
1078
 
1023
1079
  // src/wrap-up-form/schema.ts
1024
- import z27 from "zod";
1080
+ import z28 from "zod";
1025
1081
  var WrapUpFormSchema = DefaultEntitySchema.extend({
1026
- note: z27.string().nullable(),
1027
- disposition: z27.string().nullable(),
1028
- callFrom: z27.string().nullable(),
1029
- callTo: z27.string().nullable(),
1030
- tags: z27.array(TagSchema)
1082
+ note: z28.string().nullable(),
1083
+ disposition: z28.string().nullable(),
1084
+ callFrom: z28.string().nullable(),
1085
+ callTo: z28.string().nullable(),
1086
+ tags: z28.array(TagSchema)
1031
1087
  });
1032
1088
 
1033
1089
  // src/cx-log/schema.ts
1034
1090
  var CxLogSchema = DefaultEntitySchema.extend({
1035
- caseId: z28.number(),
1036
- entityId: z28.string().uuid(),
1037
- entityName: z28.string(),
1038
- contactId: z28.string().uuid().nullable(),
1039
- channel: z28.string().nullable(),
1040
- queueId: z28.string().uuid().nullable(),
1041
- agentId: z28.string().uuid().nullable(),
1042
- direction: z28.string().nullable(),
1043
- startedDate: z28.date().nullable(),
1044
- handledTime: z28.number().nullable(),
1045
- firstResponseTime: z28.number().nullable(),
1046
- disposition: z28.string().nullable(),
1091
+ caseId: z29.number(),
1092
+ entityId: z29.string().uuid(),
1093
+ entityName: z29.string(),
1094
+ contactId: z29.string().uuid().nullable(),
1095
+ channel: z29.string().nullable(),
1096
+ queueId: z29.string().uuid().nullable(),
1097
+ agentId: z29.string().uuid().nullable(),
1098
+ direction: z29.string().nullable(),
1099
+ startedDate: z29.date().nullable(),
1100
+ handledTime: z29.number().nullable(),
1101
+ firstResponseTime: z29.number().nullable(),
1102
+ disposition: z29.string().nullable(),
1047
1103
  wrapUpForm: WrapUpFormSchema.nullable()
1048
1104
  });
1049
1105
  var CxLogSchemaWithRelations = DefaultEntitySchema.extend({
1050
- caseId: z28.number(),
1051
- entityId: z28.string().uuid(),
1052
- entityName: z28.string(),
1053
- channelType: z28.string().nullable(),
1054
- channel: z28.string().nullable(),
1055
- direction: z28.string().nullable(),
1056
- startedDate: z28.string().nullable(),
1057
- handledTime: z28.string().nullable(),
1058
- firstResponseTime: z28.string().nullable(),
1059
- disposition: z28.string().nullable(),
1060
- slaMeet: z28.string().nullable(),
1106
+ caseId: z29.number(),
1107
+ entityId: z29.string().uuid(),
1108
+ entityName: z29.string(),
1109
+ channelType: z29.string().nullable(),
1110
+ channel: z29.string().nullable(),
1111
+ direction: z29.string().nullable(),
1112
+ startedDate: z29.string().nullable(),
1113
+ handledTime: z29.string().nullable(),
1114
+ firstResponseTime: z29.string().nullable(),
1115
+ disposition: z29.string().nullable(),
1116
+ slaMeet: z29.string().nullable(),
1061
1117
  evaluateForm: EvaluateFormSchema.nullable(),
1062
1118
  wrapUpForm: WrapUpFormSchema.nullable(),
1063
- room: z28.object({
1064
- id: z28.string().uuid(),
1065
- createdAt: z28.date(),
1066
- updatedAt: z28.date(),
1067
- deletedAt: z28.date().nullable(),
1068
- lastMessage: z28.string(),
1069
- handleTime: z28.number(),
1070
- closeAt: z28.date(),
1071
- unreadCount: z28.number(),
1072
- firstResponseAt: z28.date(),
1073
- firstResponseTime: z28.number(),
1074
- isLatest: z28.boolean(),
1119
+ room: z29.object({
1120
+ id: z29.string().uuid(),
1121
+ createdAt: z29.date(),
1122
+ updatedAt: z29.date(),
1123
+ deletedAt: z29.date().nullable(),
1124
+ lastMessage: z29.string(),
1125
+ handleTime: z29.number(),
1126
+ closeAt: z29.date(),
1127
+ unreadCount: z29.number(),
1128
+ firstResponseAt: z29.date(),
1129
+ firstResponseTime: z29.number(),
1130
+ isLatest: z29.boolean(),
1075
1131
  direction: MessageDirectionTypeSchema,
1076
1132
  platformContact: PlatformContactSchema,
1077
1133
  actor: UserSchema,
@@ -1079,21 +1135,21 @@ var CxLogSchemaWithRelations = DefaultEntitySchema.extend({
1079
1135
  channel: ChannelSchema
1080
1136
  }).nullable(),
1081
1137
  telephonyCdr: TelephonyCdrSchema.nullable(),
1082
- queue: z28.object({
1083
- queueName: z28.string().nullable().optional()
1138
+ queue: z29.object({
1139
+ queueName: z29.string().nullable().optional()
1084
1140
  }).nullable(),
1085
1141
  contact: ContactSchema.nullable(),
1086
1142
  agent: UserSchema.nullable(),
1087
- contactLabel: z28.array(z28.string())
1143
+ contactLabel: z29.array(z29.string())
1088
1144
  });
1089
1145
 
1090
1146
  // src/chat/schema.ts
1091
- var MessageDirectionTypeSchema = z29.enum([
1147
+ var MessageDirectionTypeSchema = z30.enum([
1092
1148
  "incoming",
1093
1149
  "outgoing",
1094
1150
  "system"
1095
1151
  ]);
1096
- var MessageTypeSchema = z29.enum([
1152
+ var MessageTypeSchema = z30.enum([
1097
1153
  "text",
1098
1154
  "image",
1099
1155
  "video",
@@ -1114,339 +1170,339 @@ var MessageTypeSchema = z29.enum([
1114
1170
  "updated",
1115
1171
  "started"
1116
1172
  ]);
1117
- var MessageLocaleTypeSchema = z29.enum(["mm", "en", "th", ""]);
1118
- var PlatformContactMetadataSchema = z29.object({
1119
- id: z29.string(),
1120
- name: z29.string(),
1121
- picture: z29.string().optional(),
1122
- additionalCredentials: z29.any()
1173
+ var MessageLocaleTypeSchema = z30.enum(["mm", "en", "th", ""]);
1174
+ var PlatformContactMetadataSchema = z30.object({
1175
+ id: z30.string(),
1176
+ name: z30.string(),
1177
+ picture: z30.string().optional(),
1178
+ additionalCredentials: z30.any()
1123
1179
  });
1124
1180
  var PlatformContactSchema = DefaultEntitySchema.extend({
1125
- channelId: z29.string().uuid(),
1126
- socialPlatformId: z29.string(),
1181
+ channelId: z30.string().uuid(),
1182
+ socialPlatformId: z30.string(),
1127
1183
  type: ChannelTypeSchema,
1128
1184
  metadata: PlatformContactMetadataSchema,
1129
1185
  contact: ContactSchema
1130
1186
  });
1131
1187
  var RoomSchema = DefaultEntitySchema.extend({
1132
- lastMessage: z29.string(),
1133
- handleTime: z29.number(),
1134
- closeAt: z29.date(),
1135
- unreadCount: z29.number(),
1136
- firstResponseAt: z29.date(),
1137
- firstResponseTime: z29.number(),
1138
- isLatest: z29.boolean(),
1188
+ lastMessage: z30.string(),
1189
+ handleTime: z30.number(),
1190
+ closeAt: z30.date(),
1191
+ unreadCount: z30.number(),
1192
+ firstResponseAt: z30.date(),
1193
+ firstResponseTime: z30.number(),
1194
+ isLatest: z30.boolean(),
1139
1195
  direction: MessageDirectionTypeSchema,
1140
1196
  platformContact: PlatformContactSchema,
1141
- actor: z29.object({
1142
- id: z29.string().uuid(),
1143
- createdAt: z29.date(),
1144
- updatedAt: z29.date(),
1145
- deletedAt: z29.date().nullable(),
1146
- name: z29.string(),
1147
- email: z29.string().email(),
1148
- emailVerifiedAt: z29.date().nullable(),
1149
- password: z29.string(),
1150
- address: z29.string().nullable(),
1151
- phone: z29.string().nullable(),
1152
- notificationCount: z29.number().nullable(),
1153
- roles: z29.array(RoleSchema),
1154
- extension: z29.object({
1155
- id: z29.string().uuid(),
1156
- createdAt: z29.date(),
1157
- updatedAt: z29.date(),
1158
- deletedAt: z29.date().nullable(),
1159
- userId: z29.string().nullable(),
1160
- sipServerUrl: z29.string(),
1161
- sipUserName: z29.string(),
1162
- webphoneLoginUser: z29.string(),
1163
- extensionId: z29.string().nullable(),
1164
- extensionName: z29.string(),
1165
- telephonySignature: z29.string().nullable()
1197
+ actor: z30.object({
1198
+ id: z30.string().uuid(),
1199
+ createdAt: z30.date(),
1200
+ updatedAt: z30.date(),
1201
+ deletedAt: z30.date().nullable(),
1202
+ name: z30.string(),
1203
+ email: z30.string().email(),
1204
+ emailVerifiedAt: z30.date().nullable(),
1205
+ password: z30.string(),
1206
+ address: z30.string().nullable(),
1207
+ phone: z30.string().nullable(),
1208
+ notificationCount: z30.number().nullable(),
1209
+ roles: z30.array(RoleSchema),
1210
+ extension: z30.object({
1211
+ id: z30.string().uuid(),
1212
+ createdAt: z30.date(),
1213
+ updatedAt: z30.date(),
1214
+ deletedAt: z30.date().nullable(),
1215
+ userId: z30.string().nullable(),
1216
+ sipServerUrl: z30.string(),
1217
+ sipUserName: z30.string(),
1218
+ webphoneLoginUser: z30.string(),
1219
+ extensionId: z30.string().nullable(),
1220
+ extensionName: z30.string(),
1221
+ telephonySignature: z30.string().nullable()
1166
1222
  })
1167
1223
  }),
1168
- assignee: z29.object({
1169
- id: z29.string().uuid(),
1170
- createdAt: z29.date(),
1171
- updatedAt: z29.date(),
1172
- deletedAt: z29.date().nullable(),
1173
- name: z29.string(),
1174
- email: z29.string().email(),
1175
- emailVerifiedAt: z29.date().nullable(),
1176
- password: z29.string(),
1177
- address: z29.string().nullable(),
1178
- phone: z29.string().nullable(),
1179
- notificationCount: z29.number().nullable(),
1180
- roles: z29.array(RoleSchema),
1181
- extension: z29.object({
1182
- id: z29.string().uuid(),
1183
- createdAt: z29.date(),
1184
- updatedAt: z29.date(),
1185
- deletedAt: z29.date().nullable(),
1186
- userId: z29.string().nullable(),
1187
- sipServerUrl: z29.string(),
1188
- sipUserName: z29.string(),
1189
- webphoneLoginUser: z29.string(),
1190
- extensionId: z29.string().nullable(),
1191
- extensionName: z29.string(),
1192
- telephonySignature: z29.string().nullable()
1224
+ assignee: z30.object({
1225
+ id: z30.string().uuid(),
1226
+ createdAt: z30.date(),
1227
+ updatedAt: z30.date(),
1228
+ deletedAt: z30.date().nullable(),
1229
+ name: z30.string(),
1230
+ email: z30.string().email(),
1231
+ emailVerifiedAt: z30.date().nullable(),
1232
+ password: z30.string(),
1233
+ address: z30.string().nullable(),
1234
+ phone: z30.string().nullable(),
1235
+ notificationCount: z30.number().nullable(),
1236
+ roles: z30.array(RoleSchema),
1237
+ extension: z30.object({
1238
+ id: z30.string().uuid(),
1239
+ createdAt: z30.date(),
1240
+ updatedAt: z30.date(),
1241
+ deletedAt: z30.date().nullable(),
1242
+ userId: z30.string().nullable(),
1243
+ sipServerUrl: z30.string(),
1244
+ sipUserName: z30.string(),
1245
+ webphoneLoginUser: z30.string(),
1246
+ extensionId: z30.string().nullable(),
1247
+ extensionName: z30.string(),
1248
+ telephonySignature: z30.string().nullable()
1193
1249
  })
1194
1250
  }),
1195
1251
  channel: ChannelSchema,
1196
1252
  cxlog: CxLogSchema
1197
1253
  });
1198
1254
  var MessageSchema = DefaultEntitySchema.extend({
1199
- message: z29.string(),
1255
+ message: z30.string(),
1200
1256
  direction: MessageDirectionTypeSchema,
1201
1257
  type: MessageTypeSchema,
1202
- readAt: z29.date(),
1203
- metadata: z29.any(),
1204
- platformId: z29.string(),
1205
- platformMessageId: z29.string(),
1206
- replyPlatformMessageId: z29.string(),
1207
- template: z29.any(),
1258
+ readAt: z30.date(),
1259
+ metadata: z30.any(),
1260
+ platformId: z30.string(),
1261
+ platformMessageId: z30.string(),
1262
+ replyPlatformMessageId: z30.string(),
1263
+ template: z30.any(),
1208
1264
  locale: MessageLocaleTypeSchema,
1209
- url: z29.string(),
1210
- previewUrl: z29.string(),
1211
- imageSetId: z29.string(),
1265
+ url: z30.string(),
1266
+ previewUrl: z30.string(),
1267
+ imageSetId: z30.string(),
1212
1268
  room: RoomSchema,
1213
1269
  upload: UploadSchema,
1214
- actor: z29.object({
1215
- id: z29.string().uuid(),
1216
- createdAt: z29.date(),
1217
- updatedAt: z29.date(),
1218
- deletedAt: z29.date().nullable(),
1219
- name: z29.string(),
1220
- email: z29.string().email(),
1221
- emailVerifiedAt: z29.date().nullable(),
1222
- password: z29.string(),
1223
- address: z29.string().nullable(),
1224
- phone: z29.string().nullable(),
1225
- notificationCount: z29.number().nullable(),
1226
- roles: z29.array(RoleSchema),
1227
- extension: z29.object({
1228
- id: z29.string().uuid(),
1229
- createdAt: z29.date(),
1230
- updatedAt: z29.date(),
1231
- deletedAt: z29.date().nullable(),
1232
- userId: z29.string().nullable(),
1233
- sipServerUrl: z29.string(),
1234
- sipUserName: z29.string(),
1235
- webphoneLoginUser: z29.string(),
1236
- extensionId: z29.string().nullable(),
1237
- extensionName: z29.string(),
1238
- telephonySignature: z29.string().nullable()
1270
+ actor: z30.object({
1271
+ id: z30.string().uuid(),
1272
+ createdAt: z30.date(),
1273
+ updatedAt: z30.date(),
1274
+ deletedAt: z30.date().nullable(),
1275
+ name: z30.string(),
1276
+ email: z30.string().email(),
1277
+ emailVerifiedAt: z30.date().nullable(),
1278
+ password: z30.string(),
1279
+ address: z30.string().nullable(),
1280
+ phone: z30.string().nullable(),
1281
+ notificationCount: z30.number().nullable(),
1282
+ roles: z30.array(RoleSchema),
1283
+ extension: z30.object({
1284
+ id: z30.string().uuid(),
1285
+ createdAt: z30.date(),
1286
+ updatedAt: z30.date(),
1287
+ deletedAt: z30.date().nullable(),
1288
+ userId: z30.string().nullable(),
1289
+ sipServerUrl: z30.string(),
1290
+ sipUserName: z30.string(),
1291
+ webphoneLoginUser: z30.string(),
1292
+ extensionId: z30.string().nullable(),
1293
+ extensionName: z30.string(),
1294
+ telephonySignature: z30.string().nullable()
1239
1295
  })
1240
1296
  }),
1241
- assignee: z29.object({
1242
- id: z29.string().uuid(),
1243
- createdAt: z29.date(),
1244
- updatedAt: z29.date(),
1245
- deletedAt: z29.date().nullable(),
1246
- name: z29.string(),
1247
- email: z29.string().email(),
1248
- emailVerifiedAt: z29.date().nullable(),
1249
- password: z29.string(),
1250
- address: z29.string().nullable(),
1251
- phone: z29.string().nullable(),
1252
- notificationCount: z29.number().nullable(),
1253
- roles: z29.array(RoleSchema),
1254
- extension: z29.object({
1255
- id: z29.string().uuid(),
1256
- createdAt: z29.date(),
1257
- updatedAt: z29.date(),
1258
- deletedAt: z29.date().nullable(),
1259
- userId: z29.string().nullable(),
1260
- sipServerUrl: z29.string(),
1261
- sipUserName: z29.string(),
1262
- webphoneLoginUser: z29.string(),
1263
- extensionId: z29.string().nullable(),
1264
- extensionName: z29.string(),
1265
- telephonySignature: z29.string().nullable()
1297
+ assignee: z30.object({
1298
+ id: z30.string().uuid(),
1299
+ createdAt: z30.date(),
1300
+ updatedAt: z30.date(),
1301
+ deletedAt: z30.date().nullable(),
1302
+ name: z30.string(),
1303
+ email: z30.string().email(),
1304
+ emailVerifiedAt: z30.date().nullable(),
1305
+ password: z30.string(),
1306
+ address: z30.string().nullable(),
1307
+ phone: z30.string().nullable(),
1308
+ notificationCount: z30.number().nullable(),
1309
+ roles: z30.array(RoleSchema),
1310
+ extension: z30.object({
1311
+ id: z30.string().uuid(),
1312
+ createdAt: z30.date(),
1313
+ updatedAt: z30.date(),
1314
+ deletedAt: z30.date().nullable(),
1315
+ userId: z30.string().nullable(),
1316
+ sipServerUrl: z30.string(),
1317
+ sipUserName: z30.string(),
1318
+ webphoneLoginUser: z30.string(),
1319
+ extensionId: z30.string().nullable(),
1320
+ extensionName: z30.string(),
1321
+ telephonySignature: z30.string().nullable()
1266
1322
  })
1267
1323
  }),
1268
- sender: z29.object({
1269
- id: z29.string().uuid(),
1270
- createdAt: z29.date(),
1271
- updatedAt: z29.date(),
1272
- deletedAt: z29.date().nullable(),
1273
- name: z29.string(),
1274
- email: z29.string().email(),
1275
- emailVerifiedAt: z29.date().nullable(),
1276
- password: z29.string(),
1277
- address: z29.string().nullable(),
1278
- phone: z29.string().nullable(),
1279
- notificationCount: z29.number().nullable(),
1280
- roles: z29.array(RoleSchema),
1281
- extension: z29.object({
1282
- id: z29.string().uuid(),
1283
- createdAt: z29.date(),
1284
- updatedAt: z29.date(),
1285
- deletedAt: z29.date().nullable(),
1286
- userId: z29.string().nullable(),
1287
- sipServerUrl: z29.string(),
1288
- sipUserName: z29.string(),
1289
- webphoneLoginUser: z29.string(),
1290
- extensionId: z29.string().nullable(),
1291
- extensionName: z29.string(),
1292
- telephonySignature: z29.string().nullable()
1324
+ sender: z30.object({
1325
+ id: z30.string().uuid(),
1326
+ createdAt: z30.date(),
1327
+ updatedAt: z30.date(),
1328
+ deletedAt: z30.date().nullable(),
1329
+ name: z30.string(),
1330
+ email: z30.string().email(),
1331
+ emailVerifiedAt: z30.date().nullable(),
1332
+ password: z30.string(),
1333
+ address: z30.string().nullable(),
1334
+ phone: z30.string().nullable(),
1335
+ notificationCount: z30.number().nullable(),
1336
+ roles: z30.array(RoleSchema),
1337
+ extension: z30.object({
1338
+ id: z30.string().uuid(),
1339
+ createdAt: z30.date(),
1340
+ updatedAt: z30.date(),
1341
+ deletedAt: z30.date().nullable(),
1342
+ userId: z30.string().nullable(),
1343
+ sipServerUrl: z30.string(),
1344
+ sipUserName: z30.string(),
1345
+ webphoneLoginUser: z30.string(),
1346
+ extensionId: z30.string().nullable(),
1347
+ extensionName: z30.string(),
1348
+ telephonySignature: z30.string().nullable()
1293
1349
  })
1294
1350
  })
1295
1351
  });
1296
- var UnreadCountsByAssigneeSchema = z29.object({
1297
- assigneeId: z29.string(),
1298
- totalUnreadCount: z29.number()
1352
+ var UnreadCountsByAssigneeSchema = z30.object({
1353
+ assigneeId: z30.string(),
1354
+ totalUnreadCount: z30.number()
1299
1355
  });
1300
1356
 
1301
1357
  // src/chat/validation.ts
1302
- import z31 from "zod";
1358
+ import z32 from "zod";
1303
1359
 
1304
1360
  // src/custom-field/schema.ts
1305
- import z30 from "zod";
1361
+ import z31 from "zod";
1306
1362
  var CustomFieldSchema = DefaultEntitySchema.extend({
1307
- textValue: z30.string().nullable(),
1308
- booleanValue: z30.boolean().nullable(),
1309
- numberValue: z30.number().nullable(),
1310
- dateValue: z30.date().nullable(),
1311
- entityId: z30.string().uuid(),
1312
- attributeId: z30.string().uuid()
1363
+ textValue: z31.string().nullable(),
1364
+ booleanValue: z31.boolean().nullable(),
1365
+ numberValue: z31.number().nullable(),
1366
+ dateValue: z31.date().nullable(),
1367
+ entityId: z31.string().uuid(),
1368
+ attributeId: z31.string().uuid()
1313
1369
  });
1314
1370
 
1315
1371
  // src/chat/validation.ts
1316
- var GetRoomsSchema = z31.object({
1317
- page: z31.coerce.number().positive().default(1),
1318
- pageSize: z31.coerce.number().positive().default(20),
1319
- contactTags: z31.string().array().optional(),
1320
- contacts: z31.string().array().optional(),
1321
- agents: z31.string().array().optional(),
1322
- roomTags: z31.string().array().optional(),
1323
- keyword: z31.string().optional(),
1324
- companies: z31.string().array().optional(),
1325
- channels: z31.string().array().optional(),
1326
- name: z31.string().optional(),
1327
- address: z31.string().optional(),
1328
- contactGroups: z31.string().array().optional(),
1329
- selectedDate: z31.string().optional(),
1330
- customFields: z31.array(CustomFieldSchema).optional(),
1331
- tags: z31.string().array().optional(),
1332
- phone: z31.string().optional(),
1333
- email: z31.string().optional(),
1334
- notes: z31.string().optional(),
1335
- tab: z31.string().optional(),
1336
- type: z31.string().optional(),
1337
- sorting: z31.string().optional().default("desc")
1338
- });
1339
- var UpdateRoomTagsAndNotesSchema = z31.object({
1340
- note: z31.string().optional(),
1372
+ var GetRoomsSchema = z32.object({
1373
+ page: z32.coerce.number().positive().default(1),
1374
+ pageSize: z32.coerce.number().positive().default(20),
1375
+ contactTags: z32.string().array().optional(),
1376
+ contacts: z32.string().array().optional(),
1377
+ agents: z32.string().array().optional(),
1378
+ roomTags: z32.string().array().optional(),
1379
+ keyword: z32.string().optional(),
1380
+ companies: z32.string().array().optional(),
1381
+ channels: z32.string().array().optional(),
1382
+ name: z32.string().optional(),
1383
+ address: z32.string().optional(),
1384
+ contactGroups: z32.string().array().optional(),
1385
+ selectedDate: z32.string().optional(),
1386
+ customFields: z32.array(CustomFieldSchema).optional(),
1387
+ tags: z32.string().array().optional(),
1388
+ phone: z32.string().optional(),
1389
+ email: z32.string().optional(),
1390
+ notes: z32.string().optional(),
1391
+ tab: z32.string().optional(),
1392
+ type: z32.string().optional(),
1393
+ sorting: z32.string().optional().default("desc")
1394
+ });
1395
+ var UpdateRoomTagsAndNotesSchema = z32.object({
1396
+ note: z32.string().optional(),
1341
1397
  tags: TagSchema.array().optional()
1342
1398
  });
1343
1399
  var UpdateRoomAttributesSchema = UpdateRoomTagsAndNotesSchema.extend({
1344
- roomId: z31.string().uuid()
1345
- });
1346
- var MessageAttachmentSchema = z31.object({
1347
- bucketName: z31.string(),
1348
- fileKey: z31.string(),
1349
- fileName: z31.string(),
1350
- fileSize: z31.number(),
1351
- url: z31.string().nullable(),
1352
- fileType: z31.string(),
1353
- thumbnailUrl: z31.string().optional()
1354
- });
1355
- var StickerSchema = z31.object({
1356
- packageId: z31.number().optional(),
1357
- stickerId: z31.number().optional()
1358
- });
1359
- var SendMessageSchema = z31.object({
1360
- roomId: z31.string().uuid(),
1400
+ roomId: z32.string().uuid()
1401
+ });
1402
+ var MessageAttachmentSchema = z32.object({
1403
+ bucketName: z32.string(),
1404
+ fileKey: z32.string(),
1405
+ fileName: z32.string(),
1406
+ fileSize: z32.number(),
1407
+ url: z32.string().nullable(),
1408
+ fileType: z32.string(),
1409
+ thumbnailUrl: z32.string().optional()
1410
+ });
1411
+ var StickerSchema = z32.object({
1412
+ packageId: z32.number().optional(),
1413
+ stickerId: z32.number().optional()
1414
+ });
1415
+ var SendMessageSchema = z32.object({
1416
+ roomId: z32.string().uuid(),
1361
1417
  messageType: MessageTypeSchema,
1362
- message: z31.string().optional(),
1418
+ message: z32.string().optional(),
1363
1419
  messageAttachments: MessageAttachmentSchema.optional(),
1364
1420
  user: UserSchema.optional(),
1365
1421
  sticker: StickerSchema.optional(),
1366
- file: z31.custom().optional()
1422
+ file: z32.custom().optional()
1367
1423
  });
1368
- var SolveRoomSchema = z31.object({
1369
- roomId: z31.string(),
1370
- disposition: z31.string()
1424
+ var SolveRoomSchema = z32.object({
1425
+ roomId: z32.string(),
1426
+ disposition: z32.string()
1371
1427
  });
1372
- var UpdateAssigneeSchema = z31.object({
1373
- assigneeId: z31.string().uuid(),
1374
- roomId: z31.string()
1428
+ var UpdateAssigneeSchema = z32.object({
1429
+ assigneeId: z32.string().uuid(),
1430
+ roomId: z32.string()
1375
1431
  });
1376
1432
  var SearchRoomsSchema = DefaultQueryParamsSchema.extend({
1377
- query: z31.string()
1433
+ query: z32.string()
1378
1434
  });
1379
- var ChannelSchema2 = z31.object({
1380
- name: z31.string(),
1435
+ var ChannelSchema2 = z32.object({
1436
+ name: z32.string(),
1381
1437
  type: ChannelTypeSchema,
1382
1438
  metadata: ChannelMetadataSchema,
1383
- platformId: z31.string(),
1384
- brandName: z31.string(),
1439
+ platformId: z32.string(),
1440
+ brandName: z32.string(),
1385
1441
  status: ChannelStatusTypeSchema,
1386
- connectedUserName: z31.string().optional().nullable(),
1387
- connectedUserId: z31.string().optional().nullable(),
1388
- actor: z31.object({
1389
- id: z31.string().uuid(),
1390
- name: z31.string(),
1391
- email: z31.string().email(),
1392
- address: z31.string().nullable(),
1393
- phone: z31.string().nullable()
1442
+ connectedUserName: z32.string().optional().nullable(),
1443
+ connectedUserId: z32.string().optional().nullable(),
1444
+ actor: z32.object({
1445
+ id: z32.string().uuid(),
1446
+ name: z32.string(),
1447
+ email: z32.string().email(),
1448
+ address: z32.string().nullable(),
1449
+ phone: z32.string().nullable()
1394
1450
  }).optional()
1395
1451
  });
1396
- var SendMessageToPlatformSchema = z31.object({
1397
- room: z31.object({
1398
- id: z31.string().uuid(),
1399
- lastMessage: z31.string().optional(),
1400
- handleTime: z31.number().optional(),
1401
- isLatest: z31.boolean(),
1452
+ var SendMessageToPlatformSchema = z32.object({
1453
+ room: z32.object({
1454
+ id: z32.string().uuid(),
1455
+ lastMessage: z32.string().optional(),
1456
+ handleTime: z32.number().optional(),
1457
+ isLatest: z32.boolean(),
1402
1458
  direction: MessageDirectionTypeSchema,
1403
- platformContact: z31.object({
1404
- channelId: z31.string().uuid(),
1405
- socialPlatformId: z31.string().nullable(),
1459
+ platformContact: z32.object({
1460
+ channelId: z32.string().uuid(),
1461
+ socialPlatformId: z32.string().nullable(),
1406
1462
  type: ChannelTypeSchema,
1407
1463
  metadata: PlatformContactMetadataSchema,
1408
- contact: z31.object({
1409
- name: z31.string(),
1410
- address: z31.string().nullable(),
1411
- channel: z31.string().nullable(),
1412
- notes: z31.string().nullable(),
1413
- contactProfile: z31.string().nullable(),
1414
- socialProfileUrl: z31.string().nullable()
1464
+ contact: z32.object({
1465
+ name: z32.string(),
1466
+ address: z32.string().nullable(),
1467
+ channel: z32.string().nullable(),
1468
+ notes: z32.string().nullable(),
1469
+ contactProfile: z32.string().nullable(),
1470
+ socialProfileUrl: z32.string().nullable()
1415
1471
  })
1416
1472
  }),
1417
- actor: z31.object({
1418
- name: z31.string(),
1419
- email: z31.string().email(),
1420
- address: z31.string().nullable(),
1421
- phone: z31.string().nullable()
1473
+ actor: z32.object({
1474
+ name: z32.string(),
1475
+ email: z32.string().email(),
1476
+ address: z32.string().nullable(),
1477
+ phone: z32.string().nullable()
1422
1478
  }).nullable(),
1423
1479
  channel: ChannelSchema2
1424
1480
  }),
1425
- message: z31.object({
1426
- message: z31.string().optional(),
1481
+ message: z32.object({
1482
+ message: z32.string().optional(),
1427
1483
  direction: MessageDirectionTypeSchema,
1428
1484
  type: MessageTypeSchema,
1429
- readAt: z31.date().optional(),
1430
- metadata: z31.any().optional(),
1431
- platformId: z31.string().optional(),
1432
- platformMessageId: z31.string().optional(),
1433
- replyPlatformMessageId: z31.string().optional(),
1434
- template: z31.any().optional(),
1485
+ readAt: z32.date().optional(),
1486
+ metadata: z32.any().optional(),
1487
+ platformId: z32.string().optional(),
1488
+ platformMessageId: z32.string().optional(),
1489
+ replyPlatformMessageId: z32.string().optional(),
1490
+ template: z32.any().optional(),
1435
1491
  locale: MessageLocaleTypeSchema.optional(),
1436
- url: z31.string().optional(),
1437
- previewUrl: z31.string().optional(),
1438
- imageSetId: z31.string().optional(),
1439
- upload: z31.object({
1440
- bucketName: z31.string(),
1441
- fileName: z31.string(),
1442
- fileSize: z31.number(),
1443
- fileKey: z31.string()
1492
+ url: z32.string().optional(),
1493
+ previewUrl: z32.string().optional(),
1494
+ imageSetId: z32.string().optional(),
1495
+ upload: z32.object({
1496
+ bucketName: z32.string(),
1497
+ fileName: z32.string(),
1498
+ fileSize: z32.number(),
1499
+ fileKey: z32.string()
1444
1500
  }).optional(),
1445
- sender: z31.object({
1446
- name: z31.string(),
1447
- email: z31.string().email(),
1448
- address: z31.string().nullable(),
1449
- phone: z31.string().nullable()
1501
+ sender: z32.object({
1502
+ name: z32.string(),
1503
+ email: z32.string().email(),
1504
+ address: z32.string().nullable(),
1505
+ phone: z32.string().nullable()
1450
1506
  })
1451
1507
  })
1452
1508
  });
@@ -1458,30 +1514,51 @@ var ChannelServiceResponseSchema = DefaultSuccessResponseSchema.extend(
1458
1514
  data: ChannelSchema2
1459
1515
  }
1460
1516
  );
1461
- var ReceiveMessageSchema = z31.object({
1462
- message: z31.object({
1463
- message: z31.string(),
1517
+ var ReceiveMessageSchema = z32.object({
1518
+ message: z32.object({
1519
+ message: z32.string(),
1464
1520
  direction: MessageDirectionTypeSchema,
1465
1521
  type: MessageTypeSchema,
1466
- metadata: z31.any(),
1467
- platformId: z31.string(),
1468
- platformMessageId: z31.string(),
1469
- replyPlatformMessageId: z31.string().optional(),
1470
- template: z31.any(),
1522
+ metadata: z32.any(),
1523
+ platformId: z32.string(),
1524
+ platformMessageId: z32.string(),
1525
+ replyPlatformMessageId: z32.string().optional(),
1526
+ template: z32.any(),
1471
1527
  locale: MessageLocaleTypeSchema.nullable(),
1472
- url: z31.string().optional(),
1473
- previewUrl: z31.string().optional(),
1474
- imageSetId: z31.string().optional(),
1475
- room: z31.object({
1476
- lastMessage: z31.string(),
1477
- handleTime: z31.number(),
1478
- closeAt: z31.date(),
1479
- unreadCount: z31.number(),
1480
- firstResponseAt: z31.date().nullable(),
1481
- firstResponseTime: z31.number().nullable(),
1482
- isLatest: z31.boolean(),
1528
+ url: z32.string().optional(),
1529
+ previewUrl: z32.string().optional(),
1530
+ imageSetId: z32.string().optional(),
1531
+ room: z32.object({
1532
+ lastMessage: z32.string(),
1533
+ handleTime: z32.number(),
1534
+ closeAt: z32.date(),
1535
+ unreadCount: z32.number(),
1536
+ firstResponseAt: z32.date().nullable(),
1537
+ firstResponseTime: z32.number().nullable(),
1538
+ isLatest: z32.boolean(),
1483
1539
  direction: MessageDirectionTypeSchema,
1484
- platformContact: PlatformContactSchema,
1540
+ platformContact: z32.object({
1541
+ channelId: z32.string().uuid(),
1542
+ socialPlatformId: z32.string(),
1543
+ type: ChannelTypeSchema,
1544
+ metadata: PlatformContactMetadataSchema,
1545
+ contact: z32.object({
1546
+ id: z32.string().uuid(),
1547
+ name: z32.string(),
1548
+ address: z32.string().nullable(),
1549
+ channel: z32.string().nullable(),
1550
+ notes: z32.string().nullable(),
1551
+ contactProfile: z32.string().nullable(),
1552
+ socialProfileUrl: z32.string().nullable(),
1553
+ tags: z32.array(TagSchema).optional(),
1554
+ company: CompanySchema.omit({ customFields: true }).nullable(),
1555
+ // room: z.array(RoomSchema).optional(),
1556
+ customFields: z32.array(ContactCustomFieldSchema).optional(),
1557
+ contactEmails: z32.array(ContactEmailsSchema).optional(),
1558
+ contactPhones: z32.array(ContactPhonesSchema).optional(),
1559
+ activityLogs: z32.array(ContactActivitySchema).optional()
1560
+ })
1561
+ }),
1485
1562
  actor: UserSchema,
1486
1563
  assignee: UserSchema,
1487
1564
  channel: ChannelSchema2,
@@ -1509,9 +1586,9 @@ var receiveMessageContract = initContract7().router(
1509
1586
  }
1510
1587
  },
1511
1588
  {
1512
- baseHeaders: z32.object({
1513
- "x-code": z32.string().uuid(),
1514
- "x-tenant": z32.string().uuid()
1589
+ baseHeaders: z33.object({
1590
+ "x-code": z33.string().uuid(),
1591
+ "x-tenant": z33.string().uuid()
1515
1592
  }),
1516
1593
  pathPrefix: "message"
1517
1594
  }
@@ -1523,11 +1600,11 @@ var mainChatContract = initContract7().router(
1523
1600
  path: "/rooms",
1524
1601
  responses: {
1525
1602
  200: DefaultSuccessResponseSchema.extend({
1526
- total: z32.number(),
1527
- page: z32.number(),
1528
- pageSize: z32.number(),
1529
- data: z32.array(RoomSchema),
1530
- unreadCountsByAssignee: z32.array(UnreadCountsByAssigneeSchema)
1603
+ total: z33.number(),
1604
+ page: z33.number(),
1605
+ pageSize: z33.number(),
1606
+ data: z33.array(RoomSchema),
1607
+ unreadCountsByAssignee: z33.array(UnreadCountsByAssigneeSchema)
1531
1608
  }),
1532
1609
  401: DefaultUnauthorizedSchema
1533
1610
  },
@@ -1537,8 +1614,8 @@ var mainChatContract = initContract7().router(
1537
1614
  getRoomContact: {
1538
1615
  method: "GET",
1539
1616
  path: "/contact/:contactId",
1540
- pathParams: z32.object({
1541
- contactId: z32.string().uuid()
1617
+ pathParams: z33.object({
1618
+ contactId: z33.string().uuid()
1542
1619
  }),
1543
1620
  responses: {
1544
1621
  200: DefaultSuccessResponseSchema.extend({
@@ -1563,7 +1640,7 @@ var mainChatContract = initContract7().router(
1563
1640
  path: "/message",
1564
1641
  body: SendMessageSchema,
1565
1642
  responses: {
1566
- 200: null,
1643
+ 200: SendMessageResponseSchema,
1567
1644
  422: DefaultErrorResponseSchema,
1568
1645
  500: DefaultErrorResponseSchema
1569
1646
  },
@@ -1572,32 +1649,32 @@ var mainChatContract = initContract7().router(
1572
1649
  getRoomsByPlatformContactId: {
1573
1650
  method: "GET",
1574
1651
  path: "/rooms/:platformContactId",
1575
- pathParams: z32.object({
1576
- platformContactId: z32.string()
1652
+ pathParams: z33.object({
1653
+ platformContactId: z33.string()
1577
1654
  }),
1578
1655
  responses: {
1579
1656
  200: DefaultSuccessResponseSchema.extend({
1580
- data: z32.array(
1581
- z32.object({
1582
- id: z32.string().uuid()
1657
+ data: z33.array(
1658
+ z33.object({
1659
+ id: z33.string().uuid()
1583
1660
  })
1584
1661
  ),
1585
- total: z32.number()
1662
+ total: z33.number()
1586
1663
  })
1587
1664
  }
1588
1665
  },
1589
1666
  getMessages: {
1590
1667
  method: "GET",
1591
1668
  path: "/message/:roomId",
1592
- pathParams: z32.object({
1593
- roomId: z32.string().uuid()
1669
+ pathParams: z33.object({
1670
+ roomId: z33.string().uuid()
1594
1671
  }),
1595
1672
  responses: {
1596
1673
  200: DefaultSuccessResponseSchema.extend({
1597
- total: z32.number(),
1598
- page: z32.number(),
1599
- pageSize: z32.number(),
1600
- data: z32.array(MessageSchema)
1674
+ total: z33.number(),
1675
+ page: z33.number(),
1676
+ pageSize: z33.number(),
1677
+ data: z33.array(MessageSchema)
1601
1678
  })
1602
1679
  },
1603
1680
  query: DefaultQueryParamsSchema,
@@ -1610,7 +1687,7 @@ var mainChatContract = initContract7().router(
1610
1687
  responses: {
1611
1688
  200: DefaultSuccessResponseSchema.extend({
1612
1689
  data: RoomSchema.extend({
1613
- solveMessage: z32.string()
1690
+ solveMessage: z33.string()
1614
1691
  })
1615
1692
  }),
1616
1693
  409: DefaultErrorResponseSchema
@@ -1631,8 +1708,8 @@ var mainChatContract = initContract7().router(
1631
1708
  getRoom: {
1632
1709
  method: "GET",
1633
1710
  path: "/room/:roomId",
1634
- pathParams: z32.object({
1635
- roomId: z32.string().uuid()
1711
+ pathParams: z33.object({
1712
+ roomId: z33.string().uuid()
1636
1713
  }),
1637
1714
  responses: {
1638
1715
  200: DefaultSuccessResponseSchema.extend({
@@ -1645,14 +1722,14 @@ var mainChatContract = initContract7().router(
1645
1722
  createRoom: {
1646
1723
  method: "POST",
1647
1724
  path: "/room/create/:platformContactId",
1648
- pathParams: z32.object({
1649
- platformContactId: z32.string().uuid()
1725
+ pathParams: z33.object({
1726
+ platformContactId: z33.string().uuid()
1650
1727
  }),
1651
1728
  responses: {
1652
1729
  200: DefaultSuccessResponseSchema.extend({
1653
1730
  data: RoomSchema.extend({
1654
1731
  contact: ContactSchema,
1655
- openMessage: z32.string()
1732
+ openMessage: z33.string()
1656
1733
  })
1657
1734
  })
1658
1735
  },
@@ -1662,13 +1739,13 @@ var mainChatContract = initContract7().router(
1662
1739
  readRoom: {
1663
1740
  method: "POST",
1664
1741
  path: "/room/:roomid/read",
1665
- pathParams: z32.object({
1666
- roomId: z32.string().uuid()
1742
+ pathParams: z33.object({
1743
+ roomId: z33.string().uuid()
1667
1744
  }),
1668
1745
  responses: {
1669
1746
  200: DefaultSuccessResponseSchema.extend({
1670
1747
  data: RoomSchema.extend({
1671
- description: z32.string().nullable()
1748
+ description: z33.string().nullable()
1672
1749
  })
1673
1750
  })
1674
1751
  },
@@ -1680,10 +1757,10 @@ var mainChatContract = initContract7().router(
1680
1757
  path: "/search",
1681
1758
  responses: {
1682
1759
  200: DefaultSuccessResponseSchema.extend({
1683
- total: z32.number(),
1684
- page: z32.number(),
1685
- pageSize: z32.number(),
1686
- data: z32.array(RoomSchema)
1760
+ total: z33.number(),
1761
+ page: z33.number(),
1762
+ pageSize: z33.number(),
1763
+ data: z33.array(RoomSchema)
1687
1764
  })
1688
1765
  },
1689
1766
  query: SearchRoomsSchema,
@@ -1698,88 +1775,88 @@ var mainChatContract = initContract7().router(
1698
1775
 
1699
1776
  // src/comment/index.ts
1700
1777
  import { initContract as initContract8 } from "@ts-rest/core";
1701
- import z36 from "zod";
1778
+ import z37 from "zod";
1702
1779
 
1703
1780
  // src/comment/validation.ts
1704
- import { z as z33 } from "zod";
1705
- var CreateCommentSchema = z33.object({
1706
- ticketId: z33.string(),
1707
- comment: z33.string(),
1708
- mentions: z33.array(z33.string()).optional()
1781
+ import { z as z34 } from "zod";
1782
+ var CreateCommentSchema = z34.object({
1783
+ ticketId: z34.string(),
1784
+ comment: z34.string(),
1785
+ mentions: z34.array(z34.string()).optional()
1709
1786
  });
1710
1787
  var UpdateCommentSchema = CreateCommentSchema;
1711
- var GetCommentQuerySchema = z33.object({
1712
- ticketId: z33.string().optional(),
1713
- deleted: z33.enum(["true", "false"]).default("false").transform((v) => v === "true" ? true : false)
1788
+ var GetCommentQuerySchema = z34.object({
1789
+ ticketId: z34.string().optional(),
1790
+ deleted: z34.enum(["true", "false"]).default("false").transform((v) => v === "true" ? true : false)
1714
1791
  }).optional();
1715
1792
 
1716
1793
  // src/comment/schema.ts
1717
- import z35 from "zod";
1794
+ import z36 from "zod";
1718
1795
 
1719
1796
  // src/ticket/schema.ts
1720
- import z34 from "zod";
1797
+ import z35 from "zod";
1721
1798
  var TicketCustomFieldSchema = DefaultEntitySchema.extend({
1722
- textValue: z34.string().nullable(),
1723
- booleanValue: z34.boolean().nullable(),
1724
- numberValue: z34.coerce.number().nullable(),
1725
- dateValue: z34.date().nullable(),
1799
+ textValue: z35.string().nullable(),
1800
+ booleanValue: z35.boolean().nullable(),
1801
+ numberValue: z35.coerce.number().nullable(),
1802
+ dateValue: z35.date().nullable(),
1726
1803
  attribute: AttributeSchema.omit({ options: true, group: true }),
1727
- uploads: z34.array(UploadSchema)
1728
- });
1729
- var TicketEntityTypesSchema = z34.object({
1730
- id: z34.string().uuid(),
1731
- createdAt: z34.date(),
1732
- updatedAt: z34.date(),
1733
- deletedAt: z34.date().nullable(),
1734
- entity: z34.string(),
1735
- description: z34.string().nullable()
1736
- });
1737
- var TicketActivitySchema = z34.object({
1738
- id: z34.string().uuid(),
1739
- createdAt: z34.date(),
1740
- updatedAt: z34.date(),
1741
- deletedAt: z34.date().nullable(),
1742
- entityId: z34.string(),
1743
- description: z34.string(),
1804
+ uploads: z35.array(UploadSchema)
1805
+ });
1806
+ var TicketEntityTypesSchema = z35.object({
1807
+ id: z35.string().uuid(),
1808
+ createdAt: z35.date(),
1809
+ updatedAt: z35.date(),
1810
+ deletedAt: z35.date().nullable(),
1811
+ entity: z35.string(),
1812
+ description: z35.string().nullable()
1813
+ });
1814
+ var TicketActivitySchema = z35.object({
1815
+ id: z35.string().uuid(),
1816
+ createdAt: z35.date(),
1817
+ updatedAt: z35.date(),
1818
+ deletedAt: z35.date().nullable(),
1819
+ entityId: z35.string(),
1820
+ description: z35.string(),
1744
1821
  entityType: TicketEntityTypesSchema
1745
1822
  });
1746
1823
  var TicketSchema = DefaultEntitySchema.extend({
1747
- title: z34.string(),
1748
- description: z34.string().nullable(),
1749
- type: z34.string(),
1750
- channel: z34.string(),
1751
- priority: z34.string(),
1752
- status: z34.string(),
1753
- contactId: z34.string().uuid(),
1754
- creatorId: z34.string().uuid(),
1824
+ title: z35.string(),
1825
+ description: z35.string().nullable(),
1826
+ type: z35.string(),
1827
+ channel: z35.string(),
1828
+ priority: z35.string(),
1829
+ status: z35.string(),
1830
+ contactId: z35.string().uuid(),
1831
+ creatorId: z35.string().uuid(),
1755
1832
  creator: UserSchema.optional().nullable(),
1756
- assigneeId: z34.string().uuid(),
1833
+ assigneeId: z35.string().uuid(),
1757
1834
  assignee: UserSchema.optional().nullable(),
1758
1835
  //note: all user info is actually not included, check with reponse data
1759
- reasonToAssign: z34.string().nullable(),
1760
- ticketNumber: z34.coerce.number().optional(),
1761
- customFields: z34.array(TicketCustomFieldSchema),
1762
- tags: z34.array(TagSchema),
1763
- categories: z34.array(CategorySchema),
1836
+ reasonToAssign: z35.string().nullable(),
1837
+ ticketNumber: z35.coerce.number().optional(),
1838
+ customFields: z35.array(TicketCustomFieldSchema),
1839
+ tags: z35.array(TagSchema),
1840
+ categories: z35.array(CategorySchema),
1764
1841
  contact: ContactSchema
1765
1842
  });
1766
- var TicketCountByContactSchema = z34.object({
1767
- total: z34.coerce.number(),
1768
- open: z34.coerce.number(),
1769
- pending: z34.coerce.number(),
1770
- closed: z34.coerce.number(),
1771
- solved: z34.coerce.number()
1843
+ var TicketCountByContactSchema = z35.object({
1844
+ total: z35.coerce.number(),
1845
+ open: z35.coerce.number(),
1846
+ pending: z35.coerce.number(),
1847
+ closed: z35.coerce.number(),
1848
+ solved: z35.coerce.number()
1772
1849
  });
1773
1850
 
1774
1851
  // src/comment/schema.ts
1775
- var CommentSchema = z35.object({
1776
- id: z35.string().uuid(),
1777
- createdAt: z35.date(),
1778
- updatedAt: z35.date(),
1779
- deletedAt: z35.date().nullable(),
1780
- activityLogs: z35.array(ActivityLogSchema),
1781
- comment: z35.string(),
1782
- mentions: z35.array(z35.string()),
1852
+ var CommentSchema = z36.object({
1853
+ id: z36.string().uuid(),
1854
+ createdAt: z36.date(),
1855
+ updatedAt: z36.date(),
1856
+ deletedAt: z36.date().nullable(),
1857
+ activityLogs: z36.array(ActivityLogSchema),
1858
+ comment: z36.string(),
1859
+ mentions: z36.array(z36.string()),
1783
1860
  ticket: TicketSchema,
1784
1861
  agent: UserSchema
1785
1862
  });
@@ -1796,8 +1873,8 @@ var commentContract = initContract8().router(
1796
1873
  201: DefaultSuccessResponseSchema.extend({
1797
1874
  comment: CommentSchema
1798
1875
  }),
1799
- 400: z36.object({
1800
- message: z36.string()
1876
+ 400: z37.object({
1877
+ message: z37.string()
1801
1878
  }),
1802
1879
  401: DefaultUnauthorizedSchema,
1803
1880
  500: DefaultErrorResponseSchema
@@ -1810,9 +1887,9 @@ var commentContract = initContract8().router(
1810
1887
  headers: DefaultHeaderSchema,
1811
1888
  query: GetCommentQuerySchema,
1812
1889
  responses: {
1813
- 201: z36.array(CommentSchema),
1814
- 400: z36.object({
1815
- message: z36.string()
1890
+ 201: z37.array(CommentSchema),
1891
+ 400: z37.object({
1892
+ message: z37.string()
1816
1893
  }),
1817
1894
  401: DefaultUnauthorizedSchema,
1818
1895
  500: DefaultErrorResponseSchema
@@ -1822,7 +1899,7 @@ var commentContract = initContract8().router(
1822
1899
  updateComment: {
1823
1900
  method: "PATCH",
1824
1901
  path: "/:id",
1825
- pathParams: z36.object({ id: z36.string() }),
1902
+ pathParams: z37.object({ id: z37.string() }),
1826
1903
  headers: DefaultHeaderSchema,
1827
1904
  body: UpdateCommentSchema,
1828
1905
  responses: {
@@ -1836,11 +1913,11 @@ var commentContract = initContract8().router(
1836
1913
  deleteComment: {
1837
1914
  method: "DELETE",
1838
1915
  path: "/:id",
1839
- pathParams: z36.object({ id: z36.string() }),
1916
+ pathParams: z37.object({ id: z37.string() }),
1840
1917
  headers: DefaultHeaderSchema,
1841
1918
  body: null,
1842
1919
  responses: {
1843
- 200: DefaultSuccessResponseSchema.extend({ message: z36.string() }),
1920
+ 200: DefaultSuccessResponseSchema.extend({ message: z37.string() }),
1844
1921
  500: DefaultErrorResponseSchema
1845
1922
  },
1846
1923
  summary: "Delete a comment."
@@ -1851,61 +1928,61 @@ var commentContract = initContract8().router(
1851
1928
 
1852
1929
  // src/company/index.ts
1853
1930
  import { initContract as initContract9 } from "@ts-rest/core";
1854
- import z38 from "zod";
1931
+ import z39 from "zod";
1855
1932
 
1856
1933
  // src/company/validation.ts
1857
- import z37 from "zod";
1858
- var BaseSchema = z37.object({
1859
- isRequired: z37.boolean(),
1860
- attributeId: z37.string().uuid()
1934
+ import z38 from "zod";
1935
+ var BaseSchema = z38.object({
1936
+ isRequired: z38.boolean(),
1937
+ attributeId: z38.string().uuid()
1861
1938
  });
1862
1939
  var CompanyContractsValidationSchema = {
1863
1940
  create: {
1864
- request: z37.object({
1865
- name: z37.object({ value: z37.string() }),
1866
- phone: z37.object({ value: z37.string() }),
1867
- address: z37.object({ value: z37.string() }),
1868
- industry: z37.object({ value: z37.string() }),
1869
- customFields: z37.array(
1941
+ request: z38.object({
1942
+ name: z38.object({ value: z38.string() }),
1943
+ phone: z38.object({ value: z38.string() }),
1944
+ address: z38.object({ value: z38.string() }),
1945
+ industry: z38.object({ value: z38.string() }),
1946
+ customFields: z38.array(
1870
1947
  BaseSchema.extend({
1871
- value: z37.union([z37.string(), z37.array(z37.string())]),
1872
- type: z37.string(),
1873
- isDefaultAttribute: z37.boolean()
1948
+ value: z38.union([z38.string(), z38.array(z38.string())]),
1949
+ type: z38.string(),
1950
+ isDefaultAttribute: z38.boolean()
1874
1951
  })
1875
1952
  )
1876
1953
  }),
1877
1954
  response: CompanySchema
1878
1955
  },
1879
1956
  getById: {
1880
- request: z37.object({
1881
- id: z37.string().uuid()
1957
+ request: z38.object({
1958
+ id: z38.string().uuid()
1882
1959
  }),
1883
1960
  response: CompanySchema
1884
1961
  },
1885
1962
  getAll: {
1886
- request: z37.object({
1887
- page: z37.coerce.number().default(1),
1888
- pageSize: z37.coerce.number().default(10),
1889
- keyword: z37.string().optional(),
1890
- industry: z37.array(z37.string()),
1891
- name: z37.string(),
1892
- address: z37.string(),
1893
- phone: z37.string(),
1894
- selectedDate: z37.string(),
1895
- customFields: z37.array(
1896
- z37.object({
1897
- attributeId: z37.string().uuid(),
1898
- type: z37.string(),
1899
- value: z37.union([z37.string(), z37.array(z37.string())])
1963
+ request: z38.object({
1964
+ page: z38.coerce.number().default(1),
1965
+ pageSize: z38.coerce.number().default(10),
1966
+ keyword: z38.string().optional(),
1967
+ industry: z38.array(z38.string()),
1968
+ name: z38.string(),
1969
+ address: z38.string(),
1970
+ phone: z38.string(),
1971
+ selectedDate: z38.string(),
1972
+ customFields: z38.array(
1973
+ z38.object({
1974
+ attributeId: z38.string().uuid(),
1975
+ type: z38.string(),
1976
+ value: z38.union([z38.string(), z38.array(z38.string())])
1900
1977
  })
1901
1978
  )
1902
1979
  }).partial(),
1903
1980
  response: {
1904
- page: z37.number(),
1905
- pageSize: z37.number(),
1906
- total: z37.number(),
1907
- lastPage: z37.number(),
1908
- data: z37.array(CompanySchema)
1981
+ page: z38.number(),
1982
+ pageSize: z38.number(),
1983
+ total: z38.number(),
1984
+ lastPage: z38.number(),
1985
+ data: z38.array(CompanySchema)
1909
1986
  }
1910
1987
  }
1911
1988
  };
@@ -1920,14 +1997,14 @@ var companyContract = initContract9().router(
1920
1997
  201: DefaultSuccessResponseSchema.extend({
1921
1998
  data: CompanyContractsValidationSchema.create.response
1922
1999
  }),
1923
- 400: z38.object({
1924
- message: z38.string()
2000
+ 400: z39.object({
2001
+ message: z39.string()
1925
2002
  }),
1926
- 409: z38.object({
1927
- message: z38.string()
2003
+ 409: z39.object({
2004
+ message: z39.string()
1928
2005
  }),
1929
- 500: z38.object({
1930
- message: z38.string()
2006
+ 500: z39.object({
2007
+ message: z39.string()
1931
2008
  }),
1932
2009
  401: DefaultUnauthorizedSchema,
1933
2010
  404: DefaultNotFoundSchema,
@@ -1939,21 +2016,21 @@ var companyContract = initContract9().router(
1939
2016
  update: {
1940
2017
  method: "PATCH",
1941
2018
  path: "/:id",
1942
- pathParams: z38.object({
1943
- id: z38.string().uuid()
2019
+ pathParams: z39.object({
2020
+ id: z39.string().uuid()
1944
2021
  }),
1945
2022
  responses: {
1946
2023
  201: DefaultSuccessResponseSchema.extend({
1947
2024
  data: CompanyContractsValidationSchema.create.response
1948
2025
  }),
1949
- 400: z38.object({
1950
- message: z38.string()
2026
+ 400: z39.object({
2027
+ message: z39.string()
1951
2028
  }),
1952
- 409: z38.object({
1953
- message: z38.string()
2029
+ 409: z39.object({
2030
+ message: z39.string()
1954
2031
  }),
1955
- 500: z38.object({
1956
- message: z38.string()
2032
+ 500: z39.object({
2033
+ message: z39.string()
1957
2034
  }),
1958
2035
  401: DefaultUnauthorizedSchema,
1959
2036
  404: DefaultNotFoundSchema,
@@ -1965,21 +2042,21 @@ var companyContract = initContract9().router(
1965
2042
  delete: {
1966
2043
  method: "DELETE",
1967
2044
  path: "/:id",
1968
- pathParams: z38.object({
1969
- id: z38.string().uuid()
2045
+ pathParams: z39.object({
2046
+ id: z39.string().uuid()
1970
2047
  }),
1971
2048
  responses: {
1972
2049
  201: DefaultSuccessResponseSchema.extend({
1973
- message: z38.string()
2050
+ message: z39.string()
1974
2051
  }),
1975
- 400: z38.object({
1976
- message: z38.string()
2052
+ 400: z39.object({
2053
+ message: z39.string()
1977
2054
  }),
1978
- 409: z38.object({
1979
- message: z38.string()
2055
+ 409: z39.object({
2056
+ message: z39.string()
1980
2057
  }),
1981
- 500: z38.object({
1982
- message: z38.string()
2058
+ 500: z39.object({
2059
+ message: z39.string()
1983
2060
  }),
1984
2061
  401: DefaultUnauthorizedSchema,
1985
2062
  404: DefaultNotFoundSchema,
@@ -1996,14 +2073,14 @@ var companyContract = initContract9().router(
1996
2073
  200: DefaultSuccessResponseSchema.extend({
1997
2074
  data: CompanyContractsValidationSchema.create.response
1998
2075
  }),
1999
- 400: z38.object({
2000
- message: z38.string()
2076
+ 400: z39.object({
2077
+ message: z39.string()
2001
2078
  }),
2002
- 409: z38.object({
2003
- message: z38.string()
2079
+ 409: z39.object({
2080
+ message: z39.string()
2004
2081
  }),
2005
- 500: z38.object({
2006
- message: z38.string()
2082
+ 500: z39.object({
2083
+ message: z39.string()
2007
2084
  }),
2008
2085
  401: DefaultUnauthorizedSchema,
2009
2086
  404: DefaultNotFoundSchema,
@@ -2019,14 +2096,14 @@ var companyContract = initContract9().router(
2019
2096
  200: DefaultSuccessResponseSchema.extend({
2020
2097
  ...CompanyContractsValidationSchema.getAll.response
2021
2098
  }),
2022
- 400: z38.object({
2023
- message: z38.string()
2099
+ 400: z39.object({
2100
+ message: z39.string()
2024
2101
  }),
2025
- 409: z38.object({
2026
- message: z38.string()
2102
+ 409: z39.object({
2103
+ message: z39.string()
2027
2104
  }),
2028
- 500: z38.object({
2029
- message: z38.string()
2105
+ 500: z39.object({
2106
+ message: z39.string()
2030
2107
  }),
2031
2108
  401: DefaultUnauthorizedSchema,
2032
2109
  404: DefaultNotFoundSchema,
@@ -2042,99 +2119,99 @@ var companyContract = initContract9().router(
2042
2119
 
2043
2120
  // src/contact/index.ts
2044
2121
  import { initContract as initContract10 } from "@ts-rest/core";
2045
- import z40 from "zod";
2122
+ import z41 from "zod";
2046
2123
 
2047
2124
  // src/contact/validation.ts
2048
- import z39 from "zod";
2049
- var BaseSchema2 = z39.object({
2050
- isRequired: z39.boolean(),
2051
- attributeId: z39.string()
2125
+ import z40 from "zod";
2126
+ var BaseSchema2 = z40.object({
2127
+ isRequired: z40.boolean(),
2128
+ attributeId: z40.string()
2052
2129
  });
2053
2130
  var SingleValue = {
2054
- value: z39.string()
2131
+ value: z40.string()
2055
2132
  };
2056
2133
  var ContactContractValidationSchema = {
2057
2134
  create: {
2058
- request: z39.object({
2135
+ request: z40.object({
2059
2136
  name: BaseSchema2.extend(SingleValue),
2060
2137
  email: BaseSchema2.extend({
2061
- value: z39.array(
2062
- z39.object({
2063
- email: z39.string(),
2064
- isPrimary: z39.boolean()
2138
+ value: z40.array(
2139
+ z40.object({
2140
+ email: z40.string(),
2141
+ isPrimary: z40.boolean()
2065
2142
  })
2066
2143
  )
2067
2144
  }),
2068
2145
  channel: BaseSchema2.extend(SingleValue),
2069
2146
  address: BaseSchema2.extend(SingleValue),
2070
2147
  phone: BaseSchema2.extend({
2071
- value: z39.array(
2072
- z39.object({
2073
- phone: z39.string(),
2074
- isPrimary: z39.boolean()
2148
+ value: z40.array(
2149
+ z40.object({
2150
+ phone: z40.string(),
2151
+ isPrimary: z40.boolean()
2075
2152
  })
2076
2153
  )
2077
2154
  }).optional(),
2078
2155
  notes: BaseSchema2.extend(SingleValue),
2079
2156
  tags: BaseSchema2.extend({
2080
- value: z39.array(z39.string())
2157
+ value: z40.array(z40.string())
2081
2158
  }),
2082
2159
  company: BaseSchema2.extend(SingleValue),
2083
- customFields: z39.array(
2160
+ customFields: z40.array(
2084
2161
  BaseSchema2.extend({
2085
- value: z39.union([z39.string(), z39.array(z39.string())]),
2086
- type: z39.string(),
2087
- isDefaultAttribute: z39.boolean()
2162
+ value: z40.union([z40.string(), z40.array(z40.string())]),
2163
+ type: z40.string(),
2164
+ isDefaultAttribute: z40.boolean()
2088
2165
  })
2089
2166
  )
2090
2167
  }),
2091
- response: z39.string()
2168
+ response: z40.string()
2092
2169
  },
2093
2170
  getById: {
2094
- request: z39.object({
2095
- id: z39.string().uuid()
2171
+ request: z40.object({
2172
+ id: z40.string().uuid()
2096
2173
  }),
2097
2174
  response: ContactSchema
2098
2175
  },
2099
2176
  delete: {
2100
- request: z39.object({
2101
- id: z39.string().uuid()
2177
+ request: z40.object({
2178
+ id: z40.string().uuid()
2102
2179
  }),
2103
- response: z39.string()
2180
+ response: z40.string()
2104
2181
  },
2105
2182
  getAll: {
2106
- request: z39.object({
2107
- page: z39.coerce.number().default(1),
2108
- pageSize: z39.coerce.number().default(10),
2109
- keyword: z39.string().optional(),
2110
- company: z39.array(z39.string().uuid()),
2111
- name: z39.string(),
2112
- address: z39.string(),
2113
- channel: z39.array(z39.string()),
2114
- selectedDate: z39.string(),
2115
- customFields: z39.array(
2116
- z39.object({
2117
- attributeId: z39.string().uuid(),
2118
- type: z39.string(),
2119
- value: z39.union([z39.string(), z39.array(z39.string())])
2183
+ request: z40.object({
2184
+ page: z40.coerce.number().default(1),
2185
+ pageSize: z40.coerce.number().default(10),
2186
+ keyword: z40.string().optional(),
2187
+ company: z40.array(z40.string().uuid()),
2188
+ name: z40.string(),
2189
+ address: z40.string(),
2190
+ channel: z40.array(z40.string()),
2191
+ selectedDate: z40.string(),
2192
+ customFields: z40.array(
2193
+ z40.object({
2194
+ attributeId: z40.string().uuid(),
2195
+ type: z40.string(),
2196
+ value: z40.union([z40.string(), z40.array(z40.string())])
2120
2197
  })
2121
2198
  ),
2122
- tags: z39.array(z39.string().uuid()),
2123
- phone: z39.string(),
2124
- email: z39.string(),
2125
- notes: z39.string()
2199
+ tags: z40.array(z40.string().uuid()),
2200
+ phone: z40.string(),
2201
+ email: z40.string(),
2202
+ notes: z40.string()
2126
2203
  }).partial(),
2127
2204
  response: {
2128
- page: z39.number(),
2129
- pageSize: z39.number(),
2130
- total: z39.number(),
2131
- lastPage: z39.number(),
2132
- data: z39.array(ContactSchema)
2205
+ page: z40.number(),
2206
+ pageSize: z40.number(),
2207
+ total: z40.number(),
2208
+ lastPage: z40.number(),
2209
+ data: z40.array(ContactSchema)
2133
2210
  }
2134
2211
  },
2135
2212
  createContactByPhone: {
2136
- request: z39.object({
2137
- phoneNumber: z39.string().refine(
2213
+ request: z40.object({
2214
+ phoneNumber: z40.string().refine(
2138
2215
  (value) => {
2139
2216
  const numericValue = value.replace(/\s/g, "");
2140
2217
  return /^\d+$/.test(numericValue);
@@ -2147,8 +2224,8 @@ var ContactContractValidationSchema = {
2147
2224
  response: ContactSchema
2148
2225
  },
2149
2226
  updateContactByPhone: {
2150
- request: z39.object({
2151
- phoneNumber: z39.string().refine(
2227
+ request: z40.object({
2228
+ phoneNumber: z40.string().refine(
2152
2229
  (value) => {
2153
2230
  const numericValue = value.replace(/\s/g, "");
2154
2231
  return /^\d+$/.test(numericValue);
@@ -2161,68 +2238,68 @@ var ContactContractValidationSchema = {
2161
2238
  response: ContactSchema
2162
2239
  },
2163
2240
  updateFromOngoingCall: {
2164
- request: z39.object({
2165
- name: z39.string(),
2166
- companyId: z39.string().uuid()
2241
+ request: z40.object({
2242
+ name: z40.string(),
2243
+ companyId: z40.string().uuid()
2167
2244
  }).partial(),
2168
2245
  response: ContactSchema
2169
2246
  },
2170
2247
  merge: {
2171
- request: z39.object({
2172
- primaryContactId: z39.string().uuid(),
2173
- emails: z39.array(
2174
- z39.object({
2175
- email: z39.string(),
2176
- isPrimary: z39.boolean()
2248
+ request: z40.object({
2249
+ primaryContactId: z40.string().uuid(),
2250
+ emails: z40.array(
2251
+ z40.object({
2252
+ email: z40.string(),
2253
+ isPrimary: z40.boolean()
2177
2254
  })
2178
2255
  ),
2179
- phones: z39.array(
2180
- z39.object({
2181
- phone: z39.string(),
2182
- isPrimary: z39.boolean()
2256
+ phones: z40.array(
2257
+ z40.object({
2258
+ phone: z40.string(),
2259
+ isPrimary: z40.boolean()
2183
2260
  })
2184
2261
  ),
2185
- otherContacts: z39.array(z39.string().uuid())
2262
+ otherContacts: z40.array(z40.string().uuid())
2186
2263
  }),
2187
2264
  response: ContactSchema
2188
2265
  },
2189
2266
  checkContactPhone: {
2190
- request: z39.object({
2191
- contactId: z39.string().uuid().optional(),
2192
- phoneNumber: z39.string()
2267
+ request: z40.object({
2268
+ contactId: z40.string().uuid().optional(),
2269
+ phoneNumber: z40.string()
2193
2270
  }),
2194
- response: z39.boolean()
2271
+ response: z40.boolean()
2195
2272
  },
2196
2273
  checkContactEmail: {
2197
- request: z39.object({
2198
- contactId: z39.string().uuid().optional(),
2199
- email: z39.string()
2274
+ request: z40.object({
2275
+ contactId: z40.string().uuid().optional(),
2276
+ email: z40.string()
2200
2277
  }),
2201
- response: z39.boolean()
2278
+ response: z40.boolean()
2202
2279
  },
2203
2280
  filterContacts: {
2204
- request: z39.object({
2205
- page: z39.coerce.number().default(1),
2206
- pageSize: z39.coerce.number().default(10),
2207
- keyword: z39.string()
2281
+ request: z40.object({
2282
+ page: z40.coerce.number().default(1),
2283
+ pageSize: z40.coerce.number().default(10),
2284
+ keyword: z40.string()
2208
2285
  }).partial(),
2209
2286
  response: {
2210
- page: z39.number(),
2211
- pageSize: z39.number(),
2212
- total: z39.number(),
2213
- lastPage: z39.number(),
2214
- data: z39.array(ContactSchema)
2287
+ page: z40.number(),
2288
+ pageSize: z40.number(),
2289
+ total: z40.number(),
2290
+ lastPage: z40.number(),
2291
+ data: z40.array(ContactSchema)
2215
2292
  }
2216
2293
  },
2217
2294
  addAttachments: {
2218
- request: z39.object({
2219
- attributeId: z39.string().uuid(),
2220
- attachments: z39.array(
2221
- z39.object({
2222
- bucketName: z39.string(),
2223
- fileKey: z39.string(),
2224
- fileName: z39.string(),
2225
- fileSize: z39.coerce.number()
2295
+ request: z40.object({
2296
+ attributeId: z40.string().uuid(),
2297
+ attachments: z40.array(
2298
+ z40.object({
2299
+ bucketName: z40.string(),
2300
+ fileKey: z40.string(),
2301
+ fileName: z40.string(),
2302
+ fileSize: z40.coerce.number()
2226
2303
  })
2227
2304
  ).optional()
2228
2305
  }),
@@ -2240,14 +2317,14 @@ var contactContract = initContract10().router(
2240
2317
  201: DefaultSuccessResponseSchema.extend({
2241
2318
  message: ContactContractValidationSchema.create.response
2242
2319
  }),
2243
- 400: z40.object({
2244
- message: z40.string()
2320
+ 400: z41.object({
2321
+ message: z41.string()
2245
2322
  }),
2246
- 409: z40.object({
2247
- message: z40.string()
2323
+ 409: z41.object({
2324
+ message: z41.string()
2248
2325
  }),
2249
- 500: z40.object({
2250
- message: z40.string()
2326
+ 500: z41.object({
2327
+ message: z41.string()
2251
2328
  }),
2252
2329
  401: DefaultUnauthorizedSchema,
2253
2330
  404: DefaultNotFoundSchema,
@@ -2264,14 +2341,14 @@ var contactContract = initContract10().router(
2264
2341
  200: DefaultSuccessResponseSchema.extend(
2265
2342
  ContactContractValidationSchema.getAll.response
2266
2343
  ),
2267
- 400: z40.object({
2268
- message: z40.string()
2344
+ 400: z41.object({
2345
+ message: z41.string()
2269
2346
  }),
2270
- 409: z40.object({
2271
- message: z40.string()
2347
+ 409: z41.object({
2348
+ message: z41.string()
2272
2349
  }),
2273
- 500: z40.object({
2274
- message: z40.string()
2350
+ 500: z41.object({
2351
+ message: z41.string()
2275
2352
  }),
2276
2353
  401: DefaultUnauthorizedSchema,
2277
2354
  404: DefaultNotFoundSchema,
@@ -2287,14 +2364,14 @@ var contactContract = initContract10().router(
2287
2364
  200: DefaultSuccessResponseSchema.extend(
2288
2365
  ContactContractValidationSchema.filterContacts.response
2289
2366
  ),
2290
- 400: z40.object({
2291
- message: z40.string()
2367
+ 400: z41.object({
2368
+ message: z41.string()
2292
2369
  }),
2293
- 409: z40.object({
2294
- message: z40.string()
2370
+ 409: z41.object({
2371
+ message: z41.string()
2295
2372
  }),
2296
- 500: z40.object({
2297
- message: z40.string()
2373
+ 500: z41.object({
2374
+ message: z41.string()
2298
2375
  }),
2299
2376
  401: DefaultUnauthorizedSchema,
2300
2377
  404: DefaultNotFoundSchema,
@@ -2310,14 +2387,14 @@ var contactContract = initContract10().router(
2310
2387
  200: DefaultSuccessResponseSchema.extend({
2311
2388
  data: ContactContractValidationSchema.getById.response
2312
2389
  }),
2313
- 400: z40.object({
2314
- message: z40.string()
2390
+ 400: z41.object({
2391
+ message: z41.string()
2315
2392
  }),
2316
- 409: z40.object({
2317
- message: z40.string()
2393
+ 409: z41.object({
2394
+ message: z41.string()
2318
2395
  }),
2319
- 500: z40.object({
2320
- message: z40.string()
2396
+ 500: z41.object({
2397
+ message: z41.string()
2321
2398
  }),
2322
2399
  401: DefaultUnauthorizedSchema,
2323
2400
  404: DefaultNotFoundSchema,
@@ -2334,14 +2411,14 @@ var contactContract = initContract10().router(
2334
2411
  200: DefaultSuccessResponseSchema.extend({
2335
2412
  message: ContactContractValidationSchema.delete.response
2336
2413
  }),
2337
- 400: z40.object({
2338
- message: z40.string()
2414
+ 400: z41.object({
2415
+ message: z41.string()
2339
2416
  }),
2340
- 409: z40.object({
2341
- message: z40.string()
2417
+ 409: z41.object({
2418
+ message: z41.string()
2342
2419
  }),
2343
- 500: z40.object({
2344
- message: z40.string()
2420
+ 500: z41.object({
2421
+ message: z41.string()
2345
2422
  }),
2346
2423
  401: DefaultUnauthorizedSchema,
2347
2424
  404: DefaultNotFoundSchema,
@@ -2357,14 +2434,14 @@ var contactContract = initContract10().router(
2357
2434
  201: DefaultSuccessResponseSchema.extend({
2358
2435
  data: ContactContractValidationSchema.createContactByPhone.response
2359
2436
  }),
2360
- 400: z40.object({
2361
- message: z40.string()
2437
+ 400: z41.object({
2438
+ message: z41.string()
2362
2439
  }),
2363
- 409: z40.object({
2364
- message: z40.string()
2440
+ 409: z41.object({
2441
+ message: z41.string()
2365
2442
  }),
2366
- 500: z40.object({
2367
- message: z40.string()
2443
+ 500: z41.object({
2444
+ message: z41.string()
2368
2445
  }),
2369
2446
  401: DefaultUnauthorizedSchema,
2370
2447
  404: DefaultNotFoundSchema,
@@ -2380,14 +2457,14 @@ var contactContract = initContract10().router(
2380
2457
  201: DefaultSuccessResponseSchema.extend({
2381
2458
  data: ContactContractValidationSchema.updateFromOngoingCall.response
2382
2459
  }),
2383
- 400: z40.object({
2384
- message: z40.string()
2460
+ 400: z41.object({
2461
+ message: z41.string()
2385
2462
  }),
2386
- 409: z40.object({
2387
- message: z40.string()
2463
+ 409: z41.object({
2464
+ message: z41.string()
2388
2465
  }),
2389
- 500: z40.object({
2390
- message: z40.string()
2466
+ 500: z41.object({
2467
+ message: z41.string()
2391
2468
  }),
2392
2469
  401: DefaultUnauthorizedSchema,
2393
2470
  404: DefaultNotFoundSchema,
@@ -2403,14 +2480,14 @@ var contactContract = initContract10().router(
2403
2480
  200: DefaultSuccessResponseSchema.extend({
2404
2481
  data: ContactContractValidationSchema.merge.response
2405
2482
  }),
2406
- 400: z40.object({
2407
- message: z40.string()
2483
+ 400: z41.object({
2484
+ message: z41.string()
2408
2485
  }),
2409
- 409: z40.object({
2410
- message: z40.string()
2486
+ 409: z41.object({
2487
+ message: z41.string()
2411
2488
  }),
2412
- 500: z40.object({
2413
- message: z40.string()
2489
+ 500: z41.object({
2490
+ message: z41.string()
2414
2491
  }),
2415
2492
  401: DefaultUnauthorizedSchema,
2416
2493
  404: DefaultNotFoundSchema,
@@ -2426,14 +2503,14 @@ var contactContract = initContract10().router(
2426
2503
  200: DefaultSuccessResponseSchema.extend({
2427
2504
  existed: ContactContractValidationSchema.checkContactPhone.response
2428
2505
  }),
2429
- 400: z40.object({
2430
- message: z40.string()
2506
+ 400: z41.object({
2507
+ message: z41.string()
2431
2508
  }),
2432
- 409: z40.object({
2433
- message: z40.string()
2509
+ 409: z41.object({
2510
+ message: z41.string()
2434
2511
  }),
2435
- 500: z40.object({
2436
- message: z40.string()
2512
+ 500: z41.object({
2513
+ message: z41.string()
2437
2514
  }),
2438
2515
  401: DefaultUnauthorizedSchema,
2439
2516
  404: DefaultNotFoundSchema,
@@ -2449,14 +2526,14 @@ var contactContract = initContract10().router(
2449
2526
  200: DefaultSuccessResponseSchema.extend({
2450
2527
  existed: ContactContractValidationSchema.checkContactEmail.response
2451
2528
  }),
2452
- 400: z40.object({
2453
- message: z40.string()
2529
+ 400: z41.object({
2530
+ message: z41.string()
2454
2531
  }),
2455
- 409: z40.object({
2456
- message: z40.string()
2532
+ 409: z41.object({
2533
+ message: z41.string()
2457
2534
  }),
2458
- 500: z40.object({
2459
- message: z40.string()
2535
+ 500: z41.object({
2536
+ message: z41.string()
2460
2537
  }),
2461
2538
  401: DefaultUnauthorizedSchema,
2462
2539
  404: DefaultNotFoundSchema,
@@ -2468,21 +2545,21 @@ var contactContract = initContract10().router(
2468
2545
  addAttachments: {
2469
2546
  method: "POST",
2470
2547
  path: "/:id/attachments",
2471
- pathParams: z40.object({
2472
- id: z40.string().uuid()
2548
+ pathParams: z41.object({
2549
+ id: z41.string().uuid()
2473
2550
  }),
2474
2551
  responses: {
2475
2552
  201: DefaultSuccessResponseSchema.extend({
2476
2553
  message: ContactContractValidationSchema.addAttachments.response
2477
2554
  }),
2478
- 400: z40.object({
2479
- message: z40.string()
2555
+ 400: z41.object({
2556
+ message: z41.string()
2480
2557
  }),
2481
- 409: z40.object({
2482
- message: z40.string()
2558
+ 409: z41.object({
2559
+ message: z41.string()
2483
2560
  }),
2484
- 500: z40.object({
2485
- message: z40.string()
2561
+ 500: z41.object({
2562
+ message: z41.string()
2486
2563
  }),
2487
2564
  401: DefaultUnauthorizedSchema,
2488
2565
  404: DefaultNotFoundSchema,
@@ -2499,14 +2576,14 @@ var contactContract = initContract10().router(
2499
2576
  200: DefaultSuccessResponseSchema.extend({
2500
2577
  data: ContactContractValidationSchema.getById.response
2501
2578
  }),
2502
- 400: z40.object({
2503
- message: z40.string()
2579
+ 400: z41.object({
2580
+ message: z41.string()
2504
2581
  }),
2505
- 409: z40.object({
2506
- message: z40.string()
2582
+ 409: z41.object({
2583
+ message: z41.string()
2507
2584
  }),
2508
- 500: z40.object({
2509
- message: z40.string()
2585
+ 500: z41.object({
2586
+ message: z41.string()
2510
2587
  }),
2511
2588
  401: DefaultUnauthorizedSchema,
2512
2589
  404: DefaultNotFoundSchema,
@@ -2523,45 +2600,45 @@ var contactContract = initContract10().router(
2523
2600
 
2524
2601
  // src/cx-log/index.ts
2525
2602
  import { initContract as initContract11 } from "@ts-rest/core";
2526
- import z42 from "zod";
2603
+ import z43 from "zod";
2527
2604
 
2528
2605
  // src/cx-log/validation.ts
2529
- import z41 from "zod";
2530
- var sentimentScoreSchema = z41.union([
2531
- z41.literal("positive"),
2532
- z41.literal("negative")
2606
+ import z42 from "zod";
2607
+ var sentimentScoreSchema = z42.union([
2608
+ z42.literal("positive"),
2609
+ z42.literal("negative")
2533
2610
  ]);
2534
- var CustomFieldQueryParamsSchema = z41.object({
2535
- attributeId: z41.string(),
2536
- value: z41.union([z41.string(), z41.array(z41.string())]),
2537
- type: z41.string().optional()
2611
+ var CustomFieldQueryParamsSchema = z42.object({
2612
+ attributeId: z42.string(),
2613
+ value: z42.union([z42.string(), z42.array(z42.string())]),
2614
+ type: z42.string().optional()
2538
2615
  });
2539
2616
  var GetAllCxLogQueryParamsSchema = DefaultQueryParamsSchema.extend({
2540
- contactId: z41.string().uuid(),
2541
- caseId: z41.string(),
2542
- channelIds: z41.array(z41.string().uuid()),
2543
- queueId: z41.array(z41.string()),
2544
- agentIds: z41.array(z41.string()),
2545
- direction: z41.array(z41.union([z41.literal("inbound"), z41.literal("outbound")])),
2546
- disposition: z41.array(z41.string()),
2547
- sentimentScore: z41.array(sentimentScoreSchema),
2548
- csatScore: z41.string(),
2549
- sla: z41.array(z41.union([z41.literal("meet"), z41.literal("unmeet")])),
2550
- tags: z41.array(z41.string()),
2617
+ contactId: z42.string().uuid(),
2618
+ caseId: z42.string(),
2619
+ channelIds: z42.array(z42.string().uuid()),
2620
+ queueId: z42.array(z42.string()),
2621
+ agentIds: z42.array(z42.string()),
2622
+ direction: z42.array(z42.union([z42.literal("inbound"), z42.literal("outbound")])),
2623
+ disposition: z42.array(z42.string()),
2624
+ sentimentScore: z42.array(sentimentScoreSchema),
2625
+ csatScore: z42.string(),
2626
+ sla: z42.array(z42.union([z42.literal("meet"), z42.literal("unmeet")])),
2627
+ tags: z42.array(z42.string()),
2551
2628
  // General tags
2552
2629
  // Default contact attributes
2553
- name: z41.string(),
2554
- contactLabels: z41.array(z41.string()),
2555
- email: z41.string(),
2556
- channel: z41.array(z41.string()),
2557
- phone: z41.string(),
2558
- notes: z41.string(),
2559
- address: z41.string(),
2560
- company: z41.array(z41.string()),
2630
+ name: z42.string(),
2631
+ contactLabels: z42.array(z42.string()),
2632
+ email: z42.string(),
2633
+ channel: z42.array(z42.string()),
2634
+ phone: z42.string(),
2635
+ notes: z42.string(),
2636
+ address: z42.string(),
2637
+ company: z42.array(z42.string()),
2561
2638
  // Custom fields
2562
- customFields: z41.array(CustomFieldQueryParamsSchema),
2639
+ customFields: z42.array(CustomFieldQueryParamsSchema),
2563
2640
  // Date filter
2564
- selectedDate: z41.string()
2641
+ selectedDate: z42.string()
2565
2642
  }).partial().optional();
2566
2643
 
2567
2644
  // src/cx-log/index.ts
@@ -2572,10 +2649,10 @@ var cxLogContract = initContract11().router({
2572
2649
  headers: DefaultHeaderSchema,
2573
2650
  responses: {
2574
2651
  200: DefaultSuccessResponseSchema.extend({
2575
- total: z42.number(),
2576
- page: z42.number(),
2577
- pageSize: z42.number(),
2578
- cxLogs: z42.array(CxLogSchemaWithRelations)
2652
+ total: z43.number(),
2653
+ page: z43.number(),
2654
+ pageSize: z43.number(),
2655
+ cxLogs: z43.array(CxLogSchemaWithRelations)
2579
2656
  }),
2580
2657
  401: DefaultUnauthorizedSchema
2581
2658
  },
@@ -2599,214 +2676,214 @@ var cxLogContract = initContract11().router({
2599
2676
  import { initContract as initContract12 } from "@ts-rest/core";
2600
2677
 
2601
2678
  // src/dashboard/validation.ts
2602
- import z43 from "zod";
2603
- var GetDashboardQueryParamsSchema = z43.object({
2604
- selectedDate: z43.string()
2679
+ import z44 from "zod";
2680
+ var GetDashboardQueryParamsSchema = z44.object({
2681
+ selectedDate: z44.string()
2605
2682
  });
2606
2683
  var GetDashboardQueryDetailParamsSchema = GetDashboardQueryParamsSchema.merge(
2607
- z43.object({
2608
- agentId: z43.string().uuid().optional()
2684
+ z44.object({
2685
+ agentId: z44.string().uuid().optional()
2609
2686
  })
2610
2687
  ).optional();
2611
2688
 
2612
2689
  // src/dashboard/index.ts
2613
- import z45 from "zod";
2690
+ import z46 from "zod";
2614
2691
 
2615
2692
  // src/dashboard/schema.ts
2616
- import z44 from "zod";
2617
- var InboundCountSchema = z44.object({
2618
- totalCallCount: z44.number(),
2619
- answeredCallCount: z44.number(),
2620
- missedCallCount: z44.number()
2621
- });
2622
- var OutboundCountSchema = z44.object({
2623
- totalCallCount: z44.number(),
2624
- answeredCallCount: z44.number(),
2625
- noAnsweredCallCount: z44.number()
2626
- });
2627
- var TwoAxiosCountSchema = z44.object({
2628
- x: z44.string(),
2629
- y: z44.string()
2630
- });
2631
- var ReceivedTicketCountDataSchema = z44.object({
2632
- name: z44.string(),
2633
- data: z44.array(TwoAxiosCountSchema)
2634
- });
2635
- var ResolvedTicketCountDataSchema = z44.object({
2636
- name: z44.string(),
2637
- data: z44.array(TwoAxiosCountSchema)
2638
- });
2639
- var TotalCallLogCountDataSchema = z44.object({
2640
- name: z44.string(),
2641
- data: z44.array(TwoAxiosCountSchema)
2642
- });
2643
- var AnsweredCallLogCountDataSchema = z44.object({
2644
- name: z44.string(),
2645
- data: z44.array(TwoAxiosCountSchema)
2646
- });
2647
- var CallLogCountByResultDaumSchema = z44.object({
2648
- result: z44.string(),
2649
- count: z44.string()
2650
- });
2651
- var DashboardDataSchema = z44.object({
2652
- receivedTicketCount: z44.number(),
2653
- pendingTicketCount: z44.number(),
2654
- openTicketCount: z44.number(),
2655
- resolvedTicketCount: z44.number(),
2656
- unResolvedTicketCount: z44.number(),
2657
- closedTicketCount: z44.number(),
2658
- unAssignedTicketCount: z44.number(),
2693
+ import z45 from "zod";
2694
+ var InboundCountSchema = z45.object({
2695
+ totalCallCount: z45.number(),
2696
+ answeredCallCount: z45.number(),
2697
+ missedCallCount: z45.number()
2698
+ });
2699
+ var OutboundCountSchema = z45.object({
2700
+ totalCallCount: z45.number(),
2701
+ answeredCallCount: z45.number(),
2702
+ noAnsweredCallCount: z45.number()
2703
+ });
2704
+ var TwoAxiosCountSchema = z45.object({
2705
+ x: z45.string(),
2706
+ y: z45.string()
2707
+ });
2708
+ var ReceivedTicketCountDataSchema = z45.object({
2709
+ name: z45.string(),
2710
+ data: z45.array(TwoAxiosCountSchema)
2711
+ });
2712
+ var ResolvedTicketCountDataSchema = z45.object({
2713
+ name: z45.string(),
2714
+ data: z45.array(TwoAxiosCountSchema)
2715
+ });
2716
+ var TotalCallLogCountDataSchema = z45.object({
2717
+ name: z45.string(),
2718
+ data: z45.array(TwoAxiosCountSchema)
2719
+ });
2720
+ var AnsweredCallLogCountDataSchema = z45.object({
2721
+ name: z45.string(),
2722
+ data: z45.array(TwoAxiosCountSchema)
2723
+ });
2724
+ var CallLogCountByResultDaumSchema = z45.object({
2725
+ result: z45.string(),
2726
+ count: z45.string()
2727
+ });
2728
+ var DashboardDataSchema = z45.object({
2729
+ receivedTicketCount: z45.number(),
2730
+ pendingTicketCount: z45.number(),
2731
+ openTicketCount: z45.number(),
2732
+ resolvedTicketCount: z45.number(),
2733
+ unResolvedTicketCount: z45.number(),
2734
+ closedTicketCount: z45.number(),
2735
+ unAssignedTicketCount: z45.number(),
2659
2736
  receivedTicketCountData: ReceivedTicketCountDataSchema,
2660
2737
  resolvedTicketCountData: ResolvedTicketCountDataSchema
2661
2738
  });
2662
2739
  var DashboardDataWithCallSchema = DashboardDataSchema.extend({
2663
- missedCallCount: z44.number(),
2664
- answeredCallCount: z44.number(),
2665
- noAnsweredCallCount: z44.number(),
2666
- totalCallCount: z44.number(),
2740
+ missedCallCount: z45.number(),
2741
+ answeredCallCount: z45.number(),
2742
+ noAnsweredCallCount: z45.number(),
2743
+ totalCallCount: z45.number(),
2667
2744
  inbound: InboundCountSchema,
2668
2745
  outbound: OutboundCountSchema,
2669
2746
  totalCallLogCountData: TotalCallLogCountDataSchema,
2670
2747
  answeredCallLogCountData: AnsweredCallLogCountDataSchema,
2671
- callLogCountByResultData: z44.array(CallLogCountByResultDaumSchema).optional()
2672
- });
2673
- var TotalTelephonyQueueCallCountListSchema = z44.object({
2674
- totalQueueCall: z44.string(),
2675
- totalMissedQueueCall: z44.string(),
2676
- totalAnsweredQueueCall: z44.string(),
2677
- totalAbandonedQueueCall: z44.string(),
2678
- totalAverageRingDuration: z44.string(),
2679
- totalAverageTalkDuration: z44.string(),
2680
- totalAverageCallDuration: z44.string(),
2681
- totalSla: z44.string(),
2682
- totalMissedCallPercent: z44.string(),
2683
- totalMaximumRingDuration: z44.string()
2684
- });
2685
- var TelephonyQueueCallCountListSchema = z44.object({
2686
- totalQueueCall: z44.string(),
2687
- totalMissedQueueCall: z44.string(),
2688
- totalAnsweredQueueCall: z44.string(),
2689
- totalAbandonedQueueCall: z44.string(),
2690
- totalAverageTalkDuration: z44.string(),
2691
- totalAverageCallDuration: z44.string(),
2692
- totalAverageRingDuration: z44.string(),
2693
- totalSla: z44.string(),
2694
- totalMissedCallPercent: z44.string(),
2695
- totalMaximumRingDuration: z44.string()
2696
- });
2697
- var TelephonyQueueCallCountListByQueueNumberSchema = z44.object({
2698
- queueNumber: z44.string(),
2699
- queueName: z44.string(),
2748
+ callLogCountByResultData: z45.array(CallLogCountByResultDaumSchema).optional()
2749
+ });
2750
+ var TotalTelephonyQueueCallCountListSchema = z45.object({
2751
+ totalQueueCall: z45.string(),
2752
+ totalMissedQueueCall: z45.string(),
2753
+ totalAnsweredQueueCall: z45.string(),
2754
+ totalAbandonedQueueCall: z45.string(),
2755
+ totalAverageRingDuration: z45.string(),
2756
+ totalAverageTalkDuration: z45.string(),
2757
+ totalAverageCallDuration: z45.string(),
2758
+ totalSla: z45.string(),
2759
+ totalMissedCallPercent: z45.string(),
2760
+ totalMaximumRingDuration: z45.string()
2761
+ });
2762
+ var TelephonyQueueCallCountListSchema = z45.object({
2763
+ totalQueueCall: z45.string(),
2764
+ totalMissedQueueCall: z45.string(),
2765
+ totalAnsweredQueueCall: z45.string(),
2766
+ totalAbandonedQueueCall: z45.string(),
2767
+ totalAverageTalkDuration: z45.string(),
2768
+ totalAverageCallDuration: z45.string(),
2769
+ totalAverageRingDuration: z45.string(),
2770
+ totalSla: z45.string(),
2771
+ totalMissedCallPercent: z45.string(),
2772
+ totalMaximumRingDuration: z45.string()
2773
+ });
2774
+ var TelephonyQueueCallCountListByQueueNumberSchema = z45.object({
2775
+ queueNumber: z45.string(),
2776
+ queueName: z45.string(),
2700
2777
  yeastarQueueCallCountList: TelephonyQueueCallCountListSchema
2701
2778
  });
2702
- var queueCallDashboardDataSchema = z44.object({
2779
+ var queueCallDashboardDataSchema = z45.object({
2703
2780
  totalTelephonyQueueCallCountList: TotalTelephonyQueueCallCountListSchema,
2704
- telephonyQueueCallCountListByQueueNumber: z44.array(
2781
+ telephonyQueueCallCountListByQueueNumber: z45.array(
2705
2782
  TelephonyQueueCallCountListByQueueNumberSchema
2706
2783
  )
2707
2784
  });
2708
- var TotalQueueLiveCallStatusSchema = z44.object({
2709
- activeCallCount: z44.number(),
2710
- waitingCallCount: z44.number()
2785
+ var TotalQueueLiveCallStatusSchema = z45.object({
2786
+ activeCallCount: z45.number(),
2787
+ waitingCallCount: z45.number()
2711
2788
  });
2712
- var QueueLiveCallListByQueueSchema = z44.object({
2713
- queueNumber: z44.string(),
2714
- activeCallCount: z44.number(),
2715
- waitingCallCount: z44.number()
2789
+ var QueueLiveCallListByQueueSchema = z45.object({
2790
+ queueNumber: z45.string(),
2791
+ activeCallCount: z45.number(),
2792
+ waitingCallCount: z45.number()
2716
2793
  });
2717
- var queueLiveCallCountListSchema = z44.object({
2794
+ var queueLiveCallCountListSchema = z45.object({
2718
2795
  totalQueueLiveCallStatus: TotalQueueLiveCallStatusSchema,
2719
- queueLiveCallListByQueue: z44.array(QueueLiveCallListByQueueSchema)
2720
- });
2721
- var TicketCountByStatusSchema = z44.object({
2722
- total: z44.number(),
2723
- open: z44.number(),
2724
- pending: z44.number(),
2725
- duration: z44.object({
2726
- day: z44.string().nullable(),
2727
- hour: z44.string().nullable()
2796
+ queueLiveCallListByQueue: z45.array(QueueLiveCallListByQueueSchema)
2797
+ });
2798
+ var TicketCountByStatusSchema = z45.object({
2799
+ total: z45.number(),
2800
+ open: z45.number(),
2801
+ pending: z45.number(),
2802
+ duration: z45.object({
2803
+ day: z45.string().nullable(),
2804
+ hour: z45.string().nullable()
2728
2805
  }),
2729
- solved: z44.number(),
2730
- others: z44.number(),
2731
- closed: z44.number(),
2732
- unassigneed: z44.number()
2733
- });
2734
- var ExpiredTicketSchema = z44.array(
2735
- z44.object({
2736
- id: z44.string(),
2737
- ticketNumber: z44.number(),
2738
- title: z44.string(),
2739
- priority: z44.string(),
2740
- expiredDays: z44.number()
2806
+ solved: z45.number(),
2807
+ others: z45.number(),
2808
+ closed: z45.number(),
2809
+ unassigneed: z45.number()
2810
+ });
2811
+ var ExpiredTicketSchema = z45.array(
2812
+ z45.object({
2813
+ id: z45.string(),
2814
+ ticketNumber: z45.number(),
2815
+ title: z45.string(),
2816
+ priority: z45.string(),
2817
+ expiredDays: z45.number()
2741
2818
  })
2742
2819
  );
2743
- var TagCountObjSchema = z44.array(
2744
- z44.object({
2745
- id: z44.string(),
2746
- name: z44.string(),
2747
- count: z44.number()
2820
+ var TagCountObjSchema = z45.array(
2821
+ z45.object({
2822
+ id: z45.string(),
2823
+ name: z45.string(),
2824
+ count: z45.number()
2748
2825
  })
2749
2826
  );
2750
- var MessageCountsByChannelObjSchema = z44.record(
2751
- z44.array(
2752
- z44.object({
2753
- platform: z44.string(),
2754
- messageCount: z44.number()
2827
+ var MessageCountsByChannelObjSchema = z45.record(
2828
+ z45.array(
2829
+ z45.object({
2830
+ platform: z45.string(),
2831
+ messageCount: z45.number()
2755
2832
  })
2756
2833
  )
2757
2834
  );
2758
- var CallEndResultSchema = z44.array(
2759
- z44.object({ result: z44.string().nullable(), count: z44.string().nullable() }).optional()
2835
+ var CallEndResultSchema = z45.array(
2836
+ z45.object({ result: z45.string().nullable(), count: z45.string().nullable() }).optional()
2760
2837
  ).optional();
2761
- var ConversationCountStatusSchema = z44.object({
2762
- newContactCount: z44.number().nullable(),
2763
- oldContactCount: z44.number().nullable()
2764
- });
2765
- var MessageStatusSchema = z44.object({
2766
- total: z44.number().nullable(),
2767
- closed: z44.number().nullable(),
2768
- unassignedOpen: z44.number().nullable(),
2769
- assignedOpen: z44.number().nullable()
2770
- });
2771
- var MessageAverageSchema = z44.object({
2772
- selectedWeekAvgByDay: z44.array(
2773
- z44.object({
2774
- day: z44.string().nullable(),
2775
- avgResolutionTime: z44.string().nullable(),
2776
- avgResponseTime: z44.string().nullable()
2838
+ var ConversationCountStatusSchema = z45.object({
2839
+ newContactCount: z45.number().nullable(),
2840
+ oldContactCount: z45.number().nullable()
2841
+ });
2842
+ var MessageStatusSchema = z45.object({
2843
+ total: z45.number().nullable(),
2844
+ closed: z45.number().nullable(),
2845
+ unassignedOpen: z45.number().nullable(),
2846
+ assignedOpen: z45.number().nullable()
2847
+ });
2848
+ var MessageAverageSchema = z45.object({
2849
+ selectedWeekAvgByDay: z45.array(
2850
+ z45.object({
2851
+ day: z45.string().nullable(),
2852
+ avgResolutionTime: z45.string().nullable(),
2853
+ avgResponseTime: z45.string().nullable()
2777
2854
  })
2778
2855
  ).optional().nullable(),
2779
- previousWeekAvg: z44.object({
2780
- avgResolutionTime: z44.string().nullable(),
2781
- avgResponseTime: z44.string().nullable()
2856
+ previousWeekAvg: z45.object({
2857
+ avgResolutionTime: z45.string().nullable(),
2858
+ avgResponseTime: z45.string().nullable()
2782
2859
  }).nullable().optional(),
2783
- selectedWeekAvg: z44.object({
2784
- avgResolutionTime: z44.string().nullable(),
2785
- avgResponseTime: z44.string().nullable()
2860
+ selectedWeekAvg: z45.object({
2861
+ avgResolutionTime: z45.string().nullable(),
2862
+ avgResponseTime: z45.string().nullable()
2786
2863
  }).nullable().optional()
2787
2864
  });
2788
- var MessagePlatformDataSchema = z44.object({
2789
- messengerCount: z44.object({ count: z44.number().nullable() }).nullable(),
2790
- lineCount: z44.object({ count: z44.number() }).nullable(),
2791
- viberCount: z44.object({ count: z44.number() }).nullable(),
2792
- instagramCount: z44.object({ count: z44.number() }).nullable()
2793
- });
2794
- var MessageDispositionSchema = z44.object({
2795
- resolvedDispositionCount: z44.number().nullable(),
2796
- prankDispositionCount: z44.number().nullable(),
2797
- followUpDispositionCount: z44.number().nullable(),
2798
- blankDispositionCount: z44.number().nullable(),
2799
- escalatedDispositionCount: z44.number().nullable()
2800
- });
2801
- var MessageIncomingDataSchema = z44.array(
2802
- z44.object({
2803
- platform: z44.string().nullable(),
2804
- hour: z44.string().nullable(),
2805
- messageCount: z44.string().nullable()
2865
+ var MessagePlatformDataSchema = z45.object({
2866
+ messengerCount: z45.object({ count: z45.number().nullable() }).nullable(),
2867
+ lineCount: z45.object({ count: z45.number() }).nullable(),
2868
+ viberCount: z45.object({ count: z45.number() }).nullable(),
2869
+ instagramCount: z45.object({ count: z45.number() }).nullable()
2870
+ });
2871
+ var MessageDispositionSchema = z45.object({
2872
+ resolvedDispositionCount: z45.number().nullable(),
2873
+ prankDispositionCount: z45.number().nullable(),
2874
+ followUpDispositionCount: z45.number().nullable(),
2875
+ blankDispositionCount: z45.number().nullable(),
2876
+ escalatedDispositionCount: z45.number().nullable()
2877
+ });
2878
+ var MessageIncomingDataSchema = z45.array(
2879
+ z45.object({
2880
+ platform: z45.string().nullable(),
2881
+ hour: z45.string().nullable(),
2882
+ messageCount: z45.string().nullable()
2806
2883
  })
2807
2884
  );
2808
- var MessageTotalIncomingDataSchema = z44.array(
2809
- z44.object({ name: z44.string(), data: z44.array(z44.number()) }).nullable()
2885
+ var MessageTotalIncomingDataSchema = z45.array(
2886
+ z45.object({ name: z45.string(), data: z45.array(z45.number()) }).nullable()
2810
2887
  );
2811
2888
 
2812
2889
  // src/dashboard/index.ts
@@ -2822,8 +2899,8 @@ var dashboardContract = initContract12().router(
2822
2899
  200: DefaultSuccessResponseSchema.extend({
2823
2900
  dashboard: DashboardDataSchema
2824
2901
  }),
2825
- 400: z45.object({
2826
- message: z45.string()
2902
+ 400: z46.object({
2903
+ message: z46.string()
2827
2904
  }),
2828
2905
  401: DefaultUnauthorizedSchema
2829
2906
  }
@@ -2838,8 +2915,8 @@ var dashboardContract = initContract12().router(
2838
2915
  200: DefaultSuccessResponseSchema.extend({
2839
2916
  queuecallDashboard: queueCallDashboardDataSchema
2840
2917
  }),
2841
- 400: z45.object({
2842
- message: z45.string()
2918
+ 400: z46.object({
2919
+ message: z46.string()
2843
2920
  }),
2844
2921
  401: DefaultUnauthorizedSchema
2845
2922
  }
@@ -3064,14 +3141,14 @@ var dashboardContract = initContract12().router(
3064
3141
  );
3065
3142
 
3066
3143
  // src/evaluate-form/index.ts
3067
- import z47 from "zod";
3144
+ import z48 from "zod";
3068
3145
 
3069
3146
  // src/evaluate-form/validation.ts
3070
- import z46 from "zod";
3071
- var CreateEvaluateFormSchema = z46.object({
3072
- cxLogId: z46.string().uuid(),
3073
- sentimentScore: z46.string().nullable().optional(),
3074
- csatScore: z46.string().nullable().optional()
3147
+ import z47 from "zod";
3148
+ var CreateEvaluateFormSchema = z47.object({
3149
+ cxLogId: z47.string().uuid(),
3150
+ sentimentScore: z47.string().nullable().optional(),
3151
+ csatScore: z47.string().nullable().optional()
3075
3152
  });
3076
3153
  var UpdateEvaluateFormSchema = CreateEvaluateFormSchema.partial();
3077
3154
 
@@ -3085,7 +3162,7 @@ var evaluateFormContract = initContract13().router(
3085
3162
  body: CreateEvaluateFormSchema,
3086
3163
  responses: {
3087
3164
  201: DefaultSuccessResponseSchema.extend({
3088
- message: z47.string()
3165
+ message: z48.string()
3089
3166
  }),
3090
3167
  401: DefaultUnauthorizedSchema
3091
3168
  },
@@ -3097,18 +3174,18 @@ var evaluateFormContract = initContract13().router(
3097
3174
 
3098
3175
  // src/extension/index.ts
3099
3176
  import { initContract as initContract14 } from "@ts-rest/core";
3100
- import z49 from "zod";
3177
+ import z50 from "zod";
3101
3178
 
3102
3179
  // src/extension/validation.ts
3103
- import { z as z48 } from "zod";
3104
- var CreateExtensionSchema = z48.object({
3105
- userId: z48.string().nullable(),
3106
- sipUserName: z48.string(),
3107
- sipServerUrl: z48.string().optional(),
3108
- webphoneLoginUser: z48.string(),
3109
- extensionId: z48.string().nullable(),
3110
- extensionName: z48.string().nullable(),
3111
- telephonySignature: z48.string().nullable().optional()
3180
+ import { z as z49 } from "zod";
3181
+ var CreateExtensionSchema = z49.object({
3182
+ userId: z49.string().nullable(),
3183
+ sipUserName: z49.string(),
3184
+ sipServerUrl: z49.string().optional(),
3185
+ webphoneLoginUser: z49.string(),
3186
+ extensionId: z49.string().nullable(),
3187
+ extensionName: z49.string().nullable(),
3188
+ telephonySignature: z49.string().nullable().optional()
3112
3189
  });
3113
3190
  var UpdateExtensionSchema = CreateExtensionSchema;
3114
3191
 
@@ -3124,8 +3201,8 @@ var extensionContract = initContract14().router(
3124
3201
  201: DefaultSuccessResponseSchema.extend({
3125
3202
  extension: ExtensionSchema
3126
3203
  }),
3127
- 400: z49.object({
3128
- message: z49.string()
3204
+ 400: z50.object({
3205
+ message: z50.string()
3129
3206
  }),
3130
3207
  401: DefaultUnauthorizedSchema,
3131
3208
  500: DefaultErrorResponseSchema
@@ -3135,33 +3212,33 @@ var extensionContract = initContract14().router(
3135
3212
  getExtensions: {
3136
3213
  method: "GET",
3137
3214
  path: "",
3138
- query: z49.object({
3139
- page: z49.coerce.number().default(1),
3140
- pageSize: z49.coerce.number().default(10),
3141
- keyword: z49.string().optional()
3215
+ query: z50.object({
3216
+ page: z50.coerce.number().default(1),
3217
+ pageSize: z50.coerce.number().default(10),
3218
+ keyword: z50.string().optional()
3142
3219
  }).optional(),
3143
3220
  headers: DefaultHeaderSchema,
3144
3221
  responses: {
3145
3222
  200: WithPagination(
3146
3223
  // The response data should contain the user relation.
3147
3224
  ExtensionSchema.extend({
3148
- user: z49.object({
3149
- id: z49.string().uuid(),
3150
- createdAt: z49.date(),
3151
- updatedAt: z49.date(),
3152
- deletedAt: z49.date().nullable(),
3153
- name: z49.string(),
3154
- email: z49.string().email(),
3155
- emailVerifiedAt: z49.date().nullable(),
3156
- password: z49.string(),
3157
- address: z49.string().nullable(),
3158
- phone: z49.string().nullable(),
3159
- notificationCount: z49.number().nullable()
3225
+ user: z50.object({
3226
+ id: z50.string().uuid(),
3227
+ createdAt: z50.date(),
3228
+ updatedAt: z50.date(),
3229
+ deletedAt: z50.date().nullable(),
3230
+ name: z50.string(),
3231
+ email: z50.string().email(),
3232
+ emailVerifiedAt: z50.date().nullable(),
3233
+ password: z50.string(),
3234
+ address: z50.string().nullable(),
3235
+ phone: z50.string().nullable(),
3236
+ notificationCount: z50.number().nullable()
3160
3237
  })
3161
3238
  })
3162
3239
  ),
3163
- 400: z49.object({
3164
- message: z49.string()
3240
+ 400: z50.object({
3241
+ message: z50.string()
3165
3242
  }),
3166
3243
  401: DefaultUnauthorizedSchema,
3167
3244
  500: DefaultErrorResponseSchema
@@ -3171,12 +3248,12 @@ var extensionContract = initContract14().router(
3171
3248
  getExtensionByUserId: {
3172
3249
  method: "GET",
3173
3250
  path: "/user/:userId",
3174
- pathParams: z49.object({ userId: z49.string() }),
3251
+ pathParams: z50.object({ userId: z50.string() }),
3175
3252
  headers: DefaultHeaderSchema,
3176
3253
  responses: {
3177
3254
  200: ExtensionSchema,
3178
- 400: z49.object({
3179
- message: z49.string()
3255
+ 400: z50.object({
3256
+ message: z50.string()
3180
3257
  }),
3181
3258
  401: DefaultUnauthorizedSchema,
3182
3259
  500: DefaultErrorResponseSchema
@@ -3186,17 +3263,17 @@ var extensionContract = initContract14().router(
3186
3263
  getExtensionByDialpad: {
3187
3264
  method: "GET",
3188
3265
  path: "/dialpad",
3189
- query: z49.object({
3190
- page: z49.coerce.number().default(1),
3191
- pageSize: z49.coerce.number().default(10),
3192
- keyword: z49.string().optional()
3266
+ query: z50.object({
3267
+ page: z50.coerce.number().default(1),
3268
+ pageSize: z50.coerce.number().default(10),
3269
+ keyword: z50.string().optional()
3193
3270
  }).optional(),
3194
3271
  headers: DefaultHeaderSchema,
3195
3272
  responses: {
3196
3273
  200: WithPagination(ExtensionSchema),
3197
3274
  500: DefaultErrorResponseSchema,
3198
- 400: z49.object({
3199
- message: z49.string()
3275
+ 400: z50.object({
3276
+ message: z50.string()
3200
3277
  }),
3201
3278
  401: DefaultUnauthorizedSchema
3202
3279
  },
@@ -3205,7 +3282,7 @@ var extensionContract = initContract14().router(
3205
3282
  updateExtension: {
3206
3283
  method: "PATCH",
3207
3284
  path: "/:id",
3208
- pathParams: z49.object({ id: z49.string() }),
3285
+ pathParams: z50.object({ id: z50.string() }),
3209
3286
  headers: DefaultHeaderSchema,
3210
3287
  body: UpdateExtensionSchema,
3211
3288
  responses: {
@@ -3219,11 +3296,11 @@ var extensionContract = initContract14().router(
3219
3296
  deleteExtension: {
3220
3297
  method: "DELETE",
3221
3298
  path: "/:id",
3222
- pathParams: z49.object({ id: z49.string() }),
3299
+ pathParams: z50.object({ id: z50.string() }),
3223
3300
  headers: DefaultHeaderSchema,
3224
3301
  body: null,
3225
3302
  responses: {
3226
- 200: DefaultSuccessResponseSchema.extend({ message: z49.string() }),
3303
+ 200: DefaultSuccessResponseSchema.extend({ message: z50.string() }),
3227
3304
  500: DefaultErrorResponseSchema
3228
3305
  },
3229
3306
  summary: "Delete a extension."
@@ -3236,35 +3313,35 @@ var extensionContract = initContract14().router(
3236
3313
  import { initContract as initContract15 } from "@ts-rest/core";
3237
3314
 
3238
3315
  // src/instagram/validation.ts
3239
- import z50 from "zod";
3240
- var GetInstagramPagesSchema = z50.object({
3241
- data: z50.array(
3242
- z50.object({
3316
+ import z51 from "zod";
3317
+ var GetInstagramPagesSchema = z51.object({
3318
+ data: z51.array(
3319
+ z51.object({
3243
3320
  // biome-ignore lint/style/useNamingConvention: <explanation>
3244
- access_token: z50.string(),
3245
- category: z50.string(),
3321
+ access_token: z51.string(),
3322
+ category: z51.string(),
3246
3323
  // biome-ignore lint/style/useNamingConvention: <explanation>
3247
- category_list: z50.array(
3248
- z50.object({
3249
- id: z50.string(),
3250
- name: z50.string()
3324
+ category_list: z51.array(
3325
+ z51.object({
3326
+ id: z51.string(),
3327
+ name: z51.string()
3251
3328
  })
3252
3329
  ),
3253
- id: z50.string(),
3254
- name: z50.string(),
3255
- tasks: z50.string().array()
3330
+ id: z51.string(),
3331
+ name: z51.string(),
3332
+ tasks: z51.string().array()
3256
3333
  })
3257
3334
  ),
3258
- paging: z50.object({
3259
- cursors: z50.object({
3260
- before: z50.string().optional(),
3261
- after: z50.string().optional()
3335
+ paging: z51.object({
3336
+ cursors: z51.object({
3337
+ before: z51.string().optional(),
3338
+ after: z51.string().optional()
3262
3339
  })
3263
3340
  }).optional()
3264
3341
  });
3265
- var GetInstagramPagesQuerySchema = z50.object({
3266
- accessToken: z50.string(),
3267
- userId: z50.string()
3342
+ var GetInstagramPagesQuerySchema = z51.object({
3343
+ accessToken: z51.string(),
3344
+ userId: z51.string()
3268
3345
  });
3269
3346
 
3270
3347
  // src/instagram/index.ts
@@ -3323,13 +3400,6 @@ var instagramContract = initContract15().router({
3323
3400
  import { initContract as initContract16 } from "@ts-rest/core";
3324
3401
  import z53 from "zod";
3325
3402
 
3326
- // src/line/schema.ts
3327
- import z51 from "zod";
3328
- var ConnectLineSchema = z51.object({
3329
- id: z51.string(),
3330
- accessToken: z51.string()
3331
- });
3332
-
3333
3403
  // src/line/validation.ts
3334
3404
  import z52 from "zod";
3335
3405
  var SendLineStickerSchema = z52.object({
@@ -4390,6 +4460,8 @@ var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
4390
4460
  pageSize: z72.coerce.number().positive().optional()
4391
4461
  })
4392
4462
  );
4463
+ var NullEmptyStringUndefined = ["", null, void 0];
4464
+ var EmtptyArrayUndefined = [[], void 0];
4393
4465
  var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
4394
4466
  reportType: z72.enum([
4395
4467
  "extcallstatistics",
@@ -4409,50 +4481,49 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
4409
4481
  trunkList: z72.array(z72.string()).optional(),
4410
4482
  extensionList: z72.array(z72.string()).optional()
4411
4483
  }).superRefine((input, ctx) => {
4412
- var _a, _b, _c;
4413
- if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance") && (input.selectedDate === null || input.selectedDate === "")) {
4484
+ if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
4414
4485
  ctx.addIssue({
4415
4486
  code: z72.ZodIssueCode.custom,
4416
4487
  path: ["selectedDate"],
4417
4488
  message: "selectedDate is required."
4418
4489
  });
4419
4490
  }
4420
- if (input.reportType === "extcallstatistics" && (input.communicationType === null || input.selectedDate === "")) {
4491
+ if (input.reportType === "extcallstatistics" && NullEmptyStringUndefined.includes(input.communicationType)) {
4421
4492
  ctx.addIssue({
4422
4493
  code: z72.ZodIssueCode.custom,
4423
4494
  path: ["communicationType"],
4424
4495
  message: "communicationType is required."
4425
4496
  });
4426
4497
  }
4427
- if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && (input.time === null || input.time === "")) {
4498
+ if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
4428
4499
  ctx.addIssue({
4429
4500
  code: z72.ZodIssueCode.custom,
4430
4501
  path: ["time"],
4431
4502
  message: "time is required."
4432
4503
  });
4433
4504
  }
4434
- if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && (((_a = input.queueList) == null ? void 0 : _a.length) || 0) < 0) {
4505
+ if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
4435
4506
  ctx.addIssue({
4436
4507
  code: z72.ZodIssueCode.custom,
4437
4508
  path: ["queueList"],
4438
4509
  message: "queueList is required."
4439
4510
  });
4440
4511
  }
4441
- if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && (input.queueId === null || input.queueId === "")) {
4512
+ if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
4442
4513
  ctx.addIssue({
4443
4514
  code: z72.ZodIssueCode.custom,
4444
4515
  path: ["queueId"],
4445
4516
  message: "queueId is required."
4446
4517
  });
4447
4518
  }
4448
- if (input.reportType === "trunkactivity" && (((_b = input.trunkList) == null ? void 0 : _b.length) || 0) < 0) {
4519
+ if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
4449
4520
  ctx.addIssue({
4450
4521
  code: z72.ZodIssueCode.custom,
4451
4522
  path: ["trunkList"],
4452
4523
  message: "trunkList is required."
4453
4524
  });
4454
4525
  }
4455
- if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && (((_c = input.extensionList) == null ? void 0 : _c.length) || 0) < 0) {
4526
+ if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
4456
4527
  ctx.addIssue({
4457
4528
  code: z72.ZodIssueCode.custom,
4458
4529
  path: ["extensionList"],
@@ -4696,6 +4767,17 @@ var telephonyCdrContract = initContract28().router(
4696
4767
  },
4697
4768
  summary: "Get yeastar call report."
4698
4769
  },
4770
+ yeastarCallReportExport: {
4771
+ method: "POST",
4772
+ path: "/yeastar_call_report/export",
4773
+ headers: DefaultHeaderSchema,
4774
+ body: GetYeastarCallReportSchema,
4775
+ responses: {
4776
+ 200: null,
4777
+ 401: DefaultUnauthorizedSchema
4778
+ },
4779
+ summary: "Export yeastar call report."
4780
+ },
4699
4781
  getTrunks: {
4700
4782
  method: "GET",
4701
4783
  path: "/trunks",
@@ -5438,6 +5520,20 @@ var userPresenceStatusLogContract = initContract32().router(
5438
5520
  500: DefaultErrorResponseSchema
5439
5521
  },
5440
5522
  summary: "Get all user presence status log."
5523
+ },
5524
+ getExportData: {
5525
+ method: "GET",
5526
+ path: "/export",
5527
+ query: UserPresenceStatusLogParamsSchema,
5528
+ headers: DefaultHeaderSchema,
5529
+ responses: {
5530
+ 200: null,
5531
+ 400: z83.object({
5532
+ message: z83.string()
5533
+ }),
5534
+ 401: DefaultUnauthorizedSchema,
5535
+ 500: DefaultErrorResponseSchema
5536
+ }
5441
5537
  }
5442
5538
  },
5443
5539
  { pathPrefix: "user-presence-status-log" }
@@ -5781,6 +5877,7 @@ export {
5781
5877
  dashboardContract,
5782
5878
  evaluateFormContract,
5783
5879
  extensionContract2 as extensionContract,
5880
+ permissionContract,
5784
5881
  platformContract,
5785
5882
  tagContract,
5786
5883
  telephonyCdrContract,