wildduck/lib/schemas/response/users-schemas.js
NickOvt a15878c7d7
fix(docs): /users API docs ZMS-110 (#575)
* /users GET endpoint added

* added /users POST to api generation

* added /users/resolve/:username GET endpoint for api generation

* fixes + request user info GET endpoint added

* Added Update User information api path to api docs generation

* added Log out User endpoint to api generation

* Added Recalculate User quota endpoint to API generation

* added Recalculate Quota for all users endpoint to api generation

* added Export data endpoint to API generation

* added Import user data endpoint to API generation

* Reset password for a User endpoint added to API generation

* Reset password for a User endpoint add param to res

* add missing response types

* added Delete a User, Return recovery info for a deleted User, Cancel user deletion task - endpoints to API generation

* fix typo in users.js
2023-12-21 10:42:09 +02:00

29 lines
1.9 KiB
JavaScript

'use strict';
const Joi = require('joi');
const { booleanSchema } = require('../../schemas');
const { quotaRes } = require('./general-schemas');
const GetUsersResult = Joi.object({
id: Joi.string().required().description('Users unique ID (24byte hex)'),
username: Joi.string().required().description('Username of the User'),
name: Joi.string().required().description('Name of the User'),
address: Joi.string().required().description('Main email address of the User'),
tags: Joi.array().items(Joi.string()).required().description('List of tags associated with the User'),
targets: Joi.array().items(Joi.string()).required().description('List of forwarding targets'),
enabled2fa: Joi.array().items(Joi.string()).required().description('List of enabled 2FA methods'),
autoreply: booleanSchema.required().description('Is autoreply enabled or not (start time may still be in the future or end time in the past)'),
encryptMessages: booleanSchema.required().description('If true then received messages are encrypted'),
encryptForwarded: booleanSchema.required().description('If true then forwarded messages are encrypted'),
quota: quotaRes,
metaData: Joi.object().description('Custom metadata value. Included if metaData query argument was true'),
internalData: Joi.object().description(
'Custom metadata value for internal use. Included if internalData query argument was true and request was not made using user-role token'
),
hasPasswordSet: booleanSchema.required().description('If true then the User has a password set and can authenticate'),
activated: booleanSchema.required().description('Is the account activated'),
disabled: booleanSchema.required().description('If true then user can not authenticate or receive any new mail'),
suspended: booleanSchema.required().description('If true then user can not authenticate')
}).$_setFlag('objectName', 'GetUsersResult');
module.exports = { GetUsersResult };