@kl1/contracts 1.2.62-uat → 1.2.64-uat
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api-contracts/src/channel/index.d.ts +2978 -2776
- package/dist/api-contracts/src/channel/index.d.ts.map +1 -1
- package/dist/api-contracts/src/channel/schema.d.ts +8 -0
- package/dist/api-contracts/src/channel/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/channel/validation.d.ts +10 -10
- package/dist/api-contracts/src/channel/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/index.d.ts +515 -189
- package/dist/api-contracts/src/chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/schema.d.ts +124 -45
- package/dist/api-contracts/src/chat/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/validation.d.ts +151 -72
- package/dist/api-contracts/src/chat/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +5410 -4317
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/cx-log/index.d.ts +11 -0
- package/dist/api-contracts/src/cx-log/index.d.ts.map +1 -1
- package/dist/api-contracts/src/cx-log/schema.d.ts +9 -0
- package/dist/api-contracts/src/cx-log/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/dashboard/index.d.ts +290 -1
- package/dist/api-contracts/src/dashboard/index.d.ts.map +1 -1
- package/dist/api-contracts/src/dashboard/schema.d.ts +71 -0
- package/dist/api-contracts/src/dashboard/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/facebook-feed/index.d.ts +165 -43
- package/dist/api-contracts/src/facebook-feed/index.d.ts.map +1 -1
- package/dist/api-contracts/src/facebook-feed/schema.d.ts +10 -3
- package/dist/api-contracts/src/facebook-feed/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/facebook-feed/validation.d.ts +5 -0
- package/dist/api-contracts/src/facebook-feed/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/instagram/index.d.ts +132 -33
- package/dist/api-contracts/src/instagram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/line/index.d.ts +131 -40
- package/dist/api-contracts/src/line/index.d.ts.map +1 -1
- package/dist/api-contracts/src/line/validation.d.ts +14 -5
- package/dist/api-contracts/src/line/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/messenger/index.d.ts +132 -33
- package/dist/api-contracts/src/messenger/index.d.ts.map +1 -1
- package/dist/api-contracts/src/messenger/validation.d.ts +5 -0
- package/dist/api-contracts/src/messenger/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/presence-status/index.d.ts +74 -50
- package/dist/api-contracts/src/presence-status/index.d.ts.map +1 -1
- package/dist/api-contracts/src/presence-status/schema.d.ts +11 -8
- package/dist/api-contracts/src/presence-status/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/presence-status/validation.d.ts +18 -12
- package/dist/api-contracts/src/presence-status/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/sms/index.d.ts +42 -5
- package/dist/api-contracts/src/sms/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telegram/index.d.ts +110 -33
- package/dist/api-contracts/src/telegram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-agent-presence-status/index.d.ts +36 -439
- package/dist/api-contracts/src/telephony-agent-presence-status/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-agent-presence-status/schema.d.ts +15 -13
- package/dist/api-contracts/src/telephony-agent-presence-status/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-agent-presence-status/validation.d.ts +0 -3
- package/dist/api-contracts/src/telephony-agent-presence-status/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/user-presence-status-log/index.d.ts +24 -16
- package/dist/api-contracts/src/user-presence-status-log/index.d.ts.map +1 -1
- package/dist/api-contracts/src/user-presence-status-log/schema.d.ts +30 -20
- package/dist/api-contracts/src/user-presence-status-log/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/viber/index.d.ts +110 -33
- package/dist/api-contracts/src/viber/index.d.ts.map +1 -1
- package/dist/api-contracts/src/webchat/index.d.ts +110 -33
- package/dist/api-contracts/src/webchat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/whatsapp/index.d.ts +167 -39
- package/dist/api-contracts/src/whatsapp/index.d.ts.map +1 -1
- package/dist/api-contracts/src/whatsapp/validation.d.ts +3 -3
- package/dist/api-contracts/src/workflow-rule/index.d.ts +58 -12
- package/dist/api-contracts/src/workflow-rule/index.d.ts.map +1 -1
- package/dist/entities/src/enums/chat.d.ts +12 -0
- package/dist/entities/src/enums/chat.d.ts.map +1 -1
- package/dist/index.js +1617 -1535
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1617 -1535
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -195,7 +195,8 @@ var ChannelMetadataSchema = z6.object({
|
|
195
195
|
}).optional(),
|
196
196
|
lineRichMenuId: z6.string().optional().nullable(),
|
197
197
|
messengerIntegrationType: z6.union([z6.literal("own"), z6.literal("business")]).optional(),
|
198
|
-
facebookFeedIntegrationType: z6.union([z6.literal("own"), z6.literal("business")]).optional()
|
198
|
+
facebookFeedIntegrationType: z6.union([z6.literal("own"), z6.literal("business")]).optional(),
|
199
|
+
isCSATEnabled: z6.boolean().optional()
|
199
200
|
});
|
200
201
|
var ChannelSchema = z6.object({
|
201
202
|
id: z6.string().uuid(),
|
@@ -627,6 +628,7 @@ var MessageTypeSchema = z18.enum([
|
|
627
628
|
"choice",
|
628
629
|
"dropdown",
|
629
630
|
// system
|
631
|
+
"csat",
|
630
632
|
"assign",
|
631
633
|
"solve",
|
632
634
|
"resolved",
|
@@ -682,6 +684,7 @@ var RoomSchema = DefaultEntitySchema.extend({
|
|
682
684
|
isBotRoom: z18.boolean(),
|
683
685
|
direction: MessageDirectionTypeSchema,
|
684
686
|
platformContact: PlatformContactSchema,
|
687
|
+
csatStatus: z18.string().nullable(),
|
685
688
|
actor: z18.object({
|
686
689
|
id: z18.string().uuid(),
|
687
690
|
createdAt: z18.date(),
|
@@ -1214,9 +1217,7 @@ var MessageAttachmentSchema = z26.object({
|
|
1214
1217
|
fileSize: z26.number(),
|
1215
1218
|
url: z26.string().nullable(),
|
1216
1219
|
fileType: z26.string(),
|
1217
|
-
thumbnailUrl: z26.string().optional()
|
1218
|
-
width: z26.string().optional(),
|
1219
|
-
height: z26.string().optional()
|
1220
|
+
thumbnailUrl: z26.string().optional()
|
1220
1221
|
});
|
1221
1222
|
var StickerSchema = z26.object({
|
1222
1223
|
packageId: z26.number(),
|
@@ -2175,10 +2176,6 @@ var ConnectWhatsappSchema = z37.object({
|
|
2175
2176
|
metadata: ChannelMetadataSchema,
|
2176
2177
|
platformId: z37.string()
|
2177
2178
|
});
|
2178
|
-
var ConnectLazadaSchema = z37.object({
|
2179
|
-
name: z37.string(),
|
2180
|
-
code: z37.string()
|
2181
|
-
});
|
2182
2179
|
|
2183
2180
|
// src/instagram/validation.ts
|
2184
2181
|
import z38 from "zod";
|
@@ -2264,7 +2261,7 @@ var WaapiQrResponseSchema = DefaultSuccessResponseSchema.extend({
|
|
2264
2261
|
data: WaapiQrSchema
|
2265
2262
|
});
|
2266
2263
|
var GetWaapiQrQuerySchema = z40.object({
|
2267
|
-
|
2264
|
+
instanceId: z40.string()
|
2268
2265
|
});
|
2269
2266
|
var SendSeenToWaapiSchema = z40.object({
|
2270
2267
|
channelId: z40.string().uuid(),
|
@@ -2462,7 +2459,7 @@ var whatsapp = initContract7().router(
|
|
2462
2459
|
},
|
2463
2460
|
createWaapi: {
|
2464
2461
|
method: "POST",
|
2465
|
-
path: "/
|
2462
|
+
path: "/mobile",
|
2466
2463
|
body: null,
|
2467
2464
|
responses: {
|
2468
2465
|
200: WaapiResponseSchema,
|
@@ -2472,36 +2469,30 @@ var whatsapp = initContract7().router(
|
|
2472
2469
|
},
|
2473
2470
|
getWaapiQr: {
|
2474
2471
|
method: "GET",
|
2475
|
-
path: "/
|
2472
|
+
path: "/mobile/qr",
|
2476
2473
|
query: GetWaapiQrQuerySchema,
|
2477
2474
|
responses: {
|
2478
2475
|
200: WaapiQrResponseSchema,
|
2479
2476
|
500: DefaultErrorResponseSchema,
|
2480
2477
|
400: DefaultErrorResponseSchema
|
2481
2478
|
}
|
2482
|
-
}
|
2483
|
-
|
2484
|
-
|
2485
|
-
|
2486
|
-
|
2487
|
-
)
|
2488
|
-
|
2489
|
-
|
2490
|
-
connect: {
|
2491
|
-
method: "POST",
|
2492
|
-
path: "/connect",
|
2479
|
+
},
|
2480
|
+
deleteWaapi: {
|
2481
|
+
method: "DELETE",
|
2482
|
+
path: "/mobile/:instanceId",
|
2483
|
+
pathParams: z41.object({
|
2484
|
+
instanceId: z41.string()
|
2485
|
+
}),
|
2486
|
+
body: z41.any().optional(),
|
2493
2487
|
responses: {
|
2494
|
-
200: DefaultSuccessResponseSchema
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2498
|
-
},
|
2499
|
-
body: ConnectLazadaSchema,
|
2500
|
-
summary: "Connect message channel"
|
2488
|
+
200: DefaultSuccessResponseSchema,
|
2489
|
+
500: DefaultErrorResponseSchema,
|
2490
|
+
400: DefaultErrorResponseSchema
|
2491
|
+
}
|
2501
2492
|
}
|
2502
2493
|
},
|
2503
2494
|
{
|
2504
|
-
pathPrefix: "/
|
2495
|
+
pathPrefix: "/whatsapp"
|
2505
2496
|
}
|
2506
2497
|
);
|
2507
2498
|
var channelContract = initContract7().router(
|
@@ -2617,14 +2608,30 @@ var channelContract = initContract7().router(
|
|
2617
2608
|
}),
|
2618
2609
|
summary: "Update new tenant"
|
2619
2610
|
},
|
2611
|
+
updateChannelCsatPreference: {
|
2612
|
+
method: "POST",
|
2613
|
+
path: "/csat/:channelId",
|
2614
|
+
pathParams: z41.object({
|
2615
|
+
channelId: z41.string().uuid()
|
2616
|
+
}),
|
2617
|
+
responses: {
|
2618
|
+
200: DefaultSuccessResponseSchema.extend({
|
2619
|
+
channel: ChannelSchema
|
2620
|
+
}),
|
2621
|
+
408: DefaultErrorResponseSchema
|
2622
|
+
},
|
2623
|
+
body: z41.object({
|
2624
|
+
isCSATEnabled: z41.boolean()
|
2625
|
+
}),
|
2626
|
+
summary: "Enable or Disable CSAT for channel"
|
2627
|
+
},
|
2620
2628
|
messenger,
|
2621
2629
|
line,
|
2622
2630
|
instagram,
|
2623
2631
|
viber,
|
2624
2632
|
telegram,
|
2625
2633
|
webchat,
|
2626
|
-
whatsapp
|
2627
|
-
lazada
|
2634
|
+
whatsapp
|
2628
2635
|
},
|
2629
2636
|
{
|
2630
2637
|
baseHeaders: DefaultHeaderSchema,
|
@@ -4298,23 +4305,27 @@ var MessageStatusSchema = z54.object({
|
|
4298
4305
|
total: z54.number().nullable(),
|
4299
4306
|
closed: z54.number().nullable(),
|
4300
4307
|
unassignedOpen: z54.number().nullable(),
|
4301
|
-
assignedOpen: z54.number().nullable()
|
4308
|
+
assignedOpen: z54.number().nullable(),
|
4309
|
+
hold: z54.number()
|
4302
4310
|
});
|
4303
4311
|
var MessageAverageSchema = z54.object({
|
4304
4312
|
selectedWeekAvgByDay: z54.array(
|
4305
4313
|
z54.object({
|
4306
4314
|
day: z54.string().nullable(),
|
4307
4315
|
avgResolutionTime: z54.string().nullable(),
|
4308
|
-
avgResponseTime: z54.string().nullable()
|
4316
|
+
avgResponseTime: z54.string().nullable(),
|
4317
|
+
resolutionRate: z54.string()
|
4309
4318
|
})
|
4310
4319
|
).optional().nullable(),
|
4311
4320
|
previousWeekAvg: z54.object({
|
4312
4321
|
avgResolutionTime: z54.string().nullable(),
|
4313
|
-
avgResponseTime: z54.string().nullable()
|
4322
|
+
avgResponseTime: z54.string().nullable(),
|
4323
|
+
resolutionRate: z54.string()
|
4314
4324
|
}).nullable().optional(),
|
4315
4325
|
selectedWeekAvg: z54.object({
|
4316
4326
|
avgResolutionTime: z54.string().nullable(),
|
4317
|
-
avgResponseTime: z54.string().nullable()
|
4327
|
+
avgResponseTime: z54.string().nullable(),
|
4328
|
+
resolutionRate: z54.string()
|
4318
4329
|
}).nullable().optional()
|
4319
4330
|
});
|
4320
4331
|
var ChannelIncomingMessageSchema = z54.object({
|
@@ -4343,6 +4354,25 @@ var CallCountsSchema = z54.object({
|
|
4343
4354
|
failedCallCount: z54.number().gte(0),
|
4344
4355
|
totalCallCount: z54.number().gte(0)
|
4345
4356
|
});
|
4357
|
+
var MessageQueueDataSchema = z54.object({
|
4358
|
+
id: z54.string().uuid().nullable(),
|
4359
|
+
name: z54.string(),
|
4360
|
+
sla: z54.number(),
|
4361
|
+
newContactCount: z54.number(),
|
4362
|
+
existingContactCount: z54.number(),
|
4363
|
+
totalRoomCount: z54.number(),
|
4364
|
+
closedRoomCount: z54.number(),
|
4365
|
+
unassignedRoomCount: z54.number(),
|
4366
|
+
assignedRoomCount: z54.number(),
|
4367
|
+
holdRoomCount: z54.number()
|
4368
|
+
});
|
4369
|
+
var AgentMessageStatisticsSchema = z54.object({
|
4370
|
+
id: z54.string().uuid(),
|
4371
|
+
name: z54.string(),
|
4372
|
+
openedRoomCount: z54.number(),
|
4373
|
+
holdRoomCount: z54.number(),
|
4374
|
+
closedRoomCount: z54.number()
|
4375
|
+
});
|
4346
4376
|
|
4347
4377
|
// src/dashboard/index.ts
|
4348
4378
|
var dashboardContract = initContract13().router(
|
@@ -4601,6 +4631,62 @@ var dashboardContract = initContract13().router(
|
|
4601
4631
|
callCounts: CallCountsSchema
|
4602
4632
|
})
|
4603
4633
|
}
|
4634
|
+
},
|
4635
|
+
getAllQueueSLA: {
|
4636
|
+
method: "GET",
|
4637
|
+
path: "/all-queue-sla",
|
4638
|
+
query: z55.object({ selectedDate: z55.string().min(1) }),
|
4639
|
+
responses: {
|
4640
|
+
200: DefaultSuccessResponseSchema.extend({
|
4641
|
+
allQueueSLA: z55.number()
|
4642
|
+
})
|
4643
|
+
}
|
4644
|
+
},
|
4645
|
+
getAllMessageQueueData: {
|
4646
|
+
method: "GET",
|
4647
|
+
path: "/all-message-queue-data",
|
4648
|
+
query: z55.object({
|
4649
|
+
selectedDate: z55.string().min(1),
|
4650
|
+
page: z55.coerce.number().positive(),
|
4651
|
+
pageSize: z55.coerce.number().positive()
|
4652
|
+
}),
|
4653
|
+
responses: {
|
4654
|
+
200: DefaultSuccessResponseSchema.extend({
|
4655
|
+
allMessageQueueData: z55.array(MessageQueueDataSchema)
|
4656
|
+
})
|
4657
|
+
}
|
4658
|
+
},
|
4659
|
+
getMessageQueueData: {
|
4660
|
+
method: "GET",
|
4661
|
+
path: "/message-queue-data",
|
4662
|
+
query: z55.object({
|
4663
|
+
automationQueueId: z55.string().uuid().optional(),
|
4664
|
+
selectedDate: z55.string().min(1),
|
4665
|
+
channelIds: z55.array(z55.string().uuid()).optional()
|
4666
|
+
}),
|
4667
|
+
responses: {
|
4668
|
+
200: DefaultSuccessResponseSchema.extend({
|
4669
|
+
messageQueueData: MessageQueueDataSchema
|
4670
|
+
})
|
4671
|
+
}
|
4672
|
+
},
|
4673
|
+
getAgentMessageStatistics: {
|
4674
|
+
method: "GET",
|
4675
|
+
path: "/agent-message-statistics",
|
4676
|
+
query: z55.object({
|
4677
|
+
automationQueueId: z55.string().uuid().optional(),
|
4678
|
+
selectedDate: z55.string().min(1),
|
4679
|
+
channelIds: z55.array(z55.string().uuid()).optional(),
|
4680
|
+
page: z55.coerce.number().positive(),
|
4681
|
+
pageSize: z55.coerce.number().positive()
|
4682
|
+
}),
|
4683
|
+
responses: {
|
4684
|
+
200: DefaultSuccessResponseSchema.extend({
|
4685
|
+
page: z55.coerce.number().positive(),
|
4686
|
+
pageSize: z55.coerce.number().positive(),
|
4687
|
+
agentMessageStatistics: z55.array(AgentMessageStatisticsSchema)
|
4688
|
+
})
|
4689
|
+
}
|
4604
4690
|
}
|
4605
4691
|
},
|
4606
4692
|
{
|
@@ -5017,7 +5103,7 @@ var lineContract = initContract17().router({
|
|
5017
5103
|
path: "/message",
|
5018
5104
|
body: SendMessageToPlatformSchema,
|
5019
5105
|
responses: {
|
5020
|
-
200: SendMessageResponseSchema,
|
5106
|
+
200: z63.union([SendMessageResponseSchema, z63.literal("TALK TO AGENT")]),
|
5021
5107
|
500: DefaultErrorResponseSchema
|
5022
5108
|
}
|
5023
5109
|
},
|
@@ -5402,70 +5488,52 @@ var tagContract = initContract22().router(
|
|
5402
5488
|
|
5403
5489
|
// src/telephony-agent-presence-status/index.ts
|
5404
5490
|
import { initContract as initContract23 } from "@ts-rest/core";
|
5405
|
-
import
|
5406
|
-
|
5407
|
-
// src/telephony-agent-presence-status/schema.ts
|
5408
|
-
import z72 from "zod";
|
5491
|
+
import z73 from "zod";
|
5409
5492
|
|
5410
5493
|
// src/presence-status/schema.ts
|
5411
5494
|
import z71 from "zod";
|
5412
|
-
var
|
5413
|
-
"
|
5414
|
-
"
|
5415
|
-
|
5495
|
+
var PresenceStatusEnum = z71.enum([
|
5496
|
+
"receive_call_noti",
|
5497
|
+
"do_not_receive_call_noti",
|
5498
|
+
"default"
|
5416
5499
|
]);
|
5417
5500
|
var PresenceStatusSchema = z71.object({
|
5418
5501
|
id: z71.string().uuid(),
|
5419
5502
|
createdAt: z71.date(),
|
5420
5503
|
updatedAt: z71.date(),
|
5421
5504
|
deletedAt: z71.date().nullable(),
|
5422
|
-
|
5423
|
-
|
5424
|
-
position: z71.number()
|
5505
|
+
systemName: PresenceStatusEnum,
|
5506
|
+
displayName: z71.string(),
|
5507
|
+
position: z71.number(),
|
5508
|
+
emoji: z71.string()
|
5425
5509
|
});
|
5426
5510
|
|
5427
5511
|
// src/telephony-agent-presence-status/schema.ts
|
5428
5512
|
var UserPresenceStatusSchema = DefaultEntitySchema.extend({
|
5429
5513
|
user: UserSchema,
|
5430
|
-
presenceStatus: PresenceStatusSchema
|
5431
|
-
customPresenceStatus: z72.string().nullable().optional()
|
5514
|
+
presenceStatus: PresenceStatusSchema
|
5432
5515
|
});
|
5433
5516
|
|
5434
5517
|
// src/telephony-agent-presence-status/validation.ts
|
5435
|
-
import { z as
|
5436
|
-
var UpdateUserStatusSchema =
|
5437
|
-
userId:
|
5438
|
-
presenceStatusId:
|
5439
|
-
|
5440
|
-
reason: z73.string()
|
5518
|
+
import { z as z72 } from "zod";
|
5519
|
+
var UpdateUserStatusSchema = z72.object({
|
5520
|
+
userId: z72.string(),
|
5521
|
+
presenceStatusId: z72.string().nullable().optional(),
|
5522
|
+
reason: z72.string()
|
5441
5523
|
});
|
5442
5524
|
|
5443
5525
|
// src/telephony-agent-presence-status/index.ts
|
5444
5526
|
var telephonyAgentPresenceStatusContract = initContract23().router(
|
5445
5527
|
{
|
5446
|
-
getAllAgentStatus: {
|
5447
|
-
method: "GET",
|
5448
|
-
path: "/agents/presence_status",
|
5449
|
-
headers: DefaultHeaderSchema,
|
5450
|
-
responses: {
|
5451
|
-
200: z74.array(UserPresenceStatusSchema),
|
5452
|
-
400: z74.object({
|
5453
|
-
message: z74.string()
|
5454
|
-
}),
|
5455
|
-
401: DefaultUnauthorizedSchema,
|
5456
|
-
500: DefaultErrorResponseSchema
|
5457
|
-
},
|
5458
|
-
summary: "Get all user presence status list."
|
5459
|
-
},
|
5460
5528
|
getAgentStatus: {
|
5461
5529
|
method: "GET",
|
5462
5530
|
path: "/presence_status/check_update/:userId",
|
5463
|
-
pathParams:
|
5531
|
+
pathParams: z73.object({ userId: z73.string() }),
|
5464
5532
|
headers: DefaultHeaderSchema,
|
5465
5533
|
responses: {
|
5466
5534
|
200: UserPresenceStatusSchema,
|
5467
|
-
400:
|
5468
|
-
message:
|
5535
|
+
400: z73.object({
|
5536
|
+
message: z73.string()
|
5469
5537
|
}),
|
5470
5538
|
401: DefaultUnauthorizedSchema,
|
5471
5539
|
500: DefaultErrorResponseSchema
|
@@ -5481,8 +5549,8 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5481
5549
|
200: DefaultSuccessResponseSchema.extend({
|
5482
5550
|
userPresenceStatu: UserPresenceStatusSchema
|
5483
5551
|
}),
|
5484
|
-
400:
|
5485
|
-
message:
|
5552
|
+
400: z73.object({
|
5553
|
+
message: z73.string()
|
5486
5554
|
}),
|
5487
5555
|
401: DefaultUnauthorizedSchema,
|
5488
5556
|
500: DefaultErrorResponseSchema
|
@@ -5494,65 +5562,65 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5494
5562
|
);
|
5495
5563
|
|
5496
5564
|
// src/telephony-cdr/index.ts
|
5497
|
-
import
|
5565
|
+
import z75 from "zod";
|
5498
5566
|
|
5499
5567
|
// src/telephony-cdr/validation.ts
|
5500
|
-
import
|
5501
|
-
var CreateTelephonyCdrSchema =
|
5502
|
-
uniqueCallId:
|
5503
|
-
timeStart:
|
5504
|
-
callFrom:
|
5505
|
-
callTo:
|
5506
|
-
callDuration:
|
5507
|
-
talkDuration:
|
5508
|
-
srcTrunkName:
|
5509
|
-
dstTrunkName:
|
5510
|
-
pinCode:
|
5511
|
-
status:
|
5512
|
-
type:
|
5513
|
-
recording:
|
5514
|
-
didNumber:
|
5515
|
-
agentRingTime:
|
5568
|
+
import z74 from "zod";
|
5569
|
+
var CreateTelephonyCdrSchema = z74.object({
|
5570
|
+
uniqueCallId: z74.string({ required_error: "uniqueCallId is required" }),
|
5571
|
+
timeStart: z74.string({ required_error: "timeStart is required" }),
|
5572
|
+
callFrom: z74.string({ required_error: "callFrom is required" }),
|
5573
|
+
callTo: z74.string({ required_error: "callTo is required" }),
|
5574
|
+
callDuration: z74.number().nullable(),
|
5575
|
+
talkDuration: z74.number().nullable(),
|
5576
|
+
srcTrunkName: z74.string().nullable(),
|
5577
|
+
dstTrunkName: z74.string().nullable(),
|
5578
|
+
pinCode: z74.string().nullable(),
|
5579
|
+
status: z74.string(),
|
5580
|
+
type: z74.string(),
|
5581
|
+
recording: z74.string().nullable(),
|
5582
|
+
didNumber: z74.string().nullable(),
|
5583
|
+
agentRingTime: z74.number().nullable()
|
5516
5584
|
});
|
5517
5585
|
var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5518
|
-
selectedDate:
|
5519
|
-
type:
|
5520
|
-
status:
|
5521
|
-
callFrom:
|
5522
|
-
callTo:
|
5523
|
-
trunk:
|
5524
|
-
userId:
|
5525
|
-
queueStatus:
|
5526
|
-
agentIds:
|
5527
|
-
agentCallsOnly:
|
5528
|
-
contactId:
|
5586
|
+
selectedDate: z74.string().optional(),
|
5587
|
+
type: z74.array(z74.string()).optional(),
|
5588
|
+
status: z74.array(z74.string()).optional(),
|
5589
|
+
callFrom: z74.string().optional(),
|
5590
|
+
callTo: z74.string().optional(),
|
5591
|
+
trunk: z74.array(z74.string()).optional(),
|
5592
|
+
userId: z74.string().uuid().optional(),
|
5593
|
+
queueStatus: z74.string().optional(),
|
5594
|
+
agentIds: z74.array(z74.string().uuid()).optional(),
|
5595
|
+
agentCallsOnly: z74.coerce.boolean().optional(),
|
5596
|
+
contactId: z74.string().uuid().optional()
|
5529
5597
|
});
|
5530
5598
|
var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5531
|
-
type:
|
5532
|
-
status:
|
5533
|
-
callFrom:
|
5534
|
-
callTo:
|
5535
|
-
result:
|
5536
|
-
callTags:
|
5537
|
-
selectedDate:
|
5538
|
-
agentId:
|
5539
|
-
contact:
|
5540
|
-
callStatus:
|
5541
|
-
queueIds:
|
5542
|
-
notes:
|
5599
|
+
type: z74.array(z74.string()).optional(),
|
5600
|
+
status: z74.array(z74.string()).optional(),
|
5601
|
+
callFrom: z74.string().optional(),
|
5602
|
+
callTo: z74.string().optional(),
|
5603
|
+
result: z74.array(z74.string()).optional(),
|
5604
|
+
callTags: z74.array(z74.string()).optional(),
|
5605
|
+
selectedDate: z74.string().optional(),
|
5606
|
+
agentId: z74.string().optional(),
|
5607
|
+
contact: z74.array(z74.string()).optional(),
|
5608
|
+
callStatus: z74.array(z74.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
|
5609
|
+
queueIds: z74.array(z74.string()).optional(),
|
5610
|
+
notes: z74.string().optional()
|
5543
5611
|
});
|
5544
5612
|
var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
|
5545
|
-
|
5546
|
-
page:
|
5547
|
-
pageSize:
|
5613
|
+
z74.object({
|
5614
|
+
page: z74.coerce.number().positive().optional(),
|
5615
|
+
pageSize: z74.coerce.number().positive().optional(),
|
5548
5616
|
// We use this export route for both CDR and Call Log.
|
5549
|
-
module:
|
5617
|
+
module: z74.union([z74.literal("cdrs"), z74.literal("call-logs")]).optional().default("cdrs")
|
5550
5618
|
})
|
5551
5619
|
);
|
5552
5620
|
var NullEmptyStringUndefined = ["", null, void 0];
|
5553
5621
|
var EmtptyArrayUndefined = [[], void 0];
|
5554
5622
|
var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
5555
|
-
reportType:
|
5623
|
+
reportType: z74.enum([
|
5556
5624
|
"extcallstatistics",
|
5557
5625
|
"extcallactivity",
|
5558
5626
|
"trunkactivity",
|
@@ -5562,52 +5630,52 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
5562
5630
|
"queueagentmisscalls",
|
5563
5631
|
"queueagentinoutcalls"
|
5564
5632
|
]),
|
5565
|
-
selectedDate:
|
5566
|
-
communicationType:
|
5567
|
-
time:
|
5568
|
-
queueList:
|
5569
|
-
queueId:
|
5570
|
-
trunkList:
|
5571
|
-
extensionList:
|
5633
|
+
selectedDate: z74.string().optional(),
|
5634
|
+
communicationType: z74.union([z74.literal("Inbound"), z74.literal("Outbound"), z74.literal("Internal")]).optional(),
|
5635
|
+
time: z74.string().optional(),
|
5636
|
+
queueList: z74.array(z74.string()).optional(),
|
5637
|
+
queueId: z74.string().optional(),
|
5638
|
+
trunkList: z74.array(z74.string()).optional(),
|
5639
|
+
extensionList: z74.array(z74.string()).optional()
|
5572
5640
|
}).superRefine((input, ctx) => {
|
5573
5641
|
if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
|
5574
5642
|
ctx.addIssue({
|
5575
|
-
code:
|
5643
|
+
code: z74.ZodIssueCode.custom,
|
5576
5644
|
path: ["selectedDate"],
|
5577
5645
|
message: "selectedDate is required."
|
5578
5646
|
});
|
5579
5647
|
}
|
5580
5648
|
if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
|
5581
5649
|
ctx.addIssue({
|
5582
|
-
code:
|
5650
|
+
code: z74.ZodIssueCode.custom,
|
5583
5651
|
path: ["time"],
|
5584
5652
|
message: "time is required."
|
5585
5653
|
});
|
5586
5654
|
}
|
5587
5655
|
if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
|
5588
5656
|
ctx.addIssue({
|
5589
|
-
code:
|
5657
|
+
code: z74.ZodIssueCode.custom,
|
5590
5658
|
path: ["queueList"],
|
5591
5659
|
message: "queueList is required."
|
5592
5660
|
});
|
5593
5661
|
}
|
5594
5662
|
if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
|
5595
5663
|
ctx.addIssue({
|
5596
|
-
code:
|
5664
|
+
code: z74.ZodIssueCode.custom,
|
5597
5665
|
path: ["queueId"],
|
5598
5666
|
message: "queueId is required."
|
5599
5667
|
});
|
5600
5668
|
}
|
5601
5669
|
if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
|
5602
5670
|
ctx.addIssue({
|
5603
|
-
code:
|
5671
|
+
code: z74.ZodIssueCode.custom,
|
5604
5672
|
path: ["trunkList"],
|
5605
5673
|
message: "trunkList is required."
|
5606
5674
|
});
|
5607
5675
|
}
|
5608
5676
|
if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
|
5609
5677
|
ctx.addIssue({
|
5610
|
-
code:
|
5678
|
+
code: z74.ZodIssueCode.custom,
|
5611
5679
|
path: ["extensionList"],
|
5612
5680
|
message: "extensionList is required."
|
5613
5681
|
});
|
@@ -5625,10 +5693,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5625
5693
|
query: GetAllTelephonyCdrSchema,
|
5626
5694
|
responses: {
|
5627
5695
|
200: DefaultSuccessResponseSchema.extend({
|
5628
|
-
total:
|
5629
|
-
page:
|
5630
|
-
pageSize:
|
5631
|
-
telephonyCdrs:
|
5696
|
+
total: z75.number(),
|
5697
|
+
page: z75.number(),
|
5698
|
+
pageSize: z75.number(),
|
5699
|
+
telephonyCdrs: z75.array(TelephonyCdrSchema)
|
5632
5700
|
}),
|
5633
5701
|
401: DefaultUnauthorizedSchema
|
5634
5702
|
},
|
@@ -5641,10 +5709,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5641
5709
|
query: GetAllTelephonyCdrSchema,
|
5642
5710
|
responses: {
|
5643
5711
|
200: DefaultSuccessResponseSchema.extend({
|
5644
|
-
total:
|
5645
|
-
page:
|
5646
|
-
pageSize:
|
5647
|
-
telephonyCdrs:
|
5712
|
+
total: z75.number(),
|
5713
|
+
page: z75.number(),
|
5714
|
+
pageSize: z75.number(),
|
5715
|
+
telephonyCdrs: z75.array(TelephonyCdrSchema)
|
5648
5716
|
}),
|
5649
5717
|
401: DefaultUnauthorizedSchema
|
5650
5718
|
},
|
@@ -5657,10 +5725,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5657
5725
|
query: GetRecentTelephonyCdrSchema,
|
5658
5726
|
responses: {
|
5659
5727
|
200: DefaultSuccessResponseSchema.extend({
|
5660
|
-
total:
|
5661
|
-
page:
|
5662
|
-
pageSize:
|
5663
|
-
telephonyCdrs:
|
5728
|
+
total: z75.number(),
|
5729
|
+
page: z75.number(),
|
5730
|
+
pageSize: z75.number(),
|
5731
|
+
telephonyCdrs: z75.array(TelephonyCdrSchema)
|
5664
5732
|
}),
|
5665
5733
|
401: DefaultUnauthorizedSchema
|
5666
5734
|
},
|
@@ -5685,7 +5753,7 @@ var telephonyCdrContract = initContract24().router(
|
|
5685
5753
|
body: GetYeastarCallReportSchema,
|
5686
5754
|
responses: {
|
5687
5755
|
// 200: CallReportSchema,
|
5688
|
-
200:
|
5756
|
+
200: z75.object({}),
|
5689
5757
|
401: DefaultUnauthorizedSchema
|
5690
5758
|
},
|
5691
5759
|
summary: "Get yeastar call report."
|
@@ -5753,10 +5821,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5753
5821
|
headers: DefaultHeaderSchema,
|
5754
5822
|
responses: {
|
5755
5823
|
200: DefaultSuccessResponseSchema.extend({
|
5756
|
-
callRedirectTo:
|
5824
|
+
callRedirectTo: z75.string()
|
5757
5825
|
}),
|
5758
|
-
400:
|
5759
|
-
message:
|
5826
|
+
400: z75.object({
|
5827
|
+
message: z75.string()
|
5760
5828
|
}),
|
5761
5829
|
401: DefaultUnauthorizedSchema,
|
5762
5830
|
500: DefaultErrorResponseSchema
|
@@ -5769,10 +5837,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5769
5837
|
body: TelephonyRedirectSettingSchema,
|
5770
5838
|
responses: {
|
5771
5839
|
200: DefaultSuccessResponseSchema.extend({
|
5772
|
-
callRedirectTo:
|
5840
|
+
callRedirectTo: z75.string()
|
5773
5841
|
}),
|
5774
|
-
400:
|
5775
|
-
message:
|
5842
|
+
400: z75.object({
|
5843
|
+
message: z75.string()
|
5776
5844
|
}),
|
5777
5845
|
401: DefaultUnauthorizedSchema,
|
5778
5846
|
500: DefaultErrorResponseSchema
|
@@ -5784,11 +5852,11 @@ var telephonyCdrContract = initContract24().router(
|
|
5784
5852
|
headers: DefaultHeaderSchema,
|
5785
5853
|
responses: {
|
5786
5854
|
200: DefaultSuccessResponseSchema.extend({
|
5787
|
-
callRedirectTo:
|
5788
|
-
isMultiTabUsed:
|
5855
|
+
callRedirectTo: z75.string(),
|
5856
|
+
isMultiTabUsed: z75.string()
|
5789
5857
|
}),
|
5790
|
-
400:
|
5791
|
-
message:
|
5858
|
+
400: z75.object({
|
5859
|
+
message: z75.string()
|
5792
5860
|
}),
|
5793
5861
|
401: DefaultUnauthorizedSchema,
|
5794
5862
|
500: DefaultErrorResponseSchema
|
@@ -5801,11 +5869,11 @@ var telephonyCdrContract = initContract24().router(
|
|
5801
5869
|
body: CallSettingSchema,
|
5802
5870
|
responses: {
|
5803
5871
|
200: DefaultSuccessResponseSchema.extend({
|
5804
|
-
callRedirectTo:
|
5805
|
-
isMultiTabUsed:
|
5872
|
+
callRedirectTo: z75.string(),
|
5873
|
+
isMultiTabUsed: z75.string()
|
5806
5874
|
}),
|
5807
|
-
400:
|
5808
|
-
message:
|
5875
|
+
400: z75.object({
|
5876
|
+
message: z75.string()
|
5809
5877
|
}),
|
5810
5878
|
401: DefaultUnauthorizedSchema,
|
5811
5879
|
500: DefaultErrorResponseSchema
|
@@ -5817,35 +5885,35 @@ var telephonyCdrContract = initContract24().router(
|
|
5817
5885
|
|
5818
5886
|
// src/telephony-extension/index.ts
|
5819
5887
|
import { initContract as initContract25 } from "@ts-rest/core";
|
5820
|
-
import
|
5888
|
+
import z77 from "zod";
|
5821
5889
|
|
5822
5890
|
// src/telephony-extension/schema.ts
|
5823
|
-
import
|
5824
|
-
var TelephonyExtensionSchema3 =
|
5825
|
-
errcode:
|
5826
|
-
errmsg:
|
5827
|
-
total_number:
|
5828
|
-
data:
|
5829
|
-
|
5830
|
-
id:
|
5831
|
-
online_status:
|
5832
|
-
fx_phone:
|
5833
|
-
sip_phone:
|
5834
|
-
status:
|
5835
|
-
ext_dev_type:
|
5836
|
-
}),
|
5837
|
-
linkus_desktop:
|
5838
|
-
linkus_mobile:
|
5839
|
-
linkus_web:
|
5840
|
-
status:
|
5841
|
-
ext_dev_type:
|
5891
|
+
import z76 from "zod";
|
5892
|
+
var TelephonyExtensionSchema3 = z76.object({
|
5893
|
+
errcode: z76.coerce.number(),
|
5894
|
+
errmsg: z76.string(),
|
5895
|
+
total_number: z76.coerce.number(),
|
5896
|
+
data: z76.array(
|
5897
|
+
z76.object({
|
5898
|
+
id: z76.coerce.number(),
|
5899
|
+
online_status: z76.object({
|
5900
|
+
fx_phone: z76.object({ status: z76.coerce.number() }),
|
5901
|
+
sip_phone: z76.object({
|
5902
|
+
status: z76.coerce.number(),
|
5903
|
+
ext_dev_type: z76.string().optional()
|
5904
|
+
}),
|
5905
|
+
linkus_desktop: z76.object({ status: z76.coerce.number() }),
|
5906
|
+
linkus_mobile: z76.object({ status: z76.coerce.number() }),
|
5907
|
+
linkus_web: z76.object({
|
5908
|
+
status: z76.coerce.number(),
|
5909
|
+
ext_dev_type: z76.string().optional()
|
5842
5910
|
})
|
5843
5911
|
}).optional(),
|
5844
|
-
presence_status:
|
5845
|
-
number:
|
5846
|
-
caller_id_name:
|
5847
|
-
role_name:
|
5848
|
-
email_addr:
|
5912
|
+
presence_status: z76.string().optional(),
|
5913
|
+
number: z76.string().optional(),
|
5914
|
+
caller_id_name: z76.string().optional(),
|
5915
|
+
role_name: z76.string().optional(),
|
5916
|
+
email_addr: z76.string().optional()
|
5849
5917
|
})
|
5850
5918
|
)
|
5851
5919
|
});
|
@@ -5860,8 +5928,8 @@ var telephonyExtensionContract = initContract25().router(
|
|
5860
5928
|
query: null,
|
5861
5929
|
responses: {
|
5862
5930
|
200: TelephonyExtensionSchema3,
|
5863
|
-
400:
|
5864
|
-
message:
|
5931
|
+
400: z77.object({
|
5932
|
+
message: z77.string()
|
5865
5933
|
}),
|
5866
5934
|
401: DefaultUnauthorizedSchema,
|
5867
5935
|
500: DefaultErrorResponseSchema
|
@@ -5874,10 +5942,10 @@ var telephonyExtensionContract = initContract25().router(
|
|
5874
5942
|
|
5875
5943
|
// src/ticket/index.ts
|
5876
5944
|
import { initContract as initContract26 } from "@ts-rest/core";
|
5877
|
-
import
|
5945
|
+
import z79 from "zod";
|
5878
5946
|
|
5879
5947
|
// src/ticket/validation.ts
|
5880
|
-
import
|
5948
|
+
import z78 from "zod";
|
5881
5949
|
var addErrorMessage2 = (field) => {
|
5882
5950
|
return field.refine(
|
5883
5951
|
({ isRequired, value }) => {
|
@@ -5895,108 +5963,108 @@ var addErrorMessage2 = (field) => {
|
|
5895
5963
|
}
|
5896
5964
|
);
|
5897
5965
|
};
|
5898
|
-
var BaseSchema3 =
|
5899
|
-
isRequired:
|
5900
|
-
attributeId:
|
5966
|
+
var BaseSchema3 = z78.object({
|
5967
|
+
isRequired: z78.boolean(),
|
5968
|
+
attributeId: z78.string()
|
5901
5969
|
});
|
5902
5970
|
var SingleValue2 = addErrorMessage2(
|
5903
5971
|
BaseSchema3.extend({
|
5904
|
-
value:
|
5972
|
+
value: z78.string()
|
5905
5973
|
})
|
5906
5974
|
);
|
5907
|
-
var CreateTicketValidationSchema =
|
5975
|
+
var CreateTicketValidationSchema = z78.object({
|
5908
5976
|
title: SingleValue2,
|
5909
5977
|
description: SingleValue2,
|
5910
5978
|
status: SingleValue2,
|
5911
5979
|
type: SingleValue2,
|
5912
5980
|
priority: SingleValue2,
|
5913
5981
|
contact: SingleValue2,
|
5914
|
-
assignee:
|
5915
|
-
isRequired:
|
5916
|
-
attributeId:
|
5917
|
-
value:
|
5982
|
+
assignee: z78.object({
|
5983
|
+
isRequired: z78.boolean(),
|
5984
|
+
attributeId: z78.string(),
|
5985
|
+
value: z78.string()
|
5918
5986
|
}),
|
5919
5987
|
channel: SingleValue2,
|
5920
|
-
tags: addErrorMessage2(BaseSchema3.extend({ value:
|
5921
|
-
categories: BaseSchema3.extend({ value:
|
5922
|
-
customFields:
|
5988
|
+
tags: addErrorMessage2(BaseSchema3.extend({ value: z78.array(z78.string()) })),
|
5989
|
+
categories: BaseSchema3.extend({ value: z78.array(z78.string()) }),
|
5990
|
+
customFields: z78.array(
|
5923
5991
|
addErrorMessage2(
|
5924
5992
|
BaseSchema3.extend({
|
5925
|
-
value:
|
5926
|
-
type:
|
5927
|
-
isDefaultAttribute:
|
5993
|
+
value: z78.union([z78.string(), z78.array(z78.string())]),
|
5994
|
+
type: z78.string(),
|
5995
|
+
isDefaultAttribute: z78.boolean()
|
5928
5996
|
})
|
5929
5997
|
)
|
5930
5998
|
),
|
5931
|
-
reasonToAssign:
|
5999
|
+
reasonToAssign: z78.object({ value: z78.string() }).optional()
|
5932
6000
|
});
|
5933
6001
|
var UpdateTicketValidationSchema = CreateTicketValidationSchema;
|
5934
|
-
var TicketAttachmentRecordSchema =
|
5935
|
-
bucketName:
|
5936
|
-
fileKey:
|
5937
|
-
fileName:
|
5938
|
-
fileSize:
|
5939
|
-
url:
|
5940
|
-
});
|
5941
|
-
var CreateTicketAttachmentRecordsSchema =
|
5942
|
-
ticketId:
|
5943
|
-
attributeId:
|
5944
|
-
ticketAttachmentRecords:
|
5945
|
-
});
|
5946
|
-
var TicketParamsSchema =
|
5947
|
-
page:
|
5948
|
-
pageSize:
|
5949
|
-
});
|
5950
|
-
var CustomFieldQuery =
|
5951
|
-
attributeId:
|
5952
|
-
type:
|
5953
|
-
value:
|
5954
|
-
});
|
5955
|
-
var GetAllTicketQuerySchema =
|
5956
|
-
page:
|
5957
|
-
pageSize:
|
5958
|
-
selectedDate:
|
5959
|
-
ticketNumber:
|
5960
|
-
keyword:
|
5961
|
-
title:
|
5962
|
-
description:
|
5963
|
-
status:
|
5964
|
-
priority:
|
5965
|
-
channel:
|
5966
|
-
type:
|
5967
|
-
ticketType:
|
5968
|
-
contact:
|
5969
|
-
tags:
|
5970
|
-
categories:
|
5971
|
-
assignee:
|
5972
|
-
customFields:
|
5973
|
-
|
5974
|
-
attributeId:
|
5975
|
-
type:
|
5976
|
-
value:
|
6002
|
+
var TicketAttachmentRecordSchema = z78.object({
|
6003
|
+
bucketName: z78.string(),
|
6004
|
+
fileKey: z78.string(),
|
6005
|
+
fileName: z78.string(),
|
6006
|
+
fileSize: z78.coerce.number(),
|
6007
|
+
url: z78.string()
|
6008
|
+
});
|
6009
|
+
var CreateTicketAttachmentRecordsSchema = z78.object({
|
6010
|
+
ticketId: z78.string(),
|
6011
|
+
attributeId: z78.string(),
|
6012
|
+
ticketAttachmentRecords: z78.array(TicketAttachmentRecordSchema)
|
6013
|
+
});
|
6014
|
+
var TicketParamsSchema = z78.object({
|
6015
|
+
page: z78.coerce.number().default(1),
|
6016
|
+
pageSize: z78.coerce.number().default(10)
|
6017
|
+
});
|
6018
|
+
var CustomFieldQuery = z78.object({
|
6019
|
+
attributeId: z78.string(),
|
6020
|
+
type: z78.string(),
|
6021
|
+
value: z78.union([z78.string(), z78.array(z78.string())])
|
6022
|
+
});
|
6023
|
+
var GetAllTicketQuerySchema = z78.object({
|
6024
|
+
page: z78.string().transform((value) => Number(value)),
|
6025
|
+
pageSize: z78.string().transform((value) => Number(value)),
|
6026
|
+
selectedDate: z78.string(),
|
6027
|
+
ticketNumber: z78.string(),
|
6028
|
+
keyword: z78.string(),
|
6029
|
+
title: z78.string(),
|
6030
|
+
description: z78.string(),
|
6031
|
+
status: z78.array(z78.string()),
|
6032
|
+
priority: z78.array(z78.string()),
|
6033
|
+
channel: z78.array(z78.string()),
|
6034
|
+
type: z78.array(z78.string()),
|
6035
|
+
ticketType: z78.array(z78.string()),
|
6036
|
+
contact: z78.array(z78.string()),
|
6037
|
+
tags: z78.array(z78.string().uuid()),
|
6038
|
+
categories: z78.array(z78.string().uuid()),
|
6039
|
+
assignee: z78.array(z78.string().uuid()),
|
6040
|
+
customFields: z78.array(
|
6041
|
+
z78.object({
|
6042
|
+
attributeId: z78.string().uuid(),
|
6043
|
+
type: z78.string(),
|
6044
|
+
value: z78.union([z78.string(), z78.array(z78.string())])
|
5977
6045
|
})
|
5978
6046
|
)
|
5979
6047
|
}).partial();
|
5980
|
-
var ExportAllTicketQuerySchema =
|
5981
|
-
agent:
|
5982
|
-
selectedDate:
|
5983
|
-
keyword:
|
5984
|
-
title:
|
5985
|
-
description:
|
5986
|
-
status:
|
5987
|
-
priority:
|
5988
|
-
assignee:
|
5989
|
-
channel:
|
5990
|
-
type:
|
5991
|
-
ticketType:
|
5992
|
-
contact:
|
5993
|
-
tags:
|
5994
|
-
categories:
|
5995
|
-
customFields:
|
5996
|
-
|
5997
|
-
attributeId:
|
5998
|
-
type:
|
5999
|
-
value:
|
6048
|
+
var ExportAllTicketQuerySchema = z78.object({
|
6049
|
+
agent: z78.array(z78.string()),
|
6050
|
+
selectedDate: z78.string(),
|
6051
|
+
keyword: z78.string(),
|
6052
|
+
title: z78.string(),
|
6053
|
+
description: z78.string(),
|
6054
|
+
status: z78.array(z78.string()),
|
6055
|
+
priority: z78.array(z78.string()),
|
6056
|
+
assignee: z78.array(z78.string().uuid()),
|
6057
|
+
channel: z78.array(z78.string()),
|
6058
|
+
type: z78.array(z78.string()),
|
6059
|
+
ticketType: z78.array(z78.string()),
|
6060
|
+
contact: z78.array(z78.string()),
|
6061
|
+
tags: z78.array(z78.string()),
|
6062
|
+
categories: z78.array(z78.string()),
|
6063
|
+
customFields: z78.array(
|
6064
|
+
z78.object({
|
6065
|
+
attributeId: z78.string().uuid(),
|
6066
|
+
type: z78.string(),
|
6067
|
+
value: z78.union([z78.string(), z78.array(z78.string())])
|
6000
6068
|
})
|
6001
6069
|
)
|
6002
6070
|
}).partial();
|
@@ -6012,14 +6080,14 @@ var ticketContract = initContract26().router(
|
|
6012
6080
|
201: DefaultSuccessResponseSchema.extend({
|
6013
6081
|
data: TicketSchema
|
6014
6082
|
}),
|
6015
|
-
400:
|
6016
|
-
message:
|
6083
|
+
400: z79.object({
|
6084
|
+
message: z79.string()
|
6017
6085
|
}),
|
6018
|
-
409:
|
6019
|
-
message:
|
6086
|
+
409: z79.object({
|
6087
|
+
message: z79.string()
|
6020
6088
|
}),
|
6021
|
-
500:
|
6022
|
-
message:
|
6089
|
+
500: z79.object({
|
6090
|
+
message: z79.string()
|
6023
6091
|
}),
|
6024
6092
|
401: DefaultUnauthorizedSchema,
|
6025
6093
|
404: DefaultNotFoundSchema,
|
@@ -6040,8 +6108,8 @@ var ticketContract = initContract26().router(
|
|
6040
6108
|
TicketSchema
|
6041
6109
|
)
|
6042
6110
|
}),
|
6043
|
-
400:
|
6044
|
-
message:
|
6111
|
+
400: z79.object({
|
6112
|
+
message: z79.string()
|
6045
6113
|
}),
|
6046
6114
|
401: DefaultUnauthorizedSchema,
|
6047
6115
|
500: DefaultErrorResponseSchema
|
@@ -6051,14 +6119,14 @@ var ticketContract = initContract26().router(
|
|
6051
6119
|
getTicketById: {
|
6052
6120
|
method: "GET",
|
6053
6121
|
path: "/:id",
|
6054
|
-
pathParams:
|
6122
|
+
pathParams: z79.object({ id: z79.string() }),
|
6055
6123
|
headers: DefaultHeaderSchema,
|
6056
6124
|
responses: {
|
6057
6125
|
200: DefaultSuccessResponseSchema.extend({
|
6058
6126
|
data: TicketSchema
|
6059
6127
|
}),
|
6060
|
-
400:
|
6061
|
-
message:
|
6128
|
+
400: z79.object({
|
6129
|
+
message: z79.string()
|
6062
6130
|
}),
|
6063
6131
|
401: DefaultUnauthorizedSchema,
|
6064
6132
|
500: DefaultErrorResponseSchema
|
@@ -6068,15 +6136,15 @@ var ticketContract = initContract26().router(
|
|
6068
6136
|
getTicketByContactId: {
|
6069
6137
|
method: "GET",
|
6070
6138
|
path: "/contact/:id",
|
6071
|
-
pathParams:
|
6139
|
+
pathParams: z79.object({ id: z79.string() }),
|
6072
6140
|
query: TicketParamsSchema,
|
6073
6141
|
headers: DefaultHeaderSchema,
|
6074
6142
|
responses: {
|
6075
6143
|
200: DefaultSuccessResponseSchema.extend({
|
6076
6144
|
data: WithPagination(TicketSchema)
|
6077
6145
|
}),
|
6078
|
-
400:
|
6079
|
-
message:
|
6146
|
+
400: z79.object({
|
6147
|
+
message: z79.string()
|
6080
6148
|
}),
|
6081
6149
|
401: DefaultUnauthorizedSchema,
|
6082
6150
|
500: DefaultErrorResponseSchema
|
@@ -6086,21 +6154,21 @@ var ticketContract = initContract26().router(
|
|
6086
6154
|
updateTicket: {
|
6087
6155
|
method: "PATCH",
|
6088
6156
|
path: "/:id",
|
6089
|
-
pathParams:
|
6157
|
+
pathParams: z79.object({ id: z79.string() }),
|
6090
6158
|
body: UpdateTicketValidationSchema,
|
6091
6159
|
headers: DefaultHeaderSchema,
|
6092
6160
|
responses: {
|
6093
6161
|
201: DefaultSuccessResponseSchema.extend({
|
6094
6162
|
data: TicketSchema
|
6095
6163
|
}),
|
6096
|
-
400:
|
6097
|
-
message:
|
6164
|
+
400: z79.object({
|
6165
|
+
message: z79.string()
|
6098
6166
|
}),
|
6099
|
-
409:
|
6100
|
-
message:
|
6167
|
+
409: z79.object({
|
6168
|
+
message: z79.string()
|
6101
6169
|
}),
|
6102
|
-
500:
|
6103
|
-
message:
|
6170
|
+
500: z79.object({
|
6171
|
+
message: z79.string()
|
6104
6172
|
}),
|
6105
6173
|
401: DefaultUnauthorizedSchema,
|
6106
6174
|
404: DefaultNotFoundSchema,
|
@@ -6111,11 +6179,11 @@ var ticketContract = initContract26().router(
|
|
6111
6179
|
deleteTicket: {
|
6112
6180
|
method: "DELETE",
|
6113
6181
|
path: "/:id",
|
6114
|
-
pathParams:
|
6182
|
+
pathParams: z79.object({ id: z79.string() }),
|
6115
6183
|
headers: DefaultHeaderSchema,
|
6116
6184
|
body: null,
|
6117
6185
|
responses: {
|
6118
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6186
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6119
6187
|
500: DefaultErrorResponseSchema
|
6120
6188
|
},
|
6121
6189
|
summary: "Delete a extension."
|
@@ -6123,19 +6191,19 @@ var ticketContract = initContract26().router(
|
|
6123
6191
|
updateDescription: {
|
6124
6192
|
method: "PATCH",
|
6125
6193
|
path: "/description/update/:id",
|
6126
|
-
pathParams:
|
6127
|
-
body:
|
6194
|
+
pathParams: z79.object({ id: z79.string() }),
|
6195
|
+
body: z79.object({ description: z79.string() }),
|
6128
6196
|
headers: DefaultHeaderSchema,
|
6129
6197
|
responses: {
|
6130
|
-
201: DefaultSuccessResponseSchema.extend({ message:
|
6131
|
-
400:
|
6132
|
-
message:
|
6198
|
+
201: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6199
|
+
400: z79.object({
|
6200
|
+
message: z79.string()
|
6133
6201
|
}),
|
6134
|
-
409:
|
6135
|
-
message:
|
6202
|
+
409: z79.object({
|
6203
|
+
message: z79.string()
|
6136
6204
|
}),
|
6137
|
-
500:
|
6138
|
-
message:
|
6205
|
+
500: z79.object({
|
6206
|
+
message: z79.string()
|
6139
6207
|
}),
|
6140
6208
|
401: DefaultUnauthorizedSchema,
|
6141
6209
|
404: DefaultNotFoundSchema,
|
@@ -6146,19 +6214,19 @@ var ticketContract = initContract26().router(
|
|
6146
6214
|
updateTitle: {
|
6147
6215
|
method: "PATCH",
|
6148
6216
|
path: "/title/update/:id",
|
6149
|
-
pathParams:
|
6150
|
-
body:
|
6217
|
+
pathParams: z79.object({ id: z79.string() }),
|
6218
|
+
body: z79.object({ title: z79.string() }),
|
6151
6219
|
headers: DefaultHeaderSchema,
|
6152
6220
|
responses: {
|
6153
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6154
|
-
400:
|
6155
|
-
message:
|
6221
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6222
|
+
400: z79.object({
|
6223
|
+
message: z79.string()
|
6156
6224
|
}),
|
6157
|
-
409:
|
6158
|
-
message:
|
6225
|
+
409: z79.object({
|
6226
|
+
message: z79.string()
|
6159
6227
|
}),
|
6160
|
-
500:
|
6161
|
-
message:
|
6228
|
+
500: z79.object({
|
6229
|
+
message: z79.string()
|
6162
6230
|
}),
|
6163
6231
|
401: DefaultUnauthorizedSchema,
|
6164
6232
|
404: DefaultNotFoundSchema,
|
@@ -6169,19 +6237,19 @@ var ticketContract = initContract26().router(
|
|
6169
6237
|
updateType: {
|
6170
6238
|
method: "PATCH",
|
6171
6239
|
path: "/type/update/:id",
|
6172
|
-
pathParams:
|
6173
|
-
body:
|
6240
|
+
pathParams: z79.object({ id: z79.string() }),
|
6241
|
+
body: z79.object({ type: z79.string() }),
|
6174
6242
|
headers: DefaultHeaderSchema,
|
6175
6243
|
responses: {
|
6176
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6177
|
-
400:
|
6178
|
-
message:
|
6244
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6245
|
+
400: z79.object({
|
6246
|
+
message: z79.string()
|
6179
6247
|
}),
|
6180
|
-
409:
|
6181
|
-
message:
|
6248
|
+
409: z79.object({
|
6249
|
+
message: z79.string()
|
6182
6250
|
}),
|
6183
|
-
500:
|
6184
|
-
message:
|
6251
|
+
500: z79.object({
|
6252
|
+
message: z79.string()
|
6185
6253
|
}),
|
6186
6254
|
401: DefaultUnauthorizedSchema,
|
6187
6255
|
404: DefaultNotFoundSchema,
|
@@ -6192,19 +6260,19 @@ var ticketContract = initContract26().router(
|
|
6192
6260
|
updateStatus: {
|
6193
6261
|
method: "PATCH",
|
6194
6262
|
path: "/status/update/:id",
|
6195
|
-
pathParams:
|
6196
|
-
body:
|
6263
|
+
pathParams: z79.object({ id: z79.string() }),
|
6264
|
+
body: z79.object({ status: z79.string() }),
|
6197
6265
|
headers: DefaultHeaderSchema,
|
6198
6266
|
responses: {
|
6199
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6200
|
-
400:
|
6201
|
-
message:
|
6267
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6268
|
+
400: z79.object({
|
6269
|
+
message: z79.string()
|
6202
6270
|
}),
|
6203
|
-
409:
|
6204
|
-
message:
|
6271
|
+
409: z79.object({
|
6272
|
+
message: z79.string()
|
6205
6273
|
}),
|
6206
|
-
500:
|
6207
|
-
message:
|
6274
|
+
500: z79.object({
|
6275
|
+
message: z79.string()
|
6208
6276
|
}),
|
6209
6277
|
401: DefaultUnauthorizedSchema,
|
6210
6278
|
404: DefaultNotFoundSchema,
|
@@ -6215,19 +6283,19 @@ var ticketContract = initContract26().router(
|
|
6215
6283
|
updatePriority: {
|
6216
6284
|
method: "PATCH",
|
6217
6285
|
path: "/priority/update/:id",
|
6218
|
-
pathParams:
|
6219
|
-
body:
|
6286
|
+
pathParams: z79.object({ id: z79.string() }),
|
6287
|
+
body: z79.object({ priority: z79.string() }),
|
6220
6288
|
headers: DefaultHeaderSchema,
|
6221
6289
|
responses: {
|
6222
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6223
|
-
400:
|
6224
|
-
message:
|
6290
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6291
|
+
400: z79.object({
|
6292
|
+
message: z79.string()
|
6225
6293
|
}),
|
6226
|
-
409:
|
6227
|
-
message:
|
6294
|
+
409: z79.object({
|
6295
|
+
message: z79.string()
|
6228
6296
|
}),
|
6229
|
-
500:
|
6230
|
-
message:
|
6297
|
+
500: z79.object({
|
6298
|
+
message: z79.string()
|
6231
6299
|
}),
|
6232
6300
|
401: DefaultUnauthorizedSchema,
|
6233
6301
|
404: DefaultNotFoundSchema,
|
@@ -6238,19 +6306,19 @@ var ticketContract = initContract26().router(
|
|
6238
6306
|
updateChannel: {
|
6239
6307
|
method: "PATCH",
|
6240
6308
|
path: "/channel/update/:id",
|
6241
|
-
pathParams:
|
6242
|
-
body:
|
6309
|
+
pathParams: z79.object({ id: z79.string() }),
|
6310
|
+
body: z79.object({ channel: z79.string() }),
|
6243
6311
|
headers: DefaultHeaderSchema,
|
6244
6312
|
responses: {
|
6245
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6246
|
-
400:
|
6247
|
-
message:
|
6313
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6314
|
+
400: z79.object({
|
6315
|
+
message: z79.string()
|
6248
6316
|
}),
|
6249
|
-
409:
|
6250
|
-
message:
|
6317
|
+
409: z79.object({
|
6318
|
+
message: z79.string()
|
6251
6319
|
}),
|
6252
|
-
500:
|
6253
|
-
message:
|
6320
|
+
500: z79.object({
|
6321
|
+
message: z79.string()
|
6254
6322
|
}),
|
6255
6323
|
401: DefaultUnauthorizedSchema,
|
6256
6324
|
404: DefaultNotFoundSchema,
|
@@ -6261,19 +6329,19 @@ var ticketContract = initContract26().router(
|
|
6261
6329
|
updateTags: {
|
6262
6330
|
method: "PATCH",
|
6263
6331
|
path: "/tags/update/:id",
|
6264
|
-
pathParams:
|
6265
|
-
body:
|
6332
|
+
pathParams: z79.object({ id: z79.string() }),
|
6333
|
+
body: z79.object({ tags: z79.array(z79.string()) }),
|
6266
6334
|
headers: DefaultHeaderSchema,
|
6267
6335
|
responses: {
|
6268
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6269
|
-
400:
|
6270
|
-
message:
|
6336
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6337
|
+
400: z79.object({
|
6338
|
+
message: z79.string()
|
6271
6339
|
}),
|
6272
|
-
409:
|
6273
|
-
message:
|
6340
|
+
409: z79.object({
|
6341
|
+
message: z79.string()
|
6274
6342
|
}),
|
6275
|
-
500:
|
6276
|
-
message:
|
6343
|
+
500: z79.object({
|
6344
|
+
message: z79.string()
|
6277
6345
|
}),
|
6278
6346
|
401: DefaultUnauthorizedSchema,
|
6279
6347
|
404: DefaultNotFoundSchema,
|
@@ -6284,25 +6352,25 @@ var ticketContract = initContract26().router(
|
|
6284
6352
|
changeAssignee: {
|
6285
6353
|
method: "PATCH",
|
6286
6354
|
path: "/assignee/update/:id",
|
6287
|
-
pathParams:
|
6288
|
-
body:
|
6289
|
-
ticketId:
|
6290
|
-
assigneeId:
|
6291
|
-
reason:
|
6355
|
+
pathParams: z79.object({ id: z79.string() }),
|
6356
|
+
body: z79.object({
|
6357
|
+
ticketId: z79.string(),
|
6358
|
+
assigneeId: z79.string(),
|
6359
|
+
reason: z79.string().optional()
|
6292
6360
|
}),
|
6293
6361
|
headers: DefaultHeaderSchema,
|
6294
6362
|
responses: {
|
6295
6363
|
200: DefaultSuccessResponseSchema.extend({
|
6296
6364
|
data: TicketSchema
|
6297
6365
|
}),
|
6298
|
-
400:
|
6299
|
-
message:
|
6366
|
+
400: z79.object({
|
6367
|
+
message: z79.string()
|
6300
6368
|
}),
|
6301
|
-
409:
|
6302
|
-
message:
|
6369
|
+
409: z79.object({
|
6370
|
+
message: z79.string()
|
6303
6371
|
}),
|
6304
|
-
500:
|
6305
|
-
message:
|
6372
|
+
500: z79.object({
|
6373
|
+
message: z79.string()
|
6306
6374
|
}),
|
6307
6375
|
401: DefaultUnauthorizedSchema,
|
6308
6376
|
404: DefaultNotFoundSchema,
|
@@ -6313,14 +6381,14 @@ var ticketContract = initContract26().router(
|
|
6313
6381
|
getTicketCountByContact: {
|
6314
6382
|
method: "GET",
|
6315
6383
|
path: "/ticket_count/contact/:id",
|
6316
|
-
pathParams:
|
6384
|
+
pathParams: z79.object({ id: z79.string() }),
|
6317
6385
|
headers: DefaultHeaderSchema,
|
6318
6386
|
responses: {
|
6319
6387
|
200: DefaultSuccessResponseSchema.extend({
|
6320
6388
|
data: TicketCountByContactSchema
|
6321
6389
|
}),
|
6322
|
-
400:
|
6323
|
-
message:
|
6390
|
+
400: z79.object({
|
6391
|
+
message: z79.string()
|
6324
6392
|
}),
|
6325
6393
|
401: DefaultUnauthorizedSchema,
|
6326
6394
|
500: DefaultErrorResponseSchema
|
@@ -6336,14 +6404,14 @@ var ticketContract = initContract26().router(
|
|
6336
6404
|
201: DefaultSuccessResponseSchema.extend({
|
6337
6405
|
data: TicketCustomFieldSchema
|
6338
6406
|
}),
|
6339
|
-
400:
|
6340
|
-
message:
|
6407
|
+
400: z79.object({
|
6408
|
+
message: z79.string()
|
6341
6409
|
}),
|
6342
|
-
409:
|
6343
|
-
message:
|
6410
|
+
409: z79.object({
|
6411
|
+
message: z79.string()
|
6344
6412
|
}),
|
6345
|
-
500:
|
6346
|
-
message:
|
6413
|
+
500: z79.object({
|
6414
|
+
message: z79.string()
|
6347
6415
|
}),
|
6348
6416
|
401: DefaultUnauthorizedSchema,
|
6349
6417
|
404: DefaultNotFoundSchema,
|
@@ -6368,10 +6436,10 @@ var ticketContract = initContract26().router(
|
|
6368
6436
|
headers: DefaultHeaderSchema,
|
6369
6437
|
responses: {
|
6370
6438
|
200: DefaultSuccessResponseSchema.extend({
|
6371
|
-
ticketReasonRequired:
|
6439
|
+
ticketReasonRequired: z79.string()
|
6372
6440
|
}),
|
6373
|
-
400:
|
6374
|
-
message:
|
6441
|
+
400: z79.object({
|
6442
|
+
message: z79.string()
|
6375
6443
|
}),
|
6376
6444
|
401: DefaultUnauthorizedSchema,
|
6377
6445
|
500: DefaultErrorResponseSchema
|
@@ -6384,10 +6452,10 @@ var ticketContract = initContract26().router(
|
|
6384
6452
|
body: TicketReasonRequiredSchema,
|
6385
6453
|
responses: {
|
6386
6454
|
200: DefaultSuccessResponseSchema.extend({
|
6387
|
-
ticketReasonRequired:
|
6455
|
+
ticketReasonRequired: z79.string()
|
6388
6456
|
}),
|
6389
|
-
400:
|
6390
|
-
message:
|
6457
|
+
400: z79.object({
|
6458
|
+
message: z79.string()
|
6391
6459
|
}),
|
6392
6460
|
401: DefaultUnauthorizedSchema,
|
6393
6461
|
500: DefaultErrorResponseSchema
|
@@ -6399,24 +6467,24 @@ var ticketContract = initContract26().router(
|
|
6399
6467
|
|
6400
6468
|
// src/user/index.ts
|
6401
6469
|
import { initContract as initContract27 } from "@ts-rest/core";
|
6402
|
-
import
|
6470
|
+
import z81 from "zod";
|
6403
6471
|
|
6404
6472
|
// src/user/validation.ts
|
6405
|
-
import { z as
|
6406
|
-
var CreateUserSchema =
|
6407
|
-
name:
|
6408
|
-
email:
|
6409
|
-
address:
|
6410
|
-
phone:
|
6411
|
-
password:
|
6412
|
-
notificationCount:
|
6413
|
-
roles:
|
6473
|
+
import { z as z80 } from "zod";
|
6474
|
+
var CreateUserSchema = z80.object({
|
6475
|
+
name: z80.string(),
|
6476
|
+
email: z80.string().email(),
|
6477
|
+
address: z80.string().nullable(),
|
6478
|
+
phone: z80.string().nullable(),
|
6479
|
+
password: z80.string(),
|
6480
|
+
notificationCount: z80.number().nullable().optional(),
|
6481
|
+
roles: z80.array(z80.string())
|
6414
6482
|
});
|
6415
6483
|
var UpdateUserSchema = CreateUserSchema.extend({
|
6416
|
-
newPassword:
|
6484
|
+
newPassword: z80.string()
|
6417
6485
|
});
|
6418
|
-
var UpdateUserProfileSchema =
|
6419
|
-
password:
|
6486
|
+
var UpdateUserProfileSchema = z80.object({
|
6487
|
+
password: z80.string()
|
6420
6488
|
});
|
6421
6489
|
|
6422
6490
|
// src/user/index.ts
|
@@ -6431,8 +6499,8 @@ var userContract = initContract27().router(
|
|
6431
6499
|
201: DefaultSuccessResponseSchema.extend({
|
6432
6500
|
user: UserSchema
|
6433
6501
|
}),
|
6434
|
-
400:
|
6435
|
-
message:
|
6502
|
+
400: z81.object({
|
6503
|
+
message: z81.string()
|
6436
6504
|
}),
|
6437
6505
|
401: DefaultUnauthorizedSchema,
|
6438
6506
|
404: DefaultNotFoundSchema,
|
@@ -6445,18 +6513,18 @@ var userContract = initContract27().router(
|
|
6445
6513
|
method: "GET",
|
6446
6514
|
path: "",
|
6447
6515
|
headers: DefaultHeaderSchema,
|
6448
|
-
query:
|
6449
|
-
page:
|
6450
|
-
pageSize:
|
6516
|
+
query: z81.object({
|
6517
|
+
page: z81.coerce.number().optional(),
|
6518
|
+
pageSize: z81.coerce.number().optional(),
|
6451
6519
|
// Don't add default 10. In some places, we need to fetch all users.
|
6452
|
-
keyword:
|
6453
|
-
userIds:
|
6454
|
-
withPresenceStatus:
|
6520
|
+
keyword: z81.string().optional(),
|
6521
|
+
userIds: z81.array(z81.string()).optional(),
|
6522
|
+
withPresenceStatus: z81.string().transform((val) => val === "true").optional()
|
6455
6523
|
}).optional(),
|
6456
6524
|
responses: {
|
6457
6525
|
200: WithPagination(UserSchema),
|
6458
|
-
400:
|
6459
|
-
message:
|
6526
|
+
400: z81.object({
|
6527
|
+
message: z81.string()
|
6460
6528
|
}),
|
6461
6529
|
401: DefaultUnauthorizedSchema,
|
6462
6530
|
500: DefaultErrorResponseSchema
|
@@ -6466,12 +6534,12 @@ var userContract = initContract27().router(
|
|
6466
6534
|
getUserById: {
|
6467
6535
|
method: "GET",
|
6468
6536
|
path: "/:id",
|
6469
|
-
pathParams:
|
6537
|
+
pathParams: z81.object({ id: z81.string() }),
|
6470
6538
|
headers: DefaultHeaderSchema,
|
6471
6539
|
responses: {
|
6472
6540
|
200: UserSchema,
|
6473
|
-
400:
|
6474
|
-
message:
|
6541
|
+
400: z81.object({
|
6542
|
+
message: z81.string()
|
6475
6543
|
}),
|
6476
6544
|
401: DefaultUnauthorizedSchema
|
6477
6545
|
},
|
@@ -6480,15 +6548,15 @@ var userContract = initContract27().router(
|
|
6480
6548
|
updateUser: {
|
6481
6549
|
method: "PATCH",
|
6482
6550
|
path: "/:id",
|
6483
|
-
pathParams:
|
6551
|
+
pathParams: z81.object({ id: z81.string() }),
|
6484
6552
|
headers: DefaultHeaderSchema,
|
6485
6553
|
body: UpdateUserSchema,
|
6486
6554
|
responses: {
|
6487
6555
|
201: DefaultSuccessResponseSchema.extend({
|
6488
6556
|
user: UserSchema
|
6489
6557
|
}),
|
6490
|
-
400:
|
6491
|
-
message:
|
6558
|
+
400: z81.object({
|
6559
|
+
message: z81.string()
|
6492
6560
|
}),
|
6493
6561
|
401: DefaultUnauthorizedSchema,
|
6494
6562
|
404: DefaultNotFoundSchema,
|
@@ -6500,15 +6568,15 @@ var userContract = initContract27().router(
|
|
6500
6568
|
updateUserProfile: {
|
6501
6569
|
method: "PATCH",
|
6502
6570
|
path: "/profile/:id",
|
6503
|
-
pathParams:
|
6571
|
+
pathParams: z81.object({ id: z81.string() }),
|
6504
6572
|
headers: DefaultHeaderSchema,
|
6505
6573
|
body: UpdateUserProfileSchema,
|
6506
6574
|
responses: {
|
6507
6575
|
201: DefaultSuccessResponseSchema.extend({
|
6508
6576
|
user: UserSchema
|
6509
6577
|
}),
|
6510
|
-
400:
|
6511
|
-
message:
|
6578
|
+
400: z81.object({
|
6579
|
+
message: z81.string()
|
6512
6580
|
}),
|
6513
6581
|
401: DefaultUnauthorizedSchema,
|
6514
6582
|
404: DefaultNotFoundSchema,
|
@@ -6520,11 +6588,11 @@ var userContract = initContract27().router(
|
|
6520
6588
|
deleteUser: {
|
6521
6589
|
method: "DELETE",
|
6522
6590
|
path: "/:id",
|
6523
|
-
pathParams:
|
6591
|
+
pathParams: z81.object({ id: z81.string() }),
|
6524
6592
|
headers: DefaultHeaderSchema,
|
6525
6593
|
body: null,
|
6526
6594
|
responses: {
|
6527
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6595
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6528
6596
|
404: DefaultNotFoundSchema,
|
6529
6597
|
422: DefaultUnprocessibleSchema,
|
6530
6598
|
500: DefaultErrorResponseSchema
|
@@ -6537,26 +6605,26 @@ var userContract = initContract27().router(
|
|
6537
6605
|
|
6538
6606
|
// src/user-presence-status-log/index.ts
|
6539
6607
|
import { initContract as initContract28 } from "@ts-rest/core";
|
6540
|
-
import
|
6608
|
+
import z84 from "zod";
|
6541
6609
|
|
6542
6610
|
// src/user-presence-status-log/schema.ts
|
6543
|
-
import
|
6611
|
+
import z82 from "zod";
|
6544
6612
|
var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
|
6545
6613
|
user: UserSchema,
|
6546
6614
|
previousPresenceStatus: PresenceStatusSchema,
|
6547
6615
|
newPresenceStatus: PresenceStatusSchema,
|
6548
|
-
reason:
|
6616
|
+
reason: z82.string()
|
6549
6617
|
});
|
6550
6618
|
|
6551
6619
|
// src/user-presence-status-log/validation.ts
|
6552
|
-
import
|
6553
|
-
var UserPresenceStatusLogParamsSchema =
|
6554
|
-
page:
|
6555
|
-
pageSize:
|
6556
|
-
selectedDate:
|
6620
|
+
import z83 from "zod";
|
6621
|
+
var UserPresenceStatusLogParamsSchema = z83.object({
|
6622
|
+
page: z83.coerce.number().default(1),
|
6623
|
+
pageSize: z83.coerce.number().default(10),
|
6624
|
+
selectedDate: z83.string().optional()
|
6557
6625
|
}).optional();
|
6558
|
-
var UserPresenceStatusLogExportParamsSchema =
|
6559
|
-
selectedDate:
|
6626
|
+
var UserPresenceStatusLogExportParamsSchema = z83.object({
|
6627
|
+
selectedDate: z83.string().optional()
|
6560
6628
|
});
|
6561
6629
|
|
6562
6630
|
// src/user-presence-status-log/index.ts
|
@@ -6569,8 +6637,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
6569
6637
|
headers: DefaultHeaderSchema,
|
6570
6638
|
responses: {
|
6571
6639
|
200: WithPagination(UserPresenceStatusLogSchema),
|
6572
|
-
400:
|
6573
|
-
message:
|
6640
|
+
400: z84.object({
|
6641
|
+
message: z84.string()
|
6574
6642
|
}),
|
6575
6643
|
401: DefaultUnauthorizedSchema,
|
6576
6644
|
500: DefaultErrorResponseSchema
|
@@ -6584,8 +6652,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
6584
6652
|
headers: DefaultHeaderSchema,
|
6585
6653
|
responses: {
|
6586
6654
|
200: null,
|
6587
|
-
400:
|
6588
|
-
message:
|
6655
|
+
400: z84.object({
|
6656
|
+
message: z84.string()
|
6589
6657
|
}),
|
6590
6658
|
401: DefaultUnauthorizedSchema,
|
6591
6659
|
500: DefaultErrorResponseSchema
|
@@ -6597,44 +6665,44 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
6597
6665
|
|
6598
6666
|
// src/widget/index.ts
|
6599
6667
|
import { initContract as initContract29 } from "@ts-rest/core";
|
6600
|
-
import
|
6668
|
+
import z87 from "zod";
|
6601
6669
|
|
6602
6670
|
// src/widget/schema.ts
|
6603
|
-
import
|
6604
|
-
var FieldsSchema =
|
6605
|
-
var WidgetPositionSchema =
|
6606
|
-
|
6607
|
-
|
6608
|
-
|
6671
|
+
import z85 from "zod";
|
6672
|
+
var FieldsSchema = z85.object({ data: z85.array(z85.string()) });
|
6673
|
+
var WidgetPositionSchema = z85.union([
|
6674
|
+
z85.literal("menu"),
|
6675
|
+
z85.literal("ticket_detail"),
|
6676
|
+
z85.literal("contact_detail")
|
6609
6677
|
]);
|
6610
6678
|
var WidgetSchema = DefaultEntitySchema.extend({
|
6611
|
-
name:
|
6612
|
-
description:
|
6679
|
+
name: z85.string(),
|
6680
|
+
description: z85.string().nullable(),
|
6613
6681
|
position: WidgetPositionSchema.nullable(),
|
6614
6682
|
fields: FieldsSchema,
|
6615
|
-
url:
|
6683
|
+
url: z85.string()
|
6616
6684
|
});
|
6617
6685
|
|
6618
6686
|
// src/widget/validation.ts
|
6619
|
-
import
|
6620
|
-
var CreateWidgetSchema =
|
6621
|
-
name:
|
6622
|
-
description:
|
6623
|
-
url:
|
6687
|
+
import z86 from "zod";
|
6688
|
+
var CreateWidgetSchema = z86.object({
|
6689
|
+
name: z86.string(),
|
6690
|
+
description: z86.string(),
|
6691
|
+
url: z86.string(),
|
6624
6692
|
position: WidgetPositionSchema,
|
6625
|
-
fields:
|
6693
|
+
fields: z86.object({
|
6626
6694
|
data: (
|
6627
6695
|
// Array of attribute system names
|
6628
|
-
|
6696
|
+
z86.array(z86.string())
|
6629
6697
|
)
|
6630
6698
|
}).optional()
|
6631
6699
|
});
|
6632
6700
|
var UpdateWidgetSchema = CreateWidgetSchema;
|
6633
|
-
var GetWidgetUrlPathQuerySchema =
|
6634
|
-
widgetId:
|
6701
|
+
var GetWidgetUrlPathQuerySchema = z86.object({
|
6702
|
+
widgetId: z86.string(),
|
6635
6703
|
// Position ID is ticket ID, contact ID, etc.
|
6636
6704
|
// TODO: The name "Position ID" is confusing. Think of a better name.
|
6637
|
-
positionId:
|
6705
|
+
positionId: z86.string()
|
6638
6706
|
});
|
6639
6707
|
|
6640
6708
|
// src/widget/index.ts
|
@@ -6649,8 +6717,8 @@ var widgetContract = initContract29().router(
|
|
6649
6717
|
201: DefaultSuccessResponseSchema.extend({
|
6650
6718
|
widget: WidgetSchema
|
6651
6719
|
}),
|
6652
|
-
400:
|
6653
|
-
message:
|
6720
|
+
400: z87.object({
|
6721
|
+
message: z87.string()
|
6654
6722
|
}),
|
6655
6723
|
401: DefaultUnauthorizedSchema,
|
6656
6724
|
500: DefaultErrorResponseSchema
|
@@ -6660,17 +6728,17 @@ var widgetContract = initContract29().router(
|
|
6660
6728
|
getWidgets: {
|
6661
6729
|
method: "GET",
|
6662
6730
|
path: "",
|
6663
|
-
query:
|
6664
|
-
page:
|
6665
|
-
pageSize:
|
6666
|
-
keyword:
|
6731
|
+
query: z87.object({
|
6732
|
+
page: z87.coerce.number().default(1),
|
6733
|
+
pageSize: z87.coerce.number().default(10),
|
6734
|
+
keyword: z87.coerce.string().optional()
|
6667
6735
|
}).optional(),
|
6668
6736
|
headers: DefaultHeaderSchema,
|
6669
6737
|
responses: {
|
6670
6738
|
200: WithPagination(WidgetSchema),
|
6671
6739
|
500: DefaultErrorResponseSchema,
|
6672
|
-
400:
|
6673
|
-
message:
|
6740
|
+
400: z87.object({
|
6741
|
+
message: z87.string()
|
6674
6742
|
}),
|
6675
6743
|
401: DefaultUnauthorizedSchema
|
6676
6744
|
},
|
@@ -6681,9 +6749,9 @@ var widgetContract = initContract29().router(
|
|
6681
6749
|
path: "/menu",
|
6682
6750
|
headers: DefaultHeaderSchema,
|
6683
6751
|
responses: {
|
6684
|
-
200:
|
6685
|
-
400:
|
6686
|
-
message:
|
6752
|
+
200: z87.array(WidgetSchema),
|
6753
|
+
400: z87.object({
|
6754
|
+
message: z87.string()
|
6687
6755
|
}),
|
6688
6756
|
401: DefaultUnauthorizedSchema,
|
6689
6757
|
500: DefaultErrorResponseSchema
|
@@ -6695,9 +6763,9 @@ var widgetContract = initContract29().router(
|
|
6695
6763
|
path: "/ticket_detail",
|
6696
6764
|
headers: DefaultHeaderSchema,
|
6697
6765
|
responses: {
|
6698
|
-
200:
|
6699
|
-
400:
|
6700
|
-
message:
|
6766
|
+
200: z87.array(WidgetSchema),
|
6767
|
+
400: z87.object({
|
6768
|
+
message: z87.string()
|
6701
6769
|
}),
|
6702
6770
|
401: DefaultUnauthorizedSchema,
|
6703
6771
|
500: DefaultErrorResponseSchema
|
@@ -6709,9 +6777,9 @@ var widgetContract = initContract29().router(
|
|
6709
6777
|
path: "/contact_detail",
|
6710
6778
|
headers: DefaultHeaderSchema,
|
6711
6779
|
responses: {
|
6712
|
-
200:
|
6713
|
-
400:
|
6714
|
-
message:
|
6780
|
+
200: z87.array(WidgetSchema),
|
6781
|
+
400: z87.object({
|
6782
|
+
message: z87.string()
|
6715
6783
|
}),
|
6716
6784
|
401: DefaultUnauthorizedSchema,
|
6717
6785
|
500: DefaultErrorResponseSchema
|
@@ -6721,12 +6789,12 @@ var widgetContract = initContract29().router(
|
|
6721
6789
|
getWidgetById: {
|
6722
6790
|
method: "GET",
|
6723
6791
|
path: "/:id",
|
6724
|
-
pathParams:
|
6792
|
+
pathParams: z87.object({ id: z87.string() }),
|
6725
6793
|
headers: DefaultHeaderSchema,
|
6726
6794
|
responses: {
|
6727
6795
|
200: WidgetSchema,
|
6728
|
-
400:
|
6729
|
-
message:
|
6796
|
+
400: z87.object({
|
6797
|
+
message: z87.string()
|
6730
6798
|
}),
|
6731
6799
|
401: DefaultUnauthorizedSchema,
|
6732
6800
|
500: DefaultErrorResponseSchema
|
@@ -6740,10 +6808,10 @@ var widgetContract = initContract29().router(
|
|
6740
6808
|
headers: DefaultHeaderSchema,
|
6741
6809
|
responses: {
|
6742
6810
|
201: DefaultSuccessResponseSchema.extend({
|
6743
|
-
url:
|
6811
|
+
url: z87.string()
|
6744
6812
|
}),
|
6745
|
-
400:
|
6746
|
-
message:
|
6813
|
+
400: z87.object({
|
6814
|
+
message: z87.string()
|
6747
6815
|
}),
|
6748
6816
|
401: DefaultUnauthorizedSchema
|
6749
6817
|
},
|
@@ -6752,14 +6820,14 @@ var widgetContract = initContract29().router(
|
|
6752
6820
|
updateWidget: {
|
6753
6821
|
method: "PATCH",
|
6754
6822
|
path: "/:id",
|
6755
|
-
pathParams:
|
6823
|
+
pathParams: z87.object({ id: z87.string() }),
|
6756
6824
|
headers: DefaultHeaderSchema,
|
6757
6825
|
responses: {
|
6758
6826
|
201: DefaultSuccessResponseSchema.extend({
|
6759
6827
|
widget: WidgetSchema
|
6760
6828
|
}),
|
6761
|
-
400:
|
6762
|
-
message:
|
6829
|
+
400: z87.object({
|
6830
|
+
message: z87.string()
|
6763
6831
|
}),
|
6764
6832
|
401: DefaultUnauthorizedSchema
|
6765
6833
|
},
|
@@ -6769,11 +6837,11 @@ var widgetContract = initContract29().router(
|
|
6769
6837
|
deleteWidget: {
|
6770
6838
|
method: "DELETE",
|
6771
6839
|
path: "/:id",
|
6772
|
-
pathParams:
|
6840
|
+
pathParams: z87.object({ id: z87.string() }),
|
6773
6841
|
headers: DefaultHeaderSchema,
|
6774
6842
|
body: null,
|
6775
6843
|
responses: {
|
6776
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6844
|
+
200: DefaultSuccessResponseSchema.extend({ message: z87.string() }),
|
6777
6845
|
500: DefaultErrorResponseSchema
|
6778
6846
|
},
|
6779
6847
|
summary: "Delete a widget."
|
@@ -6784,35 +6852,35 @@ var widgetContract = initContract29().router(
|
|
6784
6852
|
|
6785
6853
|
// src/wrap-up-form/index.ts
|
6786
6854
|
import { initContract as initContract30 } from "@ts-rest/core";
|
6787
|
-
import
|
6855
|
+
import z89 from "zod";
|
6788
6856
|
|
6789
6857
|
// src/wrap-up-form/validation.ts
|
6790
|
-
import { z as
|
6791
|
-
var CreateWrapUpFormSchema =
|
6792
|
-
note:
|
6793
|
-
disposition:
|
6794
|
-
callFrom:
|
6795
|
-
callTo:
|
6858
|
+
import { z as z88 } from "zod";
|
6859
|
+
var CreateWrapUpFormSchema = z88.object({
|
6860
|
+
note: z88.string().nullable().optional(),
|
6861
|
+
disposition: z88.string().nullable().optional(),
|
6862
|
+
callFrom: z88.string().nullable().optional(),
|
6863
|
+
callTo: z88.string().nullable().optional()
|
6796
6864
|
});
|
6797
6865
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
6798
|
-
cxLogId:
|
6799
|
-
type:
|
6800
|
-
tags:
|
6801
|
-
categoryIds:
|
6802
|
-
customFields:
|
6803
|
-
|
6804
|
-
id:
|
6805
|
-
type:
|
6806
|
-
value:
|
6866
|
+
cxLogId: z88.string().uuid().optional(),
|
6867
|
+
type: z88.string().optional(),
|
6868
|
+
tags: z88.array(z88.string()).optional(),
|
6869
|
+
categoryIds: z88.array(z88.string().uuid()).optional(),
|
6870
|
+
customFields: z88.array(
|
6871
|
+
z88.object({
|
6872
|
+
id: z88.string().uuid(),
|
6873
|
+
type: z88.string(),
|
6874
|
+
value: z88.string()
|
6807
6875
|
})
|
6808
6876
|
).optional(),
|
6809
|
-
durationSeconds:
|
6877
|
+
durationSeconds: z88.number().optional()
|
6810
6878
|
});
|
6811
|
-
var CreateCXLogWrapUpFormSchema =
|
6812
|
-
cxLogId:
|
6813
|
-
disposition:
|
6814
|
-
tagIds:
|
6815
|
-
note:
|
6879
|
+
var CreateCXLogWrapUpFormSchema = z88.object({
|
6880
|
+
cxLogId: z88.string().uuid(),
|
6881
|
+
disposition: z88.string().optional(),
|
6882
|
+
tagIds: z88.array(z88.string().uuid()).optional(),
|
6883
|
+
note: z88.string().optional()
|
6816
6884
|
});
|
6817
6885
|
|
6818
6886
|
// src/wrap-up-form/index.ts
|
@@ -6824,10 +6892,10 @@ var wrapUpFormContract = initContract30().router(
|
|
6824
6892
|
headers: DefaultHeaderSchema,
|
6825
6893
|
responses: {
|
6826
6894
|
200: DefaultSuccessResponseSchema.extend({
|
6827
|
-
wrapUpFormTimer:
|
6895
|
+
wrapUpFormTimer: z89.number()
|
6828
6896
|
}),
|
6829
|
-
400:
|
6830
|
-
message:
|
6897
|
+
400: z89.object({
|
6898
|
+
message: z89.string()
|
6831
6899
|
}),
|
6832
6900
|
401: DefaultUnauthorizedSchema,
|
6833
6901
|
500: DefaultErrorResponseSchema
|
@@ -6836,14 +6904,14 @@ var wrapUpFormContract = initContract30().router(
|
|
6836
6904
|
updateWrapUpFormTimer: {
|
6837
6905
|
method: "PATCH",
|
6838
6906
|
path: "/timer",
|
6839
|
-
body:
|
6907
|
+
body: z89.object({ newWrapUpFormTimer: z89.number().positive() }),
|
6840
6908
|
headers: DefaultHeaderSchema,
|
6841
6909
|
responses: {
|
6842
6910
|
200: DefaultSuccessResponseSchema.extend({
|
6843
|
-
wrapUpFormTimer:
|
6911
|
+
wrapUpFormTimer: z89.number()
|
6844
6912
|
}),
|
6845
|
-
400:
|
6846
|
-
message:
|
6913
|
+
400: z89.object({
|
6914
|
+
message: z89.string()
|
6847
6915
|
}),
|
6848
6916
|
401: DefaultUnauthorizedSchema,
|
6849
6917
|
500: DefaultErrorResponseSchema
|
@@ -6858,8 +6926,8 @@ var wrapUpFormContract = initContract30().router(
|
|
6858
6926
|
201: DefaultSuccessResponseSchema.extend({
|
6859
6927
|
wrapUpForm: WrapUpFormSchema
|
6860
6928
|
}),
|
6861
|
-
400:
|
6862
|
-
message:
|
6929
|
+
400: z89.object({
|
6930
|
+
message: z89.string()
|
6863
6931
|
}),
|
6864
6932
|
401: DefaultUnauthorizedSchema,
|
6865
6933
|
500: DefaultErrorResponseSchema
|
@@ -6881,15 +6949,15 @@ var wrapUpFormContract = initContract30().router(
|
|
6881
6949
|
getWrapUpForms: {
|
6882
6950
|
method: "GET",
|
6883
6951
|
path: "",
|
6884
|
-
query:
|
6885
|
-
page:
|
6886
|
-
pageSize:
|
6952
|
+
query: z89.object({
|
6953
|
+
page: z89.coerce.number().default(1),
|
6954
|
+
pageSize: z89.coerce.number().default(10)
|
6887
6955
|
}).optional(),
|
6888
6956
|
headers: DefaultHeaderSchema,
|
6889
6957
|
responses: {
|
6890
6958
|
200: WithPagination(WrapUpFormSchema),
|
6891
|
-
400:
|
6892
|
-
message:
|
6959
|
+
400: z89.object({
|
6960
|
+
message: z89.string()
|
6893
6961
|
}),
|
6894
6962
|
401: DefaultUnauthorizedSchema,
|
6895
6963
|
500: DefaultErrorResponseSchema
|
@@ -6899,12 +6967,12 @@ var wrapUpFormContract = initContract30().router(
|
|
6899
6967
|
getWrapUpForm: {
|
6900
6968
|
method: "GET",
|
6901
6969
|
path: "/:id",
|
6902
|
-
pathParams:
|
6970
|
+
pathParams: z89.object({ id: z89.string() }),
|
6903
6971
|
headers: DefaultHeaderSchema,
|
6904
6972
|
responses: {
|
6905
6973
|
200: WrapUpFormSchema,
|
6906
|
-
400:
|
6907
|
-
message:
|
6974
|
+
400: z89.object({
|
6975
|
+
message: z89.string()
|
6908
6976
|
}),
|
6909
6977
|
401: DefaultUnauthorizedSchema,
|
6910
6978
|
500: DefaultErrorResponseSchema
|
@@ -6913,15 +6981,15 @@ var wrapUpFormContract = initContract30().router(
|
|
6913
6981
|
updateWrapUpForm: {
|
6914
6982
|
method: "PATCH",
|
6915
6983
|
path: "/:id",
|
6916
|
-
pathParams:
|
6984
|
+
pathParams: z89.object({ id: z89.string() }),
|
6917
6985
|
headers: DefaultHeaderSchema,
|
6918
6986
|
body: UpdateWrapUpFormSchema,
|
6919
6987
|
responses: {
|
6920
6988
|
201: DefaultSuccessResponseSchema.extend({
|
6921
6989
|
wrapUpForm: WrapUpFormSchema
|
6922
6990
|
}),
|
6923
|
-
400:
|
6924
|
-
message:
|
6991
|
+
400: z89.object({
|
6992
|
+
message: z89.string()
|
6925
6993
|
}),
|
6926
6994
|
401: DefaultUnauthorizedSchema,
|
6927
6995
|
500: DefaultErrorResponseSchema
|
@@ -6934,28 +7002,28 @@ var wrapUpFormContract = initContract30().router(
|
|
6934
7002
|
|
6935
7003
|
// src/upload/index.ts
|
6936
7004
|
import { initContract as initContract31 } from "@ts-rest/core";
|
6937
|
-
import
|
7005
|
+
import z90 from "zod";
|
6938
7006
|
var uploadContract = initContract31().router(
|
6939
7007
|
{
|
6940
7008
|
rename: {
|
6941
7009
|
method: "POST",
|
6942
7010
|
path: "/:id/rename",
|
6943
|
-
pathParams:
|
6944
|
-
id:
|
7011
|
+
pathParams: z90.object({
|
7012
|
+
id: z90.string()
|
6945
7013
|
}),
|
6946
7014
|
headers: DefaultHeaderSchema,
|
6947
7015
|
responses: {
|
6948
7016
|
201: DefaultSuccessResponseSchema.extend({
|
6949
|
-
message:
|
7017
|
+
message: z90.string()
|
6950
7018
|
}),
|
6951
|
-
400:
|
6952
|
-
message:
|
7019
|
+
400: z90.object({
|
7020
|
+
message: z90.string()
|
6953
7021
|
}),
|
6954
|
-
409:
|
6955
|
-
message:
|
7022
|
+
409: z90.object({
|
7023
|
+
message: z90.string()
|
6956
7024
|
}),
|
6957
|
-
500:
|
6958
|
-
message:
|
7025
|
+
500: z90.object({
|
7026
|
+
message: z90.string()
|
6959
7027
|
}),
|
6960
7028
|
401: DefaultUnauthorizedSchema,
|
6961
7029
|
404: DefaultNotFoundSchema,
|
@@ -6967,23 +7035,23 @@ var uploadContract = initContract31().router(
|
|
6967
7035
|
delete: {
|
6968
7036
|
method: "DELETE",
|
6969
7037
|
path: "/:id",
|
6970
|
-
pathParams:
|
6971
|
-
id:
|
7038
|
+
pathParams: z90.object({
|
7039
|
+
id: z90.string()
|
6972
7040
|
}),
|
6973
7041
|
headers: DefaultHeaderSchema,
|
6974
7042
|
body: null,
|
6975
7043
|
responses: {
|
6976
7044
|
201: DefaultSuccessResponseSchema.extend({
|
6977
|
-
message:
|
7045
|
+
message: z90.string()
|
6978
7046
|
}),
|
6979
|
-
400:
|
6980
|
-
message:
|
7047
|
+
400: z90.object({
|
7048
|
+
message: z90.string()
|
6981
7049
|
}),
|
6982
|
-
409:
|
6983
|
-
message:
|
7050
|
+
409: z90.object({
|
7051
|
+
message: z90.string()
|
6984
7052
|
}),
|
6985
|
-
500:
|
6986
|
-
message:
|
7053
|
+
500: z90.object({
|
7054
|
+
message: z90.string()
|
6987
7055
|
}),
|
6988
7056
|
401: DefaultUnauthorizedSchema,
|
6989
7057
|
404: DefaultNotFoundSchema,
|
@@ -6998,19 +7066,19 @@ var uploadContract = initContract31().router(
|
|
6998
7066
|
);
|
6999
7067
|
|
7000
7068
|
// src/viber/index.ts
|
7001
|
-
import
|
7069
|
+
import z92 from "zod";
|
7002
7070
|
|
7003
7071
|
// src/viber/validation.ts
|
7004
|
-
import
|
7005
|
-
var ViberChannelSchema =
|
7006
|
-
name:
|
7007
|
-
accessToken:
|
7008
|
-
actor:
|
7009
|
-
id:
|
7010
|
-
name:
|
7011
|
-
email:
|
7012
|
-
address:
|
7013
|
-
phone:
|
7072
|
+
import z91 from "zod";
|
7073
|
+
var ViberChannelSchema = z91.object({
|
7074
|
+
name: z91.string(),
|
7075
|
+
accessToken: z91.string(),
|
7076
|
+
actor: z91.object({
|
7077
|
+
id: z91.string().uuid(),
|
7078
|
+
name: z91.string(),
|
7079
|
+
email: z91.string().email(),
|
7080
|
+
address: z91.string().nullable(),
|
7081
|
+
phone: z91.string().nullable()
|
7014
7082
|
}).optional()
|
7015
7083
|
});
|
7016
7084
|
|
@@ -7039,8 +7107,8 @@ var viberContract = initContract32().router({
|
|
7039
7107
|
}),
|
7040
7108
|
400: DefaultErrorResponseSchema
|
7041
7109
|
},
|
7042
|
-
body:
|
7043
|
-
id:
|
7110
|
+
body: z92.object({
|
7111
|
+
id: z92.string().uuid()
|
7044
7112
|
}),
|
7045
7113
|
summary: "Connect viber channel"
|
7046
7114
|
},
|
@@ -7056,8 +7124,8 @@ var viberContract = initContract32().router({
|
|
7056
7124
|
reconnect: {
|
7057
7125
|
method: "POST",
|
7058
7126
|
path: "/reconnect/:channelId",
|
7059
|
-
pathParams:
|
7060
|
-
channelId:
|
7127
|
+
pathParams: z92.object({
|
7128
|
+
channelId: z92.string().uuid()
|
7061
7129
|
}),
|
7062
7130
|
responses: {
|
7063
7131
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7072,8 +7140,8 @@ var viberContract = initContract32().router({
|
|
7072
7140
|
delete: {
|
7073
7141
|
method: "DELETE",
|
7074
7142
|
path: "/delete/:channelId",
|
7075
|
-
pathParams:
|
7076
|
-
channelId:
|
7143
|
+
pathParams: z92.object({
|
7144
|
+
channelId: z92.string().uuid()
|
7077
7145
|
}),
|
7078
7146
|
body: null,
|
7079
7147
|
responses: {
|
@@ -7085,21 +7153,21 @@ var viberContract = initContract32().router({
|
|
7085
7153
|
});
|
7086
7154
|
|
7087
7155
|
// src/telegram/index.ts
|
7088
|
-
import
|
7156
|
+
import z94 from "zod";
|
7089
7157
|
import { initContract as initContract33 } from "@ts-rest/core";
|
7090
7158
|
|
7091
7159
|
// src/telegram/validation.ts
|
7092
|
-
import
|
7093
|
-
var TelegramChannelSchema =
|
7094
|
-
name:
|
7160
|
+
import z93 from "zod";
|
7161
|
+
var TelegramChannelSchema = z93.object({
|
7162
|
+
name: z93.string(),
|
7095
7163
|
// Telegram bot access token
|
7096
|
-
accessToken:
|
7097
|
-
actor:
|
7098
|
-
id:
|
7099
|
-
name:
|
7100
|
-
email:
|
7101
|
-
address:
|
7102
|
-
phone:
|
7164
|
+
accessToken: z93.string(),
|
7165
|
+
actor: z93.object({
|
7166
|
+
id: z93.string().uuid(),
|
7167
|
+
name: z93.string(),
|
7168
|
+
email: z93.string().email(),
|
7169
|
+
address: z93.string().nullable(),
|
7170
|
+
phone: z93.string().nullable()
|
7103
7171
|
}).optional()
|
7104
7172
|
});
|
7105
7173
|
|
@@ -7126,8 +7194,8 @@ var telegramContract = initContract33().router({
|
|
7126
7194
|
500: DefaultErrorResponseSchema,
|
7127
7195
|
400: DefaultErrorResponseSchema
|
7128
7196
|
},
|
7129
|
-
body:
|
7130
|
-
id:
|
7197
|
+
body: z94.object({
|
7198
|
+
id: z94.string().uuid()
|
7131
7199
|
}),
|
7132
7200
|
summary: "Disconnect telegram channel"
|
7133
7201
|
},
|
@@ -7143,8 +7211,8 @@ var telegramContract = initContract33().router({
|
|
7143
7211
|
reconnect: {
|
7144
7212
|
method: "POST",
|
7145
7213
|
path: "/reconnect/:channelId",
|
7146
|
-
pathParams:
|
7147
|
-
channelId:
|
7214
|
+
pathParams: z94.object({
|
7215
|
+
channelId: z94.string().uuid()
|
7148
7216
|
}),
|
7149
7217
|
body: null,
|
7150
7218
|
responses: {
|
@@ -7157,8 +7225,8 @@ var telegramContract = initContract33().router({
|
|
7157
7225
|
delete: {
|
7158
7226
|
method: "DELETE",
|
7159
7227
|
path: "/delete/:channelId",
|
7160
|
-
pathParams:
|
7161
|
-
channelId:
|
7228
|
+
pathParams: z94.object({
|
7229
|
+
channelId: z94.string().uuid()
|
7162
7230
|
}),
|
7163
7231
|
body: null,
|
7164
7232
|
responses: {
|
@@ -7172,58 +7240,58 @@ var telegramContract = initContract33().router({
|
|
7172
7240
|
|
7173
7241
|
// src/notification/index.ts
|
7174
7242
|
import { initContract as initContract34 } from "@ts-rest/core";
|
7175
|
-
import
|
7243
|
+
import z97 from "zod";
|
7176
7244
|
|
7177
7245
|
// src/notification/validation.ts
|
7178
|
-
import
|
7246
|
+
import z96 from "zod";
|
7179
7247
|
|
7180
7248
|
// src/notification/schema.ts
|
7181
|
-
import
|
7182
|
-
var NotificationChangeSchema =
|
7183
|
-
id:
|
7184
|
-
createdAt:
|
7185
|
-
updatedAt:
|
7186
|
-
deletedAt:
|
7187
|
-
actorId:
|
7249
|
+
import z95 from "zod";
|
7250
|
+
var NotificationChangeSchema = z95.object({
|
7251
|
+
id: z95.string().uuid(),
|
7252
|
+
createdAt: z95.date(),
|
7253
|
+
updatedAt: z95.date(),
|
7254
|
+
deletedAt: z95.date().nullable(),
|
7255
|
+
actorId: z95.string().uuid(),
|
7188
7256
|
actor: UserSchema,
|
7189
|
-
notificationObjectId:
|
7190
|
-
readAt:
|
7191
|
-
});
|
7192
|
-
var NotificationObjectSchema =
|
7193
|
-
id:
|
7194
|
-
createdAt:
|
7195
|
-
updatedAt:
|
7196
|
-
deletedAt:
|
7197
|
-
data:
|
7257
|
+
notificationObjectId: z95.string().uuid(),
|
7258
|
+
readAt: z95.date()
|
7259
|
+
});
|
7260
|
+
var NotificationObjectSchema = z95.object({
|
7261
|
+
id: z95.string().uuid(),
|
7262
|
+
createdAt: z95.date(),
|
7263
|
+
updatedAt: z95.date(),
|
7264
|
+
deletedAt: z95.date().nullable(),
|
7265
|
+
data: z95.string(),
|
7198
7266
|
notificationChange: NotificationChangeSchema
|
7199
7267
|
});
|
7200
|
-
var NotificationSchema =
|
7201
|
-
id:
|
7202
|
-
createdAt:
|
7203
|
-
updatedAt:
|
7204
|
-
deletedAt:
|
7205
|
-
notificationObjectId:
|
7206
|
-
notifierId:
|
7268
|
+
var NotificationSchema = z95.object({
|
7269
|
+
id: z95.string().uuid(),
|
7270
|
+
createdAt: z95.date(),
|
7271
|
+
updatedAt: z95.date(),
|
7272
|
+
deletedAt: z95.date().nullable(),
|
7273
|
+
notificationObjectId: z95.string().uuid(),
|
7274
|
+
notifierId: z95.string().uuid(),
|
7207
7275
|
notificationObject: NotificationObjectSchema,
|
7208
|
-
readAt:
|
7276
|
+
readAt: z95.date()
|
7209
7277
|
});
|
7210
7278
|
|
7211
7279
|
// src/notification/validation.ts
|
7212
|
-
var GetNotificationsRequestSchema =
|
7213
|
-
page:
|
7214
|
-
pageSize:
|
7280
|
+
var GetNotificationsRequestSchema = z96.object({
|
7281
|
+
page: z96.coerce.number().default(1),
|
7282
|
+
pageSize: z96.coerce.number().default(10)
|
7215
7283
|
});
|
7216
|
-
var GetNotificationsResponseSchema =
|
7217
|
-
notificationCount:
|
7218
|
-
notifications:
|
7219
|
-
total:
|
7220
|
-
page:
|
7221
|
-
pageSize:
|
7222
|
-
lastPage:
|
7223
|
-
totalUnreadCount:
|
7284
|
+
var GetNotificationsResponseSchema = z96.object({
|
7285
|
+
notificationCount: z96.number(),
|
7286
|
+
notifications: z96.array(NotificationSchema),
|
7287
|
+
total: z96.number(),
|
7288
|
+
page: z96.number(),
|
7289
|
+
pageSize: z96.number(),
|
7290
|
+
lastPage: z96.number(),
|
7291
|
+
totalUnreadCount: z96.number().optional()
|
7224
7292
|
});
|
7225
|
-
var ResetNotificationRequestSchema =
|
7226
|
-
userId:
|
7293
|
+
var ResetNotificationRequestSchema = z96.object({
|
7294
|
+
userId: z96.string()
|
7227
7295
|
});
|
7228
7296
|
|
7229
7297
|
// src/notification/index.ts
|
@@ -7237,14 +7305,14 @@ var userNotificationContract = initContract34().router(
|
|
7237
7305
|
200: DefaultSuccessResponseSchema.extend({
|
7238
7306
|
data: GetNotificationsResponseSchema
|
7239
7307
|
}),
|
7240
|
-
400:
|
7241
|
-
message:
|
7308
|
+
400: z97.object({
|
7309
|
+
message: z97.string()
|
7242
7310
|
}),
|
7243
|
-
409:
|
7244
|
-
message:
|
7311
|
+
409: z97.object({
|
7312
|
+
message: z97.string()
|
7245
7313
|
}),
|
7246
|
-
500:
|
7247
|
-
message:
|
7314
|
+
500: z97.object({
|
7315
|
+
message: z97.string()
|
7248
7316
|
}),
|
7249
7317
|
401: DefaultUnauthorizedSchema,
|
7250
7318
|
404: DefaultNotFoundSchema,
|
@@ -7257,16 +7325,16 @@ var userNotificationContract = initContract34().router(
|
|
7257
7325
|
path: "/new_notifications_count",
|
7258
7326
|
responses: {
|
7259
7327
|
200: DefaultSuccessResponseSchema.extend({
|
7260
|
-
total:
|
7328
|
+
total: z97.number()
|
7261
7329
|
}),
|
7262
|
-
400:
|
7263
|
-
message:
|
7330
|
+
400: z97.object({
|
7331
|
+
message: z97.string()
|
7264
7332
|
}),
|
7265
|
-
409:
|
7266
|
-
message:
|
7333
|
+
409: z97.object({
|
7334
|
+
message: z97.string()
|
7267
7335
|
}),
|
7268
|
-
500:
|
7269
|
-
message:
|
7336
|
+
500: z97.object({
|
7337
|
+
message: z97.string()
|
7270
7338
|
}),
|
7271
7339
|
401: DefaultUnauthorizedSchema,
|
7272
7340
|
404: DefaultNotFoundSchema,
|
@@ -7281,14 +7349,14 @@ var userNotificationContract = initContract34().router(
|
|
7281
7349
|
201: DefaultSuccessResponseSchema.extend({
|
7282
7350
|
data: UserSchema
|
7283
7351
|
}),
|
7284
|
-
400:
|
7285
|
-
message:
|
7352
|
+
400: z97.object({
|
7353
|
+
message: z97.string()
|
7286
7354
|
}),
|
7287
|
-
409:
|
7288
|
-
message:
|
7355
|
+
409: z97.object({
|
7356
|
+
message: z97.string()
|
7289
7357
|
}),
|
7290
|
-
500:
|
7291
|
-
message:
|
7358
|
+
500: z97.object({
|
7359
|
+
message: z97.string()
|
7292
7360
|
}),
|
7293
7361
|
401: DefaultUnauthorizedSchema,
|
7294
7362
|
404: DefaultNotFoundSchema,
|
@@ -7300,19 +7368,19 @@ var userNotificationContract = initContract34().router(
|
|
7300
7368
|
readNotification: {
|
7301
7369
|
method: "POST",
|
7302
7370
|
path: "/read/:id",
|
7303
|
-
pathParams:
|
7371
|
+
pathParams: z97.object({ id: z97.string() }),
|
7304
7372
|
responses: {
|
7305
7373
|
201: DefaultSuccessResponseSchema.extend({
|
7306
7374
|
data: NotificationSchema
|
7307
7375
|
}),
|
7308
|
-
400:
|
7309
|
-
message:
|
7376
|
+
400: z97.object({
|
7377
|
+
message: z97.string()
|
7310
7378
|
}),
|
7311
|
-
409:
|
7312
|
-
message:
|
7379
|
+
409: z97.object({
|
7380
|
+
message: z97.string()
|
7313
7381
|
}),
|
7314
|
-
500:
|
7315
|
-
message:
|
7382
|
+
500: z97.object({
|
7383
|
+
message: z97.string()
|
7316
7384
|
}),
|
7317
7385
|
401: DefaultUnauthorizedSchema,
|
7318
7386
|
404: DefaultNotFoundSchema,
|
@@ -7329,63 +7397,63 @@ var userNotificationContract = initContract34().router(
|
|
7329
7397
|
|
7330
7398
|
// src/snippet/index.ts
|
7331
7399
|
import { initContract as initContract35 } from "@ts-rest/core";
|
7332
|
-
import { z as
|
7400
|
+
import { z as z100 } from "zod";
|
7333
7401
|
|
7334
7402
|
// src/snippet/schema.ts
|
7335
|
-
import
|
7403
|
+
import z98 from "zod";
|
7336
7404
|
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7337
|
-
name:
|
7338
|
-
platformType:
|
7405
|
+
name: z98.string(),
|
7406
|
+
platformType: z98.string()
|
7339
7407
|
});
|
7340
7408
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
7341
|
-
contentType:
|
7342
|
-
contentValue:
|
7343
|
-
contentTemplate:
|
7344
|
-
order:
|
7409
|
+
contentType: z98.string(),
|
7410
|
+
contentValue: z98.string().nullable(),
|
7411
|
+
contentTemplate: z98.any().nullable(),
|
7412
|
+
order: z98.number(),
|
7345
7413
|
upload: UploadSchema.nullable()
|
7346
7414
|
});
|
7347
7415
|
var SnippetSchema = DefaultEntitySchema.extend({
|
7348
|
-
name:
|
7416
|
+
name: z98.string(),
|
7349
7417
|
snippetGroup: SnippetGroupSchema,
|
7350
7418
|
snippetContent: SnippetContentSchema
|
7351
7419
|
});
|
7352
|
-
var SnippetGroupListItemSchema =
|
7353
|
-
id:
|
7354
|
-
name:
|
7420
|
+
var SnippetGroupListItemSchema = z98.object({
|
7421
|
+
id: z98.string().uuid(),
|
7422
|
+
name: z98.string()
|
7355
7423
|
});
|
7356
|
-
var SnippetListItemSchema =
|
7357
|
-
id:
|
7358
|
-
shortCutName:
|
7359
|
-
contentType:
|
7360
|
-
contentValue:
|
7361
|
-
snippetGroupId:
|
7424
|
+
var SnippetListItemSchema = z98.object({
|
7425
|
+
id: z98.string().uuid(),
|
7426
|
+
shortCutName: z98.string(),
|
7427
|
+
contentType: z98.string(),
|
7428
|
+
contentValue: z98.string().nullable(),
|
7429
|
+
snippetGroupId: z98.string()
|
7362
7430
|
});
|
7363
7431
|
|
7364
7432
|
// src/snippet/validation.ts
|
7365
|
-
import { z as
|
7366
|
-
var CreateSnippetGroupSchema =
|
7367
|
-
name:
|
7368
|
-
platformType:
|
7433
|
+
import { z as z99 } from "zod";
|
7434
|
+
var CreateSnippetGroupSchema = z99.object({
|
7435
|
+
name: z99.string(),
|
7436
|
+
platformType: z99.string()
|
7369
7437
|
});
|
7370
|
-
var UpdateSnippetGroupSchema =
|
7371
|
-
name:
|
7372
|
-
platformType:
|
7438
|
+
var UpdateSnippetGroupSchema = z99.object({
|
7439
|
+
name: z99.string().optional(),
|
7440
|
+
platformType: z99.string().optional()
|
7373
7441
|
});
|
7374
|
-
var DeleteSnippetGroupSchema =
|
7375
|
-
id:
|
7442
|
+
var DeleteSnippetGroupSchema = z99.object({
|
7443
|
+
id: z99.string()
|
7376
7444
|
});
|
7377
|
-
var CreateSnippetSchema =
|
7378
|
-
shortcutName:
|
7379
|
-
contentType:
|
7380
|
-
contentValue:
|
7381
|
-
snippetGroupId:
|
7382
|
-
platformType:
|
7445
|
+
var CreateSnippetSchema = z99.object({
|
7446
|
+
shortcutName: z99.string(),
|
7447
|
+
contentType: z99.string(),
|
7448
|
+
contentValue: z99.string().optional(),
|
7449
|
+
snippetGroupId: z99.string(),
|
7450
|
+
platformType: z99.string()
|
7383
7451
|
});
|
7384
7452
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
7385
|
-
snippetContentId:
|
7453
|
+
snippetContentId: z99.string()
|
7386
7454
|
});
|
7387
|
-
var DeleteSnippetSchema =
|
7388
|
-
snippetId:
|
7455
|
+
var DeleteSnippetSchema = z99.object({
|
7456
|
+
snippetId: z99.string()
|
7389
7457
|
});
|
7390
7458
|
|
7391
7459
|
// src/snippet/index.ts
|
@@ -7408,7 +7476,7 @@ var snippetContract = initContract35().router(
|
|
7408
7476
|
query: null,
|
7409
7477
|
responses: {
|
7410
7478
|
200: DefaultSuccessResponseSchema.extend({
|
7411
|
-
snippetgroups:
|
7479
|
+
snippetgroups: z100.array(SnippetGroupSchema)
|
7412
7480
|
}),
|
7413
7481
|
500: DefaultErrorResponseSchema
|
7414
7482
|
}
|
@@ -7416,7 +7484,7 @@ var snippetContract = initContract35().router(
|
|
7416
7484
|
updateSnippetGroup: {
|
7417
7485
|
method: "PATCH",
|
7418
7486
|
path: "/groups/:id",
|
7419
|
-
pathParams:
|
7487
|
+
pathParams: z100.object({ id: z100.string() }),
|
7420
7488
|
body: UpdateSnippetGroupSchema,
|
7421
7489
|
responses: {
|
7422
7490
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7428,7 +7496,7 @@ var snippetContract = initContract35().router(
|
|
7428
7496
|
deleteSnippetGroup: {
|
7429
7497
|
method: "DELETE",
|
7430
7498
|
path: "/groups/:id",
|
7431
|
-
pathParams:
|
7499
|
+
pathParams: z100.object({ id: z100.string() }),
|
7432
7500
|
body: null,
|
7433
7501
|
responses: {
|
7434
7502
|
200: DefaultSuccessResponseSchema,
|
@@ -7440,7 +7508,7 @@ var snippetContract = initContract35().router(
|
|
7440
7508
|
path: "",
|
7441
7509
|
responses: {
|
7442
7510
|
200: DefaultSuccessResponseSchema.extend({
|
7443
|
-
snippets:
|
7511
|
+
snippets: z100.array(SnippetSchema)
|
7444
7512
|
}),
|
7445
7513
|
500: DefaultErrorResponseSchema
|
7446
7514
|
}
|
@@ -7459,7 +7527,7 @@ var snippetContract = initContract35().router(
|
|
7459
7527
|
updateSnippet: {
|
7460
7528
|
method: "PATCH",
|
7461
7529
|
path: "/:id",
|
7462
|
-
pathParams:
|
7530
|
+
pathParams: z100.object({ id: z100.string() }),
|
7463
7531
|
body: UpdateSnippetSchema,
|
7464
7532
|
responses: {
|
7465
7533
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7471,7 +7539,7 @@ var snippetContract = initContract35().router(
|
|
7471
7539
|
deleteSnippet: {
|
7472
7540
|
method: "DELETE",
|
7473
7541
|
path: "/:id",
|
7474
|
-
pathParams:
|
7542
|
+
pathParams: z100.object({ id: z100.string() }),
|
7475
7543
|
body: null,
|
7476
7544
|
responses: {
|
7477
7545
|
200: DefaultSuccessResponseSchema,
|
@@ -7488,77 +7556,77 @@ var snippetContract = initContract35().router(
|
|
7488
7556
|
import { initContract as initContract36 } from "@ts-rest/core";
|
7489
7557
|
|
7490
7558
|
// src/business-calendar/validation.ts
|
7491
|
-
import
|
7492
|
-
var TimeSlotDataSchema =
|
7493
|
-
var CreateBusinessHourSchema =
|
7494
|
-
day:
|
7495
|
-
isEnabled:
|
7559
|
+
import z101 from "zod";
|
7560
|
+
var TimeSlotDataSchema = z101.any();
|
7561
|
+
var CreateBusinessHourSchema = z101.object({
|
7562
|
+
day: z101.string(),
|
7563
|
+
isEnabled: z101.boolean(),
|
7496
7564
|
timeSlots: TimeSlotDataSchema
|
7497
7565
|
}).array();
|
7498
|
-
var UpdateBusinessHourSchema =
|
7499
|
-
id:
|
7500
|
-
day:
|
7501
|
-
isEnabled:
|
7566
|
+
var UpdateBusinessHourSchema = z101.object({
|
7567
|
+
id: z101.string(),
|
7568
|
+
day: z101.string(),
|
7569
|
+
isEnabled: z101.boolean(),
|
7502
7570
|
timeSlots: TimeSlotDataSchema
|
7503
7571
|
}).array();
|
7504
|
-
var CreateHolidaySchema =
|
7505
|
-
name:
|
7506
|
-
date:
|
7507
|
-
isEnabled:
|
7572
|
+
var CreateHolidaySchema = z101.object({
|
7573
|
+
name: z101.string(),
|
7574
|
+
date: z101.string(),
|
7575
|
+
isEnabled: z101.boolean()
|
7508
7576
|
}).array();
|
7509
|
-
var UpdateHolidaySchema =
|
7510
|
-
id:
|
7511
|
-
name:
|
7512
|
-
date:
|
7513
|
-
isEnabled:
|
7577
|
+
var UpdateHolidaySchema = z101.object({
|
7578
|
+
id: z101.string().optional(),
|
7579
|
+
name: z101.string(),
|
7580
|
+
date: z101.string(),
|
7581
|
+
isEnabled: z101.boolean()
|
7514
7582
|
}).array();
|
7515
|
-
var CreateBusinessCalendarSchema =
|
7516
|
-
name:
|
7517
|
-
description:
|
7518
|
-
timeZone:
|
7519
|
-
isEnabled:
|
7583
|
+
var CreateBusinessCalendarSchema = z101.object({
|
7584
|
+
name: z101.string(),
|
7585
|
+
description: z101.string().optional(),
|
7586
|
+
timeZone: z101.string(),
|
7587
|
+
isEnabled: z101.boolean(),
|
7520
7588
|
businessHours: CreateBusinessHourSchema,
|
7521
7589
|
holidays: CreateHolidaySchema
|
7522
7590
|
});
|
7523
|
-
var UpdateBusinessCalendarSchema =
|
7524
|
-
id:
|
7525
|
-
name:
|
7526
|
-
description:
|
7527
|
-
timeZone:
|
7528
|
-
isEnabled:
|
7591
|
+
var UpdateBusinessCalendarSchema = z101.object({
|
7592
|
+
id: z101.string(),
|
7593
|
+
name: z101.string(),
|
7594
|
+
description: z101.string().optional(),
|
7595
|
+
timeZone: z101.string(),
|
7596
|
+
isEnabled: z101.boolean(),
|
7529
7597
|
businessHours: UpdateBusinessHourSchema,
|
7530
7598
|
holidays: UpdateHolidaySchema
|
7531
7599
|
});
|
7532
|
-
var DeleteBusinessCalendarSchema =
|
7533
|
-
id:
|
7600
|
+
var DeleteBusinessCalendarSchema = z101.object({
|
7601
|
+
id: z101.string()
|
7534
7602
|
});
|
7535
7603
|
|
7536
7604
|
// src/business-calendar/schema.ts
|
7537
|
-
import
|
7538
|
-
var TimeSlotDataSchema2 =
|
7605
|
+
import z102 from "zod";
|
7606
|
+
var TimeSlotDataSchema2 = z102.any();
|
7539
7607
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
7540
|
-
day:
|
7541
|
-
isEnabled:
|
7608
|
+
day: z102.string(),
|
7609
|
+
isEnabled: z102.boolean(),
|
7542
7610
|
timeSlots: TimeSlotDataSchema2
|
7543
7611
|
});
|
7544
7612
|
var HolidaySchema = DefaultEntitySchema.extend({
|
7545
|
-
name:
|
7546
|
-
date:
|
7547
|
-
isEnabled:
|
7548
|
-
isDefault:
|
7613
|
+
name: z102.string(),
|
7614
|
+
date: z102.string(),
|
7615
|
+
isEnabled: z102.boolean(),
|
7616
|
+
isDefault: z102.boolean()
|
7549
7617
|
});
|
7550
7618
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
7551
|
-
name:
|
7552
|
-
description:
|
7553
|
-
timeZone:
|
7554
|
-
isEnabled:
|
7555
|
-
isDefault:
|
7619
|
+
name: z102.string(),
|
7620
|
+
description: z102.string().optional(),
|
7621
|
+
timeZone: z102.string(),
|
7622
|
+
isEnabled: z102.boolean(),
|
7623
|
+
isDefault: z102.boolean(),
|
7556
7624
|
businessHours: BusinessHourSchema.array(),
|
7557
7625
|
holidays: HolidaySchema.array()
|
7558
7626
|
});
|
7559
7627
|
|
7560
7628
|
// src/business-calendar/index.ts
|
7561
|
-
import
|
7629
|
+
import z103 from "zod";
|
7562
7630
|
var businessCalendarContract = initContract36().router({
|
7563
7631
|
createBusinessCalendar: {
|
7564
7632
|
method: "POST",
|
@@ -7584,7 +7652,7 @@ var businessCalendarContract = initContract36().router({
|
|
7584
7652
|
updateBusinessCalendar: {
|
7585
7653
|
method: "POST",
|
7586
7654
|
path: "business-calendars/:id",
|
7587
|
-
pathParams:
|
7655
|
+
pathParams: z103.object({ id: z103.string() }),
|
7588
7656
|
body: UpdateBusinessCalendarSchema,
|
7589
7657
|
responses: {
|
7590
7658
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -7596,7 +7664,7 @@ var businessCalendarContract = initContract36().router({
|
|
7596
7664
|
deleteBusinessCalendar: {
|
7597
7665
|
method: "DELETE",
|
7598
7666
|
path: "business-calendars/:id",
|
7599
|
-
pathParams:
|
7667
|
+
pathParams: z103.object({ id: z103.string() }),
|
7600
7668
|
body: null,
|
7601
7669
|
responses: {
|
7602
7670
|
200: DefaultSuccessResponseSchema,
|
@@ -7609,73 +7677,73 @@ var businessCalendarContract = initContract36().router({
|
|
7609
7677
|
import { initContract as initContract37 } from "@ts-rest/core";
|
7610
7678
|
|
7611
7679
|
// src/facebook-feed/validation.ts
|
7612
|
-
import
|
7613
|
-
var GetFacebookPagesSchema2 =
|
7614
|
-
data:
|
7615
|
-
|
7680
|
+
import z104 from "zod";
|
7681
|
+
var GetFacebookPagesSchema2 = z104.object({
|
7682
|
+
data: z104.array(
|
7683
|
+
z104.object({
|
7616
7684
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
7617
|
-
access_token:
|
7618
|
-
category:
|
7685
|
+
access_token: z104.string(),
|
7686
|
+
category: z104.string(),
|
7619
7687
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
7620
|
-
category_list:
|
7621
|
-
|
7622
|
-
id:
|
7623
|
-
name:
|
7688
|
+
category_list: z104.array(
|
7689
|
+
z104.object({
|
7690
|
+
id: z104.string(),
|
7691
|
+
name: z104.string()
|
7624
7692
|
})
|
7625
7693
|
),
|
7626
|
-
id:
|
7627
|
-
name:
|
7628
|
-
tasks:
|
7694
|
+
id: z104.string(),
|
7695
|
+
name: z104.string(),
|
7696
|
+
tasks: z104.string().array()
|
7629
7697
|
})
|
7630
7698
|
),
|
7631
|
-
paging:
|
7632
|
-
cursors:
|
7633
|
-
before:
|
7634
|
-
after:
|
7699
|
+
paging: z104.object({
|
7700
|
+
cursors: z104.object({
|
7701
|
+
before: z104.string().optional(),
|
7702
|
+
after: z104.string().optional()
|
7635
7703
|
})
|
7636
7704
|
}).optional()
|
7637
7705
|
});
|
7638
|
-
var GetFacebookPagesQuerySchema2 =
|
7639
|
-
accessToken:
|
7640
|
-
userId:
|
7706
|
+
var GetFacebookPagesQuerySchema2 = z104.object({
|
7707
|
+
accessToken: z104.string(),
|
7708
|
+
userId: z104.string()
|
7641
7709
|
});
|
7642
7710
|
var ReconnectFacebookFeedSchema = ChannelSchema.merge(
|
7643
|
-
|
7644
|
-
isReloginRequired:
|
7645
|
-
platformContacts:
|
7646
|
-
id:
|
7647
|
-
name:
|
7648
|
-
createdAt:
|
7649
|
-
updatedAt:
|
7650
|
-
deletedAt:
|
7711
|
+
z104.object({
|
7712
|
+
isReloginRequired: z104.boolean(),
|
7713
|
+
platformContacts: z104.array(PlatformContactSchema),
|
7714
|
+
id: z104.string().uuid(),
|
7715
|
+
name: z104.string(),
|
7716
|
+
createdAt: z104.date(),
|
7717
|
+
updatedAt: z104.date(),
|
7718
|
+
deletedAt: z104.date().nullable()
|
7651
7719
|
})
|
7652
7720
|
);
|
7653
|
-
var GetFeedPostResponseSchema =
|
7654
|
-
id:
|
7655
|
-
message:
|
7656
|
-
created_time:
|
7657
|
-
can_reply_privately:
|
7658
|
-
from:
|
7659
|
-
permalink_url:
|
7660
|
-
attachments:
|
7661
|
-
data:
|
7662
|
-
|
7663
|
-
media:
|
7664
|
-
image:
|
7665
|
-
height:
|
7666
|
-
src:
|
7667
|
-
width:
|
7721
|
+
var GetFeedPostResponseSchema = z104.object({
|
7722
|
+
id: z104.string(),
|
7723
|
+
message: z104.string(),
|
7724
|
+
created_time: z104.string(),
|
7725
|
+
can_reply_privately: z104.boolean(),
|
7726
|
+
from: z104.object({ name: z104.string(), id: z104.string() }),
|
7727
|
+
permalink_url: z104.string(),
|
7728
|
+
attachments: z104.object({
|
7729
|
+
data: z104.array(
|
7730
|
+
z104.object({
|
7731
|
+
media: z104.object({
|
7732
|
+
image: z104.object({
|
7733
|
+
height: z104.number(),
|
7734
|
+
src: z104.string(),
|
7735
|
+
width: z104.number()
|
7668
7736
|
})
|
7669
7737
|
}),
|
7670
|
-
media_type:
|
7671
|
-
url:
|
7738
|
+
media_type: z104.string(),
|
7739
|
+
url: z104.string()
|
7672
7740
|
})
|
7673
7741
|
)
|
7674
7742
|
})
|
7675
7743
|
});
|
7676
7744
|
|
7677
7745
|
// src/facebook-feed/index.ts
|
7678
|
-
import
|
7746
|
+
import z105 from "zod";
|
7679
7747
|
var facebookFeedContract = initContract37().router({
|
7680
7748
|
connectToService: {
|
7681
7749
|
method: "POST",
|
@@ -7700,8 +7768,8 @@ var facebookFeedContract = initContract37().router({
|
|
7700
7768
|
reconnect: {
|
7701
7769
|
method: "POST",
|
7702
7770
|
path: "/reconnect/:channelId",
|
7703
|
-
pathParams:
|
7704
|
-
channelId:
|
7771
|
+
pathParams: z105.object({
|
7772
|
+
channelId: z105.string().uuid()
|
7705
7773
|
}),
|
7706
7774
|
body: null,
|
7707
7775
|
responses: {
|
@@ -7713,8 +7781,8 @@ var facebookFeedContract = initContract37().router({
|
|
7713
7781
|
delete: {
|
7714
7782
|
method: "DELETE",
|
7715
7783
|
path: "/delete/:channelId",
|
7716
|
-
pathParams:
|
7717
|
-
channelId:
|
7784
|
+
pathParams: z105.object({
|
7785
|
+
channelId: z105.string().uuid()
|
7718
7786
|
}),
|
7719
7787
|
body: null,
|
7720
7788
|
responses: {
|
@@ -7766,168 +7834,168 @@ var facebookFeedContract = initContract37().router({
|
|
7766
7834
|
|
7767
7835
|
// src/public-api/index.ts
|
7768
7836
|
import { initContract as initContract38 } from "@ts-rest/core";
|
7769
|
-
import
|
7837
|
+
import z108 from "zod";
|
7770
7838
|
|
7771
7839
|
// src/public-api/validation.ts
|
7772
|
-
import
|
7840
|
+
import z107 from "zod";
|
7773
7841
|
|
7774
7842
|
// src/public-api/schema.ts
|
7775
|
-
import
|
7776
|
-
var ContactPhonesSchema2 =
|
7777
|
-
id:
|
7778
|
-
createdAt:
|
7779
|
-
updatedAt:
|
7780
|
-
deletedAt:
|
7781
|
-
phone:
|
7782
|
-
isPrimary:
|
7783
|
-
});
|
7784
|
-
var ContactEmailsSchema2 =
|
7785
|
-
id:
|
7786
|
-
createdAt:
|
7787
|
-
updatedAt:
|
7788
|
-
deletedAt:
|
7789
|
-
email:
|
7790
|
-
isPrimary:
|
7791
|
-
});
|
7792
|
-
var ContactCustomFieldSchema2 =
|
7793
|
-
id:
|
7794
|
-
createdAt:
|
7795
|
-
updatedAt:
|
7796
|
-
deletedAt:
|
7797
|
-
textValue:
|
7798
|
-
booleanValue:
|
7799
|
-
numberValue:
|
7800
|
-
dateValue:
|
7843
|
+
import z106 from "zod";
|
7844
|
+
var ContactPhonesSchema2 = z106.object({
|
7845
|
+
id: z106.string().uuid(),
|
7846
|
+
createdAt: z106.date(),
|
7847
|
+
updatedAt: z106.date(),
|
7848
|
+
deletedAt: z106.date().nullable(),
|
7849
|
+
phone: z106.string(),
|
7850
|
+
isPrimary: z106.boolean()
|
7851
|
+
});
|
7852
|
+
var ContactEmailsSchema2 = z106.object({
|
7853
|
+
id: z106.string().uuid(),
|
7854
|
+
createdAt: z106.date(),
|
7855
|
+
updatedAt: z106.date(),
|
7856
|
+
deletedAt: z106.date().nullable(),
|
7857
|
+
email: z106.string(),
|
7858
|
+
isPrimary: z106.boolean()
|
7859
|
+
});
|
7860
|
+
var ContactCustomFieldSchema2 = z106.object({
|
7861
|
+
id: z106.string().uuid(),
|
7862
|
+
createdAt: z106.date(),
|
7863
|
+
updatedAt: z106.date(),
|
7864
|
+
deletedAt: z106.date().nullable(),
|
7865
|
+
textValue: z106.string().nullable(),
|
7866
|
+
booleanValue: z106.boolean().nullable(),
|
7867
|
+
numberValue: z106.number().nullable(),
|
7868
|
+
dateValue: z106.date().nullable(),
|
7801
7869
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
7802
|
-
uploads:
|
7803
|
-
});
|
7804
|
-
var ContactEntityTypesSchema2 =
|
7805
|
-
id:
|
7806
|
-
createdAt:
|
7807
|
-
updatedAt:
|
7808
|
-
deletedAt:
|
7809
|
-
entity:
|
7810
|
-
description:
|
7811
|
-
});
|
7812
|
-
var ContactActivitySchema2 =
|
7813
|
-
id:
|
7814
|
-
createdAt:
|
7815
|
-
updatedAt:
|
7816
|
-
deletedAt:
|
7817
|
-
entityId:
|
7818
|
-
description:
|
7870
|
+
uploads: z106.array(UploadSchema)
|
7871
|
+
});
|
7872
|
+
var ContactEntityTypesSchema2 = z106.object({
|
7873
|
+
id: z106.string().uuid(),
|
7874
|
+
createdAt: z106.date(),
|
7875
|
+
updatedAt: z106.date(),
|
7876
|
+
deletedAt: z106.date().nullable(),
|
7877
|
+
entity: z106.string(),
|
7878
|
+
description: z106.string().nullable()
|
7879
|
+
});
|
7880
|
+
var ContactActivitySchema2 = z106.object({
|
7881
|
+
id: z106.string().uuid(),
|
7882
|
+
createdAt: z106.date(),
|
7883
|
+
updatedAt: z106.date(),
|
7884
|
+
deletedAt: z106.date().nullable(),
|
7885
|
+
entityId: z106.string(),
|
7886
|
+
description: z106.string(),
|
7819
7887
|
entityType: ContactEntityTypesSchema2
|
7820
7888
|
});
|
7821
|
-
var ContactSchema2 =
|
7822
|
-
id:
|
7823
|
-
createdAt:
|
7824
|
-
updatedAt:
|
7825
|
-
deletedAt:
|
7826
|
-
name:
|
7827
|
-
address:
|
7828
|
-
channel:
|
7829
|
-
notes:
|
7830
|
-
contactProfile:
|
7831
|
-
socialProfileUrl:
|
7832
|
-
tags:
|
7889
|
+
var ContactSchema2 = z106.object({
|
7890
|
+
id: z106.string().uuid(),
|
7891
|
+
createdAt: z106.date(),
|
7892
|
+
updatedAt: z106.date(),
|
7893
|
+
deletedAt: z106.date().nullable(),
|
7894
|
+
name: z106.string(),
|
7895
|
+
address: z106.string().nullable(),
|
7896
|
+
channel: z106.string().nullable(),
|
7897
|
+
notes: z106.string().nullable(),
|
7898
|
+
contactProfile: z106.string().nullable(),
|
7899
|
+
socialProfileUrl: z106.string().nullable(),
|
7900
|
+
tags: z106.array(TagSchema),
|
7833
7901
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
7834
|
-
customFields:
|
7835
|
-
contactEmails:
|
7836
|
-
contactPhones:
|
7837
|
-
activityLogs:
|
7902
|
+
customFields: z106.array(ContactCustomFieldSchema2),
|
7903
|
+
contactEmails: z106.array(ContactEmailsSchema2),
|
7904
|
+
contactPhones: z106.array(ContactPhonesSchema2),
|
7905
|
+
activityLogs: z106.array(ContactActivitySchema2).optional()
|
7838
7906
|
});
|
7839
7907
|
|
7840
7908
|
// src/public-api/validation.ts
|
7841
7909
|
var ContactContractValidationSchema2 = {
|
7842
7910
|
create: {
|
7843
|
-
request:
|
7844
|
-
name:
|
7845
|
-
email:
|
7846
|
-
|
7847
|
-
email:
|
7848
|
-
isPrimary:
|
7911
|
+
request: z107.object({
|
7912
|
+
name: z107.string(),
|
7913
|
+
email: z107.array(
|
7914
|
+
z107.object({
|
7915
|
+
email: z107.string().email(),
|
7916
|
+
isPrimary: z107.boolean()
|
7849
7917
|
})
|
7850
7918
|
).optional(),
|
7851
|
-
channel:
|
7852
|
-
address:
|
7853
|
-
phone:
|
7854
|
-
|
7855
|
-
phone:
|
7856
|
-
isPrimary:
|
7919
|
+
channel: z107.string().optional(),
|
7920
|
+
address: z107.string().optional(),
|
7921
|
+
phone: z107.array(
|
7922
|
+
z107.object({
|
7923
|
+
phone: z107.string(),
|
7924
|
+
isPrimary: z107.boolean()
|
7857
7925
|
})
|
7858
7926
|
).optional(),
|
7859
|
-
notes:
|
7860
|
-
tags:
|
7861
|
-
company:
|
7862
|
-
customFields:
|
7927
|
+
notes: z107.string().optional(),
|
7928
|
+
tags: z107.array(z107.string()).optional(),
|
7929
|
+
company: z107.string().optional(),
|
7930
|
+
customFields: z107.record(z107.string())
|
7863
7931
|
// Dynamic keys with string values
|
7864
7932
|
}),
|
7865
7933
|
response: ContactSchema2
|
7866
7934
|
},
|
7867
7935
|
getById: {
|
7868
|
-
request:
|
7869
|
-
id:
|
7936
|
+
request: z107.object({
|
7937
|
+
id: z107.string().uuid()
|
7870
7938
|
})
|
7871
7939
|
},
|
7872
7940
|
delete: {
|
7873
|
-
request:
|
7874
|
-
id:
|
7941
|
+
request: z107.object({
|
7942
|
+
id: z107.string().uuid()
|
7875
7943
|
})
|
7876
7944
|
},
|
7877
7945
|
getAll: {
|
7878
|
-
request:
|
7879
|
-
page:
|
7880
|
-
pageSize:
|
7881
|
-
keyword:
|
7882
|
-
company:
|
7883
|
-
name:
|
7884
|
-
address:
|
7885
|
-
channel:
|
7886
|
-
selectedDate:
|
7887
|
-
customFields:
|
7888
|
-
|
7889
|
-
attributeId:
|
7890
|
-
type:
|
7891
|
-
value:
|
7946
|
+
request: z107.object({
|
7947
|
+
page: z107.coerce.number().default(1),
|
7948
|
+
pageSize: z107.coerce.number().default(10),
|
7949
|
+
keyword: z107.string().optional(),
|
7950
|
+
company: z107.array(z107.string().uuid()),
|
7951
|
+
name: z107.string(),
|
7952
|
+
address: z107.string(),
|
7953
|
+
channel: z107.array(z107.string()),
|
7954
|
+
selectedDate: z107.string(),
|
7955
|
+
customFields: z107.array(
|
7956
|
+
z107.object({
|
7957
|
+
attributeId: z107.string().uuid(),
|
7958
|
+
type: z107.string(),
|
7959
|
+
value: z107.union([z107.string(), z107.array(z107.string())])
|
7892
7960
|
})
|
7893
7961
|
),
|
7894
|
-
tags:
|
7895
|
-
phone:
|
7896
|
-
email:
|
7897
|
-
notes:
|
7962
|
+
tags: z107.array(z107.string().uuid()),
|
7963
|
+
phone: z107.string(),
|
7964
|
+
email: z107.string(),
|
7965
|
+
notes: z107.string()
|
7898
7966
|
}).partial(),
|
7899
7967
|
response: {
|
7900
|
-
page:
|
7901
|
-
pageSize:
|
7902
|
-
total:
|
7903
|
-
lastPage:
|
7904
|
-
data:
|
7968
|
+
page: z107.number(),
|
7969
|
+
pageSize: z107.number(),
|
7970
|
+
total: z107.number(),
|
7971
|
+
lastPage: z107.number(),
|
7972
|
+
data: z107.array(ContactSchema2)
|
7905
7973
|
}
|
7906
7974
|
},
|
7907
7975
|
getContactFields: {
|
7908
|
-
request:
|
7909
|
-
page:
|
7910
|
-
pageSize:
|
7976
|
+
request: z107.object({
|
7977
|
+
page: z107.coerce.number().default(1),
|
7978
|
+
pageSize: z107.coerce.number().default(10)
|
7911
7979
|
}).partial(),
|
7912
7980
|
response: {
|
7913
|
-
page:
|
7914
|
-
pageSize:
|
7915
|
-
total:
|
7916
|
-
lastPage:
|
7917
|
-
data:
|
7981
|
+
page: z107.number(),
|
7982
|
+
pageSize: z107.number(),
|
7983
|
+
total: z107.number(),
|
7984
|
+
lastPage: z107.number(),
|
7985
|
+
data: z107.array(ContactCustomFieldSchema2)
|
7918
7986
|
}
|
7919
7987
|
},
|
7920
7988
|
addAttachments: {
|
7921
|
-
request:
|
7922
|
-
contactId:
|
7923
|
-
attributeId:
|
7924
|
-
contactAttachmentRecords:
|
7925
|
-
|
7926
|
-
bucketName:
|
7927
|
-
fileKey:
|
7928
|
-
fileName:
|
7929
|
-
fileSize:
|
7930
|
-
url:
|
7989
|
+
request: z107.object({
|
7990
|
+
contactId: z107.string(),
|
7991
|
+
attributeId: z107.string().uuid(),
|
7992
|
+
contactAttachmentRecords: z107.array(
|
7993
|
+
z107.object({
|
7994
|
+
bucketName: z107.string(),
|
7995
|
+
fileKey: z107.string(),
|
7996
|
+
fileName: z107.string(),
|
7997
|
+
fileSize: z107.coerce.number(),
|
7998
|
+
url: z107.string()
|
7931
7999
|
})
|
7932
8000
|
)
|
7933
8001
|
}),
|
@@ -7946,11 +8014,11 @@ var publicApiContract = initContract38().router(
|
|
7946
8014
|
201: DefaultSuccessResponseSchema.extend({
|
7947
8015
|
data: ContactSchema2
|
7948
8016
|
}),
|
7949
|
-
400:
|
7950
|
-
message:
|
8017
|
+
400: z108.object({
|
8018
|
+
message: z108.string()
|
7951
8019
|
}),
|
7952
|
-
409:
|
7953
|
-
message:
|
8020
|
+
409: z108.object({
|
8021
|
+
message: z108.string()
|
7954
8022
|
}),
|
7955
8023
|
401: DefaultUnauthorizedSchema,
|
7956
8024
|
404: DefaultNotFoundSchema,
|
@@ -7965,13 +8033,13 @@ var publicApiContract = initContract38().router(
|
|
7965
8033
|
query: GetTagsSchema,
|
7966
8034
|
responses: {
|
7967
8035
|
200: DefaultSuccessResponseSchema.extend({
|
7968
|
-
tags:
|
8036
|
+
tags: z108.array(TagSchema)
|
7969
8037
|
}),
|
7970
|
-
400:
|
7971
|
-
message:
|
8038
|
+
400: z108.object({
|
8039
|
+
message: z108.string()
|
7972
8040
|
}),
|
7973
|
-
409:
|
7974
|
-
message:
|
8041
|
+
409: z108.object({
|
8042
|
+
message: z108.string()
|
7975
8043
|
}),
|
7976
8044
|
401: DefaultUnauthorizedSchema,
|
7977
8045
|
404: DefaultNotFoundSchema,
|
@@ -7987,11 +8055,11 @@ var publicApiContract = initContract38().router(
|
|
7987
8055
|
200: DefaultSuccessResponseSchema.extend(
|
7988
8056
|
ContactContractValidationSchema2.getAll.response
|
7989
8057
|
),
|
7990
|
-
400:
|
7991
|
-
message:
|
8058
|
+
400: z108.object({
|
8059
|
+
message: z108.string()
|
7992
8060
|
}),
|
7993
|
-
409:
|
7994
|
-
message:
|
8061
|
+
409: z108.object({
|
8062
|
+
message: z108.string()
|
7995
8063
|
}),
|
7996
8064
|
401: DefaultUnauthorizedSchema,
|
7997
8065
|
404: DefaultNotFoundSchema,
|
@@ -8008,11 +8076,11 @@ var publicApiContract = initContract38().router(
|
|
8008
8076
|
200: DefaultSuccessResponseSchema.extend(
|
8009
8077
|
ContactContractValidationSchema2.getContactFields.response
|
8010
8078
|
),
|
8011
|
-
400:
|
8012
|
-
message:
|
8079
|
+
400: z108.object({
|
8080
|
+
message: z108.string()
|
8013
8081
|
}),
|
8014
|
-
409:
|
8015
|
-
message:
|
8082
|
+
409: z108.object({
|
8083
|
+
message: z108.string()
|
8016
8084
|
}),
|
8017
8085
|
401: DefaultUnauthorizedSchema,
|
8018
8086
|
404: DefaultNotFoundSchema,
|
@@ -8026,17 +8094,17 @@ var publicApiContract = initContract38().router(
|
|
8026
8094
|
path: "/contacts/:id",
|
8027
8095
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8028
8096
|
responses: {
|
8029
|
-
200:
|
8030
|
-
status:
|
8031
|
-
message:
|
8097
|
+
200: z108.object({
|
8098
|
+
status: z108.string(),
|
8099
|
+
message: z108.string(),
|
8032
8100
|
data: ContactSchema2,
|
8033
|
-
requestId:
|
8101
|
+
requestId: z108.string()
|
8034
8102
|
}),
|
8035
|
-
400:
|
8036
|
-
message:
|
8103
|
+
400: z108.object({
|
8104
|
+
message: z108.string()
|
8037
8105
|
}),
|
8038
|
-
409:
|
8039
|
-
message:
|
8106
|
+
409: z108.object({
|
8107
|
+
message: z108.string()
|
8040
8108
|
}),
|
8041
8109
|
401: DefaultUnauthorizedSchema,
|
8042
8110
|
404: DefaultNotFoundSchema,
|
@@ -8054,11 +8122,11 @@ var publicApiContract = initContract38().router(
|
|
8054
8122
|
201: DefaultSuccessResponseSchema.extend({
|
8055
8123
|
message: ContactCustomFieldSchema2
|
8056
8124
|
}),
|
8057
|
-
400:
|
8058
|
-
message:
|
8125
|
+
400: z108.object({
|
8126
|
+
message: z108.string()
|
8059
8127
|
}),
|
8060
|
-
409:
|
8061
|
-
message:
|
8128
|
+
409: z108.object({
|
8129
|
+
message: z108.string()
|
8062
8130
|
}),
|
8063
8131
|
401: DefaultUnauthorizedSchema,
|
8064
8132
|
404: DefaultNotFoundSchema,
|
@@ -8072,17 +8140,17 @@ var publicApiContract = initContract38().router(
|
|
8072
8140
|
path: "/contacts/:id",
|
8073
8141
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8074
8142
|
responses: {
|
8075
|
-
200:
|
8076
|
-
status:
|
8077
|
-
message:
|
8143
|
+
200: z108.object({
|
8144
|
+
status: z108.string(),
|
8145
|
+
message: z108.string(),
|
8078
8146
|
data: ContactSchema2,
|
8079
|
-
requestId:
|
8147
|
+
requestId: z108.string()
|
8080
8148
|
}),
|
8081
|
-
400:
|
8082
|
-
message:
|
8149
|
+
400: z108.object({
|
8150
|
+
message: z108.string()
|
8083
8151
|
}),
|
8084
|
-
409:
|
8085
|
-
message:
|
8152
|
+
409: z108.object({
|
8153
|
+
message: z108.string()
|
8086
8154
|
}),
|
8087
8155
|
401: DefaultUnauthorizedSchema,
|
8088
8156
|
404: DefaultNotFoundSchema,
|
@@ -8096,17 +8164,17 @@ var publicApiContract = initContract38().router(
|
|
8096
8164
|
path: "/contacts/:id",
|
8097
8165
|
pathParams: ContactContractValidationSchema2.delete.request,
|
8098
8166
|
responses: {
|
8099
|
-
200:
|
8100
|
-
status:
|
8101
|
-
message:
|
8167
|
+
200: z108.object({
|
8168
|
+
status: z108.string(),
|
8169
|
+
message: z108.string(),
|
8102
8170
|
data: ContactSchema2,
|
8103
|
-
requestId:
|
8171
|
+
requestId: z108.string()
|
8104
8172
|
}),
|
8105
|
-
400:
|
8106
|
-
message:
|
8173
|
+
400: z108.object({
|
8174
|
+
message: z108.string()
|
8107
8175
|
}),
|
8108
|
-
409:
|
8109
|
-
message:
|
8176
|
+
409: z108.object({
|
8177
|
+
message: z108.string()
|
8110
8178
|
}),
|
8111
8179
|
401: DefaultUnauthorizedSchema,
|
8112
8180
|
404: DefaultNotFoundSchema,
|
@@ -8124,17 +8192,17 @@ var publicApiContract = initContract38().router(
|
|
8124
8192
|
|
8125
8193
|
// src/workflow-rule/index.ts
|
8126
8194
|
import { initContract as initContract39 } from "@ts-rest/core";
|
8127
|
-
import
|
8195
|
+
import z109 from "zod";
|
8128
8196
|
var chatContract = initContract39().router(
|
8129
8197
|
{
|
8130
8198
|
updateAssignee: {
|
8131
8199
|
method: "POST",
|
8132
8200
|
path: "/room/assignee",
|
8133
|
-
body:
|
8134
|
-
assigneeId:
|
8135
|
-
roomId:
|
8136
|
-
workflowId:
|
8137
|
-
queueId:
|
8201
|
+
body: z109.object({
|
8202
|
+
assigneeId: z109.string().uuid().optional(),
|
8203
|
+
roomId: z109.string().uuid(),
|
8204
|
+
workflowId: z109.string().uuid(),
|
8205
|
+
queueId: z109.string().uuid().optional()
|
8138
8206
|
}),
|
8139
8207
|
responses: {
|
8140
8208
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8148,9 +8216,9 @@ var chatContract = initContract39().router(
|
|
8148
8216
|
autoReply: {
|
8149
8217
|
method: "POST",
|
8150
8218
|
path: "/message/send",
|
8151
|
-
body:
|
8152
|
-
roomId:
|
8153
|
-
message:
|
8219
|
+
body: z109.object({
|
8220
|
+
roomId: z109.string().uuid(),
|
8221
|
+
message: z109.string(),
|
8154
8222
|
messageType: WorkflowAutoReplyMessageTypeSchema
|
8155
8223
|
// workflowId: z.string().uuid(),
|
8156
8224
|
}),
|
@@ -8166,15 +8234,15 @@ var chatContract = initContract39().router(
|
|
8166
8234
|
solveRoom: {
|
8167
8235
|
method: "POST",
|
8168
8236
|
path: "/room/solve",
|
8169
|
-
body:
|
8170
|
-
roomId:
|
8171
|
-
disposition:
|
8172
|
-
workflowId:
|
8237
|
+
body: z109.object({
|
8238
|
+
roomId: z109.string(),
|
8239
|
+
disposition: z109.string(),
|
8240
|
+
workflowId: z109.string().uuid()
|
8173
8241
|
}),
|
8174
8242
|
responses: {
|
8175
8243
|
200: DefaultSuccessResponseSchema.extend({
|
8176
8244
|
data: RoomSchema.extend({
|
8177
|
-
solveMessage:
|
8245
|
+
solveMessage: z109.string()
|
8178
8246
|
})
|
8179
8247
|
}),
|
8180
8248
|
409: DefaultErrorResponseSchema
|
@@ -8184,9 +8252,9 @@ var chatContract = initContract39().router(
|
|
8184
8252
|
emitMessage: {
|
8185
8253
|
method: "POST",
|
8186
8254
|
path: "/message/emit",
|
8187
|
-
body:
|
8188
|
-
messageId:
|
8189
|
-
queueId:
|
8255
|
+
body: z109.object({
|
8256
|
+
messageId: z109.string().uuid(),
|
8257
|
+
queueId: z109.string().uuid().optional().nullable()
|
8190
8258
|
}),
|
8191
8259
|
responses: {
|
8192
8260
|
200: DefaultSuccessResponseSchema,
|
@@ -8197,16 +8265,16 @@ var chatContract = initContract39().router(
|
|
8197
8265
|
}
|
8198
8266
|
},
|
8199
8267
|
{
|
8200
|
-
baseHeaders:
|
8201
|
-
"x-tenant":
|
8202
|
-
"x-code":
|
8268
|
+
baseHeaders: z109.object({
|
8269
|
+
"x-tenant": z109.string({ required_error: "Tenant id is required" }),
|
8270
|
+
"x-code": z109.string().uuid().optional()
|
8203
8271
|
}),
|
8204
8272
|
pathPrefix: "chat"
|
8205
8273
|
}
|
8206
8274
|
);
|
8207
8275
|
|
8208
8276
|
// src/botpress/index.ts
|
8209
|
-
import
|
8277
|
+
import z110 from "zod";
|
8210
8278
|
import { initContract as initContract40 } from "@ts-rest/core";
|
8211
8279
|
var botpressContract = initContract40().router(
|
8212
8280
|
{
|
@@ -8225,7 +8293,7 @@ var botpressContract = initContract40().router(
|
|
8225
8293
|
path: "/",
|
8226
8294
|
responses: {
|
8227
8295
|
200: DefaultSuccessResponseSchema.extend({
|
8228
|
-
data:
|
8296
|
+
data: z110.array(BotpressBotSchema)
|
8229
8297
|
}),
|
8230
8298
|
500: DefaultErrorResponseSchema
|
8231
8299
|
}
|
@@ -8262,7 +8330,7 @@ var botContract = initContract40().router(
|
|
8262
8330
|
path: "/",
|
8263
8331
|
responses: {
|
8264
8332
|
200: DefaultSuccessResponseSchema.extend({
|
8265
|
-
data:
|
8333
|
+
data: z110.array(BotpressBotSchema)
|
8266
8334
|
}),
|
8267
8335
|
500: DefaultErrorResponseSchema
|
8268
8336
|
}
|
@@ -8275,14 +8343,15 @@ var botContract = initContract40().router(
|
|
8275
8343
|
|
8276
8344
|
// src/presence-status/index.ts
|
8277
8345
|
import { initContract as initContract41 } from "@ts-rest/core";
|
8278
|
-
import
|
8346
|
+
import z112 from "zod";
|
8279
8347
|
|
8280
8348
|
// src/presence-status/validation.ts
|
8281
|
-
import { z as
|
8282
|
-
var CreatePresenceStatusSchema =
|
8283
|
-
|
8284
|
-
|
8285
|
-
position:
|
8349
|
+
import { z as z111 } from "zod";
|
8350
|
+
var CreatePresenceStatusSchema = z111.object({
|
8351
|
+
systemName: PresenceStatusEnum,
|
8352
|
+
displayName: z111.string(),
|
8353
|
+
position: z111.number(),
|
8354
|
+
emoji: z111.string()
|
8286
8355
|
});
|
8287
8356
|
var UpdatePresenceStatusSchema = CreatePresenceStatusSchema;
|
8288
8357
|
|
@@ -8294,12 +8363,12 @@ var presenceStatusContract = initContract41().router(
|
|
8294
8363
|
path: "",
|
8295
8364
|
headers: DefaultHeaderSchema,
|
8296
8365
|
responses: {
|
8297
|
-
200:
|
8298
|
-
total:
|
8299
|
-
data:
|
8366
|
+
200: z112.object({
|
8367
|
+
total: z112.number(),
|
8368
|
+
data: z112.array(PresenceStatusSchema)
|
8300
8369
|
}),
|
8301
|
-
400:
|
8302
|
-
message:
|
8370
|
+
400: z112.object({
|
8371
|
+
message: z112.string()
|
8303
8372
|
}),
|
8304
8373
|
401: DefaultUnauthorizedSchema,
|
8305
8374
|
500: DefaultErrorResponseSchema
|
@@ -8315,8 +8384,8 @@ var presenceStatusContract = initContract41().router(
|
|
8315
8384
|
201: DefaultSuccessResponseSchema.extend({
|
8316
8385
|
presenceStatus: PresenceStatusSchema
|
8317
8386
|
}),
|
8318
|
-
400:
|
8319
|
-
message:
|
8387
|
+
400: z112.object({
|
8388
|
+
message: z112.string()
|
8320
8389
|
}),
|
8321
8390
|
401: DefaultUnauthorizedSchema,
|
8322
8391
|
404: DefaultNotFoundSchema,
|
@@ -8328,12 +8397,12 @@ var presenceStatusContract = initContract41().router(
|
|
8328
8397
|
getPresenceStatusById: {
|
8329
8398
|
method: "GET",
|
8330
8399
|
path: "/:id",
|
8331
|
-
pathParams:
|
8400
|
+
pathParams: z112.object({ id: z112.string() }),
|
8332
8401
|
headers: DefaultHeaderSchema,
|
8333
8402
|
responses: {
|
8334
8403
|
200: PresenceStatusSchema,
|
8335
|
-
400:
|
8336
|
-
message:
|
8404
|
+
400: z112.object({
|
8405
|
+
message: z112.string()
|
8337
8406
|
}),
|
8338
8407
|
401: DefaultUnauthorizedSchema,
|
8339
8408
|
404: DefaultNotFoundSchema,
|
@@ -8345,15 +8414,15 @@ var presenceStatusContract = initContract41().router(
|
|
8345
8414
|
updatePresenceStatus: {
|
8346
8415
|
method: "PATCH",
|
8347
8416
|
path: "/:id",
|
8348
|
-
pathParams:
|
8417
|
+
pathParams: z112.object({ id: z112.string() }),
|
8349
8418
|
headers: DefaultHeaderSchema,
|
8350
8419
|
body: UpdatePresenceStatusSchema,
|
8351
8420
|
responses: {
|
8352
8421
|
201: DefaultSuccessResponseSchema.extend({
|
8353
8422
|
presenceStatus: PresenceStatusSchema
|
8354
8423
|
}),
|
8355
|
-
400:
|
8356
|
-
message:
|
8424
|
+
400: z112.object({
|
8425
|
+
message: z112.string()
|
8357
8426
|
}),
|
8358
8427
|
401: DefaultUnauthorizedSchema,
|
8359
8428
|
404: DefaultNotFoundSchema,
|
@@ -8365,11 +8434,11 @@ var presenceStatusContract = initContract41().router(
|
|
8365
8434
|
deletePresenceStatus: {
|
8366
8435
|
method: "DELETE",
|
8367
8436
|
path: "/:id",
|
8368
|
-
pathParams:
|
8437
|
+
pathParams: z112.object({ id: z112.string() }),
|
8369
8438
|
headers: DefaultHeaderSchema,
|
8370
8439
|
body: null,
|
8371
8440
|
responses: {
|
8372
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
8441
|
+
200: DefaultSuccessResponseSchema.extend({ message: z112.string() }),
|
8373
8442
|
404: DefaultNotFoundSchema,
|
8374
8443
|
422: DefaultUnprocessibleSchema,
|
8375
8444
|
500: DefaultErrorResponseSchema
|
@@ -8382,7 +8451,7 @@ var presenceStatusContract = initContract41().router(
|
|
8382
8451
|
|
8383
8452
|
// src/whatsapp/index.ts
|
8384
8453
|
import { initContract as initContract42 } from "@ts-rest/core";
|
8385
|
-
import
|
8454
|
+
import z113 from "zod";
|
8386
8455
|
var whatsappContract = initContract42().router({
|
8387
8456
|
sendMessage: {
|
8388
8457
|
method: "POST",
|
@@ -8417,8 +8486,8 @@ var whatsappContract = initContract42().router({
|
|
8417
8486
|
reconnect: {
|
8418
8487
|
method: "POST",
|
8419
8488
|
path: "/reconnect/:channelId",
|
8420
|
-
pathParams:
|
8421
|
-
channelId:
|
8489
|
+
pathParams: z113.object({
|
8490
|
+
channelId: z113.string().uuid()
|
8422
8491
|
}),
|
8423
8492
|
body: null,
|
8424
8493
|
responses: {
|
@@ -8430,8 +8499,8 @@ var whatsappContract = initContract42().router({
|
|
8430
8499
|
delete: {
|
8431
8500
|
method: "DELETE",
|
8432
8501
|
path: "/delete/:channelId",
|
8433
|
-
pathParams:
|
8434
|
-
channelId:
|
8502
|
+
pathParams: z113.object({
|
8503
|
+
channelId: z113.string().uuid()
|
8435
8504
|
}),
|
8436
8505
|
body: null,
|
8437
8506
|
responses: {
|
@@ -8452,7 +8521,7 @@ var whatsappContract = initContract42().router({
|
|
8452
8521
|
},
|
8453
8522
|
createWaapi: {
|
8454
8523
|
method: "POST",
|
8455
|
-
path: "/
|
8524
|
+
path: "/mobile",
|
8456
8525
|
body: null,
|
8457
8526
|
responses: {
|
8458
8527
|
200: WaapiResponseSchema,
|
@@ -8462,7 +8531,7 @@ var whatsappContract = initContract42().router({
|
|
8462
8531
|
},
|
8463
8532
|
getWaapiQr: {
|
8464
8533
|
method: "GET",
|
8465
|
-
path: "/
|
8534
|
+
path: "/mobile/qr",
|
8466
8535
|
query: GetWaapiQrQuerySchema,
|
8467
8536
|
responses: {
|
8468
8537
|
200: WaapiQrResponseSchema,
|
@@ -8470,9 +8539,22 @@ var whatsappContract = initContract42().router({
|
|
8470
8539
|
400: DefaultErrorResponseSchema
|
8471
8540
|
}
|
8472
8541
|
},
|
8542
|
+
deleteWaapi: {
|
8543
|
+
method: "DELETE",
|
8544
|
+
path: "/mobile/:instanceId",
|
8545
|
+
pathParams: z113.object({
|
8546
|
+
instanceId: z113.string()
|
8547
|
+
}),
|
8548
|
+
body: z113.any().optional(),
|
8549
|
+
responses: {
|
8550
|
+
200: DefaultSuccessResponseSchema,
|
8551
|
+
500: DefaultErrorResponseSchema,
|
8552
|
+
400: DefaultErrorResponseSchema
|
8553
|
+
}
|
8554
|
+
},
|
8473
8555
|
sendSeenToWaapi: {
|
8474
8556
|
method: "POST",
|
8475
|
-
path: "/
|
8557
|
+
path: "/mobile/send-seen",
|
8476
8558
|
body: SendSeenToWaapiSchema,
|
8477
8559
|
responses: {
|
8478
8560
|
200: WaapiResponseSchema,
|
@@ -8671,7 +8753,7 @@ var presenceStatusContract2 = initContract43().router({
|
|
8671
8753
|
|
8672
8754
|
// src/general-setting/index.ts
|
8673
8755
|
import { initContract as initContract44 } from "@ts-rest/core";
|
8674
|
-
import
|
8756
|
+
import z114 from "zod";
|
8675
8757
|
var generalSettingContract = initContract44().router(
|
8676
8758
|
{
|
8677
8759
|
autoOpenedContactWidgetId: {
|
@@ -8679,20 +8761,20 @@ var generalSettingContract = initContract44().router(
|
|
8679
8761
|
method: "GET",
|
8680
8762
|
path: "/auto-opened-contact-widget-id",
|
8681
8763
|
responses: {
|
8682
|
-
200:
|
8683
|
-
autoOpenedContactWidgetId:
|
8764
|
+
200: z114.object({
|
8765
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
8684
8766
|
})
|
8685
8767
|
}
|
8686
8768
|
},
|
8687
8769
|
updateAutoOpenedContactWidgetId: {
|
8688
8770
|
method: "PATCH",
|
8689
8771
|
path: "/auto-opened-contact-widget-id",
|
8690
|
-
body:
|
8691
|
-
autoOpenedContactWidgetId:
|
8772
|
+
body: z114.object({
|
8773
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
8692
8774
|
}),
|
8693
8775
|
responses: {
|
8694
|
-
200:
|
8695
|
-
autoOpenedContactWidgetId:
|
8776
|
+
200: z114.object({
|
8777
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
8696
8778
|
})
|
8697
8779
|
}
|
8698
8780
|
}
|
@@ -8705,49 +8787,49 @@ var generalSettingContract = initContract44().router(
|
|
8705
8787
|
|
8706
8788
|
// src/automation-queue/index.ts
|
8707
8789
|
import { initContract as initContract45 } from "@ts-rest/core";
|
8708
|
-
import { z as
|
8790
|
+
import { z as z117 } from "zod";
|
8709
8791
|
|
8710
8792
|
// src/automation-queue/validation.ts
|
8711
|
-
import { z as
|
8712
|
-
var QueueDistributionStrategySchema =
|
8713
|
-
|
8714
|
-
|
8715
|
-
|
8716
|
-
|
8793
|
+
import { z as z115 } from "zod";
|
8794
|
+
var QueueDistributionStrategySchema = z115.union([
|
8795
|
+
z115.literal("round-robin"),
|
8796
|
+
z115.literal("fewest-assignments"),
|
8797
|
+
z115.literal("random"),
|
8798
|
+
z115.literal("notify-all")
|
8717
8799
|
]);
|
8718
|
-
var CreateAutomationQueueSchema =
|
8719
|
-
emoji:
|
8720
|
-
name:
|
8721
|
-
description:
|
8722
|
-
managerIds:
|
8723
|
-
agentIds:
|
8800
|
+
var CreateAutomationQueueSchema = z115.object({
|
8801
|
+
emoji: z115.string().emoji(),
|
8802
|
+
name: z115.string(),
|
8803
|
+
description: z115.string().nullable(),
|
8804
|
+
managerIds: z115.array(z115.string().uuid()).min(1),
|
8805
|
+
agentIds: z115.array(z115.string().uuid()).min(1),
|
8724
8806
|
distributionStrategy: QueueDistributionStrategySchema,
|
8725
|
-
maximumAssignPerAgent:
|
8807
|
+
maximumAssignPerAgent: z115.number().positive()
|
8726
8808
|
// ringTimeOut: z.number().positive(),
|
8727
8809
|
// retryInterval: z.number().positive(),
|
8728
8810
|
// queueTimeOut: z.number().positive(),
|
8729
8811
|
// isAssignmentDeniable: z.coerce.boolean(),
|
8730
8812
|
});
|
8731
8813
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
8732
|
-
var CheckHasAssignedRoomSchema =
|
8733
|
-
userId:
|
8734
|
-
queueId:
|
8814
|
+
var CheckHasAssignedRoomSchema = z115.object({
|
8815
|
+
userId: z115.string().uuid().optional(),
|
8816
|
+
queueId: z115.string().uuid().optional()
|
8735
8817
|
});
|
8736
8818
|
|
8737
8819
|
// src/automation-queue/schema.ts
|
8738
|
-
import { z as
|
8820
|
+
import { z as z116 } from "zod";
|
8739
8821
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
8740
|
-
emoji:
|
8741
|
-
name:
|
8742
|
-
description:
|
8822
|
+
emoji: z116.string(),
|
8823
|
+
name: z116.string(),
|
8824
|
+
description: z116.string().nullable(),
|
8743
8825
|
distributionStrategy: QueueDistributionStrategySchema,
|
8744
|
-
maximumAssignPerAgent:
|
8826
|
+
maximumAssignPerAgent: z116.number().positive(),
|
8745
8827
|
// ringTimeOut: z.number(),
|
8746
8828
|
// retryInterval: z.number(),
|
8747
8829
|
// queueTimeOut: z.number(),
|
8748
8830
|
// isAssignmentDeniable: z.boolean(),
|
8749
|
-
managers:
|
8750
|
-
agents:
|
8831
|
+
managers: z116.array(UserSchema),
|
8832
|
+
agents: z116.array(UserSchema)
|
8751
8833
|
});
|
8752
8834
|
|
8753
8835
|
// src/automation-queue/index.ts
|
@@ -8766,8 +8848,8 @@ var automationQueueContract = initContract45().router(
|
|
8766
8848
|
duplicateAutomationQueue: {
|
8767
8849
|
method: "POST",
|
8768
8850
|
path: "/:id/duplicate",
|
8769
|
-
pathParams:
|
8770
|
-
id:
|
8851
|
+
pathParams: z117.object({
|
8852
|
+
id: z117.string().uuid()
|
8771
8853
|
}),
|
8772
8854
|
body: null,
|
8773
8855
|
responses: {
|
@@ -8779,20 +8861,20 @@ var automationQueueContract = initContract45().router(
|
|
8779
8861
|
getAutomationQueues: {
|
8780
8862
|
method: "GET",
|
8781
8863
|
path: "",
|
8782
|
-
query:
|
8783
|
-
userId:
|
8864
|
+
query: z117.object({
|
8865
|
+
userId: z117.string().uuid().optional()
|
8784
8866
|
}).optional(),
|
8785
8867
|
responses: {
|
8786
8868
|
200: DefaultSuccessResponseSchema.extend({
|
8787
|
-
data:
|
8869
|
+
data: z117.array(AutomationQueueSchema)
|
8788
8870
|
})
|
8789
8871
|
}
|
8790
8872
|
},
|
8791
8873
|
getAutomationQueueById: {
|
8792
8874
|
method: "GET",
|
8793
8875
|
path: "/:id",
|
8794
|
-
pathParams:
|
8795
|
-
id:
|
8876
|
+
pathParams: z117.object({
|
8877
|
+
id: z117.string().uuid()
|
8796
8878
|
}),
|
8797
8879
|
responses: {
|
8798
8880
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8803,8 +8885,8 @@ var automationQueueContract = initContract45().router(
|
|
8803
8885
|
updateAutomationQueue: {
|
8804
8886
|
method: "PATCH",
|
8805
8887
|
path: "/:id",
|
8806
|
-
pathParams:
|
8807
|
-
id:
|
8888
|
+
pathParams: z117.object({
|
8889
|
+
id: z117.string().uuid()
|
8808
8890
|
}),
|
8809
8891
|
body: UpdateAutomationQueueSchema,
|
8810
8892
|
responses: {
|
@@ -8816,13 +8898,13 @@ var automationQueueContract = initContract45().router(
|
|
8816
8898
|
deleteAutomationQueue: {
|
8817
8899
|
method: "DELETE",
|
8818
8900
|
path: "/:id",
|
8819
|
-
pathParams:
|
8820
|
-
id:
|
8901
|
+
pathParams: z117.object({
|
8902
|
+
id: z117.string().uuid()
|
8821
8903
|
}),
|
8822
8904
|
body: null,
|
8823
8905
|
responses: {
|
8824
8906
|
200: DefaultSuccessResponseSchema.extend({
|
8825
|
-
message:
|
8907
|
+
message: z117.string()
|
8826
8908
|
})
|
8827
8909
|
}
|
8828
8910
|
},
|
@@ -8832,8 +8914,8 @@ var automationQueueContract = initContract45().router(
|
|
8832
8914
|
body: CheckHasAssignedRoomSchema,
|
8833
8915
|
responses: {
|
8834
8916
|
200: DefaultSuccessResponseSchema.extend({
|
8835
|
-
data:
|
8836
|
-
hasAssignedRoom:
|
8917
|
+
data: z117.object({
|
8918
|
+
hasAssignedRoom: z117.boolean()
|
8837
8919
|
})
|
8838
8920
|
})
|
8839
8921
|
}
|
@@ -8850,282 +8932,282 @@ import { initContract as initContract50 } from "@ts-rest/core";
|
|
8850
8932
|
|
8851
8933
|
// src/mail/room-contract.ts
|
8852
8934
|
import { initContract as initContract46 } from "@ts-rest/core";
|
8853
|
-
import
|
8935
|
+
import z122 from "zod";
|
8854
8936
|
|
8855
8937
|
// src/mail/schemas/room.schema.ts
|
8856
|
-
import
|
8938
|
+
import z120 from "zod";
|
8857
8939
|
|
8858
8940
|
// src/mail/schemas/account.schema.ts
|
8941
|
+
import z118 from "zod";
|
8942
|
+
var MailServerSchema = z118.object({
|
8943
|
+
id: z118.string(),
|
8944
|
+
createdAt: z118.date(),
|
8945
|
+
updatedAt: z118.date(),
|
8946
|
+
deletedAt: z118.date().nullable(),
|
8947
|
+
name: z118.string(),
|
8948
|
+
smtpHost: z118.string(),
|
8949
|
+
smtpPort: z118.number(),
|
8950
|
+
smtpTlsPort: z118.number(),
|
8951
|
+
useTlsForSmtp: z118.boolean(),
|
8952
|
+
imapHost: z118.string(),
|
8953
|
+
imapPort: z118.number(),
|
8954
|
+
imapTlsPort: z118.number(),
|
8955
|
+
useTlsForImap: z118.boolean()
|
8956
|
+
});
|
8957
|
+
var MailAccountSchema = z118.object({
|
8958
|
+
id: z118.string(),
|
8959
|
+
createdAt: z118.date(),
|
8960
|
+
updatedAt: z118.date(),
|
8961
|
+
deletedAt: z118.date().nullable(),
|
8962
|
+
name: z118.string(),
|
8963
|
+
address: z118.string(),
|
8964
|
+
accountId: z118.string(),
|
8965
|
+
mailServerId: z118.string(),
|
8966
|
+
mailServer: MailServerSchema,
|
8967
|
+
state: z118.union([
|
8968
|
+
z118.literal("init"),
|
8969
|
+
z118.literal("syncing"),
|
8970
|
+
z118.literal("connecting"),
|
8971
|
+
z118.literal("connected"),
|
8972
|
+
z118.literal("disconnected"),
|
8973
|
+
z118.literal("authenticationError"),
|
8974
|
+
z118.literal("connectError"),
|
8975
|
+
z118.literal("unset")
|
8976
|
+
])
|
8977
|
+
});
|
8978
|
+
var OAuth2AppSchema = z118.object({
|
8979
|
+
id: z118.string(),
|
8980
|
+
name: z118.string(),
|
8981
|
+
description: z118.string(),
|
8982
|
+
title: z118.string(),
|
8983
|
+
provider: z118.string(),
|
8984
|
+
enabled: z118.boolean(),
|
8985
|
+
legacy: z118.boolean(),
|
8986
|
+
created: z118.string(),
|
8987
|
+
updated: z118.string(),
|
8988
|
+
includeInListing: z118.boolean(),
|
8989
|
+
clientId: z118.string(),
|
8990
|
+
clientSecret: z118.string(),
|
8991
|
+
authority: z118.string(),
|
8992
|
+
redirectUrl: z118.string(),
|
8993
|
+
serviceClient: z118.string(),
|
8994
|
+
googleProjectId: z118.string(),
|
8995
|
+
serviceClientEmail: z118.string(),
|
8996
|
+
serviceKey: z118.string()
|
8997
|
+
});
|
8998
|
+
|
8999
|
+
// src/mail/schemas/message.schema.ts
|
8859
9000
|
import z119 from "zod";
|
8860
|
-
var
|
9001
|
+
var AttachmentSchema = z119.object({
|
8861
9002
|
id: z119.string(),
|
8862
9003
|
createdAt: z119.date(),
|
8863
9004
|
updatedAt: z119.date(),
|
8864
|
-
deletedAt: z119.
|
8865
|
-
|
8866
|
-
|
8867
|
-
|
8868
|
-
|
8869
|
-
|
8870
|
-
|
8871
|
-
|
8872
|
-
|
8873
|
-
|
8874
|
-
|
8875
|
-
|
9005
|
+
deletedAt: z119.nullable(z119.date()),
|
9006
|
+
roomId: z119.string(),
|
9007
|
+
messageId: z119.string(),
|
9008
|
+
fileName: z119.string(),
|
9009
|
+
fileType: z119.string(),
|
9010
|
+
emailEngineAttachmentId: z119.string(),
|
9011
|
+
uploadId: z119.string(),
|
9012
|
+
upload: z119.object({
|
9013
|
+
id: z119.string(),
|
9014
|
+
createdAt: z119.date(),
|
9015
|
+
updatedAt: z119.date(),
|
9016
|
+
deletedAt: z119.nullable(z119.date()),
|
9017
|
+
bucketName: z119.string(),
|
9018
|
+
fileName: z119.string(),
|
9019
|
+
fileKey: z119.string(),
|
9020
|
+
fileSize: z119.number(),
|
9021
|
+
fileUrl: z119.string(),
|
9022
|
+
extensionName: z119.string()
|
9023
|
+
})
|
9024
|
+
});
|
9025
|
+
var MessageSchema2 = z119.object({
|
8876
9026
|
id: z119.string(),
|
8877
9027
|
createdAt: z119.date(),
|
8878
9028
|
updatedAt: z119.date(),
|
8879
|
-
deletedAt: z119.
|
8880
|
-
|
8881
|
-
|
8882
|
-
|
8883
|
-
|
8884
|
-
|
8885
|
-
|
8886
|
-
|
8887
|
-
|
8888
|
-
|
8889
|
-
|
8890
|
-
|
8891
|
-
|
8892
|
-
|
8893
|
-
|
8894
|
-
|
8895
|
-
|
8896
|
-
|
8897
|
-
|
8898
|
-
|
8899
|
-
|
8900
|
-
title: z119.string(),
|
8901
|
-
provider: z119.string(),
|
8902
|
-
enabled: z119.boolean(),
|
8903
|
-
legacy: z119.boolean(),
|
8904
|
-
created: z119.string(),
|
8905
|
-
updated: z119.string(),
|
8906
|
-
includeInListing: z119.boolean(),
|
8907
|
-
clientId: z119.string(),
|
8908
|
-
clientSecret: z119.string(),
|
8909
|
-
authority: z119.string(),
|
8910
|
-
redirectUrl: z119.string(),
|
8911
|
-
serviceClient: z119.string(),
|
8912
|
-
googleProjectId: z119.string(),
|
8913
|
-
serviceClientEmail: z119.string(),
|
8914
|
-
serviceKey: z119.string()
|
9029
|
+
deletedAt: z119.nullable(z119.date()),
|
9030
|
+
roomId: z119.string(),
|
9031
|
+
subject: z119.string(),
|
9032
|
+
textPlain: z119.string(),
|
9033
|
+
textHtml: z119.string(),
|
9034
|
+
textId: z119.string(),
|
9035
|
+
emailEngineEmailId: z119.string(),
|
9036
|
+
emailEngineMessageId: z119.string(),
|
9037
|
+
emailEngineReplyTo: z119.nullable(z119.string()),
|
9038
|
+
direction: z119.string(),
|
9039
|
+
date: z119.date(),
|
9040
|
+
action: z119.string(),
|
9041
|
+
unseen: z119.boolean(),
|
9042
|
+
sendAt: z119.date(),
|
9043
|
+
starred: z119.boolean(),
|
9044
|
+
seemsLikeNew: z119.boolean(),
|
9045
|
+
from: z119.array(MailParticipant),
|
9046
|
+
to: z119.array(MailParticipant),
|
9047
|
+
cc: z119.array(MailParticipant),
|
9048
|
+
bcc: z119.array(MailParticipant),
|
9049
|
+
attachments: z119.array(AttachmentSchema)
|
8915
9050
|
});
|
8916
9051
|
|
8917
|
-
// src/mail/schemas/
|
8918
|
-
|
8919
|
-
|
9052
|
+
// src/mail/schemas/room.schema.ts
|
9053
|
+
var ContactSchema3 = z120.object({
|
9054
|
+
id: z120.string().uuid(),
|
9055
|
+
createdAt: z120.date(),
|
9056
|
+
updatedAt: z120.date(),
|
9057
|
+
deletedAt: z120.date().nullable(),
|
9058
|
+
name: z120.string(),
|
9059
|
+
address: z120.string().nullable(),
|
9060
|
+
channel: z120.string().nullable(),
|
9061
|
+
notes: z120.string().nullable(),
|
9062
|
+
contactProfile: z120.string().nullable(),
|
9063
|
+
socialProfileUrl: z120.string().nullable()
|
9064
|
+
});
|
9065
|
+
var MailUserSchema = z120.object({
|
9066
|
+
id: z120.string(),
|
9067
|
+
createdAt: z120.date(),
|
9068
|
+
updatedAt: z120.date(),
|
9069
|
+
deletedAt: z120.date().nullable(),
|
9070
|
+
name: z120.string(),
|
9071
|
+
address: z120.string(),
|
9072
|
+
contactId: z120.string(),
|
9073
|
+
contact: ContactSchema3,
|
9074
|
+
isNewContact: z120.boolean()
|
9075
|
+
});
|
9076
|
+
var MailParticipant = z120.object({
|
8920
9077
|
id: z120.string(),
|
8921
9078
|
createdAt: z120.date(),
|
8922
9079
|
updatedAt: z120.date(),
|
8923
|
-
deletedAt: z120.
|
9080
|
+
deletedAt: z120.date().nullable(),
|
8924
9081
|
roomId: z120.string(),
|
8925
9082
|
messageId: z120.string(),
|
8926
|
-
|
8927
|
-
|
8928
|
-
|
8929
|
-
|
8930
|
-
|
8931
|
-
|
8932
|
-
|
8933
|
-
|
8934
|
-
|
8935
|
-
|
8936
|
-
fileName: z120.string(),
|
8937
|
-
fileKey: z120.string(),
|
8938
|
-
fileSize: z120.number(),
|
8939
|
-
fileUrl: z120.string(),
|
8940
|
-
extensionName: z120.string()
|
8941
|
-
})
|
9083
|
+
mailUserId: z120.string(),
|
9084
|
+
mailUser: MailUserSchema
|
9085
|
+
});
|
9086
|
+
var TagSchema2 = z120.object({
|
9087
|
+
color: z120.string(),
|
9088
|
+
id: z120.string(),
|
9089
|
+
createdAt: z120.date(),
|
9090
|
+
updatedAt: z120.date(),
|
9091
|
+
deletedAt: z120.date().nullable(),
|
9092
|
+
name: z120.string()
|
8942
9093
|
});
|
8943
|
-
var
|
9094
|
+
var UserModel = z120.object({
|
9095
|
+
id: z120.string().uuid(),
|
9096
|
+
createdAt: z120.date(),
|
9097
|
+
updatedAt: z120.date(),
|
9098
|
+
deletedAt: z120.date().nullable(),
|
9099
|
+
name: z120.string(),
|
9100
|
+
email: z120.string(),
|
9101
|
+
address: z120.string().nullable(),
|
9102
|
+
phone: z120.string().nullable(),
|
9103
|
+
notificationCount: z120.number().nullable()
|
9104
|
+
});
|
9105
|
+
var ActivityLogModel = z120.object({
|
8944
9106
|
id: z120.string(),
|
8945
9107
|
createdAt: z120.date(),
|
8946
9108
|
updatedAt: z120.date(),
|
8947
|
-
deletedAt: z120.nullable(z120.
|
9109
|
+
deletedAt: z120.nullable(z120.string()),
|
9110
|
+
description: z120.string(),
|
9111
|
+
actorId: z120.string(),
|
8948
9112
|
roomId: z120.string(),
|
9113
|
+
actor: UserModel
|
9114
|
+
});
|
9115
|
+
var MessagesAndLogsSchema = z120.array(
|
9116
|
+
z120.union([MessageSchema2, ActivityLogModel])
|
9117
|
+
);
|
9118
|
+
var MailRoomSchema = z120.object({
|
9119
|
+
id: z120.string(),
|
9120
|
+
createdAt: z120.date(),
|
9121
|
+
updatedAt: z120.date(),
|
9122
|
+
deletedAt: z120.date().nullable(),
|
8949
9123
|
subject: z120.string(),
|
8950
|
-
|
8951
|
-
|
8952
|
-
|
8953
|
-
|
8954
|
-
emailEngineMessageId: z120.string(),
|
8955
|
-
emailEngineReplyTo: z120.nullable(z120.string()),
|
9124
|
+
resolved: z120.boolean(),
|
9125
|
+
assigneeId: z120.string().nullable(),
|
9126
|
+
note: z120.string(),
|
9127
|
+
mailId: z120.string(),
|
8956
9128
|
direction: z120.string(),
|
8957
|
-
|
8958
|
-
|
8959
|
-
unseen: z120.boolean(),
|
8960
|
-
sendAt: z120.date(),
|
8961
|
-
starred: z120.boolean(),
|
8962
|
-
seemsLikeNew: z120.boolean(),
|
9129
|
+
lastMessageId: z120.string(),
|
9130
|
+
firstMessageId: z120.string(),
|
8963
9131
|
from: z120.array(MailParticipant),
|
8964
9132
|
to: z120.array(MailParticipant),
|
8965
9133
|
cc: z120.array(MailParticipant),
|
8966
9134
|
bcc: z120.array(MailParticipant),
|
8967
|
-
attachments: z120.array(AttachmentSchema)
|
8968
|
-
});
|
8969
|
-
|
8970
|
-
// src/mail/schemas/room.schema.ts
|
8971
|
-
var ContactSchema3 = z121.object({
|
8972
|
-
id: z121.string().uuid(),
|
8973
|
-
createdAt: z121.date(),
|
8974
|
-
updatedAt: z121.date(),
|
8975
|
-
deletedAt: z121.date().nullable(),
|
8976
|
-
name: z121.string(),
|
8977
|
-
address: z121.string().nullable(),
|
8978
|
-
channel: z121.string().nullable(),
|
8979
|
-
notes: z121.string().nullable(),
|
8980
|
-
contactProfile: z121.string().nullable(),
|
8981
|
-
socialProfileUrl: z121.string().nullable()
|
8982
|
-
});
|
8983
|
-
var MailUserSchema = z121.object({
|
8984
|
-
id: z121.string(),
|
8985
|
-
createdAt: z121.date(),
|
8986
|
-
updatedAt: z121.date(),
|
8987
|
-
deletedAt: z121.date().nullable(),
|
8988
|
-
name: z121.string(),
|
8989
|
-
address: z121.string(),
|
8990
|
-
contactId: z121.string(),
|
8991
|
-
contact: ContactSchema3,
|
8992
|
-
isNewContact: z121.boolean()
|
8993
|
-
});
|
8994
|
-
var MailParticipant = z121.object({
|
8995
|
-
id: z121.string(),
|
8996
|
-
createdAt: z121.date(),
|
8997
|
-
updatedAt: z121.date(),
|
8998
|
-
deletedAt: z121.date().nullable(),
|
8999
|
-
roomId: z121.string(),
|
9000
|
-
messageId: z121.string(),
|
9001
|
-
mailUserId: z121.string(),
|
9002
|
-
mailUser: MailUserSchema
|
9003
|
-
});
|
9004
|
-
var TagSchema2 = z121.object({
|
9005
|
-
color: z121.string(),
|
9006
|
-
id: z121.string(),
|
9007
|
-
createdAt: z121.date(),
|
9008
|
-
updatedAt: z121.date(),
|
9009
|
-
deletedAt: z121.date().nullable(),
|
9010
|
-
name: z121.string()
|
9011
|
-
});
|
9012
|
-
var UserModel = z121.object({
|
9013
|
-
id: z121.string().uuid(),
|
9014
|
-
createdAt: z121.date(),
|
9015
|
-
updatedAt: z121.date(),
|
9016
|
-
deletedAt: z121.date().nullable(),
|
9017
|
-
name: z121.string(),
|
9018
|
-
email: z121.string(),
|
9019
|
-
address: z121.string().nullable(),
|
9020
|
-
phone: z121.string().nullable(),
|
9021
|
-
notificationCount: z121.number().nullable()
|
9022
|
-
});
|
9023
|
-
var ActivityLogModel = z121.object({
|
9024
|
-
id: z121.string(),
|
9025
|
-
createdAt: z121.date(),
|
9026
|
-
updatedAt: z121.date(),
|
9027
|
-
deletedAt: z121.nullable(z121.string()),
|
9028
|
-
description: z121.string(),
|
9029
|
-
actorId: z121.string(),
|
9030
|
-
roomId: z121.string(),
|
9031
|
-
actor: UserModel
|
9032
|
-
});
|
9033
|
-
var MessagesAndLogsSchema = z121.array(
|
9034
|
-
z121.union([MessageSchema2, ActivityLogModel])
|
9035
|
-
);
|
9036
|
-
var MailRoomSchema = z121.object({
|
9037
|
-
id: z121.string(),
|
9038
|
-
createdAt: z121.date(),
|
9039
|
-
updatedAt: z121.date(),
|
9040
|
-
deletedAt: z121.date().nullable(),
|
9041
|
-
subject: z121.string(),
|
9042
|
-
resolved: z121.boolean(),
|
9043
|
-
assigneeId: z121.string().nullable(),
|
9044
|
-
note: z121.string(),
|
9045
|
-
mailId: z121.string(),
|
9046
|
-
direction: z121.string(),
|
9047
|
-
lastMessageId: z121.string(),
|
9048
|
-
firstMessageId: z121.string(),
|
9049
|
-
from: z121.array(MailParticipant),
|
9050
|
-
to: z121.array(MailParticipant),
|
9051
|
-
cc: z121.array(MailParticipant),
|
9052
|
-
bcc: z121.array(MailParticipant),
|
9053
9135
|
firstMessage: MessageSchema2,
|
9054
9136
|
lastMessage: MessageSchema2,
|
9055
|
-
tags:
|
9137
|
+
tags: z120.array(TagSchema2),
|
9056
9138
|
assignee: UserModel,
|
9057
|
-
messages:
|
9139
|
+
messages: z120.array(MessageSchema2),
|
9058
9140
|
messagesAndLogs: MessagesAndLogsSchema,
|
9059
9141
|
mail: MailAccountSchema,
|
9060
|
-
unReadMessageCount:
|
9142
|
+
unReadMessageCount: z120.number(),
|
9061
9143
|
cxlog: CxLogSchema
|
9062
9144
|
});
|
9063
|
-
var AttachmentSchema2 =
|
9064
|
-
fileName:
|
9065
|
-
fileType:
|
9066
|
-
emailEngineAttachmentId:
|
9067
|
-
uploadId:
|
9068
|
-
messageId:
|
9069
|
-
roomId:
|
9145
|
+
var AttachmentSchema2 = z120.object({
|
9146
|
+
fileName: z120.string(),
|
9147
|
+
fileType: z120.string(),
|
9148
|
+
emailEngineAttachmentId: z120.string(),
|
9149
|
+
uploadId: z120.string(),
|
9150
|
+
messageId: z120.string(),
|
9151
|
+
roomId: z120.string(),
|
9070
9152
|
upload: UploadSchema
|
9071
9153
|
});
|
9072
9154
|
|
9073
9155
|
// src/mail/schemas/room-validation.schema.ts
|
9074
|
-
import
|
9156
|
+
import z121 from "zod";
|
9075
9157
|
var RoomContractsValidationSchema = {
|
9076
9158
|
getAll: {
|
9077
|
-
input:
|
9078
|
-
page:
|
9079
|
-
pageSize:
|
9080
|
-
keyword:
|
9081
|
-
value:
|
9082
|
-
category:
|
9159
|
+
input: z121.object({
|
9160
|
+
page: z121.coerce.number().default(1),
|
9161
|
+
pageSize: z121.coerce.number().default(10),
|
9162
|
+
keyword: z121.object({
|
9163
|
+
value: z121.string(),
|
9164
|
+
category: z121.union([z121.literal("contact"), z121.literal("message")])
|
9083
9165
|
}).optional(),
|
9084
|
-
contactLabels:
|
9085
|
-
channels:
|
9086
|
-
date:
|
9087
|
-
contacts:
|
9088
|
-
assignees:
|
9089
|
-
level1:
|
9090
|
-
|
9091
|
-
|
9092
|
-
|
9093
|
-
|
9094
|
-
|
9095
|
-
|
9166
|
+
contactLabels: z121.array(z121.string()).optional(),
|
9167
|
+
channels: z121.array(z121.string().email()).optional(),
|
9168
|
+
date: z121.string().optional(),
|
9169
|
+
contacts: z121.array(z121.string()).optional(),
|
9170
|
+
assignees: z121.array(z121.string()).optional(),
|
9171
|
+
level1: z121.union([
|
9172
|
+
z121.literal("open"),
|
9173
|
+
z121.literal("close"),
|
9174
|
+
z121.literal("inbox"),
|
9175
|
+
z121.literal("sent"),
|
9176
|
+
z121.literal("scheduled"),
|
9177
|
+
z121.literal("starred")
|
9096
9178
|
]).optional(),
|
9097
|
-
level2:
|
9098
|
-
|
9099
|
-
|
9100
|
-
|
9101
|
-
|
9179
|
+
level2: z121.union([
|
9180
|
+
z121.literal("all"),
|
9181
|
+
z121.literal("unassign"),
|
9182
|
+
z121.literal("mine"),
|
9183
|
+
z121.literal("other")
|
9102
9184
|
]).optional()
|
9103
9185
|
}),
|
9104
|
-
output:
|
9105
|
-
data:
|
9106
|
-
total:
|
9107
|
-
page:
|
9108
|
-
pageSize:
|
9186
|
+
output: z121.object({
|
9187
|
+
data: z121.array(MailRoomSchema),
|
9188
|
+
total: z121.number(),
|
9189
|
+
page: z121.number(),
|
9190
|
+
pageSize: z121.number()
|
9109
9191
|
})
|
9110
9192
|
},
|
9111
9193
|
update: {
|
9112
|
-
input:
|
9113
|
-
disposition:
|
9114
|
-
|
9115
|
-
|
9116
|
-
|
9117
|
-
|
9118
|
-
|
9119
|
-
|
9194
|
+
input: z121.object({
|
9195
|
+
disposition: z121.union([
|
9196
|
+
z121.literal("resolved"),
|
9197
|
+
z121.literal("follow up"),
|
9198
|
+
z121.literal("escalated"),
|
9199
|
+
z121.literal("dropped"),
|
9200
|
+
z121.literal("prank"),
|
9201
|
+
z121.literal("blank")
|
9120
9202
|
]).optional().nullable(),
|
9121
|
-
assigneeId:
|
9122
|
-
note:
|
9123
|
-
tags:
|
9124
|
-
handover:
|
9125
|
-
|
9203
|
+
assigneeId: z121.string().uuid().optional().nullable(),
|
9204
|
+
note: z121.string().optional(),
|
9205
|
+
tags: z121.array(z121.string().uuid()).optional(),
|
9206
|
+
handover: z121.boolean().or(
|
9207
|
+
z121.union([z121.literal("true"), z121.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9126
9208
|
).optional().nullable(),
|
9127
|
-
selfAssign:
|
9128
|
-
|
9209
|
+
selfAssign: z121.boolean().or(
|
9210
|
+
z121.union([z121.literal("true"), z121.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9129
9211
|
).optional().nullable()
|
9130
9212
|
})
|
9131
9213
|
}
|
@@ -9139,7 +9221,7 @@ var roomContract = initContract46().router(
|
|
9139
9221
|
path: "/",
|
9140
9222
|
responses: {
|
9141
9223
|
200: DefaultSuccessResponseSchema.extend({
|
9142
|
-
message:
|
9224
|
+
message: z122.string()
|
9143
9225
|
}),
|
9144
9226
|
...DefaultResponses
|
9145
9227
|
},
|
@@ -9152,10 +9234,10 @@ var roomContract = initContract46().router(
|
|
9152
9234
|
query: RoomContractsValidationSchema.getAll.input,
|
9153
9235
|
responses: {
|
9154
9236
|
200: DefaultSuccessResponseSchema.extend({
|
9155
|
-
data:
|
9156
|
-
total:
|
9157
|
-
page:
|
9158
|
-
pageSize:
|
9237
|
+
data: z122.array(MailRoomSchema),
|
9238
|
+
total: z122.number(),
|
9239
|
+
page: z122.number(),
|
9240
|
+
pageSize: z122.number()
|
9159
9241
|
}),
|
9160
9242
|
...DefaultResponses
|
9161
9243
|
},
|
@@ -9167,24 +9249,24 @@ var roomContract = initContract46().router(
|
|
9167
9249
|
path: "/count_rooms/all",
|
9168
9250
|
responses: {
|
9169
9251
|
200: DefaultSuccessResponseSchema.extend({
|
9170
|
-
data:
|
9171
|
-
general:
|
9172
|
-
|
9173
|
-
name:
|
9174
|
-
count:
|
9175
|
-
unReadMessagesCount:
|
9252
|
+
data: z122.object({
|
9253
|
+
general: z122.array(
|
9254
|
+
z122.object({
|
9255
|
+
name: z122.string(),
|
9256
|
+
count: z122.number(),
|
9257
|
+
unReadMessagesCount: z122.number()
|
9176
9258
|
})
|
9177
9259
|
),
|
9178
|
-
channels:
|
9179
|
-
|
9260
|
+
channels: z122.array(
|
9261
|
+
z122.object({
|
9180
9262
|
channel: MailAccountSchema,
|
9181
|
-
count:
|
9263
|
+
count: z122.number()
|
9182
9264
|
})
|
9183
9265
|
),
|
9184
|
-
contactLabels:
|
9185
|
-
|
9266
|
+
contactLabels: z122.array(
|
9267
|
+
z122.object({
|
9186
9268
|
label: TagSchema,
|
9187
|
-
count:
|
9269
|
+
count: z122.number()
|
9188
9270
|
})
|
9189
9271
|
)
|
9190
9272
|
})
|
@@ -9196,12 +9278,12 @@ var roomContract = initContract46().router(
|
|
9196
9278
|
getAttachments: {
|
9197
9279
|
method: "GET",
|
9198
9280
|
path: "/:id/attachments",
|
9199
|
-
pathParams:
|
9200
|
-
id:
|
9281
|
+
pathParams: z122.object({
|
9282
|
+
id: z122.string().uuid()
|
9201
9283
|
}),
|
9202
9284
|
responses: {
|
9203
9285
|
200: DefaultSuccessResponseSchema.extend({
|
9204
|
-
data:
|
9286
|
+
data: z122.array(AttachmentSchema2)
|
9205
9287
|
}),
|
9206
9288
|
...DefaultResponses
|
9207
9289
|
},
|
@@ -9210,12 +9292,12 @@ var roomContract = initContract46().router(
|
|
9210
9292
|
getParticipants: {
|
9211
9293
|
method: "GET",
|
9212
9294
|
path: "/:id/participants",
|
9213
|
-
pathParams:
|
9214
|
-
id:
|
9295
|
+
pathParams: z122.object({
|
9296
|
+
id: z122.string().uuid()
|
9215
9297
|
}),
|
9216
9298
|
responses: {
|
9217
9299
|
200: DefaultSuccessResponseSchema.extend({
|
9218
|
-
data:
|
9300
|
+
data: z122.array(MailParticipant)
|
9219
9301
|
}),
|
9220
9302
|
...DefaultResponses
|
9221
9303
|
},
|
@@ -9226,22 +9308,22 @@ var roomContract = initContract46().router(
|
|
9226
9308
|
path: "/add_email_to_contact",
|
9227
9309
|
responses: {
|
9228
9310
|
200: DefaultSuccessResponseSchema.extend({
|
9229
|
-
data:
|
9311
|
+
data: z122.string()
|
9230
9312
|
}),
|
9231
9313
|
...DefaultResponses
|
9232
9314
|
},
|
9233
|
-
body:
|
9234
|
-
email:
|
9235
|
-
contactId:
|
9236
|
-
mailUserId:
|
9315
|
+
body: z122.object({
|
9316
|
+
email: z122.string(),
|
9317
|
+
contactId: z122.string(),
|
9318
|
+
mailUserId: z122.string()
|
9237
9319
|
}),
|
9238
9320
|
summary: "Add a new email of a mail room participant to an existing contact"
|
9239
9321
|
},
|
9240
9322
|
update: {
|
9241
9323
|
method: "PATCH",
|
9242
9324
|
path: "/:id",
|
9243
|
-
pathParams:
|
9244
|
-
id:
|
9325
|
+
pathParams: z122.object({
|
9326
|
+
id: z122.string()
|
9245
9327
|
}),
|
9246
9328
|
responses: {
|
9247
9329
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9255,12 +9337,12 @@ var roomContract = initContract46().router(
|
|
9255
9337
|
markAsRead: {
|
9256
9338
|
method: "POST",
|
9257
9339
|
path: "/mark_as_read",
|
9258
|
-
body:
|
9259
|
-
id:
|
9340
|
+
body: z122.object({
|
9341
|
+
id: z122.string()
|
9260
9342
|
}),
|
9261
9343
|
responses: {
|
9262
9344
|
200: DefaultSuccessResponseSchema.extend({
|
9263
|
-
message:
|
9345
|
+
message: z122.string()
|
9264
9346
|
}),
|
9265
9347
|
...DefaultResponses
|
9266
9348
|
},
|
@@ -9269,8 +9351,8 @@ var roomContract = initContract46().router(
|
|
9269
9351
|
getById: {
|
9270
9352
|
method: "GET",
|
9271
9353
|
path: "/:id",
|
9272
|
-
pathParams:
|
9273
|
-
id:
|
9354
|
+
pathParams: z122.object({
|
9355
|
+
id: z122.string().uuid()
|
9274
9356
|
}),
|
9275
9357
|
responses: {
|
9276
9358
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9288,70 +9370,70 @@ var roomContract = initContract46().router(
|
|
9288
9370
|
|
9289
9371
|
// src/mail/account-contract.ts
|
9290
9372
|
import { initContract as initContract47 } from "@ts-rest/core";
|
9291
|
-
import
|
9373
|
+
import z124 from "zod";
|
9292
9374
|
|
9293
9375
|
// src/mail/schemas/account-validation.schema.ts
|
9294
|
-
import
|
9376
|
+
import z123 from "zod";
|
9295
9377
|
var AccountContractsValidationSchemas = {
|
9296
9378
|
create: {
|
9297
|
-
input:
|
9298
|
-
address:
|
9299
|
-
name:
|
9300
|
-
password:
|
9301
|
-
mailServerId:
|
9379
|
+
input: z123.object({
|
9380
|
+
address: z123.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
9381
|
+
name: z123.string().min(1, "Account name cannot be empty."),
|
9382
|
+
password: z123.string().min(1, "Password cannot be empty."),
|
9383
|
+
mailServerId: z123.string().uuid("Invalid mail_server_id")
|
9302
9384
|
})
|
9303
9385
|
},
|
9304
9386
|
getById: {
|
9305
|
-
input:
|
9306
|
-
id:
|
9387
|
+
input: z123.object({
|
9388
|
+
id: z123.string().uuid()
|
9307
9389
|
}),
|
9308
9390
|
output: MailAccountSchema
|
9309
9391
|
},
|
9310
9392
|
getAll: {
|
9311
|
-
output:
|
9393
|
+
output: z123.array(MailAccountSchema)
|
9312
9394
|
},
|
9313
9395
|
update: {
|
9314
9396
|
input: MailAccountSchema,
|
9315
9397
|
output: MailAccountSchema
|
9316
9398
|
},
|
9317
9399
|
disconnect: {
|
9318
|
-
input:
|
9319
|
-
id:
|
9400
|
+
input: z123.object({
|
9401
|
+
id: z123.string().uuid()
|
9320
9402
|
}),
|
9321
9403
|
output: MailAccountSchema
|
9322
9404
|
},
|
9323
9405
|
reconnect: {
|
9324
|
-
input:
|
9325
|
-
id:
|
9406
|
+
input: z123.object({
|
9407
|
+
id: z123.string()
|
9326
9408
|
}),
|
9327
9409
|
output: MailAccountSchema
|
9328
9410
|
},
|
9329
9411
|
delete: {
|
9330
|
-
input:
|
9331
|
-
id:
|
9412
|
+
input: z123.object({
|
9413
|
+
id: z123.string()
|
9332
9414
|
}),
|
9333
|
-
output:
|
9415
|
+
output: z123.string()
|
9334
9416
|
},
|
9335
9417
|
deleteEmailEngineAcc: {
|
9336
|
-
input:
|
9337
|
-
account:
|
9418
|
+
input: z123.object({
|
9419
|
+
account: z123.string()
|
9338
9420
|
}),
|
9339
9421
|
output: MailAccountSchema
|
9340
9422
|
},
|
9341
9423
|
generateOAuth2AuthenticationLink: {
|
9342
|
-
body:
|
9343
|
-
oAuth2AppId:
|
9344
|
-
mailServerId:
|
9424
|
+
body: z123.object({
|
9425
|
+
oAuth2AppId: z123.string(),
|
9426
|
+
mailServerId: z123.string()
|
9345
9427
|
}),
|
9346
|
-
response:
|
9347
|
-
url:
|
9348
|
-
account:
|
9428
|
+
response: z123.object({
|
9429
|
+
url: z123.string(),
|
9430
|
+
account: z123.string()
|
9349
9431
|
})
|
9350
9432
|
},
|
9351
9433
|
createOAuth2Acc: {
|
9352
|
-
body:
|
9353
|
-
account:
|
9354
|
-
name:
|
9434
|
+
body: z123.object({
|
9435
|
+
account: z123.string(),
|
9436
|
+
name: z123.string()
|
9355
9437
|
}),
|
9356
9438
|
response: MailAccountSchema
|
9357
9439
|
}
|
@@ -9369,14 +9451,14 @@ var accountContract = initContract47().router(
|
|
9369
9451
|
// data: AccountContractsValidationSchemas.create.output,
|
9370
9452
|
data: MailAccountSchema
|
9371
9453
|
}),
|
9372
|
-
400:
|
9373
|
-
message:
|
9454
|
+
400: z124.object({
|
9455
|
+
message: z124.string()
|
9374
9456
|
}),
|
9375
|
-
409:
|
9376
|
-
message:
|
9457
|
+
409: z124.object({
|
9458
|
+
message: z124.string()
|
9377
9459
|
}),
|
9378
|
-
500:
|
9379
|
-
message:
|
9460
|
+
500: z124.object({
|
9461
|
+
message: z124.string()
|
9380
9462
|
}),
|
9381
9463
|
...DefaultResponses
|
9382
9464
|
},
|
@@ -9392,14 +9474,14 @@ var accountContract = initContract47().router(
|
|
9392
9474
|
201: DefaultSuccessResponseSchema.extend({
|
9393
9475
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
9394
9476
|
}),
|
9395
|
-
400:
|
9396
|
-
message:
|
9477
|
+
400: z124.object({
|
9478
|
+
message: z124.string()
|
9397
9479
|
}),
|
9398
|
-
409:
|
9399
|
-
message:
|
9480
|
+
409: z124.object({
|
9481
|
+
message: z124.string()
|
9400
9482
|
}),
|
9401
|
-
500:
|
9402
|
-
message:
|
9483
|
+
500: z124.object({
|
9484
|
+
message: z124.string()
|
9403
9485
|
}),
|
9404
9486
|
...DefaultResponses
|
9405
9487
|
},
|
@@ -9413,7 +9495,7 @@ var accountContract = initContract47().router(
|
|
9413
9495
|
path: "/sync",
|
9414
9496
|
responses: {
|
9415
9497
|
200: DefaultSuccessResponseSchema.extend({
|
9416
|
-
message:
|
9498
|
+
message: z124.string()
|
9417
9499
|
}),
|
9418
9500
|
...DefaultResponses
|
9419
9501
|
},
|
@@ -9438,13 +9520,13 @@ var accountContract = initContract47().router(
|
|
9438
9520
|
getAll: {
|
9439
9521
|
method: "GET",
|
9440
9522
|
path: "",
|
9441
|
-
query:
|
9442
|
-
state:
|
9443
|
-
withDeleted:
|
9523
|
+
query: z124.object({
|
9524
|
+
state: z124.union([z124.literal("connected"), z124.literal("disconnected")]).optional(),
|
9525
|
+
withDeleted: z124.boolean().default(false)
|
9444
9526
|
}).optional(),
|
9445
9527
|
responses: {
|
9446
9528
|
200: DefaultSuccessResponseSchema.extend({
|
9447
|
-
data:
|
9529
|
+
data: z124.array(MailAccountSchema)
|
9448
9530
|
}),
|
9449
9531
|
...DefaultResponses
|
9450
9532
|
},
|
@@ -9455,8 +9537,8 @@ var accountContract = initContract47().router(
|
|
9455
9537
|
update: {
|
9456
9538
|
method: "PATCH",
|
9457
9539
|
path: "/:id",
|
9458
|
-
pathParams:
|
9459
|
-
id:
|
9540
|
+
pathParams: z124.object({
|
9541
|
+
id: z124.string().uuid()
|
9460
9542
|
}),
|
9461
9543
|
responses: {
|
9462
9544
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -9505,7 +9587,7 @@ var accountContract = initContract47().router(
|
|
9505
9587
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
9506
9588
|
responses: {
|
9507
9589
|
200: DefaultSuccessResponseSchema.extend({
|
9508
|
-
message:
|
9590
|
+
message: z124.string()
|
9509
9591
|
}),
|
9510
9592
|
...DefaultResponses
|
9511
9593
|
},
|
@@ -9520,7 +9602,7 @@ var accountContract = initContract47().router(
|
|
9520
9602
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
9521
9603
|
responses: {
|
9522
9604
|
200: DefaultSuccessResponseSchema.extend({
|
9523
|
-
message:
|
9605
|
+
message: z124.string()
|
9524
9606
|
}),
|
9525
9607
|
...DefaultResponses
|
9526
9608
|
},
|
@@ -9549,20 +9631,20 @@ var accountContract = initContract47().router(
|
|
9549
9631
|
|
9550
9632
|
// src/mail/mail-server-contract.ts
|
9551
9633
|
import { initContract as initContract48 } from "@ts-rest/core";
|
9552
|
-
import
|
9634
|
+
import z126 from "zod";
|
9553
9635
|
|
9554
9636
|
// src/mail/schemas/servers-validation.schema.ts
|
9555
|
-
import
|
9556
|
-
var CreateMailServerSchema =
|
9557
|
-
name:
|
9558
|
-
smtpHost:
|
9559
|
-
smtpPort:
|
9560
|
-
smtpTlsPort:
|
9561
|
-
useTlsForSmtp:
|
9562
|
-
imapHost:
|
9563
|
-
imapPort:
|
9564
|
-
imapTlsPort:
|
9565
|
-
useTlsForImap:
|
9637
|
+
import z125 from "zod";
|
9638
|
+
var CreateMailServerSchema = z125.object({
|
9639
|
+
name: z125.string(),
|
9640
|
+
smtpHost: z125.string(),
|
9641
|
+
smtpPort: z125.number(),
|
9642
|
+
smtpTlsPort: z125.number(),
|
9643
|
+
useTlsForSmtp: z125.boolean(),
|
9644
|
+
imapHost: z125.string(),
|
9645
|
+
imapPort: z125.number(),
|
9646
|
+
imapTlsPort: z125.number(),
|
9647
|
+
useTlsForImap: z125.boolean()
|
9566
9648
|
});
|
9567
9649
|
|
9568
9650
|
// src/mail/mail-server-contract.ts
|
@@ -9585,11 +9667,11 @@ var serverContract = initContract48().router(
|
|
9585
9667
|
path: "/oauth2/apps",
|
9586
9668
|
responses: {
|
9587
9669
|
200: DefaultSuccessResponseSchema.extend({
|
9588
|
-
data:
|
9589
|
-
total:
|
9590
|
-
pages:
|
9591
|
-
page:
|
9592
|
-
apps:
|
9670
|
+
data: z126.object({
|
9671
|
+
total: z126.number(),
|
9672
|
+
pages: z126.number(),
|
9673
|
+
page: z126.number(),
|
9674
|
+
apps: z126.array(OAuth2AppSchema)
|
9593
9675
|
})
|
9594
9676
|
}),
|
9595
9677
|
...DefaultResponses
|
@@ -9599,8 +9681,8 @@ var serverContract = initContract48().router(
|
|
9599
9681
|
getById: {
|
9600
9682
|
method: "GET",
|
9601
9683
|
path: "/:id",
|
9602
|
-
pathParams:
|
9603
|
-
id:
|
9684
|
+
pathParams: z126.object({
|
9685
|
+
id: z126.string().uuid()
|
9604
9686
|
}),
|
9605
9687
|
responses: {
|
9606
9688
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9615,7 +9697,7 @@ var serverContract = initContract48().router(
|
|
9615
9697
|
path: "/",
|
9616
9698
|
responses: {
|
9617
9699
|
200: DefaultSuccessResponseSchema.extend({
|
9618
|
-
data:
|
9700
|
+
data: z126.array(MailServerSchema)
|
9619
9701
|
}),
|
9620
9702
|
...DefaultResponses
|
9621
9703
|
},
|
@@ -9624,8 +9706,8 @@ var serverContract = initContract48().router(
|
|
9624
9706
|
update: {
|
9625
9707
|
method: "PATCH",
|
9626
9708
|
path: "/:id",
|
9627
|
-
pathParams:
|
9628
|
-
id:
|
9709
|
+
pathParams: z126.object({
|
9710
|
+
id: z126.string().uuid()
|
9629
9711
|
}),
|
9630
9712
|
responses: {
|
9631
9713
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9639,8 +9721,8 @@ var serverContract = initContract48().router(
|
|
9639
9721
|
delete: {
|
9640
9722
|
method: "DELETE",
|
9641
9723
|
path: "/:id",
|
9642
|
-
pathParams:
|
9643
|
-
id:
|
9724
|
+
pathParams: z126.object({
|
9725
|
+
id: z126.string().uuid()
|
9644
9726
|
}),
|
9645
9727
|
responses: {
|
9646
9728
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9659,45 +9741,45 @@ var serverContract = initContract48().router(
|
|
9659
9741
|
|
9660
9742
|
// src/mail/message-contract.ts
|
9661
9743
|
import { initContract as initContract49 } from "@ts-rest/core";
|
9662
|
-
import
|
9744
|
+
import z128 from "zod";
|
9663
9745
|
|
9664
9746
|
// src/mail/schemas/message-validation.schema.ts
|
9665
|
-
import
|
9666
|
-
var MailParticipant2 =
|
9667
|
-
name:
|
9668
|
-
address:
|
9747
|
+
import z127 from "zod";
|
9748
|
+
var MailParticipant2 = z127.object({
|
9749
|
+
name: z127.string().optional(),
|
9750
|
+
address: z127.string().email()
|
9669
9751
|
});
|
9670
9752
|
var MessageContractsValidationsSchema = {
|
9671
9753
|
submit: {
|
9672
|
-
input:
|
9673
|
-
subject:
|
9674
|
-
text:
|
9675
|
-
html:
|
9754
|
+
input: z127.object({
|
9755
|
+
subject: z127.string(),
|
9756
|
+
text: z127.string(),
|
9757
|
+
html: z127.string(),
|
9676
9758
|
from: MailParticipant2,
|
9677
9759
|
to: MailParticipant2,
|
9678
|
-
cc:
|
9679
|
-
bcc:
|
9680
|
-
sendAt:
|
9681
|
-
reference:
|
9682
|
-
messageId:
|
9683
|
-
action:
|
9760
|
+
cc: z127.array(MailParticipant2).optional(),
|
9761
|
+
bcc: z127.array(MailParticipant2).optional(),
|
9762
|
+
sendAt: z127.string().optional(),
|
9763
|
+
reference: z127.object({
|
9764
|
+
messageId: z127.string(),
|
9765
|
+
action: z127.union([z127.literal("reply"), z127.literal("forward")])
|
9684
9766
|
}).optional(),
|
9685
|
-
attachments:
|
9686
|
-
|
9687
|
-
fileType:
|
9688
|
-
fileName:
|
9689
|
-
fileKey:
|
9690
|
-
fileSize:
|
9691
|
-
bucketName:
|
9692
|
-
presignedUrl:
|
9767
|
+
attachments: z127.array(
|
9768
|
+
z127.object({
|
9769
|
+
fileType: z127.string(),
|
9770
|
+
fileName: z127.string(),
|
9771
|
+
fileKey: z127.string(),
|
9772
|
+
fileSize: z127.number(),
|
9773
|
+
bucketName: z127.string(),
|
9774
|
+
presignedUrl: z127.string()
|
9693
9775
|
})
|
9694
9776
|
).optional()
|
9695
9777
|
}),
|
9696
|
-
output:
|
9697
|
-
response:
|
9698
|
-
messageId:
|
9699
|
-
sendAt:
|
9700
|
-
queueId:
|
9778
|
+
output: z127.object({
|
9779
|
+
response: z127.string(),
|
9780
|
+
messageId: z127.string(),
|
9781
|
+
sendAt: z127.string(),
|
9782
|
+
queueId: z127.string()
|
9701
9783
|
})
|
9702
9784
|
}
|
9703
9785
|
};
|
@@ -9726,8 +9808,8 @@ var messageContract = initContract49().router(
|
|
9726
9808
|
path: "/new_message_count",
|
9727
9809
|
responses: {
|
9728
9810
|
200: DefaultSuccessResponseSchema.extend({
|
9729
|
-
data:
|
9730
|
-
count:
|
9811
|
+
data: z128.object({
|
9812
|
+
count: z128.number()
|
9731
9813
|
})
|
9732
9814
|
}),
|
9733
9815
|
...DefaultResponses
|
@@ -9739,8 +9821,8 @@ var messageContract = initContract49().router(
|
|
9739
9821
|
getById: {
|
9740
9822
|
method: "GET",
|
9741
9823
|
path: "/:id",
|
9742
|
-
pathParams:
|
9743
|
-
id:
|
9824
|
+
pathParams: z128.object({
|
9825
|
+
id: z128.string()
|
9744
9826
|
}),
|
9745
9827
|
responses: {
|
9746
9828
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9755,8 +9837,8 @@ var messageContract = initContract49().router(
|
|
9755
9837
|
update: {
|
9756
9838
|
method: "PATCH",
|
9757
9839
|
path: "/:id",
|
9758
|
-
pathParams:
|
9759
|
-
id:
|
9840
|
+
pathParams: z128.object({
|
9841
|
+
id: z128.string()
|
9760
9842
|
}),
|
9761
9843
|
responses: {
|
9762
9844
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9772,8 +9854,8 @@ var messageContract = initContract49().router(
|
|
9772
9854
|
delete: {
|
9773
9855
|
method: "DELETE",
|
9774
9856
|
path: "/:id",
|
9775
|
-
pathParams:
|
9776
|
-
id:
|
9857
|
+
pathParams: z128.object({
|
9858
|
+
id: z128.string()
|
9777
9859
|
}),
|
9778
9860
|
responses: {
|
9779
9861
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9789,13 +9871,13 @@ var messageContract = initContract49().router(
|
|
9789
9871
|
cancelScheduledMessage: {
|
9790
9872
|
method: "DELETE",
|
9791
9873
|
path: "/scheduled_message/:id",
|
9792
|
-
pathParams:
|
9793
|
-
id:
|
9874
|
+
pathParams: z128.object({
|
9875
|
+
id: z128.string()
|
9794
9876
|
}),
|
9795
9877
|
responses: {
|
9796
9878
|
200: DefaultSuccessResponseSchema.extend({
|
9797
|
-
data:
|
9798
|
-
totalMessagesCount:
|
9879
|
+
data: z128.object({
|
9880
|
+
totalMessagesCount: z128.number()
|
9799
9881
|
})
|
9800
9882
|
}),
|
9801
9883
|
...DefaultResponses
|
@@ -9820,38 +9902,38 @@ var mailContract = initContract50().router({
|
|
9820
9902
|
|
9821
9903
|
// src/webchat/index.ts
|
9822
9904
|
import { initContract as initContract51 } from "@ts-rest/core";
|
9823
|
-
import
|
9905
|
+
import z131 from "zod";
|
9824
9906
|
|
9825
9907
|
// src/webchat/schema.ts
|
9826
|
-
import
|
9908
|
+
import z130 from "zod";
|
9827
9909
|
|
9828
9910
|
// src/webchat/validation.ts
|
9829
|
-
import
|
9911
|
+
import z129 from "zod";
|
9830
9912
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
9831
9913
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
9832
9914
|
return ChatwootChannelType3;
|
9833
9915
|
})(ChatwootChannelType2 || {});
|
9834
|
-
var WebChatChannelSchema =
|
9835
|
-
avatar:
|
9836
|
-
name:
|
9837
|
-
type:
|
9838
|
-
websiteName:
|
9839
|
-
welcomeTitle:
|
9840
|
-
websiteUrl:
|
9841
|
-
welcomeTagline:
|
9842
|
-
agentAwayMessage:
|
9843
|
-
widgetColor:
|
9916
|
+
var WebChatChannelSchema = z129.object({
|
9917
|
+
avatar: z129.string().optional(),
|
9918
|
+
name: z129.string(),
|
9919
|
+
type: z129.nativeEnum(ChatwootChannelType2),
|
9920
|
+
websiteName: z129.string(),
|
9921
|
+
welcomeTitle: z129.string(),
|
9922
|
+
websiteUrl: z129.string().url(),
|
9923
|
+
welcomeTagline: z129.string().optional(),
|
9924
|
+
agentAwayMessage: z129.string().optional(),
|
9925
|
+
widgetColor: z129.string().optional()
|
9844
9926
|
});
|
9845
9927
|
|
9846
9928
|
// src/webchat/schema.ts
|
9847
|
-
var ConnectWebChatChannelSchema =
|
9848
|
-
name:
|
9849
|
-
actor:
|
9850
|
-
id:
|
9851
|
-
name:
|
9852
|
-
email:
|
9853
|
-
address:
|
9854
|
-
phone:
|
9929
|
+
var ConnectWebChatChannelSchema = z130.object({
|
9930
|
+
name: z130.string(),
|
9931
|
+
actor: z130.object({
|
9932
|
+
id: z130.string().uuid(),
|
9933
|
+
name: z130.string(),
|
9934
|
+
email: z130.string().email(),
|
9935
|
+
address: z130.string().nullable(),
|
9936
|
+
phone: z130.string().nullable()
|
9855
9937
|
}),
|
9856
9938
|
channel: WebChatChannelSchema
|
9857
9939
|
});
|
@@ -9884,8 +9966,8 @@ var platformWebchatContract = initContract51().router({
|
|
9884
9966
|
disconnectToService: {
|
9885
9967
|
method: "POST",
|
9886
9968
|
path: "/disconnect",
|
9887
|
-
body:
|
9888
|
-
id:
|
9969
|
+
body: z131.object({
|
9970
|
+
id: z131.string().uuid()
|
9889
9971
|
}),
|
9890
9972
|
responses: {
|
9891
9973
|
200: ChannelServiceResponseSchema,
|
@@ -9896,8 +9978,8 @@ var platformWebchatContract = initContract51().router({
|
|
9896
9978
|
reconnect: {
|
9897
9979
|
method: "POST",
|
9898
9980
|
path: "/reconnect/:channelId",
|
9899
|
-
pathParams:
|
9900
|
-
channelId:
|
9981
|
+
pathParams: z131.object({
|
9982
|
+
channelId: z131.string().uuid()
|
9901
9983
|
}),
|
9902
9984
|
body: null,
|
9903
9985
|
responses: {
|
@@ -9909,8 +9991,8 @@ var platformWebchatContract = initContract51().router({
|
|
9909
9991
|
delete: {
|
9910
9992
|
method: "DELETE",
|
9911
9993
|
path: "/delete/:channelId",
|
9912
|
-
pathParams:
|
9913
|
-
channelId:
|
9994
|
+
pathParams: z131.object({
|
9995
|
+
channelId: z131.string().uuid()
|
9914
9996
|
}),
|
9915
9997
|
body: null,
|
9916
9998
|
responses: {
|
@@ -9923,18 +10005,18 @@ var platformWebchatContract = initContract51().router({
|
|
9923
10005
|
|
9924
10006
|
// src/hold-label/index.ts
|
9925
10007
|
import { initContract as initContract52 } from "@ts-rest/core";
|
9926
|
-
import
|
10008
|
+
import z133 from "zod";
|
9927
10009
|
|
9928
10010
|
// src/hold-label/validation.ts
|
9929
|
-
import
|
9930
|
-
var UpdatePositionSchema2 =
|
9931
|
-
holdLabels:
|
9932
|
-
|
10011
|
+
import z132 from "zod";
|
10012
|
+
var UpdatePositionSchema2 = z132.object({
|
10013
|
+
holdLabels: z132.array(
|
10014
|
+
z132.object({ id: z132.string().uuid(), position: z132.number() })
|
9933
10015
|
)
|
9934
10016
|
});
|
9935
|
-
var HoldRoomSchema =
|
9936
|
-
roomId:
|
9937
|
-
holdLabelId:
|
10017
|
+
var HoldRoomSchema = z132.object({
|
10018
|
+
roomId: z132.string().uuid(),
|
10019
|
+
holdLabelId: z132.string().uuid()
|
9938
10020
|
});
|
9939
10021
|
|
9940
10022
|
// src/hold-label/index.ts
|
@@ -9943,7 +10025,7 @@ var holdLabelContract = initContract52().router(
|
|
9943
10025
|
createHoldLabel: {
|
9944
10026
|
method: "POST",
|
9945
10027
|
path: "/",
|
9946
|
-
body:
|
10028
|
+
body: z133.object({ name: z133.string() }),
|
9947
10029
|
responses: {
|
9948
10030
|
201: DefaultSuccessResponseSchema.extend({
|
9949
10031
|
holdLabel: HoldLabelSchema
|
@@ -9955,7 +10037,7 @@ var holdLabelContract = initContract52().router(
|
|
9955
10037
|
path: "/",
|
9956
10038
|
responses: {
|
9957
10039
|
200: DefaultSuccessResponseSchema.extend({
|
9958
|
-
holdLabels:
|
10040
|
+
holdLabels: z133.array(HoldLabelSchema)
|
9959
10041
|
})
|
9960
10042
|
}
|
9961
10043
|
},
|
@@ -9973,8 +10055,8 @@ var holdLabelContract = initContract52().router(
|
|
9973
10055
|
updateHoldLabel: {
|
9974
10056
|
method: "PATCH",
|
9975
10057
|
path: "/:id",
|
9976
|
-
pathParams:
|
9977
|
-
body:
|
10058
|
+
pathParams: z133.object({ id: z133.string().uuid() }),
|
10059
|
+
body: z133.object({ name: z133.string() }),
|
9978
10060
|
responses: {
|
9979
10061
|
200: DefaultSuccessResponseSchema.extend({
|
9980
10062
|
holdLabel: HoldLabelSchema
|
@@ -9984,7 +10066,7 @@ var holdLabelContract = initContract52().router(
|
|
9984
10066
|
deleteHoldLabel: {
|
9985
10067
|
method: "DELETE",
|
9986
10068
|
path: "/:id",
|
9987
|
-
pathParams:
|
10069
|
+
pathParams: z133.object({ id: z133.string().uuid() }),
|
9988
10070
|
body: null,
|
9989
10071
|
responses: {
|
9990
10072
|
200: DefaultSuccessResponseSchema
|
@@ -9995,27 +10077,27 @@ var holdLabelContract = initContract52().router(
|
|
9995
10077
|
path: "/auto-unhold",
|
9996
10078
|
responses: {
|
9997
10079
|
200: DefaultSuccessResponseSchema.extend({
|
9998
|
-
autoUnhold:
|
10080
|
+
autoUnhold: z133.boolean()
|
9999
10081
|
})
|
10000
10082
|
}
|
10001
10083
|
},
|
10002
10084
|
updateAutoUnhold: {
|
10003
10085
|
method: "POST",
|
10004
10086
|
path: "/auto-unhold",
|
10005
|
-
body:
|
10087
|
+
body: z133.object({ autoUnhold: z133.boolean() }),
|
10006
10088
|
responses: {
|
10007
10089
|
200: DefaultSuccessResponseSchema.extend({
|
10008
|
-
autoUnhold:
|
10090
|
+
autoUnhold: z133.boolean()
|
10009
10091
|
})
|
10010
10092
|
}
|
10011
10093
|
},
|
10012
10094
|
getHoldLogs: {
|
10013
10095
|
method: "GET",
|
10014
10096
|
path: "/hold-logs",
|
10015
|
-
query:
|
10097
|
+
query: z133.object({ cxLogId: z133.string().uuid() }),
|
10016
10098
|
responses: {
|
10017
|
-
200:
|
10018
|
-
holdLogs:
|
10099
|
+
200: z133.object({
|
10100
|
+
holdLogs: z133.array(FormattedHoldLogSchema)
|
10019
10101
|
})
|
10020
10102
|
}
|
10021
10103
|
},
|
@@ -10032,7 +10114,7 @@ var holdLabelContract = initContract52().router(
|
|
10032
10114
|
unholdRoom: {
|
10033
10115
|
method: "POST",
|
10034
10116
|
path: "/unhold-room",
|
10035
|
-
body:
|
10117
|
+
body: z133.object({ roomId: z133.string().uuid() }),
|
10036
10118
|
responses: {
|
10037
10119
|
200: DefaultSuccessResponseSchema.extend({
|
10038
10120
|
holdLog: HoldLogSchema.optional()
|
@@ -10045,89 +10127,89 @@ var holdLabelContract = initContract52().router(
|
|
10045
10127
|
|
10046
10128
|
// src/subscription/index.ts
|
10047
10129
|
import { initContract as initContract53 } from "@ts-rest/core";
|
10048
|
-
import { z as
|
10130
|
+
import { z as z136 } from "zod";
|
10049
10131
|
|
10050
10132
|
// src/subscription/schema.ts
|
10051
|
-
import
|
10133
|
+
import z134 from "zod";
|
10052
10134
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
10053
|
-
priceId:
|
10054
|
-
name:
|
10055
|
-
perUnit:
|
10056
|
-
price:
|
10057
|
-
currency:
|
10135
|
+
priceId: z134.string(),
|
10136
|
+
name: z134.string().nullable(),
|
10137
|
+
perUnit: z134.number(),
|
10138
|
+
price: z134.number(),
|
10139
|
+
currency: z134.string().nullable()
|
10058
10140
|
});
|
10059
10141
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
10060
|
-
provider:
|
10061
|
-
productId:
|
10062
|
-
name:
|
10063
|
-
type:
|
10064
|
-
omnichannel:
|
10065
|
-
usageType:
|
10142
|
+
provider: z134.string(),
|
10143
|
+
productId: z134.string(),
|
10144
|
+
name: z134.string(),
|
10145
|
+
type: z134.string(),
|
10146
|
+
omnichannel: z134.string(),
|
10147
|
+
usageType: z134.string().nullable(),
|
10066
10148
|
productPrice: ProductPriceSchema
|
10067
10149
|
});
|
10068
10150
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
10069
|
-
includedQuantity:
|
10151
|
+
includedQuantity: z134.number(),
|
10070
10152
|
product: ProductWithoutRelatedSchema
|
10071
10153
|
});
|
10072
10154
|
var ProductSchema = DefaultEntitySchema.extend({
|
10073
|
-
provider:
|
10074
|
-
productId:
|
10075
|
-
name:
|
10076
|
-
type:
|
10077
|
-
omnichannel:
|
10078
|
-
usageType:
|
10155
|
+
provider: z134.string(),
|
10156
|
+
productId: z134.string(),
|
10157
|
+
name: z134.string(),
|
10158
|
+
type: z134.string(),
|
10159
|
+
omnichannel: z134.string(),
|
10160
|
+
usageType: z134.string().nullable(),
|
10079
10161
|
productPrice: ProductPriceSchema,
|
10080
|
-
relatedProducts:
|
10162
|
+
relatedProducts: z134.array(RelatedProductSchema)
|
10081
10163
|
});
|
10082
10164
|
var CustomerSchema = DefaultEntitySchema.extend({
|
10083
|
-
provider:
|
10084
|
-
customerId:
|
10085
|
-
email:
|
10086
|
-
name:
|
10087
|
-
balance:
|
10165
|
+
provider: z134.string(),
|
10166
|
+
customerId: z134.string(),
|
10167
|
+
email: z134.string(),
|
10168
|
+
name: z134.string(),
|
10169
|
+
balance: z134.number()
|
10088
10170
|
});
|
10089
10171
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
10090
|
-
limit:
|
10091
|
-
subscriptionItemId:
|
10092
|
-
usage:
|
10172
|
+
limit: z134.number(),
|
10173
|
+
subscriptionItemId: z134.string(),
|
10174
|
+
usage: z134.number().nullable(),
|
10093
10175
|
product: ProductSchema
|
10094
10176
|
});
|
10095
10177
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
10096
|
-
provider:
|
10097
|
-
type:
|
10098
|
-
subscriptionId:
|
10099
|
-
interval:
|
10100
|
-
quantity:
|
10101
|
-
amount:
|
10102
|
-
startAt:
|
10103
|
-
expireAt:
|
10104
|
-
status:
|
10105
|
-
name:
|
10106
|
-
subscriptionProducts:
|
10178
|
+
provider: z134.string(),
|
10179
|
+
type: z134.string(),
|
10180
|
+
subscriptionId: z134.string(),
|
10181
|
+
interval: z134.string(),
|
10182
|
+
quantity: z134.number(),
|
10183
|
+
amount: z134.number(),
|
10184
|
+
startAt: z134.date().nullable(),
|
10185
|
+
expireAt: z134.date(),
|
10186
|
+
status: z134.string(),
|
10187
|
+
name: z134.string().nullable(),
|
10188
|
+
subscriptionProducts: z134.array(SubscriptionProuctSchema),
|
10107
10189
|
productPrice: ProductPriceSchema,
|
10108
10190
|
product: ProductSchema
|
10109
10191
|
});
|
10110
10192
|
|
10111
10193
|
// src/subscription/validation.ts
|
10112
|
-
import { z as
|
10113
|
-
var GetAvailablePlanSchema =
|
10114
|
-
type:
|
10115
|
-
currency:
|
10116
|
-
});
|
10117
|
-
var UpdateSubscriptionSchema =
|
10118
|
-
planProductId:
|
10119
|
-
planProductPriceId:
|
10120
|
-
subscriptionId:
|
10121
|
-
subscriptionProducts:
|
10122
|
-
|
10123
|
-
productId:
|
10124
|
-
productPriceId:
|
10125
|
-
quantity:
|
10194
|
+
import { z as z135 } from "zod";
|
10195
|
+
var GetAvailablePlanSchema = z135.object({
|
10196
|
+
type: z135.string(),
|
10197
|
+
currency: z135.string()
|
10198
|
+
});
|
10199
|
+
var UpdateSubscriptionSchema = z135.object({
|
10200
|
+
planProductId: z135.string(),
|
10201
|
+
planProductPriceId: z135.string(),
|
10202
|
+
subscriptionId: z135.string(),
|
10203
|
+
subscriptionProducts: z135.array(
|
10204
|
+
z135.object({
|
10205
|
+
productId: z135.string(),
|
10206
|
+
productPriceId: z135.string(),
|
10207
|
+
quantity: z135.number()
|
10126
10208
|
})
|
10127
10209
|
)
|
10128
10210
|
});
|
10129
|
-
var TopUpBalanceSchema =
|
10130
|
-
quantity:
|
10211
|
+
var TopUpBalanceSchema = z135.object({
|
10212
|
+
quantity: z135.number()
|
10131
10213
|
});
|
10132
10214
|
|
10133
10215
|
// src/subscription/index.ts
|
@@ -10151,9 +10233,9 @@ var subscriptionContract = initContract53().router(
|
|
10151
10233
|
body: UpdateSubscriptionSchema,
|
10152
10234
|
responses: {
|
10153
10235
|
200: DefaultSuccessResponseSchema.extend({
|
10154
|
-
message:
|
10155
|
-
requireCheckout:
|
10156
|
-
checkoutUrl:
|
10236
|
+
message: z136.string(),
|
10237
|
+
requireCheckout: z136.boolean(),
|
10238
|
+
checkoutUrl: z136.string().nullable()
|
10157
10239
|
}),
|
10158
10240
|
402: DefaultErrorResponseSchema,
|
10159
10241
|
500: DefaultErrorResponseSchema
|
@@ -10165,7 +10247,7 @@ var subscriptionContract = initContract53().router(
|
|
10165
10247
|
body: TopUpBalanceSchema,
|
10166
10248
|
responses: {
|
10167
10249
|
200: DefaultSuccessResponseSchema.extend({
|
10168
|
-
checkoutUrl:
|
10250
|
+
checkoutUrl: z136.string()
|
10169
10251
|
}),
|
10170
10252
|
500: DefaultErrorResponseSchema
|
10171
10253
|
}
|
@@ -10176,7 +10258,7 @@ var subscriptionContract = initContract53().router(
|
|
10176
10258
|
query: GetAvailablePlanSchema,
|
10177
10259
|
responses: {
|
10178
10260
|
200: DefaultSuccessResponseSchema.extend({
|
10179
|
-
data:
|
10261
|
+
data: z136.array(ProductSchema)
|
10180
10262
|
}),
|
10181
10263
|
500: DefaultErrorResponseSchema
|
10182
10264
|
}
|
@@ -10199,19 +10281,19 @@ var subscriptionContract = initContract53().router(
|
|
10199
10281
|
|
10200
10282
|
// src/cx-intelligence/index.ts
|
10201
10283
|
import { initContract as initContract54 } from "@ts-rest/core";
|
10202
|
-
import
|
10284
|
+
import z137 from "zod";
|
10203
10285
|
var cxIntelligenceContract = initContract54().router(
|
10204
10286
|
{
|
10205
10287
|
toggle: {
|
10206
10288
|
method: "POST",
|
10207
10289
|
path: "/toggle",
|
10208
10290
|
headers: DefaultHeaderSchema,
|
10209
|
-
body:
|
10210
|
-
enabled:
|
10291
|
+
body: z137.object({
|
10292
|
+
enabled: z137.union([z137.literal(true), z137.literal(false)])
|
10211
10293
|
}),
|
10212
10294
|
responses: {
|
10213
10295
|
200: DefaultSuccessResponseSchema.extend({
|
10214
|
-
message:
|
10296
|
+
message: z137.string()
|
10215
10297
|
}),
|
10216
10298
|
500: DefaultErrorResponseSchema
|
10217
10299
|
},
|
@@ -10221,15 +10303,15 @@ var cxIntelligenceContract = initContract54().router(
|
|
10221
10303
|
method: "POST",
|
10222
10304
|
path: "/cx-logs/:id/transcribe",
|
10223
10305
|
headers: DefaultHeaderSchema,
|
10224
|
-
pathParams:
|
10225
|
-
id:
|
10306
|
+
pathParams: z137.object({
|
10307
|
+
id: z137.string().uuid()
|
10226
10308
|
}),
|
10227
|
-
body:
|
10228
|
-
fileUrl:
|
10309
|
+
body: z137.object({
|
10310
|
+
fileUrl: z137.string()
|
10229
10311
|
}),
|
10230
10312
|
responses: {
|
10231
10313
|
200: DefaultSuccessResponseSchema.extend({
|
10232
|
-
message:
|
10314
|
+
message: z137.string()
|
10233
10315
|
}),
|
10234
10316
|
403: DefaultErrorResponseSchema,
|
10235
10317
|
404: DefaultErrorResponseSchema,
|
@@ -10249,13 +10331,13 @@ var settingCxIntelligenceContract = initContract54().router(
|
|
10249
10331
|
headers: DefaultHeaderSchema,
|
10250
10332
|
responses: {
|
10251
10333
|
200: DefaultSuccessResponseSchema.extend({
|
10252
|
-
message:
|
10253
|
-
status:
|
10334
|
+
message: z137.string(),
|
10335
|
+
status: z137.boolean()
|
10254
10336
|
}),
|
10255
|
-
422:
|
10256
|
-
requestId:
|
10257
|
-
message:
|
10258
|
-
status:
|
10337
|
+
422: z137.object({
|
10338
|
+
requestId: z137.string(),
|
10339
|
+
message: z137.string(),
|
10340
|
+
status: z137.boolean()
|
10259
10341
|
}),
|
10260
10342
|
500: DefaultErrorResponseSchema
|
10261
10343
|
},
|