Skip to content

Commit

Permalink
tiny schema description changes
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Jan 2, 2025
1 parent 99e805b commit e3ca1e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
9 changes: 8 additions & 1 deletion lib/schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,14 @@ const accountCountersSchema = Joi.object({
const pathSchemaDescription =
'Check changes only on selected paths. Either a single string path or an array of paths. Can use references like "\\Sent" or "\\Inbox". Set to `null` to unset.';
const pathSchema = Joi.string().empty('').max(1024).example('INBOX').description(pathSchemaDescription);
const accountPathSchema = Joi.array().items(pathSchema).single().allow(null).description(pathSchemaDescription);
const accountPathSchema = Joi.array()
.items(pathSchema)
.single()
.allow(null)
.description(pathSchemaDescription)
.description(
'Specifies which mailbox folders to monitor for changes. The wildcard "*" includes all folders (also the default). Although you can still make API requests to folders not listed here, you will not receive webhooks for changes in those unlisted folders.'
);

const defaultAccountTypeSchema = Joi.string()
.empty('')
Expand Down
18 changes: 12 additions & 6 deletions workers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,9 @@ const init = async () => {
.max(256)
.allow(null)
.example('example')
.description('Account ID. If the provided value is `null` then an unique ID will be autogenerated')
.description(
'Account ID. If set to `null`, a unique ID will be generated automatically. If you provide an existing account ID, the settings for that account will be updated instead'
)
.required(),

name: Joi.string().max(256).required().example('My Email Account').description('Display name for the account'),
Expand Down Expand Up @@ -2784,32 +2786,36 @@ const init = async () => {
.example('example')
.default(null)
.description(
'Account ID. If the provided value is `null` then an unique ID will be autogenerated. Using an existing account ID will update settings for that existing account.'
'Account ID. If set to `null`, a unique ID will be generated automatically. If you provide an existing account ID, the settings for that account will be updated instead'
),

name: Joi.string().empty('').max(256).example('My Email Account').description('Display name for the account'),
email: Joi.string().empty('').email().example('user@example.com').description('Default email address of the account'),

email: Joi.string()
.empty('')
.email()
.example('user@example.com')
.description('Specifies the default email address for this account. Users can change it if needed.'),

delegated: Joi.boolean()
.empty('')
.truthy('Y', 'true', '1')
.falsy('N', 'false', 0)
.default(false)
.description('If true then acts as a shared mailbox. Available for MS365 OAuth2 accounts.'),
.description('If true, configures this account as a shared mailbox. Currently supported by MS365 OAuth2 accounts'),

syncFrom: accountSchemas.syncFrom,
notifyFrom: accountSchemas.notifyFrom,

subconnections: accountSchemas.subconnections,

path: accountPathSchema.example(['*']).label('AccountFormPath'),

redirectUrl: Joi.string()
.empty('')
.uri({ scheme: ['http', 'https'], allowRelative: false })
.required()
.example('https://myapp/account/settings.php')
.description('The user will be redirected to this URL after submitting the authentication form'),
.description('After the authentication process is completed, the user is redirected to this URL'),

type: defaultAccountTypeSchema
}).label('RequestAuthForm')
Expand Down

0 comments on commit e3ca1e8

Please sign in to comment.