@kl1/contracts 1.1.22 → 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 +605 -207
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +604 -207
- 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 +19857 -6726
- 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/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- 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/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 +7816 -4009
- package/dist/src/mail/mail-contract.d.ts.map +1 -1
- package/dist/src/mail/message-contract.d.ts +2103 -2
- package/dist/src/mail/message-contract.d.ts.map +1 -1
- package/dist/src/mail/room-contract.d.ts +1937 -455
- 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 +374 -8
- package/dist/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
- package/dist/src/mail/schemas/room.schema.d.ts +258 -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/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 +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),
|
@@ -4163,7 +4205,8 @@ var MailRoomSchema = z58.object({
|
|
4163
4205
|
messages: z58.array(MessageSchema2),
|
4164
4206
|
messagesAndLogs: MessagesAndLogsSchema,
|
4165
4207
|
mail: MailAccountSchema,
|
4166
|
-
unReadMessageCount: z58.number()
|
4208
|
+
unReadMessageCount: z58.number(),
|
4209
|
+
cxlog: CxLogSchema
|
4167
4210
|
});
|
4168
4211
|
var AttachmentSchema2 = z58.object({
|
4169
4212
|
fileName: z58.string(),
|
@@ -4182,7 +4225,15 @@ var RoomContractsValidationSchema = {
|
|
4182
4225
|
input: z59.object({
|
4183
4226
|
page: z59.coerce.number().default(1),
|
4184
4227
|
pageSize: z59.coerce.number().default(10),
|
4185
|
-
keyword: z59.
|
4228
|
+
keyword: z59.object({
|
4229
|
+
value: z59.string(),
|
4230
|
+
category: z59.union([z59.literal("contact"), z59.literal("message")])
|
4231
|
+
}).optional(),
|
4232
|
+
contactLabels: z59.array(z59.string()).optional(),
|
4233
|
+
channels: z59.array(z59.string().email()).optional(),
|
4234
|
+
date: z59.string().optional(),
|
4235
|
+
contacts: z59.array(z59.string()).optional(),
|
4236
|
+
assignees: z59.array(z59.string()).optional(),
|
4186
4237
|
level1: z59.union([
|
4187
4238
|
z59.literal("open"),
|
4188
4239
|
z59.literal("close"),
|
@@ -4207,9 +4258,14 @@ var RoomContractsValidationSchema = {
|
|
4207
4258
|
},
|
4208
4259
|
update: {
|
4209
4260
|
input: z59.object({
|
4210
|
-
|
4211
|
-
z59.
|
4212
|
-
|
4261
|
+
disposition: z59.union([
|
4262
|
+
z59.literal("resolved"),
|
4263
|
+
z59.literal("follow up"),
|
4264
|
+
z59.literal("escalated"),
|
4265
|
+
z59.literal("dropped"),
|
4266
|
+
z59.literal("prank"),
|
4267
|
+
z59.literal("blank")
|
4268
|
+
]).optional().nullable(),
|
4213
4269
|
assigneeId: z59.string().uuid().optional().nullable(),
|
4214
4270
|
note: z59.string().optional(),
|
4215
4271
|
tags: z59.array(z59.string().uuid()).optional(),
|
@@ -4253,19 +4309,37 @@ var roomContract = initContract18().router(
|
|
4253
4309
|
},
|
4254
4310
|
summary: "Get mail rooms"
|
4255
4311
|
},
|
4256
|
-
getById
|
4312
|
+
//added 'all' after because it has some conflict with getById route.
|
4313
|
+
getRoomCounts: {
|
4257
4314
|
method: "GET",
|
4258
|
-
path: "
|
4259
|
-
pathParams: z60.object({
|
4260
|
-
id: z60.string().uuid()
|
4261
|
-
}),
|
4315
|
+
path: "/count_rooms/all",
|
4262
4316
|
responses: {
|
4263
4317
|
200: DefaultSuccessResponseSchema.extend({
|
4264
|
-
data:
|
4318
|
+
data: z60.object({
|
4319
|
+
general: z60.array(
|
4320
|
+
z60.object({
|
4321
|
+
name: z60.string(),
|
4322
|
+
count: z60.number(),
|
4323
|
+
unReadMessagesCount: z60.number()
|
4324
|
+
})
|
4325
|
+
),
|
4326
|
+
channels: z60.array(
|
4327
|
+
z60.object({
|
4328
|
+
channel: MailAccountSchema,
|
4329
|
+
count: z60.number()
|
4330
|
+
})
|
4331
|
+
),
|
4332
|
+
contactLabels: z60.array(
|
4333
|
+
z60.object({
|
4334
|
+
label: TagSchema,
|
4335
|
+
count: z60.number()
|
4336
|
+
})
|
4337
|
+
)
|
4338
|
+
})
|
4265
4339
|
}),
|
4266
4340
|
...DefaultResponses
|
4267
4341
|
},
|
4268
|
-
summary:
|
4342
|
+
summary: 'Get unread message counts for filter like "open", "close", "inbox" and etc...'
|
4269
4343
|
},
|
4270
4344
|
getAttachments: {
|
4271
4345
|
method: "GET",
|
@@ -4311,6 +4385,20 @@ var roomContract = initContract18().router(
|
|
4311
4385
|
summary: "Update a mail room by id"
|
4312
4386
|
},
|
4313
4387
|
markAsRead: {
|
4388
|
+
method: "POST",
|
4389
|
+
path: "/mark_as_read",
|
4390
|
+
body: z60.object({
|
4391
|
+
id: z60.string()
|
4392
|
+
}),
|
4393
|
+
responses: {
|
4394
|
+
200: DefaultSuccessResponseSchema.extend({
|
4395
|
+
message: z60.string()
|
4396
|
+
}),
|
4397
|
+
...DefaultResponses
|
4398
|
+
},
|
4399
|
+
summary: "Mark all the unread messages of a room as read"
|
4400
|
+
},
|
4401
|
+
getById: {
|
4314
4402
|
method: "GET",
|
4315
4403
|
path: "/:id",
|
4316
4404
|
pathParams: z60.object({
|
@@ -4318,11 +4406,11 @@ var roomContract = initContract18().router(
|
|
4318
4406
|
}),
|
4319
4407
|
responses: {
|
4320
4408
|
200: DefaultSuccessResponseSchema.extend({
|
4321
|
-
|
4409
|
+
data: MailRoomSchema
|
4322
4410
|
}),
|
4323
4411
|
...DefaultResponses
|
4324
4412
|
},
|
4325
|
-
summary: "
|
4413
|
+
summary: "Get a mail room by id"
|
4326
4414
|
}
|
4327
4415
|
},
|
4328
4416
|
{
|
@@ -4388,7 +4476,7 @@ var accountContract = initContract19().router(
|
|
4388
4476
|
responses: {
|
4389
4477
|
201: DefaultSuccessResponseSchema.extend({
|
4390
4478
|
// data: AccountContractsValidationSchemas.create.output,
|
4391
|
-
|
4479
|
+
data: MailAccountSchema
|
4392
4480
|
}),
|
4393
4481
|
400: z62.object({
|
4394
4482
|
message: z62.string()
|
@@ -4405,6 +4493,18 @@ var accountContract = initContract19().router(
|
|
4405
4493
|
summary: "Register a new mail account"
|
4406
4494
|
},
|
4407
4495
|
//#endregion register account
|
4496
|
+
//#region ........sync all accounts
|
4497
|
+
sync: {
|
4498
|
+
method: "GET",
|
4499
|
+
path: "/sync",
|
4500
|
+
responses: {
|
4501
|
+
200: DefaultSuccessResponseSchema.extend({
|
4502
|
+
message: z62.string()
|
4503
|
+
}),
|
4504
|
+
...DefaultResponses
|
4505
|
+
},
|
4506
|
+
summary: "Sync all accounts state from email engine to system"
|
4507
|
+
},
|
4408
4508
|
//#region ........get account
|
4409
4509
|
getById: {
|
4410
4510
|
method: "GET",
|
@@ -4416,14 +4516,18 @@ var accountContract = initContract19().router(
|
|
4416
4516
|
}),
|
4417
4517
|
...DefaultResponses
|
4418
4518
|
},
|
4419
|
-
summary: "Get
|
4519
|
+
summary: "Get an account by id"
|
4420
4520
|
},
|
4421
4521
|
//#endregion get account
|
4522
|
+
//#endregion sync all accountss
|
4422
4523
|
//#region ........get all account
|
4423
|
-
//TODO: add pagination parameters
|
4424
4524
|
getAll: {
|
4425
4525
|
method: "GET",
|
4426
4526
|
path: "",
|
4527
|
+
query: z62.object({
|
4528
|
+
state: z62.union([z62.literal("connected"), z62.literal("disconnected")]).optional(),
|
4529
|
+
withDeleted: z62.boolean().default(false)
|
4530
|
+
}).optional(),
|
4427
4531
|
responses: {
|
4428
4532
|
200: DefaultSuccessResponseSchema.extend({
|
4429
4533
|
data: z62.array(MailAccountSchema)
|
@@ -4616,6 +4720,7 @@ var MessageContractsValidationsSchema = {
|
|
4616
4720
|
to: z65.array(MailParticipant),
|
4617
4721
|
cc: z65.array(MailParticipant).optional(),
|
4618
4722
|
bcc: z65.array(MailParticipant).optional(),
|
4723
|
+
sendAt: z65.string().optional(),
|
4619
4724
|
reference: z65.object({
|
4620
4725
|
messageId: z65.string(),
|
4621
4726
|
action: z65.union([z65.literal("reply"), z65.literal("forward")])
|
@@ -4654,8 +4759,25 @@ var messageContract = initContract21().router(
|
|
4654
4759
|
500: DefaultErrorResponseSchema
|
4655
4760
|
},
|
4656
4761
|
body: MessageContractsValidationsSchema.submit.input,
|
4657
|
-
summary: "Submit a message such compose, reply or forward"
|
4762
|
+
summary: "Submit a message such as compose, reply or forward"
|
4658
4763
|
},
|
4764
|
+
//#region get room counts for filter like 'open', 'close', 'inbox' and etc...
|
4765
|
+
//#endregion get unread message counts for filter like 'open', 'close', 'inbox' and etc...
|
4766
|
+
//#region get total unread messages counts
|
4767
|
+
getTotalUnreadMessageCount: {
|
4768
|
+
method: "GET",
|
4769
|
+
path: "/new_message_count",
|
4770
|
+
responses: {
|
4771
|
+
200: DefaultSuccessResponseSchema.extend({
|
4772
|
+
data: z66.object({
|
4773
|
+
count: z66.number()
|
4774
|
+
})
|
4775
|
+
}),
|
4776
|
+
...DefaultResponses
|
4777
|
+
},
|
4778
|
+
summary: "Get total unread messages counts"
|
4779
|
+
},
|
4780
|
+
//#endregion get total unread messages counts
|
4659
4781
|
//#region get a message
|
4660
4782
|
getById: {
|
4661
4783
|
method: "GET",
|
@@ -4669,9 +4791,60 @@ var messageContract = initContract21().router(
|
|
4669
4791
|
}),
|
4670
4792
|
...DefaultResponses
|
4671
4793
|
},
|
4672
|
-
summary: "Get a message
|
4673
|
-
}
|
4794
|
+
summary: "Get a message"
|
4795
|
+
},
|
4674
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
|
4675
4848
|
},
|
4676
4849
|
{
|
4677
4850
|
pathPrefix: "mail/message"
|
@@ -6792,170 +6965,391 @@ var userNotificationContract = initContract37().router(
|
|
6792
6965
|
}
|
6793
6966
|
);
|
6794
6967
|
|
6795
|
-
// src/
|
6968
|
+
// src/webchat/index.ts
|
6796
6969
|
import { initContract as initContract38 } from "@ts-rest/core";
|
6970
|
+
|
6971
|
+
// src/webchat/schema.ts
|
6972
|
+
import z100 from "zod";
|
6973
|
+
|
6974
|
+
// src/webchat/validation.ts
|
6975
|
+
import z99 from "zod";
|
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(),
|
6982
|
+
name: z99.string(),
|
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
|
6797
7037
|
import z101 from "zod";
|
7038
|
+
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7039
|
+
name: z101.string(),
|
7040
|
+
platformType: z101.string()
|
7041
|
+
});
|
7042
|
+
var SnippetContentSchema = DefaultEntitySchema.extend({
|
7043
|
+
contentType: z101.string(),
|
7044
|
+
contentValue: z101.string().nullable(),
|
7045
|
+
contentTemplate: z101.any().nullable(),
|
7046
|
+
order: z101.number(),
|
7047
|
+
upload: UploadSchema.optional().nullable()
|
7048
|
+
});
|
7049
|
+
var SnippetSchema = DefaultEntitySchema.extend({
|
7050
|
+
name: z101.string(),
|
7051
|
+
snippetGroup: SnippetGroupSchema,
|
7052
|
+
snippetContent: SnippetContentSchema
|
7053
|
+
});
|
7054
|
+
var SnippetGroupListItemSchema = z101.object({
|
7055
|
+
id: z101.string().uuid(),
|
7056
|
+
name: z101.string()
|
7057
|
+
});
|
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()
|
7064
|
+
});
|
7065
|
+
|
7066
|
+
// src/snippet/validation.ts
|
7067
|
+
import { z as z102 } from "zod";
|
7068
|
+
var CreateSnippetGroupSchema = z102.object({
|
7069
|
+
name: z102.string(),
|
7070
|
+
platformType: z102.string()
|
7071
|
+
});
|
7072
|
+
var UpdateSnippetGroupSchema = z102.object({
|
7073
|
+
name: z102.string().optional(),
|
7074
|
+
platformType: z102.string().optional()
|
7075
|
+
});
|
7076
|
+
var DeleteSnippetGroupSchema = z102.object({
|
7077
|
+
id: z102.string()
|
7078
|
+
});
|
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()
|
7085
|
+
});
|
7086
|
+
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
7087
|
+
snippetContentId: z102.string()
|
7088
|
+
});
|
7089
|
+
var DeleteSnippetSchema = z102.object({
|
7090
|
+
snippetId: z102.string()
|
7091
|
+
});
|
7092
|
+
|
7093
|
+
// src/snippet/index.ts
|
7094
|
+
var snippetContract = initContract39().router(
|
7095
|
+
{
|
7096
|
+
createSnippetGroup: {
|
7097
|
+
method: "POST",
|
7098
|
+
path: "/groups",
|
7099
|
+
body: CreateSnippetGroupSchema,
|
7100
|
+
responses: {
|
7101
|
+
201: DefaultSuccessResponseSchema.extend({
|
7102
|
+
snippetgroup: SnippetGroupSchema
|
7103
|
+
}),
|
7104
|
+
500: DefaultErrorResponseSchema
|
7105
|
+
}
|
7106
|
+
},
|
7107
|
+
getSnippetGroups: {
|
7108
|
+
method: "GET",
|
7109
|
+
path: "/groups",
|
7110
|
+
query: null,
|
7111
|
+
responses: {
|
7112
|
+
200: DefaultSuccessResponseSchema.extend({
|
7113
|
+
snippetgroups: z103.array(SnippetGroupSchema)
|
7114
|
+
}),
|
7115
|
+
500: DefaultErrorResponseSchema
|
7116
|
+
}
|
7117
|
+
},
|
7118
|
+
updateSnippetGroup: {
|
7119
|
+
method: "PATCH",
|
7120
|
+
path: "/groups/:id",
|
7121
|
+
pathParams: z103.object({ id: z103.string() }),
|
7122
|
+
body: UpdateSnippetGroupSchema,
|
7123
|
+
responses: {
|
7124
|
+
200: DefaultSuccessResponseSchema.extend({
|
7125
|
+
snippetgroup: SnippetGroupSchema
|
7126
|
+
}),
|
7127
|
+
500: DefaultErrorResponseSchema
|
7128
|
+
}
|
7129
|
+
},
|
7130
|
+
deleteSnippetGroup: {
|
7131
|
+
method: "DELETE",
|
7132
|
+
path: "/groups/:id",
|
7133
|
+
pathParams: z103.object({ id: z103.string() }),
|
7134
|
+
body: null,
|
7135
|
+
responses: {
|
7136
|
+
200: DefaultSuccessResponseSchema,
|
7137
|
+
500: DefaultErrorResponseSchema
|
7138
|
+
}
|
7139
|
+
},
|
7140
|
+
getSnippets: {
|
7141
|
+
method: "GET",
|
7142
|
+
path: "",
|
7143
|
+
responses: {
|
7144
|
+
200: DefaultSuccessResponseSchema.extend({
|
7145
|
+
snippets: z103.array(SnippetSchema)
|
7146
|
+
}),
|
7147
|
+
500: DefaultErrorResponseSchema
|
7148
|
+
}
|
7149
|
+
},
|
7150
|
+
createSnippet: {
|
7151
|
+
method: "POST",
|
7152
|
+
path: "",
|
7153
|
+
body: CreateSnippetSchema,
|
7154
|
+
responses: {
|
7155
|
+
201: DefaultSuccessResponseSchema.extend({
|
7156
|
+
snippet: SnippetSchema
|
7157
|
+
}),
|
7158
|
+
500: DefaultErrorResponseSchema
|
7159
|
+
}
|
7160
|
+
},
|
7161
|
+
updateSnippet: {
|
7162
|
+
method: "PATCH",
|
7163
|
+
path: "/:id",
|
7164
|
+
pathParams: z103.object({ id: z103.string() }),
|
7165
|
+
body: UpdateSnippetSchema,
|
7166
|
+
responses: {
|
7167
|
+
200: DefaultSuccessResponseSchema.extend({
|
7168
|
+
snippet: SnippetSchema
|
7169
|
+
}),
|
7170
|
+
500: DefaultErrorResponseSchema
|
7171
|
+
}
|
7172
|
+
},
|
7173
|
+
deleteSnippet: {
|
7174
|
+
method: "DELETE",
|
7175
|
+
path: "/:id",
|
7176
|
+
pathParams: z103.object({ id: z103.string() }),
|
7177
|
+
body: null,
|
7178
|
+
responses: {
|
7179
|
+
200: DefaultSuccessResponseSchema,
|
7180
|
+
500: DefaultErrorResponseSchema
|
7181
|
+
}
|
7182
|
+
}
|
7183
|
+
},
|
7184
|
+
{
|
7185
|
+
pathPrefix: "snippets"
|
7186
|
+
}
|
7187
|
+
);
|
7188
|
+
|
7189
|
+
// src/public-api/index.ts
|
7190
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
7191
|
+
import z106 from "zod";
|
6798
7192
|
|
6799
7193
|
// src/public-api/validation.ts
|
6800
|
-
import
|
7194
|
+
import z105 from "zod";
|
6801
7195
|
|
6802
7196
|
// 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:
|
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(),
|
6829
7223
|
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:
|
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(),
|
6847
7241
|
entityType: ContactEntityTypesSchema2
|
6848
7242
|
});
|
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:
|
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),
|
6861
7255
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
6862
|
-
customFields:
|
6863
|
-
contactEmails:
|
6864
|
-
contactPhones:
|
6865
|
-
activityLogs:
|
7256
|
+
customFields: z104.array(ContactCustomFieldSchema2),
|
7257
|
+
contactEmails: z104.array(ContactEmailsSchema2),
|
7258
|
+
contactPhones: z104.array(ContactPhonesSchema2),
|
7259
|
+
activityLogs: z104.array(ContactActivitySchema2).optional()
|
6866
7260
|
});
|
6867
7261
|
|
6868
7262
|
// src/public-api/validation.ts
|
6869
7263
|
var ContactContractValidationSchema2 = {
|
6870
7264
|
create: {
|
6871
|
-
request:
|
6872
|
-
name:
|
6873
|
-
email:
|
6874
|
-
|
6875
|
-
email:
|
6876
|
-
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()
|
6877
7271
|
})
|
6878
7272
|
).optional(),
|
6879
|
-
channel:
|
6880
|
-
address:
|
6881
|
-
phone:
|
6882
|
-
|
6883
|
-
phone:
|
6884
|
-
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()
|
6885
7279
|
})
|
6886
7280
|
).optional(),
|
6887
|
-
notes:
|
6888
|
-
tags:
|
6889
|
-
company:
|
6890
|
-
customFields:
|
7281
|
+
notes: z105.string().optional(),
|
7282
|
+
tags: z105.array(z105.string()).optional(),
|
7283
|
+
company: z105.string().optional(),
|
7284
|
+
customFields: z105.record(z105.string())
|
6891
7285
|
// Dynamic keys with string values
|
6892
7286
|
}),
|
6893
7287
|
response: ContactSchema2
|
6894
7288
|
},
|
6895
7289
|
getById: {
|
6896
|
-
request:
|
6897
|
-
id:
|
7290
|
+
request: z105.object({
|
7291
|
+
id: z105.string().uuid()
|
6898
7292
|
})
|
6899
7293
|
},
|
6900
7294
|
delete: {
|
6901
|
-
request:
|
6902
|
-
id:
|
7295
|
+
request: z105.object({
|
7296
|
+
id: z105.string().uuid()
|
6903
7297
|
})
|
6904
7298
|
},
|
6905
7299
|
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:
|
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())])
|
6920
7314
|
})
|
6921
7315
|
),
|
6922
|
-
tags:
|
6923
|
-
phone:
|
6924
|
-
email:
|
6925
|
-
notes:
|
7316
|
+
tags: z105.array(z105.string().uuid()),
|
7317
|
+
phone: z105.string(),
|
7318
|
+
email: z105.string(),
|
7319
|
+
notes: z105.string()
|
6926
7320
|
}).partial(),
|
6927
7321
|
response: {
|
6928
|
-
page:
|
6929
|
-
pageSize:
|
6930
|
-
total:
|
6931
|
-
lastPage:
|
6932
|
-
data:
|
7322
|
+
page: z105.number(),
|
7323
|
+
pageSize: z105.number(),
|
7324
|
+
total: z105.number(),
|
7325
|
+
lastPage: z105.number(),
|
7326
|
+
data: z105.array(ContactSchema2)
|
6933
7327
|
}
|
6934
7328
|
},
|
6935
7329
|
getContactFields: {
|
6936
|
-
request:
|
6937
|
-
page:
|
6938
|
-
pageSize:
|
7330
|
+
request: z105.object({
|
7331
|
+
page: z105.coerce.number().default(1),
|
7332
|
+
pageSize: z105.coerce.number().default(10)
|
6939
7333
|
}).partial(),
|
6940
7334
|
response: {
|
6941
|
-
page:
|
6942
|
-
pageSize:
|
6943
|
-
total:
|
6944
|
-
lastPage:
|
6945
|
-
data:
|
7335
|
+
page: z105.number(),
|
7336
|
+
pageSize: z105.number(),
|
7337
|
+
total: z105.number(),
|
7338
|
+
lastPage: z105.number(),
|
7339
|
+
data: z105.array(ContactCustomFieldSchema2)
|
6946
7340
|
}
|
6947
7341
|
},
|
6948
7342
|
addAttachments: {
|
6949
|
-
request:
|
6950
|
-
contactId:
|
6951
|
-
attributeId:
|
6952
|
-
contactAttachmentRecords:
|
6953
|
-
|
6954
|
-
bucketName:
|
6955
|
-
fileKey:
|
6956
|
-
fileName:
|
6957
|
-
fileSize:
|
6958
|
-
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()
|
6959
7353
|
})
|
6960
7354
|
)
|
6961
7355
|
}),
|
@@ -6964,7 +7358,7 @@ var ContactContractValidationSchema2 = {
|
|
6964
7358
|
};
|
6965
7359
|
|
6966
7360
|
// src/public-api/index.ts
|
6967
|
-
var publicApiContract =
|
7361
|
+
var publicApiContract = initContract40().router(
|
6968
7362
|
{
|
6969
7363
|
createContact: {
|
6970
7364
|
method: "POST",
|
@@ -6974,11 +7368,11 @@ var publicApiContract = initContract38().router(
|
|
6974
7368
|
201: DefaultSuccessResponseSchema.extend({
|
6975
7369
|
data: ContactSchema2
|
6976
7370
|
}),
|
6977
|
-
400:
|
6978
|
-
message:
|
7371
|
+
400: z106.object({
|
7372
|
+
message: z106.string()
|
6979
7373
|
}),
|
6980
|
-
409:
|
6981
|
-
message:
|
7374
|
+
409: z106.object({
|
7375
|
+
message: z106.string()
|
6982
7376
|
}),
|
6983
7377
|
401: DefaultUnauthorizedSchema,
|
6984
7378
|
404: DefaultNotFoundSchema,
|
@@ -6993,13 +7387,13 @@ var publicApiContract = initContract38().router(
|
|
6993
7387
|
query: GetTagsSchema,
|
6994
7388
|
responses: {
|
6995
7389
|
200: DefaultSuccessResponseSchema.extend({
|
6996
|
-
tags:
|
7390
|
+
tags: z106.array(TagSchema)
|
6997
7391
|
}),
|
6998
|
-
400:
|
6999
|
-
message:
|
7392
|
+
400: z106.object({
|
7393
|
+
message: z106.string()
|
7000
7394
|
}),
|
7001
|
-
409:
|
7002
|
-
message:
|
7395
|
+
409: z106.object({
|
7396
|
+
message: z106.string()
|
7003
7397
|
}),
|
7004
7398
|
401: DefaultUnauthorizedSchema,
|
7005
7399
|
404: DefaultNotFoundSchema,
|
@@ -7015,11 +7409,11 @@ var publicApiContract = initContract38().router(
|
|
7015
7409
|
200: DefaultSuccessResponseSchema.extend(
|
7016
7410
|
ContactContractValidationSchema2.getAll.response
|
7017
7411
|
),
|
7018
|
-
400:
|
7019
|
-
message:
|
7412
|
+
400: z106.object({
|
7413
|
+
message: z106.string()
|
7020
7414
|
}),
|
7021
|
-
409:
|
7022
|
-
message:
|
7415
|
+
409: z106.object({
|
7416
|
+
message: z106.string()
|
7023
7417
|
}),
|
7024
7418
|
401: DefaultUnauthorizedSchema,
|
7025
7419
|
404: DefaultNotFoundSchema,
|
@@ -7036,11 +7430,11 @@ var publicApiContract = initContract38().router(
|
|
7036
7430
|
200: DefaultSuccessResponseSchema.extend(
|
7037
7431
|
ContactContractValidationSchema2.getContactFields.response
|
7038
7432
|
),
|
7039
|
-
400:
|
7040
|
-
message:
|
7433
|
+
400: z106.object({
|
7434
|
+
message: z106.string()
|
7041
7435
|
}),
|
7042
|
-
409:
|
7043
|
-
message:
|
7436
|
+
409: z106.object({
|
7437
|
+
message: z106.string()
|
7044
7438
|
}),
|
7045
7439
|
401: DefaultUnauthorizedSchema,
|
7046
7440
|
404: DefaultNotFoundSchema,
|
@@ -7054,17 +7448,17 @@ var publicApiContract = initContract38().router(
|
|
7054
7448
|
path: "/contacts/:id",
|
7055
7449
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7056
7450
|
responses: {
|
7057
|
-
200:
|
7058
|
-
status:
|
7059
|
-
message:
|
7451
|
+
200: z106.object({
|
7452
|
+
status: z106.string(),
|
7453
|
+
message: z106.string(),
|
7060
7454
|
data: ContactSchema2,
|
7061
|
-
requestId:
|
7455
|
+
requestId: z106.string()
|
7062
7456
|
}),
|
7063
|
-
400:
|
7064
|
-
message:
|
7457
|
+
400: z106.object({
|
7458
|
+
message: z106.string()
|
7065
7459
|
}),
|
7066
|
-
409:
|
7067
|
-
message:
|
7460
|
+
409: z106.object({
|
7461
|
+
message: z106.string()
|
7068
7462
|
}),
|
7069
7463
|
401: DefaultUnauthorizedSchema,
|
7070
7464
|
404: DefaultNotFoundSchema,
|
@@ -7082,11 +7476,11 @@ var publicApiContract = initContract38().router(
|
|
7082
7476
|
201: DefaultSuccessResponseSchema.extend({
|
7083
7477
|
message: ContactCustomFieldSchema2
|
7084
7478
|
}),
|
7085
|
-
400:
|
7086
|
-
message:
|
7479
|
+
400: z106.object({
|
7480
|
+
message: z106.string()
|
7087
7481
|
}),
|
7088
|
-
409:
|
7089
|
-
message:
|
7482
|
+
409: z106.object({
|
7483
|
+
message: z106.string()
|
7090
7484
|
}),
|
7091
7485
|
401: DefaultUnauthorizedSchema,
|
7092
7486
|
404: DefaultNotFoundSchema,
|
@@ -7100,17 +7494,17 @@ var publicApiContract = initContract38().router(
|
|
7100
7494
|
path: "/contacts/:id",
|
7101
7495
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7102
7496
|
responses: {
|
7103
|
-
200:
|
7104
|
-
status:
|
7105
|
-
message:
|
7497
|
+
200: z106.object({
|
7498
|
+
status: z106.string(),
|
7499
|
+
message: z106.string(),
|
7106
7500
|
data: ContactSchema2,
|
7107
|
-
requestId:
|
7501
|
+
requestId: z106.string()
|
7108
7502
|
}),
|
7109
|
-
400:
|
7110
|
-
message:
|
7503
|
+
400: z106.object({
|
7504
|
+
message: z106.string()
|
7111
7505
|
}),
|
7112
|
-
409:
|
7113
|
-
message:
|
7506
|
+
409: z106.object({
|
7507
|
+
message: z106.string()
|
7114
7508
|
}),
|
7115
7509
|
401: DefaultUnauthorizedSchema,
|
7116
7510
|
404: DefaultNotFoundSchema,
|
@@ -7124,17 +7518,17 @@ var publicApiContract = initContract38().router(
|
|
7124
7518
|
path: "/contacts/:id",
|
7125
7519
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7126
7520
|
responses: {
|
7127
|
-
200:
|
7128
|
-
status:
|
7129
|
-
message:
|
7521
|
+
200: z106.object({
|
7522
|
+
status: z106.string(),
|
7523
|
+
message: z106.string(),
|
7130
7524
|
data: ContactSchema2,
|
7131
|
-
requestId:
|
7525
|
+
requestId: z106.string()
|
7132
7526
|
}),
|
7133
|
-
400:
|
7134
|
-
message:
|
7527
|
+
400: z106.object({
|
7528
|
+
message: z106.string()
|
7135
7529
|
}),
|
7136
|
-
409:
|
7137
|
-
message:
|
7530
|
+
409: z106.object({
|
7531
|
+
message: z106.string()
|
7138
7532
|
}),
|
7139
7533
|
401: DefaultUnauthorizedSchema,
|
7140
7534
|
404: DefaultNotFoundSchema,
|
@@ -7151,7 +7545,7 @@ var publicApiContract = initContract38().router(
|
|
7151
7545
|
);
|
7152
7546
|
|
7153
7547
|
// src/contract.ts
|
7154
|
-
var apiContract =
|
7548
|
+
var apiContract = initContract41().router({
|
7155
7549
|
auth: authContract,
|
7156
7550
|
mail: mailContract,
|
7157
7551
|
cxLog: cxLogContract,
|
@@ -7172,37 +7566,39 @@ var apiContract = initContract39().router({
|
|
7172
7566
|
userPresenceStatusLog: userPresenceStatusLogContract,
|
7173
7567
|
company: companyContract,
|
7174
7568
|
evaluateForm: evaluateFormContract,
|
7175
|
-
upload: uploadContract
|
7569
|
+
upload: uploadContract,
|
7570
|
+
snippet: snippetContract
|
7176
7571
|
});
|
7177
|
-
var contactContract2 =
|
7572
|
+
var contactContract2 = initContract41().router({
|
7178
7573
|
contact: contactContract
|
7179
7574
|
});
|
7180
|
-
var ticketContract2 =
|
7575
|
+
var ticketContract2 = initContract41().router({
|
7181
7576
|
ticket: ticketContract
|
7182
7577
|
});
|
7183
|
-
var extensionContract2 =
|
7578
|
+
var extensionContract2 = initContract41().router({
|
7184
7579
|
extension: extensionContract
|
7185
7580
|
});
|
7186
|
-
var commentActivityContract =
|
7581
|
+
var commentActivityContract = initContract41().router({
|
7187
7582
|
comment: commentContract,
|
7188
7583
|
activityLog: activityLogContract
|
7189
7584
|
});
|
7190
|
-
var platformContract =
|
7585
|
+
var platformContract = initContract41().router({
|
7191
7586
|
line: lineContract,
|
7192
7587
|
messenger: messengerContract,
|
7193
7588
|
instagram: instagramContract,
|
7194
|
-
viber: viberContract
|
7589
|
+
viber: viberContract,
|
7590
|
+
webchat: webchatContract
|
7195
7591
|
});
|
7196
|
-
var chatContract =
|
7592
|
+
var chatContract = initContract41().router({
|
7197
7593
|
main: mainChatContract
|
7198
7594
|
});
|
7199
|
-
var telephonyContract =
|
7595
|
+
var telephonyContract = initContract41().router({
|
7200
7596
|
telephonyCdr: telephonyCdrContract
|
7201
7597
|
});
|
7202
|
-
var notificationContract =
|
7598
|
+
var notificationContract = initContract41().router({
|
7203
7599
|
notification: userNotificationContract
|
7204
7600
|
});
|
7205
|
-
var publicApiContract2 =
|
7601
|
+
var publicApiContract2 = initContract41().router({
|
7206
7602
|
publicApi: publicApiContract
|
7207
7603
|
});
|
7208
7604
|
export {
|
@@ -7227,6 +7623,7 @@ export {
|
|
7227
7623
|
platformContract,
|
7228
7624
|
publicApiContract2 as publicApiContract,
|
7229
7625
|
receiveMessageContract,
|
7626
|
+
snippetContract,
|
7230
7627
|
tagContract,
|
7231
7628
|
telephonyCdrContract,
|
7232
7629
|
telephonyContract,
|