@kl1/contracts 1.1.22 → 1.1.23-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 +434 -195
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +433 -195
- package/dist/index.mjs.map +1 -1
- package/dist/src/contract.d.ts +4834 -2215
- package/dist/src/contract.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/line/schema.d.ts.map +1 -1
- package/dist/src/line/validation.d.ts.map +1 -1
- package/dist/src/mail/account-contract.d.ts +74 -1
- package/dist/src/mail/account-contract.d.ts.map +1 -1
- package/dist/src/mail/mail-contract.d.ts +1972 -528
- 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 +1767 -453
- package/dist/src/mail/room-contract.d.ts.map +1 -1
- package/dist/src/mail/schemas/room-validation.schema.d.ts +316 -6
- package/dist/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
- package/dist/src/mail/schemas/room.schema.d.ts +212 -0
- package/dist/src/mail/schemas/room.schema.d.ts.map +1 -1
- 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/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 initContract40 } from "@ts-rest/core";
|
3
3
|
|
4
4
|
// src/activity-log/index.ts
|
5
5
|
import { initContract } from "@ts-rest/core";
|
@@ -4163,7 +4163,8 @@ var MailRoomSchema = z58.object({
|
|
4163
4163
|
messages: z58.array(MessageSchema2),
|
4164
4164
|
messagesAndLogs: MessagesAndLogsSchema,
|
4165
4165
|
mail: MailAccountSchema,
|
4166
|
-
unReadMessageCount: z58.number()
|
4166
|
+
unReadMessageCount: z58.number(),
|
4167
|
+
cxlog: CxLogSchema
|
4167
4168
|
});
|
4168
4169
|
var AttachmentSchema2 = z58.object({
|
4169
4170
|
fileName: z58.string(),
|
@@ -4182,7 +4183,15 @@ var RoomContractsValidationSchema = {
|
|
4182
4183
|
input: z59.object({
|
4183
4184
|
page: z59.coerce.number().default(1),
|
4184
4185
|
pageSize: z59.coerce.number().default(10),
|
4185
|
-
keyword: z59.
|
4186
|
+
keyword: z59.object({
|
4187
|
+
value: z59.string(),
|
4188
|
+
category: z59.union([z59.literal("contact"), z59.literal("message")])
|
4189
|
+
}).optional(),
|
4190
|
+
contactLabels: z59.array(z59.string()).optional(),
|
4191
|
+
channels: z59.array(z59.string().email()).optional(),
|
4192
|
+
date: z59.string().optional(),
|
4193
|
+
contacts: z59.array(z59.string()).optional(),
|
4194
|
+
assignees: z59.array(z59.string()).optional(),
|
4186
4195
|
level1: z59.union([
|
4187
4196
|
z59.literal("open"),
|
4188
4197
|
z59.literal("close"),
|
@@ -4207,9 +4216,14 @@ var RoomContractsValidationSchema = {
|
|
4207
4216
|
},
|
4208
4217
|
update: {
|
4209
4218
|
input: z59.object({
|
4210
|
-
|
4211
|
-
z59.
|
4212
|
-
|
4219
|
+
disposition: z59.union([
|
4220
|
+
z59.literal("resolved"),
|
4221
|
+
z59.literal("follow up"),
|
4222
|
+
z59.literal("escalated"),
|
4223
|
+
z59.literal("dropped"),
|
4224
|
+
z59.literal("prank"),
|
4225
|
+
z59.literal("blank")
|
4226
|
+
]).optional().nullable(),
|
4213
4227
|
assigneeId: z59.string().uuid().optional().nullable(),
|
4214
4228
|
note: z59.string().optional(),
|
4215
4229
|
tags: z59.array(z59.string().uuid()).optional(),
|
@@ -4253,19 +4267,37 @@ var roomContract = initContract18().router(
|
|
4253
4267
|
},
|
4254
4268
|
summary: "Get mail rooms"
|
4255
4269
|
},
|
4256
|
-
getById
|
4270
|
+
//added 'all' after because it has some conflict with getById route.
|
4271
|
+
getRoomCounts: {
|
4257
4272
|
method: "GET",
|
4258
|
-
path: "
|
4259
|
-
pathParams: z60.object({
|
4260
|
-
id: z60.string().uuid()
|
4261
|
-
}),
|
4273
|
+
path: "/count_rooms/all",
|
4262
4274
|
responses: {
|
4263
4275
|
200: DefaultSuccessResponseSchema.extend({
|
4264
|
-
data:
|
4276
|
+
data: z60.object({
|
4277
|
+
general: z60.array(
|
4278
|
+
z60.object({
|
4279
|
+
name: z60.string(),
|
4280
|
+
count: z60.number(),
|
4281
|
+
unReadMessagesCount: z60.number()
|
4282
|
+
})
|
4283
|
+
),
|
4284
|
+
channels: z60.array(
|
4285
|
+
z60.object({
|
4286
|
+
channel: MailAccountSchema,
|
4287
|
+
count: z60.number()
|
4288
|
+
})
|
4289
|
+
),
|
4290
|
+
contactLabels: z60.array(
|
4291
|
+
z60.object({
|
4292
|
+
label: TagSchema,
|
4293
|
+
count: z60.number()
|
4294
|
+
})
|
4295
|
+
)
|
4296
|
+
})
|
4265
4297
|
}),
|
4266
4298
|
...DefaultResponses
|
4267
4299
|
},
|
4268
|
-
summary:
|
4300
|
+
summary: 'Get unread message counts for filter like "open", "close", "inbox" and etc...'
|
4269
4301
|
},
|
4270
4302
|
getAttachments: {
|
4271
4303
|
method: "GET",
|
@@ -4311,6 +4343,20 @@ var roomContract = initContract18().router(
|
|
4311
4343
|
summary: "Update a mail room by id"
|
4312
4344
|
},
|
4313
4345
|
markAsRead: {
|
4346
|
+
method: "POST",
|
4347
|
+
path: "/mark_as_read",
|
4348
|
+
body: z60.object({
|
4349
|
+
id: z60.string()
|
4350
|
+
}),
|
4351
|
+
responses: {
|
4352
|
+
200: DefaultSuccessResponseSchema.extend({
|
4353
|
+
message: z60.string()
|
4354
|
+
}),
|
4355
|
+
...DefaultResponses
|
4356
|
+
},
|
4357
|
+
summary: "Mark all the unread messages of a room as read"
|
4358
|
+
},
|
4359
|
+
getById: {
|
4314
4360
|
method: "GET",
|
4315
4361
|
path: "/:id",
|
4316
4362
|
pathParams: z60.object({
|
@@ -4318,11 +4364,11 @@ var roomContract = initContract18().router(
|
|
4318
4364
|
}),
|
4319
4365
|
responses: {
|
4320
4366
|
200: DefaultSuccessResponseSchema.extend({
|
4321
|
-
|
4367
|
+
data: MailRoomSchema
|
4322
4368
|
}),
|
4323
4369
|
...DefaultResponses
|
4324
4370
|
},
|
4325
|
-
summary: "
|
4371
|
+
summary: "Get a mail room by id"
|
4326
4372
|
}
|
4327
4373
|
},
|
4328
4374
|
{
|
@@ -4405,6 +4451,18 @@ var accountContract = initContract19().router(
|
|
4405
4451
|
summary: "Register a new mail account"
|
4406
4452
|
},
|
4407
4453
|
//#endregion register account
|
4454
|
+
//#region ........sync all accounts
|
4455
|
+
sync: {
|
4456
|
+
method: "GET",
|
4457
|
+
path: "/sync",
|
4458
|
+
responses: {
|
4459
|
+
200: DefaultSuccessResponseSchema.extend({
|
4460
|
+
message: z62.string()
|
4461
|
+
}),
|
4462
|
+
...DefaultResponses
|
4463
|
+
},
|
4464
|
+
summary: "Sync all accounts state from email engine to system"
|
4465
|
+
},
|
4408
4466
|
//#region ........get account
|
4409
4467
|
getById: {
|
4410
4468
|
method: "GET",
|
@@ -4416,14 +4474,18 @@ var accountContract = initContract19().router(
|
|
4416
4474
|
}),
|
4417
4475
|
...DefaultResponses
|
4418
4476
|
},
|
4419
|
-
summary: "Get
|
4477
|
+
summary: "Get an account by id"
|
4420
4478
|
},
|
4421
4479
|
//#endregion get account
|
4480
|
+
//#endregion sync all accountss
|
4422
4481
|
//#region ........get all account
|
4423
|
-
//TODO: add pagination parameters
|
4424
4482
|
getAll: {
|
4425
4483
|
method: "GET",
|
4426
4484
|
path: "",
|
4485
|
+
query: z62.object({
|
4486
|
+
state: z62.union([z62.literal("connected"), z62.literal("disconnected")]).optional(),
|
4487
|
+
withDeleted: z62.boolean().default(false)
|
4488
|
+
}).optional(),
|
4427
4489
|
responses: {
|
4428
4490
|
200: DefaultSuccessResponseSchema.extend({
|
4429
4491
|
data: z62.array(MailAccountSchema)
|
@@ -4654,8 +4716,25 @@ var messageContract = initContract21().router(
|
|
4654
4716
|
500: DefaultErrorResponseSchema
|
4655
4717
|
},
|
4656
4718
|
body: MessageContractsValidationsSchema.submit.input,
|
4657
|
-
summary: "Submit a message such compose, reply or forward"
|
4719
|
+
summary: "Submit a message such as compose, reply or forward"
|
4720
|
+
},
|
4721
|
+
//#region get room counts for filter like 'open', 'close', 'inbox' and etc...
|
4722
|
+
//#endregion get unread message counts for filter like 'open', 'close', 'inbox' and etc...
|
4723
|
+
//#region get total unread messages counts
|
4724
|
+
getTotalUnreadMessageCount: {
|
4725
|
+
method: "GET",
|
4726
|
+
path: "/new_message_count",
|
4727
|
+
responses: {
|
4728
|
+
200: DefaultSuccessResponseSchema.extend({
|
4729
|
+
data: z66.object({
|
4730
|
+
count: z66.number()
|
4731
|
+
})
|
4732
|
+
}),
|
4733
|
+
...DefaultResponses
|
4734
|
+
},
|
4735
|
+
summary: "Get total unread messages counts"
|
4658
4736
|
},
|
4737
|
+
//#endregion get total unread messages counts
|
4659
4738
|
//#region get a message
|
4660
4739
|
getById: {
|
4661
4740
|
method: "GET",
|
@@ -6792,170 +6871,327 @@ var userNotificationContract = initContract37().router(
|
|
6792
6871
|
}
|
6793
6872
|
);
|
6794
6873
|
|
6795
|
-
// src/
|
6874
|
+
// src/snippet/index.ts
|
6796
6875
|
import { initContract as initContract38 } from "@ts-rest/core";
|
6797
|
-
import z101 from "zod";
|
6798
|
-
|
6799
|
-
// src/public-api/validation.ts
|
6800
|
-
import z100 from "zod";
|
6876
|
+
import { z as z101 } from "zod";
|
6801
6877
|
|
6802
|
-
// src/
|
6878
|
+
// src/snippet/schema.ts
|
6803
6879
|
import z99 from "zod";
|
6804
|
-
var
|
6805
|
-
|
6806
|
-
|
6807
|
-
updatedAt: z99.date(),
|
6808
|
-
deletedAt: z99.date().nullable(),
|
6809
|
-
phone: z99.string(),
|
6810
|
-
isPrimary: z99.boolean()
|
6880
|
+
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
6881
|
+
name: z99.string(),
|
6882
|
+
platformType: z99.string()
|
6811
6883
|
});
|
6812
|
-
var
|
6813
|
-
|
6814
|
-
|
6815
|
-
|
6816
|
-
|
6817
|
-
|
6818
|
-
isPrimary: z99.boolean()
|
6884
|
+
var SnippetContentSchema = DefaultEntitySchema.extend({
|
6885
|
+
contentType: z99.string(),
|
6886
|
+
contentValue: z99.string().nullable(),
|
6887
|
+
contentTemplate: z99.any().nullable(),
|
6888
|
+
order: z99.number(),
|
6889
|
+
upload: UploadSchema.optional().nullable()
|
6819
6890
|
});
|
6820
|
-
var
|
6821
|
-
|
6822
|
-
|
6823
|
-
|
6824
|
-
deletedAt: z99.date().nullable(),
|
6825
|
-
textValue: z99.string().nullable(),
|
6826
|
-
booleanValue: z99.boolean().nullable(),
|
6827
|
-
numberValue: z99.number().nullable(),
|
6828
|
-
dateValue: z99.date().nullable(),
|
6829
|
-
attribute: AttributeSchema.omit({ options: true, group: true }),
|
6830
|
-
uploads: z99.array(UploadSchema)
|
6891
|
+
var SnippetSchema = DefaultEntitySchema.extend({
|
6892
|
+
name: z99.string(),
|
6893
|
+
snippetGroup: SnippetGroupSchema,
|
6894
|
+
snippetContent: SnippetContentSchema
|
6831
6895
|
});
|
6832
|
-
var
|
6896
|
+
var SnippetGroupListItemSchema = z99.object({
|
6833
6897
|
id: z99.string().uuid(),
|
6834
|
-
|
6835
|
-
updatedAt: z99.date(),
|
6836
|
-
deletedAt: z99.date().nullable(),
|
6837
|
-
entity: z99.string(),
|
6838
|
-
description: z99.string().nullable()
|
6898
|
+
name: z99.string()
|
6839
6899
|
});
|
6840
|
-
var
|
6900
|
+
var SnippetListItemSchema = z99.object({
|
6841
6901
|
id: z99.string().uuid(),
|
6842
|
-
|
6843
|
-
|
6844
|
-
|
6845
|
-
|
6846
|
-
|
6902
|
+
shortCutName: z99.string(),
|
6903
|
+
contentType: z99.string(),
|
6904
|
+
contentValue: z99.string().nullable(),
|
6905
|
+
snippetGroupId: z99.string()
|
6906
|
+
});
|
6907
|
+
|
6908
|
+
// src/snippet/validation.ts
|
6909
|
+
import { z as z100 } from "zod";
|
6910
|
+
var CreateSnippetGroupSchema = z100.object({
|
6911
|
+
name: z100.string(),
|
6912
|
+
platformType: z100.string()
|
6913
|
+
});
|
6914
|
+
var UpdateSnippetGroupSchema = z100.object({
|
6915
|
+
name: z100.string().optional(),
|
6916
|
+
platformType: z100.string().optional()
|
6917
|
+
});
|
6918
|
+
var DeleteSnippetGroupSchema = z100.object({
|
6919
|
+
id: z100.string()
|
6920
|
+
});
|
6921
|
+
var CreateSnippetSchema = z100.object({
|
6922
|
+
shortcutName: z100.string(),
|
6923
|
+
contentType: z100.string(),
|
6924
|
+
contentValue: z100.string().optional(),
|
6925
|
+
snippetGroupId: z100.string(),
|
6926
|
+
platformType: z100.string()
|
6927
|
+
});
|
6928
|
+
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
6929
|
+
snippetContentId: z100.string()
|
6930
|
+
});
|
6931
|
+
var DeleteSnippetSchema = z100.object({
|
6932
|
+
snippetId: z100.string()
|
6933
|
+
});
|
6934
|
+
|
6935
|
+
// src/snippet/index.ts
|
6936
|
+
var snippetContract = initContract38().router(
|
6937
|
+
{
|
6938
|
+
createSnippetGroup: {
|
6939
|
+
method: "POST",
|
6940
|
+
path: "/groups",
|
6941
|
+
body: CreateSnippetGroupSchema,
|
6942
|
+
responses: {
|
6943
|
+
201: DefaultSuccessResponseSchema.extend({
|
6944
|
+
snippetgroup: SnippetGroupSchema
|
6945
|
+
}),
|
6946
|
+
500: DefaultErrorResponseSchema
|
6947
|
+
}
|
6948
|
+
},
|
6949
|
+
getSnippetGroups: {
|
6950
|
+
method: "GET",
|
6951
|
+
path: "/groups",
|
6952
|
+
query: null,
|
6953
|
+
responses: {
|
6954
|
+
200: DefaultSuccessResponseSchema.extend({
|
6955
|
+
snippetgroups: z101.array(SnippetGroupSchema)
|
6956
|
+
}),
|
6957
|
+
500: DefaultErrorResponseSchema
|
6958
|
+
}
|
6959
|
+
},
|
6960
|
+
updateSnippetGroup: {
|
6961
|
+
method: "PATCH",
|
6962
|
+
path: "/groups/:id",
|
6963
|
+
pathParams: z101.object({ id: z101.string() }),
|
6964
|
+
body: UpdateSnippetGroupSchema,
|
6965
|
+
responses: {
|
6966
|
+
200: DefaultSuccessResponseSchema.extend({
|
6967
|
+
snippetgroup: SnippetGroupSchema
|
6968
|
+
}),
|
6969
|
+
500: DefaultErrorResponseSchema
|
6970
|
+
}
|
6971
|
+
},
|
6972
|
+
deleteSnippetGroup: {
|
6973
|
+
method: "DELETE",
|
6974
|
+
path: "/groups/:id",
|
6975
|
+
pathParams: z101.object({ id: z101.string() }),
|
6976
|
+
body: null,
|
6977
|
+
responses: {
|
6978
|
+
200: DefaultSuccessResponseSchema,
|
6979
|
+
500: DefaultErrorResponseSchema
|
6980
|
+
}
|
6981
|
+
},
|
6982
|
+
getSnippets: {
|
6983
|
+
method: "GET",
|
6984
|
+
path: "",
|
6985
|
+
responses: {
|
6986
|
+
200: DefaultSuccessResponseSchema.extend({
|
6987
|
+
snippets: z101.array(SnippetSchema)
|
6988
|
+
}),
|
6989
|
+
500: DefaultErrorResponseSchema
|
6990
|
+
}
|
6991
|
+
},
|
6992
|
+
createSnippet: {
|
6993
|
+
method: "POST",
|
6994
|
+
path: "",
|
6995
|
+
body: CreateSnippetSchema,
|
6996
|
+
responses: {
|
6997
|
+
201: DefaultSuccessResponseSchema.extend({
|
6998
|
+
snippet: SnippetSchema
|
6999
|
+
}),
|
7000
|
+
500: DefaultErrorResponseSchema
|
7001
|
+
}
|
7002
|
+
},
|
7003
|
+
updateSnippet: {
|
7004
|
+
method: "PATCH",
|
7005
|
+
path: "/:id",
|
7006
|
+
pathParams: z101.object({ id: z101.string() }),
|
7007
|
+
body: UpdateSnippetSchema,
|
7008
|
+
responses: {
|
7009
|
+
200: DefaultSuccessResponseSchema.extend({
|
7010
|
+
snippet: SnippetSchema
|
7011
|
+
}),
|
7012
|
+
500: DefaultErrorResponseSchema
|
7013
|
+
}
|
7014
|
+
},
|
7015
|
+
deleteSnippet: {
|
7016
|
+
method: "DELETE",
|
7017
|
+
path: "/:id",
|
7018
|
+
pathParams: z101.object({ id: z101.string() }),
|
7019
|
+
body: null,
|
7020
|
+
responses: {
|
7021
|
+
200: DefaultSuccessResponseSchema,
|
7022
|
+
500: DefaultErrorResponseSchema
|
7023
|
+
}
|
7024
|
+
}
|
7025
|
+
},
|
7026
|
+
{
|
7027
|
+
pathPrefix: "snippets"
|
7028
|
+
}
|
7029
|
+
);
|
7030
|
+
|
7031
|
+
// src/public-api/index.ts
|
7032
|
+
import { initContract as initContract39 } from "@ts-rest/core";
|
7033
|
+
import z104 from "zod";
|
7034
|
+
|
7035
|
+
// src/public-api/validation.ts
|
7036
|
+
import z103 from "zod";
|
7037
|
+
|
7038
|
+
// src/public-api/schema.ts
|
7039
|
+
import z102 from "zod";
|
7040
|
+
var ContactPhonesSchema2 = z102.object({
|
7041
|
+
id: z102.string().uuid(),
|
7042
|
+
createdAt: z102.date(),
|
7043
|
+
updatedAt: z102.date(),
|
7044
|
+
deletedAt: z102.date().nullable(),
|
7045
|
+
phone: z102.string(),
|
7046
|
+
isPrimary: z102.boolean()
|
7047
|
+
});
|
7048
|
+
var ContactEmailsSchema2 = z102.object({
|
7049
|
+
id: z102.string().uuid(),
|
7050
|
+
createdAt: z102.date(),
|
7051
|
+
updatedAt: z102.date(),
|
7052
|
+
deletedAt: z102.date().nullable(),
|
7053
|
+
email: z102.string(),
|
7054
|
+
isPrimary: z102.boolean()
|
7055
|
+
});
|
7056
|
+
var ContactCustomFieldSchema2 = z102.object({
|
7057
|
+
id: z102.string().uuid(),
|
7058
|
+
createdAt: z102.date(),
|
7059
|
+
updatedAt: z102.date(),
|
7060
|
+
deletedAt: z102.date().nullable(),
|
7061
|
+
textValue: z102.string().nullable(),
|
7062
|
+
booleanValue: z102.boolean().nullable(),
|
7063
|
+
numberValue: z102.number().nullable(),
|
7064
|
+
dateValue: z102.date().nullable(),
|
7065
|
+
attribute: AttributeSchema.omit({ options: true, group: true }),
|
7066
|
+
uploads: z102.array(UploadSchema)
|
7067
|
+
});
|
7068
|
+
var ContactEntityTypesSchema2 = z102.object({
|
7069
|
+
id: z102.string().uuid(),
|
7070
|
+
createdAt: z102.date(),
|
7071
|
+
updatedAt: z102.date(),
|
7072
|
+
deletedAt: z102.date().nullable(),
|
7073
|
+
entity: z102.string(),
|
7074
|
+
description: z102.string().nullable()
|
7075
|
+
});
|
7076
|
+
var ContactActivitySchema2 = z102.object({
|
7077
|
+
id: z102.string().uuid(),
|
7078
|
+
createdAt: z102.date(),
|
7079
|
+
updatedAt: z102.date(),
|
7080
|
+
deletedAt: z102.date().nullable(),
|
7081
|
+
entityId: z102.string(),
|
7082
|
+
description: z102.string(),
|
6847
7083
|
entityType: ContactEntityTypesSchema2
|
6848
7084
|
});
|
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:
|
7085
|
+
var ContactSchema2 = z102.object({
|
7086
|
+
id: z102.string().uuid(),
|
7087
|
+
createdAt: z102.date(),
|
7088
|
+
updatedAt: z102.date(),
|
7089
|
+
deletedAt: z102.date().nullable(),
|
7090
|
+
name: z102.string(),
|
7091
|
+
address: z102.string().nullable(),
|
7092
|
+
channel: z102.string().nullable(),
|
7093
|
+
notes: z102.string().nullable(),
|
7094
|
+
contactProfile: z102.string().nullable(),
|
7095
|
+
socialProfileUrl: z102.string().nullable(),
|
7096
|
+
tags: z102.array(TagSchema),
|
6861
7097
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
6862
|
-
customFields:
|
6863
|
-
contactEmails:
|
6864
|
-
contactPhones:
|
6865
|
-
activityLogs:
|
7098
|
+
customFields: z102.array(ContactCustomFieldSchema2),
|
7099
|
+
contactEmails: z102.array(ContactEmailsSchema2),
|
7100
|
+
contactPhones: z102.array(ContactPhonesSchema2),
|
7101
|
+
activityLogs: z102.array(ContactActivitySchema2).optional()
|
6866
7102
|
});
|
6867
7103
|
|
6868
7104
|
// src/public-api/validation.ts
|
6869
7105
|
var ContactContractValidationSchema2 = {
|
6870
7106
|
create: {
|
6871
|
-
request:
|
6872
|
-
name:
|
6873
|
-
email:
|
6874
|
-
|
6875
|
-
email:
|
6876
|
-
isPrimary:
|
7107
|
+
request: z103.object({
|
7108
|
+
name: z103.string(),
|
7109
|
+
email: z103.array(
|
7110
|
+
z103.object({
|
7111
|
+
email: z103.string().email(),
|
7112
|
+
isPrimary: z103.boolean()
|
6877
7113
|
})
|
6878
7114
|
).optional(),
|
6879
|
-
channel:
|
6880
|
-
address:
|
6881
|
-
phone:
|
6882
|
-
|
6883
|
-
phone:
|
6884
|
-
isPrimary:
|
7115
|
+
channel: z103.string().optional(),
|
7116
|
+
address: z103.string().optional(),
|
7117
|
+
phone: z103.array(
|
7118
|
+
z103.object({
|
7119
|
+
phone: z103.string(),
|
7120
|
+
isPrimary: z103.boolean()
|
6885
7121
|
})
|
6886
7122
|
).optional(),
|
6887
|
-
notes:
|
6888
|
-
tags:
|
6889
|
-
company:
|
6890
|
-
customFields:
|
7123
|
+
notes: z103.string().optional(),
|
7124
|
+
tags: z103.array(z103.string()).optional(),
|
7125
|
+
company: z103.string().optional(),
|
7126
|
+
customFields: z103.record(z103.string())
|
6891
7127
|
// Dynamic keys with string values
|
6892
7128
|
}),
|
6893
7129
|
response: ContactSchema2
|
6894
7130
|
},
|
6895
7131
|
getById: {
|
6896
|
-
request:
|
6897
|
-
id:
|
7132
|
+
request: z103.object({
|
7133
|
+
id: z103.string().uuid()
|
6898
7134
|
})
|
6899
7135
|
},
|
6900
7136
|
delete: {
|
6901
|
-
request:
|
6902
|
-
id:
|
7137
|
+
request: z103.object({
|
7138
|
+
id: z103.string().uuid()
|
6903
7139
|
})
|
6904
7140
|
},
|
6905
7141
|
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:
|
7142
|
+
request: z103.object({
|
7143
|
+
page: z103.coerce.number().default(1),
|
7144
|
+
pageSize: z103.coerce.number().default(10),
|
7145
|
+
keyword: z103.string().optional(),
|
7146
|
+
company: z103.array(z103.string().uuid()),
|
7147
|
+
name: z103.string(),
|
7148
|
+
address: z103.string(),
|
7149
|
+
channel: z103.array(z103.string()),
|
7150
|
+
selectedDate: z103.string(),
|
7151
|
+
customFields: z103.array(
|
7152
|
+
z103.object({
|
7153
|
+
attributeId: z103.string().uuid(),
|
7154
|
+
type: z103.string(),
|
7155
|
+
value: z103.union([z103.string(), z103.array(z103.string())])
|
6920
7156
|
})
|
6921
7157
|
),
|
6922
|
-
tags:
|
6923
|
-
phone:
|
6924
|
-
email:
|
6925
|
-
notes:
|
7158
|
+
tags: z103.array(z103.string().uuid()),
|
7159
|
+
phone: z103.string(),
|
7160
|
+
email: z103.string(),
|
7161
|
+
notes: z103.string()
|
6926
7162
|
}).partial(),
|
6927
7163
|
response: {
|
6928
|
-
page:
|
6929
|
-
pageSize:
|
6930
|
-
total:
|
6931
|
-
lastPage:
|
6932
|
-
data:
|
7164
|
+
page: z103.number(),
|
7165
|
+
pageSize: z103.number(),
|
7166
|
+
total: z103.number(),
|
7167
|
+
lastPage: z103.number(),
|
7168
|
+
data: z103.array(ContactSchema2)
|
6933
7169
|
}
|
6934
7170
|
},
|
6935
7171
|
getContactFields: {
|
6936
|
-
request:
|
6937
|
-
page:
|
6938
|
-
pageSize:
|
7172
|
+
request: z103.object({
|
7173
|
+
page: z103.coerce.number().default(1),
|
7174
|
+
pageSize: z103.coerce.number().default(10)
|
6939
7175
|
}).partial(),
|
6940
7176
|
response: {
|
6941
|
-
page:
|
6942
|
-
pageSize:
|
6943
|
-
total:
|
6944
|
-
lastPage:
|
6945
|
-
data:
|
7177
|
+
page: z103.number(),
|
7178
|
+
pageSize: z103.number(),
|
7179
|
+
total: z103.number(),
|
7180
|
+
lastPage: z103.number(),
|
7181
|
+
data: z103.array(ContactCustomFieldSchema2)
|
6946
7182
|
}
|
6947
7183
|
},
|
6948
7184
|
addAttachments: {
|
6949
|
-
request:
|
6950
|
-
contactId:
|
6951
|
-
attributeId:
|
6952
|
-
contactAttachmentRecords:
|
6953
|
-
|
6954
|
-
bucketName:
|
6955
|
-
fileKey:
|
6956
|
-
fileName:
|
6957
|
-
fileSize:
|
6958
|
-
url:
|
7185
|
+
request: z103.object({
|
7186
|
+
contactId: z103.string(),
|
7187
|
+
attributeId: z103.string().uuid(),
|
7188
|
+
contactAttachmentRecords: z103.array(
|
7189
|
+
z103.object({
|
7190
|
+
bucketName: z103.string(),
|
7191
|
+
fileKey: z103.string(),
|
7192
|
+
fileName: z103.string(),
|
7193
|
+
fileSize: z103.coerce.number(),
|
7194
|
+
url: z103.string()
|
6959
7195
|
})
|
6960
7196
|
)
|
6961
7197
|
}),
|
@@ -6964,7 +7200,7 @@ var ContactContractValidationSchema2 = {
|
|
6964
7200
|
};
|
6965
7201
|
|
6966
7202
|
// src/public-api/index.ts
|
6967
|
-
var publicApiContract =
|
7203
|
+
var publicApiContract = initContract39().router(
|
6968
7204
|
{
|
6969
7205
|
createContact: {
|
6970
7206
|
method: "POST",
|
@@ -6974,11 +7210,11 @@ var publicApiContract = initContract38().router(
|
|
6974
7210
|
201: DefaultSuccessResponseSchema.extend({
|
6975
7211
|
data: ContactSchema2
|
6976
7212
|
}),
|
6977
|
-
400:
|
6978
|
-
message:
|
7213
|
+
400: z104.object({
|
7214
|
+
message: z104.string()
|
6979
7215
|
}),
|
6980
|
-
409:
|
6981
|
-
message:
|
7216
|
+
409: z104.object({
|
7217
|
+
message: z104.string()
|
6982
7218
|
}),
|
6983
7219
|
401: DefaultUnauthorizedSchema,
|
6984
7220
|
404: DefaultNotFoundSchema,
|
@@ -6993,13 +7229,13 @@ var publicApiContract = initContract38().router(
|
|
6993
7229
|
query: GetTagsSchema,
|
6994
7230
|
responses: {
|
6995
7231
|
200: DefaultSuccessResponseSchema.extend({
|
6996
|
-
tags:
|
7232
|
+
tags: z104.array(TagSchema)
|
6997
7233
|
}),
|
6998
|
-
400:
|
6999
|
-
message:
|
7234
|
+
400: z104.object({
|
7235
|
+
message: z104.string()
|
7000
7236
|
}),
|
7001
|
-
409:
|
7002
|
-
message:
|
7237
|
+
409: z104.object({
|
7238
|
+
message: z104.string()
|
7003
7239
|
}),
|
7004
7240
|
401: DefaultUnauthorizedSchema,
|
7005
7241
|
404: DefaultNotFoundSchema,
|
@@ -7015,11 +7251,11 @@ var publicApiContract = initContract38().router(
|
|
7015
7251
|
200: DefaultSuccessResponseSchema.extend(
|
7016
7252
|
ContactContractValidationSchema2.getAll.response
|
7017
7253
|
),
|
7018
|
-
400:
|
7019
|
-
message:
|
7254
|
+
400: z104.object({
|
7255
|
+
message: z104.string()
|
7020
7256
|
}),
|
7021
|
-
409:
|
7022
|
-
message:
|
7257
|
+
409: z104.object({
|
7258
|
+
message: z104.string()
|
7023
7259
|
}),
|
7024
7260
|
401: DefaultUnauthorizedSchema,
|
7025
7261
|
404: DefaultNotFoundSchema,
|
@@ -7036,11 +7272,11 @@ var publicApiContract = initContract38().router(
|
|
7036
7272
|
200: DefaultSuccessResponseSchema.extend(
|
7037
7273
|
ContactContractValidationSchema2.getContactFields.response
|
7038
7274
|
),
|
7039
|
-
400:
|
7040
|
-
message:
|
7275
|
+
400: z104.object({
|
7276
|
+
message: z104.string()
|
7041
7277
|
}),
|
7042
|
-
409:
|
7043
|
-
message:
|
7278
|
+
409: z104.object({
|
7279
|
+
message: z104.string()
|
7044
7280
|
}),
|
7045
7281
|
401: DefaultUnauthorizedSchema,
|
7046
7282
|
404: DefaultNotFoundSchema,
|
@@ -7054,17 +7290,17 @@ var publicApiContract = initContract38().router(
|
|
7054
7290
|
path: "/contacts/:id",
|
7055
7291
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7056
7292
|
responses: {
|
7057
|
-
200:
|
7058
|
-
status:
|
7059
|
-
message:
|
7293
|
+
200: z104.object({
|
7294
|
+
status: z104.string(),
|
7295
|
+
message: z104.string(),
|
7060
7296
|
data: ContactSchema2,
|
7061
|
-
requestId:
|
7297
|
+
requestId: z104.string()
|
7062
7298
|
}),
|
7063
|
-
400:
|
7064
|
-
message:
|
7299
|
+
400: z104.object({
|
7300
|
+
message: z104.string()
|
7065
7301
|
}),
|
7066
|
-
409:
|
7067
|
-
message:
|
7302
|
+
409: z104.object({
|
7303
|
+
message: z104.string()
|
7068
7304
|
}),
|
7069
7305
|
401: DefaultUnauthorizedSchema,
|
7070
7306
|
404: DefaultNotFoundSchema,
|
@@ -7082,11 +7318,11 @@ var publicApiContract = initContract38().router(
|
|
7082
7318
|
201: DefaultSuccessResponseSchema.extend({
|
7083
7319
|
message: ContactCustomFieldSchema2
|
7084
7320
|
}),
|
7085
|
-
400:
|
7086
|
-
message:
|
7321
|
+
400: z104.object({
|
7322
|
+
message: z104.string()
|
7087
7323
|
}),
|
7088
|
-
409:
|
7089
|
-
message:
|
7324
|
+
409: z104.object({
|
7325
|
+
message: z104.string()
|
7090
7326
|
}),
|
7091
7327
|
401: DefaultUnauthorizedSchema,
|
7092
7328
|
404: DefaultNotFoundSchema,
|
@@ -7100,17 +7336,17 @@ var publicApiContract = initContract38().router(
|
|
7100
7336
|
path: "/contacts/:id",
|
7101
7337
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7102
7338
|
responses: {
|
7103
|
-
200:
|
7104
|
-
status:
|
7105
|
-
message:
|
7339
|
+
200: z104.object({
|
7340
|
+
status: z104.string(),
|
7341
|
+
message: z104.string(),
|
7106
7342
|
data: ContactSchema2,
|
7107
|
-
requestId:
|
7343
|
+
requestId: z104.string()
|
7108
7344
|
}),
|
7109
|
-
400:
|
7110
|
-
message:
|
7345
|
+
400: z104.object({
|
7346
|
+
message: z104.string()
|
7111
7347
|
}),
|
7112
|
-
409:
|
7113
|
-
message:
|
7348
|
+
409: z104.object({
|
7349
|
+
message: z104.string()
|
7114
7350
|
}),
|
7115
7351
|
401: DefaultUnauthorizedSchema,
|
7116
7352
|
404: DefaultNotFoundSchema,
|
@@ -7124,17 +7360,17 @@ var publicApiContract = initContract38().router(
|
|
7124
7360
|
path: "/contacts/:id",
|
7125
7361
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7126
7362
|
responses: {
|
7127
|
-
200:
|
7128
|
-
status:
|
7129
|
-
message:
|
7363
|
+
200: z104.object({
|
7364
|
+
status: z104.string(),
|
7365
|
+
message: z104.string(),
|
7130
7366
|
data: ContactSchema2,
|
7131
|
-
requestId:
|
7367
|
+
requestId: z104.string()
|
7132
7368
|
}),
|
7133
|
-
400:
|
7134
|
-
message:
|
7369
|
+
400: z104.object({
|
7370
|
+
message: z104.string()
|
7135
7371
|
}),
|
7136
|
-
409:
|
7137
|
-
message:
|
7372
|
+
409: z104.object({
|
7373
|
+
message: z104.string()
|
7138
7374
|
}),
|
7139
7375
|
401: DefaultUnauthorizedSchema,
|
7140
7376
|
404: DefaultNotFoundSchema,
|
@@ -7151,7 +7387,7 @@ var publicApiContract = initContract38().router(
|
|
7151
7387
|
);
|
7152
7388
|
|
7153
7389
|
// src/contract.ts
|
7154
|
-
var apiContract =
|
7390
|
+
var apiContract = initContract40().router({
|
7155
7391
|
auth: authContract,
|
7156
7392
|
mail: mailContract,
|
7157
7393
|
cxLog: cxLogContract,
|
@@ -7172,37 +7408,38 @@ var apiContract = initContract39().router({
|
|
7172
7408
|
userPresenceStatusLog: userPresenceStatusLogContract,
|
7173
7409
|
company: companyContract,
|
7174
7410
|
evaluateForm: evaluateFormContract,
|
7175
|
-
upload: uploadContract
|
7411
|
+
upload: uploadContract,
|
7412
|
+
snippet: snippetContract
|
7176
7413
|
});
|
7177
|
-
var contactContract2 =
|
7414
|
+
var contactContract2 = initContract40().router({
|
7178
7415
|
contact: contactContract
|
7179
7416
|
});
|
7180
|
-
var ticketContract2 =
|
7417
|
+
var ticketContract2 = initContract40().router({
|
7181
7418
|
ticket: ticketContract
|
7182
7419
|
});
|
7183
|
-
var extensionContract2 =
|
7420
|
+
var extensionContract2 = initContract40().router({
|
7184
7421
|
extension: extensionContract
|
7185
7422
|
});
|
7186
|
-
var commentActivityContract =
|
7423
|
+
var commentActivityContract = initContract40().router({
|
7187
7424
|
comment: commentContract,
|
7188
7425
|
activityLog: activityLogContract
|
7189
7426
|
});
|
7190
|
-
var platformContract =
|
7427
|
+
var platformContract = initContract40().router({
|
7191
7428
|
line: lineContract,
|
7192
7429
|
messenger: messengerContract,
|
7193
7430
|
instagram: instagramContract,
|
7194
7431
|
viber: viberContract
|
7195
7432
|
});
|
7196
|
-
var chatContract =
|
7433
|
+
var chatContract = initContract40().router({
|
7197
7434
|
main: mainChatContract
|
7198
7435
|
});
|
7199
|
-
var telephonyContract =
|
7436
|
+
var telephonyContract = initContract40().router({
|
7200
7437
|
telephonyCdr: telephonyCdrContract
|
7201
7438
|
});
|
7202
|
-
var notificationContract =
|
7439
|
+
var notificationContract = initContract40().router({
|
7203
7440
|
notification: userNotificationContract
|
7204
7441
|
});
|
7205
|
-
var publicApiContract2 =
|
7442
|
+
var publicApiContract2 = initContract40().router({
|
7206
7443
|
publicApi: publicApiContract
|
7207
7444
|
});
|
7208
7445
|
export {
|
@@ -7227,6 +7464,7 @@ export {
|
|
7227
7464
|
platformContract,
|
7228
7465
|
publicApiContract2 as publicApiContract,
|
7229
7466
|
receiveMessageContract,
|
7467
|
+
snippetContract,
|
7230
7468
|
tagContract,
|
7231
7469
|
telephonyCdrContract,
|
7232
7470
|
telephonyContract,
|