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