@kl1/contracts 1.0.76 → 1.0.77
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 +883 -877
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +883 -877
- package/dist/index.mjs.map +1 -1
- package/dist/src/app/index.d.ts +17 -0
- package/dist/src/app/index.d.ts.map +1 -0
- package/dist/src/contract.d.ts +26 -281
- package/dist/src/contract.d.ts.map +1 -1
- package/dist/src/instagram/index.d.ts +25 -21
- package/dist/src/instagram/index.d.ts.map +1 -1
- package/dist/src/instagram/validation.d.ts +25 -21
- package/dist/src/instagram/validation.d.ts.map +1 -1
- package/dist/src/line/index.d.ts +1 -260
- package/dist/src/line/index.d.ts.map +1 -1
- package/dist/src/line/schema.d.ts +0 -259
- package/dist/src/line/schema.d.ts.map +1 -1
- package/dist/src/mail/mail-server.d.ts +216 -0
- package/dist/src/mail/mail-server.d.ts.map +1 -0
- package/dist/src/platform-contact/schema.d.ts +30 -0
- package/dist/src/platform-contact/schema.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -3561,17 +3561,16 @@ var GetInstagramPagesSchema = z50.object({
|
|
3561
3561
|
z50.object({
|
3562
3562
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
3563
3563
|
access_token: z50.string(),
|
3564
|
-
category: z50.string(),
|
3565
3564
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
3566
|
-
|
3567
|
-
z50.
|
3568
|
-
|
3569
|
-
|
3570
|
-
|
3571
|
-
|
3572
|
-
|
3573
|
-
|
3574
|
-
|
3565
|
+
instagram_business_account: z50.object({
|
3566
|
+
username: z50.string(),
|
3567
|
+
name: z50.string(),
|
3568
|
+
// biome-ignore lint/style/useNamingConvention: <explanation>
|
3569
|
+
ig_id: z50.number().describe("Instagram ID"),
|
3570
|
+
id: z50.string().describe("Connected IG User ID")
|
3571
|
+
}),
|
3572
|
+
id: z50.string().describe("Facebook Page ID"),
|
3573
|
+
name: z50.string()
|
3575
3574
|
})
|
3576
3575
|
),
|
3577
3576
|
paging: z50.object({
|
@@ -3640,20 +3639,27 @@ var instagramContract = initContract15().router({
|
|
3640
3639
|
|
3641
3640
|
// src/line/index.ts
|
3642
3641
|
import { initContract as initContract16 } from "@ts-rest/core";
|
3643
|
-
import
|
3642
|
+
import z53 from "zod";
|
3644
3643
|
|
3645
3644
|
// src/line/schema.ts
|
3645
|
+
import z51 from "zod";
|
3646
3646
|
var ConnectLineService = ConnectLineChannelSchema.extend({
|
3647
|
-
actor:
|
3647
|
+
actor: z51.object({
|
3648
|
+
id: z51.string().uuid(),
|
3649
|
+
name: z51.string(),
|
3650
|
+
email: z51.string().email(),
|
3651
|
+
address: z51.string().nullable(),
|
3652
|
+
phone: z51.string().nullable()
|
3653
|
+
}).optional()
|
3648
3654
|
});
|
3649
3655
|
|
3650
3656
|
// src/line/validation.ts
|
3651
|
-
import
|
3652
|
-
var SendLineStickerSchema =
|
3653
|
-
userId:
|
3654
|
-
packageId:
|
3655
|
-
stickerId:
|
3656
|
-
accessToken:
|
3657
|
+
import z52 from "zod";
|
3658
|
+
var SendLineStickerSchema = z52.object({
|
3659
|
+
userId: z52.string().uuid(),
|
3660
|
+
packageId: z52.string(),
|
3661
|
+
stickerId: z52.string(),
|
3662
|
+
accessToken: z52.string()
|
3657
3663
|
});
|
3658
3664
|
|
3659
3665
|
// src/line/index.ts
|
@@ -3663,7 +3669,7 @@ var lineContract = initContract16().router({
|
|
3663
3669
|
path: "sticker",
|
3664
3670
|
responses: {
|
3665
3671
|
200: DefaultSuccessResponseSchema.extend({
|
3666
|
-
data:
|
3672
|
+
data: z53.any()
|
3667
3673
|
}),
|
3668
3674
|
500: DefaultErrorResponseSchema
|
3669
3675
|
},
|
@@ -3672,10 +3678,10 @@ var lineContract = initContract16().router({
|
|
3672
3678
|
},
|
3673
3679
|
connect: {
|
3674
3680
|
method: "POST",
|
3675
|
-
path: "connect",
|
3681
|
+
path: "/connect",
|
3676
3682
|
responses: {
|
3677
3683
|
200: DefaultSuccessResponseSchema.extend({
|
3678
|
-
data:
|
3684
|
+
data: z53.any()
|
3679
3685
|
}),
|
3680
3686
|
500: DefaultErrorResponseSchema
|
3681
3687
|
},
|
@@ -3695,7 +3701,7 @@ var lineContract = initContract16().router({
|
|
3695
3701
|
|
3696
3702
|
// src/mail/email-engine-webhooks-events.contract.ts
|
3697
3703
|
import { initContract as initContract17 } from "@ts-rest/core";
|
3698
|
-
import
|
3704
|
+
import z54 from "zod";
|
3699
3705
|
var emailEngineWebhooksEventsContract = initContract17().router({
|
3700
3706
|
handleWebhooksEvents: {
|
3701
3707
|
method: "POST",
|
@@ -3703,7 +3709,7 @@ var emailEngineWebhooksEventsContract = initContract17().router({
|
|
3703
3709
|
// we don't need to respone anything but added responses just for solving type error
|
3704
3710
|
responses: {
|
3705
3711
|
200: DefaultSuccessResponseSchema.extend({
|
3706
|
-
message:
|
3712
|
+
message: z54.string()
|
3707
3713
|
})
|
3708
3714
|
},
|
3709
3715
|
body: null,
|
@@ -3716,173 +3722,173 @@ import { initContract as initContract22 } from "@ts-rest/core";
|
|
3716
3722
|
|
3717
3723
|
// src/mail/room-contract.ts
|
3718
3724
|
import { initContract as initContract18 } from "@ts-rest/core";
|
3719
|
-
import
|
3725
|
+
import z58 from "zod";
|
3720
3726
|
|
3721
3727
|
// src/mail/schemas/room.schema.ts
|
3722
|
-
import
|
3728
|
+
import z57 from "zod";
|
3723
3729
|
|
3724
3730
|
// src/mail/schemas/account.schema.ts
|
3725
|
-
import z54 from "zod";
|
3726
|
-
var MailServerSchema = z54.object({
|
3727
|
-
id: z54.string(),
|
3728
|
-
createdAt: z54.date(),
|
3729
|
-
updatedAt: z54.date(),
|
3730
|
-
deletedAt: z54.date().nullable(),
|
3731
|
-
name: z54.string(),
|
3732
|
-
smtpHost: z54.string(),
|
3733
|
-
smtpPort: z54.string(),
|
3734
|
-
smtpTlsPort: z54.string(),
|
3735
|
-
useTlsForSmtp: z54.boolean(),
|
3736
|
-
imapHost: z54.string(),
|
3737
|
-
imapPort: z54.string(),
|
3738
|
-
imapTlsPort: z54.string(),
|
3739
|
-
useTlsForImap: z54.boolean()
|
3740
|
-
});
|
3741
|
-
var MailAccountSchema = z54.object({
|
3742
|
-
id: z54.string(),
|
3743
|
-
createdAt: z54.date(),
|
3744
|
-
updatedAt: z54.date(),
|
3745
|
-
deletedAt: z54.date().nullable(),
|
3746
|
-
name: z54.string(),
|
3747
|
-
address: z54.string(),
|
3748
|
-
accountId: z54.string(),
|
3749
|
-
mailServerId: z54.string(),
|
3750
|
-
mailServer: MailServerSchema,
|
3751
|
-
state: z54.union([
|
3752
|
-
z54.literal("init"),
|
3753
|
-
z54.literal("syncing"),
|
3754
|
-
z54.literal("connecting"),
|
3755
|
-
z54.literal("connected"),
|
3756
|
-
z54.literal("disconnected"),
|
3757
|
-
z54.literal("authenticationError"),
|
3758
|
-
z54.literal("connectError"),
|
3759
|
-
z54.literal("unset")
|
3760
|
-
])
|
3761
|
-
});
|
3762
|
-
|
3763
|
-
// src/mail/schemas/message.schema.ts
|
3764
3731
|
import z55 from "zod";
|
3765
|
-
var
|
3732
|
+
var MailServerSchema = z55.object({
|
3766
3733
|
id: z55.string(),
|
3767
3734
|
createdAt: z55.date(),
|
3768
3735
|
updatedAt: z55.date(),
|
3769
|
-
deletedAt: z55.
|
3770
|
-
|
3771
|
-
|
3772
|
-
|
3773
|
-
|
3774
|
-
|
3775
|
-
|
3776
|
-
|
3777
|
-
|
3778
|
-
|
3779
|
-
|
3780
|
-
|
3781
|
-
bucket_name: z55.string(),
|
3782
|
-
file_name: z55.string(),
|
3783
|
-
file_key: z55.string(),
|
3784
|
-
file_size: z55.number(),
|
3785
|
-
file_url: z55.string(),
|
3786
|
-
extension_name: z55.string()
|
3787
|
-
})
|
3788
|
-
});
|
3789
|
-
var MessageSchema2 = z55.object({
|
3736
|
+
deletedAt: z55.date().nullable(),
|
3737
|
+
name: z55.string(),
|
3738
|
+
smtpHost: z55.string(),
|
3739
|
+
smtpPort: z55.string(),
|
3740
|
+
smtpTlsPort: z55.string(),
|
3741
|
+
useTlsForSmtp: z55.boolean(),
|
3742
|
+
imapHost: z55.string(),
|
3743
|
+
imapPort: z55.string(),
|
3744
|
+
imapTlsPort: z55.string(),
|
3745
|
+
useTlsForImap: z55.boolean()
|
3746
|
+
});
|
3747
|
+
var MailAccountSchema = z55.object({
|
3790
3748
|
id: z55.string(),
|
3791
3749
|
createdAt: z55.date(),
|
3792
3750
|
updatedAt: z55.date(),
|
3793
|
-
deletedAt: z55.
|
3794
|
-
|
3795
|
-
|
3796
|
-
|
3797
|
-
|
3798
|
-
|
3799
|
-
|
3800
|
-
|
3801
|
-
|
3802
|
-
|
3803
|
-
|
3804
|
-
|
3805
|
-
|
3806
|
-
|
3807
|
-
|
3808
|
-
|
3809
|
-
cc: z55.array(MailUserSchema),
|
3810
|
-
bcc: z55.array(MailUserSchema),
|
3811
|
-
attachments: z55.array(AttachmentSchema)
|
3751
|
+
deletedAt: z55.date().nullable(),
|
3752
|
+
name: z55.string(),
|
3753
|
+
address: z55.string(),
|
3754
|
+
accountId: z55.string(),
|
3755
|
+
mailServerId: z55.string(),
|
3756
|
+
mailServer: MailServerSchema,
|
3757
|
+
state: z55.union([
|
3758
|
+
z55.literal("init"),
|
3759
|
+
z55.literal("syncing"),
|
3760
|
+
z55.literal("connecting"),
|
3761
|
+
z55.literal("connected"),
|
3762
|
+
z55.literal("disconnected"),
|
3763
|
+
z55.literal("authenticationError"),
|
3764
|
+
z55.literal("connectError"),
|
3765
|
+
z55.literal("unset")
|
3766
|
+
])
|
3812
3767
|
});
|
3813
3768
|
|
3814
|
-
// src/mail/schemas/
|
3815
|
-
|
3816
|
-
|
3817
|
-
createdAt: z56.date(),
|
3818
|
-
updatedAt: z56.date(),
|
3819
|
-
deletedAt: z56.date().nullable(),
|
3820
|
-
name: z56.string(),
|
3821
|
-
address: z56.string()
|
3822
|
-
});
|
3823
|
-
var TagSchema2 = z56.object({
|
3824
|
-
color: z56.string(),
|
3825
|
-
id: z56.string(),
|
3826
|
-
createdAt: z56.date(),
|
3827
|
-
updatedAt: z56.date(),
|
3828
|
-
deletedAt: z56.date().nullable(),
|
3829
|
-
name: z56.string()
|
3830
|
-
});
|
3831
|
-
var UserModel = z56.object({
|
3832
|
-
id: z56.string().uuid(),
|
3833
|
-
createdAt: z56.date(),
|
3834
|
-
updatedAt: z56.date(),
|
3835
|
-
deletedAt: z56.date().nullable(),
|
3836
|
-
name: z56.string(),
|
3837
|
-
email: z56.string(),
|
3838
|
-
address: z56.string().nullable(),
|
3839
|
-
phone: z56.string().nullable(),
|
3840
|
-
notification_count: z56.number().nullable()
|
3841
|
-
});
|
3842
|
-
var ActivityLogModel = z56.object({
|
3769
|
+
// src/mail/schemas/message.schema.ts
|
3770
|
+
import z56 from "zod";
|
3771
|
+
var AttachmentSchema = z56.object({
|
3843
3772
|
id: z56.string(),
|
3844
3773
|
createdAt: z56.date(),
|
3845
3774
|
updatedAt: z56.date(),
|
3846
|
-
deletedAt: z56.nullable(z56.
|
3847
|
-
description: z56.string(),
|
3848
|
-
actorId: z56.string(),
|
3775
|
+
deletedAt: z56.nullable(z56.date()),
|
3849
3776
|
roomId: z56.string(),
|
3850
|
-
|
3777
|
+
messageId: z56.string(),
|
3778
|
+
fileName: z56.string(),
|
3779
|
+
fileType: z56.string(),
|
3780
|
+
emailEngineAttachmentId: z56.string(),
|
3781
|
+
uploadId: z56.string(),
|
3782
|
+
upload: z56.object({
|
3783
|
+
id: z56.string(),
|
3784
|
+
createdAt: z56.date(),
|
3785
|
+
updatedAt: z56.date(),
|
3786
|
+
deletedAt: z56.nullable(z56.date()),
|
3787
|
+
bucket_name: z56.string(),
|
3788
|
+
file_name: z56.string(),
|
3789
|
+
file_key: z56.string(),
|
3790
|
+
file_size: z56.number(),
|
3791
|
+
file_url: z56.string(),
|
3792
|
+
extension_name: z56.string()
|
3793
|
+
})
|
3851
3794
|
});
|
3852
|
-
var
|
3853
|
-
var MailRoomSchema = z56.object({
|
3795
|
+
var MessageSchema2 = z56.object({
|
3854
3796
|
id: z56.string(),
|
3855
3797
|
createdAt: z56.date(),
|
3856
3798
|
updatedAt: z56.date(),
|
3857
|
-
deletedAt: z56.
|
3799
|
+
deletedAt: z56.nullable(z56.date()),
|
3800
|
+
roomId: z56.string(),
|
3858
3801
|
subject: z56.string(),
|
3859
|
-
|
3860
|
-
|
3861
|
-
|
3862
|
-
|
3802
|
+
textPlain: z56.string(),
|
3803
|
+
textHtml: z56.string(),
|
3804
|
+
textId: z56.string(),
|
3805
|
+
emailEngineEmailId: z56.string(),
|
3806
|
+
emailEngineMessageId: z56.string(),
|
3807
|
+
emailEngineReplyTo: z56.nullable(z56.string()),
|
3863
3808
|
direction: z56.string(),
|
3864
|
-
|
3865
|
-
|
3809
|
+
date: z56.date(),
|
3810
|
+
action: z56.string(),
|
3811
|
+
unseen: z56.boolean(),
|
3812
|
+
seemsLikeNew: z56.boolean(),
|
3866
3813
|
from: z56.array(MailUserSchema),
|
3867
3814
|
to: z56.array(MailUserSchema),
|
3868
3815
|
cc: z56.array(MailUserSchema),
|
3869
3816
|
bcc: z56.array(MailUserSchema),
|
3817
|
+
attachments: z56.array(AttachmentSchema)
|
3818
|
+
});
|
3819
|
+
|
3820
|
+
// src/mail/schemas/room.schema.ts
|
3821
|
+
var MailUserSchema = z57.object({
|
3822
|
+
id: z57.string(),
|
3823
|
+
createdAt: z57.date(),
|
3824
|
+
updatedAt: z57.date(),
|
3825
|
+
deletedAt: z57.date().nullable(),
|
3826
|
+
name: z57.string(),
|
3827
|
+
address: z57.string()
|
3828
|
+
});
|
3829
|
+
var TagSchema2 = z57.object({
|
3830
|
+
color: z57.string(),
|
3831
|
+
id: z57.string(),
|
3832
|
+
createdAt: z57.date(),
|
3833
|
+
updatedAt: z57.date(),
|
3834
|
+
deletedAt: z57.date().nullable(),
|
3835
|
+
name: z57.string()
|
3836
|
+
});
|
3837
|
+
var UserModel = z57.object({
|
3838
|
+
id: z57.string().uuid(),
|
3839
|
+
createdAt: z57.date(),
|
3840
|
+
updatedAt: z57.date(),
|
3841
|
+
deletedAt: z57.date().nullable(),
|
3842
|
+
name: z57.string(),
|
3843
|
+
email: z57.string(),
|
3844
|
+
address: z57.string().nullable(),
|
3845
|
+
phone: z57.string().nullable(),
|
3846
|
+
notification_count: z57.number().nullable()
|
3847
|
+
});
|
3848
|
+
var ActivityLogModel = z57.object({
|
3849
|
+
id: z57.string(),
|
3850
|
+
createdAt: z57.date(),
|
3851
|
+
updatedAt: z57.date(),
|
3852
|
+
deletedAt: z57.nullable(z57.string()),
|
3853
|
+
description: z57.string(),
|
3854
|
+
actorId: z57.string(),
|
3855
|
+
roomId: z57.string(),
|
3856
|
+
actor: UserModel
|
3857
|
+
});
|
3858
|
+
var MessagesAndLogs = z57.array(z57.union([MessageSchema2, ActivityLogModel]));
|
3859
|
+
var MailRoomSchema = z57.object({
|
3860
|
+
id: z57.string(),
|
3861
|
+
createdAt: z57.date(),
|
3862
|
+
updatedAt: z57.date(),
|
3863
|
+
deletedAt: z57.date().nullable(),
|
3864
|
+
subject: z57.string(),
|
3865
|
+
resolved: z57.boolean(),
|
3866
|
+
assigneeId: z57.string().nullable(),
|
3867
|
+
note: z57.string(),
|
3868
|
+
mailId: z57.string(),
|
3869
|
+
direction: z57.string(),
|
3870
|
+
lastMessageId: z57.string(),
|
3871
|
+
firstMessageId: z57.string(),
|
3872
|
+
from: z57.array(MailUserSchema),
|
3873
|
+
to: z57.array(MailUserSchema),
|
3874
|
+
cc: z57.array(MailUserSchema),
|
3875
|
+
bcc: z57.array(MailUserSchema),
|
3870
3876
|
firstMessage: MessageSchema2,
|
3871
3877
|
lastMessage: MessageSchema2,
|
3872
|
-
tags:
|
3878
|
+
tags: z57.array(TagSchema2),
|
3873
3879
|
assignee: UserModel,
|
3874
|
-
messages:
|
3880
|
+
messages: z57.array(MessageSchema2),
|
3875
3881
|
messagesAndLogs: MessagesAndLogs,
|
3876
3882
|
mail: MailAccountSchema,
|
3877
|
-
unReadMessageCount:
|
3878
|
-
});
|
3879
|
-
var AttachmentSchema2 =
|
3880
|
-
fileName:
|
3881
|
-
fileType:
|
3882
|
-
emailEngineAttachmentId:
|
3883
|
-
uploadId:
|
3884
|
-
messageId:
|
3885
|
-
roomId:
|
3883
|
+
unReadMessageCount: z57.number()
|
3884
|
+
});
|
3885
|
+
var AttachmentSchema2 = z57.object({
|
3886
|
+
fileName: z57.string(),
|
3887
|
+
fileType: z57.string(),
|
3888
|
+
emailEngineAttachmentId: z57.string(),
|
3889
|
+
uploadId: z57.string(),
|
3890
|
+
messageId: z57.string(),
|
3891
|
+
roomId: z57.string(),
|
3886
3892
|
upload: UploadSchema
|
3887
3893
|
});
|
3888
3894
|
|
@@ -3894,7 +3900,7 @@ var roomContract = initContract18().router(
|
|
3894
3900
|
path: "/",
|
3895
3901
|
responses: {
|
3896
3902
|
200: DefaultSuccessResponseSchema.extend({
|
3897
|
-
message:
|
3903
|
+
message: z58.string()
|
3898
3904
|
}),
|
3899
3905
|
...DefaultResponses
|
3900
3906
|
},
|
@@ -3904,19 +3910,19 @@ var roomContract = initContract18().router(
|
|
3904
3910
|
getAll: {
|
3905
3911
|
method: "GET",
|
3906
3912
|
path: "",
|
3907
|
-
query:
|
3908
|
-
page:
|
3909
|
-
pageSize:
|
3910
|
-
keyword:
|
3911
|
-
assigneeId:
|
3912
|
-
resolved:
|
3913
|
+
query: z58.object({
|
3914
|
+
page: z58.coerce.number().default(1),
|
3915
|
+
pageSize: z58.coerce.number().default(10),
|
3916
|
+
keyword: z58.string().optional(),
|
3917
|
+
assigneeId: z58.string().uuid().optional().nullable(),
|
3918
|
+
resolved: z58.boolean().or(z58.string().transform((value) => value.toLowerCase() === "true")).optional().nullable()
|
3913
3919
|
}),
|
3914
3920
|
responses: {
|
3915
3921
|
200: DefaultSuccessResponseSchema.extend({
|
3916
|
-
data:
|
3917
|
-
total:
|
3918
|
-
page:
|
3919
|
-
pageSize:
|
3922
|
+
data: z58.array(MailRoomSchema),
|
3923
|
+
total: z58.number(),
|
3924
|
+
page: z58.number(),
|
3925
|
+
pageSize: z58.number()
|
3920
3926
|
}),
|
3921
3927
|
...DefaultResponses
|
3922
3928
|
},
|
@@ -3925,8 +3931,8 @@ var roomContract = initContract18().router(
|
|
3925
3931
|
getById: {
|
3926
3932
|
method: "GET",
|
3927
3933
|
path: "/:id",
|
3928
|
-
pathParams:
|
3929
|
-
id:
|
3934
|
+
pathParams: z58.object({
|
3935
|
+
id: z58.string().uuid()
|
3930
3936
|
}),
|
3931
3937
|
responses: {
|
3932
3938
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -3939,12 +3945,12 @@ var roomContract = initContract18().router(
|
|
3939
3945
|
getAttachments: {
|
3940
3946
|
method: "GET",
|
3941
3947
|
path: "/:id/attachments",
|
3942
|
-
pathParams:
|
3943
|
-
id:
|
3948
|
+
pathParams: z58.object({
|
3949
|
+
id: z58.string().uuid()
|
3944
3950
|
}),
|
3945
3951
|
responses: {
|
3946
3952
|
200: DefaultSuccessResponseSchema.extend({
|
3947
|
-
data:
|
3953
|
+
data: z58.array(AttachmentSchema2)
|
3948
3954
|
}),
|
3949
3955
|
...DefaultResponses
|
3950
3956
|
},
|
@@ -3953,12 +3959,12 @@ var roomContract = initContract18().router(
|
|
3953
3959
|
getParticipants: {
|
3954
3960
|
method: "GET",
|
3955
3961
|
path: "/:id/participants",
|
3956
|
-
pathParams:
|
3957
|
-
id:
|
3962
|
+
pathParams: z58.object({
|
3963
|
+
id: z58.string().uuid()
|
3958
3964
|
}),
|
3959
3965
|
responses: {
|
3960
3966
|
200: DefaultSuccessResponseSchema.extend({
|
3961
|
-
data:
|
3967
|
+
data: z58.array(MailUserSchema)
|
3962
3968
|
}),
|
3963
3969
|
...DefaultResponses
|
3964
3970
|
},
|
@@ -3967,8 +3973,8 @@ var roomContract = initContract18().router(
|
|
3967
3973
|
update: {
|
3968
3974
|
method: "PATCH",
|
3969
3975
|
path: "/:id",
|
3970
|
-
pathParams:
|
3971
|
-
id:
|
3976
|
+
pathParams: z58.object({
|
3977
|
+
id: z58.string()
|
3972
3978
|
}),
|
3973
3979
|
responses: {
|
3974
3980
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -3976,15 +3982,15 @@ var roomContract = initContract18().router(
|
|
3976
3982
|
}),
|
3977
3983
|
...DefaultResponses
|
3978
3984
|
},
|
3979
|
-
body:
|
3980
|
-
resolved:
|
3981
|
-
|
3985
|
+
body: z58.object({
|
3986
|
+
resolved: z58.boolean().or(
|
3987
|
+
z58.union([z58.literal("true"), z58.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
3982
3988
|
).optional().nullable(),
|
3983
|
-
assigneeId:
|
3984
|
-
note:
|
3985
|
-
tags:
|
3986
|
-
handover:
|
3987
|
-
|
3989
|
+
assigneeId: z58.string().uuid().optional().nullable(),
|
3990
|
+
note: z58.string().optional(),
|
3991
|
+
tags: z58.array(z58.string().uuid()).optional(),
|
3992
|
+
handover: z58.boolean().or(
|
3993
|
+
z58.union([z58.literal("true"), z58.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
3988
3994
|
).optional().nullable()
|
3989
3995
|
}),
|
3990
3996
|
summary: "Update a mail room by id"
|
@@ -3992,12 +3998,12 @@ var roomContract = initContract18().router(
|
|
3992
3998
|
markAsRead: {
|
3993
3999
|
method: "GET",
|
3994
4000
|
path: "/:id",
|
3995
|
-
pathParams:
|
3996
|
-
id:
|
4001
|
+
pathParams: z58.object({
|
4002
|
+
id: z58.string().uuid()
|
3997
4003
|
}),
|
3998
4004
|
responses: {
|
3999
4005
|
200: DefaultSuccessResponseSchema.extend({
|
4000
|
-
message:
|
4006
|
+
message: z58.string()
|
4001
4007
|
}),
|
4002
4008
|
...DefaultResponses
|
4003
4009
|
},
|
@@ -4011,47 +4017,47 @@ var roomContract = initContract18().router(
|
|
4011
4017
|
|
4012
4018
|
// src/mail/account-contract.ts
|
4013
4019
|
import { initContract as initContract19 } from "@ts-rest/core";
|
4014
|
-
import
|
4020
|
+
import z60 from "zod";
|
4015
4021
|
|
4016
4022
|
// src/mail/schemas/account-validation.schema.ts
|
4017
|
-
import
|
4023
|
+
import z59 from "zod";
|
4018
4024
|
var AccountContractsValidationSchemas = {
|
4019
4025
|
create: {
|
4020
|
-
input:
|
4021
|
-
address:
|
4022
|
-
name:
|
4023
|
-
password:
|
4024
|
-
mailServerId:
|
4026
|
+
input: z59.object({
|
4027
|
+
address: z59.string().email("Email address must be valid email."),
|
4028
|
+
name: z59.string().min(1, "Account name cannot be empty."),
|
4029
|
+
password: z59.string().min(1, "Password cannot be empty."),
|
4030
|
+
mailServerId: z59.string().uuid("Invalid mail_server_id")
|
4025
4031
|
})
|
4026
4032
|
},
|
4027
4033
|
getById: {
|
4028
|
-
input:
|
4029
|
-
id:
|
4034
|
+
input: z59.object({
|
4035
|
+
id: z59.string().uuid()
|
4030
4036
|
}),
|
4031
4037
|
output: MailAccountSchema
|
4032
4038
|
},
|
4033
4039
|
getAll: {
|
4034
|
-
output:
|
4040
|
+
output: z59.array(MailAccountSchema)
|
4035
4041
|
},
|
4036
4042
|
update: {
|
4037
4043
|
input: MailAccountSchema,
|
4038
4044
|
output: MailAccountSchema
|
4039
4045
|
},
|
4040
4046
|
disconnect: {
|
4041
|
-
input:
|
4042
|
-
id:
|
4047
|
+
input: z59.object({
|
4048
|
+
id: z59.string().uuid()
|
4043
4049
|
}),
|
4044
4050
|
output: MailAccountSchema
|
4045
4051
|
},
|
4046
4052
|
reconnect: {
|
4047
|
-
input:
|
4048
|
-
id:
|
4053
|
+
input: z59.object({
|
4054
|
+
id: z59.string()
|
4049
4055
|
}),
|
4050
4056
|
output: MailAccountSchema
|
4051
4057
|
},
|
4052
4058
|
delete: {
|
4053
|
-
input:
|
4054
|
-
id:
|
4059
|
+
input: z59.object({
|
4060
|
+
id: z59.string()
|
4055
4061
|
}),
|
4056
4062
|
output: MailAccountSchema
|
4057
4063
|
}
|
@@ -4067,16 +4073,16 @@ var accountContract = initContract19().router(
|
|
4067
4073
|
responses: {
|
4068
4074
|
201: DefaultSuccessResponseSchema.extend({
|
4069
4075
|
// data: AccountContractsValidationSchemas.create.output,
|
4070
|
-
message:
|
4076
|
+
message: z60.string()
|
4071
4077
|
}),
|
4072
|
-
400:
|
4073
|
-
message:
|
4078
|
+
400: z60.object({
|
4079
|
+
message: z60.string()
|
4074
4080
|
}),
|
4075
|
-
409:
|
4076
|
-
message:
|
4081
|
+
409: z60.object({
|
4082
|
+
message: z60.string()
|
4077
4083
|
}),
|
4078
|
-
500:
|
4079
|
-
message:
|
4084
|
+
500: z60.object({
|
4085
|
+
message: z60.string()
|
4080
4086
|
}),
|
4081
4087
|
...DefaultResponses
|
4082
4088
|
},
|
@@ -4105,7 +4111,7 @@ var accountContract = initContract19().router(
|
|
4105
4111
|
path: "",
|
4106
4112
|
responses: {
|
4107
4113
|
200: DefaultSuccessResponseSchema.extend({
|
4108
|
-
data:
|
4114
|
+
data: z60.any()
|
4109
4115
|
// data: AccountContractsValidationSchemas.getAll.output,
|
4110
4116
|
}),
|
4111
4117
|
...DefaultResponses
|
@@ -4117,8 +4123,8 @@ var accountContract = initContract19().router(
|
|
4117
4123
|
update: {
|
4118
4124
|
method: "PATCH",
|
4119
4125
|
path: "/:id",
|
4120
|
-
pathParams:
|
4121
|
-
id:
|
4126
|
+
pathParams: z60.object({
|
4127
|
+
id: z60.string().uuid()
|
4122
4128
|
}),
|
4123
4129
|
responses: {
|
4124
4130
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -4167,7 +4173,7 @@ var accountContract = initContract19().router(
|
|
4167
4173
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
4168
4174
|
responses: {
|
4169
4175
|
200: DefaultSuccessResponseSchema.extend({
|
4170
|
-
message:
|
4176
|
+
message: z60.string()
|
4171
4177
|
}),
|
4172
4178
|
...DefaultResponses
|
4173
4179
|
},
|
@@ -4184,7 +4190,7 @@ var accountContract = initContract19().router(
|
|
4184
4190
|
|
4185
4191
|
// src/mail/mail-server-contract.ts
|
4186
4192
|
import { initContract as initContract20 } from "@ts-rest/core";
|
4187
|
-
import
|
4193
|
+
import z61 from "zod";
|
4188
4194
|
var serverContract = initContract20().router(
|
4189
4195
|
{
|
4190
4196
|
create: {
|
@@ -4192,7 +4198,7 @@ var serverContract = initContract20().router(
|
|
4192
4198
|
path: "/",
|
4193
4199
|
responses: {
|
4194
4200
|
200: DefaultSuccessResponseSchema.extend({
|
4195
|
-
message:
|
4201
|
+
message: z61.string()
|
4196
4202
|
}),
|
4197
4203
|
...DefaultResponses
|
4198
4204
|
},
|
@@ -4202,12 +4208,12 @@ var serverContract = initContract20().router(
|
|
4202
4208
|
get: {
|
4203
4209
|
method: "GET",
|
4204
4210
|
path: "/:id",
|
4205
|
-
pathParams:
|
4206
|
-
id:
|
4211
|
+
pathParams: z61.object({
|
4212
|
+
id: z61.string()
|
4207
4213
|
}),
|
4208
4214
|
responses: {
|
4209
4215
|
200: DefaultSuccessResponseSchema.extend({
|
4210
|
-
message:
|
4216
|
+
message: z61.string()
|
4211
4217
|
}),
|
4212
4218
|
...DefaultResponses
|
4213
4219
|
},
|
@@ -4216,12 +4222,12 @@ var serverContract = initContract20().router(
|
|
4216
4222
|
update: {
|
4217
4223
|
method: "PATCH",
|
4218
4224
|
path: "/:id",
|
4219
|
-
pathParams:
|
4220
|
-
id:
|
4225
|
+
pathParams: z61.object({
|
4226
|
+
id: z61.string()
|
4221
4227
|
}),
|
4222
4228
|
responses: {
|
4223
4229
|
200: DefaultSuccessResponseSchema.extend({
|
4224
|
-
message:
|
4230
|
+
message: z61.string()
|
4225
4231
|
}),
|
4226
4232
|
...DefaultResponses
|
4227
4233
|
},
|
@@ -4231,12 +4237,12 @@ var serverContract = initContract20().router(
|
|
4231
4237
|
delete: {
|
4232
4238
|
method: "PATCH",
|
4233
4239
|
path: "/:id",
|
4234
|
-
pathParams:
|
4235
|
-
id:
|
4240
|
+
pathParams: z61.object({
|
4241
|
+
id: z61.string()
|
4236
4242
|
}),
|
4237
4243
|
responses: {
|
4238
4244
|
200: DefaultSuccessResponseSchema.extend({
|
4239
|
-
message:
|
4245
|
+
message: z61.string()
|
4240
4246
|
}),
|
4241
4247
|
...DefaultResponses
|
4242
4248
|
},
|
@@ -4251,44 +4257,44 @@ var serverContract = initContract20().router(
|
|
4251
4257
|
|
4252
4258
|
// src/mail/message-contract.ts
|
4253
4259
|
import { initContract as initContract21 } from "@ts-rest/core";
|
4254
|
-
import
|
4260
|
+
import z63 from "zod";
|
4255
4261
|
|
4256
4262
|
// src/mail/schemas/message-validation.schema.ts
|
4257
|
-
import
|
4258
|
-
var MailParticipant =
|
4259
|
-
name:
|
4260
|
-
address:
|
4263
|
+
import z62 from "zod";
|
4264
|
+
var MailParticipant = z62.object({
|
4265
|
+
name: z62.string().optional(),
|
4266
|
+
address: z62.string().email()
|
4261
4267
|
});
|
4262
4268
|
var MessageContractsValidationsSchema = {
|
4263
4269
|
submit: {
|
4264
|
-
input:
|
4265
|
-
subject:
|
4266
|
-
text:
|
4267
|
-
html:
|
4270
|
+
input: z62.object({
|
4271
|
+
subject: z62.string(),
|
4272
|
+
text: z62.string(),
|
4273
|
+
html: z62.string(),
|
4268
4274
|
from: MailParticipant,
|
4269
|
-
to:
|
4270
|
-
cc:
|
4271
|
-
bcc:
|
4272
|
-
reference:
|
4273
|
-
messageId:
|
4274
|
-
action:
|
4275
|
+
to: z62.array(MailParticipant),
|
4276
|
+
cc: z62.array(MailParticipant).optional(),
|
4277
|
+
bcc: z62.array(MailParticipant).optional(),
|
4278
|
+
reference: z62.object({
|
4279
|
+
messageId: z62.string(),
|
4280
|
+
action: z62.union([z62.literal("reply"), z62.literal("forward")])
|
4275
4281
|
}).optional(),
|
4276
|
-
attachments:
|
4277
|
-
|
4278
|
-
fileType:
|
4279
|
-
fileName:
|
4280
|
-
fileKey:
|
4281
|
-
fileSize:
|
4282
|
-
bucketName:
|
4283
|
-
presignedUrl:
|
4282
|
+
attachments: z62.array(
|
4283
|
+
z62.object({
|
4284
|
+
fileType: z62.string(),
|
4285
|
+
fileName: z62.string(),
|
4286
|
+
fileKey: z62.string(),
|
4287
|
+
fileSize: z62.number(),
|
4288
|
+
bucketName: z62.string(),
|
4289
|
+
presignedUrl: z62.string()
|
4284
4290
|
})
|
4285
4291
|
).optional()
|
4286
4292
|
}),
|
4287
|
-
output:
|
4288
|
-
response:
|
4289
|
-
messageId:
|
4290
|
-
sendAt:
|
4291
|
-
queueId:
|
4293
|
+
output: z62.object({
|
4294
|
+
response: z62.string(),
|
4295
|
+
messageId: z62.string(),
|
4296
|
+
sendAt: z62.string(),
|
4297
|
+
queueId: z62.string()
|
4292
4298
|
})
|
4293
4299
|
}
|
4294
4300
|
};
|
@@ -4313,8 +4319,8 @@ var messageContract = initContract21().router(
|
|
4313
4319
|
getById: {
|
4314
4320
|
method: "GET",
|
4315
4321
|
path: "/:id",
|
4316
|
-
pathParams:
|
4317
|
-
id:
|
4322
|
+
pathParams: z63.object({
|
4323
|
+
id: z63.string()
|
4318
4324
|
}),
|
4319
4325
|
responses: {
|
4320
4326
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -4394,7 +4400,7 @@ var messengerContract = initContract23().router({
|
|
4394
4400
|
|
4395
4401
|
// src/permission/index.ts
|
4396
4402
|
import { initContract as initContract24 } from "@ts-rest/core";
|
4397
|
-
import
|
4403
|
+
import z64 from "zod";
|
4398
4404
|
var permissionContract = initContract24().router(
|
4399
4405
|
{
|
4400
4406
|
getPermissions: {
|
@@ -4402,9 +4408,9 @@ var permissionContract = initContract24().router(
|
|
4402
4408
|
path: "",
|
4403
4409
|
headers: DefaultHeaderSchema,
|
4404
4410
|
responses: {
|
4405
|
-
200:
|
4406
|
-
400:
|
4407
|
-
message:
|
4411
|
+
200: z64.object({ permissions: PermissionSchema.array() }),
|
4412
|
+
400: z64.object({
|
4413
|
+
message: z64.string()
|
4408
4414
|
}),
|
4409
4415
|
401: DefaultUnauthorizedSchema,
|
4410
4416
|
500: DefaultErrorResponseSchema
|
@@ -4417,15 +4423,15 @@ var permissionContract = initContract24().router(
|
|
4417
4423
|
|
4418
4424
|
// src/role/index.ts
|
4419
4425
|
import { initContract as initContract25 } from "@ts-rest/core";
|
4420
|
-
import
|
4426
|
+
import z66 from "zod";
|
4421
4427
|
|
4422
4428
|
// src/role/validation.ts
|
4423
|
-
import { z as
|
4424
|
-
var CreateRoleSchema =
|
4425
|
-
systemName:
|
4426
|
-
displayName:
|
4427
|
-
description:
|
4428
|
-
permissions:
|
4429
|
+
import { z as z65 } from "zod";
|
4430
|
+
var CreateRoleSchema = z65.object({
|
4431
|
+
systemName: z65.string(),
|
4432
|
+
displayName: z65.string(),
|
4433
|
+
description: z65.string().nullable(),
|
4434
|
+
permissions: z65.array(z65.string())
|
4429
4435
|
});
|
4430
4436
|
var UpdateRoleSchema = CreateRoleSchema;
|
4431
4437
|
|
@@ -4441,8 +4447,8 @@ var roleContract = initContract25().router(
|
|
4441
4447
|
201: DefaultSuccessResponseSchema.extend({
|
4442
4448
|
role: RoleSchema
|
4443
4449
|
}),
|
4444
|
-
400:
|
4445
|
-
message:
|
4450
|
+
400: z66.object({
|
4451
|
+
message: z66.string()
|
4446
4452
|
}),
|
4447
4453
|
401: DefaultUnauthorizedSchema,
|
4448
4454
|
500: DefaultErrorResponseSchema
|
@@ -4452,15 +4458,15 @@ var roleContract = initContract25().router(
|
|
4452
4458
|
getRoles: {
|
4453
4459
|
method: "GET",
|
4454
4460
|
path: "",
|
4455
|
-
query:
|
4456
|
-
page:
|
4457
|
-
pageSize:
|
4461
|
+
query: z66.object({
|
4462
|
+
page: z66.coerce.number().default(1),
|
4463
|
+
pageSize: z66.coerce.number().default(10)
|
4458
4464
|
}).optional(),
|
4459
4465
|
headers: DefaultHeaderSchema,
|
4460
4466
|
responses: {
|
4461
4467
|
200: WithPagination(RoleSchema),
|
4462
|
-
400:
|
4463
|
-
message:
|
4468
|
+
400: z66.object({
|
4469
|
+
message: z66.string()
|
4464
4470
|
}),
|
4465
4471
|
401: DefaultUnauthorizedSchema,
|
4466
4472
|
500: DefaultErrorResponseSchema
|
@@ -4470,15 +4476,15 @@ var roleContract = initContract25().router(
|
|
4470
4476
|
updateRole: {
|
4471
4477
|
method: "PATCH",
|
4472
4478
|
path: "/:id",
|
4473
|
-
pathParams:
|
4479
|
+
pathParams: z66.object({ id: z66.string() }),
|
4474
4480
|
headers: DefaultHeaderSchema,
|
4475
4481
|
body: UpdateRoleSchema,
|
4476
4482
|
responses: {
|
4477
4483
|
201: DefaultSuccessResponseSchema.extend({
|
4478
4484
|
role: RoleSchema
|
4479
4485
|
}),
|
4480
|
-
400:
|
4481
|
-
message:
|
4486
|
+
400: z66.object({
|
4487
|
+
message: z66.string()
|
4482
4488
|
}),
|
4483
4489
|
401: DefaultUnauthorizedSchema,
|
4484
4490
|
500: DefaultErrorResponseSchema
|
@@ -4488,11 +4494,11 @@ var roleContract = initContract25().router(
|
|
4488
4494
|
deleteRole: {
|
4489
4495
|
method: "DELETE",
|
4490
4496
|
path: "/:id",
|
4491
|
-
pathParams:
|
4497
|
+
pathParams: z66.object({ id: z66.string() }),
|
4492
4498
|
headers: DefaultHeaderSchema,
|
4493
4499
|
body: null,
|
4494
4500
|
responses: {
|
4495
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
4501
|
+
200: DefaultSuccessResponseSchema.extend({ message: z66.string() }),
|
4496
4502
|
500: DefaultErrorResponseSchema
|
4497
4503
|
},
|
4498
4504
|
summary: "Delete a role."
|
@@ -4503,19 +4509,19 @@ var roleContract = initContract25().router(
|
|
4503
4509
|
|
4504
4510
|
// src/tag/index.ts
|
4505
4511
|
import { initContract as initContract26 } from "@ts-rest/core";
|
4506
|
-
import
|
4512
|
+
import z68 from "zod";
|
4507
4513
|
|
4508
4514
|
// src/tag/validation.ts
|
4509
|
-
import { z as
|
4510
|
-
var CreateTagSchema =
|
4511
|
-
name:
|
4515
|
+
import { z as z67 } from "zod";
|
4516
|
+
var CreateTagSchema = z67.object({
|
4517
|
+
name: z67.string(),
|
4512
4518
|
group: TagGroupSchema
|
4513
4519
|
});
|
4514
|
-
var GetTagsSchema =
|
4520
|
+
var GetTagsSchema = z67.object({
|
4515
4521
|
group: TagGroupSchema.default("general"),
|
4516
|
-
keyword:
|
4522
|
+
keyword: z67.string()
|
4517
4523
|
}).partial().optional();
|
4518
|
-
var UpdateTagSchema =
|
4524
|
+
var UpdateTagSchema = z67.object({ name: z67.string() });
|
4519
4525
|
|
4520
4526
|
// src/tag/index.ts
|
4521
4527
|
var tagContract = initContract26().router(
|
@@ -4538,7 +4544,7 @@ var tagContract = initContract26().router(
|
|
4538
4544
|
query: GetTagsSchema,
|
4539
4545
|
responses: {
|
4540
4546
|
200: DefaultSuccessResponseSchema.extend({
|
4541
|
-
tags:
|
4547
|
+
tags: z68.array(TagSchema)
|
4542
4548
|
}),
|
4543
4549
|
500: DefaultErrorResponseSchema
|
4544
4550
|
},
|
@@ -4547,7 +4553,7 @@ var tagContract = initContract26().router(
|
|
4547
4553
|
updateTag: {
|
4548
4554
|
method: "PATCH",
|
4549
4555
|
path: "/:id",
|
4550
|
-
pathParams:
|
4556
|
+
pathParams: z68.object({ id: z68.string() }),
|
4551
4557
|
body: UpdateTagSchema,
|
4552
4558
|
responses: {
|
4553
4559
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -4560,11 +4566,11 @@ var tagContract = initContract26().router(
|
|
4560
4566
|
deleteTag: {
|
4561
4567
|
method: "DELETE",
|
4562
4568
|
path: "/:id",
|
4563
|
-
pathParams:
|
4564
|
-
body:
|
4569
|
+
pathParams: z68.object({ id: z68.string() }),
|
4570
|
+
body: z68.any().optional(),
|
4565
4571
|
// We don't need the body.
|
4566
4572
|
responses: {
|
4567
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
4573
|
+
200: DefaultSuccessResponseSchema.extend({ message: z68.string() }),
|
4568
4574
|
500: DefaultErrorResponseSchema
|
4569
4575
|
},
|
4570
4576
|
headers: DefaultHeaderSchema
|
@@ -4577,27 +4583,27 @@ var tagContract = initContract26().router(
|
|
4577
4583
|
|
4578
4584
|
// src/telephony-agent-presence-status/index.ts
|
4579
4585
|
import { initContract as initContract27 } from "@ts-rest/core";
|
4580
|
-
import
|
4586
|
+
import z71 from "zod";
|
4581
4587
|
|
4582
4588
|
// src/telephony-agent-presence-status/schema.ts
|
4583
|
-
import
|
4589
|
+
import z69 from "zod";
|
4584
4590
|
var PresenceStatusSchema = DefaultEntitySchema.extend({
|
4585
|
-
status:
|
4586
|
-
description:
|
4591
|
+
status: z69.string(),
|
4592
|
+
description: z69.string()
|
4587
4593
|
});
|
4588
4594
|
var UserPresenceStatusSchema = DefaultEntitySchema.extend({
|
4589
4595
|
user: UserSchema,
|
4590
4596
|
presenceStatus: PresenceStatusSchema,
|
4591
|
-
customPresenceStatus:
|
4597
|
+
customPresenceStatus: z69.string().nullable().optional()
|
4592
4598
|
});
|
4593
4599
|
|
4594
4600
|
// src/telephony-agent-presence-status/validation.ts
|
4595
|
-
import { z as
|
4596
|
-
var UpdateUserStatusSchema =
|
4597
|
-
userId:
|
4598
|
-
presenceStatusId:
|
4599
|
-
customPreseneStatus:
|
4600
|
-
reason:
|
4601
|
+
import { z as z70 } from "zod";
|
4602
|
+
var UpdateUserStatusSchema = z70.object({
|
4603
|
+
userId: z70.string(),
|
4604
|
+
presenceStatusId: z70.string().nullable().optional(),
|
4605
|
+
customPreseneStatus: z70.string().nullable().optional(),
|
4606
|
+
reason: z70.string()
|
4601
4607
|
});
|
4602
4608
|
|
4603
4609
|
// src/telephony-agent-presence-status/index.ts
|
@@ -4608,9 +4614,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4608
4614
|
path: "/presence_status",
|
4609
4615
|
headers: DefaultHeaderSchema,
|
4610
4616
|
responses: {
|
4611
|
-
200:
|
4612
|
-
400:
|
4613
|
-
message:
|
4617
|
+
200: z71.array(PresenceStatusSchema),
|
4618
|
+
400: z71.object({
|
4619
|
+
message: z71.string()
|
4614
4620
|
}),
|
4615
4621
|
401: DefaultUnauthorizedSchema,
|
4616
4622
|
500: DefaultErrorResponseSchema
|
@@ -4622,9 +4628,9 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4622
4628
|
path: "/agents/presence_status",
|
4623
4629
|
headers: DefaultHeaderSchema,
|
4624
4630
|
responses: {
|
4625
|
-
200:
|
4626
|
-
400:
|
4627
|
-
message:
|
4631
|
+
200: z71.array(UserPresenceStatusSchema),
|
4632
|
+
400: z71.object({
|
4633
|
+
message: z71.string()
|
4628
4634
|
}),
|
4629
4635
|
401: DefaultUnauthorizedSchema,
|
4630
4636
|
500: DefaultErrorResponseSchema
|
@@ -4634,12 +4640,12 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4634
4640
|
getAgentStatus: {
|
4635
4641
|
method: "GET",
|
4636
4642
|
path: "/presence_status/check_update/:userId",
|
4637
|
-
pathParams:
|
4643
|
+
pathParams: z71.object({ userId: z71.string() }),
|
4638
4644
|
headers: DefaultHeaderSchema,
|
4639
4645
|
responses: {
|
4640
4646
|
200: UserPresenceStatusSchema,
|
4641
|
-
400:
|
4642
|
-
message:
|
4647
|
+
400: z71.object({
|
4648
|
+
message: z71.string()
|
4643
4649
|
}),
|
4644
4650
|
401: DefaultUnauthorizedSchema,
|
4645
4651
|
500: DefaultErrorResponseSchema
|
@@ -4655,8 +4661,8 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4655
4661
|
200: DefaultSuccessResponseSchema.extend({
|
4656
4662
|
userPresenceStatu: UserPresenceStatusSchema
|
4657
4663
|
}),
|
4658
|
-
400:
|
4659
|
-
message:
|
4664
|
+
400: z71.object({
|
4665
|
+
message: z71.string()
|
4660
4666
|
}),
|
4661
4667
|
401: DefaultUnauthorizedSchema,
|
4662
4668
|
500: DefaultErrorResponseSchema
|
@@ -4668,58 +4674,58 @@ var telephonyAgentPresenceStatusContract = initContract27().router(
|
|
4668
4674
|
);
|
4669
4675
|
|
4670
4676
|
// src/telephony-cdr/index.ts
|
4671
|
-
import
|
4677
|
+
import z74 from "zod";
|
4672
4678
|
|
4673
4679
|
// src/telephony-cdr/validation.ts
|
4674
|
-
import
|
4675
|
-
var CreateTelephonyCdrSchema =
|
4676
|
-
uniqueCallId:
|
4677
|
-
timeStart:
|
4678
|
-
callFrom:
|
4679
|
-
callTo:
|
4680
|
-
callDuration:
|
4681
|
-
talkDuration:
|
4682
|
-
srcTrunkName:
|
4683
|
-
dstTrunkName:
|
4684
|
-
pinCode:
|
4685
|
-
status:
|
4686
|
-
type:
|
4687
|
-
recording:
|
4688
|
-
didNumber:
|
4689
|
-
agentRingTime:
|
4680
|
+
import z72 from "zod";
|
4681
|
+
var CreateTelephonyCdrSchema = z72.object({
|
4682
|
+
uniqueCallId: z72.string({ required_error: "uniqueCallId is required" }),
|
4683
|
+
timeStart: z72.string({ required_error: "timeStart is required" }),
|
4684
|
+
callFrom: z72.string({ required_error: "callFrom is required" }),
|
4685
|
+
callTo: z72.string({ required_error: "callTo is required" }),
|
4686
|
+
callDuration: z72.number().nullable(),
|
4687
|
+
talkDuration: z72.number().nullable(),
|
4688
|
+
srcTrunkName: z72.string().nullable(),
|
4689
|
+
dstTrunkName: z72.string().nullable(),
|
4690
|
+
pinCode: z72.string().nullable(),
|
4691
|
+
status: z72.string(),
|
4692
|
+
type: z72.string(),
|
4693
|
+
recording: z72.string().nullable(),
|
4694
|
+
didNumber: z72.string().nullable(),
|
4695
|
+
agentRingTime: z72.number().nullable()
|
4690
4696
|
});
|
4691
4697
|
var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
4692
|
-
selectedDate:
|
4693
|
-
type:
|
4694
|
-
status:
|
4695
|
-
callFrom:
|
4696
|
-
callTo:
|
4697
|
-
trunk:
|
4698
|
+
selectedDate: z72.string().optional(),
|
4699
|
+
type: z72.array(z72.string()).optional(),
|
4700
|
+
status: z72.array(z72.string()).optional(),
|
4701
|
+
callFrom: z72.string().optional(),
|
4702
|
+
callTo: z72.string().optional(),
|
4703
|
+
trunk: z72.array(z72.string()).optional()
|
4698
4704
|
});
|
4699
4705
|
var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
4700
|
-
type:
|
4701
|
-
status:
|
4702
|
-
callFrom:
|
4703
|
-
callTo:
|
4704
|
-
result:
|
4705
|
-
callTags:
|
4706
|
-
selectedDate:
|
4707
|
-
agentId:
|
4708
|
-
contact:
|
4709
|
-
callStatus:
|
4710
|
-
queueIds:
|
4711
|
-
notes:
|
4706
|
+
type: z72.array(z72.string()).optional(),
|
4707
|
+
status: z72.array(z72.string()).optional(),
|
4708
|
+
callFrom: z72.string().optional(),
|
4709
|
+
callTo: z72.string().optional(),
|
4710
|
+
result: z72.array(z72.string()).optional(),
|
4711
|
+
callTags: z72.array(z72.string()).optional(),
|
4712
|
+
selectedDate: z72.string().optional(),
|
4713
|
+
agentId: z72.string().optional(),
|
4714
|
+
contact: z72.array(z72.string()).optional(),
|
4715
|
+
callStatus: z72.array(z72.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
|
4716
|
+
queueIds: z72.array(z72.string()).optional(),
|
4717
|
+
notes: z72.string().optional()
|
4712
4718
|
});
|
4713
4719
|
var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
|
4714
|
-
|
4715
|
-
page:
|
4716
|
-
pageSize:
|
4720
|
+
z72.object({
|
4721
|
+
page: z72.coerce.number().positive().optional(),
|
4722
|
+
pageSize: z72.coerce.number().positive().optional()
|
4717
4723
|
})
|
4718
4724
|
);
|
4719
4725
|
var NullEmptyStringUndefined = ["", null, void 0];
|
4720
4726
|
var EmtptyArrayUndefined = [[], void 0];
|
4721
4727
|
var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
4722
|
-
reportType:
|
4728
|
+
reportType: z72.enum([
|
4723
4729
|
"extcallstatistics",
|
4724
4730
|
"extcallactivity",
|
4725
4731
|
"trunkactivity",
|
@@ -4729,59 +4735,59 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
4729
4735
|
"queueagentmisscalls",
|
4730
4736
|
"queueagentinoutcalls"
|
4731
4737
|
]),
|
4732
|
-
selectedDate:
|
4733
|
-
communicationType:
|
4734
|
-
time:
|
4735
|
-
queueList:
|
4736
|
-
queueId:
|
4737
|
-
trunkList:
|
4738
|
-
extensionList:
|
4738
|
+
selectedDate: z72.string().optional(),
|
4739
|
+
communicationType: z72.union([z72.literal("Inbound"), z72.literal("Outbound"), z72.literal("Internal")]).optional(),
|
4740
|
+
time: z72.string().optional(),
|
4741
|
+
queueList: z72.array(z72.string()).optional(),
|
4742
|
+
queueId: z72.string().optional(),
|
4743
|
+
trunkList: z72.array(z72.string()).optional(),
|
4744
|
+
extensionList: z72.array(z72.string()).optional()
|
4739
4745
|
}).superRefine((input, ctx) => {
|
4740
4746
|
if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
|
4741
4747
|
ctx.addIssue({
|
4742
|
-
code:
|
4748
|
+
code: z72.ZodIssueCode.custom,
|
4743
4749
|
path: ["selectedDate"],
|
4744
4750
|
message: "selectedDate is required."
|
4745
4751
|
});
|
4746
4752
|
}
|
4747
4753
|
if (input.reportType === "extcallstatistics" && !NullEmptyStringUndefined.includes(input.communicationType)) {
|
4748
4754
|
ctx.addIssue({
|
4749
|
-
code:
|
4755
|
+
code: z72.ZodIssueCode.custom,
|
4750
4756
|
path: ["communicationType"],
|
4751
4757
|
message: "communicationType is required."
|
4752
4758
|
});
|
4753
4759
|
}
|
4754
4760
|
if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
|
4755
4761
|
ctx.addIssue({
|
4756
|
-
code:
|
4762
|
+
code: z72.ZodIssueCode.custom,
|
4757
4763
|
path: ["time"],
|
4758
4764
|
message: "time is required."
|
4759
4765
|
});
|
4760
4766
|
}
|
4761
4767
|
if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
|
4762
4768
|
ctx.addIssue({
|
4763
|
-
code:
|
4769
|
+
code: z72.ZodIssueCode.custom,
|
4764
4770
|
path: ["queueList"],
|
4765
4771
|
message: "queueList is required."
|
4766
4772
|
});
|
4767
4773
|
}
|
4768
4774
|
if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
|
4769
4775
|
ctx.addIssue({
|
4770
|
-
code:
|
4776
|
+
code: z72.ZodIssueCode.custom,
|
4771
4777
|
path: ["queueId"],
|
4772
4778
|
message: "queueId is required."
|
4773
4779
|
});
|
4774
4780
|
}
|
4775
4781
|
if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
|
4776
4782
|
ctx.addIssue({
|
4777
|
-
code:
|
4783
|
+
code: z72.ZodIssueCode.custom,
|
4778
4784
|
path: ["trunkList"],
|
4779
4785
|
message: "trunkList is required."
|
4780
4786
|
});
|
4781
4787
|
}
|
4782
4788
|
if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
|
4783
4789
|
ctx.addIssue({
|
4784
|
-
code:
|
4790
|
+
code: z72.ZodIssueCode.custom,
|
4785
4791
|
path: ["extensionList"],
|
4786
4792
|
message: "extensionList is required."
|
4787
4793
|
});
|
@@ -4792,161 +4798,161 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
4792
4798
|
import { initContract as initContract28 } from "@ts-rest/core";
|
4793
4799
|
|
4794
4800
|
// src/telephony-cdr/call-report.schema.ts
|
4795
|
-
import
|
4796
|
-
var ExtCallStatisticsListSchema =
|
4801
|
+
import z73 from "zod";
|
4802
|
+
var ExtCallStatisticsListSchema = z73.object({
|
4797
4803
|
/** @example "ext_num" */
|
4798
|
-
ext_num:
|
4804
|
+
ext_num: z73.string(),
|
4799
4805
|
/** @example "ext_name" */
|
4800
|
-
ext_name:
|
4806
|
+
ext_name: z73.string(),
|
4801
4807
|
/** @example 0 */
|
4802
|
-
answered_calls:
|
4808
|
+
answered_calls: z73.number(),
|
4803
4809
|
/** @example 0 */
|
4804
|
-
no_answer_calls:
|
4810
|
+
no_answer_calls: z73.number(),
|
4805
4811
|
/** @example 0 */
|
4806
|
-
busy_calls:
|
4812
|
+
busy_calls: z73.number(),
|
4807
4813
|
/** @example 0 */
|
4808
|
-
failed_calls:
|
4814
|
+
failed_calls: z73.number(),
|
4809
4815
|
/** @example 0 */
|
4810
|
-
voicemail_calls:
|
4816
|
+
voicemail_calls: z73.number(),
|
4811
4817
|
/** @example 0 */
|
4812
|
-
total_holding_time:
|
4818
|
+
total_holding_time: z73.number(),
|
4813
4819
|
/** @example 0 */
|
4814
|
-
total_talking_time:
|
4820
|
+
total_talking_time: z73.number(),
|
4815
4821
|
/** @example "src_name" */
|
4816
|
-
src_name:
|
4822
|
+
src_name: z73.string(),
|
4817
4823
|
/** @example 0 */
|
4818
|
-
total_call_count:
|
4824
|
+
total_call_count: z73.number(),
|
4819
4825
|
/** @example "mobile" */
|
4820
|
-
mobile:
|
4821
|
-
});
|
4822
|
-
var ExtStatisticSchema =
|
4823
|
-
ext_num:
|
4824
|
-
ext_name:
|
4825
|
-
answered_calls:
|
4826
|
-
no_answer_calls:
|
4827
|
-
busy_calls:
|
4828
|
-
failed_calls:
|
4829
|
-
voicemail_calls:
|
4830
|
-
total_holding_time:
|
4831
|
-
total_talking_time:
|
4832
|
-
time:
|
4833
|
-
mobile:
|
4834
|
-
});
|
4835
|
-
var ExtCallActivityListSchema =
|
4836
|
-
time:
|
4837
|
-
answered_calls:
|
4838
|
-
no_answer_calls:
|
4839
|
-
busy_calls:
|
4840
|
-
failed_calls:
|
4841
|
-
voicemail_calls:
|
4842
|
-
total_holding_time:
|
4843
|
-
total_talking_time:
|
4844
|
-
ext_statistics:
|
4845
|
-
});
|
4846
|
-
var TrunkList =
|
4847
|
-
trunk_name:
|
4848
|
-
total_calls:
|
4849
|
-
});
|
4850
|
-
var TrunkActivityListSchema =
|
4851
|
-
time:
|
4852
|
-
trunk_list:
|
4853
|
-
});
|
4854
|
-
var QueueAvgWaitTalkTimeListSchema =
|
4855
|
-
time:
|
4856
|
-
avg_wait_time:
|
4857
|
-
avg_talk_time:
|
4858
|
-
});
|
4859
|
-
var SatisfactionListSchema =
|
4860
|
-
press_key:
|
4861
|
-
total:
|
4862
|
-
key_point:
|
4863
|
-
});
|
4864
|
-
var agentListSchema =
|
4865
|
-
agent_name:
|
4866
|
-
agent_num:
|
4867
|
-
satisfaction_list:
|
4868
|
-
total_key:
|
4869
|
-
total_point:
|
4870
|
-
average_point:
|
4871
|
-
});
|
4872
|
-
var QueueSatisfactionSchema =
|
4873
|
-
queue_name:
|
4874
|
-
queue_num:
|
4875
|
-
satisfaction_list:
|
4876
|
-
agent_list:
|
4877
|
-
total_key:
|
4878
|
-
total_point:
|
4879
|
-
average_point:
|
4880
|
-
});
|
4881
|
-
var QueuePerformanceListSchema =
|
4882
|
-
queue:
|
4883
|
-
total_calls:
|
4884
|
-
answered_calls:
|
4885
|
-
missed_calls:
|
4886
|
-
abandoned_calls:
|
4887
|
-
average_waiting_time:
|
4888
|
-
average_talking_time:
|
4889
|
-
max_waiting_time:
|
4890
|
-
answered_rate:
|
4891
|
-
missed_rate:
|
4892
|
-
abandoned_rate:
|
4893
|
-
sla:
|
4894
|
-
});
|
4895
|
-
var QueueAgentMissCallsListSchema =
|
4896
|
-
agent_name:
|
4897
|
-
agent_num:
|
4898
|
-
time:
|
4899
|
-
total_wait_time:
|
4900
|
-
src_name:
|
4901
|
-
src_num:
|
4902
|
-
queue_status:
|
4903
|
-
polling_attempts:
|
4904
|
-
missed_reason:
|
4905
|
-
});
|
4906
|
-
var QueueAgentInOutCallsListSchema =
|
4907
|
-
agent_name:
|
4908
|
-
agent_num:
|
4909
|
-
inbound_calls:
|
4910
|
-
inbound_duration:
|
4911
|
-
outbound_calls:
|
4912
|
-
outbound_duration:
|
4913
|
-
total_calls:
|
4914
|
-
total_duration:
|
4915
|
-
average_talk_duration:
|
4916
|
-
});
|
4917
|
-
var CallReportModel =
|
4918
|
-
errcode:
|
4919
|
-
errmsg:
|
4920
|
-
total_number:
|
4921
|
-
is_12hour:
|
4922
|
-
ext_call_statistics_list:
|
4923
|
-
ext_call_activity_list:
|
4924
|
-
trunk_activity_list:
|
4925
|
-
queue_avg_wait_talk_time_list:
|
4826
|
+
mobile: z73.string()
|
4827
|
+
});
|
4828
|
+
var ExtStatisticSchema = z73.object({
|
4829
|
+
ext_num: z73.string(),
|
4830
|
+
ext_name: z73.string(),
|
4831
|
+
answered_calls: z73.number(),
|
4832
|
+
no_answer_calls: z73.number(),
|
4833
|
+
busy_calls: z73.number(),
|
4834
|
+
failed_calls: z73.number(),
|
4835
|
+
voicemail_calls: z73.number(),
|
4836
|
+
total_holding_time: z73.number(),
|
4837
|
+
total_talking_time: z73.number(),
|
4838
|
+
time: z73.number(),
|
4839
|
+
mobile: z73.string()
|
4840
|
+
});
|
4841
|
+
var ExtCallActivityListSchema = z73.object({
|
4842
|
+
time: z73.number(),
|
4843
|
+
answered_calls: z73.number(),
|
4844
|
+
no_answer_calls: z73.number(),
|
4845
|
+
busy_calls: z73.number(),
|
4846
|
+
failed_calls: z73.number(),
|
4847
|
+
voicemail_calls: z73.number(),
|
4848
|
+
total_holding_time: z73.number(),
|
4849
|
+
total_talking_time: z73.number(),
|
4850
|
+
ext_statistics: z73.array(ExtStatisticSchema)
|
4851
|
+
});
|
4852
|
+
var TrunkList = z73.object({
|
4853
|
+
trunk_name: z73.string(),
|
4854
|
+
total_calls: z73.number()
|
4855
|
+
});
|
4856
|
+
var TrunkActivityListSchema = z73.object({
|
4857
|
+
time: z73.number(),
|
4858
|
+
trunk_list: z73.array(TrunkList)
|
4859
|
+
});
|
4860
|
+
var QueueAvgWaitTalkTimeListSchema = z73.object({
|
4861
|
+
time: z73.number(),
|
4862
|
+
avg_wait_time: z73.number(),
|
4863
|
+
avg_talk_time: z73.number()
|
4864
|
+
});
|
4865
|
+
var SatisfactionListSchema = z73.object({
|
4866
|
+
press_key: z73.string(),
|
4867
|
+
total: z73.number(),
|
4868
|
+
key_point: z73.number().optional()
|
4869
|
+
});
|
4870
|
+
var agentListSchema = z73.object({
|
4871
|
+
agent_name: z73.string(),
|
4872
|
+
agent_num: z73.string(),
|
4873
|
+
satisfaction_list: z73.array(SatisfactionListSchema).optional(),
|
4874
|
+
total_key: z73.number().optional(),
|
4875
|
+
total_point: z73.number().optional(),
|
4876
|
+
average_point: z73.number().optional()
|
4877
|
+
});
|
4878
|
+
var QueueSatisfactionSchema = z73.object({
|
4879
|
+
queue_name: z73.string(),
|
4880
|
+
queue_num: z73.string(),
|
4881
|
+
satisfaction_list: z73.array(SatisfactionListSchema).optional(),
|
4882
|
+
agent_list: z73.array(agentListSchema).optional(),
|
4883
|
+
total_key: z73.number().optional(),
|
4884
|
+
total_point: z73.number().optional(),
|
4885
|
+
average_point: z73.number().optional()
|
4886
|
+
});
|
4887
|
+
var QueuePerformanceListSchema = z73.object({
|
4888
|
+
queue: z73.string(),
|
4889
|
+
total_calls: z73.number(),
|
4890
|
+
answered_calls: z73.number(),
|
4891
|
+
missed_calls: z73.number(),
|
4892
|
+
abandoned_calls: z73.number(),
|
4893
|
+
average_waiting_time: z73.number(),
|
4894
|
+
average_talking_time: z73.number(),
|
4895
|
+
max_waiting_time: z73.number(),
|
4896
|
+
answered_rate: z73.number(),
|
4897
|
+
missed_rate: z73.number(),
|
4898
|
+
abandoned_rate: z73.number(),
|
4899
|
+
sla: z73.number()
|
4900
|
+
});
|
4901
|
+
var QueueAgentMissCallsListSchema = z73.object({
|
4902
|
+
agent_name: z73.string(),
|
4903
|
+
agent_num: z73.string(),
|
4904
|
+
time: z73.string(),
|
4905
|
+
total_wait_time: z73.number(),
|
4906
|
+
src_name: z73.string(),
|
4907
|
+
src_num: z73.string(),
|
4908
|
+
queue_status: z73.string(),
|
4909
|
+
polling_attempts: z73.number(),
|
4910
|
+
missed_reason: z73.string()
|
4911
|
+
});
|
4912
|
+
var QueueAgentInOutCallsListSchema = z73.object({
|
4913
|
+
agent_name: z73.string(),
|
4914
|
+
agent_num: z73.string(),
|
4915
|
+
inbound_calls: z73.number(),
|
4916
|
+
inbound_duration: z73.number(),
|
4917
|
+
outbound_calls: z73.number(),
|
4918
|
+
outbound_duration: z73.number(),
|
4919
|
+
total_calls: z73.number(),
|
4920
|
+
total_duration: z73.number(),
|
4921
|
+
average_talk_duration: z73.number()
|
4922
|
+
});
|
4923
|
+
var CallReportModel = z73.object({
|
4924
|
+
errcode: z73.number(),
|
4925
|
+
errmsg: z73.string(),
|
4926
|
+
total_number: z73.number(),
|
4927
|
+
is_12hour: z73.number().optional(),
|
4928
|
+
ext_call_statistics_list: z73.array(ExtCallStatisticsListSchema).optional(),
|
4929
|
+
ext_call_activity_list: z73.array(ExtCallActivityListSchema).optional(),
|
4930
|
+
trunk_activity_list: z73.array(TrunkActivityListSchema).optional(),
|
4931
|
+
queue_avg_wait_talk_time_list: z73.array(QueueAvgWaitTalkTimeListSchema).optional(),
|
4926
4932
|
queue_satisfaction: QueueSatisfactionSchema.optional(),
|
4927
|
-
queue_performance_list:
|
4928
|
-
queue_agent_miss_calls_list:
|
4929
|
-
queue_agent_in_out_calls_list:
|
4930
|
-
callback_result:
|
4931
|
-
page:
|
4932
|
-
pageSize:
|
4933
|
-
});
|
4934
|
-
var CallReportSchema =
|
4935
|
-
errcode:
|
4936
|
-
errmsg:
|
4937
|
-
total_number:
|
4938
|
-
is_12hour:
|
4939
|
-
ext_call_statistics_list:
|
4940
|
-
ext_call_activity_list:
|
4941
|
-
trunk_activity_list:
|
4942
|
-
queue_avg_wait_talk_time_list:
|
4933
|
+
queue_performance_list: z73.array(QueuePerformanceListSchema).optional(),
|
4934
|
+
queue_agent_miss_calls_list: z73.array(QueueAgentMissCallsListSchema).optional(),
|
4935
|
+
queue_agent_in_out_calls_list: z73.array(QueueAgentInOutCallsListSchema).optional(),
|
4936
|
+
callback_result: z73.string(),
|
4937
|
+
page: z73.number().optional(),
|
4938
|
+
pageSize: z73.number().optional()
|
4939
|
+
});
|
4940
|
+
var CallReportSchema = z73.object({
|
4941
|
+
errcode: z73.number(),
|
4942
|
+
errmsg: z73.string(),
|
4943
|
+
total_number: z73.number(),
|
4944
|
+
is_12hour: z73.number().optional(),
|
4945
|
+
ext_call_statistics_list: z73.array(ExtCallStatisticsListSchema).optional(),
|
4946
|
+
ext_call_activity_list: z73.array(ExtCallActivityListSchema).optional(),
|
4947
|
+
trunk_activity_list: z73.array(TrunkActivityListSchema).optional(),
|
4948
|
+
queue_avg_wait_talk_time_list: z73.array(QueueAvgWaitTalkTimeListSchema).optional(),
|
4943
4949
|
queue_satisfaction: QueueSatisfactionSchema.optional(),
|
4944
|
-
queue_performance_list:
|
4945
|
-
queue_agent_miss_calls_list:
|
4946
|
-
queue_agent_in_out_calls_list:
|
4947
|
-
callback_result:
|
4948
|
-
page:
|
4949
|
-
pageSize:
|
4950
|
+
queue_performance_list: z73.array(QueuePerformanceListSchema).optional(),
|
4951
|
+
queue_agent_miss_calls_list: z73.array(QueueAgentMissCallsListSchema).optional(),
|
4952
|
+
queue_agent_in_out_calls_list: z73.array(QueueAgentInOutCallsListSchema).optional(),
|
4953
|
+
callback_result: z73.string(),
|
4954
|
+
page: z73.number().optional(),
|
4955
|
+
pageSize: z73.number().optional()
|
4950
4956
|
});
|
4951
4957
|
|
4952
4958
|
// src/telephony-cdr/index.ts
|
@@ -4959,10 +4965,10 @@ var telephonyCdrContract = initContract28().router(
|
|
4959
4965
|
query: GetAllTelephonyCdrSchema,
|
4960
4966
|
responses: {
|
4961
4967
|
200: DefaultSuccessResponseSchema.extend({
|
4962
|
-
total:
|
4963
|
-
page:
|
4964
|
-
pageSize:
|
4965
|
-
telephonyCdrs:
|
4968
|
+
total: z74.number(),
|
4969
|
+
page: z74.number(),
|
4970
|
+
pageSize: z74.number(),
|
4971
|
+
telephonyCdrs: z74.array(TelephonyCdrSchema)
|
4966
4972
|
}),
|
4967
4973
|
401: DefaultUnauthorizedSchema
|
4968
4974
|
},
|
@@ -4975,10 +4981,10 @@ var telephonyCdrContract = initContract28().router(
|
|
4975
4981
|
query: GetAllTelephonyCdrSchema,
|
4976
4982
|
responses: {
|
4977
4983
|
200: DefaultSuccessResponseSchema.extend({
|
4978
|
-
total:
|
4979
|
-
page:
|
4980
|
-
pageSize:
|
4981
|
-
telephonyCdrs:
|
4984
|
+
total: z74.number(),
|
4985
|
+
page: z74.number(),
|
4986
|
+
pageSize: z74.number(),
|
4987
|
+
telephonyCdrs: z74.array(TelephonyCdrSchema)
|
4982
4988
|
}),
|
4983
4989
|
401: DefaultUnauthorizedSchema
|
4984
4990
|
},
|
@@ -4991,10 +4997,10 @@ var telephonyCdrContract = initContract28().router(
|
|
4991
4997
|
query: GetRecentTelephonyCdrSchema,
|
4992
4998
|
responses: {
|
4993
4999
|
200: DefaultSuccessResponseSchema.extend({
|
4994
|
-
total:
|
4995
|
-
page:
|
4996
|
-
pageSize:
|
4997
|
-
telephonyCdrs:
|
5000
|
+
total: z74.number(),
|
5001
|
+
page: z74.number(),
|
5002
|
+
pageSize: z74.number(),
|
5003
|
+
telephonyCdrs: z74.array(TelephonyCdrSchema)
|
4998
5004
|
}),
|
4999
5005
|
401: DefaultUnauthorizedSchema
|
5000
5006
|
},
|
@@ -5086,35 +5092,35 @@ var telephonyCdrContract = initContract28().router(
|
|
5086
5092
|
|
5087
5093
|
// src/telephony-extension/index.ts
|
5088
5094
|
import { initContract as initContract29 } from "@ts-rest/core";
|
5089
|
-
import
|
5095
|
+
import z76 from "zod";
|
5090
5096
|
|
5091
5097
|
// src/telephony-extension/schema.ts
|
5092
|
-
import
|
5093
|
-
var TelephonyExtensionSchema3 =
|
5094
|
-
errcode:
|
5095
|
-
errmsg:
|
5096
|
-
total_number:
|
5097
|
-
data:
|
5098
|
-
|
5099
|
-
id:
|
5100
|
-
online_status:
|
5101
|
-
fx_phone:
|
5102
|
-
sip_phone:
|
5103
|
-
status:
|
5104
|
-
ext_dev_type:
|
5105
|
-
}),
|
5106
|
-
linkus_desktop:
|
5107
|
-
linkus_mobile:
|
5108
|
-
linkus_web:
|
5109
|
-
status:
|
5110
|
-
ext_dev_type:
|
5098
|
+
import z75 from "zod";
|
5099
|
+
var TelephonyExtensionSchema3 = z75.object({
|
5100
|
+
errcode: z75.coerce.number(),
|
5101
|
+
errmsg: z75.string(),
|
5102
|
+
total_number: z75.coerce.number(),
|
5103
|
+
data: z75.array(
|
5104
|
+
z75.object({
|
5105
|
+
id: z75.coerce.number(),
|
5106
|
+
online_status: z75.object({
|
5107
|
+
fx_phone: z75.object({ status: z75.coerce.number() }),
|
5108
|
+
sip_phone: z75.object({
|
5109
|
+
status: z75.coerce.number(),
|
5110
|
+
ext_dev_type: z75.string().optional()
|
5111
|
+
}),
|
5112
|
+
linkus_desktop: z75.object({ status: z75.coerce.number() }),
|
5113
|
+
linkus_mobile: z75.object({ status: z75.coerce.number() }),
|
5114
|
+
linkus_web: z75.object({
|
5115
|
+
status: z75.coerce.number(),
|
5116
|
+
ext_dev_type: z75.string().optional()
|
5111
5117
|
})
|
5112
5118
|
}).optional(),
|
5113
|
-
presence_status:
|
5114
|
-
number:
|
5115
|
-
caller_id_name:
|
5116
|
-
role_name:
|
5117
|
-
email_addr:
|
5119
|
+
presence_status: z75.string().optional(),
|
5120
|
+
number: z75.string().optional(),
|
5121
|
+
caller_id_name: z75.string().optional(),
|
5122
|
+
role_name: z75.string().optional(),
|
5123
|
+
email_addr: z75.string().optional()
|
5118
5124
|
})
|
5119
5125
|
)
|
5120
5126
|
});
|
@@ -5129,8 +5135,8 @@ var telephonyExtensionContract = initContract29().router(
|
|
5129
5135
|
query: null,
|
5130
5136
|
responses: {
|
5131
5137
|
200: TelephonyExtensionSchema3,
|
5132
|
-
400:
|
5133
|
-
message:
|
5138
|
+
400: z76.object({
|
5139
|
+
message: z76.string()
|
5134
5140
|
}),
|
5135
5141
|
401: DefaultUnauthorizedSchema,
|
5136
5142
|
500: DefaultErrorResponseSchema
|
@@ -5143,10 +5149,10 @@ var telephonyExtensionContract = initContract29().router(
|
|
5143
5149
|
|
5144
5150
|
// src/ticket/index.ts
|
5145
5151
|
import { initContract as initContract30 } from "@ts-rest/core";
|
5146
|
-
import
|
5152
|
+
import z78 from "zod";
|
5147
5153
|
|
5148
5154
|
// src/ticket/validation.ts
|
5149
|
-
import
|
5155
|
+
import z77 from "zod";
|
5150
5156
|
var addErrorMessage2 = (field) => {
|
5151
5157
|
return field.refine(
|
5152
5158
|
({ isRequired, value }) => {
|
@@ -5164,106 +5170,106 @@ var addErrorMessage2 = (field) => {
|
|
5164
5170
|
}
|
5165
5171
|
);
|
5166
5172
|
};
|
5167
|
-
var BaseSchema3 =
|
5168
|
-
isRequired:
|
5169
|
-
attributeId:
|
5173
|
+
var BaseSchema3 = z77.object({
|
5174
|
+
isRequired: z77.boolean(),
|
5175
|
+
attributeId: z77.string()
|
5170
5176
|
});
|
5171
5177
|
var SingleValue2 = addErrorMessage2(
|
5172
5178
|
BaseSchema3.extend({
|
5173
|
-
value:
|
5179
|
+
value: z77.string()
|
5174
5180
|
})
|
5175
5181
|
);
|
5176
|
-
var CreateTicketValidationSchema =
|
5182
|
+
var CreateTicketValidationSchema = z77.object({
|
5177
5183
|
title: SingleValue2,
|
5178
5184
|
description: SingleValue2,
|
5179
5185
|
status: SingleValue2,
|
5180
5186
|
type: SingleValue2,
|
5181
5187
|
priority: SingleValue2,
|
5182
5188
|
contact: SingleValue2,
|
5183
|
-
assignee:
|
5184
|
-
isRequired:
|
5185
|
-
attributeId:
|
5186
|
-
value:
|
5189
|
+
assignee: z77.object({
|
5190
|
+
isRequired: z77.boolean(),
|
5191
|
+
attributeId: z77.string(),
|
5192
|
+
value: z77.string()
|
5187
5193
|
}),
|
5188
5194
|
channel: SingleValue2,
|
5189
|
-
tags: addErrorMessage2(BaseSchema3.extend({ value:
|
5190
|
-
categories: BaseSchema3.extend({ value:
|
5191
|
-
customFields:
|
5195
|
+
tags: addErrorMessage2(BaseSchema3.extend({ value: z77.array(z77.string()) })),
|
5196
|
+
categories: BaseSchema3.extend({ value: z77.array(z77.string()) }),
|
5197
|
+
customFields: z77.array(
|
5192
5198
|
addErrorMessage2(
|
5193
5199
|
BaseSchema3.extend({
|
5194
|
-
value:
|
5195
|
-
type:
|
5196
|
-
isDefaultAttribute:
|
5200
|
+
value: z77.union([z77.string(), z77.array(z77.string())]),
|
5201
|
+
type: z77.string(),
|
5202
|
+
isDefaultAttribute: z77.boolean()
|
5197
5203
|
})
|
5198
5204
|
)
|
5199
5205
|
),
|
5200
|
-
reasonToAssign:
|
5206
|
+
reasonToAssign: z77.object({ value: z77.string() }).optional()
|
5201
5207
|
});
|
5202
5208
|
var UpdateTicketValidationSchema = CreateTicketValidationSchema;
|
5203
|
-
var TicketAttachmentRecordSchema =
|
5204
|
-
bucketName:
|
5205
|
-
fileKey:
|
5206
|
-
fileName:
|
5207
|
-
fileSize:
|
5208
|
-
url:
|
5209
|
-
});
|
5210
|
-
var CreateTicketAttachmentRecordsSchema =
|
5211
|
-
ticketId:
|
5212
|
-
attributeId:
|
5213
|
-
ticketAttachmentRecords:
|
5214
|
-
});
|
5215
|
-
var TicketParamsSchema =
|
5216
|
-
page:
|
5217
|
-
pageSize:
|
5218
|
-
});
|
5219
|
-
var CustomFieldQuery =
|
5220
|
-
attributeId:
|
5221
|
-
type:
|
5222
|
-
value:
|
5223
|
-
});
|
5224
|
-
var GetAllTicketQuerySchema =
|
5225
|
-
page:
|
5226
|
-
pageSize:
|
5227
|
-
selectedDate:
|
5228
|
-
keyword:
|
5229
|
-
title:
|
5230
|
-
description:
|
5231
|
-
status:
|
5232
|
-
priority:
|
5233
|
-
channel:
|
5234
|
-
type:
|
5235
|
-
ticketType:
|
5236
|
-
contact:
|
5237
|
-
tags:
|
5238
|
-
categories:
|
5239
|
-
assignee:
|
5240
|
-
customFields:
|
5241
|
-
|
5242
|
-
attributeId:
|
5243
|
-
type:
|
5244
|
-
value:
|
5209
|
+
var TicketAttachmentRecordSchema = z77.object({
|
5210
|
+
bucketName: z77.string(),
|
5211
|
+
fileKey: z77.string(),
|
5212
|
+
fileName: z77.string(),
|
5213
|
+
fileSize: z77.coerce.number(),
|
5214
|
+
url: z77.string()
|
5215
|
+
});
|
5216
|
+
var CreateTicketAttachmentRecordsSchema = z77.object({
|
5217
|
+
ticketId: z77.string(),
|
5218
|
+
attributeId: z77.string(),
|
5219
|
+
ticketAttachmentRecords: z77.array(TicketAttachmentRecordSchema)
|
5220
|
+
});
|
5221
|
+
var TicketParamsSchema = z77.object({
|
5222
|
+
page: z77.coerce.number().default(1),
|
5223
|
+
pageSize: z77.coerce.number().default(10)
|
5224
|
+
});
|
5225
|
+
var CustomFieldQuery = z77.object({
|
5226
|
+
attributeId: z77.string(),
|
5227
|
+
type: z77.string(),
|
5228
|
+
value: z77.union([z77.string(), z77.array(z77.string())])
|
5229
|
+
});
|
5230
|
+
var GetAllTicketQuerySchema = z77.object({
|
5231
|
+
page: z77.string().transform((value) => Number(value)),
|
5232
|
+
pageSize: z77.string().transform((value) => Number(value)),
|
5233
|
+
selectedDate: z77.string(),
|
5234
|
+
keyword: z77.string(),
|
5235
|
+
title: z77.string(),
|
5236
|
+
description: z77.string(),
|
5237
|
+
status: z77.array(z77.string()),
|
5238
|
+
priority: z77.array(z77.string()),
|
5239
|
+
channel: z77.array(z77.string()),
|
5240
|
+
type: z77.array(z77.string()),
|
5241
|
+
ticketType: z77.array(z77.string()),
|
5242
|
+
contact: z77.array(z77.string()),
|
5243
|
+
tags: z77.array(z77.string().uuid()),
|
5244
|
+
categories: z77.array(z77.string().uuid()),
|
5245
|
+
assignee: z77.array(z77.string().uuid()),
|
5246
|
+
customFields: z77.array(
|
5247
|
+
z77.object({
|
5248
|
+
attributeId: z77.string().uuid(),
|
5249
|
+
type: z77.string(),
|
5250
|
+
value: z77.union([z77.string(), z77.array(z77.string())])
|
5245
5251
|
})
|
5246
5252
|
)
|
5247
5253
|
}).partial();
|
5248
|
-
var ExportAllTicketQuerySchema =
|
5249
|
-
agent:
|
5250
|
-
selectedDate:
|
5251
|
-
keyword:
|
5252
|
-
title:
|
5253
|
-
description:
|
5254
|
-
status:
|
5255
|
-
priority:
|
5256
|
-
channel:
|
5257
|
-
type:
|
5258
|
-
ticketType:
|
5259
|
-
contact:
|
5260
|
-
tags:
|
5261
|
-
categories:
|
5262
|
-
customFields:
|
5263
|
-
|
5264
|
-
attributeId:
|
5265
|
-
type:
|
5266
|
-
value:
|
5254
|
+
var ExportAllTicketQuerySchema = z77.object({
|
5255
|
+
agent: z77.array(z77.string()),
|
5256
|
+
selectedDate: z77.string(),
|
5257
|
+
keyword: z77.string(),
|
5258
|
+
title: z77.string(),
|
5259
|
+
description: z77.string(),
|
5260
|
+
status: z77.array(z77.string()),
|
5261
|
+
priority: z77.array(z77.string()),
|
5262
|
+
channel: z77.array(z77.string()),
|
5263
|
+
type: z77.array(z77.string()),
|
5264
|
+
ticketType: z77.array(z77.string()),
|
5265
|
+
contact: z77.array(z77.string()),
|
5266
|
+
tags: z77.array(z77.string()),
|
5267
|
+
categories: z77.array(z77.string()),
|
5268
|
+
customFields: z77.array(
|
5269
|
+
z77.object({
|
5270
|
+
attributeId: z77.string().uuid(),
|
5271
|
+
type: z77.string(),
|
5272
|
+
value: z77.union([z77.string(), z77.array(z77.string())])
|
5267
5273
|
})
|
5268
5274
|
)
|
5269
5275
|
}).partial();
|
@@ -5279,14 +5285,14 @@ var ticketContract = initContract30().router(
|
|
5279
5285
|
201: DefaultSuccessResponseSchema.extend({
|
5280
5286
|
data: TicketSchema
|
5281
5287
|
}),
|
5282
|
-
400:
|
5283
|
-
message:
|
5288
|
+
400: z78.object({
|
5289
|
+
message: z78.string()
|
5284
5290
|
}),
|
5285
|
-
409:
|
5286
|
-
message:
|
5291
|
+
409: z78.object({
|
5292
|
+
message: z78.string()
|
5287
5293
|
}),
|
5288
|
-
500:
|
5289
|
-
message:
|
5294
|
+
500: z78.object({
|
5295
|
+
message: z78.string()
|
5290
5296
|
}),
|
5291
5297
|
401: DefaultUnauthorizedSchema,
|
5292
5298
|
404: DefaultNotFoundSchema,
|
@@ -5307,8 +5313,8 @@ var ticketContract = initContract30().router(
|
|
5307
5313
|
TicketSchema
|
5308
5314
|
)
|
5309
5315
|
}),
|
5310
|
-
400:
|
5311
|
-
message:
|
5316
|
+
400: z78.object({
|
5317
|
+
message: z78.string()
|
5312
5318
|
}),
|
5313
5319
|
401: DefaultUnauthorizedSchema,
|
5314
5320
|
500: DefaultErrorResponseSchema
|
@@ -5318,14 +5324,14 @@ var ticketContract = initContract30().router(
|
|
5318
5324
|
getTicketById: {
|
5319
5325
|
method: "GET",
|
5320
5326
|
path: "/:id",
|
5321
|
-
pathParams:
|
5327
|
+
pathParams: z78.object({ id: z78.string() }),
|
5322
5328
|
headers: DefaultHeaderSchema,
|
5323
5329
|
responses: {
|
5324
5330
|
200: DefaultSuccessResponseSchema.extend({
|
5325
5331
|
data: TicketSchema
|
5326
5332
|
}),
|
5327
|
-
400:
|
5328
|
-
message:
|
5333
|
+
400: z78.object({
|
5334
|
+
message: z78.string()
|
5329
5335
|
}),
|
5330
5336
|
401: DefaultUnauthorizedSchema,
|
5331
5337
|
500: DefaultErrorResponseSchema
|
@@ -5335,15 +5341,15 @@ var ticketContract = initContract30().router(
|
|
5335
5341
|
getTicketByContactId: {
|
5336
5342
|
method: "GET",
|
5337
5343
|
path: "/contact/:id",
|
5338
|
-
pathParams:
|
5344
|
+
pathParams: z78.object({ id: z78.string() }),
|
5339
5345
|
query: TicketParamsSchema,
|
5340
5346
|
headers: DefaultHeaderSchema,
|
5341
5347
|
responses: {
|
5342
5348
|
200: DefaultSuccessResponseSchema.extend({
|
5343
5349
|
data: WithPagination(TicketSchema)
|
5344
5350
|
}),
|
5345
|
-
400:
|
5346
|
-
message:
|
5351
|
+
400: z78.object({
|
5352
|
+
message: z78.string()
|
5347
5353
|
}),
|
5348
5354
|
401: DefaultUnauthorizedSchema,
|
5349
5355
|
500: DefaultErrorResponseSchema
|
@@ -5353,21 +5359,21 @@ var ticketContract = initContract30().router(
|
|
5353
5359
|
updateTicket: {
|
5354
5360
|
method: "PATCH",
|
5355
5361
|
path: "/:id",
|
5356
|
-
pathParams:
|
5362
|
+
pathParams: z78.object({ id: z78.string() }),
|
5357
5363
|
body: UpdateTicketValidationSchema,
|
5358
5364
|
headers: DefaultHeaderSchema,
|
5359
5365
|
responses: {
|
5360
5366
|
201: DefaultSuccessResponseSchema.extend({
|
5361
5367
|
data: TicketSchema
|
5362
5368
|
}),
|
5363
|
-
400:
|
5364
|
-
message:
|
5369
|
+
400: z78.object({
|
5370
|
+
message: z78.string()
|
5365
5371
|
}),
|
5366
|
-
409:
|
5367
|
-
message:
|
5372
|
+
409: z78.object({
|
5373
|
+
message: z78.string()
|
5368
5374
|
}),
|
5369
|
-
500:
|
5370
|
-
message:
|
5375
|
+
500: z78.object({
|
5376
|
+
message: z78.string()
|
5371
5377
|
}),
|
5372
5378
|
401: DefaultUnauthorizedSchema,
|
5373
5379
|
404: DefaultNotFoundSchema,
|
@@ -5378,11 +5384,11 @@ var ticketContract = initContract30().router(
|
|
5378
5384
|
deleteTicket: {
|
5379
5385
|
method: "DELETE",
|
5380
5386
|
path: "/:id",
|
5381
|
-
pathParams:
|
5387
|
+
pathParams: z78.object({ id: z78.string() }),
|
5382
5388
|
headers: DefaultHeaderSchema,
|
5383
5389
|
body: null,
|
5384
5390
|
responses: {
|
5385
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5391
|
+
200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
|
5386
5392
|
500: DefaultErrorResponseSchema
|
5387
5393
|
},
|
5388
5394
|
summary: "Delete a extension."
|
@@ -5390,19 +5396,19 @@ var ticketContract = initContract30().router(
|
|
5390
5396
|
updateDescription: {
|
5391
5397
|
method: "PATCH",
|
5392
5398
|
path: "/description/update/:id",
|
5393
|
-
pathParams:
|
5394
|
-
body:
|
5399
|
+
pathParams: z78.object({ id: z78.string() }),
|
5400
|
+
body: z78.object({ description: z78.string() }),
|
5395
5401
|
headers: DefaultHeaderSchema,
|
5396
5402
|
responses: {
|
5397
|
-
201: DefaultSuccessResponseSchema.extend({ message:
|
5398
|
-
400:
|
5399
|
-
message:
|
5403
|
+
201: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
|
5404
|
+
400: z78.object({
|
5405
|
+
message: z78.string()
|
5400
5406
|
}),
|
5401
|
-
409:
|
5402
|
-
message:
|
5407
|
+
409: z78.object({
|
5408
|
+
message: z78.string()
|
5403
5409
|
}),
|
5404
|
-
500:
|
5405
|
-
message:
|
5410
|
+
500: z78.object({
|
5411
|
+
message: z78.string()
|
5406
5412
|
}),
|
5407
5413
|
401: DefaultUnauthorizedSchema,
|
5408
5414
|
404: DefaultNotFoundSchema,
|
@@ -5413,19 +5419,19 @@ var ticketContract = initContract30().router(
|
|
5413
5419
|
updateTitle: {
|
5414
5420
|
method: "PATCH",
|
5415
5421
|
path: "/title/update/:id",
|
5416
|
-
pathParams:
|
5417
|
-
body:
|
5422
|
+
pathParams: z78.object({ id: z78.string() }),
|
5423
|
+
body: z78.object({ title: z78.string() }),
|
5418
5424
|
headers: DefaultHeaderSchema,
|
5419
5425
|
responses: {
|
5420
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5421
|
-
400:
|
5422
|
-
message:
|
5426
|
+
200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
|
5427
|
+
400: z78.object({
|
5428
|
+
message: z78.string()
|
5423
5429
|
}),
|
5424
|
-
409:
|
5425
|
-
message:
|
5430
|
+
409: z78.object({
|
5431
|
+
message: z78.string()
|
5426
5432
|
}),
|
5427
|
-
500:
|
5428
|
-
message:
|
5433
|
+
500: z78.object({
|
5434
|
+
message: z78.string()
|
5429
5435
|
}),
|
5430
5436
|
401: DefaultUnauthorizedSchema,
|
5431
5437
|
404: DefaultNotFoundSchema,
|
@@ -5436,19 +5442,19 @@ var ticketContract = initContract30().router(
|
|
5436
5442
|
updateType: {
|
5437
5443
|
method: "PATCH",
|
5438
5444
|
path: "/type/update/:id",
|
5439
|
-
pathParams:
|
5440
|
-
body:
|
5445
|
+
pathParams: z78.object({ id: z78.string() }),
|
5446
|
+
body: z78.object({ type: z78.string() }),
|
5441
5447
|
headers: DefaultHeaderSchema,
|
5442
5448
|
responses: {
|
5443
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5444
|
-
400:
|
5445
|
-
message:
|
5449
|
+
200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
|
5450
|
+
400: z78.object({
|
5451
|
+
message: z78.string()
|
5446
5452
|
}),
|
5447
|
-
409:
|
5448
|
-
message:
|
5453
|
+
409: z78.object({
|
5454
|
+
message: z78.string()
|
5449
5455
|
}),
|
5450
|
-
500:
|
5451
|
-
message:
|
5456
|
+
500: z78.object({
|
5457
|
+
message: z78.string()
|
5452
5458
|
}),
|
5453
5459
|
401: DefaultUnauthorizedSchema,
|
5454
5460
|
404: DefaultNotFoundSchema,
|
@@ -5459,19 +5465,19 @@ var ticketContract = initContract30().router(
|
|
5459
5465
|
updateStatus: {
|
5460
5466
|
method: "PATCH",
|
5461
5467
|
path: "/status/update/:id",
|
5462
|
-
pathParams:
|
5463
|
-
body:
|
5468
|
+
pathParams: z78.object({ id: z78.string() }),
|
5469
|
+
body: z78.object({ status: z78.string() }),
|
5464
5470
|
headers: DefaultHeaderSchema,
|
5465
5471
|
responses: {
|
5466
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5467
|
-
400:
|
5468
|
-
message:
|
5472
|
+
200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
|
5473
|
+
400: z78.object({
|
5474
|
+
message: z78.string()
|
5469
5475
|
}),
|
5470
|
-
409:
|
5471
|
-
message:
|
5476
|
+
409: z78.object({
|
5477
|
+
message: z78.string()
|
5472
5478
|
}),
|
5473
|
-
500:
|
5474
|
-
message:
|
5479
|
+
500: z78.object({
|
5480
|
+
message: z78.string()
|
5475
5481
|
}),
|
5476
5482
|
401: DefaultUnauthorizedSchema,
|
5477
5483
|
404: DefaultNotFoundSchema,
|
@@ -5482,19 +5488,19 @@ var ticketContract = initContract30().router(
|
|
5482
5488
|
updatePriority: {
|
5483
5489
|
method: "PATCH",
|
5484
5490
|
path: "/priority/update/:id",
|
5485
|
-
pathParams:
|
5486
|
-
body:
|
5491
|
+
pathParams: z78.object({ id: z78.string() }),
|
5492
|
+
body: z78.object({ priority: z78.string() }),
|
5487
5493
|
headers: DefaultHeaderSchema,
|
5488
5494
|
responses: {
|
5489
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5490
|
-
400:
|
5491
|
-
message:
|
5495
|
+
200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
|
5496
|
+
400: z78.object({
|
5497
|
+
message: z78.string()
|
5492
5498
|
}),
|
5493
|
-
409:
|
5494
|
-
message:
|
5499
|
+
409: z78.object({
|
5500
|
+
message: z78.string()
|
5495
5501
|
}),
|
5496
|
-
500:
|
5497
|
-
message:
|
5502
|
+
500: z78.object({
|
5503
|
+
message: z78.string()
|
5498
5504
|
}),
|
5499
5505
|
401: DefaultUnauthorizedSchema,
|
5500
5506
|
404: DefaultNotFoundSchema,
|
@@ -5505,19 +5511,19 @@ var ticketContract = initContract30().router(
|
|
5505
5511
|
updateChannel: {
|
5506
5512
|
method: "PATCH",
|
5507
5513
|
path: "/channel/update/:id",
|
5508
|
-
pathParams:
|
5509
|
-
body:
|
5514
|
+
pathParams: z78.object({ id: z78.string() }),
|
5515
|
+
body: z78.object({ channel: z78.string() }),
|
5510
5516
|
headers: DefaultHeaderSchema,
|
5511
5517
|
responses: {
|
5512
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5513
|
-
400:
|
5514
|
-
message:
|
5518
|
+
200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
|
5519
|
+
400: z78.object({
|
5520
|
+
message: z78.string()
|
5515
5521
|
}),
|
5516
|
-
409:
|
5517
|
-
message:
|
5522
|
+
409: z78.object({
|
5523
|
+
message: z78.string()
|
5518
5524
|
}),
|
5519
|
-
500:
|
5520
|
-
message:
|
5525
|
+
500: z78.object({
|
5526
|
+
message: z78.string()
|
5521
5527
|
}),
|
5522
5528
|
401: DefaultUnauthorizedSchema,
|
5523
5529
|
404: DefaultNotFoundSchema,
|
@@ -5528,19 +5534,19 @@ var ticketContract = initContract30().router(
|
|
5528
5534
|
updateTags: {
|
5529
5535
|
method: "PATCH",
|
5530
5536
|
path: "/tags/update/:id",
|
5531
|
-
pathParams:
|
5532
|
-
body:
|
5537
|
+
pathParams: z78.object({ id: z78.string() }),
|
5538
|
+
body: z78.object({ tags: z78.array(z78.string()) }),
|
5533
5539
|
headers: DefaultHeaderSchema,
|
5534
5540
|
responses: {
|
5535
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5536
|
-
400:
|
5537
|
-
message:
|
5541
|
+
200: DefaultSuccessResponseSchema.extend({ message: z78.string() }),
|
5542
|
+
400: z78.object({
|
5543
|
+
message: z78.string()
|
5538
5544
|
}),
|
5539
|
-
409:
|
5540
|
-
message:
|
5545
|
+
409: z78.object({
|
5546
|
+
message: z78.string()
|
5541
5547
|
}),
|
5542
|
-
500:
|
5543
|
-
message:
|
5548
|
+
500: z78.object({
|
5549
|
+
message: z78.string()
|
5544
5550
|
}),
|
5545
5551
|
401: DefaultUnauthorizedSchema,
|
5546
5552
|
404: DefaultNotFoundSchema,
|
@@ -5551,25 +5557,25 @@ var ticketContract = initContract30().router(
|
|
5551
5557
|
changeAssignee: {
|
5552
5558
|
method: "PATCH",
|
5553
5559
|
path: "/assignee/update/:id",
|
5554
|
-
pathParams:
|
5555
|
-
body:
|
5556
|
-
ticketId:
|
5557
|
-
assigneeId:
|
5558
|
-
reason:
|
5560
|
+
pathParams: z78.object({ id: z78.string() }),
|
5561
|
+
body: z78.object({
|
5562
|
+
ticketId: z78.string(),
|
5563
|
+
assigneeId: z78.string(),
|
5564
|
+
reason: z78.string().optional()
|
5559
5565
|
}),
|
5560
5566
|
headers: DefaultHeaderSchema,
|
5561
5567
|
responses: {
|
5562
5568
|
200: DefaultSuccessResponseSchema.extend({
|
5563
5569
|
data: TicketSchema
|
5564
5570
|
}),
|
5565
|
-
400:
|
5566
|
-
message:
|
5571
|
+
400: z78.object({
|
5572
|
+
message: z78.string()
|
5567
5573
|
}),
|
5568
|
-
409:
|
5569
|
-
message:
|
5574
|
+
409: z78.object({
|
5575
|
+
message: z78.string()
|
5570
5576
|
}),
|
5571
|
-
500:
|
5572
|
-
message:
|
5577
|
+
500: z78.object({
|
5578
|
+
message: z78.string()
|
5573
5579
|
}),
|
5574
5580
|
401: DefaultUnauthorizedSchema,
|
5575
5581
|
404: DefaultNotFoundSchema,
|
@@ -5580,14 +5586,14 @@ var ticketContract = initContract30().router(
|
|
5580
5586
|
getTicketCountByContact: {
|
5581
5587
|
method: "GET",
|
5582
5588
|
path: "/ticket_count/contact/:id",
|
5583
|
-
pathParams:
|
5589
|
+
pathParams: z78.object({ id: z78.string() }),
|
5584
5590
|
headers: DefaultHeaderSchema,
|
5585
5591
|
responses: {
|
5586
5592
|
200: DefaultSuccessResponseSchema.extend({
|
5587
5593
|
data: TicketCountByContactSchema
|
5588
5594
|
}),
|
5589
|
-
400:
|
5590
|
-
message:
|
5595
|
+
400: z78.object({
|
5596
|
+
message: z78.string()
|
5591
5597
|
}),
|
5592
5598
|
401: DefaultUnauthorizedSchema,
|
5593
5599
|
500: DefaultErrorResponseSchema
|
@@ -5603,14 +5609,14 @@ var ticketContract = initContract30().router(
|
|
5603
5609
|
201: DefaultSuccessResponseSchema.extend({
|
5604
5610
|
data: TicketCustomFieldSchema
|
5605
5611
|
}),
|
5606
|
-
400:
|
5607
|
-
message:
|
5612
|
+
400: z78.object({
|
5613
|
+
message: z78.string()
|
5608
5614
|
}),
|
5609
|
-
409:
|
5610
|
-
message:
|
5615
|
+
409: z78.object({
|
5616
|
+
message: z78.string()
|
5611
5617
|
}),
|
5612
|
-
500:
|
5613
|
-
message:
|
5618
|
+
500: z78.object({
|
5619
|
+
message: z78.string()
|
5614
5620
|
}),
|
5615
5621
|
401: DefaultUnauthorizedSchema,
|
5616
5622
|
404: DefaultNotFoundSchema,
|
@@ -5635,21 +5641,21 @@ var ticketContract = initContract30().router(
|
|
5635
5641
|
|
5636
5642
|
// src/user/index.ts
|
5637
5643
|
import { initContract as initContract31 } from "@ts-rest/core";
|
5638
|
-
import
|
5644
|
+
import z80 from "zod";
|
5639
5645
|
|
5640
5646
|
// src/user/validation.ts
|
5641
|
-
import { z as
|
5642
|
-
var CreateUserSchema =
|
5643
|
-
name:
|
5644
|
-
email:
|
5645
|
-
address:
|
5646
|
-
phone:
|
5647
|
-
password:
|
5648
|
-
notificationCount:
|
5649
|
-
roles:
|
5647
|
+
import { z as z79 } from "zod";
|
5648
|
+
var CreateUserSchema = z79.object({
|
5649
|
+
name: z79.string(),
|
5650
|
+
email: z79.string().email(),
|
5651
|
+
address: z79.string().nullable(),
|
5652
|
+
phone: z79.string().nullable(),
|
5653
|
+
password: z79.string(),
|
5654
|
+
notificationCount: z79.number().nullable().optional(),
|
5655
|
+
roles: z79.array(z79.string())
|
5650
5656
|
});
|
5651
5657
|
var UpdateUserSchema = CreateUserSchema.extend({
|
5652
|
-
newPassword:
|
5658
|
+
newPassword: z79.string()
|
5653
5659
|
});
|
5654
5660
|
|
5655
5661
|
// src/user/index.ts
|
@@ -5664,8 +5670,8 @@ var userContract = initContract31().router(
|
|
5664
5670
|
201: DefaultSuccessResponseSchema.extend({
|
5665
5671
|
user: UserSchema
|
5666
5672
|
}),
|
5667
|
-
400:
|
5668
|
-
message:
|
5673
|
+
400: z80.object({
|
5674
|
+
message: z80.string()
|
5669
5675
|
}),
|
5670
5676
|
401: DefaultUnauthorizedSchema
|
5671
5677
|
},
|
@@ -5675,16 +5681,16 @@ var userContract = initContract31().router(
|
|
5675
5681
|
method: "GET",
|
5676
5682
|
path: "",
|
5677
5683
|
headers: DefaultHeaderSchema,
|
5678
|
-
query:
|
5679
|
-
page:
|
5680
|
-
pageSize:
|
5684
|
+
query: z80.object({
|
5685
|
+
page: z80.coerce.number().optional(),
|
5686
|
+
pageSize: z80.coerce.number().optional(),
|
5681
5687
|
// Don't add default 10. In some places, we need to fetch all users.
|
5682
|
-
keyword:
|
5688
|
+
keyword: z80.string().optional()
|
5683
5689
|
}).optional(),
|
5684
5690
|
responses: {
|
5685
5691
|
200: WithPagination(UserSchema),
|
5686
|
-
400:
|
5687
|
-
message:
|
5692
|
+
400: z80.object({
|
5693
|
+
message: z80.string()
|
5688
5694
|
}),
|
5689
5695
|
401: DefaultUnauthorizedSchema,
|
5690
5696
|
500: DefaultErrorResponseSchema
|
@@ -5694,12 +5700,12 @@ var userContract = initContract31().router(
|
|
5694
5700
|
getUserById: {
|
5695
5701
|
method: "GET",
|
5696
5702
|
path: "/:id",
|
5697
|
-
pathParams:
|
5703
|
+
pathParams: z80.object({ id: z80.string() }),
|
5698
5704
|
headers: DefaultHeaderSchema,
|
5699
5705
|
responses: {
|
5700
5706
|
200: UserSchema,
|
5701
|
-
400:
|
5702
|
-
message:
|
5707
|
+
400: z80.object({
|
5708
|
+
message: z80.string()
|
5703
5709
|
}),
|
5704
5710
|
401: DefaultUnauthorizedSchema
|
5705
5711
|
},
|
@@ -5708,15 +5714,15 @@ var userContract = initContract31().router(
|
|
5708
5714
|
updateUser: {
|
5709
5715
|
method: "PATCH",
|
5710
5716
|
path: "/:id",
|
5711
|
-
pathParams:
|
5717
|
+
pathParams: z80.object({ id: z80.string() }),
|
5712
5718
|
headers: DefaultHeaderSchema,
|
5713
5719
|
body: UpdateUserSchema,
|
5714
5720
|
responses: {
|
5715
5721
|
201: DefaultSuccessResponseSchema.extend({
|
5716
5722
|
role: UserSchema
|
5717
5723
|
}),
|
5718
|
-
400:
|
5719
|
-
message:
|
5724
|
+
400: z80.object({
|
5725
|
+
message: z80.string()
|
5720
5726
|
}),
|
5721
5727
|
401: DefaultUnauthorizedSchema
|
5722
5728
|
},
|
@@ -5725,11 +5731,11 @@ var userContract = initContract31().router(
|
|
5725
5731
|
deleteUser: {
|
5726
5732
|
method: "DELETE",
|
5727
5733
|
path: "/:id",
|
5728
|
-
pathParams:
|
5734
|
+
pathParams: z80.object({ id: z80.string() }),
|
5729
5735
|
headers: DefaultHeaderSchema,
|
5730
5736
|
body: null,
|
5731
5737
|
responses: {
|
5732
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5738
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
5733
5739
|
500: DefaultErrorResponseSchema
|
5734
5740
|
},
|
5735
5741
|
summary: "Delete a user."
|
@@ -5740,26 +5746,26 @@ var userContract = initContract31().router(
|
|
5740
5746
|
|
5741
5747
|
// src/user-presence-status-log/index.ts
|
5742
5748
|
import { initContract as initContract32 } from "@ts-rest/core";
|
5743
|
-
import
|
5749
|
+
import z83 from "zod";
|
5744
5750
|
|
5745
5751
|
// src/user-presence-status-log/schema.ts
|
5746
|
-
import
|
5752
|
+
import z81 from "zod";
|
5747
5753
|
var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
|
5748
5754
|
user: UserSchema,
|
5749
5755
|
previousPresenceStatus: PresenceStatusSchema,
|
5750
5756
|
newPresenceStatus: PresenceStatusSchema,
|
5751
|
-
reason:
|
5757
|
+
reason: z81.string()
|
5752
5758
|
});
|
5753
5759
|
|
5754
5760
|
// src/user-presence-status-log/validation.ts
|
5755
|
-
import
|
5756
|
-
var UserPresenceStatusLogParamsSchema =
|
5757
|
-
page:
|
5758
|
-
pageSize:
|
5759
|
-
selectedDate:
|
5761
|
+
import z82 from "zod";
|
5762
|
+
var UserPresenceStatusLogParamsSchema = z82.object({
|
5763
|
+
page: z82.coerce.number().default(1),
|
5764
|
+
pageSize: z82.coerce.number().default(10),
|
5765
|
+
selectedDate: z82.string().optional()
|
5760
5766
|
}).optional();
|
5761
|
-
var UserPresenceStatusLogExportParamsSchema =
|
5762
|
-
selectedDate:
|
5767
|
+
var UserPresenceStatusLogExportParamsSchema = z82.object({
|
5768
|
+
selectedDate: z82.string().optional()
|
5763
5769
|
});
|
5764
5770
|
|
5765
5771
|
// src/user-presence-status-log/index.ts
|
@@ -5772,8 +5778,8 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
5772
5778
|
headers: DefaultHeaderSchema,
|
5773
5779
|
responses: {
|
5774
5780
|
200: WithPagination(UserPresenceStatusLogSchema),
|
5775
|
-
400:
|
5776
|
-
message:
|
5781
|
+
400: z83.object({
|
5782
|
+
message: z83.string()
|
5777
5783
|
}),
|
5778
5784
|
401: DefaultUnauthorizedSchema,
|
5779
5785
|
500: DefaultErrorResponseSchema
|
@@ -5787,8 +5793,8 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
5787
5793
|
headers: DefaultHeaderSchema,
|
5788
5794
|
responses: {
|
5789
5795
|
200: null,
|
5790
|
-
400:
|
5791
|
-
message:
|
5796
|
+
400: z83.object({
|
5797
|
+
message: z83.string()
|
5792
5798
|
}),
|
5793
5799
|
401: DefaultUnauthorizedSchema,
|
5794
5800
|
500: DefaultErrorResponseSchema
|
@@ -5800,44 +5806,44 @@ var userPresenceStatusLogContract = initContract32().router(
|
|
5800
5806
|
|
5801
5807
|
// src/widget/index.ts
|
5802
5808
|
import { initContract as initContract33 } from "@ts-rest/core";
|
5803
|
-
import
|
5809
|
+
import z86 from "zod";
|
5804
5810
|
|
5805
5811
|
// src/widget/schema.ts
|
5806
|
-
import
|
5807
|
-
var FieldsSchema =
|
5808
|
-
var WidgetPositionSchema =
|
5809
|
-
|
5810
|
-
|
5811
|
-
|
5812
|
+
import z84 from "zod";
|
5813
|
+
var FieldsSchema = z84.object({ data: z84.array(z84.string()) });
|
5814
|
+
var WidgetPositionSchema = z84.union([
|
5815
|
+
z84.literal("menu"),
|
5816
|
+
z84.literal("ticket_detail"),
|
5817
|
+
z84.literal("contact_detail")
|
5812
5818
|
]);
|
5813
5819
|
var WidgetSchema = DefaultEntitySchema.extend({
|
5814
|
-
name:
|
5815
|
-
description:
|
5820
|
+
name: z84.string(),
|
5821
|
+
description: z84.string().nullable(),
|
5816
5822
|
position: WidgetPositionSchema.nullable(),
|
5817
5823
|
fields: FieldsSchema,
|
5818
|
-
url:
|
5824
|
+
url: z84.string()
|
5819
5825
|
});
|
5820
5826
|
|
5821
5827
|
// src/widget/validation.ts
|
5822
|
-
import
|
5823
|
-
var CreateWidgetSchema =
|
5824
|
-
name:
|
5825
|
-
description:
|
5826
|
-
url:
|
5828
|
+
import z85 from "zod";
|
5829
|
+
var CreateWidgetSchema = z85.object({
|
5830
|
+
name: z85.string(),
|
5831
|
+
description: z85.string(),
|
5832
|
+
url: z85.string(),
|
5827
5833
|
position: WidgetPositionSchema,
|
5828
|
-
fields:
|
5834
|
+
fields: z85.object({
|
5829
5835
|
data: (
|
5830
5836
|
// Array of attribute system names
|
5831
|
-
|
5837
|
+
z85.array(z85.string())
|
5832
5838
|
)
|
5833
5839
|
}).optional()
|
5834
5840
|
});
|
5835
5841
|
var UpdateWidgetSchema = CreateWidgetSchema;
|
5836
|
-
var GetWidgetUrlPathQuerySchema =
|
5837
|
-
widgetId:
|
5842
|
+
var GetWidgetUrlPathQuerySchema = z85.object({
|
5843
|
+
widgetId: z85.string(),
|
5838
5844
|
// Position ID is ticket ID, contact ID, etc.
|
5839
5845
|
// TODO: The name "Position ID" is confusing. Think of a better name.
|
5840
|
-
positionId:
|
5846
|
+
positionId: z85.string()
|
5841
5847
|
});
|
5842
5848
|
|
5843
5849
|
// src/widget/index.ts
|
@@ -5852,8 +5858,8 @@ var widgetContract = initContract33().router(
|
|
5852
5858
|
201: DefaultSuccessResponseSchema.extend({
|
5853
5859
|
widget: WidgetSchema
|
5854
5860
|
}),
|
5855
|
-
400:
|
5856
|
-
message:
|
5861
|
+
400: z86.object({
|
5862
|
+
message: z86.string()
|
5857
5863
|
}),
|
5858
5864
|
401: DefaultUnauthorizedSchema,
|
5859
5865
|
500: DefaultErrorResponseSchema
|
@@ -5863,17 +5869,17 @@ var widgetContract = initContract33().router(
|
|
5863
5869
|
getWidgets: {
|
5864
5870
|
method: "GET",
|
5865
5871
|
path: "",
|
5866
|
-
query:
|
5867
|
-
page:
|
5868
|
-
pageSize:
|
5869
|
-
keyword:
|
5872
|
+
query: z86.object({
|
5873
|
+
page: z86.coerce.number().default(1),
|
5874
|
+
pageSize: z86.coerce.number().default(10),
|
5875
|
+
keyword: z86.coerce.string().optional()
|
5870
5876
|
}).optional(),
|
5871
5877
|
headers: DefaultHeaderSchema,
|
5872
5878
|
responses: {
|
5873
5879
|
200: WithPagination(WidgetSchema),
|
5874
5880
|
500: DefaultErrorResponseSchema,
|
5875
|
-
400:
|
5876
|
-
message:
|
5881
|
+
400: z86.object({
|
5882
|
+
message: z86.string()
|
5877
5883
|
}),
|
5878
5884
|
401: DefaultUnauthorizedSchema
|
5879
5885
|
},
|
@@ -5884,9 +5890,9 @@ var widgetContract = initContract33().router(
|
|
5884
5890
|
path: "/menu",
|
5885
5891
|
headers: DefaultHeaderSchema,
|
5886
5892
|
responses: {
|
5887
|
-
200:
|
5888
|
-
400:
|
5889
|
-
message:
|
5893
|
+
200: z86.array(WidgetSchema),
|
5894
|
+
400: z86.object({
|
5895
|
+
message: z86.string()
|
5890
5896
|
}),
|
5891
5897
|
401: DefaultUnauthorizedSchema,
|
5892
5898
|
500: DefaultErrorResponseSchema
|
@@ -5898,9 +5904,9 @@ var widgetContract = initContract33().router(
|
|
5898
5904
|
path: "/ticket_detail",
|
5899
5905
|
headers: DefaultHeaderSchema,
|
5900
5906
|
responses: {
|
5901
|
-
200:
|
5902
|
-
400:
|
5903
|
-
message:
|
5907
|
+
200: z86.array(WidgetSchema),
|
5908
|
+
400: z86.object({
|
5909
|
+
message: z86.string()
|
5904
5910
|
}),
|
5905
5911
|
401: DefaultUnauthorizedSchema,
|
5906
5912
|
500: DefaultErrorResponseSchema
|
@@ -5912,9 +5918,9 @@ var widgetContract = initContract33().router(
|
|
5912
5918
|
path: "/contact_detail",
|
5913
5919
|
headers: DefaultHeaderSchema,
|
5914
5920
|
responses: {
|
5915
|
-
200:
|
5916
|
-
400:
|
5917
|
-
message:
|
5921
|
+
200: z86.array(WidgetSchema),
|
5922
|
+
400: z86.object({
|
5923
|
+
message: z86.string()
|
5918
5924
|
}),
|
5919
5925
|
401: DefaultUnauthorizedSchema,
|
5920
5926
|
500: DefaultErrorResponseSchema
|
@@ -5924,12 +5930,12 @@ var widgetContract = initContract33().router(
|
|
5924
5930
|
getWidgetById: {
|
5925
5931
|
method: "GET",
|
5926
5932
|
path: "/:id",
|
5927
|
-
pathParams:
|
5933
|
+
pathParams: z86.object({ id: z86.string() }),
|
5928
5934
|
headers: DefaultHeaderSchema,
|
5929
5935
|
responses: {
|
5930
5936
|
200: WidgetSchema,
|
5931
|
-
400:
|
5932
|
-
message:
|
5937
|
+
400: z86.object({
|
5938
|
+
message: z86.string()
|
5933
5939
|
}),
|
5934
5940
|
401: DefaultUnauthorizedSchema,
|
5935
5941
|
500: DefaultErrorResponseSchema
|
@@ -5943,10 +5949,10 @@ var widgetContract = initContract33().router(
|
|
5943
5949
|
headers: DefaultHeaderSchema,
|
5944
5950
|
responses: {
|
5945
5951
|
201: DefaultSuccessResponseSchema.extend({
|
5946
|
-
url:
|
5952
|
+
url: z86.string()
|
5947
5953
|
}),
|
5948
|
-
400:
|
5949
|
-
message:
|
5954
|
+
400: z86.object({
|
5955
|
+
message: z86.string()
|
5950
5956
|
}),
|
5951
5957
|
401: DefaultUnauthorizedSchema
|
5952
5958
|
},
|
@@ -5955,14 +5961,14 @@ var widgetContract = initContract33().router(
|
|
5955
5961
|
updateWidget: {
|
5956
5962
|
method: "PATCH",
|
5957
5963
|
path: "/:id",
|
5958
|
-
pathParams:
|
5964
|
+
pathParams: z86.object({ id: z86.string() }),
|
5959
5965
|
headers: DefaultHeaderSchema,
|
5960
5966
|
responses: {
|
5961
5967
|
201: DefaultSuccessResponseSchema.extend({
|
5962
5968
|
widget: WidgetSchema
|
5963
5969
|
}),
|
5964
|
-
400:
|
5965
|
-
message:
|
5970
|
+
400: z86.object({
|
5971
|
+
message: z86.string()
|
5966
5972
|
}),
|
5967
5973
|
401: DefaultUnauthorizedSchema
|
5968
5974
|
},
|
@@ -5972,11 +5978,11 @@ var widgetContract = initContract33().router(
|
|
5972
5978
|
deleteWidget: {
|
5973
5979
|
method: "DELETE",
|
5974
5980
|
path: "/:id",
|
5975
|
-
pathParams:
|
5981
|
+
pathParams: z86.object({ id: z86.string() }),
|
5976
5982
|
headers: DefaultHeaderSchema,
|
5977
5983
|
body: null,
|
5978
5984
|
responses: {
|
5979
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
5985
|
+
200: DefaultSuccessResponseSchema.extend({ message: z86.string() }),
|
5980
5986
|
500: DefaultErrorResponseSchema
|
5981
5987
|
},
|
5982
5988
|
summary: "Delete a widget."
|
@@ -5987,24 +5993,24 @@ var widgetContract = initContract33().router(
|
|
5987
5993
|
|
5988
5994
|
// src/wrap-up-form/index.ts
|
5989
5995
|
import { initContract as initContract34 } from "@ts-rest/core";
|
5990
|
-
import
|
5996
|
+
import z88 from "zod";
|
5991
5997
|
|
5992
5998
|
// src/wrap-up-form/validation.ts
|
5993
|
-
import { z as
|
5994
|
-
var CreateWrapUpFormSchema =
|
5995
|
-
note:
|
5996
|
-
disposition:
|
5997
|
-
callFrom:
|
5998
|
-
callTo:
|
5999
|
+
import { z as z87 } from "zod";
|
6000
|
+
var CreateWrapUpFormSchema = z87.object({
|
6001
|
+
note: z87.string().nullable().optional(),
|
6002
|
+
disposition: z87.string().nullable().optional(),
|
6003
|
+
callFrom: z87.string().nullable().optional(),
|
6004
|
+
callTo: z87.string().nullable().optional()
|
5999
6005
|
});
|
6000
6006
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
6001
|
-
tags:
|
6007
|
+
tags: z87.array(z87.string()).optional()
|
6002
6008
|
});
|
6003
|
-
var CreateCXLogWrapUpFormSchema =
|
6004
|
-
cxLogId:
|
6005
|
-
disposition:
|
6006
|
-
tagIds:
|
6007
|
-
note:
|
6009
|
+
var CreateCXLogWrapUpFormSchema = z87.object({
|
6010
|
+
cxLogId: z87.string().uuid(),
|
6011
|
+
disposition: z87.string().optional(),
|
6012
|
+
tagIds: z87.array(z87.string().uuid()).optional(),
|
6013
|
+
note: z87.string().optional()
|
6008
6014
|
});
|
6009
6015
|
|
6010
6016
|
// src/wrap-up-form/index.ts
|
@@ -6019,8 +6025,8 @@ var wrapUpFormContract = initContract34().router(
|
|
6019
6025
|
201: DefaultSuccessResponseSchema.extend({
|
6020
6026
|
wrapUpForm: WrapUpFormSchema
|
6021
6027
|
}),
|
6022
|
-
400:
|
6023
|
-
message:
|
6028
|
+
400: z88.object({
|
6029
|
+
message: z88.string()
|
6024
6030
|
}),
|
6025
6031
|
401: DefaultUnauthorizedSchema,
|
6026
6032
|
500: DefaultErrorResponseSchema
|
@@ -6042,15 +6048,15 @@ var wrapUpFormContract = initContract34().router(
|
|
6042
6048
|
getWrapUpForms: {
|
6043
6049
|
method: "GET",
|
6044
6050
|
path: "",
|
6045
|
-
query:
|
6046
|
-
page:
|
6047
|
-
pageSize:
|
6051
|
+
query: z88.object({
|
6052
|
+
page: z88.coerce.number().default(1),
|
6053
|
+
pageSize: z88.coerce.number().default(10)
|
6048
6054
|
}).optional(),
|
6049
6055
|
headers: DefaultHeaderSchema,
|
6050
6056
|
responses: {
|
6051
6057
|
200: WithPagination(WrapUpFormSchema),
|
6052
|
-
400:
|
6053
|
-
message:
|
6058
|
+
400: z88.object({
|
6059
|
+
message: z88.string()
|
6054
6060
|
}),
|
6055
6061
|
401: DefaultUnauthorizedSchema,
|
6056
6062
|
500: DefaultErrorResponseSchema
|
@@ -6060,15 +6066,15 @@ var wrapUpFormContract = initContract34().router(
|
|
6060
6066
|
updateWrapUpForm: {
|
6061
6067
|
method: "PATCH",
|
6062
6068
|
path: "/:id",
|
6063
|
-
pathParams:
|
6069
|
+
pathParams: z88.object({ id: z88.string() }),
|
6064
6070
|
headers: DefaultHeaderSchema,
|
6065
6071
|
body: UpdateWrapUpFormSchema,
|
6066
6072
|
responses: {
|
6067
6073
|
201: DefaultSuccessResponseSchema.extend({
|
6068
6074
|
wrapUpForm: WrapUpFormSchema
|
6069
6075
|
}),
|
6070
|
-
400:
|
6071
|
-
message:
|
6076
|
+
400: z88.object({
|
6077
|
+
message: z88.string()
|
6072
6078
|
}),
|
6073
6079
|
401: DefaultUnauthorizedSchema,
|
6074
6080
|
500: DefaultErrorResponseSchema
|
@@ -6081,28 +6087,28 @@ var wrapUpFormContract = initContract34().router(
|
|
6081
6087
|
|
6082
6088
|
// src/upload/index.ts
|
6083
6089
|
import { initContract as initContract35 } from "@ts-rest/core";
|
6084
|
-
import
|
6090
|
+
import z89 from "zod";
|
6085
6091
|
var uploadContract = initContract35().router(
|
6086
6092
|
{
|
6087
6093
|
rename: {
|
6088
6094
|
method: "POST",
|
6089
6095
|
path: "/:id/rename",
|
6090
|
-
pathParams:
|
6091
|
-
id:
|
6096
|
+
pathParams: z89.object({
|
6097
|
+
id: z89.string()
|
6092
6098
|
}),
|
6093
6099
|
headers: DefaultHeaderSchema,
|
6094
6100
|
responses: {
|
6095
6101
|
201: DefaultSuccessResponseSchema.extend({
|
6096
|
-
message:
|
6102
|
+
message: z89.string()
|
6097
6103
|
}),
|
6098
|
-
400:
|
6099
|
-
message:
|
6104
|
+
400: z89.object({
|
6105
|
+
message: z89.string()
|
6100
6106
|
}),
|
6101
|
-
409:
|
6102
|
-
message:
|
6107
|
+
409: z89.object({
|
6108
|
+
message: z89.string()
|
6103
6109
|
}),
|
6104
|
-
500:
|
6105
|
-
message:
|
6110
|
+
500: z89.object({
|
6111
|
+
message: z89.string()
|
6106
6112
|
}),
|
6107
6113
|
401: DefaultUnauthorizedSchema,
|
6108
6114
|
404: DefaultNotFoundSchema,
|
@@ -6114,23 +6120,23 @@ var uploadContract = initContract35().router(
|
|
6114
6120
|
delete: {
|
6115
6121
|
method: "DELETE",
|
6116
6122
|
path: "/:id",
|
6117
|
-
pathParams:
|
6118
|
-
id:
|
6123
|
+
pathParams: z89.object({
|
6124
|
+
id: z89.string()
|
6119
6125
|
}),
|
6120
6126
|
headers: DefaultHeaderSchema,
|
6121
6127
|
body: null,
|
6122
6128
|
responses: {
|
6123
6129
|
201: DefaultSuccessResponseSchema.extend({
|
6124
|
-
message:
|
6130
|
+
message: z89.string()
|
6125
6131
|
}),
|
6126
|
-
400:
|
6127
|
-
message:
|
6132
|
+
400: z89.object({
|
6133
|
+
message: z89.string()
|
6128
6134
|
}),
|
6129
|
-
409:
|
6130
|
-
message:
|
6135
|
+
409: z89.object({
|
6136
|
+
message: z89.string()
|
6131
6137
|
}),
|
6132
|
-
500:
|
6133
|
-
message:
|
6138
|
+
500: z89.object({
|
6139
|
+
message: z89.string()
|
6134
6140
|
}),
|
6135
6141
|
401: DefaultUnauthorizedSchema,
|
6136
6142
|
404: DefaultNotFoundSchema,
|
@@ -6145,19 +6151,19 @@ var uploadContract = initContract35().router(
|
|
6145
6151
|
);
|
6146
6152
|
|
6147
6153
|
// src/viber/index.ts
|
6148
|
-
import
|
6154
|
+
import z91 from "zod";
|
6149
6155
|
|
6150
6156
|
// src/viber/validation.ts
|
6151
|
-
import
|
6152
|
-
var ViberChannelSchema =
|
6153
|
-
name:
|
6154
|
-
accessToken:
|
6155
|
-
actor:
|
6156
|
-
id:
|
6157
|
-
name:
|
6158
|
-
email:
|
6159
|
-
address:
|
6160
|
-
phone:
|
6157
|
+
import z90 from "zod";
|
6158
|
+
var ViberChannelSchema = z90.object({
|
6159
|
+
name: z90.string(),
|
6160
|
+
accessToken: z90.string(),
|
6161
|
+
actor: z90.object({
|
6162
|
+
id: z90.string().uuid(),
|
6163
|
+
name: z90.string(),
|
6164
|
+
email: z90.string().email(),
|
6165
|
+
address: z90.string().nullable(),
|
6166
|
+
phone: z90.string().nullable()
|
6161
6167
|
}).optional()
|
6162
6168
|
});
|
6163
6169
|
|
@@ -6185,8 +6191,8 @@ var viberContract = initContract36().router({
|
|
6185
6191
|
}),
|
6186
6192
|
400: DefaultErrorResponseSchema
|
6187
6193
|
},
|
6188
|
-
body:
|
6189
|
-
id:
|
6194
|
+
body: z91.object({
|
6195
|
+
id: z91.string().uuid()
|
6190
6196
|
}),
|
6191
6197
|
summary: "Connect message channel"
|
6192
6198
|
},
|