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.
Files changed (45) hide show
  1. package/README.md +209 -122
  2. package/oclif.manifest.json +247 -86
  3. package/package.json +2 -2
  4. package/src/commands/api/clone.js +65 -0
  5. package/src/commands/api/create.js +2 -2
  6. package/src/commands/api/delete.js +1 -1
  7. package/src/commands/api/get.js +2 -2
  8. package/src/commands/api/publish.js +1 -1
  9. package/src/commands/api/setdefault.js +1 -1
  10. package/src/commands/api/update.js +3 -3
  11. package/src/commands/api/validate/download-rules.js +5 -5
  12. package/src/commands/api/validate/index.js +2 -2
  13. package/src/commands/api/validate/local.js +3 -3
  14. package/src/commands/configure.js +2 -2
  15. package/src/commands/domain/clone.js +65 -0
  16. package/src/commands/domain/create.js +6 -6
  17. package/src/commands/domain/delete.js +1 -1
  18. package/src/commands/domain/get.js +1 -1
  19. package/src/commands/domain/publish.js +1 -1
  20. package/src/commands/domain/rename.js +77 -0
  21. package/src/commands/domain/setdefault.js +1 -1
  22. package/src/commands/domain/unpublish.js +1 -1
  23. package/src/commands/domain/update.js +3 -3
  24. package/src/commands/integration/create.js +2 -2
  25. package/src/commands/integration/delete.js +1 -1
  26. package/src/commands/integration/execute.js +1 -1
  27. package/src/commands/integration/get.js +2 -2
  28. package/src/commands/integration/list.js +1 -1
  29. package/src/commands/integration/update.js +1 -1
  30. package/src/commands/project/api/add.js +2 -2
  31. package/src/commands/project/api/remove.js +3 -3
  32. package/src/commands/project/create.js +4 -4
  33. package/src/commands/project/delete.js +2 -2
  34. package/src/commands/project/domain/add.js +2 -2
  35. package/src/commands/project/domain/remove.js +3 -3
  36. package/src/commands/project/get.js +1 -1
  37. package/src/commands/project/list.js +1 -1
  38. package/src/commands/project/member/list.js +2 -2
  39. package/src/commands/spectral/download.js +1 -1
  40. package/src/commands/spectral/upload.js +1 -1
  41. package/src/support/command/base-command.js +1 -1
  42. package/src/support/inquirer/prompt-templates.js +1 -1
  43. package/src/support/isOnPrem.js +2 -2
  44. package/src/template-strings/errors.js +4 -4
  45. 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 SwaggerHub.'
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 Swaggerhub'
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 separated list of api names to include in project',
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 separated list of domain names to include in project',
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 SwaggerHub.'
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 Swaggerhub'
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 Swaggerhub'
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 Swaggerhub to add'
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 SwaggerHub.'
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 Swaggerhub'
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 Swaggerhub to remove'
64
+ description: 'The name of the domain on Swagger to remove'
65
65
  })
66
66
  }
67
67
 
@@ -42,7 +42,7 @@ GetProjectCommand.examples = [
42
42
  GetProjectCommand.args = {
43
43
  'OWNER/PROJECT_NAME': Args.string({
44
44
  required: true,
45
- description: 'The project to get details for on Swaggerhub'
45
+ description: 'The project to get details for on Swagger'
46
46
  })
47
47
  }
48
48
 
@@ -57,7 +57,7 @@ ListProjectCommand.examples = [
57
57
  ListProjectCommand.args = {
58
58
  'OWNER': Args.string({
59
59
  required: false,
60
- description: 'The organization to list projects for on Swaggerhub'
60
+ description: 'The organization to list projects for on Swagger'
61
61
  })
62
62
  }
63
63
 
@@ -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 organisation/project_name',
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 on Swaggerhub'
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 SwaggerHub'
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 SwaggerHub'
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 SwaggerHub URL is correct.')
75
+ this.error('Please verify that the configured Swagger URL is correct.')
76
76
  }
77
77
 
78
78
  return execute()
@@ -2,7 +2,7 @@ const { wrapTemplates } = require('../../utils/general')
2
2
 
3
3
  const swaggerHubUrl = {
4
4
  name: 'SWAGGERHUB_URL',
5
- message: 'SwaggerHub URL:',
5
+ message: 'Swagger URL:',
6
6
  default: '{{SWAGGERHUB_URL}}'
7
7
  }
8
8
 
@@ -1,7 +1,7 @@
1
- const { getConfig } = require('../config')
1
+ const config = require('../config')
2
2
 
3
3
  const isOnPrem = () => {
4
- const { SWAGGERHUB_URL } = getConfig()
4
+ const { SWAGGERHUB_URL } = config.getConfig()
5
5
  return !SWAGGERHUB_URL.endsWith('swaggerhub.com')
6
6
  }
7
7
 
@@ -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 SwaggerHub',
4
+ ApiCreate: 'API version \'{{owner}}/{{name}}/{{version}}\' already exists in Swagger',
5
5
 
6
- DomainCreate: 'Domain version \'{{owner}}/{{name}}/{{version}}\' already exists in SwaggerHub',
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 with parsing {{filename}}. \nReason: {{e}}',
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 Error',
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 api \'{{apiName}}\' to project \'{{projectPath}}\'',
60
+ ProjectApiAdd: 'Added API \'{{apiName}}\' to project \'{{projectPath}}\'',
55
61
 
56
- ProjectApiRemove: 'Removed api \'{{apiName}}\' from project \'{{projectPath}}\'',
62
+ ProjectApiRemove: 'Removed API \'{{apiName}}\' from project \'{{projectPath}}\'',
57
63
 
58
64
  ProjectDomainAdd: 'Added domain \'{{domainName}}\' to project \'{{projectPath}}\'',
59
65