Skip to content

Commit

Permalink
fix git divergence issues: submit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NickOvt committed Sep 26, 2024
1 parent dd60577 commit 04a1b59
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions lib/api/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Transform = require('stream').Transform;
const { sessSchema, sessIPSchema, booleanSchema, metaDataSchema } = require('../schemas');
const { preprocessAttachments } = require('../data-url');
const { userId, mailboxId } = require('../schemas/request/general-schemas');
const { AddressOptionalName, AddressOptionalNameArray, Header, Attachment, ReferenceWithAttachments } = require('../schemas/request/messages-schemas');
const { AddressOptionalName, AddressOptionalNameArray, Header, ReferenceWithoutAttachments } = require('../schemas/request/messages-schemas');
const { successRes } = require('../schemas/response/general-schemas');

class StreamCollect extends Transform {
Expand Down Expand Up @@ -631,7 +631,7 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => {
description: 'Use this method to send emails from a user account',
validationObjs: {
requestBody: {
mailbox: mailboxId,
mailbox: Joi.string().hex().lowercase().length(24).description('ID of the Mailbox'),
from: AddressOptionalName.description('Addres for the From: header'),
replyTo: AddressOptionalName.description('Address for the Reply-To: header'),
to: Joi.array()
Expand Down Expand Up @@ -664,12 +664,27 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => {
.empty('')
.max(1024 * 1024)
.description('HTML formatted message'),
attachments: Joi.array().items(Attachment).description('Attachments for the message'),
attachments: Joi.array()
.items(
Joi.object({
filename: Joi.string().empty('').max(255).description('Attachment filename'),
contentType: Joi.string().empty('').max(255).description('MIME type for the attachment file'),
encoding: Joi.string().empty('').default('base64').description('Encoding to use to store the attachments'),
contentTransferEncoding: Joi.string().empty('').description('Transfer encoding'),
contentDisposition: Joi.string().empty('').trim().lowercase().valid('inline', 'attachment').description('Content Disposition'),
content: Joi.string().required().description('Base64 encoded attachment content'),
cid: Joi.string()
.empty('')
.max(255)
.description('Content-ID value if you want to reference to this attachment from HTML formatted message')
})
)
.description('Attachments for the message'),

meta: metaDataSchema.label('metaData').description('Optional metadata, must be an object or JSON formatted string'),
sess: sessSchema,
ip: sessIPSchema,
reference: ReferenceWithAttachments.description(
reference: ReferenceWithoutAttachments.description(
'Optional referenced email. If uploaded message is a reply draft and relevant fields are not provided then these are resolved from the message to be replied to'
),
// if true then treat this message as a draft
Expand Down

0 comments on commit 04a1b59

Please sign in to comment.