@kl1/contracts 1.4.63 → 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 +57 -6
- 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 +15 -3
- 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/mail/mail-contract.d.ts +3 -3
- package/dist/api-contracts/src/mail/room-contract.d.ts +3 -3
- package/dist/api-contracts/src/mail/schemas/room-validation.schema.d.ts +3 -3
- package/dist/api-contracts/src/mail/schemas/room-validation.schema.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 +654 -593
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +653 -592
- 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,
|
@@ -1273,7 +1274,7 @@ var ActionMessageSchema = z26.object({
|
|
1273
1274
|
messageId: z26.string().uuid()
|
1274
1275
|
});
|
1275
1276
|
var SendMessageSchema = z26.object({
|
1276
|
-
createdAt: z26.string().
|
1277
|
+
createdAt: z26.string().transform((str) => new Date(str)),
|
1277
1278
|
roomId: z26.string().uuid(),
|
1278
1279
|
messageType: MessageTypeSchema,
|
1279
1280
|
message: z26.string().optional(),
|
@@ -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,283 +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
|
-
|
10136
|
-
|
10137
|
-
|
10138
|
-
|
10139
|
-
|
10140
|
-
z126.literal("blank")
|
10141
|
-
]).optional().nullable(),
|
10142
|
-
assigneeId: z126.string().uuid().optional().nullable(),
|
10143
|
-
note: z126.string().optional(),
|
10144
|
-
tags: z126.array(z126.string().uuid()).optional(),
|
10145
|
-
handover: z126.boolean().or(
|
10146
|
-
z126.union([z126.literal("true"), z126.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
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")
|
10147
10208
|
).optional().nullable(),
|
10148
|
-
selfAssign:
|
10149
|
-
|
10209
|
+
selfAssign: z128.boolean().or(
|
10210
|
+
z128.union([z128.literal("true"), z128.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
10150
10211
|
).optional().nullable()
|
10151
10212
|
})
|
10152
10213
|
}
|
@@ -10160,7 +10221,7 @@ var roomContract = initContract48().router(
|
|
10160
10221
|
path: "/",
|
10161
10222
|
responses: {
|
10162
10223
|
200: DefaultSuccessResponseSchema.extend({
|
10163
|
-
message:
|
10224
|
+
message: z129.string()
|
10164
10225
|
}),
|
10165
10226
|
...DefaultResponses
|
10166
10227
|
},
|
@@ -10173,10 +10234,10 @@ var roomContract = initContract48().router(
|
|
10173
10234
|
query: RoomContractsValidationSchema.getAll.input,
|
10174
10235
|
responses: {
|
10175
10236
|
200: DefaultSuccessResponseSchema.extend({
|
10176
|
-
data:
|
10177
|
-
total:
|
10178
|
-
page:
|
10179
|
-
pageSize:
|
10237
|
+
data: z129.array(MailRoomSchema),
|
10238
|
+
total: z129.number(),
|
10239
|
+
page: z129.number(),
|
10240
|
+
pageSize: z129.number()
|
10180
10241
|
}),
|
10181
10242
|
...DefaultResponses
|
10182
10243
|
},
|
@@ -10188,24 +10249,24 @@ var roomContract = initContract48().router(
|
|
10188
10249
|
path: "/count_rooms/all",
|
10189
10250
|
responses: {
|
10190
10251
|
200: DefaultSuccessResponseSchema.extend({
|
10191
|
-
data:
|
10192
|
-
general:
|
10193
|
-
|
10194
|
-
name:
|
10195
|
-
count:
|
10196
|
-
unReadMessagesCount:
|
10252
|
+
data: z129.object({
|
10253
|
+
general: z129.array(
|
10254
|
+
z129.object({
|
10255
|
+
name: z129.string(),
|
10256
|
+
count: z129.number(),
|
10257
|
+
unReadMessagesCount: z129.number()
|
10197
10258
|
})
|
10198
10259
|
),
|
10199
|
-
channels:
|
10200
|
-
|
10260
|
+
channels: z129.array(
|
10261
|
+
z129.object({
|
10201
10262
|
channel: MailAccountSchema,
|
10202
|
-
count:
|
10263
|
+
count: z129.number()
|
10203
10264
|
})
|
10204
10265
|
),
|
10205
|
-
contactLabels:
|
10206
|
-
|
10266
|
+
contactLabels: z129.array(
|
10267
|
+
z129.object({
|
10207
10268
|
label: TagSchema,
|
10208
|
-
count:
|
10269
|
+
count: z129.number()
|
10209
10270
|
})
|
10210
10271
|
)
|
10211
10272
|
})
|
@@ -10217,12 +10278,12 @@ var roomContract = initContract48().router(
|
|
10217
10278
|
getAttachments: {
|
10218
10279
|
method: "GET",
|
10219
10280
|
path: "/:id/attachments",
|
10220
|
-
pathParams:
|
10221
|
-
id:
|
10281
|
+
pathParams: z129.object({
|
10282
|
+
id: z129.string().uuid()
|
10222
10283
|
}),
|
10223
10284
|
responses: {
|
10224
10285
|
200: DefaultSuccessResponseSchema.extend({
|
10225
|
-
data:
|
10286
|
+
data: z129.array(AttachmentSchema2)
|
10226
10287
|
}),
|
10227
10288
|
...DefaultResponses
|
10228
10289
|
},
|
@@ -10231,12 +10292,12 @@ var roomContract = initContract48().router(
|
|
10231
10292
|
getParticipants: {
|
10232
10293
|
method: "GET",
|
10233
10294
|
path: "/:id/participants",
|
10234
|
-
pathParams:
|
10235
|
-
id:
|
10295
|
+
pathParams: z129.object({
|
10296
|
+
id: z129.string().uuid()
|
10236
10297
|
}),
|
10237
10298
|
responses: {
|
10238
10299
|
200: DefaultSuccessResponseSchema.extend({
|
10239
|
-
data:
|
10300
|
+
data: z129.array(MailParticipant)
|
10240
10301
|
}),
|
10241
10302
|
...DefaultResponses
|
10242
10303
|
},
|
@@ -10247,22 +10308,22 @@ var roomContract = initContract48().router(
|
|
10247
10308
|
path: "/add_email_to_contact",
|
10248
10309
|
responses: {
|
10249
10310
|
200: DefaultSuccessResponseSchema.extend({
|
10250
|
-
data:
|
10311
|
+
data: z129.string()
|
10251
10312
|
}),
|
10252
10313
|
...DefaultResponses
|
10253
10314
|
},
|
10254
|
-
body:
|
10255
|
-
email:
|
10256
|
-
contactId:
|
10257
|
-
mailUserId:
|
10315
|
+
body: z129.object({
|
10316
|
+
email: z129.string(),
|
10317
|
+
contactId: z129.string(),
|
10318
|
+
mailUserId: z129.string()
|
10258
10319
|
}),
|
10259
10320
|
summary: "Add a new email of a mail room participant to an existing contact"
|
10260
10321
|
},
|
10261
10322
|
update: {
|
10262
10323
|
method: "PATCH",
|
10263
10324
|
path: "/:id",
|
10264
|
-
pathParams:
|
10265
|
-
id:
|
10325
|
+
pathParams: z129.object({
|
10326
|
+
id: z129.string()
|
10266
10327
|
}),
|
10267
10328
|
responses: {
|
10268
10329
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10276,12 +10337,12 @@ var roomContract = initContract48().router(
|
|
10276
10337
|
markAsRead: {
|
10277
10338
|
method: "POST",
|
10278
10339
|
path: "/mark_as_read",
|
10279
|
-
body:
|
10280
|
-
id:
|
10340
|
+
body: z129.object({
|
10341
|
+
id: z129.string()
|
10281
10342
|
}),
|
10282
10343
|
responses: {
|
10283
10344
|
200: DefaultSuccessResponseSchema.extend({
|
10284
|
-
message:
|
10345
|
+
message: z129.string()
|
10285
10346
|
}),
|
10286
10347
|
...DefaultResponses
|
10287
10348
|
},
|
@@ -10290,8 +10351,8 @@ var roomContract = initContract48().router(
|
|
10290
10351
|
getById: {
|
10291
10352
|
method: "GET",
|
10292
10353
|
path: "/:id",
|
10293
|
-
pathParams:
|
10294
|
-
id:
|
10354
|
+
pathParams: z129.object({
|
10355
|
+
id: z129.string().uuid()
|
10295
10356
|
}),
|
10296
10357
|
responses: {
|
10297
10358
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10309,90 +10370,90 @@ var roomContract = initContract48().router(
|
|
10309
10370
|
|
10310
10371
|
// src/mail/account-contract.ts
|
10311
10372
|
import { initContract as initContract49 } from "@ts-rest/core";
|
10312
|
-
import
|
10373
|
+
import z131 from "zod";
|
10313
10374
|
|
10314
10375
|
// src/mail/schemas/account-validation.schema.ts
|
10315
|
-
import
|
10376
|
+
import z130 from "zod";
|
10316
10377
|
var AccountContractsValidationSchemas = {
|
10317
10378
|
create: {
|
10318
|
-
input:
|
10319
|
-
address:
|
10320
|
-
name:
|
10321
|
-
password:
|
10322
|
-
mailServerId:
|
10323
|
-
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("")
|
10324
10385
|
})
|
10325
10386
|
},
|
10326
10387
|
createWithCustomSmtpAndImap: {
|
10327
|
-
input:
|
10328
|
-
email:
|
10329
|
-
name:
|
10330
|
-
password:
|
10331
|
-
imap:
|
10332
|
-
host:
|
10333
|
-
port:
|
10334
|
-
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)
|
10335
10396
|
//Whether to use TLS for the connection (usually true for port 993)
|
10336
10397
|
}),
|
10337
|
-
smtp:
|
10338
|
-
host:
|
10339
|
-
port:
|
10340
|
-
secure:
|
10398
|
+
smtp: z130.object({
|
10399
|
+
host: z130.string(),
|
10400
|
+
port: z130.number(),
|
10401
|
+
secure: z130.boolean().default(false)
|
10341
10402
|
//Whether to use TLS for the connection (usually true for port 993)
|
10342
10403
|
})
|
10343
10404
|
})
|
10344
10405
|
},
|
10345
10406
|
getById: {
|
10346
|
-
input:
|
10347
|
-
id:
|
10407
|
+
input: z130.object({
|
10408
|
+
id: z130.string().uuid()
|
10348
10409
|
}),
|
10349
10410
|
output: MailAccountSchema
|
10350
10411
|
},
|
10351
10412
|
getAll: {
|
10352
|
-
output:
|
10413
|
+
output: z130.array(MailAccountSchema)
|
10353
10414
|
},
|
10354
10415
|
update: {
|
10355
10416
|
input: MailAccountSchema,
|
10356
10417
|
output: MailAccountSchema
|
10357
10418
|
},
|
10358
10419
|
disconnect: {
|
10359
|
-
input:
|
10360
|
-
id:
|
10420
|
+
input: z130.object({
|
10421
|
+
id: z130.string().uuid()
|
10361
10422
|
}),
|
10362
10423
|
output: MailAccountSchema
|
10363
10424
|
},
|
10364
10425
|
reconnect: {
|
10365
|
-
input:
|
10366
|
-
id:
|
10426
|
+
input: z130.object({
|
10427
|
+
id: z130.string()
|
10367
10428
|
}),
|
10368
10429
|
output: MailAccountSchema
|
10369
10430
|
},
|
10370
10431
|
delete: {
|
10371
|
-
input:
|
10372
|
-
id:
|
10432
|
+
input: z130.object({
|
10433
|
+
id: z130.string()
|
10373
10434
|
}),
|
10374
|
-
output:
|
10435
|
+
output: z130.string()
|
10375
10436
|
},
|
10376
10437
|
deleteEmailEngineAcc: {
|
10377
|
-
input:
|
10378
|
-
account:
|
10438
|
+
input: z130.object({
|
10439
|
+
account: z130.string()
|
10379
10440
|
}),
|
10380
10441
|
output: MailAccountSchema
|
10381
10442
|
},
|
10382
10443
|
generateOAuth2AuthenticationLink: {
|
10383
|
-
body:
|
10384
|
-
oAuth2AppId:
|
10385
|
-
mailServerId:
|
10444
|
+
body: z130.object({
|
10445
|
+
oAuth2AppId: z130.string(),
|
10446
|
+
mailServerId: z130.string()
|
10386
10447
|
}),
|
10387
|
-
response:
|
10388
|
-
url:
|
10389
|
-
account:
|
10448
|
+
response: z130.object({
|
10449
|
+
url: z130.string(),
|
10450
|
+
account: z130.string()
|
10390
10451
|
})
|
10391
10452
|
},
|
10392
10453
|
createOAuth2Acc: {
|
10393
|
-
body:
|
10394
|
-
account:
|
10395
|
-
name:
|
10454
|
+
body: z130.object({
|
10455
|
+
account: z130.string(),
|
10456
|
+
name: z130.string()
|
10396
10457
|
}),
|
10397
10458
|
response: MailAccountSchema
|
10398
10459
|
}
|
@@ -10410,14 +10471,14 @@ var accountContract = initContract49().router(
|
|
10410
10471
|
// data: AccountContractsValidationSchemas.create.output,
|
10411
10472
|
data: MailAccountSchema
|
10412
10473
|
}),
|
10413
|
-
400:
|
10414
|
-
message:
|
10474
|
+
400: z131.object({
|
10475
|
+
message: z131.string()
|
10415
10476
|
}),
|
10416
|
-
409:
|
10417
|
-
message:
|
10477
|
+
409: z131.object({
|
10478
|
+
message: z131.string()
|
10418
10479
|
}),
|
10419
|
-
500:
|
10420
|
-
message:
|
10480
|
+
500: z131.object({
|
10481
|
+
message: z131.string()
|
10421
10482
|
}),
|
10422
10483
|
...DefaultResponses
|
10423
10484
|
},
|
@@ -10432,14 +10493,14 @@ var accountContract = initContract49().router(
|
|
10432
10493
|
// data: AccountContractsValidationSchemas.create.output,
|
10433
10494
|
// data: MailAccountSchema,
|
10434
10495
|
}),
|
10435
|
-
400:
|
10436
|
-
message:
|
10496
|
+
400: z131.object({
|
10497
|
+
message: z131.string()
|
10437
10498
|
}),
|
10438
|
-
409:
|
10439
|
-
message:
|
10499
|
+
409: z131.object({
|
10500
|
+
message: z131.string()
|
10440
10501
|
}),
|
10441
|
-
500:
|
10442
|
-
message:
|
10502
|
+
500: z131.object({
|
10503
|
+
message: z131.string()
|
10443
10504
|
}),
|
10444
10505
|
...DefaultResponses
|
10445
10506
|
},
|
@@ -10455,14 +10516,14 @@ var accountContract = initContract49().router(
|
|
10455
10516
|
201: DefaultSuccessResponseSchema.extend({
|
10456
10517
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
10457
10518
|
}),
|
10458
|
-
400:
|
10459
|
-
message:
|
10519
|
+
400: z131.object({
|
10520
|
+
message: z131.string()
|
10460
10521
|
}),
|
10461
|
-
409:
|
10462
|
-
message:
|
10522
|
+
409: z131.object({
|
10523
|
+
message: z131.string()
|
10463
10524
|
}),
|
10464
|
-
500:
|
10465
|
-
message:
|
10525
|
+
500: z131.object({
|
10526
|
+
message: z131.string()
|
10466
10527
|
}),
|
10467
10528
|
...DefaultResponses
|
10468
10529
|
},
|
@@ -10476,7 +10537,7 @@ var accountContract = initContract49().router(
|
|
10476
10537
|
path: "/sync",
|
10477
10538
|
responses: {
|
10478
10539
|
200: DefaultSuccessResponseSchema.extend({
|
10479
|
-
message:
|
10540
|
+
message: z131.string()
|
10480
10541
|
}),
|
10481
10542
|
...DefaultResponses
|
10482
10543
|
},
|
@@ -10501,13 +10562,13 @@ var accountContract = initContract49().router(
|
|
10501
10562
|
getAll: {
|
10502
10563
|
method: "GET",
|
10503
10564
|
path: "",
|
10504
|
-
query:
|
10505
|
-
state:
|
10506
|
-
withDeleted:
|
10565
|
+
query: z131.object({
|
10566
|
+
state: z131.union([z131.literal("connected"), z131.literal("disconnected")]).optional(),
|
10567
|
+
withDeleted: z131.boolean().default(false)
|
10507
10568
|
}).optional(),
|
10508
10569
|
responses: {
|
10509
10570
|
200: DefaultSuccessResponseSchema.extend({
|
10510
|
-
data:
|
10571
|
+
data: z131.array(MailAccountSchema)
|
10511
10572
|
}),
|
10512
10573
|
...DefaultResponses
|
10513
10574
|
},
|
@@ -10518,8 +10579,8 @@ var accountContract = initContract49().router(
|
|
10518
10579
|
update: {
|
10519
10580
|
method: "PATCH",
|
10520
10581
|
path: "/:id",
|
10521
|
-
pathParams:
|
10522
|
-
id:
|
10582
|
+
pathParams: z131.object({
|
10583
|
+
id: z131.string().uuid()
|
10523
10584
|
}),
|
10524
10585
|
responses: {
|
10525
10586
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -10568,7 +10629,7 @@ var accountContract = initContract49().router(
|
|
10568
10629
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
10569
10630
|
responses: {
|
10570
10631
|
200: DefaultSuccessResponseSchema.extend({
|
10571
|
-
message:
|
10632
|
+
message: z131.string()
|
10572
10633
|
}),
|
10573
10634
|
...DefaultResponses
|
10574
10635
|
},
|
@@ -10583,7 +10644,7 @@ var accountContract = initContract49().router(
|
|
10583
10644
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
10584
10645
|
responses: {
|
10585
10646
|
200: DefaultSuccessResponseSchema.extend({
|
10586
|
-
message:
|
10647
|
+
message: z131.string()
|
10587
10648
|
}),
|
10588
10649
|
...DefaultResponses
|
10589
10650
|
},
|
@@ -10612,20 +10673,20 @@ var accountContract = initContract49().router(
|
|
10612
10673
|
|
10613
10674
|
// src/mail/mail-server-contract.ts
|
10614
10675
|
import { initContract as initContract50 } from "@ts-rest/core";
|
10615
|
-
import
|
10676
|
+
import z133 from "zod";
|
10616
10677
|
|
10617
10678
|
// src/mail/schemas/servers-validation.schema.ts
|
10618
|
-
import
|
10619
|
-
var CreateMailServerSchema =
|
10620
|
-
name:
|
10621
|
-
smtpHost:
|
10622
|
-
smtpPort:
|
10623
|
-
smtpTlsPort:
|
10624
|
-
useTlsForSmtp:
|
10625
|
-
imapHost:
|
10626
|
-
imapPort:
|
10627
|
-
imapTlsPort:
|
10628
|
-
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()
|
10629
10690
|
});
|
10630
10691
|
|
10631
10692
|
// src/mail/mail-server-contract.ts
|
@@ -10648,11 +10709,11 @@ var serverContract = initContract50().router(
|
|
10648
10709
|
path: "/oauth2/apps",
|
10649
10710
|
responses: {
|
10650
10711
|
200: DefaultSuccessResponseSchema.extend({
|
10651
|
-
data:
|
10652
|
-
total:
|
10653
|
-
pages:
|
10654
|
-
page:
|
10655
|
-
apps:
|
10712
|
+
data: z133.object({
|
10713
|
+
total: z133.number(),
|
10714
|
+
pages: z133.number(),
|
10715
|
+
page: z133.number(),
|
10716
|
+
apps: z133.array(OAuth2AppSchema)
|
10656
10717
|
})
|
10657
10718
|
}),
|
10658
10719
|
...DefaultResponses
|
@@ -10662,8 +10723,8 @@ var serverContract = initContract50().router(
|
|
10662
10723
|
getById: {
|
10663
10724
|
method: "GET",
|
10664
10725
|
path: "/:id",
|
10665
|
-
pathParams:
|
10666
|
-
id:
|
10726
|
+
pathParams: z133.object({
|
10727
|
+
id: z133.string().uuid()
|
10667
10728
|
}),
|
10668
10729
|
responses: {
|
10669
10730
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10678,7 +10739,7 @@ var serverContract = initContract50().router(
|
|
10678
10739
|
path: "/",
|
10679
10740
|
responses: {
|
10680
10741
|
200: DefaultSuccessResponseSchema.extend({
|
10681
|
-
data:
|
10742
|
+
data: z133.array(MailServerSchema)
|
10682
10743
|
}),
|
10683
10744
|
...DefaultResponses
|
10684
10745
|
},
|
@@ -10687,8 +10748,8 @@ var serverContract = initContract50().router(
|
|
10687
10748
|
update: {
|
10688
10749
|
method: "PATCH",
|
10689
10750
|
path: "/:id",
|
10690
|
-
pathParams:
|
10691
|
-
id:
|
10751
|
+
pathParams: z133.object({
|
10752
|
+
id: z133.string().uuid()
|
10692
10753
|
}),
|
10693
10754
|
responses: {
|
10694
10755
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10702,8 +10763,8 @@ var serverContract = initContract50().router(
|
|
10702
10763
|
delete: {
|
10703
10764
|
method: "DELETE",
|
10704
10765
|
path: "/:id",
|
10705
|
-
pathParams:
|
10706
|
-
id:
|
10766
|
+
pathParams: z133.object({
|
10767
|
+
id: z133.string().uuid()
|
10707
10768
|
}),
|
10708
10769
|
responses: {
|
10709
10770
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10722,45 +10783,45 @@ var serverContract = initContract50().router(
|
|
10722
10783
|
|
10723
10784
|
// src/mail/message-contract.ts
|
10724
10785
|
import { initContract as initContract51 } from "@ts-rest/core";
|
10725
|
-
import
|
10786
|
+
import z135 from "zod";
|
10726
10787
|
|
10727
10788
|
// src/mail/schemas/message-validation.schema.ts
|
10728
|
-
import
|
10729
|
-
var MailParticipant2 =
|
10730
|
-
name:
|
10731
|
-
address:
|
10789
|
+
import z134 from "zod";
|
10790
|
+
var MailParticipant2 = z134.object({
|
10791
|
+
name: z134.string().optional(),
|
10792
|
+
address: z134.string().email()
|
10732
10793
|
});
|
10733
10794
|
var MessageContractsValidationsSchema = {
|
10734
10795
|
submit: {
|
10735
|
-
input:
|
10736
|
-
subject:
|
10737
|
-
text:
|
10738
|
-
html:
|
10796
|
+
input: z134.object({
|
10797
|
+
subject: z134.string(),
|
10798
|
+
text: z134.string(),
|
10799
|
+
html: z134.string(),
|
10739
10800
|
from: MailParticipant2,
|
10740
10801
|
to: MailParticipant2,
|
10741
|
-
cc:
|
10742
|
-
bcc:
|
10743
|
-
sendAt:
|
10744
|
-
reference:
|
10745
|
-
messageId:
|
10746
|
-
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")])
|
10747
10808
|
}).optional(),
|
10748
|
-
attachments:
|
10749
|
-
|
10750
|
-
fileType:
|
10751
|
-
fileName:
|
10752
|
-
fileKey:
|
10753
|
-
fileSize:
|
10754
|
-
bucketName:
|
10755
|
-
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()
|
10756
10817
|
})
|
10757
10818
|
).optional()
|
10758
10819
|
}),
|
10759
|
-
output:
|
10760
|
-
response:
|
10761
|
-
messageId:
|
10762
|
-
sendAt:
|
10763
|
-
queueId:
|
10820
|
+
output: z134.object({
|
10821
|
+
response: z134.string(),
|
10822
|
+
messageId: z134.string(),
|
10823
|
+
sendAt: z134.string(),
|
10824
|
+
queueId: z134.string()
|
10764
10825
|
})
|
10765
10826
|
}
|
10766
10827
|
};
|
@@ -10789,8 +10850,8 @@ var messageContract = initContract51().router(
|
|
10789
10850
|
path: "/new_message_count",
|
10790
10851
|
responses: {
|
10791
10852
|
200: DefaultSuccessResponseSchema.extend({
|
10792
|
-
data:
|
10793
|
-
count:
|
10853
|
+
data: z135.object({
|
10854
|
+
count: z135.number()
|
10794
10855
|
})
|
10795
10856
|
}),
|
10796
10857
|
...DefaultResponses
|
@@ -10802,8 +10863,8 @@ var messageContract = initContract51().router(
|
|
10802
10863
|
getById: {
|
10803
10864
|
method: "GET",
|
10804
10865
|
path: "/:id",
|
10805
|
-
pathParams:
|
10806
|
-
id:
|
10866
|
+
pathParams: z135.object({
|
10867
|
+
id: z135.string()
|
10807
10868
|
}),
|
10808
10869
|
responses: {
|
10809
10870
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10818,8 +10879,8 @@ var messageContract = initContract51().router(
|
|
10818
10879
|
update: {
|
10819
10880
|
method: "PATCH",
|
10820
10881
|
path: "/:id",
|
10821
|
-
pathParams:
|
10822
|
-
id:
|
10882
|
+
pathParams: z135.object({
|
10883
|
+
id: z135.string()
|
10823
10884
|
}),
|
10824
10885
|
responses: {
|
10825
10886
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10835,8 +10896,8 @@ var messageContract = initContract51().router(
|
|
10835
10896
|
delete: {
|
10836
10897
|
method: "DELETE",
|
10837
10898
|
path: "/:id",
|
10838
|
-
pathParams:
|
10839
|
-
id:
|
10899
|
+
pathParams: z135.object({
|
10900
|
+
id: z135.string()
|
10840
10901
|
}),
|
10841
10902
|
responses: {
|
10842
10903
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10852,13 +10913,13 @@ var messageContract = initContract51().router(
|
|
10852
10913
|
cancelScheduledMessage: {
|
10853
10914
|
method: "DELETE",
|
10854
10915
|
path: "/scheduled_message/:id",
|
10855
|
-
pathParams:
|
10856
|
-
id:
|
10916
|
+
pathParams: z135.object({
|
10917
|
+
id: z135.string()
|
10857
10918
|
}),
|
10858
10919
|
responses: {
|
10859
10920
|
200: DefaultSuccessResponseSchema.extend({
|
10860
|
-
data:
|
10861
|
-
totalMessagesCount:
|
10921
|
+
data: z135.object({
|
10922
|
+
totalMessagesCount: z135.number()
|
10862
10923
|
})
|
10863
10924
|
}),
|
10864
10925
|
...DefaultResponses
|
@@ -10883,38 +10944,38 @@ var mailContract = initContract52().router({
|
|
10883
10944
|
|
10884
10945
|
// src/webchat/index.ts
|
10885
10946
|
import { initContract as initContract53 } from "@ts-rest/core";
|
10886
|
-
import
|
10947
|
+
import z138 from "zod";
|
10887
10948
|
|
10888
10949
|
// src/webchat/schema.ts
|
10889
|
-
import
|
10950
|
+
import z137 from "zod";
|
10890
10951
|
|
10891
10952
|
// src/webchat/validation.ts
|
10892
|
-
import
|
10953
|
+
import z136 from "zod";
|
10893
10954
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
10894
10955
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
10895
10956
|
return ChatwootChannelType3;
|
10896
10957
|
})(ChatwootChannelType2 || {});
|
10897
|
-
var WebChatChannelSchema =
|
10898
|
-
avatar:
|
10899
|
-
name:
|
10900
|
-
type:
|
10901
|
-
websiteName:
|
10902
|
-
welcomeTitle:
|
10903
|
-
websiteUrl:
|
10904
|
-
welcomeTagline:
|
10905
|
-
agentAwayMessage:
|
10906
|
-
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()
|
10907
10968
|
});
|
10908
10969
|
|
10909
10970
|
// src/webchat/schema.ts
|
10910
|
-
var ConnectWebChatChannelSchema =
|
10911
|
-
name:
|
10912
|
-
actor:
|
10913
|
-
id:
|
10914
|
-
name:
|
10915
|
-
email:
|
10916
|
-
address:
|
10917
|
-
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()
|
10918
10979
|
}),
|
10919
10980
|
channel: WebChatChannelSchema
|
10920
10981
|
});
|
@@ -10948,8 +11009,8 @@ var platformWebchatContract = initContract53().router(
|
|
10948
11009
|
disconnectToService: {
|
10949
11010
|
method: "POST",
|
10950
11011
|
path: "/disconnect",
|
10951
|
-
body:
|
10952
|
-
id:
|
11012
|
+
body: z138.object({
|
11013
|
+
id: z138.string().uuid()
|
10953
11014
|
}),
|
10954
11015
|
responses: {
|
10955
11016
|
200: ChannelServiceResponseSchema,
|
@@ -10960,8 +11021,8 @@ var platformWebchatContract = initContract53().router(
|
|
10960
11021
|
reconnect: {
|
10961
11022
|
method: "POST",
|
10962
11023
|
path: "/reconnect/:channelId",
|
10963
|
-
pathParams:
|
10964
|
-
channelId:
|
11024
|
+
pathParams: z138.object({
|
11025
|
+
channelId: z138.string().uuid()
|
10965
11026
|
}),
|
10966
11027
|
body: null,
|
10967
11028
|
responses: {
|
@@ -10973,8 +11034,8 @@ var platformWebchatContract = initContract53().router(
|
|
10973
11034
|
delete: {
|
10974
11035
|
method: "DELETE",
|
10975
11036
|
path: "/delete/:channelId",
|
10976
|
-
pathParams:
|
10977
|
-
channelId:
|
11037
|
+
pathParams: z138.object({
|
11038
|
+
channelId: z138.string().uuid()
|
10978
11039
|
}),
|
10979
11040
|
body: null,
|
10980
11041
|
responses: {
|
@@ -10991,18 +11052,18 @@ var platformWebchatContract = initContract53().router(
|
|
10991
11052
|
|
10992
11053
|
// src/hold-label/index.ts
|
10993
11054
|
import { initContract as initContract54 } from "@ts-rest/core";
|
10994
|
-
import
|
11055
|
+
import z140 from "zod";
|
10995
11056
|
|
10996
11057
|
// src/hold-label/validation.ts
|
10997
|
-
import
|
10998
|
-
var UpdatePositionSchema2 =
|
10999
|
-
holdLabels:
|
11000
|
-
|
11058
|
+
import z139 from "zod";
|
11059
|
+
var UpdatePositionSchema2 = z139.object({
|
11060
|
+
holdLabels: z139.array(
|
11061
|
+
z139.object({ id: z139.string().uuid(), position: z139.number() })
|
11001
11062
|
)
|
11002
11063
|
});
|
11003
|
-
var HoldRoomSchema =
|
11004
|
-
roomId:
|
11005
|
-
holdLabelId:
|
11064
|
+
var HoldRoomSchema = z139.object({
|
11065
|
+
roomId: z139.string().uuid(),
|
11066
|
+
holdLabelId: z139.string().uuid()
|
11006
11067
|
});
|
11007
11068
|
|
11008
11069
|
// src/hold-label/index.ts
|
@@ -11010,7 +11071,7 @@ var holdLabelContract = initContract54().router({
|
|
11010
11071
|
createHoldLabel: {
|
11011
11072
|
method: "POST",
|
11012
11073
|
path: "ms/hold-label",
|
11013
|
-
body:
|
11074
|
+
body: z140.object({ name: z140.string() }),
|
11014
11075
|
responses: {
|
11015
11076
|
201: DefaultSuccessResponseSchema.extend({
|
11016
11077
|
holdLabel: HoldLabelSchema
|
@@ -11022,7 +11083,7 @@ var holdLabelContract = initContract54().router({
|
|
11022
11083
|
path: "chs/api/v1/hold-label",
|
11023
11084
|
responses: {
|
11024
11085
|
200: DefaultSuccessResponseSchema.extend({
|
11025
|
-
holdLabels:
|
11086
|
+
holdLabels: z140.array(HoldLabelSchema)
|
11026
11087
|
})
|
11027
11088
|
}
|
11028
11089
|
},
|
@@ -11040,8 +11101,8 @@ var holdLabelContract = initContract54().router({
|
|
11040
11101
|
updateHoldLabel: {
|
11041
11102
|
method: "PATCH",
|
11042
11103
|
path: "ms/hold-label/:id",
|
11043
|
-
pathParams:
|
11044
|
-
body:
|
11104
|
+
pathParams: z140.object({ id: z140.string().uuid() }),
|
11105
|
+
body: z140.object({ name: z140.string() }),
|
11045
11106
|
responses: {
|
11046
11107
|
200: DefaultSuccessResponseSchema.extend({
|
11047
11108
|
holdLabel: HoldLabelSchema
|
@@ -11051,7 +11112,7 @@ var holdLabelContract = initContract54().router({
|
|
11051
11112
|
deleteHoldLabel: {
|
11052
11113
|
method: "DELETE",
|
11053
11114
|
path: "ms/hold-label/:id",
|
11054
|
-
pathParams:
|
11115
|
+
pathParams: z140.object({ id: z140.string().uuid() }),
|
11055
11116
|
body: null,
|
11056
11117
|
responses: {
|
11057
11118
|
200: DefaultSuccessResponseSchema
|
@@ -11062,10 +11123,10 @@ var holdLabelContract = initContract54().router({
|
|
11062
11123
|
path: "ms/hold-label/auto-unhold",
|
11063
11124
|
responses: {
|
11064
11125
|
200: DefaultSuccessResponseSchema.extend({
|
11065
|
-
autoUnhold:
|
11066
|
-
resumeLabel:
|
11067
|
-
show:
|
11068
|
-
name:
|
11126
|
+
autoUnhold: z140.boolean(),
|
11127
|
+
resumeLabel: z140.object({
|
11128
|
+
show: z140.boolean(),
|
11129
|
+
name: z140.string()
|
11069
11130
|
})
|
11070
11131
|
})
|
11071
11132
|
}
|
@@ -11073,19 +11134,19 @@ var holdLabelContract = initContract54().router({
|
|
11073
11134
|
updateAutoUnhold: {
|
11074
11135
|
method: "POST",
|
11075
11136
|
path: "ms/hold-label/auto-unhold",
|
11076
|
-
body:
|
11077
|
-
autoUnhold:
|
11078
|
-
resumeLabel:
|
11079
|
-
show:
|
11080
|
-
name:
|
11137
|
+
body: z140.object({
|
11138
|
+
autoUnhold: z140.boolean().optional(),
|
11139
|
+
resumeLabel: z140.object({
|
11140
|
+
show: z140.boolean().optional(),
|
11141
|
+
name: z140.string().optional()
|
11081
11142
|
}).optional()
|
11082
11143
|
}),
|
11083
11144
|
responses: {
|
11084
11145
|
200: DefaultSuccessResponseSchema.extend({
|
11085
|
-
autoUnhold:
|
11086
|
-
resumeLabel:
|
11087
|
-
show:
|
11088
|
-
name:
|
11146
|
+
autoUnhold: z140.boolean(),
|
11147
|
+
resumeLabel: z140.object({
|
11148
|
+
show: z140.boolean(),
|
11149
|
+
name: z140.string()
|
11089
11150
|
})
|
11090
11151
|
})
|
11091
11152
|
}
|
@@ -11093,10 +11154,10 @@ var holdLabelContract = initContract54().router({
|
|
11093
11154
|
getHoldLogs: {
|
11094
11155
|
method: "GET",
|
11095
11156
|
path: "ms/hold-label/hold-logs",
|
11096
|
-
query:
|
11157
|
+
query: z140.object({ cxLogId: z140.string().uuid() }),
|
11097
11158
|
responses: {
|
11098
|
-
200:
|
11099
|
-
holdLogs:
|
11159
|
+
200: z140.object({
|
11160
|
+
holdLogs: z140.array(FormattedHoldLogSchema)
|
11100
11161
|
})
|
11101
11162
|
}
|
11102
11163
|
},
|
@@ -11113,7 +11174,7 @@ var holdLabelContract = initContract54().router({
|
|
11113
11174
|
unholdRoom: {
|
11114
11175
|
method: "POST",
|
11115
11176
|
path: "ms/hold-label/unhold-room",
|
11116
|
-
body:
|
11177
|
+
body: z140.object({ roomId: z140.string().uuid() }),
|
11117
11178
|
responses: {
|
11118
11179
|
200: DefaultSuccessResponseSchema.extend({
|
11119
11180
|
holdLog: HoldLogSchema.optional()
|
@@ -11124,89 +11185,89 @@ var holdLabelContract = initContract54().router({
|
|
11124
11185
|
|
11125
11186
|
// src/subscription/index.ts
|
11126
11187
|
import { initContract as initContract55 } from "@ts-rest/core";
|
11127
|
-
import { z as
|
11188
|
+
import { z as z143 } from "zod";
|
11128
11189
|
|
11129
11190
|
// src/subscription/schema.ts
|
11130
|
-
import
|
11191
|
+
import z141 from "zod";
|
11131
11192
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
11132
|
-
priceId:
|
11133
|
-
name:
|
11134
|
-
perUnit:
|
11135
|
-
price:
|
11136
|
-
currency:
|
11193
|
+
priceId: z141.string(),
|
11194
|
+
name: z141.string().nullable(),
|
11195
|
+
perUnit: z141.number(),
|
11196
|
+
price: z141.number(),
|
11197
|
+
currency: z141.string().nullable()
|
11137
11198
|
});
|
11138
11199
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
11139
|
-
provider:
|
11140
|
-
productId:
|
11141
|
-
name:
|
11142
|
-
type:
|
11143
|
-
omnichannel:
|
11144
|
-
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(),
|
11145
11206
|
productPrice: ProductPriceSchema
|
11146
11207
|
});
|
11147
11208
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
11148
|
-
includedQuantity:
|
11209
|
+
includedQuantity: z141.number(),
|
11149
11210
|
product: ProductWithoutRelatedSchema
|
11150
11211
|
});
|
11151
11212
|
var ProductSchema = DefaultEntitySchema.extend({
|
11152
|
-
provider:
|
11153
|
-
productId:
|
11154
|
-
name:
|
11155
|
-
type:
|
11156
|
-
omnichannel:
|
11157
|
-
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(),
|
11158
11219
|
productPrice: ProductPriceSchema,
|
11159
|
-
relatedProducts:
|
11220
|
+
relatedProducts: z141.array(RelatedProductSchema)
|
11160
11221
|
});
|
11161
11222
|
var CustomerSchema = DefaultEntitySchema.extend({
|
11162
|
-
provider:
|
11163
|
-
customerId:
|
11164
|
-
email:
|
11165
|
-
name:
|
11166
|
-
balance:
|
11223
|
+
provider: z141.string(),
|
11224
|
+
customerId: z141.string(),
|
11225
|
+
email: z141.string(),
|
11226
|
+
name: z141.string(),
|
11227
|
+
balance: z141.number()
|
11167
11228
|
});
|
11168
11229
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
11169
|
-
limit:
|
11170
|
-
subscriptionItemId:
|
11171
|
-
usage:
|
11230
|
+
limit: z141.number(),
|
11231
|
+
subscriptionItemId: z141.string(),
|
11232
|
+
usage: z141.number().nullable(),
|
11172
11233
|
product: ProductSchema
|
11173
11234
|
});
|
11174
11235
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
11175
|
-
provider:
|
11176
|
-
type:
|
11177
|
-
subscriptionId:
|
11178
|
-
interval:
|
11179
|
-
quantity:
|
11180
|
-
amount:
|
11181
|
-
startAt:
|
11182
|
-
expireAt:
|
11183
|
-
status:
|
11184
|
-
name:
|
11185
|
-
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),
|
11186
11247
|
productPrice: ProductPriceSchema,
|
11187
11248
|
product: ProductSchema
|
11188
11249
|
});
|
11189
11250
|
|
11190
11251
|
// src/subscription/validation.ts
|
11191
|
-
import { z as
|
11192
|
-
var GetAvailablePlanSchema =
|
11193
|
-
type:
|
11194
|
-
currency:
|
11195
|
-
});
|
11196
|
-
var UpdateSubscriptionSchema =
|
11197
|
-
planProductId:
|
11198
|
-
planProductPriceId:
|
11199
|
-
subscriptionId:
|
11200
|
-
subscriptionProducts:
|
11201
|
-
|
11202
|
-
productId:
|
11203
|
-
productPriceId:
|
11204
|
-
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()
|
11205
11266
|
})
|
11206
11267
|
)
|
11207
11268
|
});
|
11208
|
-
var TopUpBalanceSchema =
|
11209
|
-
quantity:
|
11269
|
+
var TopUpBalanceSchema = z142.object({
|
11270
|
+
quantity: z142.number()
|
11210
11271
|
});
|
11211
11272
|
|
11212
11273
|
// src/subscription/index.ts
|
@@ -11230,9 +11291,9 @@ var subscriptionContract = initContract55().router(
|
|
11230
11291
|
body: UpdateSubscriptionSchema,
|
11231
11292
|
responses: {
|
11232
11293
|
200: DefaultSuccessResponseSchema.extend({
|
11233
|
-
message:
|
11234
|
-
requireCheckout:
|
11235
|
-
checkoutUrl:
|
11294
|
+
message: z143.string(),
|
11295
|
+
requireCheckout: z143.boolean(),
|
11296
|
+
checkoutUrl: z143.string().nullable()
|
11236
11297
|
}),
|
11237
11298
|
402: DefaultErrorResponseSchema,
|
11238
11299
|
500: DefaultErrorResponseSchema
|
@@ -11244,7 +11305,7 @@ var subscriptionContract = initContract55().router(
|
|
11244
11305
|
body: TopUpBalanceSchema,
|
11245
11306
|
responses: {
|
11246
11307
|
200: DefaultSuccessResponseSchema.extend({
|
11247
|
-
checkoutUrl:
|
11308
|
+
checkoutUrl: z143.string()
|
11248
11309
|
}),
|
11249
11310
|
500: DefaultErrorResponseSchema
|
11250
11311
|
}
|
@@ -11255,7 +11316,7 @@ var subscriptionContract = initContract55().router(
|
|
11255
11316
|
query: null,
|
11256
11317
|
responses: {
|
11257
11318
|
200: DefaultSuccessResponseSchema.extend({
|
11258
|
-
balance:
|
11319
|
+
balance: z143.number()
|
11259
11320
|
}),
|
11260
11321
|
500: DefaultErrorResponseSchema
|
11261
11322
|
}
|
@@ -11266,7 +11327,7 @@ var subscriptionContract = initContract55().router(
|
|
11266
11327
|
query: GetAvailablePlanSchema,
|
11267
11328
|
responses: {
|
11268
11329
|
200: DefaultSuccessResponseSchema.extend({
|
11269
|
-
data:
|
11330
|
+
data: z143.array(ProductSchema)
|
11270
11331
|
}),
|
11271
11332
|
500: DefaultErrorResponseSchema
|
11272
11333
|
}
|
@@ -11277,7 +11338,7 @@ var subscriptionContract = initContract55().router(
|
|
11277
11338
|
query: GetAvailablePlanSchema,
|
11278
11339
|
responses: {
|
11279
11340
|
200: DefaultSuccessResponseSchema.extend({
|
11280
|
-
data:
|
11341
|
+
data: z143.array(ProductSchema)
|
11281
11342
|
}),
|
11282
11343
|
500: DefaultErrorResponseSchema
|
11283
11344
|
}
|
@@ -11300,19 +11361,19 @@ var subscriptionContract = initContract55().router(
|
|
11300
11361
|
|
11301
11362
|
// src/cx-intelligence/index.ts
|
11302
11363
|
import { initContract as initContract56 } from "@ts-rest/core";
|
11303
|
-
import
|
11364
|
+
import z144 from "zod";
|
11304
11365
|
var cxIntelligenceContract = initContract56().router(
|
11305
11366
|
{
|
11306
11367
|
toggle: {
|
11307
11368
|
method: "POST",
|
11308
11369
|
path: "/toggle",
|
11309
11370
|
headers: DefaultHeaderSchema,
|
11310
|
-
body:
|
11311
|
-
enabled:
|
11371
|
+
body: z144.object({
|
11372
|
+
enabled: z144.union([z144.literal(true), z144.literal(false)])
|
11312
11373
|
}),
|
11313
11374
|
responses: {
|
11314
11375
|
200: DefaultSuccessResponseSchema.extend({
|
11315
|
-
message:
|
11376
|
+
message: z144.string()
|
11316
11377
|
}),
|
11317
11378
|
500: DefaultErrorResponseSchema
|
11318
11379
|
},
|
@@ -11322,15 +11383,15 @@ var cxIntelligenceContract = initContract56().router(
|
|
11322
11383
|
method: "POST",
|
11323
11384
|
path: "/cx-logs/:id/transcribe",
|
11324
11385
|
headers: DefaultHeaderSchema,
|
11325
|
-
pathParams:
|
11326
|
-
id:
|
11386
|
+
pathParams: z144.object({
|
11387
|
+
id: z144.string().uuid()
|
11327
11388
|
}),
|
11328
|
-
body:
|
11329
|
-
fileUrl:
|
11389
|
+
body: z144.object({
|
11390
|
+
fileUrl: z144.string()
|
11330
11391
|
}),
|
11331
11392
|
responses: {
|
11332
11393
|
200: DefaultSuccessResponseSchema.extend({
|
11333
|
-
message:
|
11394
|
+
message: z144.string()
|
11334
11395
|
}),
|
11335
11396
|
403: DefaultErrorResponseSchema,
|
11336
11397
|
404: DefaultErrorResponseSchema,
|
@@ -11350,13 +11411,13 @@ var settingCxIntelligenceContract = initContract56().router(
|
|
11350
11411
|
headers: DefaultHeaderSchema,
|
11351
11412
|
responses: {
|
11352
11413
|
200: DefaultSuccessResponseSchema.extend({
|
11353
|
-
message:
|
11354
|
-
status:
|
11414
|
+
message: z144.string(),
|
11415
|
+
status: z144.boolean()
|
11355
11416
|
}),
|
11356
|
-
422:
|
11357
|
-
requestId:
|
11358
|
-
message:
|
11359
|
-
status:
|
11417
|
+
422: z144.object({
|
11418
|
+
requestId: z144.string(),
|
11419
|
+
message: z144.string(),
|
11420
|
+
status: z144.boolean()
|
11360
11421
|
}),
|
11361
11422
|
500: DefaultErrorResponseSchema
|
11362
11423
|
},
|
@@ -11368,20 +11429,20 @@ var settingCxIntelligenceContract = initContract56().router(
|
|
11368
11429
|
|
11369
11430
|
// src/export/index.ts
|
11370
11431
|
import { initContract as initContract57 } from "@ts-rest/core";
|
11371
|
-
import
|
11432
|
+
import z145 from "zod";
|
11372
11433
|
var exportContract = initContract57().router(
|
11373
11434
|
{
|
11374
11435
|
notifyExport: {
|
11375
11436
|
method: "POST",
|
11376
11437
|
path: "notify",
|
11377
|
-
body:
|
11378
|
-
userId:
|
11379
|
-
module:
|
11380
|
-
fileUrl:
|
11438
|
+
body: z145.object({
|
11439
|
+
userId: z145.string().uuid(),
|
11440
|
+
module: z145.string(),
|
11441
|
+
fileUrl: z145.string()
|
11381
11442
|
}),
|
11382
11443
|
responses: {
|
11383
11444
|
200: DefaultSuccessResponseSchema.extend({
|
11384
|
-
success:
|
11445
|
+
success: z145.boolean()
|
11385
11446
|
}),
|
11386
11447
|
500: DefaultErrorResponseSchema
|
11387
11448
|
}
|