diff --git a/index.ts b/index.ts index c9cf83a..4f0718d 100644 --- a/index.ts +++ b/index.ts @@ -58,7 +58,7 @@ function serveSwagger( initialise(app, options); compile(); // compile swagger document app.use(swaggerUi.serve); // serve swagger static files - app.use(convert(mount(endPoint, swaggerUi.setup(json())))); + app.use(convert(mount(endPoint, swaggerUi.setup(json(), false, null, null, null)))); } /** diff --git a/package-lock.json b/package-lock.json index ff49d8b..6c5cf0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "swagger-generator-koa", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" @@ -132,9 +132,9 @@ } }, "@types/lodash": { - "version": "4.14.136", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.136.tgz", - "integrity": "sha512-0GJhzBdvsW2RUccNHOBkabI8HZVdOXmXbXhuKlDEd5Vv12P7oAVGfomGp3Ne21o5D/qu1WmthlNKFaoZJJeErA==", + "version": "4.14.138", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.138.tgz", + "integrity": "sha512-A4uJgHz4hakwNBdHNPdxOTkYmXNgmUAKLbXZ7PKGslgeV0Mb8P3BlbYfPovExek1qnod4pDfRbxuzcVs3dlFLg==", "dev": true }, "@types/mime": { @@ -143,9 +143,9 @@ "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==" }, "@types/node": { - "version": "12.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.1.tgz", - "integrity": "sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw==" + "version": "12.7.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.2.tgz", + "integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==" }, "@types/range-parser": { "version": "1.2.3", @@ -297,9 +297,9 @@ "dev": true }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "fast-deep-equal": { @@ -565,9 +565,9 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", + "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -606,9 +606,9 @@ } }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "setprototypeof": { @@ -642,9 +642,9 @@ "integrity": "sha1-cAcEaNbSl3ylI3suUZyn0Gouo/0=" }, "swagger-spec-express": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/swagger-spec-express/-/swagger-spec-express-2.0.18.tgz", - "integrity": "sha512-JxUntGaMEh9vpM9WrwvT7Ge2osQCClx65PnDKG5/Rl+PSks+WvJHEeHZyI0cOL3GbyY+KdHj+i5Y65DMaOKzow==", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/swagger-spec-express/-/swagger-spec-express-2.0.19.tgz", + "integrity": "sha512-kTKe7yEixKJX1XuHrRvhk1oQV/LPO33AZJJSSgqAJ6AufhoUDm2u9ECv6xT5AMpJqQvWgZjpmnVtTeF3Ee0gAg==", "requires": { "ajv": "6.10.2", "async": "3.1.0", @@ -694,9 +694,9 @@ "dev": true }, "tslint": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", - "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.19.0.tgz", + "integrity": "sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", diff --git a/package.json b/package.json index e3496f1..d841f1f 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,16 @@ { "name": "swagger-generator-koa", "title": "swagger-generator-koa", - "version": "1.0.0", + "version": "1.0.1", "description": "Generate automatic swagger using joi validation.", "main": "dist/index.js", "types": "dist/index.d.ts", - "build": "tsc", - "build:watch": "tsc --watch", - "prepublish": "tsc", "scripts": { "lint": "tslint --project \"./tsconfig.json\"", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc", + "build:watch": "tsc --watch", + "prepublish": "tsc" }, "author": { "name": "systango-technologies", @@ -49,13 +49,20 @@ "koa-mount": "^4.0.0", "koa-static": "^5.0.0", "lodash": "^4.17.15", - "swagger-spec-express": "^2.0.18", + "swagger-spec-express": "^2.0.19", "swagger-ui-koa": "0.0.1" }, "devDependencies": { - "@types/lodash": "^4.14.136", - "@types/node": "^12.7.1", - "tslint": "^5.18.0", + "@types/lodash": "^4.14.138", + "@types/node": "^12.7.2", + "tslint": "^5.19.0", "typescript": "^3.5.3" - } + }, + "files": [ + "dist/index.js", + "dist/index.d.ts", + "dist/responsesEnum.js", + "dist/responsesEnum.d.ts", + "README.md" + ] } diff --git a/tsconfig.json b/tsconfig.json index f36ad77..83970bd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,13 @@ { "compilerOptions": { + "baseUrl": ".", + "paths": { "*": ["types/*"] }, + "baseUrl": ".", + "paths": { "*": ["types/*"] }, + "baseUrl": ".", + "paths": { "*": ["types/*"] }, + "baseUrl": ".", + "paths": { "*": ["types/*"] }, "target": "es6", "module": "commonjs", "esModuleInterop": true, diff --git a/types/swagger-ui-koa.d.ts b/types/swagger-ui-koa.d.ts new file mode 100644 index 0000000..c742db6 --- /dev/null +++ b/types/swagger-ui-koa.d.ts @@ -0,0 +1,2 @@ +export function serve(ctx: any, next: any): void; +export function setup(swaggerDoc: any, explorer: any, options: any, customCss: any, customfavIcon: any): any;