@kl1/contracts 1.3.42 → 1.3.43

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
@@ -3461,7 +3461,7 @@ var companyContract = initContract10().router(
3461
3461
 
3462
3462
  // src/contact/index.ts
3463
3463
  import { initContract as initContract11 } from "@ts-rest/core";
3464
- import z50 from "zod";
3464
+ import z51 from "zod";
3465
3465
 
3466
3466
  // src/contact/validation.ts
3467
3467
  import z49 from "zod";
@@ -3710,6 +3710,10 @@ var ContactContractValidationSchema = {
3710
3710
  }
3711
3711
  };
3712
3712
 
3713
+ // src/export/validation.ts
3714
+ import z50 from "zod";
3715
+ var ExportFileExtensionSchema = z50.union([z50.literal("csv"), z50.literal("xlsx")]).default("csv").optional();
3716
+
3713
3717
  // src/contact/index.ts
3714
3718
  var contactContract = initContract11().router(
3715
3719
  {
@@ -3721,14 +3725,14 @@ var contactContract = initContract11().router(
3721
3725
  201: DefaultSuccessResponseSchema.extend({
3722
3726
  data: ContactSchema
3723
3727
  }),
3724
- 400: z50.object({
3725
- message: z50.string()
3728
+ 400: z51.object({
3729
+ message: z51.string()
3726
3730
  }),
3727
- 409: z50.object({
3728
- message: z50.string()
3731
+ 409: z51.object({
3732
+ message: z51.string()
3729
3733
  }),
3730
- 500: z50.object({
3731
- message: z50.string()
3734
+ 500: z51.object({
3735
+ message: z51.string()
3732
3736
  }),
3733
3737
  401: DefaultUnauthorizedSchema,
3734
3738
  404: DefaultNotFoundSchema,
@@ -3744,14 +3748,14 @@ var contactContract = initContract11().router(
3744
3748
  200: DefaultSuccessResponseSchema.extend(
3745
3749
  ContactContractValidationSchema.getAll.response
3746
3750
  ),
3747
- 400: z50.object({
3748
- message: z50.string()
3751
+ 400: z51.object({
3752
+ message: z51.string()
3749
3753
  }),
3750
- 409: z50.object({
3751
- message: z50.string()
3754
+ 409: z51.object({
3755
+ message: z51.string()
3752
3756
  }),
3753
- 500: z50.object({
3754
- message: z50.string()
3757
+ 500: z51.object({
3758
+ message: z51.string()
3755
3759
  }),
3756
3760
  401: DefaultUnauthorizedSchema,
3757
3761
  404: DefaultNotFoundSchema,
@@ -3767,14 +3771,14 @@ var contactContract = initContract11().router(
3767
3771
  200: DefaultSuccessResponseSchema.extend(
3768
3772
  ContactContractValidationSchema.filterContacts.response
3769
3773
  ),
3770
- 400: z50.object({
3771
- message: z50.string()
3774
+ 400: z51.object({
3775
+ message: z51.string()
3772
3776
  }),
3773
- 409: z50.object({
3774
- message: z50.string()
3777
+ 409: z51.object({
3778
+ message: z51.string()
3775
3779
  }),
3776
- 500: z50.object({
3777
- message: z50.string()
3780
+ 500: z51.object({
3781
+ message: z51.string()
3778
3782
  }),
3779
3783
  401: DefaultUnauthorizedSchema,
3780
3784
  404: DefaultNotFoundSchema,
@@ -3790,14 +3794,14 @@ var contactContract = initContract11().router(
3790
3794
  200: DefaultSuccessResponseSchema.extend({
3791
3795
  data: ContactContractValidationSchema.getById.response
3792
3796
  }),
3793
- 400: z50.object({
3794
- message: z50.string()
3797
+ 400: z51.object({
3798
+ message: z51.string()
3795
3799
  }),
3796
- 409: z50.object({
3797
- message: z50.string()
3800
+ 409: z51.object({
3801
+ message: z51.string()
3798
3802
  }),
3799
- 500: z50.object({
3800
- message: z50.string()
3803
+ 500: z51.object({
3804
+ message: z51.string()
3801
3805
  }),
3802
3806
  401: DefaultUnauthorizedSchema,
3803
3807
  404: DefaultNotFoundSchema,
@@ -3814,14 +3818,14 @@ var contactContract = initContract11().router(
3814
3818
  200: DefaultSuccessResponseSchema.extend({
3815
3819
  message: ContactContractValidationSchema.delete.response
3816
3820
  }),
3817
- 400: z50.object({
3818
- message: z50.string()
3821
+ 400: z51.object({
3822
+ message: z51.string()
3819
3823
  }),
3820
- 409: z50.object({
3821
- message: z50.string()
3824
+ 409: z51.object({
3825
+ message: z51.string()
3822
3826
  }),
3823
- 500: z50.object({
3824
- message: z50.string()
3827
+ 500: z51.object({
3828
+ message: z51.string()
3825
3829
  }),
3826
3830
  401: DefaultUnauthorizedSchema,
3827
3831
  404: DefaultNotFoundSchema,
@@ -3837,14 +3841,14 @@ var contactContract = initContract11().router(
3837
3841
  201: DefaultSuccessResponseSchema.extend({
3838
3842
  data: ContactContractValidationSchema.createContactByPhone.response
3839
3843
  }),
3840
- 400: z50.object({
3841
- message: z50.string()
3844
+ 400: z51.object({
3845
+ message: z51.string()
3842
3846
  }),
3843
- 409: z50.object({
3844
- message: z50.string()
3847
+ 409: z51.object({
3848
+ message: z51.string()
3845
3849
  }),
3846
- 500: z50.object({
3847
- message: z50.string()
3850
+ 500: z51.object({
3851
+ message: z51.string()
3848
3852
  }),
3849
3853
  401: DefaultUnauthorizedSchema,
3850
3854
  404: DefaultNotFoundSchema,
@@ -3863,14 +3867,14 @@ var contactContract = initContract11().router(
3863
3867
  201: DefaultSuccessResponseSchema.extend({
3864
3868
  data: ContactContractValidationSchema.createContactPlatform.response
3865
3869
  }),
3866
- 400: z50.object({
3867
- message: z50.string()
3870
+ 400: z51.object({
3871
+ message: z51.string()
3868
3872
  }),
3869
- 409: z50.object({
3870
- message: z50.string()
3873
+ 409: z51.object({
3874
+ message: z51.string()
3871
3875
  }),
3872
- 500: z50.object({
3873
- message: z50.string()
3876
+ 500: z51.object({
3877
+ message: z51.string()
3874
3878
  }),
3875
3879
  401: DefaultUnauthorizedSchema,
3876
3880
  404: DefaultNotFoundSchema,
@@ -3886,14 +3890,14 @@ var contactContract = initContract11().router(
3886
3890
  201: DefaultSuccessResponseSchema.extend({
3887
3891
  data: ContactContractValidationSchema.updateFromOngoingCall.response
3888
3892
  }),
3889
- 400: z50.object({
3890
- message: z50.string()
3893
+ 400: z51.object({
3894
+ message: z51.string()
3891
3895
  }),
3892
- 409: z50.object({
3893
- message: z50.string()
3896
+ 409: z51.object({
3897
+ message: z51.string()
3894
3898
  }),
3895
- 500: z50.object({
3896
- message: z50.string()
3899
+ 500: z51.object({
3900
+ message: z51.string()
3897
3901
  }),
3898
3902
  401: DefaultUnauthorizedSchema,
3899
3903
  404: DefaultNotFoundSchema,
@@ -3909,14 +3913,14 @@ var contactContract = initContract11().router(
3909
3913
  200: DefaultSuccessResponseSchema.extend({
3910
3914
  data: ContactContractValidationSchema.merge.response
3911
3915
  }),
3912
- 400: z50.object({
3913
- message: z50.string()
3916
+ 400: z51.object({
3917
+ message: z51.string()
3914
3918
  }),
3915
- 409: z50.object({
3916
- message: z50.string()
3919
+ 409: z51.object({
3920
+ message: z51.string()
3917
3921
  }),
3918
- 500: z50.object({
3919
- message: z50.string()
3922
+ 500: z51.object({
3923
+ message: z51.string()
3920
3924
  }),
3921
3925
  401: DefaultUnauthorizedSchema,
3922
3926
  404: DefaultNotFoundSchema,
@@ -3932,14 +3936,14 @@ var contactContract = initContract11().router(
3932
3936
  200: DefaultSuccessResponseSchema.extend({
3933
3937
  existed: ContactContractValidationSchema.checkContactPhone.response
3934
3938
  }),
3935
- 400: z50.object({
3936
- message: z50.string()
3939
+ 400: z51.object({
3940
+ message: z51.string()
3937
3941
  }),
3938
- 409: z50.object({
3939
- message: z50.string()
3942
+ 409: z51.object({
3943
+ message: z51.string()
3940
3944
  }),
3941
- 500: z50.object({
3942
- message: z50.string()
3945
+ 500: z51.object({
3946
+ message: z51.string()
3943
3947
  }),
3944
3948
  401: DefaultUnauthorizedSchema,
3945
3949
  404: DefaultNotFoundSchema,
@@ -3955,14 +3959,14 @@ var contactContract = initContract11().router(
3955
3959
  200: DefaultSuccessResponseSchema.extend({
3956
3960
  existed: ContactContractValidationSchema.checkContactEmail.response
3957
3961
  }),
3958
- 400: z50.object({
3959
- message: z50.string()
3962
+ 400: z51.object({
3963
+ message: z51.string()
3960
3964
  }),
3961
- 409: z50.object({
3962
- message: z50.string()
3965
+ 409: z51.object({
3966
+ message: z51.string()
3963
3967
  }),
3964
- 500: z50.object({
3965
- message: z50.string()
3968
+ 500: z51.object({
3969
+ message: z51.string()
3966
3970
  }),
3967
3971
  401: DefaultUnauthorizedSchema,
3968
3972
  404: DefaultNotFoundSchema,
@@ -3979,14 +3983,14 @@ var contactContract = initContract11().router(
3979
3983
  201: DefaultSuccessResponseSchema.extend({
3980
3984
  message: ContactCustomFieldSchema
3981
3985
  }),
3982
- 400: z50.object({
3983
- message: z50.string()
3986
+ 400: z51.object({
3987
+ message: z51.string()
3984
3988
  }),
3985
- 409: z50.object({
3986
- message: z50.string()
3989
+ 409: z51.object({
3990
+ message: z51.string()
3987
3991
  }),
3988
- 500: z50.object({
3989
- message: z50.string()
3992
+ 500: z51.object({
3993
+ message: z51.string()
3990
3994
  }),
3991
3995
  401: DefaultUnauthorizedSchema,
3992
3996
  404: DefaultNotFoundSchema,
@@ -4002,14 +4006,14 @@ var contactContract = initContract11().router(
4002
4006
  200: DefaultSuccessResponseSchema.extend({
4003
4007
  data: ContactContractValidationSchema.getById.response
4004
4008
  }),
4005
- 400: z50.object({
4006
- message: z50.string()
4009
+ 400: z51.object({
4010
+ message: z51.string()
4007
4011
  }),
4008
- 409: z50.object({
4009
- message: z50.string()
4012
+ 409: z51.object({
4013
+ message: z51.string()
4010
4014
  }),
4011
- 500: z50.object({
4012
- message: z50.string()
4015
+ 500: z51.object({
4016
+ message: z51.string()
4013
4017
  }),
4014
4018
  401: DefaultUnauthorizedSchema,
4015
4019
  404: DefaultNotFoundSchema,
@@ -4020,11 +4024,13 @@ var contactContract = initContract11().router(
4020
4024
  getExportContacts: {
4021
4025
  method: "GET",
4022
4026
  path: "/export",
4023
- query: ContactContractValidationSchema.getAll.request,
4027
+ query: ContactContractValidationSchema.getAll.request.extend({
4028
+ fileExtension: ExportFileExtensionSchema
4029
+ }),
4024
4030
  responses: {
4025
4031
  200: null,
4026
- 400: z50.object({
4027
- message: z50.string()
4032
+ 400: z51.object({
4033
+ message: z51.string()
4028
4034
  }),
4029
4035
  401: DefaultUnauthorizedSchema,
4030
4036
  404: DefaultNotFoundSchema
@@ -4039,30 +4045,30 @@ var contactContract = initContract11().router(
4039
4045
 
4040
4046
  // src/cx-log/index.ts
4041
4047
  import { initContract as initContract12 } from "@ts-rest/core";
4042
- import z52 from "zod";
4048
+ import z53 from "zod";
4043
4049
 
4044
4050
  // src/cx-log/validation.ts
4045
- import z51 from "zod";
4046
- var sentimentScoreSchema = z51.union([
4047
- z51.literal("positive"),
4048
- z51.literal("neutral"),
4049
- z51.literal("negative")
4051
+ import z52 from "zod";
4052
+ var sentimentScoreSchema = z52.union([
4053
+ z52.literal("positive"),
4054
+ z52.literal("neutral"),
4055
+ z52.literal("negative")
4050
4056
  ]);
4051
- var CustomFieldQueryParamsSchema = z51.object({
4052
- attributeId: z51.string(),
4053
- value: z51.union([z51.string(), z51.array(z51.string())]),
4054
- type: z51.string().optional()
4057
+ var CustomFieldQueryParamsSchema = z52.object({
4058
+ attributeId: z52.string(),
4059
+ value: z52.union([z52.string(), z52.array(z52.string())]),
4060
+ type: z52.string().optional()
4055
4061
  });
4056
4062
  var GetAllCxLogQueryParamsSchema = DefaultQueryParamsSchema.extend({
4057
- contactId: z51.string().uuid(),
4058
- caseId: z51.string(),
4059
- channelIds: z51.array(z51.string().uuid()),
4060
- trunks: z51.array(z51.string()),
4061
- queueId: z51.array(z51.string()),
4062
- agentIds: z51.union([
4063
- z51.array(z51.string()),
4063
+ contactId: z52.string().uuid(),
4064
+ caseId: z52.string(),
4065
+ channelIds: z52.array(z52.string().uuid()),
4066
+ trunks: z52.array(z52.string()),
4067
+ queueId: z52.array(z52.string()),
4068
+ agentIds: z52.union([
4069
+ z52.array(z52.string()),
4064
4070
  // If it's an array
4065
- z51.record(z51.string())
4071
+ z52.record(z52.string())
4066
4072
  // If it's an object
4067
4073
  ]).transform((val) => {
4068
4074
  if (Array.isArray(val)) {
@@ -4070,27 +4076,27 @@ var GetAllCxLogQueryParamsSchema = DefaultQueryParamsSchema.extend({
4070
4076
  }
4071
4077
  return Object.values(val);
4072
4078
  }),
4073
- direction: z51.array(z51.union([z51.literal("inbound"), z51.literal("outbound")])),
4074
- disposition: z51.array(z51.string()),
4075
- sentimentScore: z51.array(sentimentScoreSchema),
4076
- csatScore: z51.array(z51.string()),
4077
- sla: z51.union([z51.literal("meet"), z51.literal("unmeet")]),
4078
- tags: z51.array(z51.string()),
4079
+ direction: z52.array(z52.union([z52.literal("inbound"), z52.literal("outbound")])),
4080
+ disposition: z52.array(z52.string()),
4081
+ sentimentScore: z52.array(sentimentScoreSchema),
4082
+ csatScore: z52.array(z52.string()),
4083
+ sla: z52.union([z52.literal("meet"), z52.literal("unmeet")]),
4084
+ tags: z52.array(z52.string()),
4079
4085
  // General tags
4080
4086
  // Default contact attributes
4081
- name: z51.string(),
4082
- contactLabels: z51.array(z51.string()),
4083
- email: z51.string(),
4084
- channel: z51.array(z51.string()),
4085
- phone: z51.string(),
4086
- notes: z51.string(),
4087
- address: z51.string(),
4088
- company: z51.array(z51.string()),
4087
+ name: z52.string(),
4088
+ contactLabels: z52.array(z52.string()),
4089
+ email: z52.string(),
4090
+ channel: z52.array(z52.string()),
4091
+ phone: z52.string(),
4092
+ notes: z52.string(),
4093
+ address: z52.string(),
4094
+ company: z52.array(z52.string()),
4089
4095
  // Custom fields
4090
- customFields: z51.array(CustomFieldQueryParamsSchema),
4096
+ customFields: z52.array(CustomFieldQueryParamsSchema),
4091
4097
  // Date filter
4092
- selectedDate: z51.string()
4093
- }).partial().optional();
4098
+ selectedDate: z52.string()
4099
+ }).partial();
4094
4100
 
4095
4101
  // src/cx-log/index.ts
4096
4102
  var cxLogContract = initContract12().router(
@@ -4101,10 +4107,10 @@ var cxLogContract = initContract12().router(
4101
4107
  headers: DefaultHeaderSchema,
4102
4108
  responses: {
4103
4109
  200: DefaultSuccessResponseSchema.extend({
4104
- total: z52.number(),
4105
- page: z52.number(),
4106
- pageSize: z52.number(),
4107
- cxLogs: z52.array(CxLogSchemaWithRelations)
4110
+ total: z53.number(),
4111
+ page: z53.number(),
4112
+ pageSize: z53.number(),
4113
+ cxLogs: z53.array(CxLogSchemaWithRelations)
4108
4114
  }),
4109
4115
  401: DefaultUnauthorizedSchema
4110
4116
  },
@@ -4119,7 +4125,9 @@ var cxLogContract = initContract12().router(
4119
4125
  200: null,
4120
4126
  401: DefaultUnauthorizedSchema
4121
4127
  },
4122
- query: GetAllCxLogQueryParamsSchema,
4128
+ query: GetAllCxLogQueryParamsSchema.extend({
4129
+ fileExtension: ExportFileExtensionSchema
4130
+ }),
4123
4131
  summary: "Export cx-logs"
4124
4132
  },
4125
4133
  syncSla: {
@@ -4137,10 +4145,10 @@ var cxLogContract = initContract12().router(
4137
4145
  updateSla: {
4138
4146
  method: "POST",
4139
4147
  path: "/cx-logs",
4140
- headers: z52.object({
4148
+ headers: z53.object({
4141
4149
  // biome-ignore lint/style/useNamingConvention: <explanation>
4142
- "x-tenant": z52.string({ required_error: "Tenant id is required" }),
4143
- "x-code": z52.string().uuid().optional()
4150
+ "x-tenant": z53.string({ required_error: "Tenant id is required" }),
4151
+ "x-code": z53.string().uuid().optional()
4144
4152
  }),
4145
4153
  responses: {
4146
4154
  200: null,
@@ -4148,9 +4156,9 @@ var cxLogContract = initContract12().router(
4148
4156
  404: DefaultNotFoundSchema,
4149
4157
  500: DefaultErrorResponseSchema
4150
4158
  },
4151
- body: z52.object({
4152
- roomId: z52.string().uuid(),
4153
- slaStatus: z52.enum(["meet", "unmeet", "-"])
4159
+ body: z53.object({
4160
+ roomId: z53.string().uuid(),
4161
+ slaStatus: z53.enum(["meet", "unmeet", "-"])
4154
4162
  })
4155
4163
  }
4156
4164
  },
@@ -4161,297 +4169,290 @@ var cxLogContract = initContract12().router(
4161
4169
  import { initContract as initContract13 } from "@ts-rest/core";
4162
4170
 
4163
4171
  // src/dashboard/validation.ts
4164
- import z53 from "zod";
4165
- var GetDashboardQueryParamsSchema = z53.object({
4166
- channelIds: z53.array(z53.string().uuid()).optional(),
4167
- selectedDate: z53.string().min(1)
4172
+ import z54 from "zod";
4173
+ var GetDashboardQueryParamsSchema = z54.object({
4174
+ channelIds: z54.array(z54.string().uuid()).optional(),
4175
+ selectedDate: z54.string().min(1)
4168
4176
  });
4169
4177
  var GetMessageChannelQueryParamsSchema = GetDashboardQueryParamsSchema.extend({
4170
- time: z53.enum(["byDay", "byMonth", "byHour"]),
4171
- channelIds: z53.array(z53.string()).optional()
4178
+ time: z54.enum(["byDay", "byMonth", "byHour"]),
4179
+ channelIds: z54.array(z54.string()).optional()
4172
4180
  });
4173
- var DashboardGlobalFiltersSchema = z53.object({
4174
- automationQueueId: z53.string().uuid().optional(),
4175
- selectedDate: z53.string().min(1),
4176
- channelIds: z53.array(z53.string().uuid()).optional()
4181
+ var DashboardGlobalFiltersSchema = z54.object({
4182
+ automationQueueId: z54.string().uuid().optional(),
4183
+ selectedDate: z54.string().min(1),
4184
+ channelIds: z54.array(z54.string().uuid()).optional()
4177
4185
  });
4178
4186
  var DashboardQueryParamsSchema = GetDashboardQueryParamsSchema.extend({
4179
- automationQueueId: z53.string().uuid().optional(),
4180
- channelIds: z53.array(z53.string().uuid()).optional(),
4181
- agentIds: z53.array(z53.string().uuid()).optional()
4187
+ automationQueueId: z54.string().uuid().optional(),
4188
+ channelIds: z54.array(z54.string().uuid()).optional(),
4189
+ agentIds: z54.array(z54.string().uuid()).optional()
4182
4190
  });
4183
4191
  var GetDashboardQueryDetailParamsSchema = GetDashboardQueryParamsSchema.merge(
4184
- z53.object({
4185
- agentId: z53.string().uuid().optional()
4192
+ z54.object({
4193
+ agentId: z54.string().uuid().optional()
4186
4194
  })
4187
4195
  ).optional();
4188
4196
  var GetDashboardInOutQueryParamsSchema = GetDashboardQueryParamsSchema.merge(
4189
- z53.object({
4190
- direction: z53.string().optional()
4197
+ z54.object({
4198
+ direction: z54.string().optional()
4191
4199
  })
4192
4200
  );
4193
- var CallCountsQuerySchema = z53.object({
4194
- agentIds: z53.array(z53.string().uuid()).optional(),
4195
- userId: z53.string().uuid().optional(),
4196
- types: z53.array(z53.string()).optional(),
4197
- selectedDate: z53.string().optional()
4201
+ var CallCountsQuerySchema = z54.object({
4202
+ agentIds: z54.array(z54.string().uuid()).optional(),
4203
+ userId: z54.string().uuid().optional(),
4204
+ types: z54.array(z54.string()).optional(),
4205
+ selectedDate: z54.string().optional()
4198
4206
  });
4199
- var MessageDashboardDetailsQuerySchema = z53.object({
4200
- automationQueueId: z53.string().uuid().optional(),
4201
- selectedDate: z53.string().min(1),
4202
- channelIds: z53.array(z53.string().uuid()).optional()
4207
+ var MessageDashboardDetailsQuerySchema = z54.object({
4208
+ automationQueueId: z54.string().uuid().optional(),
4209
+ selectedDate: z54.string().min(1),
4210
+ channelIds: z54.array(z54.string().uuid()).optional()
4203
4211
  });
4204
- var ChannelCountsFilterSchema = z53.union([z53.literal("channelName"), z53.literal("channelType")]).default("channelName").optional();
4212
+ var ChannelCountsFilterSchema = z54.union([z54.literal("channelName"), z54.literal("channelType")]).default("channelName").optional();
4205
4213
 
4206
4214
  // src/dashboard/index.ts
4207
4215
  import z56 from "zod";
4208
4216
 
4209
4217
  // src/dashboard/schema.ts
4210
- import z54 from "zod";
4211
- var InboundCountSchema = z54.object({
4212
- totalCallCount: z54.number(),
4213
- answeredCallCount: z54.number(),
4214
- missedCallCount: z54.number()
4215
- });
4216
- var OutboundCountSchema = z54.object({
4217
- totalCallCount: z54.number(),
4218
- answeredCallCount: z54.number(),
4219
- noAnsweredCallCount: z54.number()
4220
- });
4221
- var TwoAxiosCountSchema = z54.object({
4222
- x: z54.string(),
4223
- y: z54.string()
4224
- });
4225
- var ReceivedTicketCountDataSchema = z54.object({
4226
- name: z54.string(),
4227
- data: z54.array(TwoAxiosCountSchema)
4228
- });
4229
- var ResolvedTicketCountDataSchema = z54.object({
4230
- name: z54.string(),
4231
- data: z54.array(TwoAxiosCountSchema)
4232
- });
4233
- var TotalCallLogCountDataSchema = z54.object({
4234
- name: z54.string(),
4235
- data: z54.array(TwoAxiosCountSchema)
4236
- });
4237
- var AnsweredCallLogCountDataSchema = z54.object({
4238
- name: z54.string(),
4239
- data: z54.array(TwoAxiosCountSchema)
4240
- });
4241
- var CallLogCountByResultDaumSchema = z54.object({
4242
- result: z54.string(),
4243
- count: z54.string()
4244
- });
4245
- var DashboardDataSchema = z54.object({
4246
- receivedTicketCount: z54.number(),
4247
- pendingTicketCount: z54.number(),
4248
- openTicketCount: z54.number(),
4249
- resolvedTicketCount: z54.number(),
4250
- unResolvedTicketCount: z54.number(),
4251
- closedTicketCount: z54.number(),
4252
- unAssignedTicketCount: z54.number(),
4218
+ import z55 from "zod";
4219
+ var InboundCountSchema = z55.object({
4220
+ totalCallCount: z55.number(),
4221
+ answeredCallCount: z55.number(),
4222
+ missedCallCount: z55.number()
4223
+ });
4224
+ var OutboundCountSchema = z55.object({
4225
+ totalCallCount: z55.number(),
4226
+ answeredCallCount: z55.number(),
4227
+ noAnsweredCallCount: z55.number()
4228
+ });
4229
+ var TwoAxiosCountSchema = z55.object({
4230
+ x: z55.string(),
4231
+ y: z55.string()
4232
+ });
4233
+ var ReceivedTicketCountDataSchema = z55.object({
4234
+ name: z55.string(),
4235
+ data: z55.array(TwoAxiosCountSchema)
4236
+ });
4237
+ var ResolvedTicketCountDataSchema = z55.object({
4238
+ name: z55.string(),
4239
+ data: z55.array(TwoAxiosCountSchema)
4240
+ });
4241
+ var TotalCallLogCountDataSchema = z55.object({
4242
+ name: z55.string(),
4243
+ data: z55.array(TwoAxiosCountSchema)
4244
+ });
4245
+ var AnsweredCallLogCountDataSchema = z55.object({
4246
+ name: z55.string(),
4247
+ data: z55.array(TwoAxiosCountSchema)
4248
+ });
4249
+ var CallLogCountByResultDaumSchema = z55.object({
4250
+ result: z55.string(),
4251
+ count: z55.string()
4252
+ });
4253
+ var DashboardDataSchema = z55.object({
4254
+ receivedTicketCount: z55.number(),
4255
+ pendingTicketCount: z55.number(),
4256
+ openTicketCount: z55.number(),
4257
+ resolvedTicketCount: z55.number(),
4258
+ unResolvedTicketCount: z55.number(),
4259
+ closedTicketCount: z55.number(),
4260
+ unAssignedTicketCount: z55.number(),
4253
4261
  receivedTicketCountData: ReceivedTicketCountDataSchema,
4254
4262
  resolvedTicketCountData: ResolvedTicketCountDataSchema
4255
4263
  });
4256
4264
  var DashboardDataWithCallSchema = DashboardDataSchema.extend({
4257
- missedCallCount: z54.number(),
4258
- answeredCallCount: z54.number(),
4259
- noAnsweredCallCount: z54.number(),
4260
- totalCallCount: z54.number(),
4265
+ missedCallCount: z55.number(),
4266
+ answeredCallCount: z55.number(),
4267
+ noAnsweredCallCount: z55.number(),
4268
+ totalCallCount: z55.number(),
4261
4269
  inbound: InboundCountSchema,
4262
4270
  outbound: OutboundCountSchema,
4263
4271
  totalCallLogCountData: TotalCallLogCountDataSchema,
4264
4272
  answeredCallLogCountData: AnsweredCallLogCountDataSchema,
4265
- callLogCountByResultData: z54.array(CallLogCountByResultDaumSchema).optional()
4266
- });
4267
- var TotalTelephonyQueueCallCountListSchema = z54.object({
4268
- totalQueueCall: z54.number(),
4269
- totalMissedQueueCall: z54.number(),
4270
- totalAnsweredQueueCall: z54.number(),
4271
- totalAbandonedQueueCall: z54.number(),
4272
- totalAverageRingDuration: z54.number(),
4273
- totalAverageTalkDuration: z54.number(),
4274
- totalAverageCallDuration: z54.number(),
4275
- totalSla: z54.number(),
4276
- totalMissedCallPercent: z54.string(),
4277
- totalMaximumRingDuration: z54.number()
4278
- });
4279
- var TelephonyQueueCallCountListSchema = z54.object({
4280
- totalQueueCall: z54.number(),
4281
- totalMissedQueueCall: z54.number(),
4282
- totalAnsweredQueueCall: z54.number(),
4283
- totalAbandonedQueueCall: z54.number(),
4284
- totalAverageTalkDuration: z54.number(),
4285
- totalAverageCallDuration: z54.number(),
4286
- totalAverageRingDuration: z54.number(),
4287
- totalSla: z54.number(),
4288
- totalMissedCallPercent: z54.string(),
4289
- totalMaximumRingDuration: z54.number()
4290
- });
4291
- var TelephonyQueueCallCountListByQueueNumberSchema = z54.object({
4292
- queueNumber: z54.string(),
4293
- queueName: z54.string(),
4273
+ callLogCountByResultData: z55.array(CallLogCountByResultDaumSchema).optional()
4274
+ });
4275
+ var TotalTelephonyQueueCallCountListSchema = z55.object({
4276
+ totalQueueCall: z55.number(),
4277
+ totalMissedQueueCall: z55.number(),
4278
+ totalAnsweredQueueCall: z55.number(),
4279
+ totalAbandonedQueueCall: z55.number(),
4280
+ totalAverageRingDuration: z55.number(),
4281
+ totalAverageTalkDuration: z55.number(),
4282
+ totalAverageCallDuration: z55.number(),
4283
+ totalSla: z55.number(),
4284
+ totalMissedCallPercent: z55.string(),
4285
+ totalMaximumRingDuration: z55.number()
4286
+ });
4287
+ var TelephonyQueueCallCountListSchema = z55.object({
4288
+ totalQueueCall: z55.number(),
4289
+ totalMissedQueueCall: z55.number(),
4290
+ totalAnsweredQueueCall: z55.number(),
4291
+ totalAbandonedQueueCall: z55.number(),
4292
+ totalAverageTalkDuration: z55.number(),
4293
+ totalAverageCallDuration: z55.number(),
4294
+ totalAverageRingDuration: z55.number(),
4295
+ totalSla: z55.number(),
4296
+ totalMissedCallPercent: z55.string(),
4297
+ totalMaximumRingDuration: z55.number()
4298
+ });
4299
+ var TelephonyQueueCallCountListByQueueNumberSchema = z55.object({
4300
+ queueNumber: z55.string(),
4301
+ queueName: z55.string(),
4294
4302
  yeastarQueueCallCountList: TelephonyQueueCallCountListSchema
4295
4303
  });
4296
- var queueCallDashboardDataSchema = z54.object({
4304
+ var queueCallDashboardDataSchema = z55.object({
4297
4305
  totalTelephonyQueueCallCountList: TotalTelephonyQueueCallCountListSchema,
4298
- telephonyQueueCallCountListByQueueNumber: z54.array(
4306
+ telephonyQueueCallCountListByQueueNumber: z55.array(
4299
4307
  TelephonyQueueCallCountListByQueueNumberSchema
4300
4308
  )
4301
4309
  });
4302
- var TotalQueueLiveCallStatusSchema = z54.object({
4303
- activeCallCount: z54.number(),
4304
- waitingCallCount: z54.number()
4310
+ var TotalQueueLiveCallStatusSchema = z55.object({
4311
+ activeCallCount: z55.number(),
4312
+ waitingCallCount: z55.number()
4305
4313
  });
4306
- var QueueLiveCallListByQueueSchema = z54.object({
4307
- queueNumber: z54.string(),
4308
- activeCallCount: z54.number(),
4309
- waitingCallCount: z54.number()
4314
+ var QueueLiveCallListByQueueSchema = z55.object({
4315
+ queueNumber: z55.string(),
4316
+ activeCallCount: z55.number(),
4317
+ waitingCallCount: z55.number()
4310
4318
  });
4311
- var queueLiveCallCountListSchema = z54.object({
4319
+ var queueLiveCallCountListSchema = z55.object({
4312
4320
  totalQueueLiveCallStatus: TotalQueueLiveCallStatusSchema,
4313
- queueLiveCallListByQueue: z54.array(QueueLiveCallListByQueueSchema)
4314
- });
4315
- var TicketCountByStatusSchema = z54.object({
4316
- total: z54.number(),
4317
- open: z54.number(),
4318
- pending: z54.number(),
4319
- duration: z54.object({
4320
- day: z54.string().nullable(),
4321
- hour: z54.string().nullable()
4321
+ queueLiveCallListByQueue: z55.array(QueueLiveCallListByQueueSchema)
4322
+ });
4323
+ var TicketCountByStatusSchema = z55.object({
4324
+ total: z55.number(),
4325
+ open: z55.number(),
4326
+ pending: z55.number(),
4327
+ duration: z55.object({
4328
+ day: z55.string().nullable(),
4329
+ hour: z55.string().nullable()
4322
4330
  }),
4323
- solved: z54.number(),
4324
- others: z54.number(),
4325
- closed: z54.number(),
4326
- unassigneed: z54.number()
4327
- });
4328
- var ExpiredTicketSchema = z54.array(
4329
- z54.object({
4330
- id: z54.string(),
4331
- ticketNumber: z54.number(),
4332
- title: z54.string(),
4333
- priority: z54.string(),
4334
- expiredDays: z54.number()
4331
+ solved: z55.number(),
4332
+ others: z55.number(),
4333
+ closed: z55.number(),
4334
+ unassigneed: z55.number()
4335
+ });
4336
+ var ExpiredTicketSchema = z55.array(
4337
+ z55.object({
4338
+ id: z55.string(),
4339
+ ticketNumber: z55.number(),
4340
+ title: z55.string(),
4341
+ priority: z55.string(),
4342
+ expiredDays: z55.number()
4335
4343
  })
4336
4344
  );
4337
- var TagCountSchema = z54.object({
4338
- id: z54.string(),
4339
- name: z54.string(),
4340
- count: z54.number()
4341
- });
4342
- var TagCountObjSchema = z54.array(TagCountSchema);
4343
- var MessageCountsByChannelObjSchema = z54.record(
4344
- z54.array(
4345
- z54.object({
4346
- platform: z54.string(),
4347
- messageCount: z54.number()
4345
+ var TagCountSchema = z55.object({
4346
+ id: z55.string(),
4347
+ name: z55.string(),
4348
+ count: z55.number()
4349
+ });
4350
+ var TagCountObjSchema = z55.array(TagCountSchema);
4351
+ var MessageCountsByChannelObjSchema = z55.record(
4352
+ z55.array(
4353
+ z55.object({
4354
+ platform: z55.string(),
4355
+ messageCount: z55.number()
4348
4356
  })
4349
4357
  )
4350
4358
  );
4351
- var CallEndResultSchema = z54.array(
4352
- z54.object({ result: z54.string().nullable(), count: z54.string().nullable() }).optional()
4359
+ var CallEndResultSchema = z55.array(
4360
+ z55.object({ result: z55.string().nullable(), count: z55.string().nullable() }).optional()
4353
4361
  ).optional();
4354
- var ConversationCountStatusSchema = z54.object({
4355
- newContactCount: z54.number().nullable(),
4356
- oldContactCount: z54.number().nullable()
4357
- });
4358
- var MessageStatusSchema = z54.object({
4359
- total: z54.number().nullable(),
4360
- closed: z54.number().nullable(),
4361
- unassignedOpen: z54.number().nullable(),
4362
- assignedOpen: z54.number().nullable(),
4363
- hold: z54.number()
4364
- });
4365
- var MessageAverageSchema = z54.object({
4366
- selectedWeekAvgByDay: z54.array(
4367
- z54.object({
4368
- day: z54.string().nullable(),
4369
- avgResolutionTime: z54.string().nullable(),
4370
- avgResponseTime: z54.string().nullable(),
4371
- resolutionRate: z54.string()
4362
+ var ConversationCountStatusSchema = z55.object({
4363
+ newContactCount: z55.number().nullable(),
4364
+ oldContactCount: z55.number().nullable()
4365
+ });
4366
+ var MessageStatusSchema = z55.object({
4367
+ total: z55.number().nullable(),
4368
+ closed: z55.number().nullable(),
4369
+ unassignedOpen: z55.number().nullable(),
4370
+ assignedOpen: z55.number().nullable(),
4371
+ hold: z55.number()
4372
+ });
4373
+ var MessageAverageSchema = z55.object({
4374
+ selectedWeekAvgByDay: z55.array(
4375
+ z55.object({
4376
+ day: z55.string().nullable(),
4377
+ avgResolutionTime: z55.string().nullable(),
4378
+ avgResponseTime: z55.string().nullable(),
4379
+ resolutionRate: z55.string()
4372
4380
  })
4373
4381
  ).optional().nullable(),
4374
- previousWeekAvg: z54.object({
4375
- avgResolutionTime: z54.string().nullable(),
4376
- avgResponseTime: z54.string().nullable(),
4377
- resolutionRate: z54.string()
4382
+ previousWeekAvg: z55.object({
4383
+ avgResolutionTime: z55.string().nullable(),
4384
+ avgResponseTime: z55.string().nullable(),
4385
+ resolutionRate: z55.string()
4378
4386
  }).nullable().optional(),
4379
- selectedWeekAvg: z54.object({
4380
- avgResolutionTime: z54.string().nullable(),
4381
- avgResponseTime: z54.string().nullable(),
4382
- resolutionRate: z54.string()
4387
+ selectedWeekAvg: z55.object({
4388
+ avgResolutionTime: z55.string().nullable(),
4389
+ avgResponseTime: z55.string().nullable(),
4390
+ resolutionRate: z55.string()
4383
4391
  }).nullable().optional()
4384
4392
  });
4385
- var ChannelIncomingMessageSchema = z54.object({
4386
- channelName: z54.string().optional(),
4387
- channelType: z54.string(),
4388
- count: z54.number()
4393
+ var ChannelIncomingMessageSchema = z55.object({
4394
+ channelName: z55.string().optional(),
4395
+ channelType: z55.string(),
4396
+ count: z55.number()
4389
4397
  });
4390
- var MessageDispositionSchema = z54.object({
4391
- name: z54.string().optional().nullable(),
4392
- count: z54.number().optional().nullable()
4398
+ var MessageDispositionSchema = z55.object({
4399
+ name: z55.string().optional().nullable(),
4400
+ count: z55.number().optional().nullable()
4393
4401
  });
4394
- var MessageIncomingDataSchema = z54.array(
4395
- z54.object({
4396
- platform: z54.string().nullable(),
4397
- hour: z54.string().nullable(),
4398
- messageCount: z54.string().nullable()
4402
+ var MessageIncomingDataSchema = z55.array(
4403
+ z55.object({
4404
+ platform: z55.string().nullable(),
4405
+ hour: z55.string().nullable(),
4406
+ messageCount: z55.string().nullable()
4399
4407
  })
4400
4408
  );
4401
- var MessageTotalIncomingDataSchema = z54.array(
4402
- z54.object({ name: z54.string(), data: z54.array(z54.number()) }).nullable()
4409
+ var MessageTotalIncomingDataSchema = z55.array(
4410
+ z55.object({ name: z55.string(), data: z55.array(z55.number()) }).nullable()
4403
4411
  );
4404
- var CallCountsSchema = z54.object({
4405
- answeredCallCount: z54.number().gte(0),
4406
- noAnswerCallCount: z54.number().gte(0),
4407
- busyCallCount: z54.number().gte(0),
4408
- failedCallCount: z54.number().gte(0),
4409
- totalCallCount: z54.number().gte(0)
4410
- });
4411
- var MessageQueueDataSchema = z54.object({
4412
- id: z54.string().uuid().nullable(),
4413
- name: z54.string(),
4414
- sla: z54.number(),
4415
- newContactCount: z54.number(),
4416
- existingContactCount: z54.number(),
4417
- totalRoomCount: z54.number(),
4418
- closedRoomCount: z54.number(),
4419
- unassignedRoomCount: z54.number(),
4420
- assignedRoomCount: z54.number(),
4421
- holdRoomCount: z54.number()
4422
- });
4423
- var AgentMessageStatisticsSchema = z54.object({
4424
- id: z54.string().uuid(),
4425
- name: z54.string(),
4426
- assignedRoomCount: z54.number(),
4427
- holdRoomCount: z54.number(),
4428
- closedRoomCount: z54.number(),
4429
- averageFirstResponseTime: z54.string(),
4430
- averageResolutionTime: z54.string(),
4431
- totalHandledTime: z54.string()
4432
- });
4433
- var UserCheckInLogSchema = z54.object({
4434
- userId: z54.string().uuid(),
4435
- firstLoginTime: z54.string(),
4436
- lastLogoutTime: z54.string().nullable(),
4437
- totalLoginDuration: z54.string().nullable(),
4438
- averageFirstResponseTime: z54.string().nullable(),
4439
- averageResolutionTime: z54.string().nullable(),
4440
- totalHandledTime: z54.string().nullable()
4441
- });
4442
- var UserCheckInLogsWithDaySchema = z54.object({
4443
- date: z54.date(),
4444
- formattedDate: z54.string(),
4445
- userCheckInLogs: z54.array(UserCheckInLogSchema)
4412
+ var CallCountsSchema = z55.object({
4413
+ answeredCallCount: z55.number().gte(0),
4414
+ noAnswerCallCount: z55.number().gte(0),
4415
+ busyCallCount: z55.number().gte(0),
4416
+ failedCallCount: z55.number().gte(0),
4417
+ totalCallCount: z55.number().gte(0)
4418
+ });
4419
+ var MessageQueueDataSchema = z55.object({
4420
+ id: z55.string().uuid().nullable(),
4421
+ name: z55.string(),
4422
+ sla: z55.number(),
4423
+ newContactCount: z55.number(),
4424
+ existingContactCount: z55.number(),
4425
+ totalRoomCount: z55.number(),
4426
+ closedRoomCount: z55.number(),
4427
+ unassignedRoomCount: z55.number(),
4428
+ assignedRoomCount: z55.number(),
4429
+ holdRoomCount: z55.number()
4430
+ });
4431
+ var AgentMessageStatisticsSchema = z55.object({
4432
+ id: z55.string().uuid(),
4433
+ name: z55.string(),
4434
+ assignedRoomCount: z55.number(),
4435
+ holdRoomCount: z55.number(),
4436
+ closedRoomCount: z55.number(),
4437
+ averageFirstResponseTime: z55.string(),
4438
+ averageResolutionTime: z55.string(),
4439
+ totalHandledTime: z55.string()
4440
+ });
4441
+ var UserCheckInLogSchema = z55.object({
4442
+ userId: z55.string().uuid(),
4443
+ firstLoginTime: z55.string(),
4444
+ lastLogoutTime: z55.string().nullable(),
4445
+ totalLoginDuration: z55.string().nullable(),
4446
+ averageFirstResponseTime: z55.string().nullable(),
4447
+ averageResolutionTime: z55.string().nullable(),
4448
+ totalHandledTime: z55.string().nullable()
4449
+ });
4450
+ var UserCheckInLogsWithDaySchema = z55.object({
4451
+ date: z55.date(),
4452
+ formattedDate: z55.string(),
4453
+ userCheckInLogs: z55.array(UserCheckInLogSchema)
4446
4454
  });
4447
4455
 
4448
- // src/export/validation.ts
4449
- import z55 from "zod";
4450
- var ExportFileExtensionSchema = z55.union([
4451
- z55.literal("csv"),
4452
- z55.literal("xlsx")
4453
- ]);
4454
-
4455
4456
  // src/dashboard/index.ts
4456
4457
  var dashboardContract = initContract13().router(
4457
4458
  {
@@ -6037,7 +6038,9 @@ var telephonyCdrContract = initContract24().router(
6037
6038
  method: "GET",
6038
6039
  path: "/export",
6039
6040
  headers: DefaultHeaderSchema,
6040
- query: GetExportTelephonyCdrSchema,
6041
+ query: GetExportTelephonyCdrSchema.extend({
6042
+ fileExtension: ExportFileExtensionSchema
6043
+ }),
6041
6044
  responses: {
6042
6045
  200: null,
6043
6046
  401: DefaultUnauthorizedSchema,
@@ -6726,7 +6729,9 @@ var ticketContract = initContract26().router(
6726
6729
  200: null,
6727
6730
  401: DefaultUnauthorizedSchema
6728
6731
  },
6729
- query: ExportAllTicketQuerySchema,
6732
+ query: ExportAllTicketQuerySchema.extend({
6733
+ fileExtension: ExportFileExtensionSchema
6734
+ }),
6730
6735
  summary: "Export tickets"
6731
6736
  },
6732
6737
  getTicketReasonRequired: {
@@ -6965,7 +6970,9 @@ var userPresenceStatusLogContract = initContract28().router(
6965
6970
  getExportData: {
6966
6971
  method: "GET",
6967
6972
  path: "/export",
6968
- query: UserPresenceStatusLogExportParamsSchema,
6973
+ query: UserPresenceStatusLogExportParamsSchema.extend({
6974
+ fileExtension: ExportFileExtensionSchema
6975
+ }),
6969
6976
  headers: DefaultHeaderSchema,
6970
6977
  responses: {
6971
6978
  200: null,