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