New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swagger-api-hub

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-api-hub - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0-alpha.1

lib/generate.d.ts

12

lib/repl.js

@@ -32,9 +32,13 @@ var __create = Object.create;

var program = new import_commander.default.Command();
process.title = "swagger-api-hub-cli";
program.name(Object.keys(import_package.default.bin)[0]).description("Generate front-end interface code to interact with OpenAPI-based backend services").usage("[options] [config-path]").argument(
"[config-path]",
"Path to the configuration file, if not specified, the default configuration file will be used",
"Path to the configuration file, if not specified, the default file path will be used",
"./swagger-api-hub.config.ts"
).helpOption("-h, --help").version(import_package.default.version, "-v, --version").action(async (configPath) => {
const absPath = (0, import_path.resolve)(configPath);
let absPath;
try {
absPath = require.resolve(configPath);
} catch (error) {
absPath = (0, import_path.resolve)(configPath);
}
if (!(0, import_fs.existsSync)(absPath)) {

@@ -46,3 +50,3 @@ import_signale.default.fatal("Config file not found:", configPath);

try {
const originalConfig = require((0, import_path.resolve)(configPath));
const originalConfig = require(absPath);
config = (originalConfig == null ? void 0 : originalConfig.default) ?? originalConfig;

@@ -49,0 +53,0 @@ } catch (error) {

{
"name": "swagger-api-hub",
"version": "1.0.0",
"version": "1.1.0-alpha.1",
"description": "Generate front-end access code for swagger backend services in one click",

@@ -21,3 +21,4 @@ "keywords": [

"author": "李凤宝 <shijistar@gmail.com>",
"main": "index.js",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"bin": {

@@ -24,0 +25,0 @@ "swagger-api-hub": "./bin/swagger-api-hub.js"

@@ -33,4 +33,6 @@ # swagger-api-hub

The configuration file should export an array of `ServiceConfig` objects. If you export only one object, it will generate the code directly without prompting. The config file extension can be `.ts`, `.js`, `.json`, or any other module types supported by Node.js.
The configuration file should export an array of `ServiceConfig` objects. If you export only one object, it will generate the code directly without prompting.
The config file can be either local path or npm module path, and the file extension can be `.ts`, `.js`, `.json`, or any other module types supported by Node.js.
The file should look like this:

@@ -65,3 +67,3 @@

- `name`: A human-readable name for the service.
- `url`: _[required]_ The URL of the OpenAPI specification file. If you have a local file, you can use `input` instead of `url` to specify the file path. Or you can even use `spec` to provide the OpenAPI specification object directly. Either `url`, `input`, or `spec` is required.
- `url`: _[required]_ The URL of the OpenAPI specification file. If you have a local file, you can use `input` instead of `url` to specify the file path. Or you can even use `spec` to provide the OpenAPI specification object directly. Either url, input, or spec is required.
- `apiBase`: The base path of all API endpoints. The service may be hosted on a subpath of the main domain, e.g., _/public-api/iam/v3_, then the apiBase is _/public-api_ in this case. If the original api path from the OpenAPI specification is acceptable, you don't need this field.

@@ -68,0 +70,0 @@ - `crossOrigin`: Whether to use the absolute api path when calling the service. This is useful when the service is hosted on a different domain and you need to set the `Access-Control-Allow-Origin` header. Default is `false`.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc