@piggly/fastify-chassis
Version:
An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.
22 lines (21 loc) • 816 B
TypeScript
import type { FastifyRequest, FastifyReply } from 'fastify';
import type { NonceTokenService } from '../services';
/**
* NonceBodyIssuerRoute is a route that issues a nonce as a body.
*
* On request body, you can send a number to issue that many nonces.
* E.g: { size: 3 }, by default it will issue 1 nonce.
*
* It will return a 200 status code and nonces as a body.
* E.g: { tokens: ['nonce1', 'nonce2', 'nonce3'] }
*
* @param {Object} deps
* @param {NonceTokenService} deps.NONCE_SERVICE
* @param {number} [ttl] The TTL of the nonce.
* @returns Route handler.
* @since 7.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
export declare const NonceBodyIssuerRoute: (deps: {
NONCE_SERVICE: NonceTokenService;
}, ttl?: number) => (request: FastifyRequest, reply: FastifyReply) => Promise<any>;