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