0.1.24 • Published 6 years ago
swag-engine v0.1.24
swag-engine
swagger2ts transfer Swagger docs to a controller, which help you write your owner API code and definetion
usage
use in code
import { Cmd } from 'swag-engine';
const cmd = new Cmd(rootPath?, customConfig?);
(async function() {
// sync remote docs data
await cmd.ready();
// get docs update information
const { boDiffs, modDiffs } = cmd.diff();
// boDiffs.details: string[] modDiffs.details: string[]
// update docs information
cmd.updateMod(mod);
cmd.updateBo(bo);
cmd.updateAll();
// write API code with docs information
cmd.write();
// data persistence to swag.lock like yarn.lock
cmd.save();
// reget new docs information
await cmd.syncNew();
}())
use as cmd
config
- originUrl(string)
swagger api url
- outDir(string)
auto generate code file path
- templatePath(string)
your custom template path
- prettierConfig(object)
generated code is formatted by prettier, your can config your prettier style here;
- lockPath(string)
lock file path, swag-engine lock the current code version use a lockFile
0.1.24
6 years ago
0.1.23
6 years ago
0.1.22
6 years ago
0.1.21
6 years ago
0.1.20
6 years ago
0.1.19
6 years ago
0.1.18
6 years ago
0.1.17
6 years ago
0.1.16
6 years ago
0.1.15
6 years ago
0.1.14
6 years ago
0.1.13
6 years ago
0.1.12
6 years ago
0.1.11
6 years ago
0.1.10
6 years ago
0.1.9
6 years ago
0.1.8
6 years ago
0.1.7
6 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago