wildduck/lib/schemas/response/general-schemas.js
NickOvt f55ddea06d
fix(api-certs): Certs API endpoints added to API docs generation ZMS-141 (#663)
* Added list registered TLS certificates api endpoint to api docs generation. Add examples to res types

* fix last commit's typo

* Resolve ID for a server name api endpoint added to api docs generation. Add examples to res types

* added create or update TLS sertificate for server name api endpoint to api docs generation

* add acme to response of last commit's changes

* added Delete a TLS certificate api endpoint to api docs generation

* delete cert api endpoint change certs -> cert path param

* fix cert-handler typo and bug. Added Request TLS certificate information api endpoint to api docs generation

* last commit add certs.js
2024-04-03 11:45:44 +03:00

34 lines
1.3 KiB
JavaScript

'use strict';
const Joi = require('joi');
const { booleanSchema } = require('../../schemas');
const successRes = booleanSchema.required().description('Indicates successful response').example(true);
const totalRes = Joi.number().required().description('How many results were found').example(541);
const pageRes = Joi.number().required().description('Current page number. Derived from page query argument').example(1);
const previousCursorRes = Joi.alternatives()
.try(Joi.string(), booleanSchema)
.required()
.description('Either a cursor string or false if there are not any previous results')
.example('eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0');
const nextCursorRes = Joi.alternatives()
.try(Joi.string(), booleanSchema)
.required()
.description('Either a cursor string or false if there are not any next results')
.example('TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR');
const quotaRes = Joi.object({
allowed: Joi.number().required().description('Allowed quota of the user in bytes'),
used: Joi.number().required().description('Space used in bytes')
})
.$_setFlag('objectName', 'Quota')
.description('Quota usage limits');
module.exports = {
successRes,
totalRes,
pageRes,
previousCursorRes,
nextCursorRes,
quotaRes
};