very-express 0.0.11 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +2 -1
- package/.eslintrc.json +37 -0
- package/dist/cli.js +36 -33
- package/dist/generators/controller.template.d.ts +5 -4
- package/dist/generators/controller.template.js +174 -131
- package/dist/generators/controllers.generator.d.ts +6 -1
- package/dist/generators/controllers.generator.js +99 -77
- package/dist/generators/index.d.ts +3 -3
- package/dist/generators/openapi.generator.d.ts +5 -1
- package/dist/generators/openapi.generator.js +125 -121
- package/dist/generators/packageJson.generator.js +5 -12
- package/dist/generators/routes.generator.d.ts +10 -5
- package/dist/generators/routes.generator.js +6 -7
- package/dist/generators/routes.template.d.ts +4 -5
- package/dist/generators/routes.template.js +49 -27
- package/dist/generators/server.generator.d.ts +1 -1
- package/dist/generators/server.generator.js +9 -13
- package/dist/generators/server.template.d.ts +1 -2
- package/dist/generators/server.template.js +24 -25
- package/dist/index.d.ts +2 -2
- package/dist/index.js +45 -45
- package/dist/preprocess/jsonschemaFormat.d.ts +2 -0
- package/dist/preprocess/jsonschemaFormat.js +94 -0
- package/dist/templates/root/package.json +7 -4
- package/dist/templates/utils/common.gen.ts +35 -11
- package/dist/test.d.ts +1 -0
- package/dist/test.js +10 -0
- package/dist/types/controller.d.ts +0 -0
- package/dist/types/controller.js +1 -0
- package/dist/types/openapi.d.ts +21 -18
- package/dist/types/openapi.js +0 -24
- package/dist/types/types.d.ts +36 -21
- package/dist/types/types.js +3 -13
- package/dist/utils/common.d.ts +8 -6
- package/dist/utils/common.js +81 -35
- package/dist/utils/log.d.ts +1 -1
- package/dist/utils/log.js +5 -5
- package/package.json +60 -56
- package/vex.config.json +7 -0
package/.env
CHANGED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"eslint:recommended",
|
|
8
|
+
"plugin:@typescript-eslint/recommended"
|
|
9
|
+
],
|
|
10
|
+
"parser": "@typescript-eslint/parser",
|
|
11
|
+
"parserOptions": {
|
|
12
|
+
"ecmaVersion": "latest",
|
|
13
|
+
"sourceType": "module"
|
|
14
|
+
},
|
|
15
|
+
"plugins": [
|
|
16
|
+
"@typescript-eslint"
|
|
17
|
+
],
|
|
18
|
+
"rules": {
|
|
19
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
20
|
+
"indent": [
|
|
21
|
+
"error",
|
|
22
|
+
4
|
|
23
|
+
],
|
|
24
|
+
"linebreak-style": [
|
|
25
|
+
"error",
|
|
26
|
+
"unix"
|
|
27
|
+
],
|
|
28
|
+
"quotes": [
|
|
29
|
+
"error",
|
|
30
|
+
"double"
|
|
31
|
+
],
|
|
32
|
+
"semi": [
|
|
33
|
+
"error",
|
|
34
|
+
"always"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -10,56 +10,59 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
10
10
|
const child_process_1 = __importDefault(require("child_process"));
|
|
11
11
|
const minimist_1 = __importDefault(require("minimist"));
|
|
12
12
|
const log_1 = __importDefault(require("./utils/log"));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (fs_1.default.existsSync(
|
|
13
|
+
const args = (0, minimist_1.default)(process.argv.slice(2));
|
|
14
|
+
let config = {};
|
|
15
|
+
if (fs_1.default.existsSync("vex.config.json")) {
|
|
16
16
|
try {
|
|
17
|
-
config = JSON.parse(fs_1.default.readFileSync(
|
|
17
|
+
config = JSON.parse(fs_1.default.readFileSync("vex.config.json", "utf8"));
|
|
18
18
|
}
|
|
19
19
|
catch (err) {
|
|
20
|
-
log_1.default.error(
|
|
20
|
+
log_1.default.error("failed to parse vex.config.json", err);
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
|
-
;
|
|
24
23
|
}
|
|
25
|
-
;
|
|
26
24
|
config.commitBeforeGenerate = (_a = config.commitBeforeGenerate) !== null && _a !== void 0 ? _a : false;
|
|
27
|
-
config.jsonSchemaDir = args.j || args.jsonSchemaDir || config.jsonSchemaDir ||
|
|
28
|
-
config.openapiDir = args.a || args.openapiDir || config.openapiDir ||
|
|
29
|
-
config.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
25
|
+
config.jsonSchemaDir = args.j || args.jsonSchemaDir || config.jsonSchemaDir || "./jsonSchema";
|
|
26
|
+
config.openapiDir = args.a || args.openapiDir || config.openapiDir || "./openapi";
|
|
27
|
+
config.rootDir = args.o || args.rootDir || config.rootDir || ".";
|
|
28
|
+
config.srcDir = (args.s || args.srcDir || config.srcDir || (args.o || args.rootDir || config.rootDir || ".") + "/src");
|
|
29
|
+
console.log("\x1b[35m%s\x1b[0m", "\n========== veryExpress CLI (vex) Start ==========\n");
|
|
30
|
+
log_1.default.writing("vex.config.json");
|
|
31
|
+
fs_1.default.writeFileSync("vex.config.json", JSON.stringify(config, null, 4));
|
|
32
|
+
if ("h" in args) {
|
|
33
|
+
console.log(`
|
|
34
|
+
Usage: vex [jsonSchemaDir] [openapiDir] [rootDir]
|
|
35
|
+
-h : Help
|
|
36
|
+
-j : jsonSchemaDir (config: ${config.jsonSchemaDir})
|
|
37
|
+
-a : openapiDir (config: ${config.openapiDir})
|
|
38
|
+
-o : rootDir (config: ${config.rootDir})
|
|
40
39
|
`);
|
|
41
40
|
process.exit(0);
|
|
42
41
|
}
|
|
43
|
-
;
|
|
44
42
|
if (!fs_1.default.existsSync(config.jsonSchemaDir)) {
|
|
45
|
-
log_1.default.error(
|
|
43
|
+
log_1.default.error("Schema Dir Not Found:", config.jsonSchemaDir);
|
|
46
44
|
process.exit(1);
|
|
47
45
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
if (!fs_1.default.existsSync(config.rootDir)) {
|
|
47
|
+
fs_1.default.mkdirSync(config.rootDir);
|
|
48
|
+
}
|
|
49
|
+
if (!fs_1.default.existsSync(config.srcDir)) {
|
|
50
|
+
fs_1.default.mkdirSync(config.srcDir);
|
|
51
51
|
}
|
|
52
|
-
;
|
|
53
52
|
if (config.commitBeforeGenerate === true) {
|
|
54
53
|
try {
|
|
55
|
-
log_1.default.info(
|
|
56
|
-
child_process_1.default.execSync(
|
|
54
|
+
log_1.default.info("git commit \"before vex-gen\"");
|
|
55
|
+
child_process_1.default.execSync("git add . && git commit -m \"before vex-gen\"", { stdio: "inherit" });
|
|
57
56
|
}
|
|
58
57
|
catch (err) {
|
|
59
|
-
log_1.default.error(
|
|
58
|
+
log_1.default.error("git commit \"before vex-gen\" failed", err);
|
|
60
59
|
}
|
|
61
|
-
;
|
|
62
60
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
(0, index_1.default)({
|
|
62
|
+
jsonSchemaDir: config.jsonSchemaDir,
|
|
63
|
+
openapiDir: config.openapiDir,
|
|
64
|
+
rootDir: config.rootDir,
|
|
65
|
+
srcDir: config.srcDir,
|
|
66
|
+
});
|
|
67
|
+
console.log("\x1b[35m%s\x1b[0m", "\n========== veryExpress CLI (vex) Complete ==========\n");
|
|
68
|
+
console.log("\x1b[36m%s\x1b[0m", "\nnext step:\n", `cd ${config.rootDir}\n`, "npm install\n", "npm run dev");
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import * as types from
|
|
1
|
+
import * as types from "../types/types";
|
|
2
|
+
import { Schema } from "express-validator";
|
|
2
3
|
export default function controllerTemplate(templateOptions: {
|
|
3
4
|
headerComment?: string;
|
|
4
5
|
template?: string;
|
|
5
6
|
endpoint: string;
|
|
6
7
|
modelPath: string;
|
|
7
8
|
interfaceName: string;
|
|
8
|
-
|
|
9
|
+
validators: {
|
|
9
10
|
[key: string]: {
|
|
10
|
-
[key: string]:
|
|
11
|
+
[key: string]: Schema;
|
|
11
12
|
};
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
+
compilerOptions: types.compilerOptions;
|
|
14
15
|
}): string;
|
|
@@ -1,144 +1,187 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const util_1 = __importDefault(require("util"));
|
|
3
7
|
function controllerTemplate(templateOptions) {
|
|
4
8
|
var _a;
|
|
5
9
|
if (!templateOptions.headerComment) {
|
|
6
|
-
templateOptions.headerComment = ((_a = templateOptions.
|
|
10
|
+
templateOptions.headerComment = ((_a = templateOptions.compilerOptions) === null || _a === void 0 ? void 0 : _a.headerComment) || "// generated files by very-express";
|
|
7
11
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import { {{interfaceName}}Model } from '{{modelPath}}';
|
|
14
|
-
|
|
15
|
-
class {{interfaceName}}Controller {
|
|
16
|
-
public router: Router;
|
|
17
|
-
|
|
18
|
-
constructor() {
|
|
19
|
-
this.router = Router();
|
|
20
|
-
this.routes();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public routes() {
|
|
24
|
-
|
|
25
|
-
{{getListRoute}}
|
|
26
|
-
|
|
27
|
-
{{
|
|
28
|
-
|
|
29
|
-
{{postRoute}}
|
|
30
|
-
|
|
31
|
-
{{putRoute}}
|
|
32
|
-
|
|
33
|
-
{{patchRoute}}
|
|
34
|
-
|
|
35
|
-
{{deleteRoute}}
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
public async get{{interfaceName}}(req: Request, res: Response): Promise<Response> {
|
|
40
|
-
try {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return res.status(
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return res.status(
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} catch (err:any) {
|
|
98
|
-
return res.status(500).json({ error: err.message });
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
public async
|
|
103
|
-
try {
|
|
104
|
-
const
|
|
105
|
-
if (!
|
|
106
|
-
return res.status(
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
12
|
+
let template = templateOptions.template || `{{headerComment}}
|
|
13
|
+
import { Router, Request, Response } from 'express';
|
|
14
|
+
import { checkSchema, validationResult } from 'express-validator';
|
|
15
|
+
import { parseFieldsSelect } from '../utils/common.gen';
|
|
16
|
+
|
|
17
|
+
import { {{interfaceName}}Model } from '{{modelPath}}';
|
|
18
|
+
|
|
19
|
+
class {{interfaceName}}Controller {
|
|
20
|
+
public router: Router;
|
|
21
|
+
|
|
22
|
+
constructor() {
|
|
23
|
+
this.router = Router();
|
|
24
|
+
this.routes();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public routes() {
|
|
28
|
+
|
|
29
|
+
{{getListRoute}}
|
|
30
|
+
|
|
31
|
+
{{getRoute}}
|
|
32
|
+
|
|
33
|
+
{{postRoute}}
|
|
34
|
+
|
|
35
|
+
{{putRoute}}
|
|
36
|
+
|
|
37
|
+
{{patchRoute}}
|
|
38
|
+
|
|
39
|
+
{{deleteRoute}}
|
|
40
|
+
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
public async get{{interfaceName}}(req: Request, res: Response): Promise<Response> {
|
|
44
|
+
try {
|
|
45
|
+
const validationError = validationResult(req);
|
|
46
|
+
if ( ! validationError.isEmpty() ) {
|
|
47
|
+
return res.status(400).json(validationError.array());
|
|
48
|
+
};
|
|
49
|
+
const result = await {{interfaceName}}Model.findById(req.params.id);
|
|
50
|
+
if (!result) {
|
|
51
|
+
return res.status(404).json({ error: "no data found" });
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return res.status(200).json(result);
|
|
55
|
+
};
|
|
56
|
+
} catch (err:any) {
|
|
57
|
+
return res.status(500).json({ error: err.message });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public async getList{{interfaceName}}(req: Request, res: Response): Promise<Response> {
|
|
62
|
+
try {
|
|
63
|
+
const validationError = validationResult(req);
|
|
64
|
+
if ( ! validationError.isEmpty() ) {
|
|
65
|
+
return res.status(400).json(validationError.array());
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// Get the selected fields from query string
|
|
69
|
+
const fields = req.query.fields as string | undefined;
|
|
70
|
+
const selectFields = ! fields ? undefined : await parseFieldsSelect(fields)
|
|
71
|
+
.catch((err) => {
|
|
72
|
+
return res.status(400).json({ error: err });
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const result = await {{interfaceName}}Model.find({}, selectFields);
|
|
76
|
+
if (!result) {
|
|
77
|
+
return res.status(404).json({ error: "no data found" });
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return res.status(200).json(result);
|
|
81
|
+
};
|
|
82
|
+
} catch (err:any) {
|
|
83
|
+
return res.status(500).json({ error: err.message });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public async create{{interfaceName}}(req: Request, res: Response): Promise<Response> {
|
|
88
|
+
try {
|
|
89
|
+
const validationError = validationResult(req);
|
|
90
|
+
if ( ! validationError.isEmpty() ) {
|
|
91
|
+
return res.status(400).json(validationError.array());
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const result = await {{interfaceName}}Model.create(req.body);
|
|
95
|
+
if (!result) {
|
|
96
|
+
return res.status(500).json({ error: 'failed to create data' });
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return res.status(201).json(result);
|
|
100
|
+
};
|
|
101
|
+
} catch (err:any) {
|
|
102
|
+
return res.status(500).json({ error: err.message });
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
public async update{{interfaceName}}(req: Request, res: Response): Promise<Response> {
|
|
107
|
+
try {
|
|
108
|
+
const validationError = validationResult(req);
|
|
109
|
+
if ( ! validationError.isEmpty() ) {
|
|
110
|
+
return res.status(400).json(validationError.array());
|
|
111
|
+
};
|
|
112
|
+
const result = await {{interfaceName}}Model.findByIdAndUpdate(req.params.id, req.body, { new: true });
|
|
113
|
+
if (!result) {
|
|
114
|
+
return res.status(404).json({ error: "failed to update" });
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return res.status(200).json(result);
|
|
118
|
+
};
|
|
119
|
+
} catch (err:any) {
|
|
120
|
+
return res.status(500).json({ error: err.message });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
public async delete{{interfaceName}}(req: Request, res: Response): Promise<Response> {
|
|
125
|
+
try {
|
|
126
|
+
const validationError = validationResult(req);
|
|
127
|
+
if ( ! validationError.isEmpty() ) {
|
|
128
|
+
return res.status(400).json(validationError.array());
|
|
129
|
+
};
|
|
130
|
+
const result = await {{interfaceName}}Model.findByIdAndDelete(req.params.id);
|
|
131
|
+
if (!result) {
|
|
132
|
+
return res.status(404).json({ error: "failed to update" });
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return res.status(204).json(result);
|
|
136
|
+
};
|
|
137
|
+
} catch (err:any) {
|
|
138
|
+
return res.status(500).json({ error: err.message });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export default new {{interfaceName}}Controller().router;
|
|
116
144
|
`;
|
|
117
|
-
const
|
|
118
|
-
const indent3 = '\n ';
|
|
119
|
-
const indent4 = '\n ';
|
|
145
|
+
const indent3 = " ";
|
|
120
146
|
template = template.replace(/{{headerComment}}/g, templateOptions.headerComment);
|
|
121
147
|
template = template.replace(/{{interfaceName}}/g, templateOptions.interfaceName);
|
|
122
148
|
template = template.replace(/{{modelPath}}/g, templateOptions.modelPath);
|
|
123
|
-
template = template.replace(/{{getListRoute}}/g, !templateOptions.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
template = template.replace(/{{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
template = template.replace(/{{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
149
|
+
template = template.replace(/{{getListRoute}}/g, !templateOptions.validators[templateOptions.endpoint].get ?
|
|
150
|
+
"// getListRoute disabled" : `
|
|
151
|
+
this.router.get('/',
|
|
152
|
+
checkSchema(${util_1.default.inspect(templateOptions.validators[templateOptions.endpoint].get, { depth: null }).replace(/^/gm, indent3)}),
|
|
153
|
+
this.getList${templateOptions.interfaceName}.bind(this)
|
|
154
|
+
);`);
|
|
155
|
+
template = template.replace(/{{getRoute}}/g, !templateOptions.validators[templateOptions.endpoint + "/{id}"].get ?
|
|
156
|
+
"// getRoute disabled" : `
|
|
157
|
+
this.router.get('/:id',
|
|
158
|
+
checkSchema(${util_1.default.inspect(templateOptions.validators[templateOptions.endpoint + "/{id}"].get, { depth: null }).replace(/^/gm, indent3)}),
|
|
159
|
+
this.get${templateOptions.interfaceName}.bind(this)
|
|
160
|
+
);`);
|
|
161
|
+
template = template.replace(/{{postRoute}}/g, !templateOptions.validators[templateOptions.endpoint].post ?
|
|
162
|
+
"// postRoute disabled" : `
|
|
163
|
+
this.router.post('/',
|
|
164
|
+
checkSchema(${util_1.default.inspect(templateOptions.validators[templateOptions.endpoint].post, { depth: null }).replace(/^/gm, indent3)}),
|
|
165
|
+
this.create${templateOptions.interfaceName}.bind(this)
|
|
166
|
+
);`);
|
|
167
|
+
template = template.replace(/{{putRoute}}/g, !templateOptions.validators[templateOptions.endpoint + "/{id}"].put ?
|
|
168
|
+
"// putRoute disabled" : `
|
|
169
|
+
this.router.put('/:id',
|
|
170
|
+
checkSchema(${util_1.default.inspect(templateOptions.validators[templateOptions.endpoint + "/{id}"].put, { depth: null }).replace(/^/gm, indent3)}),
|
|
171
|
+
this.replace${templateOptions.interfaceName}.bind(this)
|
|
172
|
+
);`);
|
|
173
|
+
template = template.replace(/{{patchRoute}}/g, !templateOptions.validators[templateOptions.endpoint + "/{id}"].patch ?
|
|
174
|
+
"// patchRoute disabled" : `
|
|
175
|
+
this.router.patch('/:id',
|
|
176
|
+
checkSchema(${util_1.default.inspect(templateOptions.validators[templateOptions.endpoint + "/{id}"].patch, { depth: null }).replace(/^/gm, indent3)}),
|
|
177
|
+
this.update${templateOptions.interfaceName}.bind(this)
|
|
178
|
+
);`);
|
|
179
|
+
template = template.replace(/{{deleteRoute}}/g, !templateOptions.validators[templateOptions.endpoint + "/{id}"].delete ?
|
|
180
|
+
"// deleteRoute disabled" : `
|
|
181
|
+
this.router.delete('/:id',
|
|
182
|
+
checkSchema(${util_1.default.inspect(templateOptions.validators[templateOptions.endpoint + "/{id}"].delete, { depth: null }).replace(/^/gm, indent3)}),
|
|
183
|
+
this.delete${templateOptions.interfaceName}.bind(this)
|
|
184
|
+
);`);
|
|
141
185
|
return template;
|
|
142
186
|
}
|
|
143
187
|
exports.default = controllerTemplate;
|
|
144
|
-
;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import * as types from "../types/types";
|
|
2
|
-
export declare function compile(
|
|
2
|
+
export declare function compile(options: {
|
|
3
|
+
openapiFile: string;
|
|
4
|
+
controllerOutDir: string;
|
|
5
|
+
modelDir: string;
|
|
6
|
+
compilerOptions: types.compilerOptions;
|
|
7
|
+
}): void;
|