@kl1/contracts 1.2.11-uat → 1.2.13-uat
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api-contracts/src/channel/index.d.ts +663 -1
- package/dist/api-contracts/src/channel/index.d.ts.map +1 -1
- package/dist/api-contracts/src/channel/validation.d.ts +10 -0
- package/dist/api-contracts/src/channel/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/index.d.ts +111 -111
- package/dist/api-contracts/src/chat/schema.d.ts +25 -25
- package/dist/api-contracts/src/chat/validation.d.ts +16 -16
- package/dist/api-contracts/src/contract.d.ts +22097 -449
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/facebook-feed/index.d.ts +16 -16
- package/dist/api-contracts/src/instagram/index.d.ts +16 -16
- package/dist/api-contracts/src/line/index.d.ts +16 -16
- package/dist/api-contracts/src/mail/account-contract.d.ts +71 -0
- package/dist/api-contracts/src/mail/account-contract.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/mail-contract.d.ts +71 -0
- package/dist/api-contracts/src/mail/mail-contract.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/schemas/account-validation.schema.d.ts +10 -0
- package/dist/api-contracts/src/mail/schemas/account-validation.schema.d.ts.map +1 -1
- package/dist/api-contracts/src/messenger/index.d.ts +16 -16
- package/dist/api-contracts/src/telegram/index.d.ts +20328 -0
- package/dist/api-contracts/src/telegram/index.d.ts.map +1 -0
- package/dist/api-contracts/src/telegram/schema.d.ts +2 -0
- package/dist/api-contracts/src/telegram/schema.d.ts.map +1 -0
- package/dist/api-contracts/src/telegram/validation.d.ts +45 -0
- package/dist/api-contracts/src/telegram/validation.d.ts.map +1 -0
- package/dist/api-contracts/src/viber/index.d.ts +16 -16
- package/dist/api-contracts/src/webchat/index.d.ts +16 -16
- package/dist/api-contracts/src/workflow-rule/index.d.ts +10 -10
- package/dist/index.js +1137 -999
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1136 -999
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
// src/contract.ts
|
2
|
-
import { initContract as
|
2
|
+
import { initContract as initContract43 } from "@ts-rest/core";
|
3
3
|
|
4
4
|
// src/activity-log/index.ts
|
5
5
|
import { initContract } from "@ts-rest/core";
|
@@ -1362,7 +1362,7 @@ var RoomSchema = DefaultEntitySchema.extend({
|
|
1362
1362
|
channel: ChannelSchema,
|
1363
1363
|
cxlog: CxLogSchema,
|
1364
1364
|
workflowRule: WorkflowRuleSchema,
|
1365
|
-
automationQueueId: z30.string().uuid().nullable()
|
1365
|
+
automationQueueId: z30.string().uuid().optional().nullable()
|
1366
1366
|
});
|
1367
1367
|
var MessageSchema = DefaultEntitySchema.extend({
|
1368
1368
|
message: z30.string(),
|
@@ -1998,6 +1998,10 @@ var ConnectViberChannelSchema = z34.object({
|
|
1998
1998
|
name: z34.string(),
|
1999
1999
|
accessToken: z34.string()
|
2000
2000
|
});
|
2001
|
+
var ConnectTelegramChannelSchema = z34.object({
|
2002
|
+
name: z34.string(),
|
2003
|
+
accessToken: z34.string()
|
2004
|
+
});
|
2001
2005
|
var ChatwootChannelType = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
2002
2006
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
2003
2007
|
return ChatwootChannelType3;
|
@@ -2187,6 +2191,26 @@ var viber = initContract6().router(
|
|
2187
2191
|
pathPrefix: "/viber"
|
2188
2192
|
}
|
2189
2193
|
);
|
2194
|
+
var telegram = initContract6().router(
|
2195
|
+
{
|
2196
|
+
connect: {
|
2197
|
+
method: "POST",
|
2198
|
+
path: "/connect",
|
2199
|
+
responses: {
|
2200
|
+
200: DefaultSuccessResponseSchema.extend({
|
2201
|
+
channel: ChannelSchema
|
2202
|
+
}),
|
2203
|
+
408: DefaultErrorResponseSchema,
|
2204
|
+
400: DefaultErrorResponseSchema
|
2205
|
+
},
|
2206
|
+
body: ConnectTelegramChannelSchema,
|
2207
|
+
summary: "Connect telegram channel"
|
2208
|
+
}
|
2209
|
+
},
|
2210
|
+
{
|
2211
|
+
pathPrefix: "/telegram"
|
2212
|
+
}
|
2213
|
+
);
|
2190
2214
|
var channelContract = initContract6().router(
|
2191
2215
|
{
|
2192
2216
|
getChannels: {
|
@@ -2278,6 +2302,7 @@ var channelContract = initContract6().router(
|
|
2278
2302
|
line,
|
2279
2303
|
instagram,
|
2280
2304
|
viber,
|
2305
|
+
telegram,
|
2281
2306
|
webchat
|
2282
2307
|
},
|
2283
2308
|
{
|
@@ -6670,64 +6695,151 @@ var viberContract = initContract31().router({
|
|
6670
6695
|
}
|
6671
6696
|
});
|
6672
6697
|
|
6673
|
-
// src/
|
6698
|
+
// src/telegram/index.ts
|
6699
|
+
import z90 from "zod";
|
6674
6700
|
import { initContract as initContract32 } from "@ts-rest/core";
|
6675
|
-
|
6701
|
+
|
6702
|
+
// src/telegram/validation.ts
|
6703
|
+
import z89 from "zod";
|
6704
|
+
var TelegramChannelSchema = z89.object({
|
6705
|
+
name: z89.string(),
|
6706
|
+
// Telegram bot access token
|
6707
|
+
accessToken: z89.string(),
|
6708
|
+
actor: z89.object({
|
6709
|
+
id: z89.string().uuid(),
|
6710
|
+
name: z89.string(),
|
6711
|
+
email: z89.string().email(),
|
6712
|
+
address: z89.string().nullable(),
|
6713
|
+
phone: z89.string().nullable()
|
6714
|
+
}).optional()
|
6715
|
+
});
|
6716
|
+
|
6717
|
+
// src/telegram/index.ts
|
6718
|
+
var telegramContract = initContract32().router({
|
6719
|
+
connect: {
|
6720
|
+
method: "POST",
|
6721
|
+
path: "/connect",
|
6722
|
+
responses: {
|
6723
|
+
200: DefaultSuccessResponseSchema.extend({
|
6724
|
+
channel: ChannelSchema
|
6725
|
+
}),
|
6726
|
+
400: DefaultErrorResponseSchema,
|
6727
|
+
408: DefaultErrorResponseSchema
|
6728
|
+
},
|
6729
|
+
body: TelegramChannelSchema,
|
6730
|
+
summary: "Connect telegram channel"
|
6731
|
+
},
|
6732
|
+
disconnect: {
|
6733
|
+
method: "POST",
|
6734
|
+
path: "/disconnect",
|
6735
|
+
responses: {
|
6736
|
+
200: DefaultSuccessResponseSchema.extend({
|
6737
|
+
channel: ChannelSchema
|
6738
|
+
}),
|
6739
|
+
400: DefaultErrorResponseSchema
|
6740
|
+
},
|
6741
|
+
body: ChannelSchema.partial(),
|
6742
|
+
summary: "Disconnect telegram channel"
|
6743
|
+
},
|
6744
|
+
sendMessage: {
|
6745
|
+
method: "POST",
|
6746
|
+
path: "/message",
|
6747
|
+
body: SendMessageToPlatformSchema,
|
6748
|
+
responses: {
|
6749
|
+
200: SendMessageResponseSchema,
|
6750
|
+
500: DefaultErrorResponseSchema
|
6751
|
+
}
|
6752
|
+
},
|
6753
|
+
reconnect: {
|
6754
|
+
method: "POST",
|
6755
|
+
path: "/reconnect/:channelId",
|
6756
|
+
pathParams: z90.object({
|
6757
|
+
channelId: z90.string().uuid()
|
6758
|
+
}),
|
6759
|
+
responses: {
|
6760
|
+
200: DefaultSuccessResponseSchema.extend({
|
6761
|
+
channel: ChannelSchema
|
6762
|
+
}),
|
6763
|
+
500: DefaultErrorResponseSchema,
|
6764
|
+
400: DefaultErrorResponseSchema
|
6765
|
+
},
|
6766
|
+
body: null,
|
6767
|
+
summary: "Reconnect telegram channel"
|
6768
|
+
},
|
6769
|
+
delete: {
|
6770
|
+
method: "DELETE",
|
6771
|
+
path: "/delete/:channelId",
|
6772
|
+
pathParams: z90.object({
|
6773
|
+
channelId: z90.string().uuid()
|
6774
|
+
}),
|
6775
|
+
body: null,
|
6776
|
+
responses: {
|
6777
|
+
200: ChannelServiceResponseSchema,
|
6778
|
+
500: DefaultErrorResponseSchema,
|
6779
|
+
400: DefaultErrorResponseSchema
|
6780
|
+
},
|
6781
|
+
summary: "Delete telegram channel"
|
6782
|
+
}
|
6783
|
+
});
|
6784
|
+
|
6785
|
+
// src/notification/index.ts
|
6786
|
+
import { initContract as initContract33 } from "@ts-rest/core";
|
6787
|
+
import z93 from "zod";
|
6676
6788
|
|
6677
6789
|
// src/notification/validation.ts
|
6678
|
-
import
|
6790
|
+
import z92 from "zod";
|
6679
6791
|
|
6680
6792
|
// src/notification/schema.ts
|
6681
|
-
import
|
6682
|
-
var NotificationChangeSchema =
|
6683
|
-
id:
|
6684
|
-
createdAt:
|
6685
|
-
updatedAt:
|
6686
|
-
deletedAt:
|
6687
|
-
actorId:
|
6793
|
+
import z91 from "zod";
|
6794
|
+
var NotificationChangeSchema = z91.object({
|
6795
|
+
id: z91.string().uuid(),
|
6796
|
+
createdAt: z91.date(),
|
6797
|
+
updatedAt: z91.date(),
|
6798
|
+
deletedAt: z91.date().nullable(),
|
6799
|
+
actorId: z91.string().uuid(),
|
6688
6800
|
actor: UserSchema,
|
6689
|
-
notificationObjectId:
|
6690
|
-
readAt:
|
6691
|
-
});
|
6692
|
-
var NotificationObjectSchema =
|
6693
|
-
id:
|
6694
|
-
createdAt:
|
6695
|
-
updatedAt:
|
6696
|
-
deletedAt:
|
6697
|
-
data:
|
6801
|
+
notificationObjectId: z91.string().uuid(),
|
6802
|
+
readAt: z91.date()
|
6803
|
+
});
|
6804
|
+
var NotificationObjectSchema = z91.object({
|
6805
|
+
id: z91.string().uuid(),
|
6806
|
+
createdAt: z91.date(),
|
6807
|
+
updatedAt: z91.date(),
|
6808
|
+
deletedAt: z91.date().nullable(),
|
6809
|
+
data: z91.string(),
|
6698
6810
|
notificationChange: NotificationChangeSchema
|
6699
6811
|
});
|
6700
|
-
var NotificationSchema =
|
6701
|
-
id:
|
6702
|
-
createdAt:
|
6703
|
-
updatedAt:
|
6704
|
-
deletedAt:
|
6705
|
-
notificationObjectId:
|
6706
|
-
notifierId:
|
6812
|
+
var NotificationSchema = z91.object({
|
6813
|
+
id: z91.string().uuid(),
|
6814
|
+
createdAt: z91.date(),
|
6815
|
+
updatedAt: z91.date(),
|
6816
|
+
deletedAt: z91.date().nullable(),
|
6817
|
+
notificationObjectId: z91.string().uuid(),
|
6818
|
+
notifierId: z91.string().uuid(),
|
6707
6819
|
notificationObject: NotificationObjectSchema,
|
6708
|
-
readAt:
|
6820
|
+
readAt: z91.date()
|
6709
6821
|
});
|
6710
6822
|
|
6711
6823
|
// src/notification/validation.ts
|
6712
|
-
var GetNotificationsRequestSchema =
|
6713
|
-
page:
|
6714
|
-
pageSize:
|
6824
|
+
var GetNotificationsRequestSchema = z92.object({
|
6825
|
+
page: z92.coerce.number().default(1),
|
6826
|
+
pageSize: z92.coerce.number().default(10)
|
6715
6827
|
});
|
6716
|
-
var GetNotificationsResponseSchema =
|
6717
|
-
notificationCount:
|
6718
|
-
notifications:
|
6719
|
-
total:
|
6720
|
-
page:
|
6721
|
-
pageSize:
|
6722
|
-
lastPage:
|
6723
|
-
totalUnreadCount:
|
6828
|
+
var GetNotificationsResponseSchema = z92.object({
|
6829
|
+
notificationCount: z92.number(),
|
6830
|
+
notifications: z92.array(NotificationSchema),
|
6831
|
+
total: z92.number(),
|
6832
|
+
page: z92.number(),
|
6833
|
+
pageSize: z92.number(),
|
6834
|
+
lastPage: z92.number(),
|
6835
|
+
totalUnreadCount: z92.number().optional()
|
6724
6836
|
});
|
6725
|
-
var ResetNotificationRequestSchema =
|
6726
|
-
userId:
|
6837
|
+
var ResetNotificationRequestSchema = z92.object({
|
6838
|
+
userId: z92.string()
|
6727
6839
|
});
|
6728
6840
|
|
6729
6841
|
// src/notification/index.ts
|
6730
|
-
var userNotificationContract =
|
6842
|
+
var userNotificationContract = initContract33().router(
|
6731
6843
|
{
|
6732
6844
|
getNotifications: {
|
6733
6845
|
method: "GET",
|
@@ -6737,14 +6849,14 @@ var userNotificationContract = initContract32().router(
|
|
6737
6849
|
200: DefaultSuccessResponseSchema.extend({
|
6738
6850
|
data: GetNotificationsResponseSchema
|
6739
6851
|
}),
|
6740
|
-
400:
|
6741
|
-
message:
|
6852
|
+
400: z93.object({
|
6853
|
+
message: z93.string()
|
6742
6854
|
}),
|
6743
|
-
409:
|
6744
|
-
message:
|
6855
|
+
409: z93.object({
|
6856
|
+
message: z93.string()
|
6745
6857
|
}),
|
6746
|
-
500:
|
6747
|
-
message:
|
6858
|
+
500: z93.object({
|
6859
|
+
message: z93.string()
|
6748
6860
|
}),
|
6749
6861
|
401: DefaultUnauthorizedSchema,
|
6750
6862
|
404: DefaultNotFoundSchema,
|
@@ -6757,16 +6869,16 @@ var userNotificationContract = initContract32().router(
|
|
6757
6869
|
path: "/new_notifications_count",
|
6758
6870
|
responses: {
|
6759
6871
|
200: DefaultSuccessResponseSchema.extend({
|
6760
|
-
total:
|
6872
|
+
total: z93.number()
|
6761
6873
|
}),
|
6762
|
-
400:
|
6763
|
-
message:
|
6874
|
+
400: z93.object({
|
6875
|
+
message: z93.string()
|
6764
6876
|
}),
|
6765
|
-
409:
|
6766
|
-
message:
|
6877
|
+
409: z93.object({
|
6878
|
+
message: z93.string()
|
6767
6879
|
}),
|
6768
|
-
500:
|
6769
|
-
message:
|
6880
|
+
500: z93.object({
|
6881
|
+
message: z93.string()
|
6770
6882
|
}),
|
6771
6883
|
401: DefaultUnauthorizedSchema,
|
6772
6884
|
404: DefaultNotFoundSchema,
|
@@ -6781,14 +6893,14 @@ var userNotificationContract = initContract32().router(
|
|
6781
6893
|
201: DefaultSuccessResponseSchema.extend({
|
6782
6894
|
data: UserSchema
|
6783
6895
|
}),
|
6784
|
-
400:
|
6785
|
-
message:
|
6896
|
+
400: z93.object({
|
6897
|
+
message: z93.string()
|
6786
6898
|
}),
|
6787
|
-
409:
|
6788
|
-
message:
|
6899
|
+
409: z93.object({
|
6900
|
+
message: z93.string()
|
6789
6901
|
}),
|
6790
|
-
500:
|
6791
|
-
message:
|
6902
|
+
500: z93.object({
|
6903
|
+
message: z93.string()
|
6792
6904
|
}),
|
6793
6905
|
401: DefaultUnauthorizedSchema,
|
6794
6906
|
404: DefaultNotFoundSchema,
|
@@ -6800,19 +6912,19 @@ var userNotificationContract = initContract32().router(
|
|
6800
6912
|
readNotification: {
|
6801
6913
|
method: "POST",
|
6802
6914
|
path: "/read/:id",
|
6803
|
-
pathParams:
|
6915
|
+
pathParams: z93.object({ id: z93.string() }),
|
6804
6916
|
responses: {
|
6805
6917
|
201: DefaultSuccessResponseSchema.extend({
|
6806
6918
|
data: NotificationSchema
|
6807
6919
|
}),
|
6808
|
-
400:
|
6809
|
-
message:
|
6920
|
+
400: z93.object({
|
6921
|
+
message: z93.string()
|
6810
6922
|
}),
|
6811
|
-
409:
|
6812
|
-
message:
|
6923
|
+
409: z93.object({
|
6924
|
+
message: z93.string()
|
6813
6925
|
}),
|
6814
|
-
500:
|
6815
|
-
message:
|
6926
|
+
500: z93.object({
|
6927
|
+
message: z93.string()
|
6816
6928
|
}),
|
6817
6929
|
401: DefaultUnauthorizedSchema,
|
6818
6930
|
404: DefaultNotFoundSchema,
|
@@ -6828,68 +6940,68 @@ var userNotificationContract = initContract32().router(
|
|
6828
6940
|
);
|
6829
6941
|
|
6830
6942
|
// src/snippet/index.ts
|
6831
|
-
import { initContract as
|
6832
|
-
import { z as
|
6943
|
+
import { initContract as initContract34 } from "@ts-rest/core";
|
6944
|
+
import { z as z96 } from "zod";
|
6833
6945
|
|
6834
6946
|
// src/snippet/schema.ts
|
6835
|
-
import
|
6947
|
+
import z94 from "zod";
|
6836
6948
|
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
6837
|
-
name:
|
6838
|
-
platformType:
|
6949
|
+
name: z94.string(),
|
6950
|
+
platformType: z94.string()
|
6839
6951
|
});
|
6840
6952
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
6841
|
-
contentType:
|
6842
|
-
contentValue:
|
6843
|
-
contentTemplate:
|
6844
|
-
order:
|
6953
|
+
contentType: z94.string(),
|
6954
|
+
contentValue: z94.string().nullable(),
|
6955
|
+
contentTemplate: z94.any().nullable(),
|
6956
|
+
order: z94.number(),
|
6845
6957
|
upload: UploadSchema.nullable()
|
6846
6958
|
});
|
6847
6959
|
var SnippetSchema = DefaultEntitySchema.extend({
|
6848
|
-
name:
|
6960
|
+
name: z94.string(),
|
6849
6961
|
snippetGroup: SnippetGroupSchema,
|
6850
6962
|
snippetContent: SnippetContentSchema
|
6851
6963
|
});
|
6852
|
-
var SnippetGroupListItemSchema =
|
6853
|
-
id:
|
6854
|
-
name:
|
6964
|
+
var SnippetGroupListItemSchema = z94.object({
|
6965
|
+
id: z94.string().uuid(),
|
6966
|
+
name: z94.string()
|
6855
6967
|
});
|
6856
|
-
var SnippetListItemSchema =
|
6857
|
-
id:
|
6858
|
-
shortCutName:
|
6859
|
-
contentType:
|
6860
|
-
contentValue:
|
6861
|
-
snippetGroupId:
|
6968
|
+
var SnippetListItemSchema = z94.object({
|
6969
|
+
id: z94.string().uuid(),
|
6970
|
+
shortCutName: z94.string(),
|
6971
|
+
contentType: z94.string(),
|
6972
|
+
contentValue: z94.string().nullable(),
|
6973
|
+
snippetGroupId: z94.string()
|
6862
6974
|
});
|
6863
6975
|
|
6864
6976
|
// src/snippet/validation.ts
|
6865
|
-
import { z as
|
6866
|
-
var CreateSnippetGroupSchema =
|
6867
|
-
name:
|
6868
|
-
platformType:
|
6977
|
+
import { z as z95 } from "zod";
|
6978
|
+
var CreateSnippetGroupSchema = z95.object({
|
6979
|
+
name: z95.string(),
|
6980
|
+
platformType: z95.string()
|
6869
6981
|
});
|
6870
|
-
var UpdateSnippetGroupSchema =
|
6871
|
-
name:
|
6872
|
-
platformType:
|
6982
|
+
var UpdateSnippetGroupSchema = z95.object({
|
6983
|
+
name: z95.string().optional(),
|
6984
|
+
platformType: z95.string().optional()
|
6873
6985
|
});
|
6874
|
-
var DeleteSnippetGroupSchema =
|
6875
|
-
id:
|
6986
|
+
var DeleteSnippetGroupSchema = z95.object({
|
6987
|
+
id: z95.string()
|
6876
6988
|
});
|
6877
|
-
var CreateSnippetSchema =
|
6878
|
-
shortcutName:
|
6879
|
-
contentType:
|
6880
|
-
contentValue:
|
6881
|
-
snippetGroupId:
|
6882
|
-
platformType:
|
6989
|
+
var CreateSnippetSchema = z95.object({
|
6990
|
+
shortcutName: z95.string(),
|
6991
|
+
contentType: z95.string(),
|
6992
|
+
contentValue: z95.string().optional(),
|
6993
|
+
snippetGroupId: z95.string(),
|
6994
|
+
platformType: z95.string()
|
6883
6995
|
});
|
6884
6996
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
6885
|
-
snippetContentId:
|
6997
|
+
snippetContentId: z95.string()
|
6886
6998
|
});
|
6887
|
-
var DeleteSnippetSchema =
|
6888
|
-
snippetId:
|
6999
|
+
var DeleteSnippetSchema = z95.object({
|
7000
|
+
snippetId: z95.string()
|
6889
7001
|
});
|
6890
7002
|
|
6891
7003
|
// src/snippet/index.ts
|
6892
|
-
var snippetContract =
|
7004
|
+
var snippetContract = initContract34().router(
|
6893
7005
|
{
|
6894
7006
|
createSnippetGroup: {
|
6895
7007
|
method: "POST",
|
@@ -6908,7 +7020,7 @@ var snippetContract = initContract33().router(
|
|
6908
7020
|
query: null,
|
6909
7021
|
responses: {
|
6910
7022
|
200: DefaultSuccessResponseSchema.extend({
|
6911
|
-
snippetgroups:
|
7023
|
+
snippetgroups: z96.array(SnippetGroupSchema)
|
6912
7024
|
}),
|
6913
7025
|
500: DefaultErrorResponseSchema
|
6914
7026
|
}
|
@@ -6916,7 +7028,7 @@ var snippetContract = initContract33().router(
|
|
6916
7028
|
updateSnippetGroup: {
|
6917
7029
|
method: "PATCH",
|
6918
7030
|
path: "/groups/:id",
|
6919
|
-
pathParams:
|
7031
|
+
pathParams: z96.object({ id: z96.string() }),
|
6920
7032
|
body: UpdateSnippetGroupSchema,
|
6921
7033
|
responses: {
|
6922
7034
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6928,7 +7040,7 @@ var snippetContract = initContract33().router(
|
|
6928
7040
|
deleteSnippetGroup: {
|
6929
7041
|
method: "DELETE",
|
6930
7042
|
path: "/groups/:id",
|
6931
|
-
pathParams:
|
7043
|
+
pathParams: z96.object({ id: z96.string() }),
|
6932
7044
|
body: null,
|
6933
7045
|
responses: {
|
6934
7046
|
200: DefaultSuccessResponseSchema,
|
@@ -6940,7 +7052,7 @@ var snippetContract = initContract33().router(
|
|
6940
7052
|
path: "",
|
6941
7053
|
responses: {
|
6942
7054
|
200: DefaultSuccessResponseSchema.extend({
|
6943
|
-
snippets:
|
7055
|
+
snippets: z96.array(SnippetSchema)
|
6944
7056
|
}),
|
6945
7057
|
500: DefaultErrorResponseSchema
|
6946
7058
|
}
|
@@ -6959,7 +7071,7 @@ var snippetContract = initContract33().router(
|
|
6959
7071
|
updateSnippet: {
|
6960
7072
|
method: "PATCH",
|
6961
7073
|
path: "/:id",
|
6962
|
-
pathParams:
|
7074
|
+
pathParams: z96.object({ id: z96.string() }),
|
6963
7075
|
body: UpdateSnippetSchema,
|
6964
7076
|
responses: {
|
6965
7077
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6971,7 +7083,7 @@ var snippetContract = initContract33().router(
|
|
6971
7083
|
deleteSnippet: {
|
6972
7084
|
method: "DELETE",
|
6973
7085
|
path: "/:id",
|
6974
|
-
pathParams:
|
7086
|
+
pathParams: z96.object({ id: z96.string() }),
|
6975
7087
|
body: null,
|
6976
7088
|
responses: {
|
6977
7089
|
200: DefaultSuccessResponseSchema,
|
@@ -6985,81 +7097,81 @@ var snippetContract = initContract33().router(
|
|
6985
7097
|
);
|
6986
7098
|
|
6987
7099
|
// src/subscription/index.ts
|
6988
|
-
import { initContract as
|
6989
|
-
import { z as
|
7100
|
+
import { initContract as initContract35 } from "@ts-rest/core";
|
7101
|
+
import { z as z99 } from "zod";
|
6990
7102
|
|
6991
7103
|
// src/subscription/schema.ts
|
6992
|
-
import
|
7104
|
+
import z97 from "zod";
|
6993
7105
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
6994
|
-
priceId:
|
6995
|
-
name:
|
6996
|
-
perUnit:
|
6997
|
-
price:
|
6998
|
-
currency:
|
7106
|
+
priceId: z97.string(),
|
7107
|
+
name: z97.string().nullable(),
|
7108
|
+
perUnit: z97.number(),
|
7109
|
+
price: z97.number(),
|
7110
|
+
currency: z97.string().nullable()
|
6999
7111
|
});
|
7000
7112
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
7001
|
-
provider:
|
7002
|
-
productId:
|
7003
|
-
name:
|
7004
|
-
type:
|
7005
|
-
omnichannel:
|
7006
|
-
usageType:
|
7113
|
+
provider: z97.string(),
|
7114
|
+
productId: z97.string(),
|
7115
|
+
name: z97.string(),
|
7116
|
+
type: z97.string(),
|
7117
|
+
omnichannel: z97.string(),
|
7118
|
+
usageType: z97.string().nullable(),
|
7007
7119
|
productPrice: ProductPriceSchema
|
7008
7120
|
});
|
7009
7121
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
7010
|
-
includedQuantity:
|
7122
|
+
includedQuantity: z97.number(),
|
7011
7123
|
product: ProductWithoutRelatedSchema
|
7012
7124
|
});
|
7013
7125
|
var ProductSchema = DefaultEntitySchema.extend({
|
7014
|
-
provider:
|
7015
|
-
productId:
|
7016
|
-
name:
|
7017
|
-
type:
|
7018
|
-
omnichannel:
|
7019
|
-
usageType:
|
7126
|
+
provider: z97.string(),
|
7127
|
+
productId: z97.string(),
|
7128
|
+
name: z97.string(),
|
7129
|
+
type: z97.string(),
|
7130
|
+
omnichannel: z97.string(),
|
7131
|
+
usageType: z97.string().nullable(),
|
7020
7132
|
productPrice: ProductPriceSchema,
|
7021
|
-
relatedProducts:
|
7133
|
+
relatedProducts: z97.array(RelatedProductSchema)
|
7022
7134
|
});
|
7023
7135
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
7024
|
-
limit:
|
7025
|
-
subscriptionItemId:
|
7026
|
-
usage:
|
7136
|
+
limit: z97.number(),
|
7137
|
+
subscriptionItemId: z97.string(),
|
7138
|
+
usage: z97.number().nullable(),
|
7027
7139
|
product: ProductSchema
|
7028
7140
|
});
|
7029
7141
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
7030
|
-
provider:
|
7031
|
-
type:
|
7032
|
-
subscriptionId:
|
7033
|
-
interval:
|
7034
|
-
quantity:
|
7035
|
-
amount:
|
7036
|
-
startAt:
|
7037
|
-
expireAt:
|
7038
|
-
status:
|
7039
|
-
name:
|
7040
|
-
subscriptionProducts:
|
7142
|
+
provider: z97.string(),
|
7143
|
+
type: z97.string(),
|
7144
|
+
subscriptionId: z97.string(),
|
7145
|
+
interval: z97.string(),
|
7146
|
+
quantity: z97.number(),
|
7147
|
+
amount: z97.number(),
|
7148
|
+
startAt: z97.date().nullable(),
|
7149
|
+
expireAt: z97.date(),
|
7150
|
+
status: z97.string(),
|
7151
|
+
name: z97.string().nullable(),
|
7152
|
+
subscriptionProducts: z97.array(SubscriptionProuctSchema),
|
7041
7153
|
productPrice: ProductPriceSchema,
|
7042
7154
|
product: ProductSchema
|
7043
7155
|
});
|
7044
7156
|
|
7045
7157
|
// src/subscription/validation.ts
|
7046
|
-
import { z as
|
7047
|
-
var UpdateSubscriptionSchema =
|
7048
|
-
planProductId:
|
7049
|
-
subscriptionId:
|
7050
|
-
subscriptionProducts:
|
7051
|
-
|
7052
|
-
productId:
|
7053
|
-
quantity:
|
7158
|
+
import { z as z98 } from "zod";
|
7159
|
+
var UpdateSubscriptionSchema = z98.object({
|
7160
|
+
planProductId: z98.string(),
|
7161
|
+
subscriptionId: z98.string(),
|
7162
|
+
subscriptionProducts: z98.array(
|
7163
|
+
z98.object({
|
7164
|
+
productId: z98.string(),
|
7165
|
+
quantity: z98.number()
|
7054
7166
|
})
|
7055
7167
|
)
|
7056
7168
|
});
|
7057
|
-
var TopUpBalanceSchema =
|
7058
|
-
quantity:
|
7169
|
+
var TopUpBalanceSchema = z98.object({
|
7170
|
+
quantity: z98.number()
|
7059
7171
|
});
|
7060
7172
|
|
7061
7173
|
// src/subscription/index.ts
|
7062
|
-
var subscriptionContract =
|
7174
|
+
var subscriptionContract = initContract35().router(
|
7063
7175
|
{
|
7064
7176
|
getSubscription: {
|
7065
7177
|
method: "GET",
|
@@ -7078,9 +7190,9 @@ var subscriptionContract = initContract34().router(
|
|
7078
7190
|
body: UpdateSubscriptionSchema,
|
7079
7191
|
responses: {
|
7080
7192
|
200: DefaultSuccessResponseSchema.extend({
|
7081
|
-
message:
|
7082
|
-
requireCheckout:
|
7083
|
-
checkoutUrl:
|
7193
|
+
message: z99.string(),
|
7194
|
+
requireCheckout: z99.boolean(),
|
7195
|
+
checkoutUrl: z99.string().nullable()
|
7084
7196
|
}),
|
7085
7197
|
500: DefaultErrorResponseSchema
|
7086
7198
|
}
|
@@ -7091,7 +7203,7 @@ var subscriptionContract = initContract34().router(
|
|
7091
7203
|
body: TopUpBalanceSchema,
|
7092
7204
|
responses: {
|
7093
7205
|
200: DefaultSuccessResponseSchema.extend({
|
7094
|
-
checkoutUrl:
|
7206
|
+
checkoutUrl: z99.string()
|
7095
7207
|
}),
|
7096
7208
|
500: DefaultErrorResponseSchema
|
7097
7209
|
}
|
@@ -7102,7 +7214,7 @@ var subscriptionContract = initContract34().router(
|
|
7102
7214
|
query: null,
|
7103
7215
|
responses: {
|
7104
7216
|
200: DefaultSuccessResponseSchema.extend({
|
7105
|
-
data:
|
7217
|
+
data: z99.array(ProductSchema)
|
7106
7218
|
}),
|
7107
7219
|
500: DefaultErrorResponseSchema
|
7108
7220
|
}
|
@@ -7114,81 +7226,81 @@ var subscriptionContract = initContract34().router(
|
|
7114
7226
|
);
|
7115
7227
|
|
7116
7228
|
// src/business-calendar/index.ts
|
7117
|
-
import { initContract as
|
7229
|
+
import { initContract as initContract36 } from "@ts-rest/core";
|
7118
7230
|
|
7119
7231
|
// src/business-calendar/validation.ts
|
7120
|
-
import
|
7121
|
-
var TimeSlotDataSchema =
|
7122
|
-
var CreateBusinessHourSchema =
|
7123
|
-
day:
|
7124
|
-
isEnabled:
|
7232
|
+
import z100 from "zod";
|
7233
|
+
var TimeSlotDataSchema = z100.any();
|
7234
|
+
var CreateBusinessHourSchema = z100.object({
|
7235
|
+
day: z100.string(),
|
7236
|
+
isEnabled: z100.boolean(),
|
7125
7237
|
timeSlots: TimeSlotDataSchema
|
7126
7238
|
}).array();
|
7127
|
-
var UpdateBusinessHourSchema =
|
7128
|
-
id:
|
7129
|
-
day:
|
7130
|
-
isEnabled:
|
7239
|
+
var UpdateBusinessHourSchema = z100.object({
|
7240
|
+
id: z100.string(),
|
7241
|
+
day: z100.string(),
|
7242
|
+
isEnabled: z100.boolean(),
|
7131
7243
|
timeSlots: TimeSlotDataSchema
|
7132
7244
|
}).array();
|
7133
|
-
var CreateHolidaySchema =
|
7134
|
-
name:
|
7135
|
-
date:
|
7136
|
-
isEnabled:
|
7245
|
+
var CreateHolidaySchema = z100.object({
|
7246
|
+
name: z100.string(),
|
7247
|
+
date: z100.string(),
|
7248
|
+
isEnabled: z100.boolean()
|
7137
7249
|
}).array();
|
7138
|
-
var UpdateHolidaySchema =
|
7139
|
-
id:
|
7140
|
-
name:
|
7141
|
-
date:
|
7142
|
-
isEnabled:
|
7250
|
+
var UpdateHolidaySchema = z100.object({
|
7251
|
+
id: z100.string().optional(),
|
7252
|
+
name: z100.string(),
|
7253
|
+
date: z100.string(),
|
7254
|
+
isEnabled: z100.boolean()
|
7143
7255
|
}).array();
|
7144
|
-
var CreateBusinessCalendarSchema =
|
7145
|
-
name:
|
7146
|
-
description:
|
7147
|
-
timeZone:
|
7148
|
-
isEnabled:
|
7256
|
+
var CreateBusinessCalendarSchema = z100.object({
|
7257
|
+
name: z100.string(),
|
7258
|
+
description: z100.string().optional(),
|
7259
|
+
timeZone: z100.string(),
|
7260
|
+
isEnabled: z100.boolean(),
|
7149
7261
|
businessHours: CreateBusinessHourSchema,
|
7150
7262
|
holidays: CreateHolidaySchema
|
7151
7263
|
});
|
7152
|
-
var UpdateBusinessCalendarSchema =
|
7153
|
-
id:
|
7154
|
-
name:
|
7155
|
-
description:
|
7156
|
-
timeZone:
|
7157
|
-
isEnabled:
|
7264
|
+
var UpdateBusinessCalendarSchema = z100.object({
|
7265
|
+
id: z100.string(),
|
7266
|
+
name: z100.string(),
|
7267
|
+
description: z100.string().optional(),
|
7268
|
+
timeZone: z100.string(),
|
7269
|
+
isEnabled: z100.boolean(),
|
7158
7270
|
businessHours: UpdateBusinessHourSchema,
|
7159
7271
|
holidays: UpdateHolidaySchema
|
7160
7272
|
});
|
7161
|
-
var DeleteBusinessCalendarSchema =
|
7162
|
-
id:
|
7273
|
+
var DeleteBusinessCalendarSchema = z100.object({
|
7274
|
+
id: z100.string()
|
7163
7275
|
});
|
7164
7276
|
|
7165
7277
|
// src/business-calendar/schema.ts
|
7166
|
-
import
|
7167
|
-
var TimeSlotDataSchema2 =
|
7278
|
+
import z101 from "zod";
|
7279
|
+
var TimeSlotDataSchema2 = z101.any();
|
7168
7280
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
7169
|
-
day:
|
7170
|
-
isEnabled:
|
7281
|
+
day: z101.string(),
|
7282
|
+
isEnabled: z101.boolean(),
|
7171
7283
|
timeSlots: TimeSlotDataSchema2
|
7172
7284
|
});
|
7173
7285
|
var HolidaySchema = DefaultEntitySchema.extend({
|
7174
|
-
name:
|
7175
|
-
date:
|
7176
|
-
isEnabled:
|
7177
|
-
isDefault:
|
7286
|
+
name: z101.string(),
|
7287
|
+
date: z101.string(),
|
7288
|
+
isEnabled: z101.boolean(),
|
7289
|
+
isDefault: z101.boolean()
|
7178
7290
|
});
|
7179
7291
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
7180
|
-
name:
|
7181
|
-
description:
|
7182
|
-
timeZone:
|
7183
|
-
isEnabled:
|
7184
|
-
isDefault:
|
7292
|
+
name: z101.string(),
|
7293
|
+
description: z101.string().optional(),
|
7294
|
+
timeZone: z101.string(),
|
7295
|
+
isEnabled: z101.boolean(),
|
7296
|
+
isDefault: z101.boolean(),
|
7185
7297
|
businessHours: BusinessHourSchema.array(),
|
7186
7298
|
holidays: HolidaySchema.array()
|
7187
7299
|
});
|
7188
7300
|
|
7189
7301
|
// src/business-calendar/index.ts
|
7190
|
-
import
|
7191
|
-
var businessCalendarContract =
|
7302
|
+
import z102 from "zod";
|
7303
|
+
var businessCalendarContract = initContract36().router({
|
7192
7304
|
createBusinessCalendar: {
|
7193
7305
|
method: "POST",
|
7194
7306
|
path: "business-calendar",
|
@@ -7213,7 +7325,7 @@ var businessCalendarContract = initContract35().router({
|
|
7213
7325
|
updateBusinessCalendar: {
|
7214
7326
|
method: "POST",
|
7215
7327
|
path: "business-calendars/:id",
|
7216
|
-
pathParams:
|
7328
|
+
pathParams: z102.object({ id: z102.string() }),
|
7217
7329
|
body: UpdateBusinessCalendarSchema,
|
7218
7330
|
responses: {
|
7219
7331
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -7225,7 +7337,7 @@ var businessCalendarContract = initContract35().router({
|
|
7225
7337
|
deleteBusinessCalendar: {
|
7226
7338
|
method: "DELETE",
|
7227
7339
|
path: "business-calendars/:id",
|
7228
|
-
pathParams:
|
7340
|
+
pathParams: z102.object({ id: z102.string() }),
|
7229
7341
|
body: null,
|
7230
7342
|
responses: {
|
7231
7343
|
200: DefaultSuccessResponseSchema,
|
@@ -7235,77 +7347,77 @@ var businessCalendarContract = initContract35().router({
|
|
7235
7347
|
});
|
7236
7348
|
|
7237
7349
|
// src/facebook-feed/index.ts
|
7238
|
-
import { initContract as
|
7350
|
+
import { initContract as initContract37 } from "@ts-rest/core";
|
7239
7351
|
|
7240
7352
|
// src/facebook-feed/validation.ts
|
7241
|
-
import
|
7242
|
-
var GetFacebookPagesSchema2 =
|
7243
|
-
data:
|
7244
|
-
|
7353
|
+
import z103 from "zod";
|
7354
|
+
var GetFacebookPagesSchema2 = z103.object({
|
7355
|
+
data: z103.array(
|
7356
|
+
z103.object({
|
7245
7357
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
7246
|
-
access_token:
|
7247
|
-
category:
|
7358
|
+
access_token: z103.string(),
|
7359
|
+
category: z103.string(),
|
7248
7360
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
7249
|
-
category_list:
|
7250
|
-
|
7251
|
-
id:
|
7252
|
-
name:
|
7361
|
+
category_list: z103.array(
|
7362
|
+
z103.object({
|
7363
|
+
id: z103.string(),
|
7364
|
+
name: z103.string()
|
7253
7365
|
})
|
7254
7366
|
),
|
7255
|
-
id:
|
7256
|
-
name:
|
7257
|
-
tasks:
|
7367
|
+
id: z103.string(),
|
7368
|
+
name: z103.string(),
|
7369
|
+
tasks: z103.string().array()
|
7258
7370
|
})
|
7259
7371
|
),
|
7260
|
-
paging:
|
7261
|
-
cursors:
|
7262
|
-
before:
|
7263
|
-
after:
|
7372
|
+
paging: z103.object({
|
7373
|
+
cursors: z103.object({
|
7374
|
+
before: z103.string().optional(),
|
7375
|
+
after: z103.string().optional()
|
7264
7376
|
})
|
7265
7377
|
}).optional()
|
7266
7378
|
});
|
7267
|
-
var GetFacebookPagesQuerySchema2 =
|
7268
|
-
accessToken:
|
7269
|
-
userId:
|
7379
|
+
var GetFacebookPagesQuerySchema2 = z103.object({
|
7380
|
+
accessToken: z103.string(),
|
7381
|
+
userId: z103.string()
|
7270
7382
|
});
|
7271
7383
|
var ReconnectFacebookFeedSchema = ChannelSchema.merge(
|
7272
|
-
|
7273
|
-
isReloginRequired:
|
7274
|
-
platformContacts:
|
7275
|
-
id:
|
7276
|
-
name:
|
7277
|
-
createdAt:
|
7278
|
-
updatedAt:
|
7279
|
-
deletedAt:
|
7384
|
+
z103.object({
|
7385
|
+
isReloginRequired: z103.boolean(),
|
7386
|
+
platformContacts: z103.array(PlatformContactSchema),
|
7387
|
+
id: z103.string().uuid(),
|
7388
|
+
name: z103.string(),
|
7389
|
+
createdAt: z103.date(),
|
7390
|
+
updatedAt: z103.date(),
|
7391
|
+
deletedAt: z103.date().nullable()
|
7280
7392
|
})
|
7281
7393
|
);
|
7282
|
-
var GetFeedPostResponseSchema =
|
7283
|
-
id:
|
7284
|
-
message:
|
7285
|
-
created_time:
|
7286
|
-
can_reply_privately:
|
7287
|
-
from:
|
7288
|
-
permalink_url:
|
7289
|
-
attachments:
|
7290
|
-
data:
|
7291
|
-
|
7292
|
-
media:
|
7293
|
-
image:
|
7294
|
-
height:
|
7295
|
-
src:
|
7296
|
-
width:
|
7394
|
+
var GetFeedPostResponseSchema = z103.object({
|
7395
|
+
id: z103.string(),
|
7396
|
+
message: z103.string(),
|
7397
|
+
created_time: z103.string(),
|
7398
|
+
can_reply_privately: z103.boolean(),
|
7399
|
+
from: z103.object({ name: z103.string(), id: z103.string() }),
|
7400
|
+
permalink_url: z103.string(),
|
7401
|
+
attachments: z103.object({
|
7402
|
+
data: z103.array(
|
7403
|
+
z103.object({
|
7404
|
+
media: z103.object({
|
7405
|
+
image: z103.object({
|
7406
|
+
height: z103.number(),
|
7407
|
+
src: z103.string(),
|
7408
|
+
width: z103.number()
|
7297
7409
|
})
|
7298
7410
|
}),
|
7299
|
-
media_type:
|
7300
|
-
url:
|
7411
|
+
media_type: z103.string(),
|
7412
|
+
url: z103.string()
|
7301
7413
|
})
|
7302
7414
|
)
|
7303
7415
|
})
|
7304
7416
|
});
|
7305
7417
|
|
7306
7418
|
// src/facebook-feed/index.ts
|
7307
|
-
import
|
7308
|
-
var facebookFeedContract =
|
7419
|
+
import z104 from "zod";
|
7420
|
+
var facebookFeedContract = initContract37().router({
|
7309
7421
|
connectToService: {
|
7310
7422
|
method: "POST",
|
7311
7423
|
path: "/connect",
|
@@ -7329,8 +7441,8 @@ var facebookFeedContract = initContract36().router({
|
|
7329
7441
|
reconnect: {
|
7330
7442
|
method: "POST",
|
7331
7443
|
path: "/reconnect/:channelId",
|
7332
|
-
pathParams:
|
7333
|
-
channelId:
|
7444
|
+
pathParams: z104.object({
|
7445
|
+
channelId: z104.string().uuid()
|
7334
7446
|
}),
|
7335
7447
|
body: null,
|
7336
7448
|
responses: {
|
@@ -7342,8 +7454,8 @@ var facebookFeedContract = initContract36().router({
|
|
7342
7454
|
delete: {
|
7343
7455
|
method: "DELETE",
|
7344
7456
|
path: "/delete/:channelId",
|
7345
|
-
pathParams:
|
7346
|
-
channelId:
|
7457
|
+
pathParams: z104.object({
|
7458
|
+
channelId: z104.string().uuid()
|
7347
7459
|
}),
|
7348
7460
|
body: null,
|
7349
7461
|
responses: {
|
@@ -7394,169 +7506,169 @@ var facebookFeedContract = initContract36().router({
|
|
7394
7506
|
});
|
7395
7507
|
|
7396
7508
|
// src/public-api/index.ts
|
7397
|
-
import { initContract as
|
7398
|
-
import
|
7509
|
+
import { initContract as initContract38 } from "@ts-rest/core";
|
7510
|
+
import z107 from "zod";
|
7399
7511
|
|
7400
7512
|
// src/public-api/validation.ts
|
7401
|
-
import
|
7513
|
+
import z106 from "zod";
|
7402
7514
|
|
7403
7515
|
// src/public-api/schema.ts
|
7404
|
-
import
|
7405
|
-
var ContactPhonesSchema2 =
|
7406
|
-
id:
|
7407
|
-
createdAt:
|
7408
|
-
updatedAt:
|
7409
|
-
deletedAt:
|
7410
|
-
phone:
|
7411
|
-
isPrimary:
|
7412
|
-
});
|
7413
|
-
var ContactEmailsSchema2 =
|
7414
|
-
id:
|
7415
|
-
createdAt:
|
7416
|
-
updatedAt:
|
7417
|
-
deletedAt:
|
7418
|
-
email:
|
7419
|
-
isPrimary:
|
7420
|
-
});
|
7421
|
-
var ContactCustomFieldSchema2 =
|
7422
|
-
id:
|
7423
|
-
createdAt:
|
7424
|
-
updatedAt:
|
7425
|
-
deletedAt:
|
7426
|
-
textValue:
|
7427
|
-
booleanValue:
|
7428
|
-
numberValue:
|
7429
|
-
dateValue:
|
7516
|
+
import z105 from "zod";
|
7517
|
+
var ContactPhonesSchema2 = z105.object({
|
7518
|
+
id: z105.string().uuid(),
|
7519
|
+
createdAt: z105.date(),
|
7520
|
+
updatedAt: z105.date(),
|
7521
|
+
deletedAt: z105.date().nullable(),
|
7522
|
+
phone: z105.string(),
|
7523
|
+
isPrimary: z105.boolean()
|
7524
|
+
});
|
7525
|
+
var ContactEmailsSchema2 = z105.object({
|
7526
|
+
id: z105.string().uuid(),
|
7527
|
+
createdAt: z105.date(),
|
7528
|
+
updatedAt: z105.date(),
|
7529
|
+
deletedAt: z105.date().nullable(),
|
7530
|
+
email: z105.string(),
|
7531
|
+
isPrimary: z105.boolean()
|
7532
|
+
});
|
7533
|
+
var ContactCustomFieldSchema2 = z105.object({
|
7534
|
+
id: z105.string().uuid(),
|
7535
|
+
createdAt: z105.date(),
|
7536
|
+
updatedAt: z105.date(),
|
7537
|
+
deletedAt: z105.date().nullable(),
|
7538
|
+
textValue: z105.string().nullable(),
|
7539
|
+
booleanValue: z105.boolean().nullable(),
|
7540
|
+
numberValue: z105.number().nullable(),
|
7541
|
+
dateValue: z105.date().nullable(),
|
7430
7542
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
7431
|
-
uploads:
|
7432
|
-
});
|
7433
|
-
var ContactEntityTypesSchema2 =
|
7434
|
-
id:
|
7435
|
-
createdAt:
|
7436
|
-
updatedAt:
|
7437
|
-
deletedAt:
|
7438
|
-
entity:
|
7439
|
-
description:
|
7440
|
-
});
|
7441
|
-
var ContactActivitySchema2 =
|
7442
|
-
id:
|
7443
|
-
createdAt:
|
7444
|
-
updatedAt:
|
7445
|
-
deletedAt:
|
7446
|
-
entityId:
|
7447
|
-
description:
|
7543
|
+
uploads: z105.array(UploadSchema)
|
7544
|
+
});
|
7545
|
+
var ContactEntityTypesSchema2 = z105.object({
|
7546
|
+
id: z105.string().uuid(),
|
7547
|
+
createdAt: z105.date(),
|
7548
|
+
updatedAt: z105.date(),
|
7549
|
+
deletedAt: z105.date().nullable(),
|
7550
|
+
entity: z105.string(),
|
7551
|
+
description: z105.string().nullable()
|
7552
|
+
});
|
7553
|
+
var ContactActivitySchema2 = z105.object({
|
7554
|
+
id: z105.string().uuid(),
|
7555
|
+
createdAt: z105.date(),
|
7556
|
+
updatedAt: z105.date(),
|
7557
|
+
deletedAt: z105.date().nullable(),
|
7558
|
+
entityId: z105.string(),
|
7559
|
+
description: z105.string(),
|
7448
7560
|
entityType: ContactEntityTypesSchema2
|
7449
7561
|
});
|
7450
|
-
var ContactSchema2 =
|
7451
|
-
id:
|
7452
|
-
createdAt:
|
7453
|
-
updatedAt:
|
7454
|
-
deletedAt:
|
7455
|
-
name:
|
7456
|
-
address:
|
7457
|
-
channel:
|
7458
|
-
notes:
|
7459
|
-
contactProfile:
|
7460
|
-
socialProfileUrl:
|
7461
|
-
tags:
|
7562
|
+
var ContactSchema2 = z105.object({
|
7563
|
+
id: z105.string().uuid(),
|
7564
|
+
createdAt: z105.date(),
|
7565
|
+
updatedAt: z105.date(),
|
7566
|
+
deletedAt: z105.date().nullable(),
|
7567
|
+
name: z105.string(),
|
7568
|
+
address: z105.string().nullable(),
|
7569
|
+
channel: z105.string().nullable(),
|
7570
|
+
notes: z105.string().nullable(),
|
7571
|
+
contactProfile: z105.string().nullable(),
|
7572
|
+
socialProfileUrl: z105.string().nullable(),
|
7573
|
+
tags: z105.array(TagSchema),
|
7462
7574
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
7463
|
-
customFields:
|
7464
|
-
contactEmails:
|
7465
|
-
contactPhones:
|
7466
|
-
activityLogs:
|
7575
|
+
customFields: z105.array(ContactCustomFieldSchema2),
|
7576
|
+
contactEmails: z105.array(ContactEmailsSchema2),
|
7577
|
+
contactPhones: z105.array(ContactPhonesSchema2),
|
7578
|
+
activityLogs: z105.array(ContactActivitySchema2).optional()
|
7467
7579
|
});
|
7468
7580
|
|
7469
7581
|
// src/public-api/validation.ts
|
7470
7582
|
var ContactContractValidationSchema2 = {
|
7471
7583
|
create: {
|
7472
|
-
request:
|
7473
|
-
name:
|
7474
|
-
email:
|
7475
|
-
|
7476
|
-
email:
|
7477
|
-
isPrimary:
|
7584
|
+
request: z106.object({
|
7585
|
+
name: z106.string(),
|
7586
|
+
email: z106.array(
|
7587
|
+
z106.object({
|
7588
|
+
email: z106.string().email(),
|
7589
|
+
isPrimary: z106.boolean()
|
7478
7590
|
})
|
7479
7591
|
).optional(),
|
7480
|
-
channel:
|
7481
|
-
address:
|
7482
|
-
phone:
|
7483
|
-
|
7484
|
-
phone:
|
7485
|
-
isPrimary:
|
7592
|
+
channel: z106.string().optional(),
|
7593
|
+
address: z106.string().optional(),
|
7594
|
+
phone: z106.array(
|
7595
|
+
z106.object({
|
7596
|
+
phone: z106.string(),
|
7597
|
+
isPrimary: z106.boolean()
|
7486
7598
|
})
|
7487
7599
|
).optional(),
|
7488
|
-
notes:
|
7489
|
-
tags:
|
7490
|
-
company:
|
7491
|
-
customFields:
|
7600
|
+
notes: z106.string().optional(),
|
7601
|
+
tags: z106.array(z106.string()).optional(),
|
7602
|
+
company: z106.string().optional(),
|
7603
|
+
customFields: z106.record(z106.string())
|
7492
7604
|
// Dynamic keys with string values
|
7493
7605
|
}),
|
7494
7606
|
response: ContactSchema2
|
7495
7607
|
},
|
7496
7608
|
getById: {
|
7497
|
-
request:
|
7498
|
-
id:
|
7609
|
+
request: z106.object({
|
7610
|
+
id: z106.string().uuid()
|
7499
7611
|
})
|
7500
7612
|
},
|
7501
7613
|
delete: {
|
7502
|
-
request:
|
7503
|
-
id:
|
7614
|
+
request: z106.object({
|
7615
|
+
id: z106.string().uuid()
|
7504
7616
|
})
|
7505
7617
|
},
|
7506
7618
|
getAll: {
|
7507
|
-
request:
|
7508
|
-
page:
|
7509
|
-
pageSize:
|
7510
|
-
keyword:
|
7511
|
-
company:
|
7512
|
-
name:
|
7513
|
-
address:
|
7514
|
-
channel:
|
7515
|
-
selectedDate:
|
7516
|
-
customFields:
|
7517
|
-
|
7518
|
-
attributeId:
|
7519
|
-
type:
|
7520
|
-
value:
|
7619
|
+
request: z106.object({
|
7620
|
+
page: z106.coerce.number().default(1),
|
7621
|
+
pageSize: z106.coerce.number().default(10),
|
7622
|
+
keyword: z106.string().optional(),
|
7623
|
+
company: z106.array(z106.string().uuid()),
|
7624
|
+
name: z106.string(),
|
7625
|
+
address: z106.string(),
|
7626
|
+
channel: z106.array(z106.string()),
|
7627
|
+
selectedDate: z106.string(),
|
7628
|
+
customFields: z106.array(
|
7629
|
+
z106.object({
|
7630
|
+
attributeId: z106.string().uuid(),
|
7631
|
+
type: z106.string(),
|
7632
|
+
value: z106.union([z106.string(), z106.array(z106.string())])
|
7521
7633
|
})
|
7522
7634
|
),
|
7523
|
-
tags:
|
7524
|
-
phone:
|
7525
|
-
email:
|
7526
|
-
notes:
|
7635
|
+
tags: z106.array(z106.string().uuid()),
|
7636
|
+
phone: z106.string(),
|
7637
|
+
email: z106.string(),
|
7638
|
+
notes: z106.string()
|
7527
7639
|
}).partial(),
|
7528
7640
|
response: {
|
7529
|
-
page:
|
7530
|
-
pageSize:
|
7531
|
-
total:
|
7532
|
-
lastPage:
|
7533
|
-
data:
|
7641
|
+
page: z106.number(),
|
7642
|
+
pageSize: z106.number(),
|
7643
|
+
total: z106.number(),
|
7644
|
+
lastPage: z106.number(),
|
7645
|
+
data: z106.array(ContactSchema2)
|
7534
7646
|
}
|
7535
7647
|
},
|
7536
7648
|
getContactFields: {
|
7537
|
-
request:
|
7538
|
-
page:
|
7539
|
-
pageSize:
|
7649
|
+
request: z106.object({
|
7650
|
+
page: z106.coerce.number().default(1),
|
7651
|
+
pageSize: z106.coerce.number().default(10)
|
7540
7652
|
}).partial(),
|
7541
7653
|
response: {
|
7542
|
-
page:
|
7543
|
-
pageSize:
|
7544
|
-
total:
|
7545
|
-
lastPage:
|
7546
|
-
data:
|
7654
|
+
page: z106.number(),
|
7655
|
+
pageSize: z106.number(),
|
7656
|
+
total: z106.number(),
|
7657
|
+
lastPage: z106.number(),
|
7658
|
+
data: z106.array(ContactCustomFieldSchema2)
|
7547
7659
|
}
|
7548
7660
|
},
|
7549
7661
|
addAttachments: {
|
7550
|
-
request:
|
7551
|
-
contactId:
|
7552
|
-
attributeId:
|
7553
|
-
contactAttachmentRecords:
|
7554
|
-
|
7555
|
-
bucketName:
|
7556
|
-
fileKey:
|
7557
|
-
fileName:
|
7558
|
-
fileSize:
|
7559
|
-
url:
|
7662
|
+
request: z106.object({
|
7663
|
+
contactId: z106.string(),
|
7664
|
+
attributeId: z106.string().uuid(),
|
7665
|
+
contactAttachmentRecords: z106.array(
|
7666
|
+
z106.object({
|
7667
|
+
bucketName: z106.string(),
|
7668
|
+
fileKey: z106.string(),
|
7669
|
+
fileName: z106.string(),
|
7670
|
+
fileSize: z106.coerce.number(),
|
7671
|
+
url: z106.string()
|
7560
7672
|
})
|
7561
7673
|
)
|
7562
7674
|
}),
|
@@ -7565,7 +7677,7 @@ var ContactContractValidationSchema2 = {
|
|
7565
7677
|
};
|
7566
7678
|
|
7567
7679
|
// src/public-api/index.ts
|
7568
|
-
var publicApiContract =
|
7680
|
+
var publicApiContract = initContract38().router(
|
7569
7681
|
{
|
7570
7682
|
createContact: {
|
7571
7683
|
method: "POST",
|
@@ -7575,11 +7687,11 @@ var publicApiContract = initContract37().router(
|
|
7575
7687
|
201: DefaultSuccessResponseSchema.extend({
|
7576
7688
|
data: ContactSchema2
|
7577
7689
|
}),
|
7578
|
-
400:
|
7579
|
-
message:
|
7690
|
+
400: z107.object({
|
7691
|
+
message: z107.string()
|
7580
7692
|
}),
|
7581
|
-
409:
|
7582
|
-
message:
|
7693
|
+
409: z107.object({
|
7694
|
+
message: z107.string()
|
7583
7695
|
}),
|
7584
7696
|
401: DefaultUnauthorizedSchema,
|
7585
7697
|
404: DefaultNotFoundSchema,
|
@@ -7594,13 +7706,13 @@ var publicApiContract = initContract37().router(
|
|
7594
7706
|
query: GetTagsSchema,
|
7595
7707
|
responses: {
|
7596
7708
|
200: DefaultSuccessResponseSchema.extend({
|
7597
|
-
tags:
|
7709
|
+
tags: z107.array(TagSchema)
|
7598
7710
|
}),
|
7599
|
-
400:
|
7600
|
-
message:
|
7711
|
+
400: z107.object({
|
7712
|
+
message: z107.string()
|
7601
7713
|
}),
|
7602
|
-
409:
|
7603
|
-
message:
|
7714
|
+
409: z107.object({
|
7715
|
+
message: z107.string()
|
7604
7716
|
}),
|
7605
7717
|
401: DefaultUnauthorizedSchema,
|
7606
7718
|
404: DefaultNotFoundSchema,
|
@@ -7616,11 +7728,11 @@ var publicApiContract = initContract37().router(
|
|
7616
7728
|
200: DefaultSuccessResponseSchema.extend(
|
7617
7729
|
ContactContractValidationSchema2.getAll.response
|
7618
7730
|
),
|
7619
|
-
400:
|
7620
|
-
message:
|
7731
|
+
400: z107.object({
|
7732
|
+
message: z107.string()
|
7621
7733
|
}),
|
7622
|
-
409:
|
7623
|
-
message:
|
7734
|
+
409: z107.object({
|
7735
|
+
message: z107.string()
|
7624
7736
|
}),
|
7625
7737
|
401: DefaultUnauthorizedSchema,
|
7626
7738
|
404: DefaultNotFoundSchema,
|
@@ -7637,11 +7749,11 @@ var publicApiContract = initContract37().router(
|
|
7637
7749
|
200: DefaultSuccessResponseSchema.extend(
|
7638
7750
|
ContactContractValidationSchema2.getContactFields.response
|
7639
7751
|
),
|
7640
|
-
400:
|
7641
|
-
message:
|
7752
|
+
400: z107.object({
|
7753
|
+
message: z107.string()
|
7642
7754
|
}),
|
7643
|
-
409:
|
7644
|
-
message:
|
7755
|
+
409: z107.object({
|
7756
|
+
message: z107.string()
|
7645
7757
|
}),
|
7646
7758
|
401: DefaultUnauthorizedSchema,
|
7647
7759
|
404: DefaultNotFoundSchema,
|
@@ -7655,17 +7767,17 @@ var publicApiContract = initContract37().router(
|
|
7655
7767
|
path: "/contacts/:id",
|
7656
7768
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7657
7769
|
responses: {
|
7658
|
-
200:
|
7659
|
-
status:
|
7660
|
-
message:
|
7770
|
+
200: z107.object({
|
7771
|
+
status: z107.string(),
|
7772
|
+
message: z107.string(),
|
7661
7773
|
data: ContactSchema2,
|
7662
|
-
requestId:
|
7774
|
+
requestId: z107.string()
|
7663
7775
|
}),
|
7664
|
-
400:
|
7665
|
-
message:
|
7776
|
+
400: z107.object({
|
7777
|
+
message: z107.string()
|
7666
7778
|
}),
|
7667
|
-
409:
|
7668
|
-
message:
|
7779
|
+
409: z107.object({
|
7780
|
+
message: z107.string()
|
7669
7781
|
}),
|
7670
7782
|
401: DefaultUnauthorizedSchema,
|
7671
7783
|
404: DefaultNotFoundSchema,
|
@@ -7683,11 +7795,11 @@ var publicApiContract = initContract37().router(
|
|
7683
7795
|
201: DefaultSuccessResponseSchema.extend({
|
7684
7796
|
message: ContactCustomFieldSchema2
|
7685
7797
|
}),
|
7686
|
-
400:
|
7687
|
-
message:
|
7798
|
+
400: z107.object({
|
7799
|
+
message: z107.string()
|
7688
7800
|
}),
|
7689
|
-
409:
|
7690
|
-
message:
|
7801
|
+
409: z107.object({
|
7802
|
+
message: z107.string()
|
7691
7803
|
}),
|
7692
7804
|
401: DefaultUnauthorizedSchema,
|
7693
7805
|
404: DefaultNotFoundSchema,
|
@@ -7701,17 +7813,17 @@ var publicApiContract = initContract37().router(
|
|
7701
7813
|
path: "/contacts/:id",
|
7702
7814
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7703
7815
|
responses: {
|
7704
|
-
200:
|
7705
|
-
status:
|
7706
|
-
message:
|
7816
|
+
200: z107.object({
|
7817
|
+
status: z107.string(),
|
7818
|
+
message: z107.string(),
|
7707
7819
|
data: ContactSchema2,
|
7708
|
-
requestId:
|
7820
|
+
requestId: z107.string()
|
7709
7821
|
}),
|
7710
|
-
400:
|
7711
|
-
message:
|
7822
|
+
400: z107.object({
|
7823
|
+
message: z107.string()
|
7712
7824
|
}),
|
7713
|
-
409:
|
7714
|
-
message:
|
7825
|
+
409: z107.object({
|
7826
|
+
message: z107.string()
|
7715
7827
|
}),
|
7716
7828
|
401: DefaultUnauthorizedSchema,
|
7717
7829
|
404: DefaultNotFoundSchema,
|
@@ -7725,17 +7837,17 @@ var publicApiContract = initContract37().router(
|
|
7725
7837
|
path: "/contacts/:id",
|
7726
7838
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7727
7839
|
responses: {
|
7728
|
-
200:
|
7729
|
-
status:
|
7730
|
-
message:
|
7840
|
+
200: z107.object({
|
7841
|
+
status: z107.string(),
|
7842
|
+
message: z107.string(),
|
7731
7843
|
data: ContactSchema2,
|
7732
|
-
requestId:
|
7844
|
+
requestId: z107.string()
|
7733
7845
|
}),
|
7734
|
-
400:
|
7735
|
-
message:
|
7846
|
+
400: z107.object({
|
7847
|
+
message: z107.string()
|
7736
7848
|
}),
|
7737
|
-
409:
|
7738
|
-
message:
|
7849
|
+
409: z107.object({
|
7850
|
+
message: z107.string()
|
7739
7851
|
}),
|
7740
7852
|
401: DefaultUnauthorizedSchema,
|
7741
7853
|
404: DefaultNotFoundSchema,
|
@@ -7752,18 +7864,18 @@ var publicApiContract = initContract37().router(
|
|
7752
7864
|
);
|
7753
7865
|
|
7754
7866
|
// src/workflow-rule/index.ts
|
7755
|
-
import { initContract as
|
7756
|
-
import
|
7757
|
-
var chatContract =
|
7867
|
+
import { initContract as initContract39 } from "@ts-rest/core";
|
7868
|
+
import z108 from "zod";
|
7869
|
+
var chatContract = initContract39().router(
|
7758
7870
|
{
|
7759
7871
|
updateAssignee: {
|
7760
7872
|
method: "POST",
|
7761
7873
|
path: "/room/assignee",
|
7762
|
-
body:
|
7763
|
-
assigneeId:
|
7764
|
-
roomId:
|
7765
|
-
workflowId:
|
7766
|
-
queueId:
|
7874
|
+
body: z108.object({
|
7875
|
+
assigneeId: z108.string().uuid().optional(),
|
7876
|
+
roomId: z108.string().uuid(),
|
7877
|
+
workflowId: z108.string().uuid(),
|
7878
|
+
queueId: z108.string().uuid().optional()
|
7767
7879
|
}),
|
7768
7880
|
responses: {
|
7769
7881
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7777,15 +7889,15 @@ var chatContract = initContract38().router(
|
|
7777
7889
|
solveRoom: {
|
7778
7890
|
method: "POST",
|
7779
7891
|
path: "/room/solve",
|
7780
|
-
body:
|
7781
|
-
roomId:
|
7782
|
-
disposition:
|
7783
|
-
workflowId:
|
7892
|
+
body: z108.object({
|
7893
|
+
roomId: z108.string(),
|
7894
|
+
disposition: z108.string(),
|
7895
|
+
workflowId: z108.string().uuid()
|
7784
7896
|
}),
|
7785
7897
|
responses: {
|
7786
7898
|
200: DefaultSuccessResponseSchema.extend({
|
7787
7899
|
data: RoomSchema.extend({
|
7788
|
-
solveMessage:
|
7900
|
+
solveMessage: z108.string()
|
7789
7901
|
})
|
7790
7902
|
}),
|
7791
7903
|
409: DefaultErrorResponseSchema
|
@@ -7795,9 +7907,9 @@ var chatContract = initContract38().router(
|
|
7795
7907
|
emitMessage: {
|
7796
7908
|
method: "POST",
|
7797
7909
|
path: "/message/emit",
|
7798
|
-
body:
|
7799
|
-
messageId:
|
7800
|
-
queueId:
|
7910
|
+
body: z108.object({
|
7911
|
+
messageId: z108.string().uuid(),
|
7912
|
+
queueId: z108.string().uuid().optional().nullable()
|
7801
7913
|
}),
|
7802
7914
|
responses: {
|
7803
7915
|
200: DefaultSuccessResponseSchema,
|
@@ -7808,18 +7920,18 @@ var chatContract = initContract38().router(
|
|
7808
7920
|
}
|
7809
7921
|
},
|
7810
7922
|
{
|
7811
|
-
baseHeaders:
|
7812
|
-
"x-tenant":
|
7813
|
-
"x-code":
|
7923
|
+
baseHeaders: z108.object({
|
7924
|
+
"x-tenant": z108.string({ required_error: "Tenant id is required" }),
|
7925
|
+
"x-code": z108.string().uuid().optional()
|
7814
7926
|
}),
|
7815
7927
|
pathPrefix: "chat"
|
7816
7928
|
}
|
7817
7929
|
);
|
7818
7930
|
|
7819
7931
|
// src/botpress/index.ts
|
7820
|
-
import
|
7821
|
-
import { initContract as
|
7822
|
-
var botpressContract =
|
7932
|
+
import z109 from "zod";
|
7933
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
7934
|
+
var botpressContract = initContract40().router(
|
7823
7935
|
{
|
7824
7936
|
createBot: {
|
7825
7937
|
method: "POST",
|
@@ -7836,7 +7948,7 @@ var botpressContract = initContract39().router(
|
|
7836
7948
|
path: "/",
|
7837
7949
|
responses: {
|
7838
7950
|
200: DefaultSuccessResponseSchema.extend({
|
7839
|
-
data:
|
7951
|
+
data: z109.array(BotpressBotSchema)
|
7840
7952
|
}),
|
7841
7953
|
500: DefaultErrorResponseSchema
|
7842
7954
|
}
|
@@ -7853,7 +7965,7 @@ var botpressContract = initContract39().router(
|
|
7853
7965
|
},
|
7854
7966
|
{ pathPrefix: "/bots" }
|
7855
7967
|
);
|
7856
|
-
var botContract =
|
7968
|
+
var botContract = initContract40().router(
|
7857
7969
|
{
|
7858
7970
|
createBot: {
|
7859
7971
|
method: "POST",
|
@@ -7873,7 +7985,7 @@ var botContract = initContract39().router(
|
|
7873
7985
|
path: "/",
|
7874
7986
|
responses: {
|
7875
7987
|
200: DefaultSuccessResponseSchema.extend({
|
7876
|
-
data:
|
7988
|
+
data: z109.array(BotpressBotSchema)
|
7877
7989
|
}),
|
7878
7990
|
500: DefaultErrorResponseSchema
|
7879
7991
|
}
|
@@ -7885,32 +7997,32 @@ var botContract = initContract39().router(
|
|
7885
7997
|
);
|
7886
7998
|
|
7887
7999
|
// src/presence-status/index.ts
|
7888
|
-
import { initContract as
|
7889
|
-
import
|
8000
|
+
import { initContract as initContract41 } from "@ts-rest/core";
|
8001
|
+
import z111 from "zod";
|
7890
8002
|
|
7891
8003
|
// src/presence-status/validation.ts
|
7892
|
-
import { z as
|
7893
|
-
var CreatePresenceStatusSchema =
|
7894
|
-
status:
|
8004
|
+
import { z as z110 } from "zod";
|
8005
|
+
var CreatePresenceStatusSchema = z110.object({
|
8006
|
+
status: z110.string(),
|
7895
8007
|
description: PresenceStatusDesEnum,
|
7896
|
-
position:
|
8008
|
+
position: z110.number()
|
7897
8009
|
});
|
7898
8010
|
var UpdatePresenceStatusSchema = CreatePresenceStatusSchema;
|
7899
8011
|
|
7900
8012
|
// src/presence-status/index.ts
|
7901
|
-
var presenceStatusContract =
|
8013
|
+
var presenceStatusContract = initContract41().router(
|
7902
8014
|
{
|
7903
8015
|
getAllStatus: {
|
7904
8016
|
method: "GET",
|
7905
8017
|
path: "",
|
7906
8018
|
headers: DefaultHeaderSchema,
|
7907
8019
|
responses: {
|
7908
|
-
200:
|
7909
|
-
total:
|
7910
|
-
data:
|
8020
|
+
200: z111.object({
|
8021
|
+
total: z111.number(),
|
8022
|
+
data: z111.array(PresenceStatusSchema)
|
7911
8023
|
}),
|
7912
|
-
400:
|
7913
|
-
message:
|
8024
|
+
400: z111.object({
|
8025
|
+
message: z111.string()
|
7914
8026
|
}),
|
7915
8027
|
401: DefaultUnauthorizedSchema,
|
7916
8028
|
500: DefaultErrorResponseSchema
|
@@ -7926,8 +8038,8 @@ var presenceStatusContract = initContract40().router(
|
|
7926
8038
|
201: DefaultSuccessResponseSchema.extend({
|
7927
8039
|
presenceStatus: PresenceStatusSchema
|
7928
8040
|
}),
|
7929
|
-
400:
|
7930
|
-
message:
|
8041
|
+
400: z111.object({
|
8042
|
+
message: z111.string()
|
7931
8043
|
}),
|
7932
8044
|
401: DefaultUnauthorizedSchema,
|
7933
8045
|
404: DefaultNotFoundSchema,
|
@@ -7939,12 +8051,12 @@ var presenceStatusContract = initContract40().router(
|
|
7939
8051
|
getPresenceStatusById: {
|
7940
8052
|
method: "GET",
|
7941
8053
|
path: "/:id",
|
7942
|
-
pathParams:
|
8054
|
+
pathParams: z111.object({ id: z111.string() }),
|
7943
8055
|
headers: DefaultHeaderSchema,
|
7944
8056
|
responses: {
|
7945
8057
|
200: PresenceStatusSchema,
|
7946
|
-
400:
|
7947
|
-
message:
|
8058
|
+
400: z111.object({
|
8059
|
+
message: z111.string()
|
7948
8060
|
}),
|
7949
8061
|
401: DefaultUnauthorizedSchema,
|
7950
8062
|
404: DefaultNotFoundSchema,
|
@@ -7956,15 +8068,15 @@ var presenceStatusContract = initContract40().router(
|
|
7956
8068
|
updatePresenceStatus: {
|
7957
8069
|
method: "PATCH",
|
7958
8070
|
path: "/:id",
|
7959
|
-
pathParams:
|
8071
|
+
pathParams: z111.object({ id: z111.string() }),
|
7960
8072
|
headers: DefaultHeaderSchema,
|
7961
8073
|
body: UpdatePresenceStatusSchema,
|
7962
8074
|
responses: {
|
7963
8075
|
201: DefaultSuccessResponseSchema.extend({
|
7964
8076
|
presenceStatus: PresenceStatusSchema
|
7965
8077
|
}),
|
7966
|
-
400:
|
7967
|
-
message:
|
8078
|
+
400: z111.object({
|
8079
|
+
message: z111.string()
|
7968
8080
|
}),
|
7969
8081
|
401: DefaultUnauthorizedSchema,
|
7970
8082
|
404: DefaultNotFoundSchema,
|
@@ -7976,11 +8088,11 @@ var presenceStatusContract = initContract40().router(
|
|
7976
8088
|
deletePresenceStatus: {
|
7977
8089
|
method: "DELETE",
|
7978
8090
|
path: "/:id",
|
7979
|
-
pathParams:
|
8091
|
+
pathParams: z111.object({ id: z111.string() }),
|
7980
8092
|
headers: DefaultHeaderSchema,
|
7981
8093
|
body: null,
|
7982
8094
|
responses: {
|
7983
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
8095
|
+
200: DefaultSuccessResponseSchema.extend({ message: z111.string() }),
|
7984
8096
|
404: DefaultNotFoundSchema,
|
7985
8097
|
422: DefaultUnprocessibleSchema,
|
7986
8098
|
500: DefaultErrorResponseSchema
|
@@ -7992,38 +8104,38 @@ var presenceStatusContract = initContract40().router(
|
|
7992
8104
|
);
|
7993
8105
|
|
7994
8106
|
// src/sms/index.ts
|
7995
|
-
import { initContract as
|
8107
|
+
import { initContract as initContract42 } from "@ts-rest/core";
|
7996
8108
|
|
7997
8109
|
// src/sms/schema.ts
|
7998
|
-
import
|
8110
|
+
import z113 from "zod";
|
7999
8111
|
|
8000
8112
|
// src/sms/validation.ts
|
8001
|
-
import
|
8002
|
-
var ConnectSMSSchema2 =
|
8003
|
-
name:
|
8004
|
-
type:
|
8005
|
-
senderId:
|
8006
|
-
vonageCredentials:
|
8007
|
-
mobileNumber:
|
8008
|
-
apiKey:
|
8009
|
-
apiSecret:
|
8113
|
+
import z112 from "zod";
|
8114
|
+
var ConnectSMSSchema2 = z112.object({
|
8115
|
+
name: z112.string(),
|
8116
|
+
type: z112.enum(["sms_vonage" /* VONAGE_SMS */]),
|
8117
|
+
senderId: z112.string(),
|
8118
|
+
vonageCredentials: z112.object({
|
8119
|
+
mobileNumber: z112.string(),
|
8120
|
+
apiKey: z112.string(),
|
8121
|
+
apiSecret: z112.string()
|
8010
8122
|
})
|
8011
8123
|
});
|
8012
8124
|
|
8013
8125
|
// src/sms/schema.ts
|
8014
|
-
var ConnectSMSChannelSchema =
|
8015
|
-
actor:
|
8016
|
-
id:
|
8017
|
-
name:
|
8018
|
-
email:
|
8019
|
-
address:
|
8020
|
-
phone:
|
8126
|
+
var ConnectSMSChannelSchema = z113.object({
|
8127
|
+
actor: z113.object({
|
8128
|
+
id: z113.string().uuid(),
|
8129
|
+
name: z113.string(),
|
8130
|
+
email: z113.string().email(),
|
8131
|
+
address: z113.string().nullable(),
|
8132
|
+
phone: z113.string().nullable()
|
8021
8133
|
}),
|
8022
8134
|
channel: ConnectSMSSchema2
|
8023
8135
|
});
|
8024
8136
|
|
8025
8137
|
// src/sms/index.ts
|
8026
|
-
var smsContract =
|
8138
|
+
var smsContract = initContract42().router({
|
8027
8139
|
connect: {
|
8028
8140
|
method: "POST",
|
8029
8141
|
path: "/connect",
|
@@ -8049,7 +8161,7 @@ var smsContract = initContract41().router({
|
|
8049
8161
|
});
|
8050
8162
|
|
8051
8163
|
// src/contract.ts
|
8052
|
-
var apiContract =
|
8164
|
+
var apiContract = initContract43().router({
|
8053
8165
|
auth: authContract,
|
8054
8166
|
cxLog: cxLogContract,
|
8055
8167
|
dashboard: dashboardContract,
|
@@ -8074,54 +8186,57 @@ var apiContract = initContract42().router({
|
|
8074
8186
|
bot: botContract,
|
8075
8187
|
subscription: subscriptionContract
|
8076
8188
|
});
|
8077
|
-
var contactContract2 =
|
8189
|
+
var contactContract2 = initContract43().router({
|
8078
8190
|
contact: contactContract
|
8079
8191
|
});
|
8080
|
-
var ticketContract2 =
|
8192
|
+
var ticketContract2 = initContract43().router({
|
8081
8193
|
ticket: ticketContract
|
8082
8194
|
});
|
8083
|
-
var extensionContract2 =
|
8195
|
+
var extensionContract2 = initContract43().router({
|
8084
8196
|
extension: extensionContract
|
8085
8197
|
});
|
8086
|
-
var commentActivityContract =
|
8198
|
+
var commentActivityContract = initContract43().router({
|
8087
8199
|
comment: commentContract,
|
8088
8200
|
activityLog: activityLogContract
|
8089
8201
|
});
|
8090
|
-
var platformContract =
|
8202
|
+
var platformContract = initContract43().router({
|
8091
8203
|
line: lineContract,
|
8092
8204
|
viber: viberContract
|
8093
8205
|
});
|
8094
|
-
var
|
8206
|
+
var platformTelegramContract = initContract43().router({
|
8207
|
+
telegram: telegramContract
|
8208
|
+
});
|
8209
|
+
var platformMessengerContract = initContract43().router({
|
8095
8210
|
messenger: messengerContract
|
8096
8211
|
});
|
8097
|
-
var platformInstagramContract =
|
8212
|
+
var platformInstagramContract = initContract43().router({
|
8098
8213
|
instagram: instagramContract
|
8099
8214
|
});
|
8100
|
-
var platformBotpressContract =
|
8215
|
+
var platformBotpressContract = initContract43().router({
|
8101
8216
|
botpress: botpressContract
|
8102
8217
|
});
|
8103
|
-
var platformSMSContract =
|
8218
|
+
var platformSMSContract = initContract43().router({
|
8104
8219
|
sms: smsContract
|
8105
8220
|
});
|
8106
|
-
var facebookFeedContract2 =
|
8221
|
+
var facebookFeedContract2 = initContract43().router({
|
8107
8222
|
facebookFeed: facebookFeedContract
|
8108
8223
|
});
|
8109
|
-
var feedPostContract =
|
8224
|
+
var feedPostContract = initContract43().router({
|
8110
8225
|
main: mainFeedContract
|
8111
8226
|
});
|
8112
|
-
var telephonyContract =
|
8227
|
+
var telephonyContract = initContract43().router({
|
8113
8228
|
telephonyCdr: telephonyCdrContract
|
8114
8229
|
});
|
8115
|
-
var notificationContract =
|
8230
|
+
var notificationContract = initContract43().router({
|
8116
8231
|
notification: userNotificationContract
|
8117
8232
|
});
|
8118
|
-
var publicApiContract2 =
|
8233
|
+
var publicApiContract2 = initContract43().router({
|
8119
8234
|
publicApi: publicApiContract
|
8120
8235
|
});
|
8121
|
-
var businessCalendarContract2 =
|
8236
|
+
var businessCalendarContract2 = initContract43().router({
|
8122
8237
|
businessCalendar: businessCalendarContract
|
8123
8238
|
});
|
8124
|
-
var workflowContract =
|
8239
|
+
var workflowContract = initContract43().router(
|
8125
8240
|
{
|
8126
8241
|
chat: chatContract
|
8127
8242
|
},
|
@@ -8130,7 +8245,7 @@ var workflowContract = initContract42().router(
|
|
8130
8245
|
}
|
8131
8246
|
);
|
8132
8247
|
var settingsPathPrefix = "settings/";
|
8133
|
-
var ticketSettingContract =
|
8248
|
+
var ticketSettingContract = initContract43().router(
|
8134
8249
|
{
|
8135
8250
|
ticketSetting: attributeContract
|
8136
8251
|
},
|
@@ -8138,7 +8253,7 @@ var ticketSettingContract = initContract42().router(
|
|
8138
8253
|
pathPrefix: `${settingsPathPrefix}ticket/`
|
8139
8254
|
}
|
8140
8255
|
);
|
8141
|
-
var contactSettingContract =
|
8256
|
+
var contactSettingContract = initContract43().router(
|
8142
8257
|
{
|
8143
8258
|
contactSetting: attributeContract
|
8144
8259
|
},
|
@@ -8146,7 +8261,7 @@ var contactSettingContract = initContract42().router(
|
|
8146
8261
|
pathPrefix: `${settingsPathPrefix}contact/`
|
8147
8262
|
}
|
8148
8263
|
);
|
8149
|
-
var companySettingContract =
|
8264
|
+
var companySettingContract = initContract43().router(
|
8150
8265
|
{
|
8151
8266
|
companySetting: attributeContract
|
8152
8267
|
},
|
@@ -8154,7 +8269,7 @@ var companySettingContract = initContract42().router(
|
|
8154
8269
|
pathPrefix: `${settingsPathPrefix}company/`
|
8155
8270
|
}
|
8156
8271
|
);
|
8157
|
-
var caseLogSettingContract =
|
8272
|
+
var caseLogSettingContract = initContract43().router(
|
8158
8273
|
{
|
8159
8274
|
caseLogSetting: attributeContract
|
8160
8275
|
},
|
@@ -8162,7 +8277,7 @@ var caseLogSettingContract = initContract42().router(
|
|
8162
8277
|
pathPrefix: `${settingsPathPrefix}case_log/`
|
8163
8278
|
}
|
8164
8279
|
);
|
8165
|
-
var generalTagSettingContract =
|
8280
|
+
var generalTagSettingContract = initContract43().router(
|
8166
8281
|
{
|
8167
8282
|
generalTag: tagContract
|
8168
8283
|
},
|
@@ -8170,7 +8285,7 @@ var generalTagSettingContract = initContract42().router(
|
|
8170
8285
|
pathPrefix: `${settingsPathPrefix}general_tag/`
|
8171
8286
|
}
|
8172
8287
|
);
|
8173
|
-
var contactLabelSettingContract =
|
8288
|
+
var contactLabelSettingContract = initContract43().router(
|
8174
8289
|
{
|
8175
8290
|
contactLabel: tagContract
|
8176
8291
|
},
|
@@ -8178,7 +8293,7 @@ var contactLabelSettingContract = initContract42().router(
|
|
8178
8293
|
pathPrefix: `${settingsPathPrefix}contact_label/`
|
8179
8294
|
}
|
8180
8295
|
);
|
8181
|
-
var categorySettingContract =
|
8296
|
+
var categorySettingContract = initContract43().router(
|
8182
8297
|
{
|
8183
8298
|
category: categoryContract
|
8184
8299
|
},
|
@@ -8186,7 +8301,7 @@ var categorySettingContract = initContract42().router(
|
|
8186
8301
|
pathPrefix: settingsPathPrefix
|
8187
8302
|
}
|
8188
8303
|
);
|
8189
|
-
var snippetSettingContract =
|
8304
|
+
var snippetSettingContract = initContract43().router(
|
8190
8305
|
{
|
8191
8306
|
snippet: snippetContract
|
8192
8307
|
},
|
@@ -8194,7 +8309,7 @@ var snippetSettingContract = initContract42().router(
|
|
8194
8309
|
pathPrefix: settingsPathPrefix
|
8195
8310
|
}
|
8196
8311
|
);
|
8197
|
-
var businessCalendarSettingContract =
|
8312
|
+
var businessCalendarSettingContract = initContract43().router(
|
8198
8313
|
{
|
8199
8314
|
businessCalendar: businessCalendarContract
|
8200
8315
|
},
|
@@ -8202,7 +8317,7 @@ var businessCalendarSettingContract = initContract42().router(
|
|
8202
8317
|
pathPrefix: settingsPathPrefix
|
8203
8318
|
}
|
8204
8319
|
);
|
8205
|
-
var channelSettingContract =
|
8320
|
+
var channelSettingContract = initContract43().router(
|
8206
8321
|
{
|
8207
8322
|
channel: channelContract
|
8208
8323
|
},
|
@@ -8210,75 +8325,75 @@ var channelSettingContract = initContract42().router(
|
|
8210
8325
|
pathPrefix: settingsPathPrefix
|
8211
8326
|
}
|
8212
8327
|
);
|
8213
|
-
var widgetSettingContract =
|
8328
|
+
var widgetSettingContract = initContract43().router(
|
8214
8329
|
{ widget: widgetContract },
|
8215
8330
|
{ pathPrefix: settingsPathPrefix }
|
8216
8331
|
);
|
8217
|
-
var roleSettingContract =
|
8332
|
+
var roleSettingContract = initContract43().router(
|
8218
8333
|
{ role: roleContract },
|
8219
8334
|
{ pathPrefix: settingsPathPrefix }
|
8220
8335
|
);
|
8221
|
-
var permissionSettingContract =
|
8336
|
+
var permissionSettingContract = initContract43().router(
|
8222
8337
|
{ permission: permissionContract },
|
8223
8338
|
{ pathPrefix: settingsPathPrefix }
|
8224
8339
|
);
|
8225
|
-
var memberSettingContract =
|
8340
|
+
var memberSettingContract = initContract43().router(
|
8226
8341
|
{ member: userContract },
|
8227
8342
|
{ pathPrefix: settingsPathPrefix }
|
8228
8343
|
);
|
8229
|
-
var presenceStatusContract2 =
|
8344
|
+
var presenceStatusContract2 = initContract43().router({
|
8230
8345
|
presenceStatus: presenceStatusContract
|
8231
8346
|
});
|
8232
8347
|
|
8233
8348
|
// src/automation-queue/index.ts
|
8234
|
-
import { initContract as
|
8235
|
-
import { z as
|
8349
|
+
import { initContract as initContract44 } from "@ts-rest/core";
|
8350
|
+
import { z as z116 } from "zod";
|
8236
8351
|
|
8237
8352
|
// src/automation-queue/validation.ts
|
8238
|
-
import { z as
|
8239
|
-
var QueueDistributionStrategySchema =
|
8240
|
-
|
8241
|
-
|
8242
|
-
|
8243
|
-
|
8353
|
+
import { z as z114 } from "zod";
|
8354
|
+
var QueueDistributionStrategySchema = z114.union([
|
8355
|
+
z114.literal("round-robin"),
|
8356
|
+
z114.literal("fewest-assignments"),
|
8357
|
+
z114.literal("random"),
|
8358
|
+
z114.literal("notify-all")
|
8244
8359
|
]);
|
8245
|
-
var CreateAutomationQueueSchema =
|
8246
|
-
emoji:
|
8247
|
-
name:
|
8248
|
-
description:
|
8249
|
-
managerIds:
|
8250
|
-
agentIds:
|
8360
|
+
var CreateAutomationQueueSchema = z114.object({
|
8361
|
+
emoji: z114.string().emoji(),
|
8362
|
+
name: z114.string(),
|
8363
|
+
description: z114.string().nullable(),
|
8364
|
+
managerIds: z114.array(z114.string().uuid()).min(1),
|
8365
|
+
agentIds: z114.array(z114.string().uuid()).min(1),
|
8251
8366
|
distributionStrategy: QueueDistributionStrategySchema,
|
8252
|
-
maximumAssignPerAgent:
|
8367
|
+
maximumAssignPerAgent: z114.number().positive()
|
8253
8368
|
// ringTimeOut: z.number().positive(),
|
8254
8369
|
// retryInterval: z.number().positive(),
|
8255
8370
|
// queueTimeOut: z.number().positive(),
|
8256
8371
|
// isAssignmentDeniable: z.coerce.boolean(),
|
8257
8372
|
});
|
8258
8373
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
8259
|
-
var CheckHasAssignedRoomSchema =
|
8260
|
-
userId:
|
8261
|
-
queueId:
|
8374
|
+
var CheckHasAssignedRoomSchema = z114.object({
|
8375
|
+
userId: z114.string().uuid().optional(),
|
8376
|
+
queueId: z114.string().uuid().optional()
|
8262
8377
|
});
|
8263
8378
|
|
8264
8379
|
// src/automation-queue/schema.ts
|
8265
|
-
import { z as
|
8380
|
+
import { z as z115 } from "zod";
|
8266
8381
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
8267
|
-
emoji:
|
8268
|
-
name:
|
8269
|
-
description:
|
8382
|
+
emoji: z115.string(),
|
8383
|
+
name: z115.string(),
|
8384
|
+
description: z115.string().nullable(),
|
8270
8385
|
distributionStrategy: QueueDistributionStrategySchema,
|
8271
|
-
maximumAssignPerAgent:
|
8386
|
+
maximumAssignPerAgent: z115.number().positive(),
|
8272
8387
|
// ringTimeOut: z.number(),
|
8273
8388
|
// retryInterval: z.number(),
|
8274
8389
|
// queueTimeOut: z.number(),
|
8275
8390
|
// isAssignmentDeniable: z.boolean(),
|
8276
|
-
managers:
|
8277
|
-
agents:
|
8391
|
+
managers: z115.array(UserSchema),
|
8392
|
+
agents: z115.array(UserSchema)
|
8278
8393
|
});
|
8279
8394
|
|
8280
8395
|
// src/automation-queue/index.ts
|
8281
|
-
var automationQueueContract =
|
8396
|
+
var automationQueueContract = initContract44().router(
|
8282
8397
|
{
|
8283
8398
|
createAutomationQueue: {
|
8284
8399
|
method: "POST",
|
@@ -8293,8 +8408,8 @@ var automationQueueContract = initContract43().router(
|
|
8293
8408
|
duplicateAutomationQueue: {
|
8294
8409
|
method: "POST",
|
8295
8410
|
path: "/:id/duplicate",
|
8296
|
-
pathParams:
|
8297
|
-
id:
|
8411
|
+
pathParams: z116.object({
|
8412
|
+
id: z116.string().uuid()
|
8298
8413
|
}),
|
8299
8414
|
body: null,
|
8300
8415
|
responses: {
|
@@ -8306,20 +8421,20 @@ var automationQueueContract = initContract43().router(
|
|
8306
8421
|
getAutomationQueues: {
|
8307
8422
|
method: "GET",
|
8308
8423
|
path: "",
|
8309
|
-
query:
|
8310
|
-
userId:
|
8424
|
+
query: z116.object({
|
8425
|
+
userId: z116.string().uuid().optional()
|
8311
8426
|
}).optional(),
|
8312
8427
|
responses: {
|
8313
8428
|
200: DefaultSuccessResponseSchema.extend({
|
8314
|
-
data:
|
8429
|
+
data: z116.array(AutomationQueueSchema)
|
8315
8430
|
})
|
8316
8431
|
}
|
8317
8432
|
},
|
8318
8433
|
getAutomationQueueById: {
|
8319
8434
|
method: "GET",
|
8320
8435
|
path: "/:id",
|
8321
|
-
pathParams:
|
8322
|
-
id:
|
8436
|
+
pathParams: z116.object({
|
8437
|
+
id: z116.string().uuid()
|
8323
8438
|
}),
|
8324
8439
|
responses: {
|
8325
8440
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8330,8 +8445,8 @@ var automationQueueContract = initContract43().router(
|
|
8330
8445
|
updateAutomationQueue: {
|
8331
8446
|
method: "PATCH",
|
8332
8447
|
path: "/:id",
|
8333
|
-
pathParams:
|
8334
|
-
id:
|
8448
|
+
pathParams: z116.object({
|
8449
|
+
id: z116.string().uuid()
|
8335
8450
|
}),
|
8336
8451
|
body: UpdateAutomationQueueSchema,
|
8337
8452
|
responses: {
|
@@ -8343,13 +8458,13 @@ var automationQueueContract = initContract43().router(
|
|
8343
8458
|
deleteAutomationQueue: {
|
8344
8459
|
method: "DELETE",
|
8345
8460
|
path: "/:id",
|
8346
|
-
pathParams:
|
8347
|
-
id:
|
8461
|
+
pathParams: z116.object({
|
8462
|
+
id: z116.string().uuid()
|
8348
8463
|
}),
|
8349
8464
|
body: null,
|
8350
8465
|
responses: {
|
8351
8466
|
200: DefaultSuccessResponseSchema.extend({
|
8352
|
-
message:
|
8467
|
+
message: z116.string()
|
8353
8468
|
})
|
8354
8469
|
}
|
8355
8470
|
},
|
@@ -8359,8 +8474,8 @@ var automationQueueContract = initContract43().router(
|
|
8359
8474
|
body: CheckHasAssignedRoomSchema,
|
8360
8475
|
responses: {
|
8361
8476
|
200: DefaultSuccessResponseSchema.extend({
|
8362
|
-
data:
|
8363
|
-
hasAssignedRoom:
|
8477
|
+
data: z116.object({
|
8478
|
+
hasAssignedRoom: z116.boolean()
|
8364
8479
|
})
|
8365
8480
|
})
|
8366
8481
|
}
|
@@ -8370,300 +8485,300 @@ var automationQueueContract = initContract43().router(
|
|
8370
8485
|
);
|
8371
8486
|
|
8372
8487
|
// src/mail/mail-contract.ts
|
8373
|
-
import { initContract as
|
8488
|
+
import { initContract as initContract49 } from "@ts-rest/core";
|
8374
8489
|
|
8375
8490
|
// src/mail/room-contract.ts
|
8376
|
-
import { initContract as
|
8377
|
-
import
|
8491
|
+
import { initContract as initContract45 } from "@ts-rest/core";
|
8492
|
+
import z121 from "zod";
|
8378
8493
|
|
8379
8494
|
// src/mail/schemas/room.schema.ts
|
8380
|
-
import
|
8495
|
+
import z119 from "zod";
|
8381
8496
|
|
8382
8497
|
// src/mail/schemas/account.schema.ts
|
8383
|
-
import
|
8384
|
-
var MailServerSchema =
|
8385
|
-
id:
|
8386
|
-
createdAt: z115.date(),
|
8387
|
-
updatedAt: z115.date(),
|
8388
|
-
deletedAt: z115.date().nullable(),
|
8389
|
-
name: z115.string(),
|
8390
|
-
smtpHost: z115.string(),
|
8391
|
-
smtpPort: z115.number(),
|
8392
|
-
smtpTlsPort: z115.number(),
|
8393
|
-
useTlsForSmtp: z115.boolean(),
|
8394
|
-
imapHost: z115.string(),
|
8395
|
-
imapPort: z115.number(),
|
8396
|
-
imapTlsPort: z115.number(),
|
8397
|
-
useTlsForImap: z115.boolean()
|
8398
|
-
});
|
8399
|
-
var MailAccountSchema = z115.object({
|
8400
|
-
id: z115.string(),
|
8401
|
-
createdAt: z115.date(),
|
8402
|
-
updatedAt: z115.date(),
|
8403
|
-
deletedAt: z115.date().nullable(),
|
8404
|
-
name: z115.string(),
|
8405
|
-
address: z115.string(),
|
8406
|
-
accountId: z115.string(),
|
8407
|
-
mailServerId: z115.string(),
|
8408
|
-
mailServer: MailServerSchema,
|
8409
|
-
state: z115.union([
|
8410
|
-
z115.literal("init"),
|
8411
|
-
z115.literal("syncing"),
|
8412
|
-
z115.literal("connecting"),
|
8413
|
-
z115.literal("connected"),
|
8414
|
-
z115.literal("disconnected"),
|
8415
|
-
z115.literal("authenticationError"),
|
8416
|
-
z115.literal("connectError"),
|
8417
|
-
z115.literal("unset")
|
8418
|
-
])
|
8419
|
-
});
|
8420
|
-
var OAuth2AppSchema = z115.object({
|
8421
|
-
id: z115.string(),
|
8422
|
-
name: z115.string(),
|
8423
|
-
description: z115.string(),
|
8424
|
-
title: z115.string(),
|
8425
|
-
provider: z115.string(),
|
8426
|
-
enabled: z115.boolean(),
|
8427
|
-
legacy: z115.boolean(),
|
8428
|
-
created: z115.string(),
|
8429
|
-
updated: z115.string(),
|
8430
|
-
includeInListing: z115.boolean(),
|
8431
|
-
clientId: z115.string(),
|
8432
|
-
clientSecret: z115.string(),
|
8433
|
-
authority: z115.string(),
|
8434
|
-
redirectUrl: z115.string(),
|
8435
|
-
serviceClient: z115.string(),
|
8436
|
-
googleProjectId: z115.string(),
|
8437
|
-
serviceClientEmail: z115.string(),
|
8438
|
-
serviceKey: z115.string()
|
8439
|
-
});
|
8440
|
-
|
8441
|
-
// src/mail/schemas/message.schema.ts
|
8442
|
-
import z116 from "zod";
|
8443
|
-
var AttachmentSchema = z116.object({
|
8444
|
-
id: z116.string(),
|
8445
|
-
createdAt: z116.date(),
|
8446
|
-
updatedAt: z116.date(),
|
8447
|
-
deletedAt: z116.nullable(z116.date()),
|
8448
|
-
roomId: z116.string(),
|
8449
|
-
messageId: z116.string(),
|
8450
|
-
fileName: z116.string(),
|
8451
|
-
fileType: z116.string(),
|
8452
|
-
emailEngineAttachmentId: z116.string(),
|
8453
|
-
uploadId: z116.string(),
|
8454
|
-
upload: z116.object({
|
8455
|
-
id: z116.string(),
|
8456
|
-
createdAt: z116.date(),
|
8457
|
-
updatedAt: z116.date(),
|
8458
|
-
deletedAt: z116.nullable(z116.date()),
|
8459
|
-
bucketName: z116.string(),
|
8460
|
-
fileName: z116.string(),
|
8461
|
-
fileKey: z116.string(),
|
8462
|
-
fileSize: z116.number(),
|
8463
|
-
fileUrl: z116.string(),
|
8464
|
-
extensionName: z116.string()
|
8465
|
-
})
|
8466
|
-
});
|
8467
|
-
var MessageSchema2 = z116.object({
|
8468
|
-
id: z116.string(),
|
8469
|
-
createdAt: z116.date(),
|
8470
|
-
updatedAt: z116.date(),
|
8471
|
-
deletedAt: z116.nullable(z116.date()),
|
8472
|
-
roomId: z116.string(),
|
8473
|
-
subject: z116.string(),
|
8474
|
-
textPlain: z116.string(),
|
8475
|
-
textHtml: z116.string(),
|
8476
|
-
textId: z116.string(),
|
8477
|
-
emailEngineEmailId: z116.string(),
|
8478
|
-
emailEngineMessageId: z116.string(),
|
8479
|
-
emailEngineReplyTo: z116.nullable(z116.string()),
|
8480
|
-
direction: z116.string(),
|
8481
|
-
date: z116.date(),
|
8482
|
-
action: z116.string(),
|
8483
|
-
unseen: z116.boolean(),
|
8484
|
-
sendAt: z116.date(),
|
8485
|
-
starred: z116.boolean(),
|
8486
|
-
seemsLikeNew: z116.boolean(),
|
8487
|
-
from: z116.array(MailParticipant),
|
8488
|
-
to: z116.array(MailParticipant),
|
8489
|
-
cc: z116.array(MailParticipant),
|
8490
|
-
bcc: z116.array(MailParticipant),
|
8491
|
-
attachments: z116.array(AttachmentSchema)
|
8492
|
-
});
|
8493
|
-
|
8494
|
-
// src/mail/schemas/room.schema.ts
|
8495
|
-
var ContactSchema3 = z117.object({
|
8496
|
-
id: z117.string().uuid(),
|
8498
|
+
import z117 from "zod";
|
8499
|
+
var MailServerSchema = z117.object({
|
8500
|
+
id: z117.string(),
|
8497
8501
|
createdAt: z117.date(),
|
8498
8502
|
updatedAt: z117.date(),
|
8499
8503
|
deletedAt: z117.date().nullable(),
|
8500
8504
|
name: z117.string(),
|
8501
|
-
|
8502
|
-
|
8503
|
-
|
8504
|
-
|
8505
|
-
|
8506
|
-
|
8507
|
-
|
8505
|
+
smtpHost: z117.string(),
|
8506
|
+
smtpPort: z117.number(),
|
8507
|
+
smtpTlsPort: z117.number(),
|
8508
|
+
useTlsForSmtp: z117.boolean(),
|
8509
|
+
imapHost: z117.string(),
|
8510
|
+
imapPort: z117.number(),
|
8511
|
+
imapTlsPort: z117.number(),
|
8512
|
+
useTlsForImap: z117.boolean()
|
8513
|
+
});
|
8514
|
+
var MailAccountSchema = z117.object({
|
8508
8515
|
id: z117.string(),
|
8509
8516
|
createdAt: z117.date(),
|
8510
8517
|
updatedAt: z117.date(),
|
8511
8518
|
deletedAt: z117.date().nullable(),
|
8512
8519
|
name: z117.string(),
|
8513
8520
|
address: z117.string(),
|
8514
|
-
|
8515
|
-
|
8516
|
-
|
8521
|
+
accountId: z117.string(),
|
8522
|
+
mailServerId: z117.string(),
|
8523
|
+
mailServer: MailServerSchema,
|
8524
|
+
state: z117.union([
|
8525
|
+
z117.literal("init"),
|
8526
|
+
z117.literal("syncing"),
|
8527
|
+
z117.literal("connecting"),
|
8528
|
+
z117.literal("connected"),
|
8529
|
+
z117.literal("disconnected"),
|
8530
|
+
z117.literal("authenticationError"),
|
8531
|
+
z117.literal("connectError"),
|
8532
|
+
z117.literal("unset")
|
8533
|
+
])
|
8517
8534
|
});
|
8518
|
-
var
|
8535
|
+
var OAuth2AppSchema = z117.object({
|
8519
8536
|
id: z117.string(),
|
8520
|
-
|
8521
|
-
|
8522
|
-
|
8523
|
-
|
8524
|
-
|
8525
|
-
|
8526
|
-
|
8537
|
+
name: z117.string(),
|
8538
|
+
description: z117.string(),
|
8539
|
+
title: z117.string(),
|
8540
|
+
provider: z117.string(),
|
8541
|
+
enabled: z117.boolean(),
|
8542
|
+
legacy: z117.boolean(),
|
8543
|
+
created: z117.string(),
|
8544
|
+
updated: z117.string(),
|
8545
|
+
includeInListing: z117.boolean(),
|
8546
|
+
clientId: z117.string(),
|
8547
|
+
clientSecret: z117.string(),
|
8548
|
+
authority: z117.string(),
|
8549
|
+
redirectUrl: z117.string(),
|
8550
|
+
serviceClient: z117.string(),
|
8551
|
+
googleProjectId: z117.string(),
|
8552
|
+
serviceClientEmail: z117.string(),
|
8553
|
+
serviceKey: z117.string()
|
8527
8554
|
});
|
8528
|
-
|
8529
|
-
|
8530
|
-
|
8531
|
-
|
8532
|
-
|
8533
|
-
|
8534
|
-
|
8555
|
+
|
8556
|
+
// src/mail/schemas/message.schema.ts
|
8557
|
+
import z118 from "zod";
|
8558
|
+
var AttachmentSchema = z118.object({
|
8559
|
+
id: z118.string(),
|
8560
|
+
createdAt: z118.date(),
|
8561
|
+
updatedAt: z118.date(),
|
8562
|
+
deletedAt: z118.nullable(z118.date()),
|
8563
|
+
roomId: z118.string(),
|
8564
|
+
messageId: z118.string(),
|
8565
|
+
fileName: z118.string(),
|
8566
|
+
fileType: z118.string(),
|
8567
|
+
emailEngineAttachmentId: z118.string(),
|
8568
|
+
uploadId: z118.string(),
|
8569
|
+
upload: z118.object({
|
8570
|
+
id: z118.string(),
|
8571
|
+
createdAt: z118.date(),
|
8572
|
+
updatedAt: z118.date(),
|
8573
|
+
deletedAt: z118.nullable(z118.date()),
|
8574
|
+
bucketName: z118.string(),
|
8575
|
+
fileName: z118.string(),
|
8576
|
+
fileKey: z118.string(),
|
8577
|
+
fileSize: z118.number(),
|
8578
|
+
fileUrl: z118.string(),
|
8579
|
+
extensionName: z118.string()
|
8580
|
+
})
|
8535
8581
|
});
|
8536
|
-
var
|
8537
|
-
id:
|
8538
|
-
createdAt:
|
8539
|
-
updatedAt:
|
8540
|
-
deletedAt:
|
8541
|
-
|
8542
|
-
|
8543
|
-
|
8544
|
-
|
8545
|
-
|
8582
|
+
var MessageSchema2 = z118.object({
|
8583
|
+
id: z118.string(),
|
8584
|
+
createdAt: z118.date(),
|
8585
|
+
updatedAt: z118.date(),
|
8586
|
+
deletedAt: z118.nullable(z118.date()),
|
8587
|
+
roomId: z118.string(),
|
8588
|
+
subject: z118.string(),
|
8589
|
+
textPlain: z118.string(),
|
8590
|
+
textHtml: z118.string(),
|
8591
|
+
textId: z118.string(),
|
8592
|
+
emailEngineEmailId: z118.string(),
|
8593
|
+
emailEngineMessageId: z118.string(),
|
8594
|
+
emailEngineReplyTo: z118.nullable(z118.string()),
|
8595
|
+
direction: z118.string(),
|
8596
|
+
date: z118.date(),
|
8597
|
+
action: z118.string(),
|
8598
|
+
unseen: z118.boolean(),
|
8599
|
+
sendAt: z118.date(),
|
8600
|
+
starred: z118.boolean(),
|
8601
|
+
seemsLikeNew: z118.boolean(),
|
8602
|
+
from: z118.array(MailParticipant),
|
8603
|
+
to: z118.array(MailParticipant),
|
8604
|
+
cc: z118.array(MailParticipant),
|
8605
|
+
bcc: z118.array(MailParticipant),
|
8606
|
+
attachments: z118.array(AttachmentSchema)
|
8546
8607
|
});
|
8547
|
-
|
8548
|
-
|
8549
|
-
|
8550
|
-
|
8551
|
-
|
8552
|
-
|
8553
|
-
|
8554
|
-
|
8608
|
+
|
8609
|
+
// src/mail/schemas/room.schema.ts
|
8610
|
+
var ContactSchema3 = z119.object({
|
8611
|
+
id: z119.string().uuid(),
|
8612
|
+
createdAt: z119.date(),
|
8613
|
+
updatedAt: z119.date(),
|
8614
|
+
deletedAt: z119.date().nullable(),
|
8615
|
+
name: z119.string(),
|
8616
|
+
address: z119.string().nullable(),
|
8617
|
+
channel: z119.string().nullable(),
|
8618
|
+
notes: z119.string().nullable(),
|
8619
|
+
contactProfile: z119.string().nullable(),
|
8620
|
+
socialProfileUrl: z119.string().nullable()
|
8621
|
+
});
|
8622
|
+
var MailUserSchema = z119.object({
|
8623
|
+
id: z119.string(),
|
8624
|
+
createdAt: z119.date(),
|
8625
|
+
updatedAt: z119.date(),
|
8626
|
+
deletedAt: z119.date().nullable(),
|
8627
|
+
name: z119.string(),
|
8628
|
+
address: z119.string(),
|
8629
|
+
contactId: z119.string(),
|
8630
|
+
contact: ContactSchema3,
|
8631
|
+
isNewContact: z119.boolean()
|
8632
|
+
});
|
8633
|
+
var MailParticipant = z119.object({
|
8634
|
+
id: z119.string(),
|
8635
|
+
createdAt: z119.date(),
|
8636
|
+
updatedAt: z119.date(),
|
8637
|
+
deletedAt: z119.date().nullable(),
|
8638
|
+
roomId: z119.string(),
|
8639
|
+
messageId: z119.string(),
|
8640
|
+
mailUserId: z119.string(),
|
8641
|
+
mailUser: MailUserSchema
|
8642
|
+
});
|
8643
|
+
var TagSchema2 = z119.object({
|
8644
|
+
color: z119.string(),
|
8645
|
+
id: z119.string(),
|
8646
|
+
createdAt: z119.date(),
|
8647
|
+
updatedAt: z119.date(),
|
8648
|
+
deletedAt: z119.date().nullable(),
|
8649
|
+
name: z119.string()
|
8650
|
+
});
|
8651
|
+
var UserModel = z119.object({
|
8652
|
+
id: z119.string().uuid(),
|
8653
|
+
createdAt: z119.date(),
|
8654
|
+
updatedAt: z119.date(),
|
8655
|
+
deletedAt: z119.date().nullable(),
|
8656
|
+
name: z119.string(),
|
8657
|
+
email: z119.string(),
|
8658
|
+
address: z119.string().nullable(),
|
8659
|
+
phone: z119.string().nullable(),
|
8660
|
+
notificationCount: z119.number().nullable()
|
8661
|
+
});
|
8662
|
+
var ActivityLogModel = z119.object({
|
8663
|
+
id: z119.string(),
|
8664
|
+
createdAt: z119.date(),
|
8665
|
+
updatedAt: z119.date(),
|
8666
|
+
deletedAt: z119.nullable(z119.string()),
|
8667
|
+
description: z119.string(),
|
8668
|
+
actorId: z119.string(),
|
8669
|
+
roomId: z119.string(),
|
8555
8670
|
actor: UserModel
|
8556
8671
|
});
|
8557
|
-
var MessagesAndLogsSchema =
|
8558
|
-
|
8672
|
+
var MessagesAndLogsSchema = z119.array(
|
8673
|
+
z119.union([MessageSchema2, ActivityLogModel])
|
8559
8674
|
);
|
8560
|
-
var MailRoomSchema =
|
8561
|
-
id:
|
8562
|
-
createdAt:
|
8563
|
-
updatedAt:
|
8564
|
-
deletedAt:
|
8565
|
-
subject:
|
8566
|
-
resolved:
|
8567
|
-
assigneeId:
|
8568
|
-
note:
|
8569
|
-
mailId:
|
8570
|
-
direction:
|
8571
|
-
lastMessageId:
|
8572
|
-
firstMessageId:
|
8573
|
-
from:
|
8574
|
-
to:
|
8575
|
-
cc:
|
8576
|
-
bcc:
|
8675
|
+
var MailRoomSchema = z119.object({
|
8676
|
+
id: z119.string(),
|
8677
|
+
createdAt: z119.date(),
|
8678
|
+
updatedAt: z119.date(),
|
8679
|
+
deletedAt: z119.date().nullable(),
|
8680
|
+
subject: z119.string(),
|
8681
|
+
resolved: z119.boolean(),
|
8682
|
+
assigneeId: z119.string().nullable(),
|
8683
|
+
note: z119.string(),
|
8684
|
+
mailId: z119.string(),
|
8685
|
+
direction: z119.string(),
|
8686
|
+
lastMessageId: z119.string(),
|
8687
|
+
firstMessageId: z119.string(),
|
8688
|
+
from: z119.array(MailParticipant),
|
8689
|
+
to: z119.array(MailParticipant),
|
8690
|
+
cc: z119.array(MailParticipant),
|
8691
|
+
bcc: z119.array(MailParticipant),
|
8577
8692
|
firstMessage: MessageSchema2,
|
8578
8693
|
lastMessage: MessageSchema2,
|
8579
|
-
tags:
|
8694
|
+
tags: z119.array(TagSchema2),
|
8580
8695
|
assignee: UserModel,
|
8581
|
-
messages:
|
8696
|
+
messages: z119.array(MessageSchema2),
|
8582
8697
|
messagesAndLogs: MessagesAndLogsSchema,
|
8583
8698
|
mail: MailAccountSchema,
|
8584
|
-
unReadMessageCount:
|
8699
|
+
unReadMessageCount: z119.number(),
|
8585
8700
|
cxlog: CxLogSchema
|
8586
8701
|
});
|
8587
|
-
var AttachmentSchema2 =
|
8588
|
-
fileName:
|
8589
|
-
fileType:
|
8590
|
-
emailEngineAttachmentId:
|
8591
|
-
uploadId:
|
8592
|
-
messageId:
|
8593
|
-
roomId:
|
8702
|
+
var AttachmentSchema2 = z119.object({
|
8703
|
+
fileName: z119.string(),
|
8704
|
+
fileType: z119.string(),
|
8705
|
+
emailEngineAttachmentId: z119.string(),
|
8706
|
+
uploadId: z119.string(),
|
8707
|
+
messageId: z119.string(),
|
8708
|
+
roomId: z119.string(),
|
8594
8709
|
upload: UploadSchema
|
8595
8710
|
});
|
8596
8711
|
|
8597
8712
|
// src/mail/schemas/room-validation.schema.ts
|
8598
|
-
import
|
8713
|
+
import z120 from "zod";
|
8599
8714
|
var RoomContractsValidationSchema = {
|
8600
8715
|
getAll: {
|
8601
|
-
input:
|
8602
|
-
page:
|
8603
|
-
pageSize:
|
8604
|
-
keyword:
|
8605
|
-
value:
|
8606
|
-
category:
|
8716
|
+
input: z120.object({
|
8717
|
+
page: z120.coerce.number().default(1),
|
8718
|
+
pageSize: z120.coerce.number().default(10),
|
8719
|
+
keyword: z120.object({
|
8720
|
+
value: z120.string(),
|
8721
|
+
category: z120.union([z120.literal("contact"), z120.literal("message")])
|
8607
8722
|
}).optional(),
|
8608
|
-
contactLabels:
|
8609
|
-
channels:
|
8610
|
-
date:
|
8611
|
-
contacts:
|
8612
|
-
assignees:
|
8613
|
-
level1:
|
8614
|
-
|
8615
|
-
|
8616
|
-
|
8617
|
-
|
8618
|
-
|
8619
|
-
|
8723
|
+
contactLabels: z120.array(z120.string()).optional(),
|
8724
|
+
channels: z120.array(z120.string().email()).optional(),
|
8725
|
+
date: z120.string().optional(),
|
8726
|
+
contacts: z120.array(z120.string()).optional(),
|
8727
|
+
assignees: z120.array(z120.string()).optional(),
|
8728
|
+
level1: z120.union([
|
8729
|
+
z120.literal("open"),
|
8730
|
+
z120.literal("close"),
|
8731
|
+
z120.literal("inbox"),
|
8732
|
+
z120.literal("sent"),
|
8733
|
+
z120.literal("scheduled"),
|
8734
|
+
z120.literal("starred")
|
8620
8735
|
]).optional(),
|
8621
|
-
level2:
|
8622
|
-
|
8623
|
-
|
8624
|
-
|
8625
|
-
|
8736
|
+
level2: z120.union([
|
8737
|
+
z120.literal("all"),
|
8738
|
+
z120.literal("unassign"),
|
8739
|
+
z120.literal("mine"),
|
8740
|
+
z120.literal("other")
|
8626
8741
|
]).optional()
|
8627
8742
|
}),
|
8628
|
-
output:
|
8629
|
-
data:
|
8630
|
-
total:
|
8631
|
-
page:
|
8632
|
-
pageSize:
|
8743
|
+
output: z120.object({
|
8744
|
+
data: z120.array(MailRoomSchema),
|
8745
|
+
total: z120.number(),
|
8746
|
+
page: z120.number(),
|
8747
|
+
pageSize: z120.number()
|
8633
8748
|
})
|
8634
8749
|
},
|
8635
8750
|
update: {
|
8636
|
-
input:
|
8637
|
-
disposition:
|
8638
|
-
|
8639
|
-
|
8640
|
-
|
8641
|
-
|
8642
|
-
|
8643
|
-
|
8751
|
+
input: z120.object({
|
8752
|
+
disposition: z120.union([
|
8753
|
+
z120.literal("resolved"),
|
8754
|
+
z120.literal("follow up"),
|
8755
|
+
z120.literal("escalated"),
|
8756
|
+
z120.literal("dropped"),
|
8757
|
+
z120.literal("prank"),
|
8758
|
+
z120.literal("blank")
|
8644
8759
|
]).optional().nullable(),
|
8645
|
-
assigneeId:
|
8646
|
-
note:
|
8647
|
-
tags:
|
8648
|
-
handover:
|
8649
|
-
|
8760
|
+
assigneeId: z120.string().uuid().optional().nullable(),
|
8761
|
+
note: z120.string().optional(),
|
8762
|
+
tags: z120.array(z120.string().uuid()).optional(),
|
8763
|
+
handover: z120.boolean().or(
|
8764
|
+
z120.union([z120.literal("true"), z120.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
8650
8765
|
).optional().nullable(),
|
8651
|
-
selfAssign:
|
8652
|
-
|
8766
|
+
selfAssign: z120.boolean().or(
|
8767
|
+
z120.union([z120.literal("true"), z120.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
8653
8768
|
).optional().nullable()
|
8654
8769
|
})
|
8655
8770
|
}
|
8656
8771
|
};
|
8657
8772
|
|
8658
8773
|
// src/mail/room-contract.ts
|
8659
|
-
var roomContract =
|
8774
|
+
var roomContract = initContract45().router(
|
8660
8775
|
{
|
8661
8776
|
create: {
|
8662
8777
|
method: "POST",
|
8663
8778
|
path: "/",
|
8664
8779
|
responses: {
|
8665
8780
|
200: DefaultSuccessResponseSchema.extend({
|
8666
|
-
message:
|
8781
|
+
message: z121.string()
|
8667
8782
|
}),
|
8668
8783
|
...DefaultResponses
|
8669
8784
|
},
|
@@ -8676,10 +8791,10 @@ var roomContract = initContract44().router(
|
|
8676
8791
|
query: RoomContractsValidationSchema.getAll.input,
|
8677
8792
|
responses: {
|
8678
8793
|
200: DefaultSuccessResponseSchema.extend({
|
8679
|
-
data:
|
8680
|
-
total:
|
8681
|
-
page:
|
8682
|
-
pageSize:
|
8794
|
+
data: z121.array(MailRoomSchema),
|
8795
|
+
total: z121.number(),
|
8796
|
+
page: z121.number(),
|
8797
|
+
pageSize: z121.number()
|
8683
8798
|
}),
|
8684
8799
|
...DefaultResponses
|
8685
8800
|
},
|
@@ -8691,24 +8806,24 @@ var roomContract = initContract44().router(
|
|
8691
8806
|
path: "/count_rooms/all",
|
8692
8807
|
responses: {
|
8693
8808
|
200: DefaultSuccessResponseSchema.extend({
|
8694
|
-
data:
|
8695
|
-
general:
|
8696
|
-
|
8697
|
-
name:
|
8698
|
-
count:
|
8699
|
-
unReadMessagesCount:
|
8809
|
+
data: z121.object({
|
8810
|
+
general: z121.array(
|
8811
|
+
z121.object({
|
8812
|
+
name: z121.string(),
|
8813
|
+
count: z121.number(),
|
8814
|
+
unReadMessagesCount: z121.number()
|
8700
8815
|
})
|
8701
8816
|
),
|
8702
|
-
channels:
|
8703
|
-
|
8817
|
+
channels: z121.array(
|
8818
|
+
z121.object({
|
8704
8819
|
channel: MailAccountSchema,
|
8705
|
-
count:
|
8820
|
+
count: z121.number()
|
8706
8821
|
})
|
8707
8822
|
),
|
8708
|
-
contactLabels:
|
8709
|
-
|
8823
|
+
contactLabels: z121.array(
|
8824
|
+
z121.object({
|
8710
8825
|
label: TagSchema,
|
8711
|
-
count:
|
8826
|
+
count: z121.number()
|
8712
8827
|
})
|
8713
8828
|
)
|
8714
8829
|
})
|
@@ -8720,12 +8835,12 @@ var roomContract = initContract44().router(
|
|
8720
8835
|
getAttachments: {
|
8721
8836
|
method: "GET",
|
8722
8837
|
path: "/:id/attachments",
|
8723
|
-
pathParams:
|
8724
|
-
id:
|
8838
|
+
pathParams: z121.object({
|
8839
|
+
id: z121.string().uuid()
|
8725
8840
|
}),
|
8726
8841
|
responses: {
|
8727
8842
|
200: DefaultSuccessResponseSchema.extend({
|
8728
|
-
data:
|
8843
|
+
data: z121.array(AttachmentSchema2)
|
8729
8844
|
}),
|
8730
8845
|
...DefaultResponses
|
8731
8846
|
},
|
@@ -8734,12 +8849,12 @@ var roomContract = initContract44().router(
|
|
8734
8849
|
getParticipants: {
|
8735
8850
|
method: "GET",
|
8736
8851
|
path: "/:id/participants",
|
8737
|
-
pathParams:
|
8738
|
-
id:
|
8852
|
+
pathParams: z121.object({
|
8853
|
+
id: z121.string().uuid()
|
8739
8854
|
}),
|
8740
8855
|
responses: {
|
8741
8856
|
200: DefaultSuccessResponseSchema.extend({
|
8742
|
-
data:
|
8857
|
+
data: z121.array(MailParticipant)
|
8743
8858
|
}),
|
8744
8859
|
...DefaultResponses
|
8745
8860
|
},
|
@@ -8750,22 +8865,22 @@ var roomContract = initContract44().router(
|
|
8750
8865
|
path: "/add_email_to_contact",
|
8751
8866
|
responses: {
|
8752
8867
|
200: DefaultSuccessResponseSchema.extend({
|
8753
|
-
data:
|
8868
|
+
data: z121.string()
|
8754
8869
|
}),
|
8755
8870
|
...DefaultResponses
|
8756
8871
|
},
|
8757
|
-
body:
|
8758
|
-
email:
|
8759
|
-
contactId:
|
8760
|
-
mailUserId:
|
8872
|
+
body: z121.object({
|
8873
|
+
email: z121.string(),
|
8874
|
+
contactId: z121.string(),
|
8875
|
+
mailUserId: z121.string()
|
8761
8876
|
}),
|
8762
8877
|
summary: "Add a new email of a mail room participant to an existing contact"
|
8763
8878
|
},
|
8764
8879
|
update: {
|
8765
8880
|
method: "PATCH",
|
8766
8881
|
path: "/:id",
|
8767
|
-
pathParams:
|
8768
|
-
id:
|
8882
|
+
pathParams: z121.object({
|
8883
|
+
id: z121.string()
|
8769
8884
|
}),
|
8770
8885
|
responses: {
|
8771
8886
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8779,12 +8894,12 @@ var roomContract = initContract44().router(
|
|
8779
8894
|
markAsRead: {
|
8780
8895
|
method: "POST",
|
8781
8896
|
path: "/mark_as_read",
|
8782
|
-
body:
|
8783
|
-
id:
|
8897
|
+
body: z121.object({
|
8898
|
+
id: z121.string()
|
8784
8899
|
}),
|
8785
8900
|
responses: {
|
8786
8901
|
200: DefaultSuccessResponseSchema.extend({
|
8787
|
-
message:
|
8902
|
+
message: z121.string()
|
8788
8903
|
}),
|
8789
8904
|
...DefaultResponses
|
8790
8905
|
},
|
@@ -8793,8 +8908,8 @@ var roomContract = initContract44().router(
|
|
8793
8908
|
getById: {
|
8794
8909
|
method: "GET",
|
8795
8910
|
path: "/:id",
|
8796
|
-
pathParams:
|
8797
|
-
id:
|
8911
|
+
pathParams: z121.object({
|
8912
|
+
id: z121.string().uuid()
|
8798
8913
|
}),
|
8799
8914
|
responses: {
|
8800
8915
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8811,72 +8926,78 @@ var roomContract = initContract44().router(
|
|
8811
8926
|
);
|
8812
8927
|
|
8813
8928
|
// src/mail/account-contract.ts
|
8814
|
-
import { initContract as
|
8815
|
-
import
|
8929
|
+
import { initContract as initContract46 } from "@ts-rest/core";
|
8930
|
+
import z123 from "zod";
|
8816
8931
|
|
8817
8932
|
// src/mail/schemas/account-validation.schema.ts
|
8818
|
-
import
|
8933
|
+
import z122 from "zod";
|
8819
8934
|
var AccountContractsValidationSchemas = {
|
8820
8935
|
create: {
|
8821
|
-
input:
|
8822
|
-
address:
|
8823
|
-
name:
|
8824
|
-
password:
|
8825
|
-
mailServerId:
|
8936
|
+
input: z122.object({
|
8937
|
+
address: z122.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
8938
|
+
name: z122.string().min(1, "Account name cannot be empty."),
|
8939
|
+
password: z122.string().min(1, "Password cannot be empty."),
|
8940
|
+
mailServerId: z122.string().uuid("Invalid mail_server_id")
|
8826
8941
|
})
|
8827
8942
|
},
|
8828
8943
|
getById: {
|
8829
|
-
input:
|
8830
|
-
id:
|
8944
|
+
input: z122.object({
|
8945
|
+
id: z122.string().uuid()
|
8831
8946
|
}),
|
8832
8947
|
output: MailAccountSchema
|
8833
8948
|
},
|
8834
8949
|
getAll: {
|
8835
|
-
output:
|
8950
|
+
output: z122.array(MailAccountSchema)
|
8836
8951
|
},
|
8837
8952
|
update: {
|
8838
8953
|
input: MailAccountSchema,
|
8839
8954
|
output: MailAccountSchema
|
8840
8955
|
},
|
8841
8956
|
disconnect: {
|
8842
|
-
input:
|
8843
|
-
id:
|
8957
|
+
input: z122.object({
|
8958
|
+
id: z122.string().uuid()
|
8844
8959
|
}),
|
8845
8960
|
output: MailAccountSchema
|
8846
8961
|
},
|
8847
8962
|
reconnect: {
|
8848
|
-
input:
|
8849
|
-
id:
|
8963
|
+
input: z122.object({
|
8964
|
+
id: z122.string()
|
8850
8965
|
}),
|
8851
8966
|
output: MailAccountSchema
|
8852
8967
|
},
|
8853
8968
|
delete: {
|
8854
|
-
input:
|
8855
|
-
id:
|
8969
|
+
input: z122.object({
|
8970
|
+
id: z122.string()
|
8971
|
+
}),
|
8972
|
+
output: z122.string()
|
8973
|
+
},
|
8974
|
+
deleteEmailEngineAcc: {
|
8975
|
+
input: z122.object({
|
8976
|
+
account: z122.string()
|
8856
8977
|
}),
|
8857
8978
|
output: MailAccountSchema
|
8858
8979
|
},
|
8859
8980
|
generateOAuth2AuthenticationLink: {
|
8860
|
-
body:
|
8861
|
-
oAuth2AppId:
|
8862
|
-
mailServerId:
|
8981
|
+
body: z122.object({
|
8982
|
+
oAuth2AppId: z122.string(),
|
8983
|
+
mailServerId: z122.string()
|
8863
8984
|
}),
|
8864
|
-
response:
|
8865
|
-
url:
|
8866
|
-
account:
|
8985
|
+
response: z122.object({
|
8986
|
+
url: z122.string(),
|
8987
|
+
account: z122.string()
|
8867
8988
|
})
|
8868
8989
|
},
|
8869
8990
|
createOAuth2Acc: {
|
8870
|
-
body:
|
8871
|
-
account:
|
8872
|
-
name:
|
8991
|
+
body: z122.object({
|
8992
|
+
account: z122.string(),
|
8993
|
+
name: z122.string()
|
8873
8994
|
}),
|
8874
8995
|
response: MailAccountSchema
|
8875
8996
|
}
|
8876
8997
|
};
|
8877
8998
|
|
8878
8999
|
// src/mail/account-contract.ts
|
8879
|
-
var accountContract =
|
9000
|
+
var accountContract = initContract46().router(
|
8880
9001
|
{
|
8881
9002
|
//#region ........register account
|
8882
9003
|
create: {
|
@@ -8887,14 +9008,14 @@ var accountContract = initContract45().router(
|
|
8887
9008
|
// data: AccountContractsValidationSchemas.create.output,
|
8888
9009
|
data: MailAccountSchema
|
8889
9010
|
}),
|
8890
|
-
400:
|
8891
|
-
message:
|
9011
|
+
400: z123.object({
|
9012
|
+
message: z123.string()
|
8892
9013
|
}),
|
8893
|
-
409:
|
8894
|
-
message:
|
9014
|
+
409: z123.object({
|
9015
|
+
message: z123.string()
|
8895
9016
|
}),
|
8896
|
-
500:
|
8897
|
-
message:
|
9017
|
+
500: z123.object({
|
9018
|
+
message: z123.string()
|
8898
9019
|
}),
|
8899
9020
|
...DefaultResponses
|
8900
9021
|
},
|
@@ -8910,14 +9031,14 @@ var accountContract = initContract45().router(
|
|
8910
9031
|
201: DefaultSuccessResponseSchema.extend({
|
8911
9032
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
8912
9033
|
}),
|
8913
|
-
400:
|
8914
|
-
message:
|
9034
|
+
400: z123.object({
|
9035
|
+
message: z123.string()
|
8915
9036
|
}),
|
8916
|
-
409:
|
8917
|
-
message:
|
9037
|
+
409: z123.object({
|
9038
|
+
message: z123.string()
|
8918
9039
|
}),
|
8919
|
-
500:
|
8920
|
-
message:
|
9040
|
+
500: z123.object({
|
9041
|
+
message: z123.string()
|
8921
9042
|
}),
|
8922
9043
|
...DefaultResponses
|
8923
9044
|
},
|
@@ -8931,7 +9052,7 @@ var accountContract = initContract45().router(
|
|
8931
9052
|
path: "/sync",
|
8932
9053
|
responses: {
|
8933
9054
|
200: DefaultSuccessResponseSchema.extend({
|
8934
|
-
message:
|
9055
|
+
message: z123.string()
|
8935
9056
|
}),
|
8936
9057
|
...DefaultResponses
|
8937
9058
|
},
|
@@ -8956,13 +9077,13 @@ var accountContract = initContract45().router(
|
|
8956
9077
|
getAll: {
|
8957
9078
|
method: "GET",
|
8958
9079
|
path: "",
|
8959
|
-
query:
|
8960
|
-
state:
|
8961
|
-
withDeleted:
|
9080
|
+
query: z123.object({
|
9081
|
+
state: z123.union([z123.literal("connected"), z123.literal("disconnected")]).optional(),
|
9082
|
+
withDeleted: z123.boolean().default(false)
|
8962
9083
|
}).optional(),
|
8963
9084
|
responses: {
|
8964
9085
|
200: DefaultSuccessResponseSchema.extend({
|
8965
|
-
data:
|
9086
|
+
data: z123.array(MailAccountSchema)
|
8966
9087
|
}),
|
8967
9088
|
...DefaultResponses
|
8968
9089
|
},
|
@@ -8973,8 +9094,8 @@ var accountContract = initContract45().router(
|
|
8973
9094
|
update: {
|
8974
9095
|
method: "PATCH",
|
8975
9096
|
path: "/:id",
|
8976
|
-
pathParams:
|
8977
|
-
id:
|
9097
|
+
pathParams: z123.object({
|
9098
|
+
id: z123.string().uuid()
|
8978
9099
|
}),
|
8979
9100
|
responses: {
|
8980
9101
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -9023,7 +9144,22 @@ var accountContract = initContract45().router(
|
|
9023
9144
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
9024
9145
|
responses: {
|
9025
9146
|
200: DefaultSuccessResponseSchema.extend({
|
9026
|
-
message:
|
9147
|
+
message: z123.string()
|
9148
|
+
}),
|
9149
|
+
...DefaultResponses
|
9150
|
+
},
|
9151
|
+
body: null,
|
9152
|
+
summary: "Delete an account by id"
|
9153
|
+
},
|
9154
|
+
//#endregion delete account
|
9155
|
+
//#region ........delete account
|
9156
|
+
deleteEmailEngineAcc: {
|
9157
|
+
method: "DELETE",
|
9158
|
+
path: "/email-engine/:account",
|
9159
|
+
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
9160
|
+
responses: {
|
9161
|
+
200: DefaultSuccessResponseSchema.extend({
|
9162
|
+
message: z123.string()
|
9027
9163
|
}),
|
9028
9164
|
...DefaultResponses
|
9029
9165
|
},
|
@@ -9051,25 +9187,25 @@ var accountContract = initContract45().router(
|
|
9051
9187
|
);
|
9052
9188
|
|
9053
9189
|
// src/mail/mail-server-contract.ts
|
9054
|
-
import { initContract as
|
9055
|
-
import
|
9190
|
+
import { initContract as initContract47 } from "@ts-rest/core";
|
9191
|
+
import z125 from "zod";
|
9056
9192
|
|
9057
9193
|
// src/mail/schemas/servers-validation.schema.ts
|
9058
|
-
import
|
9059
|
-
var CreateMailServerSchema =
|
9060
|
-
name:
|
9061
|
-
smtpHost:
|
9062
|
-
smtpPort:
|
9063
|
-
smtpTlsPort:
|
9064
|
-
useTlsForSmtp:
|
9065
|
-
imapHost:
|
9066
|
-
imapPort:
|
9067
|
-
imapTlsPort:
|
9068
|
-
useTlsForImap:
|
9194
|
+
import z124 from "zod";
|
9195
|
+
var CreateMailServerSchema = z124.object({
|
9196
|
+
name: z124.string(),
|
9197
|
+
smtpHost: z124.string(),
|
9198
|
+
smtpPort: z124.number(),
|
9199
|
+
smtpTlsPort: z124.number(),
|
9200
|
+
useTlsForSmtp: z124.boolean(),
|
9201
|
+
imapHost: z124.string(),
|
9202
|
+
imapPort: z124.number(),
|
9203
|
+
imapTlsPort: z124.number(),
|
9204
|
+
useTlsForImap: z124.boolean()
|
9069
9205
|
});
|
9070
9206
|
|
9071
9207
|
// src/mail/mail-server-contract.ts
|
9072
|
-
var serverContract =
|
9208
|
+
var serverContract = initContract47().router(
|
9073
9209
|
{
|
9074
9210
|
create: {
|
9075
9211
|
method: "POST",
|
@@ -9088,11 +9224,11 @@ var serverContract = initContract46().router(
|
|
9088
9224
|
path: "/oauth2/apps",
|
9089
9225
|
responses: {
|
9090
9226
|
200: DefaultSuccessResponseSchema.extend({
|
9091
|
-
data:
|
9092
|
-
total:
|
9093
|
-
pages:
|
9094
|
-
page:
|
9095
|
-
apps:
|
9227
|
+
data: z125.object({
|
9228
|
+
total: z125.number(),
|
9229
|
+
pages: z125.number(),
|
9230
|
+
page: z125.number(),
|
9231
|
+
apps: z125.array(OAuth2AppSchema)
|
9096
9232
|
})
|
9097
9233
|
}),
|
9098
9234
|
...DefaultResponses
|
@@ -9102,8 +9238,8 @@ var serverContract = initContract46().router(
|
|
9102
9238
|
getById: {
|
9103
9239
|
method: "GET",
|
9104
9240
|
path: "/:id",
|
9105
|
-
pathParams:
|
9106
|
-
id:
|
9241
|
+
pathParams: z125.object({
|
9242
|
+
id: z125.string().uuid()
|
9107
9243
|
}),
|
9108
9244
|
responses: {
|
9109
9245
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9118,7 +9254,7 @@ var serverContract = initContract46().router(
|
|
9118
9254
|
path: "/",
|
9119
9255
|
responses: {
|
9120
9256
|
200: DefaultSuccessResponseSchema.extend({
|
9121
|
-
data:
|
9257
|
+
data: z125.array(MailServerSchema)
|
9122
9258
|
}),
|
9123
9259
|
...DefaultResponses
|
9124
9260
|
},
|
@@ -9127,8 +9263,8 @@ var serverContract = initContract46().router(
|
|
9127
9263
|
update: {
|
9128
9264
|
method: "PATCH",
|
9129
9265
|
path: "/:id",
|
9130
|
-
pathParams:
|
9131
|
-
id:
|
9266
|
+
pathParams: z125.object({
|
9267
|
+
id: z125.string().uuid()
|
9132
9268
|
}),
|
9133
9269
|
responses: {
|
9134
9270
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9142,8 +9278,8 @@ var serverContract = initContract46().router(
|
|
9142
9278
|
delete: {
|
9143
9279
|
method: "DELETE",
|
9144
9280
|
path: "/:id",
|
9145
|
-
pathParams:
|
9146
|
-
id:
|
9281
|
+
pathParams: z125.object({
|
9282
|
+
id: z125.string().uuid()
|
9147
9283
|
}),
|
9148
9284
|
responses: {
|
9149
9285
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9161,52 +9297,52 @@ var serverContract = initContract46().router(
|
|
9161
9297
|
);
|
9162
9298
|
|
9163
9299
|
// src/mail/message-contract.ts
|
9164
|
-
import { initContract as
|
9165
|
-
import
|
9300
|
+
import { initContract as initContract48 } from "@ts-rest/core";
|
9301
|
+
import z127 from "zod";
|
9166
9302
|
|
9167
9303
|
// src/mail/schemas/message-validation.schema.ts
|
9168
|
-
import
|
9169
|
-
var MailParticipant2 =
|
9170
|
-
name:
|
9171
|
-
address:
|
9304
|
+
import z126 from "zod";
|
9305
|
+
var MailParticipant2 = z126.object({
|
9306
|
+
name: z126.string().optional(),
|
9307
|
+
address: z126.string().email()
|
9172
9308
|
});
|
9173
9309
|
var MessageContractsValidationsSchema = {
|
9174
9310
|
submit: {
|
9175
|
-
input:
|
9176
|
-
subject:
|
9177
|
-
text:
|
9178
|
-
html:
|
9311
|
+
input: z126.object({
|
9312
|
+
subject: z126.string(),
|
9313
|
+
text: z126.string(),
|
9314
|
+
html: z126.string(),
|
9179
9315
|
from: MailParticipant2,
|
9180
9316
|
to: MailParticipant2,
|
9181
|
-
cc:
|
9182
|
-
bcc:
|
9183
|
-
sendAt:
|
9184
|
-
reference:
|
9185
|
-
messageId:
|
9186
|
-
action:
|
9317
|
+
cc: z126.array(MailParticipant2).optional(),
|
9318
|
+
bcc: z126.array(MailParticipant2).optional(),
|
9319
|
+
sendAt: z126.string().optional(),
|
9320
|
+
reference: z126.object({
|
9321
|
+
messageId: z126.string(),
|
9322
|
+
action: z126.union([z126.literal("reply"), z126.literal("forward")])
|
9187
9323
|
}).optional(),
|
9188
|
-
attachments:
|
9189
|
-
|
9190
|
-
fileType:
|
9191
|
-
fileName:
|
9192
|
-
fileKey:
|
9193
|
-
fileSize:
|
9194
|
-
bucketName:
|
9195
|
-
presignedUrl:
|
9324
|
+
attachments: z126.array(
|
9325
|
+
z126.object({
|
9326
|
+
fileType: z126.string(),
|
9327
|
+
fileName: z126.string(),
|
9328
|
+
fileKey: z126.string(),
|
9329
|
+
fileSize: z126.number(),
|
9330
|
+
bucketName: z126.string(),
|
9331
|
+
presignedUrl: z126.string()
|
9196
9332
|
})
|
9197
9333
|
).optional()
|
9198
9334
|
}),
|
9199
|
-
output:
|
9200
|
-
response:
|
9201
|
-
messageId:
|
9202
|
-
sendAt:
|
9203
|
-
queueId:
|
9335
|
+
output: z126.object({
|
9336
|
+
response: z126.string(),
|
9337
|
+
messageId: z126.string(),
|
9338
|
+
sendAt: z126.string(),
|
9339
|
+
queueId: z126.string()
|
9204
9340
|
})
|
9205
9341
|
}
|
9206
9342
|
};
|
9207
9343
|
|
9208
9344
|
// src/mail/message-contract.ts
|
9209
|
-
var messageContract =
|
9345
|
+
var messageContract = initContract48().router(
|
9210
9346
|
{
|
9211
9347
|
submit: {
|
9212
9348
|
method: "POST",
|
@@ -9229,8 +9365,8 @@ var messageContract = initContract47().router(
|
|
9229
9365
|
path: "/new_message_count",
|
9230
9366
|
responses: {
|
9231
9367
|
200: DefaultSuccessResponseSchema.extend({
|
9232
|
-
data:
|
9233
|
-
count:
|
9368
|
+
data: z127.object({
|
9369
|
+
count: z127.number()
|
9234
9370
|
})
|
9235
9371
|
}),
|
9236
9372
|
...DefaultResponses
|
@@ -9242,8 +9378,8 @@ var messageContract = initContract47().router(
|
|
9242
9378
|
getById: {
|
9243
9379
|
method: "GET",
|
9244
9380
|
path: "/:id",
|
9245
|
-
pathParams:
|
9246
|
-
id:
|
9381
|
+
pathParams: z127.object({
|
9382
|
+
id: z127.string()
|
9247
9383
|
}),
|
9248
9384
|
responses: {
|
9249
9385
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9258,8 +9394,8 @@ var messageContract = initContract47().router(
|
|
9258
9394
|
update: {
|
9259
9395
|
method: "PATCH",
|
9260
9396
|
path: "/:id",
|
9261
|
-
pathParams:
|
9262
|
-
id:
|
9397
|
+
pathParams: z127.object({
|
9398
|
+
id: z127.string()
|
9263
9399
|
}),
|
9264
9400
|
responses: {
|
9265
9401
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9275,8 +9411,8 @@ var messageContract = initContract47().router(
|
|
9275
9411
|
delete: {
|
9276
9412
|
method: "DELETE",
|
9277
9413
|
path: "/:id",
|
9278
|
-
pathParams:
|
9279
|
-
id:
|
9414
|
+
pathParams: z127.object({
|
9415
|
+
id: z127.string()
|
9280
9416
|
}),
|
9281
9417
|
responses: {
|
9282
9418
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9292,13 +9428,13 @@ var messageContract = initContract47().router(
|
|
9292
9428
|
cancelScheduledMessage: {
|
9293
9429
|
method: "DELETE",
|
9294
9430
|
path: "/scheduled_message/:id",
|
9295
|
-
pathParams:
|
9296
|
-
id:
|
9431
|
+
pathParams: z127.object({
|
9432
|
+
id: z127.string()
|
9297
9433
|
}),
|
9298
9434
|
responses: {
|
9299
9435
|
200: DefaultSuccessResponseSchema.extend({
|
9300
|
-
data:
|
9301
|
-
totalMessagesCount:
|
9436
|
+
data: z127.object({
|
9437
|
+
totalMessagesCount: z127.number()
|
9302
9438
|
})
|
9303
9439
|
}),
|
9304
9440
|
...DefaultResponses
|
@@ -9314,7 +9450,7 @@ var messageContract = initContract47().router(
|
|
9314
9450
|
);
|
9315
9451
|
|
9316
9452
|
// src/mail/mail-contract.ts
|
9317
|
-
var mailContract =
|
9453
|
+
var mailContract = initContract49().router({
|
9318
9454
|
room: roomContract,
|
9319
9455
|
message: messageContract,
|
9320
9456
|
account: accountContract,
|
@@ -9322,44 +9458,44 @@ var mailContract = initContract48().router({
|
|
9322
9458
|
});
|
9323
9459
|
|
9324
9460
|
// src/webchat/index.ts
|
9325
|
-
import { initContract as
|
9461
|
+
import { initContract as initContract50 } from "@ts-rest/core";
|
9326
9462
|
|
9327
9463
|
// src/webchat/schema.ts
|
9328
|
-
import
|
9464
|
+
import z129 from "zod";
|
9329
9465
|
|
9330
9466
|
// src/webchat/validation.ts
|
9331
|
-
import
|
9467
|
+
import z128 from "zod";
|
9332
9468
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
9333
9469
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
9334
9470
|
return ChatwootChannelType3;
|
9335
9471
|
})(ChatwootChannelType2 || {});
|
9336
|
-
var WebChatChannelSchema =
|
9337
|
-
avatar:
|
9338
|
-
name:
|
9339
|
-
type:
|
9340
|
-
websiteName:
|
9341
|
-
welcomeTitle:
|
9342
|
-
websiteUrl:
|
9343
|
-
welcomeTagline:
|
9344
|
-
agentAwayMessage:
|
9345
|
-
widgetColor:
|
9472
|
+
var WebChatChannelSchema = z128.object({
|
9473
|
+
avatar: z128.string().optional(),
|
9474
|
+
name: z128.string(),
|
9475
|
+
type: z128.nativeEnum(ChatwootChannelType2),
|
9476
|
+
websiteName: z128.string(),
|
9477
|
+
welcomeTitle: z128.string(),
|
9478
|
+
websiteUrl: z128.string().url(),
|
9479
|
+
welcomeTagline: z128.string().optional(),
|
9480
|
+
agentAwayMessage: z128.string().optional(),
|
9481
|
+
widgetColor: z128.string().optional()
|
9346
9482
|
});
|
9347
9483
|
|
9348
9484
|
// src/webchat/schema.ts
|
9349
|
-
var ConnectWebChatChannelSchema =
|
9350
|
-
name:
|
9351
|
-
actor:
|
9352
|
-
id:
|
9353
|
-
name:
|
9354
|
-
email:
|
9355
|
-
address:
|
9356
|
-
phone:
|
9485
|
+
var ConnectWebChatChannelSchema = z129.object({
|
9486
|
+
name: z129.string(),
|
9487
|
+
actor: z129.object({
|
9488
|
+
id: z129.string().uuid(),
|
9489
|
+
name: z129.string(),
|
9490
|
+
email: z129.string().email(),
|
9491
|
+
address: z129.string().nullable(),
|
9492
|
+
phone: z129.string().nullable()
|
9357
9493
|
}),
|
9358
9494
|
channel: WebChatChannelSchema
|
9359
9495
|
});
|
9360
9496
|
|
9361
9497
|
// src/webchat/index.ts
|
9362
|
-
var platformWebchatContract =
|
9498
|
+
var platformWebchatContract = initContract50().router({
|
9363
9499
|
sendMessage: {
|
9364
9500
|
method: "POST",
|
9365
9501
|
path: "/message",
|
@@ -9386,33 +9522,33 @@ var platformWebchatContract = initContract49().router({
|
|
9386
9522
|
});
|
9387
9523
|
|
9388
9524
|
// src/hold-label/index.ts
|
9389
|
-
import { initContract as
|
9525
|
+
import { initContract as initContract51 } from "@ts-rest/core";
|
9390
9526
|
|
9391
9527
|
// src/hold-label/schema.ts
|
9392
|
-
import
|
9528
|
+
import z130 from "zod";
|
9393
9529
|
var HoldLabelSchema = DefaultEntitySchema.extend({
|
9394
|
-
name:
|
9395
|
-
position:
|
9530
|
+
name: z130.string(),
|
9531
|
+
position: z130.number()
|
9396
9532
|
});
|
9397
9533
|
|
9398
9534
|
// src/hold-label/index.ts
|
9399
|
-
import
|
9535
|
+
import z132 from "zod";
|
9400
9536
|
|
9401
9537
|
// src/hold-label/validation.ts
|
9402
|
-
import
|
9403
|
-
var UpdatePositionSchema2 =
|
9404
|
-
holdLabels:
|
9405
|
-
|
9538
|
+
import z131 from "zod";
|
9539
|
+
var UpdatePositionSchema2 = z131.object({
|
9540
|
+
holdLabels: z131.array(
|
9541
|
+
z131.object({ id: z131.string().uuid(), position: z131.number() })
|
9406
9542
|
)
|
9407
9543
|
});
|
9408
9544
|
|
9409
9545
|
// src/hold-label/index.ts
|
9410
|
-
var holdLabelContract =
|
9546
|
+
var holdLabelContract = initContract51().router(
|
9411
9547
|
{
|
9412
9548
|
createHoldLabel: {
|
9413
9549
|
method: "POST",
|
9414
9550
|
path: "/",
|
9415
|
-
body:
|
9551
|
+
body: z132.object({ name: z132.string() }),
|
9416
9552
|
responses: {
|
9417
9553
|
201: DefaultSuccessResponseSchema.extend({
|
9418
9554
|
holdLabel: HoldLabelSchema
|
@@ -9424,7 +9560,7 @@ var holdLabelContract = initContract50().router(
|
|
9424
9560
|
path: "/",
|
9425
9561
|
responses: {
|
9426
9562
|
200: DefaultSuccessResponseSchema.extend({
|
9427
|
-
holdLabels:
|
9563
|
+
holdLabels: z132.array(HoldLabelSchema)
|
9428
9564
|
})
|
9429
9565
|
}
|
9430
9566
|
},
|
@@ -9442,8 +9578,8 @@ var holdLabelContract = initContract50().router(
|
|
9442
9578
|
updateHoldLabel: {
|
9443
9579
|
method: "PATCH",
|
9444
9580
|
path: "/:id",
|
9445
|
-
pathParams:
|
9446
|
-
body:
|
9581
|
+
pathParams: z132.object({ id: z132.string().uuid() }),
|
9582
|
+
body: z132.object({ name: z132.string() }),
|
9447
9583
|
responses: {
|
9448
9584
|
200: DefaultSuccessResponseSchema.extend({
|
9449
9585
|
holdLabel: HoldLabelSchema
|
@@ -9453,7 +9589,7 @@ var holdLabelContract = initContract50().router(
|
|
9453
9589
|
deleteHoldLabel: {
|
9454
9590
|
method: "DELETE",
|
9455
9591
|
path: "/:id",
|
9456
|
-
pathParams:
|
9592
|
+
pathParams: z132.object({ id: z132.string().uuid() }),
|
9457
9593
|
body: null,
|
9458
9594
|
responses: {
|
9459
9595
|
200: DefaultSuccessResponseSchema
|
@@ -9464,17 +9600,17 @@ var holdLabelContract = initContract50().router(
|
|
9464
9600
|
path: "/auto-unhold",
|
9465
9601
|
responses: {
|
9466
9602
|
200: DefaultSuccessResponseSchema.extend({
|
9467
|
-
autoUnhold:
|
9603
|
+
autoUnhold: z132.boolean()
|
9468
9604
|
})
|
9469
9605
|
}
|
9470
9606
|
},
|
9471
9607
|
updateAutoUnhold: {
|
9472
9608
|
method: "POST",
|
9473
9609
|
path: "/auto-unhold",
|
9474
|
-
body:
|
9610
|
+
body: z132.object({ autoUnhold: z132.boolean() }),
|
9475
9611
|
responses: {
|
9476
9612
|
200: DefaultSuccessResponseSchema.extend({
|
9477
|
-
autoUnhold:
|
9613
|
+
autoUnhold: z132.boolean()
|
9478
9614
|
})
|
9479
9615
|
}
|
9480
9616
|
}
|
@@ -9527,6 +9663,7 @@ export {
|
|
9527
9663
|
platformInstagramContract,
|
9528
9664
|
platformMessengerContract,
|
9529
9665
|
platformSMSContract,
|
9666
|
+
platformTelegramContract,
|
9530
9667
|
platformWebchatContract,
|
9531
9668
|
presenceStatusContract2 as presenceStatusContract,
|
9532
9669
|
publicApiContract2 as publicApiContract,
|