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