Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Command line tool that generates typescript interfaces from your apiDoc documentation.
To use this tool install it using npm:
$ npm install apidoc2ts -g
Get help on how to use the tool:
$ apidoc2ts --help
Generating interfaces from your apiDoc:
$ apidoc2ts --source ./doc/api_data.json --output generated --name interfaces.ts
Required flags:
-s --source
- path to the api_data.json
file from apiDoc-o --output
- path to the output folder (default ./
)-n --name
- name for the file with generated interfacesAdditional flags:
-g --gropuing = (single|url)
:
single
- create one file with all interfaces in it (not the best idea)url
- create multiple folders with interfaces corresponding to URL structure-v --version = (last|all)
- which versions should be used
last
- interfaces are generated only for the latest versionsall
- interfaces are generated for all version and older version interfaces has a postfix _vx.x.x
-t --custom-types
- list of custom types that should not be replaced with strings-w --whitelist
- list of endpoints names which should be processed, the rest of endpoints will be ignored-e --parse-examples
- if example requests/responses should be parsed if no parameters are specifiedPrefixes/postfixes for top-level interfaces names:
--static-prefix
- prefix for all interfaces names--static-postfix
- postfix for all interfaces names--request-prefix
- prefix for a request interface name--request-postfix
- postfix for a request interface name--response-prefix
- prefix for a response interface name--response-postfix
- postfix for a response interface name--error-prefix
- prefix for an error interface name--error-postfix
- postfix for an error interface nameThe tool will look for a default config file called apidoc2ts.config.js
in a current folder and combine flags from the file with a flags specified in command line. Note that command line flags override config file flags and all flags in config file should be in a camelCase.
Also you can specify a path to the config file which must contain all required flags:
-c --config
- path to the config file
Example of the config file:
module.exports = {
source: "source",
name: "name.ts",
output: "output",
staticPrefix: "I",
customTypes: ["type1", "type2"]
}
We appreciate any contribution to this project whether it is a bug report, feature request or some improvement and have a small guide for that.
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
Typescript interface generator based on ApiDoc
The npm package apidoc2ts receives a total of 23 weekly downloads. As such, apidoc2ts popularity was classified as not popular.
We found that apidoc2ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.