-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmicroservice.document.add.js
45 lines (45 loc) · 1.19 KB
/
microservice.document.add.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/** @type { import("ut-run").validationFactory } */
module.exports = ({
joi,
lib: {
bigintRequired,
stringRequired,
stringNull,
file
}
}) => ({
'microservice.document.add': () => ({
description: 'add new document',
body: {
maxBytes: 10 * 1024 * 1024,
output: 'stream',
parse: false,
allow: 'multipart/form-data'
},
params: joi.object().keys({
document: joi.object({
documentName: stringRequired,
documentIcon: file
}),
page: joi.array().items(
joi.object({
title: stringNull,
attachment: file
})
)
}).required(),
result: joi.object().keys({
document: joi.object({
documentId: bigintRequired,
documentName: stringRequired,
documentIcon: file
}),
page: joi.array().items(
joi.object({
title: stringNull,
attachment: file
})
)
}).required()
})
});