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