swaggerhub-cli
Advanced tools
Comparing version 0.2.10 to 0.2.11
@@ -1,1 +0,1 @@ | ||
{"version":"0.2.10","commands":{"configure":{"id":"configure","description":"configure application settings\nEnter the SwaggerHub URL - default is https://api.swaggerhub.com\nCustomers with on-premise installations need to point this to their on-premise API, which is http(s)://{swaggerhub-host}/v1\nEnter the API Key - this can be retrieved from https://app.swaggerhub.com/settings/apiKey\nYou can set these as environment variables: SWAGGERHUB_URL, SWAGGERHUB_API_KEY. These take priority over config settings.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"api:create":{"id":"api:create","description":"creates a new API / API version from a YAML/JSON file\nThe API version from the file will be used unless the version is specified in the command argument.\nAn error will occur if the API version already exists.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:create organization/api/1.0.0 --file api.yaml --visibility public","swaggerhub api:create organization/api --file api.yaml"],"flags":{"file":{"name":"file","type":"option","char":"f","description":"file location of API to create","required":true},"visibility":{"name":"visibility","type":"option","description":"visibility of API in SwaggerHub","options":["public","private"],"default":"private"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/[VERSION]","description":"API to create in SwaggerHub","required":true}]},"api:get":{"id":"api:get","description":"fetches an API definition\nWhen VERSION is not included in the argument, the default version will be returned.\nReturns the API in YAML format by default.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:get organization/api","swaggerhub api:get organization/api/1.0.0 --json"],"flags":{"json":{"name":"json","type":"boolean","char":"j","description":"returns the API in JSON format.","allowNo":false},"resolved":{"name":"resolved","type":"boolean","char":"r","description":"gets the resolved API definition (supported in v1.25+). ","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/[VERSION]","description":"SwaggerHub API to fetch","required":true}]},"api:publish":{"id":"api:publish","description":"publish an API version","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:publish organization/api/1.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/VERSION","description":"API identifier","required":true}]},"api:setdefault":{"id":"api:setdefault","description":"set the default version of an API","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:setdefault organization/api/2.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/VERSION","description":"API identifier","required":true}]},"api:unpublish":{"id":"api:unpublish","description":"unpublish an API version","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:unpublish organization/api/1.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/VERSION","description":"API identifier","required":true}]},"api:update":{"id":"api:update","description":"update an API version\nThe API version from the file will be used unless the version is specified in the command argument.\nAn error will occur if the API version does not exist.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:update organization/api --file api.yaml","swaggerhub api:update organization/api/1.0.0 --file api.json"],"flags":{"file":{"name":"file","type":"option","char":"f","description":"file location of API to update","required":true},"visibility":{"name":"visibility","type":"option","description":"visibility of API in SwaggerHub","options":["public","private"],"default":"private"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/[VERSION]","description":"API to update in SwaggerHub","required":true}]},"api:validate":{"id":"api:validate","description":"get validation result for an API version\nWhen VERSION is not included in the argument, the default version will be validated.\nAn error will occur if the API version does not exist.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:validate organization/api/1.0.0","swaggerhub api:validate organization/api"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/[VERSION]","description":"API Identifier","required":true}]},"domain:publish":{"id":"domain:publish","description":"publish a domain version","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub domain:publish organization/domain/1.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/DOMAIN_NAME/VERSION","description":"Domain identifier","required":true}]},"domain:unpublish":{"id":"domain:unpublish","description":"unpublish a domain version","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub domain:unpublish organization/domain/1.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/DOMAIN_NAME/VERSION","description":"Domain identifier","required":true}]}}} | ||
{"version":"0.2.11","commands":{"configure":{"id":"configure","description":"configure application settings\nEnter the SwaggerHub URL - default is https://api.swaggerhub.com\nCustomers with on-premise installations need to point this to their on-premise API, which is http(s)://{swaggerhub-host}/v1\nEnter the API Key - this can be retrieved from https://app.swaggerhub.com/settings/apiKey\nYou can set these as environment variables: SWAGGERHUB_URL, SWAGGERHUB_API_KEY. These take priority over config settings.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"api:create":{"id":"api:create","description":"creates a new API / API version from a YAML/JSON file\nThe API version from the file will be used unless the version is specified in the command argument.\nAn error will occur if the API version already exists.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:create organization/api/1.0.0 --file api.yaml --visibility public","swaggerhub api:create organization/api --file api.yaml"],"flags":{"file":{"name":"file","type":"option","char":"f","description":"file location of API to create","required":true},"visibility":{"name":"visibility","type":"option","description":"visibility of API in SwaggerHub","options":["public","private"],"default":"private"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/[VERSION]","description":"API to create in SwaggerHub","required":true}]},"api:get":{"id":"api:get","description":"fetches an API definition\nWhen VERSION is not included in the argument, the default version will be returned.\nReturns the API in YAML format by default.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:get organization/api","swaggerhub api:get organization/api/1.0.0 --json"],"flags":{"json":{"name":"json","type":"boolean","char":"j","description":"returns the API in JSON format.","allowNo":false},"resolved":{"name":"resolved","type":"boolean","char":"r","description":"gets the resolved API definition (supported in v1.25+). ","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/[VERSION]","description":"SwaggerHub API to fetch","required":true}]},"api:publish":{"id":"api:publish","description":"publish an API version","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:publish organization/api/1.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/VERSION","description":"API identifier","required":true}]},"api:setdefault":{"id":"api:setdefault","description":"set the default version of an API","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:setdefault organization/api/2.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/VERSION","description":"API identifier","required":true}]},"api:unpublish":{"id":"api:unpublish","description":"unpublish an API version","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:unpublish organization/api/1.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/VERSION","description":"API identifier","required":true}]},"api:update":{"id":"api:update","description":"update an API version\nThe API version from the file will be used unless the version is specified in the command argument.\nAn error will occur if the API version does not exist.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:update organization/api --file api.yaml","swaggerhub api:update organization/api/1.0.0 --file api.json","swaggerhub api:update organization/api/1.0.0 --publish --file api.json","swaggerhub api:update organization/api/1.0.0 --setdefault --file api.json","swaggerhub api:update organization/api/1.0.0 --publish --setdefault --file api.json"],"flags":{"file":{"name":"file","type":"option","char":"f","description":"file location of API to update","required":true},"visibility":{"name":"visibility","type":"option","description":"visibility of API in SwaggerHub","options":["public","private"],"default":"private"},"publish":{"name":"publish","type":"boolean","description":"sets the API version as published","required":false,"allowNo":false},"setdefault":{"name":"setdefault","type":"boolean","description":"sets API version to be the default","required":false,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/[VERSION]","description":"API to update in SwaggerHub","required":true}]},"api:validate":{"id":"api:validate","description":"get validation result for an API version\nWhen VERSION is not included in the argument, the default version will be validated.\nAn error will occur if the API version does not exist.\n","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub api:validate organization/api/1.0.0","swaggerhub api:validate organization/api"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/API_NAME/[VERSION]","description":"API Identifier","required":true}]},"domain:publish":{"id":"domain:publish","description":"publish a domain version","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub domain:publish organization/domain/1.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/DOMAIN_NAME/VERSION","description":"Domain identifier","required":true}]},"domain:unpublish":{"id":"domain:unpublish","description":"unpublish a domain version","pluginName":"swaggerhub-cli","pluginType":"core","aliases":[],"examples":["swaggerhub domain:unpublish organization/domain/1.0.0"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"OWNER/DOMAIN_NAME/VERSION","description":"Domain identifier","required":true}]}}} |
{ | ||
"name": "swaggerhub-cli", | ||
"description": "SwaggerHub CLI", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"author": "SmartBear", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -91,3 +91,3 @@ SwaggerHub CLI | ||
_See code: [src/commands/api/create.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/api/create.js)_ | ||
_See code: [src/commands/api/create.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/api/create.js)_ | ||
@@ -119,3 +119,3 @@ ## `swaggerhub api:get` | ||
_See code: [src/commands/api/get.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/api/get.js)_ | ||
_See code: [src/commands/api/get.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/api/get.js)_ | ||
@@ -140,3 +140,3 @@ ## `swaggerhub api:publish` | ||
_See code: [src/commands/api/publish.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/api/publish.js)_ | ||
_See code: [src/commands/api/publish.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/api/publish.js)_ | ||
@@ -161,3 +161,3 @@ ## `swaggerhub api:setdefault` | ||
_See code: [src/commands/api/setdefault.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/api/setdefault.js)_ | ||
_See code: [src/commands/api/setdefault.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/api/setdefault.js)_ | ||
@@ -182,3 +182,3 @@ ## `swaggerhub api:unpublish` | ||
_See code: [src/commands/api/unpublish.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/api/unpublish.js)_ | ||
_See code: [src/commands/api/unpublish.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/api/unpublish.js)_ | ||
@@ -199,2 +199,4 @@ ## `swaggerhub api:update` | ||
-h, --help show CLI help | ||
--publish sets the API version as published | ||
--setdefault sets API version to be the default | ||
--visibility=public|private [default: private] visibility of API in SwaggerHub | ||
@@ -209,5 +211,8 @@ | ||
swaggerhub api:update organization/api/1.0.0 --file api.json | ||
swaggerhub api:update organization/api/1.0.0 --publish --file api.json | ||
swaggerhub api:update organization/api/1.0.0 --setdefault --file api.json | ||
swaggerhub api:update organization/api/1.0.0 --publish --setdefault --file api.json | ||
``` | ||
_See code: [src/commands/api/update.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/api/update.js)_ | ||
_See code: [src/commands/api/update.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/api/update.js)_ | ||
@@ -237,3 +242,3 @@ ## `swaggerhub api:validate` | ||
_See code: [src/commands/api/validate.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/api/validate.js)_ | ||
_See code: [src/commands/api/validate.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/api/validate.js)_ | ||
@@ -260,3 +265,3 @@ ## `swaggerhub configure` | ||
_See code: [src/commands/configure.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/configure.js)_ | ||
_See code: [src/commands/configure.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/configure.js)_ | ||
@@ -281,3 +286,3 @@ ## `swaggerhub domain:publish` | ||
_See code: [src/commands/domain/publish.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/domain/publish.js)_ | ||
_See code: [src/commands/domain/publish.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/domain/publish.js)_ | ||
@@ -302,3 +307,3 @@ ## `swaggerhub domain:unpublish` | ||
_See code: [src/commands/domain/unpublish.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.10/src/commands/domain/unpublish.js)_ | ||
_See code: [src/commands/domain/unpublish.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.2.11/src/commands/domain/unpublish.js)_ | ||
@@ -305,0 +310,0 @@ ## `swaggerhub help [COMMAND]` |
@@ -7,2 +7,4 @@ const { flags } = require('@oclif/command') | ||
const BaseCommand = require('../../support/command/base-command') | ||
const publish = require('./publish') | ||
const setDefault = require('./setdefault') | ||
@@ -38,2 +40,8 @@ class UpdateAPICommand extends BaseCommand { | ||
}) | ||
const apiPathWithVersion = requestedApiPath.split('/').length === 3 ? | ||
requestedApiPath : | ||
`${requestedApiPath}/${apiVersion}` | ||
if (flags.publish) await publish.run([apiPathWithVersion]) | ||
if (flags.setdefault) await setDefault.run([apiPathWithVersion]) | ||
} | ||
@@ -49,3 +57,6 @@ } | ||
'swaggerhub api:update organization/api --file api.yaml', | ||
'swaggerhub api:update organization/api/1.0.0 --file api.json' | ||
'swaggerhub api:update organization/api/1.0.0 --file api.json', | ||
'swaggerhub api:update organization/api/1.0.0 --publish --file api.json', | ||
'swaggerhub api:update organization/api/1.0.0 --setdefault --file api.json', | ||
'swaggerhub api:update organization/api/1.0.0 --publish --setdefault --file api.json' | ||
] | ||
@@ -70,2 +81,14 @@ | ||
}), | ||
publish: flags.boolean({ | ||
description: 'sets the API version as published', | ||
default: false, | ||
required: false, | ||
dependsOn: ['file'] | ||
}), | ||
setdefault: flags.boolean({ | ||
description: 'sets API version to be the default', | ||
default: false, | ||
required: false, | ||
dependsOn: ['file'] | ||
}), | ||
...BaseCommand.flags | ||
@@ -72,0 +95,0 @@ } |
@@ -14,3 +14,3 @@ const { wrapTemplates } = require('../utils/general') | ||
ApiUpdate: 'Updated API \'{{owner}}/{{name}}/{{version}}\'', | ||
ApiUpdate: 'Updated API {{owner}}/{{name}}/{{version}}', | ||
@@ -17,0 +17,0 @@ ApiUnpublish: 'Unpublished API {{apiPath}}', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66859
911
475