katya / src /routes.ts
esubtelnik's picture
Add download endpoints for visitors, employees, and books; update Swagger documentation
2200342
/* tslint:disable */
/* eslint-disable */
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import type { TsoaRoute } from '@tsoa/runtime';
import { fetchMiddlewares, ExpressTemplateService } from '@tsoa/runtime';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import { VisitorController } from './controllers/visitors';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import { EmployeeController } from './controllers/employee';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import { BookController } from './controllers/books';
import type { Request as ExRequest, Response as ExResponse, RequestHandler, Router } from 'express';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const models: TsoaRoute.Models = {
"Genre": {
"dataType": "refEnum",
"enums": ["Fiction","Non-Fiction","Mystery","Sci-Fi","Fantasy","Biography","History","Romance","Thriller","Horror","Poetry","Drama","Comics","Other"],
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"BookStatus": {
"dataType": "refEnum",
"enums": ["available","borrowed"],
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Book": {
"dataType": "refObject",
"properties": {
"id": {"dataType":"string","required":true},
"title": {"dataType":"string","required":true},
"author": {"dataType":"string","required":true},
"pages": {"dataType":"double","required":true},
"year": {"dataType":"double","required":true},
"genre": {"ref":"Genre","required":true},
"status": {"ref":"BookStatus","required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Pick_Visitor.Exclude_keyofVisitor.currentBooks-or-history__": {
"dataType": "refAlias",
"type": {"dataType":"nestedObjectLiteral","nestedProperties":{"id":{"dataType":"string","required":true},"name":{"dataType":"string","required":true},"surname":{"dataType":"string","required":true},"registrationDate":{"dataType":"string","required":true}},"validators":{}},
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"VisitorWithBooks": {
"dataType": "refObject",
"properties": {
"id": {"dataType":"string","required":true},
"name": {"dataType":"string","required":true},
"surname": {"dataType":"string","required":true},
"registrationDate": {"dataType":"string","required":true},
"currentBooks": {"dataType":"array","array":{"dataType":"refObject","ref":"Book"},"required":true},
"history": {"dataType":"array","array":{"dataType":"refObject","ref":"Book"},"required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ErrorResponse": {
"dataType": "refObject",
"properties": {
"message": {"dataType":"string","required":true},
"code": {"dataType":"string"},
"statusCode": {"dataType":"double"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse_VisitorWithBooks-Array_": {
"dataType": "refObject",
"properties": {
"data": {"dataType":"array","array":{"dataType":"refObject","ref":"VisitorWithBooks"}},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse_VisitorWithBooks_": {
"dataType": "refObject",
"properties": {
"data": {"ref":"VisitorWithBooks"},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Link": {
"dataType": "refObject",
"properties": {
"table": {"dataType":"string","required":true},
"id": {"dataType":"string","required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Visitor": {
"dataType": "refObject",
"properties": {
"id": {"dataType":"string","required":true},
"name": {"dataType":"string","required":true},
"surname": {"dataType":"string","required":true},
"registrationDate": {"dataType":"string","required":true},
"currentBooks": {"dataType":"array","array":{"dataType":"refObject","ref":"Link"},"required":true},
"history": {"dataType":"array","array":{"dataType":"refObject","ref":"Link"},"required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse_Visitor_": {
"dataType": "refObject",
"properties": {
"data": {"ref":"Visitor"},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"CreateVisitorRequest": {
"dataType": "refObject",
"properties": {
"name": {"dataType":"string","required":true},
"surname": {"dataType":"string","required":true},
"registrationDate": {"dataType":"string","required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Partial_CreateVisitorRequest_": {
"dataType": "refAlias",
"type": {"dataType":"nestedObjectLiteral","nestedProperties":{"name":{"dataType":"string"},"surname":{"dataType":"string"},"registrationDate":{"dataType":"string"}},"validators":{}},
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse_void_": {
"dataType": "refObject",
"properties": {
"data": {"dataType":"void"},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"DayOfWeek": {
"dataType": "refEnum",
"enums": ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Employee": {
"dataType": "refObject",
"properties": {
"id": {"dataType":"string","required":true},
"name": {"dataType":"string","required":true},
"surname": {"dataType":"string","required":true},
"experience": {"dataType":"double","required":true},
"workDays": {"dataType":"array","array":{"dataType":"refEnum","ref":"DayOfWeek"},"required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse_Employee-Array_": {
"dataType": "refObject",
"properties": {
"data": {"dataType":"array","array":{"dataType":"refObject","ref":"Employee"}},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse_Employee_": {
"dataType": "refObject",
"properties": {
"data": {"ref":"Employee"},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"CreateEmployeeRequest": {
"dataType": "refObject",
"properties": {
"name": {"dataType":"string","required":true},
"surname": {"dataType":"string","required":true},
"experience": {"dataType":"double","required":true},
"workDays": {"dataType":"array","array":{"dataType":"refEnum","ref":"DayOfWeek"},"required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Partial_CreateEmployeeRequest_": {
"dataType": "refAlias",
"type": {"dataType":"nestedObjectLiteral","nestedProperties":{"name":{"dataType":"string"},"surname":{"dataType":"string"},"experience":{"dataType":"double"},"workDays":{"dataType":"array","array":{"dataType":"refEnum","ref":"DayOfWeek"}}},"validators":{}},
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse_Book-Array_": {
"dataType": "refObject",
"properties": {
"data": {"dataType":"array","array":{"dataType":"refObject","ref":"Book"}},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse_Book_": {
"dataType": "refObject",
"properties": {
"data": {"ref":"Book"},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"CreateBookRequest": {
"dataType": "refObject",
"properties": {
"title": {"dataType":"string","required":true},
"author": {"dataType":"string","required":true},
"pages": {"dataType":"double","required":true},
"year": {"dataType":"double","required":true},
"genre": {"ref":"Genre","required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Partial_CreateBookRequest_": {
"dataType": "refAlias",
"type": {"dataType":"nestedObjectLiteral","nestedProperties":{"title":{"dataType":"string"},"author":{"dataType":"string"},"pages":{"dataType":"double"},"year":{"dataType":"double"},"genre":{"ref":"Genre"}},"validators":{}},
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ApiResponse__message-string__": {
"dataType": "refObject",
"properties": {
"data": {"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}},
"successful": {"dataType":"boolean","required":true},
"error": {"ref":"ErrorResponse"},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"BorrowBookRequest": {
"dataType": "refObject",
"properties": {
"bookIds": {"dataType":"array","array":{"dataType":"string"},"required":true},
"visitorId": {"dataType":"string","required":true},
"employeeId": {"dataType":"string","required":true},
"borrowDate": {"dataType":"string","required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ReturnBookRequest": {
"dataType": "refObject",
"properties": {
"bookIds": {"dataType":"array","array":{"dataType":"string"},"required":true},
"visitorId": {"dataType":"string","required":true},
"employeeId": {"dataType":"string","required":true},
"returnDate": {"dataType":"string","required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
};
const templateService = new ExpressTemplateService(models, {"noImplicitAdditionalProperties":"throw-on-extras","bodyCoercion":true});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
export function RegisterRoutes(app: Router) {
// ###########################################################################################################
// NOTE: If you do not see routes for all of your controllers in this file, then you might not have informed tsoa of where to look
// Please look into the "controllerPathGlobs" config option described in the readme: https://github.com/lukeautry/tsoa
// ###########################################################################################################
const argsVisitorController_getVisitors: Record<string, TsoaRoute.ParameterSchema> = {
};
app.get('/visitors',
...(fetchMiddlewares<RequestHandler>(VisitorController)),
...(fetchMiddlewares<RequestHandler>(VisitorController.prototype.getVisitors)),
async function VisitorController_getVisitors(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsVisitorController_getVisitors, request, response });
const controller = new VisitorController();
await templateService.apiHandler({
methodName: 'getVisitors',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsVisitorController_getVisitor: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.get('/visitors/:id',
...(fetchMiddlewares<RequestHandler>(VisitorController)),
...(fetchMiddlewares<RequestHandler>(VisitorController.prototype.getVisitor)),
async function VisitorController_getVisitor(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsVisitorController_getVisitor, request, response });
const controller = new VisitorController();
await templateService.apiHandler({
methodName: 'getVisitor',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsVisitorController_addVisitor: Record<string, TsoaRoute.ParameterSchema> = {
body: {"in":"body","name":"body","required":true,"ref":"CreateVisitorRequest"},
};
app.post('/visitors',
...(fetchMiddlewares<RequestHandler>(VisitorController)),
...(fetchMiddlewares<RequestHandler>(VisitorController.prototype.addVisitor)),
async function VisitorController_addVisitor(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsVisitorController_addVisitor, request, response });
const controller = new VisitorController();
await templateService.apiHandler({
methodName: 'addVisitor',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsVisitorController_updateVisitor: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
body: {"in":"body","name":"body","required":true,"ref":"Partial_CreateVisitorRequest_"},
};
app.patch('/visitors/:id',
...(fetchMiddlewares<RequestHandler>(VisitorController)),
...(fetchMiddlewares<RequestHandler>(VisitorController.prototype.updateVisitor)),
async function VisitorController_updateVisitor(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsVisitorController_updateVisitor, request, response });
const controller = new VisitorController();
await templateService.apiHandler({
methodName: 'updateVisitor',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsVisitorController_deleteVisitor: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.delete('/visitors/:id',
...(fetchMiddlewares<RequestHandler>(VisitorController)),
...(fetchMiddlewares<RequestHandler>(VisitorController.prototype.deleteVisitor)),
async function VisitorController_deleteVisitor(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsVisitorController_deleteVisitor, request, response });
const controller = new VisitorController();
await templateService.apiHandler({
methodName: 'deleteVisitor',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsVisitorController_downloadVisitor: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.get('/visitors/:id/download',
...(fetchMiddlewares<RequestHandler>(VisitorController)),
...(fetchMiddlewares<RequestHandler>(VisitorController.prototype.downloadVisitor)),
async function VisitorController_downloadVisitor(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsVisitorController_downloadVisitor, request, response });
const controller = new VisitorController();
await templateService.apiHandler({
methodName: 'downloadVisitor',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsEmployeeController_getEmployees: Record<string, TsoaRoute.ParameterSchema> = {
};
app.get('/employees',
...(fetchMiddlewares<RequestHandler>(EmployeeController)),
...(fetchMiddlewares<RequestHandler>(EmployeeController.prototype.getEmployees)),
async function EmployeeController_getEmployees(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsEmployeeController_getEmployees, request, response });
const controller = new EmployeeController();
await templateService.apiHandler({
methodName: 'getEmployees',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsEmployeeController_getEmployee: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.get('/employees/:id',
...(fetchMiddlewares<RequestHandler>(EmployeeController)),
...(fetchMiddlewares<RequestHandler>(EmployeeController.prototype.getEmployee)),
async function EmployeeController_getEmployee(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsEmployeeController_getEmployee, request, response });
const controller = new EmployeeController();
await templateService.apiHandler({
methodName: 'getEmployee',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsEmployeeController_addEmployee: Record<string, TsoaRoute.ParameterSchema> = {
body: {"in":"body","name":"body","required":true,"ref":"CreateEmployeeRequest"},
};
app.post('/employees',
...(fetchMiddlewares<RequestHandler>(EmployeeController)),
...(fetchMiddlewares<RequestHandler>(EmployeeController.prototype.addEmployee)),
async function EmployeeController_addEmployee(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsEmployeeController_addEmployee, request, response });
const controller = new EmployeeController();
await templateService.apiHandler({
methodName: 'addEmployee',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsEmployeeController_updateEmployee: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
body: {"in":"body","name":"body","required":true,"ref":"Partial_CreateEmployeeRequest_"},
};
app.patch('/employees/:id',
...(fetchMiddlewares<RequestHandler>(EmployeeController)),
...(fetchMiddlewares<RequestHandler>(EmployeeController.prototype.updateEmployee)),
async function EmployeeController_updateEmployee(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsEmployeeController_updateEmployee, request, response });
const controller = new EmployeeController();
await templateService.apiHandler({
methodName: 'updateEmployee',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsEmployeeController_deleteEmployee: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.delete('/employees/:id',
...(fetchMiddlewares<RequestHandler>(EmployeeController)),
...(fetchMiddlewares<RequestHandler>(EmployeeController.prototype.deleteEmployee)),
async function EmployeeController_deleteEmployee(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsEmployeeController_deleteEmployee, request, response });
const controller = new EmployeeController();
await templateService.apiHandler({
methodName: 'deleteEmployee',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsEmployeeController_downloadEmployee: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.get('/employees/:id/download',
...(fetchMiddlewares<RequestHandler>(EmployeeController)),
...(fetchMiddlewares<RequestHandler>(EmployeeController.prototype.downloadEmployee)),
async function EmployeeController_downloadEmployee(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsEmployeeController_downloadEmployee, request, response });
const controller = new EmployeeController();
await templateService.apiHandler({
methodName: 'downloadEmployee',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsBookController_getBooks: Record<string, TsoaRoute.ParameterSchema> = {
};
app.get('/books',
...(fetchMiddlewares<RequestHandler>(BookController)),
...(fetchMiddlewares<RequestHandler>(BookController.prototype.getBooks)),
async function BookController_getBooks(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsBookController_getBooks, request, response });
const controller = new BookController();
await templateService.apiHandler({
methodName: 'getBooks',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsBookController_addBook: Record<string, TsoaRoute.ParameterSchema> = {
body: {"in":"body","name":"body","required":true,"ref":"CreateBookRequest"},
};
app.post('/books',
...(fetchMiddlewares<RequestHandler>(BookController)),
...(fetchMiddlewares<RequestHandler>(BookController.prototype.addBook)),
async function BookController_addBook(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsBookController_addBook, request, response });
const controller = new BookController();
await templateService.apiHandler({
methodName: 'addBook',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsBookController_getBook: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.get('/books/:id',
...(fetchMiddlewares<RequestHandler>(BookController)),
...(fetchMiddlewares<RequestHandler>(BookController.prototype.getBook)),
async function BookController_getBook(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsBookController_getBook, request, response });
const controller = new BookController();
await templateService.apiHandler({
methodName: 'getBook',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsBookController_updateBook: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
body: {"in":"body","name":"body","required":true,"ref":"Partial_CreateBookRequest_"},
};
app.patch('/books/:id',
...(fetchMiddlewares<RequestHandler>(BookController)),
...(fetchMiddlewares<RequestHandler>(BookController.prototype.updateBook)),
async function BookController_updateBook(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsBookController_updateBook, request, response });
const controller = new BookController();
await templateService.apiHandler({
methodName: 'updateBook',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsBookController_deleteBook: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.delete('/books/:id',
...(fetchMiddlewares<RequestHandler>(BookController)),
...(fetchMiddlewares<RequestHandler>(BookController.prototype.deleteBook)),
async function BookController_deleteBook(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsBookController_deleteBook, request, response });
const controller = new BookController();
await templateService.apiHandler({
methodName: 'deleteBook',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsBookController_downloadBook: Record<string, TsoaRoute.ParameterSchema> = {
id: {"in":"path","name":"id","required":true,"dataType":"string"},
};
app.get('/books/:id/download',
...(fetchMiddlewares<RequestHandler>(BookController)),
...(fetchMiddlewares<RequestHandler>(BookController.prototype.downloadBook)),
async function BookController_downloadBook(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsBookController_downloadBook, request, response });
const controller = new BookController();
await templateService.apiHandler({
methodName: 'downloadBook',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsBookController_borrowBook: Record<string, TsoaRoute.ParameterSchema> = {
body: {"in":"body","name":"body","required":true,"ref":"BorrowBookRequest"},
};
app.post('/books/borrow',
...(fetchMiddlewares<RequestHandler>(BookController)),
...(fetchMiddlewares<RequestHandler>(BookController.prototype.borrowBook)),
async function BookController_borrowBook(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsBookController_borrowBook, request, response });
const controller = new BookController();
await templateService.apiHandler({
methodName: 'borrowBook',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const argsBookController_returnBook: Record<string, TsoaRoute.ParameterSchema> = {
body: {"in":"body","name":"body","required":true,"ref":"ReturnBookRequest"},
};
app.post('/books/return',
...(fetchMiddlewares<RequestHandler>(BookController)),
...(fetchMiddlewares<RequestHandler>(BookController.prototype.returnBook)),
async function BookController_returnBook(request: ExRequest, response: ExResponse, next: any) {
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args: argsBookController_returnBook, request, response });
const controller = new BookController();
await templateService.apiHandler({
methodName: 'returnBook',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
}
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa