@kl1/contracts 1.1.4 → 1.1.5

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 (55) hide show
  1. package/dist/index.js +933 -886
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +932 -886
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/src/app/index.d.ts +17 -0
  6. package/dist/src/app/index.d.ts.map +1 -0
  7. package/dist/src/chat/index.d.ts +2985 -2123
  8. package/dist/src/chat/index.d.ts.map +1 -1
  9. package/dist/src/chat/schema.d.ts +24 -8
  10. package/dist/src/chat/schema.d.ts.map +1 -1
  11. package/dist/src/chat/validation.d.ts +76 -7
  12. package/dist/src/chat/validation.d.ts.map +1 -1
  13. package/dist/src/chatwoot/index.d.ts +7527 -0
  14. package/dist/src/chatwoot/index.d.ts.map +1 -0
  15. package/dist/src/chatwoot/schema.d.ts +79 -0
  16. package/dist/src/chatwoot/schema.d.ts.map +1 -0
  17. package/dist/src/chatwoot/validation.d.ts +53 -0
  18. package/dist/src/chatwoot/validation.d.ts.map +1 -0
  19. package/dist/src/contract.d.ts +5238 -3489
  20. package/dist/src/contract.d.ts.map +1 -1
  21. package/dist/src/index.d.ts +1 -0
  22. package/dist/src/index.d.ts.map +1 -1
  23. package/dist/src/instagram/index.d.ts +73 -7
  24. package/dist/src/instagram/index.d.ts.map +1 -1
  25. package/dist/src/line/index.d.ts +73 -7
  26. package/dist/src/line/index.d.ts.map +1 -1
  27. package/dist/src/mail/account-contract.d.ts +289 -136
  28. package/dist/src/mail/account-contract.d.ts.map +1 -1
  29. package/dist/src/mail/index.d.ts +10 -0
  30. package/dist/src/mail/index.d.ts.map +1 -1
  31. package/dist/src/mail/mail-contract.d.ts +1775 -1162
  32. package/dist/src/mail/mail-contract.d.ts.map +1 -1
  33. package/dist/src/mail/mail-server-contract.d.ts +477 -18
  34. package/dist/src/mail/mail-server-contract.d.ts.map +1 -1
  35. package/dist/src/mail/mail-server.d.ts +216 -0
  36. package/dist/src/mail/mail-server.d.ts.map +1 -0
  37. package/dist/src/mail/message-contract.d.ts +54 -54
  38. package/dist/src/mail/room-contract.d.ts +957 -954
  39. package/dist/src/mail/room-contract.d.ts.map +1 -1
  40. package/dist/src/mail/schemas/account-validation.schema.d.ts +140 -140
  41. package/dist/src/mail/schemas/account-validation.schema.d.ts.map +1 -1
  42. package/dist/src/mail/schemas/account.schema.d.ts +32 -32
  43. package/dist/src/mail/schemas/message.schema.d.ts +42 -42
  44. package/dist/src/mail/schemas/message.schema.d.ts.map +1 -1
  45. package/dist/src/mail/schemas/room-validation.schema.d.ts +325 -322
  46. package/dist/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
  47. package/dist/src/mail/schemas/room.schema.d.ts +683 -259
  48. package/dist/src/mail/schemas/room.schema.d.ts.map +1 -1
  49. package/dist/src/messenger/index.d.ts +83 -7
  50. package/dist/src/messenger/index.d.ts.map +1 -1
  51. package/dist/src/platform-contact/schema.d.ts +30 -0
  52. package/dist/src/platform-contact/schema.d.ts.map +1 -0
  53. package/dist/src/viber/index.d.ts +73 -7
  54. package/dist/src/viber/index.d.ts.map +1 -1
  55. 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,54 @@ 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
+ level1: z59.union([
4183
+ z59.literal("open"),
4184
+ z59.literal("close"),
4185
+ z59.literal("inbox"),
4186
+ z59.literal("sent"),
4187
+ z59.literal("scheduled"),
4188
+ z59.literal("starred")
4189
+ ]).optional(),
4190
+ level2: z59.union([
4191
+ z59.literal("all"),
4192
+ z59.literal("unassign"),
4193
+ z59.literal("mine"),
4194
+ z59.literal("other")
4195
+ ]).optional()
4196
+ }),
4197
+ output: z59.object({
4198
+ data: z59.array(MailRoomSchema),
4199
+ total: z59.number(),
4200
+ page: z59.number(),
4201
+ pageSize: z59.number()
4202
+ })
4203
+ },
4204
+ update: {
4205
+ input: z59.object({
4206
+ resolved: z59.boolean().or(
4207
+ z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
4208
+ ).optional().nullable(),
4209
+ assigneeId: z59.string().uuid().optional().nullable(),
4210
+ note: z59.string().optional(),
4211
+ tags: z59.array(z59.string().uuid()).optional(),
4212
+ handover: z59.boolean().or(
4213
+ z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
4214
+ ).optional().nullable(),
4215
+ selfAssign: z59.boolean().or(
4216
+ z59.union([z59.literal("true"), z59.literal("false")]).transform((value) => value.toLowerCase() === "true")
4217
+ ).optional().nullable()
4218
+ })
4219
+ }
4220
+ };
4221
+
4188
4222
  // src/mail/room-contract.ts
