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