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