diff --git a/lib/feature-flags.js b/lib/feature-flags.js index f5524b4d..6a9bc8cb 100644 --- a/lib/feature-flags.js +++ b/lib/feature-flags.js @@ -1,5 +1,7 @@ 'use strict'; +const logger = require('./logger'); + const FEATURES = new Set(); const ENABLED_FEATURES = []; @@ -35,4 +37,6 @@ module.exports = { } }; -console.log('FEATURE FLAGS', FEATURES); +if (FEATURES.size > 0) { + logger.info({ msg: 'Enabled feature flags', featureFlags: Array.from(FEATURES) }); +} diff --git a/lib/schemas.js b/lib/schemas.js index 393982dc..a95eb584 100644 --- a/lib/schemas.js +++ b/lib/schemas.js @@ -1108,7 +1108,7 @@ const searchSchema = Joi.object({ emailId: Joi.string().max(256).example('1278455344230334865').description('Match specific Gmail unique email UD'), threadId: Joi.string().max(256).example('1278455344230334865').description('Match specific Gmail unique thread UD'), - header: Joi.object().description('Headers to match against').label('Headers').unknown(), + header: Joi.object().description('Headers to match against').label('Headers').unknown().example({ 'Message-ID': '<1DAF52A51E674A2@example.com>' }), gmailRaw: Joi.string() .max(1024) diff --git a/workers/api.js b/workers/api.js index 85ee6016..bdc73c42 100644 --- a/workers/api.js +++ b/workers/api.js @@ -4136,7 +4136,9 @@ When making API calls remember that requests against the same account are queued .label('UploadAttachmentList'), messageId: Joi.string().max(996).example('').description('Message ID'), - headers: Joi.object().label('CustomHeaders').description('Custom Headers').unknown(), + headers: Joi.object().label('CustomHeaders').description('Custom Headers').unknown().example({ + 'X-My-Custom-Header': 'Custom header value' + }), locale: Joi.string().empty('').max(100).example('fr').description('Optional locale'), tz: Joi.string().empty('').max(100).example('Europe/Tallinn').description('Optional timezone') @@ -4930,6 +4932,7 @@ When making API calls remember that requests against the same account are queued then: Joi.optional(), otherwise: Joi.forbidden() }) + .meta({ swaggerHidden: true }) }), payload: Joi.object({ @@ -5052,6 +5055,7 @@ When making API calls remember that requests against the same account are queued .description('If enabled then returns the ElasticSearch query for debugging as part of the response') .label('exposeQuery') .optional() + .meta({ swaggerHidden: true }) }), payload: Joi.object({ @@ -5254,7 +5258,8 @@ When making API calls remember that requests against the same account are queued .when('mailMerge', { is: Joi.exist().not(false, null), then: Joi.forbidden('y') - }), + }) + .label('TemplateRender'), mailMerge: Joi.array() .items( @@ -5393,6 +5398,24 @@ When making API calls remember that requests against the same account are queued .oxor('raw', 'text') .oxor('raw', 'attachments') .label('SubmitMessage') + .example({ + to: [ + { + name: 'Nyan Cat', + address: 'nyan.cat@example.com' + } + ], + subject: 'What a wonderful message!', + text: 'Hello from myself!', + html: '

Hello from myself!

', + attachments: [ + { + filename: 'transparent.gif', + content: 'R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=', + contentType: 'image/gif' + } + ] + }) }, response: {