Include enabled2fa and autoreply in user listing

This commit is contained in:
Andris Reinman 2019-10-10 13:55:21 +03:00
parent 346242277c
commit c1537dbaf5
5 changed files with 12 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
define({ "name": "wildduck", "version": "1.0.0", "description": "WildDuck API docs", "title": "WildDuck API", "url": "https://api.wildduck.email", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-10-01T08:21:54.311Z", "url": "http://apidocjs.com", "version": "0.17.7" } });
define({ "name": "wildduck", "version": "1.0.0", "description": "WildDuck API docs", "title": "WildDuck API", "url": "https://api.wildduck.email", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-10-10T10:54:16.836Z", "url": "http://apidocjs.com", "version": "0.17.7" } });

View file

@ -1 +1 @@
{ "name": "wildduck", "version": "1.0.0", "description": "WildDuck API docs", "title": "WildDuck API", "url": "https://api.wildduck.email", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-10-01T08:21:54.311Z", "url": "http://apidocjs.com", "version": "0.17.7" } }
{ "name": "wildduck", "version": "1.0.0", "description": "WildDuck API docs", "title": "WildDuck API", "url": "https://api.wildduck.email", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-10-10T10:54:16.836Z", "url": "http://apidocjs.com", "version": "0.17.7" } }

View file

@ -45,6 +45,8 @@ module.exports = (db, server, userHandler) => {
* @apiSuccess {String} results.address Main email address of the User
* @apiSuccess {String[]} results.tags List of tags associated with the User'
* @apiSuccess {String[]} results.targets List of forwarding targets
* @apiSuccess {String[]} results.enabled2fa List of enabled 2FA methods
* @apiSuccess {Boolean} results.autoreply Is autoreply enabled or not (start time may still be in the future or end time in the past)
* @apiSuccess {Boolean} results.encryptMessages If <code>true</code> then received messages are encrypted
* @apiSuccess {Boolean} results.encryptForwarded If <code>true</code> then forwarded messages are encrypted
* @apiSuccess {Object} results.quota Quota usage limits
@ -75,6 +77,8 @@ module.exports = (db, server, userHandler) => {
* "address": "john@example.com",
* "tags": [],
* "forward": [],
* "enabled2a": ["totp"],
* "autoreply": false,
* "encryptMessages": false,
* "encryptForwarded": false,
* "quota": {
@ -241,6 +245,8 @@ module.exports = (db, server, userHandler) => {
address: true,
tags: true,
storageUsed: true,
enabled2a: true,
autoreply: true,
targets: true,
quota: true,
activated: true,
@ -291,6 +297,8 @@ module.exports = (db, server, userHandler) => {
address: userData.address,
tags: userData.tags || [],
targets: userData.targets && userData.targets.map(t => t.value),
enabled2fa: Array.isArray(userData.enabled2fa) ? userData.enabled2fa : [].concat(userData.enabled2fa ? 'totp' : []),
autoreply: !!userData.autoreply,
encryptMessages: !!userData.encryptMessages,
encryptForwarded: !!userData.encryptForwarded,
quota: {