Skip to content

Commit 8c7ce99

Browse files
authored
Release 4.0.4 (#133)
* feat: add require() to template utils object; bump: up version to 4.0.4 * docs: update changelog
1 parent 95f03b1 commit 8c7ce99

15 files changed

+24
-14
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# next release
22

3+
# 4.0.4
4+
5+
Features:
6+
- add `require()` to template `utils` object
7+
8+
Docs:
9+
- add information about contributors
10+
311
# 4.0.3
412

513
Features:

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-typescript-api",
3-
"version": "4.0.3",
3+
"version": "4.0.4",
44
"description": "Create typescript api module from swagger schema",
55
"scripts": {
66
"cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts --extract-request-params --enum-names-as-values",

src/render/utils/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ module.exports = {
1515
inlineExtraFormatters,
1616
fmtToJSDocLine: require("./fmtToJSDocLine"),
1717
_: require("lodash"),
18+
require: require,
1819
};

templates/default/api.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { apiConfig, routes, utils, config } = it;
3-
const { _ } = utils;
3+
const { _, require } = utils;
44
const genericValues = apiConfig.generic.map(g => ({
55
withDefault: `${g.name} = ${g.defaultValue}`,
66
name: g.name,

templates/default/data-contracts.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { modelTypes, utils } = it;
3-
const { formatDescription } = utils;
3+
const { formatDescription, require } = utils;
44

55

66
const dataContractTemplates = {

templates/default/procedure-call.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { utils, route, config } = it;
3-
const { _, getInlineParseContent, getParseContent, parseSchema, getComponentByRef } = utils;
3+
const { _, getInlineParseContent, getParseContent, parseSchema, getComponentByRef, require } = utils;
44
const { parameters, path, method, payload, params, query, formData, security, requestParams } = route.request;
55
const { type, errorType } = route.response;
66
const routeDocs = includeFile("./route-docs", { config, route, utils });

templates/default/route-docs.eta

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<%
22
const { config, route, utils } = it;
3-
const { _, formatDescription, fmtToJSDocLine, classNameCase } = utils;
3+
const { _, formatDescription, fmtToJSDocLine, classNameCase, require } = utils;
44
const { raw, request, routeName } = route;
5+
56
const jsDocDescription = raw.description ?
67
` * @description ${formatDescription(raw.description, true)}` :
78
fmtToJSDocLine('No description', { eol: false });

templates/default/route-name.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const {
1111
summary,
1212
pathArgs,
1313
} = routeInfo;
14-
const { _, fmtToJSDocLine } = utils;
14+
const { _, fmtToJSDocLine, require } = utils;
1515

1616
const methodAliases = {
1717
get: (pathName, hasPathInserts) =>

templates/default/route-type.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { route, utils, config } = it;
3-
const { _, classNameCase } = utils
3+
const { _, classNameCase, require } = utils
44
const { query, payload } = route.request
55
const { type: responseType } = route.response
66

templates/modular/api.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { utils, route, config, modelTypes } = it;
3-
const { _, classNameCase } = utils;
3+
const { _, classNameCase, require } = utils;
44
const apiClassName = classNameCase(route.moduleName);
55
const routes = route.routes;
66
const dataContracts = _.map(modelTypes, "name");

templates/modular/data-contracts.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { modelTypes, utils } = it;
3-
const { formatDescription } = utils;
3+
const { formatDescription, require } = utils;
44

55

66
const dataContractTemplates = {

templates/modular/procedure-call.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { utils, route, config } = it;
3-
const { _, getInlineParseContent, getParseContent, parseSchema, getComponentByRef } = utils;
3+
const { _, getInlineParseContent, getParseContent, parseSchema, getComponentByRef, require } = utils;
44
const { parameters, path, method, payload, params, query, formData, security, requestParams } = route.request;
55
const { type, errorType } = route.response;
66
const routeDocs = includeFile("./route-docs", { config, route, utils });

templates/modular/route-docs.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { config, route, utils } = it;
3-
const { _, formatDescription, fmtToJSDocLine, classNameCase } = utils;
3+
const { _, formatDescription, fmtToJSDocLine, classNameCase, require } = utils;
44
const { raw, request, routeName } = route;
55
const jsDocDescription = raw.description ?
66
` * @description ${formatDescription(raw.description, true)}` :

templates/modular/route-type.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
const { utils, route, config } = it;
3-
const { _, fmtToJSDocLine, classNameCase } = utils;
3+
const { _, fmtToJSDocLine, classNameCase, require } = utils;
44
const { name, jsDocDescription, routeName } = route;
55
const { query, payload } = route.request;
66
const { type: responseType } = route.response;

0 commit comments

Comments
 (0)