@kl1/contracts 1.1.22 → 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 +579 -211
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +578 -211
- 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 +26553 -6263
- 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/index.d.ts +1 -0
- package/dist/src/index.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/schema.d.ts.map +1 -1
- package/dist/src/line/validation.d.ts +23 -23
- package/dist/src/line/validation.d.ts.map +1 -1
- package/dist/src/mail/account-contract.d.ts +230 -4
- package/dist/src/mail/account-contract.d.ts.map +1 -1
- package/dist/src/mail/mail-contract.d.ts +3277 -435
- package/dist/src/mail/mail-contract.d.ts.map +1 -1
- package/dist/src/mail/message-contract.d.ts +58 -1
- package/dist/src/mail/message-contract.d.ts.map +1 -1
- package/dist/src/mail/room-contract.d.ts +3009 -450
- package/dist/src/mail/room-contract.d.ts.map +1 -1
- package/dist/src/mail/schemas/room-validation.schema.d.ts +731 -6
- package/dist/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
- package/dist/src/mail/schemas/room.schema.d.ts +557 -0
- 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/snippet/index.d.ts +545 -97
- package/dist/src/snippet/index.d.ts.map +1 -1
- package/dist/src/snippet/schema.d.ts +220 -19
- package/dist/src/snippet/schema.d.ts.map +1 -1
- package/dist/src/snippet/validation.d.ts +5 -5
- 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
|
|
@@ -4163,7 +4218,8 @@ var MailRoomSchema = z58.object({
|
|
4163
4218
|
messages: z58.array(MessageSchema2),
|
4164
4219
|
messagesAndLogs: MessagesAndLogsSchema,
|
4165
4220
|
mail: MailAccountSchema,
|
4166
|
-
unReadMessageCount: z58.number()
|
4221
|
+
unReadMessageCount: z58.number(),
|
4222
|
+
cxlog: CxLogSchema
|
4167
4223
|
});
|
4168
4224
|
var AttachmentSchema2 = z58.object({
|
4169
4225
|
fileName: z58.string(),
|
@@ -4182,7 +4238,15 @@ var RoomContractsValidationSchema = {
|
|
4182
4238
|
input: z59.object({
|
4183
4239
|
page: z59.coerce.number().default(1),
|
4184
4240
|
pageSize: z59.coerce.number().default(10),
|
4185
|
-
keyword: z59.
|
4241
|
+
keyword: z59.object({
|
4242
|
+
value: z59.string(),
|
4243
|
+
category: z59.union([z59.literal("contact"), z59.literal("message")])
|
4244
|
+
}).optional(),
|
4245
|
+
contactLabels: z59.array(z59.string()).optional(),
|
4246
|
+
channels: z59.array(z59.string().email()).optional(),
|
4247
|
+
date: z59.string().optional(),
|
4248
|
+
contacts: z59.array(z59.string()).optional(),
|
4249
|
+
assignees: z59.array(z59.string()).optional(),
|
4186
4250
|
level1: z59.union([
|
4187
4251
|
z59.literal("open"),
|
4188
4252
|
z59.literal("close"),
|
@@ -4207,9 +4271,14 @@ var RoomContractsValidationSchema = {
|
|
4207
4271
|
},
|
4208
4272
|
update: {
|
4209
4273
|
input: z59.object({
|
4210
|
-
|
4211
|
-
z59.
|
4212
|
-
|
4274
|
+
disposition: z59.union([
|
4275
|
+
z59.literal("resolved"),
|
4276
|
+
z59.literal("follow up"),
|
4277
|
+
z59.literal("escalated"),
|
4278
|
+
z59.literal("dropped"),
|
4279
|
+
z59.literal("prank"),
|
4280
|
+
z59.literal("blank")
|
4281
|
+
]).optional().nullable(),
|
4213
4282
|
assigneeId: z59.string().uuid().optional().nullable(),
|
4214
4283
|
note: z59.string().optional(),
|
4215
4284
|
tags: z59.array(z59.string().uuid()).optional(),
|
@@ -4253,19 +4322,37 @@ var roomContract = initContract18().router(
|
|
4253
4322
|
},
|
4254
4323
|
summary: "Get mail rooms"
|
4255
4324
|
},
|
4256
|
-
getById
|
4325
|
+
//added 'all' after because it has some conflict with getById route.
|
4326
|
+
getRoomCounts: {
|
4257
4327
|
method: "GET",
|
4258
|
-
path: "
|
4259
|
-
pathParams: z60.object({
|
4260
|
-
id: z60.string().uuid()
|
4261
|
-
}),
|
4328
|
+
path: "/count_rooms/all",
|
4262
4329
|
responses: {
|
4263
4330
|
200: DefaultSuccessResponseSchema.extend({
|
4264
|
-
data:
|
4331
|
+
data: z60.object({
|
4332
|
+
general: z60.array(
|
4333
|
+
z60.object({
|
4334
|
+
name: z60.string(),
|
4335
|
+
count: z60.number(),
|
4336
|
+
unReadMessagesCount: z60.number()
|
4337
|
+
})
|
4338
|
+
),
|
4339
|
+
channels: z60.array(
|
4340
|
+
z60.object({
|
4341
|
+
channel: MailAccountSchema,
|
4342
|
+
count: z60.number()
|
4343
|
+
})
|
4344
|
+
),
|
4345
|
+
contactLabels: z60.array(
|
4346
|
+
z60.object({
|
4347
|
+
label: TagSchema,
|
4348
|
+
count: z60.number()
|
4349
|
+
})
|
4350
|
+
)
|
4351
|
+
})
|
4265
4352
|
}),
|
4266
4353
|
...DefaultResponses
|
4267
4354
|
},
|
4268
|
-
summary:
|
4355
|
+
summary: 'Get unread message counts for filter like "open", "close", "inbox" and etc...'
|
4269
4356
|
},
|
4270
4357
|
getAttachments: {
|
4271
4358
|
method: "GET",
|
@@ -4311,6 +4398,20 @@ var roomContract = initContract18().router(
|
|
4311
4398
|
summary: "Update a mail room by id"
|
4312
4399
|
},
|
4313
4400
|
markAsRead: {
|
4401
|
+
method: "POST",
|
4402
|
+
path: "/mark_as_read",
|
4403
|
+
body: z60.object({
|
4404
|
+
id: z60.string()
|
4405
|
+
}),
|
4406
|
+
responses: {
|
4407
|
+
200: DefaultSuccessResponseSchema.extend({
|
4408
|
+
message: z60.string()
|
4409
|
+
}),
|
4410
|
+
...DefaultResponses
|
4411
|
+
},
|
4412
|
+
summary: "Mark all the unread messages of a room as read"
|
4413
|
+
},
|
4414
|
+
getById: {
|
4314
4415
|
method: "GET",
|
4315
4416
|
path: "/:id",
|
4316
4417
|
pathParams: z60.object({
|
@@ -4318,11 +4419,11 @@ var roomContract = initContract18().router(
|
|
4318
4419
|
}),
|
4319
4420
|
responses: {
|
4320
4421
|
200: DefaultSuccessResponseSchema.extend({
|
4321
|
-
|
4422
|
+
data: MailRoomSchema
|
4322
4423
|
}),
|
4323
4424
|
...DefaultResponses
|
4324
4425
|
},
|
4325
|
-
summary: "
|
4426
|
+
summary: "Get a mail room by id"
|
4326
4427
|
}
|
4327
4428
|
},
|
4328
4429
|
{
|
@@ -4388,7 +4489,7 @@ var accountContract = initContract19().router(
|
|
4388
4489
|
responses: {
|
4389
4490
|
201: DefaultSuccessResponseSchema.extend({
|
4390
4491
|
// data: AccountContractsValidationSchemas.create.output,
|
4391
|
-
|
4492
|
+
data: MailAccountSchema
|
4392
4493
|
}),
|
4393
4494
|
400: z62.object({
|
4394
4495
|
message: z62.string()
|
@@ -4405,6 +4506,18 @@ var accountContract = initContract19().router(
|
|
4405
4506
|
summary: "Register a new mail account"
|
4406
4507
|
},
|
4407
4508
|
//#endregion register account
|
4509
|
+
//#region ........sync all accounts
|
4510
|
+
sync: {
|
4511
|
+
method: "GET",
|
4512
|
+
path: "/sync",
|
4513
|
+
responses: {
|
4514
|
+
200: DefaultSuccessResponseSchema.extend({
|
4515
|
+
message: z62.string()
|
4516
|
+
}),
|
4517
|
+
...DefaultResponses
|
4518
|
+
},
|
4519
|
+
summary: "Sync all accounts state from email engine to system"
|
4520
|
+
},
|
4408
4521
|
//#region ........get account
|
4409
4522
|
getById: {
|
4410
4523
|
method: "GET",
|
@@ -4416,14 +4529,18 @@ var accountContract = initContract19().router(
|
|
4416
4529
|
}),
|
4417
4530
|
...DefaultResponses
|
4418
4531
|
},
|
4419
|
-
summary: "Get
|
4532
|
+
summary: "Get an account by id"
|
4420
4533
|
},
|
4421
4534
|
//#endregion get account
|
4535
|
+
//#endregion sync all accountss
|
4422
4536
|
//#region ........get all account
|
4423
|
-
//TODO: add pagination parameters
|
4424
4537
|
getAll: {
|
4425
4538
|
method: "GET",
|
4426
4539
|
path: "",
|
4540
|
+
query: z62.object({
|
4541
|
+
state: z62.union([z62.literal("connected"), z62.literal("disconnected")]).optional(),
|
4542
|
+
withDeleted: z62.boolean().default(false)
|
4543
|
+
}).optional(),
|
4427
4544
|
responses: {
|
4428
4545
|
200: DefaultSuccessResponseSchema.extend({
|
4429
4546
|
data: z62.array(MailAccountSchema)
|
@@ -4654,8 +4771,25 @@ var messageContract = initContract21().router(
|
|
4654
4771
|
500: DefaultErrorResponseSchema
|
4655
4772
|
},
|
4656
4773
|
body: MessageContractsValidationsSchema.submit.input,
|
4657
|
-
summary: "Submit a message such compose, reply or forward"
|
4774
|
+
summary: "Submit a message such as compose, reply or forward"
|
4658
4775
|
},
|
4776
|
+
//#region get room counts for filter like 'open', 'close', 'inbox' and etc...
|
4777
|
+
//#endregion get unread message counts for filter like 'open', 'close', 'inbox' and etc...
|
4778
|
+
//#region get total unread messages counts
|
4779
|
+
getTotalUnreadMessageCount: {
|
4780
|
+
method: "GET",
|
4781
|
+
path: "/new_message_count",
|
4782
|
+
responses: {
|
4783
|
+
200: DefaultSuccessResponseSchema.extend({
|
4784
|
+
data: z66.object({
|
4785
|
+
count: z66.number()
|
4786
|
+
})
|
4787
|
+
}),
|
4788
|
+
...DefaultResponses
|
4789
|
+
},
|
4790
|
+
summary: "Get total unread messages counts"
|
4791
|
+
},
|
4792
|
+
//#endregion get total unread messages counts
|
4659
4793
|
//#region get a message
|
4660
4794
|
getById: {
|
4661
4795
|
method: "GET",
|
@@ -6402,7 +6536,16 @@ var CreateWrapUpFormSchema = z91.object({
|
|
6402
6536
|
callTo: z91.string().nullable().optional()
|
6403
6537
|
});
|
6404
6538
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
6405
|
-
|
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()
|
6406
6549
|
});
|
6407
6550
|
var CreateCXLogWrapUpFormSchema = z91.object({
|
6408
6551
|
cxLogId: z91.string().uuid(),
|
@@ -6792,179 +6935,400 @@ var userNotificationContract = initContract37().router(
|
|
6792
6935
|
}
|
6793
6936
|
);
|
6794
6937
|
|
6795
|
-
// src/
|
6938
|
+
// src/webchat/index.ts
|
6796
6939
|
import { initContract as initContract38 } from "@ts-rest/core";
|
6940
|
+
|
6941
|
+
// src/webchat/schema.ts
|
6942
|
+
import z100 from "zod";
|
6943
|
+
|
6944
|
+
// src/webchat/validation.ts
|
6945
|
+
import z99 from "zod";
|
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(),
|
6952
|
+
name: z99.string(),
|
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
|
6797
7007
|
import z101 from "zod";
|
7008
|
+
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7009
|
+
name: z101.string(),
|
7010
|
+
platformType: z101.string()
|
7011
|
+
});
|
7012
|
+
var SnippetContentSchema = DefaultEntitySchema.extend({
|
7013
|
+
contentType: z101.string(),
|
7014
|
+
contentValue: z101.string().nullable(),
|
7015
|
+
contentTemplate: z101.any().nullable(),
|
7016
|
+
order: z101.number(),
|
7017
|
+
upload: UploadSchema.optional().nullable()
|
7018
|
+
});
|
7019
|
+
var SnippetSchema = DefaultEntitySchema.extend({
|
7020
|
+
name: z101.string(),
|
7021
|
+
snippetGroup: SnippetGroupSchema,
|
7022
|
+
snippetContent: SnippetContentSchema
|
7023
|
+
});
|
7024
|
+
var SnippetGroupListItemSchema = z101.object({
|
7025
|
+
id: z101.string().uuid(),
|
7026
|
+
name: z101.string()
|
7027
|
+
});
|
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()
|
7034
|
+
});
|
7035
|
+
|
7036
|
+
// src/snippet/validation.ts
|
7037
|
+
import { z as z102 } from "zod";
|
7038
|
+
var CreateSnippetGroupSchema = z102.object({
|
7039
|
+
name: z102.string(),
|
7040
|
+
platformType: z102.string()
|
7041
|
+
});
|
7042
|
+
var UpdateSnippetGroupSchema = z102.object({
|
7043
|
+
name: z102.string().optional(),
|
7044
|
+
platformType: z102.string().optional()
|
7045
|
+
});
|
7046
|
+
var DeleteSnippetGroupSchema = z102.object({
|
7047
|
+
id: z102.string()
|
7048
|
+
});
|
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()
|
7055
|
+
});
|
7056
|
+
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
7057
|
+
snippetContentId: z102.string()
|
7058
|
+
});
|
7059
|
+
var DeleteSnippetSchema = z102.object({
|
7060
|
+
snippetId: z102.string()
|
7061
|
+
});
|
7062
|
+
|
7063
|
+
// src/snippet/index.ts
|
7064
|
+
var snippetContract = initContract39().router(
|
7065
|
+
{
|
7066
|
+
createSnippetGroup: {
|
7067
|
+
method: "POST",
|
7068
|
+
path: "/groups",
|
7069
|
+
body: CreateSnippetGroupSchema,
|
7070
|
+
responses: {
|
7071
|
+
201: DefaultSuccessResponseSchema.extend({
|
7072
|
+
snippetgroup: SnippetGroupSchema
|
7073
|
+
}),
|
7074
|
+
500: DefaultErrorResponseSchema
|
7075
|
+
}
|
7076
|
+
},
|
7077
|
+
getSnippetGroups: {
|
7078
|
+
method: "GET",
|
7079
|
+
path: "/groups",
|
7080
|
+
query: null,
|
7081
|
+
responses: {
|
7082
|
+
200: DefaultSuccessResponseSchema.extend({
|
7083
|
+
snippetgroups: z103.array(SnippetGroupSchema)
|
7084
|
+
}),
|
7085
|
+
500: DefaultErrorResponseSchema
|
7086
|
+
}
|
7087
|
+
},
|
7088
|
+
updateSnippetGroup: {
|
7089
|
+
method: "PATCH",
|
7090
|
+
path: "/groups/:id",
|
7091
|
+
pathParams: z103.object({ id: z103.string() }),
|
7092
|
+
body: UpdateSnippetGroupSchema,
|
7093
|
+
responses: {
|
7094
|
+
200: DefaultSuccessResponseSchema.extend({
|
7095
|
+
snippetgroup: SnippetGroupSchema
|
7096
|
+
}),
|
7097
|
+
500: DefaultErrorResponseSchema
|
7098
|
+
}
|
7099
|
+
},
|
7100
|
+
deleteSnippetGroup: {
|
7101
|
+
method: "DELETE",
|
7102
|
+
path: "/groups/:id",
|
7103
|
+
pathParams: z103.object({ id: z103.string() }),
|
7104
|
+
body: null,
|
7105
|
+
responses: {
|
7106
|
+
200: DefaultSuccessResponseSchema,
|
7107
|
+
500: DefaultErrorResponseSchema
|
7108
|
+
}
|
7109
|
+
},
|
7110
|
+
getSnippets: {
|
7111
|
+
method: "GET",
|
7112
|
+
path: "",
|
7113
|
+
responses: {
|
7114
|
+
200: DefaultSuccessResponseSchema.extend({
|
7115
|
+
snippets: z103.array(SnippetSchema)
|
7116
|
+
}),
|
7117
|
+
500: DefaultErrorResponseSchema
|
7118
|
+
}
|
7119
|
+
},
|
7120
|
+
createSnippet: {
|
7121
|
+
method: "POST",
|
7122
|
+
path: "",
|
7123
|
+
body: CreateSnippetSchema,
|
7124
|
+
responses: {
|
7125
|
+
201: DefaultSuccessResponseSchema.extend({
|
7126
|
+
snippet: SnippetSchema
|
7127
|
+
}),
|
7128
|
+
500: DefaultErrorResponseSchema
|
7129
|
+
}
|
7130
|
+
},
|
7131
|
+
updateSnippet: {
|
7132
|
+
method: "PATCH",
|
7133
|
+
path: "/:id",
|
7134
|
+
pathParams: z103.object({ id: z103.string() }),
|
7135
|
+
body: UpdateSnippetSchema,
|
7136
|
+
responses: {
|
7137
|
+
200: DefaultSuccessResponseSchema.extend({
|
7138
|
+
snippet: SnippetSchema
|
7139
|
+
}),
|
7140
|
+
500: DefaultErrorResponseSchema
|
7141
|
+
}
|
7142
|
+
},
|
7143
|
+
deleteSnippet: {
|
7144
|
+
method: "DELETE",
|
7145
|
+
path: "/:id",
|
7146
|
+
pathParams: z103.object({ id: z103.string() }),
|
7147
|
+
body: null,
|
7148
|
+
responses: {
|
7149
|
+
200: DefaultSuccessResponseSchema,
|
7150
|
+
500: DefaultErrorResponseSchema
|
7151
|
+
}
|
7152
|
+
}
|
7153
|
+
},
|
7154
|
+
{
|
7155
|
+
pathPrefix: "snippets"
|
7156
|
+
}
|
7157
|
+
);
|
7158
|
+
|
7159
|
+
// src/public-api/index.ts
|
7160
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
7161
|
+
import z106 from "zod";
|
6798
7162
|
|
6799
7163
|
// src/public-api/validation.ts
|
6800
|
-
import
|
7164
|
+
import z105 from "zod";
|
6801
7165
|
|
6802
7166
|
// src/public-api/schema.ts
|
6803
|
-
import
|
6804
|
-
var ContactPhonesSchema2 =
|
6805
|
-
id:
|
6806
|
-
createdAt:
|
6807
|
-
updatedAt:
|
6808
|
-
deletedAt:
|
6809
|
-
phone:
|
6810
|
-
isPrimary:
|
6811
|
-
});
|
6812
|
-
var ContactEmailsSchema2 =
|
6813
|
-
id:
|
6814
|
-
createdAt:
|
6815
|
-
updatedAt:
|
6816
|
-
deletedAt:
|
6817
|
-
email:
|
6818
|
-
isPrimary:
|
6819
|
-
});
|
6820
|
-
var ContactCustomFieldSchema2 =
|
6821
|
-
id:
|
6822
|
-
createdAt:
|
6823
|
-
updatedAt:
|
6824
|
-
deletedAt:
|
6825
|
-
textValue:
|
6826
|
-
booleanValue:
|
6827
|
-
numberValue:
|
6828
|
-
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(),
|
6829
7193
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
6830
|
-
uploads:
|
6831
|
-
});
|
6832
|
-
var ContactEntityTypesSchema2 =
|
6833
|
-
id:
|
6834
|
-
createdAt:
|
6835
|
-
updatedAt:
|
6836
|
-
deletedAt:
|
6837
|
-
entity:
|
6838
|
-
description:
|
6839
|
-
});
|
6840
|
-
var ContactActivitySchema2 =
|
6841
|
-
id:
|
6842
|
-
createdAt:
|
6843
|
-
updatedAt:
|
6844
|
-
deletedAt:
|
6845
|
-
entityId:
|
6846
|
-
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(),
|
6847
7211
|
entityType: ContactEntityTypesSchema2
|
6848
7212
|
});
|
6849
|
-
var ContactSchema2 =
|
6850
|
-
id:
|
6851
|
-
createdAt:
|
6852
|
-
updatedAt:
|
6853
|
-
deletedAt:
|
6854
|
-
name:
|
6855
|
-
address:
|
6856
|
-
channel:
|
6857
|
-
notes:
|
6858
|
-
contactProfile:
|
6859
|
-
socialProfileUrl:
|
6860
|
-
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),
|
6861
7225
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
6862
|
-
customFields:
|
6863
|
-
contactEmails:
|
6864
|
-
contactPhones:
|
6865
|
-
activityLogs:
|
7226
|
+
customFields: z104.array(ContactCustomFieldSchema2),
|
7227
|
+
contactEmails: z104.array(ContactEmailsSchema2),
|
7228
|
+
contactPhones: z104.array(ContactPhonesSchema2),
|
7229
|
+
activityLogs: z104.array(ContactActivitySchema2).optional()
|
6866
7230
|
});
|
6867
7231
|
|
6868
7232
|
// src/public-api/validation.ts
|
6869
7233
|
var ContactContractValidationSchema2 = {
|
6870
7234
|
create: {
|
6871
|
-
request:
|
6872
|
-
name:
|
6873
|
-
email:
|
6874
|
-
|
6875
|
-
email:
|
6876
|
-
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()
|
6877
7241
|
})
|
6878
7242
|
).optional(),
|
6879
|
-
channel:
|
6880
|
-
address:
|
6881
|
-
phone:
|
6882
|
-
|
6883
|
-
phone:
|
6884
|
-
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()
|
6885
7249
|
})
|
6886
7250
|
).optional(),
|
6887
|
-
notes:
|
6888
|
-
tags:
|
6889
|
-
company:
|
6890
|
-
customFields:
|
7251
|
+
notes: z105.string().optional(),
|
7252
|
+
tags: z105.array(z105.string()).optional(),
|
7253
|
+
company: z105.string().optional(),
|
7254
|
+
customFields: z105.record(z105.string())
|
6891
7255
|
// Dynamic keys with string values
|
6892
7256
|
}),
|
6893
7257
|
response: ContactSchema2
|
6894
7258
|
},
|
6895
7259
|
getById: {
|
6896
|
-
request:
|
6897
|
-
id:
|
7260
|
+
request: z105.object({
|
7261
|
+
id: z105.string().uuid()
|
6898
7262
|
})
|
6899
7263
|
},
|
6900
7264
|
delete: {
|
6901
|
-
request:
|
6902
|
-
id:
|
7265
|
+
request: z105.object({
|
7266
|
+
id: z105.string().uuid()
|
6903
7267
|
})
|
6904
7268
|
},
|
6905
7269
|
getAll: {
|
6906
|
-
request:
|
6907
|
-
page:
|
6908
|
-
pageSize:
|
6909
|
-
keyword:
|
6910
|
-
company:
|
6911
|
-
name:
|
6912
|
-
address:
|
6913
|
-
channel:
|
6914
|
-
selectedDate:
|
6915
|
-
customFields:
|
6916
|
-
|
6917
|
-
attributeId:
|
6918
|
-
type:
|
6919
|
-
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())])
|
6920
7284
|
})
|
6921
7285
|
),
|
6922
|
-
tags:
|
6923
|
-
phone:
|
6924
|
-
email:
|
6925
|
-
notes:
|
7286
|
+
tags: z105.array(z105.string().uuid()),
|
7287
|
+
phone: z105.string(),
|
7288
|
+
email: z105.string(),
|
7289
|
+
notes: z105.string()
|
6926
7290
|
}).partial(),
|
6927
7291
|
response: {
|
6928
|
-
page:
|
6929
|
-
pageSize:
|
6930
|
-
total:
|
6931
|
-
lastPage:
|
6932
|
-
data:
|
7292
|
+
page: z105.number(),
|
7293
|
+
pageSize: z105.number(),
|
7294
|
+
total: z105.number(),
|
7295
|
+
lastPage: z105.number(),
|
7296
|
+
data: z105.array(ContactSchema2)
|
6933
7297
|
}
|
6934
7298
|
},
|
6935
7299
|
getContactFields: {
|
6936
|
-
request:
|
6937
|
-
page:
|
6938
|
-
pageSize:
|
7300
|
+
request: z105.object({
|
7301
|
+
page: z105.coerce.number().default(1),
|
7302
|
+
pageSize: z105.coerce.number().default(10)
|
6939
7303
|
}).partial(),
|
6940
7304
|
response: {
|
6941
|
-
page:
|
6942
|
-
pageSize:
|
6943
|
-
total:
|
6944
|
-
lastPage:
|
6945
|
-
data:
|
7305
|
+
page: z105.number(),
|
7306
|
+
pageSize: z105.number(),
|
7307
|
+
total: z105.number(),
|
7308
|
+
lastPage: z105.number(),
|
7309
|
+
data: z105.array(ContactCustomFieldSchema2)
|
6946
7310
|
}
|
6947
7311
|
},
|
6948
7312
|
addAttachments: {
|
6949
|
-
request:
|
6950
|
-
contactId:
|
6951
|
-
attributeId:
|
6952
|
-
contactAttachmentRecords:
|
6953
|
-
|
6954
|
-
bucketName:
|
6955
|
-
fileKey:
|
6956
|
-
fileName:
|
6957
|
-
fileSize:
|
6958
|
-
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()
|
6959
7323
|
})
|
6960
7324
|
)
|
6961
7325
|
}),
|
6962
|
-
response:
|
7326
|
+
response: CustomFieldSchema2
|
6963
7327
|
}
|
6964
7328
|
};
|
6965
7329
|
|
6966
7330
|
// src/public-api/index.ts
|
6967
|
-
var publicApiContract =
|
7331
|
+
var publicApiContract = initContract40().router(
|
6968
7332
|
{
|
6969
7333
|
createContact: {
|
6970
7334
|
method: "POST",
|
@@ -6974,11 +7338,11 @@ var publicApiContract = initContract38().router(
|
|
6974
7338
|
201: DefaultSuccessResponseSchema.extend({
|
6975
7339
|
data: ContactSchema2
|
6976
7340
|
}),
|
6977
|
-
400:
|
6978
|
-
message:
|
7341
|
+
400: z106.object({
|
7342
|
+
message: z106.string()
|
6979
7343
|
}),
|
6980
|
-
409:
|
6981
|
-
message:
|
7344
|
+
409: z106.object({
|
7345
|
+
message: z106.string()
|
6982
7346
|
}),
|
6983
7347
|
401: DefaultUnauthorizedSchema,
|
6984
7348
|
404: DefaultNotFoundSchema,
|
@@ -6993,13 +7357,13 @@ var publicApiContract = initContract38().router(
|
|
6993
7357
|
query: GetTagsSchema,
|
6994
7358
|
responses: {
|
6995
7359
|
200: DefaultSuccessResponseSchema.extend({
|
6996
|
-
tags:
|
7360
|
+
tags: z106.array(TagSchema)
|
6997
7361
|
}),
|
6998
|
-
400:
|
6999
|
-
message:
|
7362
|
+
400: z106.object({
|
7363
|
+
message: z106.string()
|
7000
7364
|
}),
|
7001
|
-
409:
|
7002
|
-
message:
|
7365
|
+
409: z106.object({
|
7366
|
+
message: z106.string()
|
7003
7367
|
}),
|
7004
7368
|
401: DefaultUnauthorizedSchema,
|
7005
7369
|
404: DefaultNotFoundSchema,
|
@@ -7015,11 +7379,11 @@ var publicApiContract = initContract38().router(
|
|
7015
7379
|
200: DefaultSuccessResponseSchema.extend(
|
7016
7380
|
ContactContractValidationSchema2.getAll.response
|
7017
7381
|
),
|
7018
|
-
400:
|
7019
|
-
message:
|
7382
|
+
400: z106.object({
|
7383
|
+
message: z106.string()
|
7020
7384
|
}),
|
7021
|
-
409:
|
7022
|
-
message:
|
7385
|
+
409: z106.object({
|
7386
|
+
message: z106.string()
|
7023
7387
|
}),
|
7024
7388
|
401: DefaultUnauthorizedSchema,
|
7025
7389
|
404: DefaultNotFoundSchema,
|
@@ -7036,11 +7400,11 @@ var publicApiContract = initContract38().router(
|
|
7036
7400
|
200: DefaultSuccessResponseSchema.extend(
|
7037
7401
|
ContactContractValidationSchema2.getContactFields.response
|
7038
7402
|
),
|
7039
|
-
400:
|
7040
|
-
message:
|
7403
|
+
400: z106.object({
|
7404
|
+
message: z106.string()
|
7041
7405
|
}),
|
7042
|
-
409:
|
7043
|
-
message:
|
7406
|
+
409: z106.object({
|
7407
|
+
message: z106.string()
|
7044
7408
|
}),
|
7045
7409
|
401: DefaultUnauthorizedSchema,
|
7046
7410
|
404: DefaultNotFoundSchema,
|
@@ -7054,17 +7418,17 @@ var publicApiContract = initContract38().router(
|
|
7054
7418
|
path: "/contacts/:id",
|
7055
7419
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7056
7420
|
responses: {
|
7057
|
-
200:
|
7058
|
-
status:
|
7059
|
-
message:
|
7421
|
+
200: z106.object({
|
7422
|
+
status: z106.string(),
|
7423
|
+
message: z106.string(),
|
7060
7424
|
data: ContactSchema2,
|
7061
|
-
requestId:
|
7425
|
+
requestId: z106.string()
|
7062
7426
|
}),
|
7063
|
-
400:
|
7064
|
-
message:
|
7427
|
+
400: z106.object({
|
7428
|
+
message: z106.string()
|
7065
7429
|
}),
|
7066
|
-
409:
|
7067
|
-
message:
|
7430
|
+
409: z106.object({
|
7431
|
+
message: z106.string()
|
7068
7432
|
}),
|
7069
7433
|
401: DefaultUnauthorizedSchema,
|
7070
7434
|
404: DefaultNotFoundSchema,
|
@@ -7082,11 +7446,11 @@ var publicApiContract = initContract38().router(
|
|
7082
7446
|
201: DefaultSuccessResponseSchema.extend({
|
7083
7447
|
message: ContactCustomFieldSchema2
|
7084
7448
|
}),
|
7085
|
-
400:
|
7086
|
-
message:
|
7449
|
+
400: z106.object({
|
7450
|
+
message: z106.string()
|
7087
7451
|
}),
|
7088
|
-
409:
|
7089
|
-
message:
|
7452
|
+
409: z106.object({
|
7453
|
+
message: z106.string()
|
7090
7454
|
}),
|
7091
7455
|
401: DefaultUnauthorizedSchema,
|
7092
7456
|
404: DefaultNotFoundSchema,
|
@@ -7100,17 +7464,17 @@ var publicApiContract = initContract38().router(
|
|
7100
7464
|
path: "/contacts/:id",
|
7101
7465
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7102
7466
|
responses: {
|
7103
|
-
200:
|
7104
|
-
status:
|
7105
|
-
message:
|
7467
|
+
200: z106.object({
|
7468
|
+
status: z106.string(),
|
7469
|
+
message: z106.string(),
|
7106
7470
|
data: ContactSchema2,
|
7107
|
-
requestId:
|
7471
|
+
requestId: z106.string()
|
7108
7472
|
}),
|
7109
|
-
400:
|
7110
|
-
message:
|
7473
|
+
400: z106.object({
|
7474
|
+
message: z106.string()
|
7111
7475
|
}),
|
7112
|
-
409:
|
7113
|
-
message:
|
7476
|
+
409: z106.object({
|
7477
|
+
message: z106.string()
|
7114
7478
|
}),
|
7115
7479
|
401: DefaultUnauthorizedSchema,
|
7116
7480
|
404: DefaultNotFoundSchema,
|
@@ -7124,17 +7488,17 @@ var publicApiContract = initContract38().router(
|
|
7124
7488
|
path: "/contacts/:id",
|
7125
7489
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7126
7490
|
responses: {
|
7127
|
-
200:
|
7128
|
-
status:
|
7129
|
-
message:
|
7491
|
+
200: z106.object({
|
7492
|
+
status: z106.string(),
|
7493
|
+
message: z106.string(),
|
7130
7494
|
data: ContactSchema2,
|
7131
|
-
requestId:
|
7495
|
+
requestId: z106.string()
|
7132
7496
|
}),
|
7133
|
-
400:
|
7134
|
-
message:
|
7497
|
+
400: z106.object({
|
7498
|
+
message: z106.string()
|
7135
7499
|
}),
|
7136
|
-
409:
|
7137
|
-
message:
|
7500
|
+
409: z106.object({
|
7501
|
+
message: z106.string()
|
7138
7502
|
}),
|
7139
7503
|
401: DefaultUnauthorizedSchema,
|
7140
7504
|
404: DefaultNotFoundSchema,
|
@@ -7151,7 +7515,7 @@ var publicApiContract = initContract38().router(
|
|
7151
7515
|
);
|
7152
7516
|
|
7153
7517
|
// src/contract.ts
|
7154
|
-
var apiContract =
|
7518
|
+
var apiContract = initContract41().router({
|
7155
7519
|
auth: authContract,
|
7156
7520
|
mail: mailContract,
|
7157
7521
|
cxLog: cxLogContract,
|
@@ -7172,37 +7536,39 @@ var apiContract = initContract39().router({
|
|
7172
7536
|
userPresenceStatusLog: userPresenceStatusLogContract,
|
7173
7537
|
company: companyContract,
|
7174
7538
|
evaluateForm: evaluateFormContract,
|
7175
|
-
upload: uploadContract
|
7539
|
+
upload: uploadContract,
|
7540
|
+
snippet: snippetContract
|
7176
7541
|
});
|
7177
|
-
var contactContract2 =
|
7542
|
+
var contactContract2 = initContract41().router({
|
7178
7543
|
contact: contactContract
|
7179
7544
|
});
|
7180
|
-
var ticketContract2 =
|
7545
|
+
var ticketContract2 = initContract41().router({
|
7181
7546
|
ticket: ticketContract
|
7182
7547
|
});
|
7183
|
-
var extensionContract2 =
|
7548
|
+
var extensionContract2 = initContract41().router({
|
7184
7549
|
extension: extensionContract
|
7185
7550
|
});
|
7186
|
-
var commentActivityContract =
|
7551
|
+
var commentActivityContract = initContract41().router({
|
7187
7552
|
comment: commentContract,
|
7188
7553
|
activityLog: activityLogContract
|
7189
7554
|
});
|
7190
|
-
var platformContract =
|
7555
|
+
var platformContract = initContract41().router({
|
7191
7556
|
line: lineContract,
|
7192
7557
|
messenger: messengerContract,
|
7193
7558
|
instagram: instagramContract,
|
7194
|
-
viber: viberContract
|
7559
|
+
viber: viberContract,
|
7560
|
+
webchat: webchatContract
|
7195
7561
|
});
|
7196
|
-
var chatContract =
|
7562
|
+
var chatContract = initContract41().router({
|
7197
7563
|
main: mainChatContract
|
7198
7564
|
});
|
7199
|
-
var telephonyContract =
|
7565
|
+
var telephonyContract = initContract41().router({
|
7200
7566
|
telephonyCdr: telephonyCdrContract
|
7201
7567
|
});
|
7202
|
-
var notificationContract =
|
7568
|
+
var notificationContract = initContract41().router({
|
7203
7569
|
notification: userNotificationContract
|
7204
7570
|
});
|
7205
|
-
var publicApiContract2 =
|
7571
|
+
var publicApiContract2 = initContract41().router({
|
7206
7572
|
publicApi: publicApiContract
|
7207
7573
|
});
|
7208
7574
|
export {
|
@@ -7227,6 +7593,7 @@ export {
|
|
7227
7593
|
platformContract,
|
7228
7594
|
publicApiContract2 as publicApiContract,
|
7229
7595
|
receiveMessageContract,
|
7596
|
+
snippetContract,
|
7230
7597
|
tagContract,
|
7231
7598
|
telephonyCdrContract,
|
7232
7599
|
telephonyContract,
|