@kl1/contracts 1.1.49 → 1.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-contracts/src/channel/index.d.ts +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 +5 -2
- package/dist/api-contracts/src/chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/contact/index.d.ts +12 -0
- package/dist/api-contracts/src/contact/index.d.ts.map +1 -1
- package/dist/api-contracts/src/contact/validation.d.ts +6 -0
- package/dist/api-contracts/src/contact/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +21113 -667
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/account-contract.d.ts +11 -11
- package/dist/api-contracts/src/mail/index.d.ts +2 -1
- package/dist/api-contracts/src/mail/index.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/mail-contract.d.ts +29000 -7921
- package/dist/api-contracts/src/mail/mail-contract.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/mail-server-contract.d.ts +6 -6
- package/dist/api-contracts/src/mail/message-contract.d.ts +5033 -67
- package/dist/api-contracts/src/mail/message-contract.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/room-contract.d.ts +18048 -1933
- package/dist/api-contracts/src/mail/room-contract.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/schemas/message-validation.schema.d.ts +7 -4
- package/dist/api-contracts/src/mail/schemas/message-validation.schema.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/schemas/message.schema.d.ts +762 -40
- package/dist/api-contracts/src/mail/schemas/message.schema.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/schemas/room-validation.schema.d.ts +5639 -347
- package/dist/api-contracts/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
- package/dist/api-contracts/src/mail/schemas/room.schema.d.ts +5635 -304
- package/dist/api-contracts/src/mail/schemas/room.schema.d.ts.map +1 -1
- package/dist/api-contracts/src/telegram/index.d.ts +216 -1430
- package/dist/api-contracts/src/telegram/index.d.ts.map +1 -1
- package/dist/index.js +1095 -880
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1094 -880
- 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 initContract41 } from "@ts-rest/core";
|
3
3
|
|
4
4
|
// src/activity-log/index.ts
|
5
5
|
import { initContract } from "@ts-rest/core";
|
@@ -1994,6 +1994,10 @@ var ConnectViberChannelSchema = z34.object({
|
|
1994
1994
|
name: z34.string(),
|
1995
1995
|
accessToken: z34.string()
|
1996
1996
|
});
|
1997
|
+
var ConnectTelegramChannelSchema = z34.object({
|
1998
|
+
name: z34.string(),
|
1999
|
+
accessToken: z34.string()
|
2000
|
+
});
|
1997
2001
|
var ChatwootChannelType = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
1998
2002
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
1999
2003
|
return ChatwootChannelType3;
|
@@ -2213,6 +2217,26 @@ var viber = initContract6().router(
|
|
2213
2217
|
pathPrefix: "/viber"
|
2214
2218
|
}
|
2215
2219
|
);
|
2220
|
+
var telegram = initContract6().router(
|
2221
|
+
{
|
2222
|
+
connect: {
|
2223
|
+
method: "POST",
|
2224
|
+
path: "/connect",
|
2225
|
+
responses: {
|
2226
|
+
200: DefaultSuccessResponseSchema.extend({
|
2227
|
+
channel: ChannelSchema
|
2228
|
+
}),
|
2229
|
+
408: DefaultErrorResponseSchema,
|
2230
|
+
400: DefaultErrorResponseSchema
|
2231
|
+
},
|
2232
|
+
body: ConnectTelegramChannelSchema,
|
2233
|
+
summary: "Connect telegram channel"
|
2234
|
+
}
|
2235
|
+
},
|
2236
|
+
{
|
2237
|
+
pathPrefix: "/telegram"
|
2238
|
+
}
|
2239
|
+
);
|
2216
2240
|
var channelContract = initContract6().router(
|
2217
2241
|
{
|
2218
2242
|
getChannels: {
|
@@ -2315,6 +2339,7 @@ var channelContract = initContract6().router(
|
|
2315
2339
|
line,
|
2316
2340
|
instagram,
|
2317
2341
|
viber,
|
2342
|
+
telegram,
|
2318
2343
|
webchat,
|
2319
2344
|
facebookFeed
|
2320
2345
|
},
|
@@ -2610,7 +2635,7 @@ var mainChatContract = initContract7().router(
|
|
2610
2635
|
data: z37.array(MessageWithFeedPostSchema)
|
2611
2636
|
})
|
2612
2637
|
},
|
2613
|
-
query:
|
2638
|
+
query: OrderQueryParamSchema,
|
2614
2639
|
summary: "Get messages"
|
2615
2640
|
},
|
2616
2641
|
updateUnassignRoomsToAssignee: {
|
@@ -3133,7 +3158,9 @@ var ContactContractValidationSchema = {
|
|
3133
3158
|
isDefaultAttribute: z44.boolean()
|
3134
3159
|
})
|
3135
3160
|
)
|
3136
|
-
)
|
3161
|
+
),
|
3162
|
+
mailRoomId: z44.string().optional(),
|
3163
|
+
isTheMailRoomOwner: z44.coerce.boolean().optional()
|
3137
3164
|
}),
|
3138
3165
|
response: z44.string()
|
3139
3166
|
},
|
@@ -6622,64 +6649,150 @@ var viberContract = initContract31().router({
|
|
6622
6649
|
}
|
6623
6650
|
});
|
6624
6651
|
|
6625
|
-
// src/
|
6652
|
+
// src/telegram/index.ts
|
6653
|
+
import z89 from "zod";
|
6626
6654
|
import { initContract as initContract32 } from "@ts-rest/core";
|
6627
|
-
|
6655
|
+
|
6656
|
+
// src/telegram/validation.ts
|
6657
|
+
import z88 from "zod";
|
6658
|
+
var TelegramChannelSchema = z88.object({
|
6659
|
+
name: z88.string(),
|
6660
|
+
// Telegram bot access token
|
6661
|
+
accessToken: z88.string(),
|
6662
|
+
actor: z88.object({
|
6663
|
+
id: z88.string().uuid(),
|
6664
|
+
name: z88.string(),
|
6665
|
+
email: z88.string().email(),
|
6666
|
+
address: z88.string().nullable(),
|
6667
|
+
phone: z88.string().nullable()
|
6668
|
+
}).optional()
|
6669
|
+
});
|
6670
|
+
|
6671
|
+
// src/telegram/index.ts
|
6672
|
+
var telegramContract = initContract32().router({
|
6673
|
+
connect: {
|
6674
|
+
method: "POST",
|
6675
|
+
path: "/connect",
|
6676
|
+
responses: {
|
6677
|
+
200: DefaultSuccessResponseSchema.extend({
|
6678
|
+
channel: ChannelSchema
|
6679
|
+
}),
|
6680
|
+
400: DefaultErrorResponseSchema,
|
6681
|
+
408: DefaultErrorResponseSchema
|
6682
|
+
},
|
6683
|
+
body: TelegramChannelSchema,
|
6684
|
+
summary: "Connect telegram channel"
|
6685
|
+
},
|
6686
|
+
disconnect: {
|
6687
|
+
method: "POST",
|
6688
|
+
path: "/disconnect",
|
6689
|
+
responses: {
|
6690
|
+
200: ChannelServiceResponseSchema,
|
6691
|
+
500: DefaultErrorResponseSchema,
|
6692
|
+
400: DefaultErrorResponseSchema
|
6693
|
+
},
|
6694
|
+
body: z89.object({
|
6695
|
+
id: z89.string().uuid()
|
6696
|
+
}),
|
6697
|
+
summary: "Disconnect telegram channel"
|
6698
|
+
},
|
6699
|
+
sendMessage: {
|
6700
|
+
method: "POST",
|
6701
|
+
path: "/message",
|
6702
|
+
body: SendMessageToPlatformSchema,
|
6703
|
+
responses: {
|
6704
|
+
200: SendMessageResponseSchema,
|
6705
|
+
500: DefaultErrorResponseSchema
|
6706
|
+
}
|
6707
|
+
},
|
6708
|
+
reconnect: {
|
6709
|
+
method: "POST",
|
6710
|
+
path: "/reconnect/:channelId",
|
6711
|
+
pathParams: z89.object({
|
6712
|
+
channelId: z89.string().uuid()
|
6713
|
+
}),
|
6714
|
+
body: null,
|
6715
|
+
responses: {
|
6716
|
+
200: ChannelServiceResponseSchema,
|
6717
|
+
500: DefaultErrorResponseSchema,
|
6718
|
+
400: DefaultErrorResponseSchema
|
6719
|
+
},
|
6720
|
+
summary: "Reconnect telegram channel"
|
6721
|
+
},
|
6722
|
+
delete: {
|
6723
|
+
method: "DELETE",
|
6724
|
+
path: "/delete/:channelId",
|
6725
|
+
pathParams: z89.object({
|
6726
|
+
channelId: z89.string().uuid()
|
6727
|
+
}),
|
6728
|
+
body: null,
|
6729
|
+
responses: {
|
6730
|
+
200: ChannelServiceResponseSchema,
|
6731
|
+
500: DefaultErrorResponseSchema,
|
6732
|
+
400: DefaultErrorResponseSchema
|
6733
|
+
},
|
6734
|
+
summary: "Delete telegram channel"
|
6735
|
+
}
|
6736
|
+
});
|
6737
|
+
|
6738
|
+
// src/notification/index.ts
|
6739
|
+
import { initContract as initContract33 } from "@ts-rest/core";
|
6740
|
+
import z92 from "zod";
|
6628
6741
|
|
6629
6742
|
// src/notification/validation.ts
|
6630
|
-
import
|
6743
|
+
import z91 from "zod";
|
6631
6744
|
|
6632
6745
|
// src/notification/schema.ts
|
6633
|
-
import
|
6634
|
-
var NotificationChangeSchema =
|
6635
|
-
id:
|
6636
|
-
createdAt:
|
6637
|
-
updatedAt:
|
6638
|
-
deletedAt:
|
6639
|
-
actorId:
|
6746
|
+
import z90 from "zod";
|
6747
|
+
var NotificationChangeSchema = z90.object({
|
6748
|
+
id: z90.string().uuid(),
|
6749
|
+
createdAt: z90.date(),
|
6750
|
+
updatedAt: z90.date(),
|
6751
|
+
deletedAt: z90.date().nullable(),
|
6752
|
+
actorId: z90.string().uuid(),
|
6640
6753
|
actor: UserSchema,
|
6641
|
-
notificationObjectId:
|
6642
|
-
readAt:
|
6643
|
-
});
|
6644
|
-
var NotificationObjectSchema =
|
6645
|
-
id:
|
6646
|
-
createdAt:
|
6647
|
-
updatedAt:
|
6648
|
-
deletedAt:
|
6649
|
-
data:
|
6754
|
+
notificationObjectId: z90.string().uuid(),
|
6755
|
+
readAt: z90.date()
|
6756
|
+
});
|
6757
|
+
var NotificationObjectSchema = z90.object({
|
6758
|
+
id: z90.string().uuid(),
|
6759
|
+
createdAt: z90.date(),
|
6760
|
+
updatedAt: z90.date(),
|
6761
|
+
deletedAt: z90.date().nullable(),
|
6762
|
+
data: z90.string(),
|
6650
6763
|
notificationChange: NotificationChangeSchema
|
6651
6764
|
});
|
6652
|
-
var NotificationSchema =
|
6653
|
-
id:
|
6654
|
-
createdAt:
|
6655
|
-
updatedAt:
|
6656
|
-
deletedAt:
|
6657
|
-
notificationObjectId:
|
6658
|
-
notifierId:
|
6765
|
+
var NotificationSchema = z90.object({
|
6766
|
+
id: z90.string().uuid(),
|
6767
|
+
createdAt: z90.date(),
|
6768
|
+
updatedAt: z90.date(),
|
6769
|
+
deletedAt: z90.date().nullable(),
|
6770
|
+
notificationObjectId: z90.string().uuid(),
|
6771
|
+
notifierId: z90.string().uuid(),
|
6659
6772
|
notificationObject: NotificationObjectSchema,
|
6660
|
-
readAt:
|
6773
|
+
readAt: z90.date()
|
6661
6774
|
});
|
6662
6775
|
|
6663
6776
|
// src/notification/validation.ts
|
6664
|
-
var GetNotificationsRequestSchema =
|
6665
|
-
page:
|
6666
|
-
pageSize:
|
6777
|
+
var GetNotificationsRequestSchema = z91.object({
|
6778
|
+
page: z91.coerce.number().default(1),
|
6779
|
+
pageSize: z91.coerce.number().default(10)
|
6667
6780
|
});
|
6668
|
-
var GetNotificationsResponseSchema =
|
6669
|
-
notificationCount:
|
6670
|
-
notifications:
|
6671
|
-
total:
|
6672
|
-
page:
|
6673
|
-
pageSize:
|
6674
|
-
lastPage:
|
6675
|
-
totalUnreadCount:
|
6781
|
+
var GetNotificationsResponseSchema = z91.object({
|
6782
|
+
notificationCount: z91.number(),
|
6783
|
+
notifications: z91.array(NotificationSchema),
|
6784
|
+
total: z91.number(),
|
6785
|
+
page: z91.number(),
|
6786
|
+
pageSize: z91.number(),
|
6787
|
+
lastPage: z91.number(),
|
6788
|
+
totalUnreadCount: z91.number().optional()
|
6676
6789
|
});
|
6677
|
-
var ResetNotificationRequestSchema =
|
6678
|
-
userId:
|
6790
|
+
var ResetNotificationRequestSchema = z91.object({
|
6791
|
+
userId: z91.string()
|
6679
6792
|
});
|
6680
6793
|
|
6681
6794
|
// src/notification/index.ts
|
6682
|
-
var userNotificationContract =
|
6795
|
+
var userNotificationContract = initContract33().router(
|
6683
6796
|
{
|
6684
6797
|
getNotifications: {
|
6685
6798
|
method: "GET",
|
@@ -6689,14 +6802,14 @@ var userNotificationContract = initContract32().router(
|
|
6689
6802
|
200: DefaultSuccessResponseSchema.extend({
|
6690
6803
|
data: GetNotificationsResponseSchema
|
6691
6804
|
}),
|
6692
|
-
400:
|
6693
|
-
message:
|
6805
|
+
400: z92.object({
|
6806
|
+
message: z92.string()
|
6694
6807
|
}),
|
6695
|
-
409:
|
6696
|
-
message:
|
6808
|
+
409: z92.object({
|
6809
|
+
message: z92.string()
|
6697
6810
|
}),
|
6698
|
-
500:
|
6699
|
-
message:
|
6811
|
+
500: z92.object({
|
6812
|
+
message: z92.string()
|
6700
6813
|
}),
|
6701
6814
|
401: DefaultUnauthorizedSchema,
|
6702
6815
|
404: DefaultNotFoundSchema,
|
@@ -6709,16 +6822,16 @@ var userNotificationContract = initContract32().router(
|
|
6709
6822
|
path: "/new_notifications_count",
|
6710
6823
|
responses: {
|
6711
6824
|
200: DefaultSuccessResponseSchema.extend({
|
6712
|
-
total:
|
6825
|
+
total: z92.number()
|
6713
6826
|
}),
|
6714
|
-
400:
|
6715
|
-
message:
|
6827
|
+
400: z92.object({
|
6828
|
+
message: z92.string()
|
6716
6829
|
}),
|
6717
|
-
409:
|
6718
|
-
message:
|
6830
|
+
409: z92.object({
|
6831
|
+
message: z92.string()
|
6719
6832
|
}),
|
6720
|
-
500:
|
6721
|
-
message:
|
6833
|
+
500: z92.object({
|
6834
|
+
message: z92.string()
|
6722
6835
|
}),
|
6723
6836
|
401: DefaultUnauthorizedSchema,
|
6724
6837
|
404: DefaultNotFoundSchema,
|
@@ -6733,14 +6846,14 @@ var userNotificationContract = initContract32().router(
|
|
6733
6846
|
201: DefaultSuccessResponseSchema.extend({
|
6734
6847
|
data: UserSchema
|
6735
6848
|
}),
|
6736
|
-
400:
|
6737
|
-
message:
|
6849
|
+
400: z92.object({
|
6850
|
+
message: z92.string()
|
6738
6851
|
}),
|
6739
|
-
409:
|
6740
|
-
message:
|
6852
|
+
409: z92.object({
|
6853
|
+
message: z92.string()
|
6741
6854
|
}),
|
6742
|
-
500:
|
6743
|
-
message:
|
6855
|
+
500: z92.object({
|
6856
|
+
message: z92.string()
|
6744
6857
|
}),
|
6745
6858
|
401: DefaultUnauthorizedSchema,
|
6746
6859
|
404: DefaultNotFoundSchema,
|
@@ -6752,19 +6865,19 @@ var userNotificationContract = initContract32().router(
|
|
6752
6865
|
readNotification: {
|
6753
6866
|
method: "POST",
|
6754
6867
|
path: "/read/:id",
|
6755
|
-
pathParams:
|
6868
|
+
pathParams: z92.object({ id: z92.string() }),
|
6756
6869
|
responses: {
|
6757
6870
|
201: DefaultSuccessResponseSchema.extend({
|
6758
6871
|
data: NotificationSchema
|
6759
6872
|
}),
|
6760
|
-
400:
|
6761
|
-
message:
|
6873
|
+
400: z92.object({
|
6874
|
+
message: z92.string()
|
6762
6875
|
}),
|
6763
|
-
409:
|
6764
|
-
message:
|
6876
|
+
409: z92.object({
|
6877
|
+
message: z92.string()
|
6765
6878
|
}),
|
6766
|
-
500:
|
6767
|
-
message:
|
6879
|
+
500: z92.object({
|
6880
|
+
message: z92.string()
|
6768
6881
|
}),
|
6769
6882
|
401: DefaultUnauthorizedSchema,
|
6770
6883
|
404: DefaultNotFoundSchema,
|
@@ -6780,68 +6893,68 @@ var userNotificationContract = initContract32().router(
|
|
6780
6893
|
);
|
6781
6894
|
|
6782
6895
|
// src/snippet/index.ts
|
6783
|
-
import { initContract as
|
6784
|
-
import { z as
|
6896
|
+
import { initContract as initContract34 } from "@ts-rest/core";
|
6897
|
+
import { z as z95 } from "zod";
|
6785
6898
|
|
6786
6899
|
// src/snippet/schema.ts
|
6787
|
-
import
|
6900
|
+
import z93 from "zod";
|
6788
6901
|
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
6789
|
-
name:
|
6790
|
-
platformType:
|
6902
|
+
name: z93.string(),
|
6903
|
+
platformType: z93.string()
|
6791
6904
|
});
|
6792
6905
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
6793
|
-
contentType:
|
6794
|
-
contentValue:
|
6795
|
-
contentTemplate:
|
6796
|
-
order:
|
6906
|
+
contentType: z93.string(),
|
6907
|
+
contentValue: z93.string().nullable(),
|
6908
|
+
contentTemplate: z93.any().nullable(),
|
6909
|
+
order: z93.number(),
|
6797
6910
|
upload: UploadSchema.optional().nullable()
|
6798
6911
|
});
|
6799
6912
|
var SnippetSchema = DefaultEntitySchema.extend({
|
6800
|
-
name:
|
6913
|
+
name: z93.string(),
|
6801
6914
|
snippetGroup: SnippetGroupSchema,
|
6802
6915
|
snippetContent: SnippetContentSchema
|
6803
6916
|
});
|
6804
|
-
var SnippetGroupListItemSchema =
|
6805
|
-
id:
|
6806
|
-
name:
|
6917
|
+
var SnippetGroupListItemSchema = z93.object({
|
6918
|
+
id: z93.string().uuid(),
|
6919
|
+
name: z93.string()
|
6807
6920
|
});
|
6808
|
-
var SnippetListItemSchema =
|
6809
|
-
id:
|
6810
|
-
shortCutName:
|
6811
|
-
contentType:
|
6812
|
-
contentValue:
|
6813
|
-
snippetGroupId:
|
6921
|
+
var SnippetListItemSchema = z93.object({
|
6922
|
+
id: z93.string().uuid(),
|
6923
|
+
shortCutName: z93.string(),
|
6924
|
+
contentType: z93.string(),
|
6925
|
+
contentValue: z93.string().nullable(),
|
6926
|
+
snippetGroupId: z93.string()
|
6814
6927
|
});
|
6815
6928
|
|
6816
6929
|
// src/snippet/validation.ts
|
6817
|
-
import { z as
|
6818
|
-
var CreateSnippetGroupSchema =
|
6819
|
-
name:
|
6820
|
-
platformType:
|
6930
|
+
import { z as z94 } from "zod";
|
6931
|
+
var CreateSnippetGroupSchema = z94.object({
|
6932
|
+
name: z94.string(),
|
6933
|
+
platformType: z94.string()
|
6821
6934
|
});
|
6822
|
-
var UpdateSnippetGroupSchema =
|
6823
|
-
name:
|
6824
|
-
platformType:
|
6935
|
+
var UpdateSnippetGroupSchema = z94.object({
|
6936
|
+
name: z94.string().optional(),
|
6937
|
+
platformType: z94.string().optional()
|
6825
6938
|
});
|
6826
|
-
var DeleteSnippetGroupSchema =
|
6827
|
-
id:
|
6939
|
+
var DeleteSnippetGroupSchema = z94.object({
|
6940
|
+
id: z94.string()
|
6828
6941
|
});
|
6829
|
-
var CreateSnippetSchema =
|
6830
|
-
shortcutName:
|
6831
|
-
contentType:
|
6832
|
-
contentValue:
|
6833
|
-
snippetGroupId:
|
6834
|
-
platformType:
|
6942
|
+
var CreateSnippetSchema = z94.object({
|
6943
|
+
shortcutName: z94.string(),
|
6944
|
+
contentType: z94.string(),
|
6945
|
+
contentValue: z94.string().optional(),
|
6946
|
+
snippetGroupId: z94.string(),
|
6947
|
+
platformType: z94.string()
|
6835
6948
|
});
|
6836
6949
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
6837
|
-
snippetContentId:
|
6950
|
+
snippetContentId: z94.string()
|
6838
6951
|
});
|
6839
|
-
var DeleteSnippetSchema =
|
6840
|
-
snippetId:
|
6952
|
+
var DeleteSnippetSchema = z94.object({
|
6953
|
+
snippetId: z94.string()
|
6841
6954
|
});
|
6842
6955
|
|
6843
6956
|
// src/snippet/index.ts
|
6844
|
-
var snippetContract =
|
6957
|
+
var snippetContract = initContract34().router(
|
6845
6958
|
{
|
6846
6959
|
createSnippetGroup: {
|
6847
6960
|
method: "POST",
|
@@ -6860,7 +6973,7 @@ var snippetContract = initContract33().router(
|
|
6860
6973
|
query: null,
|
6861
6974
|
responses: {
|
6862
6975
|
200: DefaultSuccessResponseSchema.extend({
|
6863
|
-
snippetgroups:
|
6976
|
+
snippetgroups: z95.array(SnippetGroupSchema)
|
6864
6977
|
}),
|
6865
6978
|
500: DefaultErrorResponseSchema
|
6866
6979
|
}
|
@@ -6868,7 +6981,7 @@ var snippetContract = initContract33().router(
|
|
6868
6981
|
updateSnippetGroup: {
|
6869
6982
|
method: "PATCH",
|
6870
6983
|
path: "/groups/:id",
|
6871
|
-
pathParams:
|
6984
|
+
pathParams: z95.object({ id: z95.string() }),
|
6872
6985
|
body: UpdateSnippetGroupSchema,
|
6873
6986
|
responses: {
|
6874
6987
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6880,7 +6993,7 @@ var snippetContract = initContract33().router(
|
|
6880
6993
|
deleteSnippetGroup: {
|
6881
6994
|
method: "DELETE",
|
6882
6995
|
path: "/groups/:id",
|
6883
|
-
pathParams:
|
6996
|
+
pathParams: z95.object({ id: z95.string() }),
|
6884
6997
|
body: null,
|
6885
6998
|
responses: {
|
6886
6999
|
200: DefaultSuccessResponseSchema,
|
@@ -6892,7 +7005,7 @@ var snippetContract = initContract33().router(
|
|
6892
7005
|
path: "",
|
6893
7006
|
responses: {
|
6894
7007
|
200: DefaultSuccessResponseSchema.extend({
|
6895
|
-
snippets:
|
7008
|
+
snippets: z95.array(SnippetSchema)
|
6896
7009
|
}),
|
6897
7010
|
500: DefaultErrorResponseSchema
|
6898
7011
|
}
|
@@ -6911,7 +7024,7 @@ var snippetContract = initContract33().router(
|
|
6911
7024
|
updateSnippet: {
|
6912
7025
|
method: "PATCH",
|
6913
7026
|
path: "/:id",
|
6914
|
-
pathParams:
|
7027
|
+
pathParams: z95.object({ id: z95.string() }),
|
6915
7028
|
body: UpdateSnippetSchema,
|
6916
7029
|
responses: {
|
6917
7030
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6923,7 +7036,7 @@ var snippetContract = initContract33().router(
|
|
6923
7036
|
deleteSnippet: {
|
6924
7037
|
method: "DELETE",
|
6925
7038
|
path: "/:id",
|
6926
|
-
pathParams:
|
7039
|
+
pathParams: z95.object({ id: z95.string() }),
|
6927
7040
|
body: null,
|
6928
7041
|
responses: {
|
6929
7042
|
200: DefaultSuccessResponseSchema,
|
@@ -6937,81 +7050,81 @@ var snippetContract = initContract33().router(
|
|
6937
7050
|
);
|
6938
7051
|
|
6939
7052
|
// src/business-calendar/index.ts
|
6940
|
-
import { initContract as
|
7053
|
+
import { initContract as initContract35 } from "@ts-rest/core";
|
6941
7054
|
|
6942
7055
|
// src/business-calendar/validation.ts
|
6943
|
-
import
|
6944
|
-
var TimeSlotDataSchema =
|
6945
|
-
var CreateBusinessHourSchema =
|
6946
|
-
day:
|
6947
|
-
isEnabled:
|
7056
|
+
import z96 from "zod";
|
7057
|
+
var TimeSlotDataSchema = z96.any();
|
7058
|
+
var CreateBusinessHourSchema = z96.object({
|
7059
|
+
day: z96.string(),
|
7060
|
+
isEnabled: z96.boolean(),
|
6948
7061
|
timeSlots: TimeSlotDataSchema
|
6949
7062
|
}).array();
|
6950
|
-
var UpdateBusinessHourSchema =
|
6951
|
-
id:
|
6952
|
-
day:
|
6953
|
-
isEnabled:
|
7063
|
+
var UpdateBusinessHourSchema = z96.object({
|
7064
|
+
id: z96.string(),
|
7065
|
+
day: z96.string(),
|
7066
|
+
isEnabled: z96.boolean(),
|
6954
7067
|
timeSlots: TimeSlotDataSchema
|
6955
7068
|
}).array();
|
6956
|
-
var CreateHolidaySchema =
|
6957
|
-
name:
|
6958
|
-
date:
|
6959
|
-
isEnabled:
|
7069
|
+
var CreateHolidaySchema = z96.object({
|
7070
|
+
name: z96.string(),
|
7071
|
+
date: z96.string(),
|
7072
|
+
isEnabled: z96.boolean()
|
6960
7073
|
}).array();
|
6961
|
-
var UpdateHolidaySchema =
|
6962
|
-
id:
|
6963
|
-
name:
|
6964
|
-
date:
|
6965
|
-
isEnabled:
|
7074
|
+
var UpdateHolidaySchema = z96.object({
|
7075
|
+
id: z96.string().optional(),
|
7076
|
+
name: z96.string(),
|
7077
|
+
date: z96.string(),
|
7078
|
+
isEnabled: z96.boolean()
|
6966
7079
|
}).array();
|
6967
|
-
var CreateBusinessCalendarSchema =
|
6968
|
-
name:
|
6969
|
-
description:
|
6970
|
-
timeZone:
|
6971
|
-
isEnabled:
|
7080
|
+
var CreateBusinessCalendarSchema = z96.object({
|
7081
|
+
name: z96.string(),
|
7082
|
+
description: z96.string().optional(),
|
7083
|
+
timeZone: z96.string(),
|
7084
|
+
isEnabled: z96.boolean(),
|
6972
7085
|
businessHours: CreateBusinessHourSchema,
|
6973
7086
|
holidays: CreateHolidaySchema
|
6974
7087
|
});
|
6975
|
-
var UpdateBusinessCalendarSchema =
|
6976
|
-
id:
|
6977
|
-
name:
|
6978
|
-
description:
|
6979
|
-
timeZone:
|
6980
|
-
isEnabled:
|
7088
|
+
var UpdateBusinessCalendarSchema = z96.object({
|
7089
|
+
id: z96.string(),
|
7090
|
+
name: z96.string(),
|
7091
|
+
description: z96.string().optional(),
|
7092
|
+
timeZone: z96.string(),
|
7093
|
+
isEnabled: z96.boolean(),
|
6981
7094
|
businessHours: UpdateBusinessHourSchema,
|
6982
7095
|
holidays: UpdateHolidaySchema
|
6983
7096
|
});
|
6984
|
-
var DeleteBusinessCalendarSchema =
|
6985
|
-
id:
|
7097
|
+
var DeleteBusinessCalendarSchema = z96.object({
|
7098
|
+
id: z96.string()
|
6986
7099
|
});
|
6987
7100
|
|
6988
7101
|
// src/business-calendar/schema.ts
|
6989
|
-
import
|
6990
|
-
var TimeSlotDataSchema2 =
|
7102
|
+
import z97 from "zod";
|
7103
|
+
var TimeSlotDataSchema2 = z97.any();
|
6991
7104
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
6992
|
-
day:
|
6993
|
-
isEnabled:
|
7105
|
+
day: z97.string(),
|
7106
|
+
isEnabled: z97.boolean(),
|
6994
7107
|
timeSlots: TimeSlotDataSchema2
|
6995
7108
|
});
|
6996
7109
|
var HolidaySchema = DefaultEntitySchema.extend({
|
6997
|
-
name:
|
6998
|
-
date:
|
6999
|
-
isEnabled:
|
7000
|
-
isDefault:
|
7110
|
+
name: z97.string(),
|
7111
|
+
date: z97.string(),
|
7112
|
+
isEnabled: z97.boolean(),
|
7113
|
+
isDefault: z97.boolean()
|
7001
7114
|
});
|
7002
7115
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
7003
|
-
name:
|
7004
|
-
description:
|
7005
|
-
timeZone:
|
7006
|
-
isEnabled:
|
7007
|
-
isDefault:
|
7116
|
+
name: z97.string(),
|
7117
|
+
description: z97.string().optional(),
|
7118
|
+
timeZone: z97.string(),
|
7119
|
+
isEnabled: z97.boolean(),
|
7120
|
+
isDefault: z97.boolean(),
|
7008
7121
|
businessHours: BusinessHourSchema.array(),
|
7009
7122
|
holidays: HolidaySchema.array()
|
7010
7123
|
});
|
7011
7124
|
|
7012
7125
|
// src/business-calendar/index.ts
|
7013
|
-
import
|
7014
|
-
var businessCalendarContract =
|
7126
|
+
import z98 from "zod";
|
7127
|
+
var businessCalendarContract = initContract35().router({
|
7015
7128
|
createBusinessCalendar: {
|
7016
7129
|
method: "POST",
|
7017
7130
|
path: "business-calendar",
|
@@ -7036,7 +7149,7 @@ var businessCalendarContract = initContract34().router({
|
|
7036
7149
|
updateBusinessCalendar: {
|
7037
7150
|
method: "POST",
|
7038
7151
|
path: "business-calendars/:id",
|
7039
|
-
pathParams:
|
7152
|
+
pathParams: z98.object({ id: z98.string() }),
|
7040
7153
|
body: UpdateBusinessCalendarSchema,
|
7041
7154
|
responses: {
|
7042
7155
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -7048,7 +7161,7 @@ var businessCalendarContract = initContract34().router({
|
|
7048
7161
|
deleteBusinessCalendar: {
|
7049
7162
|
method: "DELETE",
|
7050
7163
|
path: "business-calendars/:id",
|
7051
|
-
pathParams:
|
7164
|
+
pathParams: z98.object({ id: z98.string() }),
|
7052
7165
|
body: null,
|
7053
7166
|
responses: {
|
7054
7167
|
200: DefaultSuccessResponseSchema,
|
@@ -7058,77 +7171,77 @@ var businessCalendarContract = initContract34().router({
|
|
7058
7171
|
});
|
7059
7172
|
|
7060
7173
|
// src/facebook-feed/index.ts
|
7061
|
-
import { initContract as
|
7174
|
+
import { initContract as initContract36 } from "@ts-rest/core";
|
7062
7175
|
|
7063
7176
|
// src/facebook-feed/validation.ts
|
7064
|
-
import
|
7065
|
-
var GetFacebookPagesSchema2 =
|
7066
|
-
data:
|
7067
|
-
|
7177
|
+
import z99 from "zod";
|
7178
|
+
var GetFacebookPagesSchema2 = z99.object({
|
7179
|
+
data: z99.array(
|
7180
|
+
z99.object({
|
7068
7181
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
7069
|
-
access_token:
|
7070
|
-
category:
|
7182
|
+
access_token: z99.string(),
|
7183
|
+
category: z99.string(),
|
7071
7184
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
7072
|
-
category_list:
|
7073
|
-
|
7074
|
-
id:
|
7075
|
-
name:
|
7185
|
+
category_list: z99.array(
|
7186
|
+
z99.object({
|
7187
|
+
id: z99.string(),
|
7188
|
+
name: z99.string()
|
7076
7189
|
})
|
7077
7190
|
),
|
7078
|
-
id:
|
7079
|
-
name:
|
7080
|
-
tasks:
|
7191
|
+
id: z99.string(),
|
7192
|
+
name: z99.string(),
|
7193
|
+
tasks: z99.string().array()
|
7081
7194
|
})
|
7082
7195
|
),
|
7083
|
-
paging:
|
7084
|
-
cursors:
|
7085
|
-
before:
|
7086
|
-
after:
|
7196
|
+
paging: z99.object({
|
7197
|
+
cursors: z99.object({
|
7198
|
+
before: z99.string().optional(),
|
7199
|
+
after: z99.string().optional()
|
7087
7200
|
})
|
7088
7201
|
}).optional()
|
7089
7202
|
});
|
7090
|
-
var GetFacebookPagesQuerySchema2 =
|
7091
|
-
accessToken:
|
7092
|
-
userId:
|
7203
|
+
var GetFacebookPagesQuerySchema2 = z99.object({
|
7204
|
+
accessToken: z99.string(),
|
7205
|
+
userId: z99.string()
|
7093
7206
|
});
|
7094
7207
|
var ReconnectFacebookFeedSchema = ChannelSchema.merge(
|
7095
|
-
|
7096
|
-
isReloginRequired:
|
7097
|
-
platformContacts:
|
7098
|
-
id:
|
7099
|
-
name:
|
7100
|
-
createdAt:
|
7101
|
-
updatedAt:
|
7102
|
-
deletedAt:
|
7208
|
+
z99.object({
|
7209
|
+
isReloginRequired: z99.boolean(),
|
7210
|
+
platformContacts: z99.array(PlatformContactSchema),
|
7211
|
+
id: z99.string().uuid(),
|
7212
|
+
name: z99.string(),
|
7213
|
+
createdAt: z99.date(),
|
7214
|
+
updatedAt: z99.date(),
|
7215
|
+
deletedAt: z99.date().nullable()
|
7103
7216
|
})
|
7104
7217
|
);
|
7105
|
-
var GetFeedPostResponseSchema =
|
7106
|
-
id:
|
7107
|
-
message:
|
7108
|
-
created_time:
|
7109
|
-
can_reply_privately:
|
7110
|
-
from:
|
7111
|
-
permalink_url:
|
7112
|
-
attachments:
|
7113
|
-
data:
|
7114
|
-
|
7115
|
-
media:
|
7116
|
-
image:
|
7117
|
-
height:
|
7118
|
-
src:
|
7119
|
-
width:
|
7218
|
+
var GetFeedPostResponseSchema = z99.object({
|
7219
|
+
id: z99.string(),
|
7220
|
+
message: z99.string(),
|
7221
|
+
created_time: z99.string(),
|
7222
|
+
can_reply_privately: z99.boolean(),
|
7223
|
+
from: z99.object({ name: z99.string(), id: z99.string() }),
|
7224
|
+
permalink_url: z99.string(),
|
7225
|
+
attachments: z99.object({
|
7226
|
+
data: z99.array(
|
7227
|
+
z99.object({
|
7228
|
+
media: z99.object({
|
7229
|
+
image: z99.object({
|
7230
|
+
height: z99.number(),
|
7231
|
+
src: z99.string(),
|
7232
|
+
width: z99.number()
|
7120
7233
|
})
|
7121
7234
|
}),
|
7122
|
-
media_type:
|
7123
|
-
url:
|
7235
|
+
media_type: z99.string(),
|
7236
|
+
url: z99.string()
|
7124
7237
|
})
|
7125
7238
|
)
|
7126
7239
|
})
|
7127
7240
|
});
|
7128
7241
|
|
7129
7242
|
// src/facebook-feed/index.ts
|
7130
|
-
import
|
7131
|
-
var facebookFeedContract =
|
7243
|
+
import z100 from "zod";
|
7244
|
+
var facebookFeedContract = initContract36().router({
|
7132
7245
|
connectToService: {
|
7133
7246
|
method: "POST",
|
7134
7247
|
path: "/connect",
|
@@ -7152,8 +7265,8 @@ var facebookFeedContract = initContract35().router({
|
|
7152
7265
|
reconnect: {
|
7153
7266
|
method: "POST",
|
7154
7267
|
path: "/reconnect/:channelId",
|
7155
|
-
pathParams:
|
7156
|
-
channelId:
|
7268
|
+
pathParams: z100.object({
|
7269
|
+
channelId: z100.string().uuid()
|
7157
7270
|
}),
|
7158
7271
|
body: null,
|
7159
7272
|
responses: {
|
@@ -7165,8 +7278,8 @@ var facebookFeedContract = initContract35().router({
|
|
7165
7278
|
delete: {
|
7166
7279
|
method: "DELETE",
|
7167
7280
|
path: "/delete/:channelId",
|
7168
|
-
pathParams:
|
7169
|
-
channelId:
|
7281
|
+
pathParams: z100.object({
|
7282
|
+
channelId: z100.string().uuid()
|
7170
7283
|
}),
|
7171
7284
|
body: null,
|
7172
7285
|
responses: {
|
@@ -7217,169 +7330,169 @@ var facebookFeedContract = initContract35().router({
|
|
7217
7330
|
});
|
7218
7331
|
|
7219
7332
|
// src/public-api/index.ts
|
7220
|
-
import { initContract as
|
7221
|
-
import
|
7333
|
+
import { initContract as initContract37 } from "@ts-rest/core";
|
7334
|
+
import z103 from "zod";
|
7222
7335
|
|
7223
7336
|
// src/public-api/validation.ts
|
7224
|
-
import
|
7337
|
+
import z102 from "zod";
|
7225
7338
|
|
7226
7339
|
// src/public-api/schema.ts
|
7227
|
-
import
|
7228
|
-
var ContactPhonesSchema2 =
|
7229
|
-
id:
|
7230
|
-
createdAt:
|
7231
|
-
updatedAt:
|
7232
|
-
deletedAt:
|
7233
|
-
phone:
|
7234
|
-
isPrimary:
|
7235
|
-
});
|
7236
|
-
var ContactEmailsSchema2 =
|
7237
|
-
id:
|
7238
|
-
createdAt:
|
7239
|
-
updatedAt:
|
7240
|
-
deletedAt:
|
7241
|
-
email:
|
7242
|
-
isPrimary:
|
7243
|
-
});
|
7244
|
-
var ContactCustomFieldSchema2 =
|
7245
|
-
id:
|
7246
|
-
createdAt:
|
7247
|
-
updatedAt:
|
7248
|
-
deletedAt:
|
7249
|
-
textValue:
|
7250
|
-
booleanValue:
|
7251
|
-
numberValue:
|
7252
|
-
dateValue:
|
7340
|
+
import z101 from "zod";
|
7341
|
+
var ContactPhonesSchema2 = z101.object({
|
7342
|
+
id: z101.string().uuid(),
|
7343
|
+
createdAt: z101.date(),
|
7344
|
+
updatedAt: z101.date(),
|
7345
|
+
deletedAt: z101.date().nullable(),
|
7346
|
+
phone: z101.string(),
|
7347
|
+
isPrimary: z101.boolean()
|
7348
|
+
});
|
7349
|
+
var ContactEmailsSchema2 = z101.object({
|
7350
|
+
id: z101.string().uuid(),
|
7351
|
+
createdAt: z101.date(),
|
7352
|
+
updatedAt: z101.date(),
|
7353
|
+
deletedAt: z101.date().nullable(),
|
7354
|
+
email: z101.string(),
|
7355
|
+
isPrimary: z101.boolean()
|
7356
|
+
});
|
7357
|
+
var ContactCustomFieldSchema2 = z101.object({
|
7358
|
+
id: z101.string().uuid(),
|
7359
|
+
createdAt: z101.date(),
|
7360
|
+
updatedAt: z101.date(),
|
7361
|
+
deletedAt: z101.date().nullable(),
|
7362
|
+
textValue: z101.string().nullable(),
|
7363
|
+
booleanValue: z101.boolean().nullable(),
|
7364
|
+
numberValue: z101.number().nullable(),
|
7365
|
+
dateValue: z101.date().nullable(),
|
7253
7366
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
7254
|
-
uploads:
|
7255
|
-
});
|
7256
|
-
var ContactEntityTypesSchema2 =
|
7257
|
-
id:
|
7258
|
-
createdAt:
|
7259
|
-
updatedAt:
|
7260
|
-
deletedAt:
|
7261
|
-
entity:
|
7262
|
-
description:
|
7263
|
-
});
|
7264
|
-
var ContactActivitySchema2 =
|
7265
|
-
id:
|
7266
|
-
createdAt:
|
7267
|
-
updatedAt:
|
7268
|
-
deletedAt:
|
7269
|
-
entityId:
|
7270
|
-
description:
|
7367
|
+
uploads: z101.array(UploadSchema)
|
7368
|
+
});
|
7369
|
+
var ContactEntityTypesSchema2 = z101.object({
|
7370
|
+
id: z101.string().uuid(),
|
7371
|
+
createdAt: z101.date(),
|
7372
|
+
updatedAt: z101.date(),
|
7373
|
+
deletedAt: z101.date().nullable(),
|
7374
|
+
entity: z101.string(),
|
7375
|
+
description: z101.string().nullable()
|
7376
|
+
});
|
7377
|
+
var ContactActivitySchema2 = z101.object({
|
7378
|
+
id: z101.string().uuid(),
|
7379
|
+
createdAt: z101.date(),
|
7380
|
+
updatedAt: z101.date(),
|
7381
|
+
deletedAt: z101.date().nullable(),
|
7382
|
+
entityId: z101.string(),
|
7383
|
+
description: z101.string(),
|
7271
7384
|
entityType: ContactEntityTypesSchema2
|
7272
7385
|
});
|
7273
|
-
var ContactSchema2 =
|
7274
|
-
id:
|
7275
|
-
createdAt:
|
7276
|
-
updatedAt:
|
7277
|
-
deletedAt:
|
7278
|
-
name:
|
7279
|
-
address:
|
7280
|
-
channel:
|
7281
|
-
notes:
|
7282
|
-
contactProfile:
|
7283
|
-
socialProfileUrl:
|
7284
|
-
tags:
|
7386
|
+
var ContactSchema2 = z101.object({
|
7387
|
+
id: z101.string().uuid(),
|
7388
|
+
createdAt: z101.date(),
|
7389
|
+
updatedAt: z101.date(),
|
7390
|
+
deletedAt: z101.date().nullable(),
|
7391
|
+
name: z101.string(),
|
7392
|
+
address: z101.string().nullable(),
|
7393
|
+
channel: z101.string().nullable(),
|
7394
|
+
notes: z101.string().nullable(),
|
7395
|
+
contactProfile: z101.string().nullable(),
|
7396
|
+
socialProfileUrl: z101.string().nullable(),
|
7397
|
+
tags: z101.array(TagSchema),
|
7285
7398
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
7286
|
-
customFields:
|
7287
|
-
contactEmails:
|
7288
|
-
contactPhones:
|
7289
|
-
activityLogs:
|
7399
|
+
customFields: z101.array(ContactCustomFieldSchema2),
|
7400
|
+
contactEmails: z101.array(ContactEmailsSchema2),
|
7401
|
+
contactPhones: z101.array(ContactPhonesSchema2),
|
7402
|
+
activityLogs: z101.array(ContactActivitySchema2).optional()
|
7290
7403
|
});
|
7291
7404
|
|
7292
7405
|
// src/public-api/validation.ts
|
7293
7406
|
var ContactContractValidationSchema2 = {
|
7294
7407
|
create: {
|
7295
|
-
request:
|
7296
|
-
name:
|
7297
|
-
email:
|
7298
|
-
|
7299
|
-
email:
|
7300
|
-
isPrimary:
|
7408
|
+
request: z102.object({
|
7409
|
+
name: z102.string(),
|
7410
|
+
email: z102.array(
|
7411
|
+
z102.object({
|
7412
|
+
email: z102.string().email(),
|
7413
|
+
isPrimary: z102.boolean()
|
7301
7414
|
})
|
7302
7415
|
).optional(),
|
7303
|
-
channel:
|
7304
|
-
address:
|
7305
|
-
phone:
|
7306
|
-
|
7307
|
-
phone:
|
7308
|
-
isPrimary:
|
7416
|
+
channel: z102.string().optional(),
|
7417
|
+
address: z102.string().optional(),
|
7418
|
+
phone: z102.array(
|
7419
|
+
z102.object({
|
7420
|
+
phone: z102.string(),
|
7421
|
+
isPrimary: z102.boolean()
|
7309
7422
|
})
|
7310
7423
|
).optional(),
|
7311
|
-
notes:
|
7312
|
-
tags:
|
7313
|
-
company:
|
7314
|
-
customFields:
|
7424
|
+
notes: z102.string().optional(),
|
7425
|
+
tags: z102.array(z102.string()).optional(),
|
7426
|
+
company: z102.string().optional(),
|
7427
|
+
customFields: z102.record(z102.string())
|
7315
7428
|
// Dynamic keys with string values
|
7316
7429
|
}),
|
7317
7430
|
response: ContactSchema2
|
7318
7431
|
},
|
7319
7432
|
getById: {
|
7320
|
-
request:
|
7321
|
-
id:
|
7433
|
+
request: z102.object({
|
7434
|
+
id: z102.string().uuid()
|
7322
7435
|
})
|
7323
7436
|
},
|
7324
7437
|
delete: {
|
7325
|
-
request:
|
7326
|
-
id:
|
7438
|
+
request: z102.object({
|
7439
|
+
id: z102.string().uuid()
|
7327
7440
|
})
|
7328
7441
|
},
|
7329
7442
|
getAll: {
|
7330
|
-
request:
|
7331
|
-
page:
|
7332
|
-
pageSize:
|
7333
|
-
keyword:
|
7334
|
-
company:
|
7335
|
-
name:
|
7336
|
-
address:
|
7337
|
-
channel:
|
7338
|
-
selectedDate:
|
7339
|
-
customFields:
|
7340
|
-
|
7341
|
-
attributeId:
|
7342
|
-
type:
|
7343
|
-
value:
|
7443
|
+
request: z102.object({
|
7444
|
+
page: z102.coerce.number().default(1),
|
7445
|
+
pageSize: z102.coerce.number().default(10),
|
7446
|
+
keyword: z102.string().optional(),
|
7447
|
+
company: z102.array(z102.string().uuid()),
|
7448
|
+
name: z102.string(),
|
7449
|
+
address: z102.string(),
|
7450
|
+
channel: z102.array(z102.string()),
|
7451
|
+
selectedDate: z102.string(),
|
7452
|
+
customFields: z102.array(
|
7453
|
+
z102.object({
|
7454
|
+
attributeId: z102.string().uuid(),
|
7455
|
+
type: z102.string(),
|
7456
|
+
value: z102.union([z102.string(), z102.array(z102.string())])
|
7344
7457
|
})
|
7345
7458
|
),
|
7346
|
-
tags:
|
7347
|
-
phone:
|
7348
|
-
email:
|
7349
|
-
notes:
|
7459
|
+
tags: z102.array(z102.string().uuid()),
|
7460
|
+
phone: z102.string(),
|
7461
|
+
email: z102.string(),
|
7462
|
+
notes: z102.string()
|
7350
7463
|
}).partial(),
|
7351
7464
|
response: {
|
7352
|
-
page:
|
7353
|
-
pageSize:
|
7354
|
-
total:
|
7355
|
-
lastPage:
|
7356
|
-
data:
|
7465
|
+
page: z102.number(),
|
7466
|
+
pageSize: z102.number(),
|
7467
|
+
total: z102.number(),
|
7468
|
+
lastPage: z102.number(),
|
7469
|
+
data: z102.array(ContactSchema2)
|
7357
7470
|
}
|
7358
7471
|
},
|
7359
7472
|
getContactFields: {
|
7360
|
-
request:
|
7361
|
-
page:
|
7362
|
-
pageSize:
|
7473
|
+
request: z102.object({
|
7474
|
+
page: z102.coerce.number().default(1),
|
7475
|
+
pageSize: z102.coerce.number().default(10)
|
7363
7476
|
}).partial(),
|
7364
7477
|
response: {
|
7365
|
-
page:
|
7366
|
-
pageSize:
|
7367
|
-
total:
|
7368
|
-
lastPage:
|
7369
|
-
data:
|
7478
|
+
page: z102.number(),
|
7479
|
+
pageSize: z102.number(),
|
7480
|
+
total: z102.number(),
|
7481
|
+
lastPage: z102.number(),
|
7482
|
+
data: z102.array(ContactCustomFieldSchema2)
|
7370
7483
|
}
|
7371
7484
|
},
|
7372
7485
|
addAttachments: {
|
7373
|
-
request:
|
7374
|
-
contactId:
|
7375
|
-
attributeId:
|
7376
|
-
contactAttachmentRecords:
|
7377
|
-
|
7378
|
-
bucketName:
|
7379
|
-
fileKey:
|
7380
|
-
fileName:
|
7381
|
-
fileSize:
|
7382
|
-
url:
|
7486
|
+
request: z102.object({
|
7487
|
+
contactId: z102.string(),
|
7488
|
+
attributeId: z102.string().uuid(),
|
7489
|
+
contactAttachmentRecords: z102.array(
|
7490
|
+
z102.object({
|
7491
|
+
bucketName: z102.string(),
|
7492
|
+
fileKey: z102.string(),
|
7493
|
+
fileName: z102.string(),
|
7494
|
+
fileSize: z102.coerce.number(),
|
7495
|
+
url: z102.string()
|
7383
7496
|
})
|
7384
7497
|
)
|
7385
7498
|
}),
|
@@ -7388,7 +7501,7 @@ var ContactContractValidationSchema2 = {
|
|
7388
7501
|
};
|
7389
7502
|
|
7390
7503
|
// src/public-api/index.ts
|
7391
|
-
var publicApiContract =
|
7504
|
+
var publicApiContract = initContract37().router(
|
7392
7505
|
{
|
7393
7506
|
createContact: {
|
7394
7507
|
method: "POST",
|
@@ -7398,11 +7511,11 @@ var publicApiContract = initContract36().router(
|
|
7398
7511
|
201: DefaultSuccessResponseSchema.extend({
|
7399
7512
|
data: ContactSchema2
|
7400
7513
|
}),
|
7401
|
-
400:
|
7402
|
-
message:
|
7514
|
+
400: z103.object({
|
7515
|
+
message: z103.string()
|
7403
7516
|
}),
|
7404
|
-
409:
|
7405
|
-
message:
|
7517
|
+
409: z103.object({
|
7518
|
+
message: z103.string()
|
7406
7519
|
}),
|
7407
7520
|
401: DefaultUnauthorizedSchema,
|
7408
7521
|
404: DefaultNotFoundSchema,
|
@@ -7417,13 +7530,13 @@ var publicApiContract = initContract36().router(
|
|
7417
7530
|
query: GetTagsSchema,
|
7418
7531
|
responses: {
|
7419
7532
|
200: DefaultSuccessResponseSchema.extend({
|
7420
|
-
tags:
|
7533
|
+
tags: z103.array(TagSchema)
|
7421
7534
|
}),
|
7422
|
-
400:
|
7423
|
-
message:
|
7535
|
+
400: z103.object({
|
7536
|
+
message: z103.string()
|
7424
7537
|
}),
|
7425
|
-
409:
|
7426
|
-
message:
|
7538
|
+
409: z103.object({
|
7539
|
+
message: z103.string()
|
7427
7540
|
}),
|
7428
7541
|
401: DefaultUnauthorizedSchema,
|
7429
7542
|
404: DefaultNotFoundSchema,
|
@@ -7439,11 +7552,11 @@ var publicApiContract = initContract36().router(
|
|
7439
7552
|
200: DefaultSuccessResponseSchema.extend(
|
7440
7553
|
ContactContractValidationSchema2.getAll.response
|
7441
7554
|
),
|
7442
|
-
400:
|
7443
|
-
message:
|
7555
|
+
400: z103.object({
|
7556
|
+
message: z103.string()
|
7444
7557
|
}),
|
7445
|
-
409:
|
7446
|
-
message:
|
7558
|
+
409: z103.object({
|
7559
|
+
message: z103.string()
|
7447
7560
|
}),
|
7448
7561
|
401: DefaultUnauthorizedSchema,
|
7449
7562
|
404: DefaultNotFoundSchema,
|
@@ -7460,11 +7573,11 @@ var publicApiContract = initContract36().router(
|
|
7460
7573
|
200: DefaultSuccessResponseSchema.extend(
|
7461
7574
|
ContactContractValidationSchema2.getContactFields.response
|
7462
7575
|
),
|
7463
|
-
400:
|
7464
|
-
message:
|
7576
|
+
400: z103.object({
|
7577
|
+
message: z103.string()
|
7465
7578
|
}),
|
7466
|
-
409:
|
7467
|
-
message:
|
7579
|
+
409: z103.object({
|
7580
|
+
message: z103.string()
|
7468
7581
|
}),
|
7469
7582
|
401: DefaultUnauthorizedSchema,
|
7470
7583
|
404: DefaultNotFoundSchema,
|
@@ -7478,17 +7591,17 @@ var publicApiContract = initContract36().router(
|
|
7478
7591
|
path: "/contacts/:id",
|
7479
7592
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7480
7593
|
responses: {
|
7481
|
-
200:
|
7482
|
-
status:
|
7483
|
-
message:
|
7594
|
+
200: z103.object({
|
7595
|
+
status: z103.string(),
|
7596
|
+
message: z103.string(),
|
7484
7597
|
data: ContactSchema2,
|
7485
|
-
requestId:
|
7598
|
+
requestId: z103.string()
|
7486
7599
|
}),
|
7487
|
-
400:
|
7488
|
-
message:
|
7600
|
+
400: z103.object({
|
7601
|
+
message: z103.string()
|
7489
7602
|
}),
|
7490
|
-
409:
|
7491
|
-
message:
|
7603
|
+
409: z103.object({
|
7604
|
+
message: z103.string()
|
7492
7605
|
}),
|
7493
7606
|
401: DefaultUnauthorizedSchema,
|
7494
7607
|
404: DefaultNotFoundSchema,
|
@@ -7506,11 +7619,11 @@ var publicApiContract = initContract36().router(
|
|
7506
7619
|
201: DefaultSuccessResponseSchema.extend({
|
7507
7620
|
message: ContactCustomFieldSchema2
|
7508
7621
|
}),
|
7509
|
-
400:
|
7510
|
-
message:
|
7622
|
+
400: z103.object({
|
7623
|
+
message: z103.string()
|
7511
7624
|
}),
|
7512
|
-
409:
|
7513
|
-
message:
|
7625
|
+
409: z103.object({
|
7626
|
+
message: z103.string()
|
7514
7627
|
}),
|
7515
7628
|
401: DefaultUnauthorizedSchema,
|
7516
7629
|
404: DefaultNotFoundSchema,
|
@@ -7524,17 +7637,17 @@ var publicApiContract = initContract36().router(
|
|
7524
7637
|
path: "/contacts/:id",
|
7525
7638
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7526
7639
|
responses: {
|
7527
|
-
200:
|
7528
|
-
status:
|
7529
|
-
message:
|
7640
|
+
200: z103.object({
|
7641
|
+
status: z103.string(),
|
7642
|
+
message: z103.string(),
|
7530
7643
|
data: ContactSchema2,
|
7531
|
-
requestId:
|
7644
|
+
requestId: z103.string()
|
7532
7645
|
}),
|
7533
|
-
400:
|
7534
|
-
message:
|
7646
|
+
400: z103.object({
|
7647
|
+
message: z103.string()
|
7535
7648
|
}),
|
7536
|
-
409:
|
7537
|
-
message:
|
7649
|
+
409: z103.object({
|
7650
|
+
message: z103.string()
|
7538
7651
|
}),
|
7539
7652
|
401: DefaultUnauthorizedSchema,
|
7540
7653
|
404: DefaultNotFoundSchema,
|
@@ -7548,17 +7661,17 @@ var publicApiContract = initContract36().router(
|
|
7548
7661
|
path: "/contacts/:id",
|
7549
7662
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7550
7663
|
responses: {
|
7551
|
-
200:
|
7552
|
-
status:
|
7553
|
-
message:
|
7664
|
+
200: z103.object({
|
7665
|
+
status: z103.string(),
|
7666
|
+
message: z103.string(),
|
7554
7667
|
data: ContactSchema2,
|
7555
|
-
requestId:
|
7668
|
+
requestId: z103.string()
|
7556
7669
|
}),
|
7557
|
-
400:
|
7558
|
-
message:
|
7670
|
+
400: z103.object({
|
7671
|
+
message: z103.string()
|
7559
7672
|
}),
|
7560
|
-
409:
|
7561
|
-
message:
|
7673
|
+
409: z103.object({
|
7674
|
+
message: z103.string()
|
7562
7675
|
}),
|
7563
7676
|
401: DefaultUnauthorizedSchema,
|
7564
7677
|
404: DefaultNotFoundSchema,
|
@@ -7575,18 +7688,18 @@ var publicApiContract = initContract36().router(
|
|
7575
7688
|
);
|
7576
7689
|
|
7577
7690
|
// src/workflow-rule/index.ts
|
7578
|
-
import { initContract as
|
7579
|
-
import
|
7580
|
-
var chatContract =
|
7691
|
+
import { initContract as initContract38 } from "@ts-rest/core";
|
7692
|
+
import z104 from "zod";
|
7693
|
+
var chatContract = initContract38().router(
|
7581
7694
|
{
|
7582
7695
|
updateAssignee: {
|
7583
7696
|
method: "POST",
|
7584
7697
|
path: "/room/assignee",
|
7585
|
-
body:
|
7586
|
-
assigneeId:
|
7587
|
-
roomId:
|
7588
|
-
workflowId:
|
7589
|
-
queueId:
|
7698
|
+
body: z104.object({
|
7699
|
+
assigneeId: z104.string().uuid(),
|
7700
|
+
roomId: z104.string().uuid(),
|
7701
|
+
workflowId: z104.string().uuid(),
|
7702
|
+
queueId: z104.string().uuid().optional()
|
7590
7703
|
}),
|
7591
7704
|
responses: {
|
7592
7705
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7600,15 +7713,15 @@ var chatContract = initContract37().router(
|
|
7600
7713
|
solveRoom: {
|
7601
7714
|
method: "POST",
|
7602
7715
|
path: "/room/solve",
|
7603
|
-
body:
|
7604
|
-
roomId:
|
7605
|
-
disposition:
|
7606
|
-
workflowId:
|
7716
|
+
body: z104.object({
|
7717
|
+
roomId: z104.string(),
|
7718
|
+
disposition: z104.string(),
|
7719
|
+
workflowId: z104.string().uuid()
|
7607
7720
|
}),
|
7608
7721
|
responses: {
|
7609
7722
|
200: DefaultSuccessResponseSchema.extend({
|
7610
7723
|
data: RoomSchema.extend({
|
7611
|
-
solveMessage:
|
7724
|
+
solveMessage: z104.string()
|
7612
7725
|
})
|
7613
7726
|
}),
|
7614
7727
|
409: DefaultErrorResponseSchema
|
@@ -7618,9 +7731,9 @@ var chatContract = initContract37().router(
|
|
7618
7731
|
emitMessage: {
|
7619
7732
|
method: "POST",
|
7620
7733
|
path: "/message/emit",
|
7621
|
-
body:
|
7622
|
-
messageId:
|
7623
|
-
queueId:
|
7734
|
+
body: z104.object({
|
7735
|
+
messageId: z104.string().uuid(),
|
7736
|
+
queueId: z104.string().uuid().optional().nullable()
|
7624
7737
|
}),
|
7625
7738
|
responses: {
|
7626
7739
|
200: DefaultSuccessResponseSchema,
|
@@ -7631,18 +7744,18 @@ var chatContract = initContract37().router(
|
|
7631
7744
|
}
|
7632
7745
|
},
|
7633
7746
|
{
|
7634
|
-
baseHeaders:
|
7635
|
-
"x-tenant":
|
7636
|
-
"x-code":
|
7747
|
+
baseHeaders: z104.object({
|
7748
|
+
"x-tenant": z104.string({ required_error: "Tenant id is required" }),
|
7749
|
+
"x-code": z104.string().uuid().optional()
|
7637
7750
|
}),
|
7638
7751
|
pathPrefix: "chat"
|
7639
7752
|
}
|
7640
7753
|
);
|
7641
7754
|
|
7642
7755
|
// src/botpress/index.ts
|
7643
|
-
import
|
7644
|
-
import { initContract as
|
7645
|
-
var botpressContract =
|
7756
|
+
import z105 from "zod";
|
7757
|
+
import { initContract as initContract39 } from "@ts-rest/core";
|
7758
|
+
var botpressContract = initContract39().router(
|
7646
7759
|
{
|
7647
7760
|
createBot: {
|
7648
7761
|
method: "POST",
|
@@ -7659,7 +7772,7 @@ var botpressContract = initContract38().router(
|
|
7659
7772
|
path: "/",
|
7660
7773
|
responses: {
|
7661
7774
|
200: DefaultSuccessResponseSchema.extend({
|
7662
|
-
data:
|
7775
|
+
data: z105.array(BotpressBotSchema)
|
7663
7776
|
}),
|
7664
7777
|
500: DefaultErrorResponseSchema
|
7665
7778
|
}
|
@@ -7676,7 +7789,7 @@ var botpressContract = initContract38().router(
|
|
7676
7789
|
},
|
7677
7790
|
{ pathPrefix: "/bots" }
|
7678
7791
|
);
|
7679
|
-
var botContract =
|
7792
|
+
var botContract = initContract39().router(
|
7680
7793
|
{
|
7681
7794
|
createBot: {
|
7682
7795
|
method: "POST",
|
@@ -7696,7 +7809,7 @@ var botContract = initContract38().router(
|
|
7696
7809
|
path: "/",
|
7697
7810
|
responses: {
|
7698
7811
|
200: DefaultSuccessResponseSchema.extend({
|
7699
|
-
data:
|
7812
|
+
data: z105.array(BotpressBotSchema)
|
7700
7813
|
}),
|
7701
7814
|
500: DefaultErrorResponseSchema
|
7702
7815
|
}
|
@@ -7708,38 +7821,38 @@ var botContract = initContract38().router(
|
|
7708
7821
|
);
|
7709
7822
|
|
7710
7823
|
// src/sms/index.ts
|
7711
|
-
import { initContract as
|
7824
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
7712
7825
|
|
7713
7826
|
// src/sms/schema.ts
|
7714
|
-
import
|
7827
|
+
import z107 from "zod";
|
7715
7828
|
|
7716
7829
|
// src/sms/validation.ts
|
7717
|
-
import
|
7718
|
-
var ConnectSMSSchema2 =
|
7719
|
-
name:
|
7720
|
-
type:
|
7721
|
-
senderId:
|
7722
|
-
vonageCredentials:
|
7723
|
-
mobileNumber:
|
7724
|
-
apiKey:
|
7725
|
-
apiSecret:
|
7830
|
+
import z106 from "zod";
|
7831
|
+
var ConnectSMSSchema2 = z106.object({
|
7832
|
+
name: z106.string(),
|
7833
|
+
type: z106.enum(["sms_vonage" /* VONAGE_SMS */]),
|
7834
|
+
senderId: z106.string(),
|
7835
|
+
vonageCredentials: z106.object({
|
7836
|
+
mobileNumber: z106.string(),
|
7837
|
+
apiKey: z106.string(),
|
7838
|
+
apiSecret: z106.string()
|
7726
7839
|
})
|
7727
7840
|
});
|
7728
7841
|
|
7729
7842
|
// src/sms/schema.ts
|
7730
|
-
var ConnectSMSChannelSchema =
|
7731
|
-
actor:
|
7732
|
-
id:
|
7733
|
-
name:
|
7734
|
-
email:
|
7735
|
-
address:
|
7736
|
-
phone:
|
7843
|
+
var ConnectSMSChannelSchema = z107.object({
|
7844
|
+
actor: z107.object({
|
7845
|
+
id: z107.string().uuid(),
|
7846
|
+
name: z107.string(),
|
7847
|
+
email: z107.string().email(),
|
7848
|
+
address: z107.string().nullable(),
|
7849
|
+
phone: z107.string().nullable()
|
7737
7850
|
}),
|
7738
7851
|
channel: ConnectSMSSchema2
|
7739
7852
|
});
|
7740
7853
|
|
7741
7854
|
// src/sms/index.ts
|
7742
|
-
var smsContract =
|
7855
|
+
var smsContract = initContract40().router({
|
7743
7856
|
connect: {
|
7744
7857
|
method: "POST",
|
7745
7858
|
path: "/connect",
|
@@ -7765,7 +7878,7 @@ var smsContract = initContract39().router({
|
|
7765
7878
|
});
|
7766
7879
|
|
7767
7880
|
// src/contract.ts
|
7768
|
-
var apiContract =
|
7881
|
+
var apiContract = initContract41().router({
|
7769
7882
|
auth: authContract,
|
7770
7883
|
cxLog: cxLogContract,
|
7771
7884
|
dashboard: dashboardContract,
|
@@ -7789,54 +7902,57 @@ var apiContract = initContract40().router({
|
|
7789
7902
|
snippet: snippetContract,
|
7790
7903
|
bot: botContract
|
7791
7904
|
});
|
7792
|
-
var contactContract2 =
|
7905
|
+
var contactContract2 = initContract41().router({
|
7793
7906
|
contact: contactContract
|
7794
7907
|
});
|
7795
|
-
var ticketContract2 =
|
7908
|
+
var ticketContract2 = initContract41().router({
|
7796
7909
|
ticket: ticketContract
|
7797
7910
|
});
|
7798
|
-
var extensionContract2 =
|
7911
|
+
var extensionContract2 = initContract41().router({
|
7799
7912
|
extension: extensionContract
|
7800
7913
|
});
|
7801
|
-
var commentActivityContract =
|
7914
|
+
var commentActivityContract = initContract41().router({
|
7802
7915
|
comment: commentContract,
|
7803
7916
|
activityLog: activityLogContract
|
7804
7917
|
});
|
7805
|
-
var platformContract =
|
7918
|
+
var platformContract = initContract41().router({
|
7806
7919
|
line: lineContract,
|
7807
7920
|
viber: viberContract
|
7808
7921
|
});
|
7809
|
-
var
|
7922
|
+
var platformTelegramContract = initContract41().router({
|
7923
|
+
telegram: telegramContract
|
7924
|
+
});
|
7925
|
+
var platformMessengerContract = initContract41().router({
|
7810
7926
|
messenger: messengerContract
|
7811
7927
|
});
|
7812
|
-
var platformInstagramContract =
|
7928
|
+
var platformInstagramContract = initContract41().router({
|
7813
7929
|
instagram: instagramContract
|
7814
7930
|
});
|
7815
|
-
var platformBotpressContract =
|
7931
|
+
var platformBotpressContract = initContract41().router({
|
7816
7932
|
botpress: botpressContract
|
7817
7933
|
});
|
7818
|
-
var platformSMSContract =
|
7934
|
+
var platformSMSContract = initContract41().router({
|
7819
7935
|
sms: smsContract
|
7820
7936
|
});
|
7821
|
-
var facebookFeedContract2 =
|
7937
|
+
var facebookFeedContract2 = initContract41().router({
|
7822
7938
|
facebookFeed: facebookFeedContract
|
7823
7939
|
});
|
7824
|
-
var feedPostContract =
|
7940
|
+
var feedPostContract = initContract41().router({
|
7825
7941
|
main: mainFeedContract
|
7826
7942
|
});
|
7827
|
-
var telephonyContract =
|
7943
|
+
var telephonyContract = initContract41().router({
|
7828
7944
|
telephonyCdr: telephonyCdrContract
|
7829
7945
|
});
|
7830
|
-
var notificationContract =
|
7946
|
+
var notificationContract = initContract41().router({
|
7831
7947
|
notification: userNotificationContract
|
7832
7948
|
});
|
7833
|
-
var publicApiContract2 =
|
7949
|
+
var publicApiContract2 = initContract41().router({
|
7834
7950
|
publicApi: publicApiContract
|
7835
7951
|
});
|
7836
|
-
var businessCalendarContract2 =
|
7952
|
+
var businessCalendarContract2 = initContract41().router({
|
7837
7953
|
businessCalendar: businessCalendarContract
|
7838
7954
|
});
|
7839
|
-
var workflowContract =
|
7955
|
+
var workflowContract = initContract41().router(
|
7840
7956
|
{
|
7841
7957
|
chat: chatContract
|
7842
7958
|
},
|
@@ -7845,7 +7961,7 @@ var workflowContract = initContract40().router(
|
|
7845
7961
|
}
|
7846
7962
|
);
|
7847
7963
|
var settingsPathPrefix = "settings/";
|
7848
|
-
var ticketSettingContract =
|
7964
|
+
var ticketSettingContract = initContract41().router(
|
7849
7965
|
{
|
7850
7966
|
ticketSetting: attributeContract
|
7851
7967
|
},
|
@@ -7853,7 +7969,7 @@ var ticketSettingContract = initContract40().router(
|
|
7853
7969
|
pathPrefix: `${settingsPathPrefix}ticket/`
|
7854
7970
|
}
|
7855
7971
|
);
|
7856
|
-
var contactSettingContract =
|
7972
|
+
var contactSettingContract = initContract41().router(
|
7857
7973
|
{
|
7858
7974
|
contactSetting: attributeContract
|
7859
7975
|
},
|
@@ -7861,7 +7977,7 @@ var contactSettingContract = initContract40().router(
|
|
7861
7977
|
pathPrefix: `${settingsPathPrefix}contact/`
|
7862
7978
|
}
|
7863
7979
|
);
|
7864
|
-
var companySettingContract =
|
7980
|
+
var companySettingContract = initContract41().router(
|
7865
7981
|
{
|
7866
7982
|
companySetting: attributeContract
|
7867
7983
|
},
|
@@ -7869,7 +7985,7 @@ var companySettingContract = initContract40().router(
|
|
7869
7985
|
pathPrefix: `${settingsPathPrefix}company/`
|
7870
7986
|
}
|
7871
7987
|
);
|
7872
|
-
var caseLogSettingContract =
|
7988
|
+
var caseLogSettingContract = initContract41().router(
|
7873
7989
|
{
|
7874
7990
|
caseLogSetting: attributeContract
|
7875
7991
|
},
|
@@ -7877,7 +7993,7 @@ var caseLogSettingContract = initContract40().router(
|
|
7877
7993
|
pathPrefix: `${settingsPathPrefix}case_log/`
|
7878
7994
|
}
|
7879
7995
|
);
|
7880
|
-
var generalTagSettingContract =
|
7996
|
+
var generalTagSettingContract = initContract41().router(
|
7881
7997
|
{
|
7882
7998
|
generalTag: tagContract
|
7883
7999
|
},
|
@@ -7885,7 +8001,7 @@ var generalTagSettingContract = initContract40().router(
|
|
7885
8001
|
pathPrefix: `${settingsPathPrefix}general_tag/`
|
7886
8002
|
}
|
7887
8003
|
);
|
7888
|
-
var contactLabelSettingContract =
|
8004
|
+
var contactLabelSettingContract = initContract41().router(
|
7889
8005
|
{
|
7890
8006
|
contactLabel: tagContract
|
7891
8007
|
},
|
@@ -7893,7 +8009,7 @@ var contactLabelSettingContract = initContract40().router(
|
|
7893
8009
|
pathPrefix: `${settingsPathPrefix}contact_label/`
|
7894
8010
|
}
|
7895
8011
|
);
|
7896
|
-
var categorySettingContract =
|
8012
|
+
var categorySettingContract = initContract41().router(
|
7897
8013
|
{
|
7898
8014
|
category: categoryContract
|
7899
8015
|
},
|
@@ -7901,7 +8017,7 @@ var categorySettingContract = initContract40().router(
|
|
7901
8017
|
pathPrefix: settingsPathPrefix
|
7902
8018
|
}
|
7903
8019
|
);
|
7904
|
-
var snippetSettingContract =
|
8020
|
+
var snippetSettingContract = initContract41().router(
|
7905
8021
|
{
|
7906
8022
|
snippet: snippetContract
|
7907
8023
|
},
|
@@ -7909,7 +8025,7 @@ var snippetSettingContract = initContract40().router(
|
|
7909
8025
|
pathPrefix: settingsPathPrefix
|
7910
8026
|
}
|
7911
8027
|
);
|
7912
|
-
var businessCalendarSettingContract =
|
8028
|
+
var businessCalendarSettingContract = initContract41().router(
|
7913
8029
|
{
|
7914
8030
|
businessCalendar: businessCalendarContract
|
7915
8031
|
},
|
@@ -7917,7 +8033,7 @@ var businessCalendarSettingContract = initContract40().router(
|
|
7917
8033
|
pathPrefix: settingsPathPrefix
|
7918
8034
|
}
|
7919
8035
|
);
|
7920
|
-
var channelSettingContract =
|
8036
|
+
var channelSettingContract = initContract41().router(
|
7921
8037
|
{
|
7922
8038
|
channel: channelContract
|
7923
8039
|
},
|
@@ -7925,72 +8041,72 @@ var channelSettingContract = initContract40().router(
|
|
7925
8041
|
pathPrefix: settingsPathPrefix
|
7926
8042
|
}
|
7927
8043
|
);
|
7928
|
-
var widgetSettingContract =
|
8044
|
+
var widgetSettingContract = initContract41().router(
|
7929
8045
|
{ widget: widgetContract },
|
7930
8046
|
{ pathPrefix: settingsPathPrefix }
|
7931
8047
|
);
|
7932
|
-
var roleSettingContract =
|
8048
|
+
var roleSettingContract = initContract41().router(
|
7933
8049
|
{ role: roleContract },
|
7934
8050
|
{ pathPrefix: settingsPathPrefix }
|
7935
8051
|
);
|
7936
|
-
var permissionSettingContract =
|
8052
|
+
var permissionSettingContract = initContract41().router(
|
7937
8053
|
{ permission: permissionContract },
|
7938
8054
|
{ pathPrefix: settingsPathPrefix }
|
7939
8055
|
);
|
7940
|
-
var memberSettingContract =
|
8056
|
+
var memberSettingContract = initContract41().router(
|
7941
8057
|
{ member: userContract },
|
7942
8058
|
{ pathPrefix: settingsPathPrefix }
|
7943
8059
|
);
|
7944
8060
|
|
7945
8061
|
// src/automation-queue/index.ts
|
7946
|
-
import { initContract as
|
7947
|
-
import { z as
|
8062
|
+
import { initContract as initContract42 } from "@ts-rest/core";
|
8063
|
+
import { z as z110 } from "zod";
|
7948
8064
|
|
7949
8065
|
// src/automation-queue/validation.ts
|
7950
|
-
import { z as
|
7951
|
-
var QueueDistributionStrategySchema =
|
7952
|
-
|
7953
|
-
|
7954
|
-
|
7955
|
-
|
8066
|
+
import { z as z108 } from "zod";
|
8067
|
+
var QueueDistributionStrategySchema = z108.union([
|
8068
|
+
z108.literal("round-robin"),
|
8069
|
+
z108.literal("fewest-assignments"),
|
8070
|
+
z108.literal("random"),
|
8071
|
+
z108.literal("notify-all")
|
7956
8072
|
]);
|
7957
|
-
var CreateAutomationQueueSchema =
|
7958
|
-
emoji:
|
7959
|
-
name:
|
7960
|
-
description:
|
7961
|
-
managerIds:
|
7962
|
-
agentIds:
|
8073
|
+
var CreateAutomationQueueSchema = z108.object({
|
8074
|
+
emoji: z108.string().emoji(),
|
8075
|
+
name: z108.string(),
|
8076
|
+
description: z108.string().nullable(),
|
8077
|
+
managerIds: z108.array(z108.string().uuid()).min(1),
|
8078
|
+
agentIds: z108.array(z108.string().uuid()).min(1),
|
7963
8079
|
distributionStrategy: QueueDistributionStrategySchema,
|
7964
|
-
maximumAssignPerAgent:
|
8080
|
+
maximumAssignPerAgent: z108.number().positive()
|
7965
8081
|
// ringTimeOut: z.number().positive(),
|
7966
8082
|
// retryInterval: z.number().positive(),
|
7967
8083
|
// queueTimeOut: z.number().positive(),
|
7968
8084
|
// isAssignmentDeniable: z.coerce.boolean(),
|
7969
8085
|
});
|
7970
8086
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
7971
|
-
var CheckHasAssignedRoomSchema =
|
7972
|
-
userId:
|
7973
|
-
queueId:
|
8087
|
+
var CheckHasAssignedRoomSchema = z108.object({
|
8088
|
+
userId: z108.string().uuid().optional(),
|
8089
|
+
queueId: z108.string().uuid().optional()
|
7974
8090
|
});
|
7975
8091
|
|
7976
8092
|
// src/automation-queue/schema.ts
|
7977
|
-
import { z as
|
8093
|
+
import { z as z109 } from "zod";
|
7978
8094
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
7979
|
-
emoji:
|
7980
|
-
name:
|
7981
|
-
description:
|
8095
|
+
emoji: z109.string(),
|
8096
|
+
name: z109.string(),
|
8097
|
+
description: z109.string().nullable(),
|
7982
8098
|
distributionStrategy: QueueDistributionStrategySchema,
|
7983
|
-
maximumAssignPerAgent:
|
8099
|
+
maximumAssignPerAgent: z109.number().positive(),
|
7984
8100
|
// ringTimeOut: z.number(),
|
7985
8101
|
// retryInterval: z.number(),
|
7986
8102
|
// queueTimeOut: z.number(),
|
7987
8103
|
// isAssignmentDeniable: z.boolean(),
|
7988
|
-
managers:
|
7989
|
-
agents:
|
8104
|
+
managers: z109.array(UserSchema),
|
8105
|
+
agents: z109.array(UserSchema)
|
7990
8106
|
});
|
7991
8107
|
|
7992
8108
|
// src/automation-queue/index.ts
|
7993
|
-
var automationQueueContract =
|
8109
|
+
var automationQueueContract = initContract42().router(
|
7994
8110
|
{
|
7995
8111
|
createAutomationQueue: {
|
7996
8112
|
method: "POST",
|
@@ -8005,8 +8121,8 @@ var automationQueueContract = initContract41().router(
|
|
8005
8121
|
duplicateAutomationQueue: {
|
8006
8122
|
method: "POST",
|
8007
8123
|
path: "/:id/duplicate",
|
8008
|
-
pathParams:
|
8009
|
-
id:
|
8124
|
+
pathParams: z110.object({
|
8125
|
+
id: z110.string().uuid()
|
8010
8126
|
}),
|
8011
8127
|
body: null,
|
8012
8128
|
responses: {
|
@@ -8018,20 +8134,20 @@ var automationQueueContract = initContract41().router(
|
|
8018
8134
|
getAutomationQueues: {
|
8019
8135
|
method: "GET",
|
8020
8136
|
path: "",
|
8021
|
-
query:
|
8022
|
-
userId:
|
8137
|
+
query: z110.object({
|
8138
|
+
userId: z110.string().uuid().optional()
|
8023
8139
|
}).optional(),
|
8024
8140
|
responses: {
|
8025
8141
|
200: DefaultSuccessResponseSchema.extend({
|
8026
|
-
data:
|
8142
|
+
data: z110.array(AutomationQueueSchema)
|
8027
8143
|
})
|
8028
8144
|
}
|
8029
8145
|
},
|
8030
8146
|
getAutomationQueueById: {
|
8031
8147
|
method: "GET",
|
8032
8148
|
path: "/:id",
|
8033
|
-
pathParams:
|
8034
|
-
id:
|
8149
|
+
pathParams: z110.object({
|
8150
|
+
id: z110.string().uuid()
|
8035
8151
|
}),
|
8036
8152
|
responses: {
|
8037
8153
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8042,8 +8158,8 @@ var automationQueueContract = initContract41().router(
|
|
8042
8158
|
updateAutomationQueue: {
|
8043
8159
|
method: "PATCH",
|
8044
8160
|
path: "/:id",
|
8045
|
-
pathParams:
|
8046
|
-
id:
|
8161
|
+
pathParams: z110.object({
|
8162
|
+
id: z110.string().uuid()
|
8047
8163
|
}),
|
8048
8164
|
body: UpdateAutomationQueueSchema,
|
8049
8165
|
responses: {
|
@@ -8055,13 +8171,13 @@ var automationQueueContract = initContract41().router(
|
|
8055
8171
|
deleteAutomationQueue: {
|
8056
8172
|
method: "DELETE",
|
8057
8173
|
path: "/:id",
|
8058
|
-
pathParams:
|
8059
|
-
id:
|
8174
|
+
pathParams: z110.object({
|
8175
|
+
id: z110.string().uuid()
|
8060
8176
|
}),
|
8061
8177
|
body: null,
|
8062
8178
|
responses: {
|
8063
8179
|
200: DefaultSuccessResponseSchema.extend({
|
8064
|
-
message:
|
8180
|
+
message: z110.string()
|
8065
8181
|
})
|
8066
8182
|
}
|
8067
8183
|
},
|
@@ -8071,8 +8187,8 @@ var automationQueueContract = initContract41().router(
|
|
8071
8187
|
body: CheckHasAssignedRoomSchema,
|
8072
8188
|
responses: {
|
8073
8189
|
200: DefaultSuccessResponseSchema.extend({
|
8074
|
-
data:
|
8075
|
-
hasAssignedRoom:
|
8190
|
+
data: z110.object({
|
8191
|
+
hasAssignedRoom: z110.boolean()
|
8076
8192
|
})
|
8077
8193
|
})
|
8078
8194
|
}
|
@@ -8082,273 +8198,300 @@ var automationQueueContract = initContract41().router(
|
|
8082
8198
|
);
|
8083
8199
|
|
8084
8200
|
// src/mail/mail-contract.ts
|
8085
|
-
import { initContract as
|
8201
|
+
import { initContract as initContract47 } from "@ts-rest/core";
|
8086
8202
|
|
8087
8203
|
// src/mail/room-contract.ts
|
8088
|
-
import { initContract as
|
8089
|
-
import
|
8204
|
+
import { initContract as initContract43 } from "@ts-rest/core";
|
8205
|
+
import z115 from "zod";
|
8090
8206
|
|
8091
8207
|
// src/mail/schemas/room.schema.ts
|
8092
|
-
import
|
8208
|
+
import z113 from "zod";
|
8093
8209
|
|
8094
8210
|
// src/mail/schemas/account.schema.ts
|
8095
|
-
import
|
8096
|
-
var MailServerSchema =
|
8097
|
-
id: z109.string(),
|
8098
|
-
createdAt: z109.date(),
|
8099
|
-
updatedAt: z109.date(),
|
8100
|
-
deletedAt: z109.date().nullable(),
|
8101
|
-
name: z109.string(),
|
8102
|
-
smtpHost: z109.string(),
|
8103
|
-
smtpPort: z109.number(),
|
8104
|
-
smtpTlsPort: z109.number(),
|
8105
|
-
useTlsForSmtp: z109.boolean(),
|
8106
|
-
imapHost: z109.string(),
|
8107
|
-
imapPort: z109.number(),
|
8108
|
-
imapTlsPort: z109.number(),
|
8109
|
-
useTlsForImap: z109.boolean()
|
8110
|
-
});
|
8111
|
-
var MailAccountSchema = z109.object({
|
8112
|
-
id: z109.string(),
|
8113
|
-
createdAt: z109.date(),
|
8114
|
-
updatedAt: z109.date(),
|
8115
|
-
deletedAt: z109.date().nullable(),
|
8116
|
-
name: z109.string(),
|
8117
|
-
address: z109.string(),
|
8118
|
-
accountId: z109.string(),
|
8119
|
-
mailServerId: z109.string(),
|
8120
|
-
mailServer: MailServerSchema,
|
8121
|
-
state: z109.union([
|
8122
|
-
z109.literal("init"),
|
8123
|
-
z109.literal("syncing"),
|
8124
|
-
z109.literal("connecting"),
|
8125
|
-
z109.literal("connected"),
|
8126
|
-
z109.literal("disconnected"),
|
8127
|
-
z109.literal("authenticationError"),
|
8128
|
-
z109.literal("connectError"),
|
8129
|
-
z109.literal("unset")
|
8130
|
-
])
|
8131
|
-
});
|
8132
|
-
var OAuth2AppSchema = z109.object({
|
8133
|
-
id: z109.string(),
|
8134
|
-
name: z109.string(),
|
8135
|
-
description: z109.string(),
|
8136
|
-
title: z109.string(),
|
8137
|
-
provider: z109.string(),
|
8138
|
-
enabled: z109.boolean(),
|
8139
|
-
legacy: z109.boolean(),
|
8140
|
-
created: z109.string(),
|
8141
|
-
updated: z109.string(),
|
8142
|
-
includeInListing: z109.boolean(),
|
8143
|
-
clientId: z109.string(),
|
8144
|
-
clientSecret: z109.string(),
|
8145
|
-
authority: z109.string(),
|
8146
|
-
redirectUrl: z109.string(),
|
8147
|
-
serviceClient: z109.string(),
|
8148
|
-
googleProjectId: z109.string(),
|
8149
|
-
serviceClientEmail: z109.string(),
|
8150
|
-
serviceKey: z109.string()
|
8151
|
-
});
|
8152
|
-
|
8153
|
-
// src/mail/schemas/message.schema.ts
|
8154
|
-
import z110 from "zod";
|
8155
|
-
var AttachmentSchema = z110.object({
|
8156
|
-
id: z110.string(),
|
8157
|
-
createdAt: z110.date(),
|
8158
|
-
updatedAt: z110.date(),
|
8159
|
-
deletedAt: z110.nullable(z110.date()),
|
8160
|
-
roomId: z110.string(),
|
8161
|
-
messageId: z110.string(),
|
8162
|
-
fileName: z110.string(),
|
8163
|
-
fileType: z110.string(),
|
8164
|
-
emailEngineAttachmentId: z110.string(),
|
8165
|
-
uploadId: z110.string(),
|
8166
|
-
upload: z110.object({
|
8167
|
-
id: z110.string(),
|
8168
|
-
createdAt: z110.date(),
|
8169
|
-
updatedAt: z110.date(),
|
8170
|
-
deletedAt: z110.nullable(z110.date()),
|
8171
|
-
bucketName: z110.string(),
|
8172
|
-
fileName: z110.string(),
|
8173
|
-
fileKey: z110.string(),
|
8174
|
-
fileSize: z110.number(),
|
8175
|
-
fileUrl: z110.string(),
|
8176
|
-
extensionName: z110.string()
|
8177
|
-
})
|
8178
|
-
});
|
8179
|
-
var MessageSchema2 = z110.object({
|
8180
|
-
id: z110.string(),
|
8181
|
-
createdAt: z110.date(),
|
8182
|
-
updatedAt: z110.date(),
|
8183
|
-
deletedAt: z110.nullable(z110.date()),
|
8184
|
-
roomId: z110.string(),
|
8185
|
-
subject: z110.string(),
|
8186
|
-
textPlain: z110.string(),
|
8187
|
-
textHtml: z110.string(),
|
8188
|
-
textId: z110.string(),
|
8189
|
-
emailEngineEmailId: z110.string(),
|
8190
|
-
emailEngineMessageId: z110.string(),
|
8191
|
-
emailEngineReplyTo: z110.nullable(z110.string()),
|
8192
|
-
direction: z110.string(),
|
8193
|
-
date: z110.date(),
|
8194
|
-
action: z110.string(),
|
8195
|
-
unseen: z110.boolean(),
|
8196
|
-
seemsLikeNew: z110.boolean(),
|
8197
|
-
from: z110.array(MailUserSchema),
|
8198
|
-
to: z110.array(MailUserSchema),
|
8199
|
-
cc: z110.array(MailUserSchema),
|
8200
|
-
bcc: z110.array(MailUserSchema),
|
8201
|
-
attachments: z110.array(AttachmentSchema)
|
8202
|
-
});
|
8203
|
-
|
8204
|
-
// src/mail/schemas/room.schema.ts
|
8205
|
-
var MailUserSchema = z111.object({
|
8211
|
+
import z111 from "zod";
|
8212
|
+
var MailServerSchema = z111.object({
|
8206
8213
|
id: z111.string(),
|
8207
8214
|
createdAt: z111.date(),
|
8208
8215
|
updatedAt: z111.date(),
|
8209
8216
|
deletedAt: z111.date().nullable(),
|
8210
8217
|
name: z111.string(),
|
8211
|
-
|
8212
|
-
|
8213
|
-
|
8214
|
-
|
8218
|
+
smtpHost: z111.string(),
|
8219
|
+
smtpPort: z111.number(),
|
8220
|
+
smtpTlsPort: z111.number(),
|
8221
|
+
useTlsForSmtp: z111.boolean(),
|
8222
|
+
imapHost: z111.string(),
|
8223
|
+
imapPort: z111.number(),
|
8224
|
+
imapTlsPort: z111.number(),
|
8225
|
+
useTlsForImap: z111.boolean()
|
8226
|
+
});
|
8227
|
+
var MailAccountSchema = z111.object({
|
8215
8228
|
id: z111.string(),
|
8216
8229
|
createdAt: z111.date(),
|
8217
8230
|
updatedAt: z111.date(),
|
8218
8231
|
deletedAt: z111.date().nullable(),
|
8219
|
-
name: z111.string()
|
8220
|
-
});
|
8221
|
-
var UserModel = z111.object({
|
8222
|
-
id: z111.string().uuid(),
|
8223
|
-
createdAt: z111.date(),
|
8224
|
-
updatedAt: z111.date(),
|
8225
|
-
deletedAt: z111.date().nullable(),
|
8226
8232
|
name: z111.string(),
|
8227
|
-
|
8228
|
-
|
8229
|
-
|
8230
|
-
|
8233
|
+
address: z111.string(),
|
8234
|
+
accountId: z111.string(),
|
8235
|
+
mailServerId: z111.string(),
|
8236
|
+
mailServer: MailServerSchema,
|
8237
|
+
state: z111.union([
|
8238
|
+
z111.literal("init"),
|
8239
|
+
z111.literal("syncing"),
|
8240
|
+
z111.literal("connecting"),
|
8241
|
+
z111.literal("connected"),
|
8242
|
+
z111.literal("disconnected"),
|
8243
|
+
z111.literal("authenticationError"),
|
8244
|
+
z111.literal("connectError"),
|
8245
|
+
z111.literal("unset")
|
8246
|
+
])
|
8231
8247
|
});
|
8232
|
-
var
|
8248
|
+
var OAuth2AppSchema = z111.object({
|
8233
8249
|
id: z111.string(),
|
8234
|
-
|
8235
|
-
updatedAt: z111.date(),
|
8236
|
-
deletedAt: z111.nullable(z111.string()),
|
8250
|
+
name: z111.string(),
|
8237
8251
|
description: z111.string(),
|
8238
|
-
|
8239
|
-
|
8252
|
+
title: z111.string(),
|
8253
|
+
provider: z111.string(),
|
8254
|
+
enabled: z111.boolean(),
|
8255
|
+
legacy: z111.boolean(),
|
8256
|
+
created: z111.string(),
|
8257
|
+
updated: z111.string(),
|
8258
|
+
includeInListing: z111.boolean(),
|
8259
|
+
clientId: z111.string(),
|
8260
|
+
clientSecret: z111.string(),
|
8261
|
+
authority: z111.string(),
|
8262
|
+
redirectUrl: z111.string(),
|
8263
|
+
serviceClient: z111.string(),
|
8264
|
+
googleProjectId: z111.string(),
|
8265
|
+
serviceClientEmail: z111.string(),
|
8266
|
+
serviceKey: z111.string()
|
8267
|
+
});
|
8268
|
+
|
8269
|
+
// src/mail/schemas/message.schema.ts
|
8270
|
+
import z112 from "zod";
|
8271
|
+
var AttachmentSchema = z112.object({
|
8272
|
+
id: z112.string(),
|
8273
|
+
createdAt: z112.date(),
|
8274
|
+
updatedAt: z112.date(),
|
8275
|
+
deletedAt: z112.nullable(z112.date()),
|
8276
|
+
roomId: z112.string(),
|
8277
|
+
messageId: z112.string(),
|
8278
|
+
fileName: z112.string(),
|
8279
|
+
fileType: z112.string(),
|
8280
|
+
emailEngineAttachmentId: z112.string(),
|
8281
|
+
uploadId: z112.string(),
|
8282
|
+
upload: z112.object({
|
8283
|
+
id: z112.string(),
|
8284
|
+
createdAt: z112.date(),
|
8285
|
+
updatedAt: z112.date(),
|
8286
|
+
deletedAt: z112.nullable(z112.date()),
|
8287
|
+
bucketName: z112.string(),
|
8288
|
+
fileName: z112.string(),
|
8289
|
+
fileKey: z112.string(),
|
8290
|
+
fileSize: z112.number(),
|
8291
|
+
fileUrl: z112.string(),
|
8292
|
+
extensionName: z112.string()
|
8293
|
+
})
|
8294
|
+
});
|
8295
|
+
var MessageSchema2 = z112.object({
|
8296
|
+
id: z112.string(),
|
8297
|
+
createdAt: z112.date(),
|
8298
|
+
updatedAt: z112.date(),
|
8299
|
+
deletedAt: z112.nullable(z112.date()),
|
8300
|
+
roomId: z112.string(),
|
8301
|
+
subject: z112.string(),
|
8302
|
+
textPlain: z112.string(),
|
8303
|
+
textHtml: z112.string(),
|
8304
|
+
textId: z112.string(),
|
8305
|
+
emailEngineEmailId: z112.string(),
|
8306
|
+
emailEngineMessageId: z112.string(),
|
8307
|
+
emailEngineReplyTo: z112.nullable(z112.string()),
|
8308
|
+
direction: z112.string(),
|
8309
|
+
date: z112.date(),
|
8310
|
+
action: z112.string(),
|
8311
|
+
unseen: z112.boolean(),
|
8312
|
+
sendAt: z112.date(),
|
8313
|
+
starred: z112.boolean(),
|
8314
|
+
seemsLikeNew: z112.boolean(),
|
8315
|
+
from: z112.array(MailParticipant),
|
8316
|
+
to: z112.array(MailParticipant),
|
8317
|
+
cc: z112.array(MailParticipant),
|
8318
|
+
bcc: z112.array(MailParticipant),
|
8319
|
+
attachments: z112.array(AttachmentSchema)
|
8320
|
+
});
|
8321
|
+
|
8322
|
+
// src/mail/schemas/room.schema.ts
|
8323
|
+
var ContactSchema3 = z113.object({
|
8324
|
+
id: z113.string().uuid(),
|
8325
|
+
createdAt: z113.date(),
|
8326
|
+
updatedAt: z113.date(),
|
8327
|
+
deletedAt: z113.date().nullable(),
|
8328
|
+
name: z113.string(),
|
8329
|
+
address: z113.string().nullable(),
|
8330
|
+
channel: z113.string().nullable(),
|
8331
|
+
notes: z113.string().nullable(),
|
8332
|
+
contactProfile: z113.string().nullable(),
|
8333
|
+
socialProfileUrl: z113.string().nullable()
|
8334
|
+
});
|
8335
|
+
var MailUserSchema = z113.object({
|
8336
|
+
id: z113.string(),
|
8337
|
+
createdAt: z113.date(),
|
8338
|
+
updatedAt: z113.date(),
|
8339
|
+
deletedAt: z113.date().nullable(),
|
8340
|
+
name: z113.string(),
|
8341
|
+
address: z113.string(),
|
8342
|
+
contactId: z113.string(),
|
8343
|
+
contact: ContactSchema3,
|
8344
|
+
isNewContact: z113.boolean()
|
8345
|
+
});
|
8346
|
+
var MailParticipant = z113.object({
|
8347
|
+
id: z113.string(),
|
8348
|
+
createdAt: z113.date(),
|
8349
|
+
updatedAt: z113.date(),
|
8350
|
+
deletedAt: z113.date().nullable(),
|
8351
|
+
roomId: z113.string(),
|
8352
|
+
messageId: z113.string(),
|
8353
|
+
mailUserId: z113.string(),
|
8354
|
+
mailUser: MailUserSchema
|
8355
|
+
});
|
8356
|
+
var TagSchema2 = z113.object({
|
8357
|
+
color: z113.string(),
|
8358
|
+
id: z113.string(),
|
8359
|
+
createdAt: z113.date(),
|
8360
|
+
updatedAt: z113.date(),
|
8361
|
+
deletedAt: z113.date().nullable(),
|
8362
|
+
name: z113.string()
|
8363
|
+
});
|
8364
|
+
var UserModel = z113.object({
|
8365
|
+
id: z113.string().uuid(),
|
8366
|
+
createdAt: z113.date(),
|
8367
|
+
updatedAt: z113.date(),
|
8368
|
+
deletedAt: z113.date().nullable(),
|
8369
|
+
name: z113.string(),
|
8370
|
+
email: z113.string(),
|
8371
|
+
address: z113.string().nullable(),
|
8372
|
+
phone: z113.string().nullable(),
|
8373
|
+
notificationCount: z113.number().nullable()
|
8374
|
+
});
|
8375
|
+
var ActivityLogModel = z113.object({
|
8376
|
+
id: z113.string(),
|
8377
|
+
createdAt: z113.date(),
|
8378
|
+
updatedAt: z113.date(),
|
8379
|
+
deletedAt: z113.nullable(z113.string()),
|
8380
|
+
description: z113.string(),
|
8381
|
+
actorId: z113.string(),
|
8382
|
+
roomId: z113.string(),
|
8240
8383
|
actor: UserModel
|
8241
8384
|
});
|
8242
|
-
var MessagesAndLogsSchema =
|
8243
|
-
|
8385
|
+
var MessagesAndLogsSchema = z113.array(
|
8386
|
+
z113.union([MessageSchema2, ActivityLogModel])
|
8244
8387
|
);
|
8245
|
-
var MailRoomSchema =
|
8246
|
-
id:
|
8247
|
-
createdAt:
|
8248
|
-
updatedAt:
|
8249
|
-
deletedAt:
|
8250
|
-
subject:
|
8251
|
-
resolved:
|
8252
|
-
assigneeId:
|
8253
|
-
note:
|
8254
|
-
mailId:
|
8255
|
-
direction:
|
8256
|
-
lastMessageId:
|
8257
|
-
firstMessageId:
|
8258
|
-
from:
|
8259
|
-
to:
|
8260
|
-
cc:
|
8261
|
-
bcc:
|
8388
|
+
var MailRoomSchema = z113.object({
|
8389
|
+
id: z113.string(),
|
8390
|
+
createdAt: z113.date(),
|
8391
|
+
updatedAt: z113.date(),
|
8392
|
+
deletedAt: z113.date().nullable(),
|
8393
|
+
subject: z113.string(),
|
8394
|
+
resolved: z113.boolean(),
|
8395
|
+
assigneeId: z113.string().nullable(),
|
8396
|
+
note: z113.string(),
|
8397
|
+
mailId: z113.string(),
|
8398
|
+
direction: z113.string(),
|
8399
|
+
lastMessageId: z113.string(),
|
8400
|
+
firstMessageId: z113.string(),
|
8401
|
+
from: z113.array(MailParticipant),
|
8402
|
+
to: z113.array(MailParticipant),
|
8403
|
+
cc: z113.array(MailParticipant),
|
8404
|
+
bcc: z113.array(MailParticipant),
|
8262
8405
|
firstMessage: MessageSchema2,
|
8263
8406
|
lastMessage: MessageSchema2,
|
8264
|
-
tags:
|
8407
|
+
tags: z113.array(TagSchema2),
|
8265
8408
|
assignee: UserModel,
|
8266
|
-
messages:
|
8409
|
+
messages: z113.array(MessageSchema2),
|
8267
8410
|
messagesAndLogs: MessagesAndLogsSchema,
|
8268
8411
|
mail: MailAccountSchema,
|
8269
|
-
unReadMessageCount:
|
8412
|
+
unReadMessageCount: z113.number(),
|
8270
8413
|
cxlog: CxLogSchema
|
8271
8414
|
});
|
8272
|
-
var AttachmentSchema2 =
|
8273
|
-
fileName:
|
8274
|
-
fileType:
|
8275
|
-
emailEngineAttachmentId:
|
8276
|
-
uploadId:
|
8277
|
-
messageId:
|
8278
|
-
roomId:
|
8415
|
+
var AttachmentSchema2 = z113.object({
|
8416
|
+
fileName: z113.string(),
|
8417
|
+
fileType: z113.string(),
|
8418
|
+
emailEngineAttachmentId: z113.string(),
|
8419
|
+
uploadId: z113.string(),
|
8420
|
+
messageId: z113.string(),
|
8421
|
+
roomId: z113.string(),
|
8279
8422
|
upload: UploadSchema
|
8280
8423
|
});
|
8281
8424
|
|
8282
8425
|
// src/mail/schemas/room-validation.schema.ts
|
8283
|
-
import
|
8426
|
+
import z114 from "zod";
|
8284
8427
|
var RoomContractsValidationSchema = {
|
8285
8428
|
getAll: {
|
8286
|
-
input:
|
8287
|
-
page:
|
8288
|
-
pageSize:
|
8289
|
-
keyword:
|
8290
|
-
value:
|
8291
|
-
category:
|
8429
|
+
input: z114.object({
|
8430
|
+
page: z114.coerce.number().default(1),
|
8431
|
+
pageSize: z114.coerce.number().default(10),
|
8432
|
+
keyword: z114.object({
|
8433
|
+
value: z114.string(),
|
8434
|
+
category: z114.union([z114.literal("contact"), z114.literal("message")])
|
8292
8435
|
}).optional(),
|
8293
|
-
contactLabels:
|
8294
|
-
channels:
|
8295
|
-
date:
|
8296
|
-
contacts:
|
8297
|
-
assignees:
|
8298
|
-
level1:
|
8299
|
-
|
8300
|
-
|
8301
|
-
|
8302
|
-
|
8303
|
-
|
8304
|
-
|
8436
|
+
contactLabels: z114.array(z114.string()).optional(),
|
8437
|
+
channels: z114.array(z114.string().email()).optional(),
|
8438
|
+
date: z114.string().optional(),
|
8439
|
+
contacts: z114.array(z114.string()).optional(),
|
8440
|
+
assignees: z114.array(z114.string()).optional(),
|
8441
|
+
level1: z114.union([
|
8442
|
+
z114.literal("open"),
|
8443
|
+
z114.literal("close"),
|
8444
|
+
z114.literal("inbox"),
|
8445
|
+
z114.literal("sent"),
|
8446
|
+
z114.literal("scheduled"),
|
8447
|
+
z114.literal("starred")
|
8305
8448
|
]).optional(),
|
8306
|
-
level2:
|
8307
|
-
|
8308
|
-
|
8309
|
-
|
8310
|
-
|
8449
|
+
level2: z114.union([
|
8450
|
+
z114.literal("all"),
|
8451
|
+
z114.literal("unassign"),
|
8452
|
+
z114.literal("mine"),
|
8453
|
+
z114.literal("other")
|
8311
8454
|
]).optional()
|
8312
8455
|
}),
|
8313
|
-
output:
|
8314
|
-
data:
|
8315
|
-
total:
|
8316
|
-
page:
|
8317
|
-
pageSize:
|
8456
|
+
output: z114.object({
|
8457
|
+
data: z114.array(MailRoomSchema),
|
8458
|
+
total: z114.number(),
|
8459
|
+
page: z114.number(),
|
8460
|
+
pageSize: z114.number()
|
8318
8461
|
})
|
8319
8462
|
},
|
8320
8463
|
update: {
|
8321
|
-
input:
|
8322
|
-
disposition:
|
8323
|
-
|
8324
|
-
|
8325
|
-
|
8326
|
-
|
8327
|
-
|
8328
|
-
|
8464
|
+
input: z114.object({
|
8465
|
+
disposition: z114.union([
|
8466
|
+
z114.literal("resolved"),
|
8467
|
+
z114.literal("follow up"),
|
8468
|
+
z114.literal("escalated"),
|
8469
|
+
z114.literal("dropped"),
|
8470
|
+
z114.literal("prank"),
|
8471
|
+
z114.literal("blank")
|
8329
8472
|
]).optional().nullable(),
|
8330
|
-
assigneeId:
|
8331
|
-
note:
|
8332
|
-
tags:
|
8333
|
-
handover:
|
8334
|
-
|
8473
|
+
assigneeId: z114.string().uuid().optional().nullable(),
|
8474
|
+
note: z114.string().optional(),
|
8475
|
+
tags: z114.array(z114.string().uuid()).optional(),
|
8476
|
+
handover: z114.boolean().or(
|
8477
|
+
z114.union([z114.literal("true"), z114.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
8335
8478
|
).optional().nullable(),
|
8336
|
-
selfAssign:
|
8337
|
-
|
8479
|
+
selfAssign: z114.boolean().or(
|
8480
|
+
z114.union([z114.literal("true"), z114.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
8338
8481
|
).optional().nullable()
|
8339
8482
|
})
|
8340
8483
|
}
|
8341
8484
|
};
|
8342
8485
|
|
8343
8486
|
// src/mail/room-contract.ts
|
8344
|
-
var roomContract =
|
8487
|
+
var roomContract = initContract43().router(
|
8345
8488
|
{
|
8346
8489
|
create: {
|
8347
8490
|
method: "POST",
|
8348
8491
|
path: "/",
|
8349
8492
|
responses: {
|
8350
8493
|
200: DefaultSuccessResponseSchema.extend({
|
8351
|
-
message:
|
8494
|
+
message: z115.string()
|
8352
8495
|
}),
|
8353
8496
|
...DefaultResponses
|
8354
8497
|
},
|
@@ -8361,10 +8504,10 @@ var roomContract = initContract42().router(
|
|
8361
8504
|
query: RoomContractsValidationSchema.getAll.input,
|
8362
8505
|
responses: {
|
8363
8506
|
200: DefaultSuccessResponseSchema.extend({
|
8364
|
-
data:
|
8365
|
-
total:
|
8366
|
-
page:
|
8367
|
-
pageSize:
|
8507
|
+
data: z115.array(MailRoomSchema),
|
8508
|
+
total: z115.number(),
|
8509
|
+
page: z115.number(),
|
8510
|
+
pageSize: z115.number()
|
8368
8511
|
}),
|
8369
8512
|
...DefaultResponses
|
8370
8513
|
},
|
@@ -8376,24 +8519,24 @@ var roomContract = initContract42().router(
|
|
8376
8519
|
path: "/count_rooms/all",
|
8377
8520
|
responses: {
|
8378
8521
|
200: DefaultSuccessResponseSchema.extend({
|
8379
|
-
data:
|
8380
|
-
general:
|
8381
|
-
|
8382
|
-
name:
|
8383
|
-
count:
|
8384
|
-
unReadMessagesCount:
|
8522
|
+
data: z115.object({
|
8523
|
+
general: z115.array(
|
8524
|
+
z115.object({
|
8525
|
+
name: z115.string(),
|
8526
|
+
count: z115.number(),
|
8527
|
+
unReadMessagesCount: z115.number()
|
8385
8528
|
})
|
8386
8529
|
),
|
8387
|
-
channels:
|
8388
|
-
|
8530
|
+
channels: z115.array(
|
8531
|
+
z115.object({
|
8389
8532
|
channel: MailAccountSchema,
|
8390
|
-
count:
|
8533
|
+
count: z115.number()
|
8391
8534
|
})
|
8392
8535
|
),
|
8393
|
-
contactLabels:
|
8394
|
-
|
8536
|
+
contactLabels: z115.array(
|
8537
|
+
z115.object({
|
8395
8538
|
label: TagSchema,
|
8396
|
-
count:
|
8539
|
+
count: z115.number()
|
8397
8540
|
})
|
8398
8541
|
)
|
8399
8542
|
})
|
@@ -8405,12 +8548,12 @@ var roomContract = initContract42().router(
|
|
8405
8548
|
getAttachments: {
|
8406
8549
|
method: "GET",
|
8407
8550
|
path: "/:id/attachments",
|
8408
|
-
pathParams:
|
8409
|
-
id:
|
8551
|
+
pathParams: z115.object({
|
8552
|
+
id: z115.string().uuid()
|
8410
8553
|
}),
|
8411
8554
|
responses: {
|
8412
8555
|
200: DefaultSuccessResponseSchema.extend({
|
8413
|
-
data:
|
8556
|
+
data: z115.array(AttachmentSchema2)
|
8414
8557
|
}),
|
8415
8558
|
...DefaultResponses
|
8416
8559
|
},
|
@@ -8419,22 +8562,38 @@ var roomContract = initContract42().router(
|
|
8419
8562
|
getParticipants: {
|
8420
8563
|
method: "GET",
|
8421
8564
|
path: "/:id/participants",
|
8422
|
-
pathParams:
|
8423
|
-
id:
|
8565
|
+
pathParams: z115.object({
|
8566
|
+
id: z115.string().uuid()
|
8424
8567
|
}),
|
8425
8568
|
responses: {
|
8426
8569
|
200: DefaultSuccessResponseSchema.extend({
|
8427
|
-
data:
|
8570
|
+
data: z115.array(MailParticipant)
|
8428
8571
|
}),
|
8429
8572
|
...DefaultResponses
|
8430
8573
|
},
|
8431
8574
|
summary: "Get all the attachments of a room"
|
8432
8575
|
},
|
8576
|
+
addNewEmailToContact: {
|
8577
|
+
method: "POST",
|
8578
|
+
path: "/add_email_to_contact",
|
8579
|
+
responses: {
|
8580
|
+
200: DefaultSuccessResponseSchema.extend({
|
8581
|
+
data: z115.string()
|
8582
|
+
}),
|
8583
|
+
...DefaultResponses
|
8584
|
+
},
|
8585
|
+
body: z115.object({
|
8586
|
+
email: z115.string(),
|
8587
|
+
contactId: z115.string(),
|
8588
|
+
mailUserId: z115.string()
|
8589
|
+
}),
|
8590
|
+
summary: "Add a new email of a mail room participant to an existing contact"
|
8591
|
+
},
|
8433
8592
|
update: {
|
8434
8593
|
method: "PATCH",
|
8435
8594
|
path: "/:id",
|
8436
|
-
pathParams:
|
8437
|
-
id:
|
8595
|
+
pathParams: z115.object({
|
8596
|
+
id: z115.string()
|
8438
8597
|
}),
|
8439
8598
|
responses: {
|
8440
8599
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8448,12 +8607,12 @@ var roomContract = initContract42().router(
|
|
8448
8607
|
markAsRead: {
|
8449
8608
|
method: "POST",
|
8450
8609
|
path: "/mark_as_read",
|
8451
|
-
body:
|
8452
|
-
id:
|
8610
|
+
body: z115.object({
|
8611
|
+
id: z115.string()
|
8453
8612
|
}),
|
8454
8613
|
responses: {
|
8455
8614
|
200: DefaultSuccessResponseSchema.extend({
|
8456
|
-
message:
|
8615
|
+
message: z115.string()
|
8457
8616
|
}),
|
8458
8617
|
...DefaultResponses
|
8459
8618
|
},
|
@@ -8462,8 +8621,8 @@ var roomContract = initContract42().router(
|
|
8462
8621
|
getById: {
|
8463
8622
|
method: "GET",
|
8464
8623
|
path: "/:id",
|
8465
|
-
pathParams:
|
8466
|
-
id:
|
8624
|
+
pathParams: z115.object({
|
8625
|
+
id: z115.string().uuid()
|
8467
8626
|
}),
|
8468
8627
|
responses: {
|
8469
8628
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8475,83 +8634,83 @@ var roomContract = initContract42().router(
|
|
8475
8634
|
}
|
8476
8635
|
},
|
8477
8636
|
{
|
8478
|
-
pathPrefix: "mail/room"
|
8637
|
+
pathPrefix: "email-service/mail/room"
|
8479
8638
|
}
|
8480
8639
|
);
|
8481
8640
|
|
8482
8641
|
// src/mail/account-contract.ts
|
8483
|
-
import { initContract as
|
8484
|
-
import
|
8642
|
+
import { initContract as initContract44 } from "@ts-rest/core";
|
8643
|
+
import z117 from "zod";
|
8485
8644
|
|
8486
8645
|
// src/mail/schemas/account-validation.schema.ts
|
8487
|
-
import
|
8646
|
+
import z116 from "zod";
|
8488
8647
|
var AccountContractsValidationSchemas = {
|
8489
8648
|
create: {
|
8490
|
-
input:
|
8491
|
-
address:
|
8492
|
-
name:
|
8493
|
-
password:
|
8494
|
-
mailServerId:
|
8649
|
+
input: z116.object({
|
8650
|
+
address: z116.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
8651
|
+
name: z116.string().min(1, "Account name cannot be empty."),
|
8652
|
+
password: z116.string().min(1, "Password cannot be empty."),
|
8653
|
+
mailServerId: z116.string().uuid("Invalid mail_server_id")
|
8495
8654
|
})
|
8496
8655
|
},
|
8497
8656
|
getById: {
|
8498
|
-
input:
|
8499
|
-
id:
|
8657
|
+
input: z116.object({
|
8658
|
+
id: z116.string().uuid()
|
8500
8659
|
}),
|
8501
8660
|
output: MailAccountSchema
|
8502
8661
|
},
|
8503
8662
|
getAll: {
|
8504
|
-
output:
|
8663
|
+
output: z116.array(MailAccountSchema)
|
8505
8664
|
},
|
8506
8665
|
update: {
|
8507
8666
|
input: MailAccountSchema,
|
8508
8667
|
output: MailAccountSchema
|
8509
8668
|
},
|
8510
8669
|
disconnect: {
|
8511
|
-
input:
|
8512
|
-
id:
|
8670
|
+
input: z116.object({
|
8671
|
+
id: z116.string().uuid()
|
8513
8672
|
}),
|
8514
8673
|
output: MailAccountSchema
|
8515
8674
|
},
|
8516
8675
|
reconnect: {
|
8517
|
-
input:
|
8518
|
-
id:
|
8676
|
+
input: z116.object({
|
8677
|
+
id: z116.string()
|
8519
8678
|
}),
|
8520
8679
|
output: MailAccountSchema
|
8521
8680
|
},
|
8522
8681
|
delete: {
|
8523
|
-
input:
|
8524
|
-
id:
|
8682
|
+
input: z116.object({
|
8683
|
+
id: z116.string()
|
8525
8684
|
}),
|
8526
|
-
output:
|
8685
|
+
output: z116.string()
|
8527
8686
|
},
|
8528
8687
|
deleteEmailEngineAcc: {
|
8529
|
-
input:
|
8530
|
-
account:
|
8688
|
+
input: z116.object({
|
8689
|
+
account: z116.string()
|
8531
8690
|
}),
|
8532
8691
|
output: MailAccountSchema
|
8533
8692
|
},
|
8534
8693
|
generateOAuth2AuthenticationLink: {
|
8535
|
-
body:
|
8536
|
-
oAuth2AppId:
|
8537
|
-
mailServerId:
|
8694
|
+
body: z116.object({
|
8695
|
+
oAuth2AppId: z116.string(),
|
8696
|
+
mailServerId: z116.string()
|
8538
8697
|
}),
|
8539
|
-
response:
|
8540
|
-
url:
|
8541
|
-
account:
|
8698
|
+
response: z116.object({
|
8699
|
+
url: z116.string(),
|
8700
|
+
account: z116.string()
|
8542
8701
|
})
|
8543
8702
|
},
|
8544
8703
|
createOAuth2Acc: {
|
8545
|
-
body:
|
8546
|
-
account:
|
8547
|
-
name:
|
8704
|
+
body: z116.object({
|
8705
|
+
account: z116.string(),
|
8706
|
+
name: z116.string()
|
8548
8707
|
}),
|
8549
8708
|
response: MailAccountSchema
|
8550
8709
|
}
|
8551
8710
|
};
|
8552
8711
|
|
8553
8712
|
// src/mail/account-contract.ts
|
8554
|
-
var accountContract =
|
8713
|
+
var accountContract = initContract44().router(
|
8555
8714
|
{
|
8556
8715
|
//#region ........register account
|
8557
8716
|
create: {
|
@@ -8562,14 +8721,14 @@ var accountContract = initContract43().router(
|
|
8562
8721
|
// data: AccountContractsValidationSchemas.create.output,
|
8563
8722
|
data: MailAccountSchema
|
8564
8723
|
}),
|
8565
|
-
400:
|
8566
|
-
message:
|
8724
|
+
400: z117.object({
|
8725
|
+
message: z117.string()
|
8567
8726
|
}),
|
8568
|
-
409:
|
8569
|
-
message:
|
8727
|
+
409: z117.object({
|
8728
|
+
message: z117.string()
|
8570
8729
|
}),
|
8571
|
-
500:
|
8572
|
-
message:
|
8730
|
+
500: z117.object({
|
8731
|
+
message: z117.string()
|
8573
8732
|
}),
|
8574
8733
|
...DefaultResponses
|
8575
8734
|
},
|
@@ -8585,14 +8744,14 @@ var accountContract = initContract43().router(
|
|
8585
8744
|
201: DefaultSuccessResponseSchema.extend({
|
8586
8745
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
8587
8746
|
}),
|
8588
|
-
400:
|
8589
|
-
message:
|
8747
|
+
400: z117.object({
|
8748
|
+
message: z117.string()
|
8590
8749
|
}),
|
8591
|
-
409:
|
8592
|
-
message:
|
8750
|
+
409: z117.object({
|
8751
|
+
message: z117.string()
|
8593
8752
|
}),
|
8594
|
-
500:
|
8595
|
-
message:
|
8753
|
+
500: z117.object({
|
8754
|
+
message: z117.string()
|
8596
8755
|
}),
|
8597
8756
|
...DefaultResponses
|
8598
8757
|
},
|
@@ -8606,7 +8765,7 @@ var accountContract = initContract43().router(
|
|
8606
8765
|
path: "/sync",
|
8607
8766
|
responses: {
|
8608
8767
|
200: DefaultSuccessResponseSchema.extend({
|
8609
|
-
message:
|
8768
|
+
message: z117.string()
|
8610
8769
|
}),
|
8611
8770
|
...DefaultResponses
|
8612
8771
|
},
|
@@ -8631,13 +8790,13 @@ var accountContract = initContract43().router(
|
|
8631
8790
|
getAll: {
|
8632
8791
|
method: "GET",
|
8633
8792
|
path: "",
|
8634
|
-
query:
|
8635
|
-
state:
|
8636
|
-
withDeleted:
|
8793
|
+
query: z117.object({
|
8794
|
+
state: z117.union([z117.literal("connected"), z117.literal("disconnected")]).optional(),
|
8795
|
+
withDeleted: z117.boolean().default(false)
|
8637
8796
|
}).optional(),
|
8638
8797
|
responses: {
|
8639
8798
|
200: DefaultSuccessResponseSchema.extend({
|
8640
|
-
data:
|
8799
|
+
data: z117.array(MailAccountSchema)
|
8641
8800
|
}),
|
8642
8801
|
...DefaultResponses
|
8643
8802
|
},
|
@@ -8648,8 +8807,8 @@ var accountContract = initContract43().router(
|
|
8648
8807
|
update: {
|
8649
8808
|
method: "PATCH",
|
8650
8809
|
path: "/:id",
|
8651
|
-
pathParams:
|
8652
|
-
id:
|
8810
|
+
pathParams: z117.object({
|
8811
|
+
id: z117.string().uuid()
|
8653
8812
|
}),
|
8654
8813
|
responses: {
|
8655
8814
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -8698,7 +8857,7 @@ var accountContract = initContract43().router(
|
|
8698
8857
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
8699
8858
|
responses: {
|
8700
8859
|
200: DefaultSuccessResponseSchema.extend({
|
8701
|
-
message:
|
8860
|
+
message: z117.string()
|
8702
8861
|
}),
|
8703
8862
|
...DefaultResponses
|
8704
8863
|
},
|
@@ -8713,7 +8872,7 @@ var accountContract = initContract43().router(
|
|
8713
8872
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
8714
8873
|
responses: {
|
8715
8874
|
200: DefaultSuccessResponseSchema.extend({
|
8716
|
-
message:
|
8875
|
+
message: z117.string()
|
8717
8876
|
}),
|
8718
8877
|
...DefaultResponses
|
8719
8878
|
},
|
@@ -8736,30 +8895,30 @@ var accountContract = initContract43().router(
|
|
8736
8895
|
},
|
8737
8896
|
{
|
8738
8897
|
baseHeaders: DefaultHeaderSchema,
|
8739
|
-
pathPrefix: "mail/account"
|
8898
|
+
pathPrefix: "email-service/mail/account"
|
8740
8899
|
}
|
8741
8900
|
);
|
8742
8901
|
|
8743
8902
|
// src/mail/mail-server-contract.ts
|
8744
|
-
import { initContract as
|
8745
|
-
import
|
8903
|
+
import { initContract as initContract45 } from "@ts-rest/core";
|
8904
|
+
import z119 from "zod";
|
8746
8905
|
|
8747
8906
|
// src/mail/schemas/servers-validation.schema.ts
|
8748
|
-
import
|
8749
|
-
var CreateMailServerSchema =
|
8750
|
-
name:
|
8751
|
-
smtpHost:
|
8752
|
-
smtpPort:
|
8753
|
-
smtpTlsPort:
|
8754
|
-
useTlsForSmtp:
|
8755
|
-
imapHost:
|
8756
|
-
imapPort:
|
8757
|
-
imapTlsPort:
|
8758
|
-
useTlsForImap:
|
8907
|
+
import z118 from "zod";
|
8908
|
+
var CreateMailServerSchema = z118.object({
|
8909
|
+
name: z118.string(),
|
8910
|
+
smtpHost: z118.string(),
|
8911
|
+
smtpPort: z118.number(),
|
8912
|
+
smtpTlsPort: z118.number(),
|
8913
|
+
useTlsForSmtp: z118.boolean(),
|
8914
|
+
imapHost: z118.string(),
|
8915
|
+
imapPort: z118.number(),
|
8916
|
+
imapTlsPort: z118.number(),
|
8917
|
+
useTlsForImap: z118.boolean()
|
8759
8918
|
});
|
8760
8919
|
|
8761
8920
|
// src/mail/mail-server-contract.ts
|
8762
|
-
var serverContract =
|
8921
|
+
var serverContract = initContract45().router(
|
8763
8922
|
{
|
8764
8923
|
create: {
|
8765
8924
|
method: "POST",
|
@@ -8778,11 +8937,11 @@ var serverContract = initContract44().router(
|
|
8778
8937
|
path: "/oauth2/apps",
|
8779
8938
|
responses: {
|
8780
8939
|
200: DefaultSuccessResponseSchema.extend({
|
8781
|
-
data:
|
8782
|
-
total:
|
8783
|
-
pages:
|
8784
|
-
page:
|
8785
|
-
apps:
|
8940
|
+
data: z119.object({
|
8941
|
+
total: z119.number(),
|
8942
|
+
pages: z119.number(),
|
8943
|
+
page: z119.number(),
|
8944
|
+
apps: z119.array(OAuth2AppSchema)
|
8786
8945
|
})
|
8787
8946
|
}),
|
8788
8947
|
...DefaultResponses
|
@@ -8792,8 +8951,8 @@ var serverContract = initContract44().router(
|
|
8792
8951
|
getById: {
|
8793
8952
|
method: "GET",
|
8794
8953
|
path: "/:id",
|
8795
|
-
pathParams:
|
8796
|
-
id:
|
8954
|
+
pathParams: z119.object({
|
8955
|
+
id: z119.string().uuid()
|
8797
8956
|
}),
|
8798
8957
|
responses: {
|
8799
8958
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8808,7 +8967,7 @@ var serverContract = initContract44().router(
|
|
8808
8967
|
path: "/",
|
8809
8968
|
responses: {
|
8810
8969
|
200: DefaultSuccessResponseSchema.extend({
|
8811
|
-
data:
|
8970
|
+
data: z119.array(MailServerSchema)
|
8812
8971
|
}),
|
8813
8972
|
...DefaultResponses
|
8814
8973
|
},
|
@@ -8817,8 +8976,8 @@ var serverContract = initContract44().router(
|
|
8817
8976
|
update: {
|
8818
8977
|
method: "PATCH",
|
8819
8978
|
path: "/:id",
|
8820
|
-
pathParams:
|
8821
|
-
id:
|
8979
|
+
pathParams: z119.object({
|
8980
|
+
id: z119.string().uuid()
|
8822
8981
|
}),
|
8823
8982
|
responses: {
|
8824
8983
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8832,8 +8991,8 @@ var serverContract = initContract44().router(
|
|
8832
8991
|
delete: {
|
8833
8992
|
method: "DELETE",
|
8834
8993
|
path: "/:id",
|
8835
|
-
pathParams:
|
8836
|
-
id:
|
8994
|
+
pathParams: z119.object({
|
8995
|
+
id: z119.string().uuid()
|
8837
8996
|
}),
|
8838
8997
|
responses: {
|
8839
8998
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8846,56 +9005,57 @@ var serverContract = initContract44().router(
|
|
8846
9005
|
}
|
8847
9006
|
},
|
8848
9007
|
{
|
8849
|
-
pathPrefix: "mail/server"
|
9008
|
+
pathPrefix: "email-service/mail/server"
|
8850
9009
|
}
|
8851
9010
|
);
|
8852
9011
|
|
8853
9012
|
// src/mail/message-contract.ts
|
8854
|
-
import { initContract as
|
8855
|
-
import
|
9013
|
+
import { initContract as initContract46 } from "@ts-rest/core";
|
9014
|
+
import z121 from "zod";
|
8856
9015
|
|
8857
9016
|
// src/mail/schemas/message-validation.schema.ts
|
8858
|
-
import
|
8859
|
-
var
|
8860
|
-
name:
|
8861
|
-
address:
|
9017
|
+
import z120 from "zod";
|
9018
|
+
var MailParticipant2 = z120.object({
|
9019
|
+
name: z120.string().optional(),
|
9020
|
+
address: z120.string().email()
|
8862
9021
|
});
|
8863
9022
|
var MessageContractsValidationsSchema = {
|
8864
9023
|
submit: {
|
8865
|
-
input:
|
8866
|
-
subject:
|
8867
|
-
text:
|
8868
|
-
html:
|
8869
|
-
from:
|
8870
|
-
to:
|
8871
|
-
cc:
|
8872
|
-
bcc:
|
8873
|
-
|
8874
|
-
|
8875
|
-
|
9024
|
+
input: z120.object({
|
9025
|
+
subject: z120.string(),
|
9026
|
+
text: z120.string(),
|
9027
|
+
html: z120.string(),
|
9028
|
+
from: MailParticipant2,
|
9029
|
+
to: MailParticipant2,
|
9030
|
+
cc: z120.array(MailParticipant2).optional(),
|
9031
|
+
bcc: z120.array(MailParticipant2).optional(),
|
9032
|
+
sendAt: z120.string().optional(),
|
9033
|
+
reference: z120.object({
|
9034
|
+
messageId: z120.string(),
|
9035
|
+
action: z120.union([z120.literal("reply"), z120.literal("forward")])
|
8876
9036
|
}).optional(),
|
8877
|
-
attachments:
|
8878
|
-
|
8879
|
-
fileType:
|
8880
|
-
fileName:
|
8881
|
-
fileKey:
|
8882
|
-
fileSize:
|
8883
|
-
bucketName:
|
8884
|
-
presignedUrl:
|
9037
|
+
attachments: z120.array(
|
9038
|
+
z120.object({
|
9039
|
+
fileType: z120.string(),
|
9040
|
+
fileName: z120.string(),
|
9041
|
+
fileKey: z120.string(),
|
9042
|
+
fileSize: z120.number(),
|
9043
|
+
bucketName: z120.string(),
|
9044
|
+
presignedUrl: z120.string()
|
8885
9045
|
})
|
8886
9046
|
).optional()
|
8887
9047
|
}),
|
8888
|
-
output:
|
8889
|
-
response:
|
8890
|
-
messageId:
|
8891
|
-
sendAt:
|
8892
|
-
queueId:
|
9048
|
+
output: z120.object({
|
9049
|
+
response: z120.string(),
|
9050
|
+
messageId: z120.string(),
|
9051
|
+
sendAt: z120.string(),
|
9052
|
+
queueId: z120.string()
|
8893
9053
|
})
|
8894
9054
|
}
|
8895
9055
|
};
|
8896
9056
|
|
8897
9057
|
// src/mail/message-contract.ts
|
8898
|
-
var messageContract =
|
9058
|
+
var messageContract = initContract46().router(
|
8899
9059
|
{
|
8900
9060
|
submit: {
|
8901
9061
|
method: "POST",
|
@@ -8918,8 +9078,8 @@ var messageContract = initContract45().router(
|
|
8918
9078
|
path: "/new_message_count",
|
8919
9079
|
responses: {
|
8920
9080
|
200: DefaultSuccessResponseSchema.extend({
|
8921
|
-
data:
|
8922
|
-
count:
|
9081
|
+
data: z121.object({
|
9082
|
+
count: z121.number()
|
8923
9083
|
})
|
8924
9084
|
}),
|
8925
9085
|
...DefaultResponses
|
@@ -8931,8 +9091,8 @@ var messageContract = initContract45().router(
|
|
8931
9091
|
getById: {
|
8932
9092
|
method: "GET",
|
8933
9093
|
path: "/:id",
|
8934
|
-
pathParams:
|
8935
|
-
id:
|
9094
|
+
pathParams: z121.object({
|
9095
|
+
id: z121.string()
|
8936
9096
|
}),
|
8937
9097
|
responses: {
|
8938
9098
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8940,17 +9100,70 @@ var messageContract = initContract45().router(
|
|
8940
9100
|
}),
|
8941
9101
|
...DefaultResponses
|
8942
9102
|
},
|
8943
|
-
summary: "Get a message
|
8944
|
-
}
|
9103
|
+
summary: "Get a message"
|
9104
|
+
},
|
8945
9105
|
//#endregion get a message
|
9106
|
+
//#region update a message
|
9107
|
+
update: {
|
9108
|
+
method: "PATCH",
|
9109
|
+
path: "/:id",
|
9110
|
+
pathParams: z121.object({
|
9111
|
+
id: z121.string()
|
9112
|
+
}),
|
9113
|
+
responses: {
|
9114
|
+
200: DefaultSuccessResponseSchema.extend({
|
9115
|
+
data: MessageSchema2
|
9116
|
+
}),
|
9117
|
+
...DefaultResponses
|
9118
|
+
},
|
9119
|
+
summary: "Update a message",
|
9120
|
+
body: MessageSchema2.partial()
|
9121
|
+
},
|
9122
|
+
//#endregion update a message
|
9123
|
+
//#region delete a message
|
9124
|
+
delete: {
|
9125
|
+
method: "DELETE",
|
9126
|
+
path: "/:id",
|
9127
|
+
pathParams: z121.object({
|
9128
|
+
id: z121.string()
|
9129
|
+
}),
|
9130
|
+
responses: {
|
9131
|
+
200: DefaultSuccessResponseSchema.extend({
|
9132
|
+
data: MessageSchema2
|
9133
|
+
}),
|
9134
|
+
...DefaultResponses
|
9135
|
+
},
|
9136
|
+
summary: "Delete a message",
|
9137
|
+
body: null
|
9138
|
+
},
|
9139
|
+
//#endregion delete a message
|
9140
|
+
//#region cancel a scheduled message
|
9141
|
+
cancelScheduledMessage: {
|
9142
|
+
method: "DELETE",
|
9143
|
+
path: "/scheduled_message/:id",
|
9144
|
+
pathParams: z121.object({
|
9145
|
+
id: z121.string()
|
9146
|
+
}),
|
9147
|
+
responses: {
|
9148
|
+
200: DefaultSuccessResponseSchema.extend({
|
9149
|
+
data: z121.object({
|
9150
|
+
totalMessagesCount: z121.number()
|
9151
|
+
})
|
9152
|
+
}),
|
9153
|
+
...DefaultResponses
|
9154
|
+
},
|
9155
|
+
summary: "Cancel a scheduled message",
|
9156
|
+
body: null
|
9157
|
+
}
|
9158
|
+
//#endregion cancel a scheduled message
|
8946
9159
|
},
|
8947
9160
|
{
|
8948
|
-
pathPrefix: "mail/message"
|
9161
|
+
pathPrefix: "email-service/mail/message"
|
8949
9162
|
}
|
8950
9163
|
);
|
8951
9164
|
|
8952
9165
|
// src/mail/mail-contract.ts
|
8953
|
-
var mailContract =
|
9166
|
+
var mailContract = initContract47().router({
|
8954
9167
|
room: roomContract,
|
8955
9168
|
message: messageContract,
|
8956
9169
|
account: accountContract,
|
@@ -8958,44 +9171,44 @@ var mailContract = initContract46().router({
|
|
8958
9171
|
});
|
8959
9172
|
|
8960
9173
|
// src/webchat/index.ts
|
8961
|
-
import { initContract as
|
9174
|
+
import { initContract as initContract48 } from "@ts-rest/core";
|
8962
9175
|
|
8963
9176
|
// src/webchat/schema.ts
|
8964
|
-
import
|
9177
|
+
import z123 from "zod";
|
8965
9178
|
|
8966
9179
|
// src/webchat/validation.ts
|
8967
|
-
import
|
9180
|
+
import z122 from "zod";
|
8968
9181
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
8969
9182
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
8970
9183
|
return ChatwootChannelType3;
|
8971
9184
|
})(ChatwootChannelType2 || {});
|
8972
|
-
var WebChatChannelSchema =
|
8973
|
-
avatar:
|
8974
|
-
name:
|
8975
|
-
type:
|
8976
|
-
websiteName:
|
8977
|
-
welcomeTitle:
|
8978
|
-
websiteUrl:
|
8979
|
-
welcomeTagline:
|
8980
|
-
agentAwayMessage:
|
8981
|
-
widgetColor:
|
9185
|
+
var WebChatChannelSchema = z122.object({
|
9186
|
+
avatar: z122.string().optional(),
|
9187
|
+
name: z122.string(),
|
9188
|
+
type: z122.nativeEnum(ChatwootChannelType2),
|
9189
|
+
websiteName: z122.string(),
|
9190
|
+
welcomeTitle: z122.string(),
|
9191
|
+
websiteUrl: z122.string().url(),
|
9192
|
+
welcomeTagline: z122.string().optional(),
|
9193
|
+
agentAwayMessage: z122.string().optional(),
|
9194
|
+
widgetColor: z122.string().optional()
|
8982
9195
|
});
|
8983
9196
|
|
8984
9197
|
// src/webchat/schema.ts
|
8985
|
-
var ConnectWebChatChannelSchema =
|
8986
|
-
name:
|
8987
|
-
actor:
|
8988
|
-
id:
|
8989
|
-
name:
|
8990
|
-
email:
|
8991
|
-
address:
|
8992
|
-
phone:
|
9198
|
+
var ConnectWebChatChannelSchema = z123.object({
|
9199
|
+
name: z123.string(),
|
9200
|
+
actor: z123.object({
|
9201
|
+
id: z123.string().uuid(),
|
9202
|
+
name: z123.string(),
|
9203
|
+
email: z123.string().email(),
|
9204
|
+
address: z123.string().nullable(),
|
9205
|
+
phone: z123.string().nullable()
|
8993
9206
|
}),
|
8994
9207
|
channel: WebChatChannelSchema
|
8995
9208
|
});
|
8996
9209
|
|
8997
9210
|
// src/webchat/index.ts
|
8998
|
-
var platformWebchatContract =
|
9211
|
+
var platformWebchatContract = initContract48().router({
|
8999
9212
|
sendMessage: {
|
9000
9213
|
method: "POST",
|
9001
9214
|
path: "/message",
|
@@ -9064,6 +9277,7 @@ export {
|
|
9064
9277
|
platformInstagramContract,
|
9065
9278
|
platformMessengerContract,
|
9066
9279
|
platformSMSContract,
|
9280
|
+
platformTelegramContract,
|
9067
9281
|
platformWebchatContract,
|
9068
9282
|
publicApiContract2 as publicApiContract,
|
9069
9283
|
receiveMessageContract,
|