@kl1/contracts 1.1.4 → 1.1.5-uat

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/index.js +951 -888
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +950 -888
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/src/chat/index.d.ts +2985 -2123
  6. package/dist/src/chat/index.d.ts.map +1 -1
  7. package/dist/src/chat/schema.d.ts +24 -8
  8. package/dist/src/chat/schema.d.ts.map +1 -1
  9. package/dist/src/chat/validation.d.ts +76 -7
  10. package/dist/src/chat/validation.d.ts.map +1 -1
  11. package/dist/src/contract.d.ts +5473 -3651
  12. package/dist/src/contract.d.ts.map +1 -1
  13. package/dist/src/index.d.ts +1 -0
  14. package/dist/src/index.d.ts.map +1 -1
  15. package/dist/src/instagram/index.d.ts +73 -7
  16. package/dist/src/instagram/index.d.ts.map +1 -1
  17. package/dist/src/line/index.d.ts +73 -7
  18. package/dist/src/line/index.d.ts.map +1 -1
  19. package/dist/src/mail/account-contract.d.ts +360 -137
  20. package/dist/src/mail/account-contract.d.ts.map +1 -1
  21. package/dist/src/mail/index.d.ts +10 -0
  22. package/dist/src/mail/index.d.ts.map +1 -1
  23. package/dist/src/mail/mail-contract.d.ts +1849 -1163
  24. package/dist/src/mail/mail-contract.d.ts.map +1 -1
  25. package/dist/src/mail/mail-server-contract.d.ts +477 -18
  26. package/dist/src/mail/mail-server-contract.d.ts.map +1 -1
  27. package/dist/src/mail/message-contract.d.ts +54 -54
  28. package/dist/src/mail/room-contract.d.ts +960 -954
  29. package/dist/src/mail/room-contract.d.ts.map +1 -1
  30. package/dist/src/mail/schemas/account-validation.schema.d.ts +140 -140
  31. package/dist/src/mail/schemas/account-validation.schema.d.ts.map +1 -1
  32. package/dist/src/mail/schemas/account.schema.d.ts +32 -32
  33. package/dist/src/mail/schemas/message.schema.d.ts +42 -42
  34. package/dist/src/mail/schemas/message.schema.d.ts.map +1 -1
  35. package/dist/src/mail/schemas/room-validation.schema.d.ts +328 -322
  36. package/dist/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
  37. package/dist/src/mail/schemas/room.schema.d.ts +683 -259
  38. package/dist/src/mail/schemas/room.schema.d.ts.map +1 -1
  39. package/dist/src/messenger/index.d.ts +83 -7
  40. package/dist/src/messenger/index.d.ts.map +1 -1
  41. package/dist/src/viber/index.d.ts +73 -7
  42. package/dist/src/viber/index.d.ts.map +1 -1
  43. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1101,7 +1101,9 @@ var PlatformContactSchema = z26.object({
1101
1101
  var RoomSchema = DefaultEntitySchema.extend({
1102
1102
  lastMessage: z26.string(),
1103
1103
  handleTime: z26.number(),
1104
- closeAt: z26.date(),
1104
+ closedAt: z26.date(),
1105
+ lastMessageAt: z26.date().nullable(),
1106
+ status: z26.number(),
1105
1107
  unreadCount: z26.number(),
1106
1108
  firstResponseAt: z26.date(),
1107
1109
  firstResponseTime: z26.number(),
@@ -1278,61 +1280,8 @@ var RepliedMessageSchema = DefaultEntitySchema.extend({
1278
1280
  url: z26.string(),
1279
1281
  previewUrl: z26.string(),
1280
1282
  imageSetId: z26.string(),
1281
- // room: RoomSchema,
1282
1283
  upload: UploadSchema,
1283
- // id: z.string().uuid(),
1284
- // createdAt: z.date(),
1285
- // updatedAt: z.date(),
1286
- // deletedAt: z.date().nullable(),
1287
- // name: z.string(),
1288
- // email: z.string().email(),
1289
- // emailVerifiedAt: z.date().nullable(),
1290
- // password: z.string(),
1291
- // address: z.string().nullable(),
1292
- // phone: z.string().nullable(),
1293
- // notificationCount: z.number().nullable(),
1294
- // roles: z.array(RoleSchema),
1295
- // extension: z.object({
1296
- // id: z.string().uuid(),
1297
- // createdAt: z.date(),
1298
- // updatedAt: z.date(),
1299
- // deletedAt: z.date().nullable(),
1300
- // userId: z.string().nullable(),
1301
- // sipServerUrl: z.string(),
1302
- // sipUserName: z.string(),
1303
- // webphoneLoginUser: z.string(),
1304
- // extensionId: z.string().nullable(),
1305
- // extensionName: z.string(),
1306
- // telephonySignature: z.string().nullable(),
1307
- // }),
1308
- // }),
1309
1284
  actor: UserSchema,
1310
- // id: z.string().uuid(),
1311
- // createdAt: z.date(),
1312
- // updatedAt: z.date(),
1313
- // deletedAt: z.date().nullable(),
1314
- // name: z.string(),
1315
- // email: z.string().email(),
1316
- // emailVerifiedAt: z.date().nullable(),
1317
- // password: z.string(),
1318
- // address: z.string().nullable(),
1319
- // phone: z.string().nullable(),
1320
- // notificationCount: z.number().nullable(),
1321
- // roles: z.array(RoleSchema),
1322
- // extension: z.object({
1323
- // id: z.string().uuid(),
1324
- // createdAt: z.date(),
1325
- // updatedAt: z.date(),
1326
- // deletedAt: z.date().nullable(),
1327
- // userId: z.string().nullable(),
1328
- // sipServerUrl: z.string(),
1329
- // sipUserName: z.string(),
1330
- // webphoneLoginUser: z.string(),
1331
- // extensionId: z.string().nullable(),
1332
- // extensionName: z.string(),
1333
- // telephonySignature: z.string().nullable(),
1334
- // }),
1335
- // }),
1336
1285
  assignee: UserSchema,
1337
1286
  sender: UserSchema
1338
1287
  });
@@ -1448,7 +1397,12 @@ var SendMessageSchema = z29.object({
1448
1397
  messageAttachments: MessageAttachmentSchema.optional(),
1449
1398
  user: UserSchema.optional(),
1450
1399
  sticker: StickerSchema.optional(),
1451
- file: z29.custom().optional()
1400
+ file: z29.custom().optional(),
1401
+ messengerTags: z29.union([
1402
+ z29.literal("post_purchase_update"),
1403
+ z29.literal("account_update"),
1404
+ z29.literal("confirmed_event_update")
1405
+ ]).optional()
1452
1406
  });
1453
1407
  var SolveRoomSchema = z29.object({
1454
1408
  roomId: z29.string(),
@@ -1497,6 +1451,7 @@ var SendMessageToPlatformSchema = z29.object({
1497
1451
  createdAt: z29.string(),
1498
1452
  updatedAt: z29.string(),
1499
1453
  platformContact: z29.object({
1454
+ id: z29.string().uuid(),
1500
1455
  channelId: z29.string().uuid(),
1501
1456
  socialPlatformId: z29.string().nullable(),
1502
1457
  type: ChannelTypeSchema,
@@ -1511,12 +1466,23 @@ var SendMessageToPlatformSchema = z29.object({
1511
1466
  })
1512
1467
  }),
1513
1468
  actor: z29.object({
1469
+ id: z29.string().uuid(),
1514
1470
  name: z29.string(),
1515
1471
  email: z29.string().email(),
1516
1472
  address: z29.string().nullable(),
1517
1473
  phone: z29.string().nullable()
1518
1474
  }).nullable(),
1519
- channel: ChannelSchema2
1475
+ assignee: z29.object({
1476
+ id: z29.string().uuid(),
1477
+ name: z29.string(),
1478
+ email: z29.string().email()
1479
+ }).nullable(),
1480
+ channel: ChannelSchema2,
1481
+ messengerTags: z29.union([
1482
+ z29.literal("post_purchase_update"),
1483
+ z29.literal("account_update"),
1484
+ z29.literal("confirmed_event_update")
1485
+ ]).optional()
1520
1486
  }),
1521
1487
  message: z29.object({
1522
1488
  message: z29.string().optional(),
@@ -2022,6 +1988,7 @@ var mainChatContract = initContract7().router(
2022
1988
  body: SendMessageSchema,
2023
1989
  responses: {
2024
1990
  200: SendMessageResponseSchema,
1991
+ 400: DefaultErrorResponseSchema,
2025
1992
  422: DefaultErrorResponseSchema,
2026
1993
  500: DefaultErrorResponseSchema
2027
1994
  },
@@ -2094,7 +2061,24 @@ var mainChatContract = initContract7().router(
2094
2061
  }),
2095
2062
  responses: {
2096
2063
  200: DefaultSuccessResponseSchema.extend({
2097
- data: RoomSchema
2064
+ data: z33.object({
2065
+ room: RoomSchema,
2066
+ latestIncomingMessage: z33.object({
2067
+ message: z33.string(),
2068
+ direction: MessageDirectionTypeSchema,
2069
+ type: MessageTypeSchema,
2070
+ readAt: z33.date(),
2071
+ metadata: z33.any(),
2072
+ platformId: z33.string(),
2073
+ platformMessageId: z33.string(),
2074
+ replyPlatformMessageId: z33.string(),
2075
+ template: z33.any(),
2076
+ locale: MessageLocaleTypeSchema,
2077
+ url: z33.string(),
2078
+ previewUrl: z33.string(),
2079
+ imageSetId: z33.string()
2080
+ })
2081
+ })
2098
2082
  }),
2099
2083
  404: DefaultErrorResponseSchema
2100
2084
  },
@@ -4015,7 +3999,7 @@ import { initContract as initContract22 } from "@ts-rest/core";
4015
3999
 
4016
4000
  // src/mail/room-contract.ts
4017
4001
  import { initContract as initContract18 } from "@ts-rest/core";
4018
- import z59 from "zod";
4002
+ import z60 from "zod";
4019
4003
 
4020
4004
  // src/mail/schemas/room.schema.ts
4021
4005
  import z58 from "zod";
@@ -4029,12 +4013,12 @@ var MailServerSchema = z56.object({
4029
4013
  deletedAt: z56.date().nullable(),
4030
4014
  name: z56.string(),
4031
4015
  smtpHost: z56.string(),
4032
- smtpPort: z56.string(),
4033
- smtpTlsPort: z56.string(),
4016
+ smtpPort: z56.number(),
4017
+ smtpTlsPort: z56.number(),
4034
4018
  useTlsForSmtp: z56.boolean(),
4035
4019
  imapHost: z56.string(),
4036
- imapPort: z56.string(),
4037
- imapTlsPort: z56.string(),
4020
+ imapPort: z56.number(),
4021
+ imapTlsPort: z56.number(),
4038
4022
  useTlsForImap: z56.boolean()
4039
4023
  });
4040
4024
  var MailAccountSchema = z56.object({
@@ -4077,12 +4061,12 @@ var AttachmentSchema = z57.object({
4077
4061
  createdAt: z57.date(),
4078
4062
  updatedAt: z57.date(),
4079
4063
  deletedAt: z57.nullable(z57.date()),
4080
- bucket_name: z57.string(),
4081
- file_name: z57.string(),
4082
- file_key: z57.string(),
4083
- file_size: z57.number(),
4084
- file_url: z57.string(),
4085
- extension_name: z57.string()
4064
+ bucketName: z57.string(),
4065
+ fileName: z57.string(),
4066
+ fileKey: z57.string(),
4067
+ fileSize: z57.number(),
4068
+ fileUrl: z57.string(),
4069
+ extensionName: z57.string()
4086
4070
  })
4087
4071
  });
4088
4072
  var MessageSchema2 = z57.object({
@@ -4136,7 +4120,7 @@ var UserModel = z58.object({
4136
4120
  email: z58.string(),
4137
4121
  address: z58.string().nullable(),
4138
4122
  phone: z58.string().nullable(),
4139
- notification_count: z58.number().nullable()
4123
+ notificationCount: z58.number().nullable()
4140
4124
  });
4141
4125
  var ActivityLogModel = z58.object({
4142
4126
  id: z58.string(),
@@ -4148,7 +4132,9 @@ var ActivityLogModel = z58.object({
4148
4132
  roomId: z58.string(),
4149
4133
  actor: UserModel
4150
4134
  });
4151
- var MessagesAndLogs = z58.array(z58.union([MessageSchema2, ActivityLogModel]));
4135
+ var MessagesAndLogsSchema = z58.array(
4136
+ z58.union([MessageSchema2, ActivityLogModel])
4137
+ );
4152
4138
  var MailRoomSchema = z58.object({
4153
4139
  id: z58.string(),
4154
4140
  createdAt: z58.date(),
@@ -4171,7 +4157,7 @@ var MailRoomSchema = z58.object({
4171
4157
  tags: z58.array(TagSchema2),
4172
4158
  assignee: UserModel,
4173
4159
  messages: z58.array(MessageSchema2),
4174
- messagesAndLogs: MessagesAndLogs,
4160
+ messagesAndLogs: MessagesAndLogsSchema,
4175
4161
  mail: MailAccountSchema,
4176
4162
  unReadMessageCount: z58.number()
4177
4163
  });
@@ -4185,6 +4171,55 @@ var AttachmentSchema2 = z58.object({
4185
4171
  upload: UploadSchema
4186
4172
  });
4187
4173
 
4174
+ // src/mail/schemas/room-validation.schema.ts
4175
+ import z59 from "zod";
4176
+ var RoomContractsValidationSchema = {
4177
+ getAll: {
4178
+ input: z59.object({
4179
+ page: z59.coerce.number().default(1),
4180
+ pageSize: z59.coerce.number().default(10),
4181
+ keyword: z59.string().optional(),
4182
+ contactLabels: z59.array(z59.string()).optional(),
4183
+ level1: z59.union([
4184
+ z59.literal("open"),
4185
+ z59.literal("close"),
4186
+ z59.literal("inbox"),
4187
+ z59.literal("sent"),
4188
+ z59.literal("scheduled"),
4189
+ z59.literal("starred")
4190
+ ]).optional(),
4191
+ level2: z59.union([
4192
+ z59.literal("all"),
4193
+ z59.literal("unassign"),
4194
+ z59.literal("mine"),
4195
+ z59.literal("other")
4196
+ ]).optional()
4197
+ }),
4198
+ output: z59.object({
4199
+ data: z59.array(MailRoomSchema),
4200
+ total: z59.number(),
4201
+ page: z59.number(),
4202
+ pageSize: z59.number()
4203
+ })
4204
+ },
4205
+ update: {
4206
+ input: z59.object({
4207
+ resolved: z59.boolean().or(
4208
+ z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
4209
+ ).optional().nullable(),
4210
+ assigneeId: z59.string().uuid().optional().nullable(),
4211
+ note: z59.string().optional(),
4212
+ tags: z59.array(z59.string().uuid()).optional(),
4213
+ handover: z59.boolean().or(
4214
+ z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
4215
+ ).optional().nullable(),
4216
+ selfAssign: z59.boolean().or(
4217
+ z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
4218
+ ).optional().nullable()
4219
+ })
4220
+ }
4221
+ };
4222
+
4188
4223
  // src/mail/room-contract.ts
4189
4224
  var roomContract = initContract18().router(
4190
4225
  {
@@ -4193,7 +4228,7 @@ var roomContract = initContract18().router(
4193
4228
  path: "/",
4194
4229
  responses: {
4195
4230
  200: DefaultSuccessResponseSchema.extend({
4196
- message: z59.string()
4231
+ message: z60.string()
4197
4232
  }),
4198
4233
  ...DefaultResponses
4199
4234
  },
@@ -4203,19 +4238,13 @@ var roomContract = initContract18().router(
4203
4238
  getAll: {
4204
4239
  method: "GET",
4205
4240
  path: "",
4206
- query: z59.object({
4207
- page: z59.coerce.number().default(1),
4208
- pageSize: z59.coerce.number().default(10),
4209
- keyword: z59.string().optional(),
4210
- assigneeId: z59.string().uuid().optional().nullable(),
4211
- resolved: z59.boolean().or(z59.string().transform((value) => value.toLowerCase() === "true")).optional().nullable()
4212
- }),
4241
+ query: RoomContractsValidationSchema.getAll.input,
4213
4242
  responses: {
4214
4243
  200: DefaultSuccessResponseSchema.extend({
4215
- data: z59.array(MailRoomSchema),
4216
- total: z59.number(),
4217
- page: z59.number(),
4218
- pageSize: z59.number()
4244
+ data: z60.array(MailRoomSchema),
4245
+ total: z60.number(),
4246
+ page: z60.number(),
4247
+ pageSize: z60.number()
4219
4248
  }),
4220
4249
  ...DefaultResponses
4221
4250
  },
@@ -4224,8 +4253,8 @@ var roomContract = initContract18().router(
4224
4253
  getById: {
4225
4254
  method: "GET",
4226
4255
  path: "/:id",
4227
- pathParams: z59.object({
4228
- id: z59.string().uuid()
4256
+ pathParams: z60.object({
4257
+ id: z60.string().uuid()
4229
4258
  }),
4230
4259
  responses: {
4231
4260
  200: DefaultSuccessResponseSchema.extend({
@@ -4238,12 +4267,12 @@ var roomContract = initContract18().router(
4238
4267
  getAttachments: {
4239
4268
  method: "GET",
4240
4269
  path: "/:id/attachments",
4241
- pathParams: z59.object({
4242
- id: z59.string().uuid()
4270
+ pathParams: z60.object({
4271
+ id: z60.string().uuid()
4243
4272
  }),
4244
4273
  responses: {
4245
4274
  200: DefaultSuccessResponseSchema.extend({
4246
- data: z59.array(AttachmentSchema2)
4275
+ data: z60.array(AttachmentSchema2)
4247
4276
  }),
4248
4277
  ...DefaultResponses
4249
4278
  },
@@ -4252,12 +4281,12 @@ var roomContract = initContract18().router(
4252
4281
  getParticipants: {
4253
4282
  method: "GET",
4254
4283
  path: "/:id/participants",
4255
- pathParams: z59.object({
4256
- id: z59.string().uuid()
4284
+ pathParams: z60.object({
4285
+ id: z60.string().uuid()
4257
4286
  }),
4258
4287
  responses: {
4259
4288
  200: DefaultSuccessResponseSchema.extend({
4260
- data: z59.array(MailUserSchema)
4289
+ data: z60.array(MailUserSchema)
4261
4290
  }),
4262
4291
  ...DefaultResponses
4263
4292
  },
@@ -4266,8 +4295,8 @@ var roomContract = initContract18().router(
4266
4295
  update: {
4267
4296
  method: "PATCH",
4268
4297
  path: "/:id",
4269
- pathParams: z59.object({
4270
- id: z59.string()
4298
+ pathParams: z60.object({
4299
+ id: z60.string()
4271
4300
  }),
4272
4301
  responses: {
4273
4302
  200: DefaultSuccessResponseSchema.extend({
@@ -4275,28 +4304,18 @@ var roomContract = initContract18().router(
4275
4304
  }),
4276
4305
  ...DefaultResponses
4277
4306
  },
4278
- body: z59.object({
4279
- resolved: z59.boolean().or(
4280
- z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
4281
- ).optional().nullable(),
4282
- assigneeId: z59.string().uuid().optional().nullable(),
4283
- note: z59.string().optional(),
4284
- tags: z59.array(z59.string().uuid()).optional(),
4285
- handover: z59.boolean().or(
4286
- z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
4287
- ).optional().nullable()
4288
- }),
4307
+ body: RoomContractsValidationSchema.update.input,
4289
4308
  summary: "Update a mail room by id"
4290
4309
  },
4291
4310
  markAsRead: {
4292
4311
  method: "GET",
4293
4312
  path: "/:id",
4294
- pathParams: z59.object({
4295
- id: z59.string().uuid()
4313
+ pathParams: z60.object({
4314
+ id: z60.string().uuid()
4296
4315
  }),
4297
4316
  responses: {
4298
4317
  200: DefaultSuccessResponseSchema.extend({
4299
- message: z59.string()
4318
+ message: z60.string()
4300
4319
  }),
4301
4320
  ...DefaultResponses
4302
4321
  },
@@ -4310,47 +4329,47 @@ var roomContract = initContract18().router(
4310
4329
 
4311
4330
  // src/mail/account-contract.ts
4312
4331
  import { initContract as initContract19 } from "@ts-rest/core";
4313
- import z61 from "zod";
4332
+ import z62 from "zod";
4314
4333
 
4315
4334
  // src/mail/schemas/account-validation.schema.ts
4316
- import z60 from "zod";
4335
+ import z61 from "zod";
4317
4336
  var AccountContractsValidationSchemas = {
4318
4337
  create: {
4319
- input: z60.object({
4320
- address: z60.string().email("Email address must be valid email."),
4321
- name: z60.string().min(1, "Account name cannot be empty."),
4322
- password: z60.string().min(1, "Password cannot be empty."),
4323
- mailServerId: z60.string().uuid("Invalid mail_server_id")
4338
+ input: z61.object({
4339
+ address: z61.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
4340
+ name: z61.string().min(1, "Account name cannot be empty."),
4341
+ password: z61.string().min(1, "Password cannot be empty."),
4342
+ mailServerId: z61.string().uuid("Invalid mail_server_id")
4324
4343
  })
4325
4344
  },
4326
4345
  getById: {
4327
- input: z60.object({
4328
- id: z60.string().uuid()
4346
+ input: z61.object({
4347
+ id: z61.string().uuid()
4329
4348
  }),
4330
4349
  output: MailAccountSchema
4331
4350
  },
4332
4351
  getAll: {
4333
- output: z60.array(MailAccountSchema)
4352
+ output: z61.array(MailAccountSchema)
4334
4353
  },
4335
4354
  update: {
4336
4355
  input: MailAccountSchema,
4337
4356
  output: MailAccountSchema
4338
4357
  },
4339
4358
  disconnect: {
4340
- input: z60.object({
4341
- id: z60.string().uuid()
4359
+ input: z61.object({
4360
+ id: z61.string().uuid()
4342
4361
  }),
4343
4362
  output: MailAccountSchema
4344
4363
  },
4345
4364
  reconnect: {
4346
- input: z60.object({
4347
- id: z60.string()
4365
+ input: z61.object({
4366
+ id: z61.string()
4348
4367
  }),
4349
4368
  output: MailAccountSchema
4350
4369
  },
4351
4370
  delete: {
4352
- input: z60.object({
4353
- id: z60.string()
4371
+ input: z61.object({
4372
+ id: z61.string()
4354
4373
  }),
4355
4374
  output: MailAccountSchema
4356
4375
  }
@@ -4366,16 +4385,16 @@ var accountContract = initContract19().router(
4366
4385
  responses: {
4367
4386
  201: DefaultSuccessResponseSchema.extend({
4368
4387
  // data: AccountContractsValidationSchemas.create.output,
4369
- message: z61.string()
4388
+ message: z62.string()
4370
4389
  }),
4371
- 400: z61.object({
4372
- message: z61.string()
4390
+ 400: z62.object({
4391
+ message: z62.string()
4373
4392
  }),
4374
- 409: z61.object({
4375
- message: z61.string()
4393
+ 409: z62.object({
4394
+ message: z62.string()
4376
4395
  }),
4377
- 500: z61.object({
4378
- message: z61.string()
4396
+ 500: z62.object({
4397
+ message: z62.string()
4379
4398
  }),
4380
4399
  ...DefaultResponses
4381
4400
  },
@@ -4383,6 +4402,18 @@ var accountContract = initContract19().router(
4383
4402
  summary: "Register a new mail account"
4384
4403
  },
4385
4404
  //#endregion register account
4405
+ //#region ........sync all accounts
4406
+ sync: {
4407
+ method: "GET",
4408
+ path: "/sync",
4409
+ responses: {
4410
+ 200: DefaultSuccessResponseSchema.extend({
4411
+ message: z62.string()
4412
+ }),
4413
+ ...DefaultResponses
4414
+ },
4415
+ summary: "Sync all accounts state from email engine to system"
4416
+ },
4386
4417
  //#region ........get account
4387
4418
  getById: {
4388
4419
  method: "GET",
@@ -4394,30 +4425,32 @@ var accountContract = initContract19().router(
4394
4425
  }),
4395
4426
  ...DefaultResponses
4396
4427
  },
4397
- summary: "Get a account by id"
4428
+ summary: "Get an account by id"
4398
4429
  },
4399
4430
  //#endregion get account
4431
+ //#endregion sync all accountss
4400
4432
  //#region ........get all account
4401
- //TODO: add pagination parameters
4402
4433
  getAll: {
4403
4434
  method: "GET",
4404
4435
  path: "",
4436
+ query: z62.object({
4437
+ state: z62.union([z62.literal("connected"), z62.literal("disconnected")]).optional()
4438
+ }).optional(),
4405
4439
  responses: {
4406
4440
  200: DefaultSuccessResponseSchema.extend({
4407
- data: z61.any()
4408
- // data: AccountContractsValidationSchemas.getAll.output,
4441
+ data: z62.array(MailAccountSchema)
4409
4442
  }),
4410
4443
  ...DefaultResponses
4411
4444
  },
4412
- summary: "Get al accounts"
4445
+ summary: "Get all accounts"
4413
4446
  },
4414
4447
  //#endregion get all accounts
4415
4448
  //#region ........update account
4416
4449
  update: {
4417
4450
  method: "PATCH",
4418
4451
  path: "/:id",
4419
- pathParams: z61.object({
4420
- id: z61.string().uuid()
4452
+ pathParams: z62.object({
4453
+ id: z62.string().uuid()
4421
4454
  }),
4422
4455
  responses: {
4423
4456
  201: DefaultSuccessResponseSchema.extend({
@@ -4466,7 +4499,7 @@ var accountContract = initContract19().router(
4466
4499
  pathParams: AccountContractsValidationSchemas.delete.input,
4467
4500
  responses: {
4468
4501
  200: DefaultSuccessResponseSchema.extend({
4469
- message: z61.string()
4502
+ message: z62.string()
4470
4503
  }),
4471
4504
  ...DefaultResponses
4472
4505
  },
@@ -4483,64 +4516,91 @@ var accountContract = initContract19().router(
4483
4516
 
4484
4517
  // src/mail/mail-server-contract.ts
4485
4518
  import { initContract as initContract20 } from "@ts-rest/core";
4486
- import z62 from "zod";
4519
+ import z64 from "zod";
4520
+
4521
+ // src/mail/schemas/servers-validation.schema.ts
4522
+ import z63 from "zod";
4523
+ var CreateMailServerSchema = z63.object({
4524
+ name: z63.string(),
4525
+ smtpHost: z63.string(),
4526
+ smtpPort: z63.number(),
4527
+ smtpTlsPort: z63.number(),
4528
+ useTlsForSmtp: z63.boolean(),
4529
+ imapHost: z63.string(),
4530
+ imapPort: z63.number(),
4531
+ imapTlsPort: z63.number(),
4532
+ useTlsForImap: z63.boolean()
4533
+ });
4534
+
4535
+ // src/mail/mail-server-contract.ts
4487
4536
  var serverContract = initContract20().router(
4488
4537
  {
4489
4538
  create: {
4490
4539
  method: "POST",
4491
4540
  path: "/",
4492
4541
  responses: {
4493
- 200: DefaultSuccessResponseSchema.extend({
4494
- message: z62.string()
4542
+ 201: DefaultSuccessResponseSchema.extend({
4543
+ data: MailServerSchema
4495
4544
  }),
4496
4545
  ...DefaultResponses
4497
4546
  },
4498
- body: null,
4547
+ body: CreateMailServerSchema,
4499
4548
  summary: "Register a new mail server"
4500
4549
  },
4501
- get: {
4550
+ getById: {
4502
4551
  method: "GET",
4503
4552
  path: "/:id",
4504
- pathParams: z62.object({
4505
- id: z62.string()
4553
+ pathParams: z64.object({
4554
+ id: z64.string().uuid()
4506
4555
  }),
4507
4556
  responses: {
4508
4557
  200: DefaultSuccessResponseSchema.extend({
4509
- message: z62.string()
4558
+ data: MailServerSchema
4510
4559
  }),
4511
4560
  ...DefaultResponses
4512
4561
  },
4513
4562
  summary: "Get a mail server by id"
4514
4563
  },
4564
+ getAll: {
4565
+ method: "GET",
4566
+ path: "/",
4567
+ responses: {
4568
+ 200: DefaultSuccessResponseSchema.extend({
4569
+ data: z64.array(MailServerSchema)
4570
+ }),
4571
+ ...DefaultResponses
4572
+ },
4573
+ summary: "Get all mail servers"
4574
+ },
4515
4575
  update: {
4516
4576
  method: "PATCH",
4517
4577
  path: "/:id",
4518
- pathParams: z62.object({
4519
- id: z62.string()
4578
+ pathParams: z64.object({
4579
+ id: z64.string().uuid()
4520
4580
  }),
4521
4581
  responses: {
4522
4582
  200: DefaultSuccessResponseSchema.extend({
4523
- message: z62.string()
4583
+ data: MailServerSchema
4524
4584
  }),
4525
4585
  ...DefaultResponses
4526
4586
  },
4527
- body: null,
4528
- summary: "Update a mail server by id"
4587
+ body: CreateMailServerSchema.partial(),
4588
+ summary: "Update a mail server"
4529
4589
  },
4530
4590
  delete: {
4531
- method: "PATCH",
4591
+ method: "DELETE",
4532
4592
  path: "/:id",
4533
- pathParams: z62.object({
4534
- id: z62.string()
4593
+ pathParams: z64.object({
4594
+ id: z64.string().uuid()
4535
4595
  }),
4536
4596
  responses: {
4537
4597
  200: DefaultSuccessResponseSchema.extend({
4538
- message: z62.string()
4598
+ data: MailServerSchema
4539
4599
  }),
4540
4600
  ...DefaultResponses
4541
4601
  },
4542
4602
  body: null,
4543
- summary: "Delete a mail server by id"
4603
+ summary: "Delete a mail server"
4544
4604
  }
4545
4605
  },
4546
4606
  {
@@ -4550,44 +4610,44 @@ var serverContract = initContract20().router(
4550
4610
 
4551
4611
  // src/mail/message-contract.ts
4552
4612
  import { initContract as initContract21 } from "@ts-rest/core";
4553
- import z64 from "zod";
4613
+ import z66 from "zod";
4554
4614
 
4555
4615
  // src/mail/schemas/message-validation.schema.ts
4556
- import z63 from "zod";
4557
- var MailParticipant = z63.object({
4558
- name: z63.string().optional(),
4559
- address: z63.string().email()
4616
+ import z65 from "zod";
4617
+ var MailParticipant = z65.object({
4618
+ name: z65.string().optional(),
4619
+ address: z65.string().email()
4560
4620
  });
4561
4621
  var MessageContractsValidationsSchema = {
4562
4622
  submit: {
4563
- input: z63.object({
4564
- subject: z63.string(),
4565
- text: z63.string(),
4566
- html: z63.string(),
4623
+ input: z65.object({
4624
+ subject: z65.string(),
4625
+ text: z65.string(),
4626
+ html: z65.string(),
4567
4627
  from: MailParticipant,
4568
- to: z63.array(MailParticipant),
4569
- cc: z63.array(MailParticipant).optional(),
4570
- bcc: z63.array(MailParticipant).optional(),
4571
- reference: z63.object({
4572
- messageId: z63.string(),
4573
- action: z63.union([z63.literal("reply"), z63.literal("forward")])
4628
+ to: z65.array(MailParticipant),
4629
+ cc: z65.array(MailParticipant).optional(),
4630
+ bcc: z65.array(MailParticipant).optional(),
4631
+ reference: z65.object({
4632
+ messageId: z65.string(),
4633
+ action: z65.union([z65.literal("reply"), z65.literal("forward")])
4574
4634
  }).optional(),
4575
- attachments: z63.array(
4576
- z63.object({
4577
- fileType: z63.string(),
4578
- fileName: z63.string(),
4579
- fileKey: z63.string(),
4580
- fileSize: z63.number(),
4581
- bucketName: z63.string(),
4582
- presignedUrl: z63.string()
4635
+ attachments: z65.array(
4636
+ z65.object({
4637
+ fileType: z65.string(),
4638
+ fileName: z65.string(),
4639
+ fileKey: z65.string(),
4640
+ fileSize: z65.number(),
4641
+ bucketName: z65.string(),
4642
+ presignedUrl: z65.string()
4583
4643
  })
4584
4644
  ).optional()
4585
4645
  }),
4586
- output: z63.object({
4587
- response: z63.string(),
4588
- messageId: z63.string(),
4589
- sendAt: z63.string(),
4590
- queueId: z63.string()
4646
+ output: z65.object({
4647
+ response: z65.string(),
4648
+ messageId: z65.string(),
4649
+ sendAt: z65.string(),
4650
+ queueId: z65.string()
4591
4651
  })
4592
4652
  }
4593
4653
  };
@@ -4612,8 +4672,8 @@ var messageContract = initContract21().router(
4612
4672
  getById: {
4613
4673
  method: "GET",
4614
4674
  path: "/:id",
4615
- pathParams: z64.object({
4616
- id: z64.string()
4675
+ pathParams: z66.object({
4676
+ id: z66.string()
4617
4677
  }),
4618
4678
  responses: {
4619
4679
  200: DefaultSuccessResponseSchema.extend({
@@ -4640,7 +4700,7 @@ var mailContract = initContract22().router({
4640
4700
 
4641
4701
  // src/messenger/index.ts
4642
4702
  import { initContract as initContract23 } from "@ts-rest/core";
4643
- import z65 from "zod";
4703
+ import z67 from "zod";
4644
4704
  var messengerContract = initContract23().router({
4645
4705
  sendMessage: {
4646
4706
  method: "POST",
@@ -4648,6 +4708,7 @@ var messengerContract = initContract23().router({
4648
4708
  body: SendMessageToPlatformSchema,
4649
4709
  responses: {
4650
4710
  200: SendMessageResponseSchema,
4711
+ 400: DefaultErrorResponseSchema,
4651
4712
  500: DefaultErrorResponseSchema
4652
4713
  }
4653
4714
  },
@@ -4674,8 +4735,8 @@ var messengerContract = initContract23().router({
4674
4735
  reconnect: {
4675
4736
  method: "POST",
4676
4737
  path: "/reconnect/:channelId",
4677
- pathParams: z65.object({
4678
- channelId: z65.string().uuid()
4738
+ pathParams: z67.object({
4739
+ channelId: z67.string().uuid()
4679
4740
  }),
4680
4741
  body: null,
4681
4742
  responses: {
@@ -4687,8 +4748,8 @@ var messengerContract = initContract23().router({
4687
4748
  delete: {
4688
4749
  method: "DELETE",
4689
4750
  path: "/delete/:channelId",
4690
- pathParams: z65.object({
4691
- channelId: z65.string().uuid()
4751
+ pathParams: z67.object({
4752
+ channelId: z67.string().uuid()
4692
4753
  }),
4693
4754
  body: null,
4694
4755
  responses: {
@@ -4720,7 +4781,7 @@ var messengerContract = initContract23().router({
4720
4781
 
4721
4782
  // src/permission/index.ts
4722
4783
  import { initContract as initContract24 } from "@ts-rest/core";
4723
- import z66 from "zod";
4784
+ import z68 from "zod";
4724
4785
  var permissionContract = initContract24().router(
4725
4786
  {
4726
4787
  getPermissions: {
@@ -4728,9 +4789,9 @@ var permissionContract = initContract24().router(
4728
4789
  path: "",
4729
4790
  headers: DefaultHeaderSchema,
4730
4791
  responses: {
4731
- 200: z66.object({ permissions: PermissionSchema.array() }),
4732
- 400: z66.object({
4733
- message: z66.string()
4792
+ 200: z68.object({ permissions: PermissionSchema.array() }),
4793
+ 400: z68.object({
4794
+ message: z68.string()
4734
4795
  }),
4735
4796
  401: DefaultUnauthorizedSchema,
4736
4797
  500: DefaultErrorResponseSchema
@@ -4743,15 +4804,15 @@ var permissionContract = initContract24().router(
4743
4804
 
4744
4805
  // src/role/index.ts
4745
4806
  import { initContract as initContract25 } from "@ts-rest/core";
4746
- import z68 from "zod";
4807
+ import z70 from "zod";
4747
4808
 
4748
4809
  // src/role/validation.ts
4749
- import { z as z67 } from "zod";
4750
- var CreateRoleSchema = z67.object({
4751
- systemName: z67.string(),
4752
- displayName: z67.string(),
4753
- description: z67.string().nullable(),
4754
- permissions: z67.array(z67.string())
4810
+ import { z as z69 } from "zod";
4811
+ var CreateRoleSchema = z69.object({
4812
+ systemName: z69.string(),
4813
+ displayName: z69.string(),
4814
+ description: z69.string().nullable(),
4815
+ permissions: z69.array(z69.string())
4755
4816
  });
4756
4817
  var UpdateRoleSchema = CreateRoleSchema;
4757
4818
 
@@ -4767,8 +4828,8 @@ var roleContract = initContract25().router(
4767
4828
  201: DefaultSuccessResponseSchema.extend({
4768
4829
  role: RoleSchema
4769
4830
  }),
4770
- 400: z68.object({
4771
- message: z68.string()
4831
+ 400: z70.object({
4832
+ message: z70.string()
4772
4833
  }),
4773
4834
  401: DefaultUnauthorizedSchema,
4774
4835
  500: DefaultErrorResponseSchema
@@ -4778,15 +4839,15 @@ var roleContract = initContract25().router(
4778
4839
  getRoles: {
4779
4840
  method: "GET",
4780
4841
  path: "",
4781
- query: z68.object({
4782
- page: z68.coerce.number().default(1),
4783
- pageSize: z68.coerce.number().default(10)
4842
+ query: z70.object({
4843
+ page: z70.coerce.number().default(1),
4844
+ pageSize: z70.coerce.number().default(10)
4784
4845
  }).optional(),
4785
4846
  headers: DefaultHeaderSchema,
4786
4847
  responses: {
4787
4848
  200: WithPagination(RoleSchema),
4788
- 400: z68.object({
4789
- message: z68.string()
4849
+ 400: z70.object({
4850
+ message: z70.string()
4790
4851
  }),
4791
4852
  401: DefaultUnauthorizedSchema,
4792
4853
  500: DefaultErrorResponseSchema
@@ -4796,15 +4857,15 @@ var roleContract = initContract25().router(
4796
4857
  updateRole: {
4797
4858
  method: "PATCH",
4798
4859
  path: "/:id",
4799
- pathParams: z68.object({ id: z68.string() }),
4860
+ pathParams: z70.object({ id: z70.string() }),
4800
4861
  headers: DefaultHeaderSchema,
4801
4862
  body: UpdateRoleSchema,
4802
4863
  responses: {
4803
4864
  201: DefaultSuccessResponseSchema.extend({
4804
4865
  role: RoleSchema
4805
4866
  }),
4806
- 400: z68.object({
4807
- message: z68.string()
4867
+ 400: z70.object({
4868
+ message: z70.string()
4808
4869
  }),
4809
4870
  401: DefaultUnauthorizedSchema,
4810
4871
  500: DefaultErrorResponseSchema
@@ -4814,11 +4875,11 @@ var roleContract = initContract25().router(
4814
4875
  deleteRole: {
4815
4876
  method: "DELETE",
4816
4877
  path: "/:id",
4817
- pathParams: z68.object({ id: z68.string() }),
4878
+ pathParams: z70.object({ id: z70.string() }),
4818
4879
  headers: DefaultHeaderSchema,
4819
4880
  body: null,
4820
4881
  responses: {
4821
- 200: DefaultSuccessResponseSchema.extend({ message: z68.string() }),
4882
+ 200: DefaultSuccessResponseSchema.extend({ message: z70.string() }),
4822
4883
  500: DefaultErrorResponseSchema
4823
4884
  },
4824
4885
  summary: "Delete a role."
@@ -4829,19 +4890,19 @@ var roleContract = initContract25().router(
4829
4890
 
4830
4891
  // src/tag/index.ts
4831
4892
  import { initContract as initContract26 } from "@ts-rest/core";
4832
- import z70 from "zod";
4893
+ import z72 from "zod";
4833
4894
 
4834
4895
  // src/tag/validation.ts
4835
- import { z as z69 } from "zod";
4836
- var CreateTagSchema = z69.object({
4837
- name: z69.string(),
4896
+ import { z as z71 } from "zod";
4897
+ var CreateTagSchema = z71.object({
4898
+ name: z71.string(),
4838
4899
  group: TagGroupSchema
4839
4900
  });
4840
- var GetTagsSchema = z69.object({
4901
+ var GetTagsSchema = z71.object({
4841
4902
  group: TagGroupSchema.default("general"),
4842
- keyword: z69.string()
4903
+ keyword: z71.string()
4843
4904
  }).partial().optional();
4844
- var UpdateTagSchema = z69.object({ name: z69.string() });
4905
+ var UpdateTagSchema = z71.object({ name: z71.string() });
4845
4906
 
4846
4907
  // src/tag/index.ts
4847
4908
  var tagContract = initContract26().router(
@@ -4864,7 +4925,7 @@ var tagContract = initContract26().router(
4864
4925
  query: GetTagsSchema,
4865
4926
  responses: {
4866
4927
  200: DefaultSuccessResponseSchema.extend({
4867
- tags: z70.array(TagSchema)
4928
+ tags: z72.array(TagSchema)
4868
4929
  }),
4869
4930
  500: DefaultErrorResponseSchema
4870
4931
  },
@@ -4873,7 +4934,7 @@ var tagContract = initContract26().router(
4873
4934
  updateTag: {
4874
4935
  method: "PATCH",
4875
4936
  path: "/:id",
4876
- pathParams: z70.object({ id: z70.string() }),
4937
+ pathParams: z72.object({ id: z72.string() }),
4877
4938
  body: UpdateTagSchema,
4878
4939
  responses: {
4879
4940
  200: DefaultSuccessResponseSchema.extend({
@@ -4886,11 +4947,11 @@ var tagContract = initContract26().router(
4886
4947
  deleteTag: {
4887
4948
  method: "DELETE",
4888
4949
  path: "/:id",
4889
- pathParams: z70.object({ id: z70.string() }),
4890
- body: z70.any().optional(),
4950
+ pathParams: z72.object({ id: z72.string() }),
4951
+ body: z72.any().optional(),
4891
4952
  // We don't need the body.
4892
4953
  responses: {
4893
- 200: DefaultSuccessResponseSchema.extend({ message: z70.string() }),
4954
+ 200: DefaultSuccessResponseSchema.extend({ message: z72.string() }),
4894
4955
  500: DefaultErrorResponseSchema
4895
4956
  },
4896
4957
  headers: DefaultHeaderSchema
@@ -4903,27 +4964,27 @@ var tagContract = initContract26().router(
4903
4964
 
4904
4965
  // src/telephony-agent-presence-status/index.ts
4905
4966
  import { initContract as initContract27 } from "@ts-rest/core";
4906
- import z73 from "zod";
4967
+ import z75 from "zod";
4907
4968
 
4908
4969
  // src/telephony-agent-presence-status/schema.ts
4909
- import z71 from "zod";
4970
+ import z73 from "zod";
4910
4971
  var PresenceStatusSchema = DefaultEntitySchema.extend({
4911
- status: z71.string(),
4912
- description: z71.string()
4972
+ status: z73.string(),
4973
+ description: z73.string()
4913
4974
  });
4914
4975
  var UserPresenceStatusSchema = DefaultEntitySchema.extend({
4915
4976
  user: UserSchema,
4916
4977
  presenceStatus: PresenceStatusSchema,
4917
- customPresenceStatus: z71.string().nullable().optional()
4978
+ customPresenceStatus: z73.string().nullable().optional()
4918
4979
  });
4919
4980
 
4920
4981
  // src/telephony-agent-presence-status/validation.ts
4921
- import { z as z72 } from "zod";
4922
- var UpdateUserStatusSchema = z72.object({
4923
- userId: z72.string(),
4924
- presenceStatusId: z72.string().nullable().optional(),
4925
- customPreseneStatus: z72.string().nullable().optional(),
4926
- reason: z72.string()
4982
+ import { z as z74 } from "zod";
4983
+ var UpdateUserStatusSchema = z74.object({
4984
+ userId: z74.string(),
4985
+ presenceStatusId: z74.string().nullable().optional(),
4986
+ customPreseneStatus: z74.string().nullable().optional(),
4987
+ reason: z74.string()
4927
4988
  });
4928
4989
 
4929
4990
  // src/telephony-agent-presence-status/index.ts
@@ -4934,9 +4995,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4934
4995
  path: "/presence_status",
4935
4996
  headers: DefaultHeaderSchema,
4936
4997
  responses: {
4937
- 200: z73.array(PresenceStatusSchema),
4938
- 400: z73.object({
4939
- message: z73.string()
4998
+ 200: z75.array(PresenceStatusSchema),
4999
+ 400: z75.object({
5000
+ message: z75.string()
4940
5001
  }),
4941
5002
  401: DefaultUnauthorizedSchema,
4942
5003
  500: DefaultErrorResponseSchema
@@ -4948,9 +5009,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4948
5009
  path: "/agents/presence_status",
4949
5010
  headers: DefaultHeaderSchema,
4950
5011
  responses: {
4951
- 200: z73.array(UserPresenceStatusSchema),
4952
- 400: z73.object({
4953
- message: z73.string()
5012
+ 200: z75.array(UserPresenceStatusSchema),
5013
+ 400: z75.object({
5014
+ message: z75.string()
4954
5015
  }),
4955
5016
  401: DefaultUnauthorizedSchema,
4956
5017
  500: DefaultErrorResponseSchema
@@ -4960,12 +5021,12 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4960
5021
  getAgentStatus: {
4961
5022
  method: "GET",
4962
5023
  path: "/presence_status/check_update/:userId",
4963
- pathParams: z73.object({ userId: z73.string() }),
5024
+ pathParams: z75.object({ userId: z75.string() }),
4964
5025
  headers: DefaultHeaderSchema,
4965
5026
  responses: {
4966
5027
  200: UserPresenceStatusSchema,
4967
- 400: z73.object({
4968
- message: z73.string()
5028
+ 400: z75.object({
5029
+ message: z75.string()
4969
5030
  }),
4970
5031
  401: DefaultUnauthorizedSchema,
4971
5032
  500: DefaultErrorResponseSchema
@@ -4981,8 +5042,8 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4981
5042
  200: DefaultSuccessResponseSchema.extend({
4982
5043
  userPresenceStatu: UserPresenceStatusSchema
4983
5044
  }),
4984
- 400: z73.object({
4985
- message: z73.string()
5045
+ 400: z75.object({
5046
+ message: z75.string()
4986
5047
  }),
4987
5048
  401: DefaultUnauthorizedSchema,
4988
5049
  500: DefaultErrorResponseSchema
@@ -4994,63 +5055,63 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4994
5055
  );
4995
5056
 
4996
5057
  // src/telephony-cdr/index.ts
4997
- import z76 from "zod";
5058
+ import z78 from "zod";
4998
5059
 
4999
5060
  // src/telephony-cdr/validation.ts
5000
- import z74 from "zod";
5001
- var CreateTelephonyCdrSchema = z74.object({
5002
- uniqueCallId: z74.string({ required_error: "uniqueCallId is required" }),
5003
- timeStart: z74.string({ required_error: "timeStart is required" }),
5004
- callFrom: z74.string({ required_error: "callFrom is required" }),
5005
- callTo: z74.string({ required_error: "callTo is required" }),
5006
- callDuration: z74.number().nullable(),
5007
- talkDuration: z74.number().nullable(),
5008
- srcTrunkName: z74.string().nullable(),
5009
- dstTrunkName: z74.string().nullable(),
5010
- pinCode: z74.string().nullable(),
5011
- status: z74.string(),
5012
- type: z74.string(),
5013
- recording: z74.string().nullable(),
5014
- didNumber: z74.string().nullable(),
5015
- agentRingTime: z74.number().nullable()
5061
+ import z76 from "zod";
5062
+ var CreateTelephonyCdrSchema = z76.object({
5063
+ uniqueCallId: z76.string({ required_error: "uniqueCallId is required" }),
5064
+ timeStart: z76.string({ required_error: "timeStart is required" }),
5065
+ callFrom: z76.string({ required_error: "callFrom is required" }),
5066
+ callTo: z76.string({ required_error: "callTo is required" }),
5067
+ callDuration: z76.number().nullable(),
5068
+ talkDuration: z76.number().nullable(),
5069
+ srcTrunkName: z76.string().nullable(),
5070
+ dstTrunkName: z76.string().nullable(),
5071
+ pinCode: z76.string().nullable(),
5072
+ status: z76.string(),
5073
+ type: z76.string(),
5074
+ recording: z76.string().nullable(),
5075
+ didNumber: z76.string().nullable(),
5076
+ agentRingTime: z76.number().nullable()
5016
5077
  });
5017
5078
  var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
5018
- selectedDate: z74.string().optional(),
5019
- type: z74.array(z74.string()).optional(),
5020
- status: z74.array(z74.string()).optional(),
5021
- callFrom: z74.string().optional(),
5022
- callTo: z74.string().optional(),
5023
- trunk: z74.array(z74.string()).optional(),
5024
- userId: z74.string().uuid().optional(),
5025
- queueStatus: z74.string().optional(),
5026
- agentIds: z74.array(z74.string().uuid()).optional(),
5027
- agentCallsOnly: z74.coerce.boolean().optional(),
5028
- contactId: z74.string().uuid().optional()
5079
+ selectedDate: z76.string().optional(),
5080
+ type: z76.array(z76.string()).optional(),
5081
+ status: z76.array(z76.string()).optional(),
5082
+ callFrom: z76.string().optional(),
5083
+ callTo: z76.string().optional(),
5084
+ trunk: z76.array(z76.string()).optional(),
5085
+ userId: z76.string().uuid().optional(),
5086
+ queueStatus: z76.string().optional(),
5087
+ agentIds: z76.array(z76.string().uuid()).optional(),
5088
+ agentCallsOnly: z76.coerce.boolean().optional(),
5089
+ contactId: z76.string().uuid().optional()
5029
5090
  });
5030
5091
  var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
5031
- type: z74.array(z74.string()).optional(),
5032
- status: z74.array(z74.string()).optional(),
5033
- callFrom: z74.string().optional(),
5034
- callTo: z74.string().optional(),
5035
- result: z74.array(z74.string()).optional(),
5036
- callTags: z74.array(z74.string()).optional(),
5037
- selectedDate: z74.string().optional(),
5038
- agentId: z74.string().optional(),
5039
- contact: z74.array(z74.string()).optional(),
5040
- callStatus: z74.array(z74.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
5041
- queueIds: z74.array(z74.string()).optional(),
5042
- notes: z74.string().optional()
5092
+ type: z76.array(z76.string()).optional(),
5093
+ status: z76.array(z76.string()).optional(),
5094
+ callFrom: z76.string().optional(),
5095
+ callTo: z76.string().optional(),
5096
+ result: z76.array(z76.string()).optional(),
5097
+ callTags: z76.array(z76.string()).optional(),
5098
+ selectedDate: z76.string().optional(),
5099
+ agentId: z76.string().optional(),
5100
+ contact: z76.array(z76.string()).optional(),
5101
+ callStatus: z76.array(z76.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
5102
+ queueIds: z76.array(z76.string()).optional(),
5103
+ notes: z76.string().optional()
5043
5104
  });
5044
5105
  var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
5045
- z74.object({
5046
- page: z74.coerce.number().positive().optional(),
5047
- pageSize: z74.coerce.number().positive().optional()
5106
+ z76.object({
5107
+ page: z76.coerce.number().positive().optional(),
5108
+ pageSize: z76.coerce.number().positive().optional()
5048
5109
  })
5049
5110
  );
5050
5111
  var NullEmptyStringUndefined = ["", null, void 0];
5051
5112
  var EmtptyArrayUndefined = [[], void 0];
5052
5113
  var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
5053
- reportType: z74.enum([
5114
+ reportType: z76.enum([
5054
5115
  "extcallstatistics",
5055
5116
  "extcallactivity",
5056
5117
  "trunkactivity",
@@ -5060,52 +5121,52 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
5060
5121
  "queueagentmisscalls",
5061
5122
  "queueagentinoutcalls"
5062
5123
  ]),
5063
- selectedDate: z74.string().optional(),
5064
- communicationType: z74.union([z74.literal("Inbound"), z74.literal("Outbound"), z74.literal("Internal")]).optional(),
5065
- time: z74.string().optional(),
5066
- queueList: z74.array(z74.string()).optional(),
5067
- queueId: z74.string().optional(),
5068
- trunkList: z74.array(z74.string()).optional(),
5069
- extensionList: z74.array(z74.string()).optional()
5124
+ selectedDate: z76.string().optional(),
5125
+ communicationType: z76.union([z76.literal("Inbound"), z76.literal("Outbound"), z76.literal("Internal")]).optional(),
5126
+ time: z76.string().optional(),
5127
+ queueList: z76.array(z76.string()).optional(),
5128
+ queueId: z76.string().optional(),
5129
+ trunkList: z76.array(z76.string()).optional(),
5130
+ extensionList: z76.array(z76.string()).optional()
5070
5131
  }).superRefine((input, ctx) => {
5071
5132
  if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
5072
5133
  ctx.addIssue({
5073
- code: z74.ZodIssueCode.custom,
5134
+ code: z76.ZodIssueCode.custom,
5074
5135
  path: ["selectedDate"],
5075
5136
  message: "selectedDate is required."
5076
5137
  });
5077
5138
  }
5078
5139
  if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
5079
5140
  ctx.addIssue({
5080
- code: z74.ZodIssueCode.custom,
5141
+ code: z76.ZodIssueCode.custom,
5081
5142
  path: ["time"],
5082
5143
  message: "time is required."
5083
5144
  });
5084
5145
  }
5085
5146
  if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
5086
5147
  ctx.addIssue({
5087
- code: z74.ZodIssueCode.custom,
5148
+ code: z76.ZodIssueCode.custom,
5088
5149
  path: ["queueList"],
5089
5150
  message: "queueList is required."
5090
5151
  });
5091
5152
  }
5092
5153
  if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
5093
5154
  ctx.addIssue({
5094
- code: z74.ZodIssueCode.custom,
5155
+ code: z76.ZodIssueCode.custom,
5095
5156
  path: ["queueId"],
5096
5157
  message: "queueId is required."
5097
5158
  });
5098
5159
  }
5099
5160
  if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
5100
5161
  ctx.addIssue({
5101
- code: z74.ZodIssueCode.custom,
5162
+ code: z76.ZodIssueCode.custom,
5102
5163
  path: ["trunkList"],
5103
5164
  message: "trunkList is required."
5104
5165
  });
5105
5166
  }
5106
5167
  if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
5107
5168
  ctx.addIssue({
5108
- code: z74.ZodIssueCode.custom,
5169
+ code: z76.ZodIssueCode.custom,
5109
5170
  path: ["extensionList"],
5110
5171
  message: "extensionList is required."
5111
5172
  });
@@ -5116,161 +5177,161 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
5116
5177
  import { initContract as initContract28 } from "@ts-rest/core";
5117
5178
 
5118
5179
  // src/telephony-cdr/call-report.schema.ts
5119
- import z75 from "zod";
5120
- var ExtCallStatisticsListSchema = z75.object({
5180
+ import z77 from "zod";
5181
+ var ExtCallStatisticsListSchema = z77.object({
5121
5182
  /** @example "ext_num" */
5122
- ext_num: z75.string(),
5183
+ ext_num: z77.string(),
5123
5184
  /** @example "ext_name" */
5124
- ext_name: z75.string(),
5185
+ ext_name: z77.string(),
5125
5186
  /** @example 0 */
5126
- answered_calls: z75.number(),
5187
+ answered_calls: z77.number(),
5127
5188
  /** @example 0 */
5128
- no_answer_calls: z75.number(),
5189
+ no_answer_calls: z77.number(),
5129
5190
  /** @example 0 */
5130
- busy_calls: z75.number(),
5191
+ busy_calls: z77.number(),
5131
5192
  /** @example 0 */
5132
- failed_calls: z75.number(),
5193
+ failed_calls: z77.number(),
5133
5194
  /** @example 0 */
5134
- voicemail_calls: z75.number(),
5195
+ voicemail_calls: z77.number(),
5135
5196
  /** @example 0 */
5136
- total_holding_time: z75.number(),
5197
+ total_holding_time: z77.number(),
5137
5198
  /** @example 0 */
5138
- total_talking_time: z75.number(),
5199
+ total_talking_time: z77.number(),
5139
5200
  /** @example "src_name" */
5140
- src_name: z75.string(),
5201
+ src_name: z77.string(),
5141
5202
  /** @example 0 */
5142
- total_call_count: z75.number(),
5203
+ total_call_count: z77.number(),
5143
5204
  /** @example "mobile" */
5144
- mobile: z75.string()
5145
- });
5146
- var ExtStatisticSchema = z75.object({
5147
- ext_num: z75.string(),
5148
- ext_name: z75.string(),
5149
- answered_calls: z75.number(),
5150
- no_answer_calls: z75.number(),
5151
- busy_calls: z75.number(),
5152
- failed_calls: z75.number(),
5153
- voicemail_calls: z75.number(),
5154
- total_holding_time: z75.number(),
5155
- total_talking_time: z75.number(),
5156
- time: z75.number(),
5157
- mobile: z75.string()
5158
- });
5159
- var ExtCallActivityListSchema = z75.object({
5160
- time: z75.number(),
5161
- answered_calls: z75.number(),
5162
- no_answer_calls: z75.number(),
5163
- busy_calls: z75.number(),
5164
- failed_calls: z75.number(),
5165
- voicemail_calls: z75.number(),
5166
- total_holding_time: z75.number(),
5167
- total_talking_time: z75.number(),
5168
- ext_statistics: z75.array(ExtStatisticSchema)
5169
- });
5170
- var TrunkList = z75.object({
5171
- trunk_name: z75.string(),
5172
- total_calls: z75.number()
5173
- });
5174
- var TrunkActivityListSchema = z75.object({
5175
- time: z75.number(),
5176
- trunk_list: z75.array(TrunkList)
5177
- });
5178
- var QueueAvgWaitTalkTimeListSchema = z75.object({
5179
- time: z75.number(),
5180
- avg_wait_time: z75.number(),
5181
- avg_talk_time: z75.number()
5182
- });
5183
- var SatisfactionListSchema = z75.object({
5184
- press_key: z75.string(),
5185
- total: z75.number(),
5186
- key_point: z75.number().optional()
5187
- });
5188
- var agentListSchema = z75.object({
5189
- agent_name: z75.string(),
5190
- agent_num: z75.string(),
5191
- satisfaction_list: z75.array(SatisfactionListSchema).optional(),
5192
- total_key: z75.number().optional(),
5193
- total_point: z75.number().optional(),
5194
- average_point: z75.number().optional()
5195
- });
5196
- var QueueSatisfactionSchema = z75.object({
5197
- queue_name: z75.string(),
5198
- queue_num: z75.string(),
5199
- satisfaction_list: z75.array(SatisfactionListSchema).optional(),
5200
- agent_list: z75.array(agentListSchema).optional(),
5201
- total_key: z75.number().optional(),
5202
- total_point: z75.number().optional(),
5203
- average_point: z75.number().optional()
5204
- });
5205
- var QueuePerformanceListSchema = z75.object({
5206
- queue: z75.string(),
5207
- total_calls: z75.number(),
5208
- answered_calls: z75.number(),
5209
- missed_calls: z75.number(),
5210
- abandoned_calls: z75.number(),
5211
- average_waiting_time: z75.number(),
5212
- average_talking_time: z75.number(),
5213
- max_waiting_time: z75.number(),
5214
- answered_rate: z75.number(),
5215
- missed_rate: z75.number(),
5216
- abandoned_rate: z75.number(),
5217
- sla: z75.number()
5218
- });
5219
- var QueueAgentMissCallsListSchema = z75.object({
5220
- agent_name: z75.string(),
5221
- agent_num: z75.string(),
5222
- time: z75.string(),
5223
- total_wait_time: z75.number(),
5224
- src_name: z75.string(),
5225
- src_num: z75.string(),
5226
- queue_status: z75.string(),
5227
- polling_attempts: z75.number(),
5228
- missed_reason: z75.string()
5229
- });
5230
- var QueueAgentInOutCallsListSchema = z75.object({
5231
- agent_name: z75.string(),
5232
- agent_num: z75.string(),
5233
- inbound_calls: z75.number(),
5234
- inbound_duration: z75.number(),
5235
- outbound_calls: z75.number(),
5236
- outbound_duration: z75.number(),
5237
- total_calls: z75.number(),
5238
- total_duration: z75.number(),
5239
- average_talk_duration: z75.number()
5240
- });
5241
- var CallReportModel = z75.object({
5242
- errcode: z75.number(),
5243
- errmsg: z75.string(),
5244
- total_number: z75.number(),
5245
- is_12hour: z75.number().optional(),
5246
- ext_call_statistics_list: z75.array(ExtCallStatisticsListSchema).optional(),
5247
- ext_call_activity_list: z75.array(ExtCallActivityListSchema).optional(),
5248
- trunk_activity_list: z75.array(TrunkActivityListSchema).optional(),
5249
- queue_avg_wait_talk_time_list: z75.array(QueueAvgWaitTalkTimeListSchema).optional(),
5205
+ mobile: z77.string()
5206
+ });
5207
+ var ExtStatisticSchema = z77.object({
5208
+ ext_num: z77.string(),
5209
+ ext_name: z77.string(),
5210
+ answered_calls: z77.number(),
5211
+ no_answer_calls: z77.number(),
5212
+ busy_calls: z77.number(),
5213
+ failed_calls: z77.number(),
5214
+ voicemail_calls: z77.number(),
5215
+ total_holding_time: z77.number(),
5216
+ total_talking_time: z77.number(),
5217
+ time: z77.number(),
5218
+ mobile: z77.string()
5219
+ });
5220
+ var ExtCallActivityListSchema = z77.object({
5221
+ time: z77.number(),
5222
+ answered_calls: z77.number(),
5223
+ no_answer_calls: z77.number(),
5224
+ busy_calls: z77.number(),
5225
+ failed_calls: z77.number(),
5226
+ voicemail_calls: z77.number(),
5227
+ total_holding_time: z77.number(),
5228
+ total_talking_time: z77.number(),
5229
+ ext_statistics: z77.array(ExtStatisticSchema)
5230
+ });
5231
+ var TrunkList = z77.object({
5232
+ trunk_name: z77.string(),
5233
+ total_calls: z77.number()
5234
+ });
5235
+ var TrunkActivityListSchema = z77.object({
5236
+ time: z77.number(),
5237
+ trunk_list: z77.array(TrunkList)
5238
+ });
5239
+ var QueueAvgWaitTalkTimeListSchema = z77.object({
5240
+ time: z77.number(),
5241
+ avg_wait_time: z77.number(),
5242
+ avg_talk_time: z77.number()
5243
+ });
5244
+ var SatisfactionListSchema = z77.object({
5245
+ press_key: z77.string(),
5246
+ total: z77.number(),
5247
+ key_point: z77.number().optional()
5248
+ });
5249
+ var agentListSchema = z77.object({
5250
+ agent_name: z77.string(),
5251
+ agent_num: z77.string(),
5252
+ satisfaction_list: z77.array(SatisfactionListSchema).optional(),
5253
+ total_key: z77.number().optional(),
5254
+ total_point: z77.number().optional(),
5255
+ average_point: z77.number().optional()
5256
+ });
5257
+ var QueueSatisfactionSchema = z77.object({
5258
+ queue_name: z77.string(),
5259
+ queue_num: z77.string(),
5260
+ satisfaction_list: z77.array(SatisfactionListSchema).optional(),
5261
+ agent_list: z77.array(agentListSchema).optional(),
5262
+ total_key: z77.number().optional(),
5263
+ total_point: z77.number().optional(),
5264
+ average_point: z77.number().optional()
5265
+ });
5266
+ var QueuePerformanceListSchema = z77.object({
5267
+ queue: z77.string(),
5268
+ total_calls: z77.number(),
5269
+ answered_calls: z77.number(),
5270
+ missed_calls: z77.number(),
5271
+ abandoned_calls: z77.number(),
5272
+ average_waiting_time: z77.number(),
5273
+ average_talking_time: z77.number(),
5274
+ max_waiting_time: z77.number(),
5275
+ answered_rate: z77.number(),
5276
+ missed_rate: z77.number(),
5277
+ abandoned_rate: z77.number(),
5278
+ sla: z77.number()
5279
+ });
5280
+ var QueueAgentMissCallsListSchema = z77.object({
5281
+ agent_name: z77.string(),
5282
+ agent_num: z77.string(),
5283
+ time: z77.string(),
5284
+ total_wait_time: z77.number(),
5285
+ src_name: z77.string(),
5286
+ src_num: z77.string(),
5287
+ queue_status: z77.string(),
5288
+ polling_attempts: z77.number(),
5289
+ missed_reason: z77.string()
5290
+ });
5291
+ var QueueAgentInOutCallsListSchema = z77.object({
5292
+ agent_name: z77.string(),
5293
+ agent_num: z77.string(),
5294
+ inbound_calls: z77.number(),
5295
+ inbound_duration: z77.number(),
5296
+ outbound_calls: z77.number(),
5297
+ outbound_duration: z77.number(),
5298
+ total_calls: z77.number(),
5299
+ total_duration: z77.number(),
5300
+ average_talk_duration: z77.number()
5301
+ });
5302
+ var CallReportModel = z77.object({
5303
+ errcode: z77.number(),
5304
+ errmsg: z77.string(),
5305
+ total_number: z77.number(),
5306
+ is_12hour: z77.number().optional(),
5307
+ ext_call_statistics_list: z77.array(ExtCallStatisticsListSchema).optional(),
5308
+ ext_call_activity_list: z77.array(ExtCallActivityListSchema).optional(),
5309
+ trunk_activity_list: z77.array(TrunkActivityListSchema).optional(),
5310
+ queue_avg_wait_talk_time_list: z77.array(QueueAvgWaitTalkTimeListSchema).optional(),
5250
5311
  queue_satisfaction: QueueSatisfactionSchema.optional(),
5251
- queue_performance_list: z75.array(QueuePerformanceListSchema).optional(),
5252
- queue_agent_miss_calls_list: z75.array(QueueAgentMissCallsListSchema).optional(),
5253
- queue_agent_in_out_calls_list: z75.array(QueueAgentInOutCallsListSchema).optional(),
5254
- callback_result: z75.string(),
5255
- page: z75.number().optional(),
5256
- pageSize: z75.number().optional()
5257
- });
5258
- var CallReportSchema = z75.object({
5259
- errcode: z75.number(),
5260
- errmsg: z75.string(),
5261
- total_number: z75.number(),
5262
- is_12hour: z75.number().optional(),
5263
- ext_call_statistics_list: z75.array(ExtCallStatisticsListSchema).optional(),
5264
- ext_call_activity_list: z75.array(ExtCallActivityListSchema).optional(),
5265
- trunk_activity_list: z75.array(TrunkActivityListSchema).optional(),
5266
- queue_avg_wait_talk_time_list: z75.array(QueueAvgWaitTalkTimeListSchema).optional(),
5312
+ queue_performance_list: z77.array(QueuePerformanceListSchema).optional(),
5313
+ queue_agent_miss_calls_list: z77.array(QueueAgentMissCallsListSchema).optional(),
5314
+ queue_agent_in_out_calls_list: z77.array(QueueAgentInOutCallsListSchema).optional(),
5315
+ callback_result: z77.string(),
5316
+ page: z77.number().optional(),
5317
+ pageSize: z77.number().optional()
5318
+ });
5319
+ var CallReportSchema = z77.object({
5320
+ errcode: z77.number(),
5321
+ errmsg: z77.string(),
5322
+ total_number: z77.number(),
5323
+ is_12hour: z77.number().optional(),
5324
+ ext_call_statistics_list: z77.array(ExtCallStatisticsListSchema).optional(),
5325
+ ext_call_activity_list: z77.array(ExtCallActivityListSchema).optional(),
5326
+ trunk_activity_list: z77.array(TrunkActivityListSchema).optional(),
5327
+ queue_avg_wait_talk_time_list: z77.array(QueueAvgWaitTalkTimeListSchema).optional(),
5267
5328
  queue_satisfaction: QueueSatisfactionSchema.optional(),
5268
- queue_performance_list: z75.array(QueuePerformanceListSchema).optional(),
5269
- queue_agent_miss_calls_list: z75.array(QueueAgentMissCallsListSchema).optional(),
5270
- queue_agent_in_out_calls_list: z75.array(QueueAgentInOutCallsListSchema).optional(),
5271
- callback_result: z75.string(),
5272
- page: z75.number().optional(),
5273
- pageSize: z75.number().optional()
5329
+ queue_performance_list: z77.array(QueuePerformanceListSchema).optional(),
5330
+ queue_agent_miss_calls_list: z77.array(QueueAgentMissCallsListSchema).optional(),
5331
+ queue_agent_in_out_calls_list: z77.array(QueueAgentInOutCallsListSchema).optional(),
5332
+ callback_result: z77.string(),
5333
+ page: z77.number().optional(),
5334
+ pageSize: z77.number().optional()
5274
5335
  });
5275
5336
 
5276
5337
  // src/telephony-cdr/index.ts
@@ -5283,10 +5344,10 @@ var telephonyCdrContract = initContract28().router(
5283
5344
  query: GetAllTelephonyCdrSchema,
5284
5345
  responses: {
5285
5346
  200: DefaultSuccessResponseSchema.extend({
5286
- total: z76.number(),
5287
- page: z76.number(),
5288
- pageSize: z76.number(),
5289
- telephonyCdrs: z76.array(TelephonyCdrSchema)
5347
+ total: z78.number(),
5348
+ page: z78.number(),
5349
+ pageSize: z78.number(),
5350
+ telephonyCdrs: z78.array(TelephonyCdrSchema)
5290
5351
  }),
5291
5352
  401: DefaultUnauthorizedSchema
5292
5353
  },
@@ -5299,10 +5360,10 @@ var telephonyCdrContract = initContract28().router(
5299
5360
  query: GetAllTelephonyCdrSchema,
5300
5361
  responses: {
5301
5362
  200: DefaultSuccessResponseSchema.extend({
5302
- total: z76.number(),
5303
- page: z76.number(),
5304
- pageSize: z76.number(),
5305
- telephonyCdrs: z76.array(TelephonyCdrSchema)
5363
+ total: z78.number(),
5364
+ page: z78.number(),
5365
+ pageSize: z78.number(),
5366
+ telephonyCdrs: z78.array(TelephonyCdrSchema)
5306
5367
  }),
5307
5368
  401: DefaultUnauthorizedSchema
5308
5369
  },
@@ -5315,10 +5376,10 @@ var telephonyCdrContract = initContract28().router(
5315
5376
  query: GetRecentTelephonyCdrSchema,
5316
5377
  responses: {
5317
5378
  200: DefaultSuccessResponseSchema.extend({
5318
- total: z76.number(),
5319
- page: z76.number(),
5320
- pageSize: z76.number(),
5321
- telephonyCdrs: z76.array(TelephonyCdrSchema)
5379
+ total: z78.number(),
5380
+ page: z78.number(),
5381
+ pageSize: z78.number(),
5382
+ telephonyCdrs: z78.array(TelephonyCdrSchema)
5322
5383
  }),
5323
5384
  401: DefaultUnauthorizedSchema
5324
5385
  },
@@ -5410,35 +5471,35 @@ var telephonyCdrContract = initContract28().router(
5410
5471
 
5411
5472
  // src/telephony-extension/index.ts
5412
5473
  import { initContract as initContract29 } from "@ts-rest/core";
5413
- import z78 from "zod";
5474
+ import z80 from "zod";
5414
5475
 
5415
5476
  // src/telephony-extension/schema.ts
5416
- import z77 from "zod";
5417
- var TelephonyExtensionSchema3 = z77.object({
5418
- errcode: z77.coerce.number(),
5419
- errmsg: z77.string(),
5420
- total_number: z77.coerce.number(),
5421
- data: z77.array(
5422
- z77.object({
5423
- id: z77.coerce.number(),
5424
- online_status: z77.object({
5425
- fx_phone: z77.object({ status: z77.coerce.number() }),
5426
- sip_phone: z77.object({
5427
- status: z77.coerce.number(),
5428
- ext_dev_type: z77.string().optional()
5429
- }),
5430
- linkus_desktop: z77.object({ status: z77.coerce.number() }),
5431
- linkus_mobile: z77.object({ status: z77.coerce.number() }),
5432
- linkus_web: z77.object({
5433
- status: z77.coerce.number(),
5434
- ext_dev_type: z77.string().optional()
5477
+ import z79 from "zod";
5478
+ var TelephonyExtensionSchema3 = z79.object({
5479
+ errcode: z79.coerce.number(),
5480
+ errmsg: z79.string(),
5481
+ total_number: z79.coerce.number(),
5482
+ data: z79.array(
5483
+ z79.object({
5484
+ id: z79.coerce.number(),
5485
+ online_status: z79.object({
5486
+ fx_phone: z79.object({ status: z79.coerce.number() }),
5487
+ sip_phone: z79.object({
5488
+ status: z79.coerce.number(),
5489
+ ext_dev_type: z79.string().optional()
5490
+ }),
5491
+ linkus_desktop: z79.object({ status: z79.coerce.number() }),
5492
+ linkus_mobile: z79.object({ status: z79.coerce.number() }),
5493
+ linkus_web: z79.object({
5494
+ status: z79.coerce.number(),
5495
+ ext_dev_type: z79.string().optional()
5435
5496
  })
5436
5497
  }).optional(),
5437
- presence_status: z77.string().optional(),
5438
- number: z77.string().optional(),
5439
- caller_id_name: z77.string().optional(),
5440
- role_name: z77.string().optional(),
5441
- email_addr: z77.string().optional()
5498
+ presence_status: z79.string().optional(),
5499
+ number: z79.string().optional(),
5500
+ caller_id_name: z79.string().optional(),
5501
+ role_name: z79.string().optional(),
5502
+ email_addr: z79.string().optional()
5442
5503
  })
5443
5504
  )
5444
5505
  });
@@ -5453,8 +5514,8 @@ var telephonyExtensionContract = initContract29().router(
5453
5514
  query: null,
5454
5515
  responses: {
5455
5516
  200: TelephonyExtensionSchema3,
5456
- 400: z78.object({
5457
- message: z78.string()
5517
+ 400: z80.object({
5518
+ message: z80.string()
5458
5519
  }),
5459
5520
  401: DefaultUnauthorizedSchema,
5460
5521
  500: DefaultErrorResponseSchema
@@ -5467,10 +5528,10 @@ var telephonyExtensionContract = initContract29().router(
5467
5528
 
5468
5529
  // src/ticket/index.ts
5469
5530
  import { initContract as initContract30 } from "@ts-rest/core";
5470
- import z80 from "zod";
5531
+ import z82 from "zod";
5471
5532
 
5472
5533
  // src/ticket/validation.ts
5473
- import z79 from "zod";
5534
+ import z81 from "zod";
5474
5535
  var addErrorMessage2 = (field) => {
5475
5536
  return field.refine(
5476
5537
  ({ isRequired, value }) => {
@@ -5488,106 +5549,106 @@ var addErrorMessage2 = (field) => {
5488
5549
  }
5489
5550
  );
5490
5551
  };
5491
- var BaseSchema3 = z79.object({
5492
- isRequired: z79.boolean(),
5493
- attributeId: z79.string()
5552
+ var BaseSchema3 = z81.object({
5553
+ isRequired: z81.boolean(),
5554
+ attributeId: z81.string()
5494
5555
  });
5495
5556
  var SingleValue2 = addErrorMessage2(
5496
5557
  BaseSchema3.extend({
5497
- value: z79.string()
5558
+ value: z81.string()
5498
5559
  })
5499
5560
  );
5500
- var CreateTicketValidationSchema = z79.object({
5561
+ var CreateTicketValidationSchema = z81.object({
5501
5562
  title: SingleValue2,
5502
5563
  description: SingleValue2,
5503
5564
  status: SingleValue2,
5504
5565
  type: SingleValue2,
5505
5566
  priority: SingleValue2,
5506
5567
  contact: SingleValue2,
5507
- assignee: z79.object({
5508
- isRequired: z79.boolean(),
5509
- attributeId: z79.string(),
5510
- value: z79.string()
5568
+ assignee: z81.object({
5569
+ isRequired: z81.boolean(),
5570
+ attributeId: z81.string(),
5571
+ value: z81.string()
5511
5572
  }),
5512
5573
  channel: SingleValue2,
5513
- tags: addErrorMessage2(BaseSchema3.extend({ value: z79.array(z79.string()) })),
5514
- categories: BaseSchema3.extend({ value: z79.array(z79.string()) }),
5515
- customFields: z79.array(
5574
+ tags: addErrorMessage2(BaseSchema3.extend({ value: z81.array(z81.string()) })),
5575
+ categories: BaseSchema3.extend({ value: z81.array(z81.string()) }),
5576
+ customFields: z81.array(
5516
5577
  addErrorMessage2(
5517
5578
  BaseSchema3.extend({
5518
- value: z79.union([z79.string(), z79.array(z79.string())]),
5519
- type: z79.string(),
5520
- isDefaultAttribute: z79.boolean()
5579
+ value: z81.union([z81.string(), z81.array(z81.string())]),
5580
+ type: z81.string(),
5581
+ isDefaultAttribute: z81.boolean()
5521
5582
  })
5522
5583
  )
5523
5584
  ),
5524
- reasonToAssign: z79.object({ value: z79.string() }).optional()
5585
+ reasonToAssign: z81.object({ value: z81.string() }).optional()
5525
5586
  });
5526
5587
  var UpdateTicketValidationSchema = CreateTicketValidationSchema;
5527
- var TicketAttachmentRecordSchema = z79.object({
5528
- bucketName: z79.string(),
5529
- fileKey: z79.string(),
5530
- fileName: z79.string(),
5531
- fileSize: z79.coerce.number(),
5532
- url: z79.string()
5533
- });
5534
- var CreateTicketAttachmentRecordsSchema = z79.object({
5535
- ticketId: z79.string(),
5536
- attributeId: z79.string(),
5537
- ticketAttachmentRecords: z79.array(TicketAttachmentRecordSchema)
5538
- });
5539
- var TicketParamsSchema = z79.object({
5540
- page: z79.coerce.number().default(1),
5541
- pageSize: z79.coerce.number().default(10)
5542
- });
5543
- var CustomFieldQuery = z79.object({
5544
- attributeId: z79.string(),
5545
- type: z79.string(),
5546
- value: z79.union([z79.string(), z79.array(z79.string())])
5547
- });
5548
- var GetAllTicketQuerySchema = z79.object({
5549
- page: z79.string().transform((value) => Number(value)),
5550
- pageSize: z79.string().transform((value) => Number(value)),
5551
- selectedDate: z79.string(),
5552
- keyword: z79.string(),
5553
- title: z79.string(),
5554
- description: z79.string(),
5555
- status: z79.array(z79.string()),
5556
- priority: z79.array(z79.string()),
5557
- channel: z79.array(z79.string()),
5558
- type: z79.array(z79.string()),
5559
- ticketType: z79.array(z79.string()),
5560
- contact: z79.array(z79.string()),
5561
- tags: z79.array(z79.string().uuid()),
5562
- categories: z79.array(z79.string().uuid()),
5563
- assignee: z79.array(z79.string().uuid()),
5564
- customFields: z79.array(
5565
- z79.object({
5566
- attributeId: z79.string().uuid(),
5567
- type: z79.string(),
5568
- value: z79.union([z79.string(), z79.array(z79.string())])
5588
+ var TicketAttachmentRecordSchema = z81.object({
5589
+ bucketName: z81.string(),
5590
+ fileKey: z81.string(),
5591
+ fileName: z81.string(),
5592
+ fileSize: z81.coerce.number(),
5593
+ url: z81.string()
5594
+ });
5595
+ var CreateTicketAttachmentRecordsSchema = z81.object({
5596
+ ticketId: z81.string(),
5597
+ attributeId: z81.string(),
5598
+ ticketAttachmentRecords: z81.array(TicketAttachmentRecordSchema)
5599
+ });
5600
+ var TicketParamsSchema = z81.object({
5601
+ page: z81.coerce.number().default(1),
5602
+ pageSize: z81.coerce.number().default(10)
5603
+ });
5604
+ var CustomFieldQuery = z81.object({
5605
+ attributeId: z81.string(),
5606
+ type: z81.string(),
5607
+ value: z81.union([z81.string(), z81.array(z81.string())])
5608
+ });
5609
+ var GetAllTicketQuerySchema = z81.object({
5610
+ page: z81.string().transform((value) => Number(value)),
5611
+ pageSize: z81.string().transform((value) => Number(value)),
5612
+ selectedDate: z81.string(),
5613
+ keyword: z81.string(),
5614
+ title: z81.string(),
5615
+ description: z81.string(),
5616
+ status: z81.array(z81.string()),
5617
+ priority: z81.array(z81.string()),
5618
+ channel: z81.array(z81.string()),
5619
+ type: z81.array(z81.string()),
5620
+ ticketType: z81.array(z81.string()),
5621
+ contact: z81.array(z81.string()),
5622
+ tags: z81.array(z81.string().uuid()),
5623
+ categories: z81.array(z81.string().uuid()),
5624
+ assignee: z81.array(z81.string().uuid()),
5625
+ customFields: z81.array(
5626
+ z81.object({
5627
+ attributeId: z81.string().uuid(),
5628
+ type: z81.string(),
5629
+ value: z81.union([z81.string(), z81.array(z81.string())])
5569
5630
  })
5570
5631
  )
5571
5632
  }).partial();
5572
- var ExportAllTicketQuerySchema = z79.object({
5573
- agent: z79.array(z79.string()),
5574
- selectedDate: z79.string(),
5575
- keyword: z79.string(),
5576
- title: z79.string(),
5577
- description: z79.string(),
5578
- status: z79.array(z79.string()),
5579
- priority: z79.array(z79.string()),
5580
- channel: z79.array(z79.string()),
5581
- type: z79.array(z79.string()),
5582
- ticketType: z79.array(z79.string()),
5583
- contact: z79.array(z79.string()),
5584
- tags: z79.array(z79.string()),
5585
- categories: z79.array(z79.string()),
5586
- customFields: z79.array(
5587
- z79.object({
5588
- attributeId: z79.string().uuid(),
5589
- type: z79.string(),
5590
- value: z79.union([z79.string(), z79.array(z79.string())])
5633
+ var ExportAllTicketQuerySchema = z81.object({
5634
+ agent: z81.array(z81.string()),
5635
+ selectedDate: z81.string(),
5636
+ keyword: z81.string(),
5637
+ title: z81.string(),
5638
+ description: z81.string(),
5639
+ status: z81.array(z81.string()),
5640
+ priority: z81.array(z81.string()),
5641
+ channel: z81.array(z81.string()),
5642
+ type: z81.array(z81.string()),
5643
+ ticketType: z81.array(z81.string()),
5644
+ contact: z81.array(z81.string()),
5645
+ tags: z81.array(z81.string()),
5646
+ categories: z81.array(z81.string()),
5647
+ customFields: z81.array(
5648
+ z81.object({
5649
+ attributeId: z81.string().uuid(),
5650
+ type: z81.string(),
5651
+ value: z81.union([z81.string(), z81.array(z81.string())])
5591
5652
  })
5592
5653
  )
5593
5654
  }).partial();
@@ -5603,14 +5664,14 @@ var ticketContract = initContract30().router(
5603
5664
  201: DefaultSuccessResponseSchema.extend({
5604
5665
  data: TicketSchema
5605
5666
  }),
5606
- 400: z80.object({
5607
- message: z80.string()
5667
+ 400: z82.object({
5668
+ message: z82.string()
5608
5669
  }),
5609
- 409: z80.object({
5610
- message: z80.string()
5670
+ 409: z82.object({
5671
+ message: z82.string()
5611
5672
  }),
5612
- 500: z80.object({
5613
- message: z80.string()
5673
+ 500: z82.object({
5674
+ message: z82.string()
5614
5675
  }),
5615
5676
  401: DefaultUnauthorizedSchema,
5616
5677
  404: DefaultNotFoundSchema,
@@ -5631,8 +5692,8 @@ var ticketContract = initContract30().router(
5631
5692
  TicketSchema
5632
5693
  )
5633
5694
  }),
5634
- 400: z80.object({
5635
- message: z80.string()
5695
+ 400: z82.object({
5696
+ message: z82.string()
5636
5697
  }),
5637
5698
  401: DefaultUnauthorizedSchema,
5638
5699
  500: DefaultErrorResponseSchema
@@ -5642,14 +5703,14 @@ var ticketContract = initContract30().router(
5642
5703
  getTicketById: {
5643
5704
  method: "GET",
5644
5705
  path: "/:id",
5645
- pathParams: z80.object({ id: z80.string() }),
5706
+ pathParams: z82.object({ id: z82.string() }),
5646
5707
  headers: DefaultHeaderSchema,
5647
5708
  responses: {
5648
5709
  200: DefaultSuccessResponseSchema.extend({
5649
5710
  data: TicketSchema
5650
5711
  }),
5651
- 400: z80.object({
5652
- message: z80.string()
5712
+ 400: z82.object({
5713
+ message: z82.string()
5653
5714
  }),
5654
5715
  401: DefaultUnauthorizedSchema,
5655
5716
  500: DefaultErrorResponseSchema
@@ -5659,15 +5720,15 @@ var ticketContract = initContract30().router(
5659
5720
  getTicketByContactId: {
5660
5721
  method: "GET",
5661
5722
  path: "/contact/:id",
5662
- pathParams: z80.object({ id: z80.string() }),
5723
+ pathParams: z82.object({ id: z82.string() }),
5663
5724
  query: TicketParamsSchema,
5664
5725
  headers: DefaultHeaderSchema,
5665
5726
  responses: {
5666
5727
  200: DefaultSuccessResponseSchema.extend({
5667
5728
  data: WithPagination(TicketSchema)
5668
5729
  }),
5669
- 400: z80.object({
5670
- message: z80.string()
5730
+ 400: z82.object({
5731
+ message: z82.string()
5671
5732
  }),
5672
5733
  401: DefaultUnauthorizedSchema,
5673
5734
  500: DefaultErrorResponseSchema
@@ -5677,21 +5738,21 @@ var ticketContract = initContract30().router(
5677
5738
  updateTicket: {
5678
5739
  method: "PATCH",
5679
5740
  path: "/:id",
5680
- pathParams: z80.object({ id: z80.string() }),
5741
+ pathParams: z82.object({ id: z82.string() }),
5681
5742
  body: UpdateTicketValidationSchema,
5682
5743
  headers: DefaultHeaderSchema,
5683
5744
  responses: {
5684
5745
  201: DefaultSuccessResponseSchema.extend({
5685
5746
  data: TicketSchema
5686
5747
  }),
5687
- 400: z80.object({
5688
- message: z80.string()
5748
+ 400: z82.object({
5749
+ message: z82.string()
5689
5750
  }),
5690
- 409: z80.object({
5691
- message: z80.string()
5751
+ 409: z82.object({
5752
+ message: z82.string()
5692
5753
  }),
5693
- 500: z80.object({
5694
- message: z80.string()
5754
+ 500: z82.object({
5755
+ message: z82.string()
5695
5756
  }),
5696
5757
  401: DefaultUnauthorizedSchema,
5697
5758
  404: DefaultNotFoundSchema,
@@ -5702,11 +5763,11 @@ var ticketContract = initContract30().router(
5702
5763
  deleteTicket: {
5703
5764
  method: "DELETE",
5704
5765
  path: "/:id",
5705
- pathParams: z80.object({ id: z80.string() }),
5766
+ pathParams: z82.object({ id: z82.string() }),
5706
5767
  headers: DefaultHeaderSchema,
5707
5768
  body: null,
5708
5769
  responses: {
5709
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5770
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5710
5771
  500: DefaultErrorResponseSchema
5711
5772
  },
5712
5773
  summary: "Delete a extension."
@@ -5714,19 +5775,19 @@ var ticketContract = initContract30().router(
5714
5775
  updateDescription: {
5715
5776
  method: "PATCH",
5716
5777
  path: "/description/update/:id",
5717
- pathParams: z80.object({ id: z80.string() }),
5718
- body: z80.object({ description: z80.string() }),
5778
+ pathParams: z82.object({ id: z82.string() }),
5779
+ body: z82.object({ description: z82.string() }),
5719
5780
  headers: DefaultHeaderSchema,
5720
5781
  responses: {
5721
- 201: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5722
- 400: z80.object({
5723
- message: z80.string()
5782
+ 201: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5783
+ 400: z82.object({
5784
+ message: z82.string()
5724
5785
  }),
5725
- 409: z80.object({
5726
- message: z80.string()
5786
+ 409: z82.object({
5787
+ message: z82.string()
5727
5788
  }),
5728
- 500: z80.object({
5729
- message: z80.string()
5789
+ 500: z82.object({
5790
+ message: z82.string()
5730
5791
  }),
5731
5792
  401: DefaultUnauthorizedSchema,
5732
5793
  404: DefaultNotFoundSchema,
@@ -5737,19 +5798,19 @@ var ticketContract = initContract30().router(
5737
5798
  updateTitle: {
5738
5799
  method: "PATCH",
5739
5800
  path: "/title/update/:id",
5740
- pathParams: z80.object({ id: z80.string() }),
5741
- body: z80.object({ title: z80.string() }),
5801
+ pathParams: z82.object({ id: z82.string() }),
5802
+ body: z82.object({ title: z82.string() }),
5742
5803
  headers: DefaultHeaderSchema,
5743
5804
  responses: {
5744
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5745
- 400: z80.object({
5746
- message: z80.string()
5805
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5806
+ 400: z82.object({
5807
+ message: z82.string()
5747
5808
  }),
5748
- 409: z80.object({
5749
- message: z80.string()
5809
+ 409: z82.object({
5810
+ message: z82.string()
5750
5811
  }),
5751
- 500: z80.object({
5752
- message: z80.string()
5812
+ 500: z82.object({
5813
+ message: z82.string()
5753
5814
  }),
5754
5815
  401: DefaultUnauthorizedSchema,
5755
5816
  404: DefaultNotFoundSchema,
@@ -5760,19 +5821,19 @@ var ticketContract = initContract30().router(
5760
5821
  updateType: {
5761
5822
  method: "PATCH",
5762
5823
  path: "/type/update/:id",
5763
- pathParams: z80.object({ id: z80.string() }),
5764
- body: z80.object({ type: z80.string() }),
5824
+ pathParams: z82.object({ id: z82.string() }),
5825
+ body: z82.object({ type: z82.string() }),
5765
5826
  headers: DefaultHeaderSchema,
5766
5827
  responses: {
5767
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5768
- 400: z80.object({
5769
- message: z80.string()
5828
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5829
+ 400: z82.object({
5830
+ message: z82.string()
5770
5831
  }),
5771
- 409: z80.object({
5772
- message: z80.string()
5832
+ 409: z82.object({
5833
+ message: z82.string()
5773
5834
  }),
5774
- 500: z80.object({
5775
- message: z80.string()
5835
+ 500: z82.object({
5836
+ message: z82.string()
5776
5837
  }),
5777
5838
  401: DefaultUnauthorizedSchema,
5778
5839
  404: DefaultNotFoundSchema,
@@ -5783,19 +5844,19 @@ var ticketContract = initContract30().router(
5783
5844
  updateStatus: {
5784
5845
  method: "PATCH",
5785
5846
  path: "/status/update/:id",
5786
- pathParams: z80.object({ id: z80.string() }),
5787
- body: z80.object({ status: z80.string() }),
5847
+ pathParams: z82.object({ id: z82.string() }),
5848
+ body: z82.object({ status: z82.string() }),
5788
5849
  headers: DefaultHeaderSchema,
5789
5850
  responses: {
5790
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5791
- 400: z80.object({
5792
- message: z80.string()
5851
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5852
+ 400: z82.object({
5853
+ message: z82.string()
5793
5854
  }),
5794
- 409: z80.object({
5795
- message: z80.string()
5855
+ 409: z82.object({
5856
+ message: z82.string()
5796
5857
  }),
5797
- 500: z80.object({
5798
- message: z80.string()
5858
+ 500: z82.object({
5859
+ message: z82.string()
5799
5860
  }),
5800
5861
  401: DefaultUnauthorizedSchema,
5801
5862
  404: DefaultNotFoundSchema,
@@ -5806,19 +5867,19 @@ var ticketContract = initContract30().router(
5806
5867
  updatePriority: {
5807
5868
  method: "PATCH",
5808
5869
  path: "/priority/update/:id",
5809
- pathParams: z80.object({ id: z80.string() }),
5810
- body: z80.object({ priority: z80.string() }),
5870
+ pathParams: z82.object({ id: z82.string() }),
5871
+ body: z82.object({ priority: z82.string() }),
5811
5872
  headers: DefaultHeaderSchema,
5812
5873
  responses: {
5813
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5814
- 400: z80.object({
5815
- message: z80.string()
5874
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5875
+ 400: z82.object({
5876
+ message: z82.string()
5816
5877
  }),
5817
- 409: z80.object({
5818
- message: z80.string()
5878
+ 409: z82.object({
5879
+ message: z82.string()
5819
5880
  }),
5820
- 500: z80.object({
5821
- message: z80.string()
5881
+ 500: z82.object({
5882
+ message: z82.string()
5822
5883
  }),
5823
5884
  401: DefaultUnauthorizedSchema,
5824
5885
  404: DefaultNotFoundSchema,
@@ -5829,19 +5890,19 @@ var ticketContract = initContract30().router(
5829
5890
  updateChannel: {
5830
5891
  method: "PATCH",
5831
5892
  path: "/channel/update/:id",
5832
- pathParams: z80.object({ id: z80.string() }),
5833
- body: z80.object({ channel: z80.string() }),
5893
+ pathParams: z82.object({ id: z82.string() }),
5894
+ body: z82.object({ channel: z82.string() }),
5834
5895
  headers: DefaultHeaderSchema,
5835
5896
  responses: {
5836
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5837
- 400: z80.object({
5838
- message: z80.string()
5897
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5898
+ 400: z82.object({
5899
+ message: z82.string()
5839
5900
  }),
5840
- 409: z80.object({
5841
- message: z80.string()
5901
+ 409: z82.object({
5902
+ message: z82.string()
5842
5903
  }),
5843
- 500: z80.object({
5844
- message: z80.string()
5904
+ 500: z82.object({
5905
+ message: z82.string()
5845
5906
  }),
5846
5907
  401: DefaultUnauthorizedSchema,
5847
5908
  404: DefaultNotFoundSchema,
@@ -5852,19 +5913,19 @@ var ticketContract = initContract30().router(
5852
5913
  updateTags: {
5853
5914
  method: "PATCH",
5854
5915
  path: "/tags/update/:id",
5855
- pathParams: z80.object({ id: z80.string() }),
5856
- body: z80.object({ tags: z80.array(z80.string()) }),
5916
+ pathParams: z82.object({ id: z82.string() }),
5917
+ body: z82.object({ tags: z82.array(z82.string()) }),
5857
5918
  headers: DefaultHeaderSchema,
5858
5919
  responses: {
5859
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5860
- 400: z80.object({
5861
- message: z80.string()
5920
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5921
+ 400: z82.object({
5922
+ message: z82.string()
5862
5923
  }),
5863
- 409: z80.object({
5864
- message: z80.string()
5924
+ 409: z82.object({
5925
+ message: z82.string()
5865
5926
  }),
5866
- 500: z80.object({
5867
- message: z80.string()
5927
+ 500: z82.object({
5928
+ message: z82.string()
5868
5929
  }),
5869
5930
  401: DefaultUnauthorizedSchema,
5870
5931
  404: DefaultNotFoundSchema,
@@ -5875,25 +5936,25 @@ var ticketContract = initContract30().router(
5875
5936
  changeAssignee: {
5876
5937
  method: "PATCH",
5877
5938
  path: "/assignee/update/:id",
5878
- pathParams: z80.object({ id: z80.string() }),
5879
- body: z80.object({
5880
- ticketId: z80.string(),
5881
- assigneeId: z80.string(),
5882
- reason: z80.string().optional()
5939
+ pathParams: z82.object({ id: z82.string() }),
5940
+ body: z82.object({
5941
+ ticketId: z82.string(),
5942
+ assigneeId: z82.string(),
5943
+ reason: z82.string().optional()
5883
5944
  }),
5884
5945
  headers: DefaultHeaderSchema,
5885
5946
  responses: {
5886
5947
  200: DefaultSuccessResponseSchema.extend({
5887
5948
  data: TicketSchema
5888
5949
  }),
5889
- 400: z80.object({
5890
- message: z80.string()
5950
+ 400: z82.object({
5951
+ message: z82.string()
5891
5952
  }),
5892
- 409: z80.object({
5893
- message: z80.string()
5953
+ 409: z82.object({
5954
+ message: z82.string()
5894
5955
  }),
5895
- 500: z80.object({
5896
- message: z80.string()
5956
+ 500: z82.object({
5957
+ message: z82.string()
5897
5958
  }),
5898
5959
  401: DefaultUnauthorizedSchema,
5899
5960
  404: DefaultNotFoundSchema,
@@ -5904,14 +5965,14 @@ var ticketContract = initContract30().router(
5904
5965
  getTicketCountByContact: {
5905
5966
  method: "GET",
5906
5967
  path: "/ticket_count/contact/:id",
5907
- pathParams: z80.object({ id: z80.string() }),
5968
+ pathParams: z82.object({ id: z82.string() }),
5908
5969
  headers: DefaultHeaderSchema,
5909
5970
  responses: {
5910
5971
  200: DefaultSuccessResponseSchema.extend({
5911
5972
  data: TicketCountByContactSchema
5912
5973
  }),
5913
- 400: z80.object({
5914
- message: z80.string()
5974
+ 400: z82.object({
5975
+ message: z82.string()
5915
5976
  }),
5916
5977
  401: DefaultUnauthorizedSchema,
5917
5978
  500: DefaultErrorResponseSchema
@@ -5927,14 +5988,14 @@ var ticketContract = initContract30().router(
5927
5988
  201: DefaultSuccessResponseSchema.extend({
5928
5989
  data: TicketCustomFieldSchema
5929
5990
  }),
5930
- 400: z80.object({
5931
- message: z80.string()
5991
+ 400: z82.object({
5992
+ message: z82.string()
5932
5993
  }),
5933
- 409: z80.object({
5934
- message: z80.string()
5994
+ 409: z82.object({
5995
+ message: z82.string()
5935
5996
  }),
5936
- 500: z80.object({
5937
- message: z80.string()
5997
+ 500: z82.object({
5998
+ message: z82.string()
5938
5999
  }),
5939
6000
  401: DefaultUnauthorizedSchema,
5940
6001
  404: DefaultNotFoundSchema,
@@ -5959,24 +6020,24 @@ var ticketContract = initContract30().router(
5959
6020
 
5960
6021
  // src/user/index.ts
5961
6022
  import { initContract as initContract31 } from "@ts-rest/core";
5962
- import z82 from "zod";
6023
+ import z84 from "zod";
5963
6024
 
5964
6025
  // src/user/validation.ts
5965
- import { z as z81 } from "zod";
5966
- var CreateUserSchema = z81.object({
5967
- name: z81.string(),
5968
- email: z81.string().email(),
5969
- address: z81.string().nullable(),
5970
- phone: z81.string().nullable(),
5971
- password: z81.string(),
5972
- notificationCount: z81.number().nullable().optional(),
5973
- roles: z81.array(z81.string())
6026
+ import { z as z83 } from "zod";
6027
+ var CreateUserSchema = z83.object({
6028
+ name: z83.string(),
6029
+ email: z83.string().email(),
6030
+ address: z83.string().nullable(),
6031
+ phone: z83.string().nullable(),
6032
+ password: z83.string(),
6033
+ notificationCount: z83.number().nullable().optional(),
6034
+ roles: z83.array(z83.string())
5974
6035
  });
5975
6036
  var UpdateUserSchema = CreateUserSchema.extend({
5976
- newPassword: z81.string()
6037
+ newPassword: z83.string()
5977
6038
  });
5978
- var UpdateUserProfileSchema = z81.object({
5979
- password: z81.string()
6039
+ var UpdateUserProfileSchema = z83.object({
6040
+ password: z83.string()
5980
6041
  });
5981
6042
 
5982
6043
  // src/user/index.ts
@@ -5991,8 +6052,8 @@ var userContract = initContract31().router(
5991
6052
  201: DefaultSuccessResponseSchema.extend({
5992
6053
  user: UserSchema
5993
6054
  }),
5994
- 400: z82.object({
5995
- message: z82.string()
6055
+ 400: z84.object({
6056
+ message: z84.string()
5996
6057
  }),
5997
6058
  401: DefaultUnauthorizedSchema,
5998
6059
  404: DefaultNotFoundSchema,
@@ -6005,16 +6066,16 @@ var userContract = initContract31().router(
6005
6066
  method: "GET",
6006
6067
  path: "",
6007
6068
  headers: DefaultHeaderSchema,
6008
- query: z82.object({
6009
- page: z82.coerce.number().optional(),
6010
- pageSize: z82.coerce.number().optional(),
6069
+ query: z84.object({
6070
+ page: z84.coerce.number().optional(),
6071
+ pageSize: z84.coerce.number().optional(),
6011
6072
  // Don't add default 10. In some places, we need to fetch all users.
6012
- keyword: z82.string().optional()
6073
+ keyword: z84.string().optional()
6013
6074
  }).optional(),
6014
6075
  responses: {
6015
6076
  200: WithPagination(UserSchema),
6016
- 400: z82.object({
6017
- message: z82.string()
6077
+ 400: z84.object({
6078
+ message: z84.string()
6018
6079
  }),
6019
6080
  401: DefaultUnauthorizedSchema,
6020
6081
  500: DefaultErrorResponseSchema
@@ -6024,12 +6085,12 @@ var userContract = initContract31().router(
6024
6085
  getUserById: {
6025
6086
  method: "GET",
6026
6087
  path: "/:id",
6027
- pathParams: z82.object({ id: z82.string() }),
6088
+ pathParams: z84.object({ id: z84.string() }),
6028
6089
  headers: DefaultHeaderSchema,
6029
6090
  responses: {
6030
6091
  200: UserSchema,
6031
- 400: z82.object({
6032
- message: z82.string()
6092
+ 400: z84.object({
6093
+ message: z84.string()
6033
6094
  }),
6034
6095
  401: DefaultUnauthorizedSchema
6035
6096
  },
@@ -6038,15 +6099,15 @@ var userContract = initContract31().router(
6038
6099
  updateUser: {
6039
6100
  method: "PATCH",
6040
6101
  path: "/:id",
6041
- pathParams: z82.object({ id: z82.string() }),
6102
+ pathParams: z84.object({ id: z84.string() }),
6042
6103
  headers: DefaultHeaderSchema,
6043
6104
  body: UpdateUserSchema,
6044
6105
  responses: {
6045
6106
  201: DefaultSuccessResponseSchema.extend({
6046
6107
  user: UserSchema
6047
6108
  }),
6048
- 400: z82.object({
6049
- message: z82.string()
6109
+ 400: z84.object({
6110
+ message: z84.string()
6050
6111
  }),
6051
6112
  401: DefaultUnauthorizedSchema,
6052
6113
  404: DefaultNotFoundSchema,
@@ -6058,15 +6119,15 @@ var userContract = initContract31().router(
6058
6119
  updateUserProfile: {
6059
6120
  method: "PATCH",
6060
6121
  path: "/profile/:id",
6061
- pathParams: z82.object({ id: z82.string() }),
6122
+ pathParams: z84.object({ id: z84.string() }),
6062
6123
  headers: DefaultHeaderSchema,
6063
6124
  body: UpdateUserProfileSchema,
6064
6125
  responses: {
6065
6126
  201: DefaultSuccessResponseSchema.extend({
6066
6127
  user: UserSchema
6067
6128
  }),
6068
- 400: z82.object({
6069
- message: z82.string()
6129
+ 400: z84.object({
6130
+ message: z84.string()
6070
6131
  }),
6071
6132
  401: DefaultUnauthorizedSchema,
6072
6133
  404: DefaultNotFoundSchema,
@@ -6078,11 +6139,11 @@ var userContract = initContract31().router(
6078
6139
  deleteUser: {
6079
6140
  method: "DELETE",
6080
6141
  path: "/:id",
6081
- pathParams: z82.object({ id: z82.string() }),
6142
+ pathParams: z84.object({ id: z84.string() }),
6082
6143
  headers: DefaultHeaderSchema,
6083
6144
  body: null,
6084
6145
  responses: {
6085
- 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
6146
+ 200: DefaultSuccessResponseSchema.extend({ message: z84.string() }),
6086
6147
  404: DefaultNotFoundSchema,
6087
6148
  422: DefaultUnprocessibleSchema,
6088
6149
  500: DefaultErrorResponseSchema
@@ -6095,26 +6156,26 @@ var userContract = initContract31().router(
6095
6156
 
6096
6157
  // src/user-presence-status-log/index.ts
6097
6158
  import { initContract as initContract32 } from "@ts-rest/core";
6098
- import z85 from "zod";
6159
+ import z87 from "zod";
6099
6160
 
6100
6161
  // src/user-presence-status-log/schema.ts
6101
- import z83 from "zod";
6162
+ import z85 from "zod";
6102
6163
  var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
6103
6164
  user: UserSchema,
6104
6165
  previousPresenceStatus: PresenceStatusSchema,
6105
6166
  newPresenceStatus: PresenceStatusSchema,
6106
- reason: z83.string()
6167
+ reason: z85.string()
6107
6168
  });
6108
6169
 
6109
6170
  // src/user-presence-status-log/validation.ts
6110
- import z84 from "zod";
6111
- var UserPresenceStatusLogParamsSchema = z84.object({
6112
- page: z84.coerce.number().default(1),
6113
- pageSize: z84.coerce.number().default(10),
6114
- selectedDate: z84.string().optional()
6171
+ import z86 from "zod";
6172
+ var UserPresenceStatusLogParamsSchema = z86.object({
6173
+ page: z86.coerce.number().default(1),
6174
+ pageSize: z86.coerce.number().default(10),
6175
+ selectedDate: z86.string().optional()
6115
6176
  }).optional();
6116
- var UserPresenceStatusLogExportParamsSchema = z84.object({
6117
- selectedDate: z84.string().optional()
6177
+ var UserPresenceStatusLogExportParamsSchema = z86.object({
6178
+ selectedDate: z86.string().optional()
6118
6179
  });
6119
6180
 
6120
6181
  // src/user-presence-status-log/index.ts
@@ -6127,8 +6188,8 @@ var userPresenceStatusLogContract = initContract32().router(
6127
6188
  headers: DefaultHeaderSchema,
6128
6189
  responses: {
6129
6190
  200: WithPagination(UserPresenceStatusLogSchema),
6130
- 400: z85.object({
6131
- message: z85.string()
6191
+ 400: z87.object({
6192
+ message: z87.string()
6132
6193
  }),
6133
6194
  401: DefaultUnauthorizedSchema,
6134
6195
  500: DefaultErrorResponseSchema
@@ -6142,8 +6203,8 @@ var userPresenceStatusLogContract = initContract32().router(
6142
6203
  headers: DefaultHeaderSchema,
6143
6204
  responses: {
6144
6205
  200: null,
6145
- 400: z85.object({
6146
- message: z85.string()
6206
+ 400: z87.object({
6207
+ message: z87.string()
6147
6208
  }),
6148
6209
  401: DefaultUnauthorizedSchema,
6149
6210
  500: DefaultErrorResponseSchema
@@ -6155,44 +6216,44 @@ var userPresenceStatusLogContract = initContract32().router(
6155
6216
 
6156
6217
  // src/widget/index.ts
6157
6218
  import { initContract as initContract33 } from "@ts-rest/core";
6158
- import z88 from "zod";
6219
+ import z90 from "zod";
6159
6220
 
6160
6221
  // src/widget/schema.ts
6161
- import z86 from "zod";
6162
- var FieldsSchema = z86.object({ data: z86.array(z86.string()) });
6163
- var WidgetPositionSchema = z86.union([
6164
- z86.literal("menu"),
6165
- z86.literal("ticket_detail"),
6166
- z86.literal("contact_detail")
6222
+ import z88 from "zod";
6223
+ var FieldsSchema = z88.object({ data: z88.array(z88.string()) });
6224
+ var WidgetPositionSchema = z88.union([
6225
+ z88.literal("menu"),
6226
+ z88.literal("ticket_detail"),
6227
+ z88.literal("contact_detail")
6167
6228
  ]);
6168
6229
  var WidgetSchema = DefaultEntitySchema.extend({
6169
- name: z86.string(),
6170
- description: z86.string().nullable(),
6230
+ name: z88.string(),
6231
+ description: z88.string().nullable(),
6171
6232
  position: WidgetPositionSchema.nullable(),
6172
6233
  fields: FieldsSchema,
6173
- url: z86.string()
6234
+ url: z88.string()
6174
6235
  });
6175
6236
 
6176
6237
  // src/widget/validation.ts
6177
- import z87 from "zod";
6178
- var CreateWidgetSchema = z87.object({
6179
- name: z87.string(),
6180
- description: z87.string(),
6181
- url: z87.string(),
6238
+ import z89 from "zod";
6239
+ var CreateWidgetSchema = z89.object({
6240
+ name: z89.string(),
6241
+ description: z89.string(),
6242
+ url: z89.string(),
6182
6243
  position: WidgetPositionSchema,
6183
- fields: z87.object({
6244
+ fields: z89.object({
6184
6245
  data: (
6185
6246
  // Array of attribute system names
6186
- z87.array(z87.string())
6247
+ z89.array(z89.string())
6187
6248
  )
6188
6249
  }).optional()
6189
6250
  });
6190
6251
  var UpdateWidgetSchema = CreateWidgetSchema;
6191
- var GetWidgetUrlPathQuerySchema = z87.object({
6192
- widgetId: z87.string(),
6252
+ var GetWidgetUrlPathQuerySchema = z89.object({
6253
+ widgetId: z89.string(),
6193
6254
  // Position ID is ticket ID, contact ID, etc.
6194
6255
  // TODO: The name "Position ID" is confusing. Think of a better name.
6195
- positionId: z87.string()
6256
+ positionId: z89.string()
6196
6257
  });
6197
6258
 
6198
6259
  // src/widget/index.ts
@@ -6207,8 +6268,8 @@ var widgetContract = initContract33().router(
6207
6268
  201: DefaultSuccessResponseSchema.extend({
6208
6269
  widget: WidgetSchema
6209
6270
  }),
6210
- 400: z88.object({
6211
- message: z88.string()
6271
+ 400: z90.object({
6272
+ message: z90.string()
6212
6273
  }),
6213
6274
  401: DefaultUnauthorizedSchema,
6214
6275
  500: DefaultErrorResponseSchema
@@ -6218,17 +6279,17 @@ var widgetContract = initContract33().router(
6218
6279
  getWidgets: {
6219
6280
  method: "GET",
6220
6281
  path: "",
6221
- query: z88.object({
6222
- page: z88.coerce.number().default(1),
6223
- pageSize: z88.coerce.number().default(10),
6224
- keyword: z88.coerce.string().optional()
6282
+ query: z90.object({
6283
+ page: z90.coerce.number().default(1),
6284
+ pageSize: z90.coerce.number().default(10),
6285
+ keyword: z90.coerce.string().optional()
6225
6286
  }).optional(),
6226
6287
  headers: DefaultHeaderSchema,
6227
6288
  responses: {
6228
6289
  200: WithPagination(WidgetSchema),
6229
6290
  500: DefaultErrorResponseSchema,
6230
- 400: z88.object({
6231
- message: z88.string()
6291
+ 400: z90.object({
6292
+ message: z90.string()
6232
6293
  }),
6233
6294
  401: DefaultUnauthorizedSchema
6234
6295
  },
@@ -6239,9 +6300,9 @@ var widgetContract = initContract33().router(
6239
6300
  path: "/menu",
6240
6301
  headers: DefaultHeaderSchema,
6241
6302
  responses: {
6242
- 200: z88.array(WidgetSchema),
6243
- 400: z88.object({
6244
- message: z88.string()
6303
+ 200: z90.array(WidgetSchema),
6304
+ 400: z90.object({
6305
+ message: z90.string()
6245
6306
  }),
6246
6307
  401: DefaultUnauthorizedSchema,
6247
6308
  500: DefaultErrorResponseSchema
@@ -6253,9 +6314,9 @@ var widgetContract = initContract33().router(
6253
6314
  path: "/ticket_detail",
6254
6315
  headers: DefaultHeaderSchema,
6255
6316
  responses: {
6256
- 200: z88.array(WidgetSchema),
6257
- 400: z88.object({
6258
- message: z88.string()
6317
+ 200: z90.array(WidgetSchema),
6318
+ 400: z90.object({
6319
+ message: z90.string()
6259
6320
  }),
6260
6321
  401: DefaultUnauthorizedSchema,
6261
6322
  500: DefaultErrorResponseSchema
@@ -6267,9 +6328,9 @@ var widgetContract = initContract33().router(
6267
6328
  path: "/contact_detail",
6268
6329
  headers: DefaultHeaderSchema,
6269
6330
  responses: {
6270
- 200: z88.array(WidgetSchema),
6271
- 400: z88.object({
6272
- message: z88.string()
6331
+ 200: z90.array(WidgetSchema),
6332
+ 400: z90.object({
6333
+ message: z90.string()
6273
6334
  }),
6274
6335
  401: DefaultUnauthorizedSchema,
6275
6336
  500: DefaultErrorResponseSchema
@@ -6279,12 +6340,12 @@ var widgetContract = initContract33().router(
6279
6340
  getWidgetById: {
6280
6341
  method: "GET",
6281
6342
  path: "/:id",
6282
- pathParams: z88.object({ id: z88.string() }),
6343
+ pathParams: z90.object({ id: z90.string() }),
6283
6344
  headers: DefaultHeaderSchema,
6284
6345
  responses: {
6285
6346
  200: WidgetSchema,
6286
- 400: z88.object({
6287
- message: z88.string()
6347
+ 400: z90.object({
6348
+ message: z90.string()
6288
6349
  }),
6289
6350
  401: DefaultUnauthorizedSchema,
6290
6351
  500: DefaultErrorResponseSchema
@@ -6298,10 +6359,10 @@ var widgetContract = initContract33().router(
6298
6359
  headers: DefaultHeaderSchema,
6299
6360
  responses: {
6300
6361
  201: DefaultSuccessResponseSchema.extend({
6301
- url: z88.string()
6362
+ url: z90.string()
6302
6363
  }),
6303
- 400: z88.object({
6304
- message: z88.string()
6364
+ 400: z90.object({
6365
+ message: z90.string()
6305
6366
  }),
6306
6367
  401: DefaultUnauthorizedSchema
6307
6368
  },
@@ -6310,14 +6371,14 @@ var widgetContract = initContract33().router(
6310
6371
  updateWidget: {
6311
6372
  method: "PATCH",
6312
6373
  path: "/:id",
6313
- pathParams: z88.object({ id: z88.string() }),
6374
+ pathParams: z90.object({ id: z90.string() }),
6314
6375
  headers: DefaultHeaderSchema,
6315
6376
  responses: {
6316
6377
  201: DefaultSuccessResponseSchema.extend({
6317
6378
  widget: WidgetSchema
6318
6379
  }),
6319
- 400: z88.object({
6320
- message: z88.string()
6380
+ 400: z90.object({
6381
+ message: z90.string()
6321
6382
  }),
6322
6383
  401: DefaultUnauthorizedSchema
6323
6384
  },
@@ -6327,11 +6388,11 @@ var widgetContract = initContract33().router(
6327
6388
  deleteWidget: {
6328
6389
  method: "DELETE",
6329
6390
  path: "/:id",
6330
- pathParams: z88.object({ id: z88.string() }),
6391
+ pathParams: z90.object({ id: z90.string() }),
6331
6392
  headers: DefaultHeaderSchema,
6332
6393
  body: null,
6333
6394
  responses: {
6334
- 200: DefaultSuccessResponseSchema.extend({ message: z88.string() }),
6395
+ 200: DefaultSuccessResponseSchema.extend({ message: z90.string() }),
6335
6396
  500: DefaultErrorResponseSchema
6336
6397
  },
6337
6398
  summary: "Delete a widget."
@@ -6342,24 +6403,24 @@ var widgetContract = initContract33().router(
6342
6403
 
6343
6404
  // src/wrap-up-form/index.ts
6344
6405
  import { initContract as initContract34 } from "@ts-rest/core";
6345
- import z90 from "zod";
6406
+ import z92 from "zod";
6346
6407
 
6347
6408
  // src/wrap-up-form/validation.ts
6348
- import { z as z89 } from "zod";
6349
- var CreateWrapUpFormSchema = z89.object({
6350
- note: z89.string().nullable().optional(),
6351
- disposition: z89.string().nullable().optional(),
6352
- callFrom: z89.string().nullable().optional(),
6353
- callTo: z89.string().nullable().optional()
6409
+ import { z as z91 } from "zod";
6410
+ var CreateWrapUpFormSchema = z91.object({
6411
+ note: z91.string().nullable().optional(),
6412
+ disposition: z91.string().nullable().optional(),
6413
+ callFrom: z91.string().nullable().optional(),
6414
+ callTo: z91.string().nullable().optional()
6354
6415
  });
6355
6416
  var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
6356
- tags: z89.array(z89.string()).optional()
6417
+ tags: z91.array(z91.string()).optional()
6357
6418
  });
6358
- var CreateCXLogWrapUpFormSchema = z89.object({
6359
- cxLogId: z89.string().uuid(),
6360
- disposition: z89.string().optional(),
6361
- tagIds: z89.array(z89.string().uuid()).optional(),
6362
- note: z89.string().optional()
6419
+ var CreateCXLogWrapUpFormSchema = z91.object({
6420
+ cxLogId: z91.string().uuid(),
6421
+ disposition: z91.string().optional(),
6422
+ tagIds: z91.array(z91.string().uuid()).optional(),
6423
+ note: z91.string().optional()
6363
6424
  });
6364
6425
 
6365
6426
  // src/wrap-up-form/index.ts
@@ -6374,8 +6435,8 @@ var wrapUpFormContract = initContract34().router(
6374
6435
  201: DefaultSuccessResponseSchema.extend({
6375
6436
  wrapUpForm: WrapUpFormSchema
6376
6437
  }),
6377
- 400: z90.object({
6378
- message: z90.string()
6438
+ 400: z92.object({
6439
+ message: z92.string()
6379
6440
  }),
6380
6441
  401: DefaultUnauthorizedSchema,
6381
6442
  500: DefaultErrorResponseSchema
@@ -6397,15 +6458,15 @@ var wrapUpFormContract = initContract34().router(
6397
6458
  getWrapUpForms: {
6398
6459
  method: "GET",
6399
6460
  path: "",
6400
- query: z90.object({
6401
- page: z90.coerce.number().default(1),
6402
- pageSize: z90.coerce.number().default(10)
6461
+ query: z92.object({
6462
+ page: z92.coerce.number().default(1),
6463
+ pageSize: z92.coerce.number().default(10)
6403
6464
  }).optional(),
6404
6465
  headers: DefaultHeaderSchema,
6405
6466
  responses: {
6406
6467
  200: WithPagination(WrapUpFormSchema),
6407
- 400: z90.object({
6408
- message: z90.string()
6468
+ 400: z92.object({
6469
+ message: z92.string()
6409
6470
  }),
6410
6471
  401: DefaultUnauthorizedSchema,
6411
6472
  500: DefaultErrorResponseSchema
@@ -6415,15 +6476,15 @@ var wrapUpFormContract = initContract34().router(
6415
6476
  updateWrapUpForm: {
6416
6477
  method: "PATCH",
6417
6478
  path: "/:id",
6418
- pathParams: z90.object({ id: z90.string() }),
6479
+ pathParams: z92.object({ id: z92.string() }),
6419
6480
  headers: DefaultHeaderSchema,
6420
6481
  body: UpdateWrapUpFormSchema,
6421
6482
  responses: {
6422
6483
  201: DefaultSuccessResponseSchema.extend({
6423
6484
  wrapUpForm: WrapUpFormSchema
6424
6485
  }),
6425
- 400: z90.object({
6426
- message: z90.string()
6486
+ 400: z92.object({
6487
+ message: z92.string()
6427
6488
  }),
6428
6489
  401: DefaultUnauthorizedSchema,
6429
6490
  500: DefaultErrorResponseSchema
@@ -6436,28 +6497,28 @@ var wrapUpFormContract = initContract34().router(
6436
6497
 
6437
6498
  // src/upload/index.ts
6438
6499
  import { initContract as initContract35 } from "@ts-rest/core";
6439
- import z91 from "zod";
6500
+ import z93 from "zod";
6440
6501
  var uploadContract = initContract35().router(
6441
6502
  {
6442
6503
  rename: {
6443
6504
  method: "POST",
6444
6505
  path: "/:id/rename",
6445
- pathParams: z91.object({
6446
- id: z91.string()
6506
+ pathParams: z93.object({
6507
+ id: z93.string()
6447
6508
  }),
6448
6509
  headers: DefaultHeaderSchema,
6449
6510
  responses: {
6450
6511
  201: DefaultSuccessResponseSchema.extend({
6451
- message: z91.string()
6512
+ message: z93.string()
6452
6513
  }),
6453
- 400: z91.object({
6454
- message: z91.string()
6514
+ 400: z93.object({
6515
+ message: z93.string()
6455
6516
  }),
6456
- 409: z91.object({
6457
- message: z91.string()
6517
+ 409: z93.object({
6518
+ message: z93.string()
6458
6519
  }),
6459
- 500: z91.object({
6460
- message: z91.string()
6520
+ 500: z93.object({
6521
+ message: z93.string()
6461
6522
  }),
6462
6523
  401: DefaultUnauthorizedSchema,
6463
6524
  404: DefaultNotFoundSchema,
@@ -6469,23 +6530,23 @@ var uploadContract = initContract35().router(
6469
6530
  delete: {
6470
6531
  method: "DELETE",
6471
6532
  path: "/:id",
6472
- pathParams: z91.object({
6473
- id: z91.string()
6533
+ pathParams: z93.object({
6534
+ id: z93.string()
6474
6535
  }),
6475
6536
  headers: DefaultHeaderSchema,
6476
6537
  body: null,
6477
6538
  responses: {
6478
6539
  201: DefaultSuccessResponseSchema.extend({
6479
- message: z91.string()
6540
+ message: z93.string()
6480
6541
  }),
6481
- 400: z91.object({
6482
- message: z91.string()
6542
+ 400: z93.object({
6543
+ message: z93.string()
6483
6544
  }),
6484
- 409: z91.object({
6485
- message: z91.string()
6545
+ 409: z93.object({
6546
+ message: z93.string()
6486
6547
  }),
6487
- 500: z91.object({
6488
- message: z91.string()
6548
+ 500: z93.object({
6549
+ message: z93.string()
6489
6550
  }),
6490
6551
  401: DefaultUnauthorizedSchema,
6491
6552
  404: DefaultNotFoundSchema,
@@ -6500,19 +6561,19 @@ var uploadContract = initContract35().router(
6500
6561
  );
6501
6562
 
6502
6563
  // src/viber/index.ts
6503
- import z93 from "zod";
6564
+ import z95 from "zod";
6504
6565
 
6505
6566
  // src/viber/validation.ts
6506
- import z92 from "zod";
6507
- var ViberChannelSchema = z92.object({
6508
- name: z92.string(),
6509
- accessToken: z92.string(),
6510
- actor: z92.object({
6511
- id: z92.string().uuid(),
6512
- name: z92.string(),
6513
- email: z92.string().email(),
6514
- address: z92.string().nullable(),
6515
- phone: z92.string().nullable()
6567
+ import z94 from "zod";
6568
+ var ViberChannelSchema = z94.object({
6569
+ name: z94.string(),
6570
+ accessToken: z94.string(),
6571
+ actor: z94.object({
6572
+ id: z94.string().uuid(),
6573
+ name: z94.string(),
6574
+ email: z94.string().email(),
6575
+ address: z94.string().nullable(),
6576
+ phone: z94.string().nullable()
6516
6577
  }).optional()
6517
6578
  });
6518
6579
 
@@ -6541,8 +6602,8 @@ var viberContract = initContract36().router({
6541
6602
  }),
6542
6603
  400: DefaultErrorResponseSchema
6543
6604
  },
6544
- body: z93.object({
6545
- id: z93.string().uuid()
6605
+ body: z95.object({
6606
+ id: z95.string().uuid()
6546
6607
  }),
6547
6608
  summary: "Connect viber channel"
6548
6609
  },
@@ -6558,8 +6619,8 @@ var viberContract = initContract36().router({
6558
6619
  reconnect: {
6559
6620
  method: "POST",
6560
6621
  path: "/reconnect/:channelId",
6561
- pathParams: z93.object({
6562
- channelId: z93.string().uuid()
6622
+ pathParams: z95.object({
6623
+ channelId: z95.string().uuid()
6563
6624
  }),
6564
6625
  responses: {
6565
6626
  200: DefaultSuccessResponseSchema.extend({
@@ -6574,8 +6635,8 @@ var viberContract = initContract36().router({
6574
6635
  delete: {
6575
6636
  method: "DELETE",
6576
6637
  path: "/delete/:channelId",
6577
- pathParams: z93.object({
6578
- channelId: z93.string().uuid()
6638
+ pathParams: z95.object({
6639
+ channelId: z95.string().uuid()
6579
6640
  }),
6580
6641
  body: null,
6581
6642
  responses: {
@@ -6588,58 +6649,58 @@ var viberContract = initContract36().router({
6588
6649
 
6589
6650
  // src/notification/index.ts
6590
6651
  import { initContract as initContract37 } from "@ts-rest/core";
6591
- import z96 from "zod";
6652
+ import z98 from "zod";
6592
6653
 
6593
6654
  // src/notification/validation.ts
6594
- import z95 from "zod";
6655
+ import z97 from "zod";
6595
6656
 
6596
6657
  // src/notification/schema.ts
6597
- import z94 from "zod";
6598
- var NotificationChangeSchema = z94.object({
6599
- id: z94.string().uuid(),
6600
- createdAt: z94.date(),
6601
- updatedAt: z94.date(),
6602
- deletedAt: z94.date().nullable(),
6603
- actorId: z94.string().uuid(),
6658
+ import z96 from "zod";
6659
+ var NotificationChangeSchema = z96.object({
6660
+ id: z96.string().uuid(),
6661
+ createdAt: z96.date(),
6662
+ updatedAt: z96.date(),
6663
+ deletedAt: z96.date().nullable(),
6664
+ actorId: z96.string().uuid(),
6604
6665
  actor: UserSchema,
6605
- notificationObjectId: z94.string().uuid(),
6606
- readAt: z94.date()
6607
- });
6608
- var NotificationObjectSchema = z94.object({
6609
- id: z94.string().uuid(),
6610
- createdAt: z94.date(),
6611
- updatedAt: z94.date(),
6612
- deletedAt: z94.date().nullable(),
6613
- data: z94.string(),
6666
+ notificationObjectId: z96.string().uuid(),
6667
+ readAt: z96.date()
6668
+ });
6669
+ var NotificationObjectSchema = z96.object({
6670
+ id: z96.string().uuid(),
6671
+ createdAt: z96.date(),
6672
+ updatedAt: z96.date(),
6673
+ deletedAt: z96.date().nullable(),
6674
+ data: z96.string(),
6614
6675
  notificationChange: NotificationChangeSchema
6615
6676
  });
6616
- var NotificationSchema = z94.object({
6617
- id: z94.string().uuid(),
6618
- createdAt: z94.date(),
6619
- updatedAt: z94.date(),
6620
- deletedAt: z94.date().nullable(),
6621
- notificationObjectId: z94.string().uuid(),
6622
- notifierId: z94.string().uuid(),
6677
+ var NotificationSchema = z96.object({
6678
+ id: z96.string().uuid(),
6679
+ createdAt: z96.date(),
6680
+ updatedAt: z96.date(),
6681
+ deletedAt: z96.date().nullable(),
6682
+ notificationObjectId: z96.string().uuid(),
6683
+ notifierId: z96.string().uuid(),
6623
6684
  notificationObject: NotificationObjectSchema,
6624
- readAt: z94.date()
6685
+ readAt: z96.date()
6625
6686
  });
6626
6687
 
6627
6688
  // src/notification/validation.ts
6628
- var GetNotificationsRequestSchema = z95.object({
6629
- page: z95.coerce.number().default(1),
6630
- pageSize: z95.coerce.number().default(10)
6689
+ var GetNotificationsRequestSchema = z97.object({
6690
+ page: z97.coerce.number().default(1),
6691
+ pageSize: z97.coerce.number().default(10)
6631
6692
  });
6632
- var GetNotificationsResponseSchema = z95.object({
6633
- notificationCount: z95.number(),
6634
- notifications: z95.array(NotificationSchema),
6635
- total: z95.number(),
6636
- page: z95.number(),
6637
- pageSize: z95.number(),
6638
- lastPage: z95.number(),
6639
- totalUnreadCount: z95.number().optional()
6693
+ var GetNotificationsResponseSchema = z97.object({
6694
+ notificationCount: z97.number(),
6695
+ notifications: z97.array(NotificationSchema),
6696
+ total: z97.number(),
6697
+ page: z97.number(),
6698
+ pageSize: z97.number(),
6699
+ lastPage: z97.number(),
6700
+ totalUnreadCount: z97.number().optional()
6640
6701
  });
6641
- var ResetNotificationRequestSchema = z95.object({
6642
- userId: z95.string()
6702
+ var ResetNotificationRequestSchema = z97.object({
6703
+ userId: z97.string()
6643
6704
  });
6644
6705
 
6645
6706
  // src/notification/index.ts
@@ -6653,14 +6714,14 @@ var userNotificationContract = initContract37().router(
6653
6714
  200: DefaultSuccessResponseSchema.extend({
6654
6715
  data: GetNotificationsResponseSchema
6655
6716
  }),
6656
- 400: z96.object({
6657
- message: z96.string()
6717
+ 400: z98.object({
6718
+ message: z98.string()
6658
6719
  }),
6659
- 409: z96.object({
6660
- message: z96.string()
6720
+ 409: z98.object({
6721
+ message: z98.string()
6661
6722
  }),
6662
- 500: z96.object({
6663
- message: z96.string()
6723
+ 500: z98.object({
6724
+ message: z98.string()
6664
6725
  }),
6665
6726
  401: DefaultUnauthorizedSchema,
6666
6727
  404: DefaultNotFoundSchema,
@@ -6673,16 +6734,16 @@ var userNotificationContract = initContract37().router(
6673
6734
  path: "/new_notifications_count",
6674
6735
  responses: {
6675
6736
  200: DefaultSuccessResponseSchema.extend({
6676
- total: z96.number()
6737
+ total: z98.number()
6677
6738
  }),
6678
- 400: z96.object({
6679
- message: z96.string()
6739
+ 400: z98.object({
6740
+ message: z98.string()
6680
6741
  }),
6681
- 409: z96.object({
6682
- message: z96.string()
6742
+ 409: z98.object({
6743
+ message: z98.string()
6683
6744
  }),
6684
- 500: z96.object({
6685
- message: z96.string()
6745
+ 500: z98.object({
6746
+ message: z98.string()
6686
6747
  }),
6687
6748
  401: DefaultUnauthorizedSchema,
6688
6749
  404: DefaultNotFoundSchema,
@@ -6697,14 +6758,14 @@ var userNotificationContract = initContract37().router(
6697
6758
  201: DefaultSuccessResponseSchema.extend({
6698
6759
  data: UserSchema
6699
6760
  }),
6700
- 400: z96.object({
6701
- message: z96.string()
6761
+ 400: z98.object({
6762
+ message: z98.string()
6702
6763
  }),
6703
- 409: z96.object({
6704
- message: z96.string()
6764
+ 409: z98.object({
6765
+ message: z98.string()
6705
6766
  }),
6706
- 500: z96.object({
6707
- message: z96.string()
6767
+ 500: z98.object({
6768
+ message: z98.string()
6708
6769
  }),
6709
6770
  401: DefaultUnauthorizedSchema,
6710
6771
  404: DefaultNotFoundSchema,
@@ -6716,19 +6777,19 @@ var userNotificationContract = initContract37().router(
6716
6777
  readNotification: {
6717
6778
  method: "POST",
6718
6779
  path: "/read/:id",
6719
- pathParams: z96.object({ id: z96.string() }),
6780
+ pathParams: z98.object({ id: z98.string() }),
6720
6781
  responses: {
6721
6782
  201: DefaultSuccessResponseSchema.extend({
6722
6783
  data: NotificationSchema
6723
6784
  }),
6724
- 400: z96.object({
6725
- message: z96.string()
6785
+ 400: z98.object({
6786
+ message: z98.string()
6726
6787
  }),
6727
- 409: z96.object({
6728
- message: z96.string()
6788
+ 409: z98.object({
6789
+ message: z98.string()
6729
6790
  }),
6730
- 500: z96.object({
6731
- message: z96.string()
6791
+ 500: z98.object({
6792
+ message: z98.string()
6732
6793
  }),
6733
6794
  401: DefaultUnauthorizedSchema,
6734
6795
  404: DefaultNotFoundSchema,
@@ -6810,6 +6871,7 @@ export {
6810
6871
  dashboardContract,
6811
6872
  evaluateFormContract,
6812
6873
  extensionContract2 as extensionContract,
6874
+ mailContract,
6813
6875
  mainChatContract,
6814
6876
  notificationContract,
6815
6877
  permissionContract,