@kl1/contracts 1.0.94 → 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 +776 -745
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +775 -745
- package/dist/index.mjs.map +1 -1
- package/dist/src/contract.d.ts +733 -258
- package/dist/src/contract.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/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/src/app/index.d.ts +0 -17
- package/dist/src/app/index.d.ts.map +0 -1
- package/dist/src/chatwoot/index.d.ts +0 -7527
- package/dist/src/chatwoot/index.d.ts.map +0 -1
- package/dist/src/chatwoot/schema.d.ts +0 -79
- package/dist/src/chatwoot/schema.d.ts.map +0 -1
- package/dist/src/chatwoot/validation.d.ts +0 -53
- package/dist/src/chatwoot/validation.d.ts.map +0 -1
- package/dist/src/mail/mail-server.d.ts +0 -216
- package/dist/src/mail/mail-server.d.ts.map +0 -1
- package/dist/src/platform-contact/schema.d.ts +0 -30
- package/dist/src/platform-contact/schema.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
@@ -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,52 +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
5099
|
if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
|
5071
5100
|
ctx.addIssue({
|
5072
|
-
code:
|
5101
|
+
code: z75.ZodIssueCode.custom,
|
5073
5102
|
path: ["time"],
|
5074
5103
|
message: "time is required."
|
5075
5104
|
});
|
5076
5105
|
}
|
5077
5106
|
if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
|
5078
5107
|
ctx.addIssue({
|
5079
|
-
code:
|
5108
|
+
code: z75.ZodIssueCode.custom,
|
5080
5109
|
path: ["queueList"],
|
5081
5110
|
message: "queueList is required."
|
5082
5111
|
});
|
5083
5112
|
}
|
5084
5113
|
if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
|
5085
5114
|
ctx.addIssue({
|
5086
|
-
code:
|
5115
|
+
code: z75.ZodIssueCode.custom,
|
5087
5116
|
path: ["queueId"],
|
5088
5117
|
message: "queueId is required."
|
5089
5118
|
});
|
5090
5119
|
}
|
5091
5120
|
if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
|
5092
5121
|
ctx.addIssue({
|
5093
|
-
code:
|
5122
|
+
code: z75.ZodIssueCode.custom,
|
5094
5123
|
path: ["trunkList"],
|
5095
5124
|
message: "trunkList is required."
|
5096
5125
|
});
|
5097
5126
|
}
|
5098
5127
|
if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
|
5099
5128
|
ctx.addIssue({
|
5100
|
-
code:
|
5129
|
+
code: z75.ZodIssueCode.custom,
|
5101
5130
|
path: ["extensionList"],
|
5102
5131
|
message: "extensionList is required."
|
5103
5132
|
});
|
@@ -5108,161 +5137,161 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
5108
5137
|
import { initContract as initContract28 } from "@ts-rest/core";
|
5109
5138
|
|
5110
5139
|
// src/telephony-cdr/call-report.schema.ts
|
5111
|
-
import
|
5112
|
-
var ExtCallStatisticsListSchema =
|
5140
|
+
import z76 from "zod";
|
5141
|
+
var ExtCallStatisticsListSchema = z76.object({
|
5113
5142
|
/** @example "ext_num" */
|
5114
|
-
ext_num:
|
5143
|
+
ext_num: z76.string(),
|
5115
5144
|
/** @example "ext_name" */
|
5116
|
-
ext_name:
|
5145
|
+
ext_name: z76.string(),
|
5117
5146
|
/** @example 0 */
|
5118
|
-
answered_calls:
|
5147
|
+
answered_calls: z76.number(),
|
5119
5148
|
/** @example 0 */
|
5120
|
-
no_answer_calls:
|
5149
|
+
no_answer_calls: z76.number(),
|
5121
5150
|
/** @example 0 */
|
5122
|
-
busy_calls:
|
5151
|
+
busy_calls: z76.number(),
|
5123
5152
|
/** @example 0 */
|
5124
|
-
failed_calls:
|
5153
|
+
failed_calls: z76.number(),
|
5125
5154
|
/** @example 0 */
|
5126
|
-
voicemail_calls:
|
5155
|
+
voicemail_calls: z76.number(),
|
5127
5156
|
/** @example 0 */
|
5128
|
-
total_holding_time:
|
5157
|
+
total_holding_time: z76.number(),
|
5129
5158
|
/** @example 0 */
|
5130
|
-
total_talking_time:
|
5159
|
+
total_talking_time: z76.number(),
|
5131
5160
|
/** @example "src_name" */
|
5132
|
-
src_name:
|
5161
|
+
src_name: z76.string(),
|
5133
5162
|
/** @example 0 */
|
5134
|
-
total_call_count:
|
5163
|
+
total_call_count: z76.number(),
|
5135
5164
|
/** @example "mobile" */
|
5136
|
-
mobile:
|
5137
|
-
});
|
5138
|
-
var ExtStatisticSchema =
|
5139
|
-
ext_num:
|
5140
|
-
ext_name:
|
5141
|
-
answered_calls:
|
5142
|
-
no_answer_calls:
|
5143
|
-
busy_calls:
|
5144
|
-
failed_calls:
|
5145
|
-
voicemail_calls:
|
5146
|
-
total_holding_time:
|
5147
|
-
total_talking_time:
|
5148
|
-
time:
|
5149
|
-
mobile:
|
5150
|
-
});
|
5151
|
-
var ExtCallActivityListSchema =
|
5152
|
-
time:
|
5153
|
-
answered_calls:
|
5154
|
-
no_answer_calls:
|
5155
|
-
busy_calls:
|
5156
|
-
failed_calls:
|
5157
|
-
voicemail_calls:
|
5158
|
-
total_holding_time:
|
5159
|
-
total_talking_time:
|
5160
|
-
ext_statistics:
|
5161
|
-
});
|
5162
|
-
var TrunkList =
|
5163
|
-
trunk_name:
|
5164
|
-
total_calls:
|
5165
|
-
});
|
5166
|
-
var TrunkActivityListSchema =
|
5167
|
-
time:
|
5168
|
-
trunk_list:
|
5169
|
-
});
|
5170
|
-
var QueueAvgWaitTalkTimeListSchema =
|
5171
|
-
time:
|
5172
|
-
avg_wait_time:
|
5173
|
-
avg_talk_time:
|
5174
|
-
});
|
5175
|
-
var SatisfactionListSchema =
|
5176
|
-
press_key:
|
5177
|
-
total:
|
5178
|
-
key_point:
|
5179
|
-
});
|
5180
|
-
var agentListSchema =
|
5181
|
-
agent_name:
|
5182
|
-
agent_num:
|
5183
|
-
satisfaction_list:
|
5184
|
-
total_key:
|
5185
|
-
total_point:
|
5186
|
-
average_point:
|
5187
|
-
});
|
5188
|
-
var QueueSatisfactionSchema =
|
5189
|
-
queue_name:
|
5190
|
-
queue_num:
|
5191
|
-
satisfaction_list:
|
5192
|
-
agent_list:
|
5193
|
-
total_key:
|
5194
|
-
total_point:
|
5195
|
-
average_point:
|
5196
|
-
});
|
5197
|
-
var QueuePerformanceListSchema =
|
5198
|
-
queue:
|
5199
|
-
total_calls:
|
5200
|
-
answered_calls:
|
5201
|
-
missed_calls:
|
5202
|
-
abandoned_calls:
|
5203
|
-
average_waiting_time:
|
5204
|
-
average_talking_time:
|
5205
|
-
max_waiting_time:
|
5206
|
-
answered_rate:
|
5207
|
-
missed_rate:
|
5208
|
-
abandoned_rate:
|
5209
|
-
sla:
|
5210
|
-
});
|
5211
|
-
var QueueAgentMissCallsListSchema =
|
5212
|
-
agent_name:
|
5213
|
-
agent_num:
|
5214
|
-
time:
|
5215
|
-
total_wait_time:
|
5216
|
-
src_name:
|
5217
|
-
src_num:
|
5218
|
-
queue_status:
|
5219
|
-
polling_attempts:
|
5220
|
-
missed_reason:
|
5221
|
-
});
|
5222
|
-
var QueueAgentInOutCallsListSchema =
|
5223
|
-
agent_name:
|
5224
|
-
agent_num:
|
5225
|
-
inbound_calls:
|
5226
|
-
inbound_duration:
|
5227
|
-
outbound_calls:
|
5228
|
-
outbound_duration:
|
5229
|
-
total_calls:
|
5230
|
-
total_duration:
|
5231
|
-
average_talk_duration:
|
5232
|
-
});
|
5233
|
-
var CallReportModel =
|
5234
|
-
errcode:
|
5235
|
-
errmsg:
|
5236
|
-
total_number:
|
5237
|
-
is_12hour:
|
5238
|
-
ext_call_statistics_list:
|
5239
|
-
ext_call_activity_list:
|
5240
|
-
trunk_activity_list:
|
5241
|
-
queue_avg_wait_talk_time_list:
|
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(),
|
5242
5271
|
queue_satisfaction: QueueSatisfactionSchema.optional(),
|
5243
|
-
queue_performance_list:
|
5244
|
-
queue_agent_miss_calls_list:
|
5245
|
-
queue_agent_in_out_calls_list:
|
5246
|
-
callback_result:
|
5247
|
-
page:
|
5248
|
-
pageSize:
|
5249
|
-
});
|
5250
|
-
var CallReportSchema =
|
5251
|
-
errcode:
|
5252
|
-
errmsg:
|
5253
|
-
total_number:
|
5254
|
-
is_12hour:
|
5255
|
-
ext_call_statistics_list:
|
5256
|
-
ext_call_activity_list:
|
5257
|
-
trunk_activity_list:
|
5258
|
-
queue_avg_wait_talk_time_list:
|
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(),
|
5259
5288
|
queue_satisfaction: QueueSatisfactionSchema.optional(),
|
5260
|
-
queue_performance_list:
|
5261
|
-
queue_agent_miss_calls_list:
|
5262
|
-
queue_agent_in_out_calls_list:
|
5263
|
-
callback_result:
|
5264
|
-
page:
|
5265
|
-
pageSize:
|
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()
|
5266
5295
|
});
|
5267
5296
|
|
5268
5297
|
// src/telephony-cdr/index.ts
|
@@ -5275,10 +5304,10 @@ var telephonyCdrContract = initContract28().router(
|
|
5275
5304
|
query: GetAllTelephonyCdrSchema,
|
5276
5305
|
responses: {
|
5277
5306
|
200: DefaultSuccessResponseSchema.extend({
|
5278
|
-
total:
|
5279
|
-
page:
|
5280
|
-
pageSize:
|
5281
|
-
telephonyCdrs:
|
5307
|
+
total: z77.number(),
|
5308
|
+
page: z77.number(),
|
5309
|
+
pageSize: z77.number(),
|
5310
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
5282
5311
|
}),
|
5283
5312
|
401: DefaultUnauthorizedSchema
|
5284
5313
|
},
|
@@ -5291,10 +5320,10 @@ var telephonyCdrContract = initContract28().router(
|
|
5291
5320
|
query: GetAllTelephonyCdrSchema,
|
5292
5321
|
responses: {
|
5293
5322
|
200: DefaultSuccessResponseSchema.extend({
|
5294
|
-
total:
|
5295
|
-
page:
|
5296
|
-
pageSize:
|
5297
|
-
telephonyCdrs:
|
5323
|
+
total: z77.number(),
|
5324
|
+
page: z77.number(),
|
5325
|
+
pageSize: z77.number(),
|
5326
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
5298
5327
|
}),
|
5299
5328
|
401: DefaultUnauthorizedSchema
|
5300
5329
|
},
|
@@ -5307,10 +5336,10 @@ var telephonyCdrContract = initContract28().router(
|
|
5307
5336
|
query: GetRecentTelephonyCdrSchema,
|
5308
5337
|
responses: {
|
5309
5338
|
200: DefaultSuccessResponseSchema.extend({
|
5310
|
-
total:
|
5311
|
-
page:
|
5312
|
-
pageSize:
|
5313
|
-
telephonyCdrs:
|
5339
|
+
total: z77.number(),
|
5340
|
+
page: z77.number(),
|
5341
|
+
pageSize: z77.number(),
|
5342
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
5314
5343
|
}),
|
5315
5344
|
401: DefaultUnauthorizedSchema
|
5316
5345
|
},
|
@@ -5402,35 +5431,35 @@ var telephonyCdrContract = initContract28().router(
|
|
5402
5431
|
|
5403
5432
|
// src/telephony-extension/index.ts
|
5404
5433
|
import { initContract as initContract29 } from "@ts-rest/core";
|
5405
|
-
import
|
5434
|
+
import z79 from "zod";
|
5406
5435
|
|
5407
5436
|
// src/telephony-extension/schema.ts
|
5408
|
-
import
|
5409
|
-
var TelephonyExtensionSchema3 =
|
5410
|
-
errcode:
|
5411
|
-
errmsg:
|
5412
|
-
total_number:
|
5413
|
-
data:
|
5414
|
-
|
5415
|
-
id:
|
5416
|
-
online_status:
|
5417
|
-
fx_phone:
|
5418
|
-
sip_phone:
|
5419
|
-
status:
|
5420
|
-
ext_dev_type:
|
5421
|
-
}),
|
5422
|
-
linkus_desktop:
|
5423
|
-
linkus_mobile:
|
5424
|
-
linkus_web:
|
5425
|
-
status:
|
5426
|
-
ext_dev_type:
|
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()
|
5427
5456
|
})
|
5428
5457
|
}).optional(),
|
5429
|
-
presence_status:
|
5430
|
-
number:
|
5431
|
-
caller_id_name:
|
5432
|
-
role_name:
|
5433
|
-
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()
|
5434
5463
|
})
|
5435
5464
|
)
|
5436
5465
|
});
|
@@ -5445,8 +5474,8 @@ var telephonyExtensionContract = initContract29().router(
|
|
5445
5474
|
query: null,
|
5446
5475
|
responses: {
|
5447
5476
|
200: TelephonyExtensionSchema3,
|
5448
|
-
400:
|
5449
|
-
message:
|
5477
|
+
400: z79.object({
|
5478
|
+
message: z79.string()
|
5450
5479
|
}),
|
5451
5480
|
401: DefaultUnauthorizedSchema,
|
5452
5481
|
500: DefaultErrorResponseSchema
|
@@ -5459,10 +5488,10 @@ var telephonyExtensionContract = initContract29().router(
|
|
5459
5488
|
|
5460
5489
|
// src/ticket/index.ts
|
5461
5490
|
import { initContract as initContract30 } from "@ts-rest/core";
|
5462
|
-
import
|
5491
|
+
import z81 from "zod";
|
5463
5492
|
|
5464
5493
|
// src/ticket/validation.ts
|
5465
|
-
import
|
5494
|
+
import z80 from "zod";
|
5466
5495
|
var addErrorMessage2 = (field) => {
|
5467
5496
|
return field.refine(
|
5468
5497
|
({ isRequired, value }) => {
|
@@ -5480,106 +5509,106 @@ var addErrorMessage2 = (field) => {
|
|
5480
5509
|
}
|
5481
5510
|
);
|
5482
5511
|
};
|
5483
|
-
var BaseSchema3 =
|
5484
|
-
isRequired:
|
5485
|
-
attributeId:
|
5512
|
+
var BaseSchema3 = z80.object({
|
5513
|
+
isRequired: z80.boolean(),
|
5514
|
+
attributeId: z80.string()
|
5486
5515
|
});
|
5487
5516
|
var SingleValue2 = addErrorMessage2(
|
5488
5517
|
BaseSchema3.extend({
|
5489
|
-
value:
|
5518
|
+
value: z80.string()
|
5490
5519
|
})
|
5491
5520
|
);
|
5492
|
-
var CreateTicketValidationSchema =
|
5521
|
+
var CreateTicketValidationSchema = z80.object({
|
5493
5522
|
title: SingleValue2,
|
5494
5523
|
description: SingleValue2,
|
5495
5524
|
status: SingleValue2,
|
5496
5525
|
type: SingleValue2,
|
5497
5526
|
priority: SingleValue2,
|
5498
5527
|
contact: SingleValue2,
|
5499
|
-
assignee:
|
5500
|
-
isRequired:
|
5501
|
-
attributeId:
|
5502
|
-
value:
|
5528
|
+
assignee: z80.object({
|
5529
|
+
isRequired: z80.boolean(),
|
5530
|
+
attributeId: z80.string(),
|
5531
|
+
value: z80.string()
|
5503
5532
|
}),
|
5504
5533
|
channel: SingleValue2,
|
5505
|
-
tags: addErrorMessage2(BaseSchema3.extend({ value:
|
5506
|
-
categories: BaseSchema3.extend({ value:
|
5507
|
-
customFields:
|
5534
|
+
tags: addErrorMessage2(BaseSchema3.extend({ value: z80.array(z80.string()) })),
|
5535
|
+
categories: BaseSchema3.extend({ value: z80.array(z80.string()) }),
|
5536
|
+
customFields: z80.array(
|
5508
5537
|
addErrorMessage2(
|
5509
5538
|
BaseSchema3.extend({
|
5510
|
-
value:
|
5511
|
-
type:
|
5512
|
-
isDefaultAttribute:
|
5539
|
+
value: z80.union([z80.string(), z80.array(z80.string())]),
|
5540
|
+
type: z80.string(),
|
5541
|
+
isDefaultAttribute: z80.boolean()
|
5513
5542
|
})
|
5514
5543
|
)
|
5515
5544
|
),
|
5516
|
-
reasonToAssign:
|
5545
|
+
reasonToAssign: z80.object({ value: z80.string() }).optional()
|
5517
5546
|
});
|
5518
5547
|
var UpdateTicketValidationSchema = CreateTicketValidationSchema;
|
5519
|
-
var TicketAttachmentRecordSchema =
|
5520
|
-
bucketName:
|
5521
|
-
fileKey:
|
5522
|
-
fileName:
|
5523
|
-
fileSize:
|
5524
|
-
url:
|
5525
|
-
});
|
5526
|
-
var CreateTicketAttachmentRecordsSchema =
|
5527
|
-
ticketId:
|
5528
|
-
attributeId:
|
5529
|
-
ticketAttachmentRecords:
|
5530
|
-
});
|
5531
|
-
var TicketParamsSchema =
|
5532
|
-
page:
|
5533
|
-
pageSize:
|
5534
|
-
});
|
5535
|
-
var CustomFieldQuery =
|
5536
|
-
attributeId:
|
5537
|
-
type:
|
5538
|
-
value:
|
5539
|
-
});
|
5540
|
-
var GetAllTicketQuerySchema =
|
5541
|
-
page:
|
5542
|
-
pageSize:
|
5543
|
-
selectedDate:
|
5544
|
-
keyword:
|
5545
|
-
title:
|
5546
|
-
description:
|
5547
|
-
status:
|
5548
|
-
priority:
|
5549
|
-
channel:
|
5550
|
-
type:
|
5551
|
-
ticketType:
|
5552
|
-
contact:
|
5553
|
-
tags:
|
5554
|
-
categories:
|
5555
|
-
assignee:
|
5556
|
-
customFields:
|
5557
|
-
|
5558
|
-
attributeId:
|
5559
|
-
type:
|
5560
|
-
value:
|
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())])
|
5561
5590
|
})
|
5562
5591
|
)
|
5563
5592
|
}).partial();
|
5564
|
-
var ExportAllTicketQuerySchema =
|
5565
|
-
agent:
|
5566
|
-
selectedDate:
|
5567
|
-
keyword:
|
5568
|
-
title:
|
5569
|
-
description:
|
5570
|
-
status:
|
5571
|
-
priority:
|
5572
|
-
channel:
|
5573
|
-
type:
|
5574
|
-
ticketType:
|
5575
|
-
contact:
|
5576
|
-
tags:
|
5577
|
-
categories:
|
5578
|
-
customFields:
|
5579
|
-
|
5580
|
-
attributeId:
|
5581
|
-
type:
|
5582
|
-
value:
|
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())])
|
5583
5612
|
})
|
5584
5613
|
)
|
5585
5614
|
}).partial();
|
@@ -5595,14 +5624,14 @@ var ticketContract = initContract30().router(
|
|
5595
5624
|
201: DefaultSuccessResponseSchema.extend({
|
5596
5625
|
data: TicketSchema
|
5597
5626
|
}),
|
5598
|
-
400:
|
5599
|
-
message:
|
5627
|
+
400: z81.object({
|
5628
|
+
message: z81.string()
|
5600
5629
|
}),
|
5601
|
-
409:
|
5602
|
-
message:
|
5630
|
+
409: z81.object({
|
5631
|
+
message: z81.string()
|
5603
5632
|
}),
|
5604
|
-
500:
|
5605
|
-
message:
|
5633
|
+
500: z81.object({
|
5634
|
+
message: z81.string()
|
5606
5635
|
}),
|
5607
5636
|
401: DefaultUnauthorizedSchema,
|
5608
5637
|
404: DefaultNotFoundSchema,
|
@@ -5623,8 +5652,8 @@ var ticketContract = initContract30().router(
|
|
5623
5652
|
TicketSchema
|
5624
5653
|
)
|
5625
5654
|
}),
|
5626
|
-
400:
|
5627
|
-
message:
|
5655
|
+
400: z81.object({
|
5656
|
+
message: z81.string()
|
5628
5657
|
}),
|
5629
5658
|
401: DefaultUnauthorizedSchema,
|
5630
5659
|
500: DefaultErrorResponseSchema
|
@@ -5634,14 +5663,14 @@ var ticketContract = initContract30().router(
|
|
5634
5663
|
getTicketById: {
|
5635
5664
|
method: "GET",
|
5636
5665
|
path: "/:id",
|
5637
|
-
pathParams:
|
5666
|
+
pathParams: z81.object({ id: z81.string() }),
|
5638
5667
|
headers: DefaultHeaderSchema,
|
5639
5668
|
responses: {
|
5640
5669
|
200: DefaultSuccessResponseSchema.extend({
|
5641
5670
|
data: TicketSchema
|
5642
5671
|
}),
|
5643
|
-
400:
|
5644
|
-
message:
|
5672
|
+
400: z81.object({
|
5673
|
+
message: z81.string()
|
5645
5674
|
}),
|
5646
5675
|
401: DefaultUnauthorizedSchema,
|
5647
5676
|
500: DefaultErrorResponseSchema
|
@@ -5651,15 +5680,15 @@ var ticketContract = initContract30().router(
|
|
5651
5680
|
getTicketByContactId: {
|
5652
5681
|
method: "GET",
|
5653
5682
|
path: "/contact/:id",
|
5654
|
-
pathParams:
|
5683
|
+
pathParams: z81.object({ id: z81.string() }),
|
5655
5684
|
query: TicketParamsSchema,
|
5656
5685
|
headers: DefaultHeaderSchema,
|
5657
5686
|
responses: {
|
5658
5687
|
200: DefaultSuccessResponseSchema.extend({
|
5659
5688
|
data: WithPagination(TicketSchema)
|
5660
5689
|
}),
|
5661
|
-
400:
|
5662
|
-
message:
|
5690
|
+
400: z81.object({
|
5691
|
+
message: z81.string()
|
5663
5692
|
}),
|
5664
5693
|
401: DefaultUnauthorizedSchema,
|
5665
5694
|
500: DefaultErrorResponseSchema
|
@@ -5669,21 +5698,21 @@ var ticketContract = initContract30().router(
|
|
5669
5698
|
updateTicket: {
|
5670
5699
|
method: "PATCH",
|
5671
5700
|
path: "/:id",
|
5672
|
-
pathParams:
|
5701
|
+
pathParams: z81.object({ id: z81.string() }),
|
5673
5702
|
body: UpdateTicketValidationSchema,
|
5674
5703
|
headers: DefaultHeaderSchema,
|
5675
5704
|
responses: {
|
5676
5705
|
201: DefaultSuccessResponseSchema.extend({
|
5677
5706
|
data: TicketSchema
|
5678
5707
|
}),
|
5679
|
-
400:
|
5680
|
-
message:
|
5708
|
+
400: z81.object({
|
5709
|
+
message: z81.string()
|
5681
5710
|
}),
|
5682
|
-
409:
|
5683
|
-
message:
|
5711
|
+
409: z81.object({
|
5712
|
+
message: z81.string()
|
5684
5713
|
}),
|
5685
|
-
500:
|
5686
|
-
message:
|
5714
|
+
500: z81.object({
|
5715
|
+
message: z81.string()
|
5687
5716
|
}),
|
5688
5717
|
401: DefaultUnauthorizedSchema,
|
5689
5718
|
404: DefaultNotFoundSchema,
|
@@ -5694,11 +5723,11 @@ var ticketContract = initContract30().router(
|
|
5694
5723
|
deleteTicket: {
|
5695
5724
|
method: "DELETE",
|
5696
5725
|
path: "/:id",
|
5697
|
-
pathParams:
|
5726
|
+
pathParams: z81.object({ id: z81.string() }),
|
5698
5727
|
headers: DefaultHeaderSchema,
|
5699
5728
|
body: null,
|
5700
5729
|
responses: {
|
5701
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5730
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5702
5731
|
500: DefaultErrorResponseSchema
|
5703
5732
|
},
|
5704
5733
|
summary: "Delete a extension."
|
@@ -5706,19 +5735,19 @@ var ticketContract = initContract30().router(
|
|
5706
5735
|
updateDescription: {
|
5707
5736
|
method: "PATCH",
|
5708
5737
|
path: "/description/update/:id",
|
5709
|
-
pathParams:
|
5710
|
-
body:
|
5738
|
+
pathParams: z81.object({ id: z81.string() }),
|
5739
|
+
body: z81.object({ description: z81.string() }),
|
5711
5740
|
headers: DefaultHeaderSchema,
|
5712
5741
|
responses: {
|
5713
|
-
201: DefaultSuccessResponseSchema.extend({ message:
|
5714
|
-
400:
|
5715
|
-
message:
|
5742
|
+
201: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5743
|
+
400: z81.object({
|
5744
|
+
message: z81.string()
|
5716
5745
|
}),
|
5717
|
-
409:
|
5718
|
-
message:
|
5746
|
+
409: z81.object({
|
5747
|
+
message: z81.string()
|
5719
5748
|
}),
|
5720
|
-
500:
|
5721
|
-
message:
|
5749
|
+
500: z81.object({
|
5750
|
+
message: z81.string()
|
5722
5751
|
}),
|
5723
5752
|
401: DefaultUnauthorizedSchema,
|
5724
5753
|
404: DefaultNotFoundSchema,
|
@@ -5729,19 +5758,19 @@ var ticketContract = initContract30().router(
|
|
5729
5758
|
updateTitle: {
|
5730
5759
|
method: "PATCH",
|
5731
5760
|
path: "/title/update/:id",
|
5732
|
-
pathParams:
|
5733
|
-
body:
|
5761
|
+
pathParams: z81.object({ id: z81.string() }),
|
5762
|
+
body: z81.object({ title: z81.string() }),
|
5734
5763
|
headers: DefaultHeaderSchema,
|
5735
5764
|
responses: {
|
5736
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5737
|
-
400:
|
5738
|
-
message:
|
5765
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5766
|
+
400: z81.object({
|
5767
|
+
message: z81.string()
|
5739
5768
|
}),
|
5740
|
-
409:
|
5741
|
-
message:
|
5769
|
+
409: z81.object({
|
5770
|
+
message: z81.string()
|
5742
5771
|
}),
|
5743
|
-
500:
|
5744
|
-
message:
|
5772
|
+
500: z81.object({
|
5773
|
+
message: z81.string()
|
5745
5774
|
}),
|
5746
5775
|
401: DefaultUnauthorizedSchema,
|
5747
5776
|
404: DefaultNotFoundSchema,
|
@@ -5752,19 +5781,19 @@ var ticketContract = initContract30().router(
|
|
5752
5781
|
updateType: {
|
5753
5782
|
method: "PATCH",
|
5754
5783
|
path: "/type/update/:id",
|
5755
|
-
pathParams:
|
5756
|
-
body:
|
5784
|
+
pathParams: z81.object({ id: z81.string() }),
|
5785
|
+
body: z81.object({ type: z81.string() }),
|
5757
5786
|
headers: DefaultHeaderSchema,
|
5758
5787
|
responses: {
|
5759
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5760
|
-
400:
|
5761
|
-
message:
|
5788
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5789
|
+
400: z81.object({
|
5790
|
+
message: z81.string()
|
5762
5791
|
}),
|
5763
|
-
409:
|
5764
|
-
message:
|
5792
|
+
409: z81.object({
|
5793
|
+
message: z81.string()
|
5765
5794
|
}),
|
5766
|
-
500:
|
5767
|
-
message:
|
5795
|
+
500: z81.object({
|
5796
|
+
message: z81.string()
|
5768
5797
|
}),
|
5769
5798
|
401: DefaultUnauthorizedSchema,
|
5770
5799
|
404: DefaultNotFoundSchema,
|
@@ -5775,19 +5804,19 @@ var ticketContract = initContract30().router(
|
|
5775
5804
|
updateStatus: {
|
5776
5805
|
method: "PATCH",
|
5777
5806
|
path: "/status/update/:id",
|
5778
|
-
pathParams:
|
5779
|
-
body:
|
5807
|
+
pathParams: z81.object({ id: z81.string() }),
|
5808
|
+
body: z81.object({ status: z81.string() }),
|
5780
5809
|
headers: DefaultHeaderSchema,
|
5781
5810
|
responses: {
|
5782
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5783
|
-
400:
|
5784
|
-
message:
|
5811
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5812
|
+
400: z81.object({
|
5813
|
+
message: z81.string()
|
5785
5814
|
}),
|
5786
|
-
409:
|
5787
|
-
message:
|
5815
|
+
409: z81.object({
|
5816
|
+
message: z81.string()
|
5788
5817
|
}),
|
5789
|
-
500:
|
5790
|
-
message:
|
5818
|
+
500: z81.object({
|
5819
|
+
message: z81.string()
|
5791
5820
|
}),
|
5792
5821
|
401: DefaultUnauthorizedSchema,
|
5793
5822
|
404: DefaultNotFoundSchema,
|
@@ -5798,19 +5827,19 @@ var ticketContract = initContract30().router(
|
|
5798
5827
|
updatePriority: {
|
5799
5828
|
method: "PATCH",
|
5800
5829
|
path: "/priority/update/:id",
|
5801
|
-
pathParams:
|
5802
|
-
body:
|
5830
|
+
pathParams: z81.object({ id: z81.string() }),
|
5831
|
+
body: z81.object({ priority: z81.string() }),
|
5803
5832
|
headers: DefaultHeaderSchema,
|
5804
5833
|
responses: {
|
5805
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5806
|
-
400:
|
5807
|
-
message:
|
5834
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5835
|
+
400: z81.object({
|
5836
|
+
message: z81.string()
|
5808
5837
|
}),
|
5809
|
-
409:
|
5810
|
-
message:
|
5838
|
+
409: z81.object({
|
5839
|
+
message: z81.string()
|
5811
5840
|
}),
|
5812
|
-
500:
|
5813
|
-
message:
|
5841
|
+
500: z81.object({
|
5842
|
+
message: z81.string()
|
5814
5843
|
}),
|
5815
5844
|
401: DefaultUnauthorizedSchema,
|
5816
5845
|
404: DefaultNotFoundSchema,
|
@@ -5821,19 +5850,19 @@ var ticketContract = initContract30().router(
|
|
5821
5850
|
updateChannel: {
|
5822
5851
|
method: "PATCH",
|
5823
5852
|
path: "/channel/update/:id",
|
5824
|
-
pathParams:
|
5825
|
-
body:
|
5853
|
+
pathParams: z81.object({ id: z81.string() }),
|
5854
|
+
body: z81.object({ channel: z81.string() }),
|
5826
5855
|
headers: DefaultHeaderSchema,
|
5827
5856
|
responses: {
|
5828
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5829
|
-
400:
|
5830
|
-
message:
|
5857
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5858
|
+
400: z81.object({
|
5859
|
+
message: z81.string()
|
5831
5860
|
}),
|
5832
|
-
409:
|
5833
|
-
message:
|
5861
|
+
409: z81.object({
|
5862
|
+
message: z81.string()
|
5834
5863
|
}),
|
5835
|
-
500:
|
5836
|
-
message:
|
5864
|
+
500: z81.object({
|
5865
|
+
message: z81.string()
|
5837
5866
|
}),
|
5838
5867
|
401: DefaultUnauthorizedSchema,
|
5839
5868
|
404: DefaultNotFoundSchema,
|
@@ -5844,19 +5873,19 @@ var ticketContract = initContract30().router(
|
|
5844
5873
|
updateTags: {
|
5845
5874
|
method: "PATCH",
|
5846
5875
|
path: "/tags/update/:id",
|
5847
|
-
pathParams:
|
5848
|
-
body:
|
5876
|
+
pathParams: z81.object({ id: z81.string() }),
|
5877
|
+
body: z81.object({ tags: z81.array(z81.string()) }),
|
5849
5878
|
headers: DefaultHeaderSchema,
|
5850
5879
|
responses: {
|
5851
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5852
|
-
400:
|
5853
|
-
message:
|
5880
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
5881
|
+
400: z81.object({
|
5882
|
+
message: z81.string()
|
5854
5883
|
}),
|
5855
|
-
409:
|
5856
|
-
message:
|
5884
|
+
409: z81.object({
|
5885
|
+
message: z81.string()
|
5857
5886
|
}),
|
5858
|
-
500:
|
5859
|
-
message:
|
5887
|
+
500: z81.object({
|
5888
|
+
message: z81.string()
|
5860
5889
|
}),
|
5861
5890
|
401: DefaultUnauthorizedSchema,
|
5862
5891
|
404: DefaultNotFoundSchema,
|
@@ -5867,25 +5896,25 @@ var ticketContract = initContract30().router(
|
|
5867
5896
|
changeAssignee: {
|
5868
5897
|
method: "PATCH",
|
5869
5898
|
path: "/assignee/update/:id",
|
5870
|
-
pathParams:
|
5871
|
-
body:
|
5872
|
-
ticketId:
|
5873
|
-
assigneeId:
|
5874
|
-
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()
|
5875
5904
|
}),
|
5876
5905
|
headers: DefaultHeaderSchema,
|
5877
5906
|
responses: {
|
5878
5907
|
200: DefaultSuccessResponseSchema.extend({
|
5879
5908
|
data: TicketSchema
|
5880
5909
|
}),
|
5881
|
-
400:
|
5882
|
-
message:
|
5910
|
+
400: z81.object({
|
5911
|
+
message: z81.string()
|
5883
5912
|
}),
|
5884
|
-
409:
|
5885
|
-
message:
|
5913
|
+
409: z81.object({
|
5914
|
+
message: z81.string()
|
5886
5915
|
}),
|
5887
|
-
500:
|
5888
|
-
message:
|
5916
|
+
500: z81.object({
|
5917
|
+
message: z81.string()
|
5889
5918
|
}),
|
5890
5919
|
401: DefaultUnauthorizedSchema,
|
5891
5920
|
404: DefaultNotFoundSchema,
|
@@ -5896,14 +5925,14 @@ var ticketContract = initContract30().router(
|
|
5896
5925
|
getTicketCountByContact: {
|
5897
5926
|
method: "GET",
|
5898
5927
|
path: "/ticket_count/contact/:id",
|
5899
|
-
pathParams:
|
5928
|
+
pathParams: z81.object({ id: z81.string() }),
|
5900
5929
|
headers: DefaultHeaderSchema,
|
5901
5930
|
responses: {
|
5902
5931
|
200: DefaultSuccessResponseSchema.extend({
|
5903
5932
|
data: TicketCountByContactSchema
|
5904
5933
|
}),
|
5905
|
-
400:
|
5906
|
-
message:
|
5934
|
+
400: z81.object({
|
5935
|
+
message: z81.string()
|
5907
5936
|
}),
|
5908
5937
|
401: DefaultUnauthorizedSchema,
|
5909
5938
|
500: DefaultErrorResponseSchema
|
@@ -5919,14 +5948,14 @@ var ticketContract = initContract30().router(
|
|
5919
5948
|
201: DefaultSuccessResponseSchema.extend({
|
5920
5949
|
data: TicketCustomFieldSchema
|
5921
5950
|
}),
|
5922
|
-
400:
|
5923
|
-
message:
|
5951
|
+
400: z81.object({
|
5952
|
+
message: z81.string()
|
5924
5953
|
}),
|
5925
|
-
409:
|
5926
|
-
message:
|
5954
|
+
409: z81.object({
|
5955
|
+
message: z81.string()
|
5927
5956
|
}),
|
5928
|
-
500:
|
5929
|
-
message:
|
5957
|
+
500: z81.object({
|
5958
|
+
message: z81.string()
|
5930
5959
|
}),
|
5931
5960
|
401: DefaultUnauthorizedSchema,
|
5932
5961
|
404: DefaultNotFoundSchema,
|
@@ -5951,21 +5980,21 @@ var ticketContract = initContract30().router(
|
|
5951
5980
|
|
5952
5981
|
// src/user/index.ts
|
5953
5982
|
import { initContract as initContract31 } from "@ts-rest/core";
|
5954
|
-
import
|
5983
|
+
import z83 from "zod";
|
5955
5984
|
|
5956
5985
|
// src/user/validation.ts
|
5957
|
-
import { z as
|
5958
|
-
var CreateUserSchema =
|
5959
|
-
name:
|
5960
|
-
email:
|
5961
|
-
address:
|
5962
|
-
phone:
|
5963
|
-
password:
|
5964
|
-
notificationCount:
|
5965
|
-
roles:
|
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())
|
5966
5995
|
});
|
5967
5996
|
var UpdateUserSchema = CreateUserSchema.extend({
|
5968
|
-
newPassword:
|
5997
|
+
newPassword: z82.string()
|
5969
5998
|
});
|
5970
5999
|
|
5971
6000
|
// src/user/index.ts
|
@@ -5980,8 +6009,8 @@ var userContract = initContract31().router(
|
|
5980
6009
|
201: DefaultSuccessResponseSchema.extend({
|
5981
6010
|
user: UserSchema
|
5982
6011
|
}),
|
5983
|
-
400:
|
5984
|
-
message:
|
6012
|
+
400: z83.object({
|
6013
|
+
message: z83.string()
|
5985
6014
|
}),
|
5986
6015
|
401: DefaultUnauthorizedSchema
|
5987
6016
|
},
|
@@ -5991,16 +6020,16 @@ var userContract = initContract31().router(
|
|
5991
6020
|
method: "GET",
|
5992
6021
|
path: "",
|
5993
6022
|
headers: DefaultHeaderSchema,
|
5994
|
-
query:
|
5995
|
-
page:
|
5996
|
-
pageSize:
|
6023
|
+
query: z83.object({
|
6024
|
+
page: z83.coerce.number().optional(),
|
6025
|
+
pageSize: z83.coerce.number().optional(),
|
5997
6026
|
// Don't add default 10. In some places, we need to fetch all users.
|
5998
|
-
keyword:
|
6027
|
+
keyword: z83.string().optional()
|
5999
6028
|
}).optional(),
|
6000
6029
|
responses: {
|
6001
6030
|
200: WithPagination(UserSchema),
|
6002
|
-
400:
|
6003
|
-
message:
|
6031
|
+
400: z83.object({
|
6032
|
+
message: z83.string()
|
6004
6033
|
}),
|
6005
6034
|
401: DefaultUnauthorizedSchema,
|
6006
6035
|
500: DefaultErrorResponseSchema
|
@@ -6010,12 +6039,12 @@ var userContract = initContract31().router(
|
|
6010
6039
|
getUserById: {
|
6011
6040
|
method: "GET",
|
6012
6041
|
path: "/:id",
|
6013
|
-
pathParams:
|
6042
|
+
pathParams: z83.object({ id: z83.string() }),
|
6014
6043
|
headers: DefaultHeaderSchema,
|
6015
6044
|
responses: {
|
6016
6045
|
200: UserSchema,
|
6017
|
-
400:
|
6018
|
-
message:
|
6046
|
+
400: z83.object({
|
6047
|
+
message: z83.string()
|
6019
6048
|
}),
|
6020
6049
|
401: DefaultUnauthorizedSchema
|
6021
6050
|
},
|
@@ -6024,15 +6053,15 @@ var userContract = initContract31().router(
|
|
6024
6053
|
updateUser: {
|
6025
6054
|
method: "PATCH",
|
6026
6055
|
path: "/:id",
|
6027
|
-
pathParams:
|
6056
|
+
pathParams: z83.object({ id: z83.string() }),
|
6028
6057
|
headers: DefaultHeaderSchema,
|
6029
6058
|
body: UpdateUserSchema,
|
6030
6059
|
responses: {
|
6031
6060
|
201: DefaultSuccessResponseSchema.extend({
|
6032
6061
|
role: UserSchema
|
6033
6062
|
}),
|
6034
|
-
400:
|
6035
|
-
message:
|
6063
|
+
400: z83.object({
|
6064
|
+
message: z83.string()
|
6036
6065
|
}),
|
6037
6066
|
401: DefaultUnauthorizedSchema
|
6038
6067
|
},
|
@@ -6041,11 +6070,11 @@ var userContract = initContract31().router(
|
|
6041
6070
|
deleteUser: {
|
6042
6071
|
method: "DELETE",
|
6043
6072
|
path: "/:id",
|
6044
|
-
pathParams:
|
6073
|
+
pathParams: z83.object({ id: z83.string() }),
|
6045
6074
|
headers: DefaultHeaderSchema,
|
6046
6075
|
body: null,
|
6047
6076
|
responses: {
|
6048
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6077
|
+
200: DefaultSuccessResponseSchema.extend({ message: z83.string() }),
|
6049
6078
|
500: DefaultErrorResponseSchema
|
6050
6079
|
},
|
6051
6080
|
summary: "Delete a user."
|
@@ -6056,26 +6085,26 @@ var userContract = initContract31().router(
|
|
6056
6085
|
|
6057
6086
|
// src/user-presence-status-log/index.ts
|
6058
6087
|
import { initContract as initContract32 } from "@ts-rest/core";
|
6059
|
-
import
|
6088
|
+
import z86 from "zod";
|
6060
6089
|
|
6061
6090
|
// src/user-presence-status-log/schema.ts
|
6062
|
-
import
|
6091
|
+
import z84 from "zod";
|
6063
6092
|
var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
|
6064
6093
|
user: UserSchema,
|
6065
6094
|
previousPresenceStatus: PresenceStatusSchema,
|
6066
6095
|
newPresenceStatus: PresenceStatusSchema,
|
6067
|
-
reason:
|
6096
|
+
reason: z84.string()
|
6068
6097
|
});
|
6069
6098
|
|
6070
6099
|
// src/user-presence-status-log/validation.ts
|
6071
|
-
import
|
6072
|
-
var UserPresenceStatusLogParamsSchema =
|
6073
|
-
page:
|
6074
|
-
pageSize:
|
6075
|
-
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()
|
6076
6105
|
}).optional();
|
6077
|
-
var UserPresenceStatusLogExportParamsSchema =
|
6078
|
-
selectedDate:
|
6106
|
+
var UserPresenceStatusLogExportParamsSchema = z85.object({
|
6107
|
+
selectedDate: z85.string().optional()
|
6079
6108
|
});
|
6080
6109
|
|
6081
6110
|
// src/user-presence-status-log/index.ts
|
@@ -6088,8 +6117,8 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
6088
6117
|
headers: DefaultHeaderSchema,
|
6089
6118
|
responses: {
|
6090
6119
|
200: WithPagination(UserPresenceStatusLogSchema),
|
6091
|
-
400:
|
6092
|
-
message:
|
6120
|
+
400: z86.object({
|
6121
|
+
message: z86.string()
|
6093
6122
|
}),
|
6094
6123
|
401: DefaultUnauthorizedSchema,
|
6095
6124
|
500: DefaultErrorResponseSchema
|
@@ -6103,8 +6132,8 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
6103
6132
|
headers: DefaultHeaderSchema,
|
6104
6133
|
responses: {
|
6105
6134
|
200: null,
|
6106
|
-
400:
|
6107
|
-
message:
|
6135
|
+
400: z86.object({
|
6136
|
+
message: z86.string()
|
6108
6137
|
}),
|
6109
6138
|
401: DefaultUnauthorizedSchema,
|
6110
6139
|
500: DefaultErrorResponseSchema
|
@@ -6116,44 +6145,44 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
6116
6145
|
|
6117
6146
|
// src/widget/index.ts
|
6118
6147
|
import { initContract as initContract33 } from "@ts-rest/core";
|
6119
|
-
import
|
6148
|
+
import z89 from "zod";
|
6120
6149
|
|
6121
6150
|
// src/widget/schema.ts
|
6122
|
-
import
|
6123
|
-
var FieldsSchema =
|
6124
|
-
var WidgetPositionSchema =
|
6125
|
-
|
6126
|
-
|
6127
|
-
|
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")
|
6128
6157
|
]);
|
6129
6158
|
var WidgetSchema = DefaultEntitySchema.extend({
|
6130
|
-
name:
|
6131
|
-
description:
|
6159
|
+
name: z87.string(),
|
6160
|
+
description: z87.string().nullable(),
|
6132
6161
|
position: WidgetPositionSchema.nullable(),
|
6133
6162
|
fields: FieldsSchema,
|
6134
|
-
url:
|
6163
|
+
url: z87.string()
|
6135
6164
|
});
|
6136
6165
|
|
6137
6166
|
// src/widget/validation.ts
|
6138
|
-
import
|
6139
|
-
var CreateWidgetSchema =
|
6140
|
-
name:
|
6141
|
-
description:
|
6142
|
-
url:
|
6167
|
+
import z88 from "zod";
|
6168
|
+
var CreateWidgetSchema = z88.object({
|
6169
|
+
name: z88.string(),
|
6170
|
+
description: z88.string(),
|
6171
|
+
url: z88.string(),
|
6143
6172
|
position: WidgetPositionSchema,
|
6144
|
-
fields:
|
6173
|
+
fields: z88.object({
|
6145
6174
|
data: (
|
6146
6175
|
// Array of attribute system names
|
6147
|
-
|
6176
|
+
z88.array(z88.string())
|
6148
6177
|
)
|
6149
6178
|
}).optional()
|
6150
6179
|
});
|
6151
6180
|
var UpdateWidgetSchema = CreateWidgetSchema;
|
6152
|
-
var GetWidgetUrlPathQuerySchema =
|
6153
|
-
widgetId:
|
6181
|
+
var GetWidgetUrlPathQuerySchema = z88.object({
|
6182
|
+
widgetId: z88.string(),
|
6154
6183
|
// Position ID is ticket ID, contact ID, etc.
|
6155
6184
|
// TODO: The name "Position ID" is confusing. Think of a better name.
|
6156
|
-
positionId:
|
6185
|
+
positionId: z88.string()
|
6157
6186
|
});
|
6158
6187
|
|
6159
6188
|
// src/widget/index.ts
|
@@ -6168,8 +6197,8 @@ var widgetContract = initContract33().router(
|
|
6168
6197
|
201: DefaultSuccessResponseSchema.extend({
|
6169
6198
|
widget: WidgetSchema
|
6170
6199
|
}),
|
6171
|
-
400:
|
6172
|
-
message:
|
6200
|
+
400: z89.object({
|
6201
|
+
message: z89.string()
|
6173
6202
|
}),
|
6174
6203
|
401: DefaultUnauthorizedSchema,
|
6175
6204
|
500: DefaultErrorResponseSchema
|
@@ -6179,17 +6208,17 @@ var widgetContract = initContract33().router(
|
|
6179
6208
|
getWidgets: {
|
6180
6209
|
method: "GET",
|
6181
6210
|
path: "",
|
6182
|
-
query:
|
6183
|
-
page:
|
6184
|
-
pageSize:
|
6185
|
-
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()
|
6186
6215
|
}).optional(),
|
6187
6216
|
headers: DefaultHeaderSchema,
|
6188
6217
|
responses: {
|
6189
6218
|
200: WithPagination(WidgetSchema),
|
6190
6219
|
500: DefaultErrorResponseSchema,
|
6191
|
-
400:
|
6192
|
-
message:
|
6220
|
+
400: z89.object({
|
6221
|
+
message: z89.string()
|
6193
6222
|
}),
|
6194
6223
|
401: DefaultUnauthorizedSchema
|
6195
6224
|
},
|
@@ -6200,9 +6229,9 @@ var widgetContract = initContract33().router(
|
|
6200
6229
|
path: "/menu",
|
6201
6230
|
headers: DefaultHeaderSchema,
|
6202
6231
|
responses: {
|
6203
|
-
200:
|
6204
|
-
400:
|
6205
|
-
message:
|
6232
|
+
200: z89.array(WidgetSchema),
|
6233
|
+
400: z89.object({
|
6234
|
+
message: z89.string()
|
6206
6235
|
}),
|
6207
6236
|
401: DefaultUnauthorizedSchema,
|
6208
6237
|
500: DefaultErrorResponseSchema
|
@@ -6214,9 +6243,9 @@ var widgetContract = initContract33().router(
|
|
6214
6243
|
path: "/ticket_detail",
|
6215
6244
|
headers: DefaultHeaderSchema,
|
6216
6245
|
responses: {
|
6217
|
-
200:
|
6218
|
-
400:
|
6219
|
-
message:
|
6246
|
+
200: z89.array(WidgetSchema),
|
6247
|
+
400: z89.object({
|
6248
|
+
message: z89.string()
|
6220
6249
|
}),
|
6221
6250
|
401: DefaultUnauthorizedSchema,
|
6222
6251
|
500: DefaultErrorResponseSchema
|
@@ -6228,9 +6257,9 @@ var widgetContract = initContract33().router(
|
|
6228
6257
|
path: "/contact_detail",
|
6229
6258
|
headers: DefaultHeaderSchema,
|
6230
6259
|
responses: {
|
6231
|
-
200:
|
6232
|
-
400:
|
6233
|
-
message:
|
6260
|
+
200: z89.array(WidgetSchema),
|
6261
|
+
400: z89.object({
|
6262
|
+
message: z89.string()
|
6234
6263
|
}),
|
6235
6264
|
401: DefaultUnauthorizedSchema,
|
6236
6265
|
500: DefaultErrorResponseSchema
|
@@ -6240,12 +6269,12 @@ var widgetContract = initContract33().router(
|
|
6240
6269
|
getWidgetById: {
|
6241
6270
|
method: "GET",
|
6242
6271
|
path: "/:id",
|
6243
|
-
pathParams:
|
6272
|
+
pathParams: z89.object({ id: z89.string() }),
|
6244
6273
|
headers: DefaultHeaderSchema,
|
6245
6274
|
responses: {
|
6246
6275
|
200: WidgetSchema,
|
6247
|
-
400:
|
6248
|
-
message:
|
6276
|
+
400: z89.object({
|
6277
|
+
message: z89.string()
|
6249
6278
|
}),
|
6250
6279
|
401: DefaultUnauthorizedSchema,
|
6251
6280
|
500: DefaultErrorResponseSchema
|
@@ -6259,10 +6288,10 @@ var widgetContract = initContract33().router(
|
|
6259
6288
|
headers: DefaultHeaderSchema,
|
6260
6289
|
responses: {
|
6261
6290
|
201: DefaultSuccessResponseSchema.extend({
|
6262
|
-
url:
|
6291
|
+
url: z89.string()
|
6263
6292
|
}),
|
6264
|
-
400:
|
6265
|
-
message:
|
6293
|
+
400: z89.object({
|
6294
|
+
message: z89.string()
|
6266
6295
|
}),
|
6267
6296
|
401: DefaultUnauthorizedSchema
|
6268
6297
|
},
|
@@ -6271,14 +6300,14 @@ var widgetContract = initContract33().router(
|
|
6271
6300
|
updateWidget: {
|
6272
6301
|
method: "PATCH",
|
6273
6302
|
path: "/:id",
|
6274
|
-
pathParams:
|
6303
|
+
pathParams: z89.object({ id: z89.string() }),
|
6275
6304
|
headers: DefaultHeaderSchema,
|
6276
6305
|
responses: {
|
6277
6306
|
201: DefaultSuccessResponseSchema.extend({
|
6278
6307
|
widget: WidgetSchema
|
6279
6308
|
}),
|
6280
|
-
400:
|
6281
|
-
message:
|
6309
|
+
400: z89.object({
|
6310
|
+
message: z89.string()
|
6282
6311
|
}),
|
6283
6312
|
401: DefaultUnauthorizedSchema
|
6284
6313
|
},
|
@@ -6288,11 +6317,11 @@ var widgetContract = initContract33().router(
|
|
6288
6317
|
deleteWidget: {
|
6289
6318
|
method: "DELETE",
|
6290
6319
|
path: "/:id",
|
6291
|
-
pathParams:
|
6320
|
+
pathParams: z89.object({ id: z89.string() }),
|
6292
6321
|
headers: DefaultHeaderSchema,
|
6293
6322
|
body: null,
|
6294
6323
|
responses: {
|
6295
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6324
|
+
200: DefaultSuccessResponseSchema.extend({ message: z89.string() }),
|
6296
6325
|
500: DefaultErrorResponseSchema
|
6297
6326
|
},
|
6298
6327
|
summary: "Delete a widget."
|
@@ -6303,24 +6332,24 @@ var widgetContract = initContract33().router(
|
|
6303
6332
|
|
6304
6333
|
// src/wrap-up-form/index.ts
|
6305
6334
|
import { initContract as initContract34 } from "@ts-rest/core";
|
6306
|
-
import
|
6335
|
+
import z91 from "zod";
|
6307
6336
|
|
6308
6337
|
// src/wrap-up-form/validation.ts
|
6309
|
-
import { z as
|
6310
|
-
var CreateWrapUpFormSchema =
|
6311
|
-
note:
|
6312
|
-
disposition:
|
6313
|
-
callFrom:
|
6314
|
-
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()
|
6315
6344
|
});
|
6316
6345
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
6317
|
-
tags:
|
6346
|
+
tags: z90.array(z90.string()).optional()
|
6318
6347
|
});
|
6319
|
-
var CreateCXLogWrapUpFormSchema =
|
6320
|
-
cxLogId:
|
6321
|
-
disposition:
|
6322
|
-
tagIds:
|
6323
|
-
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()
|
6324
6353
|
});
|
6325
6354
|
|
6326
6355
|
// src/wrap-up-form/index.ts
|
@@ -6335,8 +6364,8 @@ var wrapUpFormContract = initContract34().router(
|
|
6335
6364
|
201: DefaultSuccessResponseSchema.extend({
|
6336
6365
|
wrapUpForm: WrapUpFormSchema
|
6337
6366
|
}),
|
6338
|
-
400:
|
6339
|
-
message:
|
6367
|
+
400: z91.object({
|
6368
|
+
message: z91.string()
|
6340
6369
|
}),
|
6341
6370
|
401: DefaultUnauthorizedSchema,
|
6342
6371
|
500: DefaultErrorResponseSchema
|
@@ -6358,15 +6387,15 @@ var wrapUpFormContract = initContract34().router(
|
|
6358
6387
|
getWrapUpForms: {
|
6359
6388
|
method: "GET",
|
6360
6389
|
path: "",
|
6361
|
-
query:
|
6362
|
-
page:
|
6363
|
-
pageSize:
|
6390
|
+
query: z91.object({
|
6391
|
+
page: z91.coerce.number().default(1),
|
6392
|
+
pageSize: z91.coerce.number().default(10)
|
6364
6393
|
}).optional(),
|
6365
6394
|
headers: DefaultHeaderSchema,
|
6366
6395
|
responses: {
|
6367
6396
|
200: WithPagination(WrapUpFormSchema),
|
6368
|
-
400:
|
6369
|
-
message:
|
6397
|
+
400: z91.object({
|
6398
|
+
message: z91.string()
|
6370
6399
|
}),
|
6371
6400
|
401: DefaultUnauthorizedSchema,
|
6372
6401
|
500: DefaultErrorResponseSchema
|
@@ -6376,15 +6405,15 @@ var wrapUpFormContract = initContract34().router(
|
|
6376
6405
|
updateWrapUpForm: {
|
6377
6406
|
method: "PATCH",
|
6378
6407
|
path: "/:id",
|
6379
|
-
pathParams:
|
6408
|
+
pathParams: z91.object({ id: z91.string() }),
|
6380
6409
|
headers: DefaultHeaderSchema,
|
6381
6410
|
body: UpdateWrapUpFormSchema,
|
6382
6411
|
responses: {
|
6383
6412
|
201: DefaultSuccessResponseSchema.extend({
|
6384
6413
|
wrapUpForm: WrapUpFormSchema
|
6385
6414
|
}),
|
6386
|
-
400:
|
6387
|
-
message:
|
6415
|
+
400: z91.object({
|
6416
|
+
message: z91.string()
|
6388
6417
|
}),
|
6389
6418
|
401: DefaultUnauthorizedSchema,
|
6390
6419
|
500: DefaultErrorResponseSchema
|
@@ -6397,28 +6426,28 @@ var wrapUpFormContract = initContract34().router(
|
|
6397
6426
|
|
6398
6427
|
// src/upload/index.ts
|
6399
6428
|
import { initContract as initContract35 } from "@ts-rest/core";
|
6400
|
-
import
|
6429
|
+
import z92 from "zod";
|
6401
6430
|
var uploadContract = initContract35().router(
|
6402
6431
|
{
|
6403
6432
|
rename: {
|
6404
6433
|
method: "POST",
|
6405
6434
|
path: "/:id/rename",
|
6406
|
-
pathParams:
|
6407
|
-
id:
|
6435
|
+
pathParams: z92.object({
|
6436
|
+
id: z92.string()
|
6408
6437
|
}),
|
6409
6438
|
headers: DefaultHeaderSchema,
|
6410
6439
|
responses: {
|
6411
6440
|
201: DefaultSuccessResponseSchema.extend({
|
6412
|
-
message:
|
6441
|
+
message: z92.string()
|
6413
6442
|
}),
|
6414
|
-
400:
|
6415
|
-
message:
|
6443
|
+
400: z92.object({
|
6444
|
+
message: z92.string()
|
6416
6445
|
}),
|
6417
|
-
409:
|
6418
|
-
message:
|
6446
|
+
409: z92.object({
|
6447
|
+
message: z92.string()
|
6419
6448
|
}),
|
6420
|
-
500:
|
6421
|
-
message:
|
6449
|
+
500: z92.object({
|
6450
|
+
message: z92.string()
|
6422
6451
|
}),
|
6423
6452
|
401: DefaultUnauthorizedSchema,
|
6424
6453
|
404: DefaultNotFoundSchema,
|
@@ -6430,23 +6459,23 @@ var uploadContract = initContract35().router(
|
|
6430
6459
|
delete: {
|
6431
6460
|
method: "DELETE",
|
6432
6461
|
path: "/:id",
|
6433
|
-
pathParams:
|
6434
|
-
id:
|
6462
|
+
pathParams: z92.object({
|
6463
|
+
id: z92.string()
|
6435
6464
|
}),
|
6436
6465
|
headers: DefaultHeaderSchema,
|
6437
6466
|
body: null,
|
6438
6467
|
responses: {
|
6439
6468
|
201: DefaultSuccessResponseSchema.extend({
|
6440
|
-
message:
|
6469
|
+
message: z92.string()
|
6441
6470
|
}),
|
6442
|
-
400:
|
6443
|
-
message:
|
6471
|
+
400: z92.object({
|
6472
|
+
message: z92.string()
|
6444
6473
|
}),
|
6445
|
-
409:
|
6446
|
-
message:
|
6474
|
+
409: z92.object({
|
6475
|
+
message: z92.string()
|
6447
6476
|
}),
|
6448
|
-
500:
|
6449
|
-
message:
|
6477
|
+
500: z92.object({
|
6478
|
+
message: z92.string()
|
6450
6479
|
}),
|
6451
6480
|
401: DefaultUnauthorizedSchema,
|
6452
6481
|
404: DefaultNotFoundSchema,
|
@@ -6461,19 +6490,19 @@ var uploadContract = initContract35().router(
|
|
6461
6490
|
);
|
6462
6491
|
|
6463
6492
|
// src/viber/index.ts
|
6464
|
-
import
|
6493
|
+
import z94 from "zod";
|
6465
6494
|
|
6466
6495
|
// src/viber/validation.ts
|
6467
|
-
import
|
6468
|
-
var ViberChannelSchema =
|
6469
|
-
name:
|
6470
|
-
accessToken:
|
6471
|
-
actor:
|
6472
|
-
id:
|
6473
|
-
name:
|
6474
|
-
email:
|
6475
|
-
address:
|
6476
|
-
phone:
|
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()
|
6477
6506
|
}).optional()
|
6478
6507
|
});
|
6479
6508
|
|
@@ -6502,8 +6531,8 @@ var viberContract = initContract36().router({
|
|
6502
6531
|
}),
|
6503
6532
|
400: DefaultErrorResponseSchema
|
6504
6533
|
},
|
6505
|
-
body:
|
6506
|
-
id:
|
6534
|
+
body: z94.object({
|
6535
|
+
id: z94.string().uuid()
|
6507
6536
|
}),
|
6508
6537
|
summary: "Connect viber channel"
|
6509
6538
|
},
|
@@ -6519,8 +6548,8 @@ var viberContract = initContract36().router({
|
|
6519
6548
|
reconnect: {
|
6520
6549
|
method: "POST",
|
6521
6550
|
path: "/reconnect/:channelId",
|
6522
|
-
pathParams:
|
6523
|
-
channelId:
|
6551
|
+
pathParams: z94.object({
|
6552
|
+
channelId: z94.string().uuid()
|
6524
6553
|
}),
|
6525
6554
|
responses: {
|
6526
6555
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6535,8 +6564,8 @@ var viberContract = initContract36().router({
|
|
6535
6564
|
delete: {
|
6536
6565
|
method: "DELETE",
|
6537
6566
|
path: "/delete/:channelId",
|
6538
|
-
pathParams:
|
6539
|
-
channelId:
|
6567
|
+
pathParams: z94.object({
|
6568
|
+
channelId: z94.string().uuid()
|
6540
6569
|
}),
|
6541
6570
|
body: null,
|
6542
6571
|
responses: {
|
@@ -6549,58 +6578,58 @@ var viberContract = initContract36().router({
|
|
6549
6578
|
|
6550
6579
|
// src/notification/index.ts
|
6551
6580
|
import { initContract as initContract37 } from "@ts-rest/core";
|
6552
|
-
import
|
6581
|
+
import z97 from "zod";
|
6553
6582
|
|
6554
6583
|
// src/notification/validation.ts
|
6555
|
-
import
|
6584
|
+
import z96 from "zod";
|
6556
6585
|
|
6557
6586
|
// src/notification/schema.ts
|
6558
|
-
import
|
6559
|
-
var NotificationChangeSchema =
|
6560
|
-
id:
|
6561
|
-
createdAt:
|
6562
|
-
updatedAt:
|
6563
|
-
deletedAt:
|
6564
|
-
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(),
|
6565
6594
|
actor: UserSchema,
|
6566
|
-
notificationObjectId:
|
6567
|
-
readAt:
|
6568
|
-
});
|
6569
|
-
var NotificationObjectSchema =
|
6570
|
-
id:
|
6571
|
-
createdAt:
|
6572
|
-
updatedAt:
|
6573
|
-
deletedAt:
|
6574
|
-
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(),
|
6575
6604
|
notificationChange: NotificationChangeSchema
|
6576
6605
|
});
|
6577
|
-
var NotificationSchema =
|
6578
|
-
id:
|
6579
|
-
createdAt:
|
6580
|
-
updatedAt:
|
6581
|
-
deletedAt:
|
6582
|
-
notificationObjectId:
|
6583
|
-
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(),
|
6584
6613
|
notificationObject: NotificationObjectSchema,
|
6585
|
-
readAt:
|
6614
|
+
readAt: z95.date()
|
6586
6615
|
});
|
6587
6616
|
|
6588
6617
|
// src/notification/validation.ts
|
6589
|
-
var GetNotificationsRequestSchema =
|
6590
|
-
page:
|
6591
|
-
pageSize:
|
6618
|
+
var GetNotificationsRequestSchema = z96.object({
|
6619
|
+
page: z96.coerce.number().default(1),
|
6620
|
+
pageSize: z96.coerce.number().default(10)
|
6592
6621
|
});
|
6593
|
-
var GetNotificationsResponseSchema =
|
6594
|
-
notificationCount:
|
6595
|
-
notifications:
|
6596
|
-
total:
|
6597
|
-
page:
|
6598
|
-
pageSize:
|
6599
|
-
lastPage:
|
6600
|
-
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()
|
6601
6630
|
});
|
6602
|
-
var ResetNotificationRequestSchema =
|
6603
|
-
userId:
|
6631
|
+
var ResetNotificationRequestSchema = z96.object({
|
6632
|
+
userId: z96.string()
|
6604
6633
|
});
|
6605
6634
|
|
6606
6635
|
// src/notification/index.ts
|
@@ -6614,14 +6643,14 @@ var userNotificationContract = initContract37().router(
|
|
6614
6643
|
200: DefaultSuccessResponseSchema.extend({
|
6615
6644
|
data: GetNotificationsResponseSchema
|
6616
6645
|
}),
|
6617
|
-
400:
|
6618
|
-
message:
|
6646
|
+
400: z97.object({
|
6647
|
+
message: z97.string()
|
6619
6648
|
}),
|
6620
|
-
409:
|
6621
|
-
message:
|
6649
|
+
409: z97.object({
|
6650
|
+
message: z97.string()
|
6622
6651
|
}),
|
6623
|
-
500:
|
6624
|
-
message:
|
6652
|
+
500: z97.object({
|
6653
|
+
message: z97.string()
|
6625
6654
|
}),
|
6626
6655
|
401: DefaultUnauthorizedSchema,
|
6627
6656
|
404: DefaultNotFoundSchema,
|
@@ -6634,16 +6663,16 @@ var userNotificationContract = initContract37().router(
|
|
6634
6663
|
path: "/new_notifications_count",
|
6635
6664
|
responses: {
|
6636
6665
|
200: DefaultSuccessResponseSchema.extend({
|
6637
|
-
total:
|
6666
|
+
total: z97.number()
|
6638
6667
|
}),
|
6639
|
-
400:
|
6640
|
-
message:
|
6668
|
+
400: z97.object({
|
6669
|
+
message: z97.string()
|
6641
6670
|
}),
|
6642
|
-
409:
|
6643
|
-
message:
|
6671
|
+
409: z97.object({
|
6672
|
+
message: z97.string()
|
6644
6673
|
}),
|
6645
|
-
500:
|
6646
|
-
message:
|
6674
|
+
500: z97.object({
|
6675
|
+
message: z97.string()
|
6647
6676
|
}),
|
6648
6677
|
401: DefaultUnauthorizedSchema,
|
6649
6678
|
404: DefaultNotFoundSchema,
|
@@ -6658,14 +6687,14 @@ var userNotificationContract = initContract37().router(
|
|
6658
6687
|
201: DefaultSuccessResponseSchema.extend({
|
6659
6688
|
data: UserSchema
|
6660
6689
|
}),
|
6661
|
-
400:
|
6662
|
-
message:
|
6690
|
+
400: z97.object({
|
6691
|
+
message: z97.string()
|
6663
6692
|
}),
|
6664
|
-
409:
|
6665
|
-
message:
|
6693
|
+
409: z97.object({
|
6694
|
+
message: z97.string()
|
6666
6695
|
}),
|
6667
|
-
500:
|
6668
|
-
message:
|
6696
|
+
500: z97.object({
|
6697
|
+
message: z97.string()
|
6669
6698
|
}),
|
6670
6699
|
401: DefaultUnauthorizedSchema,
|
6671
6700
|
404: DefaultNotFoundSchema,
|
@@ -6677,19 +6706,19 @@ var userNotificationContract = initContract37().router(
|
|
6677
6706
|
readNotification: {
|
6678
6707
|
method: "POST",
|
6679
6708
|
path: "/read/:id",
|
6680
|
-
pathParams:
|
6709
|
+
pathParams: z97.object({ id: z97.string() }),
|
6681
6710
|
responses: {
|
6682
6711
|
201: DefaultSuccessResponseSchema.extend({
|
6683
6712
|
data: NotificationSchema
|
6684
6713
|
}),
|
6685
|
-
400:
|
6686
|
-
message:
|
6714
|
+
400: z97.object({
|
6715
|
+
message: z97.string()
|
6687
6716
|
}),
|
6688
|
-
409:
|
6689
|
-
message:
|
6717
|
+
409: z97.object({
|
6718
|
+
message: z97.string()
|
6690
6719
|
}),
|
6691
|
-
500:
|
6692
|
-
message:
|
6720
|
+
500: z97.object({
|
6721
|
+
message: z97.string()
|
6693
6722
|
}),
|
6694
6723
|
401: DefaultUnauthorizedSchema,
|
6695
6724
|
404: DefaultNotFoundSchema,
|
@@ -6771,6 +6800,7 @@ export {
|
|
6771
6800
|
dashboardContract,
|
6772
6801
|
evaluateFormContract,
|
6773
6802
|
extensionContract2 as extensionContract,
|
6803
|
+
mailContract,
|
6774
6804
|
mainChatContract,
|
6775
6805
|
notificationContract,
|
6776
6806
|
permissionContract,
|