4189
4223
  var roomContract = initContract18().router(
4190
4224
  {
@@ -4193,7 +4227,7 @@ var roomContract = initContract18().router(
4193
4227
  path: "/",
4194
4228
  responses: {
4195
4229
  200: DefaultSuccessResponseSchema.extend({
4196
- message: z59.string()
4230
+ message: z60.string()
4197
4231
  }),
4198
4232
  ...DefaultResponses
4199
4233
  },
@@ -4203,19 +4237,13 @@ var roomContract = initContract18().router(
4203
4237
  getAll: {
4204
4238
  method: "GET",
4205
4239
  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
- }),
4240
+ query: RoomContractsValidationSchema.getAll.input,
4213
4241
  responses: {
4214
4242
  200: DefaultSuccessResponseSchema.extend({
4215
- data: z59.array(MailRoomSchema),
4216
- total: z59.number(),
4217
- page: z59.number(),
4218
- pageSize: z59.number()
4243
+ data: z60.array(MailRoomSchema),
4244
+ total: z60.number(),
4245
+ page: z60.number(),
4246
+ pageSize: z60.number()
4219
4247
  }),
4220
4248
  ...DefaultResponses
4221
4249
  },
@@ -4224,8 +4252,8 @@ var roomContract = initContract18().router(
4224
4252
  getById: {
4225
4253
  method: "GET",
4226
4254
  path: "/:id",
4227
- pathParams: z59.object({
4228
- id: z59.string().uuid()
4255
+ pathParams: z60.object({
4256
+ id: z60.string().uuid()
4229
4257
  }),
4230
4258
  responses: {
4231
4259
  200: DefaultSuccessResponseSchema.extend({
@@ -4238,12 +4266,12 @@ var roomContract = initContract18().router(
4238
4266
  getAttachments: {
4239
4267
  method: "GET",
4240
4268
  path: "/:id/attachments",
4241
- pathParams: z59.object({
4242
- id: z59.string().uuid()
4269
+ pathParams: z60.object({
4270
+ id: z60.string().uuid()
4243
4271
  }),
4244
4272
  responses: {
4245
4273
  200: DefaultSuccessResponseSchema.extend({
4246
- data: z59.array(AttachmentSchema2)
4274
+ data: z60.array(AttachmentSchema2)
4247
4275
  }),
4248
4276
  ...DefaultResponses
4249
4277
  },
@@ -4252,12 +4280,12 @@ var roomContract = initContract18().router(
4252
4280
  getParticipants: {
4253
4281
  method: "GET",
4254
4282
  path: "/:id/participants",
4255
- pathParams: z59.object({
4256
- id: z59.string().uuid()
4283
+ pathParams: z60.object({
4284
+ id: z60.string().uuid()
4257
4285
  }),
4258
4286
  responses: {
4259
4287
  200: DefaultSuccessResponseSchema.extend({
4260
- data: z59.array(MailUserSchema)
4288
+ data: z60.array(MailUserSchema)
4261
4289
  }),
4262
4290
  ...DefaultResponses
4263
4291
  },
@@ -4266,8 +4294,8 @@ var roomContract = initContract18().router(
4266
4294
  update: {
4267
4295
  method: "PATCH",
4268
4296
  path: "/:id",
4269
- pathParams: z59.object({
4270
- id: z59.string()
4297
+ pathParams: z60.object({
4298
+ id: z60.string()
4271
4299
  }),
4272
4300
  responses: {
4273
4301
  200: DefaultSuccessResponseSchema.extend({
@@ -4275,28 +4303,18 @@ var roomContract = initContract18().router(
4275
4303
  }),
4276
4304
  ...DefaultResponses
4277
4305
  },
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
- }),
4306
+ body: RoomContractsValidationSchema.update.input,
4289
4307
  summary: "Update a mail room by id"
4290
4308
  },
4291
4309
  markAsRead: {
4292
4310
  method: "GET",
4293
4311
  path: "/:id",
4294
- pathParams: z59.object({
4295
- id: z59.string().uuid()
4312
+ pathParams: z60.object({
4313
+ id: z60.string().uuid()
4296
4314
  }),
4297
4315
  responses: {
4298
4316
  200: DefaultSuccessResponseSchema.extend({
4299
- message: z59.string()
4317
+ message: z60.string()
4300
4318
  }),
4301
4319
  ...DefaultResponses
4302
4320
  },
@@ -4310,47 +4328,47 @@ var roomContract = initContract18().router(
4310
4328
 
4311
4329
  // src/mail/account-contract.ts
4312
4330
  import { initContract as initContract19 } from "@ts-rest/core";
4313
- import z61 from "zod";
4331
+ import z62 from "zod";
4314
4332
 
4315
4333
  // src/mail/schemas/account-validation.schema.ts
4316
- import z60 from "zod";
4334
+ import z61 from "zod";
4317
4335
  var AccountContractsValidationSchemas = {
4318
4336
  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")
4337
+ input: z61.object({
4338
+ address: z61.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
4339
+ name: z61.string().min(1, "Account name cannot be empty."),
4340
+ password: z61.string().min(1, "Password cannot be empty."),
4341
+ mailServerId: z61.string().uuid("Invalid mail_server_id")
4324
4342
  })
4325
4343
  },
4326
4344
  getById: {
4327
- input: z60.object({
4328
- id: z60.string().uuid()
4345
+ input: z61.object({
4346
+ id: z61.string().uuid()
4329
4347
  }),
4330
4348
  output: MailAccountSchema
4331
4349
  },
4332
4350
  getAll: {
4333
- output: z60.array(MailAccountSchema)
4351
+ output: z61.array(MailAccountSchema)
4334
4352
  },
4335
4353
  update: {
4336
4354
  input: MailAccountSchema,
4337
4355
  output: MailAccountSchema
4338
4356
  },
4339
4357
  disconnect: {
4340
- input: z60.object({
4341
- id: z60.string().uuid()
4358
+ input: z61.object({
4359
+ id: z61.string().uuid()
4342
4360
  }),
4343
4361
  output: MailAccountSchema
4344
4362
  },
4345
4363
  reconnect: {
4346
- input: z60.object({
4347
- id: z60.string()
4364
+ input: z61.object({
4365
+ id: z61.string()
4348
4366
  }),
4349
4367
  output: MailAccountSchema
4350
4368
  },
4351
4369
  delete: {
4352
- input: z60.object({
4353
- id: z60.string()
4370
+ input: z61.object({
4371
+ id: z61.string()
4354
4372
  }),
4355
4373
  output: MailAccountSchema
4356
4374
  }
@@ -4366,16 +4384,16 @@ var accountContract = initContract19().router(
4366
4384
  responses: {
4367
4385
  201: DefaultSuccessResponseSchema.extend({
4368
4386
  // data: AccountContractsValidationSchemas.create.output,
4369
- message: z61.string()
4387
+ message: z62.string()
4370
4388
  }),
4371
- 400: z61.object({
4372
- message: z61.string()
4389
+ 400: z62.object({
4390
+ message: z62.string()
4373
4391
  }),
4374
- 409: z61.object({
4375
- message: z61.string()
4392
+ 409: z62.object({
4393
+ message: z62.string()
4376
4394
  }),
4377
- 500: z61.object({
4378
- message: z61.string()
4395
+ 500: z62.object({
4396
+ message: z62.string()
4379
4397
  }),
4380
4398
  ...DefaultResponses
4381
4399
  },
@@ -4404,20 +4422,19 @@ var accountContract = initContract19().router(
4404
4422
  path: "",
4405
4423
  responses: {
4406
4424
  200: DefaultSuccessResponseSchema.extend({
4407
- data: z61.any()
4408
- // data: AccountContractsValidationSchemas.getAll.output,
4425
+ data: z62.array(MailAccountSchema)
4409
4426
  }),
4410
4427
  ...DefaultResponses
4411
4428
  },
4412
- summary: "Get al accounts"
4429
+ summary: "Get all accounts"
4413
4430
  },
4414
4431
  //#endregion get all accounts
4415
4432
  //#region ........update account
4416
4433
  update: {
4417
4434
  method: "PATCH",
4418
4435
  path: "/:id",
4419
- pathParams: z61.object({
4420
- id: z61.string().uuid()
4436
+ pathParams: z62.object({
4437
+ id: z62.string().uuid()
4421
4438
  }),
4422
4439
  responses: {
4423
4440
  201: DefaultSuccessResponseSchema.extend({
@@ -4466,7 +4483,7 @@ var accountContract = initContract19().router(
4466
4483
  pathParams: AccountContractsValidationSchemas.delete.input,
4467
4484
  responses: {
4468
4485
  200: DefaultSuccessResponseSchema.extend({
4469
- message: z61.string()
4486
+ message: z62.string()
4470
4487
  }),
4471
4488
  ...DefaultResponses
4472
4489
  },
@@ -4483,64 +4500,91 @@ var accountContract = initContract19().router(
4483
4500
 
4484
4501
  // src/mail/mail-server-contract.ts
4485
4502
  import { initContract as initContract20 } from "@ts-rest/core";
4486
- import z62 from "zod";
4503
+ import z64 from "zod";
4504
+
4505
+ // src/mail/schemas/servers-validation.schema.ts
4506
+ import z63 from "zod";
4507
+ var CreateMailServerSchema = z63.object({
4508
+ name: z63.string(),
4509
+ smtpHost: z63.string(),
4510
+ smtpPort: z63.number(),
4511
+ smtpTlsPort: z63.number(),
4512
+ useTlsForSmtp: z63.boolean(),
4513
+ imapHost: z63.string(),
4514
+ imapPort: z63.number(),
4515
+ imapTlsPort: z63.number(),
4516
+ useTlsForImap: z63.boolean()
4517
+ });
4518
+
4519
+ // src/mail/mail-server-contract.ts
4487
4520
  var serverContract = initContract20().router(
4488
4521
  {
4489
4522
  create: {
4490
4523
  method: "POST",
4491
4524
  path: "/",
4492
4525
  responses: {
4493
- 200: DefaultSuccessResponseSchema.extend({
4494
- message: z62.string()
4526
+ 201: DefaultSuccessResponseSchema.extend({
4527
+ data: MailServerSchema
4495
4528
  }),
4496
4529
  ...DefaultResponses
4497
4530
  },
4498
- body: null,
4531
+ body: CreateMailServerSchema,
4499
4532
  summary: "Register a new mail server"
4500
4533
  },
4501
- get: {
4534
+ getById: {
4502
4535
  method: "GET",
4503
4536
  path: "/:id",
4504
- pathParams: z62.object({
4505
- id: z62.string()
4537
+ pathParams: z64.object({
4538
+ id: z64.string().uuid()
4506
4539
  }),
4507
4540
  responses: {
4508
4541
  200: DefaultSuccessResponseSchema.extend({
4509
- message: z62.string()
4542
+ data: MailServerSchema
4510
4543
  }),
4511
4544
  ...DefaultResponses
4512
4545
  },
4513
4546
  summary: "Get a mail server by id"
4514
4547
  },
4548
+ getAll: {
4549
+ method: "GET",
4550
+ path: "/",
4551
+ responses: {
4552
+ 200: DefaultSuccessResponseSchema.extend({
4553
+ data: z64.array(MailServerSchema)
4554
+ }),
4555
+ ...DefaultResponses
4556
+ },
4557
+ summary: "Get all mail servers"
4558
+ },
4515
4559
  update: {
4516
4560
  method: "PATCH",
4517
4561
  path: "/:id",
4518
- pathParams: z62.object({
4519
- id: z62.string()
4562
+ pathParams: z64.object({
4563
+ id: z64.string().uuid()
4520
4564
  }),
4521
4565
  responses: {
4522
4566
  200: DefaultSuccessResponseSchema.extend({
4523
- message: z62.string()
4567
+ data: MailServerSchema
4524
4568
  }),
4525
4569
  ...DefaultResponses
4526
4570
  },
4527
- body: null,
4528
- summary: "Update a mail server by id"
4571
+ body: CreateMailServerSchema.partial(),
4572
+ summary: "Update a mail server"
4529
4573
  },
4530
4574
  delete: {
4531
- method: "PATCH",
4575
+ method: "DELETE",
4532
4576
  path: "/:id",
4533
- pathParams: z62.object({
4534
- id: z62.string()
4577
+ pathParams: z64.object({
4578
+ id: z64.string().uuid()
4535
4579
  }),
4536
4580
  responses: {
4537
4581
  200: DefaultSuccessResponseSchema.extend({
4538
- message: z62.string()
4582
+ data: MailServerSchema
4539
4583
  }),
4540
4584
  ...DefaultResponses
4541
4585
  },
4542
4586
  body: null,
4543
- summary: "Delete a mail server by id"
4587
+ summary: "Delete a mail server"
4544
4588
  }
4545
4589
  },
4546
4590
  {
@@ -4550,44 +4594,44 @@ var serverContract = initContract20().router(
4550
4594
 
4551
4595
  // src/mail/message-contract.ts
4552
4596
  import { initContract as initContract21 } from "@ts-rest/core";
4553
- import z64 from "zod";
4597
+ import z66 from "zod";
4554
4598
 
4555
4599
  // 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()
4600
+ import z65 from "zod";
4601
+ var MailParticipant = z65.object({
4602
+ name: z65.string().optional(),
4603
+ address: z65.string().email()
4560
4604
  });
4561
4605
  var MessageContractsValidationsSchema = {
4562
4606
  submit: {
4563
- input: z63.object({
4564
- subject: z63.string(),
4565
- text: z63.string(),
4566
- html: z63.string(),
4607
+ input: z65.object({
4608
+ subject: z65.string(),
4609
+ text: z65.string(),
4610
+ html: z65.string(),
4567
4611
  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")])
4612
+ to: z65.array(MailParticipant),
4613
+ cc: z65.array(MailParticipant).optional(),
4614
+ bcc: z65.array(MailParticipant).optional(),
4615
+ reference: z65.object({
4616
+ messageId: z65.string(),
4617
+ action: z65.union([z65.literal("reply"), z65.literal("forward")])
4574
4618
  }).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()
4619
+ attachments: z65.array(
4620
+ z65.object({
4621
+ fileType: z65.string(),
4622
+ fileName: z65.string(),
4623
+ fileKey: z65.string(),
4624
+ fileSize: z65.number(),
4625
+ bucketName: z65.string(),
4626
+ presignedUrl: z65.string()
4583
4627
  })
4584
4628
  ).optional()
4585
4629
  }),
4586
- output: z63.object({
4587
- response: z63.string(),
4588
- messageId: z63.string(),
4589
- sendAt: z63.string(),
4590
- queueId: z63.string()
4630
+ output: z65.object({
4631
+ response: z65.string(),
4632
+ messageId: z65.string(),
4633
+ sendAt: z65.string(),
4634
+ queueId: z65.string()
4591
4635
  })
4592
4636
  }
4593
4637
  };
@@ -4612,8 +4656,8 @@ var messageContract = initContract21().router(
4612
4656
  getById: {
4613
4657
  method: "GET",
4614
4658
  path: "/:id",
4615
- pathParams: z64.object({
4616
- id: z64.string()
4659
+ pathParams: z66.object({
4660
+ id: z66.string()
4617
4661
  }),
4618
4662
  responses: {
4619
4663
  200: DefaultSuccessResponseSchema.extend({
@@ -4640,7 +4684,7 @@ var mailContract = initContract22().router({
4640
4684
 
4641
4685
  // src/messenger/index.ts
4642
4686
  import { initContract as initContract23 } from "@ts-rest/core";
4643
- import z65 from "zod";
4687
+ import z67 from "zod";
4644
4688
  var messengerContract = initContract23().router({
4645
4689
  sendMessage: {
4646
4690
  method: "POST",
@@ -4648,6 +4692,7 @@ var messengerContract = initContract23().router({
4648
4692
  body: SendMessageToPlatformSchema,
4649
4693
  responses: {
4650
4694
  200: SendMessageResponseSchema,
4695
+ 400: DefaultErrorResponseSchema,
4651
4696
  500: DefaultErrorResponseSchema
4652
4697
  }
4653
4698
  },
@@ -4674,8 +4719,8 @@ var messengerContract = initContract23().router({
4674
4719
  reconnect: {
4675
4720
  method: "POST",
4676
4721
  path: "/reconnect/:channelId",
4677
- pathParams: z65.object({
4678
- channelId: z65.string().uuid()
4722
+ pathParams: z67.object({
4723
+ channelId: z67.string().uuid()
4679
4724
  }),
4680
4725
  body: null,
4681
4726
  responses: {
@@ -4687,8 +4732,8 @@ var messengerContract = initContract23().router({
4687
4732
  delete: {
4688
4733
  method: "DELETE",
4689
4734
  path: "/delete/:channelId",
4690
- pathParams: z65.object({
4691
- channelId: z65.string().uuid()
4735
+ pathParams: z67.object({
4736
+ channelId: z67.string().uuid()
4692
4737
  }),
4693
4738
  body: null,
4694
4739
  responses: {
@@ -4720,7 +4765,7 @@ var messengerContract = initContract23().router({
4720
4765
 
4721
4766
  // src/permission/index.ts
4722
4767
  import { initContract as initContract24 } from "@ts-rest/core";
4723
- import z66 from "zod";
4768
+ import z68 from "zod";
4724
4769
  var permissionContract = initContract24().router(
4725
4770
  {
4726
4771
  getPermissions: {
@@ -4728,9 +4773,9 @@ var permissionContract = initContract24().router(
4728
4773
  path: "",
4729
4774
  headers: DefaultHeaderSchema,
4730
4775
  responses: {
4731
- 200: z66.object({ permissions: PermissionSchema.array() }),
4732
- 400: z66.object({
4733
- message: z66.string()
4776
+ 200: z68.object({ permissions: PermissionSchema.array() }),
4777
+ 400: z68.object({
4778
+ message: z68.string()
4734
4779
  }),
4735
4780
  401: DefaultUnauthorizedSchema,
4736
4781
  500: DefaultErrorResponseSchema
@@ -4743,15 +4788,15 @@ var permissionContract = initContract24().router(
4743
4788
 
4744
4789
  // src/role/index.ts
4745
4790
  import { initContract as initContract25 } from "@ts-rest/core";
4746
- import z68 from "zod";
4791
+ import z70 from "zod";
4747
4792
 
4748
4793
  // 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())
4794
+ import { z as z69 } from "zod";
4795
+ var CreateRoleSchema = z69.object({
4796
+ systemName: z69.string(),
4797
+ displayName: z69.string(),
4798
+ description: z69.string().nullable(),
4799
+ permissions: z69.array(z69.string())
4755
4800
  });
4756
4801
  var UpdateRoleSchema = CreateRoleSchema;
4757
4802
 
@@ -4767,8 +4812,8 @@ var roleContract = initContract25().router(
4767
4812
  201: DefaultSuccessResponseSchema.extend({
4768
4813
  role: RoleSchema
4769
4814
  }),
4770
- 400: z68.object({
4771
- message: z68.string()
4815
+ 400: z70.object({
4816
+ message: z70.string()
4772
4817
  }),
4773
4818
  401: DefaultUnauthorizedSchema,
4774
4819
  500: DefaultErrorResponseSchema
@@ -4778,15 +4823,15 @@ var roleContract = initContract25().router(
4778
4823
  getRoles: {
4779
4824
  method: "GET",
4780
4825
  path: "",
4781
- query: z68.object({
4782
- page: z68.coerce.number().default(1),
4783
- pageSize: z68.coerce.number().default(10)
4826
+ query: z70.object({
4827
+ page: z70.coerce.number().default(1),
4828
+ pageSize: z70.coerce.number().default(10)
4784
4829
  }).optional(),
4785
4830
  headers: DefaultHeaderSchema,
4786
4831
  responses: {
4787
4832
  200: WithPagination(RoleSchema),
4788
- 400: z68.object({
4789
- message: z68.string()
4833
+ 400: z70.object({
4834
+ message: z70.string()
4790
4835
  }),
4791
4836
  401: DefaultUnauthorizedSchema,
4792
4837
  500: DefaultErrorResponseSchema
@@ -4796,15 +4841,15 @@ var roleContract = initContract25().router(
4796
4841
  updateRole: {
4797
4842
  method: "PATCH",
4798
4843
  path: "/:id",
4799
- pathParams: z68.object({ id: z68.string() }),
4844
+ pathParams: z70.object({ id: z70.string() }),
4800
4845
  headers: DefaultHeaderSchema,
4801
4846
  body: UpdateRoleSchema,
4802
4847
  responses: {
4803
4848
  201: DefaultSuccessResponseSchema.extend({
4804
4849
  role: RoleSchema
4805
4850
  }),
4806
- 400: z68.object({
4807
- message: z68.string()
4851
+ 400: z70.object({
4852
+ message: z70.string()
4808
4853
  }),
4809
4854
  401: DefaultUnauthorizedSchema,
4810
4855
  500: DefaultErrorResponseSchema
@@ -4814,11 +4859,11 @@ var roleContract = initContract25().router(
4814
4859
  deleteRole: {
4815
4860
  method: "DELETE",
4816
4861
  path: "/:id",
4817
- pathParams: z68.object({ id: z68.string() }),
4862
+ pathParams: z70.object({ id: z70.string() }),
4818
4863
  headers: DefaultHeaderSchema,
4819
4864
  body: null,
4820
4865
  responses: {
4821
- 200: DefaultSuccessResponseSchema.extend({ message: z68.string() }),
4866
+ 200: DefaultSuccessResponseSchema.extend({ message: z70.string() }),
4822
4867
  500: DefaultErrorResponseSchema
4823
4868
  },
4824
4869
  summary: "Delete a role."
@@ -4829,19 +4874,19 @@ var roleContract = initContract25().router(
4829
4874
 
4830
4875
  // src/tag/index.ts
4831
4876
  import { initContract as initContract26 } from "@ts-rest/core";
4832
- import z70 from "zod";
4877
+ import z72 from "zod";
4833
4878
 
4834
4879
  // src/tag/validation.ts
4835
- import { z as z69 } from "zod";
4836
- var CreateTagSchema = z69.object({
4837
- name: z69.string(),
4880
+ import { z as z71 } from "zod";
4881
+ var CreateTagSchema = z71.object({
4882
+ name: z71.string(),
4838
4883
  group: TagGroupSchema
4839
4884
  });
4840
- var GetTagsSchema = z69.object({
4885
+ var GetTagsSchema = z71.object({
4841
4886
  group: TagGroupSchema.default("general"),
4842
- keyword: z69.string()
4887
+ keyword: z71.string()
4843
4888
  }).partial().optional();
4844
- var UpdateTagSchema = z69.object({ name: z69.string() });
4889
+ var UpdateTagSchema = z71.object({ name: z71.string() });
4845
4890
 
4846
4891
  // src/tag/index.ts
4847
4892
  var tagContract = initContract26().router(
@@ -4864,7 +4909,7 @@ var tagContract = initContract26().router(
4864
4909
  query: GetTagsSchema,
4865
4910
  responses: {
4866
4911
  200: DefaultSuccessResponseSchema.extend({
4867
- tags: z70.array(TagSchema)
4912
+ tags: z72.array(TagSchema)
4868
4913
  }),
4869
4914
  500: DefaultErrorResponseSchema
4870
4915
  },
@@ -4873,7 +4918,7 @@ var tagContract = initContract26().router(
4873
4918
  updateTag: {
4874
4919
  method: "PATCH",
4875
4920
  path: "/:id",
4876
- pathParams: z70.object({ id: z70.string() }),
4921
+ pathParams: z72.object({ id: z72.string() }),
4877
4922
  body: UpdateTagSchema,
4878
4923
  responses: {
4879
4924
  200: DefaultSuccessResponseSchema.extend({
@@ -4886,11 +4931,11 @@ var tagContract = initContract26().router(
4886
4931
  deleteTag: {
4887
4932
  method: "DELETE",
4888
4933
  path: "/:id",
4889
- pathParams: z70.object({ id: z70.string() }),
4890
- body: z70.any().optional(),
4934
+ pathParams: z72.object({ id: z72.string() }),
4935
+ body: z72.any().optional(),
4891
4936
  // We don't need the body.
4892
4937
  responses: {
4893
- 200: DefaultSuccessResponseSchema.extend({ message: z70.string() }),
4938
+ 200: DefaultSuccessResponseSchema.extend({ message: z72.string() }),
4894
4939
  500: DefaultErrorResponseSchema
4895
4940
  },
4896
4941
  headers: DefaultHeaderSchema
@@ -4903,27 +4948,27 @@ var tagContract = initContract26().router(
4903
4948
 
4904
4949
  // src/telephony-agent-presence-status/index.ts
4905
4950
  import { initContract as initContract27 } from "@ts-rest/core";
4906
- import z73 from "zod";
4951
+ import z75 from "zod";
4907
4952
 
4908
4953
  // src/telephony-agent-presence-status/schema.ts
4909
- import z71 from "zod";
4954
+ import z73 from "zod";
4910
4955
  var PresenceStatusSchema = DefaultEntitySchema.extend({
4911
- status: z71.string(),
4912
- description: z71.string()
4956
+ status: z73.string(),
4957
+ description: z73.string()
4913
4958
  });
4914
4959
  var UserPresenceStatusSchema = DefaultEntitySchema.extend({
4915
4960
  user: UserSchema,
4916
4961
  presenceStatus: PresenceStatusSchema,
4917
- customPresenceStatus: z71.string().nullable().optional()
4962
+ customPresenceStatus: z73.string().nullable().optional()
4918
4963
  });
4919
4964
 
4920
4965
  // 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()
4966
+ import { z as z74 } from "zod";
4967
+ var UpdateUserStatusSchema = z74.object({
4968
+ userId: z74.string(),
4969
+ presenceStatusId: z74.string().nullable().optional(),
4970
+ customPreseneStatus: z74.string().nullable().optional(),
4971
+ reason: z74.string()
4927
4972
  });
4928
4973
 
4929
4974
  // src/telephony-agent-presence-status/index.ts
@@ -4934,9 +4979,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4934
4979
  path: "/presence_status",
4935
4980
  headers: DefaultHeaderSchema,
4936
4981
  responses: {
4937
- 200: z73.array(PresenceStatusSchema),
4938
- 400: z73.object({
4939
- message: z73.string()
4982
+ 200: z75.array(PresenceStatusSchema),
4983
+ 400: z75.object({
4984
+ message: z75.string()
4940
4985
  }),
4941
4986
  401: DefaultUnauthorizedSchema,
4942
4987
  500: DefaultErrorResponseSchema
@@ -4948,9 +4993,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4948
4993
  path: "/agents/presence_status",
4949
4994
  headers: DefaultHeaderSchema,
4950
4995
  responses: {
4951
- 200: z73.array(UserPresenceStatusSchema),
4952
- 400: z73.object({
4953
- message: z73.string()
4996
+ 200: z75.array(UserPresenceStatusSchema),
4997
+ 400: z75.object({
4998
+ message: z75.string()
4954
4999
  }),
4955
5000
  401: DefaultUnauthorizedSchema,
4956
5001
  500: DefaultErrorResponseSchema
@@ -4960,12 +5005,12 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4960
5005
  getAgentStatus: {
4961
5006
  method: "GET",
4962
5007
  path: "/presence_status/check_update/:userId",
4963
- pathParams: z73.object({ userId: z73.string() }),
5008
+ pathParams: z75.object({ userId: z75.string() }),
4964
5009
  headers: DefaultHeaderSchema,
4965
5010
  responses: {
4966
5011
  200: UserPresenceStatusSchema,
4967
- 400: z73.object({
4968
- message: z73.string()
5012
+ 400: z75.object({
5013
+ message: z75.string()
4969
5014
  }),
4970
5015
  401: DefaultUnauthorizedSchema,
4971
5016
  500: DefaultErrorResponseSchema
@@ -4981,8 +5026,8 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4981
5026
  200: DefaultSuccessResponseSchema.extend({
4982
5027
  userPresenceStatu: UserPresenceStatusSchema
4983
5028
  }),
4984
- 400: z73.object({
4985
- message: z73.string()
5029
+ 400: z75.object({
5030
+ message: z75.string()
4986
5031
  }),
4987
5032
  401: DefaultUnauthorizedSchema,
4988
5033
  500: DefaultErrorResponseSchema
@@ -4994,63 +5039,63 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
4994
5039
  );
4995
5040
 
4996
5041
  // src/telephony-cdr/index.ts
4997
- import z76 from "zod";
5042
+ import z78 from "zod";
4998
5043
 
4999
5044
  // 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()
5045
+ import z76 from "zod";
5046
+ var CreateTelephonyCdrSchema = z76.object({
5047
+ uniqueCallId: z76.string({ required_error: "uniqueCallId is required" }),
5048
+ timeStart: z76.string({ required_error: "timeStart is required" }),
5049
+ callFrom: z76.string({ required_error: "callFrom is required" }),
5050
+ callTo: z76.string({ required_error: "callTo is required" }),
5051
+ callDuration: z76.number().nullable(),
5052
+ talkDuration: z76.number().nullable(),
5053
+ srcTrunkName: z76.string().nullable(),
5054
+ dstTrunkName: z76.string().nullable(),
5055
+ pinCode: z76.string().nullable(),
5056
+ status: z76.string(),
5057
+ type: z76.string(),
5058
+ recording: z76.string().nullable(),
5059
+ didNumber: z76.string().nullable(),
5060
+ agentRingTime: z76.number().nullable()
5016
5061
  });
5017
5062
  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()
5063
+ selectedDate: z76.string().optional(),
5064
+ type: z76.array(z76.string()).optional(),
5065
+ status: z76.array(z76.string()).optional(),
5066
+ callFrom: z76.string().optional(),
5067
+ callTo: z76.string().optional(),
5068
+ trunk: z76.array(z76.string()).optional(),
5069
+ userId: z76.string().uuid().optional(),
5070
+ queueStatus: z76.string().optional(),
5071
+ agentIds: z76.array(z76.string().uuid()).optional(),
5072
+ agentCallsOnly: z76.coerce.boolean().optional(),
5073
+ contactId: z76.string().uuid().optional()
5029
5074
  });
5030
5075
  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()
5076
+ type: z76.array(z76.string()).optional(),
5077
+ status: z76.array(z76.string()).optional(),
5078
+ callFrom: z76.string().optional(),
5079
+ callTo: z76.string().optional(),
5080
+ result: z76.array(z76.string()).optional(),
5081
+ callTags: z76.array(z76.string()).optional(),
5082
+ selectedDate: z76.string().optional(),
5083
+ agentId: z76.string().optional(),
5084
+ contact: z76.array(z76.string()).optional(),
5085
+ callStatus: z76.array(z76.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
5086
+ queueIds: z76.array(z76.string()).optional(),
5087
+ notes: z76.string().optional()
5043
5088
  });
5044
5089
  var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
5045
- z74.object({
5046
- page: z74.coerce.number().positive().optional(),
5047
- pageSize: z74.coerce.number().positive().optional()
5090
+ z76.object({
5091
+ page: z76.coerce.number().positive().optional(),
5092
+ pageSize: z76.coerce.number().positive().optional()
5048
5093
  })
5049
5094
  );
5050
5095
  var NullEmptyStringUndefined = ["", null, void 0];
5051
5096
  var EmtptyArrayUndefined = [[], void 0];
5052
5097
  var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
5053
- reportType: z74.enum([
5098
+ reportType: z76.enum([
5054
5099
  "extcallstatistics",
5055
5100
  "extcallactivity",
5056
5101
  "trunkactivity",
@@ -5060,52 +5105,52 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
5060
5105
  "queueagentmisscalls",
5061
5106
  "queueagentinoutcalls"
5062
5107
  ]),
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()
5108
+ selectedDate: z76.string().optional(),
5109
+ communicationType: z76.union([z76.literal("Inbound"), z76.literal("Outbound"), z76.literal("Internal")]).optional(),
5110
+ time: z76.string().optional(),
5111
+ queueList: z76.array(z76.string()).optional(),
5112
+ queueId: z76.string().optional(),
5113
+ trunkList: z76.array(z76.string()).optional(),
5114
+ extensionList: z76.array(z76.string()).optional()
5070
5115
  }).superRefine((input, ctx) => {
5071
5116
  if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
5072
5117
  ctx.addIssue({
5073
- code: z74.ZodIssueCode.custom,
5118
+ code: z76.ZodIssueCode.custom,
5074
5119
  path: ["selectedDate"],
5075
5120
  message: "selectedDate is required."
5076
5121
  });
5077
5122
  }
5078
5123
  if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
5079
5124
  ctx.addIssue({
5080
- code: z74.ZodIssueCode.custom,
5125
+ code: z76.ZodIssueCode.custom,
5081
5126
  path: ["time"],
5082
5127
  message: "time is required."
5083
5128
  });
5084
5129
  }
5085
5130
  if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
5086
5131
  ctx.addIssue({
5087
- code: z74.ZodIssueCode.custom,
5132
+ code: z76.ZodIssueCode.custom,
5088
5133
  path: ["queueList"],
5089
5134
  message: "queueList is required."
5090
5135
  });
5091
5136
  }
5092
5137
  if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
5093
5138
  ctx.addIssue({
5094
- code: z74.ZodIssueCode.custom,
5139
+ code: z76.ZodIssueCode.custom,
5095
5140
  path: ["queueId"],
5096
5141
  message: "queueId is required."
5097
5142
  });
5098
5143
  }
5099
5144
  if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
5100
5145
  ctx.addIssue({
5101
- code: z74.ZodIssueCode.custom,
5146
+ code: z76.ZodIssueCode.custom,
5102
5147
  path: ["trunkList"],
5103
5148
  message: "trunkList is required."
5104
5149
  });
5105
5150
  }
5106
5151
  if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
5107
5152
  ctx.addIssue({
5108
- code: z74.ZodIssueCode.custom,
5153
+ code: z76.ZodIssueCode.custom,
5109
5154
  path: ["extensionList"],
5110
5155
  message: "extensionList is required."
5111
5156
  });
@@ -5116,161 +5161,161 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
5116
5161
  import { initContract as initContract28 } from "@ts-rest/core";
5117
5162
 
5118
5163
  // src/telephony-cdr/call-report.schema.ts
5119
- import z75 from "zod";
5120
- var ExtCallStatisticsListSchema = z75.object({
5164
+ import z77 from "zod";
5165
+ var ExtCallStatisticsListSchema = z77.object({
5121
5166
  /** @example "ext_num" */
5122
- ext_num: z75.string(),
5167
+ ext_num: z77.string(),
5123
5168
  /** @example "ext_name" */
5124
- ext_name: z75.string(),
5169
+ ext_name: z77.string(),
5125
5170
  /** @example 0 */
5126
- answered_calls: z75.number(),
5171
+ answered_calls: z77.number(),
5127
5172
  /** @example 0 */
5128
- no_answer_calls: z75.number(),
5173
+ no_answer_calls: z77.number(),
5129
5174
  /** @example 0 */
5130
- busy_calls: z75.number(),
5175
+ busy_calls: z77.number(),
5131
5176
  /** @example 0 */
5132
- failed_calls: z75.number(),
5177
+ failed_calls: z77.number(),
5133
5178
  /** @example 0 */
5134
- voicemail_calls: z75.number(),
5179
+ voicemail_calls: z77.number(),
5135
5180
  /** @example 0 */
5136
- total_holding_time: z75.number(),
5181
+ total_holding_time: z77.number(),
5137
5182
  /** @example 0 */
5138
- total_talking_time: z75.number(),
5183
+ total_talking_time: z77.number(),
5139
5184
  /** @example "src_name" */
5140
- src_name: z75.string(),
5185
+ src_name: z77.string(),
5141
5186
  /** @example 0 */
5142
- total_call_count: z75.number(),
5187
+ total_call_count: z77.number(),
5143
5188
  /** @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(),
5189
+ mobile: z77.string()
5190
+ });
5191
+ var ExtStatisticSchema = z77.object({
5192
+ ext_num: z77.string(),
5193
+ ext_name: z77.string(),
5194
+ answered_calls: z77.number(),
5195
+ no_answer_calls: z77.number(),
5196
+ busy_calls: z77.number(),
5197
+ failed_calls: z77.number(),
5198
+ voicemail_calls: z77.number(),
5199
+ total_holding_time: z77.number(),
5200
+ total_talking_time: z77.number(),
5201
+ time: z77.number(),
5202
+ mobile: z77.string()
5203
+ });
5204
+ var ExtCallActivityListSchema = z77.object({
5205
+ time: z77.number(),
5206
+ answered_calls: z77.number(),
5207
+ no_answer_calls: z77.number(),
5208
+ busy_calls: z77.number(),
5209
+ failed_calls: z77.number(),
5210
+ voicemail_calls: z77.number(),
5211
+ total_holding_time: z77.number(),
5212
+ total_talking_time: z77.number(),
5213
+ ext_statistics: z77.array(ExtStatisticSchema)
5214
+ });
5215
+ var TrunkList = z77.object({
5216
+ trunk_name: z77.string(),
5217
+ total_calls: z77.number()
5218
+ });
5219
+ var TrunkActivityListSchema = z77.object({
5220
+ time: z77.number(),
5221
+ trunk_list: z77.array(TrunkList)
5222
+ });
5223
+ var QueueAvgWaitTalkTimeListSchema = z77.object({
5224
+ time: z77.number(),
5225
+ avg_wait_time: z77.number(),
5226
+ avg_talk_time: z77.number()
5227
+ });
5228
+ var SatisfactionListSchema = z77.object({
5229
+ press_key: z77.string(),
5230
+ total: z77.number(),
5231
+ key_point: z77.number().optional()
5232
+ });
5233
+ var agentListSchema = z77.object({
5234
+ agent_name: z77.string(),
5235
+ agent_num: z77.string(),
5236
+ satisfaction_list: z77.array(SatisfactionListSchema).optional(),
5237
+ total_key: z77.number().optional(),
5238
+ total_point: z77.number().optional(),
5239
+ average_point: z77.number().optional()
5240
+ });
5241
+ var QueueSatisfactionSchema = z77.object({
5242
+ queue_name: z77.string(),
5243
+ queue_num: z77.string(),
5244
+ satisfaction_list: z77.array(SatisfactionListSchema).optional(),
5245
+ agent_list: z77.array(agentListSchema).optional(),
5246
+ total_key: z77.number().optional(),
5247
+ total_point: z77.number().optional(),
5248
+ average_point: z77.number().optional()
5249
+ });
5250
+ var QueuePerformanceListSchema = z77.object({
5251
+ queue: z77.string(),
5252
+ total_calls: z77.number(),
5253
+ answered_calls: z77.number(),
5254
+ missed_calls: z77.number(),
5255
+ abandoned_calls: z77.number(),
5256
+ average_waiting_time: z77.number(),
5257
+ average_talking_time: z77.number(),
5258
+ max_waiting_time: z77.number(),
5259
+ answered_rate: z77.number(),
5260
+ missed_rate: z77.number(),
5261
+ abandoned_rate: z77.number(),
5262
+ sla: z77.number()
5263
+ });
5264
+ var QueueAgentMissCallsListSchema = z77.object({
5265
+ agent_name: z77.string(),
5266
+ agent_num: z77.string(),
5267
+ time: z77.string(),
5268
+ total_wait_time: z77.number(),
5269
+ src_name: z77.string(),
5270
+ src_num: z77.string(),
5271
+ queue_status: z77.string(),
5272
+ polling_attempts: z77.number(),
5273
+ missed_reason: z77.string()
5274
+ });
5275
+ var QueueAgentInOutCallsListSchema = z77.object({
5276
+ agent_name: z77.string(),
5277
+ agent_num: z77.string(),
5278
+ inbound_calls: z77.number(),
5279
+ inbound_duration: z77.number(),
5280
+ outbound_calls: z77.number(),
5281
+ outbound_duration: z77.number(),
5282
+ total_calls: z77.number(),
5283
+ total_duration: z77.number(),
5284
+ average_talk_duration: z77.number()
5285
+ });
5286
+ var CallReportModel = z77.object({
5287
+ errcode: z77.number(),
5288
+ errmsg: z77.string(),
5289
+ total_number: z77.number(),
5290
+ is_12hour: z77.number().optional(),
5291
+ ext_call_statistics_list: z77.array(ExtCallStatisticsListSchema).optional(),
5292
+ ext_call_activity_list: z77.array(ExtCallActivityListSchema).optional(),
5293
+ trunk_activity_list: z77.array(TrunkActivityListSchema).optional(),
5294
+ queue_avg_wait_talk_time_list: z77.array(QueueAvgWaitTalkTimeListSchema).optional(),
5250
5295
  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(),
5296
+ queue_performance_list: z77.array(QueuePerformanceListSchema).optional(),
5297
+ queue_agent_miss_calls_list: z77.array(QueueAgentMissCallsListSchema).optional(),
5298
+ queue_agent_in_out_calls_list: z77.array(QueueAgentInOutCallsListSchema).optional(),
5299
+ callback_result: z77.string(),
5300
+ page: z77.number().optional(),
5301
+ pageSize: z77.number().optional()
5302
+ });
5303
+ var CallReportSchema = z77.object({
5304
+ errcode: z77.number(),
5305
+ errmsg: z77.string(),
5306
+ total_number: z77.number(),
5307
+ is_12hour: z77.number().optional(),
5308
+ ext_call_statistics_list: z77.array(ExtCallStatisticsListSchema).optional(),
5309
+ ext_call_activity_list: z77.array(ExtCallActivityListSchema).optional(),
5310
+ trunk_activity_list: z77.array(TrunkActivityListSchema).optional(),
5311
+ queue_avg_wait_talk_time_list: z77.array(QueueAvgWaitTalkTimeListSchema).optional(),
5267
5312
  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()
5313
+ queue_performance_list: z77.array(QueuePerformanceListSchema).optional(),
5314
+ queue_agent_miss_calls_list: z77.array(QueueAgentMissCallsListSchema).optional(),
5315
+ queue_agent_in_out_calls_list: z77.array(QueueAgentInOutCallsListSchema).optional(),
5316
+ callback_result: z77.string(),
5317
+ page: z77.number().optional(),
5318
+ pageSize: z77.number().optional()
5274
5319
  });
5275
5320
 
5276
5321
  // src/telephony-cdr/index.ts
@@ -5283,10 +5328,10 @@ var telephonyCdrContract = initContract28().router(
5283
5328
  query: GetAllTelephonyCdrSchema,
5284
5329
  responses: {
5285
5330
  200: DefaultSuccessResponseSchema.extend({
5286
- total: z76.number(),
5287
- page: z76.number(),
5288
- pageSize: z76.number(),
5289
- telephonyCdrs: z76.array(TelephonyCdrSchema)
5331
+ total: z78.number(),
5332
+ page: z78.number(),
5333
+ pageSize: z78.number(),
5334
+ telephonyCdrs: z78.array(TelephonyCdrSchema)
5290
5335
  }),
5291
5336
  401: DefaultUnauthorizedSchema
5292
5337
  },
@@ -5299,10 +5344,10 @@ var telephonyCdrContract = initContract28().router(
5299
5344
  query: GetAllTelephonyCdrSchema,
5300
5345
  responses: {
5301
5346
  200: DefaultSuccessResponseSchema.extend({
5302
- total: z76.number(),
5303
- page: z76.number(),
5304
- pageSize: z76.number(),
5305
- telephonyCdrs: z76.array(TelephonyCdrSchema)
5347
+ total: z78.number(),
5348
+ page: z78.number(),
5349
+ pageSize: z78.number(),
5350
+ telephonyCdrs: z78.array(TelephonyCdrSchema)
5306
5351
  }),
5307
5352
  401: DefaultUnauthorizedSchema
5308
5353
  },
@@ -5315,10 +5360,10 @@ var telephonyCdrContract = initContract28().router(
5315
5360
  query: GetRecentTelephonyCdrSchema,
5316
5361
  responses: {
5317
5362
  200: DefaultSuccessResponseSchema.extend({
5318
- total: z76.number(),
5319
- page: z76.number(),
5320
- pageSize: z76.number(),
5321
- telephonyCdrs: z76.array(TelephonyCdrSchema)
5363
+ total: z78.number(),
5364
+ page: z78.number(),
5365
+ pageSize: z78.number(),
5366
+ telephonyCdrs: z78.array(TelephonyCdrSchema)
5322
5367
  }),
5323
5368
  401: DefaultUnauthorizedSchema
5324
5369
  },
@@ -5410,35 +5455,35 @@ var telephonyCdrContract = initContract28().router(
5410
5455
 
5411
5456
  // src/telephony-extension/index.ts
5412
5457
  import { initContract as initContract29 } from "@ts-rest/core";
5413
- import z78 from "zod";
5458
+ import z80 from "zod";
5414
5459
 
5415
5460
  // 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()
5461
+ import z79 from "zod";
5462
+ var TelephonyExtensionSchema3 = z79.object({
5463
+ errcode: z79.coerce.number(),
5464
+ errmsg: z79.string(),
5465
+ total_number: z79.coerce.number(),
5466
+ data: z79.array(
5467
+ z79.object({
5468
+ id: z79.coerce.number(),
5469
+ online_status: z79.object({
5470
+ fx_phone: z79.object({ status: z79.coerce.number() }),
5471
+ sip_phone: z79.object({
5472
+ status: z79.coerce.number(),
5473
+ ext_dev_type: z79.string().optional()
5474
+ }),
5475
+ linkus_desktop: z79.object({ status: z79.coerce.number() }),
5476
+ linkus_mobile: z79.object({ status: z79.coerce.number() }),
5477
+ linkus_web: z79.object({
5478
+ status: z79.coerce.number(),
5479
+ ext_dev_type: z79.string().optional()
5435
5480
  })
5436
5481
  }).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()
5482
+ presence_status: z79.string().optional(),
5483
+ number: z79.string().optional(),
5484
+ caller_id_name: z79.string().optional(),
5485
+ role_name: z79.string().optional(),
5486
+ email_addr: z79.string().optional()
5442
5487
  })
5443
5488
  )
5444
5489
  });
@@ -5453,8 +5498,8 @@ var telephonyExtensionContract = initContract29().router(
5453
5498
  query: null,
5454
5499
  responses: {
5455
5500
  200: TelephonyExtensionSchema3,
5456
- 400: z78.object({
5457
- message: z78.string()
5501
+ 400: z80.object({
5502
+ message: z80.string()
5458
5503
  }),
5459
5504
  401: DefaultUnauthorizedSchema,
5460
5505
  500: DefaultErrorResponseSchema
@@ -5467,10 +5512,10 @@ var telephonyExtensionContract = initContract29().router(
5467
5512
 
5468
5513
  // src/ticket/index.ts
5469
5514
  import { initContract as initContract30 } from "@ts-rest/core";
5470
- import z80 from "zod";
5515
+ import z82 from "zod";
5471
5516
 
5472
5517
  // src/ticket/validation.ts
5473
- import z79 from "zod";
5518
+ import z81 from "zod";
5474
5519
  var addErrorMessage2 = (field) => {
5475
5520
  return field.refine(
5476
5521
  ({ isRequired, value }) => {
@@ -5488,106 +5533,106 @@ var addErrorMessage2 = (field) => {
5488
5533
  }
5489
5534
  );
5490
5535
  };
5491
- var BaseSchema3 = z79.object({
5492
- isRequired: z79.boolean(),
5493
- attributeId: z79.string()
5536
+ var BaseSchema3 = z81.object({
5537
+ isRequired: z81.boolean(),
5538
+ attributeId: z81.string()
5494
5539
  });
5495
5540
  var SingleValue2 = addErrorMessage2(
5496
5541
  BaseSchema3.extend({
5497
- value: z79.string()
5542
+ value: z81.string()
5498
5543
  })
5499
5544
  );
5500
- var CreateTicketValidationSchema = z79.object({
5545
+ var CreateTicketValidationSchema = z81.object({
5501
5546
  title: SingleValue2,
5502
5547
  description: SingleValue2,
5503
5548
  status: SingleValue2,
5504
5549
  type: SingleValue2,
5505
5550
  priority: SingleValue2,
5506
5551
  contact: SingleValue2,
5507
- assignee: z79.object({
5508
- isRequired: z79.boolean(),
5509
- attributeId: z79.string(),
5510
- value: z79.string()
5552
+ assignee: z81.object({
5553
+ isRequired: z81.boolean(),
5554
+ attributeId: z81.string(),
5555
+ value: z81.string()
5511
5556
  }),
5512
5557
  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(
5558
+ tags: addErrorMessage2(BaseSchema3.extend({ value: z81.array(z81.string()) })),
5559
+ categories: BaseSchema3.extend({ value: z81.array(z81.string()) }),
5560
+ customFields: z81.array(
5516
5561
  addErrorMessage2(
5517
5562
  BaseSchema3.extend({
5518
- value: z79.union([z79.string(), z79.array(z79.string())]),
5519
- type: z79.string(),
5520
- isDefaultAttribute: z79.boolean()
5563
+ value: z81.union([z81.string(), z81.array(z81.string())]),
5564
+ type: z81.string(),
5565
+ isDefaultAttribute: z81.boolean()
5521
5566
  })
5522
5567
  )
5523
5568
  ),
5524
- reasonToAssign: z79.object({ value: z79.string() }).optional()
5569
+ reasonToAssign: z81.object({ value: z81.string() }).optional()
5525
5570
  });
5526
5571
  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())])
5572
+ var TicketAttachmentRecordSchema = z81.object({
5573
+ bucketName: z81.string(),
5574
+ fileKey: z81.string(),
5575
+ fileName: z81.string(),
5576
+ fileSize: z81.coerce.number(),
5577
+ url: z81.string()
5578
+ });
5579
+ var CreateTicketAttachmentRecordsSchema = z81.object({
5580
+ ticketId: z81.string(),
5581
+ attributeId: z81.string(),
5582
+ ticketAttachmentRecords: z81.array(TicketAttachmentRecordSchema)
5583
+ });
5584
+ var TicketParamsSchema = z81.object({
5585
+ page: z81.coerce.number().default(1),
5586
+ pageSize: z81.coerce.number().default(10)
5587
+ });
5588
+ var CustomFieldQuery = z81.object({
5589
+ attributeId: z81.string(),
5590
+ type: z81.string(),
5591
+ value: z81.union([z81.string(), z81.array(z81.string())])
5592
+ });
5593
+ var GetAllTicketQuerySchema = z81.object({
5594
+ page: z81.string().transform((value) => Number(value)),
5595
+ pageSize: z81.string().transform((value) => Number(value)),
5596
+ selectedDate: z81.string(),
5597
+ keyword: z81.string(),
5598
+ title: z81.string(),
5599
+ description: z81.string(),
5600
+ status: z81.array(z81.string()),
5601
+ priority: z81.array(z81.string()),
5602
+ channel: z81.array(z81.string()),
5603
+ type: z81.array(z81.string()),
5604
+ ticketType: z81.array(z81.string()),
5605
+ contact: z81.array(z81.string()),
5606
+ tags: z81.array(z81.string().uuid()),
5607
+ categories: z81.array(z81.string().uuid()),
5608
+ assignee: z81.array(z81.string().uuid()),
5609
+ customFields: z81.array(
5610
+ z81.object({
5611
+ attributeId: z81.string().uuid(),
5612
+ type: z81.string(),
5613
+ value: z81.union([z81.string(), z81.array(z81.string())])
5569
5614
  })
5570
5615
  )
5571
5616
  }).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())])
5617
+ var ExportAllTicketQuerySchema = z81.object({
5618
+ agent: z81.array(z81.string()),
5619
+ selectedDate: z81.string(),
5620
+ keyword: z81.string(),
5621
+ title: z81.string(),
5622
+ description: z81.string(),
5623
+ status: z81.array(z81.string()),
5624
+ priority: z81.array(z81.string()),
5625
+ channel: z81.array(z81.string()),
5626
+ type: z81.array(z81.string()),
5627
+ ticketType: z81.array(z81.string()),
5628
+ contact: z81.array(z81.string()),
5629
+ tags: z81.array(z81.string()),
5630
+ categories: z81.array(z81.string()),
5631
+ customFields: z81.array(
5632
+ z81.object({
5633
+ attributeId: z81.string().uuid(),
5634
+ type: z81.string(),
5635
+ value: z81.union([z81.string(), z81.array(z81.string())])
5591
5636
  })
5592
5637
  )
5593
5638
  }).partial();
@@ -5603,14 +5648,14 @@ var ticketContract = initContract30().router(
5603
5648
  201: DefaultSuccessResponseSchema.extend({
5604
5649
  data: TicketSchema
5605
5650
  }),
5606
- 400: z80.object({
5607
- message: z80.string()
5651
+ 400: z82.object({
5652
+ message: z82.string()
5608
5653
  }),
5609
- 409: z80.object({
5610
- message: z80.string()
5654
+ 409: z82.object({
5655
+ message: z82.string()
5611
5656
  }),
5612
- 500: z80.object({
5613
- message: z80.string()
5657
+ 500: z82.object({
5658
+ message: z82.string()
5614
5659
  }),
5615
5660
  401: DefaultUnauthorizedSchema,
5616
5661
  404: DefaultNotFoundSchema,
@@ -5631,8 +5676,8 @@ var ticketContract = initContract30().router(
5631
5676
  TicketSchema
5632
5677
  )
5633
5678
  }),
5634
- 400: z80.object({
5635
- message: z80.string()
5679
+ 400: z82.object({
5680
+ message: z82.string()
5636
5681
  }),
5637
5682
  401: DefaultUnauthorizedSchema,
5638
5683
  500: DefaultErrorResponseSchema
@@ -5642,14 +5687,14 @@ var ticketContract = initContract30().router(
5642
5687
  getTicketById: {
5643
5688
  method: "GET",
5644
5689
  path: "/:id",
5645
- pathParams: z80.object({ id: z80.string() }),
5690
+ pathParams: z82.object({ id: z82.string() }),
5646
5691
  headers: DefaultHeaderSchema,
5647
5692
  responses: {
5648
5693
  200: DefaultSuccessResponseSchema.extend({
5649
5694
  data: TicketSchema
5650
5695
  }),
5651
- 400: z80.object({
5652
- message: z80.string()
5696
+ 400: z82.object({
5697
+ message: z82.string()
5653
5698
  }),
5654
5699
  401: DefaultUnauthorizedSchema,
5655
5700
  500: DefaultErrorResponseSchema
@@ -5659,15 +5704,15 @@ var ticketContract = initContract30().router(
5659
5704
  getTicketByContactId: {
5660
5705
  method: "GET",
5661
5706
  path: "/contact/:id",
5662
- pathParams: z80.object({ id: z80.string() }),
5707
+ pathParams: z82.object({ id: z82.string() }),
5663
5708
  query: TicketParamsSchema,
5664
5709
  headers: DefaultHeaderSchema,
5665
5710
  responses: {
5666
5711
  200: DefaultSuccessResponseSchema.extend({
5667
5712
  data: WithPagination(TicketSchema)
5668
5713
  }),
5669
- 400: z80.object({
5670
- message: z80.string()
5714
+ 400: z82.object({
5715
+ message: z82.string()
5671
5716
  }),
5672
5717
  401: DefaultUnauthorizedSchema,
5673
5718
  500: DefaultErrorResponseSchema
@@ -5677,21 +5722,21 @@ var ticketContract = initContract30().router(
5677
5722
  updateTicket: {
5678
5723
  method: "PATCH",
5679
5724
  path: "/:id",
5680
- pathParams: z80.object({ id: z80.string() }),
5725
+ pathParams: z82.object({ id: z82.string() }),
5681
5726
  body: UpdateTicketValidationSchema,
5682
5727
  headers: DefaultHeaderSchema,
5683
5728
  responses: {
5684
5729
  201: DefaultSuccessResponseSchema.extend({
5685
5730
  data: TicketSchema
5686
5731
  }),
5687
- 400: z80.object({
5688
- message: z80.string()
5732
+ 400: z82.object({
5733
+ message: z82.string()
5689
5734
  }),
5690
- 409: z80.object({
5691
- message: z80.string()
5735
+ 409: z82.object({
5736
+ message: z82.string()
5692
5737
  }),
5693
- 500: z80.object({
5694
- message: z80.string()
5738
+ 500: z82.object({
5739
+ message: z82.string()
5695
5740
  }),
5696
5741
  401: DefaultUnauthorizedSchema,
5697
5742
  404: DefaultNotFoundSchema,
@@ -5702,11 +5747,11 @@ var ticketContract = initContract30().router(
5702
5747
  deleteTicket: {
5703
5748
  method: "DELETE",
5704
5749
  path: "/:id",
5705
- pathParams: z80.object({ id: z80.string() }),
5750
+ pathParams: z82.object({ id: z82.string() }),
5706
5751
  headers: DefaultHeaderSchema,
5707
5752
  body: null,
5708
5753
  responses: {
5709
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5754
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5710
5755
  500: DefaultErrorResponseSchema
5711
5756
  },
5712
5757
  summary: "Delete a extension."
@@ -5714,19 +5759,19 @@ var ticketContract = initContract30().router(
5714
5759
  updateDescription: {
5715
5760
  method: "PATCH",
5716
5761
  path: "/description/update/:id",
5717
- pathParams: z80.object({ id: z80.string() }),
5718
- body: z80.object({ description: z80.string() }),
5762
+ pathParams: z82.object({ id: z82.string() }),
5763
+ body: z82.object({ description: z82.string() }),
5719
5764
  headers: DefaultHeaderSchema,
5720
5765
  responses: {
5721
- 201: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5722
- 400: z80.object({
5723
- message: z80.string()
5766
+ 201: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5767
+ 400: z82.object({
5768
+ message: z82.string()
5724
5769
  }),
5725
- 409: z80.object({
5726
- message: z80.string()
5770
+ 409: z82.object({
5771
+ message: z82.string()
5727
5772
  }),
5728
- 500: z80.object({
5729
- message: z80.string()
5773
+ 500: z82.object({
5774
+ message: z82.string()
5730
5775
  }),
5731
5776
  401: DefaultUnauthorizedSchema,
5732
5777
  404: DefaultNotFoundSchema,
@@ -5737,19 +5782,19 @@ var ticketContract = initContract30().router(
5737
5782
  updateTitle: {
5738
5783
  method: "PATCH",
5739
5784
  path: "/title/update/:id",
5740
- pathParams: z80.object({ id: z80.string() }),
5741
- body: z80.object({ title: z80.string() }),
5785
+ pathParams: z82.object({ id: z82.string() }),
5786
+ body: z82.object({ title: z82.string() }),
5742
5787
  headers: DefaultHeaderSchema,
5743
5788
  responses: {
5744
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5745
- 400: z80.object({
5746
- message: z80.string()
5789
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5790
+ 400: z82.object({
5791
+ message: z82.string()
5747
5792
  }),
5748
- 409: z80.object({
5749
- message: z80.string()
5793
+ 409: z82.object({
5794
+ message: z82.string()
5750
5795
  }),
5751
- 500: z80.object({
5752
- message: z80.string()
5796
+ 500: z82.object({
5797
+ message: z82.string()
5753
5798
  }),
5754
5799
  401: DefaultUnauthorizedSchema,
5755
5800
  404: DefaultNotFoundSchema,
@@ -5760,19 +5805,19 @@ var ticketContract = initContract30().router(
5760
5805
  updateType: {
5761
5806
  method: "PATCH",
5762
5807
  path: "/type/update/:id",
5763
- pathParams: z80.object({ id: z80.string() }),
5764
- body: z80.object({ type: z80.string() }),
5808
+ pathParams: z82.object({ id: z82.string() }),
5809
+ body: z82.object({ type: z82.string() }),
5765
5810
  headers: DefaultHeaderSchema,
5766
5811
  responses: {
5767
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5768
- 400: z80.object({
5769
- message: z80.string()
5812
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5813
+ 400: z82.object({
5814
+ message: z82.string()
5770
5815
  }),
5771
- 409: z80.object({
5772
- message: z80.string()
5816
+ 409: z82.object({
5817
+ message: z82.string()
5773
5818
  }),
5774
- 500: z80.object({
5775
- message: z80.string()
5819
+ 500: z82.object({
5820
+ message: z82.string()
5776
5821
  }),
5777
5822
  401: DefaultUnauthorizedSchema,
5778
5823
  404: DefaultNotFoundSchema,
@@ -5783,19 +5828,19 @@ var ticketContract = initContract30().router(
5783
5828
  updateStatus: {
5784
5829
  method: "PATCH",
5785
5830
  path: "/status/update/:id",
5786
- pathParams: z80.object({ id: z80.string() }),
5787
- body: z80.object({ status: z80.string() }),
5831
+ pathParams: z82.object({ id: z82.string() }),
5832
+ body: z82.object({ status: z82.string() }),
5788
5833
  headers: DefaultHeaderSchema,
5789
5834
  responses: {
5790
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5791
- 400: z80.object({
5792
- message: z80.string()
5835
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5836
+ 400: z82.object({
5837
+ message: z82.string()
5793
5838
  }),
5794
- 409: z80.object({
5795
- message: z80.string()
5839
+ 409: z82.object({
5840
+ message: z82.string()
5796
5841
  }),
5797
- 500: z80.object({
5798
- message: z80.string()
5842
+ 500: z82.object({
5843
+ message: z82.string()
5799
5844
  }),
5800
5845
  401: DefaultUnauthorizedSchema,
5801
5846
  404: DefaultNotFoundSchema,
@@ -5806,19 +5851,19 @@ var ticketContract = initContract30().router(
5806
5851
  updatePriority: {
5807
5852
  method: "PATCH",
5808
5853
  path: "/priority/update/:id",
5809
- pathParams: z80.object({ id: z80.string() }),
5810
- body: z80.object({ priority: z80.string() }),
5854
+ pathParams: z82.object({ id: z82.string() }),
5855
+ body: z82.object({ priority: z82.string() }),
5811
5856
  headers: DefaultHeaderSchema,
5812
5857
  responses: {
5813
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5814
- 400: z80.object({
5815
- message: z80.string()
5858
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5859
+ 400: z82.object({
5860
+ message: z82.string()
5816
5861
  }),
5817
- 409: z80.object({
5818
- message: z80.string()
5862
+ 409: z82.object({
5863
+ message: z82.string()
5819
5864
  }),
5820
- 500: z80.object({
5821
- message: z80.string()
5865
+ 500: z82.object({
5866
+ message: z82.string()
5822
5867
  }),
5823
5868
  401: DefaultUnauthorizedSchema,
5824
5869
  404: DefaultNotFoundSchema,
@@ -5829,19 +5874,19 @@ var ticketContract = initContract30().router(
5829
5874
  updateChannel: {
5830
5875
  method: "PATCH",
5831
5876
  path: "/channel/update/:id",
5832
- pathParams: z80.object({ id: z80.string() }),
5833
- body: z80.object({ channel: z80.string() }),
5877
+ pathParams: z82.object({ id: z82.string() }),
5878
+ body: z82.object({ channel: z82.string() }),
5834
5879
  headers: DefaultHeaderSchema,
5835
5880
  responses: {
5836
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5837
- 400: z80.object({
5838
- message: z80.string()
5881
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5882
+ 400: z82.object({
5883
+ message: z82.string()
5839
5884
  }),
5840
- 409: z80.object({
5841
- message: z80.string()
5885
+ 409: z82.object({
5886
+ message: z82.string()
5842
5887
  }),
5843
- 500: z80.object({
5844
- message: z80.string()
5888
+ 500: z82.object({
5889
+ message: z82.string()
5845
5890
  }),
5846
5891
  401: DefaultUnauthorizedSchema,
5847
5892
  404: DefaultNotFoundSchema,
@@ -5852,19 +5897,19 @@ var ticketContract = initContract30().router(
5852
5897
  updateTags: {
5853
5898
  method: "PATCH",
5854
5899
  path: "/tags/update/:id",
5855
- pathParams: z80.object({ id: z80.string() }),
5856
- body: z80.object({ tags: z80.array(z80.string()) }),
5900
+ pathParams: z82.object({ id: z82.string() }),
5901
+ body: z82.object({ tags: z82.array(z82.string()) }),
5857
5902
  headers: DefaultHeaderSchema,
5858
5903
  responses: {
5859
- 200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
5860
- 400: z80.object({
5861
- message: z80.string()
5904
+ 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
5905
+ 400: z82.object({
5906
+ message: z82.string()
5862
5907
  }),
5863
- 409: z80.object({
5864
- message: z80.string()
5908
+ 409: z82.object({
5909
+ message: z82.string()
5865
5910
  }),
5866
- 500: z80.object({
5867
- message: z80.string()
5911
+ 500: z82.object({
5912
+ message: z82.string()
5868
5913
  }),
5869
5914
  401: DefaultUnauthorizedSchema,
5870
5915
  404: DefaultNotFoundSchema,
@@ -5875,25 +5920,25 @@ var ticketContract = initContract30().router(
5875
5920
  changeAssignee: {
5876
5921
  method: "PATCH",
5877
5922
  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()
5923
+ pathParams: z82.object({ id: z82.string() }),
5924
+ body: z82.object({
5925
+ ticketId: z82.string(),
5926
+ assigneeId: z82.string(),
5927
+ reason: z82.string().optional()
5883
5928
  }),
5884
5929
  headers: DefaultHeaderSchema,
5885
5930
  responses: {
5886
5931
  200: DefaultSuccessResponseSchema.extend({
5887
5932
  data: TicketSchema
5888
5933
  }),
5889
- 400: z80.object({
5890
- message: z80.string()
5934
+ 400: z82.object({
5935
+ message: z82.string()
5891
5936
  }),
5892
- 409: z80.object({
5893
- message: z80.string()
5937
+ 409: z82.object({
5938
+ message: z82.string()
5894
5939
  }),
5895
- 500: z80.object({
5896
- message: z80.string()
5940
+ 500: z82.object({
5941
+ message: z82.string()
5897
5942
  }),
5898
5943
  401: DefaultUnauthorizedSchema,
5899
5944
  404: DefaultNotFoundSchema,
@@ -5904,14 +5949,14 @@ var ticketContract = initContract30().router(
5904
5949
  getTicketCountByContact: {
5905
5950
  method: "GET",
5906
5951
  path: "/ticket_count/contact/:id",
5907
- pathParams: z80.object({ id: z80.string() }),
5952
+ pathParams: z82.object({ id: z82.string() }),
5908
5953
  headers: DefaultHeaderSchema,
5909
5954
  responses: {
5910
5955
  200: DefaultSuccessResponseSchema.extend({
5911
5956
  data: TicketCountByContactSchema
5912
5957
  }),
5913
- 400: z80.object({
5914
- message: z80.string()
5958
+ 400: z82.object({
5959
+ message: z82.string()
5915
5960
  }),
5916
5961
  401: DefaultUnauthorizedSchema,
5917
5962
  500: DefaultErrorResponseSchema
@@ -5927,14 +5972,14 @@ var ticketContract = initContract30().router(
5927
5972
  201: DefaultSuccessResponseSchema.extend({
5928
5973
  data: TicketCustomFieldSchema
5929
5974
  }),
5930
- 400: z80.object({
5931
- message: z80.string()
5975
+ 400: z82.object({
5976
+ message: z82.string()
5932
5977
  }),
5933
- 409: z80.object({
5934
- message: z80.string()
5978
+ 409: z82.object({
5979
+ message: z82.string()
5935
5980
  }),
5936
- 500: z80.object({
5937
- message: z80.string()
5981
+ 500: z82.object({
5982
+ message: z82.string()
5938
5983
  }),
5939
5984
  401: DefaultUnauthorizedSchema,
5940
5985
  404: DefaultNotFoundSchema,
@@ -5959,24 +6004,24 @@ var ticketContract = initContract30().router(
5959
6004
 
5960
6005
  // src/user/index.ts
5961
6006
  import { initContract as initContract31 } from "@ts-rest/core";
5962
- import z82 from "zod";
6007
+ import z84 from "zod";
5963
6008
 
5964
6009
  // 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())
6010
+ import { z as z83 } from "zod";
6011
+ var CreateUserSchema = z83.object({
6012
+ name: z83.string(),
6013
+ email: z83.string().email(),
6014
+ address: z83.string().nullable(),
6015
+ phone: z83.string().nullable(),
6016
+ password: z83.string(),
6017
+ notificationCount: z83.number().nullable().optional(),
6018
+ roles: z83.array(z83.string())
5974
6019
  });
5975
6020
  var UpdateUserSchema = CreateUserSchema.extend({
5976
- newPassword: z81.string()
6021
+ newPassword: z83.string()
5977
6022
  });
5978
- var UpdateUserProfileSchema = z81.object({
5979
- password: z81.string()
6023
+ var UpdateUserProfileSchema = z83.object({
6024
+ password: z83.string()
5980
6025
  });
5981
6026
 
5982
6027
  // src/user/index.ts
@@ -5991,8 +6036,8 @@ var userContract = initContract31().router(
5991
6036
  201: DefaultSuccessResponseSchema.extend({
5992
6037
  user: UserSchema
5993
6038
  }),
5994
- 400: z82.object({
5995
- message: z82.string()
6039
+ 400: z84.object({
6040
+ message: z84.string()
5996
6041
  }),
5997
6042
  401: DefaultUnauthorizedSchema,
5998
6043
  404: DefaultNotFoundSchema,
@@ -6005,16 +6050,16 @@ var userContract = initContract31().router(
6005
6050
  method: "GET",
6006
6051
  path: "",
6007
6052
  headers: DefaultHeaderSchema,
6008
- query: z82.object({
6009
- page: z82.coerce.number().optional(),
6010
- pageSize: z82.coerce.number().optional(),
6053
+ query: z84.object({
6054
+ page: z84.coerce.number().optional(),
6055
+ pageSize: z84.coerce.number().optional(),
6011
6056
  // Don't add default 10. In some places, we need to fetch all users.
6012
- keyword: z82.string().optional()
6057
+ keyword: z84.string().optional()
6013
6058
  }).optional(),
6014
6059
  responses: {
6015
6060
  200: WithPagination(UserSchema),
6016
- 400: z82.object({
6017
- message: z82.string()
6061
+ 400: z84.object({
6062
+ message: z84.string()
6018
6063
  }),
6019
6064
  401: DefaultUnauthorizedSchema,
6020
6065
  500: DefaultErrorResponseSchema
@@ -6024,12 +6069,12 @@ var userContract = initContract31().router(
6024
6069
  getUserById: {
6025
6070
  method: "GET",
6026
6071
  path: "/:id",
6027
- pathParams: z82.object({ id: z82.string() }),
6072
+ pathParams: z84.object({ id: z84.string() }),
6028
6073
  headers: DefaultHeaderSchema,
6029
6074
  responses: {
6030
6075
  200: UserSchema,
6031
- 400: z82.object({
6032
- message: z82.string()
6076
+ 400: z84.object({
6077
+ message: z84.string()
6033
6078
  }),
6034
6079
  401: DefaultUnauthorizedSchema
6035
6080
  },
@@ -6038,15 +6083,15 @@ var userContract = initContract31().router(
6038
6083
  updateUser: {
6039
6084
  method: "PATCH",
6040
6085
  path: "/:id",
6041
- pathParams: z82.object({ id: z82.string() }),
6086
+ pathParams: z84.object({ id: z84.string() }),
6042
6087
  headers: DefaultHeaderSchema,
6043
6088
  body: UpdateUserSchema,
6044
6089
  responses: {
6045
6090
  201: DefaultSuccessResponseSchema.extend({
6046
6091
  user: UserSchema
6047
6092
  }),
6048
- 400: z82.object({
6049
- message: z82.string()
6093
+ 400: z84.object({
6094
+ message: z84.string()
6050
6095
  }),
6051
6096
  401: DefaultUnauthorizedSchema,
6052
6097
  404: DefaultNotFoundSchema,
@@ -6058,15 +6103,15 @@ var userContract = initContract31().router(
6058
6103
  updateUserProfile: {
6059
6104
  method: "PATCH",
6060
6105
  path: "/profile/:id",
6061
- pathParams: z82.object({ id: z82.string() }),
6106
+ pathParams: z84.object({ id: z84.string() }),
6062
6107
  headers: DefaultHeaderSchema,
6063
6108
  body: UpdateUserProfileSchema,
6064
6109
  responses: {
6065
6110
  201: DefaultSuccessResponseSchema.extend({
6066
6111
  user: UserSchema
6067
6112
  }),
6068
- 400: z82.object({
6069
- message: z82.string()
6113
+ 400: z84.object({
6114
+ message: z84.string()
6070
6115
  }),
6071
6116
  401: DefaultUnauthorizedSchema,
6072
6117
  404: DefaultNotFoundSchema,
@@ -6078,11 +6123,11 @@ var userContract = initContract31().router(
6078
6123
  deleteUser: {
6079
6124
  method: "DELETE",
6080
6125
  path: "/:id",
6081
- pathParams: z82.object({ id: z82.string() }),
6126
+ pathParams: z84.object({ id: z84.string() }),
6082
6127
  headers: DefaultHeaderSchema,
6083
6128
  body: null,
6084
6129
  responses: {
6085
- 200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
6130
+ 200: DefaultSuccessResponseSchema.extend({ message: z84.string() }),
6086
6131
  404: DefaultNotFoundSchema,
6087
6132
  422: DefaultUnprocessibleSchema,
6088
6133
  500: DefaultErrorResponseSchema
@@ -6095,26 +6140,26 @@ var userContract = initContract31().router(
6095
6140
 
6096
6141
  // src/user-presence-status-log/index.ts
6097
6142
  import { initContract as initContract32 } from "@ts-rest/core";
6098
- import z85 from "zod";
6143
+ import z87 from "zod";
6099
6144
 
6100
6145
  // src/user-presence-status-log/schema.ts
6101
- import z83 from "zod";
6146
+ import z85 from "zod";
6102
6147
  var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
6103
6148
  user: UserSchema,
6104
6149
  previousPresenceStatus: PresenceStatusSchema,
6105
6150
  newPresenceStatus: PresenceStatusSchema,
6106
- reason: z83.string()
6151
+ reason: z85.string()
6107
6152
  });
6108
6153
 
6109
6154
  // 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()
6155
+ import z86 from "zod";
6156
+ var UserPresenceStatusLogParamsSchema = z86.object({
6157
+ page: z86.coerce.number().default(1),
6158
+ pageSize: z86.coerce.number().default(10),
6159
+ selectedDate: z86.string().optional()
6115
6160
  }).optional();
6116
- var UserPresenceStatusLogExportParamsSchema = z84.object({
6117
- selectedDate: z84.string().optional()
6161
+ var UserPresenceStatusLogExportParamsSchema = z86.object({
6162
+ selectedDate: z86.string().optional()
6118
6163
  });
6119
6164
 
6120
6165
  // src/user-presence-status-log/index.ts
@@ -6127,8 +6172,8 @@ var userPresenceStatusLogContract = initContract32().router(
6127
6172
  headers: DefaultHeaderSchema,
6128
6173
  responses: {
6129
6174
  200: WithPagination(UserPresenceStatusLogSchema),
6130
- 400: z85.object({
6131
- message: z85.string()
6175
+ 400: z87.object({
6176
+ message: z87.string()
6132
6177
  }),
6133
6178
  401: DefaultUnauthorizedSchema,
6134
6179
  500: DefaultErrorResponseSchema
@@ -6142,8 +6187,8 @@ var userPresenceStatusLogContract = initContract32().router(
6142
6187
  headers: DefaultHeaderSchema,
6143
6188
  responses: {
6144
6189
  200: null,
6145
- 400: z85.object({
6146
- message: z85.string()
6190
+ 400: z87.object({
6191
+ message: z87.string()
6147
6192
  }),
6148
6193
  401: DefaultUnauthorizedSchema,
6149
6194
  500: DefaultErrorResponseSchema
@@ -6155,44 +6200,44 @@ var userPresenceStatusLogContract = initContract32().router(
6155
6200
 
6156
6201
  // src/widget/index.ts
6157
6202
  import { initContract as initContract33 } from "@ts-rest/core";
6158
- import z88 from "zod";
6203
+ import z90 from "zod";
6159
6204
 
6160
6205
  // 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")
6206
+ import z88 from "zod";
6207
+ var FieldsSchema = z88.object({ data: z88.array(z88.string()) });
6208
+ var WidgetPositionSchema = z88.union([
6209
+ z88.literal("menu"),
6210
+ z88.literal("ticket_detail"),
6211
+ z88.literal("contact_detail")
6167
6212
  ]);
6168
6213
  var WidgetSchema = DefaultEntitySchema.extend({
6169
- name: z86.string(),
6170
- description: z86.string().nullable(),
6214
+ name: z88.string(),
6215
+ description: z88.string().nullable(),
6171
6216
  position: WidgetPositionSchema.nullable(),
6172
6217
  fields: FieldsSchema,
6173
- url: z86.string()
6218
+ url: z88.string()
6174
6219
  });
6175
6220
 
6176
6221
  // 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(),
6222
+ import z89 from "zod";
6223
+ var CreateWidgetSchema = z89.object({
6224
+ name: z89.string(),
6225
+ description: z89.string(),
6226
+ url: z89.string(),
6182
6227
  position: WidgetPositionSchema,
6183
- fields: z87.object({
6228
+ fields: z89.object({
6184
6229
  data: (
6185
6230
  // Array of attribute system names
6186
- z87.array(z87.string())
6231
+ z89.array(z89.string())
6187
6232
  )
6188
6233
  }).optional()
6189
6234
  });
6190
6235
  var UpdateWidgetSchema = CreateWidgetSchema;
6191
- var GetWidgetUrlPathQuerySchema = z87.object({
6192
- widgetId: z87.string(),
6236
+ var GetWidgetUrlPathQuerySchema = z89.object({
6237
+ widgetId: z89.string(),
6193
6238
  // Position ID is ticket ID, contact ID, etc.
6194
6239
  // TODO: The name "Position ID" is confusing. Think of a better name.
6195
- positionId: z87.string()
6240
+ positionId: z89.string()
6196
6241
  });
6197
6242
 
6198
6243
  // src/widget/index.ts
@@ -6207,8 +6252,8 @@ var widgetContract = initContract33().router(
6207
6252
  201: DefaultSuccessResponseSchema.extend({
6208
6253
  widget: WidgetSchema
6209
6254
  }),
6210
- 400: z88.object({
6211
- message: z88.string()
6255
+ 400: z90.object({
6256
+ message: z90.string()
6212
6257
  }),
6213
6258
  401: DefaultUnauthorizedSchema,
6214
6259
  500: DefaultErrorResponseSchema
@@ -6218,17 +6263,17 @@ var widgetContract = initContract33().router(
6218
6263
  getWidgets: {
6219
6264
  method: "GET",
6220
6265
  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()
6266
+ query: z90.object({
6267
+ page: z90.coerce.number().default(1),
6268
+ pageSize: z90.coerce.number().default(10),
6269
+ keyword: z90.coerce.string().optional()
6225
6270
  }).optional(),
6226
6271
  headers: DefaultHeaderSchema,
6227
6272
  responses: {
6228
6273
  200: WithPagination(WidgetSchema),
6229
6274
  500: DefaultErrorResponseSchema,
6230
- 400: z88.object({
6231
- message: z88.string()
6275
+ 400: z90.object({
6276
+ message: z90.string()
6232
6277
  }),
6233
6278
  401: DefaultUnauthorizedSchema
6234
6279
  },
@@ -6239,9 +6284,9 @@ var widgetContract = initContract33().router(
6239
6284
  path: "/menu",
6240
6285
  headers: DefaultHeaderSchema,
6241
6286
  responses: {
6242
- 200: z88.array(WidgetSchema),
6243
- 400: z88.object({
6244
- message: z88.string()
6287
+ 200: z90.array(WidgetSchema),
6288
+ 400: z90.object({
6289
+ message: z90.string()
6245
6290
  }),
6246
6291
  401: DefaultUnauthorizedSchema,
6247
6292
  500: DefaultErrorResponseSchema
@@ -6253,9 +6298,9 @@ var widgetContract = initContract33().router(
6253
6298
  path: "/ticket_detail",
6254
6299
  headers: DefaultHeaderSchema,
6255
6300
  responses: {
6256
- 200: z88.array(WidgetSchema),
6257
- 400: z88.object({
6258
- message: z88.string()
6301
+ 200: z90.array(WidgetSchema),
6302
+ 400: z90.object({
6303
+ message: z90.string()
6259
6304
  }),
6260
6305
  401: DefaultUnauthorizedSchema,
6261
6306
  500: DefaultErrorResponseSchema
@@ -6267,9 +6312,9 @@ var widgetContract = initContract33().router(
6267
6312
  path: "/contact_detail",
6268
6313
  headers: DefaultHeaderSchema,
6269
6314
  responses: {
6270
- 200: z88.array(WidgetSchema),
6271
- 400: z88.object({
6272
- message: z88.string()
6315
+ 200: z90.array(WidgetSchema),
6316
+ 400: z90.object({
6317
+ message: z90.string()
6273
6318
  }),
6274
6319
  401: DefaultUnauthorizedSchema,
6275
6320
  500: DefaultErrorResponseSchema
@@ -6279,12 +6324,12 @@ var widgetContract = initContract33().router(
6279
6324
  getWidgetById: {
6280
6325
  method: "GET",
6281
6326
  path: "/:id",
6282
- pathParams: z88.object({ id: z88.string() }),
6327
+ pathParams: z90.object({ id: z90.string() }),
6283
6328
  headers: DefaultHeaderSchema,
6284
6329
  responses: {
6285
6330
  200: WidgetSchema,
6286
- 400: z88.object({
6287
- message: z88.string()
6331
+ 400: z90.object({
6332
+ message: z90.string()
6288
6333
  }),
6289
6334
  401: DefaultUnauthorizedSchema,
6290
6335
  500: DefaultErrorResponseSchema
@@ -6298,10 +6343,10 @@ var widgetContract = initContract33().router(
6298
6343
  headers: DefaultHeaderSchema,
6299
6344
  responses: {
6300
6345
  201: DefaultSuccessResponseSchema.extend({
6301
- url: z88.string()
6346
+ url: z90.string()
6302
6347
  }),
6303
- 400: z88.object({
6304
- message: z88.string()
6348
+ 400: z90.object({
6349
+ message: z90.string()
6305
6350
  }),
6306
6351
  401: DefaultUnauthorizedSchema
6307
6352
  },
@@ -6310,14 +6355,14 @@ var widgetContract = initContract33().router(
6310
6355
  updateWidget: {
6311
6356
  method: "PATCH",
6312
6357
  path: "/:id",
6313
- pathParams: z88.object({ id: z88.string() }),
6358
+ pathParams: z90.object({ id: z90.string() }),
6314
6359
  headers: DefaultHeaderSchema,
6315
6360
  responses: {
6316
6361
  201: DefaultSuccessResponseSchema.extend({
6317
6362
  widget: WidgetSchema
6318
6363
  }),
6319
- 400: z88.object({
6320
- message: z88.string()
6364
+ 400: z90.object({
6365
+ message: z90.string()
6321
6366
  }),
6322
6367
  401: DefaultUnauthorizedSchema
6323
6368
  },
@@ -6327,11 +6372,11 @@ var widgetContract = initContract33().router(
6327
6372
  deleteWidget: {
6328
6373
  method: "DELETE",
6329
6374
  path: "/:id",
6330
- pathParams: z88.object({ id: z88.string() }),
6375
+ pathParams: z90.object({ id: z90.string() }),
6331
6376
  headers: DefaultHeaderSchema,
6332
6377
  body: null,
6333
6378
  responses: {
6334
- 200: DefaultSuccessResponseSchema.extend({ message: z88.string() }),
6379
+ 200: DefaultSuccessResponseSchema.extend({ message: z90.string() }),
6335
6380
  500: DefaultErrorResponseSchema
6336
6381
  },
6337
6382
  summary: "Delete a widget."
@@ -6342,24 +6387,24 @@ var widgetContract = initContract33().router(
6342
6387
 
6343
6388
  // src/wrap-up-form/index.ts
6344
6389
  import { initContract as initContract34 } from "@ts-rest/core";
6345
- import z90 from "zod";
6390
+ import z92 from "zod";
6346
6391
 
6347
6392
  // 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()
6393
+ import { z as z91 } from "zod";
6394
+ var CreateWrapUpFormSchema = z91.object({
6395
+ note: z91.string().nullable().optional(),
6396
+ disposition: z91.string().nullable().optional(),
6397
+ callFrom: z91.string().nullable().optional(),
6398
+ callTo: z91.string().nullable().optional()
6354
6399
  });
6355
6400
  var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
6356
- tags: z89.array(z89.string()).optional()
6401
+ tags: z91.array(z91.string()).optional()
6357
6402
  });
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()
6403
+ var CreateCXLogWrapUpFormSchema = z91.object({
6404
+ cxLogId: z91.string().uuid(),
6405
+ disposition: z91.string().optional(),
6406
+ tagIds: z91.array(z91.string().uuid()).optional(),
6407
+ note: z91.string().optional()
6363
6408
  });
6364
6409
 
6365
6410
  // src/wrap-up-form/index.ts
@@ -6374,8 +6419,8 @@ var wrapUpFormContract = initContract34().router(
6374
6419
  201: DefaultSuccessResponseSchema.extend({
6375
6420
  wrapUpForm: WrapUpFormSchema
6376
6421
  }),
6377
- 400: z90.object({
6378
- message: z90.string()
6422
+ 400: z92.object({
6423
+ message: z92.string()
6379
6424
  }),
6380
6425
  401: DefaultUnauthorizedSchema,
6381
6426
  500: DefaultErrorResponseSchema
@@ -6397,15 +6442,15 @@ var wrapUpFormContract = initContract34().router(
6397
6442
  getWrapUpForms: {
6398
6443
  method: "GET",
6399
6444
  path: "",
6400
- query: z90.object({
6401
- page: z90.coerce.number().default(1),
6402
- pageSize: z90.coerce.number().default(10)
6445
+ query: z92.object({
6446
+ page: z92.coerce.number().default(1),
6447
+ pageSize: z92.coerce.number().default(10)
6403
6448
  }).optional(),
6404
6449
  headers: DefaultHeaderSchema,
6405
6450
  responses: {
6406
6451
  200: WithPagination(WrapUpFormSchema),
6407
- 400: z90.object({
6408
- message: z90.string()
6452
+ 400: z92.object({
6453
+ message: z92.string()
6409
6454
  }),
6410
6455
  401: DefaultUnauthorizedSchema,
6411
6456
  500: DefaultErrorResponseSchema
@@ -6415,15 +6460,15 @@ var wrapUpFormContract = initContract34().router(
6415
6460
  updateWrapUpForm: {
6416
6461
  method: "PATCH",
6417
6462
  path: "/:id",
6418
- pathParams: z90.object({ id: z90.string() }),
6463
+ pathParams: z92.object({ id: z92.string() }),
6419
6464
  headers: DefaultHeaderSchema,
6420
6465
  body: UpdateWrapUpFormSchema,
6421
6466
  responses: {
6422
6467
  201: DefaultSuccessResponseSchema.extend({
6423
6468
  wrapUpForm: WrapUpFormSchema
6424
6469
  }),
6425
- 400: z90.object({
6426
- message: z90.string()
6470
+ 400: z92.object({
6471
+ message: z92.string()
6427
6472
  }),
6428
6473
  401: DefaultUnauthorizedSchema,
6429
6474
  500: DefaultErrorResponseSchema
@@ -6436,28 +6481,28 @@ var wrapUpFormContract = initContract34().router(
6436
6481
 
6437
6482
  // src/upload/index.ts
6438
6483
  import { initContract as initContract35 } from "@ts-rest/core";
6439
- import z91 from "zod";
6484
+ import z93 from "zod";
6440
6485
  var uploadContract = initContract35().router(
6441
6486
  {
6442
6487
  rename: {
6443
6488
  method: "POST",
6444
6489
  path: "/:id/rename",
6445
- pathParams: z91.object({
6446
- id: z91.string()
6490
+ pathParams: z93.object({
6491
+ id: z93.string()
6447
6492
  }),
6448
6493
  headers: DefaultHeaderSchema,
6449
6494
  responses: {
6450
6495
  201: DefaultSuccessResponseSchema.extend({
6451
- message: z91.string()
6496
+ message: z93.string()
6452
6497
  }),
6453
- 400: z91.object({
6454
- message: z91.string()
6498
+ 400: z93.object({
6499
+ message: z93.string()
6455
6500
  }),
6456
- 409: z91.object({
6457
- message: z91.string()
6501
+ 409: z93.object({
6502
+ message: z93.string()
6458
6503
  }),
6459
- 500: z91.object({
6460
- message: z91.string()
6504
+ 500: z93.object({
6505
+ message: z93.string()
6461
6506
  }),
6462
6507
  401: DefaultUnauthorizedSchema,
6463
6508
  404: DefaultNotFoundSchema,
@@ -6469,23 +6514,23 @@ var uploadContract = initContract35().router(
6469
6514
  delete: {
6470
6515
  method: "DELETE",
6471
6516
  path: "/:id",
6472
- pathParams: z91.object({
6473
- id: z91.string()
6517
+ pathParams: z93.object({
6518
+ id: z93.string()
6474
6519
  }),
6475
6520
  headers: DefaultHeaderSchema,
6476
6521
  body: null,
6477
6522
  responses: {
6478
6523
  201: DefaultSuccessResponseSchema.extend({
6479
- message: z91.string()
6524
+ message: z93.string()
6480
6525
  }),
6481
- 400: z91.object({
6482
- message: z91.string()
6526
+ 400: z93.object({
6527
+ message: z93.string()
6483
6528
  }),
6484
- 409: z91.object({
6485
- message: z91.string()
6529
+ 409: z93.object({
6530
+ message: z93.string()
6486
6531
  }),
6487
- 500: z91.object({
6488
- message: z91.string()
6532
+ 500: z93.object({
6533
+ message: z93.string()
6489
6534
  }),
6490
6535
  401: DefaultUnauthorizedSchema,
6491
6536
  404: DefaultNotFoundSchema,
@@ -6500,19 +6545,19 @@ var uploadContract = initContract35().router(
6500
6545
  );
6501
6546
 
6502
6547
  // src/viber/index.ts
6503
- import z93 from "zod";
6548
+ import z95 from "zod";
6504
6549
 
6505
6550
  // 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()
6551
+ import z94 from "zod";
6552
+ var ViberChannelSchema = z94.object({
6553
+ name: z94.string(),
6554
+ accessToken: z94.string(),
6555
+ actor: z94.object({
6556
+ id: z94.string().uuid(),
6557
+ name: z94.string(),
6558
+ email: z94.string().email(),
6559
+ address: z94.string().nullable(),
6560
+ phone: z94.string().nullable()
6516
6561
  }).optional()
6517
6562
  });
6518
6563
 
@@ -6541,8 +6586,8 @@ var viberContract = initContract36().router({
6541
6586
  }),
6542
6587
  400: DefaultErrorResponseSchema
6543
6588
  },
6544
- body: z93.object({
6545
- id: z93.string().uuid()
6589
+ body: z95.object({
6590
+ id: z95.string().uuid()
6546
6591
  }),
6547
6592
  summary: "Connect viber channel"
6548
6593
  },
@@ -6558,8 +6603,8 @@ var viberContract = initContract36().router({
6558
6603
  reconnect: {
6559
6604
  method: "POST",
6560
6605
  path: "/reconnect/:channelId",
6561
- pathParams: z93.object({
6562
- channelId: z93.string().uuid()
6606
+ pathParams: z95.object({
6607
+ channelId: z95.string().uuid()
6563
6608
  }),
6564
6609
  responses: {
6565
6610
  200: DefaultSuccessResponseSchema.extend({
@@ -6574,8 +6619,8 @@ var viberContract = initContract36().router({
6574
6619
  delete: {
6575
6620
  method: "DELETE",
6576
6621
  path: "/delete/:channelId",
6577
- pathParams: z93.object({
6578
- channelId: z93.string().uuid()
6622
+ pathParams: z95.object({
6623
+ channelId: z95.string().uuid()
6579
6624
  }),
6580
6625
  body: null,
6581
6626
  responses: {
@@ -6588,58 +6633,58 @@ var viberContract = initContract36().router({
6588
6633
 
6589
6634
  // src/notification/index.ts
6590
6635
  import { initContract as initContract37 } from "@ts-rest/core";
6591
- import z96 from "zod";
6636
+ import z98 from "zod";
6592
6637
 
6593
6638
  // src/notification/validation.ts
6594
- import z95 from "zod";
6639
+ import z97 from "zod";
6595
6640
 
6596
6641
  // 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(),
6642
+ import z96 from "zod";
6643
+ var NotificationChangeSchema = z96.object({
6644
+ id: z96.string().uuid(),
6645
+ createdAt: z96.date(),
6646
+ updatedAt: z96.date(),
6647
+ deletedAt: z96.date().nullable(),
6648
+ actorId: z96.string().uuid(),
6604
6649
  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(),
6650
+ notificationObjectId: z96.string().uuid(),
6651
+ readAt: z96.date()
6652
+ });
6653
+ var NotificationObjectSchema = z96.object({
6654
+ id: z96.string().uuid(),
6655
+ createdAt: z96.date(),
6656
+ updatedAt: z96.date(),
6657
+ deletedAt: z96.date().nullable(),
6658
+ data: z96.string(),
6614
6659
  notificationChange: NotificationChangeSchema
6615
6660
  });
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(),
6661
+ var NotificationSchema = z96.object({
6662
+ id: z96.string().uuid(),
6663
+ createdAt: z96.date(),
6664
+ updatedAt: z96.date(),
6665
+ deletedAt: z96.date().nullable(),
6666
+ notificationObjectId: z96.string().uuid(),
6667
+ notifierId: z96.string().uuid(),
6623
6668
  notificationObject: NotificationObjectSchema,
6624
- readAt: z94.date()
6669
+ readAt: z96.date()
6625
6670
  });
6626
6671
 
6627
6672
  // src/notification/validation.ts
6628
- var GetNotificationsRequestSchema = z95.object({
6629
- page: z95.coerce.number().default(1),
6630
- pageSize: z95.coerce.number().default(10)
6673
+ var GetNotificationsRequestSchema = z97.object({
6674
+ page: z97.coerce.number().default(1),
6675
+ pageSize: z97.coerce.number().default(10)
6631
6676
  });
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()
6677
+ var GetNotificationsResponseSchema = z97.object({
6678
+ notificationCount: z97.number(),
6679
+ notifications: z97.array(NotificationSchema),
6680
+ total: z97.number(),
6681
+ page: z97.number(),
6682
+ pageSize: z97.number(),
6683
+ lastPage: z97.number(),
6684
+ totalUnreadCount: z97.number().optional()
6640
6685
  });
6641
- var ResetNotificationRequestSchema = z95.object({
6642
- userId: z95.string()
6686
+ var ResetNotificationRequestSchema = z97.object({
6687
+ userId: z97.string()
6643
6688
  });
6644
6689
 
6645
6690
  // src/notification/index.ts
@@ -6653,14 +6698,14 @@ var userNotificationContract = initContract37().router(
6653
6698
  200: DefaultSuccessResponseSchema.extend({
6654
6699
  data: GetNotificationsResponseSchema
6655
6700
  }),
6656
- 400: z96.object({
6657
- message: z96.string()
6701
+ 400: z98.object({
6702
+ message: z98.string()
6658
6703
  }),
6659
- 409: z96.object({
6660
- message: z96.string()
6704
+ 409: z98.object({
6705
+ message: z98.string()
6661
6706
  }),
6662
- 500: z96.object({
6663
- message: z96.string()
6707
+ 500: z98.object({
6708
+ message: z98.string()
6664
6709
  }),
6665
6710
  401: DefaultUnauthorizedSchema,
6666
6711
  404: DefaultNotFoundSchema,
@@ -6673,16 +6718,16 @@ var userNotificationContract = initContract37().router(
6673
6718
  path: "/new_notifications_count",
6674
6719
  responses: {
6675
6720
  200: DefaultSuccessResponseSchema.extend({
6676
- total: z96.number()
6721
+ total: z98.number()
6677
6722
  }),
6678
- 400: z96.object({
6679
- message: z96.string()
6723
+ 400: z98.object({
6724
+ message: z98.string()
6680
6725
  }),
6681
- 409: z96.object({
6682
- message: z96.string()
6726
+ 409: z98.object({
6727
+ message: z98.string()
6683
6728
  }),
6684
- 500: z96.object({
6685
- message: z96.string()
6729
+ 500: z98.object({
6730
+ message: z98.string()
6686
6731
  }),
6687
6732
  401: DefaultUnauthorizedSchema,
6688
6733
  404: DefaultNotFoundSchema,
@@ -6697,14 +6742,14 @@ var userNotificationContract = initContract37().router(
6697
6742
  201: DefaultSuccessResponseSchema.extend({
6698
6743
  data: UserSchema
6699
6744
  }),
6700
- 400: z96.object({
6701
- message: z96.string()
6745
+ 400: z98.object({
6746
+ message: z98.string()
6702
6747
  }),
6703
- 409: z96.object({
6704
- message: z96.string()
6748
+ 409: z98.object({
6749
+ message: z98.string()
6705
6750
  }),
6706
- 500: z96.object({
6707
- message: z96.string()
6751
+ 500: z98.object({
6752
+ message: z98.string()
6708
6753
  }),
6709
6754
  401: DefaultUnauthorizedSchema,
6710
6755
  404: DefaultNotFoundSchema,
@@ -6716,19 +6761,19 @@ var userNotificationContract = initContract37().router(
6716
6761
  readNotification: {
6717
6762
  method: "POST",
6718
6763
  path: "/read/:id",
6719
- pathParams: z96.object({ id: z96.string() }),
6764
+ pathParams: z98.object({ id: z98.string() }),
6720
6765
  responses: {
6721
6766
  201: DefaultSuccessResponseSchema.extend({
6722
6767
  data: NotificationSchema
6723
6768
  }),
6724
- 400: z96.object({
6725
- message: z96.string()
6769
+ 400: z98.object({
6770
+ message: z98.string()
6726
6771
  }),
6727
- 409: z96.object({
6728
- message: z96.string()
6772
+ 409: z98.object({
6773
+ message: z98.string()
6729
6774
  }),
6730
- 500: z96.object({
6731
- message: z96.string()
6775
+ 500: z98.object({
6776
+ message: z98.string()
6732
6777
  }),
6733
6778
  401: DefaultUnauthorizedSchema,
6734
6779
  404: DefaultNotFoundSchema,
@@ -6810,6 +6855,7 @@ export {
6810
6855
  dashboardContract,
6811
6856
  evaluateFormContract,
6812
6857
  extensionContract2 as extensionContract,
6858
+ mailContract,
6813
6859
  mainChatContract,
6814
6860
  notificationContract,
6815
6861
  permissionContract,