@kl1/contracts 1.1.23-uat → 1.1.25-uat
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/index.js +395 -235
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +395 -235
- package/dist/index.mjs.map +1 -1
- package/dist/src/channel/index.d.ts +725 -611
- package/dist/src/channel/index.d.ts.map +1 -1
- package/dist/src/channel/schema.d.ts +12 -12
- package/dist/src/channel/schema.d.ts.map +1 -1
- package/dist/src/channel/validation.d.ts +71 -8
- package/dist/src/channel/validation.d.ts.map +1 -1
- package/dist/src/chat/index.d.ts +277 -277
- package/dist/src/chat/schema.d.ts +43 -43
- package/dist/src/chat/validation.d.ts +114 -109
- package/dist/src/chat/validation.d.ts.map +1 -1
- package/dist/src/contract.d.ts +13305 -2790
- package/dist/src/contract.d.ts.map +1 -1
- package/dist/src/cx-log/index.d.ts +29 -29
- package/dist/src/cx-log/schema.d.ts +23 -23
- package/dist/src/instagram/index.d.ts +141 -136
- package/dist/src/instagram/index.d.ts.map +1 -1
- package/dist/src/line/index.d.ts +136 -131
- package/dist/src/line/index.d.ts.map +1 -1
- package/dist/src/line/validation.d.ts +23 -23
- package/dist/src/mail/account-contract.d.ts +156 -3
- package/dist/src/mail/account-contract.d.ts.map +1 -1
- package/dist/src/mail/mail-contract.d.ts +2369 -6
- package/dist/src/mail/mail-contract.d.ts.map +1 -1
- package/dist/src/mail/message-contract.d.ts +2045 -1
- package/dist/src/mail/message-contract.d.ts.map +1 -1
- package/dist/src/mail/room-contract.d.ts +170 -2
- package/dist/src/mail/room-contract.d.ts.map +1 -1
- package/dist/src/mail/schemas/message-validation.schema.d.ts +3 -0
- package/dist/src/mail/schemas/message-validation.schema.d.ts.map +1 -1
- package/dist/src/mail/schemas/message.schema.d.ts +6 -0
- package/dist/src/mail/schemas/message.schema.d.ts.map +1 -1
- package/dist/src/mail/schemas/room-validation.schema.d.ts +58 -2
- package/dist/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
- package/dist/src/mail/schemas/room.schema.d.ts +46 -0
- package/dist/src/mail/schemas/room.schema.d.ts.map +1 -1
- package/dist/src/messenger/index.d.ts +141 -136
- package/dist/src/messenger/index.d.ts.map +1 -1
- package/dist/src/messenger/validation.d.ts +13 -13
- package/dist/src/viber/index.d.ts +105 -100
- package/dist/src/viber/index.d.ts.map +1 -1
- package/dist/src/webchat/index.d.ts +8021 -0
- package/dist/src/webchat/index.d.ts.map +1 -0
- package/dist/src/webchat/schema.d.ts +95 -0
- package/dist/src/webchat/schema.d.ts.map +1 -0
- package/dist/src/webchat/validation.d.ts +36 -0
- package/dist/src/webchat/validation.d.ts.map +1 -0
- package/dist/src/wrap-up-form/index.d.ts +3 -0
- package/dist/src/wrap-up-form/index.d.ts.map +1 -1
- package/dist/src/wrap-up-form/validation.d.ts +3 -0
- package/dist/src/wrap-up-form/validation.d.ts.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";
|
@@ -632,7 +632,8 @@ var ChannelTypeSchema = z16.enum([
|
|
632
632
|
"viber",
|
633
633
|
"kakao",
|
634
634
|
"shopee",
|
635
|
-
"lazada"
|
635
|
+
"lazada",
|
636
|
+
"webchat"
|
636
637
|
]);
|
637
638
|
var ChannelStatusTypeSchema = z16.union([
|
638
639
|
z16.literal(true),
|
@@ -643,7 +644,8 @@ var ChannelStatusTypeSchema = z16.union([
|
|
643
644
|
var ChannelMetadataSchema = z16.object({
|
644
645
|
id: z16.string(),
|
645
646
|
name: z16.string(),
|
646
|
-
accessToken: z16.string(),
|
647
|
+
accessToken: z16.string().optional(),
|
648
|
+
// accessToken for chatwoot is not store in meta data, but in .env
|
647
649
|
channelSecret: z16.string().optional(),
|
648
650
|
additionalCredentials: z16.any().optional()
|
649
651
|
});
|
@@ -1452,6 +1454,7 @@ var SendMessageToPlatformSchema = z29.object({
|
|
1452
1454
|
handleTime: z29.number().optional(),
|
1453
1455
|
isLatest: z29.boolean(),
|
1454
1456
|
direction: MessageDirectionTypeSchema,
|
1457
|
+
metadata: z29.any().optional(),
|
1455
1458
|
createdAt: z29.string(),
|
1456
1459
|
updatedAt: z29.string(),
|
1457
1460
|
platformContact: z29.object({
|
@@ -1687,6 +1690,24 @@ var ConnectViberChannelSchema = z30.object({
|
|
1687
1690
|
name: z30.string(),
|
1688
1691
|
accessToken: z30.string()
|
1689
1692
|
});
|
1693
|
+
var ChatwootChannelType = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
1694
|
+
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
1695
|
+
return ChatwootChannelType3;
|
1696
|
+
})(ChatwootChannelType || {});
|
1697
|
+
var ConnectWebChatSchema = z30.object({
|
1698
|
+
name: z30.string(),
|
1699
|
+
channel: z30.object({
|
1700
|
+
avatar: z30.string().optional(),
|
1701
|
+
name: z30.string(),
|
1702
|
+
type: z30.nativeEnum(ChatwootChannelType),
|
1703
|
+
websiteName: z30.string(),
|
1704
|
+
welcomeTitle: z30.string(),
|
1705
|
+
websiteUrl: z30.string().url(),
|
1706
|
+
welcomeTagline: z30.string().optional(),
|
1707
|
+
agentAwayMessage: z30.string().optional(),
|
1708
|
+
widgetColor: z30.string().optional()
|
1709
|
+
})
|
1710
|
+
});
|
1690
1711
|
var GetChannelSchema = z30.object({
|
1691
1712
|
withDeleted: z30.coerce.boolean().default(false)
|
1692
1713
|
});
|
@@ -1789,9 +1810,7 @@ var line = initContract6().router(
|
|
1789
1810
|
method: "POST",
|
1790
1811
|
path: "/connect",
|
1791
1812
|
responses: {
|
1792
|
-
200: DefaultSuccessResponseSchema
|
1793
|
-
channel: ChannelSchema
|
1794
|
-
}),
|
1813
|
+
200: DefaultSuccessResponseSchema,
|
1795
1814
|
408: DefaultErrorResponseSchema
|
1796
1815
|
},
|
1797
1816
|
body: ConnectLineChannelSchema,
|
@@ -1802,6 +1821,26 @@ var line = initContract6().router(
|
|
1802
1821
|
pathPrefix: "/line"
|
1803
1822
|
}
|
1804
1823
|
);
|
1824
|
+
var webchat = initContract6().router(
|
1825
|
+
{
|
1826
|
+
connect: {
|
1827
|
+
method: "POST",
|
1828
|
+
path: "/connect",
|
1829
|
+
responses: {
|
1830
|
+
200: DefaultSuccessResponseSchema.extend({
|
1831
|
+
channel: ChannelSchema
|
1832
|
+
}),
|
1833
|
+
408: DefaultErrorResponseSchema,
|
1834
|
+
400: DefaultErrorResponseSchema
|
1835
|
+
},
|
1836
|
+
body: ConnectWebChatSchema,
|
1837
|
+
summary: "Connect message channel"
|
1838
|
+
}
|
1839
|
+
},
|
1840
|
+
{
|
1841
|
+
pathPrefix: "/webchat"
|
1842
|
+
}
|
1843
|
+
);
|
1805
1844
|
var viber = initContract6().router(
|
1806
1845
|
{
|
1807
1846
|
connect: {
|
@@ -1912,7 +1951,8 @@ var channelContract = initContract6().router(
|
|
1912
1951
|
messenger,
|
1913
1952
|
line,
|
1914
1953
|
instagram,
|
1915
|
-
viber
|
1954
|
+
viber,
|
1955
|
+
webchat
|
1916
1956
|
},
|
1917
1957
|
{
|
1918
1958
|
baseHeaders: DefaultHeaderSchema,
|
@@ -4090,6 +4130,8 @@ var MessageSchema2 = z57.object({
|
|
4090
4130
|
date: z57.date(),
|
4091
4131
|
action: z57.string(),
|
4092
4132
|
unseen: z57.boolean(),
|
4133
|
+
sendAt: z57.date(),
|
4134
|
+
starred: z57.boolean(),
|
4093
4135
|
seemsLikeNew: z57.boolean(),
|
4094
4136
|
from: z57.array(MailUserSchema),
|
4095
4137
|
to: z57.array(MailUserSchema),
|
@@ -4434,7 +4476,7 @@ var accountContract = initContract19().router(
|
|
4434
4476
|
responses: {
|
4435
4477
|
201: DefaultSuccessResponseSchema.extend({
|
4436
4478
|
// data: AccountContractsValidationSchemas.create.output,
|
4437
|
-
|
4479
|
+
data: MailAccountSchema
|
4438
4480
|
}),
|
4439
4481
|
400: z62.object({
|
4440
4482
|
message: z62.string()
|
@@ -4678,6 +4720,7 @@ var MessageContractsValidationsSchema = {
|
|
4678
4720
|
to: z65.array(MailParticipant),
|
4679
4721
|
cc: z65.array(MailParticipant).optional(),
|
4680
4722
|
bcc: z65.array(MailParticipant).optional(),
|
4723
|
+
sendAt: z65.string().optional(),
|
4681
4724
|
reference: z65.object({
|
4682
4725
|
messageId: z65.string(),
|
4683
4726
|
action: z65.union([z65.literal("reply"), z65.literal("forward")])
|
@@ -4748,9 +4791,60 @@ var messageContract = initContract21().router(
|
|
4748
4791
|
}),
|
4749
4792
|
...DefaultResponses
|
4750
4793
|
},
|
4751
|
-
summary: "Get a message
|
4752
|
-
}
|
4794
|
+
summary: "Get a message"
|
4795
|
+
},
|
4753
4796
|
//#endregion get a message
|
4797
|
+
//#region update a message
|
4798
|
+
update: {
|
4799
|
+
method: "PATCH",
|
4800
|
+
path: "/:id",
|
4801
|
+
pathParams: z66.object({
|
4802
|
+
id: z66.string()
|
4803
|
+
}),
|
4804
|
+
responses: {
|
4805
|
+
200: DefaultSuccessResponseSchema.extend({
|
4806
|
+
data: MessageSchema2
|
4807
|
+
}),
|
4808
|
+
...DefaultResponses
|
4809
|
+
},
|
4810
|
+
summary: "Update a message",
|
4811
|
+
body: MessageSchema2.partial()
|
4812
|
+
},
|
4813
|
+
//#endregion update a message
|
4814
|
+
//#region delete a message
|
4815
|
+
delete: {
|
4816
|
+
method: "DELETE",
|
4817
|
+
path: "/:id",
|
4818
|
+
pathParams: z66.object({
|
4819
|
+
id: z66.string()
|
4820
|
+
}),
|
4821
|
+
responses: {
|
4822
|
+
200: DefaultSuccessResponseSchema.extend({
|
4823
|
+
data: MessageSchema2
|
4824
|
+
}),
|
4825
|
+
...DefaultResponses
|
4826
|
+
},
|
4827
|
+
summary: "Delete a message",
|
4828
|
+
body: null
|
4829
|
+
},
|
4830
|
+
//#endregion delete a message
|
4831
|
+
//#region cancel a scheduled message
|
4832
|
+
cancelScheduledMessage: {
|
4833
|
+
method: "DELETE",
|
4834
|
+
path: "/scheduled_message/:id",
|
4835
|
+
pathParams: z66.object({
|
4836
|
+
id: z66.string()
|
4837
|
+
}),
|
4838
|
+
responses: {
|
4839
|
+
200: DefaultSuccessResponseSchema.extend({
|
4840
|
+
data: MessageSchema2
|
4841
|
+
}),
|
4842
|
+
...DefaultResponses
|
4843
|
+
},
|
4844
|
+
summary: "Cancel a scheduled message",
|
4845
|
+
body: null
|
4846
|
+
}
|
4847
|
+
//#endregion cancel a scheduled message
|
4754
4848
|
},
|
4755
4849
|
{
|
4756
4850
|
pathPrefix: "mail/message"
|
@@ -6481,7 +6575,8 @@ var CreateWrapUpFormSchema = z91.object({
|
|
6481
6575
|
callTo: z91.string().nullable().optional()
|
6482
6576
|
});
|
6483
6577
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
6484
|
-
tags: z91.array(z91.string()).optional()
|
6578
|
+
tags: z91.array(z91.string()).optional(),
|
6579
|
+
categoryIds: z91.array(z91.string().uuid()).optional()
|
6485
6580
|
});
|
6486
6581
|
var CreateCXLogWrapUpFormSchema = z91.object({
|
6487
6582
|
cxLogId: z91.string().uuid(),
|
@@ -6871,69 +6966,133 @@ var userNotificationContract = initContract37().router(
|
|
6871
6966
|
}
|
6872
6967
|
);
|
6873
6968
|
|
6874
|
-
// src/
|
6969
|
+
// src/webchat/index.ts
|
6875
6970
|
import { initContract as initContract38 } from "@ts-rest/core";
|
6876
|
-
import { z as z101 } from "zod";
|
6877
6971
|
|
6878
|
-
// src/
|
6972
|
+
// src/webchat/schema.ts
|
6973
|
+
import z100 from "zod";
|
6974
|
+
|
6975
|
+
// src/webchat/validation.ts
|
6879
6976
|
import z99 from "zod";
|
6880
|
-
var
|
6977
|
+
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
6978
|
+
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
6979
|
+
return ChatwootChannelType3;
|
6980
|
+
})(ChatwootChannelType2 || {});
|
6981
|
+
var WebChatChannelSchema = z99.object({
|
6982
|
+
avatar: z99.string().optional(),
|
6881
6983
|
name: z99.string(),
|
6882
|
-
|
6984
|
+
type: z99.nativeEnum(ChatwootChannelType2),
|
6985
|
+
websiteName: z99.string(),
|
6986
|
+
welcomeTitle: z99.string(),
|
6987
|
+
websiteUrl: z99.string().url(),
|
6988
|
+
welcomeTagline: z99.string().optional(),
|
6989
|
+
agentAwayMessage: z99.string().optional(),
|
6990
|
+
widgetColor: z99.string().optional()
|
6991
|
+
});
|
6992
|
+
|
6993
|
+
// src/webchat/schema.ts
|
6994
|
+
var ConnectWebChatChannelSchema = z100.object({
|
6995
|
+
name: z100.string(),
|
6996
|
+
actor: z100.object({
|
6997
|
+
id: z100.string().uuid(),
|
6998
|
+
name: z100.string(),
|
6999
|
+
email: z100.string().email(),
|
7000
|
+
address: z100.string().nullable(),
|
7001
|
+
phone: z100.string().nullable()
|
7002
|
+
}),
|
7003
|
+
channel: WebChatChannelSchema
|
7004
|
+
});
|
7005
|
+
|
7006
|
+
// src/webchat/index.ts
|
7007
|
+
var webchatContract = initContract38().router({
|
7008
|
+
sendMessage: {
|
7009
|
+
method: "POST",
|
7010
|
+
path: "/message",
|
7011
|
+
body: SendMessageToPlatformSchema,
|
7012
|
+
responses: {
|
7013
|
+
200: SendMessageResponseSchema,
|
7014
|
+
400: DefaultErrorResponseSchema,
|
7015
|
+
500: DefaultErrorResponseSchema
|
7016
|
+
}
|
7017
|
+
},
|
7018
|
+
connect: {
|
7019
|
+
method: "POST",
|
7020
|
+
path: "/connect",
|
7021
|
+
summary: "Connect to a webchat channel",
|
7022
|
+
responses: {
|
7023
|
+
200: DefaultSuccessResponseSchema.extend({
|
7024
|
+
channel: ChannelSchema
|
7025
|
+
}),
|
7026
|
+
400: DefaultErrorResponseSchema,
|
7027
|
+
500: DefaultErrorResponseSchema
|
7028
|
+
},
|
7029
|
+
body: ConnectWebChatChannelSchema
|
7030
|
+
}
|
7031
|
+
});
|
7032
|
+
|
7033
|
+
// src/snippet/index.ts
|
7034
|
+
import { initContract as initContract39 } from "@ts-rest/core";
|
7035
|
+
import { z as z103 } from "zod";
|
7036
|
+
|
7037
|
+
// src/snippet/schema.ts
|
7038
|
+
import z101 from "zod";
|
7039
|
+
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7040
|
+
name: z101.string(),
|
7041
|
+
platformType: z101.string()
|
6883
7042
|
});
|
6884
7043
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
6885
|
-
contentType:
|
6886
|
-
contentValue:
|
6887
|
-
contentTemplate:
|
6888
|
-
order:
|
7044
|
+
contentType: z101.string(),
|
7045
|
+
contentValue: z101.string().nullable(),
|
7046
|
+
contentTemplate: z101.any().nullable(),
|
7047
|
+
order: z101.number(),
|
6889
7048
|
upload: UploadSchema.optional().nullable()
|
6890
7049
|
});
|
6891
7050
|
var SnippetSchema = DefaultEntitySchema.extend({
|
6892
|
-
name:
|
7051
|
+
name: z101.string(),
|
6893
7052
|
snippetGroup: SnippetGroupSchema,
|
6894
7053
|
snippetContent: SnippetContentSchema
|
6895
7054
|
});
|
6896
|
-
var SnippetGroupListItemSchema =
|
6897
|
-
id:
|
6898
|
-
name:
|
7055
|
+
var SnippetGroupListItemSchema = z101.object({
|
7056
|
+
id: z101.string().uuid(),
|
7057
|
+
name: z101.string()
|
6899
7058
|
});
|
6900
|
-
var SnippetListItemSchema =
|
6901
|
-
id:
|
6902
|
-
shortCutName:
|
6903
|
-
contentType:
|
6904
|
-
contentValue:
|
6905
|
-
snippetGroupId:
|
7059
|
+
var SnippetListItemSchema = z101.object({
|
7060
|
+
id: z101.string().uuid(),
|
7061
|
+
shortCutName: z101.string(),
|
7062
|
+
contentType: z101.string(),
|
7063
|
+
contentValue: z101.string().nullable(),
|
7064
|
+
snippetGroupId: z101.string()
|
6906
7065
|
});
|
6907
7066
|
|
6908
7067
|
// src/snippet/validation.ts
|
6909
|
-
import { z as
|
6910
|
-
var CreateSnippetGroupSchema =
|
6911
|
-
name:
|
6912
|
-
platformType:
|
7068
|
+
import { z as z102 } from "zod";
|
7069
|
+
var CreateSnippetGroupSchema = z102.object({
|
7070
|
+
name: z102.string(),
|
7071
|
+
platformType: z102.string()
|
6913
7072
|
});
|
6914
|
-
var UpdateSnippetGroupSchema =
|
6915
|
-
name:
|
6916
|
-
platformType:
|
7073
|
+
var UpdateSnippetGroupSchema = z102.object({
|
7074
|
+
name: z102.string().optional(),
|
7075
|
+
platformType: z102.string().optional()
|
6917
7076
|
});
|
6918
|
-
var DeleteSnippetGroupSchema =
|
6919
|
-
id:
|
7077
|
+
var DeleteSnippetGroupSchema = z102.object({
|
7078
|
+
id: z102.string()
|
6920
7079
|
});
|
6921
|
-
var CreateSnippetSchema =
|
6922
|
-
shortcutName:
|
6923
|
-
contentType:
|
6924
|
-
contentValue:
|
6925
|
-
snippetGroupId:
|
6926
|
-
platformType:
|
7080
|
+
var CreateSnippetSchema = z102.object({
|
7081
|
+
shortcutName: z102.string(),
|
7082
|
+
contentType: z102.string(),
|
7083
|
+
contentValue: z102.string().optional(),
|
7084
|
+
snippetGroupId: z102.string(),
|
7085
|
+
platformType: z102.string()
|
6927
7086
|
});
|
6928
7087
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
6929
|
-
snippetContentId:
|
7088
|
+
snippetContentId: z102.string()
|
6930
7089
|
});
|
6931
|
-
var DeleteSnippetSchema =
|
6932
|
-
snippetId:
|
7090
|
+
var DeleteSnippetSchema = z102.object({
|
7091
|
+
snippetId: z102.string()
|
6933
7092
|
});
|
6934
7093
|
|
6935
7094
|
// src/snippet/index.ts
|
6936
|
-
var snippetContract =
|
7095
|
+
var snippetContract = initContract39().router(
|
6937
7096
|
{
|
6938
7097
|
createSnippetGroup: {
|
6939
7098
|
method: "POST",
|
@@ -6952,7 +7111,7 @@ var snippetContract = initContract38().router(
|
|
6952
7111
|
query: null,
|
6953
7112
|
responses: {
|
6954
7113
|
200: DefaultSuccessResponseSchema.extend({
|
6955
|
-
snippetgroups:
|
7114
|
+
snippetgroups: z103.array(SnippetGroupSchema)
|
6956
7115
|
}),
|
6957
7116
|
500: DefaultErrorResponseSchema
|
6958
7117
|
}
|
@@ -6960,7 +7119,7 @@ var snippetContract = initContract38().router(
|
|
6960
7119
|
updateSnippetGroup: {
|
6961
7120
|
method: "PATCH",
|
6962
7121
|
path: "/groups/:id",
|
6963
|
-
pathParams:
|
7122
|
+
pathParams: z103.object({ id: z103.string() }),
|
6964
7123
|
body: UpdateSnippetGroupSchema,
|
6965
7124
|
responses: {
|
6966
7125
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6972,7 +7131,7 @@ var snippetContract = initContract38().router(
|
|
6972
7131
|
deleteSnippetGroup: {
|
6973
7132
|
method: "DELETE",
|
6974
7133
|
path: "/groups/:id",
|
6975
|
-
pathParams:
|
7134
|
+
pathParams: z103.object({ id: z103.string() }),
|
6976
7135
|
body: null,
|
6977
7136
|
responses: {
|
6978
7137
|
200: DefaultSuccessResponseSchema,
|
@@ -6984,7 +7143,7 @@ var snippetContract = initContract38().router(
|
|
6984
7143
|
path: "",
|
6985
7144
|
responses: {
|
6986
7145
|
200: DefaultSuccessResponseSchema.extend({
|
6987
|
-
snippets:
|
7146
|
+
snippets: z103.array(SnippetSchema)
|
6988
7147
|
}),
|
6989
7148
|
500: DefaultErrorResponseSchema
|
6990
7149
|
}
|
@@ -7003,7 +7162,7 @@ var snippetContract = initContract38().router(
|
|
7003
7162
|
updateSnippet: {
|
7004
7163
|
method: "PATCH",
|
7005
7164
|
path: "/:id",
|
7006
|
-
pathParams:
|
7165
|
+
pathParams: z103.object({ id: z103.string() }),
|
7007
7166
|
body: UpdateSnippetSchema,
|
7008
7167
|
responses: {
|
7009
7168
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7015,7 +7174,7 @@ var snippetContract = initContract38().router(
|
|
7015
7174
|
deleteSnippet: {
|
7016
7175
|
method: "DELETE",
|
7017
7176
|
path: "/:id",
|
7018
|
-
pathParams:
|
7177
|
+
pathParams: z103.object({ id: z103.string() }),
|
7019
7178
|
body: null,
|
7020
7179
|
responses: {
|
7021
7180
|
200: DefaultSuccessResponseSchema,
|
@@ -7029,169 +7188,169 @@ var snippetContract = initContract38().router(
|
|
7029
7188
|
);
|
7030
7189
|
|
7031
7190
|
// src/public-api/index.ts
|
7032
|
-
import { initContract as
|
7033
|
-
import
|
7191
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
7192
|
+
import z106 from "zod";
|
7034
7193
|
|
7035
7194
|
// src/public-api/validation.ts
|
7036
|
-
import
|
7195
|
+
import z105 from "zod";
|
7037
7196
|
|
7038
7197
|
// src/public-api/schema.ts
|
7039
|
-
import
|
7040
|
-
var ContactPhonesSchema2 =
|
7041
|
-
id:
|
7042
|
-
createdAt:
|
7043
|
-
updatedAt:
|
7044
|
-
deletedAt:
|
7045
|
-
phone:
|
7046
|
-
isPrimary:
|
7047
|
-
});
|
7048
|
-
var ContactEmailsSchema2 =
|
7049
|
-
id:
|
7050
|
-
createdAt:
|
7051
|
-
updatedAt:
|
7052
|
-
deletedAt:
|
7053
|
-
email:
|
7054
|
-
isPrimary:
|
7055
|
-
});
|
7056
|
-
var ContactCustomFieldSchema2 =
|
7057
|
-
id:
|
7058
|
-
createdAt:
|
7059
|
-
updatedAt:
|
7060
|
-
deletedAt:
|
7061
|
-
textValue:
|
7062
|
-
booleanValue:
|
7063
|
-
numberValue:
|
7064
|
-
dateValue:
|
7198
|
+
import z104 from "zod";
|
7199
|
+
var ContactPhonesSchema2 = z104.object({
|
7200
|
+
id: z104.string().uuid(),
|
7201
|
+
createdAt: z104.date(),
|
7202
|
+
updatedAt: z104.date(),
|
7203
|
+
deletedAt: z104.date().nullable(),
|
7204
|
+
phone: z104.string(),
|
7205
|
+
isPrimary: z104.boolean()
|
7206
|
+
});
|
7207
|
+
var ContactEmailsSchema2 = z104.object({
|
7208
|
+
id: z104.string().uuid(),
|
7209
|
+
createdAt: z104.date(),
|
7210
|
+
updatedAt: z104.date(),
|
7211
|
+
deletedAt: z104.date().nullable(),
|
7212
|
+
email: z104.string(),
|
7213
|
+
isPrimary: z104.boolean()
|
7214
|
+
});
|
7215
|
+
var ContactCustomFieldSchema2 = z104.object({
|
7216
|
+
id: z104.string().uuid(),
|
7217
|
+
createdAt: z104.date(),
|
7218
|
+
updatedAt: z104.date(),
|
7219
|
+
deletedAt: z104.date().nullable(),
|
7220
|
+
textValue: z104.string().nullable(),
|
7221
|
+
booleanValue: z104.boolean().nullable(),
|
7222
|
+
numberValue: z104.number().nullable(),
|
7223
|
+
dateValue: z104.date().nullable(),
|
7065
7224
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
7066
|
-
uploads:
|
7067
|
-
});
|
7068
|
-
var ContactEntityTypesSchema2 =
|
7069
|
-
id:
|
7070
|
-
createdAt:
|
7071
|
-
updatedAt:
|
7072
|
-
deletedAt:
|
7073
|
-
entity:
|
7074
|
-
description:
|
7075
|
-
});
|
7076
|
-
var ContactActivitySchema2 =
|
7077
|
-
id:
|
7078
|
-
createdAt:
|
7079
|
-
updatedAt:
|
7080
|
-
deletedAt:
|
7081
|
-
entityId:
|
7082
|
-
description:
|
7225
|
+
uploads: z104.array(UploadSchema)
|
7226
|
+
});
|
7227
|
+
var ContactEntityTypesSchema2 = z104.object({
|
7228
|
+
id: z104.string().uuid(),
|
7229
|
+
createdAt: z104.date(),
|
7230
|
+
updatedAt: z104.date(),
|
7231
|
+
deletedAt: z104.date().nullable(),
|
7232
|
+
entity: z104.string(),
|
7233
|
+
description: z104.string().nullable()
|
7234
|
+
});
|
7235
|
+
var ContactActivitySchema2 = z104.object({
|
7236
|
+
id: z104.string().uuid(),
|
7237
|
+
createdAt: z104.date(),
|
7238
|
+
updatedAt: z104.date(),
|
7239
|
+
deletedAt: z104.date().nullable(),
|
7240
|
+
entityId: z104.string(),
|
7241
|
+
description: z104.string(),
|
7083
7242
|
entityType: ContactEntityTypesSchema2
|
7084
7243
|
});
|
7085
|
-
var ContactSchema2 =
|
7086
|
-
id:
|
7087
|
-
createdAt:
|
7088
|
-
updatedAt:
|
7089
|
-
deletedAt:
|
7090
|
-
name:
|
7091
|
-
address:
|
7092
|
-
channel:
|
7093
|
-
notes:
|
7094
|
-
contactProfile:
|
7095
|
-
socialProfileUrl:
|
7096
|
-
tags:
|
7244
|
+
var ContactSchema2 = z104.object({
|
7245
|
+
id: z104.string().uuid(),
|
7246
|
+
createdAt: z104.date(),
|
7247
|
+
updatedAt: z104.date(),
|
7248
|
+
deletedAt: z104.date().nullable(),
|
7249
|
+
name: z104.string(),
|
7250
|
+
address: z104.string().nullable(),
|
7251
|
+
channel: z104.string().nullable(),
|
7252
|
+
notes: z104.string().nullable(),
|
7253
|
+
contactProfile: z104.string().nullable(),
|
7254
|
+
socialProfileUrl: z104.string().nullable(),
|
7255
|
+
tags: z104.array(TagSchema),
|
7097
7256
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
7098
|
-
customFields:
|
7099
|
-
contactEmails:
|
7100
|
-
contactPhones:
|
7101
|
-
activityLogs:
|
7257
|
+
customFields: z104.array(ContactCustomFieldSchema2),
|
7258
|
+
contactEmails: z104.array(ContactEmailsSchema2),
|
7259
|
+
contactPhones: z104.array(ContactPhonesSchema2),
|
7260
|
+
activityLogs: z104.array(ContactActivitySchema2).optional()
|
7102
7261
|
});
|
7103
7262
|
|
7104
7263
|
// src/public-api/validation.ts
|
7105
7264
|
var ContactContractValidationSchema2 = {
|
7106
7265
|
create: {
|
7107
|
-
request:
|
7108
|
-
name:
|
7109
|
-
email:
|
7110
|
-
|
7111
|
-
email:
|
7112
|
-
isPrimary:
|
7266
|
+
request: z105.object({
|
7267
|
+
name: z105.string(),
|
7268
|
+
email: z105.array(
|
7269
|
+
z105.object({
|
7270
|
+
email: z105.string().email(),
|
7271
|
+
isPrimary: z105.boolean()
|
7113
7272
|
})
|
7114
7273
|
).optional(),
|
7115
|
-
channel:
|
7116
|
-
address:
|
7117
|
-
phone:
|
7118
|
-
|
7119
|
-
phone:
|
7120
|
-
isPrimary:
|
7274
|
+
channel: z105.string().optional(),
|
7275
|
+
address: z105.string().optional(),
|
7276
|
+
phone: z105.array(
|
7277
|
+
z105.object({
|
7278
|
+
phone: z105.string(),
|
7279
|
+
isPrimary: z105.boolean()
|
7121
7280
|
})
|
7122
7281
|
).optional(),
|
7123
|
-
notes:
|
7124
|
-
tags:
|
7125
|
-
company:
|
7126
|
-
customFields:
|
7282
|
+
notes: z105.string().optional(),
|
7283
|
+
tags: z105.array(z105.string()).optional(),
|
7284
|
+
company: z105.string().optional(),
|
7285
|
+
customFields: z105.record(z105.string())
|
7127
7286
|
// Dynamic keys with string values
|
7128
7287
|
}),
|
7129
7288
|
response: ContactSchema2
|
7130
7289
|
},
|
7131
7290
|
getById: {
|
7132
|
-
request:
|
7133
|
-
id:
|
7291
|
+
request: z105.object({
|
7292
|
+
id: z105.string().uuid()
|
7134
7293
|
})
|
7135
7294
|
},
|
7136
7295
|
delete: {
|
7137
|
-
request:
|
7138
|
-
id:
|
7296
|
+
request: z105.object({
|
7297
|
+
id: z105.string().uuid()
|
7139
7298
|
})
|
7140
7299
|
},
|
7141
7300
|
getAll: {
|
7142
|
-
request:
|
7143
|
-
page:
|
7144
|
-
pageSize:
|
7145
|
-
keyword:
|
7146
|
-
company:
|
7147
|
-
name:
|
7148
|
-
address:
|
7149
|
-
channel:
|
7150
|
-
selectedDate:
|
7151
|
-
customFields:
|
7152
|
-
|
7153
|
-
attributeId:
|
7154
|
-
type:
|
7155
|
-
value:
|
7301
|
+
request: z105.object({
|
7302
|
+
page: z105.coerce.number().default(1),
|
7303
|
+
pageSize: z105.coerce.number().default(10),
|
7304
|
+
keyword: z105.string().optional(),
|
7305
|
+
company: z105.array(z105.string().uuid()),
|
7306
|
+
name: z105.string(),
|
7307
|
+
address: z105.string(),
|
7308
|
+
channel: z105.array(z105.string()),
|
7309
|
+
selectedDate: z105.string(),
|
7310
|
+
customFields: z105.array(
|
7311
|
+
z105.object({
|
7312
|
+
attributeId: z105.string().uuid(),
|
7313
|
+
type: z105.string(),
|
7314
|
+
value: z105.union([z105.string(), z105.array(z105.string())])
|
7156
7315
|
})
|
7157
7316
|
),
|
7158
|
-
tags:
|
7159
|
-
phone:
|
7160
|
-
email:
|
7161
|
-
notes:
|
7317
|
+
tags: z105.array(z105.string().uuid()),
|
7318
|
+
phone: z105.string(),
|
7319
|
+
email: z105.string(),
|
7320
|
+
notes: z105.string()
|
7162
7321
|
}).partial(),
|
7163
7322
|
response: {
|
7164
|
-
page:
|
7165
|
-
pageSize:
|
7166
|
-
total:
|
7167
|
-
lastPage:
|
7168
|
-
data:
|
7323
|
+
page: z105.number(),
|
7324
|
+
pageSize: z105.number(),
|
7325
|
+
total: z105.number(),
|
7326
|
+
lastPage: z105.number(),
|
7327
|
+
data: z105.array(ContactSchema2)
|
7169
7328
|
}
|
7170
7329
|
},
|
7171
7330
|
getContactFields: {
|
7172
|
-
request:
|
7173
|
-
page:
|
7174
|
-
pageSize:
|
7331
|
+
request: z105.object({
|
7332
|
+
page: z105.coerce.number().default(1),
|
7333
|
+
pageSize: z105.coerce.number().default(10)
|
7175
7334
|
}).partial(),
|
7176
7335
|
response: {
|
7177
|
-
page:
|
7178
|
-
pageSize:
|
7179
|
-
total:
|
7180
|
-
lastPage:
|
7181
|
-
data:
|
7336
|
+
page: z105.number(),
|
7337
|
+
pageSize: z105.number(),
|
7338
|
+
total: z105.number(),
|
7339
|
+
lastPage: z105.number(),
|
7340
|
+
data: z105.array(ContactCustomFieldSchema2)
|
7182
7341
|
}
|
7183
7342
|
},
|
7184
7343
|
addAttachments: {
|
7185
|
-
request:
|
7186
|
-
contactId:
|
7187
|
-
attributeId:
|
7188
|
-
contactAttachmentRecords:
|
7189
|
-
|
7190
|
-
bucketName:
|
7191
|
-
fileKey:
|
7192
|
-
fileName:
|
7193
|
-
fileSize:
|
7194
|
-
url:
|
7344
|
+
request: z105.object({
|
7345
|
+
contactId: z105.string(),
|
7346
|
+
attributeId: z105.string().uuid(),
|
7347
|
+
contactAttachmentRecords: z105.array(
|
7348
|
+
z105.object({
|
7349
|
+
bucketName: z105.string(),
|
7350
|
+
fileKey: z105.string(),
|
7351
|
+
fileName: z105.string(),
|
7352
|
+
fileSize: z105.coerce.number(),
|
7353
|
+
url: z105.string()
|
7195
7354
|
})
|
7196
7355
|
)
|
7197
7356
|
}),
|
@@ -7200,7 +7359,7 @@ var ContactContractValidationSchema2 = {
|
|
7200
7359
|
};
|
7201
7360
|
|
7202
7361
|
// src/public-api/index.ts
|
7203
|
-
var publicApiContract =
|
7362
|
+
var publicApiContract = initContract40().router(
|
7204
7363
|
{
|
7205
7364
|
createContact: {
|
7206
7365
|
method: "POST",
|
@@ -7210,11 +7369,11 @@ var publicApiContract = initContract39().router(
|
|
7210
7369
|
201: DefaultSuccessResponseSchema.extend({
|
7211
7370
|
data: ContactSchema2
|
7212
7371
|
}),
|
7213
|
-
400:
|
7214
|
-
message:
|
7372
|
+
400: z106.object({
|
7373
|
+
message: z106.string()
|
7215
7374
|
}),
|
7216
|
-
409:
|
7217
|
-
message:
|
7375
|
+
409: z106.object({
|
7376
|
+
message: z106.string()
|
7218
7377
|
}),
|
7219
7378
|
401: DefaultUnauthorizedSchema,
|
7220
7379
|
404: DefaultNotFoundSchema,
|
@@ -7229,13 +7388,13 @@ var publicApiContract = initContract39().router(
|
|
7229
7388
|
query: GetTagsSchema,
|
7230
7389
|
responses: {
|
7231
7390
|
200: DefaultSuccessResponseSchema.extend({
|
7232
|
-
tags:
|
7391
|
+
tags: z106.array(TagSchema)
|
7233
7392
|
}),
|
7234
|
-
400:
|
7235
|
-
message:
|
7393
|
+
400: z106.object({
|
7394
|
+
message: z106.string()
|
7236
7395
|
}),
|
7237
|
-
409:
|
7238
|
-
message:
|
7396
|
+
409: z106.object({
|
7397
|
+
message: z106.string()
|
7239
7398
|
}),
|
7240
7399
|
401: DefaultUnauthorizedSchema,
|
7241
7400
|
404: DefaultNotFoundSchema,
|
@@ -7251,11 +7410,11 @@ var publicApiContract = initContract39().router(
|
|
7251
7410
|
200: DefaultSuccessResponseSchema.extend(
|
7252
7411
|
ContactContractValidationSchema2.getAll.response
|
7253
7412
|
),
|
7254
|
-
400:
|
7255
|
-
message:
|
7413
|
+
400: z106.object({
|
7414
|
+
message: z106.string()
|
7256
7415
|
}),
|
7257
|
-
409:
|
7258
|
-
message:
|
7416
|
+
409: z106.object({
|
7417
|
+
message: z106.string()
|
7259
7418
|
}),
|
7260
7419
|
401: DefaultUnauthorizedSchema,
|
7261
7420
|
404: DefaultNotFoundSchema,
|
@@ -7272,11 +7431,11 @@ var publicApiContract = initContract39().router(
|
|
7272
7431
|
200: DefaultSuccessResponseSchema.extend(
|
7273
7432
|
ContactContractValidationSchema2.getContactFields.response
|
7274
7433
|
),
|
7275
|
-
400:
|
7276
|
-
message:
|
7434
|
+
400: z106.object({
|
7435
|
+
message: z106.string()
|
7277
7436
|
}),
|
7278
|
-
409:
|
7279
|
-
message:
|
7437
|
+
409: z106.object({
|
7438
|
+
message: z106.string()
|
7280
7439
|
}),
|
7281
7440
|
401: DefaultUnauthorizedSchema,
|
7282
7441
|
404: DefaultNotFoundSchema,
|
@@ -7290,17 +7449,17 @@ var publicApiContract = initContract39().router(
|
|
7290
7449
|
path: "/contacts/:id",
|
7291
7450
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7292
7451
|
responses: {
|
7293
|
-
200:
|
7294
|
-
status:
|
7295
|
-
message:
|
7452
|
+
200: z106.object({
|
7453
|
+
status: z106.string(),
|
7454
|
+
message: z106.string(),
|
7296
7455
|
data: ContactSchema2,
|
7297
|
-
requestId:
|
7456
|
+
requestId: z106.string()
|
7298
7457
|
}),
|
7299
|
-
400:
|
7300
|
-
message:
|
7458
|
+
400: z106.object({
|
7459
|
+
message: z106.string()
|
7301
7460
|
}),
|
7302
|
-
409:
|
7303
|
-
message:
|
7461
|
+
409: z106.object({
|
7462
|
+
message: z106.string()
|
7304
7463
|
}),
|
7305
7464
|
401: DefaultUnauthorizedSchema,
|
7306
7465
|
404: DefaultNotFoundSchema,
|
@@ -7318,11 +7477,11 @@ var publicApiContract = initContract39().router(
|
|
7318
7477
|
201: DefaultSuccessResponseSchema.extend({
|
7319
7478
|
message: ContactCustomFieldSchema2
|
7320
7479
|
}),
|
7321
|
-
400:
|
7322
|
-
message:
|
7480
|
+
400: z106.object({
|
7481
|
+
message: z106.string()
|
7323
7482
|
}),
|
7324
|
-
409:
|
7325
|
-
message:
|
7483
|
+
409: z106.object({
|
7484
|
+
message: z106.string()
|
7326
7485
|
}),
|
7327
7486
|
401: DefaultUnauthorizedSchema,
|
7328
7487
|
404: DefaultNotFoundSchema,
|
@@ -7336,17 +7495,17 @@ var publicApiContract = initContract39().router(
|
|
7336
7495
|
path: "/contacts/:id",
|
7337
7496
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7338
7497
|
responses: {
|
7339
|
-
200:
|
7340
|
-
status:
|
7341
|
-
message:
|
7498
|
+
200: z106.object({
|
7499
|
+
status: z106.string(),
|
7500
|
+
message: z106.string(),
|
7342
7501
|
data: ContactSchema2,
|
7343
|
-
requestId:
|
7502
|
+
requestId: z106.string()
|
7344
7503
|
}),
|
7345
|
-
400:
|
7346
|
-
message:
|
7504
|
+
400: z106.object({
|
7505
|
+
message: z106.string()
|
7347
7506
|
}),
|
7348
|
-
409:
|
7349
|
-
message:
|
7507
|
+
409: z106.object({
|
7508
|
+
message: z106.string()
|
7350
7509
|
}),
|
7351
7510
|
401: DefaultUnauthorizedSchema,
|
7352
7511
|
404: DefaultNotFoundSchema,
|
@@ -7360,17 +7519,17 @@ var publicApiContract = initContract39().router(
|
|
7360
7519
|
path: "/contacts/:id",
|
7361
7520
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7362
7521
|
responses: {
|
7363
|
-
200:
|
7364
|
-
status:
|
7365
|
-
message:
|
7522
|
+
200: z106.object({
|
7523
|
+
status: z106.string(),
|
7524
|
+
message: z106.string(),
|
7366
7525
|
data: ContactSchema2,
|
7367
|
-
requestId:
|
7526
|
+
requestId: z106.string()
|
7368
7527
|
}),
|
7369
|
-
400:
|
7370
|
-
message:
|
7528
|
+
400: z106.object({
|
7529
|
+
message: z106.string()
|
7371
7530
|
}),
|
7372
|
-
409:
|
7373
|
-
message:
|
7531
|
+
409: z106.object({
|
7532
|
+
message: z106.string()
|
7374
7533
|
}),
|
7375
7534
|
401: DefaultUnauthorizedSchema,
|
7376
7535
|
404: DefaultNotFoundSchema,
|
@@ -7387,7 +7546,7 @@ var publicApiContract = initContract39().router(
|
|
7387
7546
|
);
|
7388
7547
|
|
7389
7548
|
// src/contract.ts
|
7390
|
-
var apiContract =
|
7549
|
+
var apiContract = initContract41().router({
|
7391
7550
|
auth: authContract,
|
7392
7551
|
mail: mailContract,
|
7393
7552
|
cxLog: cxLogContract,
|
@@ -7411,35 +7570,36 @@ var apiContract = initContract40().router({
|
|
7411
7570
|
upload: uploadContract,
|
7412
7571
|
snippet: snippetContract
|
7413
7572
|
});
|
7414
|
-
var contactContract2 =
|
7573
|
+
var contactContract2 = initContract41().router({
|
7415
7574
|
contact: contactContract
|
7416
7575
|
});
|
7417
|
-
var ticketContract2 =
|
7576
|
+
var ticketContract2 = initContract41().router({
|
7418
7577
|
ticket: ticketContract
|
7419
7578
|
});
|
7420
|
-
var extensionContract2 =
|
7579
|
+
var extensionContract2 = initContract41().router({
|
7421
7580
|
extension: extensionContract
|
7422
7581
|
});
|
7423
|
-
var commentActivityContract =
|
7582
|
+
var commentActivityContract = initContract41().router({
|
7424
7583
|
comment: commentContract,
|
7425
7584
|
activityLog: activityLogContract
|
7426
7585
|
});
|
7427
|
-
var platformContract =
|
7586
|
+
var platformContract = initContract41().router({
|
7428
7587
|
line: lineContract,
|
7429
7588
|
messenger: messengerContract,
|
7430
7589
|
instagram: instagramContract,
|
7431
|
-
viber: viberContract
|
7590
|
+
viber: viberContract,
|
7591
|
+
webchat: webchatContract
|
7432
7592
|
});
|
7433
|
-
var chatContract =
|
7593
|
+
var chatContract = initContract41().router({
|
7434
7594
|
main: mainChatContract
|
7435
7595
|
});
|
7436
|
-
var telephonyContract =
|
7596
|
+
var telephonyContract = initContract41().router({
|
7437
7597
|
telephonyCdr: telephonyCdrContract
|
7438
7598
|
});
|
7439
|
-
var notificationContract =
|
7599
|
+
var notificationContract = initContract41().router({
|
7440
7600
|
notification: userNotificationContract
|
7441
7601
|
});
|
7442
|
-
var publicApiContract2 =
|
7602
|
+
var publicApiContract2 = initContract41().router({
|
7443
7603
|
publicApi: publicApiContract
|
7444
7604
|
});
|
7445
7605
|
export {
|