@kl1/contracts 1.1.23-uat → 1.1.23
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 +367 -238
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +367 -238
- package/dist/index.mjs.map +1 -1
- package/dist/src/business-calendar/index.d.ts +799 -0
- package/dist/src/business-calendar/index.d.ts.map +1 -0
- package/dist/src/business-calendar/schema.d.ts +172 -0
- package/dist/src/business-calendar/schema.d.ts.map +1 -0
- package/dist/src/business-calendar/validation.d.ts +210 -0
- package/dist/src/business-calendar/validation.d.ts.map +1 -0
- 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 +5144 -299
- package/dist/src/chat/index.d.ts.map +1 -1
- package/dist/src/chat/schema.d.ts +807 -47
- package/dist/src/chat/schema.d.ts.map +1 -1
- package/dist/src/chat/validation.d.ts +1093 -118
- package/dist/src/chat/validation.d.ts.map +1 -1
- package/dist/src/contract.d.ts +19780 -2109
- package/dist/src/contract.d.ts.map +1 -1
- package/dist/src/cx-log/index.d.ts +376 -31
- package/dist/src/cx-log/index.d.ts.map +1 -1
- package/dist/src/cx-log/schema.d.ts +577 -27
- package/dist/src/cx-log/schema.d.ts.map +1 -1
- package/dist/src/instagram/index.d.ts +628 -138
- package/dist/src/instagram/index.d.ts.map +1 -1
- package/dist/src/line/index.d.ts +623 -133
- 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 +1407 -9
- package/dist/src/mail/mail-contract.d.ts.map +1 -1
- package/dist/src/mail/room-contract.d.ts +1251 -6
- package/dist/src/mail/room-contract.d.ts.map +1 -1
- package/dist/src/mail/schemas/room-validation.schema.d.ts +417 -2
- package/dist/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
- package/dist/src/mail/schemas/room.schema.d.ts +347 -2
- package/dist/src/mail/schemas/room.schema.d.ts.map +1 -1
- package/dist/src/messenger/index.d.ts +628 -138
- 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 +592 -102
- package/dist/src/viber/index.d.ts.map +1 -1
- package/dist/src/webchat/index.d.ts +8506 -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/workflow-rule/index.d.ts +7295 -0
- package/dist/src/workflow-rule/index.d.ts.map +1 -0
- package/dist/src/workflow-rule/schema.d.ts +27 -0
- package/dist/src/workflow-rule/schema.d.ts.map +1 -0
- package/dist/src/wrap-up-form/index.d.ts +1000 -6
- package/dist/src/wrap-up-form/index.d.ts.map +1 -1
- package/dist/src/wrap-up-form/schema.d.ts +207 -2
- package/dist/src/wrap-up-form/schema.d.ts.map +1 -1
- package/dist/src/wrap-up-form/validation.d.ts +29 -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
|
});
|
@@ -986,12 +988,27 @@ var TelephonyDropdownListSchema = z23.object({
|
|
986
988
|
|
987
989
|
// src/wrap-up-form/schema.ts
|
988
990
|
import z24 from "zod";
|
991
|
+
var CustomFieldSchema = z24.object({
|
992
|
+
id: z24.string().uuid(),
|
993
|
+
createdAt: z24.date(),
|
994
|
+
updatedAt: z24.date(),
|
995
|
+
deletedAt: z24.date().nullable(),
|
996
|
+
textValue: z24.string().nullable(),
|
997
|
+
booleanValue: z24.boolean().nullable(),
|
998
|
+
numberValue: z24.number().nullable(),
|
999
|
+
dateValue: z24.date().nullable(),
|
1000
|
+
entityId: z24.string().uuid(),
|
1001
|
+
attributeId: z24.string().uuid()
|
1002
|
+
});
|
989
1003
|
var WrapUpFormSchema = DefaultEntitySchema.extend({
|
990
1004
|
note: z24.string().nullable(),
|
991
1005
|
disposition: z24.string().nullable(),
|
1006
|
+
type: z24.string(),
|
1007
|
+
tags: z24.array(TagSchema),
|
1008
|
+
categories: z24.array(CategorySchema),
|
992
1009
|
callFrom: z24.string().nullable(),
|
993
1010
|
callTo: z24.string().nullable(),
|
994
|
-
|
1011
|
+
customFields: z24.array(CustomFieldSchema).optional().nullable()
|
995
1012
|
});
|
996
1013
|
|
997
1014
|
// src/cx-log/schema.ts
|
@@ -1339,7 +1356,7 @@ import z29 from "zod";
|
|
1339
1356
|
|
1340
1357
|
// src/custom-field/schema.ts
|
1341
1358
|
import z28 from "zod";
|
1342
|
-
var
|
1359
|
+
var CustomFieldSchema2 = DefaultEntitySchema.extend({
|
1343
1360
|
textValue: z28.string().nullable(),
|
1344
1361
|
booleanValue: z28.boolean().nullable(),
|
1345
1362
|
numberValue: z28.number().nullable(),
|
@@ -1363,7 +1380,7 @@ var GetRoomsSchema = z29.object({
|
|
1363
1380
|
address: z29.string().optional(),
|
1364
1381
|
contactGroups: z29.string().array().optional(),
|
1365
1382
|
selectedDate: z29.string().optional(),
|
1366
|
-
customFields: z29.array(
|
1383
|
+
customFields: z29.array(CustomFieldSchema2).optional(),
|
1367
1384
|
tags: z29.string().array().optional(),
|
1368
1385
|
phone: z29.string().optional(),
|
1369
1386
|
email: z29.string().optional(),
|
@@ -1452,6 +1469,7 @@ var SendMessageToPlatformSchema = z29.object({
|
|
1452
1469
|
handleTime: z29.number().optional(),
|
1453
1470
|
isLatest: z29.boolean(),
|
1454
1471
|
direction: MessageDirectionTypeSchema,
|
1472
|
+
metadata: z29.any().optional(),
|
1455
1473
|
createdAt: z29.string(),
|
1456
1474
|
updatedAt: z29.string(),
|
1457
1475
|
platformContact: z29.object({
|
@@ -1687,6 +1705,24 @@ var ConnectViberChannelSchema = z30.object({
|
|
1687
1705
|
name: z30.string(),
|
1688
1706
|
accessToken: z30.string()
|
1689
1707
|
});
|
1708
|
+
var ChatwootChannelType = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
1709
|
+
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
1710
|
+
return ChatwootChannelType3;
|
1711
|
+
})(ChatwootChannelType || {});
|
1712
|
+
var ConnectWebChatSchema = z30.object({
|
1713
|
+
name: z30.string(),
|
1714
|
+
channel: z30.object({
|
1715
|
+
avatar: z30.string().optional(),
|
1716
|
+
name: z30.string(),
|
1717
|
+
type: z30.nativeEnum(ChatwootChannelType),
|
1718
|
+
websiteName: z30.string(),
|
1719
|
+
welcomeTitle: z30.string(),
|
1720
|
+
websiteUrl: z30.string().url(),
|
1721
|
+
welcomeTagline: z30.string().optional(),
|
1722
|
+
agentAwayMessage: z30.string().optional(),
|
1723
|
+
widgetColor: z30.string().optional()
|
1724
|
+
})
|
1725
|
+
});
|
1690
1726
|
var GetChannelSchema = z30.object({
|
1691
1727
|
withDeleted: z30.coerce.boolean().default(false)
|
1692
1728
|
});
|
@@ -1789,9 +1825,7 @@ var line = initContract6().router(
|
|
1789
1825
|
method: "POST",
|
1790
1826
|
path: "/connect",
|
1791
1827
|
responses: {
|
1792
|
-
200: DefaultSuccessResponseSchema
|
1793
|
-
channel: ChannelSchema
|
1794
|
-
}),
|
1828
|
+
200: DefaultSuccessResponseSchema,
|
1795
1829
|
408: DefaultErrorResponseSchema
|
1796
1830
|
},
|
1797
1831
|
body: ConnectLineChannelSchema,
|
@@ -1802,6 +1836,26 @@ var line = initContract6().router(
|
|
1802
1836
|
pathPrefix: "/line"
|
1803
1837
|
}
|
1804
1838
|
);
|
1839
|
+
var webchat = initContract6().router(
|
1840
|
+
{
|
1841
|
+
connect: {
|
1842
|
+
method: "POST",
|
1843
|
+
path: "/connect",
|
1844
|
+
responses: {
|
1845
|
+
200: DefaultSuccessResponseSchema.extend({
|
1846
|
+
channel: ChannelSchema
|
1847
|
+
}),
|
1848
|
+
408: DefaultErrorResponseSchema,
|
1849
|
+
400: DefaultErrorResponseSchema
|
1850
|
+
},
|
1851
|
+
body: ConnectWebChatSchema,
|
1852
|
+
summary: "Connect message channel"
|
1853
|
+
}
|
1854
|
+
},
|
1855
|
+
{
|
1856
|
+
pathPrefix: "/webchat"
|
1857
|
+
}
|
1858
|
+
);
|
1805
1859
|
var viber = initContract6().router(
|
1806
1860
|
{
|
1807
1861
|
connect: {
|
@@ -1912,7 +1966,8 @@ var channelContract = initContract6().router(
|
|
1912
1966
|
messenger,
|
1913
1967
|
line,
|
1914
1968
|
instagram,
|
1915
|
-
viber
|
1969
|
+
viber,
|
1970
|
+
webchat
|
1916
1971
|
},
|
1917
1972
|
{
|
1918
1973
|
baseHeaders: DefaultHeaderSchema,
|
@@ -2711,7 +2766,7 @@ var ContactContractValidationSchema = {
|
|
2711
2766
|
})
|
2712
2767
|
)
|
2713
2768
|
}),
|
2714
|
-
response:
|
2769
|
+
response: CustomFieldSchema2
|
2715
2770
|
}
|
2716
2771
|
};
|
2717
2772
|
|
@@ -4434,7 +4489,7 @@ var accountContract = initContract19().router(
|
|
4434
4489
|
responses: {
|
4435
4490
|
201: DefaultSuccessResponseSchema.extend({
|
4436
4491
|
// data: AccountContractsValidationSchemas.create.output,
|
4437
|
-
|
4492
|
+
data: MailAccountSchema
|
4438
4493
|
}),
|
4439
4494
|
400: z62.object({
|
4440
4495
|
message: z62.string()
|
@@ -6481,7 +6536,16 @@ var CreateWrapUpFormSchema = z91.object({
|
|
6481
6536
|
callTo: z91.string().nullable().optional()
|
6482
6537
|
});
|
6483
6538
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
6484
|
-
|
6539
|
+
type: z91.string().optional(),
|
6540
|
+
tags: z91.array(z91.string()).optional(),
|
6541
|
+
categoryIds: z91.array(z91.string().uuid()).optional(),
|
6542
|
+
customFields: z91.array(
|
6543
|
+
z91.object({
|
6544
|
+
id: z91.string().uuid(),
|
6545
|
+
type: z91.string(),
|
6546
|
+
value: z91.string()
|
6547
|
+
})
|
6548
|
+
).optional()
|
6485
6549
|
});
|
6486
6550
|
var CreateCXLogWrapUpFormSchema = z91.object({
|
6487
6551
|
cxLogId: z91.string().uuid(),
|
@@ -6871,69 +6935,133 @@ var userNotificationContract = initContract37().router(
|
|
6871
6935
|
}
|
6872
6936
|
);
|
6873
6937
|
|
6874
|
-
// src/
|
6938
|
+
// src/webchat/index.ts
|
6875
6939
|
import { initContract as initContract38 } from "@ts-rest/core";
|
6876
|
-
import { z as z101 } from "zod";
|
6877
6940
|
|
6878
|
-
// src/
|
6941
|
+
// src/webchat/schema.ts
|
6942
|
+
import z100 from "zod";
|
6943
|
+
|
6944
|
+
// src/webchat/validation.ts
|
6879
6945
|
import z99 from "zod";
|
6880
|
-
var
|
6946
|
+
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
6947
|
+
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
6948
|
+
return ChatwootChannelType3;
|
6949
|
+
})(ChatwootChannelType2 || {});
|
6950
|
+
var WebChatChannelSchema = z99.object({
|
6951
|
+
avatar: z99.string().optional(),
|
6881
6952
|
name: z99.string(),
|
6882
|
-
|
6953
|
+
type: z99.nativeEnum(ChatwootChannelType2),
|
6954
|
+
websiteName: z99.string(),
|
6955
|
+
welcomeTitle: z99.string(),
|
6956
|
+
websiteUrl: z99.string().url(),
|
6957
|
+
welcomeTagline: z99.string().optional(),
|
6958
|
+
agentAwayMessage: z99.string().optional(),
|
6959
|
+
widgetColor: z99.string().optional()
|
6960
|
+
});
|
6961
|
+
|
6962
|
+
// src/webchat/schema.ts
|
6963
|
+
var ConnectWebChatChannelSchema = z100.object({
|
6964
|
+
name: z100.string(),
|
6965
|
+
actor: z100.object({
|
6966
|
+
id: z100.string().uuid(),
|
6967
|
+
name: z100.string(),
|
6968
|
+
email: z100.string().email(),
|
6969
|
+
address: z100.string().nullable(),
|
6970
|
+
phone: z100.string().nullable()
|
6971
|
+
}),
|
6972
|
+
channel: WebChatChannelSchema
|
6973
|
+
});
|
6974
|
+
|
6975
|
+
// src/webchat/index.ts
|
6976
|
+
var webchatContract = initContract38().router({
|
6977
|
+
sendMessage: {
|
6978
|
+
method: "POST",
|
6979
|
+
path: "/message",
|
6980
|
+
body: SendMessageToPlatformSchema,
|
6981
|
+
responses: {
|
6982
|
+
200: SendMessageResponseSchema,
|
6983
|
+
400: DefaultErrorResponseSchema,
|
6984
|
+
500: DefaultErrorResponseSchema
|
6985
|
+
}
|
6986
|
+
},
|
6987
|
+
connect: {
|
6988
|
+
method: "POST",
|
6989
|
+
path: "/connect",
|
6990
|
+
summary: "Connect to a webchat channel",
|
6991
|
+
responses: {
|
6992
|
+
200: DefaultSuccessResponseSchema.extend({
|
6993
|
+
channel: ChannelSchema
|
6994
|
+
}),
|
6995
|
+
400: DefaultErrorResponseSchema,
|
6996
|
+
500: DefaultErrorResponseSchema
|
6997
|
+
},
|
6998
|
+
body: ConnectWebChatChannelSchema
|
6999
|
+
}
|
7000
|
+
});
|
7001
|
+
|
7002
|
+
// src/snippet/index.ts
|
7003
|
+
import { initContract as initContract39 } from "@ts-rest/core";
|
7004
|
+
import { z as z103 } from "zod";
|
7005
|
+
|
7006
|
+
// src/snippet/schema.ts
|
7007
|
+
import z101 from "zod";
|
7008
|
+
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7009
|
+
name: z101.string(),
|
7010
|
+
platformType: z101.string()
|
6883
7011
|
});
|
6884
7012
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
6885
|
-
contentType:
|
6886
|
-
contentValue:
|
6887
|
-
contentTemplate:
|
6888
|
-
order:
|
7013
|
+
contentType: z101.string(),
|
7014
|
+
contentValue: z101.string().nullable(),
|
7015
|
+
contentTemplate: z101.any().nullable(),
|
7016
|
+
order: z101.number(),
|
6889
7017
|
upload: UploadSchema.optional().nullable()
|
6890
7018
|
});
|
6891
7019
|
var SnippetSchema = DefaultEntitySchema.extend({
|
6892
|
-
name:
|
7020
|
+
name: z101.string(),
|
6893
7021
|
snippetGroup: SnippetGroupSchema,
|
6894
7022
|
snippetContent: SnippetContentSchema
|
6895
7023
|
});
|
6896
|
-
var SnippetGroupListItemSchema =
|
6897
|
-
id:
|
6898
|
-
name:
|
7024
|
+
var SnippetGroupListItemSchema = z101.object({
|
7025
|
+
id: z101.string().uuid(),
|
7026
|
+
name: z101.string()
|
6899
7027
|
});
|
6900
|
-
var SnippetListItemSchema =
|
6901
|
-
id:
|
6902
|
-
shortCutName:
|
6903
|
-
contentType:
|
6904
|
-
contentValue:
|
6905
|
-
snippetGroupId:
|
7028
|
+
var SnippetListItemSchema = z101.object({
|
7029
|
+
id: z101.string().uuid(),
|
7030
|
+
shortCutName: z101.string(),
|
7031
|
+
contentType: z101.string(),
|
7032
|
+
contentValue: z101.string().nullable(),
|
7033
|
+
snippetGroupId: z101.string()
|
6906
7034
|
});
|
6907
7035
|
|
6908
7036
|
// src/snippet/validation.ts
|
6909
|
-
import { z as
|
6910
|
-
var CreateSnippetGroupSchema =
|
6911
|
-
name:
|
6912
|
-
platformType:
|
7037
|
+
import { z as z102 } from "zod";
|
7038
|
+
var CreateSnippetGroupSchema = z102.object({
|
7039
|
+
name: z102.string(),
|
7040
|
+
platformType: z102.string()
|
6913
7041
|
});
|
6914
|
-
var UpdateSnippetGroupSchema =
|
6915
|
-
name:
|
6916
|
-
platformType:
|
7042
|
+
var UpdateSnippetGroupSchema = z102.object({
|
7043
|
+
name: z102.string().optional(),
|
7044
|
+
platformType: z102.string().optional()
|
6917
7045
|
});
|
6918
|
-
var DeleteSnippetGroupSchema =
|
6919
|
-
id:
|
7046
|
+
var DeleteSnippetGroupSchema = z102.object({
|
7047
|
+
id: z102.string()
|
6920
7048
|
});
|
6921
|
-
var CreateSnippetSchema =
|
6922
|
-
shortcutName:
|
6923
|
-
contentType:
|
6924
|
-
contentValue:
|
6925
|
-
snippetGroupId:
|
6926
|
-
platformType:
|
7049
|
+
var CreateSnippetSchema = z102.object({
|
7050
|
+
shortcutName: z102.string(),
|
7051
|
+
contentType: z102.string(),
|
7052
|
+
contentValue: z102.string().optional(),
|
7053
|
+
snippetGroupId: z102.string(),
|
7054
|
+
platformType: z102.string()
|
6927
7055
|
});
|
6928
7056
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
6929
|
-
snippetContentId:
|
7057
|
+
snippetContentId: z102.string()
|
6930
7058
|
});
|
6931
|
-
var DeleteSnippetSchema =
|
6932
|
-
snippetId:
|
7059
|
+
var DeleteSnippetSchema = z102.object({
|
7060
|
+
snippetId: z102.string()
|
6933
7061
|
});
|
6934
7062
|
|
6935
7063
|
// src/snippet/index.ts
|
6936
|
-
var snippetContract =
|
7064
|
+
var snippetContract = initContract39().router(
|
6937
7065
|
{
|
6938
7066
|
createSnippetGroup: {
|
6939
7067
|
method: "POST",
|
@@ -6952,7 +7080,7 @@ var snippetContract = initContract38().router(
|
|
6952
7080
|
query: null,
|
6953
7081
|
responses: {
|
6954
7082
|
200: DefaultSuccessResponseSchema.extend({
|
6955
|
-
snippetgroups:
|
7083
|
+
snippetgroups: z103.array(SnippetGroupSchema)
|
6956
7084
|
}),
|
6957
7085
|
500: DefaultErrorResponseSchema
|
6958
7086
|
}
|
@@ -6960,7 +7088,7 @@ var snippetContract = initContract38().router(
|
|
6960
7088
|
updateSnippetGroup: {
|
6961
7089
|
method: "PATCH",
|
6962
7090
|
path: "/groups/:id",
|
6963
|
-
pathParams:
|
7091
|
+
pathParams: z103.object({ id: z103.string() }),
|
6964
7092
|
body: UpdateSnippetGroupSchema,
|
6965
7093
|
responses: {
|
6966
7094
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -6972,7 +7100,7 @@ var snippetContract = initContract38().router(
|
|
6972
7100
|
deleteSnippetGroup: {
|
6973
7101
|
method: "DELETE",
|
6974
7102
|
path: "/groups/:id",
|
6975
|
-
pathParams:
|
7103
|
+
pathParams: z103.object({ id: z103.string() }),
|
6976
7104
|
body: null,
|
6977
7105
|
responses: {
|
6978
7106
|
200: DefaultSuccessResponseSchema,
|
@@ -6984,7 +7112,7 @@ var snippetContract = initContract38().router(
|
|
6984
7112
|
path: "",
|
6985
7113
|
responses: {
|
6986
7114
|
200: DefaultSuccessResponseSchema.extend({
|
6987
|
-
snippets:
|
7115
|
+
snippets: z103.array(SnippetSchema)
|
6988
7116
|
}),
|
6989
7117
|
500: DefaultErrorResponseSchema
|
6990
7118
|
}
|
@@ -7003,7 +7131,7 @@ var snippetContract = initContract38().router(
|
|
7003
7131
|
updateSnippet: {
|
7004
7132
|
method: "PATCH",
|
7005
7133
|
path: "/:id",
|
7006
|
-
pathParams:
|
7134
|
+
pathParams: z103.object({ id: z103.string() }),
|
7007
7135
|
body: UpdateSnippetSchema,
|
7008
7136
|
responses: {
|
7009
7137
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7015,7 +7143,7 @@ var snippetContract = initContract38().router(
|
|
7015
7143
|
deleteSnippet: {
|
7016
7144
|
method: "DELETE",
|
7017
7145
|
path: "/:id",
|
7018
|
-
pathParams:
|
7146
|
+
pathParams: z103.object({ id: z103.string() }),
|
7019
7147
|
body: null,
|
7020
7148
|
responses: {
|
7021
7149
|
200: DefaultSuccessResponseSchema,
|
@@ -7029,178 +7157,178 @@ var snippetContract = initContract38().router(
|
|
7029
7157
|
);
|
7030
7158
|
|
7031
7159
|
// src/public-api/index.ts
|
7032
|
-
import { initContract as
|
7033
|
-
import
|
7160
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
7161
|
+
import z106 from "zod";
|
7034
7162
|
|
7035
7163
|
// src/public-api/validation.ts
|
7036
|
-
import
|
7164
|
+
import z105 from "zod";
|
7037
7165
|
|
7038
7166
|
// 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:
|
7167
|
+
import z104 from "zod";
|
7168
|
+
var ContactPhonesSchema2 = z104.object({
|
7169
|
+
id: z104.string().uuid(),
|
7170
|
+
createdAt: z104.date(),
|
7171
|
+
updatedAt: z104.date(),
|
7172
|
+
deletedAt: z104.date().nullable(),
|
7173
|
+
phone: z104.string(),
|
7174
|
+
isPrimary: z104.boolean()
|
7175
|
+
});
|
7176
|
+
var ContactEmailsSchema2 = z104.object({
|
7177
|
+
id: z104.string().uuid(),
|
7178
|
+
createdAt: z104.date(),
|
7179
|
+
updatedAt: z104.date(),
|
7180
|
+
deletedAt: z104.date().nullable(),
|
7181
|
+
email: z104.string(),
|
7182
|
+
isPrimary: z104.boolean()
|
7183
|
+
});
|
7184
|
+
var ContactCustomFieldSchema2 = z104.object({
|
7185
|
+
id: z104.string().uuid(),
|
7186
|
+
createdAt: z104.date(),
|
7187
|
+
updatedAt: z104.date(),
|
7188
|
+
deletedAt: z104.date().nullable(),
|
7189
|
+
textValue: z104.string().nullable(),
|
7190
|
+
booleanValue: z104.boolean().nullable(),
|
7191
|
+
numberValue: z104.number().nullable(),
|
7192
|
+
dateValue: z104.date().nullable(),
|
7065
7193
|
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:
|
7194
|
+
uploads: z104.array(UploadSchema)
|
7195
|
+
});
|
7196
|
+
var ContactEntityTypesSchema2 = z104.object({
|
7197
|
+
id: z104.string().uuid(),
|
7198
|
+
createdAt: z104.date(),
|
7199
|
+
updatedAt: z104.date(),
|
7200
|
+
deletedAt: z104.date().nullable(),
|
7201
|
+
entity: z104.string(),
|
7202
|
+
description: z104.string().nullable()
|
7203
|
+
});
|
7204
|
+
var ContactActivitySchema2 = z104.object({
|
7205
|
+
id: z104.string().uuid(),
|
7206
|
+
createdAt: z104.date(),
|
7207
|
+
updatedAt: z104.date(),
|
7208
|
+
deletedAt: z104.date().nullable(),
|
7209
|
+
entityId: z104.string(),
|
7210
|
+
description: z104.string(),
|
7083
7211
|
entityType: ContactEntityTypesSchema2
|
7084
7212
|
});
|
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:
|
7213
|
+
var ContactSchema2 = z104.object({
|
7214
|
+
id: z104.string().uuid(),
|
7215
|
+
createdAt: z104.date(),
|
7216
|
+
updatedAt: z104.date(),
|
7217
|
+
deletedAt: z104.date().nullable(),
|
7218
|
+
name: z104.string(),
|
7219
|
+
address: z104.string().nullable(),
|
7220
|
+
channel: z104.string().nullable(),
|
7221
|
+
notes: z104.string().nullable(),
|
7222
|
+
contactProfile: z104.string().nullable(),
|
7223
|
+
socialProfileUrl: z104.string().nullable(),
|
7224
|
+
tags: z104.array(TagSchema),
|
7097
7225
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
7098
|
-
customFields:
|
7099
|
-
contactEmails:
|
7100
|
-
contactPhones:
|
7101
|
-
activityLogs:
|
7226
|
+
customFields: z104.array(ContactCustomFieldSchema2),
|
7227
|
+
contactEmails: z104.array(ContactEmailsSchema2),
|
7228
|
+
contactPhones: z104.array(ContactPhonesSchema2),
|
7229
|
+
activityLogs: z104.array(ContactActivitySchema2).optional()
|
7102
7230
|
});
|
7103
7231
|
|
7104
7232
|
// src/public-api/validation.ts
|
7105
7233
|
var ContactContractValidationSchema2 = {
|
7106
7234
|
create: {
|
7107
|
-
request:
|
7108
|
-
name:
|
7109
|
-
email:
|
7110
|
-
|
7111
|
-
email:
|
7112
|
-
isPrimary:
|
7235
|
+
request: z105.object({
|
7236
|
+
name: z105.string(),
|
7237
|
+
email: z105.array(
|
7238
|
+
z105.object({
|
7239
|
+
email: z105.string().email(),
|
7240
|
+
isPrimary: z105.boolean()
|
7113
7241
|
})
|
7114
7242
|
).optional(),
|
7115
|
-
channel:
|
7116
|
-
address:
|
7117
|
-
phone:
|
7118
|
-
|
7119
|
-
phone:
|
7120
|
-
isPrimary:
|
7243
|
+
channel: z105.string().optional(),
|
7244
|
+
address: z105.string().optional(),
|
7245
|
+
phone: z105.array(
|
7246
|
+
z105.object({
|
7247
|
+
phone: z105.string(),
|
7248
|
+
isPrimary: z105.boolean()
|
7121
7249
|
})
|
7122
7250
|
).optional(),
|
7123
|
-
notes:
|
7124
|
-
tags:
|
7125
|
-
company:
|
7126
|
-
customFields:
|
7251
|
+
notes: z105.string().optional(),
|
7252
|
+
tags: z105.array(z105.string()).optional(),
|
7253
|
+
company: z105.string().optional(),
|
7254
|
+
customFields: z105.record(z105.string())
|
7127
7255
|
// Dynamic keys with string values
|
7128
7256
|
}),
|
7129
7257
|
response: ContactSchema2
|
7130
7258
|
},
|
7131
7259
|
getById: {
|
7132
|
-
request:
|
7133
|
-
id:
|
7260
|
+
request: z105.object({
|
7261
|
+
id: z105.string().uuid()
|
7134
7262
|
})
|
7135
7263
|
},
|
7136
7264
|
delete: {
|
7137
|
-
request:
|
7138
|
-
id:
|
7265
|
+
request: z105.object({
|
7266
|
+
id: z105.string().uuid()
|
7139
7267
|
})
|
7140
7268
|
},
|
7141
7269
|
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:
|
7270
|
+
request: z105.object({
|
7271
|
+
page: z105.coerce.number().default(1),
|
7272
|
+
pageSize: z105.coerce.number().default(10),
|
7273
|
+
keyword: z105.string().optional(),
|
7274
|
+
company: z105.array(z105.string().uuid()),
|
7275
|
+
name: z105.string(),
|
7276
|
+
address: z105.string(),
|
7277
|
+
channel: z105.array(z105.string()),
|
7278
|
+
selectedDate: z105.string(),
|
7279
|
+
customFields: z105.array(
|
7280
|
+
z105.object({
|
7281
|
+
attributeId: z105.string().uuid(),
|
7282
|
+
type: z105.string(),
|
7283
|
+
value: z105.union([z105.string(), z105.array(z105.string())])
|
7156
7284
|
})
|
7157
7285
|
),
|
7158
|
-
tags:
|
7159
|
-
phone:
|
7160
|
-
email:
|
7161
|
-
notes:
|
7286
|
+
tags: z105.array(z105.string().uuid()),
|
7287
|
+
phone: z105.string(),
|
7288
|
+
email: z105.string(),
|
7289
|
+
notes: z105.string()
|
7162
7290
|
}).partial(),
|
7163
7291
|
response: {
|
7164
|
-
page:
|
7165
|
-
pageSize:
|
7166
|
-
total:
|
7167
|
-
lastPage:
|
7168
|
-
data:
|
7292
|
+
page: z105.number(),
|
7293
|
+
pageSize: z105.number(),
|
7294
|
+
total: z105.number(),
|
7295
|
+
lastPage: z105.number(),
|
7296
|
+
data: z105.array(ContactSchema2)
|
7169
7297
|
}
|
7170
7298
|
},
|
7171
7299
|
getContactFields: {
|
7172
|
-
request:
|
7173
|
-
page:
|
7174
|
-
pageSize:
|
7300
|
+
request: z105.object({
|
7301
|
+
page: z105.coerce.number().default(1),
|
7302
|
+
pageSize: z105.coerce.number().default(10)
|
7175
7303
|
}).partial(),
|
7176
7304
|
response: {
|
7177
|
-
page:
|
7178
|
-
pageSize:
|
7179
|
-
total:
|
7180
|
-
lastPage:
|
7181
|
-
data:
|
7305
|
+
page: z105.number(),
|
7306
|
+
pageSize: z105.number(),
|
7307
|
+
total: z105.number(),
|
7308
|
+
lastPage: z105.number(),
|
7309
|
+
data: z105.array(ContactCustomFieldSchema2)
|
7182
7310
|
}
|
7183
7311
|
},
|
7184
7312
|
addAttachments: {
|
7185
|
-
request:
|
7186
|
-
contactId:
|
7187
|
-
attributeId:
|
7188
|
-
contactAttachmentRecords:
|
7189
|
-
|
7190
|
-
bucketName:
|
7191
|
-
fileKey:
|
7192
|
-
fileName:
|
7193
|
-
fileSize:
|
7194
|
-
url:
|
7313
|
+
request: z105.object({
|
7314
|
+
contactId: z105.string(),
|
7315
|
+
attributeId: z105.string().uuid(),
|
7316
|
+
contactAttachmentRecords: z105.array(
|
7317
|
+
z105.object({
|
7318
|
+
bucketName: z105.string(),
|
7319
|
+
fileKey: z105.string(),
|
7320
|
+
fileName: z105.string(),
|
7321
|
+
fileSize: z105.coerce.number(),
|
7322
|
+
url: z105.string()
|
7195
7323
|
})
|
7196
7324
|
)
|
7197
7325
|
}),
|
7198
|
-
response:
|
7326
|
+
response: CustomFieldSchema2
|
7199
7327
|
}
|
7200
7328
|
};
|
7201
7329
|
|
7202
7330
|
// src/public-api/index.ts
|
7203
|
-
var publicApiContract =
|
7331
|
+
var publicApiContract = initContract40().router(
|
7204
7332
|
{
|
7205
7333
|
createContact: {
|
7206
7334
|
method: "POST",
|
@@ -7210,11 +7338,11 @@ var publicApiContract = initContract39().router(
|
|
7210
7338
|
201: DefaultSuccessResponseSchema.extend({
|
7211
7339
|
data: ContactSchema2
|
7212
7340
|
}),
|
7213
|
-
400:
|
7214
|
-
message:
|
7341
|
+
400: z106.object({
|
7342
|
+
message: z106.string()
|
7215
7343
|
}),
|
7216
|
-
409:
|
7217
|
-
message:
|
7344
|
+
409: z106.object({
|
7345
|
+
message: z106.string()
|
7218
7346
|
}),
|
7219
7347
|
401: DefaultUnauthorizedSchema,
|
7220
7348
|
404: DefaultNotFoundSchema,
|
@@ -7229,13 +7357,13 @@ var publicApiContract = initContract39().router(
|
|
7229
7357
|
query: GetTagsSchema,
|
7230
7358
|
responses: {
|
7231
7359
|
200: DefaultSuccessResponseSchema.extend({
|
7232
|
-
tags:
|
7360
|
+
tags: z106.array(TagSchema)
|
7233
7361
|
}),
|
7234
|
-
400:
|
7235
|
-
message:
|
7362
|
+
400: z106.object({
|
7363
|
+
message: z106.string()
|
7236
7364
|
}),
|
7237
|
-
409:
|
7238
|
-
message:
|
7365
|
+
409: z106.object({
|
7366
|
+
message: z106.string()
|
7239
7367
|
}),
|
7240
7368
|
401: DefaultUnauthorizedSchema,
|
7241
7369
|
404: DefaultNotFoundSchema,
|
@@ -7251,11 +7379,11 @@ var publicApiContract = initContract39().router(
|
|
7251
7379
|
200: DefaultSuccessResponseSchema.extend(
|
7252
7380
|
ContactContractValidationSchema2.getAll.response
|
7253
7381
|
),
|
7254
|
-
400:
|
7255
|
-
message:
|
7382
|
+
400: z106.object({
|
7383
|
+
message: z106.string()
|
7256
7384
|
}),
|
7257
|
-
409:
|
7258
|
-
message:
|
7385
|
+
409: z106.object({
|
7386
|
+
message: z106.string()
|
7259
7387
|
}),
|
7260
7388
|
401: DefaultUnauthorizedSchema,
|
7261
7389
|
404: DefaultNotFoundSchema,
|
@@ -7272,11 +7400,11 @@ var publicApiContract = initContract39().router(
|
|
7272
7400
|
200: DefaultSuccessResponseSchema.extend(
|
7273
7401
|
ContactContractValidationSchema2.getContactFields.response
|
7274
7402
|
),
|
7275
|
-
400:
|
7276
|
-
message:
|
7403
|
+
400: z106.object({
|
7404
|
+
message: z106.string()
|
7277
7405
|
}),
|
7278
|
-
409:
|
7279
|
-
message:
|
7406
|
+
409: z106.object({
|
7407
|
+
message: z106.string()
|
7280
7408
|
}),
|
7281
7409
|
401: DefaultUnauthorizedSchema,
|
7282
7410
|
404: DefaultNotFoundSchema,
|
@@ -7290,17 +7418,17 @@ var publicApiContract = initContract39().router(
|
|
7290
7418
|
path: "/contacts/:id",
|
7291
7419
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7292
7420
|
responses: {
|
7293
|
-
200:
|
7294
|
-
status:
|
7295
|
-
message:
|
7421
|
+
200: z106.object({
|
7422
|
+
status: z106.string(),
|
7423
|
+
message: z106.string(),
|
7296
7424
|
data: ContactSchema2,
|
7297
|
-
requestId:
|
7425
|
+
requestId: z106.string()
|
7298
7426
|
}),
|
7299
|
-
400:
|
7300
|
-
message:
|
7427
|
+
400: z106.object({
|
7428
|
+
message: z106.string()
|
7301
7429
|
}),
|
7302
|
-
409:
|
7303
|
-
message:
|
7430
|
+
409: z106.object({
|
7431
|
+
message: z106.string()
|
7304
7432
|
}),
|
7305
7433
|
401: DefaultUnauthorizedSchema,
|
7306
7434
|
404: DefaultNotFoundSchema,
|
@@ -7318,11 +7446,11 @@ var publicApiContract = initContract39().router(
|
|
7318
7446
|
201: DefaultSuccessResponseSchema.extend({
|
7319
7447
|
message: ContactCustomFieldSchema2
|
7320
7448
|
}),
|
7321
|
-
400:
|
7322
|
-
message:
|
7449
|
+
400: z106.object({
|
7450
|
+
message: z106.string()
|
7323
7451
|
}),
|
7324
|
-
409:
|
7325
|
-
message:
|
7452
|
+
409: z106.object({
|
7453
|
+
message: z106.string()
|
7326
7454
|
}),
|
7327
7455
|
401: DefaultUnauthorizedSchema,
|
7328
7456
|
404: DefaultNotFoundSchema,
|
@@ -7336,17 +7464,17 @@ var publicApiContract = initContract39().router(
|
|
7336
7464
|
path: "/contacts/:id",
|
7337
7465
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7338
7466
|
responses: {
|
7339
|
-
200:
|
7340
|
-
status:
|
7341
|
-
message:
|
7467
|
+
200: z106.object({
|
7468
|
+
status: z106.string(),
|
7469
|
+
message: z106.string(),
|
7342
7470
|
data: ContactSchema2,
|
7343
|
-
requestId:
|
7471
|
+
requestId: z106.string()
|
7344
7472
|
}),
|
7345
|
-
400:
|
7346
|
-
message:
|
7473
|
+
400: z106.object({
|
7474
|
+
message: z106.string()
|
7347
7475
|
}),
|
7348
|
-
409:
|
7349
|
-
message:
|
7476
|
+
409: z106.object({
|
7477
|
+
message: z106.string()
|
7350
7478
|
}),
|
7351
7479
|
401: DefaultUnauthorizedSchema,
|
7352
7480
|
404: DefaultNotFoundSchema,
|
@@ -7360,17 +7488,17 @@ var publicApiContract = initContract39().router(
|
|
7360
7488
|
path: "/contacts/:id",
|
7361
7489
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7362
7490
|
responses: {
|
7363
|
-
200:
|
7364
|
-
status:
|
7365
|
-
message:
|
7491
|
+
200: z106.object({
|
7492
|
+
status: z106.string(),
|
7493
|
+
message: z106.string(),
|
7366
7494
|
data: ContactSchema2,
|
7367
|
-
requestId:
|
7495
|
+
requestId: z106.string()
|
7368
7496
|
}),
|
7369
|
-
400:
|
7370
|
-
message:
|
7497
|
+
400: z106.object({
|
7498
|
+
message: z106.string()
|
7371
7499
|
}),
|
7372
|
-
409:
|
7373
|
-
message:
|
7500
|
+
409: z106.object({
|
7501
|
+
message: z106.string()
|
7374
7502
|
}),
|
7375
7503
|
401: DefaultUnauthorizedSchema,
|
7376
7504
|
404: DefaultNotFoundSchema,
|
@@ -7387,7 +7515,7 @@ var publicApiContract = initContract39().router(
|
|
7387
7515
|
);
|
7388
7516
|
|
7389
7517
|
// src/contract.ts
|
7390
|
-
var apiContract =
|
7518
|
+
var apiContract = initContract41().router({
|
7391
7519
|
auth: authContract,
|
7392
7520
|
mail: mailContract,
|
7393
7521
|
cxLog: cxLogContract,
|
@@ -7411,35 +7539,36 @@ var apiContract = initContract40().router({
|
|
7411
7539
|
upload: uploadContract,
|
7412
7540
|
snippet: snippetContract
|
7413
7541
|
});
|
7414
|
-
var contactContract2 =
|
7542
|
+
var contactContract2 = initContract41().router({
|
7415
7543
|
contact: contactContract
|
7416
7544
|
});
|
7417
|
-
var ticketContract2 =
|
7545
|
+
var ticketContract2 = initContract41().router({
|
7418
7546
|
ticket: ticketContract
|
7419
7547
|
});
|
7420
|
-
var extensionContract2 =
|
7548
|
+
var extensionContract2 = initContract41().router({
|
7421
7549
|
extension: extensionContract
|
7422
7550
|
});
|
7423
|
-
var commentActivityContract =
|
7551
|
+
var commentActivityContract = initContract41().router({
|
7424
7552
|
comment: commentContract,
|
7425
7553
|
activityLog: activityLogContract
|
7426
7554
|
});
|
7427
|
-
var platformContract =
|
7555
|
+
var platformContract = initContract41().router({
|
7428
7556
|
line: lineContract,
|
7429
7557
|
messenger: messengerContract,
|
7430
7558
|
instagram: instagramContract,
|
7431
|
-
viber: viberContract
|
7559
|
+
viber: viberContract,
|
7560
|
+
webchat: webchatContract
|
7432
7561
|
});
|
7433
|
-
var chatContract =
|
7562
|
+
var chatContract = initContract41().router({
|
7434
7563
|
main: mainChatContract
|
7435
7564
|
});
|
7436
|
-
var telephonyContract =
|
7565
|
+
var telephonyContract = initContract41().router({
|
7437
7566
|
telephonyCdr: telephonyCdrContract
|
7438
7567
|
});
|
7439
|
-
var notificationContract =
|
7568
|
+
var notificationContract = initContract41().router({
|
7440
7569
|
notification: userNotificationContract
|
7441
7570
|
});
|
7442
|
-
var publicApiContract2 =
|
7571
|
+
var publicApiContract2 = initContract41().router({
|
7443
7572
|
publicApi: publicApiContract
|
7444
7573
|
});
|
7445
7574
|
export {
|