2024-05-07 09:36:44 +03:00
|
|
|
/** @typedef {object} PermissionsObject */
|
|
|
|
/** @typedef {boolean} PermissionsBoolean */
|
|
|
|
|
|
|
|
/** @typedef {number} StatusCodeNumber */
|
|
|
|
/** @typedef {(result: any) => number} StatusCodeFunction */
|
|
|
|
|
|
|
|
/** @typedef {object} ValidationObject */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {object} ControllerMethod
|
|
|
|
* @property {object} headers
|
|
|
|
* @property {PermissionsBoolean | PermissionsObject} permissions
|
|
|
|
* @property {string[]} [options]
|
|
|
|
* @property {ValidationObject} [validation]
|
|
|
|
* @property {string[]} [data]
|
|
|
|
* @property {StatusCodeFunction | StatusCodeNumber} [statusCode]
|
|
|
|
* @property {object} [response]
|
|
|
|
* @property {function} [cache]
|
|
|
|
* @property {(frame: import('./lib/Frame')) => object} [generateCacheKeyData]
|
|
|
|
* @property {(frame: import('./lib/Frame')) => any} query
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {Record<string, ControllerMethod | string> & Record<'docName', string>} Controller
|
|
|
|
*/
|
|
|
|
|
2022-08-11 17:39:37 +03:00
|
|
|
module.exports = require('./lib/api-framework');
|