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
|
@@ -39,7 +39,7 @@ class CreateProjectCommand extends BaseCommand {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
CreateProjectCommand.description = 'Creates a new project in
|
|
42
|
+
CreateProjectCommand.description = 'Creates a new project in Swagger.'
|
|
43
43
|
|
|
44
44
|
CreateProjectCommand.examples = [
|
|
45
45
|
'swaggerhub project:create organization/new_project_name --description "project description"',
|
|
@@ -53,7 +53,7 @@ CreateProjectCommand.examples = [
|
|
|
53
53
|
CreateProjectCommand.args = {
|
|
54
54
|
'OWNER/PROJECT_NAME': Args.string({
|
|
55
55
|
required: true,
|
|
56
|
-
description: 'The new project to create on
|
|
56
|
+
description: 'The new project to create on Swagger'
|
|
57
57
|
})
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -64,12 +64,12 @@ CreateProjectCommand.flags = {
|
|
|
64
64
|
}),
|
|
65
65
|
apis: Flags.string({
|
|
66
66
|
char: 'a',
|
|
67
|
-
description: 'Comma
|
|
67
|
+
description: 'Comma-separated list of API names to include in project',
|
|
68
68
|
required: false
|
|
69
69
|
}),
|
|
70
70
|
domains: Flags.string({
|
|
71
71
|
char: 'd',
|
|
72
|
-
description: 'Comma
|
|
72
|
+
description: 'Comma-separated list of domain names to include in project',
|
|
73
73
|
required: false
|
|
74
74
|
}),
|
|
75
75
|
...BaseCommand.flags
|
|
@@ -26,7 +26,7 @@ class DeleteProjectCommand extends BaseCommand {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
DeleteProjectCommand.description = 'Deletes a project from
|
|
29
|
+
DeleteProjectCommand.description = 'Deletes a project from Swagger.'
|
|
30
30
|
|
|
31
31
|
DeleteProjectCommand.examples = [
|
|
32
32
|
'swaggerhub project:delete organization/project_name'
|
|
@@ -35,7 +35,7 @@ DeleteProjectCommand.examples = [
|
|
|
35
35
|
DeleteProjectCommand.args = {
|
|
36
36
|
'OWNER/PROJECT_NAME': Args.string({
|
|
37
37
|
required: true,
|
|
38
|
-
description: 'The project to delete on
|
|
38
|
+
description: 'The project to delete on Swagger'
|
|
39
39
|
})
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -35,11 +35,11 @@ ProjectDomainAddCommand.examples = [
|
|
|
35
35
|
ProjectDomainAddCommand.args = {
|
|
36
36
|
'OWNER/PROJECT_NAME': Args.string({
|
|
37
37
|
required: true,
|
|
38
|
-
description: 'The project to add the domain to on
|
|
38
|
+
description: 'The project to add the domain to on Swagger'
|
|
39
39
|
}),
|
|
40
40
|
'DOMAIN': Args.string({
|
|
41
41
|
required: true,
|
|
42
|
-
description: 'The name of the domain on
|
|
42
|
+
description: 'The name of the domain on Swagger to add'
|
|
43
43
|
})
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -48,7 +48,7 @@ class ProjectDomainRemoveCommand extends BaseCommand {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
ProjectDomainRemoveCommand.description = 'Removes a domain from a project in
|
|
51
|
+
ProjectDomainRemoveCommand.description = 'Removes a domain from a project in Swagger.'
|
|
52
52
|
|
|
53
53
|
ProjectDomainRemoveCommand.examples = [
|
|
54
54
|
'swaggerhub project:domain:remove organization/project_name my_domain',
|
|
@@ -57,11 +57,11 @@ ProjectDomainRemoveCommand.examples = [
|
|
|
57
57
|
ProjectDomainRemoveCommand.args = {
|
|
58
58
|
'OWNER/PROJECT_NAME': Args.string({
|
|
59
59
|
required: true,
|
|
60
|
-
description: 'The project to remove the domain from on
|
|
60
|
+
description: 'The project to remove the domain from on Swagger'
|
|
61
61
|
}),
|
|
62
62
|
'DOMAIN': Args.string({
|
|
63
63
|
required: true,
|
|
64
|
-
description: 'The name of the domain on
|
|
64
|
+
description: 'The name of the domain on Swagger to remove'
|
|
65
65
|
})
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -44,13 +44,13 @@ class ListProjectMembersCommand extends BaseCommand {
|
|
|
44
44
|
ListProjectMembersCommand.description = 'list members of a project'
|
|
45
45
|
|
|
46
46
|
ListProjectMembersCommand.examples = [
|
|
47
|
-
'swaggerhub project:member:list
|
|
47
|
+
'swaggerhub project:member:list organization/project_name',
|
|
48
48
|
]
|
|
49
49
|
|
|
50
50
|
ListProjectMembersCommand.args = {
|
|
51
51
|
'OWNER/PROJECT_NAME': Args.string({
|
|
52
52
|
required: true,
|
|
53
|
-
description: 'Project to list members of
|
|
53
|
+
description: 'Project to list members of'
|
|
54
54
|
})
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -54,7 +54,7 @@ DownloadSpectralRulesetCommand.examples = [
|
|
|
54
54
|
DownloadSpectralRulesetCommand.args = {
|
|
55
55
|
'OWNER/RULESET_NAME': Args.string({
|
|
56
56
|
required: true,
|
|
57
|
-
description: 'Organization\'s Spectral ruleset to create or update on
|
|
57
|
+
description: 'Organization\'s Spectral ruleset to create or update on Swagger'
|
|
58
58
|
}),
|
|
59
59
|
'directory': Args.string({
|
|
60
60
|
required: true,
|
|
@@ -44,7 +44,7 @@ UploadSpectralRulesetCommand.examples = [
|
|
|
44
44
|
UploadSpectralRulesetCommand.args = {
|
|
45
45
|
'OWNER/RULESET_NAME': Args.string({
|
|
46
46
|
required: true,
|
|
47
|
-
description: 'Organization\'s Spectral ruleset to create or update on
|
|
47
|
+
description: 'Organization\'s Spectral ruleset to create or update on Swagger'
|
|
48
48
|
}),
|
|
49
49
|
'directory': Args.string({
|
|
50
50
|
required: true,
|
|
@@ -72,7 +72,7 @@ class BaseCommand extends Command {
|
|
|
72
72
|
executeHttp({ execute, onResolve, onReject = handleErrors, options: { resolveStatus = [] } }) {
|
|
73
73
|
|
|
74
74
|
if (!config.isURLValid()) {
|
|
75
|
-
this.error('Please verify that the configured
|
|
75
|
+
this.error('Please verify that the configured Swagger URL is correct.')
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
return execute()
|
package/src/support/isOnPrem.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
const { wrapTemplates } = require('../utils/general')
|
|
2
2
|
|
|
3
3
|
const errorMsg = {
|
|
4
|
-
ApiCreate: 'API version \'{{owner}}/{{name}}/{{version}}\' already exists in
|
|
4
|
+
ApiCreate: 'API version \'{{owner}}/{{name}}/{{version}}\' already exists in Swagger',
|
|
5
5
|
|
|
6
|
-
DomainCreate: 'Domain version \'{{owner}}/{{name}}/{{version}}\' already exists in
|
|
6
|
+
DomainCreate: 'Domain version \'{{owner}}/{{name}}/{{version}}\' already exists in Swagger',
|
|
7
7
|
|
|
8
8
|
Configure: 'Failed to write config to {{configFilePath}}',
|
|
9
9
|
|
|
10
10
|
argsMustMatchFormat: 'Argument must match {{format}} format',
|
|
11
11
|
|
|
12
|
-
cannotParseDefinition: 'There was a problem
|
|
12
|
+
cannotParseDefinition: 'There was a problem parsing {{filename}}. \nReason: {{e}}',
|
|
13
13
|
|
|
14
14
|
cannotParseSpecification: 'Cannot determine specification from file',
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ const errorMsg = {
|
|
|
25
25
|
|
|
26
26
|
directoryExists: 'Directory already exists: \'{{directory}}\'',
|
|
27
27
|
|
|
28
|
-
unknown: 'Unknown
|
|
28
|
+
unknown: 'Unknown error',
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
module.exports = wrapTemplates({
|
|
@@ -7,6 +7,12 @@ const infoMsg = {
|
|
|
7
7
|
|
|
8
8
|
ApiRename: 'Renamed API \'{{apiPath}}\' to \'{{newName}}\'',
|
|
9
9
|
|
|
10
|
+
ApiClone: 'Cloned API \'{{apiPath}}\' as version {{newVersion}}',
|
|
11
|
+
|
|
12
|
+
DomainClone: 'Cloned domain \'{{domainPath}}\' as version {{newVersion}}',
|
|
13
|
+
|
|
14
|
+
DomainRename: 'Renamed domain \'{{domainPath}}\' to \'{{newName}}\'',
|
|
15
|
+
|
|
10
16
|
DomainCreate: 'Created domain \'{{owner}}/{{name}}\'',
|
|
11
17
|
|
|
12
18
|
DomainDelete: 'Deleted domain \'{{owner}}/{{name}}\'',
|
|
@@ -51,9 +57,9 @@ const infoMsg = {
|
|
|
51
57
|
|
|
52
58
|
ProjectUpdate: 'Updated project \'{{owner}}/{{projectName}}\'',
|
|
53
59
|
|
|
54
|
-
ProjectApiAdd: 'Added
|
|
60
|
+
ProjectApiAdd: 'Added API \'{{apiName}}\' to project \'{{projectPath}}\'',
|
|
55
61
|
|
|
56
|
-
ProjectApiRemove: 'Removed
|
|
62
|
+
ProjectApiRemove: 'Removed API \'{{apiName}}\' from project \'{{projectPath}}\'',
|
|
57
63
|
|
|
58
64
|
ProjectDomainAdd: 'Added domain \'{{domainName}}\' to project \'{{projectPath}}\'',
|
|
59
65
|
|