@kl1/contracts 1.1.5 → 1.1.16-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 +455 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +454 -17
- package/dist/index.mjs.map +1 -1
- package/dist/src/contract.d.ts +6433 -8
- package/dist/src/contract.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 +602 -8
- package/dist/src/mail/mail-contract.d.ts.map +1 -1
- package/dist/src/mail/message-contract.d.ts +495 -1
- package/dist/src/mail/message-contract.d.ts.map +1 -1
- package/dist/src/mail/room-contract.d.ts +36 -6
- package/dist/src/mail/room-contract.d.ts.map +1 -1
- package/dist/src/mail/schemas/room-validation.schema.d.ts +36 -6
- package/dist/src/mail/schemas/room-validation.schema.d.ts.map +1 -1
- package/dist/src/public-api/index.d.ts +5843 -0
- package/dist/src/{chatwoot → public-api}/index.d.ts.map +1 -1
- package/dist/src/public-api/schema.d.ts +1010 -0
- package/dist/src/public-api/schema.d.ts.map +1 -0
- package/dist/src/public-api/validation.d.ts +1822 -0
- package/dist/src/public-api/validation.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/src/app/index.d.ts +0 -17
- package/dist/src/app/index.d.ts.map +0 -1
- package/dist/src/chatwoot/index.d.ts +0 -7527
- package/dist/src/chatwoot/schema.d.ts +0 -79
- package/dist/src/chatwoot/schema.d.ts.map +0 -1
- package/dist/src/chatwoot/validation.d.ts +0 -53
- package/dist/src/chatwoot/validation.d.ts.map +0 -1
- package/dist/src/mail/mail-server.d.ts +0 -216
- package/dist/src/mail/mail-server.d.ts.map +0 -1
- package/dist/src/platform-contact/schema.d.ts +0 -30
- package/dist/src/platform-contact/schema.d.ts.map +0 -1
package/dist/index.js
CHANGED
@@ -49,6 +49,7 @@ __export(src_exports, {
|
|
49
49
|
notificationContract: () => notificationContract,
|
50
50
|
permissionContract: () => permissionContract,
|
51
51
|
platformContract: () => platformContract,
|
52
|
+
publicApiContract: () => publicApiContract2,
|
52
53
|
receiveMessageContract: () => receiveMessageContract,
|
53
54
|
tagContract: () => tagContract,
|
54
55
|
telephonyCdrContract: () => telephonyCdrContract,
|
@@ -63,7 +64,7 @@ __export(src_exports, {
|
|
63
64
|
module.exports = __toCommonJS(src_exports);
|
64
65
|
|
65
66
|
// src/contract.ts
|
66
|
-
var
|
67
|
+
var import_core39 = require("@ts-rest/core");
|
67
68
|
|
68
69
|
// src/activity-log/index.ts
|
69
70
|
var import_core = require("@ts-rest/core");
|
@@ -4242,7 +4243,15 @@ var RoomContractsValidationSchema = {
|
|
4242
4243
|
input: import_zod59.default.object({
|
4243
4244
|
page: import_zod59.default.coerce.number().default(1),
|
4244
4245
|
pageSize: import_zod59.default.coerce.number().default(10),
|
4245
|
-
keyword: import_zod59.default.
|
4246
|
+
keyword: import_zod59.default.object({
|
4247
|
+
value: import_zod59.default.string(),
|
4248
|
+
category: import_zod59.default.union([import_zod59.default.literal("contact"), import_zod59.default.literal("message")])
|
4249
|
+
}).optional(),
|
4250
|
+
contactLabels: import_zod59.default.array(import_zod59.default.string()).optional(),
|
4251
|
+
channels: import_zod59.default.array(import_zod59.default.string().email()).optional(),
|
4252
|
+
date: import_zod59.default.string().optional(),
|
4253
|
+
contacts: import_zod59.default.array(import_zod59.default.string()).optional(),
|
4254
|
+
assignees: import_zod59.default.array(import_zod59.default.string()).optional(),
|
4246
4255
|
level1: import_zod59.default.union([
|
4247
4256
|
import_zod59.default.literal("open"),
|
4248
4257
|
import_zod59.default.literal("close"),
|
@@ -4267,9 +4276,14 @@ var RoomContractsValidationSchema = {
|
|
4267
4276
|
},
|
4268
4277
|
update: {
|
4269
4278
|
input: import_zod59.default.object({
|
4270
|
-
|
4271
|
-
import_zod59.default.
|
4272
|
-
|
4279
|
+
disposition: import_zod59.default.union([
|
4280
|
+
import_zod59.default.literal("resolved"),
|
4281
|
+
import_zod59.default.literal("follow_up"),
|
4282
|
+
import_zod59.default.literal("escalated"),
|
4283
|
+
import_zod59.default.literal("dropped"),
|
4284
|
+
import_zod59.default.literal("prank"),
|
4285
|
+
import_zod59.default.literal("blank")
|
4286
|
+
]).optional().nullable(),
|
4273
4287
|
assigneeId: import_zod59.default.string().uuid().optional().nullable(),
|
4274
4288
|
note: import_zod59.default.string().optional(),
|
4275
4289
|
tags: import_zod59.default.array(import_zod59.default.string().uuid()).optional(),
|
@@ -4465,6 +4479,18 @@ var accountContract = (0, import_core19.initContract)().router(
|
|
4465
4479
|
summary: "Register a new mail account"
|
4466
4480
|
},
|
4467
4481
|
//#endregion register account
|
4482
|
+
//#region ........sync all accounts
|
4483
|
+
sync: {
|
4484
|
+
method: "GET",
|
4485
|
+
path: "/sync",
|
4486
|
+
responses: {
|
4487
|
+
200: DefaultSuccessResponseSchema.extend({
|
4488
|
+
message: import_zod62.default.string()
|
4489
|
+
}),
|
4490
|
+
...DefaultResponses
|
4491
|
+
},
|
4492
|
+
summary: "Sync all accounts state from email engine to system"
|
4493
|
+
},
|
4468
4494
|
//#region ........get account
|
4469
4495
|
getById: {
|
4470
4496
|
method: "GET",
|
@@ -4476,14 +4502,17 @@ var accountContract = (0, import_core19.initContract)().router(
|
|
4476
4502
|
}),
|
4477
4503
|
...DefaultResponses
|
4478
4504
|
},
|
4479
|
-
summary: "Get
|
4505
|
+
summary: "Get an account by id"
|
4480
4506
|
},
|
4481
4507
|
//#endregion get account
|
4508
|
+
//#endregion sync all accountss
|
4482
4509
|
//#region ........get all account
|
4483
|
-
//TODO: add pagination parameters
|
4484
4510
|
getAll: {
|
4485
4511
|
method: "GET",
|
4486
4512
|
path: "",
|
4513
|
+
query: import_zod62.default.object({
|
4514
|
+
state: import_zod62.default.union([import_zod62.default.literal("connected"), import_zod62.default.literal("disconnected")]).optional()
|
4515
|
+
}).optional(),
|
4487
4516
|
responses: {
|
4488
4517
|
200: DefaultSuccessResponseSchema.extend({
|
4489
4518
|
data: import_zod62.default.array(MailAccountSchema)
|
@@ -4714,8 +4743,55 @@ var messageContract = (0, import_core21.initContract)().router(
|
|
4714
4743
|
500: DefaultErrorResponseSchema
|
4715
4744
|
},
|
4716
4745
|
body: MessageContractsValidationsSchema.submit.input,
|
4717
|
-
summary: "Submit a message such compose, reply or forward"
|
4746
|
+
summary: "Submit a message such as compose, reply or forward"
|
4747
|
+
},
|
4748
|
+
//#region get room counts for filter like 'open', 'close', 'inbox' and etc...
|
4749
|
+
getRoomCounts: {
|
4750
|
+
method: "GET",
|
4751
|
+
path: "/room_counts",
|
4752
|
+
responses: {
|
4753
|
+
200: DefaultSuccessResponseSchema.extend({
|
4754
|
+
data: import_zod66.default.object({
|
4755
|
+
general: import_zod66.default.array(
|
4756
|
+
import_zod66.default.object({
|
4757
|
+
name: import_zod66.default.string(),
|
4758
|
+
count: import_zod66.default.number()
|
4759
|
+
})
|
4760
|
+
),
|
4761
|
+
channels: import_zod66.default.array(
|
4762
|
+
import_zod66.default.object({
|
4763
|
+
channel: MailAccountSchema,
|
4764
|
+
count: import_zod66.default.number()
|
4765
|
+
})
|
4766
|
+
),
|
4767
|
+
contactLabels: import_zod66.default.array(
|
4768
|
+
import_zod66.default.object({
|
4769
|
+
label: TagSchema,
|
4770
|
+
count: import_zod66.default.number()
|
4771
|
+
})
|
4772
|
+
)
|
4773
|
+
})
|
4774
|
+
}),
|
4775
|
+
...DefaultResponses
|
4776
|
+
},
|
4777
|
+
summary: 'Get unread message counts for filter like "open", "close", "inbox" and etc...'
|
4778
|
+
},
|
4779
|
+
//#endregion get unread message counts for filter like 'open', 'close', 'inbox' and etc...
|
4780
|
+
//#region get total unread messages counts
|
4781
|
+
getTotalUnreadMessageCount: {
|
4782
|
+
method: "GET",
|
4783
|
+
path: "/new_message_count",
|
4784
|
+
responses: {
|
4785
|
+
200: DefaultSuccessResponseSchema.extend({
|
4786
|
+
data: import_zod66.default.object({
|
4787
|
+
count: import_zod66.default.number()
|
4788
|
+
})
|
4789
|
+
}),
|
4790
|
+
...DefaultResponses
|
4791
|
+
},
|
4792
|
+
summary: "Get total unread messages counts"
|
4718
4793
|
},
|
4794
|
+
//#endregion get total unread messages counts
|
4719
4795
|
//#region get a message
|
4720
4796
|
getById: {
|
4721
4797
|
method: "GET",
|
@@ -6852,8 +6928,366 @@ var userNotificationContract = (0, import_core37.initContract)().router(
|
|
6852
6928
|
}
|
6853
6929
|
);
|
6854
6930
|
|
6931
|
+
// src/public-api/index.ts
|
6932
|
+
var import_core38 = require("@ts-rest/core");
|
6933
|
+
var import_zod101 = __toESM(require("zod"));
|
6934
|
+
|
6935
|
+
// src/public-api/validation.ts
|
6936
|
+
var import_zod100 = __toESM(require("zod"));
|
6937
|
+
|
6938
|
+
// src/public-api/schema.ts
|
6939
|
+
var import_zod99 = __toESM(require("zod"));
|
6940
|
+
var ContactPhonesSchema2 = import_zod99.default.object({
|
6941
|
+
id: import_zod99.default.string().uuid(),
|
6942
|
+
createdAt: import_zod99.default.date(),
|
6943
|
+
updatedAt: import_zod99.default.date(),
|
6944
|
+
deletedAt: import_zod99.default.date().nullable(),
|
6945
|
+
phone: import_zod99.default.string(),
|
6946
|
+
isPrimary: import_zod99.default.boolean()
|
6947
|
+
});
|
6948
|
+
var ContactEmailsSchema2 = import_zod99.default.object({
|
6949
|
+
id: import_zod99.default.string().uuid(),
|
6950
|
+
createdAt: import_zod99.default.date(),
|
6951
|
+
updatedAt: import_zod99.default.date(),
|
6952
|
+
deletedAt: import_zod99.default.date().nullable(),
|
6953
|
+
email: import_zod99.default.string(),
|
6954
|
+
isPrimary: import_zod99.default.boolean()
|
6955
|
+
});
|
6956
|
+
var ContactCustomFieldSchema2 = import_zod99.default.object({
|
6957
|
+
id: import_zod99.default.string().uuid(),
|
6958
|
+
createdAt: import_zod99.default.date(),
|
6959
|
+
updatedAt: import_zod99.default.date(),
|
6960
|
+
deletedAt: import_zod99.default.date().nullable(),
|
6961
|
+
textValue: import_zod99.default.string().nullable(),
|
6962
|
+
booleanValue: import_zod99.default.boolean().nullable(),
|
6963
|
+
numberValue: import_zod99.default.number().nullable(),
|
6964
|
+
dateValue: import_zod99.default.date().nullable(),
|
6965
|
+
attribute: AttributeSchema.omit({ options: true, group: true }),
|
6966
|
+
uploads: import_zod99.default.array(UploadSchema)
|
6967
|
+
});
|
6968
|
+
var ContactEntityTypesSchema2 = import_zod99.default.object({
|
6969
|
+
id: import_zod99.default.string().uuid(),
|
6970
|
+
createdAt: import_zod99.default.date(),
|
6971
|
+
updatedAt: import_zod99.default.date(),
|
6972
|
+
deletedAt: import_zod99.default.date().nullable(),
|
6973
|
+
entity: import_zod99.default.string(),
|
6974
|
+
description: import_zod99.default.string().nullable()
|
6975
|
+
});
|
6976
|
+
var ContactActivitySchema2 = import_zod99.default.object({
|
6977
|
+
id: import_zod99.default.string().uuid(),
|
6978
|
+
createdAt: import_zod99.default.date(),
|
6979
|
+
updatedAt: import_zod99.default.date(),
|
6980
|
+
deletedAt: import_zod99.default.date().nullable(),
|
6981
|
+
entityId: import_zod99.default.string(),
|
6982
|
+
description: import_zod99.default.string(),
|
6983
|
+
entityType: ContactEntityTypesSchema2
|
6984
|
+
});
|
6985
|
+
var ContactSchema2 = import_zod99.default.object({
|
6986
|
+
id: import_zod99.default.string().uuid(),
|
6987
|
+
createdAt: import_zod99.default.date(),
|
6988
|
+
updatedAt: import_zod99.default.date(),
|
6989
|
+
deletedAt: import_zod99.default.date().nullable(),
|
6990
|
+
name: import_zod99.default.string(),
|
6991
|
+
address: import_zod99.default.string().nullable(),
|
6992
|
+
channel: import_zod99.default.string().nullable(),
|
6993
|
+
notes: import_zod99.default.string().nullable(),
|
6994
|
+
contactProfile: import_zod99.default.string().nullable(),
|
6995
|
+
socialProfileUrl: import_zod99.default.string().nullable(),
|
6996
|
+
tags: import_zod99.default.array(TagSchema),
|
6997
|
+
company: CompanySchema.omit({ customFields: true }).nullable(),
|
6998
|
+
customFields: import_zod99.default.array(ContactCustomFieldSchema2),
|
6999
|
+
contactEmails: import_zod99.default.array(ContactEmailsSchema2),
|
7000
|
+
contactPhones: import_zod99.default.array(ContactPhonesSchema2),
|
7001
|
+
activityLogs: import_zod99.default.array(ContactActivitySchema2).optional()
|
7002
|
+
});
|
7003
|
+
|
7004
|
+
// src/public-api/validation.ts
|
7005
|
+
var ContactContractValidationSchema2 = {
|
7006
|
+
create: {
|
7007
|
+
request: import_zod100.default.object({
|
7008
|
+
name: import_zod100.default.string(),
|
7009
|
+
email: import_zod100.default.array(
|
7010
|
+
import_zod100.default.object({
|
7011
|
+
email: import_zod100.default.string().email(),
|
7012
|
+
isPrimary: import_zod100.default.boolean()
|
7013
|
+
})
|
7014
|
+
).optional(),
|
7015
|
+
channel: import_zod100.default.string().optional(),
|
7016
|
+
address: import_zod100.default.string().optional(),
|
7017
|
+
phone: import_zod100.default.array(
|
7018
|
+
import_zod100.default.object({
|
7019
|
+
phone: import_zod100.default.string(),
|
7020
|
+
isPrimary: import_zod100.default.boolean()
|
7021
|
+
})
|
7022
|
+
).optional(),
|
7023
|
+
notes: import_zod100.default.string().optional(),
|
7024
|
+
tags: import_zod100.default.array(import_zod100.default.string()).optional(),
|
7025
|
+
company: import_zod100.default.string().optional(),
|
7026
|
+
customFields: import_zod100.default.record(import_zod100.default.string())
|
7027
|
+
// Dynamic keys with string values
|
7028
|
+
}),
|
7029
|
+
response: ContactSchema2
|
7030
|
+
},
|
7031
|
+
getById: {
|
7032
|
+
request: import_zod100.default.object({
|
7033
|
+
id: import_zod100.default.string().uuid()
|
7034
|
+
})
|
7035
|
+
},
|
7036
|
+
delete: {
|
7037
|
+
request: import_zod100.default.object({
|
7038
|
+
id: import_zod100.default.string().uuid()
|
7039
|
+
})
|
7040
|
+
},
|
7041
|
+
getAll: {
|
7042
|
+
request: import_zod100.default.object({
|
7043
|
+
page: import_zod100.default.coerce.number().default(1),
|
7044
|
+
pageSize: import_zod100.default.coerce.number().default(10),
|
7045
|
+
keyword: import_zod100.default.string().optional(),
|
7046
|
+
company: import_zod100.default.array(import_zod100.default.string().uuid()),
|
7047
|
+
name: import_zod100.default.string(),
|
7048
|
+
address: import_zod100.default.string(),
|
7049
|
+
channel: import_zod100.default.array(import_zod100.default.string()),
|
7050
|
+
selectedDate: import_zod100.default.string(),
|
7051
|
+
customFields: import_zod100.default.array(
|
7052
|
+
import_zod100.default.object({
|
7053
|
+
attributeId: import_zod100.default.string().uuid(),
|
7054
|
+
type: import_zod100.default.string(),
|
7055
|
+
value: import_zod100.default.union([import_zod100.default.string(), import_zod100.default.array(import_zod100.default.string())])
|
7056
|
+
})
|
7057
|
+
),
|
7058
|
+
tags: import_zod100.default.array(import_zod100.default.string().uuid()),
|
7059
|
+
phone: import_zod100.default.string(),
|
7060
|
+
email: import_zod100.default.string(),
|
7061
|
+
notes: import_zod100.default.string()
|
7062
|
+
}).partial(),
|
7063
|
+
response: {
|
7064
|
+
page: import_zod100.default.number(),
|
7065
|
+
pageSize: import_zod100.default.number(),
|
7066
|
+
total: import_zod100.default.number(),
|
7067
|
+
lastPage: import_zod100.default.number(),
|
7068
|
+
data: import_zod100.default.array(ContactSchema2)
|
7069
|
+
}
|
7070
|
+
},
|
7071
|
+
getContactFields: {
|
7072
|
+
request: import_zod100.default.object({
|
7073
|
+
page: import_zod100.default.coerce.number().default(1),
|
7074
|
+
pageSize: import_zod100.default.coerce.number().default(10)
|
7075
|
+
}).partial(),
|
7076
|
+
response: {
|
7077
|
+
page: import_zod100.default.number(),
|
7078
|
+
pageSize: import_zod100.default.number(),
|
7079
|
+
total: import_zod100.default.number(),
|
7080
|
+
lastPage: import_zod100.default.number(),
|
7081
|
+
data: import_zod100.default.array(ContactCustomFieldSchema2)
|
7082
|
+
}
|
7083
|
+
},
|
7084
|
+
addAttachments: {
|
7085
|
+
request: import_zod100.default.object({
|
7086
|
+
contactId: import_zod100.default.string(),
|
7087
|
+
attributeId: import_zod100.default.string().uuid(),
|
7088
|
+
contactAttachmentRecords: import_zod100.default.array(
|
7089
|
+
import_zod100.default.object({
|
7090
|
+
bucketName: import_zod100.default.string(),
|
7091
|
+
fileKey: import_zod100.default.string(),
|
7092
|
+
fileName: import_zod100.default.string(),
|
7093
|
+
fileSize: import_zod100.default.coerce.number(),
|
7094
|
+
url: import_zod100.default.string()
|
7095
|
+
})
|
7096
|
+
)
|
7097
|
+
}),
|
7098
|
+
response: CustomFieldSchema
|
7099
|
+
}
|
7100
|
+
};
|
7101
|
+
|
7102
|
+
// src/public-api/index.ts
|
7103
|
+
var publicApiContract = (0, import_core38.initContract)().router(
|
7104
|
+
{
|
7105
|
+
createContact: {
|
7106
|
+
method: "POST",
|
7107
|
+
path: "/contacts",
|
7108
|
+
body: ContactContractValidationSchema2.create.request,
|
7109
|
+
responses: {
|
7110
|
+
201: DefaultSuccessResponseSchema.extend({
|
7111
|
+
data: ContactSchema2
|
7112
|
+
}),
|
7113
|
+
400: import_zod101.default.object({
|
7114
|
+
message: import_zod101.default.string()
|
7115
|
+
}),
|
7116
|
+
409: import_zod101.default.object({
|
7117
|
+
message: import_zod101.default.string()
|
7118
|
+
}),
|
7119
|
+
401: DefaultUnauthorizedSchema,
|
7120
|
+
404: DefaultNotFoundSchema,
|
7121
|
+
422: DefaultUnprocessibleSchema,
|
7122
|
+
500: DefaultErrorResponseSchema
|
7123
|
+
},
|
7124
|
+
summary: "Create a new contact"
|
7125
|
+
},
|
7126
|
+
getAllTags: {
|
7127
|
+
method: "GET",
|
7128
|
+
path: "/tags",
|
7129
|
+
query: GetTagsSchema,
|
7130
|
+
responses: {
|
7131
|
+
200: DefaultSuccessResponseSchema.extend({
|
7132
|
+
tags: import_zod101.default.array(TagSchema)
|
7133
|
+
}),
|
7134
|
+
400: import_zod101.default.object({
|
7135
|
+
message: import_zod101.default.string()
|
7136
|
+
}),
|
7137
|
+
409: import_zod101.default.object({
|
7138
|
+
message: import_zod101.default.string()
|
7139
|
+
}),
|
7140
|
+
401: DefaultUnauthorizedSchema,
|
7141
|
+
404: DefaultNotFoundSchema,
|
7142
|
+
422: DefaultUnprocessibleSchema,
|
7143
|
+
500: DefaultErrorResponseSchema
|
7144
|
+
}
|
7145
|
+
},
|
7146
|
+
getAllContact: {
|
7147
|
+
method: "GET",
|
7148
|
+
path: "/contacts",
|
7149
|
+
query: ContactContractValidationSchema2.getAll.request,
|
7150
|
+
responses: {
|
7151
|
+
200: DefaultSuccessResponseSchema.extend(
|
7152
|
+
ContactContractValidationSchema2.getAll.response
|
7153
|
+
),
|
7154
|
+
400: import_zod101.default.object({
|
7155
|
+
message: import_zod101.default.string()
|
7156
|
+
}),
|
7157
|
+
409: import_zod101.default.object({
|
7158
|
+
message: import_zod101.default.string()
|
7159
|
+
}),
|
7160
|
+
401: DefaultUnauthorizedSchema,
|
7161
|
+
404: DefaultNotFoundSchema,
|
7162
|
+
422: DefaultUnprocessibleSchema,
|
7163
|
+
500: DefaultErrorResponseSchema
|
7164
|
+
},
|
7165
|
+
summary: "Get all contacts"
|
7166
|
+
},
|
7167
|
+
getContactFields: {
|
7168
|
+
method: "GET",
|
7169
|
+
path: "/contacts/fields",
|
7170
|
+
query: ContactContractValidationSchema2.getContactFields.request,
|
7171
|
+
responses: {
|
7172
|
+
200: DefaultSuccessResponseSchema.extend(
|
7173
|
+
ContactContractValidationSchema2.getContactFields.response
|
7174
|
+
),
|
7175
|
+
400: import_zod101.default.object({
|
7176
|
+
message: import_zod101.default.string()
|
7177
|
+
}),
|
7178
|
+
409: import_zod101.default.object({
|
7179
|
+
message: import_zod101.default.string()
|
7180
|
+
}),
|
7181
|
+
401: DefaultUnauthorizedSchema,
|
7182
|
+
404: DefaultNotFoundSchema,
|
7183
|
+
422: DefaultUnprocessibleSchema,
|
7184
|
+
500: DefaultErrorResponseSchema
|
7185
|
+
},
|
7186
|
+
summary: "Get contact custom fields."
|
7187
|
+
},
|
7188
|
+
updateContact: {
|
7189
|
+
method: "PATCH",
|
7190
|
+
path: "/contacts/:id",
|
7191
|
+
pathParams: ContactContractValidationSchema2.getById.request,
|
7192
|
+
responses: {
|
7193
|
+
200: import_zod101.default.object({
|
7194
|
+
status: import_zod101.default.string(),
|
7195
|
+
message: import_zod101.default.string(),
|
7196
|
+
data: ContactSchema2,
|
7197
|
+
requestId: import_zod101.default.string()
|
7198
|
+
}),
|
7199
|
+
400: import_zod101.default.object({
|
7200
|
+
message: import_zod101.default.string()
|
7201
|
+
}),
|
7202
|
+
409: import_zod101.default.object({
|
7203
|
+
message: import_zod101.default.string()
|
7204
|
+
}),
|
7205
|
+
401: DefaultUnauthorizedSchema,
|
7206
|
+
404: DefaultNotFoundSchema,
|
7207
|
+
422: DefaultUnprocessibleSchema,
|
7208
|
+
500: DefaultErrorResponseSchema
|
7209
|
+
},
|
7210
|
+
body: ContactContractValidationSchema2.create.request.partial(),
|
7211
|
+
summary: "Update a contact"
|
7212
|
+
},
|
7213
|
+
createContactAttachmentRecords: {
|
7214
|
+
method: "POST",
|
7215
|
+
path: "/contacts/attachments",
|
7216
|
+
body: ContactContractValidationSchema2.addAttachments.request,
|
7217
|
+
responses: {
|
7218
|
+
201: DefaultSuccessResponseSchema.extend({
|
7219
|
+
message: ContactCustomFieldSchema2
|
7220
|
+
}),
|
7221
|
+
400: import_zod101.default.object({
|
7222
|
+
message: import_zod101.default.string()
|
7223
|
+
}),
|
7224
|
+
409: import_zod101.default.object({
|
7225
|
+
message: import_zod101.default.string()
|
7226
|
+
}),
|
7227
|
+
401: DefaultUnauthorizedSchema,
|
7228
|
+
404: DefaultNotFoundSchema,
|
7229
|
+
422: DefaultUnprocessibleSchema,
|
7230
|
+
500: DefaultErrorResponseSchema
|
7231
|
+
},
|
7232
|
+
summary: "Create a new contact attachment"
|
7233
|
+
},
|
7234
|
+
getContactById: {
|
7235
|
+
method: "GET",
|
7236
|
+
path: "/contacts/:id",
|
7237
|
+
pathParams: ContactContractValidationSchema2.getById.request,
|
7238
|
+
responses: {
|
7239
|
+
200: import_zod101.default.object({
|
7240
|
+
status: import_zod101.default.string(),
|
7241
|
+
message: import_zod101.default.string(),
|
7242
|
+
data: ContactSchema2,
|
7243
|
+
requestId: import_zod101.default.string()
|
7244
|
+
}),
|
7245
|
+
400: import_zod101.default.object({
|
7246
|
+
message: import_zod101.default.string()
|
7247
|
+
}),
|
7248
|
+
409: import_zod101.default.object({
|
7249
|
+
message: import_zod101.default.string()
|
7250
|
+
}),
|
7251
|
+
401: DefaultUnauthorizedSchema,
|
7252
|
+
404: DefaultNotFoundSchema,
|
7253
|
+
422: DefaultUnprocessibleSchema,
|
7254
|
+
500: DefaultErrorResponseSchema
|
7255
|
+
},
|
7256
|
+
summary: "Get a contact by id"
|
7257
|
+
},
|
7258
|
+
deleteContact: {
|
7259
|
+
method: "DELETE",
|
7260
|
+
path: "/contacts/:id",
|
7261
|
+
pathParams: ContactContractValidationSchema2.delete.request,
|
7262
|
+
responses: {
|
7263
|
+
200: import_zod101.default.object({
|
7264
|
+
status: import_zod101.default.string(),
|
7265
|
+
message: import_zod101.default.string(),
|
7266
|
+
data: ContactSchema2,
|
7267
|
+
requestId: import_zod101.default.string()
|
7268
|
+
}),
|
7269
|
+
400: import_zod101.default.object({
|
7270
|
+
message: import_zod101.default.string()
|
7271
|
+
}),
|
7272
|
+
409: import_zod101.default.object({
|
7273
|
+
message: import_zod101.default.string()
|
7274
|
+
}),
|
7275
|
+
401: DefaultUnauthorizedSchema,
|
7276
|
+
404: DefaultNotFoundSchema,
|
7277
|
+
422: DefaultUnprocessibleSchema,
|
7278
|
+
500: DefaultErrorResponseSchema
|
7279
|
+
},
|
7280
|
+
body: null,
|
7281
|
+
summary: "Delete a contact"
|
7282
|
+
}
|
7283
|
+
},
|
7284
|
+
{
|
7285
|
+
pathPrefix: "api/v1"
|
7286
|
+
}
|
7287
|
+
);
|
7288
|
+
|
6855
7289
|
// src/contract.ts
|
6856
|
-
var apiContract = (0,
|
7290
|
+
var apiContract = (0, import_core39.initContract)().router({
|
6857
7291
|
auth: authContract,
|
6858
7292
|
mail: mailContract,
|
6859
7293
|
cxLog: cxLogContract,
|
@@ -6876,34 +7310,37 @@ var apiContract = (0, import_core38.initContract)().router({
|
|
6876
7310
|
evaluateForm: evaluateFormContract,
|
6877
7311
|
upload: uploadContract
|
6878
7312
|
});
|
6879
|
-
var contactContract2 = (0,
|
7313
|
+
var contactContract2 = (0, import_core39.initContract)().router({
|
6880
7314
|
contact: contactContract
|
6881
7315
|
});
|
6882
|
-
var ticketContract2 = (0,
|
7316
|
+
var ticketContract2 = (0, import_core39.initContract)().router({
|
6883
7317
|
ticket: ticketContract
|
6884
7318
|
});
|
6885
|
-
var extensionContract2 = (0,
|
7319
|
+
var extensionContract2 = (0, import_core39.initContract)().router({
|
6886
7320
|
extension: extensionContract
|
6887
7321
|
});
|
6888
|
-
var commentActivityContract = (0,
|
7322
|
+
var commentActivityContract = (0, import_core39.initContract)().router({
|
6889
7323
|
comment: commentContract,
|
6890
7324
|
activityLog: activityLogContract
|
6891
7325
|
});
|
6892
|
-
var platformContract = (0,
|
7326
|
+
var platformContract = (0, import_core39.initContract)().router({
|
6893
7327
|
line: lineContract,
|
6894
7328
|
messenger: messengerContract,
|
6895
7329
|
instagram: instagramContract,
|
6896
7330
|
viber: viberContract
|
6897
7331
|
});
|
6898
|
-
var chatContract = (0,
|
7332
|
+
var chatContract = (0, import_core39.initContract)().router({
|
6899
7333
|
main: mainChatContract
|
6900
7334
|
});
|
6901
|
-
var telephonyContract = (0,
|
7335
|
+
var telephonyContract = (0, import_core39.initContract)().router({
|
6902
7336
|
telephonyCdr: telephonyCdrContract
|
6903
7337
|
});
|
6904
|
-
var notificationContract = (0,
|
7338
|
+
var notificationContract = (0, import_core39.initContract)().router({
|
6905
7339
|
notification: userNotificationContract
|
6906
7340
|
});
|
7341
|
+
var publicApiContract2 = (0, import_core39.initContract)().router({
|
7342
|
+
publicApi: publicApiContract
|
7343
|
+
});
|
6907
7344
|
// Annotate the CommonJS export names for ESM import in node:
|
6908
7345
|
0 && (module.exports = {
|
6909
7346
|
activityLogContract,
|
@@ -6925,6 +7362,7 @@ var notificationContract = (0, import_core38.initContract)().router({
|
|
6925
7362
|
notificationContract,
|
6926
7363
|
permissionContract,
|
6927
7364
|
platformContract,
|
7365
|
+
publicApiContract,
|
6928
7366
|
receiveMessageContract,
|
6929
7367
|
tagContract,
|
6930
7368
|
telephonyCdrContract,
|