@kl1/contracts 1.0.94 → 1.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +780 -747
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +779 -747
- package/dist/index.mjs.map +1 -1
- package/dist/src/chat/index.d.ts +3 -0
- package/dist/src/chat/index.d.ts.map +1 -1
- package/dist/src/chat/validation.d.ts +8 -0
- package/dist/src/chat/validation.d.ts.map +1 -1
- package/dist/src/contract.d.ts +756 -258
- package/dist/src/contract.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/instagram/index.d.ts +5 -0
- package/dist/src/instagram/index.d.ts.map +1 -1
- package/dist/src/line/index.d.ts +5 -0
- package/dist/src/line/index.d.ts.map +1 -1
- package/dist/src/mail/account-contract.d.ts +132 -132
- package/dist/src/mail/mail-contract.d.ts +715 -258
- package/dist/src/mail/mail-contract.d.ts.map +1 -1
- package/dist/src/mail/mail-server-contract.d.ts +477 -18
- package/dist/src/mail/mail-server-contract.d.ts.map +1 -1
- package/dist/src/mail/room-contract.d.ts +108 -108
- package/dist/src/mail/schemas/account-validation.schema.d.ts +140 -140
- package/dist/src/mail/schemas/account.schema.d.ts +32 -32
- package/dist/src/mail/schemas/room-validation.schema.d.ts +36 -36
- package/dist/src/mail/schemas/room.schema.d.ts +28 -28
- package/dist/src/mail/schemas/servers-validation.schema.d.ts +33 -0
- package/dist/src/mail/schemas/servers-validation.schema.d.ts.map +1 -0
- package/dist/src/messenger/index.d.ts +5 -0
- package/dist/src/messenger/index.d.ts.map +1 -1
- package/dist/src/telephony-cdr/index.d.ts +18 -0
- package/dist/src/telephony-cdr/index.d.ts.map +1 -1
- package/dist/src/telephony-cdr/validation.d.ts +12 -0
- package/dist/src/telephony-cdr/validation.d.ts.map +1 -1
- package/dist/src/viber/index.d.ts +5 -0
- package/dist/src/viber/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src/app/index.d.ts +0 -17
- package/dist/src/app/index.d.ts.map +0 -1
- package/dist/src/chatwoot/index.d.ts +0 -7527
- package/dist/src/chatwoot/index.d.ts.map +0 -1
- package/dist/src/chatwoot/schema.d.ts +0 -79
- package/dist/src/chatwoot/schema.d.ts.map +0 -1
- package/dist/src/chatwoot/validation.d.ts +0 -53
- package/dist/src/chatwoot/validation.d.ts.map +0 -1
- package/dist/src/mail/mail-server.d.ts +0 -216
- package/dist/src/mail/mail-server.d.ts.map +0 -1
- package/dist/src/platform-contact/schema.d.ts +0 -30
- package/dist/src/platform-contact/schema.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
@@ -1448,7 +1448,8 @@ var SendMessageSchema = z29.object({
|
|
1448
1448
|
messageAttachments: MessageAttachmentSchema.optional(),
|
1449
1449
|
user: UserSchema.optional(),
|
1450
1450
|
sticker: StickerSchema.optional(),
|
1451
|
-
file: z29.custom().optional()
|
1451
|
+
file: z29.custom().optional(),
|
1452
|
+
messengerTags: z29.union([z29.literal(1), z29.literal(2), z29.literal(3)])
|
1452
1453
|
});
|
1453
1454
|
var SolveRoomSchema = z29.object({
|
1454
1455
|
roomId: z29.string(),
|
@@ -1516,7 +1517,8 @@ var SendMessageToPlatformSchema = z29.object({
|
|
1516
1517
|
address: z29.string().nullable(),
|
1517
1518
|
phone: z29.string().nullable()
|
1518
1519
|
}).nullable(),
|
1519
|
-
channel: ChannelSchema2
|
1520
|
+
channel: ChannelSchema2,
|
1521
|
+
status: z29.number()
|
1520
1522
|
}),
|
1521
1523
|
message: z29.object({
|
1522
1524
|
message: z29.string().optional(),
|
@@ -4024,12 +4026,12 @@ var MailServerSchema = z56.object({
|
|
4024
4026
|
deletedAt: z56.date().nullable(),
|
4025
4027
|
name: z56.string(),
|
4026
4028
|
smtpHost: z56.string(),
|
4027
|
-
smtpPort: z56.
|
4028
|
-
smtpTlsPort: z56.
|
4029
|
+
smtpPort: z56.number(),
|
4030
|
+
smtpTlsPort: z56.number(),
|
4029
4031
|
useTlsForSmtp: z56.boolean(),
|
4030
4032
|
imapHost: z56.string(),
|
4031
|
-
imapPort: z56.
|
4032
|
-
imapTlsPort: z56.
|
4033
|
+
imapPort: z56.number(),
|
4034
|
+
imapTlsPort: z56.number(),
|
4033
4035
|
useTlsForImap: z56.boolean()
|
4034
4036
|
});
|
4035
4037
|
var MailAccountSchema = z56.object({
|
@@ -4478,64 +4480,91 @@ var accountContract = initContract19().router(
|
|
4478
4480
|
|
4479
4481
|
// src/mail/mail-server-contract.ts
|
4480
4482
|
import { initContract as initContract20 } from "@ts-rest/core";
|
4483
|
+
import z63 from "zod";
|
4484
|
+
|
4485
|
+
// src/mail/schemas/servers-validation.schema.ts
|
4481
4486
|
import z62 from "zod";
|
4487
|
+
var CreateMailServerSchema = z62.object({
|
4488
|
+
name: z62.string(),
|
4489
|
+
smtpHost: z62.string(),
|
4490
|
+
smtpPort: z62.number(),
|
4491
|
+
smtpTlsPort: z62.number(),
|
4492
|
+
useTlsForSmtp: z62.boolean(),
|
4493
|
+
imapHost: z62.string(),
|
4494
|
+
imapPort: z62.number(),
|
4495
|
+
imapTlsPort: z62.number(),
|
4496
|
+
useTlsForImap: z62.boolean()
|
4497
|
+
});
|
4498
|
+
|
4499
|
+
// src/mail/mail-server-contract.ts
|
4482
4500
|
var serverContract = initContract20().router(
|
4483
4501
|
{
|
4484
4502
|
create: {
|
4485
4503
|
method: "POST",
|
4486
4504
|
path: "/",
|
4487
4505
|
responses: {
|
4488
|
-
|
4489
|
-
|
4506
|
+
201: DefaultSuccessResponseSchema.extend({
|
4507
|
+
data: MailServerSchema
|
4490
4508
|
}),
|
4491
4509
|
...DefaultResponses
|
4492
4510
|
},
|
4493
|
-
body:
|
4511
|
+
body: CreateMailServerSchema,
|
4494
4512
|
summary: "Register a new mail server"
|
4495
4513
|
},
|
4496
|
-
|
4514
|
+
getById: {
|
4497
4515
|
method: "GET",
|
4498
4516
|
path: "/:id",
|
4499
|
-
pathParams:
|
4500
|
-
id:
|
4517
|
+
pathParams: z63.object({
|
4518
|
+
id: z63.string().uuid()
|
4501
4519
|
}),
|
4502
4520
|
responses: {
|
4503
4521
|
200: DefaultSuccessResponseSchema.extend({
|
4504
|
-
|
4522
|
+
data: MailServerSchema
|
4505
4523
|
}),
|
4506
4524
|
...DefaultResponses
|
4507
4525
|
},
|
4508
4526
|
summary: "Get a mail server by id"
|
4509
4527
|
},
|
4528
|
+
getAll: {
|
4529
|
+
method: "GET",
|
4530
|
+
path: "/",
|
4531
|
+
responses: {
|
4532
|
+
200: DefaultSuccessResponseSchema.extend({
|
4533
|
+
data: z63.array(MailServerSchema)
|
4534
|
+
}),
|
4535
|
+
...DefaultResponses
|
4536
|
+
},
|
4537
|
+
summary: "Get all mail servers"
|
4538
|
+
},
|
4510
4539
|
update: {
|
4511
4540
|
method: "PATCH",
|
4512
4541
|
path: "/:id",
|
4513
|
-
pathParams:
|
4514
|
-
id:
|
4542
|
+
pathParams: z63.object({
|
4543
|
+
id: z63.string().uuid()
|
4515
4544
|
}),
|
4516
4545
|
responses: {
|
4517
4546
|
200: DefaultSuccessResponseSchema.extend({
|
4518
|
-
|
4547
|
+
data: MailServerSchema
|
4519
4548
|
}),
|
4520
4549
|
...DefaultResponses
|
4521
4550
|
},
|
4522
|
-
body:
|
4523
|
-
summary: "Update a mail server
|
4551
|
+
body: CreateMailServerSchema.partial(),
|
4552
|
+
summary: "Update a mail server"
|
4524
4553
|
},
|
4525
4554
|
delete: {
|
4526
|
-
method: "
|
4555
|
+
method: "DELETE",
|
4527
4556
|
path: "/:id",
|
4528
|
-
pathParams:
|
4529
|
-
id:
|
4557
|
+
pathParams: z63.object({
|
4558
|
+
id: z63.string().uuid()
|
4530
4559
|
}),
|
4531
4560
|
responses: {
|
4532
4561
|
200: DefaultSuccessResponseSchema.extend({
|
4533
|
-
|
4562
|
+
data: MailServerSchema
|
4534
4563
|
}),
|
4535
4564
|
...DefaultResponses
|
4536
4565
|
},
|
4537
4566
|
body: null,
|
4538
|
-
summary: "Delete a mail server
|
4567
|
+
summary: "Delete a mail server"
|
4539
4568
|
}
|
4540
4569
|
},
|
4541
4570
|
{
|
@@ -4545,44 +4574,44 @@ var serverContract = initContract20().router(
|
|
4545
4574
|
|
4546
4575
|
// src/mail/message-contract.ts
|
4547
4576
|
import { initContract as initContract21 } from "@ts-rest/core";
|
4548
|
-
import
|
4577
|
+
import z65 from "zod";
|
4549
4578
|
|
4550
4579
|
// src/mail/schemas/message-validation.schema.ts
|
4551
|
-
import
|
4552
|
-
var MailParticipant =
|
4553
|
-
name:
|
4554
|
-
address:
|
4580
|
+
import z64 from "zod";
|
4581
|
+
var MailParticipant = z64.object({
|
4582
|
+
name: z64.string().optional(),
|
4583
|
+
address: z64.string().email()
|
4555
4584
|
});
|
4556
4585
|
var MessageContractsValidationsSchema = {
|
4557
4586
|
submit: {
|
4558
|
-
input:
|
4559
|
-
subject:
|
4560
|
-
text:
|
4561
|
-
html:
|
4587
|
+
input: z64.object({
|
4588
|
+
subject: z64.string(),
|
4589
|
+
text: z64.string(),
|
4590
|
+
html: z64.string(),
|
4562
4591
|
from: MailParticipant,
|
4563
|
-
to:
|
4564
|
-
cc:
|
4565
|
-
bcc:
|
4566
|
-
reference:
|
4567
|
-
messageId:
|
4568
|
-
action:
|
4592
|
+
to: z64.array(MailParticipant),
|
4593
|
+
cc: z64.array(MailParticipant).optional(),
|
4594
|
+
bcc: z64.array(MailParticipant).optional(),
|
4595
|
+
reference: z64.object({
|
4596
|
+
messageId: z64.string(),
|
4597
|
+
action: z64.union([z64.literal("reply"), z64.literal("forward")])
|
4569
4598
|
}).optional(),
|
4570
|
-
attachments:
|
4571
|
-
|
4572
|
-
fileType:
|
4573
|
-
fileName:
|
4574
|
-
fileKey:
|
4575
|
-
fileSize:
|
4576
|
-
bucketName:
|
4577
|
-
presignedUrl:
|
4599
|
+
attachments: z64.array(
|
4600
|
+
z64.object({
|
4601
|
+
fileType: z64.string(),
|
4602
|
+
fileName: z64.string(),
|
4603
|
+
fileKey: z64.string(),
|
4604
|
+
fileSize: z64.number(),
|
4605
|
+
bucketName: z64.string(),
|
4606
|
+
presignedUrl: z64.string()
|
4578
4607
|
})
|
4579
4608
|
).optional()
|
4580
4609
|
}),
|
4581
|
-
output:
|
4582
|
-
response:
|
4583
|
-
messageId:
|
4584
|
-
sendAt:
|
4585
|
-
queueId:
|
4610
|
+
output: z64.object({
|
4611
|
+
response: z64.string(),
|
4612
|
+
messageId: z64.string(),
|
4613
|
+
sendAt: z64.string(),
|
4614
|
+
queueId: z64.string()
|
4586
4615
|
})
|
4587
4616
|
}
|
4588
4617
|
};
|
@@ -4607,8 +4636,8 @@ var messageContract = initContract21().router(
|
|
4607
4636
|
getById: {
|
4608
4637
|
method: "GET",
|
4609
4638
|
path: "/:id",
|
4610
|
-
pathParams:
|
4611
|
-
id:
|
4639
|
+
pathParams: z65.object({
|
4640
|
+
id: z65.string()
|
4612
4641
|
}),
|
4613
4642
|
responses: {
|
4614
4643
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -4635,7 +4664,7 @@ var mailContract = initContract22().router({
|
|
4635
4664
|
|
4636
4665
|
// src/messenger/index.ts
|
4637
4666
|
import { initContract as initContract23 } from "@ts-rest/core";
|
4638
|
-
import
|
4667
|
+
import z66 from "zod";
|
4639
4668
|
var messengerContract = initContract23().router({
|
4640
4669
|
sendMessage: {
|
4641
4670
|
method: "POST",
|
@@ -4669,8 +4698,8 @@ var messengerContract = initContract23().router({
|
|
4669
4698
|
reconnect: {
|
4670
4699
|
method: "POST",
|
4671
4700
|
path: "/reconnect/:channelId",
|
4672
|
-
pathParams:
|
4673
|
-
channelId:
|
4701
|
+
pathParams: z66.object({
|
4702
|
+
channelId: z66.string().uuid()
|
4674
4703
|
}),
|
4675
4704
|
body: null,
|
4676
4705
|
responses: {
|
@@ -4682,8 +4711,8 @@ var messengerContract = initContract23().router({
|
|
4682
4711
|
delete: {
|
4683
4712
|
method: "DELETE",
|
4684
4713
|
path: "/delete/:channelId",
|
4685
|
-
pathParams:
|
4686
|
-
channelId:
|
4714
|
+
pathParams: z66.object({
|
4715
|
+
channelId: z66.string().uuid()
|
4687
4716
|
}),
|
4688
4717
|
body: null,
|
4689
4718
|
responses: {
|
@@ -4715,7 +4744,7 @@ var messengerContract = initContract23().router({
|
|
4715
4744
|
|
4716
4745
|
// src/permission/index.ts
|
4717
4746
|
import { initContract as initContract24 } from "@ts-rest/core";
|
4718
|
-
import
|
4747
|
+
import z67 from "zod";
|
4719
4748
|
var permissionContract = initContract24().router(
|
4720
4749
|
{
|
4721
4750
|
getPermissions: {
|
@@ -4723,9 +4752,9 @@ var permissionContract = initContract24().router(
|
|
4723
4752
|
path: "",
|
4724
4753
|
headers: DefaultHeaderSchema,
|
4725
4754
|
responses: {
|
4726
|
-
200:
|
4727
|
-
400:
|
4728
|
-
message:
|
4755
|
+
200: z67.object({ permissions: PermissionSchema.array() }),
|
4756
|
+
400: z67.object({
|
4757
|
+
message: z67.string()
|
4729
4758
|
}),
|
4730
4759
|
401: DefaultUnauthorizedSchema,
|
4731
4760
|
500: DefaultErrorResponseSchema
|
@@ -4738,15 +4767,15 @@ var permissionContract = initContract24().router(
|
|
4738
4767
|
|
4739
4768
|
// src/role/index.ts
|
4740
4769
|
import { initContract as initContract25 } from "@ts-rest/core";
|
4741
|
-
import
|
4770
|
+
import z69 from "zod";
|
4742
4771
|
|
4743
4772
|
// src/role/validation.ts
|
4744
|
-
import { z as
|
4745
|
-
var CreateRoleSchema =
|
4746
|
-
systemName:
|
4747
|
-
displayName:
|
4748
|
-
description:
|
4749
|
-
permissions:
|
4773
|
+
import { z as z68 } from "zod";
|
4774
|
+
var CreateRoleSchema = z68.object({
|
4775
|
+
systemName: z68.string(),
|
4776
|
+
displayName: z68.string(),
|
4777
|
+
description: z68.string().nullable(),
|
4778
|
+
permissions: z68.array(z68.string())
|
4750
4779
|
});
|
4751
4780
|
var UpdateRoleSchema = CreateRoleSchema;
|
4752
4781
|
|
@@ -4762,8 +4791,8 @@ var roleContract = initContract25().router(
|
|
4762
4791
|
201: DefaultSuccessResponseSchema.extend({
|
4763
4792
|
role: RoleSchema
|
4764
4793
|
}),
|
4765
|
-
400:
|
4766
|
-
message:
|
4794
|
+
400: z69.object({
|
4795
|
+
message: z69.string()
|
4767
4796
|
}),
|
4768
4797
|
401: DefaultUnauthorizedSchema,
|
4769
4798
|
500: DefaultErrorResponseSchema
|
@@ -4773,15 +4802,15 @@ var roleContract = initContract25().router(
|
|
4773
4802
|
getRoles: {
|
4774
4803
|
method: "GET",
|
4775
4804
|
path: "",
|
4776
|
-
query:
|
4777
|
-
page:
|
4778
|
-
pageSize:
|
4805
|
+
query: z69.object({
|
4806
|
+
page: z69.coerce.number().default(1),
|
4807
|
+
pageSize: z69.coerce.number().default(10)
|
4779
4808
|
}).optional(),
|
4780
4809
|
headers: DefaultHeaderSchema,
|
4781
4810
|
responses: {
|
4782
4811
|
200: WithPagination(RoleSchema),
|
4783
|
-
400:
|
4784
|
-
message:
|
4812
|
+
400: z69.object({
|
4813
|
+
message: z69.string()
|
4785
4814
|
}),
|
4786
4815
|
401: DefaultUnauthorizedSchema,
|
4787
4816
|
500: DefaultErrorResponseSchema
|
@@ -4791,15 +4820,15 @@ var roleContract = initContract25().router(
|
|
4791
4820
|
updateRole: {
|
4792
4821
|
method: "PATCH",
|
4793
4822
|
path: "/:id",
|
4794
|
-
pathParams:
|
4823
|
+
pathParams: z69.object({ id: z69.string() }),
|
4795
4824
|
headers: DefaultHeaderSchema,
|
4796
4825
|
body: UpdateRoleSchema,
|
4797
4826
|
responses: {
|
4798
4827
|
201: DefaultSuccessResponseSchema.extend({
|
4799
4828
|
role: RoleSchema
|
4800
4829
|
}),
|
4801
|
-
400:
|
4802
|
-
message:
|
4830
|
+
400: z69.object({
|
4831
|
+
message: z69.string()
|
4803
4832
|
}),
|
4804
4833
|
401: DefaultUnauthorizedSchema,
|
4805
4834
|
500: DefaultErrorResponseSchema
|
@@ -4809,11 +4838,11 @@ var roleContract = initContract25().router(
|
|
4809
4838
|
deleteRole: {
|
4810
4839
|
method: "DELETE",
|
4811
4840
|
path: "/:id",
|
4812
|
-
pathParams:
|
4841
|
+
pathParams: z69.object({ id: z69.string() }),
|
4813
4842
|
headers: DefaultHeaderSchema,
|
4814
4843
|
body: null,
|
4815
4844
|
responses: {
|
4816
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
4845
|
+
200: DefaultSuccessResponseSchema.extend({ message: z69.string() }),
|
4817
4846
|
500: DefaultErrorResponseSchema
|
4818
4847
|
},
|
4819
4848
|
summary: "Delete a role."
|
@@ -4824,19 +4853,19 @@ var roleContract = initContract25().router(
|
|
4824
4853
|
|
4825
4854
|
// src/tag/index.ts
|
4826
4855
|
import { initContract as initContract26 } from "@ts-rest/core";
|
4827
|
-
import
|
4856
|
+
import z71 from "zod";
|
4828
4857
|
|
4829
4858
|
// src/tag/validation.ts
|
4830
|
-
import { z as
|
4831
|
-
var CreateTagSchema =
|
4832
|
-
name:
|
4859
|
+
import { z as z70 } from "zod";
|
4860
|
+
var CreateTagSchema = z70.object({
|
4861
|
+
name: z70.string(),
|
4833
4862
|
group: TagGroupSchema
|
4834
4863
|
});
|
4835
|
-
var GetTagsSchema =
|
4864
|
+
var GetTagsSchema = z70.object({
|
4836
4865
|
group: TagGroupSchema.default("general"),
|
4837
|
-
keyword:
|
4866
|
+
keyword: z70.string()
|
4838
4867
|
}).partial().optional();
|
4839
|
-
var UpdateTagSchema =
|
4868
|
+
var UpdateTagSchema = z70.object({ name: z70.string() });
|
4840
4869
|
|
4841
4870
|
// src/tag/index.ts
|
4842
4871
|
var tagContract = initContract26().router(
|
@@ -4859,7 +4888,7 @@ var tagContract = initContract26().router(
|
|
4859
4888
|
query: GetTagsSchema,
|
4860
4889
|
responses: {
|
4861
4890
|
200: DefaultSuccessResponseSchema.extend({
|
4862
|
-
tags:
|
4891
|
+
tags: z71.array(TagSchema)
|
4863
4892
|
}),
|
4864
4893
|
500: DefaultErrorResponseSchema
|
4865
4894
|
},
|
@@ -4868,7 +4897,7 @@ var tagContract = initContract26().router(
|
|
4868
4897
|
updateTag: {
|
4869
4898
|
method: "PATCH",
|
4870
4899
|
path: "/:id",
|
4871
|
-
pathParams:
|
4900
|
+
pathParams: z71.object({ id: z71.string() }),
|
4872
4901
|
body: UpdateTagSchema,
|
4873
4902
|
responses: {
|
4874
4903
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -4881,11 +4910,11 @@ var tagContract = initContract26().router(
|
|
4881
4910
|
deleteTag: {
|
4882
4911
|
method: "DELETE",
|
4883
4912
|
path: "/:id",
|
4884
|
-
pathParams:
|
4885
|
-
body:
|
4913
|
+
pathParams: z71.object({ id: z71.string() }),
|
4914
|
+
body: z71.any().optional(),
|
4886
4915
|
// We don't need the body.
|
4887
4916
|
responses: {
|
4888
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
4917
|
+
200: DefaultSuccessResponseSchema.extend({ message: z71.string() }),
|
4889
4918
|
500: DefaultErrorResponseSchema
|
4890
4919
|
},
|
4891
4920
|
headers: DefaultHeaderSchema
|
@@ -4898,27 +4927,27 @@ var tagContract = initContract26().router(
|
|
4898
4927
|
|
4899
4928
|
// src/telephony-agent-presence-status/index.ts
|
4900
4929
|
import { initContract as initContract27 } from "@ts-rest/core";
|
4901
|
-
import
|
4930
|
+
import z74 from "zod";
|
4902
4931
|
|
4903
4932
|
// src/telephony-agent-presence-status/schema.ts
|
4904
|
-
import
|
4933
|
+
import z72 from "zod";
|
4905
4934
|
var PresenceStatusSchema = DefaultEntitySchema.extend({
|
4906
|
-
status:
|
4907
|
-
description:
|
4935
|
+
status: z72.string(),
|
4936
|
+
description: z72.string()
|
4908
4937
|
});
|
4909
4938
|
var UserPresenceStatusSchema = DefaultEntitySchema.extend({
|
4910
4939
|
user: UserSchema,
|
4911
4940
|
presenceStatus: PresenceStatusSchema,
|
4912
|
-
customPresenceStatus:
|
4941
|
+
customPresenceStatus: z72.string().nullable().optional()
|
4913
4942
|
});
|
4914
4943
|
|
4915
4944
|
// src/telephony-agent-presence-status/validation.ts
|
4916
|
-
import { z as
|
4917
|
-
var UpdateUserStatusSchema =
|
4918
|
-
userId:
|
4919
|
-
presenceStatusId:
|
4920
|
-
customPreseneStatus:
|
4921
|
-
reason:
|
4945
|
+
import { z as z73 } from "zod";
|
4946
|
+
var UpdateUserStatusSchema = z73.object({
|
4947
|
+
userId: z73.string(),
|
4948
|
+
presenceStatusId: z73.string().nullable().optional(),
|
4949
|
+
customPreseneStatus: z73.string().nullable().optional(),
|
4950
|
+
reason: z73.string()
|
4922
4951
|
});
|
4923
4952
|
|
4924
4953
|
// src/telephony-agent-presence-status/index.ts
|
@@ -4929,9 +4958,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4929
4958
|
path: "/presence_status",
|
4930
4959
|
headers: DefaultHeaderSchema,
|
4931
4960
|
responses: {
|
4932
|
-
200:
|
4933
|
-
400:
|
4934
|
-
message:
|
4961
|
+
200: z74.array(PresenceStatusSchema),
|
4962
|
+
400: z74.object({
|
4963
|
+
message: z74.string()
|
4935
4964
|
}),
|
4936
4965
|
401: DefaultUnauthorizedSchema,
|
4937
4966
|
500: DefaultErrorResponseSchema
|
@@ -4943,9 +4972,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4943
4972
|
path: "/agents/presence_status",
|
4944
4973
|
headers: DefaultHeaderSchema,
|
4945
4974
|
responses: {
|
4946
|
-
200:
|
4947
|
-
400:
|
4948
|
-
message:
|
4975
|
+
200: z74.array(UserPresenceStatusSchema),
|
4976
|
+
400: z74.object({
|
4977
|
+
message: z74.string()
|
4949
4978
|
}),
|
4950
4979
|
401: DefaultUnauthorizedSchema,
|
4951
4980
|
500: DefaultErrorResponseSchema
|
@@ -4955,12 +4984,12 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4955
4984
|
getAgentStatus: {
|
4956
4985
|
method: "GET",
|
4957
4986
|
path: "/presence_status/check_update/:userId",
|
4958
|
-
pathParams:
|
4987
|
+
pathParams: z74.object({ userId: z74.string() }),
|
4959
4988
|
headers: DefaultHeaderSchema,
|
4960
4989
|
responses: {
|
4961
4990
|
200: UserPresenceStatusSchema,
|
4962
|
-
400:
|
4963
|
-
message:
|
4991
|
+
400: z74.object({
|
4992
|
+
message: z74.string()
|
4964
4993
|
}),
|
4965
4994
|
401: DefaultUnauthorizedSchema,
|
4966
4995
|
500: DefaultErrorResponseSchema
|
@@ -4976,8 +5005,8 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4976
5005
|
200: DefaultSuccessResponseSchema.extend({
|
4977
5006
|
userPresenceStatu: UserPresenceStatusSchema
|
4978
5007
|
}),
|
4979
|
-
400:
|
4980
|
-
message:
|
5008
|
+
400: z74.object({
|
5009
|
+
message: z74.string()
|
4981
5010
|
}),
|
4982
5011
|
401: DefaultUnauthorizedSchema,
|
4983
5012
|
500: DefaultErrorResponseSchema
|
@@ -4989,60 +5018,62 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4989
5018
|
);
|
4990
5019
|
|
4991
5020
|
// src/telephony-cdr/index.ts
|
4992
|
-
import
|
5021
|
+
import z77 from "zod";
|
4993
5022
|
|
4994
5023
|
// src/telephony-cdr/validation.ts
|
4995
|
-
import
|
4996
|
-
var CreateTelephonyCdrSchema =
|
4997
|
-
uniqueCallId:
|
4998
|
-
timeStart:
|
4999
|
-
callFrom:
|
5000
|
-
callTo:
|
5001
|
-
callDuration:
|
5002
|
-
talkDuration:
|
5003
|
-
srcTrunkName:
|
5004
|
-
dstTrunkName:
|
5005
|
-
pinCode:
|
5006
|
-
status:
|
5007
|
-
type:
|
5008
|
-
recording:
|
5009
|
-
didNumber:
|
5010
|
-
agentRingTime:
|
5024
|
+
import z75 from "zod";
|
5025
|
+
var CreateTelephonyCdrSchema = z75.object({
|
5026
|
+
uniqueCallId: z75.string({ required_error: "uniqueCallId is required" }),
|
5027
|
+
timeStart: z75.string({ required_error: "timeStart is required" }),
|
5028
|
+
callFrom: z75.string({ required_error: "callFrom is required" }),
|
5029
|
+
callTo: z75.string({ required_error: "callTo is required" }),
|
5030
|
+
callDuration: z75.number().nullable(),
|
5031
|
+
talkDuration: z75.number().nullable(),
|
5032
|
+
srcTrunkName: z75.string().nullable(),
|
5033
|
+
dstTrunkName: z75.string().nullable(),
|
5034
|
+
pinCode: z75.string().nullable(),
|
5035
|
+
status: z75.string(),
|
5036
|
+
type: z75.string(),
|
5037
|
+
recording: z75.string().nullable(),
|
5038
|
+
didNumber: z75.string().nullable(),
|
5039
|
+
agentRingTime: z75.number().nullable()
|
5011
5040
|
});
|
5012
5041
|
var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5013
|
-
selectedDate:
|
5014
|
-
type:
|
5015
|
-
status:
|
5016
|
-
callFrom:
|
5017
|
-
callTo:
|
5018
|
-
trunk:
|
5019
|
-
userId:
|
5020
|
-
queueStatus:
|
5042
|
+
selectedDate: z75.string().optional(),
|
5043
|
+
type: z75.array(z75.string()).optional(),
|
5044
|
+
status: z75.array(z75.string()).optional(),
|
5045
|
+
callFrom: z75.string().optional(),
|
5046
|
+
callTo: z75.string().optional(),
|
5047
|
+
trunk: z75.array(z75.string()).optional(),
|
5048
|
+
userId: z75.string().uuid().optional(),
|
5049
|
+
queueStatus: z75.string().optional(),
|
5050
|
+
agentIds: z75.array(z75.string().uuid()).optional(),
|
5051
|
+
agentCallsOnly: z75.coerce.boolean().optional()
|
5021
5052
|
});
|
5022
5053
|
var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5023
|
-
type:
|
5024
|
-
status:
|
5025
|
-
callFrom:
|
5026
|
-
callTo:
|
5027
|
-
result:
|
5028
|
-
callTags:
|
5029
|
-
selectedDate:
|
5030
|
-
agentId:
|
5031
|
-
contact:
|
5032
|
-
callStatus:
|
5033
|
-
queueIds:
|
5034
|
-
notes:
|
5054
|
+
type: z75.array(z75.string()).optional(),
|
5055
|
+
status: z75.array(z75.string()).optional(),
|
5056
|
+
callFrom: z75.string().optional(),
|
5057
|
+
callTo: z75.string().optional(),
|
5058
|
+
result: z75.array(z75.string()).optional(),
|
5059
|
+
callTags: z75.array(z75.string()).optional(),
|
5060
|
+
selectedDate: z75.string().optional(),
|
5061
|
+
agentId: z75.string().optional(),
|
5062
|
+
contact: z75.array(z75.string()).optional(),
|
5063
|
+
callStatus: z75.array(z75.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
|
5064
|
+
queueIds: z75.array(z75.string()).optional(),
|
5065
|
+
notes: z75.string().optional()
|
5035
5066
|
});
|
5036
5067
|
var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
|
5037
|
-
|
5038
|
-
page:
|
5039
|
-
pageSize:
|
5068
|
+
z75.object({
|
5069
|
+
page: z75.coerce.number().positive().optional(),
|
5070
|
+
pageSize: z75.coerce.number().positive().optional()
|
5040
5071
|
})
|
5041
5072
|
);
|
5042
5073
|
var NullEmptyStringUndefined = ["", null, void 0];
|
5043
5074
|
var EmtptyArrayUndefined = [[], void 0];
|
5044
5075
|
var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
5045
|
-
reportType:
|
5076
|
+
reportType: z75.enum([
|
5046
5077
|
"extcallstatistics",
|
5047
5078
|
"extcallactivity",
|
5048
5079
|
"trunkactivity",
|
@@ -5052,52 +5083,52 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
5052
5083
|
"queueagentmisscalls",
|
5053
5084
|
"queueagentinoutcalls"
|
5054
5085
|
]),
|
5055
|
-
selectedDate:
|
5056
|
-
communicationType:
|
5057
|
-
time:
|
5058
|
-
queueList:
|
5059
|
-
queueId:
|
5060
|
-
trunkList:
|
5061
|
-
extensionList:
|
5086
|
+
selectedDate: z75.string().optional(),
|
5087
|
+
communicationType: z75.union([z75.literal("Inbound"), z75.literal("Outbound"), z75.literal("Internal")]).optional(),
|
5088
|
+
time: z75.string().optional(),
|
5089
|
+
queueList: z75.array(z75.string()).optional(),
|
5090
|
+
queueId: z75.string().optional(),
|
5091
|
+
trunkList: z75.array(z75.string()).optional(),
|
5092
|
+
extensionList: z75.array(z75.string()).optional()
|
5062
5093
|
}).superRefine((input, ctx) => {
|
5063
5094
|
if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
|
5064
5095
|
ctx.addIssue({
|
5065
|
-
code:
|
5096
|
+
code: z75.ZodIssueCode.custom,
|
5066
5097
|
path: ["selectedDate"],
|
5067
5098
|
message: "selectedDate is required."
|
5068
5099
|
});
|
5069
5100
|
}
|
5070
5101
|
if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
|
5071
5102
|
ctx.addIssue({
|
5072
|
-
code:
|
5103
|
+
code: z75.ZodIssueCode.custom,
|
5073
5104
|
path: ["time"],
|
5074
5105
|
message: "time is required."
|
5075
5106
|
});
|
5076
5107
|
}
|
5077
5108
|
if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
|
5078
5109
|
ctx.addIssue({
|
5079
|
-
code:
|
5110
|
+
code: z75.ZodIssueCode.custom,
|
5080
5111
|
path: ["queueList"],
|
5081
5112
|
message: "queueList is required."
|
5082
5113
|
});
|
5083
5114
|
}
|
5084
5115
|
if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
|
5085
5116
|
ctx.addIssue({
|
5086
|
-
code:
|
5117
|
+
code: z75.ZodIssueCode.custom,
|
5087
5118
|
path: ["queueId"],
|
5088
5119
|
message: "queueId is required."
|
5089
5120
|
});
|
5090
5121
|
}
|
5091
5122
|
if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
|
5092
5123
|
ctx.addIssue({
|
5093
|
-
code:
|
5124
|
+
code: z75.ZodIssueCode.custom,
|
5094
5125
|
path: ["trunkList"],
|
5095
5126
|
message: "trunkList is required."
|
5096
5127
|
});
|
5097
5128
|
}
|
5098
5129
|
if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
|
5099
5130
|
ctx.addIssue({
|
5100
|
-
code:
|
5131
|
+
code: z75.ZodIssueCode.custom,
|
5101
5132
|
path: ["extensionList"],
|
5102
5133
|
message: "extensionList is required."
|
5103
5134
|
});
|
@@ -5108,161 +5139,161 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
5108
5139
|
import { initContract as initContract28 } from "@ts-rest/core";
|
5109
5140
|
|
5110
5141
|
// src/telephony-cdr/call-report.schema.ts
|
5111
|
-
import
|
5112
|
-
var ExtCallStatisticsListSchema =
|
5142
|
+
import z76 from "zod";
|
5143
|
+
var ExtCallStatisticsListSchema = z76.object({
|
5113
5144
|
/** @example "ext_num" */
|
5114
|
-
ext_num:
|
5145
|
+
ext_num: z76.string(),
|
5115
5146
|
/** @example "ext_name" */
|
5116
|
-
ext_name:
|
5147
|
+
ext_name: z76.string(),
|
5117
5148
|
/** @example 0 */
|
5118
|
-
answered_calls:
|
5149
|
+
answered_calls: z76.number(),
|
5119
5150
|
/** @example 0 */
|
5120
|
-
no_answer_calls:
|
5151
|
+
no_answer_calls: z76.number(),
|
5121
5152
|
/** @example 0 */
|
5122
|
-
busy_calls:
|
5153
|
+
busy_calls: z76.number(),
|
5123
5154
|
/** @example 0 */
|
5124
|
-
failed_calls:
|
5155
|
+
failed_calls: z76.number(),
|
5125
5156
|
/** @example 0 */
|
5126
|
-
voicemail_calls:
|
5157
|
+
voicemail_calls: z76.number(),
|
5127
5158
|
/** @example 0 */
|
5128
|
-
total_holding_time:
|
5159
|
+
total_holding_time: z76.number(),
|
5129
5160
|
/** @example 0 */
|
5130
|
-
total_talking_time:
|
5161
|
+
total_talking_time: z76.number(),
|
5131
5162
|
/** @example "src_name" */
|
5132
|
-
src_name:
|
5163
|
+
src_name: z76.string(),
|
5133
5164
|
/** @example 0 */
|
5134
|
-
total_call_count:
|
5165
|
+
total_call_count: z76.number(),
|
5135
5166
|
/** @example "mobile" */
|
5136
|
-
mobile:
|
5137
|
-
});
|
5138
|
-
var ExtStatisticSchema =
|
5139
|
-
ext_num:
|
5140
|
-
ext_name:
|
5141
|
-
answered_calls:
|
5142
|
-
no_answer_calls:
|
5143
|
-
busy_calls:
|
5144
|
-
failed_calls:
|
5145
|
-
voicemail_calls:
|
5146
|
-
total_holding_time:
|
5147
|
-
total_talking_time:
|
5148
|
-
time:
|
5149
|
-
mobile:
|
5150
|
-
});
|
5151
|
-
var ExtCallActivityListSchema =
|
5152
|
-
time:
|
5153
|
-
answered_calls:
|
5154
|
-
no_answer_calls:
|
5155
|
-
busy_calls:
|
5156
|
-
failed_calls:
|
5157
|
-
voicemail_calls:
|
5158
|
-
total_holding_time:
|
5159
|
-
total_talking_time:
|
5160
|
-
ext_statistics:
|
5161
|
-
});
|
5162
|
-
var TrunkList =
|
5163
|
-
trunk_name:
|
5164
|
-
total_calls:
|
5165
|
-
});
|
5166
|
-
var TrunkActivityListSchema =
|
5167
|
-
time:
|
5168
|
-
trunk_list:
|
5169
|
-
});
|
5170
|
-
var QueueAvgWaitTalkTimeListSchema =
|
5171
|
-
time:
|
5172
|
-
avg_wait_time:
|
5173
|
-
avg_talk_time:
|
5174
|
-
});
|
5175
|
-
var SatisfactionListSchema =
|
5176
|
-
press_key:
|
5177
|
-
total:
|
5178
|
-
key_point:
|
5179
|
-
});
|
5180
|
-
var agentListSchema =
|
5181
|
-
agent_name:
|
5182
|
-
agent_num:
|
5183
|
-
satisfaction_list:
|
5184
|
-
total_key:
|
5185
|
-
total_point:
|
5186
|
-
average_point:
|
5187
|
-
});
|
5188
|
-
var QueueSatisfactionSchema =
|
5189
|
-
queue_name:
|
5190
|
-
queue_num:
|
5191
|
-
satisfaction_list:
|
5192
|
-
agent_list:
|
5193
|
-
total_key:
|
5194
|
-
total_point:
|
5195
|
-
average_point:
|
5196
|
-
});
|
5197
|
-
var QueuePerformanceListSchema =
|
5198
|
-
queue:
|
5199
|
-
total_calls:
|
5200
|
-
answered_calls:
|
5201
|
-
missed_calls:
|
5202
|
-
abandoned_calls:
|
5203
|
-
average_waiting_time:
|
5204
|
-
average_talking_time:
|
5205
|
-
max_waiting_time:
|
5206
|
-
answered_rate:
|
5207
|
-
missed_rate:
|
5208
|
-
abandoned_rate:
|
5209
|
-
sla:
|
5210
|
-
});
|
5211
|
-
var QueueAgentMissCallsListSchema =
|
5212
|
-
agent_name:
|
5213
|
-
agent_num:
|
5214
|
-
time:
|
5215
|
-
total_wait_time:
|
5216
|
-
src_name:
|
5217
|
-
src_num:
|
5218
|
-
queue_status:
|
5219
|
-
polling_attempts:
|
5220
|
-
missed_reason:
|
5221
|
-
});
|
5222
|
-
var QueueAgentInOutCallsListSchema =
|
5223
|
-
agent_name:
|
5224
|
-
agent_num:
|
5225
|
-
inbound_calls:
|
5226
|
-
inbound_duration:
|
5227
|
-
outbound_calls:
|
5228
|
-
outbound_duration:
|
5229
|
-
total_calls:
|
5230
|
-
total_duration:
|
5231
|
-
average_talk_duration:
|
5232
|
-
});
|
5233
|
-
var CallReportModel =
|
5234
|
-
errcode:
|
5235
|
-
errmsg:
|
5236
|
-
total_number:
|
5237
|
-
is_12hour:
|
5238
|
-
ext_call_statistics_list:
|
5239
|
-
ext_call_activity_list:
|
5240
|
-
trunk_activity_list:
|
5241
|
-
queue_avg_wait_talk_time_list:
|
5167
|
+
mobile: z76.string()
|
5168
|
+
});
|
5169
|
+
var ExtStatisticSchema = z76.object({
|
5170
|
+
ext_num: z76.string(),
|
5171
|
+
ext_name: z76.string(),
|
5172
|
+
answered_calls: z76.number(),
|
5173
|
+
no_answer_calls: z76.number(),
|
5174
|
+
busy_calls: z76.number(),
|
5175
|
+
failed_calls: z76.number(),
|
5176
|
+
voicemail_calls: z76.number(),
|
5177
|
+
total_holding_time: z76.number(),
|
5178
|
+
total_talking_time: z76.number(),
|
5179
|
+
time: z76.number(),
|
5180
|
+
mobile: z76.string()
|
5181
|
+
});
|
5182
|
+
var ExtCallActivityListSchema = z76.object({
|
5183
|
+
time: z76.number(),
|
5184
|
+
answered_calls: z76.number(),
|
5185
|
+
no_answer_calls: z76.number(),
|
5186
|
+
busy_calls: z76.number(),
|
5187
|
+
failed_calls: z76.number(),
|
5188
|
+
voicemail_calls: z76.number(),
|
5189
|
+
total_holding_time: z76.number(),
|
5190
|
+
total_talking_time: z76.number(),
|
5191
|
+
ext_statistics: z76.array(ExtStatisticSchema)
|
5192
|
+
});
|
5193
|
+
var TrunkList = z76.object({
|
5194
|
+
trunk_name: z76.string(),
|
5195
|
+
total_calls: z76.number()
|
5196
|
+
});
|
5197
|
+
var TrunkActivityListSchema = z76.object({
|
5198
|
+
time: z76.number(),
|
5199
|
+
trunk_list: z76.array(TrunkList)
|
5200
|
+
});
|
5201
|
+
var QueueAvgWaitTalkTimeListSchema = z76.object({
|
5202
|
+
time: z76.number(),
|
5203
|
+
avg_wait_time: z76.number(),
|
5204
|
+
avg_talk_time: z76.number()
|
5205
|
+
});
|
5206
|
+
var SatisfactionListSchema = z76.object({
|
5207
|
+
press_key: z76.string(),
|
5208
|
+
total: z76.number(),
|
5209
|
+
key_point: z76.number().optional()
|
5210
|
+
});
|
5211
|
+
var agentListSchema = z76.object({
|
5212
|
+
agent_name: z76.string(),
|
5213
|
+
agent_num: z76.string(),
|
5214
|
+
satisfaction_list: z76.array(SatisfactionListSchema).optional(),
|
5215
|
+
total_key: z76.number().optional(),
|
5216
|
+
total_point: z76.number().optional(),
|
5217
|
+
average_point: z76.number().optional()
|
5218
|
+
});
|
5219
|
+
var QueueSatisfactionSchema = z76.object({
|
5220
|
+
queue_name: z76.string(),
|
5221
|
+
queue_num: z76.string(),
|
5222
|
+
satisfaction_list: z76.array(SatisfactionListSchema).optional(),
|
5223
|
+
agent_list: z76.array(agentListSchema).optional(),
|
5224
|
+
total_key: z76.number().optional(),
|
5225
|
+
total_point: z76.number().optional(),
|
5226
|
+
average_point: z76.number().optional()
|
5227
|
+
});
|
5228
|
+
var QueuePerformanceListSchema = z76.object({
|
5229
|
+
queue: z76.string(),
|
5230
|
+
total_calls: z76.number(),
|
5231
|
+
answered_calls: z76.number(),
|
5232
|
+
missed_calls: z76.number(),
|
5233
|
+
abandoned_calls: z76.number(),
|
5234
|
+
average_waiting_time: z76.number(),
|
5235
|
+
average_talking_time: z76.number(),
|
5236
|
+
max_waiting_time: z76.number(),
|
5237
|
+
answered_rate: z76.number(),
|
5238
|
+
missed_rate: z76.number(),
|
5239
|
+
abandoned_rate: z76.number(),
|
5240
|
+
sla: z76.number()
|
5241
|
+
});
|
5242
|
+
var QueueAgentMissCallsListSchema = z76.object({
|
5243
|
+
agent_name: z76.string(),
|
5244
|
+
agent_num: z76.string(),
|
5245
|
+
time: z76.string(),
|
5246
|
+
total_wait_time: z76.number(),
|
5247
|
+
src_name: z76.string(),
|
5248
|
+
src_num: z76.string(),
|
5249
|
+
queue_status: z76.string(),
|
5250
|
+
polling_attempts: z76.number(),
|
5251
|
+
missed_reason: z76.string()
|
5252
|
+
});
|
5253
|
+
var QueueAgentInOutCallsListSchema = z76.object({
|
5254
|
+
agent_name: z76.string(),
|
5255
|
+
agent_num: z76.string(),
|
5256
|
+
inbound_calls: z76.number(),
|
5257
|
+
inbound_duration: z76.number(),
|
5258
|
+
outbound_calls: z76.number(),
|
5259
|
+
outbound_duration: z76.number(),
|
5260
|
+
total_calls: z76.number(),
|
5261
|
+
total_duration: z76.number(),
|
5262
|
+
average_talk_duration: z76.number()
|
5263
|
+
});
|
5264
|
+
var CallReportModel = z76.object({
|
5265
|
+
errcode: z76.number(),
|
5266
|
+
errmsg: z76.string(),
|
5267
|
+
total_number: z76.number(),
|
5268
|
+
is_12hour: z76.number().optional(),
|
5269
|
+
ext_call_statistics_list: z76.array(ExtCallStatisticsListSchema).optional(),
|
5270
|
+
ext_call_activity_list: z76.array(ExtCallActivityListSchema).optional(),
|
5271
|
+
trunk_activity_list: z76.array(TrunkActivityListSchema).optional(),
|
5272
|
+
queue_avg_wait_talk_time_list: z76.array(QueueAvgWaitTalkTimeListSchema).optional(),
|
5242
5273
|
queue_satisfaction: QueueSatisfactionSchema.optional(),
|
5243
|
-
queue_performance_list:
|
5244
|
-
queue_agent_miss_calls_list:
|
5245
|
-
queue_agent_in_out_calls_list:
|
5246
|
-
callback_result:
|
5247
|
-
page:
|
5248
|
-
pageSize:
|
5249
|
-
});
|
5250
|
-
var CallReportSchema =
|
5251
|
-
errcode:
|
5252
|
-
errmsg:
|
5253
|
-
total_number:
|
5254
|
-
is_12hour:
|
5255
|
-
ext_call_statistics_list:
|
5256
|
-
ext_call_activity_list:
|
5257
|
-
trunk_activity_list:
|
5258
|
-
queue_avg_wait_talk_time_list:
|
5274
|
+
queue_performance_list: z76.array(QueuePerformanceListSchema).optional(),
|
5275
|
+
queue_agent_miss_calls_list: z76.array(QueueAgentMissCallsListSchema).optional(),
|
5276
|
+
queue_agent_in_out_calls_list: z76.array(QueueAgentInOutCallsListSchema).optional(),
|
5277
|
+
callback_result: z76.string(),
|
5278
|
+
page: z76.number().optional(),
|
5279
|
+
pageSize: z76.number().optional()
|
5280
|
+
});
|
5281
|
+
var CallReportSchema = z76.object({
|
5282
|
+
errcode: z76.number(),
|
5283
|
+
errmsg: z76.string(),
|
5284
|
+
total_number: z76.number(),
|
5285
|
+
is_12hour: z76.number().optional(),
|
5286
|
+
ext_call_statistics_list: z76.array(ExtCallStatisticsListSchema).optional(),
|
5287
|
+
ext_call_activity_list: z76.array(ExtCallActivityListSchema).optional(),
|
5288
|
+
trunk_activity_list: z76.array(TrunkActivityListSchema).optional(),
|
5289
|
+
queue_avg_wait_talk_time_list: z76.array(QueueAvgWaitTalkTimeListSchema).optional(),
|
5259
5290
|
queue_satisfaction: QueueSatisfactionSchema.optional(),
|
5260
|
-
queue_performance_list:
|
5261
|
-
queue_agent_miss_calls_list:
|
5262
|
-
queue_agent_in_out_calls_list:
|
5263
|
-
callback_result:
|
5264
|
-
page:
|
5265
|
-
pageSize:
|
5291
|
+
queue_performance_list: z76.array(QueuePerformanceListSchema).optional(),
|
5292
|
+
queue_agent_miss_calls_list: z76.array(QueueAgentMissCallsListSchema).optional(),
|
5293
|
+
queue_agent_in_out_calls_list: z76.array(QueueAgentInOutCallsListSchema).optional(),
|
5294
|
+
callback_result: z76.string(),
|
5295
|
+
page: z76.number().optional(),
|
5296
|
+
pageSize: z76.number().optional()
|
5266
5297
|
});
|
5267
5298
|
|
5268
5299
|
// src/telephony-cdr/index.ts
|
@@ -5275,10 +5306,10 @@ var telephonyCdrContract = initContract28().router(
|
|
5275
5306
|
query: GetAllTelephonyCdrSchema,
|
5276
5307
|
responses: {
|
5277
5308
|
200: DefaultSuccessResponseSchema.extend({
|
5278
|
-
total:
|
5279
|
-
page:
|
5280
|
-
pageSize:
|
5281
|
-
telephonyCdrs:
|
5309
|
+
total: z77.number(),
|
5310
|
+
page: z77.number(),
|
5311
|
+
pageSize: z77.number(),
|
5312
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
5282
5313
|
}),
|
5283
5314
|
401: DefaultUnauthorizedSchema
|
5284
5315
|
},
|
@@ -5291,10 +5322,10 @@ var telephonyCdrContract = initContract28().router(
|
|
5291
5322
|
query: GetAllTelephonyCdrSchema,
|
5292
5323
|
responses: {
|
5293
5324
|
200: DefaultSuccessResponseSchema.extend({
|
5294
|
-
total:
|
5295
|
-
page:
|
5296
|
-
pageSize:
|
5297
|
-
telephonyCdrs:
|
5325
|
+
total: z77.number(),
|
5326
|
+
page: z77.number(),
|
5327
|
+
pageSize: z77.number(),
|
5328
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
5298
5329
|
}),
|
5299
5330
|
401: DefaultUnauthorizedSchema
|
5300
5331
|
},
|
@@ -5307,10 +5338,10 @@ var telephonyCdrContract = initContract28().router(
|
|
5307
5338
|
query: GetRecentTelephonyCdrSchema,
|
5308
5339
|
responses: {
|
5309
5340
|
200: DefaultSuccessResponseSchema.extend({
|
5310
|
-
total:
|
5311
|
-
page:
|
5312
|
-
pageSize:
|
5313
|
-
telephonyCdrs:
|
5341
|
+
total: z77.number(),
|
5342
|
+
page: z77.number(),
|
5343
|
+
pageSize: z77.number(),
|
5344
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
5314
5345
|
}),
|
5315
5346
|
401: DefaultUnauthorizedSchema
|
5316
5347
|
},
|
@@ -5402,35 +5433,35 @@ var telephonyCdrContract = initContract28().router(
|
|
5402
5433
|
|
5403
5434
|
// src/telephony-extension/index.ts
|
5404
5435
|
import { initContract as initContract29 } from "@ts-rest/core";
|
5405
|
-
import
|
5436
|
+
import z79 from "zod";
|
5406
5437
|
|
5407
5438
|
// src/telephony-extension/schema.ts
|
5408
|
-
import
|
5409
|
-
var TelephonyExtensionSchema3 =
|
5410
|
-
errcode:
|
5411
|
-
errmsg:
|
5412
|
-
total_number:
|
5413
|
-
data:
|
5414
|
-
|
5415
|
-
id:
|
5416
|
-
online_status:
|
5417
|
-
fx_phone:
|
5418
|
-
sip_phone:
|
5419
|
-
status:
|
5420
|
-
ext_dev_type:
|
5421
|
-
}),
|
5422
|
-
linkus_desktop:
|
5423
|
-
linkus_mobile:
|
5424
|
-
linkus_web:
|
5425
|
-
status:
|
5426
|
-
ext_dev_type:
|
5439
|
+
import z78 from "zod";
|
5440
|
+
var TelephonyExtensionSchema3 = z78.object({
|
5441
|
+
errcode: z78.coerce.number(),
|
5442
|
+
errmsg: z78.string(),
|
5443
|
+
total_number: z78.coerce.number(),
|
5444
|
+
data: z78.array(
|
5445
|
+
z78.object({
|
5446
|
+
id: z78.coerce.number(),
|
5447
|
+
online_status: z78.object({
|
5448
|
+
fx_phone: z78.object({ status: z78.coerce.number() }),
|
5449
|
+
sip_phone: z78.object({
|
5450
|
+
status: z78.coerce.number(),
|
5451
|
+
ext_dev_type: z78.string().optional()
|
5452
|
+
}),
|
5453
|
+
linkus_desktop: z78.object({ status: z78.coerce.number() }),
|
5454
|
+
linkus_mobile: z78.object({ status: z78.coerce.number() }),
|
5455
|
+
linkus_web: z78.object({
|
5456
|
+
status: z78.coerce.number(),
|
5457
|
+
ext_dev_type: z78.string().optional()
|
5427
5458
|
})
|
5428
5459
|
}).optional(),
|
5429
|
-
presence_status:
|
5430
|
-
number:
|
5431
|
-
caller_id_name:
|
5432
|
-
role_name:
|
5433
|
-
email_addr:
|
5460
|
+
presence_status: z78.string().optional(),
|
5461
|
+
number: z78.string().optional(),
|
5462
|
+
caller_id_name: z78.string().optional(),
|
5463
|
+
role_name: z78.string().optional(),
|
5464
|
+
email_addr: z78.string().optional()
|
5434
5465
|
})
|
5435
5466
|
)
|
5436
5467
|
});
|
@@ -5445,8 +5476,8 @@ var telephonyExtensionContract = initContract29().router(
|
|
5445
5476
|
query: null,
|
5446
5477
|
responses: {
|
5447
5478
|
200: TelephonyExtensionSchema3,
|
5448
|
-
400:
|
5449
|
-
message:
|
5479
|
+
400: z79.object({
|
5480
|
+
message: z79.string()
|
5450
5481
|
}),
|
5451
5482
|
401: DefaultUnauthorizedSchema,
|
5452
5483
|
500: DefaultErrorResponseSchema
|
@@ -5459,10 +5490,10 @@ var telephonyExtensionContract = initContract29().router(
|
|
5459
5490
|
|
5460
5491
|
// src/ticket/index.ts
|
5461
5492
|
import { initContract as initContract30 } from "@ts-rest/core";
|
5462
|
-
import
|
5493
|
+
import z81 from "zod";
|
5463
5494
|
|
5464
5495
|
// src/ticket/validation.ts
|
5465
|
-
import
|
5496
|
+
import z80 from "zod";
|
5466
5497
|
var addErrorMessage2 = (field) => {
|
5467
5498
|
return field.refine(
|
5468
5499
|
({ isRequired, value }) => {
|
@@ -5480,106 +5511,106 @@ var addErrorMessage2 = (field) => {
|
|
5480
5511
|
}
|
5481
5512
|
);
|
5482
5513
|
};
|
5483
|
-
var BaseSchema3 =
|
5484
|
-
isRequired:
|
5485
|
-
attributeId:
|
5514
|
+
var BaseSchema3 = z80.object({
|
5515
|
+
isRequired: z80.boolean(),
|
5516
|
+
attributeId: z80.string()
|
5486
5517
|
});
|
5487
5518
|
var SingleValue2 = addErrorMessage2(
|
5488
5519
|
BaseSchema3.extend({
|
5489
|
-
value:
|
5520
|
+
value: z80.string()
|
5490
5521
|
})
|
5491
5522
|
);
|
5492
|
-
var CreateTicketValidationSchema =
|
5523
|
+
var CreateTicketValidationSchema = z80.object({
|
5493
5524
|
title: SingleValue2,
|
5494
5525
|
description: SingleValue2,
|
5495
5526
|
status: SingleValue2,
|
5496
5527
|
type: SingleValue2,
|
5497
5528
|
priority: SingleValue2,
|
5498
5529
|
contact: SingleValue2,
|
5499
|
-
assignee:
|
5500
|
-
isRequired:
|
5501
|
-
attributeId:
|
5502
|
-
value:
|
5530
|
+
assignee: z80.object({
|
5531
|
+
isRequired: z80.boolean(),
|
5532
|
+
attributeId: z80.string(),
|
5533
|
+
value: z80.string()
|
5503
5534
|
}),
|
5504
5535
|
channel: SingleValue2,
|
5505
|
-
tags: addErrorMessage2(BaseSchema3.extend({ value:
|
5506
|
-
categories: BaseSchema3.extend({ value:
|
5507
|
-
customFields:
|
5536
|
+
tags: addErrorMessage2(BaseSchema3.extend({ value: z80.array(z80.string()) })),
|
5537
|
+
categories: BaseSchema3.extend({ value: z80.array(z80.string()) }),
|
5538
|
+
customFields: z80.array(
|
5508
5539
|
addErrorMessage2(
|
5509
5540
|
BaseSchema3.extend({
|
5510
|
-
value:
|
5511
|
-
type:
|
5512
|
-
isDefaultAttribute:
|
5541
|
+
value: z80.union([z80.string(), z80.array(z80.string())]),
|
5542
|
+
type: z80.string(),
|
5543
|
+
isDefaultAttribute: z80.boolean()
|
5513
5544
|
})
|
5514
5545
|
)
|
5515
5546
|
),
|
5516
|
-
reasonToAssign:
|
5547
|
+
reasonToAssign: z80.object({ value: z80.string() }).optional()
|
5517
5548
|
});
|
5518
5549
|
var UpdateTicketValidationSchema = CreateTicketValidationSchema;
|
5519
|
-
var TicketAttachmentRecordSchema =
|
5520
|
-
bucketName:
|
5521
|
-
fileKey:
|
5522
|
-
fileName:
|
5523
|
-
fileSize:
|
5524
|
-
url:
|
5525
|
-
});
|
5526
|
-
var CreateTicketAttachmentRecordsSchema =
|
5527
|
-
ticketId:
|
5528
|
-
attributeId:
|
5529
|
-
ticketAttachmentRecords:
|
5530
|
-
});
|
5531
|
-
var TicketParamsSchema =
|
5532
|
-
page:
|
5533
|
-
pageSize:
|
5534
|
-
});
|
5535
|
-
var CustomFieldQuery =
|
5536
|
-
attributeId:
|
5537
|
-
type:
|
5538
|
-
value:
|
5539
|
-
});
|
5540
|
-
var GetAllTicketQuerySchema =
|
5541
|
-
page:
|
5542
|
-
pageSize:
|
5543
|
-
selectedDate:
|
5544
|
-
keyword:
|
5545
|
-
title:
|
5546
|
-
description:
|
5547
|
-
status:
|
5548
|
-
priority:
|
5549
|
-
channel:
|
5550
|
-
type:
|
5551
|
-
ticketType:
|
5552
|
-
contact:
|
5553
|
-
tags:
|
5554
|
-
categories:
|
5555
|
-
assignee:
|
5556
|
-
customFields:
|
5557
|
-
|
5558
|
-
attributeId:
|
5559
|
-
type:
|
5560
|
-
value:
|
5550
|
+
var TicketAttachmentRecordSchema = z80.object({
|
5551
|
+
bucketName: z80.string(),
|
5552
|
+
fileKey: z80.string(),
|
5553
|
+
fileName: z80.string(),
|
5554
|
+
fileSize: z80.coerce.number(),
|
5555
|
+
url: z80.string()
|
5556
|
+
});
|
5557
|
+
var CreateTicketAttachmentRecordsSchema = z80.object({
|
5558
|
+
ticketId: z80.string(),
|
5559
|
+
attributeId: z80.string(),
|
5560
|
+
ticketAttachmentRecords: z80.array(TicketAttachmentRecordSchema)
|
5561
|
+
});
|
5562
|
+
var TicketParamsSchema = z80.object({
|
5563
|
+
page: z80.coerce.number().default(1),
|
5564
|
+
pageSize: z80.coerce.number().default(10)
|
5565
|
+
});
|
5566
|
+
var CustomFieldQuery = z80.object({
|
5567
|
+
attributeId: z80.string(),
|
5568
|
+
type: z80.string(),
|
5569
|
+
value: z80.union([z80.string(), z80.array(z80.string())])
|
5570
|
+
});
|
5571
|
+
var GetAllTicketQuerySchema = z80.object({
|
5572
|
+
page: z80.string().transform((value) => Number(value)),
|
5573
|
+
pageSize: z80.string().transform((value) => Number(value)),
|
5574
|
+
selectedDate: z80.string(),
|
5575
|
+
keyword: z80.string(),
|
5576
|
+
title: z80.string(),
|
5577
|
+
description: z80.string(),
|
5578
|
+
status: z80.array(z80.string()),
|
5579
|
+
priority: z80.array(z80.string()),
|
5580
|
+
channel: z80.array(z80.string()),
|
5581
|
+
type: z80.array(z80.string()),
|
5582
|
+
ticketType: z80.array(z80.string()),
|
5583
|
+
contact: z80.array(z80.string()),
|
5584
|
+
tags: z80.array(z80.string().uuid()),
|
5585
|
+
categories: z80.array(z80.string().uuid()),
|
5586
|
+
assignee: z80.array(z80.string().uuid()),
|
5587
|
+
customFields: z80.array(
|
5588
|
+
z80.object({
|
5589
|
+
attributeId: z80.string().uuid(),
|
5590
|
+
type: z80.string(),
|
5591
|
+
value: z80.union([z80.string(), z80.array(z80.string())])
|
5561
5592
|
})
|
5562
5593
|
)
|
5563
5594
|
}).partial();
|
5564
|
-
var ExportAllTicketQuerySchema =
|
5565
|
-
agent:
|
5566
|
-
selectedDate:
|
5567
|
-
keyword:
|
5568
|
-
title:
|
5569
|
-
description:
|
5570
|
-
status:
|
5571
|
-
priority:
|
5572
|
-
channel:
|
5573
|
-
type:
|
5574
|
-
ticketType:
|
5575
|
-
contact:
|
5576
|
-
tags:
|
5577
|
-
categories:
|
5578
|
-
customFields:
|
5579
|
-
|
5580
|
-
attributeId:
|
5581
|
-
type:
|
5582
|
-
value:
|
5595
|
+
var ExportAllTicketQuerySchema = z80.object({
|
5596
|
+
agent: z80.array(z80.string()),
|
5597
|
+
selectedDate: z80.string(),
|
5598
|
+
keyword: z80.string(),
|
5599
|
+
title: z80.string(),
|
5600
|
+
description: z80.string(),
|
5601
|
+
status: z80.array(z80.string()),
|
5602
|
+
priority: z80.array(z80.string()),
|
5603
|
+
channel: z80.array(z80.string()),
|
5604
|
+
type: z80.array(z80.string()),
|
5605
|
+
ticketType: z80.array(z80.string()),
|
5606
|
+
contact: z80.array(z80.string()),
|
5607
|
+
tags: z80.array(z80.string()),
|
5608
|
+
categories: z80.array(z80.string()),
|
5609
|
+
customFields: z80.array(
|
5610
|
+
z80.object({
|
5611
|
+
attributeId: z80.string().uuid(),
|
5612
|
+
type: z80.string(),
|
5613
|
+
value: z80.union([z80.string(), z80.array(z80.string())])
|
5583
5614
|
})
|
5584
5615
|
)
|
5585
5616
|
}).partial();
|
@@ -5595,14 +5626,14 @@ var ticketContract = initContract30().router(
|
|
5595
5626
|
201: DefaultSuccessResponseSchema.extend({
|
5596
5627
|
data: TicketSchema
|
5597
5628
|
}),
|
5598
|
-
400:
|
5599
|
-
message:
|
5629
|
+
400: z81.object({
|
5630
|
+
message: z81.string()
|
5600
5631
|
}),
|
5601
|
-
409:
|
5602
|
-
message:
|
5632
|
+
409: z81.object({
|
5633
|
+
message: z81.string()
|
5603
5634
|
}),
|
5604
|
-
500:
|
5605
|
-
message:
|
5635
|
+
500: z81.object({
|
5636
|
+
message: z81.string()
|
5606
5637
|
}),
|
5607
5638
|
401: DefaultUnauthorizedSchema,
|
5608
5639
|
404: DefaultNotFoundSchema,
|
@@ -5623,8 +5654,8 @@ var ticketContract = initContract30().router(
|
|
5623
5654
|
TicketSchema
|
5624
5655
|
)
|
5625
5656
|
}),
|
5626
|
-
400:
|
5627
|
-
message:
|
5657
|
+
400: z81.object({
|
5658
|
+
message: z81.string()
|
5628
5659
|
}),
|
5629
5660
|
401: DefaultUnauthorizedSchema,
|
5630
5661
|
500: DefaultErrorResponseSchema
|
@@ -5634,14 +5665,14 @@ var ticketContract = initContract30().router(
|
|
5634
5665
|
getTicketById: {
|
5635
5666
|
method: "GET",
|
5636
5667
|
path: "/:id",
|
5637
|
-
pathParams:
|
5668
|
+
pathParams: z81.object({ id: z81.string() }),
|
5638
5669
|
headers: DefaultHeaderSchema,
|
5639
5670
|
responses: {
|
5640
5671
|
200: DefaultSuccessResponseSchema.extend({
|
5641
5672
|
data: TicketSchema
|
5642
5673
|
}),
|
5643
|
-
400:
|
5644
|
-
message:
|
5674
|
+
400: z81.object({
|
5675
|
+
message: z81.string()
|
5645
5676
|
}),
|
5646
5677
|
401: DefaultUnauthorizedSchema,
|
5647
5678
|
500: DefaultErrorResponseSchema
|
@@ -5651,15 +5682,15 @@ var ticketContract = initContract30().router(
|
|
5651
5682
|
getTicketByContactId: {
|
5652
5683
|
method: "GET",
|
5653
5684
|
path: "/contact/:id",
|
5654
|
-
pathParams:
|
5685
|
+
pathParams: z81.object({ id: z81.string() }),
|
5655
5686
|
query: TicketParamsSchema,
|
5656
5687
|
headers: DefaultHeaderSchema,
|
5657
5688
|
responses: {
|
5658
5689
|
200: DefaultSuccessResponseSchema.extend({
|
5659
5690
|
data: WithPagination(TicketSchema)
|
5660
5691
|
}),
|
5661
|
-
400:
|
5662
|
-
message:
|
5692
|
+
400: z81.object({
|
5693
|
+
message: z81.string()
|
5663
5694
|
}),
|
5664
5695
|
401: DefaultUnauthorizedSchema,
|
5665
5696
|
500: DefaultErrorResponseSchema
|
@@ -5669,21 +5700,21 @@ var ticketContract = initContract30().router(
|
|
5669
5700
|
updateTicket: {
|
5670
5701
|
method: "PATCH",
|
5671
5702
|
path: "/:id",
|
5672
|
-
pathParams:
|
5703
|
+
pathParams: z81.object({ id: z81.string() }),
|
5673
5704
|
body: UpdateTicketValidationSchema,
|
5674
5705
|
headers: DefaultHeaderSchema,
|
5675
5706
|
responses: {
|
5676
5707
|
201: DefaultSuccessResponseSchema.extend({
|
5677
5708
|
data: TicketSchema
|
5678
5709
|
}),
|
5679
|
-
400:
|
5680
|
-
message:
|
5710
|
+
400: z81.object({
|
5711
|
+
message: z81.string()
|
5681
5712
|
}),
|
5682
|
-
409:
|
5683
|
-
message:
|
5713
|
+
409: z81.object({
|
5714
|
+
message: z81.string()
|
5684
5715
|
}),
|
5685
|
-
500:
|
5686
|
-
message:
|
5716
|
+
500: z81.object({
|
5717
|
+
message: z81.string()
|
5687
5718
|
}),
|
5688
5719
|
401: DefaultUnauthorizedSchema,
|
5689
5720
|
404: DefaultNotFoundSchema,
|
@@ -5694,11 +5725,11 @@ var ticketContract = initContract30().router(
|
|
5694
5725
|
deleteTicket: {
|
5695
5726
|
method: "DELETE",
|
5696
5727
|
path: "/:id",
|
5697
|
-
pathParams:
|
5728
|
+
pathParams: z81.object({ id: z81.string() }),
|
5698
5729
|
headers: DefaultHeaderSchema,
|
5699
5730
|
body: null,
|
5700
5731
|
responses: {
|
5701
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5732
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5702
5733
|
500: DefaultErrorResponseSchema
|
5703
5734
|
},
|
5704
5735
|
summary: "Delete a extension."
|
@@ -5706,19 +5737,19 @@ var ticketContract = initContract30().router(
|
|
5706
5737
|
updateDescription: {
|
5707
5738
|
method: "PATCH",
|
5708
5739
|
path: "/description/update/:id",
|
5709
|
-
pathParams:
|
5710
|
-
body:
|
5740
|
+
pathParams: z81.object({ id: z81.string() }),
|
5741
|
+
body: z81.object({ description: z81.string() }),
|
5711
5742
|
headers: DefaultHeaderSchema,
|
5712
5743
|
responses: {
|
5713
|
-
201: DefaultSuccessResponseSchema.extend({ message:
|
5714
|
-
400:
|
5715
|
-
message:
|
5744
|
+
201: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5745
|
+
400: z81.object({
|
5746
|
+
message: z81.string()
|
5716
5747
|
}),
|
5717
|
-
409:
|
5718
|
-
message:
|
5748
|
+
409: z81.object({
|
5749
|
+
message: z81.string()
|
5719
5750
|
}),
|
5720
|
-
500:
|
5721
|
-
message:
|
5751
|
+
500: z81.object({
|
5752
|
+
message: z81.string()
|
5722
5753
|
}),
|
5723
5754
|
401: DefaultUnauthorizedSchema,
|
5724
5755
|
404: DefaultNotFoundSchema,
|
@@ -5729,19 +5760,19 @@ var ticketContract = initContract30().router(
|
|
5729
5760
|
updateTitle: {
|
5730
5761
|
method: "PATCH",
|
5731
5762
|
path: "/title/update/:id",
|
5732
|
-
pathParams:
|
5733
|
-
body:
|
5763
|
+
pathParams: z81.object({ id: z81.string() }),
|
5764
|
+
body: z81.object({ title: z81.string() }),
|
5734
5765
|
headers: DefaultHeaderSchema,
|
5735
5766
|
responses: {
|
5736
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5737
|
-
400:
|
5738
|
-
message:
|
5767
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5768
|
+
400: z81.object({
|
5769
|
+
message: z81.string()
|
5739
5770
|
}),
|
5740
|
-
409:
|
5741
|
-
message:
|
5771
|
+
409: z81.object({
|
5772
|
+
message: z81.string()
|
5742
5773
|
}),
|
5743
|
-
500:
|
5744
|
-
message:
|
5774
|
+
500: z81.object({
|
5775
|
+
message: z81.string()
|
5745
5776
|
}),
|
5746
5777
|
401: DefaultUnauthorizedSchema,
|
5747
5778
|
404: DefaultNotFoundSchema,
|
@@ -5752,19 +5783,19 @@ var ticketContract = initContract30().router(
|
|
5752
5783
|
updateType: {
|
5753
5784
|
method: "PATCH",
|
5754
5785
|
path: "/type/update/:id",
|
5755
|
-
pathParams:
|
5756
|
-
body:
|
5786
|
+
pathParams: z81.object({ id: z81.string() }),
|
5787
|
+
body: z81.object({ type: z81.string() }),
|
5757
5788
|
headers: DefaultHeaderSchema,
|
5758
5789
|
responses: {
|
5759
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5760
|
-
400:
|
5761
|
-
message:
|
5790
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5791
|
+
400: z81.object({
|
5792
|
+
message: z81.string()
|
5762
5793
|
}),
|
5763
|
-
409:
|
5764
|
-
message:
|
5794
|
+
409: z81.object({
|
5795
|
+
message: z81.string()
|
5765
5796
|
}),
|
5766
|
-
500:
|
5767
|
-
message:
|
5797
|
+
500: z81.object({
|
5798
|
+
message: z81.string()
|
5768
5799
|
}),
|
5769
5800
|
401: DefaultUnauthorizedSchema,
|
5770
5801
|
404: DefaultNotFoundSchema,
|
@@ -5775,19 +5806,19 @@ var ticketContract = initContract30().router(
|
|
5775
5806
|
updateStatus: {
|
5776
5807
|
method: "PATCH",
|
5777
5808
|
path: "/status/update/:id",
|
5778
|
-
pathParams:
|
5779
|
-
body:
|
5809
|
+
pathParams: z81.object({ id: z81.string() }),
|
5810
|
+
body: z81.object({ status: z81.string() }),
|
5780
5811
|
headers: DefaultHeaderSchema,
|
5781
5812
|
responses: {
|
5782
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5783
|
-
400:
|
5784
|
-
message:
|
5813
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5814
|
+
400: z81.object({
|
5815
|
+
message: z81.string()
|
5785
5816
|
}),
|
5786
|
-
409:
|
5787
|
-
message:
|
5817
|
+
409: z81.object({
|
5818
|
+
message: z81.string()
|
5788
5819
|
}),
|
5789
|
-
500:
|
5790
|
-
message:
|
5820
|
+
500: z81.object({
|
5821
|
+
message: z81.string()
|
5791
5822
|
}),
|
5792
5823
|
401: DefaultUnauthorizedSchema,
|
5793
5824
|
404: DefaultNotFoundSchema,
|
@@ -5798,19 +5829,19 @@ var ticketContract = initContract30().router(
|
|
5798
5829
|
updatePriority: {
|
5799
5830
|
method: "PATCH",
|
5800
5831
|
path: "/priority/update/:id",
|
5801
|
-
pathParams:
|
5802
|
-
body:
|
5832
|
+
pathParams: z81.object({ id: z81.string() }),
|
5833
|
+
body: z81.object({ priority: z81.string() }),
|
5803
5834
|
headers: DefaultHeaderSchema,
|
5804
5835
|
responses: {
|
5805
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5806
|
-
400:
|
5807
|
-
message:
|
5836
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5837
|
+
400: z81.object({
|
5838
|
+
message: z81.string()
|
5808
5839
|
}),
|
5809
|
-
409:
|
5810
|
-
message:
|
5840
|
+
409: z81.object({
|
5841
|
+
message: z81.string()
|
5811
5842
|
}),
|
5812
|
-
500:
|
5813
|
-
message:
|
5843
|
+
500: z81.object({
|
5844
|
+
message: z81.string()
|
5814
5845
|
}),
|
5815
5846
|
401: DefaultUnauthorizedSchema,
|
5816
5847
|
404: DefaultNotFoundSchema,
|
@@ -5821,19 +5852,19 @@ var ticketContract = initContract30().router(
|
|
5821
5852
|
updateChannel: {
|
5822
5853
|
method: "PATCH",
|
5823
5854
|
path: "/channel/update/:id",
|
5824
|
-
pathParams:
|
5825
|
-
body:
|
5855
|
+
pathParams: z81.object({ id: z81.string() }),
|
5856
|
+
body: z81.object({ channel: z81.string() }),
|
5826
5857
|
headers: DefaultHeaderSchema,
|
5827
5858
|
responses: {
|
5828
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5829
|
-
400:
|
5830
|
-
message:
|
5859
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5860
|
+
400: z81.object({
|
5861
|
+
message: z81.string()
|
5831
5862
|
}),
|
5832
|
-
409:
|
5833
|
-
message:
|
5863
|
+
409: z81.object({
|
5864
|
+
message: z81.string()
|
5834
5865
|
}),
|
5835
|
-
500:
|
5836
|
-
message:
|
5866
|
+
500: z81.object({
|
5867
|
+
message: z81.string()
|
5837
5868
|
}),
|
5838
5869
|
401: DefaultUnauthorizedSchema,
|
5839
5870
|
404: DefaultNotFoundSchema,
|
@@ -5844,19 +5875,19 @@ var ticketContract = initContract30().router(
|
|
5844
5875
|
updateTags: {
|
5845
5876
|
method: "PATCH",
|
5846
5877
|
path: "/tags/update/:id",
|
5847
|
-
pathParams:
|
5848
|
-
body:
|
5878
|
+
pathParams: z81.object({ id: z81.string() }),
|
5879
|
+
body: z81.object({ tags: z81.array(z81.string()) }),
|
5849
5880
|
headers: DefaultHeaderSchema,
|
5850
5881
|
responses: {
|
5851
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5852
|
-
400:
|
5853
|
-
message:
|
5882
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5883
|
+
400: z81.object({
|
5884
|
+
message: z81.string()
|
5854
5885
|
}),
|
5855
|
-
409:
|
5856
|
-
message:
|
5886
|
+
409: z81.object({
|
5887
|
+
message: z81.string()
|
5857
5888
|
}),
|
5858
|
-
500:
|
5859
|
-
message:
|
5889
|
+
500: z81.object({
|
5890
|
+
message: z81.string()
|
5860
5891
|
}),
|
5861
5892
|
401: DefaultUnauthorizedSchema,
|
5862
5893
|
404: DefaultNotFoundSchema,
|
@@ -5867,25 +5898,25 @@ var ticketContract = initContract30().router(
|
|
5867
5898
|
changeAssignee: {
|
5868
5899
|
method: "PATCH",
|
5869
5900
|
path: "/assignee/update/:id",
|
5870
|
-
pathParams:
|
5871
|
-
body:
|
5872
|
-
ticketId:
|
5873
|
-
assigneeId:
|
5874
|
-
reason:
|
5901
|
+
pathParams: z81.object({ id: z81.string() }),
|
5902
|
+
body: z81.object({
|
5903
|
+
ticketId: z81.string(),
|
5904
|
+
assigneeId: z81.string(),
|
5905
|
+
reason: z81.string().optional()
|
5875
5906
|
}),
|
5876
5907
|
headers: DefaultHeaderSchema,
|
5877
5908
|
responses: {
|
5878
5909
|
200: DefaultSuccessResponseSchema.extend({
|
5879
5910
|
data: TicketSchema
|
5880
5911
|
}),
|
5881
|
-
400:
|
5882
|
-
message:
|
5912
|
+
400: z81.object({
|
5913
|
+
message: z81.string()
|
5883
5914
|
}),
|
5884
|
-
409:
|
5885
|
-
message:
|
5915
|
+
409: z81.object({
|
5916
|
+
message: z81.string()
|
5886
5917
|
}),
|
5887
|
-
500:
|
5888
|
-
message:
|
5918
|
+
500: z81.object({
|
5919
|
+
message: z81.string()
|
5889
5920
|
}),
|
5890
5921
|
401: DefaultUnauthorizedSchema,
|
5891
5922
|
404: DefaultNotFoundSchema,
|
@@ -5896,14 +5927,14 @@ var ticketContract = initContract30().router(
|
|
5896
5927
|
getTicketCountByContact: {
|
5897
5928
|
method: "GET",
|
5898
5929
|
path: "/ticket_count/contact/:id",
|
5899
|
-
pathParams:
|
5930
|
+
pathParams: z81.object({ id: z81.string() }),
|
5900
5931
|
headers: DefaultHeaderSchema,
|
5901
5932
|
responses: {
|
5902
5933
|
200: DefaultSuccessResponseSchema.extend({
|
5903
5934
|
data: TicketCountByContactSchema
|
5904
5935
|
}),
|
5905
|
-
400:
|
5906
|
-
message:
|
5936
|
+
400: z81.object({
|
5937
|
+
message: z81.string()
|
5907
5938
|
}),
|
5908
5939
|
401: DefaultUnauthorizedSchema,
|
5909
5940
|
500: DefaultErrorResponseSchema
|
@@ -5919,14 +5950,14 @@ var ticketContract = initContract30().router(
|
|
5919
5950
|
201: DefaultSuccessResponseSchema.extend({
|
5920
5951
|
data: TicketCustomFieldSchema
|
5921
5952
|
}),
|
5922
|
-
400:
|
5923
|
-
message:
|
5953
|
+
400: z81.object({
|
5954
|
+
message: z81.string()
|
5924
5955
|
}),
|
5925
|
-
409:
|
5926
|
-
message:
|
5956
|
+
409: z81.object({
|
5957
|
+
message: z81.string()
|
5927
5958
|
}),
|
5928
|
-
500:
|
5929
|
-
message:
|
5959
|
+
500: z81.object({
|
5960
|
+
message: z81.string()
|
5930
5961
|
}),
|
5931
5962
|
401: DefaultUnauthorizedSchema,
|
5932
5963
|
404: DefaultNotFoundSchema,
|
@@ -5951,21 +5982,21 @@ var ticketContract = initContract30().router(
|
|
5951
5982
|
|
5952
5983
|
// src/user/index.ts
|
5953
5984
|
import { initContract as initContract31 } from "@ts-rest/core";
|
5954
|
-
import
|
5985
|
+
import z83 from "zod";
|
5955
5986
|
|
5956
5987
|
// src/user/validation.ts
|
5957
|
-
import { z as
|
5958
|
-
var CreateUserSchema =
|
5959
|
-
name:
|
5960
|
-
email:
|
5961
|
-
address:
|
5962
|
-
phone:
|
5963
|
-
password:
|
5964
|
-
notificationCount:
|
5965
|
-
roles:
|
5988
|
+
import { z as z82 } from "zod";
|
5989
|
+
var CreateUserSchema = z82.object({
|
5990
|
+
name: z82.string(),
|
5991
|
+
email: z82.string().email(),
|
5992
|
+
address: z82.string().nullable(),
|
5993
|
+
phone: z82.string().nullable(),
|
5994
|
+
password: z82.string(),
|
5995
|
+
notificationCount: z82.number().nullable().optional(),
|
5996
|
+
roles: z82.array(z82.string())
|
5966
5997
|
});
|
5967
5998
|
var UpdateUserSchema = CreateUserSchema.extend({
|
5968
|
-
newPassword:
|
5999
|
+
newPassword: z82.string()
|
5969
6000
|
});
|
5970
6001
|
|
5971
6002
|
// src/user/index.ts
|
@@ -5980,8 +6011,8 @@ var userContract = initContract31().router(
|
|
5980
6011
|
201: DefaultSuccessResponseSchema.extend({
|
5981
6012
|
user: UserSchema
|
5982
6013
|
}),
|
5983
|
-
400:
|
5984
|
-
message:
|
6014
|
+
400: z83.object({
|
6015
|
+
message: z83.string()
|
5985
6016
|
}),
|
5986
6017
|
401: DefaultUnauthorizedSchema
|
5987
6018
|
},
|
@@ -5991,16 +6022,16 @@ var userContract = initContract31().router(
|
|
5991
6022
|
method: "GET",
|
5992
6023
|
path: "",
|
5993
6024
|
headers: DefaultHeaderSchema,
|
5994
|
-
query:
|
5995
|
-
page:
|
5996
|
-
pageSize:
|
6025
|
+
query: z83.object({
|
6026
|
+
page: z83.coerce.number().optional(),
|
6027
|
+
pageSize: z83.coerce.number().optional(),
|
5997
6028
|
// Don't add default 10. In some places, we need to fetch all users.
|
5998
|
-
keyword:
|
6029
|
+
keyword: z83.string().optional()
|
5999
6030
|
}).optional(),
|
6000
6031
|
responses: {
|
6001
6032
|
200: WithPagination(UserSchema),
|
6002
|
-
400:
|
6003
|
-
message:
|
6033
|
+
400: z83.object({
|
6034
|
+
message: z83.string()
|
6004
6035
|
}),
|
6005
6036
|
401: DefaultUnauthorizedSchema,
|
6006
6037
|
500: DefaultErrorResponseSchema
|
@@ -6010,12 +6041,12 @@ var userContract = initContract31().router(
|
|
6010
6041
|
getUserById: {
|
6011
6042
|
method: "GET",
|
6012
6043
|
path: "/:id",
|
6013
|
-
pathParams:
|
6044
|
+
pathParams: z83.object({ id: z83.string() }),
|
6014
6045
|
headers: DefaultHeaderSchema,
|
6015
6046
|
responses: {
|
6016
6047
|
200: UserSchema,
|
6017
|
-
400:
|
6018
|
-
message:
|
6048
|
+
400: z83.object({
|
6049
|
+
message: z83.string()
|
6019
6050
|
}),
|
6020
6051
|
401: DefaultUnauthorizedSchema
|
6021
6052
|
},
|
@@ -6024,15 +6055,15 @@ var userContract = initContract31().router(
|
|
6024
6055
|
updateUser: {
|
6025
6056
|
method: "PATCH",
|
6026
6057
|
path: "/:id",
|
6027
|
-
pathParams:
|
6058
|
+
pathParams: z83.object({ id: z83.string() }),
|
6028
6059
|
headers: DefaultHeaderSchema,
|
6029
6060
|
body: UpdateUserSchema,
|
6030
6061
|
responses: {
|
6031
6062
|
201: DefaultSuccessResponseSchema.extend({
|
6032
6063
|
role: UserSchema
|
6033
6064
|
}),
|
6034
|
-
400:
|
6035
|
-
message:
|
6065
|
+
400: z83.object({
|
6066
|
+
message: z83.string()
|
6036
6067
|
}),
|
6037
6068
|
401: DefaultUnauthorizedSchema
|
6038
6069
|
},
|
@@ -6041,11 +6072,11 @@ var userContract = initContract31().router(
|
|
6041
6072
|
deleteUser: {
|
6042
6073
|
method: "DELETE",
|
6043
6074
|
path: "/:id",
|
6044
|
-
pathParams:
|
6075
|
+
pathParams: z83.object({ id: z83.string() }),
|
6045
6076
|
headers: DefaultHeaderSchema,
|
6046
6077
|
body: null,
|
6047
6078
|
responses: {
|
6048
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6079
|
+
200: DefaultSuccessResponseSchema.extend({ message: z83.string() }),
|
6049
6080
|
500: DefaultErrorResponseSchema
|
6050
6081
|
},
|
6051
6082
|
summary: "Delete a user."
|
@@ -6056,26 +6087,26 @@ var userContract = initContract31().router(
|
|
6056
6087
|
|
6057
6088
|
// src/user-presence-status-log/index.ts
|
6058
6089
|
import { initContract as initContract32 } from "@ts-rest/core";
|
6059
|
-
import
|
6090
|
+
import z86 from "zod";
|
6060
6091
|
|
6061
6092
|
// src/user-presence-status-log/schema.ts
|
6062
|
-
import
|
6093
|
+
import z84 from "zod";
|
6063
6094
|
var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
|
6064
6095
|
user: UserSchema,
|
6065
6096
|
previousPresenceStatus: PresenceStatusSchema,
|
6066
6097
|
newPresenceStatus: PresenceStatusSchema,
|
6067
|
-
reason:
|
6098
|
+
reason: z84.string()
|
6068
6099
|
});
|
6069
6100
|
|
6070
6101
|
// src/user-presence-status-log/validation.ts
|
6071
|
-
import
|
6072
|
-
var UserPresenceStatusLogParamsSchema =
|
6073
|
-
page:
|
6074
|
-
pageSize:
|
6075
|
-
selectedDate:
|
6102
|
+
import z85 from "zod";
|
6103
|
+
var UserPresenceStatusLogParamsSchema = z85.object({
|
6104
|
+
page: z85.coerce.number().default(1),
|
6105
|
+
pageSize: z85.coerce.number().default(10),
|
6106
|
+
selectedDate: z85.string().optional()
|
6076
6107
|
}).optional();
|
6077
|
-
var UserPresenceStatusLogExportParamsSchema =
|
6078
|
-
selectedDate:
|
6108
|
+
var UserPresenceStatusLogExportParamsSchema = z85.object({
|
6109
|
+
selectedDate: z85.string().optional()
|
6079
6110
|
});
|
6080
6111
|
|
6081
6112
|
// src/user-presence-status-log/index.ts
|
@@ -6088,8 +6119,8 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
6088
6119
|
headers: DefaultHeaderSchema,
|
6089
6120
|
responses: {
|
6090
6121
|
200: WithPagination(UserPresenceStatusLogSchema),
|
6091
|
-
400:
|
6092
|
-
message:
|
6122
|
+
400: z86.object({
|
6123
|
+
message: z86.string()
|
6093
6124
|
}),
|
6094
6125
|
401: DefaultUnauthorizedSchema,
|
6095
6126
|
500: DefaultErrorResponseSchema
|
@@ -6103,8 +6134,8 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
6103
6134
|
headers: DefaultHeaderSchema,
|
6104
6135
|
responses: {
|
6105
6136
|
200: null,
|
6106
|
-
400:
|
6107
|
-
message:
|
6137
|
+
400: z86.object({
|
6138
|
+
message: z86.string()
|
6108
6139
|
}),
|
6109
6140
|
401: DefaultUnauthorizedSchema,
|
6110
6141
|
500: DefaultErrorResponseSchema
|
@@ -6116,44 +6147,44 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
6116
6147
|
|
6117
6148
|
// src/widget/index.ts
|
6118
6149
|
import { initContract as initContract33 } from "@ts-rest/core";
|
6119
|
-
import
|
6150
|
+
import z89 from "zod";
|
6120
6151
|
|
6121
6152
|
// src/widget/schema.ts
|
6122
|
-
import
|
6123
|
-
var FieldsSchema =
|
6124
|
-
var WidgetPositionSchema =
|
6125
|
-
|
6126
|
-
|
6127
|
-
|
6153
|
+
import z87 from "zod";
|
6154
|
+
var FieldsSchema = z87.object({ data: z87.array(z87.string()) });
|
6155
|
+
var WidgetPositionSchema = z87.union([
|
6156
|
+
z87.literal("menu"),
|
6157
|
+
z87.literal("ticket_detail"),
|
6158
|
+
z87.literal("contact_detail")
|
6128
6159
|
]);
|
6129
6160
|
var WidgetSchema = DefaultEntitySchema.extend({
|
6130
|
-
name:
|
6131
|
-
description:
|
6161
|
+
name: z87.string(),
|
6162
|
+
description: z87.string().nullable(),
|
6132
6163
|
position: WidgetPositionSchema.nullable(),
|
6133
6164
|
fields: FieldsSchema,
|
6134
|
-
url:
|
6165
|
+
url: z87.string()
|
6135
6166
|
});
|
6136
6167
|
|
6137
6168
|
// src/widget/validation.ts
|
6138
|
-
import
|
6139
|
-
var CreateWidgetSchema =
|
6140
|
-
name:
|
6141
|
-
description:
|
6142
|
-
url:
|
6169
|
+
import z88 from "zod";
|
6170
|
+
var CreateWidgetSchema = z88.object({
|
6171
|
+
name: z88.string(),
|
6172
|
+
description: z88.string(),
|
6173
|
+
url: z88.string(),
|
6143
6174
|
position: WidgetPositionSchema,
|
6144
|
-
fields:
|
6175
|
+
fields: z88.object({
|
6145
6176
|
data: (
|
6146
6177
|
// Array of attribute system names
|
6147
|
-
|
6178
|
+
z88.array(z88.string())
|
6148
6179
|
)
|
6149
6180
|
}).optional()
|
6150
6181
|
});
|
6151
6182
|
var UpdateWidgetSchema = CreateWidgetSchema;
|
6152
|
-
var GetWidgetUrlPathQuerySchema =
|
6153
|
-
widgetId:
|
6183
|
+
var GetWidgetUrlPathQuerySchema = z88.object({
|
6184
|
+
widgetId: z88.string(),
|
6154
6185
|
// Position ID is ticket ID, contact ID, etc.
|
6155
6186
|
// TODO: The name "Position ID" is confusing. Think of a better name.
|
6156
|
-
positionId:
|
6187
|
+
positionId: z88.string()
|
6157
6188
|
});
|
6158
6189
|
|
6159
6190
|
// src/widget/index.ts
|
@@ -6168,8 +6199,8 @@ var widgetContract = initContract33().router(
|
|
6168
6199
|
201: DefaultSuccessResponseSchema.extend({
|
6169
6200
|
widget: WidgetSchema
|
6170
6201
|
}),
|
6171
|
-
400:
|
6172
|
-
message:
|
6202
|
+
400: z89.object({
|
6203
|
+
message: z89.string()
|
6173
6204
|
}),
|
6174
6205
|
401: DefaultUnauthorizedSchema,
|
6175
6206
|
500: DefaultErrorResponseSchema
|
@@ -6179,17 +6210,17 @@ var widgetContract = initContract33().router(
|
|
6179
6210
|
getWidgets: {
|
6180
6211
|
method: "GET",
|
6181
6212
|
path: "",
|
6182
|
-
query:
|
6183
|
-
page:
|
6184
|
-
pageSize:
|
6185
|
-
keyword:
|
6213
|
+
query: z89.object({
|
6214
|
+
page: z89.coerce.number().default(1),
|
6215
|
+
pageSize: z89.coerce.number().default(10),
|
6216
|
+
keyword: z89.coerce.string().optional()
|
6186
6217
|
}).optional(),
|
6187
6218
|
headers: DefaultHeaderSchema,
|
6188
6219
|
responses: {
|
6189
6220
|
200: WithPagination(WidgetSchema),
|
6190
6221
|
500: DefaultErrorResponseSchema,
|
6191
|
-
400:
|
6192
|
-
message:
|
6222
|
+
400: z89.object({
|
6223
|
+
message: z89.string()
|
6193
6224
|
}),
|
6194
6225
|
401: DefaultUnauthorizedSchema
|
6195
6226
|
},
|
@@ -6200,9 +6231,9 @@ var widgetContract = initContract33().router(
|
|
6200
6231
|
path: "/menu",
|
6201
6232
|
headers: DefaultHeaderSchema,
|
6202
6233
|
responses: {
|
6203
|
-
200:
|
6204
|
-
400:
|
6205
|
-
message:
|
6234
|
+
200: z89.array(WidgetSchema),
|
6235
|
+
400: z89.object({
|
6236
|
+
message: z89.string()
|
6206
6237
|
}),
|
6207
6238
|
401: DefaultUnauthorizedSchema,
|
6208
6239
|
500: DefaultErrorResponseSchema
|
@@ -6214,9 +6245,9 @@ var widgetContract = initContract33().router(
|
|
6214
6245
|
path: "/ticket_detail",
|
6215
6246
|
headers: DefaultHeaderSchema,
|
6216
6247
|
responses: {
|
6217
|
-
200:
|
6218
|
-
400:
|
6219
|
-
message:
|
6248
|
+
200: z89.array(WidgetSchema),
|
6249
|
+
400: z89.object({
|
6250
|
+
message: z89.string()
|
6220
6251
|
}),
|
6221
6252
|
401: DefaultUnauthorizedSchema,
|
6222
6253
|
500: DefaultErrorResponseSchema
|
@@ -6228,9 +6259,9 @@ var widgetContract = initContract33().router(
|
|
6228
6259
|
path: "/contact_detail",
|
6229
6260
|
headers: DefaultHeaderSchema,
|
6230
6261
|
responses: {
|
6231
|
-
200:
|
6232
|
-
400:
|
6233
|
-
message:
|
6262
|
+
200: z89.array(WidgetSchema),
|
6263
|
+
400: z89.object({
|
6264
|
+
message: z89.string()
|
6234
6265
|
}),
|
6235
6266
|
401: DefaultUnauthorizedSchema,
|
6236
6267
|
500: DefaultErrorResponseSchema
|
@@ -6240,12 +6271,12 @@ var widgetContract = initContract33().router(
|
|
6240
6271
|
getWidgetById: {
|
6241
6272
|
method: "GET",
|
6242
6273
|
path: "/:id",
|
6243
|
-
pathParams:
|
6274
|
+
pathParams: z89.object({ id: z89.string() }),
|
6244
6275
|
headers: DefaultHeaderSchema,
|
6245
6276
|
responses: {
|
6246
6277
|
200: WidgetSchema,
|
6247
|
-
400:
|
6248
|
-
message:
|
6278
|
+
400: z89.object({
|
6279
|
+
message: z89.string()
|
6249
6280
|
}),
|
6250
6281
|
401: DefaultUnauthorizedSchema,
|
6251
6282
|
500: DefaultErrorResponseSchema
|
@@ -6259,10 +6290,10 @@ var widgetContract = initContract33().router(
|
|
6259
6290
|
headers: DefaultHeaderSchema,
|
6260
6291
|
responses: {
|
6261
6292
|
201: DefaultSuccessResponseSchema.extend({
|
6262
|
-
url:
|
6293
|
+
url: z89.string()
|
6263
6294
|
}),
|
6264
|
-
400:
|
6265
|
-
message:
|
6295
|
+
400: z89.object({
|
6296
|
+
message: z89.string()
|
6266
6297
|
}),
|
6267
6298
|
401: DefaultUnauthorizedSchema
|
6268
6299
|
},
|
@@ -6271,14 +6302,14 @@ var widgetContract = initContract33().router(
|
|
6271
6302
|
updateWidget: {
|
6272
6303
|
method: "PATCH",
|
6273
6304
|
path: "/:id",
|
6274
|
-
pathParams:
|
6305
|
+
pathParams: z89.object({ id: z89.string() }),
|
6275
6306
|
headers: DefaultHeaderSchema,
|
6276
6307
|
responses: {
|
6277
6308
|
201: DefaultSuccessResponseSchema.extend({
|
6278
6309
|
widget: WidgetSchema
|
6279
6310
|
}),
|
6280
|
-
400:
|
6281
|
-
message:
|
6311
|
+
400: z89.object({
|
6312
|
+
message: z89.string()
|
6282
6313
|
}),
|
6283
6314
|
401: DefaultUnauthorizedSchema
|
6284
6315
|
},
|
@@ -6288,11 +6319,11 @@ var widgetContract = initContract33().router(
|
|
6288
6319
|
deleteWidget: {
|
6289
6320
|
method: "DELETE",
|
6290
6321
|
path: "/:id",
|
6291
|
-
pathParams:
|
6322
|
+
pathParams: z89.object({ id: z89.string() }),
|
6292
6323
|
headers: DefaultHeaderSchema,
|
6293
6324
|
body: null,
|
6294
6325
|
responses: {
|
6295
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6326
|
+
200: DefaultSuccessResponseSchema.extend({ message: z89.string() }),
|
6296
6327
|
500: DefaultErrorResponseSchema
|
6297
6328
|
},
|
6298
6329
|
summary: "Delete a widget."
|
@@ -6303,24 +6334,24 @@ var widgetContract = initContract33().router(
|
|
6303
6334
|
|
6304
6335
|
// src/wrap-up-form/index.ts
|
6305
6336
|
import { initContract as initContract34 } from "@ts-rest/core";
|
6306
|
-
import
|
6337
|
+
import z91 from "zod";
|
6307
6338
|
|
6308
6339
|
// src/wrap-up-form/validation.ts
|
6309
|
-
import { z as
|
6310
|
-
var CreateWrapUpFormSchema =
|
6311
|
-
note:
|
6312
|
-
disposition:
|
6313
|
-
callFrom:
|
6314
|
-
callTo:
|
6340
|
+
import { z as z90 } from "zod";
|
6341
|
+
var CreateWrapUpFormSchema = z90.object({
|
6342
|
+
note: z90.string().nullable().optional(),
|
6343
|
+
disposition: z90.string().nullable().optional(),
|
6344
|
+
callFrom: z90.string().nullable().optional(),
|
6345
|
+
callTo: z90.string().nullable().optional()
|
6315
6346
|
});
|
6316
6347
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
6317
|
-
tags:
|
6348
|
+
tags: z90.array(z90.string()).optional()
|
6318
6349
|
});
|
6319
|
-
var CreateCXLogWrapUpFormSchema =
|
6320
|
-
cxLogId:
|
6321
|
-
disposition:
|
6322
|
-
tagIds:
|
6323
|
-
note:
|
6350
|
+
var CreateCXLogWrapUpFormSchema = z90.object({
|
6351
|
+
cxLogId: z90.string().uuid(),
|
6352
|
+
disposition: z90.string().optional(),
|
6353
|
+
tagIds: z90.array(z90.string().uuid()).optional(),
|
6354
|
+
note: z90.string().optional()
|
6324
6355
|
});
|
6325
6356
|
|
6326
6357
|
// src/wrap-up-form/index.ts
|
@@ -6335,8 +6366,8 @@ var wrapUpFormContract = initContract34().router(
|
|
6335
6366
|
201: DefaultSuccessResponseSchema.extend({
|
6336
6367
|
wrapUpForm: WrapUpFormSchema
|
6337
6368
|
}),
|
6338
|
-
400:
|
6339
|
-
message:
|
6369
|
+
400: z91.object({
|
6370
|
+
message: z91.string()
|
6340
6371
|
}),
|
6341
6372
|
401: DefaultUnauthorizedSchema,
|
6342
6373
|
500: DefaultErrorResponseSchema
|
@@ -6358,15 +6389,15 @@ var wrapUpFormContract = initContract34().router(
|
|
6358
6389
|
getWrapUpForms: {
|
6359
6390
|
method: "GET",
|
6360
6391
|
path: "",
|
6361
|
-
query:
|
6362
|
-
page:
|
6363
|
-
pageSize:
|
6392
|
+
query: z91.object({
|
6393
|
+
page: z91.coerce.number().default(1),
|
6394
|
+
pageSize: z91.coerce.number().default(10)
|
6364
6395
|
}).optional(),
|
6365
6396
|
headers: DefaultHeaderSchema,
|
6366
6397
|
responses: {
|
6367
6398
|
200: WithPagination(WrapUpFormSchema),
|
6368
|
-
400:
|
6369
|
-
message:
|
6399
|
+
400: z91.object({
|
6400
|
+
message: z91.string()
|
6370
6401
|
}),
|
6371
6402
|
401: DefaultUnauthorizedSchema,
|
6372
6403
|
500: DefaultErrorResponseSchema
|
@@ -6376,15 +6407,15 @@ var wrapUpFormContract = initContract34().router(
|
|
6376
6407
|
updateWrapUpForm: {
|
6377
6408
|
method: "PATCH",
|
6378
6409
|
path: "/:id",
|
6379
|
-
pathParams:
|
6410
|
+
pathParams: z91.object({ id: z91.string() }),
|
6380
6411
|
headers: DefaultHeaderSchema,
|
6381
6412
|
body: UpdateWrapUpFormSchema,
|
6382
6413
|
responses: {
|
6383
6414
|
201: DefaultSuccessResponseSchema.extend({
|
6384
6415
|
wrapUpForm: WrapUpFormSchema
|
6385
6416
|
}),
|
6386
|
-
400:
|
6387
|
-
message:
|
6417
|
+
400: z91.object({
|
6418
|
+
message: z91.string()
|
6388
6419
|
}),
|
6389
6420
|
401: DefaultUnauthorizedSchema,
|
6390
6421
|
500: DefaultErrorResponseSchema
|
@@ -6397,28 +6428,28 @@ var wrapUpFormContract = initContract34().router(
|
|
6397
6428
|
|
6398
6429
|
// src/upload/index.ts
|
6399
6430
|
import { initContract as initContract35 } from "@ts-rest/core";
|
6400
|
-
import
|
6431
|
+
import z92 from "zod";
|
6401
6432
|
var uploadContract = initContract35().router(
|
6402
6433
|
{
|
6403
6434
|
rename: {
|
6404
6435
|
method: "POST",
|
6405
6436
|
path: "/:id/rename",
|
6406
|
-
pathParams:
|
6407
|
-
id:
|
6437
|
+
pathParams: z92.object({
|
6438
|
+
id: z92.string()
|
6408
6439
|
}),
|
6409
6440
|
headers: DefaultHeaderSchema,
|
6410
6441
|
responses: {
|
6411
6442
|
201: DefaultSuccessResponseSchema.extend({
|
6412
|
-
message:
|
6443
|
+
message: z92.string()
|
6413
6444
|
}),
|
6414
|
-
400:
|
6415
|
-
message:
|
6445
|
+
400: z92.object({
|
6446
|
+
message: z92.string()
|
6416
6447
|
}),
|
6417
|
-
409:
|
6418
|
-
message:
|
6448
|
+
409: z92.object({
|
6449
|
+
message: z92.string()
|
6419
6450
|
}),
|
6420
|
-
500:
|
6421
|
-
message:
|
6451
|
+
500: z92.object({
|
6452
|
+
message: z92.string()
|
6422
6453
|
}),
|
6423
6454
|
401: DefaultUnauthorizedSchema,
|
6424
6455
|
404: DefaultNotFoundSchema,
|
@@ -6430,23 +6461,23 @@ var uploadContract = initContract35().router(
|
|
6430
6461
|
delete: {
|
6431
6462
|
method: "DELETE",
|
6432
6463
|
path: "/:id",
|
6433
|
-
pathParams:
|
6434
|
-
id:
|
6464
|
+
pathParams: z92.object({
|
6465
|
+
id: z92.string()
|
6435
6466
|
}),
|
6436
6467
|
headers: DefaultHeaderSchema,
|
6437
6468
|
body: null,
|
6438
6469
|
responses: {
|
6439
6470
|
201: DefaultSuccessResponseSchema.extend({
|
6440
|
-
message:
|
6471
|
+
message: z92.string()
|
6441
6472
|
}),
|
6442
|
-
400:
|
6443
|
-
message:
|
6473
|
+
400: z92.object({
|
6474
|
+
message: z92.string()
|
6444
6475
|
}),
|
6445
|
-
409:
|
6446
|
-
message:
|
6476
|
+
409: z92.object({
|
6477
|
+
message: z92.string()
|
6447
6478
|
}),
|
6448
|
-
500:
|
6449
|
-
message:
|
6479
|
+
500: z92.object({
|
6480
|
+
message: z92.string()
|
6450
6481
|
}),
|
6451
6482
|
401: DefaultUnauthorizedSchema,
|
6452
6483
|
404: DefaultNotFoundSchema,
|
@@ -6461,19 +6492,19 @@ var uploadContract = initContract35().router(
|
|
6461
6492
|
);
|
6462
6493
|
|
6463
6494
|
// src/viber/index.ts
|
6464
|
-
import
|
6495
|
+
import z94 from "zod";
|
6465
6496
|
|
6466
6497
|
// src/viber/validation.ts
|
6467
|
-
import
|
6468
|
-
var ViberChannelSchema =
|
6469
|
-
name:
|
6470
|
-
accessToken:
|
6471
|
-
actor:
|
6472
|
-
id:
|
6473
|
-
name:
|
6474
|
-
email:
|
6475
|
-
address:
|
6476
|
-
phone:
|
6498
|
+
import z93 from "zod";
|
6499
|
+
var ViberChannelSchema = z93.object({
|
6500
|
+
name: z93.string(),
|
6501
|
+
accessToken: z93.string(),
|
6502
|
+
actor: z93.object({
|
6503
|
+
id: z93.string().uuid(),
|
6504
|
+
name: z93.string(),
|
6505
|
+
email: z93.string().email(),
|
6506
|
+
address: z93.string().nullable(),
|
6507
|
+
phone: z93.string().nullable()
|
6477
6508
|
}).optional()
|
6478
6509
|
});
|
6479
6510
|
|
@@ -6502,8 +6533,8 @@ var viberContract = initContract36().router({
|
|
6502
6533
|
}),
|
6503
6534
|
400: DefaultErrorResponseSchema
|
6504
6535
|
},
|
6505
|
-
body:
|
6506
|
-
id:
|
6536
|
+
body: z94.object({
|
6537
|
+
id: z94.string().uuid()
|
6507
6538
|
}),
|
6508
6539
|
summary: "Connect viber channel"
|
6509
6540
|
},
|
@@ -6519,8 +6550,8 @@ var viberContract = initContract36().router({
|
|
6519
6550
|
reconnect: {
|
6520
6551
|
method: "POST",
|
6521
6552
|
path: "/reconnect/:channelId",
|
6522
|
-
pathParams:
|
6523
|
-
channelId:
|
6553
|
+
pathParams: z94.object({
|
6554
|
+
channelId: z94.string().uuid()
|
6524
6555
|
}),
|
6525
6556
|
responses: {
|
6526
6557
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6535,8 +6566,8 @@ var viberContract = initContract36().router({
|
|
6535
6566
|
delete: {
|
6536
6567
|
method: "DELETE",
|
6537
6568
|
path: "/delete/:channelId",
|
6538
|
-
pathParams:
|
6539
|
-
channelId:
|
6569
|
+
pathParams: z94.object({
|
6570
|
+
channelId: z94.string().uuid()
|
6540
6571
|
}),
|
6541
6572
|
body: null,
|
6542
6573
|
responses: {
|
@@ -6549,58 +6580,58 @@ var viberContract = initContract36().router({
|
|
6549
6580
|
|
6550
6581
|
// src/notification/index.ts
|
6551
6582
|
import { initContract as initContract37 } from "@ts-rest/core";
|
6552
|
-
import
|
6583
|
+
import z97 from "zod";
|
6553
6584
|
|
6554
6585
|
// src/notification/validation.ts
|
6555
|
-
import
|
6586
|
+
import z96 from "zod";
|
6556
6587
|
|
6557
6588
|
// src/notification/schema.ts
|
6558
|
-
import
|
6559
|
-
var NotificationChangeSchema =
|
6560
|
-
id:
|
6561
|
-
createdAt:
|
6562
|
-
updatedAt:
|
6563
|
-
deletedAt:
|
6564
|
-
actorId:
|
6589
|
+
import z95 from "zod";
|
6590
|
+
var NotificationChangeSchema = z95.object({
|
6591
|
+
id: z95.string().uuid(),
|
6592
|
+
createdAt: z95.date(),
|
6593
|
+
updatedAt: z95.date(),
|
6594
|
+
deletedAt: z95.date().nullable(),
|
6595
|
+
actorId: z95.string().uuid(),
|
6565
6596
|
actor: UserSchema,
|
6566
|
-
notificationObjectId:
|
6567
|
-
readAt:
|
6568
|
-
});
|
6569
|
-
var NotificationObjectSchema =
|
6570
|
-
id:
|
6571
|
-
createdAt:
|
6572
|
-
updatedAt:
|
6573
|
-
deletedAt:
|
6574
|
-
data:
|
6597
|
+
notificationObjectId: z95.string().uuid(),
|
6598
|
+
readAt: z95.date()
|
6599
|
+
});
|
6600
|
+
var NotificationObjectSchema = z95.object({
|
6601
|
+
id: z95.string().uuid(),
|
6602
|
+
createdAt: z95.date(),
|
6603
|
+
updatedAt: z95.date(),
|
6604
|
+
deletedAt: z95.date().nullable(),
|
6605
|
+
data: z95.string(),
|
6575
6606
|
notificationChange: NotificationChangeSchema
|
6576
6607
|
});
|
6577
|
-
var NotificationSchema =
|
6578
|
-
id:
|
6579
|
-
createdAt:
|
6580
|
-
updatedAt:
|
6581
|
-
deletedAt:
|
6582
|
-
notificationObjectId:
|
6583
|
-
notifierId:
|
6608
|
+
var NotificationSchema = z95.object({
|
6609
|
+
id: z95.string().uuid(),
|
6610
|
+
createdAt: z95.date(),
|
6611
|
+
updatedAt: z95.date(),
|
6612
|
+
deletedAt: z95.date().nullable(),
|
6613
|
+
notificationObjectId: z95.string().uuid(),
|
6614
|
+
notifierId: z95.string().uuid(),
|
6584
6615
|
notificationObject: NotificationObjectSchema,
|
6585
|
-
readAt:
|
6616
|
+
readAt: z95.date()
|
6586
6617
|
});
|
6587
6618
|
|
6588
6619
|
// src/notification/validation.ts
|
6589
|
-
var GetNotificationsRequestSchema =
|
6590
|
-
page:
|
6591
|
-
pageSize:
|
6620
|
+
var GetNotificationsRequestSchema = z96.object({
|
6621
|
+
page: z96.coerce.number().default(1),
|
6622
|
+
pageSize: z96.coerce.number().default(10)
|
6592
6623
|
});
|
6593
|
-
var GetNotificationsResponseSchema =
|
6594
|
-
notificationCount:
|
6595
|
-
notifications:
|
6596
|
-
total:
|
6597
|
-
page:
|
6598
|
-
pageSize:
|
6599
|
-
lastPage:
|
6600
|
-
totalUnreadCount:
|
6624
|
+
var GetNotificationsResponseSchema = z96.object({
|
6625
|
+
notificationCount: z96.number(),
|
6626
|
+
notifications: z96.array(NotificationSchema),
|
6627
|
+
total: z96.number(),
|
6628
|
+
page: z96.number(),
|
6629
|
+
pageSize: z96.number(),
|
6630
|
+
lastPage: z96.number(),
|
6631
|
+
totalUnreadCount: z96.number().optional()
|
6601
6632
|
});
|
6602
|
-
var ResetNotificationRequestSchema =
|
6603
|
-
userId:
|
6633
|
+
var ResetNotificationRequestSchema = z96.object({
|
6634
|
+
userId: z96.string()
|
6604
6635
|
});
|
6605
6636
|
|
6606
6637
|
// src/notification/index.ts
|
@@ -6614,14 +6645,14 @@ var userNotificationContract = initContract37().router(
|
|
6614
6645
|
200: DefaultSuccessResponseSchema.extend({
|
6615
6646
|
data: GetNotificationsResponseSchema
|
6616
6647
|
}),
|
6617
|
-
400:
|
6618
|
-
message:
|
6648
|
+
400: z97.object({
|
6649
|
+
message: z97.string()
|
6619
6650
|
}),
|
6620
|
-
409:
|
6621
|
-
message:
|
6651
|
+
409: z97.object({
|
6652
|
+
message: z97.string()
|
6622
6653
|
}),
|
6623
|
-
500:
|
6624
|
-
message:
|
6654
|
+
500: z97.object({
|
6655
|
+
message: z97.string()
|
6625
6656
|
}),
|
6626
6657
|
401: DefaultUnauthorizedSchema,
|
6627
6658
|
404: DefaultNotFoundSchema,
|
@@ -6634,16 +6665,16 @@ var userNotificationContract = initContract37().router(
|
|
6634
6665
|
path: "/new_notifications_count",
|
6635
6666
|
responses: {
|
6636
6667
|
200: DefaultSuccessResponseSchema.extend({
|
6637
|
-
total:
|
6668
|
+
total: z97.number()
|
6638
6669
|
}),
|
6639
|
-
400:
|
6640
|
-
message:
|
6670
|
+
400: z97.object({
|
6671
|
+
message: z97.string()
|
6641
6672
|
}),
|
6642
|
-
409:
|
6643
|
-
message:
|
6673
|
+
409: z97.object({
|
6674
|
+
message: z97.string()
|
6644
6675
|
}),
|
6645
|
-
500:
|
6646
|
-
message:
|
6676
|
+
500: z97.object({
|
6677
|
+
message: z97.string()
|
6647
6678
|
}),
|
6648
6679
|
401: DefaultUnauthorizedSchema,
|
6649
6680
|
404: DefaultNotFoundSchema,
|
@@ -6658,14 +6689,14 @@ var userNotificationContract = initContract37().router(
|
|
6658
6689
|
201: DefaultSuccessResponseSchema.extend({
|
6659
6690
|
data: UserSchema
|
6660
6691
|
}),
|
6661
|
-
400:
|
6662
|
-
message:
|
6692
|
+
400: z97.object({
|
6693
|
+
message: z97.string()
|
6663
6694
|
}),
|
6664
|
-
409:
|
6665
|
-
message:
|
6695
|
+
409: z97.object({
|
6696
|
+
message: z97.string()
|
6666
6697
|
}),
|
6667
|
-
500:
|
6668
|
-
message:
|
6698
|
+
500: z97.object({
|
6699
|
+
message: z97.string()
|
6669
6700
|
}),
|
6670
6701
|
401: DefaultUnauthorizedSchema,
|
6671
6702
|
404: DefaultNotFoundSchema,
|
@@ -6677,19 +6708,19 @@ var userNotificationContract = initContract37().router(
|
|
6677
6708
|
readNotification: {
|
6678
6709
|
method: "POST",
|
6679
6710
|
path: "/read/:id",
|
6680
|
-
pathParams:
|
6711
|
+
pathParams: z97.object({ id: z97.string() }),
|
6681
6712
|
responses: {
|
6682
6713
|
201: DefaultSuccessResponseSchema.extend({
|
6683
6714
|
data: NotificationSchema
|
6684
6715
|
}),
|
6685
|
-
400:
|
6686
|
-
message:
|
6716
|
+
400: z97.object({
|
6717
|
+
message: z97.string()
|
6687
6718
|
}),
|
6688
|
-
409:
|
6689
|
-
message:
|
6719
|
+
409: z97.object({
|
6720
|
+
message: z97.string()
|
6690
6721
|
}),
|
6691
|
-
500:
|
6692
|
-
message:
|
6722
|
+
500: z97.object({
|
6723
|
+
message: z97.string()
|
6693
6724
|
}),
|
6694
6725
|
401: DefaultUnauthorizedSchema,
|
6695
6726
|
404: DefaultNotFoundSchema,
|
@@ -6771,6 +6802,7 @@ export {
|
|
6771
6802
|
dashboardContract,
|
6772
6803
|
evaluateFormContract,
|
6773
6804
|
extensionContract2 as extensionContract,
|
6805
|
+
mailContract,
|
6774
6806
|
mainChatContract,
|
6775
6807
|
notificationContract,
|
6776
6808
|
permissionContract,
|