@kl1/contracts 1.1.23-uat → 1.1.24-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 +393 -234
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +393 -234
- 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 +13302 -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/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"
|
@@ -6871,69 +6965,133 @@ var userNotificationContract = initContract37().router(
|
|
6871
6965
|
}
|
6872
6966
|
);
|
6873
6967
|
|
6874
|
-
// src/
|
6968
|
+
// src/webchat/index.ts
|
6875
6969
|
import { initContract as initContract38 } from "@ts-rest/core";
|
6876
|
-
import { z as z101 } from "zod";
|
6877
6970
|
|
6878
|
-
// src/
|
6971
|
+
// src/webchat/schema.ts
|
6972
|
+
import z100 from "zod";
|
6973
|
+
|
6974
|
+
// src/webchat/validation.ts
|
6879
6975
|
import z99 from "zod";
|
6880
|
-
var
|
6976
|
+
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
6977
|
+
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
6978
|
+
return ChatwootChannelType3;
|
6979
|
+
})(ChatwootChannelType2 || {});
|
6980
|
+
var WebChatChannelSchema = z99.object({
|
6981
|
+
avatar: z99.string().optional(),
|
6881
6982
|
name: z99.string(),
|
6882
|
-
|
6983
|
+
type: z99.nativeEnum(ChatwootChannelType2),
|
6984
|
+
websiteName: z99.string(),
|
6985
|
+
welcomeTitle: z99.string(),
|
6986
|
+
websiteUrl: z99.string().url(),
|
6987
|
+
welcomeTagline: z99.string().optional(),
|
6988
|
+
agentAwayMessage: z99.string().optional(),
|
6989
|
+
widgetColor: z99.string().optional()
|
6990
|
+
});
|
6991
|
+
|
6992
|
+
// src/webchat/schema.ts
|
6993
|
+
var ConnectWebChatChannelSchema = z100.object({
|
6994
|
+
name: z100.string(),
|
6995
|
+
actor: z100.object({
|
6996
|
+
id: z100.string().uuid(),
|
6997
|
+
name: z100.string(),
|
6998
|
+
email: z100.string().email(),
|
6999
|
+
address: z100.string().nullable(),
|
7000
|
+
phone: z100.string().nullable()
|
7001
|
+
}),
|
7002
|
+
channel: WebChatChannelSchema
|
7003
|
+
});
|
7004
|
+
|
7005
|
+
// src/webchat/index.ts
|
7006
|
+
var webchatContract = initContract38().router({
|
7007
|
+
sendMessage: {
|
7008
|
+
method: "POST",
|
7009
|
+
path: "/message",
|
7010
|
+
body: SendMessageToPlatformSchema,
|
7011
|
+
responses: {
|
7012
|
+
200: SendMessageResponseSchema,
|
7013
|
+
400: DefaultErrorResponseSchema,
|
7014
|
+
500: DefaultErrorResponseSchema
|
7015
|
+
}
|
7016
|
+
},
|
7017
|
+
connect: {
|
7018
|
+
method: "POST",
|
7019
|
+
path: "/connect",
|
7020
|
+
summary: "Connect to a webchat channel",
|
7021
|
+
responses: {
|
7022
|
+
200: DefaultSuccessResponseSchema.extend({
|
7023
|
+
channel: ChannelSchema
|
7024
|
+
}),
|
7025
|
+
400: DefaultErrorResponseSchema,
|
7026
|
+
500: DefaultErrorResponseSchema
|
7027
|
+
},
|
7028
|
+
body: ConnectWebChatChannelSchema
|
7029
|
+
}
|
7030
|
+
});
|
7031
|
+
|
7032
|
+
// src/snippet/index.ts
|
7033
|
+
import { initContract as initContract39 } from "@ts-rest/core";
|
7034
|
+
import { z as z103 } from "zod";
|
7035
|
+
|
7036
|
+
// src/snippet/schema.ts
|
7037
|
+
import z101 from "zod";
|
7038
|
+
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7039
|
+
name: z101.string(),
|
7040
|
+
platformType: z101.string()
|
6883
7041
|
});
|
6884
7042
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
6885
|
-
contentType:
|
6886
|
-
contentValue:
|
6887
|
-
contentTemplate:
|
6888
|
-
order:
|
7043
|
+
contentType: z101.string(),
|
7044
|
+
contentValue: z101.string().nullable(),
|
7045
|
+
contentTemplate: z101.any().nullable(),
|
7046
|
+
order: z101.number(),
|
6889
7047
|
upload: UploadSchema.optional().nullable()
|
6890
7048
|
});
|
6891
7049
|
var SnippetSchema = DefaultEntitySchema.extend({
|
6892
|
-
name:
|
7050
|
+
name: z101.string(),
|
6893
7051
|
snippetGroup: SnippetGroupSchema,
|
6894
7052
|
snippetContent: SnippetContentSchema
|
6895
7053
|
});
|
6896
|
-
var SnippetGroupListItemSchema =
|
6897
|
-
id:
|
6898
|
-
name:
|
7054
|
+
var SnippetGroupListItemSchema = z101.object({
|
7055
|
+
id: z101.string().uuid(),
|
7056
|
+
name: z101.string()
|
6899
7057
|
});
|
6900
|
-
var SnippetListItemSchema =
|
6901
|
-
id:
|
6902
|
-
shortCutName:
|
6903
|
-
contentType:
|
6904
|
-
contentValue:
|
6905
|
-
snippetGroupId:
|
7058
|
+
var SnippetListItemSchema = z101.object({
|
7059
|
+
id: z101.string().uuid(),
|
7060
|
+
shortCutName: z101.string(),
|
7061
|
+
contentType: z101.string(),
|
7062
|
+
contentValue: z101.string().nullable(),
|
7063
|
+
snippetGroupId: z101.string()
|
6906
7064
|
});
|
6907
7065
|
|
6908
7066
|
// src/snippet/validation.ts
|
6909
|
-
import { z as
|
6910
|
-
var CreateSnippetGroupSchema =
|
6911
|
-
name:
|
6912
|
-
platformType:
|
7067
|
+
import { z as z102 } from "zod";
|
7068
|
+
var CreateSnippetGroupSchema = z102.object({
|
7069
|
+
name: z102.string(),
|
7070
|
+
platformType: z102.string()
|
6913
7071
|
});
|
6914
|
-
var UpdateSnippetGroupSchema =
|
6915
|
-
name:
|
6916
|
-
platformType:
|
7072
|
+
var UpdateSnippetGroupSchema = z102.object({
|
7073
|
+
name: z102.string().optional(),
|
7074
|
+
platformType: z102.string().optional()
|
6917
7075
|
});
|
6918
|
-
var DeleteSnippetGroupSchema =
|
6919
|
-
id:
|
7076
|
+
var DeleteSnippetGroupSchema = z102.object({
|
7077
|
+
id: z102.string()
|
6920
7078
|
});
|
6921
|
-
var CreateSnippetSchema =
|
6922
|
-
shortcutName:
|
6923
|
-
contentType:
|
6924
|
-
contentValue:
|
6925
|
-
snippetGroupId:
|
6926
|
-
platformType:
|
7079
|
+
var CreateSnippetSchema = z102.object({
|
7080
|
+
shortcutName: z102.string(),
|
7081
|
+
contentType: z102.string(),
|
7082
|
+
contentValue: z102.string().optional(),
|
7083
|
+
snippetGroupId: z102.string(),
|
7084
|
+
platformType: z102.string()
|
6927
7085
|
});
|
6928
7086
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
6929
|
-
snippetContentId:
|
7087
|
+
snippetContentId: z102.string()
|
6930
7088
|
});
|
6931
|
-
var DeleteSnippetSchema =
|
6932
|
-
snippetId:
|
7089
|
+
var DeleteSnippetSchema = z102.object({
|
7090
|
+
snippetId: z102.string()
|
6933
7091
|
});
|
6934
7092
|
|
6935
7093
|
// src/snippet/index.ts
|
6936
|
-
var snippetContract =
|
7094
|
+
var snippetContract = initContract39().router(
|
6937
7095
|
{
|
6938
7096
|
createSnippetGroup: {
|
6939
7097
|
method: "POST",
|
@@ -6952,7 +7110,7 @@ var snippetContract = initContract38().router(
|
|
6952
7110
|
query: null,
|
6953
7111
|
responses: {
|
6954
7112
|
200: DefaultSuccessResponseSchema.extend({
|
6955
|
-
snippetgroups:
|
7113
|
+
snippetgroups: z103.array(SnippetGroupSchema)
|
6956
7114
|
}),
|
6957
7115
|
500: DefaultErrorResponseSchema
|
6958
7116
|
}
|
@@ -6960,7 +7118,7 @@ var snippetContract = initContract38().router(
|
|
6960
7118
|
updateSnippetGroup: {
|
6961
7119
|
method: "PATCH",
|
6962
7120
|
path: "/groups/:id",
|
6963
|
-
pathParams:
|
7121
|
+
pathParams: z103.object({ id: z103.string() }),
|
6964
7122
|
body: UpdateSnippetGroupSchema,
|
6965
7123
|
responses: {
|
6966
7124
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6972,7 +7130,7 @@ var snippetContract = initContract38().router(
|
|
6972
7130
|
deleteSnippetGroup: {
|
6973
7131
|
method: "DELETE",
|
6974
7132
|
path: "/groups/:id",
|
6975
|
-
pathParams:
|
7133
|
+
pathParams: z103.object({ id: z103.string() }),
|
6976
7134
|
body: null,
|
6977
7135
|
responses: {
|
6978
7136
|
200: DefaultSuccessResponseSchema,
|
@@ -6984,7 +7142,7 @@ var snippetContract = initContract38().router(
|
|
6984
7142
|
path: "",
|
6985
7143
|
responses: {
|
6986
7144
|
200: DefaultSuccessResponseSchema.extend({
|
6987
|
-
snippets:
|
7145
|
+
snippets: z103.array(SnippetSchema)
|
6988
7146
|
}),
|
6989
7147
|
500: DefaultErrorResponseSchema
|
6990
7148
|
}
|
@@ -7003,7 +7161,7 @@ var snippetContract = initContract38().router(
|
|
7003
7161
|
updateSnippet: {
|
7004
7162
|
method: "PATCH",
|
7005
7163
|
path: "/:id",
|
7006
|
-
pathParams:
|
7164
|
+
pathParams: z103.object({ id: z103.string() }),
|
7007
7165
|
body: UpdateSnippetSchema,
|
7008
7166
|
responses: {
|
7009
7167
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7015,7 +7173,7 @@ var snippetContract = initContract38().router(
|
|
7015
7173
|
deleteSnippet: {
|
7016
7174
|
method: "DELETE",
|
7017
7175
|
path: "/:id",
|
7018
|
-
pathParams:
|
7176
|
+
pathParams: z103.object({ id: z103.string() }),
|
7019
7177
|
body: null,
|
7020
7178
|
responses: {
|
7021
7179
|
200: DefaultSuccessResponseSchema,
|
@@ -7029,169 +7187,169 @@ var snippetContract = initContract38().router(
|
|
7029
7187
|
);
|
7030
7188
|
|
7031
7189
|
// src/public-api/index.ts
|
7032
|
-
import { initContract as
|
7033
|
-
import
|
7190
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
7191
|
+
import z106 from "zod";
|
7034
7192
|
|
7035
7193
|
// src/public-api/validation.ts
|
7036
|
-
import
|
7194
|
+
import z105 from "zod";
|
7037
7195
|
|
7038
7196
|
// 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:
|
7197
|
+
import z104 from "zod";
|
7198
|
+
var ContactPhonesSchema2 = z104.object({
|
7199
|
+
id: z104.string().uuid(),
|
7200
|
+
createdAt: z104.date(),
|
7201
|
+
updatedAt: z104.date(),
|
7202
|
+
deletedAt: z104.date().nullable(),
|
7203
|
+
phone: z104.string(),
|
7204
|
+
isPrimary: z104.boolean()
|
7205
|
+
});
|
7206
|
+
var ContactEmailsSchema2 = z104.object({
|
7207
|
+
id: z104.string().uuid(),
|
7208
|
+
createdAt: z104.date(),
|
7209
|
+
updatedAt: z104.date(),
|
7210
|
+
deletedAt: z104.date().nullable(),
|
7211
|
+
email: z104.string(),
|
7212
|
+
isPrimary: z104.boolean()
|
7213
|
+
});
|
7214
|
+
var ContactCustomFieldSchema2 = z104.object({
|
7215
|
+
id: z104.string().uuid(),
|
7216
|
+
createdAt: z104.date(),
|
7217
|
+
updatedAt: z104.date(),
|
7218
|
+
deletedAt: z104.date().nullable(),
|
7219
|
+
textValue: z104.string().nullable(),
|
7220
|
+
booleanValue: z104.boolean().nullable(),
|
7221
|
+
numberValue: z104.number().nullable(),
|
7222
|
+
dateValue: z104.date().nullable(),
|
7065
7223
|
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:
|
7224
|
+
uploads: z104.array(UploadSchema)
|
7225
|
+
});
|
7226
|
+
var ContactEntityTypesSchema2 = z104.object({
|
7227
|
+
id: z104.string().uuid(),
|
7228
|
+
createdAt: z104.date(),
|
7229
|
+
updatedAt: z104.date(),
|
7230
|
+
deletedAt: z104.date().nullable(),
|
7231
|
+
entity: z104.string(),
|
7232
|
+
description: z104.string().nullable()
|
7233
|
+
});
|
7234
|
+
var ContactActivitySchema2 = z104.object({
|
7235
|
+
id: z104.string().uuid(),
|
7236
|
+
createdAt: z104.date(),
|
7237
|
+
updatedAt: z104.date(),
|
7238
|
+
deletedAt: z104.date().nullable(),
|
7239
|
+
entityId: z104.string(),
|
7240
|
+
description: z104.string(),
|
7083
7241
|
entityType: ContactEntityTypesSchema2
|
7084
7242
|
});
|
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:
|
7243
|
+
var ContactSchema2 = z104.object({
|
7244
|
+
id: z104.string().uuid(),
|
7245
|
+
createdAt: z104.date(),
|
7246
|
+
updatedAt: z104.date(),
|
7247
|
+
deletedAt: z104.date().nullable(),
|
7248
|
+
name: z104.string(),
|
7249
|
+
address: z104.string().nullable(),
|
7250
|
+
channel: z104.string().nullable(),
|
7251
|
+
notes: z104.string().nullable(),
|
7252
|
+
contactProfile: z104.string().nullable(),
|
7253
|
+
socialProfileUrl: z104.string().nullable(),
|
7254
|
+
tags: z104.array(TagSchema),
|
7097
7255
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
7098
|
-
customFields:
|
7099
|
-
contactEmails:
|
7100
|
-
contactPhones:
|
7101
|
-
activityLogs:
|
7256
|
+
customFields: z104.array(ContactCustomFieldSchema2),
|
7257
|
+
contactEmails: z104.array(ContactEmailsSchema2),
|
7258
|
+
contactPhones: z104.array(ContactPhonesSchema2),
|
7259
|
+
activityLogs: z104.array(ContactActivitySchema2).optional()
|
7102
7260
|
});
|
7103
7261
|
|
7104
7262
|
// src/public-api/validation.ts
|
7105
7263
|
var ContactContractValidationSchema2 = {
|
7106
7264
|
create: {
|
7107
|
-
request:
|
7108
|
-
name:
|
7109
|
-
email:
|
7110
|
-
|
7111
|
-
email:
|
7112
|
-
isPrimary:
|
7265
|
+
request: z105.object({
|
7266
|
+
name: z105.string(),
|
7267
|
+
email: z105.array(
|
7268
|
+
z105.object({
|
7269
|
+
email: z105.string().email(),
|
7270
|
+
isPrimary: z105.boolean()
|
7113
7271
|
})
|
7114
7272
|
).optional(),
|
7115
|
-
channel:
|
7116
|
-
address:
|
7117
|
-
phone:
|
7118
|
-
|
7119
|
-
phone:
|
7120
|
-
isPrimary:
|
7273
|
+
channel: z105.string().optional(),
|
7274
|
+
address: z105.string().optional(),
|
7275
|
+
phone: z105.array(
|
7276
|
+
z105.object({
|
7277
|
+
phone: z105.string(),
|
7278
|
+
isPrimary: z105.boolean()
|
7121
7279
|
})
|
7122
7280
|
).optional(),
|
7123
|
-
notes:
|
7124
|
-
tags:
|
7125
|
-
company:
|
7126
|
-
customFields:
|
7281
|
+
notes: z105.string().optional(),
|
7282
|
+
tags: z105.array(z105.string()).optional(),
|
7283
|
+
company: z105.string().optional(),
|
7284
|
+
customFields: z105.record(z105.string())
|
7127
7285
|
// Dynamic keys with string values
|
7128
7286
|
}),
|
7129
7287
|
response: ContactSchema2
|
7130
7288
|
},
|
7131
7289
|
getById: {
|
7132
|
-
request:
|
7133
|
-
id:
|
7290
|
+
request: z105.object({
|
7291
|
+
id: z105.string().uuid()
|
7134
7292
|
})
|
7135
7293
|
},
|
7136
7294
|
delete: {
|
7137
|
-
request:
|
7138
|
-
id:
|
7295
|
+
request: z105.object({
|
7296
|
+
id: z105.string().uuid()
|
7139
7297
|
})
|
7140
7298
|
},
|
7141
7299
|
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:
|
7300
|
+
request: z105.object({
|
7301
|
+
page: z105.coerce.number().default(1),
|
7302
|
+
pageSize: z105.coerce.number().default(10),
|
7303
|
+
keyword: z105.string().optional(),
|
7304
|
+
company: z105.array(z105.string().uuid()),
|
7305
|
+
name: z105.string(),
|
7306
|
+
address: z105.string(),
|
7307
|
+
channel: z105.array(z105.string()),
|
7308
|
+
selectedDate: z105.string(),
|
7309
|
+
customFields: z105.array(
|
7310
|
+
z105.object({
|
7311
|
+
attributeId: z105.string().uuid(),
|
7312
|
+
type: z105.string(),
|
7313
|
+
value: z105.union([z105.string(), z105.array(z105.string())])
|
7156
7314
|
})
|
7157
7315
|
),
|
7158
|
-
tags:
|
7159
|
-
phone:
|
7160
|
-
email:
|
7161
|
-
notes:
|
7316
|
+
tags: z105.array(z105.string().uuid()),
|
7317
|
+
phone: z105.string(),
|
7318
|
+
email: z105.string(),
|
7319
|
+
notes: z105.string()
|
7162
7320
|
}).partial(),
|
7163
7321
|
response: {
|
7164
|
-
page:
|
7165
|
-
pageSize:
|
7166
|
-
total:
|
7167
|
-
lastPage:
|
7168
|
-
data:
|
7322
|
+
page: z105.number(),
|
7323
|
+
pageSize: z105.number(),
|
7324
|
+
total: z105.number(),
|
7325
|
+
lastPage: z105.number(),
|
7326
|
+
data: z105.array(ContactSchema2)
|
7169
7327
|
}
|
7170
7328
|
},
|
7171
7329
|
getContactFields: {
|
7172
|
-
request:
|
7173
|
-
page:
|
7174
|
-
pageSize:
|
7330
|
+
request: z105.object({
|
7331
|
+
page: z105.coerce.number().default(1),
|
7332
|
+
pageSize: z105.coerce.number().default(10)
|
7175
7333
|
}).partial(),
|
7176
7334
|
response: {
|
7177
|
-
page:
|
7178
|
-
pageSize:
|
7179
|
-
total:
|
7180
|
-
lastPage:
|
7181
|
-
data:
|
7335
|
+
page: z105.number(),
|
7336
|
+
pageSize: z105.number(),
|
7337
|
+
total: z105.number(),
|
7338
|
+
lastPage: z105.number(),
|
7339
|
+
data: z105.array(ContactCustomFieldSchema2)
|
7182
7340
|
}
|
7183
7341
|
},
|
7184
7342
|
addAttachments: {
|
7185
|
-
request:
|
7186
|
-
contactId:
|
7187
|
-
attributeId:
|
7188
|
-
contactAttachmentRecords:
|
7189
|
-
|
7190
|
-
bucketName:
|
7191
|
-
fileKey:
|
7192
|
-
fileName:
|
7193
|
-
fileSize:
|
7194
|
-
url:
|
7343
|
+
request: z105.object({
|
7344
|
+
contactId: z105.string(),
|
7345
|
+
attributeId: z105.string().uuid(),
|
7346
|
+
contactAttachmentRecords: z105.array(
|
7347
|
+
z105.object({
|
7348
|
+
bucketName: z105.string(),
|
7349
|
+
fileKey: z105.string(),
|
7350
|
+
fileName: z105.string(),
|
7351
|
+
fileSize: z105.coerce.number(),
|
7352
|
+
url: z105.string()
|
7195
7353
|
})
|
7196
7354
|
)
|
7197
7355
|
}),
|
@@ -7200,7 +7358,7 @@ var ContactContractValidationSchema2 = {
|
|
7200
7358
|
};
|
7201
7359
|
|
7202
7360
|
// src/public-api/index.ts
|
7203
|
-
var publicApiContract =
|
7361
|
+
var publicApiContract = initContract40().router(
|
7204
7362
|
{
|
7205
7363
|
createContact: {
|
7206
7364
|
method: "POST",
|
@@ -7210,11 +7368,11 @@ var publicApiContract = initContract39().router(
|
|
7210
7368
|
201: DefaultSuccessResponseSchema.extend({
|
7211
7369
|
data: ContactSchema2
|
7212
7370
|
}),
|
7213
|
-
400:
|
7214
|
-
message:
|
7371
|
+
400: z106.object({
|
7372
|
+
message: z106.string()
|
7215
7373
|
}),
|
7216
|
-
409:
|
7217
|
-
message:
|
7374
|
+
409: z106.object({
|
7375
|
+
message: z106.string()
|
7218
7376
|
}),
|
7219
7377
|
401: DefaultUnauthorizedSchema,
|
7220
7378
|
404: DefaultNotFoundSchema,
|
@@ -7229,13 +7387,13 @@ var publicApiContract = initContract39().router(
|
|
7229
7387
|
query: GetTagsSchema,
|
7230
7388
|
responses: {
|
7231
7389
|
200: DefaultSuccessResponseSchema.extend({
|
7232
|
-
tags:
|
7390
|
+
tags: z106.array(TagSchema)
|
7233
7391
|
}),
|
7234
|
-
400:
|
7235
|
-
message:
|
7392
|
+
400: z106.object({
|
7393
|
+
message: z106.string()
|
7236
7394
|
}),
|
7237
|
-
409:
|
7238
|
-
message:
|
7395
|
+
409: z106.object({
|
7396
|
+
message: z106.string()
|
7239
7397
|
}),
|
7240
7398
|
401: DefaultUnauthorizedSchema,
|
7241
7399
|
404: DefaultNotFoundSchema,
|
@@ -7251,11 +7409,11 @@ var publicApiContract = initContract39().router(
|
|
7251
7409
|
200: DefaultSuccessResponseSchema.extend(
|
7252
7410
|
ContactContractValidationSchema2.getAll.response
|
7253
7411
|
),
|
7254
|
-
400:
|
7255
|
-
message:
|
7412
|
+
400: z106.object({
|
7413
|
+
message: z106.string()
|
7256
7414
|
}),
|
7257
|
-
409:
|
7258
|
-
message:
|
7415
|
+
409: z106.object({
|
7416
|
+
message: z106.string()
|
7259
7417
|
}),
|
7260
7418
|
401: DefaultUnauthorizedSchema,
|
7261
7419
|
404: DefaultNotFoundSchema,
|
@@ -7272,11 +7430,11 @@ var publicApiContract = initContract39().router(
|
|
7272
7430
|
200: DefaultSuccessResponseSchema.extend(
|
7273
7431
|
ContactContractValidationSchema2.getContactFields.response
|
7274
7432
|
),
|
7275
|
-
400:
|
7276
|
-
message:
|
7433
|
+
400: z106.object({
|
7434
|
+
message: z106.string()
|
7277
7435
|
}),
|
7278
|
-
409:
|
7279
|
-
message:
|
7436
|
+
409: z106.object({
|
7437
|
+
message: z106.string()
|
7280
7438
|
}),
|
7281
7439
|
401: DefaultUnauthorizedSchema,
|
7282
7440
|
404: DefaultNotFoundSchema,
|
@@ -7290,17 +7448,17 @@ var publicApiContract = initContract39().router(
|
|
7290
7448
|
path: "/contacts/:id",
|
7291
7449
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7292
7450
|
responses: {
|
7293
|
-
200:
|
7294
|
-
status:
|
7295
|
-
message:
|
7451
|
+
200: z106.object({
|
7452
|
+
status: z106.string(),
|
7453
|
+
message: z106.string(),
|
7296
7454
|
data: ContactSchema2,
|
7297
|
-
requestId:
|
7455
|
+
requestId: z106.string()
|
7298
7456
|
}),
|
7299
|
-
400:
|
7300
|
-
message:
|
7457
|
+
400: z106.object({
|
7458
|
+
message: z106.string()
|
7301
7459
|
}),
|
7302
|
-
409:
|
7303
|
-
message:
|
7460
|
+
409: z106.object({
|
7461
|
+
message: z106.string()
|
7304
7462
|
}),
|
7305
7463
|
401: DefaultUnauthorizedSchema,
|
7306
7464
|
404: DefaultNotFoundSchema,
|
@@ -7318,11 +7476,11 @@ var publicApiContract = initContract39().router(
|
|
7318
7476
|
201: DefaultSuccessResponseSchema.extend({
|
7319
7477
|
message: ContactCustomFieldSchema2
|
7320
7478
|
}),
|
7321
|
-
400:
|
7322
|
-
message:
|
7479
|
+
400: z106.object({
|
7480
|
+
message: z106.string()
|
7323
7481
|
}),
|
7324
|
-
409:
|
7325
|
-
message:
|
7482
|
+
409: z106.object({
|
7483
|
+
message: z106.string()
|
7326
7484
|
}),
|
7327
7485
|
401: DefaultUnauthorizedSchema,
|
7328
7486
|
404: DefaultNotFoundSchema,
|
@@ -7336,17 +7494,17 @@ var publicApiContract = initContract39().router(
|
|
7336
7494
|
path: "/contacts/:id",
|
7337
7495
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7338
7496
|
responses: {
|
7339
|
-
200:
|
7340
|
-
status:
|
7341
|
-
message:
|
7497
|
+
200: z106.object({
|
7498
|
+
status: z106.string(),
|
7499
|
+
message: z106.string(),
|
7342
7500
|
data: ContactSchema2,
|
7343
|
-
requestId:
|
7501
|
+
requestId: z106.string()
|
7344
7502
|
}),
|
7345
|
-
400:
|
7346
|
-
message:
|
7503
|
+
400: z106.object({
|
7504
|
+
message: z106.string()
|
7347
7505
|
}),
|
7348
|
-
409:
|
7349
|
-
message:
|
7506
|
+
409: z106.object({
|
7507
|
+
message: z106.string()
|
7350
7508
|
}),
|
7351
7509
|
401: DefaultUnauthorizedSchema,
|
7352
7510
|
404: DefaultNotFoundSchema,
|
@@ -7360,17 +7518,17 @@ var publicApiContract = initContract39().router(
|
|
7360
7518
|
path: "/contacts/:id",
|
7361
7519
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7362
7520
|
responses: {
|
7363
|
-
200:
|
7364
|
-
status:
|
7365
|
-
message:
|
7521
|
+
200: z106.object({
|
7522
|
+
status: z106.string(),
|
7523
|
+
message: z106.string(),
|
7366
7524
|
data: ContactSchema2,
|
7367
|
-
requestId:
|
7525
|
+
requestId: z106.string()
|
7368
7526
|
}),
|
7369
|
-
400:
|
7370
|
-
message:
|
7527
|
+
400: z106.object({
|
7528
|
+
message: z106.string()
|
7371
7529
|
}),
|
7372
|
-
409:
|
7373
|
-
message:
|
7530
|
+
409: z106.object({
|
7531
|
+
message: z106.string()
|
7374
7532
|
}),
|
7375
7533
|
401: DefaultUnauthorizedSchema,
|
7376
7534
|
404: DefaultNotFoundSchema,
|
@@ -7387,7 +7545,7 @@ var publicApiContract = initContract39().router(
|
|
7387
7545
|
);
|
7388
7546
|
|
7389
7547
|
// src/contract.ts
|
7390
|
-
var apiContract =
|
7548
|
+
var apiContract = initContract41().router({
|
7391
7549
|
auth: authContract,
|
7392
7550
|
mail: mailContract,
|
7393
7551
|
cxLog: cxLogContract,
|
@@ -7411,35 +7569,36 @@ var apiContract = initContract40().router({
|
|
7411
7569
|
upload: uploadContract,
|
7412
7570
|
snippet: snippetContract
|
7413
7571
|
});
|
7414
|
-
var contactContract2 =
|
7572
|
+
var contactContract2 = initContract41().router({
|
7415
7573
|
contact: contactContract
|
7416
7574
|
});
|
7417
|
-
var ticketContract2 =
|
7575
|
+
var ticketContract2 = initContract41().router({
|
7418
7576
|
ticket: ticketContract
|
7419
7577
|
});
|
7420
|
-
var extensionContract2 =
|
7578
|
+
var extensionContract2 = initContract41().router({
|
7421
7579
|
extension: extensionContract
|
7422
7580
|
});
|
7423
|
-
var commentActivityContract =
|
7581
|
+
var commentActivityContract = initContract41().router({
|
7424
7582
|
comment: commentContract,
|
7425
7583
|
activityLog: activityLogContract
|
7426
7584
|
});
|
7427
|
-
var platformContract =
|
7585
|
+
var platformContract = initContract41().router({
|
7428
7586
|
line: lineContract,
|
7429
7587
|
messenger: messengerContract,
|
7430
7588
|
instagram: instagramContract,
|
7431
|
-
viber: viberContract
|
7589
|
+
viber: viberContract,
|
7590
|
+
webchat: webchatContract
|
7432
7591
|
});
|
7433
|
-
var chatContract =
|
7592
|
+
var chatContract = initContract41().router({
|
7434
7593
|
main: mainChatContract
|
7435
7594
|
});
|
7436
|
-
var telephonyContract =
|
7595
|
+
var telephonyContract = initContract41().router({
|
7437
7596
|
telephonyCdr: telephonyCdrContract
|
7438
7597
|
});
|
7439
|
-
var notificationContract =
|
7598
|
+
var notificationContract = initContract41().router({
|
7440
7599
|
notification: userNotificationContract
|
7441
7600
|
});
|
7442
|
-
var publicApiContract2 =
|
7601
|
+
var publicApiContract2 = initContract41().router({
|
7443
7602
|
publicApi: publicApiContract
|
7444
7603
|
});
|
7445
7604
|
export {
|