@kl1/contracts 1.2.57-uat → 1.2.58-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 +5 -62
- package/dist/api-contracts/src/channel/index.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +150 -863
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/dashboard/index.d.ts +0 -187
- package/dist/api-contracts/src/dashboard/index.d.ts.map +1 -1
- package/dist/api-contracts/src/dashboard/schema.d.ts +0 -37
- package/dist/api-contracts/src/dashboard/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/line/index.d.ts +2 -2
- 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/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/whatsapp/index.d.ts +6 -47
- 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/index.js +1486 -1575
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1486 -1575
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -2258,7 +2258,7 @@ var WaapiQrResponseSchema = DefaultSuccessResponseSchema.extend({
|
|
2258
2258
|
data: WaapiQrSchema
|
2259
2259
|
});
|
2260
2260
|
var GetWaapiQrQuerySchema = z40.object({
|
2261
|
-
|
2261
|
+
channelId: z40.string()
|
2262
2262
|
});
|
2263
2263
|
var SendSeenToWaapiSchema = z40.object({
|
2264
2264
|
channelId: z40.string().uuid(),
|
@@ -2456,7 +2456,7 @@ var whatsapp = initContract7().router(
|
|
2456
2456
|
},
|
2457
2457
|
createWaapi: {
|
2458
2458
|
method: "POST",
|
2459
|
-
path: "/
|
2459
|
+
path: "/waapi",
|
2460
2460
|
body: null,
|
2461
2461
|
responses: {
|
2462
2462
|
200: WaapiResponseSchema,
|
@@ -2466,26 +2466,13 @@ var whatsapp = initContract7().router(
|
|
2466
2466
|
},
|
2467
2467
|
getWaapiQr: {
|
2468
2468
|
method: "GET",
|
2469
|
-
path: "/
|
2469
|
+
path: "/waapi/qr",
|
2470
2470
|
query: GetWaapiQrQuerySchema,
|
2471
2471
|
responses: {
|
2472
2472
|
200: WaapiQrResponseSchema,
|
2473
2473
|
500: DefaultErrorResponseSchema,
|
2474
2474
|
400: DefaultErrorResponseSchema
|
2475
2475
|
}
|
2476
|
-
},
|
2477
|
-
deleteWaapi: {
|
2478
|
-
method: "DELETE",
|
2479
|
-
path: "/mobile/:instanceId",
|
2480
|
-
pathParams: z41.object({
|
2481
|
-
instanceId: z41.string()
|
2482
|
-
}),
|
2483
|
-
body: z41.any().optional(),
|
2484
|
-
responses: {
|
2485
|
-
200: DefaultSuccessResponseSchema,
|
2486
|
-
500: DefaultErrorResponseSchema,
|
2487
|
-
400: DefaultErrorResponseSchema
|
2488
|
-
}
|
2489
2476
|
}
|
2490
2477
|
},
|
2491
2478
|
{
|
@@ -4285,8 +4272,7 @@ var MessageStatusSchema = z54.object({
|
|
4285
4272
|
total: z54.number().nullable(),
|
4286
4273
|
closed: z54.number().nullable(),
|
4287
4274
|
unassignedOpen: z54.number().nullable(),
|
4288
|
-
assignedOpen: z54.number().nullable()
|
4289
|
-
hold: z54.number()
|
4275
|
+
assignedOpen: z54.number().nullable()
|
4290
4276
|
});
|
4291
4277
|
var MessageAverageSchema = z54.object({
|
4292
4278
|
selectedWeekAvgByDay: z54.array(
|
@@ -4331,18 +4317,6 @@ var CallCountsSchema = z54.object({
|
|
4331
4317
|
failedCallCount: z54.number().gte(0),
|
4332
4318
|
totalCallCount: z54.number().gte(0)
|
4333
4319
|
});
|
4334
|
-
var MessageQueueDataSchema = z54.object({
|
4335
|
-
id: z54.string().uuid().nullable(),
|
4336
|
-
name: z54.string(),
|
4337
|
-
sla: z54.number(),
|
4338
|
-
newContactCount: z54.number(),
|
4339
|
-
existingContactCount: z54.number(),
|
4340
|
-
totalRoomCount: z54.number(),
|
4341
|
-
closedRoomCount: z54.number(),
|
4342
|
-
unassignedRoomCount: z54.number(),
|
4343
|
-
assignedRoomCount: z54.number(),
|
4344
|
-
holdRoomCount: z54.number()
|
4345
|
-
});
|
4346
4320
|
|
4347
4321
|
// src/dashboard/index.ts
|
4348
4322
|
var dashboardContract = initContract13().router(
|
@@ -4601,39 +4575,6 @@ var dashboardContract = initContract13().router(
|
|
4601
4575
|
callCounts: CallCountsSchema
|
4602
4576
|
})
|
4603
4577
|
}
|
4604
|
-
},
|
4605
|
-
getAllQueueSLA: {
|
4606
|
-
method: "GET",
|
4607
|
-
path: "/all-queue-sla",
|
4608
|
-
query: z55.object({ selectedDate: z55.string().min(1) }),
|
4609
|
-
responses: {
|
4610
|
-
200: DefaultSuccessResponseSchema.extend({
|
4611
|
-
allQueueSLA: z55.number()
|
4612
|
-
})
|
4613
|
-
}
|
4614
|
-
},
|
4615
|
-
getAllMessageQueueData: {
|
4616
|
-
method: "GET",
|
4617
|
-
path: "/all-message-queue-data",
|
4618
|
-
query: z55.object({ selectedDate: z55.string().min(1) }),
|
4619
|
-
responses: {
|
4620
|
-
200: DefaultSuccessResponseSchema.extend({
|
4621
|
-
allMessageQueueData: z55.array(MessageQueueDataSchema)
|
4622
|
-
})
|
4623
|
-
}
|
4624
|
-
},
|
4625
|
-
getMessageQueueData: {
|
4626
|
-
method: "GET",
|
4627
|
-
path: "/message-queue-data",
|
4628
|
-
query: z55.object({
|
4629
|
-
automationQueueId: z55.string().uuid().optional(),
|
4630
|
-
selectedDate: z55.string().min(1)
|
4631
|
-
}),
|
4632
|
-
responses: {
|
4633
|
-
200: DefaultSuccessResponseSchema.extend({
|
4634
|
-
messageQueueData: MessageQueueDataSchema
|
4635
|
-
})
|
4636
|
-
}
|
4637
4578
|
}
|
4638
4579
|
},
|
4639
4580
|
{
|
@@ -5050,7 +4991,7 @@ var lineContract = initContract17().router({
|
|
5050
4991
|
path: "/message",
|
5051
4992
|
body: SendMessageToPlatformSchema,
|
5052
4993
|
responses: {
|
5053
|
-
200: SendMessageResponseSchema,
|
4994
|
+
200: z63.union([SendMessageResponseSchema, z63.literal("TALK TO AGENT")]),
|
5054
4995
|
500: DefaultErrorResponseSchema
|
5055
4996
|
}
|
5056
4997
|
},
|
@@ -5435,70 +5376,52 @@ var tagContract = initContract22().router(
|
|
5435
5376
|
|
5436
5377
|
// src/telephony-agent-presence-status/index.ts
|
5437
5378
|
import { initContract as initContract23 } from "@ts-rest/core";
|
5438
|
-
import
|
5439
|
-
|
5440
|
-
// src/telephony-agent-presence-status/schema.ts
|
5441
|
-
import z72 from "zod";
|
5379
|
+
import z73 from "zod";
|
5442
5380
|
|
5443
5381
|
// src/presence-status/schema.ts
|
5444
5382
|
import z71 from "zod";
|
5445
|
-
var
|
5446
|
-
"
|
5447
|
-
"
|
5448
|
-
|
5383
|
+
var PresenceStatusEnum = z71.enum([
|
5384
|
+
"receive_call_noti",
|
5385
|
+
"do_not_receive_call_noti",
|
5386
|
+
"default"
|
5449
5387
|
]);
|
5450
5388
|
var PresenceStatusSchema = z71.object({
|
5451
5389
|
id: z71.string().uuid(),
|
5452
5390
|
createdAt: z71.date(),
|
5453
5391
|
updatedAt: z71.date(),
|
5454
5392
|
deletedAt: z71.date().nullable(),
|
5455
|
-
status:
|
5456
|
-
|
5457
|
-
position: z71.number()
|
5393
|
+
status: PresenceStatusEnum,
|
5394
|
+
statusName: z71.string(),
|
5395
|
+
position: z71.number(),
|
5396
|
+
emoji: z71.string()
|
5458
5397
|
});
|
5459
5398
|
|
5460
5399
|
// src/telephony-agent-presence-status/schema.ts
|
5461
5400
|
var UserPresenceStatusSchema = DefaultEntitySchema.extend({
|
5462
5401
|
user: UserSchema,
|
5463
|
-
presenceStatus: PresenceStatusSchema
|
5464
|
-
customPresenceStatus: z72.string().nullable().optional()
|
5402
|
+
presenceStatus: PresenceStatusSchema
|
5465
5403
|
});
|
5466
5404
|
|
5467
5405
|
// src/telephony-agent-presence-status/validation.ts
|
5468
|
-
import { z as
|
5469
|
-
var UpdateUserStatusSchema =
|
5470
|
-
userId:
|
5471
|
-
presenceStatusId:
|
5472
|
-
|
5473
|
-
reason: z73.string()
|
5406
|
+
import { z as z72 } from "zod";
|
5407
|
+
var UpdateUserStatusSchema = z72.object({
|
5408
|
+
userId: z72.string(),
|
5409
|
+
presenceStatusId: z72.string().nullable().optional(),
|
5410
|
+
reason: z72.string()
|
5474
5411
|
});
|
5475
5412
|
|
5476
5413
|
// src/telephony-agent-presence-status/index.ts
|
5477
5414
|
var telephonyAgentPresenceStatusContract = initContract23().router(
|
5478
5415
|
{
|
5479
|
-
getAllAgentStatus: {
|
5480
|
-
method: "GET",
|
5481
|
-
path: "/agents/presence_status",
|
5482
|
-
headers: DefaultHeaderSchema,
|
5483
|
-
responses: {
|
5484
|
-
200: z74.array(UserPresenceStatusSchema),
|
5485
|
-
400: z74.object({
|
5486
|
-
message: z74.string()
|
5487
|
-
}),
|
5488
|
-
401: DefaultUnauthorizedSchema,
|
5489
|
-
500: DefaultErrorResponseSchema
|
5490
|
-
},
|
5491
|
-
summary: "Get all user presence status list."
|
5492
|
-
},
|
5493
5416
|
getAgentStatus: {
|
5494
5417
|
method: "GET",
|
5495
5418
|
path: "/presence_status/check_update/:userId",
|
5496
|
-
pathParams:
|
5419
|
+
pathParams: z73.object({ userId: z73.string() }),
|
5497
5420
|
headers: DefaultHeaderSchema,
|
5498
5421
|
responses: {
|
5499
5422
|
200: UserPresenceStatusSchema,
|
5500
|
-
400:
|
5501
|
-
message:
|
5423
|
+
400: z73.object({
|
5424
|
+
message: z73.string()
|
5502
5425
|
}),
|
5503
5426
|
401: DefaultUnauthorizedSchema,
|
5504
5427
|
500: DefaultErrorResponseSchema
|
@@ -5514,8 +5437,8 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5514
5437
|
200: DefaultSuccessResponseSchema.extend({
|
5515
5438
|
userPresenceStatu: UserPresenceStatusSchema
|
5516
5439
|
}),
|
5517
|
-
400:
|
5518
|
-
message:
|
5440
|
+
400: z73.object({
|
5441
|
+
message: z73.string()
|
5519
5442
|
}),
|
5520
5443
|
401: DefaultUnauthorizedSchema,
|
5521
5444
|
500: DefaultErrorResponseSchema
|
@@ -5527,65 +5450,65 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5527
5450
|
);
|
5528
5451
|
|
5529
5452
|
// src/telephony-cdr/index.ts
|
5530
|
-
import
|
5453
|
+
import z75 from "zod";
|
5531
5454
|
|
5532
5455
|
// src/telephony-cdr/validation.ts
|
5533
|
-
import
|
5534
|
-
var CreateTelephonyCdrSchema =
|
5535
|
-
uniqueCallId:
|
5536
|
-
timeStart:
|
5537
|
-
callFrom:
|
5538
|
-
callTo:
|
5539
|
-
callDuration:
|
5540
|
-
talkDuration:
|
5541
|
-
srcTrunkName:
|
5542
|
-
dstTrunkName:
|
5543
|
-
pinCode:
|
5544
|
-
status:
|
5545
|
-
type:
|
5546
|
-
recording:
|
5547
|
-
didNumber:
|
5548
|
-
agentRingTime:
|
5456
|
+
import z74 from "zod";
|
5457
|
+
var CreateTelephonyCdrSchema = z74.object({
|
5458
|
+
uniqueCallId: z74.string({ required_error: "uniqueCallId is required" }),
|
5459
|
+
timeStart: z74.string({ required_error: "timeStart is required" }),
|
5460
|
+
callFrom: z74.string({ required_error: "callFrom is required" }),
|
5461
|
+
callTo: z74.string({ required_error: "callTo is required" }),
|
5462
|
+
callDuration: z74.number().nullable(),
|
5463
|
+
talkDuration: z74.number().nullable(),
|
5464
|
+
srcTrunkName: z74.string().nullable(),
|
5465
|
+
dstTrunkName: z74.string().nullable(),
|
5466
|
+
pinCode: z74.string().nullable(),
|
5467
|
+
status: z74.string(),
|
5468
|
+
type: z74.string(),
|
5469
|
+
recording: z74.string().nullable(),
|
5470
|
+
didNumber: z74.string().nullable(),
|
5471
|
+
agentRingTime: z74.number().nullable()
|
5549
5472
|
});
|
5550
5473
|
var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5551
|
-
selectedDate:
|
5552
|
-
type:
|
5553
|
-
status:
|
5554
|
-
callFrom:
|
5555
|
-
callTo:
|
5556
|
-
trunk:
|
5557
|
-
userId:
|
5558
|
-
queueStatus:
|
5559
|
-
agentIds:
|
5560
|
-
agentCallsOnly:
|
5561
|
-
contactId:
|
5474
|
+
selectedDate: z74.string().optional(),
|
5475
|
+
type: z74.array(z74.string()).optional(),
|
5476
|
+
status: z74.array(z74.string()).optional(),
|
5477
|
+
callFrom: z74.string().optional(),
|
5478
|
+
callTo: z74.string().optional(),
|
5479
|
+
trunk: z74.array(z74.string()).optional(),
|
5480
|
+
userId: z74.string().uuid().optional(),
|
5481
|
+
queueStatus: z74.string().optional(),
|
5482
|
+
agentIds: z74.array(z74.string().uuid()).optional(),
|
5483
|
+
agentCallsOnly: z74.coerce.boolean().optional(),
|
5484
|
+
contactId: z74.string().uuid().optional()
|
5562
5485
|
});
|
5563
5486
|
var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5564
|
-
type:
|
5565
|
-
status:
|
5566
|
-
callFrom:
|
5567
|
-
callTo:
|
5568
|
-
result:
|
5569
|
-
callTags:
|
5570
|
-
selectedDate:
|
5571
|
-
agentId:
|
5572
|
-
contact:
|
5573
|
-
callStatus:
|
5574
|
-
queueIds:
|
5575
|
-
notes:
|
5487
|
+
type: z74.array(z74.string()).optional(),
|
5488
|
+
status: z74.array(z74.string()).optional(),
|
5489
|
+
callFrom: z74.string().optional(),
|
5490
|
+
callTo: z74.string().optional(),
|
5491
|
+
result: z74.array(z74.string()).optional(),
|
5492
|
+
callTags: z74.array(z74.string()).optional(),
|
5493
|
+
selectedDate: z74.string().optional(),
|
5494
|
+
agentId: z74.string().optional(),
|
5495
|
+
contact: z74.array(z74.string()).optional(),
|
5496
|
+
callStatus: z74.array(z74.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
|
5497
|
+
queueIds: z74.array(z74.string()).optional(),
|
5498
|
+
notes: z74.string().optional()
|
5576
5499
|
});
|
5577
5500
|
var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
|
5578
|
-
|
5579
|
-
page:
|
5580
|
-
pageSize:
|
5501
|
+
z74.object({
|
5502
|
+
page: z74.coerce.number().positive().optional(),
|
5503
|
+
pageSize: z74.coerce.number().positive().optional(),
|
5581
5504
|
// We use this export route for both CDR and Call Log.
|
5582
|
-
module:
|
5505
|
+
module: z74.union([z74.literal("cdrs"), z74.literal("call-logs")]).optional().default("cdrs")
|
5583
5506
|
})
|
5584
5507
|
);
|
5585
5508
|
var NullEmptyStringUndefined = ["", null, void 0];
|
5586
5509
|
var EmtptyArrayUndefined = [[], void 0];
|
5587
5510
|
var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
5588
|
-
reportType:
|
5511
|
+
reportType: z74.enum([
|
5589
5512
|
"extcallstatistics",
|
5590
5513
|
"extcallactivity",
|
5591
5514
|
"trunkactivity",
|
@@ -5595,52 +5518,52 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
5595
5518
|
"queueagentmisscalls",
|
5596
5519
|
"queueagentinoutcalls"
|
5597
5520
|
]),
|
5598
|
-
selectedDate:
|
5599
|
-
communicationType:
|
5600
|
-
time:
|
5601
|
-
queueList:
|
5602
|
-
queueId:
|
5603
|
-
trunkList:
|
5604
|
-
extensionList:
|
5521
|
+
selectedDate: z74.string().optional(),
|
5522
|
+
communicationType: z74.union([z74.literal("Inbound"), z74.literal("Outbound"), z74.literal("Internal")]).optional(),
|
5523
|
+
time: z74.string().optional(),
|
5524
|
+
queueList: z74.array(z74.string()).optional(),
|
5525
|
+
queueId: z74.string().optional(),
|
5526
|
+
trunkList: z74.array(z74.string()).optional(),
|
5527
|
+
extensionList: z74.array(z74.string()).optional()
|
5605
5528
|
}).superRefine((input, ctx) => {
|
5606
5529
|
if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
|
5607
5530
|
ctx.addIssue({
|
5608
|
-
code:
|
5531
|
+
code: z74.ZodIssueCode.custom,
|
5609
5532
|
path: ["selectedDate"],
|
5610
5533
|
message: "selectedDate is required."
|
5611
5534
|
});
|
5612
5535
|
}
|
5613
5536
|
if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
|
5614
5537
|
ctx.addIssue({
|
5615
|
-
code:
|
5538
|
+
code: z74.ZodIssueCode.custom,
|
5616
5539
|
path: ["time"],
|
5617
5540
|
message: "time is required."
|
5618
5541
|
});
|
5619
5542
|
}
|
5620
5543
|
if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
|
5621
5544
|
ctx.addIssue({
|
5622
|
-
code:
|
5545
|
+
code: z74.ZodIssueCode.custom,
|
5623
5546
|
path: ["queueList"],
|
5624
5547
|
message: "queueList is required."
|
5625
5548
|
});
|
5626
5549
|
}
|
5627
5550
|
if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
|
5628
5551
|
ctx.addIssue({
|
5629
|
-
code:
|
5552
|
+
code: z74.ZodIssueCode.custom,
|
5630
5553
|
path: ["queueId"],
|
5631
5554
|
message: "queueId is required."
|
5632
5555
|
});
|
5633
5556
|
}
|
5634
5557
|
if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
|
5635
5558
|
ctx.addIssue({
|
5636
|
-
code:
|
5559
|
+
code: z74.ZodIssueCode.custom,
|
5637
5560
|
path: ["trunkList"],
|
5638
5561
|
message: "trunkList is required."
|
5639
5562
|
});
|
5640
5563
|
}
|
5641
5564
|
if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
|
5642
5565
|
ctx.addIssue({
|
5643
|
-
code:
|
5566
|
+
code: z74.ZodIssueCode.custom,
|
5644
5567
|
path: ["extensionList"],
|
5645
5568
|
message: "extensionList is required."
|
5646
5569
|
});
|
@@ -5658,10 +5581,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5658
5581
|
query: GetAllTelephonyCdrSchema,
|
5659
5582
|
responses: {
|
5660
5583
|
200: DefaultSuccessResponseSchema.extend({
|
5661
|
-
total:
|
5662
|
-
page:
|
5663
|
-
pageSize:
|
5664
|
-
telephonyCdrs:
|
5584
|
+
total: z75.number(),
|
5585
|
+
page: z75.number(),
|
5586
|
+
pageSize: z75.number(),
|
5587
|
+
telephonyCdrs: z75.array(TelephonyCdrSchema)
|
5665
5588
|
}),
|
5666
5589
|
401: DefaultUnauthorizedSchema
|
5667
5590
|
},
|
@@ -5674,10 +5597,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5674
5597
|
query: GetAllTelephonyCdrSchema,
|
5675
5598
|
responses: {
|
5676
5599
|
200: DefaultSuccessResponseSchema.extend({
|
5677
|
-
total:
|
5678
|
-
page:
|
5679
|
-
pageSize:
|
5680
|
-
telephonyCdrs:
|
5600
|
+
total: z75.number(),
|
5601
|
+
page: z75.number(),
|
5602
|
+
pageSize: z75.number(),
|
5603
|
+
telephonyCdrs: z75.array(TelephonyCdrSchema)
|
5681
5604
|
}),
|
5682
5605
|
401: DefaultUnauthorizedSchema
|
5683
5606
|
},
|
@@ -5690,10 +5613,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5690
5613
|
query: GetRecentTelephonyCdrSchema,
|
5691
5614
|
responses: {
|
5692
5615
|
200: DefaultSuccessResponseSchema.extend({
|
5693
|
-
total:
|
5694
|
-
page:
|
5695
|
-
pageSize:
|
5696
|
-
telephonyCdrs:
|
5616
|
+
total: z75.number(),
|
5617
|
+
page: z75.number(),
|
5618
|
+
pageSize: z75.number(),
|
5619
|
+
telephonyCdrs: z75.array(TelephonyCdrSchema)
|
5697
5620
|
}),
|
5698
5621
|
401: DefaultUnauthorizedSchema
|
5699
5622
|
},
|
@@ -5718,7 +5641,7 @@ var telephonyCdrContract = initContract24().router(
|
|
5718
5641
|
body: GetYeastarCallReportSchema,
|
5719
5642
|
responses: {
|
5720
5643
|
// 200: CallReportSchema,
|
5721
|
-
200:
|
5644
|
+
200: z75.object({}),
|
5722
5645
|
401: DefaultUnauthorizedSchema
|
5723
5646
|
},
|
5724
5647
|
summary: "Get yeastar call report."
|
@@ -5786,10 +5709,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5786
5709
|
headers: DefaultHeaderSchema,
|
5787
5710
|
responses: {
|
5788
5711
|
200: DefaultSuccessResponseSchema.extend({
|
5789
|
-
callRedirectTo:
|
5712
|
+
callRedirectTo: z75.string()
|
5790
5713
|
}),
|
5791
|
-
400:
|
5792
|
-
message:
|
5714
|
+
400: z75.object({
|
5715
|
+
message: z75.string()
|
5793
5716
|
}),
|
5794
5717
|
401: DefaultUnauthorizedSchema,
|
5795
5718
|
500: DefaultErrorResponseSchema
|
@@ -5802,10 +5725,10 @@ var telephonyCdrContract = initContract24().router(
|
|
5802
5725
|
body: TelephonyRedirectSettingSchema,
|
5803
5726
|
responses: {
|
5804
5727
|
200: DefaultSuccessResponseSchema.extend({
|
5805
|
-
callRedirectTo:
|
5728
|
+
callRedirectTo: z75.string()
|
5806
5729
|
}),
|
5807
|
-
400:
|
5808
|
-
message:
|
5730
|
+
400: z75.object({
|
5731
|
+
message: z75.string()
|
5809
5732
|
}),
|
5810
5733
|
401: DefaultUnauthorizedSchema,
|
5811
5734
|
500: DefaultErrorResponseSchema
|
@@ -5817,11 +5740,11 @@ var telephonyCdrContract = initContract24().router(
|
|
5817
5740
|
headers: DefaultHeaderSchema,
|
5818
5741
|
responses: {
|
5819
5742
|
200: DefaultSuccessResponseSchema.extend({
|
5820
|
-
callRedirectTo:
|
5821
|
-
isMultiTabUsed:
|
5743
|
+
callRedirectTo: z75.string(),
|
5744
|
+
isMultiTabUsed: z75.string()
|
5822
5745
|
}),
|
5823
|
-
400:
|
5824
|
-
message:
|
5746
|
+
400: z75.object({
|
5747
|
+
message: z75.string()
|
5825
5748
|
}),
|
5826
5749
|
401: DefaultUnauthorizedSchema,
|
5827
5750
|
500: DefaultErrorResponseSchema
|
@@ -5834,11 +5757,11 @@ var telephonyCdrContract = initContract24().router(
|
|
5834
5757
|
body: CallSettingSchema,
|
5835
5758
|
responses: {
|
5836
5759
|
200: DefaultSuccessResponseSchema.extend({
|
5837
|
-
callRedirectTo:
|
5838
|
-
isMultiTabUsed:
|
5760
|
+
callRedirectTo: z75.string(),
|
5761
|
+
isMultiTabUsed: z75.string()
|
5839
5762
|
}),
|
5840
|
-
400:
|
5841
|
-
message:
|
5763
|
+
400: z75.object({
|
5764
|
+
message: z75.string()
|
5842
5765
|
}),
|
5843
5766
|
401: DefaultUnauthorizedSchema,
|
5844
5767
|
500: DefaultErrorResponseSchema
|
@@ -5850,35 +5773,35 @@ var telephonyCdrContract = initContract24().router(
|
|
5850
5773
|
|
5851
5774
|
// src/telephony-extension/index.ts
|
5852
5775
|
import { initContract as initContract25 } from "@ts-rest/core";
|
5853
|
-
import
|
5776
|
+
import z77 from "zod";
|
5854
5777
|
|
5855
5778
|
// src/telephony-extension/schema.ts
|
5856
|
-
import
|
5857
|
-
var TelephonyExtensionSchema3 =
|
5858
|
-
errcode:
|
5859
|
-
errmsg:
|
5860
|
-
total_number:
|
5861
|
-
data:
|
5862
|
-
|
5863
|
-
id:
|
5864
|
-
online_status:
|
5865
|
-
fx_phone:
|
5866
|
-
sip_phone:
|
5867
|
-
status:
|
5868
|
-
ext_dev_type:
|
5869
|
-
}),
|
5870
|
-
linkus_desktop:
|
5871
|
-
linkus_mobile:
|
5872
|
-
linkus_web:
|
5873
|
-
status:
|
5874
|
-
ext_dev_type:
|
5779
|
+
import z76 from "zod";
|
5780
|
+
var TelephonyExtensionSchema3 = z76.object({
|
5781
|
+
errcode: z76.coerce.number(),
|
5782
|
+
errmsg: z76.string(),
|
5783
|
+
total_number: z76.coerce.number(),
|
5784
|
+
data: z76.array(
|
5785
|
+
z76.object({
|
5786
|
+
id: z76.coerce.number(),
|
5787
|
+
online_status: z76.object({
|
5788
|
+
fx_phone: z76.object({ status: z76.coerce.number() }),
|
5789
|
+
sip_phone: z76.object({
|
5790
|
+
status: z76.coerce.number(),
|
5791
|
+
ext_dev_type: z76.string().optional()
|
5792
|
+
}),
|
5793
|
+
linkus_desktop: z76.object({ status: z76.coerce.number() }),
|
5794
|
+
linkus_mobile: z76.object({ status: z76.coerce.number() }),
|
5795
|
+
linkus_web: z76.object({
|
5796
|
+
status: z76.coerce.number(),
|
5797
|
+
ext_dev_type: z76.string().optional()
|
5875
5798
|
})
|
5876
5799
|
}).optional(),
|
5877
|
-
presence_status:
|
5878
|
-
number:
|
5879
|
-
caller_id_name:
|
5880
|
-
role_name:
|
5881
|
-
email_addr:
|
5800
|
+
presence_status: z76.string().optional(),
|
5801
|
+
number: z76.string().optional(),
|
5802
|
+
caller_id_name: z76.string().optional(),
|
5803
|
+
role_name: z76.string().optional(),
|
5804
|
+
email_addr: z76.string().optional()
|
5882
5805
|
})
|
5883
5806
|
)
|
5884
5807
|
});
|
@@ -5893,8 +5816,8 @@ var telephonyExtensionContract = initContract25().router(
|
|
5893
5816
|
query: null,
|
5894
5817
|
responses: {
|
5895
5818
|
200: TelephonyExtensionSchema3,
|
5896
|
-
400:
|
5897
|
-
message:
|
5819
|
+
400: z77.object({
|
5820
|
+
message: z77.string()
|
5898
5821
|
}),
|
5899
5822
|
401: DefaultUnauthorizedSchema,
|
5900
5823
|
500: DefaultErrorResponseSchema
|
@@ -5907,10 +5830,10 @@ var telephonyExtensionContract = initContract25().router(
|
|
5907
5830
|
|
5908
5831
|
// src/ticket/index.ts
|
5909
5832
|
import { initContract as initContract26 } from "@ts-rest/core";
|
5910
|
-
import
|
5833
|
+
import z79 from "zod";
|
5911
5834
|
|
5912
5835
|
// src/ticket/validation.ts
|
5913
|
-
import
|
5836
|
+
import z78 from "zod";
|
5914
5837
|
var addErrorMessage2 = (field) => {
|
5915
5838
|
return field.refine(
|
5916
5839
|
({ isRequired, value }) => {
|
@@ -5928,108 +5851,108 @@ var addErrorMessage2 = (field) => {
|
|
5928
5851
|
}
|
5929
5852
|
);
|
5930
5853
|
};
|
5931
|
-
var BaseSchema3 =
|
5932
|
-
isRequired:
|
5933
|
-
attributeId:
|
5854
|
+
var BaseSchema3 = z78.object({
|
5855
|
+
isRequired: z78.boolean(),
|
5856
|
+
attributeId: z78.string()
|
5934
5857
|
});
|
5935
5858
|
var SingleValue2 = addErrorMessage2(
|
5936
5859
|
BaseSchema3.extend({
|
5937
|
-
value:
|
5860
|
+
value: z78.string()
|
5938
5861
|
})
|
5939
5862
|
);
|
5940
|
-
var CreateTicketValidationSchema =
|
5863
|
+
var CreateTicketValidationSchema = z78.object({
|
5941
5864
|
title: SingleValue2,
|
5942
5865
|
description: SingleValue2,
|
5943
5866
|
status: SingleValue2,
|
5944
5867
|
type: SingleValue2,
|
5945
5868
|
priority: SingleValue2,
|
5946
5869
|
contact: SingleValue2,
|
5947
|
-
assignee:
|
5948
|
-
isRequired:
|
5949
|
-
attributeId:
|
5950
|
-
value:
|
5870
|
+
assignee: z78.object({
|
5871
|
+
isRequired: z78.boolean(),
|
5872
|
+
attributeId: z78.string(),
|
5873
|
+
value: z78.string()
|
5951
5874
|
}),
|
5952
5875
|
channel: SingleValue2,
|
5953
|
-
tags: addErrorMessage2(BaseSchema3.extend({ value:
|
5954
|
-
categories: BaseSchema3.extend({ value:
|
5955
|
-
customFields:
|
5876
|
+
tags: addErrorMessage2(BaseSchema3.extend({ value: z78.array(z78.string()) })),
|
5877
|
+
categories: BaseSchema3.extend({ value: z78.array(z78.string()) }),
|
5878
|
+
customFields: z78.array(
|
5956
5879
|
addErrorMessage2(
|
5957
5880
|
BaseSchema3.extend({
|
5958
|
-
value:
|
5959
|
-
type:
|
5960
|
-
isDefaultAttribute:
|
5881
|
+
value: z78.union([z78.string(), z78.array(z78.string())]),
|
5882
|
+
type: z78.string(),
|
5883
|
+
isDefaultAttribute: z78.boolean()
|
5961
5884
|
})
|
5962
5885
|
)
|
5963
5886
|
),
|
5964
|
-
reasonToAssign:
|
5887
|
+
reasonToAssign: z78.object({ value: z78.string() }).optional()
|
5965
5888
|
});
|
5966
5889
|
var UpdateTicketValidationSchema = CreateTicketValidationSchema;
|
5967
|
-
var TicketAttachmentRecordSchema =
|
5968
|
-
bucketName:
|
5969
|
-
fileKey:
|
5970
|
-
fileName:
|
5971
|
-
fileSize:
|
5972
|
-
url:
|
5973
|
-
});
|
5974
|
-
var CreateTicketAttachmentRecordsSchema =
|
5975
|
-
ticketId:
|
5976
|
-
attributeId:
|
5977
|
-
ticketAttachmentRecords:
|
5978
|
-
});
|
5979
|
-
var TicketParamsSchema =
|
5980
|
-
page:
|
5981
|
-
pageSize:
|
5982
|
-
});
|
5983
|
-
var CustomFieldQuery =
|
5984
|
-
attributeId:
|
5985
|
-
type:
|
5986
|
-
value:
|
5987
|
-
});
|
5988
|
-
var GetAllTicketQuerySchema =
|
5989
|
-
page:
|
5990
|
-
pageSize:
|
5991
|
-
selectedDate:
|
5992
|
-
ticketNumber:
|
5993
|
-
keyword:
|
5994
|
-
title:
|
5995
|
-
description:
|
5996
|
-
status:
|
5997
|
-
priority:
|
5998
|
-
channel:
|
5999
|
-
type:
|
6000
|
-
ticketType:
|
6001
|
-
contact:
|
6002
|
-
tags:
|
6003
|
-
categories:
|
6004
|
-
assignee:
|
6005
|
-
customFields:
|
6006
|
-
|
6007
|
-
attributeId:
|
6008
|
-
type:
|
6009
|
-
value:
|
5890
|
+
var TicketAttachmentRecordSchema = z78.object({
|
5891
|
+
bucketName: z78.string(),
|
5892
|
+
fileKey: z78.string(),
|
5893
|
+
fileName: z78.string(),
|
5894
|
+
fileSize: z78.coerce.number(),
|
5895
|
+
url: z78.string()
|
5896
|
+
});
|
5897
|
+
var CreateTicketAttachmentRecordsSchema = z78.object({
|
5898
|
+
ticketId: z78.string(),
|
5899
|
+
attributeId: z78.string(),
|
5900
|
+
ticketAttachmentRecords: z78.array(TicketAttachmentRecordSchema)
|
5901
|
+
});
|
5902
|
+
var TicketParamsSchema = z78.object({
|
5903
|
+
page: z78.coerce.number().default(1),
|
5904
|
+
pageSize: z78.coerce.number().default(10)
|
5905
|
+
});
|
5906
|
+
var CustomFieldQuery = z78.object({
|
5907
|
+
attributeId: z78.string(),
|
5908
|
+
type: z78.string(),
|
5909
|
+
value: z78.union([z78.string(), z78.array(z78.string())])
|
5910
|
+
});
|
5911
|
+
var GetAllTicketQuerySchema = z78.object({
|
5912
|
+
page: z78.string().transform((value) => Number(value)),
|
5913
|
+
pageSize: z78.string().transform((value) => Number(value)),
|
5914
|
+
selectedDate: z78.string(),
|
5915
|
+
ticketNumber: z78.string(),
|
5916
|
+
keyword: z78.string(),
|
5917
|
+
title: z78.string(),
|
5918
|
+
description: z78.string(),
|
5919
|
+
status: z78.array(z78.string()),
|
5920
|
+
priority: z78.array(z78.string()),
|
5921
|
+
channel: z78.array(z78.string()),
|
5922
|
+
type: z78.array(z78.string()),
|
5923
|
+
ticketType: z78.array(z78.string()),
|
5924
|
+
contact: z78.array(z78.string()),
|
5925
|
+
tags: z78.array(z78.string().uuid()),
|
5926
|
+
categories: z78.array(z78.string().uuid()),
|
5927
|
+
assignee: z78.array(z78.string().uuid()),
|
5928
|
+
customFields: z78.array(
|
5929
|
+
z78.object({
|
5930
|
+
attributeId: z78.string().uuid(),
|
5931
|
+
type: z78.string(),
|
5932
|
+
value: z78.union([z78.string(), z78.array(z78.string())])
|
6010
5933
|
})
|
6011
5934
|
)
|
6012
5935
|
}).partial();
|
6013
|
-
var ExportAllTicketQuerySchema =
|
6014
|
-
agent:
|
6015
|
-
selectedDate:
|
6016
|
-
keyword:
|
6017
|
-
title:
|
6018
|
-
description:
|
6019
|
-
status:
|
6020
|
-
priority:
|
6021
|
-
assignee:
|
6022
|
-
channel:
|
6023
|
-
type:
|
6024
|
-
ticketType:
|
6025
|
-
contact:
|
6026
|
-
tags:
|
6027
|
-
categories:
|
6028
|
-
customFields:
|
6029
|
-
|
6030
|
-
attributeId:
|
6031
|
-
type:
|
6032
|
-
value:
|
5936
|
+
var ExportAllTicketQuerySchema = z78.object({
|
5937
|
+
agent: z78.array(z78.string()),
|
5938
|
+
selectedDate: z78.string(),
|
5939
|
+
keyword: z78.string(),
|
5940
|
+
title: z78.string(),
|
5941
|
+
description: z78.string(),
|
5942
|
+
status: z78.array(z78.string()),
|
5943
|
+
priority: z78.array(z78.string()),
|
5944
|
+
assignee: z78.array(z78.string().uuid()),
|
5945
|
+
channel: z78.array(z78.string()),
|
5946
|
+
type: z78.array(z78.string()),
|
5947
|
+
ticketType: z78.array(z78.string()),
|
5948
|
+
contact: z78.array(z78.string()),
|
5949
|
+
tags: z78.array(z78.string()),
|
5950
|
+
categories: z78.array(z78.string()),
|
5951
|
+
customFields: z78.array(
|
5952
|
+
z78.object({
|
5953
|
+
attributeId: z78.string().uuid(),
|
5954
|
+
type: z78.string(),
|
5955
|
+
value: z78.union([z78.string(), z78.array(z78.string())])
|
6033
5956
|
})
|
6034
5957
|
)
|
6035
5958
|
}).partial();
|
@@ -6045,14 +5968,14 @@ var ticketContract = initContract26().router(
|
|
6045
5968
|
201: DefaultSuccessResponseSchema.extend({
|
6046
5969
|
data: TicketSchema
|
6047
5970
|
}),
|
6048
|
-
400:
|
6049
|
-
message:
|
5971
|
+
400: z79.object({
|
5972
|
+
message: z79.string()
|
6050
5973
|
}),
|
6051
|
-
409:
|
6052
|
-
message:
|
5974
|
+
409: z79.object({
|
5975
|
+
message: z79.string()
|
6053
5976
|
}),
|
6054
|
-
500:
|
6055
|
-
message:
|
5977
|
+
500: z79.object({
|
5978
|
+
message: z79.string()
|
6056
5979
|
}),
|
6057
5980
|
401: DefaultUnauthorizedSchema,
|
6058
5981
|
404: DefaultNotFoundSchema,
|
@@ -6073,8 +5996,8 @@ var ticketContract = initContract26().router(
|
|
6073
5996
|
TicketSchema
|
6074
5997
|
)
|
6075
5998
|
}),
|
6076
|
-
400:
|
6077
|
-
message:
|
5999
|
+
400: z79.object({
|
6000
|
+
message: z79.string()
|
6078
6001
|
}),
|
6079
6002
|
401: DefaultUnauthorizedSchema,
|
6080
6003
|
500: DefaultErrorResponseSchema
|
@@ -6084,14 +6007,14 @@ var ticketContract = initContract26().router(
|
|
6084
6007
|
getTicketById: {
|
6085
6008
|
method: "GET",
|
6086
6009
|
path: "/:id",
|
6087
|
-
pathParams:
|
6010
|
+
pathParams: z79.object({ id: z79.string() }),
|
6088
6011
|
headers: DefaultHeaderSchema,
|
6089
6012
|
responses: {
|
6090
6013
|
200: DefaultSuccessResponseSchema.extend({
|
6091
6014
|
data: TicketSchema
|
6092
6015
|
}),
|
6093
|
-
400:
|
6094
|
-
message:
|
6016
|
+
400: z79.object({
|
6017
|
+
message: z79.string()
|
6095
6018
|
}),
|
6096
6019
|
401: DefaultUnauthorizedSchema,
|
6097
6020
|
500: DefaultErrorResponseSchema
|
@@ -6101,15 +6024,15 @@ var ticketContract = initContract26().router(
|
|
6101
6024
|
getTicketByContactId: {
|
6102
6025
|
method: "GET",
|
6103
6026
|
path: "/contact/:id",
|
6104
|
-
pathParams:
|
6027
|
+
pathParams: z79.object({ id: z79.string() }),
|
6105
6028
|
query: TicketParamsSchema,
|
6106
6029
|
headers: DefaultHeaderSchema,
|
6107
6030
|
responses: {
|
6108
6031
|
200: DefaultSuccessResponseSchema.extend({
|
6109
6032
|
data: WithPagination(TicketSchema)
|
6110
6033
|
}),
|
6111
|
-
400:
|
6112
|
-
message:
|
6034
|
+
400: z79.object({
|
6035
|
+
message: z79.string()
|
6113
6036
|
}),
|
6114
6037
|
401: DefaultUnauthorizedSchema,
|
6115
6038
|
500: DefaultErrorResponseSchema
|
@@ -6119,21 +6042,21 @@ var ticketContract = initContract26().router(
|
|
6119
6042
|
updateTicket: {
|
6120
6043
|
method: "PATCH",
|
6121
6044
|
path: "/:id",
|
6122
|
-
pathParams:
|
6045
|
+
pathParams: z79.object({ id: z79.string() }),
|
6123
6046
|
body: UpdateTicketValidationSchema,
|
6124
6047
|
headers: DefaultHeaderSchema,
|
6125
6048
|
responses: {
|
6126
6049
|
201: DefaultSuccessResponseSchema.extend({
|
6127
6050
|
data: TicketSchema
|
6128
6051
|
}),
|
6129
|
-
400:
|
6130
|
-
message:
|
6052
|
+
400: z79.object({
|
6053
|
+
message: z79.string()
|
6131
6054
|
}),
|
6132
|
-
409:
|
6133
|
-
message:
|
6055
|
+
409: z79.object({
|
6056
|
+
message: z79.string()
|
6134
6057
|
}),
|
6135
|
-
500:
|
6136
|
-
message:
|
6058
|
+
500: z79.object({
|
6059
|
+
message: z79.string()
|
6137
6060
|
}),
|
6138
6061
|
401: DefaultUnauthorizedSchema,
|
6139
6062
|
404: DefaultNotFoundSchema,
|
@@ -6144,11 +6067,11 @@ var ticketContract = initContract26().router(
|
|
6144
6067
|
deleteTicket: {
|
6145
6068
|
method: "DELETE",
|
6146
6069
|
path: "/:id",
|
6147
|
-
pathParams:
|
6070
|
+
pathParams: z79.object({ id: z79.string() }),
|
6148
6071
|
headers: DefaultHeaderSchema,
|
6149
6072
|
body: null,
|
6150
6073
|
responses: {
|
6151
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6074
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6152
6075
|
500: DefaultErrorResponseSchema
|
6153
6076
|
},
|
6154
6077
|
summary: "Delete a extension."
|
@@ -6156,19 +6079,19 @@ var ticketContract = initContract26().router(
|
|
6156
6079
|
updateDescription: {
|
6157
6080
|
method: "PATCH",
|
6158
6081
|
path: "/description/update/:id",
|
6159
|
-
pathParams:
|
6160
|
-
body:
|
6082
|
+
pathParams: z79.object({ id: z79.string() }),
|
6083
|
+
body: z79.object({ description: z79.string() }),
|
6161
6084
|
headers: DefaultHeaderSchema,
|
6162
6085
|
responses: {
|
6163
|
-
201: DefaultSuccessResponseSchema.extend({ message:
|
6164
|
-
400:
|
6165
|
-
message:
|
6086
|
+
201: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6087
|
+
400: z79.object({
|
6088
|
+
message: z79.string()
|
6166
6089
|
}),
|
6167
|
-
409:
|
6168
|
-
message:
|
6090
|
+
409: z79.object({
|
6091
|
+
message: z79.string()
|
6169
6092
|
}),
|
6170
|
-
500:
|
6171
|
-
message:
|
6093
|
+
500: z79.object({
|
6094
|
+
message: z79.string()
|
6172
6095
|
}),
|
6173
6096
|
401: DefaultUnauthorizedSchema,
|
6174
6097
|
404: DefaultNotFoundSchema,
|
@@ -6179,19 +6102,19 @@ var ticketContract = initContract26().router(
|
|
6179
6102
|
updateTitle: {
|
6180
6103
|
method: "PATCH",
|
6181
6104
|
path: "/title/update/:id",
|
6182
|
-
pathParams:
|
6183
|
-
body:
|
6105
|
+
pathParams: z79.object({ id: z79.string() }),
|
6106
|
+
body: z79.object({ title: z79.string() }),
|
6184
6107
|
headers: DefaultHeaderSchema,
|
6185
6108
|
responses: {
|
6186
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6187
|
-
400:
|
6188
|
-
message:
|
6109
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6110
|
+
400: z79.object({
|
6111
|
+
message: z79.string()
|
6189
6112
|
}),
|
6190
|
-
409:
|
6191
|
-
message:
|
6113
|
+
409: z79.object({
|
6114
|
+
message: z79.string()
|
6192
6115
|
}),
|
6193
|
-
500:
|
6194
|
-
message:
|
6116
|
+
500: z79.object({
|
6117
|
+
message: z79.string()
|
6195
6118
|
}),
|
6196
6119
|
401: DefaultUnauthorizedSchema,
|
6197
6120
|
404: DefaultNotFoundSchema,
|
@@ -6202,19 +6125,19 @@ var ticketContract = initContract26().router(
|
|
6202
6125
|
updateType: {
|
6203
6126
|
method: "PATCH",
|
6204
6127
|
path: "/type/update/:id",
|
6205
|
-
pathParams:
|
6206
|
-
body:
|
6128
|
+
pathParams: z79.object({ id: z79.string() }),
|
6129
|
+
body: z79.object({ type: z79.string() }),
|
6207
6130
|
headers: DefaultHeaderSchema,
|
6208
6131
|
responses: {
|
6209
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6210
|
-
400:
|
6211
|
-
message:
|
6132
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6133
|
+
400: z79.object({
|
6134
|
+
message: z79.string()
|
6212
6135
|
}),
|
6213
|
-
409:
|
6214
|
-
message:
|
6136
|
+
409: z79.object({
|
6137
|
+
message: z79.string()
|
6215
6138
|
}),
|
6216
|
-
500:
|
6217
|
-
message:
|
6139
|
+
500: z79.object({
|
6140
|
+
message: z79.string()
|
6218
6141
|
}),
|
6219
6142
|
401: DefaultUnauthorizedSchema,
|
6220
6143
|
404: DefaultNotFoundSchema,
|
@@ -6225,19 +6148,19 @@ var ticketContract = initContract26().router(
|
|
6225
6148
|
updateStatus: {
|
6226
6149
|
method: "PATCH",
|
6227
6150
|
path: "/status/update/:id",
|
6228
|
-
pathParams:
|
6229
|
-
body:
|
6151
|
+
pathParams: z79.object({ id: z79.string() }),
|
6152
|
+
body: z79.object({ status: z79.string() }),
|
6230
6153
|
headers: DefaultHeaderSchema,
|
6231
6154
|
responses: {
|
6232
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6233
|
-
400:
|
6234
|
-
message:
|
6155
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6156
|
+
400: z79.object({
|
6157
|
+
message: z79.string()
|
6235
6158
|
}),
|
6236
|
-
409:
|
6237
|
-
message:
|
6159
|
+
409: z79.object({
|
6160
|
+
message: z79.string()
|
6238
6161
|
}),
|
6239
|
-
500:
|
6240
|
-
message:
|
6162
|
+
500: z79.object({
|
6163
|
+
message: z79.string()
|
6241
6164
|
}),
|
6242
6165
|
401: DefaultUnauthorizedSchema,
|
6243
6166
|
404: DefaultNotFoundSchema,
|
@@ -6248,19 +6171,19 @@ var ticketContract = initContract26().router(
|
|
6248
6171
|
updatePriority: {
|
6249
6172
|
method: "PATCH",
|
6250
6173
|
path: "/priority/update/:id",
|
6251
|
-
pathParams:
|
6252
|
-
body:
|
6174
|
+
pathParams: z79.object({ id: z79.string() }),
|
6175
|
+
body: z79.object({ priority: z79.string() }),
|
6253
6176
|
headers: DefaultHeaderSchema,
|
6254
6177
|
responses: {
|
6255
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6256
|
-
400:
|
6257
|
-
message:
|
6178
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6179
|
+
400: z79.object({
|
6180
|
+
message: z79.string()
|
6258
6181
|
}),
|
6259
|
-
409:
|
6260
|
-
message:
|
6182
|
+
409: z79.object({
|
6183
|
+
message: z79.string()
|
6261
6184
|
}),
|
6262
|
-
500:
|
6263
|
-
message:
|
6185
|
+
500: z79.object({
|
6186
|
+
message: z79.string()
|
6264
6187
|
}),
|
6265
6188
|
401: DefaultUnauthorizedSchema,
|
6266
6189
|
404: DefaultNotFoundSchema,
|
@@ -6271,19 +6194,19 @@ var ticketContract = initContract26().router(
|
|
6271
6194
|
updateChannel: {
|
6272
6195
|
method: "PATCH",
|
6273
6196
|
path: "/channel/update/:id",
|
6274
|
-
pathParams:
|
6275
|
-
body:
|
6197
|
+
pathParams: z79.object({ id: z79.string() }),
|
6198
|
+
body: z79.object({ channel: z79.string() }),
|
6276
6199
|
headers: DefaultHeaderSchema,
|
6277
6200
|
responses: {
|
6278
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6279
|
-
400:
|
6280
|
-
message:
|
6201
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6202
|
+
400: z79.object({
|
6203
|
+
message: z79.string()
|
6281
6204
|
}),
|
6282
|
-
409:
|
6283
|
-
message:
|
6205
|
+
409: z79.object({
|
6206
|
+
message: z79.string()
|
6284
6207
|
}),
|
6285
|
-
500:
|
6286
|
-
message:
|
6208
|
+
500: z79.object({
|
6209
|
+
message: z79.string()
|
6287
6210
|
}),
|
6288
6211
|
401: DefaultUnauthorizedSchema,
|
6289
6212
|
404: DefaultNotFoundSchema,
|
@@ -6294,19 +6217,19 @@ var ticketContract = initContract26().router(
|
|
6294
6217
|
updateTags: {
|
6295
6218
|
method: "PATCH",
|
6296
6219
|
path: "/tags/update/:id",
|
6297
|
-
pathParams:
|
6298
|
-
body:
|
6220
|
+
pathParams: z79.object({ id: z79.string() }),
|
6221
|
+
body: z79.object({ tags: z79.array(z79.string()) }),
|
6299
6222
|
headers: DefaultHeaderSchema,
|
6300
6223
|
responses: {
|
6301
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6302
|
-
400:
|
6303
|
-
message:
|
6224
|
+
200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
|
6225
|
+
400: z79.object({
|
6226
|
+
message: z79.string()
|
6304
6227
|
}),
|
6305
|
-
409:
|
6306
|
-
message:
|
6228
|
+
409: z79.object({
|
6229
|
+
message: z79.string()
|
6307
6230
|
}),
|
6308
|
-
500:
|
6309
|
-
message:
|
6231
|
+
500: z79.object({
|
6232
|
+
message: z79.string()
|
6310
6233
|
}),
|
6311
6234
|
401: DefaultUnauthorizedSchema,
|
6312
6235
|
404: DefaultNotFoundSchema,
|
@@ -6317,25 +6240,25 @@ var ticketContract = initContract26().router(
|
|
6317
6240
|
changeAssignee: {
|
6318
6241
|
method: "PATCH",
|
6319
6242
|
path: "/assignee/update/:id",
|
6320
|
-
pathParams:
|
6321
|
-
body:
|
6322
|
-
ticketId:
|
6323
|
-
assigneeId:
|
6324
|
-
reason:
|
6243
|
+
pathParams: z79.object({ id: z79.string() }),
|
6244
|
+
body: z79.object({
|
6245
|
+
ticketId: z79.string(),
|
6246
|
+
assigneeId: z79.string(),
|
6247
|
+
reason: z79.string().optional()
|
6325
6248
|
}),
|
6326
6249
|
headers: DefaultHeaderSchema,
|
6327
6250
|
responses: {
|
6328
6251
|
200: DefaultSuccessResponseSchema.extend({
|
6329
6252
|
data: TicketSchema
|
6330
6253
|
}),
|
6331
|
-
400:
|
6332
|
-
message:
|
6254
|
+
400: z79.object({
|
6255
|
+
message: z79.string()
|
6333
6256
|
}),
|
6334
|
-
409:
|
6335
|
-
message:
|
6257
|
+
409: z79.object({
|
6258
|
+
message: z79.string()
|
6336
6259
|
}),
|
6337
|
-
500:
|
6338
|
-
message:
|
6260
|
+
500: z79.object({
|
6261
|
+
message: z79.string()
|
6339
6262
|
}),
|
6340
6263
|
401: DefaultUnauthorizedSchema,
|
6341
6264
|
404: DefaultNotFoundSchema,
|
@@ -6346,14 +6269,14 @@ var ticketContract = initContract26().router(
|
|
6346
6269
|
getTicketCountByContact: {
|
6347
6270
|
method: "GET",
|
6348
6271
|
path: "/ticket_count/contact/:id",
|
6349
|
-
pathParams:
|
6272
|
+
pathParams: z79.object({ id: z79.string() }),
|
6350
6273
|
headers: DefaultHeaderSchema,
|
6351
6274
|
responses: {
|
6352
6275
|
200: DefaultSuccessResponseSchema.extend({
|
6353
6276
|
data: TicketCountByContactSchema
|
6354
6277
|
}),
|
6355
|
-
400:
|
6356
|
-
message:
|
6278
|
+
400: z79.object({
|
6279
|
+
message: z79.string()
|
6357
6280
|
}),
|
6358
6281
|
401: DefaultUnauthorizedSchema,
|
6359
6282
|
500: DefaultErrorResponseSchema
|
@@ -6369,14 +6292,14 @@ var ticketContract = initContract26().router(
|
|
6369
6292
|
201: DefaultSuccessResponseSchema.extend({
|
6370
6293
|
data: TicketCustomFieldSchema
|
6371
6294
|
}),
|
6372
|
-
400:
|
6373
|
-
message:
|
6295
|
+
400: z79.object({
|
6296
|
+
message: z79.string()
|
6374
6297
|
}),
|
6375
|
-
409:
|
6376
|
-
message:
|
6298
|
+
409: z79.object({
|
6299
|
+
message: z79.string()
|
6377
6300
|
}),
|
6378
|
-
500:
|
6379
|
-
message:
|
6301
|
+
500: z79.object({
|
6302
|
+
message: z79.string()
|
6380
6303
|
}),
|
6381
6304
|
401: DefaultUnauthorizedSchema,
|
6382
6305
|
404: DefaultNotFoundSchema,
|
@@ -6401,10 +6324,10 @@ var ticketContract = initContract26().router(
|
|
6401
6324
|
headers: DefaultHeaderSchema,
|
6402
6325
|
responses: {
|
6403
6326
|
200: DefaultSuccessResponseSchema.extend({
|
6404
|
-
ticketReasonRequired:
|
6327
|
+
ticketReasonRequired: z79.string()
|
6405
6328
|
}),
|
6406
|
-
400:
|
6407
|
-
message:
|
6329
|
+
400: z79.object({
|
6330
|
+
message: z79.string()
|
6408
6331
|
}),
|
6409
6332
|
401: DefaultUnauthorizedSchema,
|
6410
6333
|
500: DefaultErrorResponseSchema
|
@@ -6417,10 +6340,10 @@ var ticketContract = initContract26().router(
|
|
6417
6340
|
body: TicketReasonRequiredSchema,
|
6418
6341
|
responses: {
|
6419
6342
|
200: DefaultSuccessResponseSchema.extend({
|
6420
|
-
ticketReasonRequired:
|
6343
|
+
ticketReasonRequired: z79.string()
|
6421
6344
|
}),
|
6422
|
-
400:
|
6423
|
-
message:
|
6345
|
+
400: z79.object({
|
6346
|
+
message: z79.string()
|
6424
6347
|
}),
|
6425
6348
|
401: DefaultUnauthorizedSchema,
|
6426
6349
|
500: DefaultErrorResponseSchema
|
@@ -6432,24 +6355,24 @@ var ticketContract = initContract26().router(
|
|
6432
6355
|
|
6433
6356
|
// src/user/index.ts
|
6434
6357
|
import { initContract as initContract27 } from "@ts-rest/core";
|
6435
|
-
import
|
6358
|
+
import z81 from "zod";
|
6436
6359
|
|
6437
6360
|
// src/user/validation.ts
|
6438
|
-
import { z as
|
6439
|
-
var CreateUserSchema =
|
6440
|
-
name:
|
6441
|
-
email:
|
6442
|
-
address:
|
6443
|
-
phone:
|
6444
|
-
password:
|
6445
|
-
notificationCount:
|
6446
|
-
roles:
|
6361
|
+
import { z as z80 } from "zod";
|
6362
|
+
var CreateUserSchema = z80.object({
|
6363
|
+
name: z80.string(),
|
6364
|
+
email: z80.string().email(),
|
6365
|
+
address: z80.string().nullable(),
|
6366
|
+
phone: z80.string().nullable(),
|
6367
|
+
password: z80.string(),
|
6368
|
+
notificationCount: z80.number().nullable().optional(),
|
6369
|
+
roles: z80.array(z80.string())
|
6447
6370
|
});
|
6448
6371
|
var UpdateUserSchema = CreateUserSchema.extend({
|
6449
|
-
newPassword:
|
6372
|
+
newPassword: z80.string()
|
6450
6373
|
});
|
6451
|
-
var UpdateUserProfileSchema =
|
6452
|
-
password:
|
6374
|
+
var UpdateUserProfileSchema = z80.object({
|
6375
|
+
password: z80.string()
|
6453
6376
|
});
|
6454
6377
|
|
6455
6378
|
// src/user/index.ts
|
@@ -6464,8 +6387,8 @@ var userContract = initContract27().router(
|
|
6464
6387
|
201: DefaultSuccessResponseSchema.extend({
|
6465
6388
|
user: UserSchema
|
6466
6389
|
}),
|
6467
|
-
400:
|
6468
|
-
message:
|
6390
|
+
400: z81.object({
|
6391
|
+
message: z81.string()
|
6469
6392
|
}),
|
6470
6393
|
401: DefaultUnauthorizedSchema,
|
6471
6394
|
404: DefaultNotFoundSchema,
|
@@ -6478,18 +6401,18 @@ var userContract = initContract27().router(
|
|
6478
6401
|
method: "GET",
|
6479
6402
|
path: "",
|
6480
6403
|
headers: DefaultHeaderSchema,
|
6481
|
-
query:
|
6482
|
-
page:
|
6483
|
-
pageSize:
|
6404
|
+
query: z81.object({
|
6405
|
+
page: z81.coerce.number().optional(),
|
6406
|
+
pageSize: z81.coerce.number().optional(),
|
6484
6407
|
// Don't add default 10. In some places, we need to fetch all users.
|
6485
|
-
keyword:
|
6486
|
-
userIds:
|
6487
|
-
withPresenceStatus:
|
6408
|
+
keyword: z81.string().optional(),
|
6409
|
+
userIds: z81.array(z81.string()).optional(),
|
6410
|
+
withPresenceStatus: z81.string().transform((val) => val === "true").optional()
|
6488
6411
|
}).optional(),
|
6489
6412
|
responses: {
|
6490
6413
|
200: WithPagination(UserSchema),
|
6491
|
-
400:
|
6492
|
-
message:
|
6414
|
+
400: z81.object({
|
6415
|
+
message: z81.string()
|
6493
6416
|
}),
|
6494
6417
|
401: DefaultUnauthorizedSchema,
|
6495
6418
|
500: DefaultErrorResponseSchema
|
@@ -6499,12 +6422,12 @@ var userContract = initContract27().router(
|
|
6499
6422
|
getUserById: {
|
6500
6423
|
method: "GET",
|
6501
6424
|
path: "/:id",
|
6502
|
-
pathParams:
|
6425
|
+
pathParams: z81.object({ id: z81.string() }),
|
6503
6426
|
headers: DefaultHeaderSchema,
|
6504
6427
|
responses: {
|
6505
6428
|
200: UserSchema,
|
6506
|
-
400:
|
6507
|
-
message:
|
6429
|
+
400: z81.object({
|
6430
|
+
message: z81.string()
|
6508
6431
|
}),
|
6509
6432
|
401: DefaultUnauthorizedSchema
|
6510
6433
|
},
|
@@ -6513,15 +6436,15 @@ var userContract = initContract27().router(
|
|
6513
6436
|
updateUser: {
|
6514
6437
|
method: "PATCH",
|
6515
6438
|
path: "/:id",
|
6516
|
-
pathParams:
|
6439
|
+
pathParams: z81.object({ id: z81.string() }),
|
6517
6440
|
headers: DefaultHeaderSchema,
|
6518
6441
|
body: UpdateUserSchema,
|
6519
6442
|
responses: {
|
6520
6443
|
201: DefaultSuccessResponseSchema.extend({
|
6521
6444
|
user: UserSchema
|
6522
6445
|
}),
|
6523
|
-
400:
|
6524
|
-
message:
|
6446
|
+
400: z81.object({
|
6447
|
+
message: z81.string()
|
6525
6448
|
}),
|
6526
6449
|
401: DefaultUnauthorizedSchema,
|
6527
6450
|
404: DefaultNotFoundSchema,
|
@@ -6533,15 +6456,15 @@ var userContract = initContract27().router(
|
|
6533
6456
|
updateUserProfile: {
|
6534
6457
|
method: "PATCH",
|
6535
6458
|
path: "/profile/:id",
|
6536
|
-
pathParams:
|
6459
|
+
pathParams: z81.object({ id: z81.string() }),
|
6537
6460
|
headers: DefaultHeaderSchema,
|
6538
6461
|
body: UpdateUserProfileSchema,
|
6539
6462
|
responses: {
|
6540
6463
|
201: DefaultSuccessResponseSchema.extend({
|
6541
6464
|
user: UserSchema
|
6542
6465
|
}),
|
6543
|
-
400:
|
6544
|
-
message:
|
6466
|
+
400: z81.object({
|
6467
|
+
message: z81.string()
|
6545
6468
|
}),
|
6546
6469
|
401: DefaultUnauthorizedSchema,
|
6547
6470
|
404: DefaultNotFoundSchema,
|
@@ -6553,11 +6476,11 @@ var userContract = initContract27().router(
|
|
6553
6476
|
deleteUser: {
|
6554
6477
|
method: "DELETE",
|
6555
6478
|
path: "/:id",
|
6556
|
-
pathParams:
|
6479
|
+
pathParams: z81.object({ id: z81.string() }),
|
6557
6480
|
headers: DefaultHeaderSchema,
|
6558
6481
|
body: null,
|
6559
6482
|
responses: {
|
6560
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6483
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6561
6484
|
404: DefaultNotFoundSchema,
|
6562
6485
|
422: DefaultUnprocessibleSchema,
|
6563
6486
|
500: DefaultErrorResponseSchema
|
@@ -6570,26 +6493,26 @@ var userContract = initContract27().router(
|
|
6570
6493
|
|
6571
6494
|
// src/user-presence-status-log/index.ts
|
6572
6495
|
import { initContract as initContract28 } from "@ts-rest/core";
|
6573
|
-
import
|
6496
|
+
import z84 from "zod";
|
6574
6497
|
|
6575
6498
|
// src/user-presence-status-log/schema.ts
|
6576
|
-
import
|
6499
|
+
import z82 from "zod";
|
6577
6500
|
var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
|
6578
6501
|
user: UserSchema,
|
6579
6502
|
previousPresenceStatus: PresenceStatusSchema,
|
6580
6503
|
newPresenceStatus: PresenceStatusSchema,
|
6581
|
-
reason:
|
6504
|
+
reason: z82.string()
|
6582
6505
|
});
|
6583
6506
|
|
6584
6507
|
// src/user-presence-status-log/validation.ts
|
6585
|
-
import
|
6586
|
-
var UserPresenceStatusLogParamsSchema =
|
6587
|
-
page:
|
6588
|
-
pageSize:
|
6589
|
-
selectedDate:
|
6508
|
+
import z83 from "zod";
|
6509
|
+
var UserPresenceStatusLogParamsSchema = z83.object({
|
6510
|
+
page: z83.coerce.number().default(1),
|
6511
|
+
pageSize: z83.coerce.number().default(10),
|
6512
|
+
selectedDate: z83.string().optional()
|
6590
6513
|
}).optional();
|
6591
|
-
var UserPresenceStatusLogExportParamsSchema =
|
6592
|
-
selectedDate:
|
6514
|
+
var UserPresenceStatusLogExportParamsSchema = z83.object({
|
6515
|
+
selectedDate: z83.string().optional()
|
6593
6516
|
});
|
6594
6517
|
|
6595
6518
|
// src/user-presence-status-log/index.ts
|
@@ -6602,8 +6525,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
6602
6525
|
headers: DefaultHeaderSchema,
|
6603
6526
|
responses: {
|
6604
6527
|
200: WithPagination(UserPresenceStatusLogSchema),
|
6605
|
-
400:
|
6606
|
-
message:
|
6528
|
+
400: z84.object({
|
6529
|
+
message: z84.string()
|
6607
6530
|
}),
|
6608
6531
|
401: DefaultUnauthorizedSchema,
|
6609
6532
|
500: DefaultErrorResponseSchema
|
@@ -6617,8 +6540,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
6617
6540
|
headers: DefaultHeaderSchema,
|
6618
6541
|
responses: {
|
6619
6542
|
200: null,
|
6620
|
-
400:
|
6621
|
-
message:
|
6543
|
+
400: z84.object({
|
6544
|
+
message: z84.string()
|
6622
6545
|
}),
|
6623
6546
|
401: DefaultUnauthorizedSchema,
|
6624
6547
|
500: DefaultErrorResponseSchema
|
@@ -6630,44 +6553,44 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
6630
6553
|
|
6631
6554
|
// src/widget/index.ts
|
6632
6555
|
import { initContract as initContract29 } from "@ts-rest/core";
|
6633
|
-
import
|
6556
|
+
import z87 from "zod";
|
6634
6557
|
|
6635
6558
|
// src/widget/schema.ts
|
6636
|
-
import
|
6637
|
-
var FieldsSchema =
|
6638
|
-
var WidgetPositionSchema =
|
6639
|
-
|
6640
|
-
|
6641
|
-
|
6559
|
+
import z85 from "zod";
|
6560
|
+
var FieldsSchema = z85.object({ data: z85.array(z85.string()) });
|
6561
|
+
var WidgetPositionSchema = z85.union([
|
6562
|
+
z85.literal("menu"),
|
6563
|
+
z85.literal("ticket_detail"),
|
6564
|
+
z85.literal("contact_detail")
|
6642
6565
|
]);
|
6643
6566
|
var WidgetSchema = DefaultEntitySchema.extend({
|
6644
|
-
name:
|
6645
|
-
description:
|
6567
|
+
name: z85.string(),
|
6568
|
+
description: z85.string().nullable(),
|
6646
6569
|
position: WidgetPositionSchema.nullable(),
|
6647
6570
|
fields: FieldsSchema,
|
6648
|
-
url:
|
6571
|
+
url: z85.string()
|
6649
6572
|
});
|
6650
6573
|
|
6651
6574
|
// src/widget/validation.ts
|
6652
|
-
import
|
6653
|
-
var CreateWidgetSchema =
|
6654
|
-
name:
|
6655
|
-
description:
|
6656
|
-
url:
|
6575
|
+
import z86 from "zod";
|
6576
|
+
var CreateWidgetSchema = z86.object({
|
6577
|
+
name: z86.string(),
|
6578
|
+
description: z86.string(),
|
6579
|
+
url: z86.string(),
|
6657
6580
|
position: WidgetPositionSchema,
|
6658
|
-
fields:
|
6581
|
+
fields: z86.object({
|
6659
6582
|
data: (
|
6660
6583
|
// Array of attribute system names
|
6661
|
-
|
6584
|
+
z86.array(z86.string())
|
6662
6585
|
)
|
6663
6586
|
}).optional()
|
6664
6587
|
});
|
6665
6588
|
var UpdateWidgetSchema = CreateWidgetSchema;
|
6666
|
-
var GetWidgetUrlPathQuerySchema =
|
6667
|
-
widgetId:
|
6589
|
+
var GetWidgetUrlPathQuerySchema = z86.object({
|
6590
|
+
widgetId: z86.string(),
|
6668
6591
|
// Position ID is ticket ID, contact ID, etc.
|
6669
6592
|
// TODO: The name "Position ID" is confusing. Think of a better name.
|
6670
|
-
positionId:
|
6593
|
+
positionId: z86.string()
|
6671
6594
|
});
|
6672
6595
|
|
6673
6596
|
// src/widget/index.ts
|
@@ -6682,8 +6605,8 @@ var widgetContract = initContract29().router(
|
|
6682
6605
|
201: DefaultSuccessResponseSchema.extend({
|
6683
6606
|
widget: WidgetSchema
|
6684
6607
|
}),
|
6685
|
-
400:
|
6686
|
-
message:
|
6608
|
+
400: z87.object({
|
6609
|
+
message: z87.string()
|
6687
6610
|
}),
|
6688
6611
|
401: DefaultUnauthorizedSchema,
|
6689
6612
|
500: DefaultErrorResponseSchema
|
@@ -6693,17 +6616,17 @@ var widgetContract = initContract29().router(
|
|
6693
6616
|
getWidgets: {
|
6694
6617
|
method: "GET",
|
6695
6618
|
path: "",
|
6696
|
-
query:
|
6697
|
-
page:
|
6698
|
-
pageSize:
|
6699
|
-
keyword:
|
6619
|
+
query: z87.object({
|
6620
|
+
page: z87.coerce.number().default(1),
|
6621
|
+
pageSize: z87.coerce.number().default(10),
|
6622
|
+
keyword: z87.coerce.string().optional()
|
6700
6623
|
}).optional(),
|
6701
6624
|
headers: DefaultHeaderSchema,
|
6702
6625
|
responses: {
|
6703
6626
|
200: WithPagination(WidgetSchema),
|
6704
6627
|
500: DefaultErrorResponseSchema,
|
6705
|
-
400:
|
6706
|
-
message:
|
6628
|
+
400: z87.object({
|
6629
|
+
message: z87.string()
|
6707
6630
|
}),
|
6708
6631
|
401: DefaultUnauthorizedSchema
|
6709
6632
|
},
|
@@ -6714,9 +6637,9 @@ var widgetContract = initContract29().router(
|
|
6714
6637
|
path: "/menu",
|
6715
6638
|
headers: DefaultHeaderSchema,
|
6716
6639
|
responses: {
|
6717
|
-
200:
|
6718
|
-
400:
|
6719
|
-
message:
|
6640
|
+
200: z87.array(WidgetSchema),
|
6641
|
+
400: z87.object({
|
6642
|
+
message: z87.string()
|
6720
6643
|
}),
|
6721
6644
|
401: DefaultUnauthorizedSchema,
|
6722
6645
|
500: DefaultErrorResponseSchema
|
@@ -6728,9 +6651,9 @@ var widgetContract = initContract29().router(
|
|
6728
6651
|
path: "/ticket_detail",
|
6729
6652
|
headers: DefaultHeaderSchema,
|
6730
6653
|
responses: {
|
6731
|
-
200:
|
6732
|
-
400:
|
6733
|
-
message:
|
6654
|
+
200: z87.array(WidgetSchema),
|
6655
|
+
400: z87.object({
|
6656
|
+
message: z87.string()
|
6734
6657
|
}),
|
6735
6658
|
401: DefaultUnauthorizedSchema,
|
6736
6659
|
500: DefaultErrorResponseSchema
|
@@ -6742,9 +6665,9 @@ var widgetContract = initContract29().router(
|
|
6742
6665
|
path: "/contact_detail",
|
6743
6666
|
headers: DefaultHeaderSchema,
|
6744
6667
|
responses: {
|
6745
|
-
200:
|
6746
|
-
400:
|
6747
|
-
message:
|
6668
|
+
200: z87.array(WidgetSchema),
|
6669
|
+
400: z87.object({
|
6670
|
+
message: z87.string()
|
6748
6671
|
}),
|
6749
6672
|
401: DefaultUnauthorizedSchema,
|
6750
6673
|
500: DefaultErrorResponseSchema
|
@@ -6754,12 +6677,12 @@ var widgetContract = initContract29().router(
|
|
6754
6677
|
getWidgetById: {
|
6755
6678
|
method: "GET",
|
6756
6679
|
path: "/:id",
|
6757
|
-
pathParams:
|
6680
|
+
pathParams: z87.object({ id: z87.string() }),
|
6758
6681
|
headers: DefaultHeaderSchema,
|
6759
6682
|
responses: {
|
6760
6683
|
200: WidgetSchema,
|
6761
|
-
400:
|
6762
|
-
message:
|
6684
|
+
400: z87.object({
|
6685
|
+
message: z87.string()
|
6763
6686
|
}),
|
6764
6687
|
401: DefaultUnauthorizedSchema,
|
6765
6688
|
500: DefaultErrorResponseSchema
|
@@ -6773,10 +6696,10 @@ var widgetContract = initContract29().router(
|
|
6773
6696
|
headers: DefaultHeaderSchema,
|
6774
6697
|
responses: {
|
6775
6698
|
201: DefaultSuccessResponseSchema.extend({
|
6776
|
-
url:
|
6699
|
+
url: z87.string()
|
6777
6700
|
}),
|
6778
|
-
400:
|
6779
|
-
message:
|
6701
|
+
400: z87.object({
|
6702
|
+
message: z87.string()
|
6780
6703
|
}),
|
6781
6704
|
401: DefaultUnauthorizedSchema
|
6782
6705
|
},
|
@@ -6785,14 +6708,14 @@ var widgetContract = initContract29().router(
|
|
6785
6708
|
updateWidget: {
|
6786
6709
|
method: "PATCH",
|
6787
6710
|
path: "/:id",
|
6788
|
-
pathParams:
|
6711
|
+
pathParams: z87.object({ id: z87.string() }),
|
6789
6712
|
headers: DefaultHeaderSchema,
|
6790
6713
|
responses: {
|
6791
6714
|
201: DefaultSuccessResponseSchema.extend({
|
6792
6715
|
widget: WidgetSchema
|
6793
6716
|
}),
|
6794
|
-
400:
|
6795
|
-
message:
|
6717
|
+
400: z87.object({
|
6718
|
+
message: z87.string()
|
6796
6719
|
}),
|
6797
6720
|
401: DefaultUnauthorizedSchema
|
6798
6721
|
},
|
@@ -6802,11 +6725,11 @@ var widgetContract = initContract29().router(
|
|
6802
6725
|
deleteWidget: {
|
6803
6726
|
method: "DELETE",
|
6804
6727
|
path: "/:id",
|
6805
|
-
pathParams:
|
6728
|
+
pathParams: z87.object({ id: z87.string() }),
|
6806
6729
|
headers: DefaultHeaderSchema,
|
6807
6730
|
body: null,
|
6808
6731
|
responses: {
|
6809
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6732
|
+
200: DefaultSuccessResponseSchema.extend({ message: z87.string() }),
|
6810
6733
|
500: DefaultErrorResponseSchema
|
6811
6734
|
},
|
6812
6735
|
summary: "Delete a widget."
|
@@ -6817,35 +6740,35 @@ var widgetContract = initContract29().router(
|
|
6817
6740
|
|
6818
6741
|
// src/wrap-up-form/index.ts
|
6819
6742
|
import { initContract as initContract30 } from "@ts-rest/core";
|
6820
|
-
import
|
6743
|
+
import z89 from "zod";
|
6821
6744
|
|
6822
6745
|
// src/wrap-up-form/validation.ts
|
6823
|
-
import { z as
|
6824
|
-
var CreateWrapUpFormSchema =
|
6825
|
-
note:
|
6826
|
-
disposition:
|
6827
|
-
callFrom:
|
6828
|
-
callTo:
|
6746
|
+
import { z as z88 } from "zod";
|
6747
|
+
var CreateWrapUpFormSchema = z88.object({
|
6748
|
+
note: z88.string().nullable().optional(),
|
6749
|
+
disposition: z88.string().nullable().optional(),
|
6750
|
+
callFrom: z88.string().nullable().optional(),
|
6751
|
+
callTo: z88.string().nullable().optional()
|
6829
6752
|
});
|
6830
6753
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
6831
|
-
cxLogId:
|
6832
|
-
type:
|
6833
|
-
tags:
|
6834
|
-
categoryIds:
|
6835
|
-
customFields:
|
6836
|
-
|
6837
|
-
id:
|
6838
|
-
type:
|
6839
|
-
value:
|
6754
|
+
cxLogId: z88.string().uuid().optional(),
|
6755
|
+
type: z88.string().optional(),
|
6756
|
+
tags: z88.array(z88.string()).optional(),
|
6757
|
+
categoryIds: z88.array(z88.string().uuid()).optional(),
|
6758
|
+
customFields: z88.array(
|
6759
|
+
z88.object({
|
6760
|
+
id: z88.string().uuid(),
|
6761
|
+
type: z88.string(),
|
6762
|
+
value: z88.string()
|
6840
6763
|
})
|
6841
6764
|
).optional(),
|
6842
|
-
durationSeconds:
|
6765
|
+
durationSeconds: z88.number().optional()
|
6843
6766
|
});
|
6844
|
-
var CreateCXLogWrapUpFormSchema =
|
6845
|
-
cxLogId:
|
6846
|
-
disposition:
|
6847
|
-
tagIds:
|
6848
|
-
note:
|
6767
|
+
var CreateCXLogWrapUpFormSchema = z88.object({
|
6768
|
+
cxLogId: z88.string().uuid(),
|
6769
|
+
disposition: z88.string().optional(),
|
6770
|
+
tagIds: z88.array(z88.string().uuid()).optional(),
|
6771
|
+
note: z88.string().optional()
|
6849
6772
|
});
|
6850
6773
|
|
6851
6774
|
// src/wrap-up-form/index.ts
|
@@ -6857,10 +6780,10 @@ var wrapUpFormContract = initContract30().router(
|
|
6857
6780
|
headers: DefaultHeaderSchema,
|
6858
6781
|
responses: {
|
6859
6782
|
200: DefaultSuccessResponseSchema.extend({
|
6860
|
-
wrapUpFormTimer:
|
6783
|
+
wrapUpFormTimer: z89.number()
|
6861
6784
|
}),
|
6862
|
-
400:
|
6863
|
-
message:
|
6785
|
+
400: z89.object({
|
6786
|
+
message: z89.string()
|
6864
6787
|
}),
|
6865
6788
|
401: DefaultUnauthorizedSchema,
|
6866
6789
|
500: DefaultErrorResponseSchema
|
@@ -6869,14 +6792,14 @@ var wrapUpFormContract = initContract30().router(
|
|
6869
6792
|
updateWrapUpFormTimer: {
|
6870
6793
|
method: "PATCH",
|
6871
6794
|
path: "/timer",
|
6872
|
-
body:
|
6795
|
+
body: z89.object({ newWrapUpFormTimer: z89.number().positive() }),
|
6873
6796
|
headers: DefaultHeaderSchema,
|
6874
6797
|
responses: {
|
6875
6798
|
200: DefaultSuccessResponseSchema.extend({
|
6876
|
-
wrapUpFormTimer:
|
6799
|
+
wrapUpFormTimer: z89.number()
|
6877
6800
|
}),
|
6878
|
-
400:
|
6879
|
-
message:
|
6801
|
+
400: z89.object({
|
6802
|
+
message: z89.string()
|
6880
6803
|
}),
|
6881
6804
|
401: DefaultUnauthorizedSchema,
|
6882
6805
|
500: DefaultErrorResponseSchema
|
@@ -6891,8 +6814,8 @@ var wrapUpFormContract = initContract30().router(
|
|
6891
6814
|
201: DefaultSuccessResponseSchema.extend({
|
6892
6815
|
wrapUpForm: WrapUpFormSchema
|
6893
6816
|
}),
|
6894
|
-
400:
|
6895
|
-
message:
|
6817
|
+
400: z89.object({
|
6818
|
+
message: z89.string()
|
6896
6819
|
}),
|
6897
6820
|
401: DefaultUnauthorizedSchema,
|
6898
6821
|
500: DefaultErrorResponseSchema
|
@@ -6914,15 +6837,15 @@ var wrapUpFormContract = initContract30().router(
|
|
6914
6837
|
getWrapUpForms: {
|
6915
6838
|
method: "GET",
|
6916
6839
|
path: "",
|
6917
|
-
query:
|
6918
|
-
page:
|
6919
|
-
pageSize:
|
6840
|
+
query: z89.object({
|
6841
|
+
page: z89.coerce.number().default(1),
|
6842
|
+
pageSize: z89.coerce.number().default(10)
|
6920
6843
|
}).optional(),
|
6921
6844
|
headers: DefaultHeaderSchema,
|
6922
6845
|
responses: {
|
6923
6846
|
200: WithPagination(WrapUpFormSchema),
|
6924
|
-
400:
|
6925
|
-
message:
|
6847
|
+
400: z89.object({
|
6848
|
+
message: z89.string()
|
6926
6849
|
}),
|
6927
6850
|
401: DefaultUnauthorizedSchema,
|
6928
6851
|
500: DefaultErrorResponseSchema
|
@@ -6932,12 +6855,12 @@ var wrapUpFormContract = initContract30().router(
|
|
6932
6855
|
getWrapUpForm: {
|
6933
6856
|
method: "GET",
|
6934
6857
|
path: "/:id",
|
6935
|
-
pathParams:
|
6858
|
+
pathParams: z89.object({ id: z89.string() }),
|
6936
6859
|
headers: DefaultHeaderSchema,
|
6937
6860
|
responses: {
|
6938
6861
|
200: WrapUpFormSchema,
|
6939
|
-
400:
|
6940
|
-
message:
|
6862
|
+
400: z89.object({
|
6863
|
+
message: z89.string()
|
6941
6864
|
}),
|
6942
6865
|
401: DefaultUnauthorizedSchema,
|
6943
6866
|
500: DefaultErrorResponseSchema
|
@@ -6946,15 +6869,15 @@ var wrapUpFormContract = initContract30().router(
|
|
6946
6869
|
updateWrapUpForm: {
|
6947
6870
|
method: "PATCH",
|
6948
6871
|
path: "/:id",
|
6949
|
-
pathParams:
|
6872
|
+
pathParams: z89.object({ id: z89.string() }),
|
6950
6873
|
headers: DefaultHeaderSchema,
|
6951
6874
|
body: UpdateWrapUpFormSchema,
|
6952
6875
|
responses: {
|
6953
6876
|
201: DefaultSuccessResponseSchema.extend({
|
6954
6877
|
wrapUpForm: WrapUpFormSchema
|
6955
6878
|
}),
|
6956
|
-
400:
|
6957
|
-
message:
|
6879
|
+
400: z89.object({
|
6880
|
+
message: z89.string()
|
6958
6881
|
}),
|
6959
6882
|
401: DefaultUnauthorizedSchema,
|
6960
6883
|
500: DefaultErrorResponseSchema
|
@@ -6967,28 +6890,28 @@ var wrapUpFormContract = initContract30().router(
|
|
6967
6890
|
|
6968
6891
|
// src/upload/index.ts
|
6969
6892
|
import { initContract as initContract31 } from "@ts-rest/core";
|
6970
|
-
import
|
6893
|
+
import z90 from "zod";
|
6971
6894
|
var uploadContract = initContract31().router(
|
6972
6895
|
{
|
6973
6896
|
rename: {
|
6974
6897
|
method: "POST",
|
6975
6898
|
path: "/:id/rename",
|
6976
|
-
pathParams:
|
6977
|
-
id:
|
6899
|
+
pathParams: z90.object({
|
6900
|
+
id: z90.string()
|
6978
6901
|
}),
|
6979
6902
|
headers: DefaultHeaderSchema,
|
6980
6903
|
responses: {
|
6981
6904
|
201: DefaultSuccessResponseSchema.extend({
|
6982
|
-
message:
|
6905
|
+
message: z90.string()
|
6983
6906
|
}),
|
6984
|
-
400:
|
6985
|
-
message:
|
6907
|
+
400: z90.object({
|
6908
|
+
message: z90.string()
|
6986
6909
|
}),
|
6987
|
-
409:
|
6988
|
-
message:
|
6910
|
+
409: z90.object({
|
6911
|
+
message: z90.string()
|
6989
6912
|
}),
|
6990
|
-
500:
|
6991
|
-
message:
|
6913
|
+
500: z90.object({
|
6914
|
+
message: z90.string()
|
6992
6915
|
}),
|
6993
6916
|
401: DefaultUnauthorizedSchema,
|
6994
6917
|
404: DefaultNotFoundSchema,
|
@@ -7000,23 +6923,23 @@ var uploadContract = initContract31().router(
|
|
7000
6923
|
delete: {
|
7001
6924
|
method: "DELETE",
|
7002
6925
|
path: "/:id",
|
7003
|
-
pathParams:
|
7004
|
-
id:
|
6926
|
+
pathParams: z90.object({
|
6927
|
+
id: z90.string()
|
7005
6928
|
}),
|
7006
6929
|
headers: DefaultHeaderSchema,
|
7007
6930
|
body: null,
|
7008
6931
|
responses: {
|
7009
6932
|
201: DefaultSuccessResponseSchema.extend({
|
7010
|
-
message:
|
6933
|
+
message: z90.string()
|
7011
6934
|
}),
|
7012
|
-
400:
|
7013
|
-
message:
|
6935
|
+
400: z90.object({
|
6936
|
+
message: z90.string()
|
7014
6937
|
}),
|
7015
|
-
409:
|
7016
|
-
message:
|
6938
|
+
409: z90.object({
|
6939
|
+
message: z90.string()
|
7017
6940
|
}),
|
7018
|
-
500:
|
7019
|
-
message:
|
6941
|
+
500: z90.object({
|
6942
|
+
message: z90.string()
|
7020
6943
|
}),
|
7021
6944
|
401: DefaultUnauthorizedSchema,
|
7022
6945
|
404: DefaultNotFoundSchema,
|
@@ -7031,19 +6954,19 @@ var uploadContract = initContract31().router(
|
|
7031
6954
|
);
|
7032
6955
|
|
7033
6956
|
// src/viber/index.ts
|
7034
|
-
import
|
6957
|
+
import z92 from "zod";
|
7035
6958
|
|
7036
6959
|
// src/viber/validation.ts
|
7037
|
-
import
|
7038
|
-
var ViberChannelSchema =
|
7039
|
-
name:
|
7040
|
-
accessToken:
|
7041
|
-
actor:
|
7042
|
-
id:
|
7043
|
-
name:
|
7044
|
-
email:
|
7045
|
-
address:
|
7046
|
-
phone:
|
6960
|
+
import z91 from "zod";
|
6961
|
+
var ViberChannelSchema = z91.object({
|
6962
|
+
name: z91.string(),
|
6963
|
+
accessToken: z91.string(),
|
6964
|
+
actor: z91.object({
|
6965
|
+
id: z91.string().uuid(),
|
6966
|
+
name: z91.string(),
|
6967
|
+
email: z91.string().email(),
|
6968
|
+
address: z91.string().nullable(),
|
6969
|
+
phone: z91.string().nullable()
|
7047
6970
|
}).optional()
|
7048
6971
|
});
|
7049
6972
|
|
@@ -7072,8 +6995,8 @@ var viberContract = initContract32().router({
|
|
7072
6995
|
}),
|
7073
6996
|
400: DefaultErrorResponseSchema
|
7074
6997
|
},
|
7075
|
-
body:
|
7076
|
-
id:
|
6998
|
+
body: z92.object({
|
6999
|
+
id: z92.string().uuid()
|
7077
7000
|
}),
|
7078
7001
|
summary: "Connect viber channel"
|
7079
7002
|
},
|
@@ -7089,8 +7012,8 @@ var viberContract = initContract32().router({
|
|
7089
7012
|
reconnect: {
|
7090
7013
|
method: "POST",
|
7091
7014
|
path: "/reconnect/:channelId",
|
7092
|
-
pathParams:
|
7093
|
-
channelId:
|
7015
|
+
pathParams: z92.object({
|
7016
|
+
channelId: z92.string().uuid()
|
7094
7017
|
}),
|
7095
7018
|
responses: {
|
7096
7019
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7105,8 +7028,8 @@ var viberContract = initContract32().router({
|
|
7105
7028
|
delete: {
|
7106
7029
|
method: "DELETE",
|
7107
7030
|
path: "/delete/:channelId",
|
7108
|
-
pathParams:
|
7109
|
-
channelId:
|
7031
|
+
pathParams: z92.object({
|
7032
|
+
channelId: z92.string().uuid()
|
7110
7033
|
}),
|
7111
7034
|
body: null,
|
7112
7035
|
responses: {
|
@@ -7118,21 +7041,21 @@ var viberContract = initContract32().router({
|
|
7118
7041
|
});
|
7119
7042
|
|
7120
7043
|
// src/telegram/index.ts
|
7121
|
-
import
|
7044
|
+
import z94 from "zod";
|
7122
7045
|
import { initContract as initContract33 } from "@ts-rest/core";
|
7123
7046
|
|
7124
7047
|
// src/telegram/validation.ts
|
7125
|
-
import
|
7126
|
-
var TelegramChannelSchema =
|
7127
|
-
name:
|
7048
|
+
import z93 from "zod";
|
7049
|
+
var TelegramChannelSchema = z93.object({
|
7050
|
+
name: z93.string(),
|
7128
7051
|
// Telegram bot access token
|
7129
|
-
accessToken:
|
7130
|
-
actor:
|
7131
|
-
id:
|
7132
|
-
name:
|
7133
|
-
email:
|
7134
|
-
address:
|
7135
|
-
phone:
|
7052
|
+
accessToken: z93.string(),
|
7053
|
+
actor: z93.object({
|
7054
|
+
id: z93.string().uuid(),
|
7055
|
+
name: z93.string(),
|
7056
|
+
email: z93.string().email(),
|
7057
|
+
address: z93.string().nullable(),
|
7058
|
+
phone: z93.string().nullable()
|
7136
7059
|
}).optional()
|
7137
7060
|
});
|
7138
7061
|
|
@@ -7159,8 +7082,8 @@ var telegramContract = initContract33().router({
|
|
7159
7082
|
500: DefaultErrorResponseSchema,
|
7160
7083
|
400: DefaultErrorResponseSchema
|
7161
7084
|
},
|
7162
|
-
body:
|
7163
|
-
id:
|
7085
|
+
body: z94.object({
|
7086
|
+
id: z94.string().uuid()
|
7164
7087
|
}),
|
7165
7088
|
summary: "Disconnect telegram channel"
|
7166
7089
|
},
|
@@ -7176,8 +7099,8 @@ var telegramContract = initContract33().router({
|
|
7176
7099
|
reconnect: {
|
7177
7100
|
method: "POST",
|
7178
7101
|
path: "/reconnect/:channelId",
|
7179
|
-
pathParams:
|
7180
|
-
channelId:
|
7102
|
+
pathParams: z94.object({
|
7103
|
+
channelId: z94.string().uuid()
|
7181
7104
|
}),
|
7182
7105
|
body: null,
|
7183
7106
|
responses: {
|
@@ -7190,8 +7113,8 @@ var telegramContract = initContract33().router({
|
|
7190
7113
|
delete: {
|
7191
7114
|
method: "DELETE",
|
7192
7115
|
path: "/delete/:channelId",
|
7193
|
-
pathParams:
|
7194
|
-
channelId:
|
7116
|
+
pathParams: z94.object({
|
7117
|
+
channelId: z94.string().uuid()
|
7195
7118
|
}),
|
7196
7119
|
body: null,
|
7197
7120
|
responses: {
|
@@ -7205,58 +7128,58 @@ var telegramContract = initContract33().router({
|
|
7205
7128
|
|
7206
7129
|
// src/notification/index.ts
|
7207
7130
|
import { initContract as initContract34 } from "@ts-rest/core";
|
7208
|
-
import
|
7131
|
+
import z97 from "zod";
|
7209
7132
|
|
7210
7133
|
// src/notification/validation.ts
|
7211
|
-
import
|
7134
|
+
import z96 from "zod";
|
7212
7135
|
|
7213
7136
|
// src/notification/schema.ts
|
7214
|
-
import
|
7215
|
-
var NotificationChangeSchema =
|
7216
|
-
id:
|
7217
|
-
createdAt:
|
7218
|
-
updatedAt:
|
7219
|
-
deletedAt:
|
7220
|
-
actorId:
|
7137
|
+
import z95 from "zod";
|
7138
|
+
var NotificationChangeSchema = z95.object({
|
7139
|
+
id: z95.string().uuid(),
|
7140
|
+
createdAt: z95.date(),
|
7141
|
+
updatedAt: z95.date(),
|
7142
|
+
deletedAt: z95.date().nullable(),
|
7143
|
+
actorId: z95.string().uuid(),
|
7221
7144
|
actor: UserSchema,
|
7222
|
-
notificationObjectId:
|
7223
|
-
readAt:
|
7224
|
-
});
|
7225
|
-
var NotificationObjectSchema =
|
7226
|
-
id:
|
7227
|
-
createdAt:
|
7228
|
-
updatedAt:
|
7229
|
-
deletedAt:
|
7230
|
-
data:
|
7145
|
+
notificationObjectId: z95.string().uuid(),
|
7146
|
+
readAt: z95.date()
|
7147
|
+
});
|
7148
|
+
var NotificationObjectSchema = z95.object({
|
7149
|
+
id: z95.string().uuid(),
|
7150
|
+
createdAt: z95.date(),
|
7151
|
+
updatedAt: z95.date(),
|
7152
|
+
deletedAt: z95.date().nullable(),
|
7153
|
+
data: z95.string(),
|
7231
7154
|
notificationChange: NotificationChangeSchema
|
7232
7155
|
});
|
7233
|
-
var NotificationSchema =
|
7234
|
-
id:
|
7235
|
-
createdAt:
|
7236
|
-
updatedAt:
|
7237
|
-
deletedAt:
|
7238
|
-
notificationObjectId:
|
7239
|
-
notifierId:
|
7156
|
+
var NotificationSchema = z95.object({
|
7157
|
+
id: z95.string().uuid(),
|
7158
|
+
createdAt: z95.date(),
|
7159
|
+
updatedAt: z95.date(),
|
7160
|
+
deletedAt: z95.date().nullable(),
|
7161
|
+
notificationObjectId: z95.string().uuid(),
|
7162
|
+
notifierId: z95.string().uuid(),
|
7240
7163
|
notificationObject: NotificationObjectSchema,
|
7241
|
-
readAt:
|
7164
|
+
readAt: z95.date()
|
7242
7165
|
});
|
7243
7166
|
|
7244
7167
|
// src/notification/validation.ts
|
7245
|
-
var GetNotificationsRequestSchema =
|
7246
|
-
page:
|
7247
|
-
pageSize:
|
7168
|
+
var GetNotificationsRequestSchema = z96.object({
|
7169
|
+
page: z96.coerce.number().default(1),
|
7170
|
+
pageSize: z96.coerce.number().default(10)
|
7248
7171
|
});
|
7249
|
-
var GetNotificationsResponseSchema =
|
7250
|
-
notificationCount:
|
7251
|
-
notifications:
|
7252
|
-
total:
|
7253
|
-
page:
|
7254
|
-
pageSize:
|
7255
|
-
lastPage:
|
7256
|
-
totalUnreadCount:
|
7172
|
+
var GetNotificationsResponseSchema = z96.object({
|
7173
|
+
notificationCount: z96.number(),
|
7174
|
+
notifications: z96.array(NotificationSchema),
|
7175
|
+
total: z96.number(),
|
7176
|
+
page: z96.number(),
|
7177
|
+
pageSize: z96.number(),
|
7178
|
+
lastPage: z96.number(),
|
7179
|
+
totalUnreadCount: z96.number().optional()
|
7257
7180
|
});
|
7258
|
-
var ResetNotificationRequestSchema =
|
7259
|
-
userId:
|
7181
|
+
var ResetNotificationRequestSchema = z96.object({
|
7182
|
+
userId: z96.string()
|
7260
7183
|
});
|
7261
7184
|
|
7262
7185
|
// src/notification/index.ts
|
@@ -7270,14 +7193,14 @@ var userNotificationContract = initContract34().router(
|
|
7270
7193
|
200: DefaultSuccessResponseSchema.extend({
|
7271
7194
|
data: GetNotificationsResponseSchema
|
7272
7195
|
}),
|
7273
|
-
400:
|
7274
|
-
message:
|
7196
|
+
400: z97.object({
|
7197
|
+
message: z97.string()
|
7275
7198
|
}),
|
7276
|
-
409:
|
7277
|
-
message:
|
7199
|
+
409: z97.object({
|
7200
|
+
message: z97.string()
|
7278
7201
|
}),
|
7279
|
-
500:
|
7280
|
-
message:
|
7202
|
+
500: z97.object({
|
7203
|
+
message: z97.string()
|
7281
7204
|
}),
|
7282
7205
|
401: DefaultUnauthorizedSchema,
|
7283
7206
|
404: DefaultNotFoundSchema,
|
@@ -7290,16 +7213,16 @@ var userNotificationContract = initContract34().router(
|
|
7290
7213
|
path: "/new_notifications_count",
|
7291
7214
|
responses: {
|
7292
7215
|
200: DefaultSuccessResponseSchema.extend({
|
7293
|
-
total:
|
7216
|
+
total: z97.number()
|
7294
7217
|
}),
|
7295
|
-
400:
|
7296
|
-
message:
|
7218
|
+
400: z97.object({
|
7219
|
+
message: z97.string()
|
7297
7220
|
}),
|
7298
|
-
409:
|
7299
|
-
message:
|
7221
|
+
409: z97.object({
|
7222
|
+
message: z97.string()
|
7300
7223
|
}),
|
7301
|
-
500:
|
7302
|
-
message:
|
7224
|
+
500: z97.object({
|
7225
|
+
message: z97.string()
|
7303
7226
|
}),
|
7304
7227
|
401: DefaultUnauthorizedSchema,
|
7305
7228
|
404: DefaultNotFoundSchema,
|
@@ -7314,14 +7237,14 @@ var userNotificationContract = initContract34().router(
|
|
7314
7237
|
201: DefaultSuccessResponseSchema.extend({
|
7315
7238
|
data: UserSchema
|
7316
7239
|
}),
|
7317
|
-
400:
|
7318
|
-
message:
|
7240
|
+
400: z97.object({
|
7241
|
+
message: z97.string()
|
7319
7242
|
}),
|
7320
|
-
409:
|
7321
|
-
message:
|
7243
|
+
409: z97.object({
|
7244
|
+
message: z97.string()
|
7322
7245
|
}),
|
7323
|
-
500:
|
7324
|
-
message:
|
7246
|
+
500: z97.object({
|
7247
|
+
message: z97.string()
|
7325
7248
|
}),
|
7326
7249
|
401: DefaultUnauthorizedSchema,
|
7327
7250
|
404: DefaultNotFoundSchema,
|
@@ -7333,19 +7256,19 @@ var userNotificationContract = initContract34().router(
|
|
7333
7256
|
readNotification: {
|
7334
7257
|
method: "POST",
|
7335
7258
|
path: "/read/:id",
|
7336
|
-
pathParams:
|
7259
|
+
pathParams: z97.object({ id: z97.string() }),
|
7337
7260
|
responses: {
|
7338
7261
|
201: DefaultSuccessResponseSchema.extend({
|
7339
7262
|
data: NotificationSchema
|
7340
7263
|
}),
|
7341
|
-
400:
|
7342
|
-
message:
|
7264
|
+
400: z97.object({
|
7265
|
+
message: z97.string()
|
7343
7266
|
}),
|
7344
|
-
409:
|
7345
|
-
message:
|
7267
|
+
409: z97.object({
|
7268
|
+
message: z97.string()
|
7346
7269
|
}),
|
7347
|
-
500:
|
7348
|
-
message:
|
7270
|
+
500: z97.object({
|
7271
|
+
message: z97.string()
|
7349
7272
|
}),
|
7350
7273
|
401: DefaultUnauthorizedSchema,
|
7351
7274
|
404: DefaultNotFoundSchema,
|
@@ -7362,63 +7285,63 @@ var userNotificationContract = initContract34().router(
|
|
7362
7285
|
|
7363
7286
|
// src/snippet/index.ts
|
7364
7287
|
import { initContract as initContract35 } from "@ts-rest/core";
|
7365
|
-
import { z as
|
7288
|
+
import { z as z100 } from "zod";
|
7366
7289
|
|
7367
7290
|
// src/snippet/schema.ts
|
7368
|
-
import
|
7291
|
+
import z98 from "zod";
|
7369
7292
|
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7370
|
-
name:
|
7371
|
-
platformType:
|
7293
|
+
name: z98.string(),
|
7294
|
+
platformType: z98.string()
|
7372
7295
|
});
|
7373
7296
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
7374
|
-
contentType:
|
7375
|
-
contentValue:
|
7376
|
-
contentTemplate:
|
7377
|
-
order:
|
7297
|
+
contentType: z98.string(),
|
7298
|
+
contentValue: z98.string().nullable(),
|
7299
|
+
contentTemplate: z98.any().nullable(),
|
7300
|
+
order: z98.number(),
|
7378
7301
|
upload: UploadSchema.nullable()
|
7379
7302
|
});
|
7380
7303
|
var SnippetSchema = DefaultEntitySchema.extend({
|
7381
|
-
name:
|
7304
|
+
name: z98.string(),
|
7382
7305
|
snippetGroup: SnippetGroupSchema,
|
7383
7306
|
snippetContent: SnippetContentSchema
|
7384
7307
|
});
|
7385
|
-
var SnippetGroupListItemSchema =
|
7386
|
-
id:
|
7387
|
-
name:
|
7308
|
+
var SnippetGroupListItemSchema = z98.object({
|
7309
|
+
id: z98.string().uuid(),
|
7310
|
+
name: z98.string()
|
7388
7311
|
});
|
7389
|
-
var SnippetListItemSchema =
|
7390
|
-
id:
|
7391
|
-
shortCutName:
|
7392
|
-
contentType:
|
7393
|
-
contentValue:
|
7394
|
-
snippetGroupId:
|
7312
|
+
var SnippetListItemSchema = z98.object({
|
7313
|
+
id: z98.string().uuid(),
|
7314
|
+
shortCutName: z98.string(),
|
7315
|
+
contentType: z98.string(),
|
7316
|
+
contentValue: z98.string().nullable(),
|
7317
|
+
snippetGroupId: z98.string()
|
7395
7318
|
});
|
7396
7319
|
|
7397
7320
|
// src/snippet/validation.ts
|
7398
|
-
import { z as
|
7399
|
-
var CreateSnippetGroupSchema =
|
7400
|
-
name:
|
7401
|
-
platformType:
|
7321
|
+
import { z as z99 } from "zod";
|
7322
|
+
var CreateSnippetGroupSchema = z99.object({
|
7323
|
+
name: z99.string(),
|
7324
|
+
platformType: z99.string()
|
7402
7325
|
});
|
7403
|
-
var UpdateSnippetGroupSchema =
|
7404
|
-
name:
|
7405
|
-
platformType:
|
7326
|
+
var UpdateSnippetGroupSchema = z99.object({
|
7327
|
+
name: z99.string().optional(),
|
7328
|
+
platformType: z99.string().optional()
|
7406
7329
|
});
|
7407
|
-
var DeleteSnippetGroupSchema =
|
7408
|
-
id:
|
7330
|
+
var DeleteSnippetGroupSchema = z99.object({
|
7331
|
+
id: z99.string()
|
7409
7332
|
});
|
7410
|
-
var CreateSnippetSchema =
|
7411
|
-
shortcutName:
|
7412
|
-
contentType:
|
7413
|
-
contentValue:
|
7414
|
-
snippetGroupId:
|
7415
|
-
platformType:
|
7333
|
+
var CreateSnippetSchema = z99.object({
|
7334
|
+
shortcutName: z99.string(),
|
7335
|
+
contentType: z99.string(),
|
7336
|
+
contentValue: z99.string().optional(),
|
7337
|
+
snippetGroupId: z99.string(),
|
7338
|
+
platformType: z99.string()
|
7416
7339
|
});
|
7417
7340
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
7418
|
-
snippetContentId:
|
7341
|
+
snippetContentId: z99.string()
|
7419
7342
|
});
|
7420
|
-
var DeleteSnippetSchema =
|
7421
|
-
snippetId:
|
7343
|
+
var DeleteSnippetSchema = z99.object({
|
7344
|
+
snippetId: z99.string()
|
7422
7345
|
});
|
7423
7346
|
|
7424
7347
|
// src/snippet/index.ts
|
@@ -7441,7 +7364,7 @@ var snippetContract = initContract35().router(
|
|
7441
7364
|
query: null,
|
7442
7365
|
responses: {
|
7443
7366
|
200: DefaultSuccessResponseSchema.extend({
|
7444
|
-
snippetgroups:
|
7367
|
+
snippetgroups: z100.array(SnippetGroupSchema)
|
7445
7368
|
}),
|
7446
7369
|
500: DefaultErrorResponseSchema
|
7447
7370
|
}
|
@@ -7449,7 +7372,7 @@ var snippetContract = initContract35().router(
|
|
7449
7372
|
updateSnippetGroup: {
|
7450
7373
|
method: "PATCH",
|
7451
7374
|
path: "/groups/:id",
|
7452
|
-
pathParams:
|
7375
|
+
pathParams: z100.object({ id: z100.string() }),
|
7453
7376
|
body: UpdateSnippetGroupSchema,
|
7454
7377
|
responses: {
|
7455
7378
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7461,7 +7384,7 @@ var snippetContract = initContract35().router(
|
|
7461
7384
|
deleteSnippetGroup: {
|
7462
7385
|
method: "DELETE",
|
7463
7386
|
path: "/groups/:id",
|
7464
|
-
pathParams:
|
7387
|
+
pathParams: z100.object({ id: z100.string() }),
|
7465
7388
|
body: null,
|
7466
7389
|
responses: {
|
7467
7390
|
200: DefaultSuccessResponseSchema,
|
@@ -7473,7 +7396,7 @@ var snippetContract = initContract35().router(
|
|
7473
7396
|
path: "",
|
7474
7397
|
responses: {
|
7475
7398
|
200: DefaultSuccessResponseSchema.extend({
|
7476
|
-
snippets:
|
7399
|
+
snippets: z100.array(SnippetSchema)
|
7477
7400
|
}),
|
7478
7401
|
500: DefaultErrorResponseSchema
|
7479
7402
|
}
|
@@ -7492,7 +7415,7 @@ var snippetContract = initContract35().router(
|
|
7492
7415
|
updateSnippet: {
|
7493
7416
|
method: "PATCH",
|
7494
7417
|
path: "/:id",
|
7495
|
-
pathParams:
|
7418
|
+
pathParams: z100.object({ id: z100.string() }),
|
7496
7419
|
body: UpdateSnippetSchema,
|
7497
7420
|
responses: {
|
7498
7421
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7504,7 +7427,7 @@ var snippetContract = initContract35().router(
|
|
7504
7427
|
deleteSnippet: {
|
7505
7428
|
method: "DELETE",
|
7506
7429
|
path: "/:id",
|
7507
|
-
pathParams:
|
7430
|
+
pathParams: z100.object({ id: z100.string() }),
|
7508
7431
|
body: null,
|
7509
7432
|
responses: {
|
7510
7433
|
200: DefaultSuccessResponseSchema,
|
@@ -7521,77 +7444,77 @@ var snippetContract = initContract35().router(
|
|
7521
7444
|
import { initContract as initContract36 } from "@ts-rest/core";
|
7522
7445
|
|
7523
7446
|
// src/business-calendar/validation.ts
|
7524
|
-
import
|
7525
|
-
var TimeSlotDataSchema =
|
7526
|
-
var CreateBusinessHourSchema =
|
7527
|
-
day:
|
7528
|
-
isEnabled:
|
7447
|
+
import z101 from "zod";
|
7448
|
+
var TimeSlotDataSchema = z101.any();
|
7449
|
+
var CreateBusinessHourSchema = z101.object({
|
7450
|
+
day: z101.string(),
|
7451
|
+
isEnabled: z101.boolean(),
|
7529
7452
|
timeSlots: TimeSlotDataSchema
|
7530
7453
|
}).array();
|
7531
|
-
var UpdateBusinessHourSchema =
|
7532
|
-
id:
|
7533
|
-
day:
|
7534
|
-
isEnabled:
|
7454
|
+
var UpdateBusinessHourSchema = z101.object({
|
7455
|
+
id: z101.string(),
|
7456
|
+
day: z101.string(),
|
7457
|
+
isEnabled: z101.boolean(),
|
7535
7458
|
timeSlots: TimeSlotDataSchema
|
7536
7459
|
}).array();
|
7537
|
-
var CreateHolidaySchema =
|
7538
|
-
name:
|
7539
|
-
date:
|
7540
|
-
isEnabled:
|
7460
|
+
var CreateHolidaySchema = z101.object({
|
7461
|
+
name: z101.string(),
|
7462
|
+
date: z101.string(),
|
7463
|
+
isEnabled: z101.boolean()
|
7541
7464
|
}).array();
|
7542
|
-
var UpdateHolidaySchema =
|
7543
|
-
id:
|
7544
|
-
name:
|
7545
|
-
date:
|
7546
|
-
isEnabled:
|
7465
|
+
var UpdateHolidaySchema = z101.object({
|
7466
|
+
id: z101.string().optional(),
|
7467
|
+
name: z101.string(),
|
7468
|
+
date: z101.string(),
|
7469
|
+
isEnabled: z101.boolean()
|
7547
7470
|
}).array();
|
7548
|
-
var CreateBusinessCalendarSchema =
|
7549
|
-
name:
|
7550
|
-
description:
|
7551
|
-
timeZone:
|
7552
|
-
isEnabled:
|
7471
|
+
var CreateBusinessCalendarSchema = z101.object({
|
7472
|
+
name: z101.string(),
|
7473
|
+
description: z101.string().optional(),
|
7474
|
+
timeZone: z101.string(),
|
7475
|
+
isEnabled: z101.boolean(),
|
7553
7476
|
businessHours: CreateBusinessHourSchema,
|
7554
7477
|
holidays: CreateHolidaySchema
|
7555
7478
|
});
|
7556
|
-
var UpdateBusinessCalendarSchema =
|
7557
|
-
id:
|
7558
|
-
name:
|
7559
|
-
description:
|
7560
|
-
timeZone:
|
7561
|
-
isEnabled:
|
7479
|
+
var UpdateBusinessCalendarSchema = z101.object({
|
7480
|
+
id: z101.string(),
|
7481
|
+
name: z101.string(),
|
7482
|
+
description: z101.string().optional(),
|
7483
|
+
timeZone: z101.string(),
|
7484
|
+
isEnabled: z101.boolean(),
|
7562
7485
|
businessHours: UpdateBusinessHourSchema,
|
7563
7486
|
holidays: UpdateHolidaySchema
|
7564
7487
|
});
|
7565
|
-
var DeleteBusinessCalendarSchema =
|
7566
|
-
id:
|
7488
|
+
var DeleteBusinessCalendarSchema = z101.object({
|
7489
|
+
id: z101.string()
|
7567
7490
|
});
|
7568
7491
|
|
7569
7492
|
// src/business-calendar/schema.ts
|
7570
|
-
import
|
7571
|
-
var TimeSlotDataSchema2 =
|
7493
|
+
import z102 from "zod";
|
7494
|
+
var TimeSlotDataSchema2 = z102.any();
|
7572
7495
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
7573
|
-
day:
|
7574
|
-
isEnabled:
|
7496
|
+
day: z102.string(),
|
7497
|
+
isEnabled: z102.boolean(),
|
7575
7498
|
timeSlots: TimeSlotDataSchema2
|
7576
7499
|
});
|
7577
7500
|
var HolidaySchema = DefaultEntitySchema.extend({
|
7578
|
-
name:
|
7579
|
-
date:
|
7580
|
-
isEnabled:
|
7581
|
-
isDefault:
|
7501
|
+
name: z102.string(),
|
7502
|
+
date: z102.string(),
|
7503
|
+
isEnabled: z102.boolean(),
|
7504
|
+
isDefault: z102.boolean()
|
7582
7505
|
});
|
7583
7506
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
7584
|
-
name:
|
7585
|
-
description:
|
7586
|
-
timeZone:
|
7587
|
-
isEnabled:
|
7588
|
-
isDefault:
|
7507
|
+
name: z102.string(),
|
7508
|
+
description: z102.string().optional(),
|
7509
|
+
timeZone: z102.string(),
|
7510
|
+
isEnabled: z102.boolean(),
|
7511
|
+
isDefault: z102.boolean(),
|
7589
7512
|
businessHours: BusinessHourSchema.array(),
|
7590
7513
|
holidays: HolidaySchema.array()
|
7591
7514
|
});
|
7592
7515
|
|
7593
7516
|
// src/business-calendar/index.ts
|
7594
|
-
import
|
7517
|
+
import z103 from "zod";
|
7595
7518
|
var businessCalendarContract = initContract36().router({
|
7596
7519
|
createBusinessCalendar: {
|
7597
7520
|
method: "POST",
|
@@ -7617,7 +7540,7 @@ var businessCalendarContract = initContract36().router({
|
|
7617
7540
|
updateBusinessCalendar: {
|
7618
7541
|
method: "POST",
|
7619
7542
|
path: "business-calendars/:id",
|
7620
|
-
pathParams:
|
7543
|
+
pathParams: z103.object({ id: z103.string() }),
|
7621
7544
|
body: UpdateBusinessCalendarSchema,
|
7622
7545
|
responses: {
|
7623
7546
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -7629,7 +7552,7 @@ var businessCalendarContract = initContract36().router({
|
|
7629
7552
|
deleteBusinessCalendar: {
|
7630
7553
|
method: "DELETE",
|
7631
7554
|
path: "business-calendars/:id",
|
7632
|
-
pathParams:
|
7555
|
+
pathParams: z103.object({ id: z103.string() }),
|
7633
7556
|
body: null,
|
7634
7557
|
responses: {
|
7635
7558
|
200: DefaultSuccessResponseSchema,
|
@@ -7642,73 +7565,73 @@ var businessCalendarContract = initContract36().router({
|
|
7642
7565
|
import { initContract as initContract37 } from "@ts-rest/core";
|
7643
7566
|
|
7644
7567
|
// src/facebook-feed/validation.ts
|
7645
|
-
import
|
7646
|
-
var GetFacebookPagesSchema2 =
|
7647
|
-
data:
|
7648
|
-
|
7568
|
+
import z104 from "zod";
|
7569
|
+
var GetFacebookPagesSchema2 = z104.object({
|
7570
|
+
data: z104.array(
|
7571
|
+
z104.object({
|
7649
7572
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
7650
|
-
access_token:
|
7651
|
-
category:
|
7573
|
+
access_token: z104.string(),
|
7574
|
+
category: z104.string(),
|
7652
7575
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
7653
|
-
category_list:
|
7654
|
-
|
7655
|
-
id:
|
7656
|
-
name:
|
7576
|
+
category_list: z104.array(
|
7577
|
+
z104.object({
|
7578
|
+
id: z104.string(),
|
7579
|
+
name: z104.string()
|
7657
7580
|
})
|
7658
7581
|
),
|
7659
|
-
id:
|
7660
|
-
name:
|
7661
|
-
tasks:
|
7582
|
+
id: z104.string(),
|
7583
|
+
name: z104.string(),
|
7584
|
+
tasks: z104.string().array()
|
7662
7585
|
})
|
7663
7586
|
),
|
7664
|
-
paging:
|
7665
|
-
cursors:
|
7666
|
-
before:
|
7667
|
-
after:
|
7587
|
+
paging: z104.object({
|
7588
|
+
cursors: z104.object({
|
7589
|
+
before: z104.string().optional(),
|
7590
|
+
after: z104.string().optional()
|
7668
7591
|
})
|
7669
7592
|
}).optional()
|
7670
7593
|
});
|
7671
|
-
var GetFacebookPagesQuerySchema2 =
|
7672
|
-
accessToken:
|
7673
|
-
userId:
|
7594
|
+
var GetFacebookPagesQuerySchema2 = z104.object({
|
7595
|
+
accessToken: z104.string(),
|
7596
|
+
userId: z104.string()
|
7674
7597
|
});
|
7675
7598
|
var ReconnectFacebookFeedSchema = ChannelSchema.merge(
|
7676
|
-
|
7677
|
-
isReloginRequired:
|
7678
|
-
platformContacts:
|
7679
|
-
id:
|
7680
|
-
name:
|
7681
|
-
createdAt:
|
7682
|
-
updatedAt:
|
7683
|
-
deletedAt:
|
7599
|
+
z104.object({
|
7600
|
+
isReloginRequired: z104.boolean(),
|
7601
|
+
platformContacts: z104.array(PlatformContactSchema),
|
7602
|
+
id: z104.string().uuid(),
|
7603
|
+
name: z104.string(),
|
7604
|
+
createdAt: z104.date(),
|
7605
|
+
updatedAt: z104.date(),
|
7606
|
+
deletedAt: z104.date().nullable()
|
7684
7607
|
})
|
7685
7608
|
);
|
7686
|
-
var GetFeedPostResponseSchema =
|
7687
|
-
id:
|
7688
|
-
message:
|
7689
|
-
created_time:
|
7690
|
-
can_reply_privately:
|
7691
|
-
from:
|
7692
|
-
permalink_url:
|
7693
|
-
attachments:
|
7694
|
-
data:
|
7695
|
-
|
7696
|
-
media:
|
7697
|
-
image:
|
7698
|
-
height:
|
7699
|
-
src:
|
7700
|
-
width:
|
7609
|
+
var GetFeedPostResponseSchema = z104.object({
|
7610
|
+
id: z104.string(),
|
7611
|
+
message: z104.string(),
|
7612
|
+
created_time: z104.string(),
|
7613
|
+
can_reply_privately: z104.boolean(),
|
7614
|
+
from: z104.object({ name: z104.string(), id: z104.string() }),
|
7615
|
+
permalink_url: z104.string(),
|
7616
|
+
attachments: z104.object({
|
7617
|
+
data: z104.array(
|
7618
|
+
z104.object({
|
7619
|
+
media: z104.object({
|
7620
|
+
image: z104.object({
|
7621
|
+
height: z104.number(),
|
7622
|
+
src: z104.string(),
|
7623
|
+
width: z104.number()
|
7701
7624
|
})
|
7702
7625
|
}),
|
7703
|
-
media_type:
|
7704
|
-
url:
|
7626
|
+
media_type: z104.string(),
|
7627
|
+
url: z104.string()
|
7705
7628
|
})
|
7706
7629
|
)
|
7707
7630
|
})
|
7708
7631
|
});
|
7709
7632
|
|
7710
7633
|
// src/facebook-feed/index.ts
|
7711
|
-
import
|
7634
|
+
import z105 from "zod";
|
7712
7635
|
var facebookFeedContract = initContract37().router({
|
7713
7636
|
connectToService: {
|
7714
7637
|
method: "POST",
|
@@ -7733,8 +7656,8 @@ var facebookFeedContract = initContract37().router({
|
|
7733
7656
|
reconnect: {
|
7734
7657
|
method: "POST",
|
7735
7658
|
path: "/reconnect/:channelId",
|
7736
|
-
pathParams:
|
7737
|
-
channelId:
|
7659
|
+
pathParams: z105.object({
|
7660
|
+
channelId: z105.string().uuid()
|
7738
7661
|
}),
|
7739
7662
|
body: null,
|
7740
7663
|
responses: {
|
@@ -7746,8 +7669,8 @@ var facebookFeedContract = initContract37().router({
|
|
7746
7669
|
delete: {
|
7747
7670
|
method: "DELETE",
|
7748
7671
|
path: "/delete/:channelId",
|
7749
|
-
pathParams:
|
7750
|
-
channelId:
|
7672
|
+
pathParams: z105.object({
|
7673
|
+
channelId: z105.string().uuid()
|
7751
7674
|
}),
|
7752
7675
|
body: null,
|
7753
7676
|
responses: {
|
@@ -7799,168 +7722,168 @@ var facebookFeedContract = initContract37().router({
|
|
7799
7722
|
|
7800
7723
|
// src/public-api/index.ts
|
7801
7724
|
import { initContract as initContract38 } from "@ts-rest/core";
|
7802
|
-
import
|
7725
|
+
import z108 from "zod";
|
7803
7726
|
|
7804
7727
|
// src/public-api/validation.ts
|
7805
|
-
import
|
7728
|
+
import z107 from "zod";
|
7806
7729
|
|
7807
7730
|
// src/public-api/schema.ts
|
7808
|
-
import
|
7809
|
-
var ContactPhonesSchema2 =
|
7810
|
-
id:
|
7811
|
-
createdAt:
|
7812
|
-
updatedAt:
|
7813
|
-
deletedAt:
|
7814
|
-
phone:
|
7815
|
-
isPrimary:
|
7816
|
-
});
|
7817
|
-
var ContactEmailsSchema2 =
|
7818
|
-
id:
|
7819
|
-
createdAt:
|
7820
|
-
updatedAt:
|
7821
|
-
deletedAt:
|
7822
|
-
email:
|
7823
|
-
isPrimary:
|
7824
|
-
});
|
7825
|
-
var ContactCustomFieldSchema2 =
|
7826
|
-
id:
|
7827
|
-
createdAt:
|
7828
|
-
updatedAt:
|
7829
|
-
deletedAt:
|
7830
|
-
textValue:
|
7831
|
-
booleanValue:
|
7832
|
-
numberValue:
|
7833
|
-
dateValue:
|
7731
|
+
import z106 from "zod";
|
7732
|
+
var ContactPhonesSchema2 = z106.object({
|
7733
|
+
id: z106.string().uuid(),
|
7734
|
+
createdAt: z106.date(),
|
7735
|
+
updatedAt: z106.date(),
|
7736
|
+
deletedAt: z106.date().nullable(),
|
7737
|
+
phone: z106.string(),
|
7738
|
+
isPrimary: z106.boolean()
|
7739
|
+
});
|
7740
|
+
var ContactEmailsSchema2 = z106.object({
|
7741
|
+
id: z106.string().uuid(),
|
7742
|
+
createdAt: z106.date(),
|
7743
|
+
updatedAt: z106.date(),
|
7744
|
+
deletedAt: z106.date().nullable(),
|
7745
|
+
email: z106.string(),
|
7746
|
+
isPrimary: z106.boolean()
|
7747
|
+
});
|
7748
|
+
var ContactCustomFieldSchema2 = z106.object({
|
7749
|
+
id: z106.string().uuid(),
|
7750
|
+
createdAt: z106.date(),
|
7751
|
+
updatedAt: z106.date(),
|
7752
|
+
deletedAt: z106.date().nullable(),
|
7753
|
+
textValue: z106.string().nullable(),
|
7754
|
+
booleanValue: z106.boolean().nullable(),
|
7755
|
+
numberValue: z106.number().nullable(),
|
7756
|
+
dateValue: z106.date().nullable(),
|
7834
7757
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
7835
|
-
uploads:
|
7836
|
-
});
|
7837
|
-
var ContactEntityTypesSchema2 =
|
7838
|
-
id:
|
7839
|
-
createdAt:
|
7840
|
-
updatedAt:
|
7841
|
-
deletedAt:
|
7842
|
-
entity:
|
7843
|
-
description:
|
7844
|
-
});
|
7845
|
-
var ContactActivitySchema2 =
|
7846
|
-
id:
|
7847
|
-
createdAt:
|
7848
|
-
updatedAt:
|
7849
|
-
deletedAt:
|
7850
|
-
entityId:
|
7851
|
-
description:
|
7758
|
+
uploads: z106.array(UploadSchema)
|
7759
|
+
});
|
7760
|
+
var ContactEntityTypesSchema2 = z106.object({
|
7761
|
+
id: z106.string().uuid(),
|
7762
|
+
createdAt: z106.date(),
|
7763
|
+
updatedAt: z106.date(),
|
7764
|
+
deletedAt: z106.date().nullable(),
|
7765
|
+
entity: z106.string(),
|
7766
|
+
description: z106.string().nullable()
|
7767
|
+
});
|
7768
|
+
var ContactActivitySchema2 = z106.object({
|
7769
|
+
id: z106.string().uuid(),
|
7770
|
+
createdAt: z106.date(),
|
7771
|
+
updatedAt: z106.date(),
|
7772
|
+
deletedAt: z106.date().nullable(),
|
7773
|
+
entityId: z106.string(),
|
7774
|
+
description: z106.string(),
|
7852
7775
|
entityType: ContactEntityTypesSchema2
|
7853
7776
|
});
|
7854
|
-
var ContactSchema2 =
|
7855
|
-
id:
|
7856
|
-
createdAt:
|
7857
|
-
updatedAt:
|
7858
|
-
deletedAt:
|
7859
|
-
name:
|
7860
|
-
address:
|
7861
|
-
channel:
|
7862
|
-
notes:
|
7863
|
-
contactProfile:
|
7864
|
-
socialProfileUrl:
|
7865
|
-
tags:
|
7777
|
+
var ContactSchema2 = z106.object({
|
7778
|
+
id: z106.string().uuid(),
|
7779
|
+
createdAt: z106.date(),
|
7780
|
+
updatedAt: z106.date(),
|
7781
|
+
deletedAt: z106.date().nullable(),
|
7782
|
+
name: z106.string(),
|
7783
|
+
address: z106.string().nullable(),
|
7784
|
+
channel: z106.string().nullable(),
|
7785
|
+
notes: z106.string().nullable(),
|
7786
|
+
contactProfile: z106.string().nullable(),
|
7787
|
+
socialProfileUrl: z106.string().nullable(),
|
7788
|
+
tags: z106.array(TagSchema),
|
7866
7789
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
7867
|
-
customFields:
|
7868
|
-
contactEmails:
|
7869
|
-
contactPhones:
|
7870
|
-
activityLogs:
|
7790
|
+
customFields: z106.array(ContactCustomFieldSchema2),
|
7791
|
+
contactEmails: z106.array(ContactEmailsSchema2),
|
7792
|
+
contactPhones: z106.array(ContactPhonesSchema2),
|
7793
|
+
activityLogs: z106.array(ContactActivitySchema2).optional()
|
7871
7794
|
});
|
7872
7795
|
|
7873
7796
|
// src/public-api/validation.ts
|
7874
7797
|
var ContactContractValidationSchema2 = {
|
7875
7798
|
create: {
|
7876
|
-
request:
|
7877
|
-
name:
|
7878
|
-
email:
|
7879
|
-
|
7880
|
-
email:
|
7881
|
-
isPrimary:
|
7799
|
+
request: z107.object({
|
7800
|
+
name: z107.string(),
|
7801
|
+
email: z107.array(
|
7802
|
+
z107.object({
|
7803
|
+
email: z107.string().email(),
|
7804
|
+
isPrimary: z107.boolean()
|
7882
7805
|
})
|
7883
7806
|
).optional(),
|
7884
|
-
channel:
|
7885
|
-
address:
|
7886
|
-
phone:
|
7887
|
-
|
7888
|
-
phone:
|
7889
|
-
isPrimary:
|
7807
|
+
channel: z107.string().optional(),
|
7808
|
+
address: z107.string().optional(),
|
7809
|
+
phone: z107.array(
|
7810
|
+
z107.object({
|
7811
|
+
phone: z107.string(),
|
7812
|
+
isPrimary: z107.boolean()
|
7890
7813
|
})
|
7891
7814
|
).optional(),
|
7892
|
-
notes:
|
7893
|
-
tags:
|
7894
|
-
company:
|
7895
|
-
customFields:
|
7815
|
+
notes: z107.string().optional(),
|
7816
|
+
tags: z107.array(z107.string()).optional(),
|
7817
|
+
company: z107.string().optional(),
|
7818
|
+
customFields: z107.record(z107.string())
|
7896
7819
|
// Dynamic keys with string values
|
7897
7820
|
}),
|
7898
7821
|
response: ContactSchema2
|
7899
7822
|
},
|
7900
7823
|
getById: {
|
7901
|
-
request:
|
7902
|
-
id:
|
7824
|
+
request: z107.object({
|
7825
|
+
id: z107.string().uuid()
|
7903
7826
|
})
|
7904
7827
|
},
|
7905
7828
|
delete: {
|
7906
|
-
request:
|
7907
|
-
id:
|
7829
|
+
request: z107.object({
|
7830
|
+
id: z107.string().uuid()
|
7908
7831
|
})
|
7909
7832
|
},
|
7910
7833
|
getAll: {
|
7911
|
-
request:
|
7912
|
-
page:
|
7913
|
-
pageSize:
|
7914
|
-
keyword:
|
7915
|
-
company:
|
7916
|
-
name:
|
7917
|
-
address:
|
7918
|
-
channel:
|
7919
|
-
selectedDate:
|
7920
|
-
customFields:
|
7921
|
-
|
7922
|
-
attributeId:
|
7923
|
-
type:
|
7924
|
-
value:
|
7834
|
+
request: z107.object({
|
7835
|
+
page: z107.coerce.number().default(1),
|
7836
|
+
pageSize: z107.coerce.number().default(10),
|
7837
|
+
keyword: z107.string().optional(),
|
7838
|
+
company: z107.array(z107.string().uuid()),
|
7839
|
+
name: z107.string(),
|
7840
|
+
address: z107.string(),
|
7841
|
+
channel: z107.array(z107.string()),
|
7842
|
+
selectedDate: z107.string(),
|
7843
|
+
customFields: z107.array(
|
7844
|
+
z107.object({
|
7845
|
+
attributeId: z107.string().uuid(),
|
7846
|
+
type: z107.string(),
|
7847
|
+
value: z107.union([z107.string(), z107.array(z107.string())])
|
7925
7848
|
})
|
7926
7849
|
),
|
7927
|
-
tags:
|
7928
|
-
phone:
|
7929
|
-
email:
|
7930
|
-
notes:
|
7850
|
+
tags: z107.array(z107.string().uuid()),
|
7851
|
+
phone: z107.string(),
|
7852
|
+
email: z107.string(),
|
7853
|
+
notes: z107.string()
|
7931
7854
|
}).partial(),
|
7932
7855
|
response: {
|
7933
|
-
page:
|
7934
|
-
pageSize:
|
7935
|
-
total:
|
7936
|
-
lastPage:
|
7937
|
-
data:
|
7856
|
+
page: z107.number(),
|
7857
|
+
pageSize: z107.number(),
|
7858
|
+
total: z107.number(),
|
7859
|
+
lastPage: z107.number(),
|
7860
|
+
data: z107.array(ContactSchema2)
|
7938
7861
|
}
|
7939
7862
|
},
|
7940
7863
|
getContactFields: {
|
7941
|
-
request:
|
7942
|
-
page:
|
7943
|
-
pageSize:
|
7864
|
+
request: z107.object({
|
7865
|
+
page: z107.coerce.number().default(1),
|
7866
|
+
pageSize: z107.coerce.number().default(10)
|
7944
7867
|
}).partial(),
|
7945
7868
|
response: {
|
7946
|
-
page:
|
7947
|
-
pageSize:
|
7948
|
-
total:
|
7949
|
-
lastPage:
|
7950
|
-
data:
|
7869
|
+
page: z107.number(),
|
7870
|
+
pageSize: z107.number(),
|
7871
|
+
total: z107.number(),
|
7872
|
+
lastPage: z107.number(),
|
7873
|
+
data: z107.array(ContactCustomFieldSchema2)
|
7951
7874
|
}
|
7952
7875
|
},
|
7953
7876
|
addAttachments: {
|
7954
|
-
request:
|
7955
|
-
contactId:
|
7956
|
-
attributeId:
|
7957
|
-
contactAttachmentRecords:
|
7958
|
-
|
7959
|
-
bucketName:
|
7960
|
-
fileKey:
|
7961
|
-
fileName:
|
7962
|
-
fileSize:
|
7963
|
-
url:
|
7877
|
+
request: z107.object({
|
7878
|
+
contactId: z107.string(),
|
7879
|
+
attributeId: z107.string().uuid(),
|
7880
|
+
contactAttachmentRecords: z107.array(
|
7881
|
+
z107.object({
|
7882
|
+
bucketName: z107.string(),
|
7883
|
+
fileKey: z107.string(),
|
7884
|
+
fileName: z107.string(),
|
7885
|
+
fileSize: z107.coerce.number(),
|
7886
|
+
url: z107.string()
|
7964
7887
|
})
|
7965
7888
|
)
|
7966
7889
|
}),
|
@@ -7979,11 +7902,11 @@ var publicApiContract = initContract38().router(
|
|
7979
7902
|
201: DefaultSuccessResponseSchema.extend({
|
7980
7903
|
data: ContactSchema2
|
7981
7904
|
}),
|
7982
|
-
400:
|
7983
|
-
message:
|
7905
|
+
400: z108.object({
|
7906
|
+
message: z108.string()
|
7984
7907
|
}),
|
7985
|
-
409:
|
7986
|
-
message:
|
7908
|
+
409: z108.object({
|
7909
|
+
message: z108.string()
|
7987
7910
|
}),
|
7988
7911
|
401: DefaultUnauthorizedSchema,
|
7989
7912
|
404: DefaultNotFoundSchema,
|
@@ -7998,13 +7921,13 @@ var publicApiContract = initContract38().router(
|
|
7998
7921
|
query: GetTagsSchema,
|
7999
7922
|
responses: {
|
8000
7923
|
200: DefaultSuccessResponseSchema.extend({
|
8001
|
-
tags:
|
7924
|
+
tags: z108.array(TagSchema)
|
8002
7925
|
}),
|
8003
|
-
400:
|
8004
|
-
message:
|
7926
|
+
400: z108.object({
|
7927
|
+
message: z108.string()
|
8005
7928
|
}),
|
8006
|
-
409:
|
8007
|
-
message:
|
7929
|
+
409: z108.object({
|
7930
|
+
message: z108.string()
|
8008
7931
|
}),
|
8009
7932
|
401: DefaultUnauthorizedSchema,
|
8010
7933
|
404: DefaultNotFoundSchema,
|
@@ -8020,11 +7943,11 @@ var publicApiContract = initContract38().router(
|
|
8020
7943
|
200: DefaultSuccessResponseSchema.extend(
|
8021
7944
|
ContactContractValidationSchema2.getAll.response
|
8022
7945
|
),
|
8023
|
-
400:
|
8024
|
-
message:
|
7946
|
+
400: z108.object({
|
7947
|
+
message: z108.string()
|
8025
7948
|
}),
|
8026
|
-
409:
|
8027
|
-
message:
|
7949
|
+
409: z108.object({
|
7950
|
+
message: z108.string()
|
8028
7951
|
}),
|
8029
7952
|
401: DefaultUnauthorizedSchema,
|
8030
7953
|
404: DefaultNotFoundSchema,
|
@@ -8041,11 +7964,11 @@ var publicApiContract = initContract38().router(
|
|
8041
7964
|
200: DefaultSuccessResponseSchema.extend(
|
8042
7965
|
ContactContractValidationSchema2.getContactFields.response
|
8043
7966
|
),
|
8044
|
-
400:
|
8045
|
-
message:
|
7967
|
+
400: z108.object({
|
7968
|
+
message: z108.string()
|
8046
7969
|
}),
|
8047
|
-
409:
|
8048
|
-
message:
|
7970
|
+
409: z108.object({
|
7971
|
+
message: z108.string()
|
8049
7972
|
}),
|
8050
7973
|
401: DefaultUnauthorizedSchema,
|
8051
7974
|
404: DefaultNotFoundSchema,
|
@@ -8059,17 +7982,17 @@ var publicApiContract = initContract38().router(
|
|
8059
7982
|
path: "/contacts/:id",
|
8060
7983
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8061
7984
|
responses: {
|
8062
|
-
200:
|
8063
|
-
status:
|
8064
|
-
message:
|
7985
|
+
200: z108.object({
|
7986
|
+
status: z108.string(),
|
7987
|
+
message: z108.string(),
|
8065
7988
|
data: ContactSchema2,
|
8066
|
-
requestId:
|
7989
|
+
requestId: z108.string()
|
8067
7990
|
}),
|
8068
|
-
400:
|
8069
|
-
message:
|
7991
|
+
400: z108.object({
|
7992
|
+
message: z108.string()
|
8070
7993
|
}),
|
8071
|
-
409:
|
8072
|
-
message:
|
7994
|
+
409: z108.object({
|
7995
|
+
message: z108.string()
|
8073
7996
|
}),
|
8074
7997
|
401: DefaultUnauthorizedSchema,
|
8075
7998
|
404: DefaultNotFoundSchema,
|
@@ -8087,11 +8010,11 @@ var publicApiContract = initContract38().router(
|
|
8087
8010
|
201: DefaultSuccessResponseSchema.extend({
|
8088
8011
|
message: ContactCustomFieldSchema2
|
8089
8012
|
}),
|
8090
|
-
400:
|
8091
|
-
message:
|
8013
|
+
400: z108.object({
|
8014
|
+
message: z108.string()
|
8092
8015
|
}),
|
8093
|
-
409:
|
8094
|
-
message:
|
8016
|
+
409: z108.object({
|
8017
|
+
message: z108.string()
|
8095
8018
|
}),
|
8096
8019
|
401: DefaultUnauthorizedSchema,
|
8097
8020
|
404: DefaultNotFoundSchema,
|
@@ -8105,17 +8028,17 @@ var publicApiContract = initContract38().router(
|
|
8105
8028
|
path: "/contacts/:id",
|
8106
8029
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8107
8030
|
responses: {
|
8108
|
-
200:
|
8109
|
-
status:
|
8110
|
-
message:
|
8031
|
+
200: z108.object({
|
8032
|
+
status: z108.string(),
|
8033
|
+
message: z108.string(),
|
8111
8034
|
data: ContactSchema2,
|
8112
|
-
requestId:
|
8035
|
+
requestId: z108.string()
|
8113
8036
|
}),
|
8114
|
-
400:
|
8115
|
-
message:
|
8037
|
+
400: z108.object({
|
8038
|
+
message: z108.string()
|
8116
8039
|
}),
|
8117
|
-
409:
|
8118
|
-
message:
|
8040
|
+
409: z108.object({
|
8041
|
+
message: z108.string()
|
8119
8042
|
}),
|
8120
8043
|
401: DefaultUnauthorizedSchema,
|
8121
8044
|
404: DefaultNotFoundSchema,
|
@@ -8129,17 +8052,17 @@ var publicApiContract = initContract38().router(
|
|
8129
8052
|
path: "/contacts/:id",
|
8130
8053
|
pathParams: ContactContractValidationSchema2.delete.request,
|
8131
8054
|
responses: {
|
8132
|
-
200:
|
8133
|
-
status:
|
8134
|
-
message:
|
8055
|
+
200: z108.object({
|
8056
|
+
status: z108.string(),
|
8057
|
+
message: z108.string(),
|
8135
8058
|
data: ContactSchema2,
|
8136
|
-
requestId:
|
8059
|
+
requestId: z108.string()
|
8137
8060
|
}),
|
8138
|
-
400:
|
8139
|
-
message:
|
8061
|
+
400: z108.object({
|
8062
|
+
message: z108.string()
|
8140
8063
|
}),
|
8141
|
-
409:
|
8142
|
-
message:
|
8064
|
+
409: z108.object({
|
8065
|
+
message: z108.string()
|
8143
8066
|
}),
|
8144
8067
|
401: DefaultUnauthorizedSchema,
|
8145
8068
|
404: DefaultNotFoundSchema,
|
@@ -8157,17 +8080,17 @@ var publicApiContract = initContract38().router(
|
|
8157
8080
|
|
8158
8081
|
// src/workflow-rule/index.ts
|
8159
8082
|
import { initContract as initContract39 } from "@ts-rest/core";
|
8160
|
-
import
|
8083
|
+
import z109 from "zod";
|
8161
8084
|
var chatContract = initContract39().router(
|
8162
8085
|
{
|
8163
8086
|
updateAssignee: {
|
8164
8087
|
method: "POST",
|
8165
8088
|
path: "/room/assignee",
|
8166
|
-
body:
|
8167
|
-
assigneeId:
|
8168
|
-
roomId:
|
8169
|
-
workflowId:
|
8170
|
-
queueId:
|
8089
|
+
body: z109.object({
|
8090
|
+
assigneeId: z109.string().uuid().optional(),
|
8091
|
+
roomId: z109.string().uuid(),
|
8092
|
+
workflowId: z109.string().uuid(),
|
8093
|
+
queueId: z109.string().uuid().optional()
|
8171
8094
|
}),
|
8172
8095
|
responses: {
|
8173
8096
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8181,9 +8104,9 @@ var chatContract = initContract39().router(
|
|
8181
8104
|
autoReply: {
|
8182
8105
|
method: "POST",
|
8183
8106
|
path: "/message/send",
|
8184
|
-
body:
|
8185
|
-
roomId:
|
8186
|
-
message:
|
8107
|
+
body: z109.object({
|
8108
|
+
roomId: z109.string().uuid(),
|
8109
|
+
message: z109.string(),
|
8187
8110
|
messageType: WorkflowAutoReplyMessageTypeSchema
|
8188
8111
|
// workflowId: z.string().uuid(),
|
8189
8112
|
}),
|
@@ -8199,15 +8122,15 @@ var chatContract = initContract39().router(
|
|
8199
8122
|
solveRoom: {
|
8200
8123
|
method: "POST",
|
8201
8124
|
path: "/room/solve",
|
8202
|
-
body:
|
8203
|
-
roomId:
|
8204
|
-
disposition:
|
8205
|
-
workflowId:
|
8125
|
+
body: z109.object({
|
8126
|
+
roomId: z109.string(),
|
8127
|
+
disposition: z109.string(),
|
8128
|
+
workflowId: z109.string().uuid()
|
8206
8129
|
}),
|
8207
8130
|
responses: {
|
8208
8131
|
200: DefaultSuccessResponseSchema.extend({
|
8209
8132
|
data: RoomSchema.extend({
|
8210
|
-
solveMessage:
|
8133
|
+
solveMessage: z109.string()
|
8211
8134
|
})
|
8212
8135
|
}),
|
8213
8136
|
409: DefaultErrorResponseSchema
|
@@ -8217,9 +8140,9 @@ var chatContract = initContract39().router(
|
|
8217
8140
|
emitMessage: {
|
8218
8141
|
method: "POST",
|
8219
8142
|
path: "/message/emit",
|
8220
|
-
body:
|
8221
|
-
messageId:
|
8222
|
-
queueId:
|
8143
|
+
body: z109.object({
|
8144
|
+
messageId: z109.string().uuid(),
|
8145
|
+
queueId: z109.string().uuid().optional().nullable()
|
8223
8146
|
}),
|
8224
8147
|
responses: {
|
8225
8148
|
200: DefaultSuccessResponseSchema,
|
@@ -8230,16 +8153,16 @@ var chatContract = initContract39().router(
|
|
8230
8153
|
}
|
8231
8154
|
},
|
8232
8155
|
{
|
8233
|
-
baseHeaders:
|
8234
|
-
"x-tenant":
|
8235
|
-
"x-code":
|
8156
|
+
baseHeaders: z109.object({
|
8157
|
+
"x-tenant": z109.string({ required_error: "Tenant id is required" }),
|
8158
|
+
"x-code": z109.string().uuid().optional()
|
8236
8159
|
}),
|
8237
8160
|
pathPrefix: "chat"
|
8238
8161
|
}
|
8239
8162
|
);
|
8240
8163
|
|
8241
8164
|
// src/botpress/index.ts
|
8242
|
-
import
|
8165
|
+
import z110 from "zod";
|
8243
8166
|
import { initContract as initContract40 } from "@ts-rest/core";
|
8244
8167
|
var botpressContract = initContract40().router(
|
8245
8168
|
{
|
@@ -8258,7 +8181,7 @@ var botpressContract = initContract40().router(
|
|
8258
8181
|
path: "/",
|
8259
8182
|
responses: {
|
8260
8183
|
200: DefaultSuccessResponseSchema.extend({
|
8261
|
-
data:
|
8184
|
+
data: z110.array(BotpressBotSchema)
|
8262
8185
|
}),
|
8263
8186
|
500: DefaultErrorResponseSchema
|
8264
8187
|
}
|
@@ -8295,7 +8218,7 @@ var botContract = initContract40().router(
|
|
8295
8218
|
path: "/",
|
8296
8219
|
responses: {
|
8297
8220
|
200: DefaultSuccessResponseSchema.extend({
|
8298
|
-
data:
|
8221
|
+
data: z110.array(BotpressBotSchema)
|
8299
8222
|
}),
|
8300
8223
|
500: DefaultErrorResponseSchema
|
8301
8224
|
}
|
@@ -8308,14 +8231,15 @@ var botContract = initContract40().router(
|
|
8308
8231
|
|
8309
8232
|
// src/presence-status/index.ts
|
8310
8233
|
import { initContract as initContract41 } from "@ts-rest/core";
|
8311
|
-
import
|
8234
|
+
import z112 from "zod";
|
8312
8235
|
|
8313
8236
|
// src/presence-status/validation.ts
|
8314
|
-
import { z as
|
8315
|
-
var CreatePresenceStatusSchema =
|
8316
|
-
status:
|
8317
|
-
|
8318
|
-
position:
|
8237
|
+
import { z as z111 } from "zod";
|
8238
|
+
var CreatePresenceStatusSchema = z111.object({
|
8239
|
+
status: PresenceStatusEnum,
|
8240
|
+
statusName: z111.string(),
|
8241
|
+
position: z111.number(),
|
8242
|
+
emoji: z111.string()
|
8319
8243
|
});
|
8320
8244
|
var UpdatePresenceStatusSchema = CreatePresenceStatusSchema;
|
8321
8245
|
|
@@ -8327,12 +8251,12 @@ var presenceStatusContract = initContract41().router(
|
|
8327
8251
|
path: "",
|
8328
8252
|
headers: DefaultHeaderSchema,
|
8329
8253
|
responses: {
|
8330
|
-
200:
|
8331
|
-
total:
|
8332
|
-
data:
|
8254
|
+
200: z112.object({
|
8255
|
+
total: z112.number(),
|
8256
|
+
data: z112.array(PresenceStatusSchema)
|
8333
8257
|
}),
|
8334
|
-
400:
|
8335
|
-
message:
|
8258
|
+
400: z112.object({
|
8259
|
+
message: z112.string()
|
8336
8260
|
}),
|
8337
8261
|
401: DefaultUnauthorizedSchema,
|
8338
8262
|
500: DefaultErrorResponseSchema
|
@@ -8348,8 +8272,8 @@ var presenceStatusContract = initContract41().router(
|
|
8348
8272
|
201: DefaultSuccessResponseSchema.extend({
|
8349
8273
|
presenceStatus: PresenceStatusSchema
|
8350
8274
|
}),
|
8351
|
-
400:
|
8352
|
-
message:
|
8275
|
+
400: z112.object({
|
8276
|
+
message: z112.string()
|
8353
8277
|
}),
|
8354
8278
|
401: DefaultUnauthorizedSchema,
|
8355
8279
|
404: DefaultNotFoundSchema,
|
@@ -8361,12 +8285,12 @@ var presenceStatusContract = initContract41().router(
|
|
8361
8285
|
getPresenceStatusById: {
|
8362
8286
|
method: "GET",
|
8363
8287
|
path: "/:id",
|
8364
|
-
pathParams:
|
8288
|
+
pathParams: z112.object({ id: z112.string() }),
|
8365
8289
|
headers: DefaultHeaderSchema,
|
8366
8290
|
responses: {
|
8367
8291
|
200: PresenceStatusSchema,
|
8368
|
-
400:
|
8369
|
-
message:
|
8292
|
+
400: z112.object({
|
8293
|
+
message: z112.string()
|
8370
8294
|
}),
|
8371
8295
|
401: DefaultUnauthorizedSchema,
|
8372
8296
|
404: DefaultNotFoundSchema,
|
@@ -8378,15 +8302,15 @@ var presenceStatusContract = initContract41().router(
|
|
8378
8302
|
updatePresenceStatus: {
|
8379
8303
|
method: "PATCH",
|
8380
8304
|
path: "/:id",
|
8381
|
-
pathParams:
|
8305
|
+
pathParams: z112.object({ id: z112.string() }),
|
8382
8306
|
headers: DefaultHeaderSchema,
|
8383
8307
|
body: UpdatePresenceStatusSchema,
|
8384
8308
|
responses: {
|
8385
8309
|
201: DefaultSuccessResponseSchema.extend({
|
8386
8310
|
presenceStatus: PresenceStatusSchema
|
8387
8311
|
}),
|
8388
|
-
400:
|
8389
|
-
message:
|
8312
|
+
400: z112.object({
|
8313
|
+
message: z112.string()
|
8390
8314
|
}),
|
8391
8315
|
401: DefaultUnauthorizedSchema,
|
8392
8316
|
404: DefaultNotFoundSchema,
|
@@ -8398,11 +8322,11 @@ var presenceStatusContract = initContract41().router(
|
|
8398
8322
|
deletePresenceStatus: {
|
8399
8323
|
method: "DELETE",
|
8400
8324
|
path: "/:id",
|
8401
|
-
pathParams:
|
8325
|
+
pathParams: z112.object({ id: z112.string() }),
|
8402
8326
|
headers: DefaultHeaderSchema,
|
8403
8327
|
body: null,
|
8404
8328
|
responses: {
|
8405
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
8329
|
+
200: DefaultSuccessResponseSchema.extend({ message: z112.string() }),
|
8406
8330
|
404: DefaultNotFoundSchema,
|
8407
8331
|
422: DefaultUnprocessibleSchema,
|
8408
8332
|
500: DefaultErrorResponseSchema
|
@@ -8415,7 +8339,7 @@ var presenceStatusContract = initContract41().router(
|
|
8415
8339
|
|
8416
8340
|
// src/whatsapp/index.ts
|
8417
8341
|
import { initContract as initContract42 } from "@ts-rest/core";
|
8418
|
-
import
|
8342
|
+
import z113 from "zod";
|
8419
8343
|
var whatsappContract = initContract42().router({
|
8420
8344
|
sendMessage: {
|
8421
8345
|
method: "POST",
|
@@ -8450,8 +8374,8 @@ var whatsappContract = initContract42().router({
|
|
8450
8374
|
reconnect: {
|
8451
8375
|
method: "POST",
|
8452
8376
|
path: "/reconnect/:channelId",
|
8453
|
-
pathParams:
|
8454
|
-
channelId:
|
8377
|
+
pathParams: z113.object({
|
8378
|
+
channelId: z113.string().uuid()
|
8455
8379
|
}),
|
8456
8380
|
body: null,
|
8457
8381
|
responses: {
|
@@ -8463,8 +8387,8 @@ var whatsappContract = initContract42().router({
|
|
8463
8387
|
delete: {
|
8464
8388
|
method: "DELETE",
|
8465
8389
|
path: "/delete/:channelId",
|
8466
|
-
pathParams:
|
8467
|
-
channelId:
|
8390
|
+
pathParams: z113.object({
|
8391
|
+
channelId: z113.string().uuid()
|
8468
8392
|
}),
|
8469
8393
|
body: null,
|
8470
8394
|
responses: {
|
@@ -8485,7 +8409,7 @@ var whatsappContract = initContract42().router({
|
|
8485
8409
|
},
|
8486
8410
|
createWaapi: {
|
8487
8411
|
method: "POST",
|
8488
|
-
path: "/
|
8412
|
+
path: "/waapi",
|
8489
8413
|
body: null,
|
8490
8414
|
responses: {
|
8491
8415
|
200: WaapiResponseSchema,
|
@@ -8495,7 +8419,7 @@ var whatsappContract = initContract42().router({
|
|
8495
8419
|
},
|
8496
8420
|
getWaapiQr: {
|
8497
8421
|
method: "GET",
|
8498
|
-
path: "/
|
8422
|
+
path: "/waapi/qr",
|
8499
8423
|
query: GetWaapiQrQuerySchema,
|
8500
8424
|
responses: {
|
8501
8425
|
200: WaapiQrResponseSchema,
|
@@ -8503,22 +8427,9 @@ var whatsappContract = initContract42().router({
|
|
8503
8427
|
400: DefaultErrorResponseSchema
|
8504
8428
|
}
|
8505
8429
|
},
|
8506
|
-
deleteWaapi: {
|
8507
|
-
method: "DELETE",
|
8508
|
-
path: "/mobile/:instanceId",
|
8509
|
-
pathParams: z114.object({
|
8510
|
-
instanceId: z114.string()
|
8511
|
-
}),
|
8512
|
-
body: z114.any().optional(),
|
8513
|
-
responses: {
|
8514
|
-
200: DefaultSuccessResponseSchema,
|
8515
|
-
500: DefaultErrorResponseSchema,
|
8516
|
-
400: DefaultErrorResponseSchema
|
8517
|
-
}
|
8518
|
-
},
|
8519
8430
|
sendSeenToWaapi: {
|
8520
8431
|
method: "POST",
|
8521
|
-
path: "/
|
8432
|
+
path: "/waapi/send-seen",
|
8522
8433
|
body: SendSeenToWaapiSchema,
|
8523
8434
|
responses: {
|
8524
8435
|
200: WaapiResponseSchema,
|
@@ -8717,7 +8628,7 @@ var presenceStatusContract2 = initContract43().router({
|
|
8717
8628
|
|
8718
8629
|
// src/general-setting/index.ts
|
8719
8630
|
import { initContract as initContract44 } from "@ts-rest/core";
|
8720
|
-
import
|
8631
|
+
import z114 from "zod";
|
8721
8632
|
var generalSettingContract = initContract44().router(
|
8722
8633
|
{
|
8723
8634
|
autoOpenedContactWidgetId: {
|
@@ -8725,20 +8636,20 @@ var generalSettingContract = initContract44().router(
|
|
8725
8636
|
method: "GET",
|
8726
8637
|
path: "/auto-opened-contact-widget-id",
|
8727
8638
|
responses: {
|
8728
|
-
200:
|
8729
|
-
autoOpenedContactWidgetId:
|
8639
|
+
200: z114.object({
|
8640
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
8730
8641
|
})
|
8731
8642
|
}
|
8732
8643
|
},
|
8733
8644
|
updateAutoOpenedContactWidgetId: {
|
8734
8645
|
method: "PATCH",
|
8735
8646
|
path: "/auto-opened-contact-widget-id",
|
8736
|
-
body:
|
8737
|
-
autoOpenedContactWidgetId:
|
8647
|
+
body: z114.object({
|
8648
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
8738
8649
|
}),
|
8739
8650
|
responses: {
|
8740
|
-
200:
|
8741
|
-
autoOpenedContactWidgetId:
|
8651
|
+
200: z114.object({
|
8652
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
8742
8653
|
})
|
8743
8654
|
}
|
8744
8655
|
}
|
@@ -8751,49 +8662,49 @@ var generalSettingContract = initContract44().router(
|
|
8751
8662
|
|
8752
8663
|
// src/automation-queue/index.ts
|
8753
8664
|
import { initContract as initContract45 } from "@ts-rest/core";
|
8754
|
-
import { z as
|
8665
|
+
import { z as z117 } from "zod";
|
8755
8666
|
|
8756
8667
|
// src/automation-queue/validation.ts
|
8757
|
-
import { z as
|
8758
|
-
var QueueDistributionStrategySchema =
|
8759
|
-
|
8760
|
-
|
8761
|
-
|
8762
|
-
|
8668
|
+
import { z as z115 } from "zod";
|
8669
|
+
var QueueDistributionStrategySchema = z115.union([
|
8670
|
+
z115.literal("round-robin"),
|
8671
|
+
z115.literal("fewest-assignments"),
|
8672
|
+
z115.literal("random"),
|
8673
|
+
z115.literal("notify-all")
|
8763
8674
|
]);
|
8764
|
-
var CreateAutomationQueueSchema =
|
8765
|
-
emoji:
|
8766
|
-
name:
|
8767
|
-
description:
|
8768
|
-
managerIds:
|
8769
|
-
agentIds:
|
8675
|
+
var CreateAutomationQueueSchema = z115.object({
|
8676
|
+
emoji: z115.string().emoji(),
|
8677
|
+
name: z115.string(),
|
8678
|
+
description: z115.string().nullable(),
|
8679
|
+
managerIds: z115.array(z115.string().uuid()).min(1),
|
8680
|
+
agentIds: z115.array(z115.string().uuid()).min(1),
|
8770
8681
|
distributionStrategy: QueueDistributionStrategySchema,
|
8771
|
-
maximumAssignPerAgent:
|
8682
|
+
maximumAssignPerAgent: z115.number().positive()
|
8772
8683
|
// ringTimeOut: z.number().positive(),
|
8773
8684
|
// retryInterval: z.number().positive(),
|
8774
8685
|
// queueTimeOut: z.number().positive(),
|
8775
8686
|
// isAssignmentDeniable: z.coerce.boolean(),
|
8776
8687
|
});
|
8777
8688
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
8778
|
-
var CheckHasAssignedRoomSchema =
|
8779
|
-
userId:
|
8780
|
-
queueId:
|
8689
|
+
var CheckHasAssignedRoomSchema = z115.object({
|
8690
|
+
userId: z115.string().uuid().optional(),
|
8691
|
+
queueId: z115.string().uuid().optional()
|
8781
8692
|
});
|
8782
8693
|
|
8783
8694
|
// src/automation-queue/schema.ts
|
8784
|
-
import { z as
|
8695
|
+
import { z as z116 } from "zod";
|
8785
8696
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
8786
|
-
emoji:
|
8787
|
-
name:
|
8788
|
-
description:
|
8697
|
+
emoji: z116.string(),
|
8698
|
+
name: z116.string(),
|
8699
|
+
description: z116.string().nullable(),
|
8789
8700
|
distributionStrategy: QueueDistributionStrategySchema,
|
8790
|
-
maximumAssignPerAgent:
|
8701
|
+
maximumAssignPerAgent: z116.number().positive(),
|
8791
8702
|
// ringTimeOut: z.number(),
|
8792
8703
|
// retryInterval: z.number(),
|
8793
8704
|
// queueTimeOut: z.number(),
|
8794
8705
|
// isAssignmentDeniable: z.boolean(),
|
8795
|
-
managers:
|
8796
|
-
agents:
|
8706
|
+
managers: z116.array(UserSchema),
|
8707
|
+
agents: z116.array(UserSchema)
|
8797
8708
|
});
|
8798
8709
|
|
8799
8710
|
// src/automation-queue/index.ts
|
@@ -8812,8 +8723,8 @@ var automationQueueContract = initContract45().router(
|
|
8812
8723
|
duplicateAutomationQueue: {
|
8813
8724
|
method: "POST",
|
8814
8725
|
path: "/:id/duplicate",
|
8815
|
-
pathParams:
|
8816
|
-
id:
|
8726
|
+
pathParams: z117.object({
|
8727
|
+
id: z117.string().uuid()
|
8817
8728
|
}),
|
8818
8729
|
body: null,
|
8819
8730
|
responses: {
|
@@ -8825,20 +8736,20 @@ var automationQueueContract = initContract45().router(
|
|
8825
8736
|
getAutomationQueues: {
|
8826
8737
|
method: "GET",
|
8827
8738
|
path: "",
|
8828
|
-
query:
|
8829
|
-
userId:
|
8739
|
+
query: z117.object({
|
8740
|
+
userId: z117.string().uuid().optional()
|
8830
8741
|
}).optional(),
|
8831
8742
|
responses: {
|
8832
8743
|
200: DefaultSuccessResponseSchema.extend({
|
8833
|
-
data:
|
8744
|
+
data: z117.array(AutomationQueueSchema)
|
8834
8745
|
})
|
8835
8746
|
}
|
8836
8747
|
},
|
8837
8748
|
getAutomationQueueById: {
|
8838
8749
|
method: "GET",
|
8839
8750
|
path: "/:id",
|
8840
|
-
pathParams:
|
8841
|
-
id:
|
8751
|
+
pathParams: z117.object({
|
8752
|
+
id: z117.string().uuid()
|
8842
8753
|
}),
|
8843
8754
|
responses: {
|
8844
8755
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8849,8 +8760,8 @@ var automationQueueContract = initContract45().router(
|
|
8849
8760
|
updateAutomationQueue: {
|
8850
8761
|
method: "PATCH",
|
8851
8762
|
path: "/:id",
|
8852
|
-
pathParams:
|
8853
|
-
id:
|
8763
|
+
pathParams: z117.object({
|
8764
|
+
id: z117.string().uuid()
|
8854
8765
|
}),
|
8855
8766
|
body: UpdateAutomationQueueSchema,
|
8856
8767
|
responses: {
|
@@ -8862,13 +8773,13 @@ var automationQueueContract = initContract45().router(
|
|
8862
8773
|
deleteAutomationQueue: {
|
8863
8774
|
method: "DELETE",
|
8864
8775
|
path: "/:id",
|
8865
|
-
pathParams:
|
8866
|
-
id:
|
8776
|
+
pathParams: z117.object({
|
8777
|
+
id: z117.string().uuid()
|
8867
8778
|
}),
|
8868
8779
|
body: null,
|
8869
8780
|
responses: {
|
8870
8781
|
200: DefaultSuccessResponseSchema.extend({
|
8871
|
-
message:
|
8782
|
+
message: z117.string()
|
8872
8783
|
})
|
8873
8784
|
}
|
8874
8785
|
},
|
@@ -8878,8 +8789,8 @@ var automationQueueContract = initContract45().router(
|
|
8878
8789
|
body: CheckHasAssignedRoomSchema,
|
8879
8790
|
responses: {
|
8880
8791
|
200: DefaultSuccessResponseSchema.extend({
|
8881
|
-
data:
|
8882
|
-
hasAssignedRoom:
|
8792
|
+
data: z117.object({
|
8793
|
+
hasAssignedRoom: z117.boolean()
|
8883
8794
|
})
|
8884
8795
|
})
|
8885
8796
|
}
|
@@ -8896,282 +8807,282 @@ import { initContract as initContract50 } from "@ts-rest/core";
|
|
8896
8807
|
|
8897
8808
|
// src/mail/room-contract.ts
|
8898
8809
|
import { initContract as initContract46 } from "@ts-rest/core";
|
8899
|
-
import
|
8810
|
+
import z122 from "zod";
|
8900
8811
|
|
8901
8812
|
// src/mail/schemas/room.schema.ts
|
8902
|
-
import
|
8813
|
+
import z120 from "zod";
|
8903
8814
|
|
8904
8815
|
// src/mail/schemas/account.schema.ts
|
8816
|
+
import z118 from "zod";
|
8817
|
+
var MailServerSchema = z118.object({
|
8818
|
+
id: z118.string(),
|
8819
|
+
createdAt: z118.date(),
|
8820
|
+
updatedAt: z118.date(),
|
8821
|
+
deletedAt: z118.date().nullable(),
|
8822
|
+
name: z118.string(),
|
8823
|
+
smtpHost: z118.string(),
|
8824
|
+
smtpPort: z118.number(),
|
8825
|
+
smtpTlsPort: z118.number(),
|
8826
|
+
useTlsForSmtp: z118.boolean(),
|
8827
|
+
imapHost: z118.string(),
|
8828
|
+
imapPort: z118.number(),
|
8829
|
+
imapTlsPort: z118.number(),
|
8830
|
+
useTlsForImap: z118.boolean()
|
8831
|
+
});
|
8832
|
+
var MailAccountSchema = z118.object({
|
8833
|
+
id: z118.string(),
|
8834
|
+
createdAt: z118.date(),
|
8835
|
+
updatedAt: z118.date(),
|
8836
|
+
deletedAt: z118.date().nullable(),
|
8837
|
+
name: z118.string(),
|
8838
|
+
address: z118.string(),
|
8839
|
+
accountId: z118.string(),
|
8840
|
+
mailServerId: z118.string(),
|
8841
|
+
mailServer: MailServerSchema,
|
8842
|
+
state: z118.union([
|
8843
|
+
z118.literal("init"),
|
8844
|
+
z118.literal("syncing"),
|
8845
|
+
z118.literal("connecting"),
|
8846
|
+
z118.literal("connected"),
|
8847
|
+
z118.literal("disconnected"),
|
8848
|
+
z118.literal("authenticationError"),
|
8849
|
+
z118.literal("connectError"),
|
8850
|
+
z118.literal("unset")
|
8851
|
+
])
|
8852
|
+
});
|
8853
|
+
var OAuth2AppSchema = z118.object({
|
8854
|
+
id: z118.string(),
|
8855
|
+
name: z118.string(),
|
8856
|
+
description: z118.string(),
|
8857
|
+
title: z118.string(),
|
8858
|
+
provider: z118.string(),
|
8859
|
+
enabled: z118.boolean(),
|
8860
|
+
legacy: z118.boolean(),
|
8861
|
+
created: z118.string(),
|
8862
|
+
updated: z118.string(),
|
8863
|
+
includeInListing: z118.boolean(),
|
8864
|
+
clientId: z118.string(),
|
8865
|
+
clientSecret: z118.string(),
|
8866
|
+
authority: z118.string(),
|
8867
|
+
redirectUrl: z118.string(),
|
8868
|
+
serviceClient: z118.string(),
|
8869
|
+
googleProjectId: z118.string(),
|
8870
|
+
serviceClientEmail: z118.string(),
|
8871
|
+
serviceKey: z118.string()
|
8872
|
+
});
|
8873
|
+
|
8874
|
+
// src/mail/schemas/message.schema.ts
|
8905
8875
|
import z119 from "zod";
|
8906
|
-
var
|
8876
|
+
var AttachmentSchema = z119.object({
|
8907
8877
|
id: z119.string(),
|
8908
8878
|
createdAt: z119.date(),
|
8909
8879
|
updatedAt: z119.date(),
|
8910
|
-
deletedAt: z119.
|
8911
|
-
|
8912
|
-
|
8913
|
-
|
8914
|
-
|
8915
|
-
|
8916
|
-
|
8917
|
-
|
8918
|
-
|
8919
|
-
|
8920
|
-
|
8921
|
-
|
8880
|
+
deletedAt: z119.nullable(z119.date()),
|
8881
|
+
roomId: z119.string(),
|
8882
|
+
messageId: z119.string(),
|
8883
|
+
fileName: z119.string(),
|
8884
|
+
fileType: z119.string(),
|
8885
|
+
emailEngineAttachmentId: z119.string(),
|
8886
|
+
uploadId: z119.string(),
|
8887
|
+
upload: z119.object({
|
8888
|
+
id: z119.string(),
|
8889
|
+
createdAt: z119.date(),
|
8890
|
+
updatedAt: z119.date(),
|
8891
|
+
deletedAt: z119.nullable(z119.date()),
|
8892
|
+
bucketName: z119.string(),
|
8893
|
+
fileName: z119.string(),
|
8894
|
+
fileKey: z119.string(),
|
8895
|
+
fileSize: z119.number(),
|
8896
|
+
fileUrl: z119.string(),
|
8897
|
+
extensionName: z119.string()
|
8898
|
+
})
|
8899
|
+
});
|
8900
|
+
var MessageSchema2 = z119.object({
|
8922
8901
|
id: z119.string(),
|
8923
8902
|
createdAt: z119.date(),
|
8924
8903
|
updatedAt: z119.date(),
|
8925
|
-
deletedAt: z119.
|
8926
|
-
|
8927
|
-
|
8928
|
-
|
8929
|
-
|
8930
|
-
|
8931
|
-
|
8932
|
-
|
8933
|
-
|
8934
|
-
|
8935
|
-
|
8936
|
-
|
8937
|
-
|
8938
|
-
|
8939
|
-
|
8940
|
-
|
8941
|
-
|
8942
|
-
|
8943
|
-
|
8944
|
-
|
8945
|
-
|
8946
|
-
title: z119.string(),
|
8947
|
-
provider: z119.string(),
|
8948
|
-
enabled: z119.boolean(),
|
8949
|
-
legacy: z119.boolean(),
|
8950
|
-
created: z119.string(),
|
8951
|
-
updated: z119.string(),
|
8952
|
-
includeInListing: z119.boolean(),
|
8953
|
-
clientId: z119.string(),
|
8954
|
-
clientSecret: z119.string(),
|
8955
|
-
authority: z119.string(),
|
8956
|
-
redirectUrl: z119.string(),
|
8957
|
-
serviceClient: z119.string(),
|
8958
|
-
googleProjectId: z119.string(),
|
8959
|
-
serviceClientEmail: z119.string(),
|
8960
|
-
serviceKey: z119.string()
|
8904
|
+
deletedAt: z119.nullable(z119.date()),
|
8905
|
+
roomId: z119.string(),
|
8906
|
+
subject: z119.string(),
|
8907
|
+
textPlain: z119.string(),
|
8908
|
+
textHtml: z119.string(),
|
8909
|
+
textId: z119.string(),
|
8910
|
+
emailEngineEmailId: z119.string(),
|
8911
|
+
emailEngineMessageId: z119.string(),
|
8912
|
+
emailEngineReplyTo: z119.nullable(z119.string()),
|
8913
|
+
direction: z119.string(),
|
8914
|
+
date: z119.date(),
|
8915
|
+
action: z119.string(),
|
8916
|
+
unseen: z119.boolean(),
|
8917
|
+
sendAt: z119.date(),
|
8918
|
+
starred: z119.boolean(),
|
8919
|
+
seemsLikeNew: z119.boolean(),
|
8920
|
+
from: z119.array(MailParticipant),
|
8921
|
+
to: z119.array(MailParticipant),
|
8922
|
+
cc: z119.array(MailParticipant),
|
8923
|
+
bcc: z119.array(MailParticipant),
|
8924
|
+
attachments: z119.array(AttachmentSchema)
|
8961
8925
|
});
|
8962
8926
|
|
8963
|
-
// src/mail/schemas/
|
8964
|
-
|
8965
|
-
|
8927
|
+
// src/mail/schemas/room.schema.ts
|
8928
|
+
var ContactSchema3 = z120.object({
|
8929
|
+
id: z120.string().uuid(),
|
8930
|
+
createdAt: z120.date(),
|
8931
|
+
updatedAt: z120.date(),
|
8932
|
+
deletedAt: z120.date().nullable(),
|
8933
|
+
name: z120.string(),
|
8934
|
+
address: z120.string().nullable(),
|
8935
|
+
channel: z120.string().nullable(),
|
8936
|
+
notes: z120.string().nullable(),
|
8937
|
+
contactProfile: z120.string().nullable(),
|
8938
|
+
socialProfileUrl: z120.string().nullable()
|
8939
|
+
});
|
8940
|
+
var MailUserSchema = z120.object({
|
8941
|
+
id: z120.string(),
|
8942
|
+
createdAt: z120.date(),
|
8943
|
+
updatedAt: z120.date(),
|
8944
|
+
deletedAt: z120.date().nullable(),
|
8945
|
+
name: z120.string(),
|
8946
|
+
address: z120.string(),
|
8947
|
+
contactId: z120.string(),
|
8948
|
+
contact: ContactSchema3,
|
8949
|
+
isNewContact: z120.boolean()
|
8950
|
+
});
|
8951
|
+
var MailParticipant = z120.object({
|
8966
8952
|
id: z120.string(),
|
8967
8953
|
createdAt: z120.date(),
|
8968
8954
|
updatedAt: z120.date(),
|
8969
|
-
deletedAt: z120.
|
8955
|
+
deletedAt: z120.date().nullable(),
|
8970
8956
|
roomId: z120.string(),
|
8971
8957
|
messageId: z120.string(),
|
8972
|
-
|
8973
|
-
|
8974
|
-
emailEngineAttachmentId: z120.string(),
|
8975
|
-
uploadId: z120.string(),
|
8976
|
-
upload: z120.object({
|
8977
|
-
id: z120.string(),
|
8978
|
-
createdAt: z120.date(),
|
8979
|
-
updatedAt: z120.date(),
|
8980
|
-
deletedAt: z120.nullable(z120.date()),
|
8981
|
-
bucketName: z120.string(),
|
8982
|
-
fileName: z120.string(),
|
8983
|
-
fileKey: z120.string(),
|
8984
|
-
fileSize: z120.number(),
|
8985
|
-
fileUrl: z120.string(),
|
8986
|
-
extensionName: z120.string()
|
8987
|
-
})
|
8958
|
+
mailUserId: z120.string(),
|
8959
|
+
mailUser: MailUserSchema
|
8988
8960
|
});
|
8989
|
-
var
|
8961
|
+
var TagSchema2 = z120.object({
|
8962
|
+
color: z120.string(),
|
8963
|
+
id: z120.string(),
|
8964
|
+
createdAt: z120.date(),
|
8965
|
+
updatedAt: z120.date(),
|
8966
|
+
deletedAt: z120.date().nullable(),
|
8967
|
+
name: z120.string()
|
8968
|
+
});
|
8969
|
+
var UserModel = z120.object({
|
8970
|
+
id: z120.string().uuid(),
|
8971
|
+
createdAt: z120.date(),
|
8972
|
+
updatedAt: z120.date(),
|
8973
|
+
deletedAt: z120.date().nullable(),
|
8974
|
+
name: z120.string(),
|
8975
|
+
email: z120.string(),
|
8976
|
+
address: z120.string().nullable(),
|
8977
|
+
phone: z120.string().nullable(),
|
8978
|
+
notificationCount: z120.number().nullable()
|
8979
|
+
});
|
8980
|
+
var ActivityLogModel = z120.object({
|
8990
8981
|
id: z120.string(),
|
8991
8982
|
createdAt: z120.date(),
|
8992
8983
|
updatedAt: z120.date(),
|
8993
|
-
deletedAt: z120.nullable(z120.
|
8984
|
+
deletedAt: z120.nullable(z120.string()),
|
8985
|
+
description: z120.string(),
|
8986
|
+
actorId: z120.string(),
|
8994
8987
|
roomId: z120.string(),
|
8988
|
+
actor: UserModel
|
8989
|
+
});
|
8990
|
+
var MessagesAndLogsSchema = z120.array(
|
8991
|
+
z120.union([MessageSchema2, ActivityLogModel])
|
8992
|
+
);
|
8993
|
+
var MailRoomSchema = z120.object({
|
8994
|
+
id: z120.string(),
|
8995
|
+
createdAt: z120.date(),
|
8996
|
+
updatedAt: z120.date(),
|
8997
|
+
deletedAt: z120.date().nullable(),
|
8995
8998
|
subject: z120.string(),
|
8996
|
-
|
8997
|
-
|
8998
|
-
|
8999
|
-
|
9000
|
-
emailEngineMessageId: z120.string(),
|
9001
|
-
emailEngineReplyTo: z120.nullable(z120.string()),
|
8999
|
+
resolved: z120.boolean(),
|
9000
|
+
assigneeId: z120.string().nullable(),
|
9001
|
+
note: z120.string(),
|
9002
|
+
mailId: z120.string(),
|
9002
9003
|
direction: z120.string(),
|
9003
|
-
|
9004
|
-
|
9005
|
-
unseen: z120.boolean(),
|
9006
|
-
sendAt: z120.date(),
|
9007
|
-
starred: z120.boolean(),
|
9008
|
-
seemsLikeNew: z120.boolean(),
|
9004
|
+
lastMessageId: z120.string(),
|
9005
|
+
firstMessageId: z120.string(),
|
9009
9006
|
from: z120.array(MailParticipant),
|
9010
9007
|
to: z120.array(MailParticipant),
|
9011
9008
|
cc: z120.array(MailParticipant),
|
9012
9009
|
bcc: z120.array(MailParticipant),
|
9013
|
-
attachments: z120.array(AttachmentSchema)
|
9014
|
-
});
|
9015
|
-
|
9016
|
-
// src/mail/schemas/room.schema.ts
|
9017
|
-
var ContactSchema3 = z121.object({
|
9018
|
-
id: z121.string().uuid(),
|
9019
|
-
createdAt: z121.date(),
|
9020
|
-
updatedAt: z121.date(),
|
9021
|
-
deletedAt: z121.date().nullable(),
|
9022
|
-
name: z121.string(),
|
9023
|
-
address: z121.string().nullable(),
|
9024
|
-
channel: z121.string().nullable(),
|
9025
|
-
notes: z121.string().nullable(),
|
9026
|
-
contactProfile: z121.string().nullable(),
|
9027
|
-
socialProfileUrl: z121.string().nullable()
|
9028
|
-
});
|
9029
|
-
var MailUserSchema = z121.object({
|
9030
|
-
id: z121.string(),
|
9031
|
-
createdAt: z121.date(),
|
9032
|
-
updatedAt: z121.date(),
|
9033
|
-
deletedAt: z121.date().nullable(),
|
9034
|
-
name: z121.string(),
|
9035
|
-
address: z121.string(),
|
9036
|
-
contactId: z121.string(),
|
9037
|
-
contact: ContactSchema3,
|
9038
|
-
isNewContact: z121.boolean()
|
9039
|
-
});
|
9040
|
-
var MailParticipant = z121.object({
|
9041
|
-
id: z121.string(),
|
9042
|
-
createdAt: z121.date(),
|
9043
|
-
updatedAt: z121.date(),
|
9044
|
-
deletedAt: z121.date().nullable(),
|
9045
|
-
roomId: z121.string(),
|
9046
|
-
messageId: z121.string(),
|
9047
|
-
mailUserId: z121.string(),
|
9048
|
-
mailUser: MailUserSchema
|
9049
|
-
});
|
9050
|
-
var TagSchema2 = z121.object({
|
9051
|
-
color: z121.string(),
|
9052
|
-
id: z121.string(),
|
9053
|
-
createdAt: z121.date(),
|
9054
|
-
updatedAt: z121.date(),
|
9055
|
-
deletedAt: z121.date().nullable(),
|
9056
|
-
name: z121.string()
|
9057
|
-
});
|
9058
|
-
var UserModel = z121.object({
|
9059
|
-
id: z121.string().uuid(),
|
9060
|
-
createdAt: z121.date(),
|
9061
|
-
updatedAt: z121.date(),
|
9062
|
-
deletedAt: z121.date().nullable(),
|
9063
|
-
name: z121.string(),
|
9064
|
-
email: z121.string(),
|
9065
|
-
address: z121.string().nullable(),
|
9066
|
-
phone: z121.string().nullable(),
|
9067
|
-
notificationCount: z121.number().nullable()
|
9068
|
-
});
|
9069
|
-
var ActivityLogModel = z121.object({
|
9070
|
-
id: z121.string(),
|
9071
|
-
createdAt: z121.date(),
|
9072
|
-
updatedAt: z121.date(),
|
9073
|
-
deletedAt: z121.nullable(z121.string()),
|
9074
|
-
description: z121.string(),
|
9075
|
-
actorId: z121.string(),
|
9076
|
-
roomId: z121.string(),
|
9077
|
-
actor: UserModel
|
9078
|
-
});
|
9079
|
-
var MessagesAndLogsSchema = z121.array(
|
9080
|
-
z121.union([MessageSchema2, ActivityLogModel])
|
9081
|
-
);
|
9082
|
-
var MailRoomSchema = z121.object({
|
9083
|
-
id: z121.string(),
|
9084
|
-
createdAt: z121.date(),
|
9085
|
-
updatedAt: z121.date(),
|
9086
|
-
deletedAt: z121.date().nullable(),
|
9087
|
-
subject: z121.string(),
|
9088
|
-
resolved: z121.boolean(),
|
9089
|
-
assigneeId: z121.string().nullable(),
|
9090
|
-
note: z121.string(),
|
9091
|
-
mailId: z121.string(),
|
9092
|
-
direction: z121.string(),
|
9093
|
-
lastMessageId: z121.string(),
|
9094
|
-
firstMessageId: z121.string(),
|
9095
|
-
from: z121.array(MailParticipant),
|
9096
|
-
to: z121.array(MailParticipant),
|
9097
|
-
cc: z121.array(MailParticipant),
|
9098
|
-
bcc: z121.array(MailParticipant),
|
9099
9010
|
firstMessage: MessageSchema2,
|
9100
9011
|
lastMessage: MessageSchema2,
|
9101
|
-
tags:
|
9012
|
+
tags: z120.array(TagSchema2),
|
9102
9013
|
assignee: UserModel,
|
9103
|
-
messages:
|
9014
|
+
messages: z120.array(MessageSchema2),
|
9104
9015
|
messagesAndLogs: MessagesAndLogsSchema,
|
9105
9016
|
mail: MailAccountSchema,
|
9106
|
-
unReadMessageCount:
|
9017
|
+
unReadMessageCount: z120.number(),
|
9107
9018
|
cxlog: CxLogSchema
|
9108
9019
|
});
|
9109
|
-
var AttachmentSchema2 =
|
9110
|
-
fileName:
|
9111
|
-
fileType:
|
9112
|
-
emailEngineAttachmentId:
|
9113
|
-
uploadId:
|
9114
|
-
messageId:
|
9115
|
-
roomId:
|
9020
|
+
var AttachmentSchema2 = z120.object({
|
9021
|
+
fileName: z120.string(),
|
9022
|
+
fileType: z120.string(),
|
9023
|
+
emailEngineAttachmentId: z120.string(),
|
9024
|
+
uploadId: z120.string(),
|
9025
|
+
messageId: z120.string(),
|
9026
|
+
roomId: z120.string(),
|
9116
9027
|
upload: UploadSchema
|
9117
9028
|
});
|
9118
9029
|
|
9119
9030
|
// src/mail/schemas/room-validation.schema.ts
|
9120
|
-
import
|
9031
|
+
import z121 from "zod";
|
9121
9032
|
var RoomContractsValidationSchema = {
|
9122
9033
|
getAll: {
|
9123
|
-
input:
|
9124
|
-
page:
|
9125
|
-
pageSize:
|
9126
|
-
keyword:
|
9127
|
-
value:
|
9128
|
-
category:
|
9034
|
+
input: z121.object({
|
9035
|
+
page: z121.coerce.number().default(1),
|
9036
|
+
pageSize: z121.coerce.number().default(10),
|
9037
|
+
keyword: z121.object({
|
9038
|
+
value: z121.string(),
|
9039
|
+
category: z121.union([z121.literal("contact"), z121.literal("message")])
|
9129
9040
|
}).optional(),
|
9130
|
-
contactLabels:
|
9131
|
-
channels:
|
9132
|
-
date:
|
9133
|
-
contacts:
|
9134
|
-
assignees:
|
9135
|
-
level1:
|
9136
|
-
|
9137
|
-
|
9138
|
-
|
9139
|
-
|
9140
|
-
|
9141
|
-
|
9041
|
+
contactLabels: z121.array(z121.string()).optional(),
|
9042
|
+
channels: z121.array(z121.string().email()).optional(),
|
9043
|
+
date: z121.string().optional(),
|
9044
|
+
contacts: z121.array(z121.string()).optional(),
|
9045
|
+
assignees: z121.array(z121.string()).optional(),
|
9046
|
+
level1: z121.union([
|
9047
|
+
z121.literal("open"),
|
9048
|
+
z121.literal("close"),
|
9049
|
+
z121.literal("inbox"),
|
9050
|
+
z121.literal("sent"),
|
9051
|
+
z121.literal("scheduled"),
|
9052
|
+
z121.literal("starred")
|
9142
9053
|
]).optional(),
|
9143
|
-
level2:
|
9144
|
-
|
9145
|
-
|
9146
|
-
|
9147
|
-
|
9054
|
+
level2: z121.union([
|
9055
|
+
z121.literal("all"),
|
9056
|
+
z121.literal("unassign"),
|
9057
|
+
z121.literal("mine"),
|
9058
|
+
z121.literal("other")
|
9148
9059
|
]).optional()
|
9149
9060
|
}),
|
9150
|
-
output:
|
9151
|
-
data:
|
9152
|
-
total:
|
9153
|
-
page:
|
9154
|
-
pageSize:
|
9061
|
+
output: z121.object({
|
9062
|
+
data: z121.array(MailRoomSchema),
|
9063
|
+
total: z121.number(),
|
9064
|
+
page: z121.number(),
|
9065
|
+
pageSize: z121.number()
|
9155
9066
|
})
|
9156
9067
|
},
|
9157
9068
|
update: {
|
9158
|
-
input:
|
9159
|
-
disposition:
|
9160
|
-
|
9161
|
-
|
9162
|
-
|
9163
|
-
|
9164
|
-
|
9165
|
-
|
9069
|
+
input: z121.object({
|
9070
|
+
disposition: z121.union([
|
9071
|
+
z121.literal("resolved"),
|
9072
|
+
z121.literal("follow up"),
|
9073
|
+
z121.literal("escalated"),
|
9074
|
+
z121.literal("dropped"),
|
9075
|
+
z121.literal("prank"),
|
9076
|
+
z121.literal("blank")
|
9166
9077
|
]).optional().nullable(),
|
9167
|
-
assigneeId:
|
9168
|
-
note:
|
9169
|
-
tags:
|
9170
|
-
handover:
|
9171
|
-
|
9078
|
+
assigneeId: z121.string().uuid().optional().nullable(),
|
9079
|
+
note: z121.string().optional(),
|
9080
|
+
tags: z121.array(z121.string().uuid()).optional(),
|
9081
|
+
handover: z121.boolean().or(
|
9082
|
+
z121.union([z121.literal("true"), z121.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9172
9083
|
).optional().nullable(),
|
9173
|
-
selfAssign:
|
9174
|
-
|
9084
|
+
selfAssign: z121.boolean().or(
|
9085
|
+
z121.union([z121.literal("true"), z121.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9175
9086
|
).optional().nullable()
|
9176
9087
|
})
|
9177
9088
|
}
|
@@ -9185,7 +9096,7 @@ var roomContract = initContract46().router(
|
|
9185
9096
|
path: "/",
|
9186
9097
|
responses: {
|
9187
9098
|
200: DefaultSuccessResponseSchema.extend({
|
9188
|
-
message:
|
9099
|
+
message: z122.string()
|
9189
9100
|
}),
|
9190
9101
|
...DefaultResponses
|
9191
9102
|
},
|
@@ -9198,10 +9109,10 @@ var roomContract = initContract46().router(
|
|
9198
9109
|
query: RoomContractsValidationSchema.getAll.input,
|
9199
9110
|
responses: {
|
9200
9111
|
200: DefaultSuccessResponseSchema.extend({
|
9201
|
-
data:
|
9202
|
-
total:
|
9203
|
-
page:
|
9204
|
-
pageSize:
|
9112
|
+
data: z122.array(MailRoomSchema),
|
9113
|
+
total: z122.number(),
|
9114
|
+
page: z122.number(),
|
9115
|
+
pageSize: z122.number()
|
9205
9116
|
}),
|
9206
9117
|
...DefaultResponses
|
9207
9118
|
},
|
@@ -9213,24 +9124,24 @@ var roomContract = initContract46().router(
|
|
9213
9124
|
path: "/count_rooms/all",
|
9214
9125
|
responses: {
|
9215
9126
|
200: DefaultSuccessResponseSchema.extend({
|
9216
|
-
data:
|
9217
|
-
general:
|
9218
|
-
|
9219
|
-
name:
|
9220
|
-
count:
|
9221
|
-
unReadMessagesCount:
|
9127
|
+
data: z122.object({
|
9128
|
+
general: z122.array(
|
9129
|
+
z122.object({
|
9130
|
+
name: z122.string(),
|
9131
|
+
count: z122.number(),
|
9132
|
+
unReadMessagesCount: z122.number()
|
9222
9133
|
})
|
9223
9134
|
),
|
9224
|
-
channels:
|
9225
|
-
|
9135
|
+
channels: z122.array(
|
9136
|
+
z122.object({
|
9226
9137
|
channel: MailAccountSchema,
|
9227
|
-
count:
|
9138
|
+
count: z122.number()
|
9228
9139
|
})
|
9229
9140
|
),
|
9230
|
-
contactLabels:
|
9231
|
-
|
9141
|
+
contactLabels: z122.array(
|
9142
|
+
z122.object({
|
9232
9143
|
label: TagSchema,
|
9233
|
-
count:
|
9144
|
+
count: z122.number()
|
9234
9145
|
})
|
9235
9146
|
)
|
9236
9147
|
})
|
@@ -9242,12 +9153,12 @@ var roomContract = initContract46().router(
|
|
9242
9153
|
getAttachments: {
|
9243
9154
|
method: "GET",
|
9244
9155
|
path: "/:id/attachments",
|
9245
|
-
pathParams:
|
9246
|
-
id:
|
9156
|
+
pathParams: z122.object({
|
9157
|
+
id: z122.string().uuid()
|
9247
9158
|
}),
|
9248
9159
|
responses: {
|
9249
9160
|
200: DefaultSuccessResponseSchema.extend({
|
9250
|
-
data:
|
9161
|
+
data: z122.array(AttachmentSchema2)
|
9251
9162
|
}),
|
9252
9163
|
...DefaultResponses
|
9253
9164
|
},
|
@@ -9256,12 +9167,12 @@ var roomContract = initContract46().router(
|
|
9256
9167
|
getParticipants: {
|
9257
9168
|
method: "GET",
|
9258
9169
|
path: "/:id/participants",
|
9259
|
-
pathParams:
|
9260
|
-
id:
|
9170
|
+
pathParams: z122.object({
|
9171
|
+
id: z122.string().uuid()
|
9261
9172
|
}),
|
9262
9173
|
responses: {
|
9263
9174
|
200: DefaultSuccessResponseSchema.extend({
|
9264
|
-
data:
|
9175
|
+
data: z122.array(MailParticipant)
|
9265
9176
|
}),
|
9266
9177
|
...DefaultResponses
|
9267
9178
|
},
|
@@ -9272,22 +9183,22 @@ var roomContract = initContract46().router(
|
|
9272
9183
|
path: "/add_email_to_contact",
|
9273
9184
|
responses: {
|
9274
9185
|
200: DefaultSuccessResponseSchema.extend({
|
9275
|
-
data:
|
9186
|
+
data: z122.string()
|
9276
9187
|
}),
|
9277
9188
|
...DefaultResponses
|
9278
9189
|
},
|
9279
|
-
body:
|
9280
|
-
email:
|
9281
|
-
contactId:
|
9282
|
-
mailUserId:
|
9190
|
+
body: z122.object({
|
9191
|
+
email: z122.string(),
|
9192
|
+
contactId: z122.string(),
|
9193
|
+
mailUserId: z122.string()
|
9283
9194
|
}),
|
9284
9195
|
summary: "Add a new email of a mail room participant to an existing contact"
|
9285
9196
|
},
|
9286
9197
|
update: {
|
9287
9198
|
method: "PATCH",
|
9288
9199
|
path: "/:id",
|
9289
|
-
pathParams:
|
9290
|
-
id:
|
9200
|
+
pathParams: z122.object({
|
9201
|
+
id: z122.string()
|
9291
9202
|
}),
|
9292
9203
|
responses: {
|
9293
9204
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9301,12 +9212,12 @@ var roomContract = initContract46().router(
|
|
9301
9212
|
markAsRead: {
|
9302
9213
|
method: "POST",
|
9303
9214
|
path: "/mark_as_read",
|
9304
|
-
body:
|
9305
|
-
id:
|
9215
|
+
body: z122.object({
|
9216
|
+
id: z122.string()
|
9306
9217
|
}),
|
9307
9218
|
responses: {
|
9308
9219
|
200: DefaultSuccessResponseSchema.extend({
|
9309
|
-
message:
|
9220
|
+
message: z122.string()
|
9310
9221
|
}),
|
9311
9222
|
...DefaultResponses
|
9312
9223
|
},
|
@@ -9315,8 +9226,8 @@ var roomContract = initContract46().router(
|
|
9315
9226
|
getById: {
|
9316
9227
|
method: "GET",
|
9317
9228
|
path: "/:id",
|
9318
|
-
pathParams:
|
9319
|
-
id:
|
9229
|
+
pathParams: z122.object({
|
9230
|
+
id: z122.string().uuid()
|
9320
9231
|
}),
|
9321
9232
|
responses: {
|
9322
9233
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9334,70 +9245,70 @@ var roomContract = initContract46().router(
|
|
9334
9245
|
|
9335
9246
|
// src/mail/account-contract.ts
|
9336
9247
|
import { initContract as initContract47 } from "@ts-rest/core";
|
9337
|
-
import
|
9248
|
+
import z124 from "zod";
|
9338
9249
|
|
9339
9250
|
// src/mail/schemas/account-validation.schema.ts
|
9340
|
-
import
|
9251
|
+
import z123 from "zod";
|
9341
9252
|
var AccountContractsValidationSchemas = {
|
9342
9253
|
create: {
|
9343
|
-
input:
|
9344
|
-
address:
|
9345
|
-
name:
|
9346
|
-
password:
|
9347
|
-
mailServerId:
|
9254
|
+
input: z123.object({
|
9255
|
+
address: z123.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
9256
|
+
name: z123.string().min(1, "Account name cannot be empty."),
|
9257
|
+
password: z123.string().min(1, "Password cannot be empty."),
|
9258
|
+
mailServerId: z123.string().uuid("Invalid mail_server_id")
|
9348
9259
|
})
|
9349
9260
|
},
|
9350
9261
|
getById: {
|
9351
|
-
input:
|
9352
|
-
id:
|
9262
|
+
input: z123.object({
|
9263
|
+
id: z123.string().uuid()
|
9353
9264
|
}),
|
9354
9265
|
output: MailAccountSchema
|
9355
9266
|
},
|
9356
9267
|
getAll: {
|
9357
|
-
output:
|
9268
|
+
output: z123.array(MailAccountSchema)
|
9358
9269
|
},
|
9359
9270
|
update: {
|
9360
9271
|
input: MailAccountSchema,
|
9361
9272
|
output: MailAccountSchema
|
9362
9273
|
},
|
9363
9274
|
disconnect: {
|
9364
|
-
input:
|
9365
|
-
id:
|
9275
|
+
input: z123.object({
|
9276
|
+
id: z123.string().uuid()
|
9366
9277
|
}),
|
9367
9278
|
output: MailAccountSchema
|
9368
9279
|
},
|
9369
9280
|
reconnect: {
|
9370
|
-
input:
|
9371
|
-
id:
|
9281
|
+
input: z123.object({
|
9282
|
+
id: z123.string()
|
9372
9283
|
}),
|
9373
9284
|
output: MailAccountSchema
|
9374
9285
|
},
|
9375
9286
|
delete: {
|
9376
|
-
input:
|
9377
|
-
id:
|
9287
|
+
input: z123.object({
|
9288
|
+
id: z123.string()
|
9378
9289
|
}),
|
9379
|
-
output:
|
9290
|
+
output: z123.string()
|
9380
9291
|
},
|
9381
9292
|
deleteEmailEngineAcc: {
|
9382
|
-
input:
|
9383
|
-
account:
|
9293
|
+
input: z123.object({
|
9294
|
+
account: z123.string()
|
9384
9295
|
}),
|
9385
9296
|
output: MailAccountSchema
|
9386
9297
|
},
|
9387
9298
|
generateOAuth2AuthenticationLink: {
|
9388
|
-
body:
|
9389
|
-
oAuth2AppId:
|
9390
|
-
mailServerId:
|
9299
|
+
body: z123.object({
|
9300
|
+
oAuth2AppId: z123.string(),
|
9301
|
+
mailServerId: z123.string()
|
9391
9302
|
}),
|
9392
|
-
response:
|
9393
|
-
url:
|
9394
|
-
account:
|
9303
|
+
response: z123.object({
|
9304
|
+
url: z123.string(),
|
9305
|
+
account: z123.string()
|
9395
9306
|
})
|
9396
9307
|
},
|
9397
9308
|
createOAuth2Acc: {
|
9398
|
-
body:
|
9399
|
-
account:
|
9400
|
-
name:
|
9309
|
+
body: z123.object({
|
9310
|
+
account: z123.string(),
|
9311
|
+
name: z123.string()
|
9401
9312
|
}),
|
9402
9313
|
response: MailAccountSchema
|
9403
9314
|
}
|
@@ -9415,14 +9326,14 @@ var accountContract = initContract47().router(
|
|
9415
9326
|
// data: AccountContractsValidationSchemas.create.output,
|
9416
9327
|
data: MailAccountSchema
|
9417
9328
|
}),
|
9418
|
-
400:
|
9419
|
-
message:
|
9329
|
+
400: z124.object({
|
9330
|
+
message: z124.string()
|
9420
9331
|
}),
|
9421
|
-
409:
|
9422
|
-
message:
|
9332
|
+
409: z124.object({
|
9333
|
+
message: z124.string()
|
9423
9334
|
}),
|
9424
|
-
500:
|
9425
|
-
message:
|
9335
|
+
500: z124.object({
|
9336
|
+
message: z124.string()
|
9426
9337
|
}),
|
9427
9338
|
...DefaultResponses
|
9428
9339
|
},
|
@@ -9438,14 +9349,14 @@ var accountContract = initContract47().router(
|
|
9438
9349
|
201: DefaultSuccessResponseSchema.extend({
|
9439
9350
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
9440
9351
|
}),
|
9441
|
-
400:
|
9442
|
-
message:
|
9352
|
+
400: z124.object({
|
9353
|
+
message: z124.string()
|
9443
9354
|
}),
|
9444
|
-
409:
|
9445
|
-
message:
|
9355
|
+
409: z124.object({
|
9356
|
+
message: z124.string()
|
9446
9357
|
}),
|
9447
|
-
500:
|
9448
|
-
message:
|
9358
|
+
500: z124.object({
|
9359
|
+
message: z124.string()
|
9449
9360
|
}),
|
9450
9361
|
...DefaultResponses
|
9451
9362
|
},
|
@@ -9459,7 +9370,7 @@ var accountContract = initContract47().router(
|
|
9459
9370
|
path: "/sync",
|
9460
9371
|
responses: {
|
9461
9372
|
200: DefaultSuccessResponseSchema.extend({
|
9462
|
-
message:
|
9373
|
+
message: z124.string()
|
9463
9374
|
}),
|
9464
9375
|
...DefaultResponses
|
9465
9376
|
},
|
@@ -9484,13 +9395,13 @@ var accountContract = initContract47().router(
|
|
9484
9395
|
getAll: {
|
9485
9396
|
method: "GET",
|
9486
9397
|
path: "",
|
9487
|
-
query:
|
9488
|
-
state:
|
9489
|
-
withDeleted:
|
9398
|
+
query: z124.object({
|
9399
|
+
state: z124.union([z124.literal("connected"), z124.literal("disconnected")]).optional(),
|
9400
|
+
withDeleted: z124.boolean().default(false)
|
9490
9401
|
}).optional(),
|
9491
9402
|
responses: {
|
9492
9403
|
200: DefaultSuccessResponseSchema.extend({
|
9493
|
-
data:
|
9404
|
+
data: z124.array(MailAccountSchema)
|
9494
9405
|
}),
|
9495
9406
|
...DefaultResponses
|
9496
9407
|
},
|
@@ -9501,8 +9412,8 @@ var accountContract = initContract47().router(
|
|
9501
9412
|
update: {
|
9502
9413
|
method: "PATCH",
|
9503
9414
|
path: "/:id",
|
9504
|
-
pathParams:
|
9505
|
-
id:
|
9415
|
+
pathParams: z124.object({
|
9416
|
+
id: z124.string().uuid()
|
9506
9417
|
}),
|
9507
9418
|
responses: {
|
9508
9419
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -9551,7 +9462,7 @@ var accountContract = initContract47().router(
|
|
9551
9462
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
9552
9463
|
responses: {
|
9553
9464
|
200: DefaultSuccessResponseSchema.extend({
|
9554
|
-
message:
|
9465
|
+
message: z124.string()
|
9555
9466
|
}),
|
9556
9467
|
...DefaultResponses
|
9557
9468
|
},
|
@@ -9566,7 +9477,7 @@ var accountContract = initContract47().router(
|
|
9566
9477
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
9567
9478
|
responses: {
|
9568
9479
|
200: DefaultSuccessResponseSchema.extend({
|
9569
|
-
message:
|
9480
|
+
message: z124.string()
|
9570
9481
|
}),
|
9571
9482
|
...DefaultResponses
|
9572
9483
|
},
|
@@ -9595,20 +9506,20 @@ var accountContract = initContract47().router(
|
|
9595
9506
|
|
9596
9507
|
// src/mail/mail-server-contract.ts
|
9597
9508
|
import { initContract as initContract48 } from "@ts-rest/core";
|
9598
|
-
import
|
9509
|
+
import z126 from "zod";
|
9599
9510
|
|
9600
9511
|
// src/mail/schemas/servers-validation.schema.ts
|
9601
|
-
import
|
9602
|
-
var CreateMailServerSchema =
|
9603
|
-
name:
|
9604
|
-
smtpHost:
|
9605
|
-
smtpPort:
|
9606
|
-
smtpTlsPort:
|
9607
|
-
useTlsForSmtp:
|
9608
|
-
imapHost:
|
9609
|
-
imapPort:
|
9610
|
-
imapTlsPort:
|
9611
|
-
useTlsForImap:
|
9512
|
+
import z125 from "zod";
|
9513
|
+
var CreateMailServerSchema = z125.object({
|
9514
|
+
name: z125.string(),
|
9515
|
+
smtpHost: z125.string(),
|
9516
|
+
smtpPort: z125.number(),
|
9517
|
+
smtpTlsPort: z125.number(),
|
9518
|
+
useTlsForSmtp: z125.boolean(),
|
9519
|
+
imapHost: z125.string(),
|
9520
|
+
imapPort: z125.number(),
|
9521
|
+
imapTlsPort: z125.number(),
|
9522
|
+
useTlsForImap: z125.boolean()
|
9612
9523
|
});
|
9613
9524
|
|
9614
9525
|
// src/mail/mail-server-contract.ts
|
@@ -9631,11 +9542,11 @@ var serverContract = initContract48().router(
|
|
9631
9542
|
path: "/oauth2/apps",
|
9632
9543
|
responses: {
|
9633
9544
|
200: DefaultSuccessResponseSchema.extend({
|
9634
|
-
data:
|
9635
|
-
total:
|
9636
|
-
pages:
|
9637
|
-
page:
|
9638
|
-
apps:
|
9545
|
+
data: z126.object({
|
9546
|
+
total: z126.number(),
|
9547
|
+
pages: z126.number(),
|
9548
|
+
page: z126.number(),
|
9549
|
+
apps: z126.array(OAuth2AppSchema)
|
9639
9550
|
})
|
9640
9551
|
}),
|
9641
9552
|
...DefaultResponses
|
@@ -9645,8 +9556,8 @@ var serverContract = initContract48().router(
|
|
9645
9556
|
getById: {
|
9646
9557
|
method: "GET",
|
9647
9558
|
path: "/:id",
|
9648
|
-
pathParams:
|
9649
|
-
id:
|
9559
|
+
pathParams: z126.object({
|
9560
|
+
id: z126.string().uuid()
|
9650
9561
|
}),
|
9651
9562
|
responses: {
|
9652
9563
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9661,7 +9572,7 @@ var serverContract = initContract48().router(
|
|
9661
9572
|
path: "/",
|
9662
9573
|
responses: {
|
9663
9574
|
200: DefaultSuccessResponseSchema.extend({
|
9664
|
-
data:
|
9575
|
+
data: z126.array(MailServerSchema)
|
9665
9576
|
}),
|
9666
9577
|
...DefaultResponses
|
9667
9578
|
},
|
@@ -9670,8 +9581,8 @@ var serverContract = initContract48().router(
|
|
9670
9581
|
update: {
|
9671
9582
|
method: "PATCH",
|
9672
9583
|
path: "/:id",
|
9673
|
-
pathParams:
|
9674
|
-
id:
|
9584
|
+
pathParams: z126.object({
|
9585
|
+
id: z126.string().uuid()
|
9675
9586
|
}),
|
9676
9587
|
responses: {
|
9677
9588
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9685,8 +9596,8 @@ var serverContract = initContract48().router(
|
|
9685
9596
|
delete: {
|
9686
9597
|
method: "DELETE",
|
9687
9598
|
path: "/:id",
|
9688
|
-
pathParams:
|
9689
|
-
id:
|
9599
|
+
pathParams: z126.object({
|
9600
|
+
id: z126.string().uuid()
|
9690
9601
|
}),
|
9691
9602
|
responses: {
|
9692
9603
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9705,45 +9616,45 @@ var serverContract = initContract48().router(
|
|
9705
9616
|
|
9706
9617
|
// src/mail/message-contract.ts
|
9707
9618
|
import { initContract as initContract49 } from "@ts-rest/core";
|
9708
|
-
import
|
9619
|
+
import z128 from "zod";
|
9709
9620
|
|
9710
9621
|
// src/mail/schemas/message-validation.schema.ts
|
9711
|
-
import
|
9712
|
-
var MailParticipant2 =
|
9713
|
-
name:
|
9714
|
-
address:
|
9622
|
+
import z127 from "zod";
|
9623
|
+
var MailParticipant2 = z127.object({
|
9624
|
+
name: z127.string().optional(),
|
9625
|
+
address: z127.string().email()
|
9715
9626
|
});
|
9716
9627
|
var MessageContractsValidationsSchema = {
|
9717
9628
|
submit: {
|
9718
|
-
input:
|
9719
|
-
subject:
|
9720
|
-
text:
|
9721
|
-
html:
|
9629
|
+
input: z127.object({
|
9630
|
+
subject: z127.string(),
|
9631
|
+
text: z127.string(),
|
9632
|
+
html: z127.string(),
|
9722
9633
|
from: MailParticipant2,
|
9723
9634
|
to: MailParticipant2,
|
9724
|
-
cc:
|
9725
|
-
bcc:
|
9726
|
-
sendAt:
|
9727
|
-
reference:
|
9728
|
-
messageId:
|
9729
|
-
action:
|
9635
|
+
cc: z127.array(MailParticipant2).optional(),
|
9636
|
+
bcc: z127.array(MailParticipant2).optional(),
|
9637
|
+
sendAt: z127.string().optional(),
|
9638
|
+
reference: z127.object({
|
9639
|
+
messageId: z127.string(),
|
9640
|
+
action: z127.union([z127.literal("reply"), z127.literal("forward")])
|
9730
9641
|
}).optional(),
|
9731
|
-
attachments:
|
9732
|
-
|
9733
|
-
fileType:
|
9734
|
-
fileName:
|
9735
|
-
fileKey:
|
9736
|
-
fileSize:
|
9737
|
-
bucketName:
|
9738
|
-
presignedUrl:
|
9642
|
+
attachments: z127.array(
|
9643
|
+
z127.object({
|
9644
|
+
fileType: z127.string(),
|
9645
|
+
fileName: z127.string(),
|
9646
|
+
fileKey: z127.string(),
|
9647
|
+
fileSize: z127.number(),
|
9648
|
+
bucketName: z127.string(),
|
9649
|
+
presignedUrl: z127.string()
|
9739
9650
|
})
|
9740
9651
|
).optional()
|
9741
9652
|
}),
|
9742
|
-
output:
|
9743
|
-
response:
|
9744
|
-
messageId:
|
9745
|
-
sendAt:
|
9746
|
-
queueId:
|
9653
|
+
output: z127.object({
|
9654
|
+
response: z127.string(),
|
9655
|
+
messageId: z127.string(),
|
9656
|
+
sendAt: z127.string(),
|
9657
|
+
queueId: z127.string()
|
9747
9658
|
})
|
9748
9659
|
}
|
9749
9660
|
};
|
@@ -9772,8 +9683,8 @@ var messageContract = initContract49().router(
|
|
9772
9683
|
path: "/new_message_count",
|
9773
9684
|
responses: {
|
9774
9685
|
200: DefaultSuccessResponseSchema.extend({
|
9775
|
-
data:
|
9776
|
-
count:
|
9686
|
+
data: z128.object({
|
9687
|
+
count: z128.number()
|
9777
9688
|
})
|
9778
9689
|
}),
|
9779
9690
|
...DefaultResponses
|
@@ -9785,8 +9696,8 @@ var messageContract = initContract49().router(
|
|
9785
9696
|
getById: {
|
9786
9697
|
method: "GET",
|
9787
9698
|
path: "/:id",
|
9788
|
-
pathParams:
|
9789
|
-
id:
|
9699
|
+
pathParams: z128.object({
|
9700
|
+
id: z128.string()
|
9790
9701
|
}),
|
9791
9702
|
responses: {
|
9792
9703
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9801,8 +9712,8 @@ var messageContract = initContract49().router(
|
|
9801
9712
|
update: {
|
9802
9713
|
method: "PATCH",
|
9803
9714
|
path: "/:id",
|
9804
|
-
pathParams:
|
9805
|
-
id:
|
9715
|
+
pathParams: z128.object({
|
9716
|
+
id: z128.string()
|
9806
9717
|
}),
|
9807
9718
|
responses: {
|
9808
9719
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9818,8 +9729,8 @@ var messageContract = initContract49().router(
|
|
9818
9729
|
delete: {
|
9819
9730
|
method: "DELETE",
|
9820
9731
|
path: "/:id",
|
9821
|
-
pathParams:
|
9822
|
-
id:
|
9732
|
+
pathParams: z128.object({
|
9733
|
+
id: z128.string()
|
9823
9734
|
}),
|
9824
9735
|
responses: {
|
9825
9736
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9835,13 +9746,13 @@ var messageContract = initContract49().router(
|
|
9835
9746
|
cancelScheduledMessage: {
|
9836
9747
|
method: "DELETE",
|
9837
9748
|
path: "/scheduled_message/:id",
|
9838
|
-
pathParams:
|
9839
|
-
id:
|
9749
|
+
pathParams: z128.object({
|
9750
|
+
id: z128.string()
|
9840
9751
|
}),
|
9841
9752
|
responses: {
|
9842
9753
|
200: DefaultSuccessResponseSchema.extend({
|
9843
|
-
data:
|
9844
|
-
totalMessagesCount:
|
9754
|
+
data: z128.object({
|
9755
|
+
totalMessagesCount: z128.number()
|
9845
9756
|
})
|
9846
9757
|
}),
|
9847
9758
|
...DefaultResponses
|
@@ -9866,38 +9777,38 @@ var mailContract = initContract50().router({
|
|
9866
9777
|
|
9867
9778
|
// src/webchat/index.ts
|
9868
9779
|
import { initContract as initContract51 } from "@ts-rest/core";
|
9869
|
-
import
|
9780
|
+
import z131 from "zod";
|
9870
9781
|
|
9871
9782
|
// src/webchat/schema.ts
|
9872
|
-
import
|
9783
|
+
import z130 from "zod";
|
9873
9784
|
|
9874
9785
|
// src/webchat/validation.ts
|
9875
|
-
import
|
9786
|
+
import z129 from "zod";
|
9876
9787
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
9877
9788
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
9878
9789
|
return ChatwootChannelType3;
|
9879
9790
|
})(ChatwootChannelType2 || {});
|
9880
|
-
var WebChatChannelSchema =
|
9881
|
-
avatar:
|
9882
|
-
name:
|
9883
|
-
type:
|
9884
|
-
websiteName:
|
9885
|
-
welcomeTitle:
|
9886
|
-
websiteUrl:
|
9887
|
-
welcomeTagline:
|
9888
|
-
agentAwayMessage:
|
9889
|
-
widgetColor:
|
9791
|
+
var WebChatChannelSchema = z129.object({
|
9792
|
+
avatar: z129.string().optional(),
|
9793
|
+
name: z129.string(),
|
9794
|
+
type: z129.nativeEnum(ChatwootChannelType2),
|
9795
|
+
websiteName: z129.string(),
|
9796
|
+
welcomeTitle: z129.string(),
|
9797
|
+
websiteUrl: z129.string().url(),
|
9798
|
+
welcomeTagline: z129.string().optional(),
|
9799
|
+
agentAwayMessage: z129.string().optional(),
|
9800
|
+
widgetColor: z129.string().optional()
|
9890
9801
|
});
|
9891
9802
|
|
9892
9803
|
// src/webchat/schema.ts
|
9893
|
-
var ConnectWebChatChannelSchema =
|
9894
|
-
name:
|
9895
|
-
actor:
|
9896
|
-
id:
|
9897
|
-
name:
|
9898
|
-
email:
|
9899
|
-
address:
|
9900
|
-
phone:
|
9804
|
+
var ConnectWebChatChannelSchema = z130.object({
|
9805
|
+
name: z130.string(),
|
9806
|
+
actor: z130.object({
|
9807
|
+
id: z130.string().uuid(),
|
9808
|
+
name: z130.string(),
|
9809
|
+
email: z130.string().email(),
|
9810
|
+
address: z130.string().nullable(),
|
9811
|
+
phone: z130.string().nullable()
|
9901
9812
|
}),
|
9902
9813
|
channel: WebChatChannelSchema
|
9903
9814
|
});
|
@@ -9930,8 +9841,8 @@ var platformWebchatContract = initContract51().router({
|
|
9930
9841
|
disconnectToService: {
|
9931
9842
|
method: "POST",
|
9932
9843
|
path: "/disconnect",
|
9933
|
-
body:
|
9934
|
-
id:
|
9844
|
+
body: z131.object({
|
9845
|
+
id: z131.string().uuid()
|
9935
9846
|
}),
|
9936
9847
|
responses: {
|
9937
9848
|
200: ChannelServiceResponseSchema,
|
@@ -9942,8 +9853,8 @@ var platformWebchatContract = initContract51().router({
|
|
9942
9853
|
reconnect: {
|
9943
9854
|
method: "POST",
|
9944
9855
|
path: "/reconnect/:channelId",
|
9945
|
-
pathParams:
|
9946
|
-
channelId:
|
9856
|
+
pathParams: z131.object({
|
9857
|
+
channelId: z131.string().uuid()
|
9947
9858
|
}),
|
9948
9859
|
body: null,
|
9949
9860
|
responses: {
|
@@ -9955,8 +9866,8 @@ var platformWebchatContract = initContract51().router({
|
|
9955
9866
|
delete: {
|
9956
9867
|
method: "DELETE",
|
9957
9868
|
path: "/delete/:channelId",
|
9958
|
-
pathParams:
|
9959
|
-
channelId:
|
9869
|
+
pathParams: z131.object({
|
9870
|
+
channelId: z131.string().uuid()
|
9960
9871
|
}),
|
9961
9872
|
body: null,
|
9962
9873
|
responses: {
|
@@ -9969,18 +9880,18 @@ var platformWebchatContract = initContract51().router({
|
|
9969
9880
|
|
9970
9881
|
// src/hold-label/index.ts
|
9971
9882
|
import { initContract as initContract52 } from "@ts-rest/core";
|
9972
|
-
import
|
9883
|
+
import z133 from "zod";
|
9973
9884
|
|
9974
9885
|
// src/hold-label/validation.ts
|
9975
|
-
import
|
9976
|
-
var UpdatePositionSchema2 =
|
9977
|
-
holdLabels:
|
9978
|
-
|
9886
|
+
import z132 from "zod";
|
9887
|
+
var UpdatePositionSchema2 = z132.object({
|
9888
|
+
holdLabels: z132.array(
|
9889
|
+
z132.object({ id: z132.string().uuid(), position: z132.number() })
|
9979
9890
|
)
|
9980
9891
|
});
|
9981
|
-
var HoldRoomSchema =
|
9982
|
-
roomId:
|
9983
|
-
holdLabelId:
|
9892
|
+
var HoldRoomSchema = z132.object({
|
9893
|
+
roomId: z132.string().uuid(),
|
9894
|
+
holdLabelId: z132.string().uuid()
|
9984
9895
|
});
|
9985
9896
|
|
9986
9897
|
// src/hold-label/index.ts
|
@@ -9989,7 +9900,7 @@ var holdLabelContract = initContract52().router(
|
|
9989
9900
|
createHoldLabel: {
|
9990
9901
|
method: "POST",
|
9991
9902
|
path: "/",
|
9992
|
-
body:
|
9903
|
+
body: z133.object({ name: z133.string() }),
|
9993
9904
|
responses: {
|
9994
9905
|
201: DefaultSuccessResponseSchema.extend({
|
9995
9906
|
holdLabel: HoldLabelSchema
|
@@ -10001,7 +9912,7 @@ var holdLabelContract = initContract52().router(
|
|
10001
9912
|
path: "/",
|
10002
9913
|
responses: {
|
10003
9914
|
200: DefaultSuccessResponseSchema.extend({
|
10004
|
-
holdLabels:
|
9915
|
+
holdLabels: z133.array(HoldLabelSchema)
|
10005
9916
|
})
|
10006
9917
|
}
|
10007
9918
|
},
|
@@ -10019,8 +9930,8 @@ var holdLabelContract = initContract52().router(
|
|
10019
9930
|
updateHoldLabel: {
|
10020
9931
|
method: "PATCH",
|
10021
9932
|
path: "/:id",
|
10022
|
-
pathParams:
|
10023
|
-
body:
|
9933
|
+
pathParams: z133.object({ id: z133.string().uuid() }),
|
9934
|
+
body: z133.object({ name: z133.string() }),
|
10024
9935
|
responses: {
|
10025
9936
|
200: DefaultSuccessResponseSchema.extend({
|
10026
9937
|
holdLabel: HoldLabelSchema
|
@@ -10030,7 +9941,7 @@ var holdLabelContract = initContract52().router(
|
|
10030
9941
|
deleteHoldLabel: {
|
10031
9942
|
method: "DELETE",
|
10032
9943
|
path: "/:id",
|
10033
|
-
pathParams:
|
9944
|
+
pathParams: z133.object({ id: z133.string().uuid() }),
|
10034
9945
|
body: null,
|
10035
9946
|
responses: {
|
10036
9947
|
200: DefaultSuccessResponseSchema
|
@@ -10041,27 +9952,27 @@ var holdLabelContract = initContract52().router(
|
|
10041
9952
|
path: "/auto-unhold",
|
10042
9953
|
responses: {
|
10043
9954
|
200: DefaultSuccessResponseSchema.extend({
|
10044
|
-
autoUnhold:
|
9955
|
+
autoUnhold: z133.boolean()
|
10045
9956
|
})
|
10046
9957
|
}
|
10047
9958
|
},
|
10048
9959
|
updateAutoUnhold: {
|
10049
9960
|
method: "POST",
|
10050
9961
|
path: "/auto-unhold",
|
10051
|
-
body:
|
9962
|
+
body: z133.object({ autoUnhold: z133.boolean() }),
|
10052
9963
|
responses: {
|
10053
9964
|
200: DefaultSuccessResponseSchema.extend({
|
10054
|
-
autoUnhold:
|
9965
|
+
autoUnhold: z133.boolean()
|
10055
9966
|
})
|
10056
9967
|
}
|
10057
9968
|
},
|
10058
9969
|
getHoldLogs: {
|
10059
9970
|
method: "GET",
|
10060
9971
|
path: "/hold-logs",
|
10061
|
-
query:
|
9972
|
+
query: z133.object({ cxLogId: z133.string().uuid() }),
|
10062
9973
|
responses: {
|
10063
|
-
200:
|
10064
|
-
holdLogs:
|
9974
|
+
200: z133.object({
|
9975
|
+
holdLogs: z133.array(FormattedHoldLogSchema)
|
10065
9976
|
})
|
10066
9977
|
}
|
10067
9978
|
},
|
@@ -10078,7 +9989,7 @@ var holdLabelContract = initContract52().router(
|
|
10078
9989
|
unholdRoom: {
|
10079
9990
|
method: "POST",
|
10080
9991
|
path: "/unhold-room",
|
10081
|
-
body:
|
9992
|
+
body: z133.object({ roomId: z133.string().uuid() }),
|
10082
9993
|
responses: {
|
10083
9994
|
200: DefaultSuccessResponseSchema.extend({
|
10084
9995
|
holdLog: HoldLogSchema.optional()
|
@@ -10091,89 +10002,89 @@ var holdLabelContract = initContract52().router(
|
|
10091
10002
|
|
10092
10003
|
// src/subscription/index.ts
|
10093
10004
|
import { initContract as initContract53 } from "@ts-rest/core";
|
10094
|
-
import { z as
|
10005
|
+
import { z as z136 } from "zod";
|
10095
10006
|
|
10096
10007
|
// src/subscription/schema.ts
|
10097
|
-
import
|
10008
|
+
import z134 from "zod";
|
10098
10009
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
10099
|
-
priceId:
|
10100
|
-
name:
|
10101
|
-
perUnit:
|
10102
|
-
price:
|
10103
|
-
currency:
|
10010
|
+
priceId: z134.string(),
|
10011
|
+
name: z134.string().nullable(),
|
10012
|
+
perUnit: z134.number(),
|
10013
|
+
price: z134.number(),
|
10014
|
+
currency: z134.string().nullable()
|
10104
10015
|
});
|
10105
10016
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
10106
|
-
provider:
|
10107
|
-
productId:
|
10108
|
-
name:
|
10109
|
-
type:
|
10110
|
-
omnichannel:
|
10111
|
-
usageType:
|
10017
|
+
provider: z134.string(),
|
10018
|
+
productId: z134.string(),
|
10019
|
+
name: z134.string(),
|
10020
|
+
type: z134.string(),
|
10021
|
+
omnichannel: z134.string(),
|
10022
|
+
usageType: z134.string().nullable(),
|
10112
10023
|
productPrice: ProductPriceSchema
|
10113
10024
|
});
|
10114
10025
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
10115
|
-
includedQuantity:
|
10026
|
+
includedQuantity: z134.number(),
|
10116
10027
|
product: ProductWithoutRelatedSchema
|
10117
10028
|
});
|
10118
10029
|
var ProductSchema = DefaultEntitySchema.extend({
|
10119
|
-
provider:
|
10120
|
-
productId:
|
10121
|
-
name:
|
10122
|
-
type:
|
10123
|
-
omnichannel:
|
10124
|
-
usageType:
|
10030
|
+
provider: z134.string(),
|
10031
|
+
productId: z134.string(),
|
10032
|
+
name: z134.string(),
|
10033
|
+
type: z134.string(),
|
10034
|
+
omnichannel: z134.string(),
|
10035
|
+
usageType: z134.string().nullable(),
|
10125
10036
|
productPrice: ProductPriceSchema,
|
10126
|
-
relatedProducts:
|
10037
|
+
relatedProducts: z134.array(RelatedProductSchema)
|
10127
10038
|
});
|
10128
10039
|
var CustomerSchema = DefaultEntitySchema.extend({
|
10129
|
-
provider:
|
10130
|
-
customerId:
|
10131
|
-
email:
|
10132
|
-
name:
|
10133
|
-
balance:
|
10040
|
+
provider: z134.string(),
|
10041
|
+
customerId: z134.string(),
|
10042
|
+
email: z134.string(),
|
10043
|
+
name: z134.string(),
|
10044
|
+
balance: z134.number()
|
10134
10045
|
});
|
10135
10046
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
10136
|
-
limit:
|
10137
|
-
subscriptionItemId:
|
10138
|
-
usage:
|
10047
|
+
limit: z134.number(),
|
10048
|
+
subscriptionItemId: z134.string(),
|
10049
|
+
usage: z134.number().nullable(),
|
10139
10050
|
product: ProductSchema
|
10140
10051
|
});
|
10141
10052
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
10142
|
-
provider:
|
10143
|
-
type:
|
10144
|
-
subscriptionId:
|
10145
|
-
interval:
|
10146
|
-
quantity:
|
10147
|
-
amount:
|
10148
|
-
startAt:
|
10149
|
-
expireAt:
|
10150
|
-
status:
|
10151
|
-
name:
|
10152
|
-
subscriptionProducts:
|
10053
|
+
provider: z134.string(),
|
10054
|
+
type: z134.string(),
|
10055
|
+
subscriptionId: z134.string(),
|
10056
|
+
interval: z134.string(),
|
10057
|
+
quantity: z134.number(),
|
10058
|
+
amount: z134.number(),
|
10059
|
+
startAt: z134.date().nullable(),
|
10060
|
+
expireAt: z134.date(),
|
10061
|
+
status: z134.string(),
|
10062
|
+
name: z134.string().nullable(),
|
10063
|
+
subscriptionProducts: z134.array(SubscriptionProuctSchema),
|
10153
10064
|
productPrice: ProductPriceSchema,
|
10154
10065
|
product: ProductSchema
|
10155
10066
|
});
|
10156
10067
|
|
10157
10068
|
// src/subscription/validation.ts
|
10158
|
-
import { z as
|
10159
|
-
var GetAvailablePlanSchema =
|
10160
|
-
type:
|
10161
|
-
currency:
|
10162
|
-
});
|
10163
|
-
var UpdateSubscriptionSchema =
|
10164
|
-
planProductId:
|
10165
|
-
planProductPriceId:
|
10166
|
-
subscriptionId:
|
10167
|
-
subscriptionProducts:
|
10168
|
-
|
10169
|
-
productId:
|
10170
|
-
productPriceId:
|
10171
|
-
quantity:
|
10069
|
+
import { z as z135 } from "zod";
|
10070
|
+
var GetAvailablePlanSchema = z135.object({
|
10071
|
+
type: z135.string(),
|
10072
|
+
currency: z135.string()
|
10073
|
+
});
|
10074
|
+
var UpdateSubscriptionSchema = z135.object({
|
10075
|
+
planProductId: z135.string(),
|
10076
|
+
planProductPriceId: z135.string(),
|
10077
|
+
subscriptionId: z135.string(),
|
10078
|
+
subscriptionProducts: z135.array(
|
10079
|
+
z135.object({
|
10080
|
+
productId: z135.string(),
|
10081
|
+
productPriceId: z135.string(),
|
10082
|
+
quantity: z135.number()
|
10172
10083
|
})
|
10173
10084
|
)
|
10174
10085
|
});
|
10175
|
-
var TopUpBalanceSchema =
|
10176
|
-
quantity:
|
10086
|
+
var TopUpBalanceSchema = z135.object({
|
10087
|
+
quantity: z135.number()
|
10177
10088
|
});
|
10178
10089
|
|
10179
10090
|
// src/subscription/index.ts
|
@@ -10197,9 +10108,9 @@ var subscriptionContract = initContract53().router(
|
|
10197
10108
|
body: UpdateSubscriptionSchema,
|
10198
10109
|
responses: {
|
10199
10110
|
200: DefaultSuccessResponseSchema.extend({
|
10200
|
-
message:
|
10201
|
-
requireCheckout:
|
10202
|
-
checkoutUrl:
|
10111
|
+
message: z136.string(),
|
10112
|
+
requireCheckout: z136.boolean(),
|
10113
|
+
checkoutUrl: z136.string().nullable()
|
10203
10114
|
}),
|
10204
10115
|
402: DefaultErrorResponseSchema,
|
10205
10116
|
500: DefaultErrorResponseSchema
|
@@ -10211,7 +10122,7 @@ var subscriptionContract = initContract53().router(
|
|
10211
10122
|
body: TopUpBalanceSchema,
|
10212
10123
|
responses: {
|
10213
10124
|
200: DefaultSuccessResponseSchema.extend({
|
10214
|
-
checkoutUrl:
|
10125
|
+
checkoutUrl: z136.string()
|
10215
10126
|
}),
|
10216
10127
|
500: DefaultErrorResponseSchema
|
10217
10128
|
}
|
@@ -10222,7 +10133,7 @@ var subscriptionContract = initContract53().router(
|
|
10222
10133
|
query: GetAvailablePlanSchema,
|
10223
10134
|
responses: {
|
10224
10135
|
200: DefaultSuccessResponseSchema.extend({
|
10225
|
-
data:
|
10136
|
+
data: z136.array(ProductSchema)
|
10226
10137
|
}),
|
10227
10138
|
500: DefaultErrorResponseSchema
|
10228
10139
|
}
|
@@ -10245,19 +10156,19 @@ var subscriptionContract = initContract53().router(
|
|
10245
10156
|
|
10246
10157
|
// src/cx-intelligence/index.ts
|
10247
10158
|
import { initContract as initContract54 } from "@ts-rest/core";
|
10248
|
-
import
|
10159
|
+
import z137 from "zod";
|
10249
10160
|
var cxIntelligenceContract = initContract54().router(
|
10250
10161
|
{
|
10251
10162
|
toggle: {
|
10252
10163
|
method: "POST",
|
10253
10164
|
path: "/toggle",
|
10254
10165
|
headers: DefaultHeaderSchema,
|
10255
|
-
body:
|
10256
|
-
enabled:
|
10166
|
+
body: z137.object({
|
10167
|
+
enabled: z137.union([z137.literal(true), z137.literal(false)])
|
10257
10168
|
}),
|
10258
10169
|
responses: {
|
10259
10170
|
200: DefaultSuccessResponseSchema.extend({
|
10260
|
-
message:
|
10171
|
+
message: z137.string()
|
10261
10172
|
}),
|
10262
10173
|
500: DefaultErrorResponseSchema
|
10263
10174
|
},
|
@@ -10267,15 +10178,15 @@ var cxIntelligenceContract = initContract54().router(
|
|
10267
10178
|
method: "POST",
|
10268
10179
|
path: "/cx-logs/:id/transcribe",
|
10269
10180
|
headers: DefaultHeaderSchema,
|
10270
|
-
pathParams:
|
10271
|
-
id:
|
10181
|
+
pathParams: z137.object({
|
10182
|
+
id: z137.string().uuid()
|
10272
10183
|
}),
|
10273
|
-
body:
|
10274
|
-
fileUrl:
|
10184
|
+
body: z137.object({
|
10185
|
+
fileUrl: z137.string()
|
10275
10186
|
}),
|
10276
10187
|
responses: {
|
10277
10188
|
200: DefaultSuccessResponseSchema.extend({
|
10278
|
-
message:
|
10189
|
+
message: z137.string()
|
10279
10190
|
}),
|
10280
10191
|
403: DefaultErrorResponseSchema,
|
10281
10192
|
404: DefaultErrorResponseSchema,
|
@@ -10295,13 +10206,13 @@ var settingCxIntelligenceContract = initContract54().router(
|
|
10295
10206
|
headers: DefaultHeaderSchema,
|
10296
10207
|
responses: {
|
10297
10208
|
200: DefaultSuccessResponseSchema.extend({
|
10298
|
-
message:
|
10299
|
-
status:
|
10209
|
+
message: z137.string(),
|
10210
|
+
status: z137.boolean()
|
10300
10211
|
}),
|
10301
|
-
422:
|
10302
|
-
requestId:
|
10303
|
-
message:
|
10304
|
-
status:
|
10212
|
+
422: z137.object({
|
10213
|
+
requestId: z137.string(),
|
10214
|
+
message: z137.string(),
|
10215
|
+
status: z137.boolean()
|
10305
10216
|
}),
|
10306
10217
|
500: DefaultErrorResponseSchema
|
10307
10218
|
},
|