You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP โ†’
Socket
Book a DemoInstallSign in
Socket

swagger-typescript-api

Package Overview
Dependencies
Maintainers
1
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-typescript-api - npm Package Compare versions

Comparing version

to
11.0.0

4

CHANGELOG.md

@@ -11,3 +11,7 @@ # next release

- ability to call `generateApi` function 2 and more times per 1 NodeJS process.
- new command `generate-templates` to create source templates
## [feature] Ability to generate source templates
New command `generate-templates` which allow you to generate source templates which using with option `--templates`
## [feature] Ability to modify internal codegen typescript structs

@@ -14,0 +18,0 @@ Everything which creates codegen about output typescript code now contains in `Ts` field in [`src/configuration`](src/configuration.js).

2

package.json
{
"name": "swagger-typescript-api",
"version": "11.0.0--beta-6",
"version": "11.0.0",
"description": "Generate typescript/javascript api from swagger schema",

@@ -5,0 +5,0 @@ "scripts": {

@@ -37,2 +37,3 @@ # swagger-typescript-api

Usage: swagger-typescript-api [options]
Usage: swagger-typescript-api generate-templates [options]

@@ -77,3 +78,14 @@ Options:

--another-array-type generate array types as Array<Type> (by default Type[]) (default: false)
--sort-types sort fields and types (default: false)
-h, --help display help for command
Commands:
generate-templates Generate ".ejs" templates needed for generate api
-o, --output <string> output path of generated templates
-m, --modular generate templates needed to separate files for http client, data contracts, and routes (default: false)
--http-client <string> http client type (possible values: "fetch", "axios") (default: "fetch")
-c, --clean-output clean output folder before generate template. WARNING: May cause data loss (default: false)
-r, --rewrite rewrite content in existing templates (default: false)
--silent Output only errors to console (default: false)
-h, --help display help for command
```

@@ -88,3 +100,3 @@

```js
const { generateApi } = require('swagger-typescript-api');
const { generateApi, generateTemplates } = require('swagger-typescript-api');
const path = require("path");

@@ -164,2 +176,12 @@ const fs = require("fs");

generateTemplates({
cleanOutput: false,
output: PATH_TO_OUTPUT_DIR,
httpClientType: "fetch",
modular: false,
silent: false,
rewrite: false,
})
```

@@ -227,2 +249,5 @@

## `generate-templates` command
This command allows you to generate source templates which using with option `--templates`
## Modification internal codegen structs with NodeJS API:

@@ -229,0 +254,0 @@

@@ -69,3 +69,3 @@ const _ = require("lodash");

});
this.logger.event(`source templates has been successfully created in "${outputPath}"`);
this.logger.success(`source templates has been successfully created in "${outputPath}"`);
}

@@ -72,0 +72,0 @@