@kl1/contracts 1.4.72 → 1.4.75
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/api-contracts/src/contract.d.ts +3 -3
- package/dist/api-contracts/src/general-setting/index.d.ts +244 -0
- package/dist/api-contracts/src/general-setting/index.d.ts.map +1 -1
- package/dist/api-contracts/src/general-setting/schema.d.ts +30 -0
- package/dist/api-contracts/src/general-setting/schema.d.ts.map +1 -0
- package/dist/api-contracts/src/general-setting/validation.d.ts +30 -0
- package/dist/api-contracts/src/general-setting/validation.d.ts.map +1 -0
- package/dist/api-contracts/src/public-api/index.d.ts +3 -3
- package/dist/api-contracts/src/public-api/validation.d.ts +3 -3
- package/dist/index.js +653 -586
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +652 -585
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -8588,7 +8588,7 @@ var ContactContractValidationSchema2 = {
|
|
8588
8588
|
var SendMessageSchema2 = z109.object({
|
8589
8589
|
channelId: z109.string(),
|
8590
8590
|
message: z109.string(),
|
8591
|
-
contactId: z109.string().optional(),
|
8591
|
+
contactId: z109.union([z109.string(), z109.array(z109.string())]).optional(),
|
8592
8592
|
platformUserId: z109.string().optional()
|
8593
8593
|
});
|
8594
8594
|
var GetCxLogsSchema = z109.object({
|
@@ -9670,7 +9670,35 @@ var platformKlinkChatContract = initContract45().router({
|
|
9670
9670
|
|
9671
9671
|
// src/general-setting/index.ts
|
9672
9672
|
import { initContract as initContract46 } from "@ts-rest/core";
|
9673
|
-
import
|
9673
|
+
import z121 from "zod";
|
9674
|
+
|
9675
|
+
// src/general-setting/validation.ts
|
9676
|
+
import { z as z119 } from "zod";
|
9677
|
+
var CreateUpdateAiTranslateRequestSetting = z119.object({
|
9678
|
+
languageList: z119.array(
|
9679
|
+
z119.object({
|
9680
|
+
languageName: z119.string(),
|
9681
|
+
languageCode: z119.string()
|
9682
|
+
})
|
9683
|
+
).nullable(),
|
9684
|
+
aiTranslationInstructions: z119.string().nullable(),
|
9685
|
+
displayAiTranslationNotice: z119.string().nullable()
|
9686
|
+
});
|
9687
|
+
|
9688
|
+
// src/general-setting/schema.ts
|
9689
|
+
import z120 from "zod";
|
9690
|
+
var AiTranslateSettingSchema = z120.object({
|
9691
|
+
languageList: z120.array(
|
9692
|
+
z120.object({
|
9693
|
+
languageName: z120.string(),
|
9694
|
+
languageCode: z120.string()
|
9695
|
+
})
|
9696
|
+
).nullable(),
|
9697
|
+
aiTranslationInstructions: z120.string().nullable(),
|
9698
|
+
displayAiTranslationNotice: z120.string().nullable()
|
9699
|
+
});
|
9700
|
+
|
9701
|
+
// src/general-setting/index.ts
|
9674
9702
|
var generalSettingContract = initContract46().router(
|
9675
9703
|
{
|
9676
9704
|
autoOpenedContactWidgetId: {
|
@@ -9678,23 +9706,62 @@ var generalSettingContract = initContract46().router(
|
|
9678
9706
|
method: "GET",
|
9679
9707
|
path: "/auto-opened-contact-widget-id",
|
9680
9708
|
responses: {
|
9681
|
-
200:
|
9682
|
-
autoOpenedContactWidgetId:
|
9709
|
+
200: z121.object({
|
9710
|
+
autoOpenedContactWidgetId: z121.string().nullable()
|
9683
9711
|
})
|
9684
9712
|
}
|
9685
9713
|
},
|
9686
9714
|
updateAutoOpenedContactWidgetId: {
|
9687
9715
|
method: "PATCH",
|
9688
9716
|
path: "/auto-opened-contact-widget-id",
|
9689
|
-
body:
|
9690
|
-
autoOpenedContactWidgetId:
|
9717
|
+
body: z121.object({
|
9718
|
+
autoOpenedContactWidgetId: z121.string().nullable()
|
9691
9719
|
}),
|
9692
9720
|
responses: {
|
9693
|
-
200:
|
9694
|
-
autoOpenedContactWidgetId:
|
9721
|
+
200: z121.object({
|
9722
|
+
autoOpenedContactWidgetId: z121.string().nullable()
|
9695
9723
|
})
|
9696
9724
|
}
|
9697
9725
|
}
|
9726
|
+
},
|
9727
|
+
aiTranslateSetting: {
|
9728
|
+
getAiTranslateSetting: {
|
9729
|
+
method: "GET",
|
9730
|
+
path: "/ai-translate-setting",
|
9731
|
+
responses: {
|
9732
|
+
200: z121.object({
|
9733
|
+
requestId: z121.string().uuid(),
|
9734
|
+
aiTranslateSetting: AiTranslateSettingSchema
|
9735
|
+
}),
|
9736
|
+
400: z121.object({
|
9737
|
+
message: z121.string()
|
9738
|
+
}),
|
9739
|
+
401: DefaultUnauthorizedSchema,
|
9740
|
+
404: DefaultNotFoundSchema,
|
9741
|
+
422: DefaultUnprocessibleSchema,
|
9742
|
+
500: DefaultErrorResponseSchema
|
9743
|
+
},
|
9744
|
+
summary: "Get ai translate setting"
|
9745
|
+
},
|
9746
|
+
updateAiTranslateSetting: {
|
9747
|
+
method: "PATCH",
|
9748
|
+
path: "/ai-translate-setting",
|
9749
|
+
body: CreateUpdateAiTranslateRequestSetting,
|
9750
|
+
responses: {
|
9751
|
+
200: z121.object({
|
9752
|
+
requestId: z121.string().uuid(),
|
9753
|
+
aiTranslateSetting: AiTranslateSettingSchema
|
9754
|
+
}),
|
9755
|
+
400: z121.object({
|
9756
|
+
message: z121.string()
|
9757
|
+
}),
|
9758
|
+
401: DefaultUnauthorizedSchema,
|
9759
|
+
404: DefaultNotFoundSchema,
|
9760
|
+
422: DefaultUnprocessibleSchema,
|
9761
|
+
500: DefaultErrorResponseSchema
|
9762
|
+
},
|
9763
|
+
summary: "Update ai translate setting"
|
9764
|
+
}
|
9698
9765
|
}
|
9699
9766
|
},
|
9700
9767
|
{
|
@@ -9704,51 +9771,51 @@ var generalSettingContract = initContract46().router(
|
|
9704
9771
|
|
9705
9772
|
// src/automation-queue/index.ts
|
9706
9773
|
import { initContract as initContract47 } from "@ts-rest/core";
|
9707
|
-
import { z as
|
9774
|
+
import { z as z124 } from "zod";
|
9708
9775
|
|
9709
9776
|
// src/automation-queue/validation.ts
|
9710
|
-
import { z as
|
9711
|
-
var QueueDistributionStrategySchema =
|
9712
|
-
|
9713
|
-
|
9714
|
-
|
9715
|
-
|
9777
|
+
import { z as z122 } from "zod";
|
9778
|
+
var QueueDistributionStrategySchema = z122.union([
|
9779
|
+
z122.literal("round-robin"),
|
9780
|
+
z122.literal("fewest-assignments"),
|
9781
|
+
z122.literal("random"),
|
9782
|
+
z122.literal("notify-all")
|
9716
9783
|
]);
|
9717
|
-
var CreateAutomationQueueSchema =
|
9718
|
-
emoji:
|
9719
|
-
name:
|
9720
|
-
description:
|
9721
|
-
managerIds:
|
9722
|
-
agentIds:
|
9784
|
+
var CreateAutomationQueueSchema = z122.object({
|
9785
|
+
emoji: z122.string().emoji(),
|
9786
|
+
name: z122.string(),
|
9787
|
+
description: z122.string().nullable(),
|
9788
|
+
managerIds: z122.array(z122.string().uuid()).min(1),
|
9789
|
+
agentIds: z122.array(z122.string().uuid()).min(1),
|
9723
9790
|
distributionStrategy: QueueDistributionStrategySchema.nullable(),
|
9724
|
-
maximumAssignPerAgent:
|
9725
|
-
autoAssign:
|
9791
|
+
maximumAssignPerAgent: z122.number().positive().nullable(),
|
9792
|
+
autoAssign: z122.boolean().nullable()
|
9726
9793
|
// ringTimeOut: z.number().positive(),
|
9727
9794
|
// retryInterval: z.number().positive(),
|
9728
9795
|
// queueTimeOut: z.number().positive(),
|
9729
9796
|
// isAssignmentDeniable: z.coerce.boolean(),
|
9730
9797
|
});
|
9731
9798
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
9732
|
-
var CheckHasAssignedRoomSchema =
|
9733
|
-
userId:
|
9734
|
-
queueId:
|
9799
|
+
var CheckHasAssignedRoomSchema = z122.object({
|
9800
|
+
userId: z122.string().uuid().optional(),
|
9801
|
+
queueId: z122.string().uuid().optional()
|
9735
9802
|
});
|
9736
9803
|
|
9737
9804
|
// src/automation-queue/schema.ts
|
9738
|
-
import { z as
|
9805
|
+
import { z as z123 } from "zod";
|
9739
9806
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
9740
|
-
emoji:
|
9741
|
-
name:
|
9742
|
-
description:
|
9807
|
+
emoji: z123.string(),
|
9808
|
+
name: z123.string(),
|
9809
|
+
description: z123.string().nullable(),
|
9743
9810
|
distributionStrategy: QueueDistributionStrategySchema,
|
9744
|
-
maximumAssignPerAgent:
|
9811
|
+
maximumAssignPerAgent: z123.number().positive(),
|
9745
9812
|
// ringTimeOut: z.number(),
|
9746
9813
|
// retryInterval: z.number(),
|
9747
9814
|
// queueTimeOut: z.number(),
|
9748
9815
|
// isAssignmentDeniable: z.boolean(),
|
9749
|
-
autoAssign:
|
9750
|
-
managers:
|
9751
|
-
agents:
|
9816
|
+
autoAssign: z123.boolean(),
|
9817
|
+
managers: z123.array(UserSchema),
|
9818
|
+
agents: z123.array(UserSchema)
|
9752
9819
|
});
|
9753
9820
|
|
9754
9821
|
// src/automation-queue/index.ts
|
@@ -9767,8 +9834,8 @@ var automationQueueContract = initContract47().router(
|
|
9767
9834
|
duplicateAutomationQueue: {
|
9768
9835
|
method: "POST",
|
9769
9836
|
path: "/:id/duplicate",
|
9770
|
-
pathParams:
|
9771
|
-
id:
|
9837
|
+
pathParams: z124.object({
|
9838
|
+
id: z124.string().uuid()
|
9772
9839
|
}),
|
9773
9840
|
body: null,
|
9774
9841
|
responses: {
|
@@ -9780,21 +9847,21 @@ var automationQueueContract = initContract47().router(
|
|
9780
9847
|
getAutomationQueues: {
|
9781
9848
|
method: "GET",
|
9782
9849
|
path: "",
|
9783
|
-
query:
|
9784
|
-
userId:
|
9785
|
-
withRelations:
|
9850
|
+
query: z124.object({
|
9851
|
+
userId: z124.string().uuid().optional(),
|
9852
|
+
withRelations: z124.coerce.boolean().default(true).optional()
|
9786
9853
|
}).optional(),
|
9787
9854
|
responses: {
|
9788
9855
|
200: DefaultSuccessResponseSchema.extend({
|
9789
|
-
data:
|
9856
|
+
data: z124.array(AutomationQueueSchema)
|
9790
9857
|
})
|
9791
9858
|
}
|
9792
9859
|
},
|
9793
9860
|
getAutomationQueueById: {
|
9794
9861
|
method: "GET",
|
9795
9862
|
path: "/:id",
|
9796
|
-
pathParams:
|
9797
|
-
id:
|
9863
|
+
pathParams: z124.object({
|
9864
|
+
id: z124.string().uuid()
|
9798
9865
|
}),
|
9799
9866
|
responses: {
|
9800
9867
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9805,8 +9872,8 @@ var automationQueueContract = initContract47().router(
|
|
9805
9872
|
updateAutomationQueue: {
|
9806
9873
|
method: "PATCH",
|
9807
9874
|
path: "/:id",
|
9808
|
-
pathParams:
|
9809
|
-
id:
|
9875
|
+
pathParams: z124.object({
|
9876
|
+
id: z124.string().uuid()
|
9810
9877
|
}),
|
9811
9878
|
body: UpdateAutomationQueueSchema,
|
9812
9879
|
responses: {
|
@@ -9818,13 +9885,13 @@ var automationQueueContract = initContract47().router(
|
|
9818
9885
|
deleteAutomationQueue: {
|
9819
9886
|
method: "DELETE",
|
9820
9887
|
path: "/:id",
|
9821
|
-
pathParams:
|
9822
|
-
id:
|
9888
|
+
pathParams: z124.object({
|
9889
|
+
id: z124.string().uuid()
|
9823
9890
|
}),
|
9824
9891
|
body: null,
|
9825
9892
|
responses: {
|
9826
9893
|
200: DefaultSuccessResponseSchema.extend({
|
9827
|
-
message:
|
9894
|
+
message: z124.string()
|
9828
9895
|
})
|
9829
9896
|
}
|
9830
9897
|
},
|
@@ -9834,8 +9901,8 @@ var automationQueueContract = initContract47().router(
|
|
9834
9901
|
body: CheckHasAssignedRoomSchema,
|
9835
9902
|
responses: {
|
9836
9903
|
200: DefaultSuccessResponseSchema.extend({
|
9837
|
-
data:
|
9838
|
-
hasAssignedRoom:
|
9904
|
+
data: z124.object({
|
9905
|
+
hasAssignedRoom: z124.boolean()
|
9839
9906
|
})
|
9840
9907
|
})
|
9841
9908
|
}
|
@@ -9852,276 +9919,276 @@ import { initContract as initContract52 } from "@ts-rest/core";
|
|
9852
9919
|
|
9853
9920
|
// src/mail/room-contract.ts
|
9854
9921
|
import { initContract as initContract48 } from "@ts-rest/core";
|
9855
|
-
import
|
9922
|
+
import z129 from "zod";
|
9856
9923
|
|
9857
9924
|
// src/mail/schemas/room.schema.ts
|
9858
|
-
import
|
9925
|
+
import z127 from "zod";
|
9859
9926
|
|
9860
9927
|
// src/mail/schemas/account.schema.ts
|
9861
|
-
import
|
9862
|
-
var MailServerSchema =
|
9863
|
-
id:
|
9864
|
-
createdAt:
|
9865
|
-
updatedAt:
|
9866
|
-
deletedAt:
|
9867
|
-
name:
|
9868
|
-
smtpHost:
|
9869
|
-
smtpPort:
|
9870
|
-
smtpTlsPort:
|
9871
|
-
useTlsForSmtp:
|
9872
|
-
imapHost:
|
9873
|
-
imapPort:
|
9874
|
-
imapTlsPort:
|
9875
|
-
useTlsForImap:
|
9876
|
-
});
|
9877
|
-
var MailAccountSchema =
|
9878
|
-
id:
|
9879
|
-
name:
|
9880
|
-
address:
|
9881
|
-
signature:
|
9882
|
-
accountId:
|
9883
|
-
mailServerId:
|
9928
|
+
import z125 from "zod";
|
9929
|
+
var MailServerSchema = z125.object({
|
9930
|
+
id: z125.string(),
|
9931
|
+
createdAt: z125.date(),
|
9932
|
+
updatedAt: z125.date(),
|
9933
|
+
deletedAt: z125.date().nullable(),
|
9934
|
+
name: z125.string(),
|
9935
|
+
smtpHost: z125.string(),
|
9936
|
+
smtpPort: z125.number(),
|
9937
|
+
smtpTlsPort: z125.number(),
|
9938
|
+
useTlsForSmtp: z125.boolean(),
|
9939
|
+
imapHost: z125.string(),
|
9940
|
+
imapPort: z125.number(),
|
9941
|
+
imapTlsPort: z125.number(),
|
9942
|
+
useTlsForImap: z125.boolean()
|
9943
|
+
});
|
9944
|
+
var MailAccountSchema = z125.object({
|
9945
|
+
id: z125.string(),
|
9946
|
+
name: z125.string(),
|
9947
|
+
address: z125.string(),
|
9948
|
+
signature: z125.string().nullable(),
|
9949
|
+
accountId: z125.string(),
|
9950
|
+
mailServerId: z125.string(),
|
9884
9951
|
mailServer: MailServerSchema,
|
9885
|
-
state:
|
9886
|
-
|
9887
|
-
|
9888
|
-
|
9889
|
-
|
9890
|
-
|
9891
|
-
|
9892
|
-
|
9893
|
-
|
9952
|
+
state: z125.union([
|
9953
|
+
z125.literal("init"),
|
9954
|
+
z125.literal("syncing"),
|
9955
|
+
z125.literal("connecting"),
|
9956
|
+
z125.literal("connected"),
|
9957
|
+
z125.literal("disconnected"),
|
9958
|
+
z125.literal("authenticationError"),
|
9959
|
+
z125.literal("connectError"),
|
9960
|
+
z125.literal("unset")
|
9894
9961
|
]),
|
9895
|
-
createdAt:
|
9896
|
-
updatedAt:
|
9897
|
-
deletedAt:
|
9962
|
+
createdAt: z125.date(),
|
9963
|
+
updatedAt: z125.date(),
|
9964
|
+
deletedAt: z125.date().nullable()
|
9898
9965
|
});
|
9899
|
-
var OAuth2AppSchema =
|
9900
|
-
id:
|
9901
|
-
name:
|
9902
|
-
description:
|
9903
|
-
title:
|
9904
|
-
provider:
|
9905
|
-
enabled:
|
9906
|
-
legacy:
|
9907
|
-
created:
|
9908
|
-
updated:
|
9909
|
-
includeInListing:
|
9910
|
-
clientId:
|
9911
|
-
clientSecret:
|
9912
|
-
authority:
|
9913
|
-
redirectUrl:
|
9914
|
-
serviceClient:
|
9915
|
-
googleProjectId:
|
9916
|
-
serviceClientEmail:
|
9917
|
-
serviceKey:
|
9966
|
+
var OAuth2AppSchema = z125.object({
|
9967
|
+
id: z125.string(),
|
9968
|
+
name: z125.string(),
|
9969
|
+
description: z125.string(),
|
9970
|
+
title: z125.string(),
|
9971
|
+
provider: z125.string(),
|
9972
|
+
enabled: z125.boolean(),
|
9973
|
+
legacy: z125.boolean(),
|
9974
|
+
created: z125.string(),
|
9975
|
+
updated: z125.string(),
|
9976
|
+
includeInListing: z125.boolean(),
|
9977
|
+
clientId: z125.string(),
|
9978
|
+
clientSecret: z125.string(),
|
9979
|
+
authority: z125.string(),
|
9980
|
+
redirectUrl: z125.string(),
|
9981
|
+
serviceClient: z125.string(),
|
9982
|
+
googleProjectId: z125.string(),
|
9983
|
+
serviceClientEmail: z125.string(),
|
9984
|
+
serviceKey: z125.string()
|
9918
9985
|
});
|
9919
9986
|
|
9920
9987
|
// src/mail/schemas/message.schema.ts
|
9921
|
-
import
|
9922
|
-
var AttachmentSchema =
|
9923
|
-
id:
|
9924
|
-
createdAt:
|
9925
|
-
updatedAt:
|
9926
|
-
deletedAt:
|
9927
|
-
roomId:
|
9928
|
-
messageId:
|
9929
|
-
fileName:
|
9930
|
-
fileType:
|
9931
|
-
emailEngineAttachmentId:
|
9932
|
-
uploadId:
|
9933
|
-
upload:
|
9934
|
-
id:
|
9935
|
-
createdAt:
|
9936
|
-
updatedAt:
|
9937
|
-
deletedAt:
|
9938
|
-
bucketName:
|
9939
|
-
fileName:
|
9940
|
-
fileKey:
|
9941
|
-
fileSize:
|
9942
|
-
fileUrl:
|
9943
|
-
extensionName:
|
9988
|
+
import z126 from "zod";
|
9989
|
+
var AttachmentSchema = z126.object({
|
9990
|
+
id: z126.string(),
|
9991
|
+
createdAt: z126.date(),
|
9992
|
+
updatedAt: z126.date(),
|
9993
|
+
deletedAt: z126.nullable(z126.date()),
|
9994
|
+
roomId: z126.string(),
|
9995
|
+
messageId: z126.string(),
|
9996
|
+
fileName: z126.string(),
|
9997
|
+
fileType: z126.string(),
|
9998
|
+
emailEngineAttachmentId: z126.string(),
|
9999
|
+
uploadId: z126.string(),
|
10000
|
+
upload: z126.object({
|
10001
|
+
id: z126.string(),
|
10002
|
+
createdAt: z126.date(),
|
10003
|
+
updatedAt: z126.date(),
|
10004
|
+
deletedAt: z126.nullable(z126.date()),
|
10005
|
+
bucketName: z126.string(),
|
10006
|
+
fileName: z126.string(),
|
10007
|
+
fileKey: z126.string(),
|
10008
|
+
fileSize: z126.number(),
|
10009
|
+
fileUrl: z126.string(),
|
10010
|
+
extensionName: z126.string()
|
9944
10011
|
})
|
9945
10012
|
});
|
9946
|
-
var MessageSchema2 =
|
9947
|
-
id:
|
9948
|
-
createdAt:
|
9949
|
-
updatedAt:
|
9950
|
-
deletedAt:
|
9951
|
-
roomId:
|
9952
|
-
subject:
|
9953
|
-
textPlain:
|
9954
|
-
textHtml:
|
9955
|
-
textId:
|
9956
|
-
emailEngineEmailId:
|
9957
|
-
emailEngineMessageId:
|
9958
|
-
emailEngineReplyTo:
|
9959
|
-
direction:
|
9960
|
-
date:
|
9961
|
-
action:
|
9962
|
-
unseen:
|
9963
|
-
sendAt:
|
9964
|
-
starred:
|
9965
|
-
seemsLikeNew:
|
9966
|
-
from:
|
9967
|
-
to:
|
9968
|
-
cc:
|
9969
|
-
bcc:
|
9970
|
-
attachments:
|
10013
|
+
var MessageSchema2 = z126.object({
|
10014
|
+
id: z126.string(),
|
10015
|
+
createdAt: z126.date(),
|
10016
|
+
updatedAt: z126.date(),
|
10017
|
+
deletedAt: z126.nullable(z126.date()),
|
10018
|
+
roomId: z126.string(),
|
10019
|
+
subject: z126.string(),
|
10020
|
+
textPlain: z126.string(),
|
10021
|
+
textHtml: z126.string(),
|
10022
|
+
textId: z126.string(),
|
10023
|
+
emailEngineEmailId: z126.string(),
|
10024
|
+
emailEngineMessageId: z126.string(),
|
10025
|
+
emailEngineReplyTo: z126.nullable(z126.string()),
|
10026
|
+
direction: z126.string(),
|
10027
|
+
date: z126.date(),
|
10028
|
+
action: z126.string(),
|
10029
|
+
unseen: z126.boolean(),
|
10030
|
+
sendAt: z126.date(),
|
10031
|
+
starred: z126.boolean(),
|
10032
|
+
seemsLikeNew: z126.boolean(),
|
10033
|
+
from: z126.array(MailParticipant),
|
10034
|
+
to: z126.array(MailParticipant),
|
10035
|
+
cc: z126.array(MailParticipant),
|
10036
|
+
bcc: z126.array(MailParticipant),
|
10037
|
+
attachments: z126.array(AttachmentSchema)
|
9971
10038
|
});
|
9972
10039
|
|
9973
10040
|
// src/mail/schemas/room.schema.ts
|
9974
|
-
var ContactSchema3 =
|
9975
|
-
id:
|
9976
|
-
createdAt:
|
9977
|
-
updatedAt:
|
9978
|
-
deletedAt:
|
9979
|
-
name:
|
9980
|
-
address:
|
9981
|
-
channel:
|
9982
|
-
notes:
|
9983
|
-
contactProfile:
|
9984
|
-
socialProfileUrl:
|
9985
|
-
});
|
9986
|
-
var MailUserSchema =
|
9987
|
-
id:
|
9988
|
-
createdAt:
|
9989
|
-
updatedAt:
|
9990
|
-
deletedAt:
|
9991
|
-
name:
|
9992
|
-
address:
|
9993
|
-
contactId:
|
10041
|
+
var ContactSchema3 = z127.object({
|
10042
|
+
id: z127.string().uuid(),
|
10043
|
+
createdAt: z127.date(),
|
10044
|
+
updatedAt: z127.date(),
|
10045
|
+
deletedAt: z127.date().nullable(),
|
10046
|
+
name: z127.string(),
|
10047
|
+
address: z127.string().nullable(),
|
10048
|
+
channel: z127.string().nullable(),
|
10049
|
+
notes: z127.string().nullable(),
|
10050
|
+
contactProfile: z127.string().nullable(),
|
10051
|
+
socialProfileUrl: z127.string().nullable()
|
10052
|
+
});
|
10053
|
+
var MailUserSchema = z127.object({
|
10054
|
+
id: z127.string(),
|
10055
|
+
createdAt: z127.date(),
|
10056
|
+
updatedAt: z127.date(),
|
10057
|
+
deletedAt: z127.date().nullable(),
|
10058
|
+
name: z127.string(),
|
10059
|
+
address: z127.string(),
|
10060
|
+
contactId: z127.string(),
|
9994
10061
|
contact: ContactSchema3,
|
9995
|
-
isNewContact:
|
9996
|
-
});
|
9997
|
-
var MailParticipant =
|
9998
|
-
id:
|
9999
|
-
createdAt:
|
10000
|
-
updatedAt:
|
10001
|
-
deletedAt:
|
10002
|
-
roomId:
|
10003
|
-
messageId:
|
10004
|
-
mailUserId:
|
10062
|
+
isNewContact: z127.boolean()
|
10063
|
+
});
|
10064
|
+
var MailParticipant = z127.object({
|
10065
|
+
id: z127.string(),
|
10066
|
+
createdAt: z127.date(),
|
10067
|
+
updatedAt: z127.date(),
|
10068
|
+
deletedAt: z127.date().nullable(),
|
10069
|
+
roomId: z127.string(),
|
10070
|
+
messageId: z127.string(),
|
10071
|
+
mailUserId: z127.string(),
|
10005
10072
|
mailUser: MailUserSchema
|
10006
10073
|
});
|
10007
|
-
var TagSchema2 =
|
10008
|
-
color:
|
10009
|
-
id:
|
10010
|
-
createdAt:
|
10011
|
-
updatedAt:
|
10012
|
-
deletedAt:
|
10013
|
-
name:
|
10014
|
-
});
|
10015
|
-
var UserModel =
|
10016
|
-
id:
|
10017
|
-
createdAt:
|
10018
|
-
updatedAt:
|
10019
|
-
deletedAt:
|
10020
|
-
name:
|
10021
|
-
email:
|
10022
|
-
address:
|
10023
|
-
phone:
|
10024
|
-
notificationCount:
|
10025
|
-
});
|
10026
|
-
var ActivityLogModel =
|
10027
|
-
id:
|
10028
|
-
createdAt:
|
10029
|
-
updatedAt:
|
10030
|
-
deletedAt:
|
10031
|
-
description:
|
10032
|
-
actorId:
|
10033
|
-
roomId:
|
10074
|
+
var TagSchema2 = z127.object({
|
10075
|
+
color: z127.string(),
|
10076
|
+
id: z127.string(),
|
10077
|
+
createdAt: z127.date(),
|
10078
|
+
updatedAt: z127.date(),
|
10079
|
+
deletedAt: z127.date().nullable(),
|
10080
|
+
name: z127.string()
|
10081
|
+
});
|
10082
|
+
var UserModel = z127.object({
|
10083
|
+
id: z127.string().uuid(),
|
10084
|
+
createdAt: z127.date(),
|
10085
|
+
updatedAt: z127.date(),
|
10086
|
+
deletedAt: z127.date().nullable(),
|
10087
|
+
name: z127.string(),
|
10088
|
+
email: z127.string(),
|
10089
|
+
address: z127.string().nullable(),
|
10090
|
+
phone: z127.string().nullable(),
|
10091
|
+
notificationCount: z127.number().nullable()
|
10092
|
+
});
|
10093
|
+
var ActivityLogModel = z127.object({
|
10094
|
+
id: z127.string(),
|
10095
|
+
createdAt: z127.date(),
|
10096
|
+
updatedAt: z127.date(),
|
10097
|
+
deletedAt: z127.nullable(z127.string()),
|
10098
|
+
description: z127.string(),
|
10099
|
+
actorId: z127.string(),
|
10100
|
+
roomId: z127.string(),
|
10034
10101
|
actor: UserModel
|
10035
10102
|
});
|
10036
|
-
var MessagesAndLogsSchema =
|
10037
|
-
|
10103
|
+
var MessagesAndLogsSchema = z127.array(
|
10104
|
+
z127.union([MessageSchema2, ActivityLogModel])
|
10038
10105
|
);
|
10039
|
-
var MailRoomSchema =
|
10040
|
-
id:
|
10041
|
-
createdAt:
|
10042
|
-
updatedAt:
|
10043
|
-
deletedAt:
|
10044
|
-
subject:
|
10045
|
-
resolved:
|
10046
|
-
assigneeId:
|
10047
|
-
note:
|
10048
|
-
mailId:
|
10049
|
-
direction:
|
10050
|
-
lastMessageId:
|
10051
|
-
firstMessageId:
|
10052
|
-
from:
|
10053
|
-
to:
|
10054
|
-
cc:
|
10055
|
-
bcc:
|
10106
|
+
var MailRoomSchema = z127.object({
|
10107
|
+
id: z127.string(),
|
10108
|
+
createdAt: z127.date(),
|
10109
|
+
updatedAt: z127.date(),
|
10110
|
+
deletedAt: z127.date().nullable(),
|
10111
|
+
subject: z127.string(),
|
10112
|
+
resolved: z127.boolean(),
|
10113
|
+
assigneeId: z127.string().nullable(),
|
10114
|
+
note: z127.string(),
|
10115
|
+
mailId: z127.string(),
|
10116
|
+
direction: z127.string(),
|
10117
|
+
lastMessageId: z127.string(),
|
10118
|
+
firstMessageId: z127.string(),
|
10119
|
+
from: z127.array(MailParticipant),
|
10120
|
+
to: z127.array(MailParticipant),
|
10121
|
+
cc: z127.array(MailParticipant),
|
10122
|
+
bcc: z127.array(MailParticipant),
|
10056
10123
|
firstMessage: MessageSchema2,
|
10057
10124
|
lastMessage: MessageSchema2,
|
10058
|
-
tags:
|
10125
|
+
tags: z127.array(TagSchema2),
|
10059
10126
|
assignee: UserModel,
|
10060
|
-
messages:
|
10127
|
+
messages: z127.array(MessageSchema2),
|
10061
10128
|
messagesAndLogs: MessagesAndLogsSchema,
|
10062
10129
|
mail: MailAccountSchema,
|
10063
|
-
unReadMessageCount:
|
10130
|
+
unReadMessageCount: z127.number(),
|
10064
10131
|
cxlog: CxLogSchema
|
10065
10132
|
});
|
10066
|
-
var AttachmentSchema2 =
|
10067
|
-
fileName:
|
10068
|
-
fileType:
|
10069
|
-
emailEngineAttachmentId:
|
10070
|
-
uploadId:
|
10071
|
-
messageId:
|
10072
|
-
roomId:
|
10133
|
+
var AttachmentSchema2 = z127.object({
|
10134
|
+
fileName: z127.string(),
|
10135
|
+
fileType: z127.string(),
|
10136
|
+
emailEngineAttachmentId: z127.string(),
|
10137
|
+
uploadId: z127.string(),
|
10138
|
+
messageId: z127.string(),
|
10139
|
+
roomId: z127.string(),
|
10073
10140
|
upload: UploadSchema
|
10074
10141
|
});
|
10075
10142
|
|
10076
10143
|
// src/mail/schemas/room-validation.schema.ts
|
10077
|
-
import
|
10144
|
+
import z128 from "zod";
|
10078
10145
|
var RoomContractsValidationSchema = {
|
10079
10146
|
getAll: {
|
10080
|
-
input:
|
10081
|
-
page:
|
10082
|
-
pageSize:
|
10083
|
-
keyword:
|
10084
|
-
value:
|
10085
|
-
category:
|
10147
|
+
input: z128.object({
|
10148
|
+
page: z128.coerce.number().default(1),
|
10149
|
+
pageSize: z128.coerce.number().default(10),
|
10150
|
+
keyword: z128.object({
|
10151
|
+
value: z128.string(),
|
10152
|
+
category: z128.union([z128.literal("contact"), z128.literal("message")])
|
10086
10153
|
}).optional(),
|
10087
|
-
contactLabels:
|
10088
|
-
channels:
|
10089
|
-
date:
|
10090
|
-
contacts:
|
10091
|
-
assignees:
|
10092
|
-
level1:
|
10093
|
-
|
10094
|
-
|
10095
|
-
|
10096
|
-
|
10097
|
-
|
10098
|
-
|
10154
|
+
contactLabels: z128.array(z128.string()).optional(),
|
10155
|
+
channels: z128.array(z128.string().email()).optional(),
|
10156
|
+
date: z128.string().optional(),
|
10157
|
+
contacts: z128.array(z128.string()).optional(),
|
10158
|
+
assignees: z128.array(z128.string()).optional(),
|
10159
|
+
level1: z128.union([
|
10160
|
+
z128.literal("open"),
|
10161
|
+
z128.literal("close"),
|
10162
|
+
z128.literal("inbox"),
|
10163
|
+
z128.literal("sent"),
|
10164
|
+
z128.literal("scheduled"),
|
10165
|
+
z128.literal("starred")
|
10099
10166
|
]).optional(),
|
10100
|
-
level2:
|
10101
|
-
|
10102
|
-
|
10103
|
-
|
10104
|
-
|
10167
|
+
level2: z128.union([
|
10168
|
+
z128.literal("all"),
|
10169
|
+
z128.literal("unassign"),
|
10170
|
+
z128.literal("mine"),
|
10171
|
+
z128.literal("other")
|
10105
10172
|
]).optional()
|
10106
10173
|
}),
|
10107
|
-
output:
|
10108
|
-
data:
|
10109
|
-
total:
|
10110
|
-
page:
|
10111
|
-
pageSize:
|
10174
|
+
output: z128.object({
|
10175
|
+
data: z128.array(MailRoomSchema),
|
10176
|
+
total: z128.number(),
|
10177
|
+
page: z128.number(),
|
10178
|
+
pageSize: z128.number()
|
10112
10179
|
})
|
10113
10180
|
},
|
10114
10181
|
update: {
|
10115
|
-
input:
|
10116
|
-
disposition:
|
10117
|
-
assigneeId:
|
10118
|
-
note:
|
10119
|
-
tags:
|
10120
|
-
handover:
|
10121
|
-
|
10182
|
+
input: z128.object({
|
10183
|
+
disposition: z128.string().optional().nullable(),
|
10184
|
+
assigneeId: z128.string().uuid().optional().nullable(),
|
10185
|
+
note: z128.string().optional(),
|
10186
|
+
tags: z128.array(z128.string().uuid()).optional(),
|
10187
|
+
handover: z128.boolean().or(
|
10188
|
+
z128.union([z128.literal("true"), z128.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
10122
10189
|
).optional().nullable(),
|
10123
|
-
selfAssign:
|
10124
|
-
|
10190
|
+
selfAssign: z128.boolean().or(
|
10191
|
+
z128.union([z128.literal("true"), z128.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
10125
10192
|
).optional().nullable()
|
10126
10193
|
})
|
10127
10194
|
}
|
@@ -10135,7 +10202,7 @@ var roomContract = initContract48().router(
|
|
10135
10202
|
path: "/",
|
10136
10203
|
responses: {
|
10137
10204
|
200: DefaultSuccessResponseSchema.extend({
|
10138
|
-
message:
|
10205
|
+
message: z129.string()
|
10139
10206
|
}),
|
10140
10207
|
...DefaultResponses
|
10141
10208
|
},
|
@@ -10148,10 +10215,10 @@ var roomContract = initContract48().router(
|
|
10148
10215
|
query: RoomContractsValidationSchema.getAll.input,
|
10149
10216
|
responses: {
|
10150
10217
|
200: DefaultSuccessResponseSchema.extend({
|
10151
|
-
data:
|
10152
|
-
total:
|
10153
|
-
page:
|
10154
|
-
pageSize:
|
10218
|
+
data: z129.array(MailRoomSchema),
|
10219
|
+
total: z129.number(),
|
10220
|
+
page: z129.number(),
|
10221
|
+
pageSize: z129.number()
|
10155
10222
|
}),
|
10156
10223
|
...DefaultResponses
|
10157
10224
|
},
|
@@ -10163,24 +10230,24 @@ var roomContract = initContract48().router(
|
|
10163
10230
|
path: "/count_rooms/all",
|
10164
10231
|
responses: {
|
10165
10232
|
200: DefaultSuccessResponseSchema.extend({
|
10166
|
-
data:
|
10167
|
-
general:
|
10168
|
-
|
10169
|
-
name:
|
10170
|
-
count:
|
10171
|
-
unReadMessagesCount:
|
10233
|
+
data: z129.object({
|
10234
|
+
general: z129.array(
|
10235
|
+
z129.object({
|
10236
|
+
name: z129.string(),
|
10237
|
+
count: z129.number(),
|
10238
|
+
unReadMessagesCount: z129.number()
|
10172
10239
|
})
|
10173
10240
|
),
|
10174
|
-
channels:
|
10175
|
-
|
10241
|
+
channels: z129.array(
|
10242
|
+
z129.object({
|
10176
10243
|
channel: MailAccountSchema,
|
10177
|
-
count:
|
10244
|
+
count: z129.number()
|
10178
10245
|
})
|
10179
10246
|
),
|
10180
|
-
contactLabels:
|
10181
|
-
|
10247
|
+
contactLabels: z129.array(
|
10248
|
+
z129.object({
|
10182
10249
|
label: TagSchema,
|
10183
|
-
count:
|
10250
|
+
count: z129.number()
|
10184
10251
|
})
|
10185
10252
|
)
|
10186
10253
|
})
|
@@ -10192,12 +10259,12 @@ var roomContract = initContract48().router(
|
|
10192
10259
|
getAttachments: {
|
10193
10260
|
method: "GET",
|
10194
10261
|
path: "/:id/attachments",
|
10195
|
-
pathParams:
|
10196
|
-
id:
|
10262
|
+
pathParams: z129.object({
|
10263
|
+
id: z129.string().uuid()
|
10197
10264
|
}),
|
10198
10265
|
responses: {
|
10199
10266
|
200: DefaultSuccessResponseSchema.extend({
|
10200
|
-
data:
|
10267
|
+
data: z129.array(AttachmentSchema2)
|
10201
10268
|
}),
|
10202
10269
|
...DefaultResponses
|
10203
10270
|
},
|
@@ -10206,12 +10273,12 @@ var roomContract = initContract48().router(
|
|
10206
10273
|
getParticipants: {
|
10207
10274
|
method: "GET",
|
10208
10275
|
path: "/:id/participants",
|
10209
|
-
pathParams:
|
10210
|
-
id:
|
10276
|
+
pathParams: z129.object({
|
10277
|
+
id: z129.string().uuid()
|
10211
10278
|
}),
|
10212
10279
|
responses: {
|
10213
10280
|
200: DefaultSuccessResponseSchema.extend({
|
10214
|
-
data:
|
10281
|
+
data: z129.array(MailParticipant)
|
10215
10282
|
}),
|
10216
10283
|
...DefaultResponses
|
10217
10284
|
},
|
@@ -10222,22 +10289,22 @@ var roomContract = initContract48().router(
|
|
10222
10289
|
path: "/add_email_to_contact",
|
10223
10290
|
responses: {
|
10224
10291
|
200: DefaultSuccessResponseSchema.extend({
|
10225
|
-
data:
|
10292
|
+
data: z129.string()
|
10226
10293
|
}),
|
10227
10294
|
...DefaultResponses
|
10228
10295
|
},
|
10229
|
-
body:
|
10230
|
-
email:
|
10231
|
-
contactId:
|
10232
|
-
mailUserId:
|
10296
|
+
body: z129.object({
|
10297
|
+
email: z129.string(),
|
10298
|
+
contactId: z129.string(),
|
10299
|
+
mailUserId: z129.string()
|
10233
10300
|
}),
|
10234
10301
|
summary: "Add a new email of a mail room participant to an existing contact"
|
10235
10302
|
},
|
10236
10303
|
update: {
|
10237
10304
|
method: "PATCH",
|
10238
10305
|
path: "/:id",
|
10239
|
-
pathParams:
|
10240
|
-
id:
|
10306
|
+
pathParams: z129.object({
|
10307
|
+
id: z129.string()
|
10241
10308
|
}),
|
10242
10309
|
responses: {
|
10243
10310
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10251,12 +10318,12 @@ var roomContract = initContract48().router(
|
|
10251
10318
|
markAsRead: {
|
10252
10319
|
method: "POST",
|
10253
10320
|
path: "/mark_as_read",
|
10254
|
-
body:
|
10255
|
-
id:
|
10321
|
+
body: z129.object({
|
10322
|
+
id: z129.string()
|
10256
10323
|
}),
|
10257
10324
|
responses: {
|
10258
10325
|
200: DefaultSuccessResponseSchema.extend({
|
10259
|
-
message:
|
10326
|
+
message: z129.string()
|
10260
10327
|
}),
|
10261
10328
|
...DefaultResponses
|
10262
10329
|
},
|
@@ -10265,8 +10332,8 @@ var roomContract = initContract48().router(
|
|
10265
10332
|
getById: {
|
10266
10333
|
method: "GET",
|
10267
10334
|
path: "/:id",
|
10268
|
-
pathParams:
|
10269
|
-
id:
|
10335
|
+
pathParams: z129.object({
|
10336
|
+
id: z129.string().uuid()
|
10270
10337
|
}),
|
10271
10338
|
responses: {
|
10272
10339
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10284,90 +10351,90 @@ var roomContract = initContract48().router(
|
|
10284
10351
|
|
10285
10352
|
// src/mail/account-contract.ts
|
10286
10353
|
import { initContract as initContract49 } from "@ts-rest/core";
|
10287
|
-
import
|
10354
|
+
import z131 from "zod";
|
10288
10355
|
|
10289
10356
|
// src/mail/schemas/account-validation.schema.ts
|
10290
|
-
import
|
10357
|
+
import z130 from "zod";
|
10291
10358
|
var AccountContractsValidationSchemas = {
|
10292
10359
|
create: {
|
10293
|
-
input:
|
10294
|
-
address:
|
10295
|
-
name:
|
10296
|
-
password:
|
10297
|
-
mailServerId:
|
10298
|
-
signature:
|
10360
|
+
input: z130.object({
|
10361
|
+
address: z130.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
10362
|
+
name: z130.string().min(1, "Account name cannot be empty."),
|
10363
|
+
password: z130.string().min(1, "Password cannot be empty."),
|
10364
|
+
mailServerId: z130.string().uuid("Invalid mail_server_id"),
|
10365
|
+
signature: z130.string().optional().default("")
|
10299
10366
|
})
|
10300
10367
|
},
|
10301
10368
|
createWithCustomSmtpAndImap: {
|
10302
|
-
input:
|
10303
|
-
email:
|
10304
|
-
name:
|
10305
|
-
password:
|
10306
|
-
imap:
|
10307
|
-
host:
|
10308
|
-
port:
|
10309
|
-
secure:
|
10369
|
+
input: z130.object({
|
10370
|
+
email: z130.string(),
|
10371
|
+
name: z130.string(),
|
10372
|
+
password: z130.string(),
|
10373
|
+
imap: z130.object({
|
10374
|
+
host: z130.string(),
|
10375
|
+
port: z130.number(),
|
10376
|
+
secure: z130.boolean().default(false)
|
10310
10377
|
//Whether to use TLS for the connection (usually true for port 993)
|
10311
10378
|
}),
|
10312
|
-
smtp:
|
10313
|
-
host:
|
10314
|
-
port:
|
10315
|
-
secure:
|
10379
|
+
smtp: z130.object({
|
10380
|
+
host: z130.string(),
|
10381
|
+
port: z130.number(),
|
10382
|
+
secure: z130.boolean().default(false)
|
10316
10383
|
//Whether to use TLS for the connection (usually true for port 993)
|
10317
10384
|
})
|
10318
10385
|
})
|
10319
10386
|
},
|
10320
10387
|
getById: {
|
10321
|
-
input:
|
10322
|
-
id:
|
10388
|
+
input: z130.object({
|
10389
|
+
id: z130.string().uuid()
|
10323
10390
|
}),
|
10324
10391
|
output: MailAccountSchema
|
10325
10392
|
},
|
10326
10393
|
getAll: {
|
10327
|
-
output:
|
10394
|
+
output: z130.array(MailAccountSchema)
|
10328
10395
|
},
|
10329
10396
|
update: {
|
10330
10397
|
input: MailAccountSchema,
|
10331
10398
|
output: MailAccountSchema
|
10332
10399
|
},
|
10333
10400
|
disconnect: {
|
10334
|
-
input:
|
10335
|
-
id:
|
10401
|
+
input: z130.object({
|
10402
|
+
id: z130.string().uuid()
|
10336
10403
|
}),
|
10337
10404
|
output: MailAccountSchema
|
10338
10405
|
},
|
10339
10406
|
reconnect: {
|
10340
|
-
input:
|
10341
|
-
id:
|
10407
|
+
input: z130.object({
|
10408
|
+
id: z130.string()
|
10342
10409
|
}),
|
10343
10410
|
output: MailAccountSchema
|
10344
10411
|
},
|
10345
10412
|
delete: {
|
10346
|
-
input:
|
10347
|
-
id:
|
10413
|
+
input: z130.object({
|
10414
|
+
id: z130.string()
|
10348
10415
|
}),
|
10349
|
-
output:
|
10416
|
+
output: z130.string()
|
10350
10417
|
},
|
10351
10418
|
deleteEmailEngineAcc: {
|
10352
|
-
input:
|
10353
|
-
account:
|
10419
|
+
input: z130.object({
|
10420
|
+
account: z130.string()
|
10354
10421
|
}),
|
10355
10422
|
output: MailAccountSchema
|
10356
10423
|
},
|
10357
10424
|
generateOAuth2AuthenticationLink: {
|
10358
|
-
body:
|
10359
|
-
oAuth2AppId:
|
10360
|
-
mailServerId:
|
10425
|
+
body: z130.object({
|
10426
|
+
oAuth2AppId: z130.string(),
|
10427
|
+
mailServerId: z130.string()
|
10361
10428
|
}),
|
10362
|
-
response:
|
10363
|
-
url:
|
10364
|
-
account:
|
10429
|
+
response: z130.object({
|
10430
|
+
url: z130.string(),
|
10431
|
+
account: z130.string()
|
10365
10432
|
})
|
10366
10433
|
},
|
10367
10434
|
createOAuth2Acc: {
|
10368
|
-
body:
|
10369
|
-
account:
|
10370
|
-
name:
|
10435
|
+
body: z130.object({
|
10436
|
+
account: z130.string(),
|
10437
|
+
name: z130.string()
|
10371
10438
|
}),
|
10372
10439
|
response: MailAccountSchema
|
10373
10440
|
}
|
@@ -10385,14 +10452,14 @@ var accountContract = initContract49().router(
|
|
10385
10452
|
// data: AccountContractsValidationSchemas.create.output,
|
10386
10453
|
data: MailAccountSchema
|
10387
10454
|
}),
|
10388
|
-
400:
|
10389
|
-
message:
|
10455
|
+
400: z131.object({
|
10456
|
+
message: z131.string()
|
10390
10457
|
}),
|
10391
|
-
409:
|
10392
|
-
message:
|
10458
|
+
409: z131.object({
|
10459
|
+
message: z131.string()
|
10393
10460
|
}),
|
10394
|
-
500:
|
10395
|
-
message:
|
10461
|
+
500: z131.object({
|
10462
|
+
message: z131.string()
|
10396
10463
|
}),
|
10397
10464
|
...DefaultResponses
|
10398
10465
|
},
|
@@ -10407,14 +10474,14 @@ var accountContract = initContract49().router(
|
|
10407
10474
|
// data: AccountContractsValidationSchemas.create.output,
|
10408
10475
|
// data: MailAccountSchema,
|
10409
10476
|
}),
|
10410
|
-
400:
|
10411
|
-
message:
|
10477
|
+
400: z131.object({
|
10478
|
+
message: z131.string()
|
10412
10479
|
}),
|
10413
|
-
409:
|
10414
|
-
message:
|
10480
|
+
409: z131.object({
|
10481
|
+
message: z131.string()
|
10415
10482
|
}),
|
10416
|
-
500:
|
10417
|
-
message:
|
10483
|
+
500: z131.object({
|
10484
|
+
message: z131.string()
|
10418
10485
|
}),
|
10419
10486
|
...DefaultResponses
|
10420
10487
|
},
|
@@ -10430,14 +10497,14 @@ var accountContract = initContract49().router(
|
|
10430
10497
|
201: DefaultSuccessResponseSchema.extend({
|
10431
10498
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
10432
10499
|
}),
|
10433
|
-
400:
|
10434
|
-
message:
|
10500
|
+
400: z131.object({
|
10501
|
+
message: z131.string()
|
10435
10502
|
}),
|
10436
|
-
409:
|
10437
|
-
message:
|
10503
|
+
409: z131.object({
|
10504
|
+
message: z131.string()
|
10438
10505
|
}),
|
10439
|
-
500:
|
10440
|
-
message:
|
10506
|
+
500: z131.object({
|
10507
|
+
message: z131.string()
|
10441
10508
|
}),
|
10442
10509
|
...DefaultResponses
|
10443
10510
|
},
|
@@ -10451,7 +10518,7 @@ var accountContract = initContract49().router(
|
|
10451
10518
|
path: "/sync",
|
10452
10519
|
responses: {
|
10453
10520
|
200: DefaultSuccessResponseSchema.extend({
|
10454
|
-
message:
|
10521
|
+
message: z131.string()
|
10455
10522
|
}),
|
10456
10523
|
...DefaultResponses
|
10457
10524
|
},
|
@@ -10476,13 +10543,13 @@ var accountContract = initContract49().router(
|
|
10476
10543
|
getAll: {
|
10477
10544
|
method: "GET",
|
10478
10545
|
path: "",
|
10479
|
-
query:
|
10480
|
-
state:
|
10481
|
-
withDeleted:
|
10546
|
+
query: z131.object({
|
10547
|
+
state: z131.union([z131.literal("connected"), z131.literal("disconnected")]).optional(),
|
10548
|
+
withDeleted: z131.boolean().default(false)
|
10482
10549
|
}).optional(),
|
10483
10550
|
responses: {
|
10484
10551
|
200: DefaultSuccessResponseSchema.extend({
|
10485
|
-
data:
|
10552
|
+
data: z131.array(MailAccountSchema)
|
10486
10553
|
}),
|
10487
10554
|
...DefaultResponses
|
10488
10555
|
},
|
@@ -10493,8 +10560,8 @@ var accountContract = initContract49().router(
|
|
10493
10560
|
update: {
|
10494
10561
|
method: "PATCH",
|
10495
10562
|
path: "/:id",
|
10496
|
-
pathParams:
|
10497
|
-
id:
|
10563
|
+
pathParams: z131.object({
|
10564
|
+
id: z131.string().uuid()
|
10498
10565
|
}),
|
10499
10566
|
responses: {
|
10500
10567
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -10543,7 +10610,7 @@ var accountContract = initContract49().router(
|
|
10543
10610
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
10544
10611
|
responses: {
|
10545
10612
|
200: DefaultSuccessResponseSchema.extend({
|
10546
|
-
message:
|
10613
|
+
message: z131.string()
|
10547
10614
|
}),
|
10548
10615
|
...DefaultResponses
|
10549
10616
|
},
|
@@ -10558,7 +10625,7 @@ var accountContract = initContract49().router(
|
|
10558
10625
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
10559
10626
|
responses: {
|
10560
10627
|
200: DefaultSuccessResponseSchema.extend({
|
10561
|
-
message:
|
10628
|
+
message: z131.string()
|
10562
10629
|
}),
|
10563
10630
|
...DefaultResponses
|
10564
10631
|
},
|
@@ -10587,20 +10654,20 @@ var accountContract = initContract49().router(
|
|
10587
10654
|
|
10588
10655
|
// src/mail/mail-server-contract.ts
|
10589
10656
|
import { initContract as initContract50 } from "@ts-rest/core";
|
10590
|
-
import
|
10657
|
+
import z133 from "zod";
|
10591
10658
|
|
10592
10659
|
// src/mail/schemas/servers-validation.schema.ts
|
10593
|
-
import
|
10594
|
-
var CreateMailServerSchema =
|
10595
|
-
name:
|
10596
|
-
smtpHost:
|
10597
|
-
smtpPort:
|
10598
|
-
smtpTlsPort:
|
10599
|
-
useTlsForSmtp:
|
10600
|
-
imapHost:
|
10601
|
-
imapPort:
|
10602
|
-
imapTlsPort:
|
10603
|
-
useTlsForImap:
|
10660
|
+
import z132 from "zod";
|
10661
|
+
var CreateMailServerSchema = z132.object({
|
10662
|
+
name: z132.string(),
|
10663
|
+
smtpHost: z132.string(),
|
10664
|
+
smtpPort: z132.number(),
|
10665
|
+
smtpTlsPort: z132.number(),
|
10666
|
+
useTlsForSmtp: z132.boolean(),
|
10667
|
+
imapHost: z132.string(),
|
10668
|
+
imapPort: z132.number(),
|
10669
|
+
imapTlsPort: z132.number(),
|
10670
|
+
useTlsForImap: z132.boolean()
|
10604
10671
|
});
|
10605
10672
|
|
10606
10673
|
// src/mail/mail-server-contract.ts
|
@@ -10623,11 +10690,11 @@ var serverContract = initContract50().router(
|
|
10623
10690
|
path: "/oauth2/apps",
|
10624
10691
|
responses: {
|
10625
10692
|
200: DefaultSuccessResponseSchema.extend({
|
10626
|
-
data:
|
10627
|
-
total:
|
10628
|
-
pages:
|
10629
|
-
page:
|
10630
|
-
apps:
|
10693
|
+
data: z133.object({
|
10694
|
+
total: z133.number(),
|
10695
|
+
pages: z133.number(),
|
10696
|
+
page: z133.number(),
|
10697
|
+
apps: z133.array(OAuth2AppSchema)
|
10631
10698
|
})
|
10632
10699
|
}),
|
10633
10700
|
...DefaultResponses
|
@@ -10637,8 +10704,8 @@ var serverContract = initContract50().router(
|
|
10637
10704
|
getById: {
|
10638
10705
|
method: "GET",
|
10639
10706
|
path: "/:id",
|
10640
|
-
pathParams:
|
10641
|
-
id:
|
10707
|
+
pathParams: z133.object({
|
10708
|
+
id: z133.string().uuid()
|
10642
10709
|
}),
|
10643
10710
|
responses: {
|
10644
10711
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10653,7 +10720,7 @@ var serverContract = initContract50().router(
|
|
10653
10720
|
path: "/",
|
10654
10721
|
responses: {
|
10655
10722
|
200: DefaultSuccessResponseSchema.extend({
|
10656
|
-
data:
|
10723
|
+
data: z133.array(MailServerSchema)
|
10657
10724
|
}),
|
10658
10725
|
...DefaultResponses
|
10659
10726
|
},
|
@@ -10662,8 +10729,8 @@ var serverContract = initContract50().router(
|
|
10662
10729
|
update: {
|
10663
10730
|
method: "PATCH",
|
10664
10731
|
path: "/:id",
|
10665
|
-
pathParams:
|
10666
|
-
id:
|
10732
|
+
pathParams: z133.object({
|
10733
|
+
id: z133.string().uuid()
|
10667
10734
|
}),
|
10668
10735
|
responses: {
|
10669
10736
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10677,8 +10744,8 @@ var serverContract = initContract50().router(
|
|
10677
10744
|
delete: {
|
10678
10745
|
method: "DELETE",
|
10679
10746
|
path: "/:id",
|
10680
|
-
pathParams:
|
10681
|
-
id:
|
10747
|
+
pathParams: z133.object({
|
10748
|
+
id: z133.string().uuid()
|
10682
10749
|
}),
|
10683
10750
|
responses: {
|
10684
10751
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10697,45 +10764,45 @@ var serverContract = initContract50().router(
|
|
10697
10764
|
|
10698
10765
|
// src/mail/message-contract.ts
|
10699
10766
|
import { initContract as initContract51 } from "@ts-rest/core";
|
10700
|
-
import
|
10767
|
+
import z135 from "zod";
|
10701
10768
|
|
10702
10769
|
// src/mail/schemas/message-validation.schema.ts
|
10703
|
-
import
|
10704
|
-
var MailParticipant2 =
|
10705
|
-
name:
|
10706
|
-
address:
|
10770
|
+
import z134 from "zod";
|
10771
|
+
var MailParticipant2 = z134.object({
|
10772
|
+
name: z134.string().optional(),
|
10773
|
+
address: z134.string().email()
|
10707
10774
|
});
|
10708
10775
|
var MessageContractsValidationsSchema = {
|
10709
10776
|
submit: {
|
10710
|
-
input:
|
10711
|
-
subject:
|
10712
|
-
text:
|
10713
|
-
html:
|
10777
|
+
input: z134.object({
|
10778
|
+
subject: z134.string(),
|
10779
|
+
text: z134.string(),
|
10780
|
+
html: z134.string(),
|
10714
10781
|
from: MailParticipant2,
|
10715
10782
|
to: MailParticipant2,
|
10716
|
-
cc:
|
10717
|
-
bcc:
|
10718
|
-
sendAt:
|
10719
|
-
reference:
|
10720
|
-
messageId:
|
10721
|
-
action:
|
10783
|
+
cc: z134.array(MailParticipant2).optional(),
|
10784
|
+
bcc: z134.array(MailParticipant2).optional(),
|
10785
|
+
sendAt: z134.string().optional(),
|
10786
|
+
reference: z134.object({
|
10787
|
+
messageId: z134.string(),
|
10788
|
+
action: z134.union([z134.literal("reply"), z134.literal("forward")])
|
10722
10789
|
}).optional(),
|
10723
|
-
attachments:
|
10724
|
-
|
10725
|
-
fileType:
|
10726
|
-
fileName:
|
10727
|
-
fileKey:
|
10728
|
-
fileSize:
|
10729
|
-
bucketName:
|
10730
|
-
presignedUrl:
|
10790
|
+
attachments: z134.array(
|
10791
|
+
z134.object({
|
10792
|
+
fileType: z134.string(),
|
10793
|
+
fileName: z134.string(),
|
10794
|
+
fileKey: z134.string(),
|
10795
|
+
fileSize: z134.number(),
|
10796
|
+
bucketName: z134.string(),
|
10797
|
+
presignedUrl: z134.string()
|
10731
10798
|
})
|
10732
10799
|
).optional()
|
10733
10800
|
}),
|
10734
|
-
output:
|
10735
|
-
response:
|
10736
|
-
messageId:
|
10737
|
-
sendAt:
|
10738
|
-
queueId:
|
10801
|
+
output: z134.object({
|
10802
|
+
response: z134.string(),
|
10803
|
+
messageId: z134.string(),
|
10804
|
+
sendAt: z134.string(),
|
10805
|
+
queueId: z134.string()
|
10739
10806
|
})
|
10740
10807
|
}
|
10741
10808
|
};
|
@@ -10764,8 +10831,8 @@ var messageContract = initContract51().router(
|
|
10764
10831
|
path: "/new_message_count",
|
10765
10832
|
responses: {
|
10766
10833
|
200: DefaultSuccessResponseSchema.extend({
|
10767
|
-
data:
|
10768
|
-
count:
|
10834
|
+
data: z135.object({
|
10835
|
+
count: z135.number()
|
10769
10836
|
})
|
10770
10837
|
}),
|
10771
10838
|
...DefaultResponses
|
@@ -10777,8 +10844,8 @@ var messageContract = initContract51().router(
|
|
10777
10844
|
getById: {
|
10778
10845
|
method: "GET",
|
10779
10846
|
path: "/:id",
|
10780
|
-
pathParams:
|
10781
|
-
id:
|
10847
|
+
pathParams: z135.object({
|
10848
|
+
id: z135.string()
|
10782
10849
|
}),
|
10783
10850
|
responses: {
|
10784
10851
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10793,8 +10860,8 @@ var messageContract = initContract51().router(
|
|
10793
10860
|
update: {
|
10794
10861
|
method: "PATCH",
|
10795
10862
|
path: "/:id",
|
10796
|
-
pathParams:
|
10797
|
-
id:
|
10863
|
+
pathParams: z135.object({
|
10864
|
+
id: z135.string()
|
10798
10865
|
}),
|
10799
10866
|
responses: {
|
10800
10867
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10810,8 +10877,8 @@ var messageContract = initContract51().router(
|
|
10810
10877
|
delete: {
|
10811
10878
|
method: "DELETE",
|
10812
10879
|
path: "/:id",
|
10813
|
-
pathParams:
|
10814
|
-
id:
|
10880
|
+
pathParams: z135.object({
|
10881
|
+
id: z135.string()
|
10815
10882
|
}),
|
10816
10883
|
responses: {
|
10817
10884
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10827,13 +10894,13 @@ var messageContract = initContract51().router(
|
|
10827
10894
|
cancelScheduledMessage: {
|
10828
10895
|
method: "DELETE",
|
10829
10896
|
path: "/scheduled_message/:id",
|
10830
|
-
pathParams:
|
10831
|
-
id:
|
10897
|
+
pathParams: z135.object({
|
10898
|
+
id: z135.string()
|
10832
10899
|
}),
|
10833
10900
|
responses: {
|
10834
10901
|
200: DefaultSuccessResponseSchema.extend({
|
10835
|
-
data:
|
10836
|
-
totalMessagesCount:
|
10902
|
+
data: z135.object({
|
10903
|
+
totalMessagesCount: z135.number()
|
10837
10904
|
})
|
10838
10905
|
}),
|
10839
10906
|
...DefaultResponses
|
@@ -10858,38 +10925,38 @@ var mailContract = initContract52().router({
|
|
10858
10925
|
|
10859
10926
|
// src/webchat/index.ts
|
10860
10927
|
import { initContract as initContract53 } from "@ts-rest/core";
|
10861
|
-
import
|
10928
|
+
import z138 from "zod";
|
10862
10929
|
|
10863
10930
|
// src/webchat/schema.ts
|
10864
|
-
import
|
10931
|
+
import z137 from "zod";
|
10865
10932
|
|
10866
10933
|
// src/webchat/validation.ts
|
10867
|
-
import
|
10934
|
+
import z136 from "zod";
|
10868
10935
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
10869
10936
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
10870
10937
|
return ChatwootChannelType3;
|
10871
10938
|
})(ChatwootChannelType2 || {});
|
10872
|
-
var WebChatChannelSchema =
|
10873
|
-
avatar:
|
10874
|
-
name:
|
10875
|
-
type:
|
10876
|
-
websiteName:
|
10877
|
-
welcomeTitle:
|
10878
|
-
websiteUrl:
|
10879
|
-
welcomeTagline:
|
10880
|
-
agentAwayMessage:
|
10881
|
-
widgetColor:
|
10939
|
+
var WebChatChannelSchema = z136.object({
|
10940
|
+
avatar: z136.string().optional(),
|
10941
|
+
name: z136.string(),
|
10942
|
+
type: z136.nativeEnum(ChatwootChannelType2),
|
10943
|
+
websiteName: z136.string(),
|
10944
|
+
welcomeTitle: z136.string(),
|
10945
|
+
websiteUrl: z136.string().url(),
|
10946
|
+
welcomeTagline: z136.string().optional(),
|
10947
|
+
agentAwayMessage: z136.string().optional(),
|
10948
|
+
widgetColor: z136.string().optional()
|
10882
10949
|
});
|
10883
10950
|
|
10884
10951
|
// src/webchat/schema.ts
|
10885
|
-
var ConnectWebChatChannelSchema =
|
10886
|
-
name:
|
10887
|
-
actor:
|
10888
|
-
id:
|
10889
|
-
name:
|
10890
|
-
email:
|
10891
|
-
address:
|
10892
|
-
phone:
|
10952
|
+
var ConnectWebChatChannelSchema = z137.object({
|
10953
|
+
name: z137.string(),
|
10954
|
+
actor: z137.object({
|
10955
|
+
id: z137.string().uuid(),
|
10956
|
+
name: z137.string(),
|
10957
|
+
email: z137.string().email(),
|
10958
|
+
address: z137.string().nullable(),
|
10959
|
+
phone: z137.string().nullable()
|
10893
10960
|
}),
|
10894
10961
|
channel: WebChatChannelSchema
|
10895
10962
|
});
|
@@ -10923,8 +10990,8 @@ var platformWebchatContract = initContract53().router(
|
|
10923
10990
|
disconnectToService: {
|
10924
10991
|
method: "POST",
|
10925
10992
|
path: "/disconnect",
|
10926
|
-
body:
|
10927
|
-
id:
|
10993
|
+
body: z138.object({
|
10994
|
+
id: z138.string().uuid()
|
10928
10995
|
}),
|
10929
10996
|
responses: {
|
10930
10997
|
200: ChannelServiceResponseSchema,
|
@@ -10935,8 +11002,8 @@ var platformWebchatContract = initContract53().router(
|
|
10935
11002
|
reconnect: {
|
10936
11003
|
method: "POST",
|
10937
11004
|
path: "/reconnect/:channelId",
|
10938
|
-
pathParams:
|
10939
|
-
channelId:
|
11005
|
+
pathParams: z138.object({
|
11006
|
+
channelId: z138.string().uuid()
|
10940
11007
|
}),
|
10941
11008
|
body: null,
|
10942
11009
|
responses: {
|
@@ -10948,8 +11015,8 @@ var platformWebchatContract = initContract53().router(
|
|
10948
11015
|
delete: {
|
10949
11016
|
method: "DELETE",
|
10950
11017
|
path: "/delete/:channelId",
|
10951
|
-
pathParams:
|
10952
|
-
channelId:
|
11018
|
+
pathParams: z138.object({
|
11019
|
+
channelId: z138.string().uuid()
|
10953
11020
|
}),
|
10954
11021
|
body: null,
|
10955
11022
|
responses: {
|
@@ -10966,18 +11033,18 @@ var platformWebchatContract = initContract53().router(
|
|
10966
11033
|
|
10967
11034
|
// src/hold-label/index.ts
|
10968
11035
|
import { initContract as initContract54 } from "@ts-rest/core";
|
10969
|
-
import
|
11036
|
+
import z140 from "zod";
|
10970
11037
|
|
10971
11038
|
// src/hold-label/validation.ts
|
10972
|
-
import
|
10973
|
-
var UpdatePositionSchema2 =
|
10974
|
-
holdLabels:
|
10975
|
-
|
11039
|
+
import z139 from "zod";
|
11040
|
+
var UpdatePositionSchema2 = z139.object({
|
11041
|
+
holdLabels: z139.array(
|
11042
|
+
z139.object({ id: z139.string().uuid(), position: z139.number() })
|
10976
11043
|
)
|
10977
11044
|
});
|
10978
|
-
var HoldRoomSchema =
|
10979
|
-
roomId:
|
10980
|
-
holdLabelId:
|
11045
|
+
var HoldRoomSchema = z139.object({
|
11046
|
+
roomId: z139.string().uuid(),
|
11047
|
+
holdLabelId: z139.string().uuid()
|
10981
11048
|
});
|
10982
11049
|
|
10983
11050
|
// src/hold-label/index.ts
|
@@ -10985,7 +11052,7 @@ var holdLabelContract = initContract54().router({
|
|
10985
11052
|
createHoldLabel: {
|
10986
11053
|
method: "POST",
|
10987
11054
|
path: "ms/hold-label",
|
10988
|
-
body:
|
11055
|
+
body: z140.object({ name: z140.string() }),
|
10989
11056
|
responses: {
|
10990
11057
|
201: DefaultSuccessResponseSchema.extend({
|
10991
11058
|
holdLabel: HoldLabelSchema
|
@@ -10997,7 +11064,7 @@ var holdLabelContract = initContract54().router({
|
|
10997
11064
|
path: "chs/api/v1/hold-label",
|
10998
11065
|
responses: {
|
10999
11066
|
200: DefaultSuccessResponseSchema.extend({
|
11000
|
-
holdLabels:
|
11067
|
+
holdLabels: z140.array(HoldLabelSchema)
|
11001
11068
|
})
|
11002
11069
|
}
|
11003
11070
|
},
|
@@ -11015,8 +11082,8 @@ var holdLabelContract = initContract54().router({
|
|
11015
11082
|
updateHoldLabel: {
|
11016
11083
|
method: "PATCH",
|
11017
11084
|
path: "ms/hold-label/:id",
|
11018
|
-
pathParams:
|
11019
|
-
body:
|
11085
|
+
pathParams: z140.object({ id: z140.string().uuid() }),
|
11086
|
+
body: z140.object({ name: z140.string() }),
|
11020
11087
|
responses: {
|
11021
11088
|
200: DefaultSuccessResponseSchema.extend({
|
11022
11089
|
holdLabel: HoldLabelSchema
|
@@ -11026,7 +11093,7 @@ var holdLabelContract = initContract54().router({
|
|
11026
11093
|
deleteHoldLabel: {
|
11027
11094
|
method: "DELETE",
|
11028
11095
|
path: "ms/hold-label/:id",
|
11029
|
-
pathParams:
|
11096
|
+
pathParams: z140.object({ id: z140.string().uuid() }),
|
11030
11097
|
body: null,
|
11031
11098
|
responses: {
|
11032
11099
|
200: DefaultSuccessResponseSchema
|
@@ -11037,10 +11104,10 @@ var holdLabelContract = initContract54().router({
|
|
11037
11104
|
path: "ms/hold-label/auto-unhold",
|
11038
11105
|
responses: {
|
11039
11106
|
200: DefaultSuccessResponseSchema.extend({
|
11040
|
-
autoUnhold:
|
11041
|
-
resumeLabel:
|
11042
|
-
show:
|
11043
|
-
name:
|
11107
|
+
autoUnhold: z140.boolean(),
|
11108
|
+
resumeLabel: z140.object({
|
11109
|
+
show: z140.boolean(),
|
11110
|
+
name: z140.string()
|
11044
11111
|
})
|
11045
11112
|
})
|
11046
11113
|
}
|
@@ -11048,19 +11115,19 @@ var holdLabelContract = initContract54().router({
|
|
11048
11115
|
updateAutoUnhold: {
|
11049
11116
|
method: "POST",
|
11050
11117
|
path: "ms/hold-label/auto-unhold",
|
11051
|
-
body:
|
11052
|
-
autoUnhold:
|
11053
|
-
resumeLabel:
|
11054
|
-
show:
|
11055
|
-
name:
|
11118
|
+
body: z140.object({
|
11119
|
+
autoUnhold: z140.boolean().optional(),
|
11120
|
+
resumeLabel: z140.object({
|
11121
|
+
show: z140.boolean().optional(),
|
11122
|
+
name: z140.string().optional()
|
11056
11123
|
}).optional()
|
11057
11124
|
}),
|
11058
11125
|
responses: {
|
11059
11126
|
200: DefaultSuccessResponseSchema.extend({
|
11060
|
-
autoUnhold:
|
11061
|
-
resumeLabel:
|
11062
|
-
show:
|
11063
|
-
name:
|
11127
|
+
autoUnhold: z140.boolean(),
|
11128
|
+
resumeLabel: z140.object({
|
11129
|
+
show: z140.boolean(),
|
11130
|
+
name: z140.string()
|
11064
11131
|
})
|
11065
11132
|
})
|
11066
11133
|
}
|
@@ -11068,10 +11135,10 @@ var holdLabelContract = initContract54().router({
|
|
11068
11135
|
getHoldLogs: {
|
11069
11136
|
method: "GET",
|
11070
11137
|
path: "ms/hold-label/hold-logs",
|
11071
|
-
query:
|
11138
|
+
query: z140.object({ cxLogId: z140.string().uuid() }),
|
11072
11139
|
responses: {
|
11073
|
-
200:
|
11074
|
-
holdLogs:
|
11140
|
+
200: z140.object({
|
11141
|
+
holdLogs: z140.array(FormattedHoldLogSchema)
|
11075
11142
|
})
|
11076
11143
|
}
|
11077
11144
|
},
|
@@ -11088,7 +11155,7 @@ var holdLabelContract = initContract54().router({
|
|
11088
11155
|
unholdRoom: {
|
11089
11156
|
method: "POST",
|
11090
11157
|
path: "ms/hold-label/unhold-room",
|
11091
|
-
body:
|
11158
|
+
body: z140.object({ roomId: z140.string().uuid() }),
|
11092
11159
|
responses: {
|
11093
11160
|
200: DefaultSuccessResponseSchema.extend({
|
11094
11161
|
holdLog: HoldLogSchema.optional()
|
@@ -11099,89 +11166,89 @@ var holdLabelContract = initContract54().router({
|
|
11099
11166
|
|
11100
11167
|
// src/subscription/index.ts
|
11101
11168
|
import { initContract as initContract55 } from "@ts-rest/core";
|
11102
|
-
import { z as
|
11169
|
+
import { z as z143 } from "zod";
|
11103
11170
|
|
11104
11171
|
// src/subscription/schema.ts
|
11105
|
-
import
|
11172
|
+
import z141 from "zod";
|
11106
11173
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
11107
|
-
priceId:
|
11108
|
-
name:
|
11109
|
-
perUnit:
|
11110
|
-
price:
|
11111
|
-
currency:
|
11174
|
+
priceId: z141.string(),
|
11175
|
+
name: z141.string().nullable(),
|
11176
|
+
perUnit: z141.number(),
|
11177
|
+
price: z141.number(),
|
11178
|
+
currency: z141.string().nullable()
|
11112
11179
|
});
|
11113
11180
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
11114
|
-
provider:
|
11115
|
-
productId:
|
11116
|
-
name:
|
11117
|
-
type:
|
11118
|
-
omnichannel:
|
11119
|
-
usageType:
|
11181
|
+
provider: z141.string(),
|
11182
|
+
productId: z141.string(),
|
11183
|
+
name: z141.string(),
|
11184
|
+
type: z141.string(),
|
11185
|
+
omnichannel: z141.string(),
|
11186
|
+
usageType: z141.string().nullable(),
|
11120
11187
|
productPrice: ProductPriceSchema
|
11121
11188
|
});
|
11122
11189
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
11123
|
-
includedQuantity:
|
11190
|
+
includedQuantity: z141.number(),
|
11124
11191
|
product: ProductWithoutRelatedSchema
|
11125
11192
|
});
|
11126
11193
|
var ProductSchema = DefaultEntitySchema.extend({
|
11127
|
-
provider:
|
11128
|
-
productId:
|
11129
|
-
name:
|
11130
|
-
type:
|
11131
|
-
omnichannel:
|
11132
|
-
usageType:
|
11194
|
+
provider: z141.string(),
|
11195
|
+
productId: z141.string(),
|
11196
|
+
name: z141.string(),
|
11197
|
+
type: z141.string(),
|
11198
|
+
omnichannel: z141.string(),
|
11199
|
+
usageType: z141.string().nullable(),
|
11133
11200
|
productPrice: ProductPriceSchema,
|
11134
|
-
relatedProducts:
|
11201
|
+
relatedProducts: z141.array(RelatedProductSchema)
|
11135
11202
|
});
|
11136
11203
|
var CustomerSchema = DefaultEntitySchema.extend({
|
11137
|
-
provider:
|
11138
|
-
customerId:
|
11139
|
-
email:
|
11140
|
-
name:
|
11141
|
-
balance:
|
11204
|
+
provider: z141.string(),
|
11205
|
+
customerId: z141.string(),
|
11206
|
+
email: z141.string(),
|
11207
|
+
name: z141.string(),
|
11208
|
+
balance: z141.number()
|
11142
11209
|
});
|
11143
11210
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
11144
|
-
limit:
|
11145
|
-
subscriptionItemId:
|
11146
|
-
usage:
|
11211
|
+
limit: z141.number(),
|
11212
|
+
subscriptionItemId: z141.string(),
|
11213
|
+
usage: z141.number().nullable(),
|
11147
11214
|
product: ProductSchema
|
11148
11215
|
});
|
11149
11216
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
11150
|
-
provider:
|
11151
|
-
type:
|
11152
|
-
subscriptionId:
|
11153
|
-
interval:
|
11154
|
-
quantity:
|
11155
|
-
amount:
|
11156
|
-
startAt:
|
11157
|
-
expireAt:
|
11158
|
-
status:
|
11159
|
-
name:
|
11160
|
-
subscriptionProducts:
|
11217
|
+
provider: z141.string(),
|
11218
|
+
type: z141.string(),
|
11219
|
+
subscriptionId: z141.string(),
|
11220
|
+
interval: z141.string(),
|
11221
|
+
quantity: z141.number(),
|
11222
|
+
amount: z141.number(),
|
11223
|
+
startAt: z141.date().nullable(),
|
11224
|
+
expireAt: z141.date(),
|
11225
|
+
status: z141.string(),
|
11226
|
+
name: z141.string().nullable(),
|
11227
|
+
subscriptionProducts: z141.array(SubscriptionProuctSchema),
|
11161
11228
|
productPrice: ProductPriceSchema,
|
11162
11229
|
product: ProductSchema
|
11163
11230
|
});
|
11164
11231
|
|
11165
11232
|
// src/subscription/validation.ts
|
11166
|
-
import { z as
|
11167
|
-
var GetAvailablePlanSchema =
|
11168
|
-
type:
|
11169
|
-
currency:
|
11170
|
-
});
|
11171
|
-
var UpdateSubscriptionSchema =
|
11172
|
-
planProductId:
|
11173
|
-
planProductPriceId:
|
11174
|
-
subscriptionId:
|
11175
|
-
subscriptionProducts:
|
11176
|
-
|
11177
|
-
productId:
|
11178
|
-
productPriceId:
|
11179
|
-
quantity:
|
11233
|
+
import { z as z142 } from "zod";
|
11234
|
+
var GetAvailablePlanSchema = z142.object({
|
11235
|
+
type: z142.string(),
|
11236
|
+
currency: z142.string()
|
11237
|
+
});
|
11238
|
+
var UpdateSubscriptionSchema = z142.object({
|
11239
|
+
planProductId: z142.string(),
|
11240
|
+
planProductPriceId: z142.string(),
|
11241
|
+
subscriptionId: z142.string(),
|
11242
|
+
subscriptionProducts: z142.array(
|
11243
|
+
z142.object({
|
11244
|
+
productId: z142.string(),
|
11245
|
+
productPriceId: z142.string(),
|
11246
|
+
quantity: z142.number()
|
11180
11247
|
})
|
11181
11248
|
)
|
11182
11249
|
});
|
11183
|
-
var TopUpBalanceSchema =
|
11184
|
-
quantity:
|
11250
|
+
var TopUpBalanceSchema = z142.object({
|
11251
|
+
quantity: z142.number()
|
11185
11252
|
});
|
11186
11253
|
|
11187
11254
|
// src/subscription/index.ts
|
@@ -11205,9 +11272,9 @@ var subscriptionContract = initContract55().router(
|
|
11205
11272
|
body: UpdateSubscriptionSchema,
|
11206
11273
|
responses: {
|
11207
11274
|
200: DefaultSuccessResponseSchema.extend({
|
11208
|
-
message:
|
11209
|
-
requireCheckout:
|
11210
|
-
checkoutUrl:
|
11275
|
+
message: z143.string(),
|
11276
|
+
requireCheckout: z143.boolean(),
|
11277
|
+
checkoutUrl: z143.string().nullable()
|
11211
11278
|
}),
|
11212
11279
|
402: DefaultErrorResponseSchema,
|
11213
11280
|
500: DefaultErrorResponseSchema
|
@@ -11219,7 +11286,7 @@ var subscriptionContract = initContract55().router(
|
|
11219
11286
|
body: TopUpBalanceSchema,
|
11220
11287
|
responses: {
|
11221
11288
|
200: DefaultSuccessResponseSchema.extend({
|
11222
|
-
checkoutUrl:
|
11289
|
+
checkoutUrl: z143.string()
|
11223
11290
|
}),
|
11224
11291
|
500: DefaultErrorResponseSchema
|
11225
11292
|
}
|
@@ -11230,7 +11297,7 @@ var subscriptionContract = initContract55().router(
|
|
11230
11297
|
query: null,
|
11231
11298
|
responses: {
|
11232
11299
|
200: DefaultSuccessResponseSchema.extend({
|
11233
|
-
balance:
|
11300
|
+
balance: z143.number()
|
11234
11301
|
}),
|
11235
11302
|
500: DefaultErrorResponseSchema
|
11236
11303
|
}
|
@@ -11241,7 +11308,7 @@ var subscriptionContract = initContract55().router(
|
|
11241
11308
|
query: GetAvailablePlanSchema,
|
11242
11309
|
responses: {
|
11243
11310
|
200: DefaultSuccessResponseSchema.extend({
|
11244
|
-
data:
|
11311
|
+
data: z143.array(ProductSchema)
|
11245
11312
|
}),
|
11246
11313
|
500: DefaultErrorResponseSchema
|
11247
11314
|
}
|
@@ -11252,7 +11319,7 @@ var subscriptionContract = initContract55().router(
|
|
11252
11319
|
query: GetAvailablePlanSchema,
|
11253
11320
|
responses: {
|
11254
11321
|
200: DefaultSuccessResponseSchema.extend({
|
11255
|
-
data:
|
11322
|
+
data: z143.array(ProductSchema)
|
11256
11323
|
}),
|
11257
11324
|
500: DefaultErrorResponseSchema
|
11258
11325
|
}
|
@@ -11275,19 +11342,19 @@ var subscriptionContract = initContract55().router(
|
|
11275
11342
|
|
11276
11343
|
// src/cx-intelligence/index.ts
|
11277
11344
|
import { initContract as initContract56 } from "@ts-rest/core";
|
11278
|
-
import
|
11345
|
+
import z144 from "zod";
|
11279
11346
|
var cxIntelligenceContract = initContract56().router(
|
11280
11347
|
{
|
11281
11348
|
toggle: {
|
11282
11349
|
method: "POST",
|
11283
11350
|
path: "/toggle",
|
11284
11351
|
headers: DefaultHeaderSchema,
|
11285
|
-
body:
|
11286
|
-
enabled:
|
11352
|
+
body: z144.object({
|
11353
|
+
enabled: z144.union([z144.literal(true), z144.literal(false)])
|
11287
11354
|
}),
|
11288
11355
|
responses: {
|
11289
11356
|
200: DefaultSuccessResponseSchema.extend({
|
11290
|
-
message:
|
11357
|
+
message: z144.string()
|
11291
11358
|
}),
|
11292
11359
|
500: DefaultErrorResponseSchema
|
11293
11360
|
},
|
@@ -11297,15 +11364,15 @@ var cxIntelligenceContract = initContract56().router(
|
|
11297
11364
|
method: "POST",
|
11298
11365
|
path: "/cx-logs/:id/transcribe",
|
11299
11366
|
headers: DefaultHeaderSchema,
|
11300
|
-
pathParams:
|
11301
|
-
id:
|
11367
|
+
pathParams: z144.object({
|
11368
|
+
id: z144.string().uuid()
|
11302
11369
|
}),
|
11303
|
-
body:
|
11304
|
-
fileUrl:
|
11370
|
+
body: z144.object({
|
11371
|
+
fileUrl: z144.string()
|
11305
11372
|
}),
|
11306
11373
|
responses: {
|
11307
11374
|
200: DefaultSuccessResponseSchema.extend({
|
11308
|
-
message:
|
11375
|
+
message: z144.string()
|
11309
11376
|
}),
|
11310
11377
|
403: DefaultErrorResponseSchema,
|
11311
11378
|
404: DefaultErrorResponseSchema,
|
@@ -11325,13 +11392,13 @@ var settingCxIntelligenceContract = initContract56().router(
|
|
11325
11392
|
headers: DefaultHeaderSchema,
|
11326
11393
|
responses: {
|
11327
11394
|
200: DefaultSuccessResponseSchema.extend({
|
11328
|
-
message:
|
11329
|
-
status:
|
11395
|
+
message: z144.string(),
|
11396
|
+
status: z144.boolean()
|
11330
11397
|
}),
|
11331
|
-
422:
|
11332
|
-
requestId:
|
11333
|
-
message:
|
11334
|
-
status:
|
11398
|
+
422: z144.object({
|
11399
|
+
requestId: z144.string(),
|
11400
|
+
message: z144.string(),
|
11401
|
+
status: z144.boolean()
|
11335
11402
|
}),
|
11336
11403
|
500: DefaultErrorResponseSchema
|
11337
11404
|
},
|
@@ -11343,20 +11410,20 @@ var settingCxIntelligenceContract = initContract56().router(
|
|
11343
11410
|
|
11344
11411
|
// src/export/index.ts
|
11345
11412
|
import { initContract as initContract57 } from "@ts-rest/core";
|
11346
|
-
import
|
11413
|
+
import z145 from "zod";
|
11347
11414
|
var exportContract = initContract57().router(
|
11348
11415
|
{
|
11349
11416
|
notifyExport: {
|
11350
11417
|
method: "POST",
|
11351
11418
|
path: "notify",
|
11352
|
-
body:
|
11353
|
-
userId:
|
11354
|
-
module:
|
11355
|
-
fileUrl:
|
11419
|
+
body: z145.object({
|
11420
|
+
userId: z145.string().uuid(),
|
11421
|
+
module: z145.string(),
|
11422
|
+
fileUrl: z145.string()
|
11356
11423
|
}),
|
11357
11424
|
responses: {
|
11358
11425
|
200: DefaultSuccessResponseSchema.extend({
|
11359
|
-
success:
|
11426
|
+
success: z145.boolean()
|
11360
11427
|
}),
|
11361
11428
|
500: DefaultErrorResponseSchema
|
11362
11429
|
}
|