swaggerhub-cli 0.14.0 → 0.16.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 (76) hide show
  1. package/README.md +152 -41
  2. package/bin/run +5 -4
  3. package/oclif.manifest.json +841 -670
  4. package/package.json +21 -16
  5. package/skills/swaggerhub-cli/SKILL.md +43 -0
  6. package/src/check-node-version.js +3 -2
  7. package/src/commands/api/clone.js +8 -7
  8. package/src/commands/api/comment/list.js +91 -0
  9. package/src/commands/api/create.js +8 -8
  10. package/src/commands/api/delete.js +6 -6
  11. package/src/commands/api/fork.js +75 -0
  12. package/src/commands/api/get.js +7 -7
  13. package/src/commands/api/publish.js +6 -6
  14. package/src/commands/api/rename.js +8 -10
  15. package/src/commands/api/setdefault.js +5 -5
  16. package/src/commands/api/unpublish.js +5 -5
  17. package/src/commands/api/update.js +8 -8
  18. package/src/commands/api/validate/download-rules.js +6 -6
  19. package/src/commands/api/validate/index.js +8 -8
  20. package/src/commands/api/validate/local.js +8 -8
  21. package/src/commands/configure.js +6 -6
  22. package/src/commands/domain/clone.js +8 -7
  23. package/src/commands/domain/create.js +8 -8
  24. package/src/commands/domain/delete.js +6 -6
  25. package/src/commands/domain/fork.js +75 -0
  26. package/src/commands/domain/get.js +7 -7
  27. package/src/commands/domain/publish.js +5 -5
  28. package/src/commands/domain/rename.js +9 -8
  29. package/src/commands/domain/setdefault.js +5 -5
  30. package/src/commands/domain/unpublish.js +5 -5
  31. package/src/commands/domain/update.js +8 -8
  32. package/src/commands/integration/create.js +5 -5
  33. package/src/commands/integration/delete.js +5 -5
  34. package/src/commands/integration/execute.js +5 -5
  35. package/src/commands/integration/get.js +7 -7
  36. package/src/commands/integration/list.js +6 -6
  37. package/src/commands/integration/update.js +5 -5
  38. package/src/commands/project/api/add.js +5 -7
  39. package/src/commands/project/api/remove.js +7 -10
  40. package/src/commands/project/create.js +5 -9
  41. package/src/commands/project/delete.js +5 -5
  42. package/src/commands/project/domain/add.js +5 -7
  43. package/src/commands/project/domain/remove.js +7 -10
  44. package/src/commands/project/get.js +7 -7
  45. package/src/commands/project/list.js +5 -5
  46. package/src/commands/project/member/list.js +6 -6
  47. package/src/commands/spectral/download.js +8 -8
  48. package/src/commands/spectral/upload.js +10 -10
  49. package/src/config/index.js +27 -5
  50. package/src/format-readme.js +3 -2
  51. package/src/help.js +2 -2
  52. package/src/hooks/setup-config.js +11 -6
  53. package/src/index.js +2 -2
  54. package/src/requests/api.js +3 -3
  55. package/src/requests/domain.js +3 -3
  56. package/src/requests/project.js +2 -2
  57. package/src/requests/spec.js +5 -5
  58. package/src/requests/spectral.js +3 -3
  59. package/src/requests/standardization.js +4 -4
  60. package/src/support/command/base-command.js +10 -11
  61. package/src/support/command/base-validate-command.js +3 -3
  62. package/src/support/command/handle-response.js +7 -5
  63. package/src/support/command/parse-input.js +8 -6
  64. package/src/support/command/update-command.js +5 -5
  65. package/src/support/http/default-headers.js +1 -1
  66. package/src/support/http/header-templates.js +2 -2
  67. package/src/support/http/index.js +7 -7
  68. package/src/support/http/proxy-agent.js +4 -4
  69. package/src/support/inquirer/index.js +4 -4
  70. package/src/support/inquirer/prompt-templates.js +2 -2
  71. package/src/support/isOnPrem.js +4 -4
  72. package/src/template-strings/errors.js +2 -2
  73. package/src/template-strings/index.js +3 -3
  74. package/src/template-strings/info.js +6 -2
  75. package/src/utils/definitions.js +8 -6
  76. package/src/utils/general.js +3 -3
