12345678910111213141516171819202122 |
- <%
- const { route, utils, config } = it;
- const { _, pascalCase, require } = utils;
- const { query, payload, pathParams, headers } = route.request;
- const routeDocs = includeFile("./route-docs", { config, route, utils });
- const routeNamespace = pascalCase(route.routeName.usage);
- %>
- /**
- <%~ routeDocs.description %>
- <%~ routeDocs.lines %>
- */
- export namespace <%~ routeNamespace %> {
- export type RequestParams = <%~ (pathParams && pathParams.type) || '{}' %>;
- export type RequestQuery = <%~ (query && query.type) || '{}' %>;
- export type RequestBody = <%~ (payload && payload.type) || 'never' %>;
- export type RequestHeaders = <%~ (headers && headers.type) || '{}' %>;
- export type ResponseBody = <%~ route.response.type %>;
- }
|