very-express 0.0.1 → 0.0.3

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.
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function controllerTemplate(templateOptions) {
4
+ var _a;
5
+ if (!templateOptions.headerComment) {
6
+ templateOptions.headerComment = ((_a = templateOptions.options) === null || _a === void 0 ? void 0 : _a.headerComment) || "// generated files by very-express";
7
+ }
8
+ ;
9
+ let template = templateOptions.template || `{{headerComment}}
10
+ import { Router, Request, Response } from 'express';
11
+ import { check, body, validationResult } from 'express-validator';
12
+ import mongoose from 'mongoose';
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
+ this.router.get(
25
+ '/',
26
+ [
27
+ {{getListValidator}}
28
+ ],
29
+ this.get{{interfaceName}}List.bind(this)
30
+ );
31
+
32
+ this.router.get(
33
+ '/:id',
34
+ [
35
+ {{getOneValidator}}
36
+ ],
37
+ this.get{{interfaceName}}.bind(this)
38
+ );
39
+
40
+ this.router.post(
41
+ '/',
42
+ [
43
+ {{postValidator}}
44
+ ],
45
+ this.create{{interfaceName}}.bind(this)
46
+ );
47
+
48
+ this.router.put(
49
+ '/:id',
50
+ [
51
+ {{putValidator}}
52
+ ],
53
+ this.update{{interfaceName}}.bind(this)
54
+ );
55
+ this.router.patch(
56
+ '/:id',
57
+ [
58
+ {{patchValidator}}
59
+ ],
60
+ this.update{{interfaceName}}.bind(this)
61
+ );
62
+
63
+ this.router.delete(
64
+ '/:id',
65
+ [
66
+ {{deleteValidator}}
67
+ ],
68
+ this.delete{{interfaceName}}.bind(this)
69
+ );
70
+ };
71
+
72
+ public async get{{interfaceName}}(req: Request, res: Response): Promise<Response> {
73
+ try {
74
+ await check('id').custom((value) => mongoose.Types.ObjectId.isValid(value)).withMessage('Invalid user id').run(req);
75
+
76
+ const errors = validationResult(req);
77
+ if (!errors.isEmpty()) {
78
+ return res.status(400).json({ errors: errors.array() });
79
+ }
80
+
81
+ const user = await {{interfaceName}}Model.findById(req.params.id);
82
+ if (!user) {
83
+ return res.status(404).json({ error: '{{interfaceName}} not found' });
84
+ }
85
+ return res.json(user);
86
+ } catch (err:any) {
87
+ return res.status(500).json({ error: err.message });
88
+ }
89
+ }
90
+
91
+ public async get{{interfaceName}}List(req: Request, res: Response): Promise<Response> {
92
+ try {
93
+ const user = await {{interfaceName}}Model.find();
94
+ if (!user) {
95
+ return res.status(404).json({ error: 'No {{interfaceName}} found' });
96
+ }
97
+ return res.json(user);
98
+ } catch (err:any) {
99
+ return res.status(500).json({ error: err.message });
100
+ }
101
+ }
102
+
103
+ public async create{{interfaceName}}(req: Request, res: Response): Promise<Response> {
104
+ const errors = validationResult(req);
105
+ if (!errors.isEmpty()) {
106
+ return res.status(400).json({ errors: errors.array() });
107
+ };
108
+
109
+ try {
110
+ const user = new {{interfaceName}}Model (req.body);
111
+ await user.save();
112
+ return res.status(201).json(user);
113
+ } catch (err:any) {
114
+ return res.status(500).json({ error: err.message });
115
+ };
116
+ };
117
+
118
+ public async update{{interfaceName}}(req: Request, res: Response): Promise<Response> {
119
+ const errors = validationResult(req);
120
+ if (!errors.isEmpty()) {
121
+ return res.status(400).json({ errors: errors.array() });
122
+ }
123
+
124
+ try {
125
+ const user = await {{interfaceName}}Model.findByIdAndUpdate(req.params.id, req.body, { new: true });
126
+ if (!user) {
127
+ return res.status(404).json({ error: '{{interfaceName}} not found' });
128
+ }
129
+ return res.json(user);
130
+ } catch (err:any) {
131
+ return res.status(500).json({ error: err.message });
132
+ }
133
+ }
134
+
135
+ public async delete{{interfaceName}}(req: Request, res: Response): Promise<Response> {
136
+ try {
137
+ const user = await {{interfaceName}}Model.findByIdAndDelete(req.params.id);
138
+ if (!user) {
139
+ return res.status(404).json({ error: '{{interfaceName}} not found' });
140
+ }
141
+ return res.status(204).json();
142
+ } catch (err:any) {
143
+ return res.status(500).json({ error: err.message });
144
+ }
145
+ }
146
+ }
147
+
148
+ export default new {{interfaceName}}Controller().router;
149
+ `;
150
+ template = template.replace(/{{headerComment}}/g, templateOptions.headerComment);
151
+ template = template.replace(/{{interfaceName}}/g, templateOptions.interfaceName);
152
+ template = template.replace(/{{modelPath}}/g, templateOptions.modelPath);
153
+ template = template.replace(/{{getListValidator}}/g, templateOptions.validator[templateOptions.endpoint].get.join(',\n '));
154
+ template = template.replace(/{{getOneValidator}}/g, templateOptions.validator[templateOptions.endpoint + '/{id}'].get.join(',\n '));
155
+ template = template.replace(/{{postValidator}}/g, templateOptions.validator[templateOptions.endpoint].post.join(',\n '));
156
+ template = template.replace(/{{putValidator}}/g, templateOptions.validator[templateOptions.endpoint + '/{id}'].put.join(',\n '));
157
+ template = template.replace(/{{patchValidator}}/g, templateOptions.validator[templateOptions.endpoint + '/{id}'].patch.join(',\n '));
158
+ template = template.replace(/{{deleteValidator}}/g, templateOptions.validator[templateOptions.endpoint + '/{id}'].delete.join(',\n '));
159
+ return template;
160
+ }
161
+ exports.default = controllerTemplate;
162
+ ;
@@ -0,0 +1,9 @@
1
+ import controllerTemplate from './controller.template';
2
+ import routesTemplate from './routes.template';
3
+ import serverTemplate from './server.template';
4
+ declare const _default: {
5
+ controllerTemplate: typeof controllerTemplate;
6
+ routesTemplate: typeof routesTemplate;
7
+ serverTemplate: typeof serverTemplate;
8
+ };
9
+ export default _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const controller_template_1 = __importDefault(require("./controller.template"));
7
+ const routes_template_1 = __importDefault(require("./routes.template"));
8
+ const server_template_1 = __importDefault(require("./server.template"));
9
+ exports.default = {
10
+ controllerTemplate: controller_template_1.default,
11
+ routesTemplate: routes_template_1.default,
12
+ serverTemplate: server_template_1.default,
13
+ };
@@ -0,0 +1,13 @@
1
+ import * as types from '../types/types';
2
+ export default function routesTemplate(templateOptions: {
3
+ headerComment?: string;
4
+ template?: string;
5
+ enableOpenApi?: boolean;
6
+ openapiPath?: string;
7
+ routes: {
8
+ route: string;
9
+ controllerClassName: string;
10
+ controllerPath: string;
11
+ }[];
12
+ options?: types.compilerOptions;
13
+ }): string;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function routesTemplate(templateOptions) {
4
+ var _a, _b;
5
+ if (!templateOptions.headerComment) {
6
+ templateOptions.headerComment = ((_a = templateOptions.options) === null || _a === void 0 ? void 0 : _a.headerComment) || "// generated files by very-express";
7
+ }
8
+ ;
9
+ let enableOpenApi = templateOptions.enableOpenApi || true;
10
+ if (enableOpenApi && !templateOptions.openapiPath) {
11
+ console.log('\x1b[31m%s\x1b[0m', '[Error]', 'OpenApi : routers.generator > compile() : Args "openapiPath" is required while enableOpenApi is true.');
12
+ throw new Error('OpenApi : routers.generator > compile() : Args "openapiPath" is required while enableOpenApi is true.');
13
+ }
14
+ ;
15
+ let headerComment = ((_b = templateOptions.options) === null || _b === void 0 ? void 0 : _b.headerComment) || "// generated files by very-express";
16
+ let template = templateOptions.template || `{{headerComment}}
17
+ import { Router } from 'express';
18
+ import swaggerUi, { JsonObject } from 'swagger-ui-express';
19
+ import { loadYaml } from '../utils/common.gen';
20
+
21
+ {{importRoutes}}
22
+
23
+ const router :Router = Router();
24
+
25
+ {{openapiRoute}}
26
+
27
+ {{useRoutes}}
28
+
29
+ export default router;`;
30
+ let importRoutes = "";
31
+ let useRoutes = "";
32
+ templateOptions === null || templateOptions === void 0 ? void 0 : templateOptions.routes.forEach((obj) => {
33
+ importRoutes += `import ${obj.controllerClassName} from '${obj.controllerPath}';\n`;
34
+ useRoutes += `router.use('${obj.route}', ${obj.controllerClassName});\n`;
35
+ });
36
+ template = template.replace(/{{headerComment}}/g, headerComment);
37
+ template = template.replace(/{{importRoutes}}/g, importRoutes);
38
+ template = template.replace(/{{openapiRoute}}/g, enableOpenApi ? `router.use('/api', swaggerUi.serve, swaggerUi.setup(loadYaml('${templateOptions.openapiPath}') as JsonObject));` : '');
39
+ template = template.replace(/{{useRoutes}}/g, useRoutes);
40
+ return template;
41
+ }
42
+ exports.default = routesTemplate;
43
+ ;
@@ -0,0 +1,6 @@
1
+ import * as types from '../types/types';
2
+ export default function serverTemplate(templateOptions: {
3
+ headerComment?: string;
4
+ template?: string;
5
+ options?: types.compilerOptions;
6
+ }): string;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function serverTemplate(templateOptions) {
4
+ var _a;
5
+ let headerComment = ((_a = templateOptions.options) === null || _a === void 0 ? void 0 : _a.headerComment) || "// generated files by very-express";
6
+ let template = templateOptions.template || `{{headerComment}}
7
+
8
+ import dotenv from 'dotenv';
9
+ import express from 'express';
10
+ import helmet from 'helmet';
11
+ import routesGenerated from './routes/routes.gen';
12
+
13
+ dotenv.config();
14
+
15
+ const app = express();
16
+ app.disable("x-powered-by");
17
+ app.use(express.json());
18
+
19
+ app.use(routesGenerated);
20
+
21
+ app.use(helmet({
22
+ xPoweredBy: false,
23
+ xDnsPrefetchControl: { allow: false },
24
+ }));
25
+
26
+ app.listen(process.env.VERYEXPRESS_PORT, () => {
27
+ console.log('Server is running on port ' + process.env.VERYEXPRESS_PORT );
28
+ });
29
+ `;
30
+ template = template.replace(/{{headerComment}}/g, headerComment);
31
+ return template;
32
+ }
33
+ exports.default = serverTemplate;
34
+ ;
@@ -0,0 +1 @@
1
+ export declare function loadYaml(yamlFilePath: string): unknown;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.loadYaml = void 0;
7
+ const js_yaml_1 = __importDefault(require("js-yaml"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ function loadYaml(yamlFilePath) {
10
+ try {
11
+ return js_yaml_1.default.load(fs_1.default.readFileSync(yamlFilePath, 'utf8'));
12
+ }
13
+ catch (e) {
14
+ console.error('Error Load OpenApi File :\n', e.message || e);
15
+ }
16
+ }
17
+ exports.loadYaml = loadYaml;
18
+ ;
@@ -0,0 +1,105 @@
1
+ import * as types from "./types";
2
+ export interface openapi {
3
+ openapi: string;
4
+ info: {
5
+ title: string;
6
+ description: string;
7
+ version: string;
8
+ };
9
+ paths: paths;
10
+ components: components;
11
+ }
12
+ export interface paths {
13
+ [key: string]: {
14
+ summary: string;
15
+ [types.method.get]?: method;
16
+ [types.method.post]?: method;
17
+ [types.method.put]?: method;
18
+ [types.method.patch]?: method;
19
+ [types.method.delete]?: method;
20
+ [types.method.options]?: method;
21
+ [types.method.head]?: method;
22
+ [types.method.trace]?: method;
23
+ [key: string]: method | string | undefined;
24
+ };
25
+ }
26
+ export interface method {
27
+ summary: string;
28
+ operationId: string;
29
+ tags: string[];
30
+ parameters: parameter[];
31
+ requestBody?: requestBody;
32
+ responses: {
33
+ [key: number]: responseItem;
34
+ };
35
+ }
36
+ export interface parameter {
37
+ name: string;
38
+ in: 'query' | 'header' | 'path' | 'cookie';
39
+ description?: string;
40
+ required?: boolean;
41
+ deprecated?: boolean;
42
+ allowEmptyValue?: boolean;
43
+ style?: string;
44
+ explode?: boolean;
45
+ allowReserved?: boolean;
46
+ schema: {
47
+ type: string;
48
+ format?: string;
49
+ required?: string[];
50
+ minLength?: number;
51
+ maxLength?: number;
52
+ minimum?: number;
53
+ maximum?: number;
54
+ enum?: string[];
55
+ };
56
+ example?: any;
57
+ examples?: any;
58
+ }
59
+ export interface requestBody {
60
+ description: string;
61
+ required: boolean;
62
+ content?: {
63
+ 'application/json': {
64
+ schema: {
65
+ $ref: string;
66
+ };
67
+ };
68
+ };
69
+ }
70
+ export interface responseItem {
71
+ description: string;
72
+ content?: {
73
+ 'application/json'?: {
74
+ schema: {
75
+ $ref?: string;
76
+ [key: string]: any;
77
+ };
78
+ };
79
+ };
80
+ }
81
+ export interface components {
82
+ schemas: {
83
+ [key: string]: componentsSchemaValue;
84
+ };
85
+ }
86
+ export interface componentsSchemaValue {
87
+ type: string;
88
+ items?: any;
89
+ properties?: {
90
+ [key: string]: fieldsItem;
91
+ };
92
+ }
93
+ export interface fieldsItem {
94
+ type: string;
95
+ format?: string;
96
+ minimum?: number;
97
+ maximum?: number;
98
+ minLength?: number;
99
+ maxLength?: number;
100
+ maxItems?: number;
101
+ maxProperties?: number;
102
+ uniqueItems?: boolean;
103
+ enum?: string[];
104
+ [key: string]: any;
105
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const types = __importStar(require("./types"));
@@ -0,0 +1,40 @@
1
+ export interface compilerOptions {
2
+ headerComment?: string;
3
+ modelsTemplate?: string;
4
+ controllersTemplate?: string;
5
+ }
6
+ export interface jsonSchema {
7
+ type: string;
8
+ 'x-documentConfig': documentConfig;
9
+ properties: {
10
+ [key: string]: {
11
+ type: string;
12
+ format?: string;
13
+ index?: boolean;
14
+ required?: boolean;
15
+ description?: string;
16
+ example?: any;
17
+ [key: string]: any;
18
+ };
19
+ };
20
+ required?: string[];
21
+ index?: string[];
22
+ [key: string]: any;
23
+ }
24
+ export interface documentConfig {
25
+ documentName: string;
26
+ documentType?: 'primary' | 'secondary';
27
+ interfaceName: string;
28
+ keyPrefix?: string;
29
+ method: method[];
30
+ }
31
+ export declare enum method {
32
+ get = "get",
33
+ post = "post",
34
+ put = "put",
35
+ patch = "patch",
36
+ delete = "delete",
37
+ options = "options",
38
+ head = "head",
39
+ trace = "trace"
40
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.method = void 0;
4
+ var method;
5
+ (function (method) {
6
+ method["get"] = "get";
7
+ method["post"] = "post";
8
+ method["put"] = "put";
9
+ method["patch"] = "patch";
10
+ method["delete"] = "delete";
11
+ method["options"] = "options";
12
+ method["head"] = "head";
13
+ method["trace"] = "trace";
14
+ })(method || (exports.method = method = {}));
15
+ ;
@@ -0,0 +1,22 @@
1
+ import { compilerOptions } from "./types/types";
2
+ export declare const relativePath: (fromPath: string, toPath: string) => string;
3
+ export declare function loadYaml(yamlFilePath: string): void;
4
+ export declare function getGenaratorHeaderComment(comment?: string): string;
5
+ export declare function getSimpleHeaderComment(): string;
6
+ export declare function cleanXcustomValue(schemaObj: {
7
+ [key: string]: any;
8
+ }, additionalKeyArr?: string[]): {
9
+ [key: string]: any;
10
+ };
11
+ export declare function copyDir(source: string, destination: string): void;
12
+ export declare const defaultCompilerOptions: compilerOptions;
13
+ declare const _default: {
14
+ getGenaratorHeaderComment: typeof getGenaratorHeaderComment;
15
+ getSimpleHeaderComment: typeof getSimpleHeaderComment;
16
+ defaultCompilerOptions: compilerOptions;
17
+ relativePath: (fromPath: string, toPath: string) => string;
18
+ cleanXcustomValue: typeof cleanXcustomValue;
19
+ loadYaml: typeof loadYaml;
20
+ copyDir: typeof copyDir;
21
+ };
22
+ export default _default;
package/dist/utils.js ADDED
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.defaultCompilerOptions = exports.copyDir = exports.cleanXcustomValue = exports.getSimpleHeaderComment = exports.getGenaratorHeaderComment = exports.loadYaml = exports.relativePath = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const js_yaml_1 = __importDefault(require("js-yaml"));
10
+ function getPackageInfo() {
11
+ var _a;
12
+ const packageJson = fs_1.default.readFileSync("./package.json", "utf8");
13
+ const packageJsonObject = JSON.parse(packageJson);
14
+ return {
15
+ version: ((_a = packageJsonObject.dependencies['very-express']) === null || _a === void 0 ? void 0 : _a.replace('^', '')) || "[unknown version]",
16
+ author: packageJsonObject.author || "justin26l",
17
+ };
18
+ }
19
+ const relativePath = (fromPath, toPath) => {
20
+ return path_1.default.relative(fromPath, toPath).replace(/\\/g, '/');
21
+ };
22
+ exports.relativePath = relativePath;
23
+ function loadYaml(yamlFilePath) {
24
+ try {
25
+ const doc = js_yaml_1.default.load(fs_1.default.readFileSync(yamlFilePath, 'utf8'));
26
+ }
27
+ catch (e) {
28
+ console.error(e);
29
+ }
30
+ }
31
+ exports.loadYaml = loadYaml;
32
+ ;
33
+ function getGenaratorHeaderComment(comment) {
34
+ const packageInfo = getPackageInfo();
35
+ return `/* eslint-disable */
36
+ /**
37
+ * Generated by veryExpress@${packageInfo.version}
38
+ * DO NOT MODIFY MANUALLY. Instead, modify the JsonSchema file,
39
+ * then run veryExpress to regenerate this file.
40
+ *
41
+ * author: ${packageInfo.author}
42
+ * version: ${packageInfo.version}${comment ? `\n * comment: ${comment}` : ''}
43
+ */
44
+ `;
45
+ }
46
+ exports.getGenaratorHeaderComment = getGenaratorHeaderComment;
47
+ ;
48
+ function getSimpleHeaderComment() {
49
+ const packageInfo = getPackageInfo();
50
+ return `// Generated by veryExpress@${packageInfo.version}`;
51
+ }
52
+ exports.getSimpleHeaderComment = getSimpleHeaderComment;
53
+ ;
54
+ function cleanXcustomValue(schemaObj, additionalKeyArr) {
55
+ let obj = Object.assign(schemaObj);
56
+ for (const key in obj) {
57
+ if (key.startsWith("x-")) {
58
+ delete obj[key];
59
+ }
60
+ else if (additionalKeyArr && additionalKeyArr.includes(key)) {
61
+ delete obj[key];
62
+ }
63
+ else if (typeof obj[key] === "object") {
64
+ cleanXcustomValue(obj[key], additionalKeyArr);
65
+ }
66
+ }
67
+ return obj;
68
+ }
69
+ exports.cleanXcustomValue = cleanXcustomValue;
70
+ ;
71
+ function copyDir(source, destination) {
72
+ if (!fs_1.default.existsSync(destination)) {
73
+ fs_1.default.mkdirSync(destination);
74
+ }
75
+ const files = fs_1.default.readdirSync(source);
76
+ for (let i = 0; i < files.length; i++) {
77
+ const current = fs_1.default.lstatSync(source + '/' + files[i]);
78
+ if (current.isDirectory()) {
79
+ copyDir(source + '/' + files[i], destination + '/' + files[i]);
80
+ }
81
+ else if (current.isSymbolicLink()) {
82
+ const symlink = fs_1.default.readlinkSync(source + '/' + files[i]);
83
+ fs_1.default.symlinkSync(symlink, destination + '/' + files[i]);
84
+ }
85
+ else {
86
+ const outPath = destination + '/' + files[i];
87
+ console.log('\x1b[32m%s\x1b[0m', '[Writing]', `Utils : ${outPath}`);
88
+ fs_1.default.copyFileSync(source + '/' + files[i], outPath);
89
+ }
90
+ }
91
+ }
92
+ exports.copyDir = copyDir;
93
+ exports.defaultCompilerOptions = {
94
+ headerComment: getGenaratorHeaderComment(),
95
+ };
96
+ exports.default = {
97
+ getGenaratorHeaderComment,
98
+ getSimpleHeaderComment,
99
+ defaultCompilerOptions: exports.defaultCompilerOptions,
100
+ relativePath: exports.relativePath,
101
+ cleanXcustomValue,
102
+ loadYaml,
103
+ copyDir,
104
+ };
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "very-express",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "based on json schema and openapi, generate Express RestApi server with mongoDb ",
5
5
  "author": "justin26l",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
8
-
9
8
  "bin": {
10
9
  "vex": "./dist/cli.js"
11
10
  },
@@ -28,18 +27,14 @@
28
27
  "url": "git+https://github.com/Justin26l/json2mongoose.git"
29
28
  },
30
29
  "dependencies": {
31
- "@types/express": "^4.17.21",
32
- "@types/js-yaml": "^4.0.9",
33
- "@types/swagger-ui-express": "^4.1.6",
34
- "express": "^4.18.2",
35
- "express-validator": "^7.0.1",
36
- "helmet": "^7.1.0",
37
- "js-yaml": "^4.1.0",
38
- "swagger-ui-express": "^5.0.0"
30
+ "js-yaml": "4.1.0",
31
+ "json-schema-to-openapi-schema": "^0.4.0",
32
+ "json2mongoose": "^0.1.5"
39
33
  },
40
34
  "devDependencies": {
41
35
  "@types/express": "^4.17.21",
42
36
  "@types/js-yaml": "^4.0.9",
37
+ "@types/node": "^20.10.4",
43
38
  "@types/swagger-ui-express": "^4.1.6",
44
39
  "dotenv": "^16.3.1",
45
40
  "express": "^4.18.2",