swaggerhub-cli 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +209 -122
- package/oclif.manifest.json +247 -86
- package/package.json +2 -2
- package/src/commands/api/clone.js +65 -0
- package/src/commands/api/create.js +2 -2
- package/src/commands/api/delete.js +1 -1
- package/src/commands/api/get.js +2 -2
- package/src/commands/api/publish.js +1 -1
- package/src/commands/api/setdefault.js +1 -1
- package/src/commands/api/update.js +3 -3
- package/src/commands/api/validate/download-rules.js +5 -5
- package/src/commands/api/validate/index.js +2 -2
- package/src/commands/api/validate/local.js +3 -3
- package/src/commands/configure.js +2 -2
- package/src/commands/domain/clone.js +65 -0
- package/src/commands/domain/create.js +6 -6
- package/src/commands/domain/delete.js +1 -1
- package/src/commands/domain/get.js +1 -1
- package/src/commands/domain/publish.js +1 -1
- package/src/commands/domain/rename.js +77 -0
- package/src/commands/domain/setdefault.js +1 -1
- package/src/commands/domain/unpublish.js +1 -1
- package/src/commands/domain/update.js +3 -3
- package/src/commands/integration/create.js +2 -2
- package/src/commands/integration/delete.js +1 -1
- package/src/commands/integration/execute.js +1 -1
- package/src/commands/integration/get.js +2 -2
- package/src/commands/integration/list.js +1 -1
- package/src/commands/integration/update.js +1 -1
- package/src/commands/project/api/add.js +2 -2
- package/src/commands/project/api/remove.js +3 -3
- package/src/commands/project/create.js +4 -4
- package/src/commands/project/delete.js +2 -2
- package/src/commands/project/domain/add.js +2 -2
- package/src/commands/project/domain/remove.js +3 -3
- package/src/commands/project/get.js +1 -1
- package/src/commands/project/list.js +1 -1
- package/src/commands/project/member/list.js +2 -2
- package/src/commands/spectral/download.js +1 -1
- package/src/commands/spectral/upload.js +1 -1
- package/src/support/command/base-command.js +1 -1
- package/src/support/inquirer/prompt-templates.js +1 -1
- package/src/support/isOnPrem.js +2 -2
- package/src/template-strings/errors.js +4 -4
- package/src/template-strings/info.js +8 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swaggerhub-cli",
|
|
3
3
|
"description": "SwaggerHub CLI",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0",
|
|
5
5
|
"author": "SmartBear",
|
|
6
6
|
"bin": {
|
|
7
7
|
"swaggerhub": "./bin/run"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"eslint": "^10.13.0",
|
|
32
32
|
"eslint-plugin-chai-friendly": "^1.0.0",
|
|
33
33
|
"eslint-plugin-immutable": "^1.0.0",
|
|
34
|
-
"eslint-plugin-mocha": "^
|
|
34
|
+
"eslint-plugin-mocha": "^12.0.0",
|
|
35
35
|
"eslint-plugin-n": "^18.3.0",
|
|
36
36
|
"globby": "^16.2.0",
|
|
37
37
|
"husky": "^9.0.1",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const BaseCommand = require('../../support/command/base-command')
|
|
2
|
+
const { Args, Flags } = require('@oclif/core')
|
|
3
|
+
const { getApiIdentifierArg, apiNameRegex } = require('../../support/command/parse-input')
|
|
4
|
+
const { errorMsg } = require('../../template-strings')
|
|
5
|
+
const { CLIError } = require('@oclif/core/lib/errors')
|
|
6
|
+
const { postApi } = require('../../requests/api')
|
|
7
|
+
|
|
8
|
+
const getNewVersion = args => {
|
|
9
|
+
const newVersion = args['NEW_VERSION']
|
|
10
|
+
if (!apiNameRegex.test(newVersion)) {
|
|
11
|
+
throw new CLIError(errorMsg.argsMustMatchFormat({ format: 'NEW_VERSION' }))
|
|
12
|
+
}
|
|
13
|
+
return newVersion
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class CloneApiCommand extends BaseCommand {
|
|
17
|
+
|
|
18
|
+
async run() {
|
|
19
|
+
const { args, flags } = await this.parse(CloneApiCommand)
|
|
20
|
+
|
|
21
|
+
const apiPath = getApiIdentifierArg(args)
|
|
22
|
+
const newVersion = getNewVersion(args)
|
|
23
|
+
const body = { version: newVersion }
|
|
24
|
+
if (flags.visibility) body.private = flags.visibility === 'private'
|
|
25
|
+
|
|
26
|
+
this.log(`Cloning API: '${apiPath}' as version '${newVersion}'`)
|
|
27
|
+
|
|
28
|
+
await this.executeHttp({
|
|
29
|
+
execute: () => postApi({
|
|
30
|
+
pathParams: [apiPath, 'clone'],
|
|
31
|
+
body: JSON.stringify(body)
|
|
32
|
+
}),
|
|
33
|
+
onResolve: this.logCommandSuccess({ apiPath, newVersion }),
|
|
34
|
+
options: {}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
CloneApiCommand.description = 'clone an API version as a new version'
|
|
40
|
+
|
|
41
|
+
CloneApiCommand.examples = [
|
|
42
|
+
'swaggerhub api:clone organization/api/1.0.0 1.0.1',
|
|
43
|
+
'swaggerhub api:clone organization/api/1.0.0 1.0.1 --visibility public'
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
CloneApiCommand.args = {
|
|
47
|
+
'OWNER/API_NAME/VERSION': Args.string({
|
|
48
|
+
required: true,
|
|
49
|
+
description: 'API version to clone'
|
|
50
|
+
}),
|
|
51
|
+
'NEW_VERSION': Args.string({
|
|
52
|
+
required: true,
|
|
53
|
+
description: 'Version identifier of the new API version'
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
CloneApiCommand.flags = {
|
|
58
|
+
visibility: Flags.string({
|
|
59
|
+
description: 'visibility of the new version (defaults to the server setting)',
|
|
60
|
+
options: ['public', 'private']
|
|
61
|
+
}),
|
|
62
|
+
...BaseCommand.flags
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = CloneApiCommand
|
|
@@ -106,7 +106,7 @@ CreateAPICommand.examples = [
|
|
|
106
106
|
CreateAPICommand.args = {
|
|
107
107
|
'OWNER/API_NAME/[VERSION]': Args.string({
|
|
108
108
|
required: true,
|
|
109
|
-
description: 'API to create on
|
|
109
|
+
description: 'API to create on Swagger'
|
|
110
110
|
})
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -117,7 +117,7 @@ CreateAPICommand.flags = {
|
|
|
117
117
|
required: true
|
|
118
118
|
}),
|
|
119
119
|
visibility: Flags.string({
|
|
120
|
-
description: 'visibility of API in
|
|
120
|
+
description: 'visibility of API in Swagger',
|
|
121
121
|
options: ['public', 'private'],
|
|
122
122
|
default: 'private'
|
|
123
123
|
}),
|
package/src/commands/api/get.js
CHANGED
|
@@ -48,7 +48,7 @@ GetAPICommand.examples = [
|
|
|
48
48
|
GetAPICommand.args = {
|
|
49
49
|
'OWNER/API_NAME/[VERSION]': Args.string({
|
|
50
50
|
required: true,
|
|
51
|
-
description: 'API to fetch from
|
|
51
|
+
description: 'API to fetch from Swagger'
|
|
52
52
|
})
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -59,7 +59,7 @@ GetAPICommand.flags = {
|
|
|
59
59
|
}),
|
|
60
60
|
resolved: Flags.boolean({
|
|
61
61
|
char: 'r',
|
|
62
|
-
description: 'gets the resolved API definition
|
|
62
|
+
description: 'gets the resolved API definition'
|
|
63
63
|
}),
|
|
64
64
|
...BaseCommand.flags
|
|
65
65
|
}
|
|
@@ -65,7 +65,7 @@ class UpdateAPICommand extends UpdateCommand {
|
|
|
65
65
|
UpdateAPICommand.description = `update an API
|
|
66
66
|
The API version from the file will be used unless the version is specified in the command argument.
|
|
67
67
|
When no file is specified then the default API version will be updated.
|
|
68
|
-
The API visibility can be changed by using visibility flag.
|
|
68
|
+
The API visibility can be changed by using the --visibility flag.
|
|
69
69
|
`
|
|
70
70
|
|
|
71
71
|
UpdateAPICommand.examples = [
|
|
@@ -80,7 +80,7 @@ UpdateAPICommand.examples = [
|
|
|
80
80
|
UpdateAPICommand.args = {
|
|
81
81
|
'OWNER/API_NAME/[VERSION]': Args.string({
|
|
82
82
|
required: true,
|
|
83
|
-
description: 'API to update on
|
|
83
|
+
description: 'API to update on Swagger'
|
|
84
84
|
})
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ UpdateAPICommand.flags = {
|
|
|
92
92
|
multiple: false
|
|
93
93
|
}),
|
|
94
94
|
visibility: Flags.string({
|
|
95
|
-
description: 'visibility of API in
|
|
95
|
+
description: 'visibility of API in Swagger',
|
|
96
96
|
options: ['public', 'private']
|
|
97
97
|
}),
|
|
98
98
|
published: Flags.string({
|
|
@@ -27,11 +27,11 @@ class ValidateDownloadRulesCommand extends BaseCommand {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
ValidateDownloadRulesCommand.description = `Get
|
|
31
|
-
Requires organization name argument. An error will occur if provided organization doesn't exist
|
|
30
|
+
ValidateDownloadRulesCommand.description = `Get an organization's existing standardization ruleset from Swagger.
|
|
31
|
+
Requires organization name argument. An error will occur if the provided organization doesn't exist
|
|
32
32
|
or your account is not permitted to access that organization's settings.
|
|
33
|
-
If the flag \`-s\` or \`--include-system-rules\` is used, the returned ruleset will also include
|
|
34
|
-
If the flag \`-d\` or \`--include-disabled-rules\` is used, the returned ruleset will also include disabled custom rules
|
|
33
|
+
If the flag \`-s\` or \`--include-system-rules\` is used, the returned ruleset will also include Swagger system rules.
|
|
34
|
+
If the flag \`-d\` or \`--include-disabled-rules\` is used, the returned ruleset will also include disabled custom rules.`
|
|
35
35
|
|
|
36
36
|
ValidateDownloadRulesCommand.examples = [
|
|
37
37
|
'swaggerhub api:validate:download-rules myOrg -s',
|
|
@@ -41,7 +41,7 @@ ValidateDownloadRulesCommand.examples = [
|
|
|
41
41
|
ValidateDownloadRulesCommand.args = {
|
|
42
42
|
'OWNER': Args.string({
|
|
43
43
|
required: true,
|
|
44
|
-
description: 'Which organization standardization rules to fetch from
|
|
44
|
+
description: 'Which organization standardization rules to fetch from Swagger'
|
|
45
45
|
})
|
|
46
46
|
}
|
|
47
47
|
ValidateDownloadRulesCommand.flags = {
|
|
@@ -52,7 +52,7 @@ class ValidateCommand extends BaseValidateCommand {
|
|
|
52
52
|
ValidateCommand.description = `Get validation result for an API version
|
|
53
53
|
When VERSION is not included in the argument, the default version will be validated.
|
|
54
54
|
An error will occur if the API version does not exist.
|
|
55
|
-
If the flag \`-c\` or \`--
|
|
55
|
+
If the flag \`-c\` or \`--fail-on-critical\` is used and there are standardization
|
|
56
56
|
errors with \`Critical\` severity present, the command will exit with error code \`1\`.
|
|
57
57
|
`
|
|
58
58
|
|
|
@@ -65,7 +65,7 @@ ValidateCommand.examples = [
|
|
|
65
65
|
ValidateCommand.args = {
|
|
66
66
|
'OWNER/API_NAME/[VERSION]': Args.string({
|
|
67
67
|
required: true,
|
|
68
|
-
description: 'API to fetch validation errors for
|
|
68
|
+
description: 'API to fetch validation errors for'
|
|
69
69
|
})
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -34,14 +34,14 @@ class ValidateLocalCommand extends BaseValidateCommand {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
ValidateLocalCommand.description = `Runs a scan against a local API definition using the organization's standardization configuration on
|
|
38
|
-
If the flag \`-c\` or \`--
|
|
37
|
+
ValidateLocalCommand.description = `Runs a scan against a local API definition using the organization's standardization configuration on Swagger.
|
|
38
|
+
If the flag \`-c\` or \`--fail-on-critical\` is used and there are standardization
|
|
39
39
|
errors with \`Critical\` severity present, the command will exit with error code \`1\`.
|
|
40
40
|
`
|
|
41
41
|
|
|
42
42
|
ValidateLocalCommand.examples = [
|
|
43
43
|
'swaggerhub api:validate:local -o myOrg -f ./my-api.yaml -c -j ',
|
|
44
|
-
'swaggerhub api:validate:local --organization myOrg --file ./my-api
|
|
44
|
+
'swaggerhub api:validate:local --organization myOrg --file ./my-api.json --fail-on-critical --json',
|
|
45
45
|
]
|
|
46
46
|
|
|
47
47
|
ValidateLocalCommand.flags = {
|
|
@@ -18,8 +18,8 @@ class ConfigureCommand extends BaseCommand {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
ConfigureCommand.description = `configure application settings
|
|
21
|
-
Enter the
|
|
22
|
-
Customers with on-premise installations need to point this to their on-premise API, which is http(s)://{swaggerhub-host}/v1
|
|
21
|
+
Enter the Swagger URL - default is https://api.swaggerhub.com
|
|
22
|
+
Customers with on-premise installations (version 2.x) need to point this to their on-premise API, which is http(s)://{swaggerhub-host}/v1
|
|
23
23
|
Enter the API Key - this can be retrieved from https://app.swaggerhub.com/settings/apiKey
|
|
24
24
|
You can set these as environment variables: SWAGGERHUB_URL, SWAGGERHUB_API_KEY. These take priority over config settings.
|
|
25
25
|
`
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const BaseCommand = require('../../support/command/base-command')
|
|
2
|
+
const { Args, Flags } = require('@oclif/core')
|
|
3
|
+
const { getDomainIdentifierArg, apiNameRegex } = require('../../support/command/parse-input')
|
|
4
|
+
const { errorMsg } = require('../../template-strings')
|
|
5
|
+
const { CLIError } = require('@oclif/core/lib/errors')
|
|
6
|
+
const { postDomain } = require('../../requests/domain')
|
|
7
|
+
|
|
8
|
+
const getNewVersion = args => {
|
|
9
|
+
const newVersion = args['NEW_VERSION']
|
|
10
|
+
if (!apiNameRegex.test(newVersion)) {
|
|
11
|
+
throw new CLIError(errorMsg.argsMustMatchFormat({ format: 'NEW_VERSION' }))
|
|
12
|
+
}
|
|
13
|
+
return newVersion
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class CloneDomainCommand extends BaseCommand {
|
|
17
|
+
|
|
18
|
+
async run() {
|
|
19
|
+
const { args, flags } = await this.parse(CloneDomainCommand)
|
|
20
|
+
|
|
21
|
+
const domainPath = getDomainIdentifierArg(args)
|
|
22
|
+
const newVersion = getNewVersion(args)
|
|
23
|
+
const body = { version: newVersion }
|
|
24
|
+
if (flags.visibility) body.private = flags.visibility === 'private'
|
|
25
|
+
|
|
26
|
+
this.log(`Cloning domain: '${domainPath}' as version '${newVersion}'`)
|
|
27
|
+
|
|
28
|
+
await this.executeHttp({
|
|
29
|
+
execute: () => postDomain({
|
|
30
|
+
pathParams: [domainPath, 'clone'],
|
|
31
|
+
body: JSON.stringify(body)
|
|
32
|
+
}),
|
|
33
|
+
onResolve: this.logCommandSuccess({ domainPath, newVersion }),
|
|
34
|
+
options: {}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
CloneDomainCommand.description = 'clone a domain version as a new version'
|
|
40
|
+
|
|
41
|
+
CloneDomainCommand.examples = [
|
|
42
|
+
'swaggerhub domain:clone organization/domain/1.0.0 1.0.1',
|
|
43
|
+
'swaggerhub domain:clone organization/domain/1.0.0 1.0.1 --visibility public'
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
CloneDomainCommand.args = {
|
|
47
|
+
'OWNER/DOMAIN_NAME/VERSION': Args.string({
|
|
48
|
+
required: true,
|
|
49
|
+
description: 'Domain version to clone'
|
|
50
|
+
}),
|
|
51
|
+
'NEW_VERSION': Args.string({
|
|
52
|
+
required: true,
|
|
53
|
+
description: 'Version identifier of the new domain version'
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
CloneDomainCommand.flags = {
|
|
58
|
+
visibility: Flags.string({
|
|
59
|
+
description: 'visibility of the new version (defaults to the server setting)',
|
|
60
|
+
options: ['public', 'private']
|
|
61
|
+
}),
|
|
62
|
+
...BaseCommand.flags
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = CloneDomainCommand
|
|
@@ -62,8 +62,8 @@ class CreateDomainCommand extends UpdateCommand {
|
|
|
62
62
|
const { args, flags } = await this.parse(CreateDomainCommand)
|
|
63
63
|
const definition = parseDefinition(flags.file)
|
|
64
64
|
const domainVersion = getVersion(definition)
|
|
65
|
-
const
|
|
66
|
-
const [owner, name, version = domainVersion] = splitPathParams(
|
|
65
|
+
const domainPath = getDomainIdentifierArg(args)
|
|
66
|
+
const [owner, name, version = domainVersion] = splitPathParams(domainPath)
|
|
67
67
|
const type = 'domains'
|
|
68
68
|
|
|
69
69
|
const argsObj = {
|
|
@@ -96,15 +96,15 @@ An error will occur if the domain version already exists.
|
|
|
96
96
|
CreateDomainCommand.examples = [
|
|
97
97
|
'swaggerhub domain:create organization/domain/1.0.0 --file domain.yaml --visibility public',
|
|
98
98
|
'swaggerhub domain:create organization/domain --file domain.yaml',
|
|
99
|
-
'swaggerhub domain:create organization/domain/1.0.0 --publish --file domain.json',
|
|
99
|
+
'swaggerhub domain:create organization/domain/1.0.0 --published=publish --file domain.json',
|
|
100
100
|
'swaggerhub domain:create organization/domain/1.0.0 --setdefault --file domain.json',
|
|
101
|
-
'swaggerhub domain:create organization/domain/1.0.0 --publish --setdefault --file domain.json'
|
|
101
|
+
'swaggerhub domain:create organization/domain/1.0.0 --published=publish --setdefault --file domain.json'
|
|
102
102
|
]
|
|
103
103
|
|
|
104
104
|
CreateDomainCommand.args = {
|
|
105
105
|
'OWNER/DOMAIN_NAME/[VERSION]': Args.string({
|
|
106
106
|
required: true,
|
|
107
|
-
description: 'Domain to create on
|
|
107
|
+
description: 'Domain to create on Swagger'
|
|
108
108
|
})
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -115,7 +115,7 @@ CreateDomainCommand.flags = {
|
|
|
115
115
|
required: true
|
|
116
116
|
}),
|
|
117
117
|
visibility: Flags.string({
|
|
118
|
-
description: 'visibility of domain in
|
|
118
|
+
description: 'visibility of domain in Swagger',
|
|
119
119
|
options: ['public', 'private'],
|
|
120
120
|
default: 'private'
|
|
121
121
|
}),
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const BaseCommand = require('../../support/command/base-command')
|
|
2
|
+
const { Args, Flags } = require('@oclif/core')
|
|
3
|
+
const {
|
|
4
|
+
noVersionRegex,
|
|
5
|
+
apiNameRegex
|
|
6
|
+
} = require('../../support/command/parse-input')
|
|
7
|
+
const { errorMsg } = require('../../template-strings')
|
|
8
|
+
const { CLIError } = require('@oclif/core/lib/errors')
|
|
9
|
+
const { postDomain } = require('../../requests/domain')
|
|
10
|
+
|
|
11
|
+
const getDomainToRename = args => {
|
|
12
|
+
const domainPath = args['OWNER/DOMAIN_NAME']
|
|
13
|
+
if (!noVersionRegex.test(domainPath)) {
|
|
14
|
+
throw new CLIError(errorMsg.argsMustMatchFormat({ format: 'OWNER/DOMAIN_NAME' }))
|
|
15
|
+
}
|
|
16
|
+
return domainPath
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const getDomainNewName = args => {
|
|
20
|
+
const newName = args['DOMAIN_NEW_NAME']
|
|
21
|
+
if (!apiNameRegex.test(newName)) {
|
|
22
|
+
throw new CLIError(errorMsg.argsMustMatchFormat({ format: 'DOMAIN_NEW_NAME' }))
|
|
23
|
+
}
|
|
24
|
+
return newName
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class RenameDomainCommand extends BaseCommand {
|
|
28
|
+
|
|
29
|
+
async run() {
|
|
30
|
+
const { args, flags } = await this.parse(RenameDomainCommand)
|
|
31
|
+
|
|
32
|
+
const domainPath = getDomainToRename(args)
|
|
33
|
+
const newName = getDomainNewName(args)
|
|
34
|
+
const queryParams = { newName }
|
|
35
|
+
if (flags.force) queryParams.force = 'true'
|
|
36
|
+
|
|
37
|
+
this.log(`Renaming domain: '${domainPath}' to '${newName}'`)
|
|
38
|
+
|
|
39
|
+
await this.executeHttp({
|
|
40
|
+
execute: () => postDomain({
|
|
41
|
+
pathParams: [domainPath, 'rename'],
|
|
42
|
+
queryParams,
|
|
43
|
+
body: '{}'
|
|
44
|
+
}),
|
|
45
|
+
onResolve: this.logCommandSuccess({ domainPath, newName }),
|
|
46
|
+
options: {}
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
RenameDomainCommand.description = 'rename a domain'
|
|
52
|
+
|
|
53
|
+
RenameDomainCommand.examples = [
|
|
54
|
+
'swaggerhub domain:rename organization/domainOldName domainNewName',
|
|
55
|
+
'swaggerhub domain:rename organization/domainOldName domainNewName --force'
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
RenameDomainCommand.args = {
|
|
59
|
+
'OWNER/DOMAIN_NAME': Args.string({
|
|
60
|
+
required: true,
|
|
61
|
+
description: 'Domain to be renamed'
|
|
62
|
+
}),
|
|
63
|
+
'DOMAIN_NEW_NAME': Args.string({
|
|
64
|
+
required: true,
|
|
65
|
+
description: 'New name for the domain'
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
RenameDomainCommand.flags = {
|
|
70
|
+
force: Flags.boolean({
|
|
71
|
+
char: 'f',
|
|
72
|
+
description: 'rename the domain even if it is referenced by APIs or other domains'
|
|
73
|
+
}),
|
|
74
|
+
...BaseCommand.flags
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = RenameDomainCommand
|
|
@@ -23,7 +23,7 @@ SetDefaultDomainCommand.examples = [
|
|
|
23
23
|
SetDefaultDomainCommand.args = {
|
|
24
24
|
'OWNER/DOMAIN_NAME/VERSION': Args.string({
|
|
25
25
|
required: true,
|
|
26
|
-
description: 'Domain to set as default on
|
|
26
|
+
description: 'Domain to set as default on Swagger'
|
|
27
27
|
})
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -65,7 +65,7 @@ class UpdateDomainCommand extends UpdateCommand {
|
|
|
65
65
|
UpdateDomainCommand.description = `update a domain
|
|
66
66
|
The domain version from the file will be used unless the version is specified in the command argument.
|
|
67
67
|
When no file is specified then the default domain version will be updated.
|
|
68
|
-
The domain visibility can be changed by using visibility flag.
|
|
68
|
+
The domain visibility can be changed by using the --visibility flag.
|
|
69
69
|
`
|
|
70
70
|
|
|
71
71
|
UpdateDomainCommand.examples = [
|
|
@@ -80,7 +80,7 @@ UpdateDomainCommand.examples = [
|
|
|
80
80
|
UpdateDomainCommand.args = {
|
|
81
81
|
'OWNER/DOMAIN_NAME/[VERSION]': Args.string({
|
|
82
82
|
required: true,
|
|
83
|
-
description: 'Domain to update on
|
|
83
|
+
description: 'Domain to update on Swagger'
|
|
84
84
|
})
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ UpdateDomainCommand.flags = {
|
|
|
92
92
|
multiple: false
|
|
93
93
|
}),
|
|
94
94
|
visibility: Flags.string({
|
|
95
|
-
description: 'visibility of domain in
|
|
95
|
+
description: 'visibility of domain in Swagger',
|
|
96
96
|
options: ['public', 'private']
|
|
97
97
|
}),
|
|
98
98
|
published: Flags.string({
|
|
@@ -30,7 +30,7 @@ class CreateIntegrationCommand extends BaseCommand {
|
|
|
30
30
|
|
|
31
31
|
CreateIntegrationCommand.description = `creates a new API integration from a JSON configuration file.
|
|
32
32
|
See the documentation for configuration files: https://github.com/SmartBear/swaggerhub-cli/tree/main/examples/integrations
|
|
33
|
-
When VERSION is not included in the argument, the integration will be added to
|
|
33
|
+
When VERSION is not included in the argument, the integration will be added to the default API version.
|
|
34
34
|
`
|
|
35
35
|
|
|
36
36
|
CreateIntegrationCommand.examples = [
|
|
@@ -40,7 +40,7 @@ CreateIntegrationCommand.examples = [
|
|
|
40
40
|
CreateIntegrationCommand.args = {
|
|
41
41
|
'OWNER/API_NAME/[VERSION]': Args.string({
|
|
42
42
|
required: true,
|
|
43
|
-
description: 'API to add integration to on
|
|
43
|
+
description: 'API to add integration to on Swagger'
|
|
44
44
|
})
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -31,7 +31,7 @@ DeleteIntegrationCommand.examples = [
|
|
|
31
31
|
DeleteIntegrationCommand.args = {
|
|
32
32
|
'OWNER/API_NAME/VERSION/INTEGRATION_ID': Args.string({
|
|
33
33
|
required: true,
|
|
34
|
-
description: 'Integration to delete for given API on
|
|
34
|
+
description: 'Integration to delete for given API on Swagger'
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -31,7 +31,7 @@ ExecuteIntegrationCommand.examples = [
|
|
|
31
31
|
ExecuteIntegrationCommand.args = {
|
|
32
32
|
'OWNER/API_NAME/VERSION/INTEGRATION_ID': Args.string({
|
|
33
33
|
required: true,
|
|
34
|
-
description: 'Integration to execute for given API on
|
|
34
|
+
description: 'Integration to execute for given API on Swagger'
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -33,7 +33,7 @@ class GetIntegrationCommand extends BaseCommand {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
GetIntegrationCommand.description = '
|
|
36
|
+
GetIntegrationCommand.description = 'retrieves an integration for the given API.'
|
|
37
37
|
|
|
38
38
|
GetIntegrationCommand.examples = [
|
|
39
39
|
'swaggerhub integration:get organization/api/1.0.0/503c2db6-448a-4678-a310-f465429e9704'
|
|
@@ -42,7 +42,7 @@ GetIntegrationCommand.examples = [
|
|
|
42
42
|
GetIntegrationCommand.args = {
|
|
43
43
|
'OWNER/API_NAME/VERSION/INTEGRATION_ID': Args.string({
|
|
44
44
|
required: true,
|
|
45
|
-
description: 'Integration to fetch for given API on
|
|
45
|
+
description: 'Integration to fetch for given API on Swagger'
|
|
46
46
|
})
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -36,7 +36,7 @@ UpdateIntegrationCommand.examples = [
|
|
|
36
36
|
UpdateIntegrationCommand.args = {
|
|
37
37
|
'OWNER/API_NAME/VERSION/INTEGRATION_ID': Args.string({
|
|
38
38
|
required: true,
|
|
39
|
-
description: 'Integration to update for given API on
|
|
39
|
+
description: 'Integration to update for given API on Swagger'
|
|
40
40
|
})
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -35,11 +35,11 @@ ProjectApiAddCommand.examples = [
|
|
|
35
35
|
ProjectApiAddCommand.args = {
|
|
36
36
|
'OWNER/PROJECT_NAME': Args.string({
|
|
37
37
|
required: true,
|
|
38
|
-
description: 'The project to add the API to on
|
|
38
|
+
description: 'The project to add the API to on Swagger'
|
|
39
39
|
}),
|
|
40
40
|
'API': Args.string({
|
|
41
41
|
required: true,
|
|
42
|
-
description: 'The name of the API on
|
|
42
|
+
description: 'The name of the API on Swagger to add'
|
|
43
43
|
})
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -48,7 +48,7 @@ class ProjectApiRemoveCommand extends BaseCommand {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
ProjectApiRemoveCommand.description = 'Removes an API from a project in
|
|
51
|
+
ProjectApiRemoveCommand.description = 'Removes an API from a project in Swagger.'
|
|
52
52
|
|
|
53
53
|
ProjectApiRemoveCommand.examples = [
|
|
54
54
|
'swaggerhub project:api:remove organization/project_name my_api',
|
|
@@ -57,11 +57,11 @@ ProjectApiRemoveCommand.examples = [
|
|
|
57
57
|
ProjectApiRemoveCommand.args = {
|
|
58
58
|
'OWNER/PROJECT_NAME': Args.string({
|
|
59
59
|
required: true,
|
|
60
|
-
description: 'The project to remove the API from on
|
|
60
|
+
description: 'The project to remove the API from on Swagger'
|
|
61
61
|
}),
|
|
62
62
|
'API': Args.string({
|
|
63
63
|
required: true,
|
|
64
|
-
description: 'The name of the API on
|
|
64
|
+
description: 'The name of the API on Swagger to remove'
|
|
65
65
|
})
|
|
66
66
|
}
|
|
67
67
|
|