@@ -1,10 +1,10 @@
1
- const { Flags, Args } = require('@oclif/core')
2
- const { readFileSync } = require('fs-extra')
3
- const { getDomain, postDomain } = require('../../requests/domain')
4
- const { getDomainIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
5
- const { getVersion, parseDefinition } = require('../../utils/definitions')
6
- const BaseCommand = require('../../support/command/base-command')
7
- const UpdateCommand = require('../../support/command/update-command')
1
+ import { Flags, Args } from '@oclif/core'
2
+ import { readFileSync } from 'node:fs'
3
+ import { getDomain, postDomain } from '../../requests/domain.js'
4
+ import { getDomainIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
5
+ import { getVersion, parseDefinition } from '../../utils/definitions.js'
6
+ import BaseCommand from '../../support/command/base-command.js'
7
+ import UpdateCommand from '../../support/command/update-command.js'
8
8
 
9
9
  const isDomainNameAvailable = response => response.status === 404
10
10
 
@@ -135,4 +135,4 @@ CreateDomainCommand.flags = {
135
135
  ...BaseCommand.flags
136
136
  }
137
137
 
138
- module.exports = CreateDomainCommand
138
+ export default CreateDomainCommand
@@ -1,8 +1,8 @@
1
- const { Flags, Args } = require('@oclif/core')
2
- const { deleteDomain } = require('../../requests/domain')
3
- const { getDomainIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
4
- const BaseCommand = require('../../support/command/base-command')
5
- const inquirer = require('inquirer')
1
+ import { Flags, Args } from '@oclif/core'
2
+ import { deleteDomain } from '../../requests/domain.js'
3
+ import { getDomainIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
4
+ import BaseCommand from '../../support/command/base-command.js'
5
+ import inquirer from 'inquirer'
6
6
 
7
7
  class DeleteDomainCommand extends BaseCommand {
8
8
 
@@ -61,4 +61,4 @@ DeleteDomainCommand.flags = {
61
61
  ...BaseCommand.flags
62
62
  }
63
63
 
64
- module.exports = DeleteDomainCommand
64
+ export default DeleteDomainCommand
@@ -0,0 +1,75 @@
1
+ import BaseCommand from '../../support/command/base-command.js'
2
+ import { Args, Flags, Errors } from '@oclif/core'
3
+ import { getDomainIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
4
+ import { errorMsg } from '../../template-strings/index.js'
5
+ import { postDomain } from '../../requests/domain.js'
6
+
7
+ const { CLIError } = Errors
8
+
9
+ const targetRegex = new RegExp(/^[\w\-.]+\/[\w\-.]+\/[\w\-.]+$/)
10
+
11
+ const getTarget = args => {
12
+ const target = args['NEW_OWNER/NEW_DOMAIN_NAME/NEW_VERSION']
13
+ if (!targetRegex.test(target)) {
14
+ throw new CLIError(errorMsg.argsMustMatchFormat({ format: 'NEW_OWNER/NEW_DOMAIN_NAME/NEW_VERSION' }))
15
+ }
16
+ const [owner, name, version] = splitPathParams(target)
17
+ return { owner, name, version }
18
+ }
19
+
20
+ class ForkDomainCommand extends BaseCommand {
21
+
22
+ async run() {
23
+ const { args, flags } = await this.parse(ForkDomainCommand)
24
+
25
+ const domainPath = getDomainIdentifierArg(args)
26
+ const body = getTarget(args)
27
+ const forkPath = `${body.owner}/${body.name}/${body.version}`
28
+ if (flags.project) body.project = flags.project
29
+ if (flags.visibility) body.private = flags.visibility === 'private'
30
+
31
+ this.log(`Forking domain: '${domainPath}' as '${forkPath}'`)
32
+
33
+ await this.executeHttp({
34
+ execute: () => postDomain({
35
+ pathParams: [domainPath, 'fork'],
36
+ body: JSON.stringify(body)
37
+ }),
38
+ onResolve: this.logCommandSuccess({ domainPath, forkPath }),
39
+ options: {}
40
+ })
41
+ }
42
+ }
43
+
44
+ ForkDomainCommand.description = `fork a domain version
45
+ The fork can be created as a new domain, or as a new version of another existing domain.
46
+ `
47
+
48
+ ForkDomainCommand.examples = [
49
+ 'swaggerhub domain:fork organization/domain/1.0.0 myorg/domain-fork/1.0.0',
50
+ 'swaggerhub domain:fork organization/domain/1.0.0 myorg/domain-fork/1.0.0 --project my-project --visibility private'
51
+ ]
52
+
53
+ ForkDomainCommand.args = {
54
+ 'OWNER/DOMAIN_NAME/VERSION': Args.string({
55
+ required: true,
56
+ description: 'Domain version to fork'
57
+ }),
58
+ 'NEW_OWNER/NEW_DOMAIN_NAME/NEW_VERSION': Args.string({
59
+ required: true,
60
+ description: 'Owner, name and version of the fork. An existing domain name creates a new version of it.'
61
+ })
62
+ }
63
+
64
+ ForkDomainCommand.flags = {
65
+ project: Flags.string({
66
+ description: 'existing project of the target organization to add the fork to'
67
+ }),
68
+ visibility: Flags.string({
69
+ description: 'visibility of the fork (defaults to the visibility of the source version)',
70
+ options: ['public', 'private']
71
+ }),
72
+ ...BaseCommand.flags
73
+ }
74
+
75
+ export default ForkDomainCommand
@@ -1,9 +1,9 @@
1
- const { Flags, Args } = require('@oclif/core')
2
- const { getDomainIdentifierArg, reqType, resolvedParam, splitPathParams } = require('../../support/command/parse-input')
3
- const { hasJsonStructure, prettyPrintJSON } = require('../../utils/general')
4
- const { getDomain } = require('../../requests/domain')
5
- const { getResponseContent } = require('../../support/command/handle-response')
6
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Flags, Args } from '@oclif/core'
2
+ import { getDomainIdentifierArg, reqType, resolvedParam, splitPathParams } from '../../support/command/parse-input.js'
3
+ import { hasJsonStructure, prettyPrintJSON } from '../../utils/general.js'
4
+ import { getDomain } from '../../requests/domain.js'
5
+ import { getResponseContent } from '../../support/command/handle-response.js'
6
+ import BaseCommand from '../../support/command/base-command.js'
7
7
 
8
8
  class GetDomainCommand extends BaseCommand {
9
9
  constructor(...props) {
@@ -66,4 +66,4 @@ GetDomainCommand.flags = {
66
66
  ...BaseCommand.flags
67
67
  }
68
68
 
69
- module.exports = GetDomainCommand
69
+ export default GetDomainCommand
@@ -1,7 +1,7 @@
1
- const { Flags, Args } = require('@oclif/core')
2
- const { getDomainIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
3
- const BaseCommand = require('../../support/command/base-command')
4
- const UpdateCommand = require('../../support/command/update-command')
1
+ import { Flags, Args } from '@oclif/core'
2
+ import { getDomainIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
3
+ import BaseCommand from '../../support/command/base-command.js'
4
+ import UpdateCommand from '../../support/command/update-command.js'
5
5
 
6
6
  class PublishCommand extends UpdateCommand {
7
7
 
@@ -36,4 +36,4 @@ PublishCommand.flags = {
36
36
  ...BaseCommand.flags
37
37
  }
38
38
 
39
- module.exports = PublishCommand
39
+ export default PublishCommand
@@ -1,12 +1,13 @@
1
- const BaseCommand = require('../../support/command/base-command')
2
- const { Args, Flags } = require('@oclif/core')
3
- const {
1
+ import BaseCommand from '../../support/command/base-command.js'
2
+ import { Args, Flags, Errors } from '@oclif/core'
3
+ import {
4
4
  noVersionRegex,
5
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')
6
+ } from '../../support/command/parse-input.js'
7
+ import { errorMsg } from '../../template-strings/index.js'
8
+ import { postDomain } from '../../requests/domain.js'
9
+
10
+ const { CLIError } = Errors
10
11
 
11
12
  const getDomainToRename = args => {
12
13
  const domainPath = args['OWNER/DOMAIN_NAME']
@@ -74,4 +75,4 @@ RenameDomainCommand.flags = {
74
75
  ...BaseCommand.flags
75
76
  }
76
77
 
77
- module.exports = RenameDomainCommand
78
+ export default RenameDomainCommand
@@ -1,7 +1,7 @@
1
- const { Args } = require('@oclif/core')
2
- const { getDomainIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
3
- const BaseCommand = require('../../support/command/base-command')
4
- const UpdateCommand = require('../../support/command/update-command')
1
+ import { Args } from '@oclif/core'
2
+ import { getDomainIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
3
+ import BaseCommand from '../../support/command/base-command.js'
4
+ import UpdateCommand from '../../support/command/update-command.js'
5
5
 
6
6
  class SetDefaultDomainCommand extends UpdateCommand {
7
7
 
@@ -29,4 +29,4 @@ SetDefaultDomainCommand.args = {
29
29
 
30
30
  SetDefaultDomainCommand.flags = BaseCommand.flags
31
31
 
32
- module.exports = SetDefaultDomainCommand
32
+ export default SetDefaultDomainCommand
@@ -1,7 +1,7 @@
1
- const { Args } = require('@oclif/core')
2
- const { getDomainIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
3
- const BaseCommand = require('../../support/command/base-command')
4
- const UpdateCommand = require('../../support/command/update-command')
1
+ import { Args } from '@oclif/core'
2
+ import { getDomainIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
3
+ import BaseCommand from '../../support/command/base-command.js'
4
+ import UpdateCommand from '../../support/command/update-command.js'
5
5
 
6
6
  class UnpublishCommand extends UpdateCommand {
7
7
 
@@ -29,4 +29,4 @@ UnpublishCommand.args = {
29
29
 
30
30
  UnpublishCommand.flags = BaseCommand.flags
31
31
 
32
- module.exports = UnpublishCommand
32
+ export default UnpublishCommand
@@ -1,10 +1,10 @@
1
- const { Flags, Args } = require('@oclif/core')
2
- const { readFileSync } = require('fs-extra')
3
- const { getDomain, postDomain } = require('../../requests/domain')
4
- const { getDomainIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
5
- const { getVersion, parseDefinition } = require('../../utils/definitions')
6
- const BaseCommand = require('../../support/command/base-command')
7
- const UpdateCommand = require('../../support/command/update-command')
1
+ import { Flags, Args } from '@oclif/core'
2
+ import { readFileSync } from 'node:fs'
3
+ import { getDomain, postDomain } from '../../requests/domain.js'
4
+ import { getDomainIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
5
+ import { getVersion, parseDefinition } from '../../utils/definitions.js'
6
+ import BaseCommand from '../../support/command/base-command.js'
7
+ import UpdateCommand from '../../support/command/update-command.js'
8
8
 
9
9
  class UpdateDomainCommand extends UpdateCommand {
10
10
 
@@ -107,4 +107,4 @@ UpdateDomainCommand.flags = {
107
107
  ...BaseCommand.flags
108
108
  }
109
109
 
110
- module.exports = UpdateDomainCommand
110
+ export default UpdateDomainCommand
@@ -1,7 +1,7 @@
1
- const { Flags, Args } = require('@oclif/core')
2
- const { postApi } = require('../../requests/api')
3
- const { getApiIdentifierArg, readConfigFile } = require('../../support/command/parse-input')
4
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Flags, Args } from '@oclif/core'
2
+ import { postApi } from '../../requests/api.js'
3
+ import { getApiIdentifierArg, readConfigFile } from '../../support/command/parse-input.js'
4
+ import BaseCommand from '../../support/command/base-command.js'
5
5
 
6
6
  class CreateIntegrationCommand extends BaseCommand {
7
7
 
@@ -53,4 +53,4 @@ CreateIntegrationCommand.flags = {
53
53
  ...BaseCommand.flags
54
54
  }
55
55
 
56
- module.exports = CreateIntegrationCommand
56
+ export default CreateIntegrationCommand
@@ -1,7 +1,7 @@
1
- const { Args } = require('@oclif/core')
2
- const { deleteApi } = require('../../requests/api')
3
- const { getIntegrationIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
4
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Args } from '@oclif/core'
2
+ import { deleteApi } from '../../requests/api.js'
3
+ import { getIntegrationIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
4
+ import BaseCommand from '../../support/command/base-command.js'
5
5
 
6
6
  class DeleteIntegrationCommand extends BaseCommand {
7
7
 
@@ -39,4 +39,4 @@ DeleteIntegrationCommand.flags = {
39
39
  ...BaseCommand.flags
40
40
  }
41
41
 
42
- module.exports = DeleteIntegrationCommand
42
+ export default DeleteIntegrationCommand
@@ -1,7 +1,7 @@
1
- const { Args } = require('@oclif/core')
2
- const { postApi } = require('../../requests/api')
3
- const { getIntegrationIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
4
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Args } from '@oclif/core'
2
+ import { postApi } from '../../requests/api.js'
3
+ import { getIntegrationIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
4
+ import BaseCommand from '../../support/command/base-command.js'
5
5
 
6
6
  class ExecuteIntegrationCommand extends BaseCommand {
7
7
 
@@ -39,4 +39,4 @@ ExecuteIntegrationCommand.flags = {
39
39
  ...BaseCommand.flags
40
40
  }
41
41
 
42
- module.exports = ExecuteIntegrationCommand
42
+ export default ExecuteIntegrationCommand
@@ -1,9 +1,9 @@
1
- const { Args } = require('@oclif/core')
2
- const { getApi } = require('../../requests/api')
3
- const { getIntegrationIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
4
- const { getResponseContent } = require('../../support/command/handle-response')
5
- const { prettyPrintJSON } = require('../../utils/general')
6
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Args } from '@oclif/core'
2
+ import { getApi } from '../../requests/api.js'
3
+ import { getIntegrationIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
4
+ import { getResponseContent } from '../../support/command/handle-response.js'
5
+ import { prettyPrintJSON } from '../../utils/general.js'
6
+ import BaseCommand from '../../support/command/base-command.js'
7
7
 
8
8
  class GetIntegrationCommand extends BaseCommand {
9
9
  constructor(...props) {
@@ -50,4 +50,4 @@ GetIntegrationCommand.flags = {
50
50
  ...BaseCommand.flags
51
51
  }
52
52
 
53
- module.exports = GetIntegrationCommand
53
+ export default GetIntegrationCommand
@@ -1,8 +1,8 @@
1
- const { ux, Args } = require('@oclif/core')
2
- const { getApi } = require('../../requests/api')
3
- const { getResponseContent } = require('../../support/command/handle-response')
4
- const { getApiIdentifierArg } = require('../../support/command/parse-input')
5
- const BaseCommand = require('../../support/command/base-command')
1
+ import { ux, Args } from '@oclif/core'
2
+ import { getApi } from '../../requests/api.js'
3
+ import { getResponseContent } from '../../support/command/handle-response.js'
4
+ import { getApiIdentifierArg } from '../../support/command/parse-input.js'
5
+ import BaseCommand from '../../support/command/base-command.js'
6
6
 
7
7
  class ListIntegrationCommand extends BaseCommand {
8
8
  constructor(...props) {
@@ -60,4 +60,4 @@ ListIntegrationCommand.flags = {
60
60
  ...BaseCommand.flags
61
61
  }
62
62
 
63
- module.exports = ListIntegrationCommand
63
+ export default ListIntegrationCommand
@@ -1,7 +1,7 @@
1
- const { Flags, Args } = require('@oclif/core')
2
- const { putApi } = require('../../requests/api')
3
- const { getIntegrationIdentifierArg, readConfigFile, splitPathParams } = require('../../support/command/parse-input')
4
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Flags, Args } from '@oclif/core'
2
+ import { putApi } from '../../requests/api.js'
3
+ import { getIntegrationIdentifierArg, readConfigFile, splitPathParams } from '../../support/command/parse-input.js'
4
+ import BaseCommand from '../../support/command/base-command.js'
5
5
 
6
6
  class UpdateIntegrationCommand extends BaseCommand {
7
7
 
@@ -49,4 +49,4 @@ UpdateIntegrationCommand.flags = {
49
49
  ...BaseCommand.flags
50
50
  }
51
51
 
52
- module.exports = UpdateIntegrationCommand
52
+ export default UpdateIntegrationCommand
@@ -1,9 +1,7 @@
1
- const { Args } = require('@oclif/core')
2
- const { putProject } = require('../../../requests/project')
3
- const {
4
- getProjectIdentifierArg
5
- } = require('../../../support/command/parse-input')
6
- const BaseCommand = require('../../../support/command/base-command')
1
+ import { Args } from '@oclif/core'
2
+ import { putProject } from '../../../requests/project.js'
3
+ import { getProjectIdentifierArg } from '../../../support/command/parse-input.js'
4
+ import BaseCommand from '../../../support/command/base-command.js'
7
5
 
8
6
  class ProjectApiAddCommand extends BaseCommand {
9
7
 
@@ -43,4 +41,4 @@ ProjectApiAddCommand.args = {
43
41
  })
44
42
  }
45
43
 
46
- module.exports = ProjectApiAddCommand
44
+ export default ProjectApiAddCommand
@@ -1,12 +1,9 @@
1
- const { Args } = require('@oclif/core')
2
- const { putProject, getProject } = require('../../../requests/project')
3
- const {
4
- getProjectIdentifierArg,
5
- splitPathParams,
6
- } = require('../../../support/command/parse-input')
7
- const BaseCommand = require('../../../support/command/base-command')
8
- const { getResponseContent } = require('../../../support/command/handle-response')
9
- const { pipeAsync } = require('../../../utils/general')
1
+ import { Args } from '@oclif/core'
2
+ import { putProject, getProject } from '../../../requests/project.js'
3
+ import { getProjectIdentifierArg, splitPathParams } from '../../../support/command/parse-input.js'
4
+ import BaseCommand from '../../../support/command/base-command.js'
5
+ import { getResponseContent } from '../../../support/command/handle-response.js'
6
+ import { pipeAsync } from '../../../utils/general.js'
10
7
 
11
8
  class ProjectApiRemoveCommand extends BaseCommand {
12
9
 
@@ -65,4 +62,4 @@ ProjectApiRemoveCommand.args = {
65
62
  })
66
63
  }
67
64
 
68
- module.exports = ProjectApiRemoveCommand
65
+ export default ProjectApiRemoveCommand
@@ -1,11 +1,7 @@
1
- const { Flags, Args } = require('@oclif/core')
2
- const { postProject } = require('../../requests/project')
3
- const {
4
- getProjectIdentifierArg,
5
- splitPathParams,
6
- splitFlagParams
7
- } = require('../../support/command/parse-input')
8
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Flags, Args } from '@oclif/core'
2
+ import { postProject } from '../../requests/project.js'
3
+ import { getProjectIdentifierArg, splitPathParams, splitFlagParams } from '../../support/command/parse-input.js'
4
+ import BaseCommand from '../../support/command/base-command.js'
9
5
 
10
6
  class CreateProjectCommand extends BaseCommand {
11
7
 
@@ -75,4 +71,4 @@ CreateProjectCommand.flags = {
75
71
  ...BaseCommand.flags
76
72
  }
77
73
 
78
- module.exports = CreateProjectCommand
74
+ export default CreateProjectCommand
@@ -1,7 +1,7 @@
1
- const { Args } = require('@oclif/core')
2
- const { deleteProject } = require('../../requests/project')
3
- const { getProjectIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
4
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Args } from '@oclif/core'
2
+ import { deleteProject } from '../../requests/project.js'
3
+ import { getProjectIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
4
+ import BaseCommand from '../../support/command/base-command.js'
5
5
 
6
6
  class DeleteProjectCommand extends BaseCommand {
7
7
  constructor(...props) {
@@ -43,4 +43,4 @@ DeleteProjectCommand.flags = {
43
43
  ...BaseCommand.flags
44
44
  }
45
45
 
46
- module.exports = DeleteProjectCommand
46
+ export default DeleteProjectCommand
@@ -1,9 +1,7 @@
1
- const { Args } = require('@oclif/core')
2
- const { putProject } = require('../../../requests/project')
3
- const {
4
- getProjectIdentifierArg
5
- } = require('../../../support/command/parse-input')
6
- const BaseCommand = require('../../../support/command/base-command')
1
+ import { Args } from '@oclif/core'
2
+ import { putProject } from '../../../requests/project.js'
3
+ import { getProjectIdentifierArg } from '../../../support/command/parse-input.js'
4
+ import BaseCommand from '../../../support/command/base-command.js'
7
5
 
8
6
  class ProjectDomainAddCommand extends BaseCommand {
9
7
 
@@ -43,4 +41,4 @@ ProjectDomainAddCommand.args = {
43
41
  })
44
42
  }
45
43
 
46
- module.exports = ProjectDomainAddCommand
44
+ export default ProjectDomainAddCommand
@@ -1,12 +1,9 @@
1
- const { Args } = require('@oclif/core')
2
- const { putProject, getProject } = require('../../../requests/project')
3
- const {
4
- getProjectIdentifierArg,
5
- splitPathParams,
6
- } = require('../../../support/command/parse-input')
7
- const BaseCommand = require('../../../support/command/base-command')
8
- const { getResponseContent } = require('../../../support/command/handle-response')
9
- const { pipeAsync } = require('../../../utils/general')
1
+ import { Args } from '@oclif/core'
2
+ import { putProject, getProject } from '../../../requests/project.js'
3
+ import { getProjectIdentifierArg, splitPathParams } from '../../../support/command/parse-input.js'
4
+ import BaseCommand from '../../../support/command/base-command.js'
5
+ import { getResponseContent } from '../../../support/command/handle-response.js'
6
+ import { pipeAsync } from '../../../utils/general.js'
10
7
 
11
8
  class ProjectDomainRemoveCommand extends BaseCommand {
12
9
 
@@ -65,4 +62,4 @@ ProjectDomainRemoveCommand.args = {
65
62
  })
66
63
  }
67
64
 
68
- module.exports = ProjectDomainRemoveCommand
65
+ export default ProjectDomainRemoveCommand
@@ -1,9 +1,9 @@
1
- const { Args } = require('@oclif/core')
2
- const { getProject } = require('../../requests/project')
3
- const { getProjectIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
4
- const { getResponseContent } = require('../../support/command/handle-response')
5
- const { prettyPrintJSON } = require('../../utils/general')
6
- const BaseCommand = require('../../support/command/base-command')
1
+ import { Args } from '@oclif/core'
2
+ import { getProject } from '../../requests/project.js'
3
+ import { getProjectIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
4
+ import { getResponseContent } from '../../support/command/handle-response.js'
5
+ import { prettyPrintJSON } from '../../utils/general.js'
6
+ import BaseCommand from '../../support/command/base-command.js'
7
7
 
8
8
  class GetProjectCommand extends BaseCommand {
9
9
  constructor(...props) {
@@ -50,4 +50,4 @@ GetProjectCommand.flags = {
50
50
  ...BaseCommand.flags
51
51
  }
52
52
 
53
- module.exports = GetProjectCommand
53
+ export default GetProjectCommand
@@ -1,7 +1,7 @@
1
- const { ux, Args, Flags } = require('@oclif/core')
2
- const { getProject } = require('../../requests/project')
3
- const { getResponseContent } = require('../../support/command/handle-response')
4
- const BaseCommand = require('../../support/command/base-command')
1
+ import { ux, Args, Flags } from '@oclif/core'
2
+ import { getProject } from '../../requests/project.js'
3
+ import { getResponseContent } from '../../support/command/handle-response.js'
4
+ import BaseCommand from '../../support/command/base-command.js'
5
5
 
6
6
  class ListProjectCommand extends BaseCommand {
7
7
  constructor(...props) {
@@ -79,4 +79,4 @@ ListProjectCommand.flags = {
79
79
  })
80
80
  }
81
81
 
82
- module.exports = ListProjectCommand
82
+ export default ListProjectCommand
@@ -1,8 +1,8 @@
1
- const { ux, Args } = require('@oclif/core')
2
- const { getProject } = require('../../../requests/project')
3
- const { getResponseContent } = require('../../../support/command/handle-response')
4
- const BaseCommand = require('../../../support/command/base-command')
5
- const { getProjectIdentifierArg } = require('../../../support/command/parse-input')
1
+ import { ux, Args } from '@oclif/core'
2
+ import { getProject } from '../../../requests/project.js'
3
+ import { getResponseContent } from '../../../support/command/handle-response.js'
4
+ import BaseCommand from '../../../support/command/base-command.js'
5
+ import { getProjectIdentifierArg } from '../../../support/command/parse-input.js'
6
6
 
7
7
  class ListProjectMembersCommand extends BaseCommand {
8
8
  constructor(...props) {
@@ -58,4 +58,4 @@ ListProjectMembersCommand.flags = {
58
58
  ...BaseCommand.flags
59
59
  }
60
60
 
61
- module.exports = ListProjectMembersCommand
61
+ export default ListProjectMembersCommand
@@ -1,10 +1,10 @@
1
- const { Args , Errors } = require('@oclif/core')
2
- const { getSpectralRuleset } = require('../../requests/spectral')
3
- const { getSpectralIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
4
- const { errorMsg } = require('../../template-strings')
5
- const BaseCommand = require('../../support/command/base-command')
6
- const unzipper = require('unzipper')
7
- const fs = require('fs')
1
+ import { Args, Errors } from '@oclif/core'
2
+ import { getSpectralRuleset } from '../../requests/spectral.js'
3
+ import { getSpectralIdentifierArg, splitPathParams } from '../../support/command/parse-input.js'
4
+ import { errorMsg } from '../../template-strings/index.js'
5
+ import BaseCommand from '../../support/command/base-command.js'
6
+ import unzipper from 'unzipper'
7
+ import fs from 'fs'
8
8
 
9
9
  class DownloadSpectralRulesetCommand extends BaseCommand {
10
10
  async run() {
@@ -66,4 +66,4 @@ DownloadSpectralRulesetCommand.flags = {
66
66
  ...BaseCommand.flags
67
67
  }
68
68
 
69
- module.exports = DownloadSpectralRulesetCommand
69
+ export default DownloadSpectralRulesetCommand