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