@kl1/contracts 1.4.72 → 1.4.74
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/channel/index.d.ts +9 -4
- package/dist/api-contracts/src/channel/index.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/index.d.ts +6 -0
- package/dist/api-contracts/src/chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/validation.d.ts +13 -0
- package/dist/api-contracts/src/chat/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/company/index.d.ts +80 -0
- package/dist/api-contracts/src/company/index.d.ts.map +1 -1
- package/dist/api-contracts/src/company/validation.d.ts +40 -0
- package/dist/api-contracts/src/company/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +63 -8
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/facebook-feed/index.d.ts +5 -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 +5 -0
- package/dist/api-contracts/src/instagram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/klink-chat/index.d.ts +5 -0
- package/dist/api-contracts/src/klink-chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/line/index.d.ts +5 -0
- package/dist/api-contracts/src/line/index.d.ts.map +1 -1
- package/dist/api-contracts/src/messenger/index.d.ts +5 -0
- package/dist/api-contracts/src/messenger/index.d.ts.map +1 -1
- package/dist/api-contracts/src/sms/index.d.ts +5 -0
- package/dist/api-contracts/src/sms/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telegram/index.d.ts +5 -0
- package/dist/api-contracts/src/telegram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/viber/index.d.ts +5 -0
- package/dist/api-contracts/src/viber/index.d.ts.map +1 -1
- package/dist/api-contracts/src/webchat/index.d.ts +5 -0
- package/dist/api-contracts/src/webchat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/whatsapp/index.d.ts +14 -4
- package/dist/api-contracts/src/whatsapp/index.d.ts.map +1 -1
- package/dist/api-contracts/src/whatsapp/validation.d.ts +12 -4
- package/dist/api-contracts/src/whatsapp/validation.d.ts.map +1 -1
- package/dist/entities/src/enums/chat.d.ts +1 -0
- package/dist/entities/src/enums/chat.d.ts.map +1 -1
- package/dist/index.js +676 -590
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +675 -589
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
@@ -1287,6 +1287,7 @@ var SendMessageSchema = z26.object({
|
|
1287
1287
|
z26.literal("account_update"),
|
1288
1288
|
z26.literal("confirmed_event_update")
|
1289
1289
|
]).optional(),
|
1290
|
+
whatsappTemplateName: z26.string().optional(),
|
1290
1291
|
parentMessageId: z26.string().uuid().optional(),
|
1291
1292
|
feedPostId: z26.string().uuid().optional(),
|
1292
1293
|
platformId: z26.string().optional(),
|
@@ -1462,6 +1463,7 @@ var SendMessageToPlatformSchema = z26.object({
|
|
1462
1463
|
z26.literal("account_update"),
|
1463
1464
|
z26.literal("confirmed_event_update")
|
1464
1465
|
]).optional(),
|
1466
|
+
whatsappTemplateName: z26.string().optional(),
|
1465
1467
|
telegramBusinessConnectionId: z26.string().nullable().optional(),
|
1466
1468
|
isBotRoom: z26.boolean().nullable().default(false)
|
1467
1469
|
}),
|
@@ -2338,6 +2340,7 @@ var FacebookBusinessSchema = z39.object({
|
|
2338
2340
|
// src/whatsapp/validation.ts
|
2339
2341
|
import z40 from "zod";
|
2340
2342
|
var TemplatesSchema = z40.object({
|
2343
|
+
id: z40.string(),
|
2341
2344
|
category: z40.union([
|
2342
2345
|
z40.literal("UTILITY"),
|
2343
2346
|
z40.literal("MARKETING"),
|
@@ -2357,7 +2360,7 @@ var WaapiQrSchema = z40.object({
|
|
2357
2360
|
qr: z40.string()
|
2358
2361
|
});
|
2359
2362
|
var TemplatesResponseSchema = DefaultSuccessResponseSchema.extend({
|
2360
|
-
data: TemplatesSchema
|
2363
|
+
data: z40.array(TemplatesSchema)
|
2361
2364
|
});
|
2362
2365
|
var GetTemplatesQuerySchema = z40.object({
|
2363
2366
|
channelId: z40.string()
|
@@ -3490,10 +3493,26 @@ var BaseSchema = z48.object({
|
|
3490
3493
|
var CompanyContractsValidationSchema = {
|
3491
3494
|
create: {
|
3492
3495
|
request: z48.object({
|
3493
|
-
name: z48.object({
|
3494
|
-
|
3495
|
-
|
3496
|
-
|
3496
|
+
name: z48.object({
|
3497
|
+
value: z48.string(),
|
3498
|
+
isRequired: z48.boolean(),
|
3499
|
+
attributeId: z48.string()
|
3500
|
+
}),
|
3501
|
+
phone: z48.object({
|
3502
|
+
value: z48.string(),
|
3503
|
+
isRequired: z48.boolean(),
|
3504
|
+
attributeId: z48.string()
|
3505
|
+
}),
|
3506
|
+
address: z48.object({
|
3507
|
+
value: z48.string(),
|
3508
|
+
isRequired: z48.boolean(),
|
3509
|
+
attributeId: z48.string()
|
3510
|
+
}),
|
3511
|
+
industry: z48.object({
|
3512
|
+
value: z48.string(),
|
3513
|
+
isRequired: z48.boolean(),
|
3514
|
+
attributeId: z48.string()
|
3515
|
+
}),
|
3497
3516
|
customFields: z48.array(
|
3498
3517
|
BaseSchema.extend({
|
3499
3518
|
value: z48.union([z48.string(), z48.array(z48.string())]),
|
@@ -9670,7 +9689,35 @@ var platformKlinkChatContract = initContract45().router({
|
|
9670
9689
|
|
9671
9690
|
// src/general-setting/index.ts
|
9672
9691
|
import { initContract as initContract46 } from "@ts-rest/core";
|
9673
|
-
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
|
+
).nullable(),
|
9703
|
+
aiTranslationInstructions: z119.string().nullable(),
|
9704
|
+
displayAiTranslationNotice: z119.string().nullable()
|
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
|
9674
9721
|
var generalSettingContract = initContract46().router(
|
9675
9722
|
{
|
9676
9723
|
autoOpenedContactWidgetId: {
|
@@ -9678,23 +9725,62 @@ var generalSettingContract = initContract46().router(
|
|
9678
9725
|
method: "GET",
|
9679
9726
|
path: "/auto-opened-contact-widget-id",
|
9680
9727
|
responses: {
|
9681
|
-
200:
|
9682
|
-
autoOpenedContactWidgetId:
|
9728
|
+
200: z121.object({
|
9729
|
+
autoOpenedContactWidgetId: z121.string().nullable()
|
9683
9730
|
})
|
9684
9731
|
}
|
9685
9732
|
},
|
9686
9733
|
updateAutoOpenedContactWidgetId: {
|
9687
9734
|
method: "PATCH",
|
9688
9735
|
path: "/auto-opened-contact-widget-id",
|
9689
|
-
body:
|
9690
|
-
autoOpenedContactWidgetId:
|
9736
|
+
body: z121.object({
|
9737
|
+
autoOpenedContactWidgetId: z121.string().nullable()
|
9691
9738
|
}),
|
9692
9739
|
responses: {
|
9693
|
-
200:
|
9694
|
-
autoOpenedContactWidgetId:
|
9740
|
+
200: z121.object({
|
9741
|
+
autoOpenedContactWidgetId: z121.string().nullable()
|
9695
9742
|
})
|
9696
9743
|
}
|
9697
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
|
+
}
|
9698
9784
|
}
|
9699
9785
|
},
|
9700
9786
|
{
|
@@ -9704,51 +9790,51 @@ var generalSettingContract = initContract46().router(
|
|
9704
9790
|
|
9705
9791
|
// src/automation-queue/index.ts
|
9706
9792
|
import { initContract as initContract47 } from "@ts-rest/core";
|
9707
|
-
import { z as
|
9793
|
+
import { z as z124 } from "zod";
|
9708
9794
|
|
9709
9795
|
// src/automation-queue/validation.ts
|
9710
|
-
import { z as
|
9711
|
-
var QueueDistributionStrategySchema =
|
9712
|
-
|
9713
|
-
|
9714
|
-
|
9715
|
-
|
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")
|
9716
9802
|
]);
|
9717
|
-
var CreateAutomationQueueSchema =
|
9718
|
-
emoji:
|
9719
|
-
name:
|
9720
|
-
description:
|
9721
|
-
managerIds:
|
9722
|
-
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),
|
9723
9809
|
distributionStrategy: QueueDistributionStrategySchema.nullable(),
|
9724
|
-
maximumAssignPerAgent:
|
9725
|
-
autoAssign:
|
9810
|
+
maximumAssignPerAgent: z122.number().positive().nullable(),
|
9811
|
+
autoAssign: z122.boolean().nullable()
|
9726
9812
|
// ringTimeOut: z.number().positive(),
|
9727
9813
|
// retryInterval: z.number().positive(),
|
9728
9814
|
// queueTimeOut: z.number().positive(),
|
9729
9815
|
// isAssignmentDeniable: z.coerce.boolean(),
|
9730
9816
|
});
|
9731
9817
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
9732
|
-
var CheckHasAssignedRoomSchema =
|
9733
|
-
userId:
|
9734
|
-
queueId:
|
9818
|
+
var CheckHasAssignedRoomSchema = z122.object({
|
9819
|
+
userId: z122.string().uuid().optional(),
|
9820
|
+
queueId: z122.string().uuid().optional()
|
9735
9821
|
});
|
9736
9822
|
|
9737
9823
|
// src/automation-queue/schema.ts
|
9738
|
-
import { z as
|
9824
|
+
import { z as z123 } from "zod";
|
9739
9825
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
9740
|
-
emoji:
|
9741
|
-
name:
|
9742
|
-
description:
|
9826
|
+
emoji: z123.string(),
|
9827
|
+
name: z123.string(),
|
9828
|
+
description: z123.string().nullable(),
|
9743
9829
|
distributionStrategy: QueueDistributionStrategySchema,
|
9744
|
-
maximumAssignPerAgent:
|
9830
|
+
maximumAssignPerAgent: z123.number().positive(),
|
9745
9831
|
// ringTimeOut: z.number(),
|
9746
9832
|
// retryInterval: z.number(),
|
9747
9833
|
// queueTimeOut: z.number(),
|
9748
9834
|
// isAssignmentDeniable: z.boolean(),
|
9749
|
-
autoAssign:
|
9750
|
-
managers:
|
9751
|
-
agents:
|
9835
|
+
autoAssign: z123.boolean(),
|
9836
|
+
managers: z123.array(UserSchema),
|
9837
|
+
agents: z123.array(UserSchema)
|
9752
9838
|
});
|
9753
9839
|
|
9754
9840
|
// src/automation-queue/index.ts
|
@@ -9767,8 +9853,8 @@ var automationQueueContract = initContract47().router(
|
|
9767
9853
|
duplicateAutomationQueue: {
|
9768
9854
|
method: "POST",
|
9769
9855
|
path: "/:id/duplicate",
|
9770
|
-
pathParams:
|
9771
|
-
id:
|
9856
|
+
pathParams: z124.object({
|
9857
|
+
id: z124.string().uuid()
|
9772
9858
|
}),
|
9773
9859
|
body: null,
|
9774
9860
|
responses: {
|
@@ -9780,21 +9866,21 @@ var automationQueueContract = initContract47().router(
|
|
9780
9866
|
getAutomationQueues: {
|
9781
9867
|
method: "GET",
|
9782
9868
|
path: "",
|
9783
|
-
query:
|
9784
|
-
userId:
|
9785
|
-
withRelations:
|
9869
|
+
query: z124.object({
|
9870
|
+
userId: z124.string().uuid().optional(),
|
9871
|
+
withRelations: z124.coerce.boolean().default(true).optional()
|
9786
9872
|
}).optional(),
|
9787
9873
|
responses: {
|
9788
9874
|
200: DefaultSuccessResponseSchema.extend({
|
9789
|
-
data:
|
9875
|
+
data: z124.array(AutomationQueueSchema)
|
9790
9876
|
})
|
9791
9877
|
}
|
9792
9878
|
},
|
9793
9879
|
getAutomationQueueById: {
|
9794
9880
|
method: "GET",
|
9795
9881
|
path: "/:id",
|
9796
|
-
pathParams:
|
9797
|
-
id:
|
9882
|
+
pathParams: z124.object({
|
9883
|
+
id: z124.string().uuid()
|
9798
9884
|
}),
|
9799
9885
|
responses: {
|
9800
9886
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9805,8 +9891,8 @@ var automationQueueContract = initContract47().router(
|
|
9805
9891
|
updateAutomationQueue: {
|
9806
9892
|
method: "PATCH",
|
9807
9893
|
path: "/:id",
|
9808
|
-
pathParams:
|
9809
|
-
id:
|
9894
|
+
pathParams: z124.object({
|
9895
|
+
id: z124.string().uuid()
|
9810
9896
|
}),
|
9811
9897
|
body: UpdateAutomationQueueSchema,
|
9812
9898
|
responses: {
|
@@ -9818,13 +9904,13 @@ var automationQueueContract = initContract47().router(
|
|
9818
9904
|
deleteAutomationQueue: {
|
9819
9905
|
method: "DELETE",
|
9820
9906
|
path: "/:id",
|
9821
|
-
pathParams:
|
9822
|
-
id:
|
9907
|
+
pathParams: z124.object({
|
9908
|
+
id: z124.string().uuid()
|
9823
9909
|
}),
|
9824
9910
|
body: null,
|
9825
9911
|
responses: {
|
9826
9912
|
200: DefaultSuccessResponseSchema.extend({
|
9827
|
-
message:
|
9913
|
+
message: z124.string()
|
9828
9914
|
})
|
9829
9915
|
}
|
9830
9916
|
},
|
@@ -9834,8 +9920,8 @@ var automationQueueContract = initContract47().router(
|
|
9834
9920
|
body: CheckHasAssignedRoomSchema,
|
9835
9921
|
responses: {
|
9836
9922
|
200: DefaultSuccessResponseSchema.extend({
|
9837
|
-
data:
|
9838
|
-
hasAssignedRoom:
|
9923
|
+
data: z124.object({
|
9924
|
+
hasAssignedRoom: z124.boolean()
|
9839
9925
|
})
|
9840
9926
|
})
|
9841
9927
|
}
|
@@ -9852,276 +9938,276 @@ import { initContract as initContract52 } from "@ts-rest/core";
|
|
9852
9938
|
|
9853
9939
|
// src/mail/room-contract.ts
|
9854
9940
|
import { initContract as initContract48 } from "@ts-rest/core";
|
9855
|
-
import
|
9941
|
+
import z129 from "zod";
|
9856
9942
|
|
9857
9943
|
// src/mail/schemas/room.schema.ts
|
9858
|
-
import
|
9944
|
+
import z127 from "zod";
|
9859
9945
|
|
9860
9946
|
// src/mail/schemas/account.schema.ts
|
9861
|
-
import
|
9862
|
-
var MailServerSchema =
|
9863
|
-
id:
|
9864
|
-
createdAt:
|
9865
|
-
updatedAt:
|
9866
|
-
deletedAt:
|
9867
|
-
name:
|
9868
|
-
smtpHost:
|
9869
|
-
smtpPort:
|
9870
|
-
smtpTlsPort:
|
9871
|
-
useTlsForSmtp:
|
9872
|
-
imapHost:
|
9873
|
-
imapPort:
|
9874
|
-
imapTlsPort:
|
9875
|
-
useTlsForImap:
|
9876
|
-
});
|
9877
|
-
var MailAccountSchema =
|
9878
|
-
id:
|
9879
|
-
name:
|
9880
|
-
address:
|
9881
|
-
signature:
|
9882
|
-
accountId:
|
9883
|
-
mailServerId:
|
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(),
|
9884
9970
|
mailServer: MailServerSchema,
|
9885
|
-
state:
|
9886
|
-
|
9887
|
-
|
9888
|
-
|
9889
|
-
|
9890
|
-
|
9891
|
-
|
9892
|
-
|
9893
|
-
|
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")
|
9894
9980
|
]),
|
9895
|
-
createdAt:
|
9896
|
-
updatedAt:
|
9897
|
-
deletedAt:
|
9981
|
+
createdAt: z125.date(),
|
9982
|
+
updatedAt: z125.date(),
|
9983
|
+
deletedAt: z125.date().nullable()
|
9898
9984
|
});
|
9899
|
-
var OAuth2AppSchema =
|
9900
|
-
id:
|
9901
|
-
name:
|
9902
|
-
description:
|
9903
|
-
title:
|
9904
|
-
provider:
|
9905
|
-
enabled:
|
9906
|
-
legacy:
|
9907
|
-
created:
|
9908
|
-
updated:
|
9909
|
-
includeInListing:
|
9910
|
-
clientId:
|
9911
|
-
clientSecret:
|
9912
|
-
authority:
|
9913
|
-
redirectUrl:
|
9914
|
-
serviceClient:
|
9915
|
-
googleProjectId:
|
9916
|
-
serviceClientEmail:
|
9917
|
-
serviceKey:
|
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()
|
9918
10004
|
});
|
9919
10005
|
|
9920
10006
|
// src/mail/schemas/message.schema.ts
|
9921
|
-
import
|
9922
|
-
var AttachmentSchema =
|
9923
|
-
id:
|
9924
|
-
createdAt:
|
9925
|
-
updatedAt:
|
9926
|
-
deletedAt:
|
9927
|
-
roomId:
|
9928
|
-
messageId:
|
9929
|
-
fileName:
|
9930
|
-
fileType:
|
9931
|
-
emailEngineAttachmentId:
|
9932
|
-
uploadId:
|
9933
|
-
upload:
|
9934
|
-
id:
|
9935
|
-
createdAt:
|
9936
|
-
updatedAt:
|
9937
|
-
deletedAt:
|
9938
|
-
bucketName:
|
9939
|
-
fileName:
|
9940
|
-
fileKey:
|
9941
|
-
fileSize:
|
9942
|
-
fileUrl:
|
9943
|
-
extensionName:
|
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()
|
9944
10030
|
})
|
9945
10031
|
});
|
9946
|
-
var MessageSchema2 =
|
9947
|
-
id:
|
9948
|
-
createdAt:
|
9949
|
-
updatedAt:
|
9950
|
-
deletedAt:
|
9951
|
-
roomId:
|
9952
|
-
subject:
|
9953
|
-
textPlain:
|
9954
|
-
textHtml:
|
9955
|
-
textId:
|
9956
|
-
emailEngineEmailId:
|
9957
|
-
emailEngineMessageId:
|
9958
|
-
emailEngineReplyTo:
|
9959
|
-
direction:
|
9960
|
-
date:
|
9961
|
-
action:
|
9962
|
-
unseen:
|
9963
|
-
sendAt:
|
9964
|
-
starred:
|
9965
|
-
seemsLikeNew:
|
9966
|
-
from:
|
9967
|
-
to:
|
9968
|
-
cc:
|
9969
|
-
bcc:
|
9970
|
-
attachments:
|
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)
|
9971
10057
|
});
|
9972
10058
|
|
9973
10059
|
// src/mail/schemas/room.schema.ts
|
9974
|
-
var ContactSchema3 =
|
9975
|
-
id:
|
9976
|
-
createdAt:
|
9977
|
-
updatedAt:
|
9978
|
-
deletedAt:
|
9979
|
-
name:
|
9980
|
-
address:
|
9981
|
-
channel:
|
9982
|
-
notes:
|
9983
|
-
contactProfile:
|
9984
|
-
socialProfileUrl:
|
9985
|
-
});
|
9986
|
-
var MailUserSchema =
|
9987
|
-
id:
|
9988
|
-
createdAt:
|
9989
|
-
updatedAt:
|
9990
|
-
deletedAt:
|
9991
|
-
name:
|
9992
|
-
address:
|
9993
|
-
contactId:
|
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(),
|
9994
10080
|
contact: ContactSchema3,
|
9995
|
-
isNewContact:
|
9996
|
-
});
|
9997
|
-
var MailParticipant =
|
9998
|
-
id:
|
9999
|
-
createdAt:
|
10000
|
-
updatedAt:
|
10001
|
-
deletedAt:
|
10002
|
-
roomId:
|
10003
|
-
messageId:
|
10004
|
-
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(),
|
10005
10091
|
mailUser: MailUserSchema
|
10006
10092
|
});
|
10007
|
-
var TagSchema2 =
|
10008
|
-
color:
|
10009
|
-
id:
|
10010
|
-
createdAt:
|
10011
|
-
updatedAt:
|
10012
|
-
deletedAt:
|
10013
|
-
name:
|
10014
|
-
});
|
10015
|
-
var UserModel =
|
10016
|
-
id:
|
10017
|
-
createdAt:
|
10018
|
-
updatedAt:
|
10019
|
-
deletedAt:
|
10020
|
-
name:
|
10021
|
-
email:
|
10022
|
-
address:
|
10023
|
-
phone:
|
10024
|
-
notificationCount:
|
10025
|
-
});
|
10026
|
-
var ActivityLogModel =
|
10027
|
-
id:
|
10028
|
-
createdAt:
|
10029
|
-
updatedAt:
|
10030
|
-
deletedAt:
|
10031
|
-
description:
|
10032
|
-
actorId:
|
10033
|
-
roomId:
|
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(),
|
10034
10120
|
actor: UserModel
|
10035
10121
|
});
|
10036
|
-
var MessagesAndLogsSchema =
|
10037
|
-
|
10122
|
+
var MessagesAndLogsSchema = z127.array(
|
10123
|
+
z127.union([MessageSchema2, ActivityLogModel])
|
10038
10124
|
);
|
10039
|
-
var MailRoomSchema =
|
10040
|
-
id:
|
10041
|
-
createdAt:
|
10042
|
-
updatedAt:
|
10043
|
-
deletedAt:
|
10044
|
-
subject:
|
10045
|
-
resolved:
|
10046
|
-
assigneeId:
|
10047
|
-
note:
|
10048
|
-
mailId:
|
10049
|
-
direction:
|
10050
|
-
lastMessageId:
|
10051
|
-
firstMessageId:
|
10052
|
-
from:
|
10053
|
-
to:
|
10054
|
-
cc:
|
10055
|
-
bcc:
|
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),
|
10056
10142
|
firstMessage: MessageSchema2,
|
10057
10143
|
lastMessage: MessageSchema2,
|
10058
|
-
tags:
|
10144
|
+
tags: z127.array(TagSchema2),
|
10059
10145
|
assignee: UserModel,
|
10060
|
-
messages:
|
10146
|
+
messages: z127.array(MessageSchema2),
|
10061
10147
|
messagesAndLogs: MessagesAndLogsSchema,
|
10062
10148
|
mail: MailAccountSchema,
|
10063
|
-
unReadMessageCount:
|
10149
|
+
unReadMessageCount: z127.number(),
|
10064
10150
|
cxlog: CxLogSchema
|
10065
10151
|
});
|
10066
|
-
var AttachmentSchema2 =
|
10067
|
-
fileName:
|
10068
|
-
fileType:
|
10069
|
-
emailEngineAttachmentId:
|
10070
|
-
uploadId:
|
10071
|
-
messageId:
|
10072
|
-
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(),
|
10073
10159
|
upload: UploadSchema
|
10074
10160
|
});
|
10075
10161
|
|
10076
10162
|
// src/mail/schemas/room-validation.schema.ts
|
10077
|
-
import
|
10163
|
+
import z128 from "zod";
|
10078
10164
|
var RoomContractsValidationSchema = {
|
10079
10165
|
getAll: {
|
10080
|
-
input:
|
10081
|
-
page:
|
10082
|
-
pageSize:
|
10083
|
-
keyword:
|
10084
|
-
value:
|
10085
|
-
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")])
|
10086
10172
|
}).optional(),
|
10087
|
-
contactLabels:
|
10088
|
-
channels:
|
10089
|
-
date:
|
10090
|
-
contacts:
|
10091
|
-
assignees:
|
10092
|
-
level1:
|
10093
|
-
|
10094
|
-
|
10095
|
-
|
10096
|
-
|
10097
|
-
|
10098
|
-
|
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")
|
10099
10185
|
]).optional(),
|
10100
|
-
level2:
|
10101
|
-
|
10102
|
-
|
10103
|
-
|
10104
|
-
|
10186
|
+
level2: z128.union([
|
10187
|
+
z128.literal("all"),
|
10188
|
+
z128.literal("unassign"),
|
10189
|
+
z128.literal("mine"),
|
10190
|
+
z128.literal("other")
|
10105
10191
|
]).optional()
|
10106
10192
|
}),
|
10107
|
-
output:
|
10108
|
-
data:
|
10109
|
-
total:
|
10110
|
-
page:
|
10111
|
-
pageSize:
|
10193
|
+
output: z128.object({
|
10194
|
+
data: z128.array(MailRoomSchema),
|
10195
|
+
total: z128.number(),
|
10196
|
+
page: z128.number(),
|
10197
|
+
pageSize: z128.number()
|
10112
10198
|
})
|
10113
10199
|
},
|
10114
10200
|
update: {
|
10115
|
-
input:
|
10116
|
-
disposition:
|
10117
|
-
assigneeId:
|
10118
|
-
note:
|
10119
|
-
tags:
|
10120
|
-
handover:
|
10121
|
-
|
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")
|
10122
10208
|
).optional().nullable(),
|
10123
|
-
selfAssign:
|
10124
|
-
|
10209
|
+
selfAssign: z128.boolean().or(
|
10210
|
+
z128.union([z128.literal("true"), z128.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
10125
10211
|
).optional().nullable()
|
10126
10212
|
})
|
10127
10213
|
}
|
@@ -10135,7 +10221,7 @@ var roomContract = initContract48().router(
|
|
10135
10221
|
path: "/",
|
10136
10222
|
responses: {
|
10137
10223
|
200: DefaultSuccessResponseSchema.extend({
|
10138
|
-
message:
|
10224
|
+
message: z129.string()
|
10139
10225
|
}),
|
10140
10226
|
...DefaultResponses
|
10141
10227
|
},
|
@@ -10148,10 +10234,10 @@ var roomContract = initContract48().router(
|
|
10148
10234
|
query: RoomContractsValidationSchema.getAll.input,
|
10149
10235
|
responses: {
|
10150
10236
|
200: DefaultSuccessResponseSchema.extend({
|
10151
|
-
data:
|
10152
|
-
total:
|
10153
|
-
page:
|
10154
|
-
pageSize:
|
10237
|
+
data: z129.array(MailRoomSchema),
|
10238
|
+
total: z129.number(),
|
10239
|
+
page: z129.number(),
|
10240
|
+
pageSize: z129.number()
|
10155
10241
|
}),
|
10156
10242
|
...DefaultResponses
|
10157
10243
|
},
|
@@ -10163,24 +10249,24 @@ var roomContract = initContract48().router(
|
|
10163
10249
|
path: "/count_rooms/all",
|
10164
10250
|
responses: {
|
10165
10251
|
200: DefaultSuccessResponseSchema.extend({
|
10166
|
-
data:
|
10167
|
-
general:
|
10168
|
-
|
10169
|
-
name:
|
10170
|
-
count:
|
10171
|
-
unReadMessagesCount:
|
10252
|
+
data: z129.object({
|
10253
|
+
general: z129.array(
|
10254
|
+
z129.object({
|
10255
|
+
name: z129.string(),
|
10256
|
+
count: z129.number(),
|
10257
|
+
unReadMessagesCount: z129.number()
|
10172
10258
|
})
|
10173
10259
|
),
|
10174
|
-
channels:
|
10175
|
-
|
10260
|
+
channels: z129.array(
|
10261
|
+
z129.object({
|
10176
10262
|
channel: MailAccountSchema,
|
10177
|
-
count:
|
10263
|
+
count: z129.number()
|
10178
10264
|
})
|
10179
10265
|
),
|
10180
|
-
contactLabels:
|
10181
|
-
|
10266
|
+
contactLabels: z129.array(
|
10267
|
+
z129.object({
|
10182
10268
|
label: TagSchema,
|
10183
|
-
count:
|
10269
|
+
count: z129.number()
|
10184
10270
|
})
|
10185
10271
|
)
|
10186
10272
|
})
|
@@ -10192,12 +10278,12 @@ var roomContract = initContract48().router(
|
|
10192
10278
|
getAttachments: {
|
10193
10279
|
method: "GET",
|
10194
10280
|
path: "/:id/attachments",
|
10195
|
-
pathParams:
|
10196
|
-
id:
|
10281
|
+
pathParams: z129.object({
|
10282
|
+
id: z129.string().uuid()
|
10197
10283
|
}),
|
10198
10284
|
responses: {
|
10199
10285
|
200: DefaultSuccessResponseSchema.extend({
|
10200
|
-
data:
|
10286
|
+
data: z129.array(AttachmentSchema2)
|
10201
10287
|
}),
|
10202
10288
|
...DefaultResponses
|
10203
10289
|
},
|
@@ -10206,12 +10292,12 @@ var roomContract = initContract48().router(
|
|
10206
10292
|
getParticipants: {
|
10207
10293
|
method: "GET",
|
10208
10294
|
path: "/:id/participants",
|
10209
|
-
pathParams:
|
10210
|
-
id:
|
10295
|
+
pathParams: z129.object({
|
10296
|
+
id: z129.string().uuid()
|
10211
10297
|
}),
|
10212
10298
|
responses: {
|
10213
10299
|
200: DefaultSuccessResponseSchema.extend({
|
10214
|
-
data:
|
10300
|
+
data: z129.array(MailParticipant)
|
10215
10301
|
}),
|
10216
10302
|
...DefaultResponses
|
10217
10303
|
},
|
@@ -10222,22 +10308,22 @@ var roomContract = initContract48().router(
|
|
10222
10308
|
path: "/add_email_to_contact",
|
10223
10309
|
responses: {
|
10224
10310
|
200: DefaultSuccessResponseSchema.extend({
|
10225
|
-
data:
|
10311
|
+
data: z129.string()
|
10226
10312
|
}),
|
10227
10313
|
...DefaultResponses
|
10228
10314
|
},
|
10229
|
-
body:
|
10230
|
-
email:
|
10231
|
-
contactId:
|
10232
|
-
mailUserId:
|
10315
|
+
body: z129.object({
|
10316
|
+
email: z129.string(),
|
10317
|
+
contactId: z129.string(),
|
10318
|
+
mailUserId: z129.string()
|
10233
10319
|
}),
|
10234
10320
|
summary: "Add a new email of a mail room participant to an existing contact"
|
10235
10321
|
},
|
10236
10322
|
update: {
|
10237
10323
|
method: "PATCH",
|
10238
10324
|
path: "/:id",
|
10239
|
-
pathParams:
|
10240
|
-
id:
|
10325
|
+
pathParams: z129.object({
|
10326
|
+
id: z129.string()
|
10241
10327
|
}),
|
10242
10328
|
responses: {
|
10243
10329
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10251,12 +10337,12 @@ var roomContract = initContract48().router(
|
|
10251
10337
|
markAsRead: {
|
10252
10338
|
method: "POST",
|
10253
10339
|
path: "/mark_as_read",
|
10254
|
-
body:
|
10255
|
-
id:
|
10340
|
+
body: z129.object({
|
10341
|
+
id: z129.string()
|
10256
10342
|
}),
|
10257
10343
|
responses: {
|
10258
10344
|
200: DefaultSuccessResponseSchema.extend({
|
10259
|
-
message:
|
10345
|
+
message: z129.string()
|
10260
10346
|
}),
|
10261
10347
|
...DefaultResponses
|
10262
10348
|
},
|
@@ -10265,8 +10351,8 @@ var roomContract = initContract48().router(
|
|
10265
10351
|
getById: {
|
10266
10352
|
method: "GET",
|
10267
10353
|
path: "/:id",
|
10268
|
-
pathParams:
|
10269
|
-
id:
|
10354
|
+
pathParams: z129.object({
|
10355
|
+
id: z129.string().uuid()
|
10270
10356
|
}),
|
10271
10357
|
responses: {
|
10272
10358
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10284,90 +10370,90 @@ var roomContract = initContract48().router(
|
|
10284
10370
|
|
10285
10371
|
// src/mail/account-contract.ts
|
10286
10372
|
import { initContract as initContract49 } from "@ts-rest/core";
|
10287
|
-
import
|
10373
|
+
import z131 from "zod";
|
10288
10374
|
|
10289
10375
|
// src/mail/schemas/account-validation.schema.ts
|
10290
|
-
import
|
10376
|
+
import z130 from "zod";
|
10291
10377
|
var AccountContractsValidationSchemas = {
|
10292
10378
|
create: {
|
10293
|
-
input:
|
10294
|
-
address:
|
10295
|
-
name:
|
10296
|
-
password:
|
10297
|
-
mailServerId:
|
10298
|
-
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("")
|
10299
10385
|
})
|
10300
10386
|
},
|
10301
10387
|
createWithCustomSmtpAndImap: {
|
10302
|
-
input:
|
10303
|
-
email:
|
10304
|
-
name:
|
10305
|
-
password:
|
10306
|
-
imap:
|
10307
|
-
host:
|
10308
|
-
port:
|
10309
|
-
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)
|
10310
10396
|
//Whether to use TLS for the connection (usually true for port 993)
|
10311
10397
|
}),
|
10312
|
-
smtp:
|
10313
|
-
host:
|
10314
|
-
port:
|
10315
|
-
secure:
|
10398
|
+
smtp: z130.object({
|
10399
|
+
host: z130.string(),
|
10400
|
+
port: z130.number(),
|
10401
|
+
secure: z130.boolean().default(false)
|
10316
10402
|
//Whether to use TLS for the connection (usually true for port 993)
|
10317
10403
|
})
|
10318
10404
|
})
|
10319
10405
|
},
|
10320
10406
|
getById: {
|
10321
|
-
input:
|
10322
|
-
id:
|
10407
|
+
input: z130.object({
|
10408
|
+
id: z130.string().uuid()
|
10323
10409
|
}),
|
10324
10410
|
output: MailAccountSchema
|
10325
10411
|
},
|
10326
10412
|
getAll: {
|
10327
|
-
output:
|
10413
|
+
output: z130.array(MailAccountSchema)
|
10328
10414
|
},
|
10329
10415
|
update: {
|
10330
10416
|
input: MailAccountSchema,
|
10331
10417
|
output: MailAccountSchema
|
10332
10418
|
},
|
10333
10419
|
disconnect: {
|
10334
|
-
input:
|
10335
|
-
id:
|
10420
|
+
input: z130.object({
|
10421
|
+
id: z130.string().uuid()
|
10336
10422
|
}),
|
10337
10423
|
output: MailAccountSchema
|
10338
10424
|
},
|
10339
10425
|
reconnect: {
|
10340
|
-
input:
|
10341
|
-
id:
|
10426
|
+
input: z130.object({
|
10427
|
+
id: z130.string()
|
10342
10428
|
}),
|
10343
10429
|
output: MailAccountSchema
|
10344
10430
|
},
|
10345
10431
|
delete: {
|
10346
|
-
input:
|
10347
|
-
id:
|
10432
|
+
input: z130.object({
|
10433
|
+
id: z130.string()
|
10348
10434
|
}),
|
10349
|
-
output:
|
10435
|
+
output: z130.string()
|
10350
10436
|
},
|
10351
10437
|
deleteEmailEngineAcc: {
|
10352
|
-
input:
|
10353
|
-
account:
|
10438
|
+
input: z130.object({
|
10439
|
+
account: z130.string()
|
10354
10440
|
}),
|
10355
10441
|
output: MailAccountSchema
|
10356
10442
|
},
|
10357
10443
|
generateOAuth2AuthenticationLink: {
|
10358
|
-
body:
|
10359
|
-
oAuth2AppId:
|
10360
|
-
mailServerId:
|
10444
|
+
body: z130.object({
|
10445
|
+
oAuth2AppId: z130.string(),
|
10446
|
+
mailServerId: z130.string()
|
10361
10447
|
}),
|
10362
|
-
response:
|
10363
|
-
url:
|
10364
|
-
account:
|
10448
|
+
response: z130.object({
|
10449
|
+
url: z130.string(),
|
10450
|
+
account: z130.string()
|
10365
10451
|
})
|
10366
10452
|
},
|
10367
10453
|
createOAuth2Acc: {
|
10368
|
-
body:
|
10369
|
-
account:
|
10370
|
-
name:
|
10454
|
+
body: z130.object({
|
10455
|
+
account: z130.string(),
|
10456
|
+
name: z130.string()
|
10371
10457
|
}),
|
10372
10458
|
response: MailAccountSchema
|
10373
10459
|
}
|
@@ -10385,14 +10471,14 @@ var accountContract = initContract49().router(
|
|
10385
10471
|
// data: AccountContractsValidationSchemas.create.output,
|
10386
10472
|
data: MailAccountSchema
|
10387
10473
|
}),
|
10388
|
-
400:
|
10389
|
-
message:
|
10474
|
+
400: z131.object({
|
10475
|
+
message: z131.string()
|
10390
10476
|
}),
|
10391
|
-
409:
|
10392
|
-
message:
|
10477
|
+
409: z131.object({
|
10478
|
+
message: z131.string()
|
10393
10479
|
}),
|
10394
|
-
500:
|
10395
|
-
message:
|
10480
|
+
500: z131.object({
|
10481
|
+
message: z131.string()
|
10396
10482
|
}),
|
10397
10483
|
...DefaultResponses
|
10398
10484
|
},
|
@@ -10407,14 +10493,14 @@ var accountContract = initContract49().router(
|
|
10407
10493
|
// data: AccountContractsValidationSchemas.create.output,
|
10408
10494
|
// data: MailAccountSchema,
|
10409
10495
|
}),
|
10410
|
-
400:
|
10411
|
-
message:
|
10496
|
+
400: z131.object({
|
10497
|
+
message: z131.string()
|
10412
10498
|
}),
|
10413
|
-
409:
|
10414
|
-
message:
|
10499
|
+
409: z131.object({
|
10500
|
+
message: z131.string()
|
10415
10501
|
}),
|
10416
|
-
500:
|
10417
|
-
message:
|
10502
|
+
500: z131.object({
|
10503
|
+
message: z131.string()
|
10418
10504
|
}),
|
10419
10505
|
...DefaultResponses
|
10420
10506
|
},
|
@@ -10430,14 +10516,14 @@ var accountContract = initContract49().router(
|
|
10430
10516
|
201: DefaultSuccessResponseSchema.extend({
|
10431
10517
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
10432
10518
|
}),
|
10433
|
-
400:
|
10434
|
-
message:
|
10519
|
+
400: z131.object({
|
10520
|
+
message: z131.string()
|
10435
10521
|
}),
|
10436
|
-
409:
|
10437
|
-
message:
|
10522
|
+
409: z131.object({
|
10523
|
+
message: z131.string()
|
10438
10524
|
}),
|
10439
|
-
500:
|
10440
|
-
message:
|
10525
|
+
500: z131.object({
|
10526
|
+
message: z131.string()
|
10441
10527
|
}),
|
10442
10528
|
...DefaultResponses
|
10443
10529
|
},
|
@@ -10451,7 +10537,7 @@ var accountContract = initContract49().router(
|
|
10451
10537
|
path: "/sync",
|
10452
10538
|
responses: {
|
10453
10539
|
200: DefaultSuccessResponseSchema.extend({
|
10454
|
-
message:
|
10540
|
+
message: z131.string()
|
10455
10541
|
}),
|
10456
10542
|
...DefaultResponses
|
10457
10543
|
},
|
@@ -10476,13 +10562,13 @@ var accountContract = initContract49().router(
|
|
10476
10562
|
getAll: {
|
10477
10563
|
method: "GET",
|
10478
10564
|
path: "",
|
10479
|
-
query:
|
10480
|
-
state:
|
10481
|
-
withDeleted:
|
10565
|
+
query: z131.object({
|
10566
|
+
state: z131.union([z131.literal("connected"), z131.literal("disconnected")]).optional(),
|
10567
|
+
withDeleted: z131.boolean().default(false)
|
10482
10568
|
}).optional(),
|
10483
10569
|
responses: {
|
10484
10570
|
200: DefaultSuccessResponseSchema.extend({
|
10485
|
-
data:
|
10571
|
+
data: z131.array(MailAccountSchema)
|
10486
10572
|
}),
|
10487
10573
|
...DefaultResponses
|
10488
10574
|
},
|
@@ -10493,8 +10579,8 @@ var accountContract = initContract49().router(
|
|
10493
10579
|
update: {
|
10494
10580
|
method: "PATCH",
|
10495
10581
|
path: "/:id",
|
10496
|
-
pathParams:
|
10497
|
-
id:
|
10582
|
+
pathParams: z131.object({
|
10583
|
+
id: z131.string().uuid()
|
10498
10584
|
}),
|
10499
10585
|
responses: {
|
10500
10586
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -10543,7 +10629,7 @@ var accountContract = initContract49().router(
|
|
10543
10629
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
10544
10630
|
responses: {
|
10545
10631
|
200: DefaultSuccessResponseSchema.extend({
|
10546
|
-
message:
|
10632
|
+
message: z131.string()
|
10547
10633
|
}),
|
10548
10634
|
...DefaultResponses
|
10549
10635
|
},
|
@@ -10558,7 +10644,7 @@ var accountContract = initContract49().router(
|
|
10558
10644
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
10559
10645
|
responses: {
|
10560
10646
|
200: DefaultSuccessResponseSchema.extend({
|
10561
|
-
message:
|
10647
|
+
message: z131.string()
|
10562
10648
|
}),
|
10563
10649
|
...DefaultResponses
|
10564
10650
|
},
|
@@ -10587,20 +10673,20 @@ var accountContract = initContract49().router(
|
|
10587
10673
|
|
10588
10674
|
// src/mail/mail-server-contract.ts
|
10589
10675
|
import { initContract as initContract50 } from "@ts-rest/core";
|
10590
|
-
import
|
10676
|
+
import z133 from "zod";
|
10591
10677
|
|
10592
10678
|
// src/mail/schemas/servers-validation.schema.ts
|
10593
|
-
import
|
10594
|
-
var CreateMailServerSchema =
|
10595
|
-
name:
|
10596
|
-
smtpHost:
|
10597
|
-
smtpPort:
|
10598
|
-
smtpTlsPort:
|
10599
|
-
useTlsForSmtp:
|
10600
|
-
imapHost:
|
10601
|
-
imapPort:
|
10602
|
-
imapTlsPort:
|
10603
|
-
useTlsForImap:
|
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()
|
10604
10690
|
});
|
10605
10691
|
|
10606
10692
|
// src/mail/mail-server-contract.ts
|
@@ -10623,11 +10709,11 @@ var serverContract = initContract50().router(
|
|
10623
10709
|
path: "/oauth2/apps",
|
10624
10710
|
responses: {
|
10625
10711
|
200: DefaultSuccessResponseSchema.extend({
|
10626
|
-
data:
|
10627
|
-
total:
|
10628
|
-
pages:
|
10629
|
-
page:
|
10630
|
-
apps:
|
10712
|
+
data: z133.object({
|
10713
|
+
total: z133.number(),
|
10714
|
+
pages: z133.number(),
|
10715
|
+
page: z133.number(),
|
10716
|
+
apps: z133.array(OAuth2AppSchema)
|
10631
10717
|
})
|
10632
10718
|
}),
|
10633
10719
|
...DefaultResponses
|
@@ -10637,8 +10723,8 @@ var serverContract = initContract50().router(
|
|
10637
10723
|
getById: {
|
10638
10724
|
method: "GET",
|
10639
10725
|
path: "/:id",
|
10640
|
-
pathParams:
|
10641
|
-
id:
|
10726
|
+
pathParams: z133.object({
|
10727
|
+
id: z133.string().uuid()
|
10642
10728
|
}),
|
10643
10729
|
responses: {
|
10644
10730
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10653,7 +10739,7 @@ var serverContract = initContract50().router(
|
|
10653
10739
|
path: "/",
|
10654
10740
|
responses: {
|
10655
10741
|
200: DefaultSuccessResponseSchema.extend({
|
10656
|
-
data:
|
10742
|
+
data: z133.array(MailServerSchema)
|
10657
10743
|
}),
|
10658
10744
|
...DefaultResponses
|
10659
10745
|
},
|
@@ -10662,8 +10748,8 @@ var serverContract = initContract50().router(
|
|
10662
10748
|
update: {
|
10663
10749
|
method: "PATCH",
|
10664
10750
|
path: "/:id",
|
10665
|
-
pathParams:
|
10666
|
-
id:
|
10751
|
+
pathParams: z133.object({
|
10752
|
+
id: z133.string().uuid()
|
10667
10753
|
}),
|
10668
10754
|
responses: {
|
10669
10755
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10677,8 +10763,8 @@ var serverContract = initContract50().router(
|
|
10677
10763
|
delete: {
|
10678
10764
|
method: "DELETE",
|
10679
10765
|
path: "/:id",
|
10680
|
-
pathParams:
|
10681
|
-
id:
|
10766
|
+
pathParams: z133.object({
|
10767
|
+
id: z133.string().uuid()
|
10682
10768
|
}),
|
10683
10769
|
responses: {
|
10684
10770
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10697,45 +10783,45 @@ var serverContract = initContract50().router(
|
|
10697
10783
|
|
10698
10784
|
// src/mail/message-contract.ts
|
10699
10785
|
import { initContract as initContract51 } from "@ts-rest/core";
|
10700
|
-
import
|
10786
|
+
import z135 from "zod";
|
10701
10787
|
|
10702
10788
|
// src/mail/schemas/message-validation.schema.ts
|
10703
|
-
import
|
10704
|
-
var MailParticipant2 =
|
10705
|
-
name:
|
10706
|
-
address:
|
10789
|
+
import z134 from "zod";
|
10790
|
+
var MailParticipant2 = z134.object({
|
10791
|
+
name: z134.string().optional(),
|
10792
|
+
address: z134.string().email()
|
10707
10793
|
});
|
10708
10794
|
var MessageContractsValidationsSchema = {
|
10709
10795
|
submit: {
|
10710
|
-
input:
|
10711
|
-
subject:
|
10712
|
-
text:
|
10713
|
-
html:
|
10796
|
+
input: z134.object({
|
10797
|
+
subject: z134.string(),
|
10798
|
+
text: z134.string(),
|
10799
|
+
html: z134.string(),
|
10714
10800
|
from: MailParticipant2,
|
10715
10801
|
to: MailParticipant2,
|
10716
|
-
cc:
|
10717
|
-
bcc:
|
10718
|
-
sendAt:
|
10719
|
-
reference:
|
10720
|
-
messageId:
|
10721
|
-
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")])
|
10722
10808
|
}).optional(),
|
10723
|
-
attachments:
|
10724
|
-
|
10725
|
-
fileType:
|
10726
|
-
fileName:
|
10727
|
-
fileKey:
|
10728
|
-
fileSize:
|
10729
|
-
bucketName:
|
10730
|
-
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()
|
10731
10817
|
})
|
10732
10818
|
).optional()
|
10733
10819
|
}),
|
10734
|
-
output:
|
10735
|
-
response:
|
10736
|
-
messageId:
|
10737
|
-
sendAt:
|
10738
|
-
queueId:
|
10820
|
+
output: z134.object({
|
10821
|
+
response: z134.string(),
|
10822
|
+
messageId: z134.string(),
|
10823
|
+
sendAt: z134.string(),
|
10824
|
+
queueId: z134.string()
|
10739
10825
|
})
|
10740
10826
|
}
|
10741
10827
|
};
|
@@ -10764,8 +10850,8 @@ var messageContract = initContract51().router(
|
|
10764
10850
|
path: "/new_message_count",
|
10765
10851
|
responses: {
|
10766
10852
|
200: DefaultSuccessResponseSchema.extend({
|
10767
|
-
data:
|
10768
|
-
count:
|
10853
|
+
data: z135.object({
|
10854
|
+
count: z135.number()
|
10769
10855
|
})
|
10770
10856
|
}),
|
10771
10857
|
...DefaultResponses
|
@@ -10777,8 +10863,8 @@ var messageContract = initContract51().router(
|
|
10777
10863
|
getById: {
|
10778
10864
|
method: "GET",
|
10779
10865
|
path: "/:id",
|
10780
|
-
pathParams:
|
10781
|
-
id:
|
10866
|
+
pathParams: z135.object({
|
10867
|
+
id: z135.string()
|
10782
10868
|
}),
|
10783
10869
|
responses: {
|
10784
10870
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10793,8 +10879,8 @@ var messageContract = initContract51().router(
|
|
10793
10879
|
update: {
|
10794
10880
|
method: "PATCH",
|
10795
10881
|
path: "/:id",
|
10796
|
-
pathParams:
|
10797
|
-
id:
|
10882
|
+
pathParams: z135.object({
|
10883
|
+
id: z135.string()
|
10798
10884
|
}),
|
10799
10885
|
responses: {
|
10800
10886
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10810,8 +10896,8 @@ var messageContract = initContract51().router(
|
|
10810
10896
|
delete: {
|
10811
10897
|
method: "DELETE",
|
10812
10898
|
path: "/:id",
|
10813
|
-
pathParams:
|
10814
|
-
id:
|
10899
|
+
pathParams: z135.object({
|
10900
|
+
id: z135.string()
|
10815
10901
|
}),
|
10816
10902
|
responses: {
|
10817
10903
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10827,13 +10913,13 @@ var messageContract = initContract51().router(
|
|
10827
10913
|
cancelScheduledMessage: {
|
10828
10914
|
method: "DELETE",
|
10829
10915
|
path: "/scheduled_message/:id",
|
10830
|
-
pathParams:
|
10831
|
-
id:
|
10916
|
+
pathParams: z135.object({
|
10917
|
+
id: z135.string()
|
10832
10918
|
}),
|
10833
10919
|
responses: {
|
10834
10920
|
200: DefaultSuccessResponseSchema.extend({
|
10835
|
-
data:
|
10836
|
-
totalMessagesCount:
|
10921
|
+
data: z135.object({
|
10922
|
+
totalMessagesCount: z135.number()
|
10837
10923
|
})
|
10838
10924
|
}),
|
10839
10925
|
...DefaultResponses
|
@@ -10858,38 +10944,38 @@ var mailContract = initContract52().router({
|
|
10858
10944
|
|
10859
10945
|
// src/webchat/index.ts
|
10860
10946
|
import { initContract as initContract53 } from "@ts-rest/core";
|
10861
|
-
import
|
10947
|
+
import z138 from "zod";
|
10862
10948
|
|
10863
10949
|
// src/webchat/schema.ts
|
10864
|
-
import
|
10950
|
+
import z137 from "zod";
|
10865
10951
|
|
10866
10952
|
// src/webchat/validation.ts
|
10867
|
-
import
|
10953
|
+
import z136 from "zod";
|
10868
10954
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
10869
10955
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
10870
10956
|
return ChatwootChannelType3;
|
10871
10957
|
})(ChatwootChannelType2 || {});
|
10872
|
-
var WebChatChannelSchema =
|
10873
|
-
avatar:
|
10874
|
-
name:
|
10875
|
-
type:
|
10876
|
-
websiteName:
|
10877
|
-
welcomeTitle:
|
10878
|
-
websiteUrl:
|
10879
|
-
welcomeTagline:
|
10880
|
-
agentAwayMessage:
|
10881
|
-
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()
|
10882
10968
|
});
|
10883
10969
|
|
10884
10970
|
// src/webchat/schema.ts
|
10885
|
-
var ConnectWebChatChannelSchema =
|
10886
|
-
name:
|
10887
|
-
actor:
|
10888
|
-
id:
|
10889
|
-
name:
|
10890
|
-
email:
|
10891
|
-
address:
|
10892
|
-
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()
|
10893
10979
|
}),
|
10894
10980
|
channel: WebChatChannelSchema
|
10895
10981
|
});
|
@@ -10923,8 +11009,8 @@ var platformWebchatContract = initContract53().router(
|
|
10923
11009
|
disconnectToService: {
|
10924
11010
|
method: "POST",
|
10925
11011
|
path: "/disconnect",
|
10926
|
-
body:
|
10927
|
-
id:
|
11012
|
+
body: z138.object({
|
11013
|
+
id: z138.string().uuid()
|
10928
11014
|
}),
|
10929
11015
|
responses: {
|
10930
11016
|
200: ChannelServiceResponseSchema,
|
@@ -10935,8 +11021,8 @@ var platformWebchatContract = initContract53().router(
|
|
10935
11021
|
reconnect: {
|
10936
11022
|
method: "POST",
|
10937
11023
|
path: "/reconnect/:channelId",
|
10938
|
-
pathParams:
|
10939
|
-
channelId:
|
11024
|
+
pathParams: z138.object({
|
11025
|
+
channelId: z138.string().uuid()
|
10940
11026
|
}),
|
10941
11027
|
body: null,
|
10942
11028
|
responses: {
|
@@ -10948,8 +11034,8 @@ var platformWebchatContract = initContract53().router(
|
|
10948
11034
|
delete: {
|
10949
11035
|
method: "DELETE",
|
10950
11036
|
path: "/delete/:channelId",
|
10951
|
-
pathParams:
|
10952
|
-
channelId:
|
11037
|
+
pathParams: z138.object({
|
11038
|
+
channelId: z138.string().uuid()
|
10953
11039
|
}),
|
10954
11040
|
body: null,
|
10955
11041
|
responses: {
|
@@ -10966,18 +11052,18 @@ var platformWebchatContract = initContract53().router(
|
|
10966
11052
|
|
10967
11053
|
// src/hold-label/index.ts
|
10968
11054
|
import { initContract as initContract54 } from "@ts-rest/core";
|
10969
|
-
import
|
11055
|
+
import z140 from "zod";
|
10970
11056
|
|
10971
11057
|
// src/hold-label/validation.ts
|
10972
|
-
import
|
10973
|
-
var UpdatePositionSchema2 =
|
10974
|
-
holdLabels:
|
10975
|
-
|
11058
|
+
import z139 from "zod";
|
11059
|
+
var UpdatePositionSchema2 = z139.object({
|
11060
|
+
holdLabels: z139.array(
|
11061
|
+
z139.object({ id: z139.string().uuid(), position: z139.number() })
|
10976
11062
|
)
|
10977
11063
|
});
|
10978
|
-
var HoldRoomSchema =
|
10979
|
-
roomId:
|
10980
|
-
holdLabelId:
|
11064
|
+
var HoldRoomSchema = z139.object({
|
11065
|
+
roomId: z139.string().uuid(),
|
11066
|
+
holdLabelId: z139.string().uuid()
|
10981
11067
|
});
|
10982
11068
|
|
10983
11069
|
// src/hold-label/index.ts
|
@@ -10985,7 +11071,7 @@ var holdLabelContract = initContract54().router({
|
|
10985
11071
|
createHoldLabel: {
|
10986
11072
|
method: "POST",
|
10987
11073
|
path: "ms/hold-label",
|
10988
|
-
body:
|
11074
|
+
body: z140.object({ name: z140.string() }),
|
10989
11075
|
responses: {
|
10990
11076
|
201: DefaultSuccessResponseSchema.extend({
|
10991
11077
|
holdLabel: HoldLabelSchema
|
@@ -10997,7 +11083,7 @@ var holdLabelContract = initContract54().router({
|
|
10997
11083
|
path: "chs/api/v1/hold-label",
|
10998
11084
|
responses: {
|
10999
11085
|
200: DefaultSuccessResponseSchema.extend({
|
11000
|
-
holdLabels:
|
11086
|
+
holdLabels: z140.array(HoldLabelSchema)
|
11001
11087
|
})
|
11002
11088
|
}
|
11003
11089
|
},
|
@@ -11015,8 +11101,8 @@ var holdLabelContract = initContract54().router({
|
|
11015
11101
|
updateHoldLabel: {
|
11016
11102
|
method: "PATCH",
|
11017
11103
|
path: "ms/hold-label/:id",
|
11018
|
-
pathParams:
|
11019
|
-
body:
|
11104
|
+
pathParams: z140.object({ id: z140.string().uuid() }),
|
11105
|
+
body: z140.object({ name: z140.string() }),
|
11020
11106
|
responses: {
|
11021
11107
|
200: DefaultSuccessResponseSchema.extend({
|
11022
11108
|
holdLabel: HoldLabelSchema
|
@@ -11026,7 +11112,7 @@ var holdLabelContract = initContract54().router({
|
|
11026
11112
|
deleteHoldLabel: {
|
11027
11113
|
method: "DELETE",
|
11028
11114
|
path: "ms/hold-label/:id",
|
11029
|
-
pathParams:
|
11115
|
+
pathParams: z140.object({ id: z140.string().uuid() }),
|
11030
11116
|
body: null,
|
11031
11117
|
responses: {
|
11032
11118
|
200: DefaultSuccessResponseSchema
|
@@ -11037,10 +11123,10 @@ var holdLabelContract = initContract54().router({
|
|
11037
11123
|
path: "ms/hold-label/auto-unhold",
|
11038
11124
|
responses: {
|
11039
11125
|
200: DefaultSuccessResponseSchema.extend({
|
11040
|
-
autoUnhold:
|
11041
|
-
resumeLabel:
|
11042
|
-
show:
|
11043
|
-
name:
|
11126
|
+
autoUnhold: z140.boolean(),
|
11127
|
+
resumeLabel: z140.object({
|
11128
|
+
show: z140.boolean(),
|
11129
|
+
name: z140.string()
|
11044
11130
|
})
|
11045
11131
|
})
|
11046
11132
|
}
|
@@ -11048,19 +11134,19 @@ var holdLabelContract = initContract54().router({
|
|
11048
11134
|
updateAutoUnhold: {
|
11049
11135
|
method: "POST",
|
11050
11136
|
path: "ms/hold-label/auto-unhold",
|
11051
|
-
body:
|
11052
|
-
autoUnhold:
|
11053
|
-
resumeLabel:
|
11054
|
-
show:
|
11055
|
-
name:
|
11137
|
+
body: z140.object({
|
11138
|
+
autoUnhold: z140.boolean().optional(),
|
11139
|
+
resumeLabel: z140.object({
|
11140
|
+
show: z140.boolean().optional(),
|
11141
|
+
name: z140.string().optional()
|
11056
11142
|
}).optional()
|
11057
11143
|
}),
|
11058
11144
|
responses: {
|
11059
11145
|
200: DefaultSuccessResponseSchema.extend({
|
11060
|
-
autoUnhold:
|
11061
|
-
resumeLabel:
|
11062
|
-
show:
|
11063
|
-
name:
|
11146
|
+
autoUnhold: z140.boolean(),
|
11147
|
+
resumeLabel: z140.object({
|
11148
|
+
show: z140.boolean(),
|
11149
|
+
name: z140.string()
|
11064
11150
|
})
|
11065
11151
|
})
|
11066
11152
|
}
|
@@ -11068,10 +11154,10 @@ var holdLabelContract = initContract54().router({
|
|
11068
11154
|
getHoldLogs: {
|
11069
11155
|
method: "GET",
|
11070
11156
|
path: "ms/hold-label/hold-logs",
|
11071
|
-
query:
|
11157
|
+
query: z140.object({ cxLogId: z140.string().uuid() }),
|
11072
11158
|
responses: {
|
11073
|
-
200:
|
11074
|
-
holdLogs:
|
11159
|
+
200: z140.object({
|
11160
|
+
holdLogs: z140.array(FormattedHoldLogSchema)
|
11075
11161
|
})
|
11076
11162
|
}
|
11077
11163
|
},
|
@@ -11088,7 +11174,7 @@ var holdLabelContract = initContract54().router({
|
|
11088
11174
|
unholdRoom: {
|
11089
11175
|
method: "POST",
|
11090
11176
|
path: "ms/hold-label/unhold-room",
|
11091
|
-
body:
|
11177
|
+
body: z140.object({ roomId: z140.string().uuid() }),
|
11092
11178
|
responses: {
|
11093
11179
|
200: DefaultSuccessResponseSchema.extend({
|
11094
11180
|
holdLog: HoldLogSchema.optional()
|
@@ -11099,89 +11185,89 @@ var holdLabelContract = initContract54().router({
|
|
11099
11185
|
|
11100
11186
|
// src/subscription/index.ts
|
11101
11187
|
import { initContract as initContract55 } from "@ts-rest/core";
|
11102
|
-
import { z as
|
11188
|
+
import { z as z143 } from "zod";
|
11103
11189
|
|
11104
11190
|
// src/subscription/schema.ts
|
11105
|
-
import
|
11191
|
+
import z141 from "zod";
|
11106
11192
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
11107
|
-
priceId:
|
11108
|
-
name:
|
11109
|
-
perUnit:
|
11110
|
-
price:
|
11111
|
-
currency:
|
11193
|
+
priceId: z141.string(),
|
11194
|
+
name: z141.string().nullable(),
|
11195
|
+
perUnit: z141.number(),
|
11196
|
+
price: z141.number(),
|
11197
|
+
currency: z141.string().nullable()
|
11112
11198
|
});
|
11113
11199
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
11114
|
-
provider:
|
11115
|
-
productId:
|
11116
|
-
name:
|
11117
|
-
type:
|
11118
|
-
omnichannel:
|
11119
|
-
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(),
|
11120
11206
|
productPrice: ProductPriceSchema
|
11121
11207
|
});
|
11122
11208
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
11123
|
-
includedQuantity:
|
11209
|
+
includedQuantity: z141.number(),
|
11124
11210
|
product: ProductWithoutRelatedSchema
|
11125
11211
|
});
|
11126
11212
|
var ProductSchema = DefaultEntitySchema.extend({
|
11127
|
-
provider:
|
11128
|
-
productId:
|
11129
|
-
name:
|
11130
|
-
type:
|
11131
|
-
omnichannel:
|
11132
|
-
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(),
|
11133
11219
|
productPrice: ProductPriceSchema,
|
11134
|
-
relatedProducts:
|
11220
|
+
relatedProducts: z141.array(RelatedProductSchema)
|
11135
11221
|
});
|
11136
11222
|
var CustomerSchema = DefaultEntitySchema.extend({
|
11137
|
-
provider:
|
11138
|
-
customerId:
|
11139
|
-
email:
|
11140
|
-
name:
|
11141
|
-
balance:
|
11223
|
+
provider: z141.string(),
|
11224
|
+
customerId: z141.string(),
|
11225
|
+
email: z141.string(),
|
11226
|
+
name: z141.string(),
|
11227
|
+
balance: z141.number()
|
11142
11228
|
});
|
11143
11229
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
11144
|
-
limit:
|
11145
|
-
subscriptionItemId:
|
11146
|
-
usage:
|
11230
|
+
limit: z141.number(),
|
11231
|
+
subscriptionItemId: z141.string(),
|
11232
|
+
usage: z141.number().nullable(),
|
11147
11233
|
product: ProductSchema
|
11148
11234
|
});
|
11149
11235
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
11150
|
-
provider:
|
11151
|
-
type:
|
11152
|
-
subscriptionId:
|
11153
|
-
interval:
|
11154
|
-
quantity:
|
11155
|
-
amount:
|
11156
|
-
startAt:
|
11157
|
-
expireAt:
|
11158
|
-
status:
|
11159
|
-
name:
|
11160
|
-
subscriptionProducts:
|
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),
|
11161
11247
|
productPrice: ProductPriceSchema,
|
11162
11248
|
product: ProductSchema
|
11163
11249
|
});
|
11164
11250
|
|
11165
11251
|
// src/subscription/validation.ts
|
11166
|
-
import { z as
|
11167
|
-
var GetAvailablePlanSchema =
|
11168
|
-
type:
|
11169
|
-
currency:
|
11170
|
-
});
|
11171
|
-
var UpdateSubscriptionSchema =
|
11172
|
-
planProductId:
|
11173
|
-
planProductPriceId:
|
11174
|
-
subscriptionId:
|
11175
|
-
subscriptionProducts:
|
11176
|
-
|
11177
|
-
productId:
|
11178
|
-
productPriceId:
|
11179
|
-
quantity:
|
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()
|
11180
11266
|
})
|
11181
11267
|
)
|
11182
11268
|
});
|
11183
|
-
var TopUpBalanceSchema =
|
11184
|
-
quantity:
|
11269
|
+
var TopUpBalanceSchema = z142.object({
|
11270
|
+
quantity: z142.number()
|
11185
11271
|
});
|
11186
11272
|
|
11187
11273
|
// src/subscription/index.ts
|
@@ -11205,9 +11291,9 @@ var subscriptionContract = initContract55().router(
|
|
11205
11291
|
body: UpdateSubscriptionSchema,
|
11206
11292
|
responses: {
|
11207
11293
|
200: DefaultSuccessResponseSchema.extend({
|
11208
|
-
message:
|
11209
|
-
requireCheckout:
|
11210
|
-
checkoutUrl:
|
11294
|
+
message: z143.string(),
|
11295
|
+
requireCheckout: z143.boolean(),
|
11296
|
+
checkoutUrl: z143.string().nullable()
|
11211
11297
|
}),
|
11212
11298
|
402: DefaultErrorResponseSchema,
|
11213
11299
|
500: DefaultErrorResponseSchema
|
@@ -11219,7 +11305,7 @@ var subscriptionContract = initContract55().router(
|
|
11219
11305
|
body: TopUpBalanceSchema,
|
11220
11306
|
responses: {
|
11221
11307
|
200: DefaultSuccessResponseSchema.extend({
|
11222
|
-
checkoutUrl:
|
11308
|
+
checkoutUrl: z143.string()
|
11223
11309
|
}),
|
11224
11310
|
500: DefaultErrorResponseSchema
|
11225
11311
|
}
|
@@ -11230,7 +11316,7 @@ var subscriptionContract = initContract55().router(
|
|
11230
11316
|
query: null,
|
11231
11317
|
responses: {
|
11232
11318
|
200: DefaultSuccessResponseSchema.extend({
|
11233
|
-
balance:
|
11319
|
+
balance: z143.number()
|
11234
11320
|
}),
|
11235
11321
|
500: DefaultErrorResponseSchema
|
11236
11322
|
}
|
@@ -11241,7 +11327,7 @@ var subscriptionContract = initContract55().router(
|
|
11241
11327
|
query: GetAvailablePlanSchema,
|
11242
11328
|
responses: {
|
11243
11329
|
200: DefaultSuccessResponseSchema.extend({
|
11244
|
-
data:
|
11330
|
+
data: z143.array(ProductSchema)
|
11245
11331
|
}),
|
11246
11332
|
500: DefaultErrorResponseSchema
|
11247
11333
|
}
|
@@ -11252,7 +11338,7 @@ var subscriptionContract = initContract55().router(
|
|
11252
11338
|
query: GetAvailablePlanSchema,
|
11253
11339
|
responses: {
|
11254
11340
|
200: DefaultSuccessResponseSchema.extend({
|
11255
|
-
data:
|
11341
|
+
data: z143.array(ProductSchema)
|
11256
11342
|
}),
|
11257
11343
|
500: DefaultErrorResponseSchema
|
11258
11344
|
}
|
@@ -11275,19 +11361,19 @@ var subscriptionContract = initContract55().router(
|
|
11275
11361
|
|
11276
11362
|
// src/cx-intelligence/index.ts
|
11277
11363
|
import { initContract as initContract56 } from "@ts-rest/core";
|
11278
|
-
import
|
11364
|
+
import z144 from "zod";
|
11279
11365
|
var cxIntelligenceContract = initContract56().router(
|
11280
11366
|
{
|
11281
11367
|
toggle: {
|
11282
11368
|
method: "POST",
|
11283
11369
|
path: "/toggle",
|
11284
11370
|
headers: DefaultHeaderSchema,
|
11285
|
-
body:
|
11286
|
-
enabled:
|
11371
|
+
body: z144.object({
|
11372
|
+
enabled: z144.union([z144.literal(true), z144.literal(false)])
|
11287
11373
|
}),
|
11288
11374
|
responses: {
|
11289
11375
|
200: DefaultSuccessResponseSchema.extend({
|
11290
|
-
message:
|
11376
|
+
message: z144.string()
|
11291
11377
|
}),
|
11292
11378
|
500: DefaultErrorResponseSchema
|
11293
11379
|
},
|
@@ -11297,15 +11383,15 @@ var cxIntelligenceContract = initContract56().router(
|
|
11297
11383
|
method: "POST",
|
11298
11384
|
path: "/cx-logs/:id/transcribe",
|
11299
11385
|
headers: DefaultHeaderSchema,
|
11300
|
-
pathParams:
|
11301
|
-
id:
|
11386
|
+
pathParams: z144.object({
|
11387
|
+
id: z144.string().uuid()
|
11302
11388
|
}),
|
11303
|
-
body:
|
11304
|
-
fileUrl:
|
11389
|
+
body: z144.object({
|
11390
|
+
fileUrl: z144.string()
|
11305
11391
|
}),
|
11306
11392
|
responses: {
|
11307
11393
|
200: DefaultSuccessResponseSchema.extend({
|
11308
|
-
message:
|
11394
|
+
message: z144.string()
|
11309
11395
|
}),
|
11310
11396
|
403: DefaultErrorResponseSchema,
|
11311
11397
|
404: DefaultErrorResponseSchema,
|
@@ -11325,13 +11411,13 @@ var settingCxIntelligenceContract = initContract56().router(
|
|
11325
11411
|
headers: DefaultHeaderSchema,
|
11326
11412
|
responses: {
|
11327
11413
|
200: DefaultSuccessResponseSchema.extend({
|
11328
|
-
message:
|
11329
|
-
status:
|
11414
|
+
message: z144.string(),
|
11415
|
+
status: z144.boolean()
|
11330
11416
|
}),
|
11331
|
-
422:
|
11332
|
-
requestId:
|
11333
|
-
message:
|
11334
|
-
status:
|
11417
|
+
422: z144.object({
|
11418
|
+
requestId: z144.string(),
|
11419
|
+
message: z144.string(),
|
11420
|
+
status: z144.boolean()
|
11335
11421
|
}),
|
11336
11422
|
500: DefaultErrorResponseSchema
|
11337
11423
|
},
|
@@ -11343,20 +11429,20 @@ var settingCxIntelligenceContract = initContract56().router(
|
|
11343
11429
|
|
11344
11430
|
// src/export/index.ts
|
11345
11431
|
import { initContract as initContract57 } from "@ts-rest/core";
|
11346
|
-
import
|
11432
|
+
import z145 from "zod";
|
11347
11433
|
var exportContract = initContract57().router(
|
11348
11434
|
{
|
11349
11435
|
notifyExport: {
|
11350
11436
|
method: "POST",
|
11351
11437
|
path: "notify",
|
11352
|
-
body:
|
11353
|
-
userId:
|
11354
|
-
module:
|
11355
|
-
fileUrl:
|
11438
|
+
body: z145.object({
|
11439
|
+
userId: z145.string().uuid(),
|
11440
|
+
module: z145.string(),
|
11441
|
+
fileUrl: z145.string()
|
11356
11442
|
}),
|
11357
11443
|
responses: {
|
11358
11444
|
200: DefaultSuccessResponseSchema.extend({
|
11359
|
-
success:
|
11445
|
+
success: z145.boolean()
|
11360
11446
|
}),
|
11361
11447
|
500: DefaultErrorResponseSchema
|
11362
11448
|
}
|