Gathering detailed insights and metrics for @protocolnebula/ts-openapi-generator
Gathering detailed insights and metrics for @protocolnebula/ts-openapi-generator
npm install @protocolnebula/ts-openapi-generator
Typescript
Module System
Node Version
NPM Version
35.2
Supply Chain
84.9
Quality
65.8
Maintenance
25
Vulnerability
92.8
License
TypeScript (97.02%)
JavaScript (2.53%)
Shell (0.45%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
5,303
Last Day
4
Last Week
5
Last Month
44
Last Year
576
9 Stars
139 Commits
2 Forks
3 Watchers
23 Branches
1 Contributors
Updated on Jul 09, 2024
Latest Version
2.6.0
Package Id
@protocolnebula/ts-openapi-generator@2.6.0
Unpacked Size
496.25 kB
Size
190.32 kB
File Count
190
NPM Version
7.24.0
Node Version
16.10.0
Cumulative downloads
Total Downloads
Last Day
0%
4
Compared to previous day
Last Week
-16.7%
5
Compared to previous week
Last Month
-56.4%
44
Compared to previous month
Last Year
-33.3%
576
Compared to previous year
This script is written in TypeScript
, it can generate all Models
and APIs
(serivces) in any kind of language.
Currently it exports to Angular 2
but you can create your own templates (check templates folder).
You can modify those files to adapt to your code.
It's planned for a future to let configure this script instead need to modify the source code.
1npm i @protocolnebula/ts-openapi-generator
You need to copy "ApiBase" which is the "dependences" to work. This will be changed in a future and will not be required to be copied. You can just download
ApiBase
folder and save in your project in thesame folder that you will "output" the generated data
or copy with this command.
1mkdir -p src/generatedApi 2cp -r node_modules/ts-openapi-generator/ApiBase src/generatedApi/ApiBase
Is recommended to add a script to your package.json
or package manager that you use.
Change
src/generatedApi
by your desired folder to generate the code. If you not specifymock-output
,-o + mock/
will be used.
Note that
-t
(template) and--mock-engine
are optional, you can only use some of them.
1transform-swagger \ 2 -f URI/TO/SWAGGER/JSON/OR/YAML \ 3 -o src/generatedApi/ \ 4 -t angular2 \ 5 --mock-engine json-server \ 6 --mock-output path/to/mock
The settings of the config file are the same than cli one (but in
camelCase
).
We will use as example transfrom-config.json example's one.
1{ 2 "clean": true, 3 "file": "./examples/openApiFiles/passportescaperoom.com.json", 4 "outputFolder": "./examples/generated/angular2", 5 "template": "angular2", 6 "mock-generator": "json-server", 7 "mock-output": "examples/generated/mocks/json-server", 8 "saveFile": "./openApiFiles/passportescaperoom.com" 9}
1transform-swagger --config-file ./examples/transform-config.json
1Usage: transform-swagger [options] 2 3Options: 4 --version, -v Show version number [boolean] 5 --config-file Configuration file to use (values from cli will overwrite 6 this file). 7 --mock-generator Specify the generator to use to generate mocks. If none 8 provider, mocks will not be generated 9 --mock-output The path where mock will be generated. If no specified, 10 output-folder/mock will be used 11 --mock-partial If true, only mock data will be generated instead of all 12 files [boolean] [default: false] 13 --clean No clean the output-folder, so old files will remain 14 [boolean] [default: true] 15 -f, --file Path OR URL to the swagger document to parse [required] 16 -o, --output-folder Specify the output folder (generated folders will be 17 replaced) [default: "output"] 18 -t, --template Template (preset) name or path to a template 19 -h, --help Show help [boolean] 20 -s, --save-file [default: "./openapi_temp"] 21 22Examples: 23 cli -f swagger.js -o api/ -t angular2 Convert a Swagger JSON file to 24 compatible-angular API
Plugin name
refers to thetemplate
parameter (-t
or--template
in the cli)
Language/Framework | Status | Plugin name (-t) |
---|---|---|
Angular 2 | Beta | angular2 |
Generator name
refers to themock-generator
parameter (--mock-generator
in the cli)
Engine | Status | Generator name (--mock-generator) |
---|---|---|
json-server | Beta | json-server |
This will generate a file in
output/temp.json|yaml
npm run start:dev -- -f URL_TO_SWAGGER.JSON/YAML
You can re-use the downloaded file or specify another folder
npm run start:dev -- -f output/temp.json -o src/generatedApi/ -t angular2
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
SAST tool detected but not run on all commits
Details
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
Found 0/26 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
40 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-24
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More