@adinsure-ops/ops-cli 5.0.3 → 5.0.5

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 (36) hide show
  1. package/CHANGELOGS.md +10 -7
  2. package/README.md +22 -9
  3. package/lib/command.base.d.ts +1 -0
  4. package/lib/command.base.js +11 -0
  5. package/lib/commands/docker/update-image-version.js +4 -0
  6. package/lib/commands/doctor.js +4 -0
  7. package/lib/commands/download/client.js +4 -0
  8. package/lib/commands/download/identity-server.js +4 -0
  9. package/lib/commands/download/jmeter.js +6 -2
  10. package/lib/commands/download/keycloak-scim.js +4 -0
  11. package/lib/commands/download/platform.js +4 -0
  12. package/lib/commands/download/scheduler.js +4 -0
  13. package/lib/commands/download/server.js +4 -0
  14. package/lib/commands/download/signalr.js +4 -0
  15. package/lib/commands/download/studio.js +4 -0
  16. package/lib/commands/gitlab/get-tag-pipeline.js +4 -0
  17. package/lib/commands/gitlab/next-nightly-tag.js +4 -0
  18. package/lib/commands/jira/issue.js +4 -0
  19. package/lib/commands/jira/labels.js +4 -0
  20. package/lib/commands/log/add.js +4 -0
  21. package/lib/commands/log/generate.js +4 -0
  22. package/lib/commands/log/validate.js +4 -0
  23. package/lib/commands/login.d.ts +0 -3
  24. package/lib/commands/login.js +4 -17
  25. package/lib/commands/npm/check-publish.js +4 -0
  26. package/lib/commands/npm/dependency-update.js +4 -0
  27. package/lib/commands/npm/publish.js +4 -0
  28. package/lib/commands/nuget/dependency-update.d.ts +2 -2
  29. package/lib/commands/nuget/dependency-update.js +7 -2
  30. package/lib/commands/prepare-content.js +4 -0
  31. package/lib/commands/sql.js +4 -0
  32. package/lib/commands/translate.js +4 -0
  33. package/lib/commands/version.js +12 -15
  34. package/lib/security/context.js +0 -1
  35. package/oclif.manifest.json +3 -23
  36. package/package.json +3 -3
package/CHANGELOGS.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelogs
2
2
 
3
+ ## 5.0.5: 2023-11-20
4
+
5
+ - Fixed the ops-cli releasing cycle as a few minor releases were not uploaded to npm.js
6
+
7
+ ## 5.0.4: 2023-09-27
8
+
9
+ - Fixed version command's post request, where the headers were actually stored in the body
10
+
3
11
  ## 5.0.3: 2023-09-25
4
12
 
5
13
  - Updated node engine support to also include 20.x and deprecated the use of 14.x
@@ -15,21 +23,16 @@
15
23
  - Prepare-content command is back! But with a differenct syntax than before, so check the README
16
24
  - Faster performance and updated dependencies
17
25
 
18
- ## 5.0.0-rc5: 2023-09-08
26
+ ## 5.0.0: 2023-09-08
19
27
 
20
28
  - Added --description flag to the log command. It accepts the description of the changelog which will be used
21
29
  - Added --force flag to the log command. It creates folder structure if missing
22
-
23
- ## 5.0.0-rc4: 2023-09-05
24
-
25
30
  - Added --keep flag to the download:studio command
26
-
27
- ## 5.0.0-rc3: 2023-09-01
28
-
29
31
  - Bugfixes
30
32
  - Security patching: the project was migrated to a new oclif framework from the old one
31
33
  - Performace tuning
32
34
  - [DEPRECATED] Deprecation and removal of the prepare-content command
35
+ - [REMOVED] `--servicePrincipal` login is no longer available or required. 'AZURE_CLIENT_ID' and 'AZURE_CLIENT_SECRET' environment variables are required with every command in order to use service principal.
33
36
 
34
37
  ## 4.8.3: 2023-08-22
35
38
 
package/README.md CHANGED
@@ -21,7 +21,17 @@ To quick start development:
21
21
  - Run `yarn install`
22
22
  - For easier debugging, run `yarn link`
23
23
 
24
- You can run and debug commands directly from terminal by running `ops [command]` (if you `yarn link`-ed the package) or execute `.\bin\run [command]` (if you didn't).
24
+ You can run and debug commands directly from terminal by running `ops [command]` (if you `yarn link`-ed the package) or execute `.\bin\run [command]` (if you didn't). For debugging, you can follow oclif's documentation on how to turn on debug mode for a single command **[here](https://oclif.io/docs/debugging/)**.
25
+
26
+ ## Upgrade guilde
27
+
28
+ ### Upgrade to version 5
29
+
30
+ Node 18 or 20 are required.
31
+
32
+ ### Upgrade to version 4
33
+
34
+ We changed the way service principal login works. It is no longer needed to call login command for service principal login (for example in CI). Commands `ops login --servicePrincipal -c ${AZURE_CLIENT_ID} -s ${AZURE_CLIENT_SECRET}` should be removed, but `AZURE_CLIENT_ID` and `AZURE_CLIENT_SECRET` environment variables should exists, because OPS Cli uses it in background.
25
35
 
26
36
  ## Commands
27
37
 
@@ -36,7 +46,7 @@ You can run and debug commands directly from terminal by running `ops [command]`
36
46
  - [`ops download:signalr <flags>`](#ops-downloadsignalr-flags)
37
47
  - [`ops download:studio <flags>`](#ops-downloadstudio-flags)
38
48
  - [`ops download:keycloak-scim <flags>`](#ops-downloadkeycloak-scim-flags)
39
- - [`ops download:jmeter-examples <flags>`](#ops-downloadstudio-flags)
49
+ - [`ops download:jmeter <flags>`](#ops-downloadstudio-flags)
40
50
  - [`ops gitlab:get-tag-pipeline`](#ops-gitlabget-tag-pipeline)
41
51
  - [`ops gitlab:next-nightly-tag`](#ops-gitlabnext-nightly-tag)
42
52
  - [`ops log <issue> -t <type> -c [component]`](#ops-log-issue-t-type-c-component)
@@ -222,19 +232,19 @@ EXAMPLES
222
232
  $ ops download:keycloak-scim -v 3.0.0
223
233
  ```
224
234
 
225
- ## `ops download:jmeter-examples <flags>`
235
+ ## `ops download:jmeter <flags>`
226
236
 
227
237
  Download the Jmeter examples zip
228
238
 
229
239
  ```txt
230
240
  USAGE
231
- $ ops download:jmeter-examples <flags>
241
+ $ ops download:jmeter <flags>
232
242
 
233
243
  OPTIONS
234
244
  -o, --output=output [default: ./] output directory.
235
245
 
236
246
  EXAMPLES
237
- $ ops download:jmeter-examples -o ~/Downloads
247
+ $ ops download:jmeter -o ~/Downloads
238
248
  ```
239
249
 
240
250
  ## `ops gitlab:get-tag-pipeline`
@@ -404,13 +414,16 @@ USAGE
404
414
  $ ops login
405
415
 
406
416
  OPTIONS
407
- --servicePrincipal # authenticate using service principal credentials.
408
- -c, --clientId # (application) client id.
409
- -s, --secret # client secret.
417
+ --deviceFlow authenticate using device flow
418
+ --force Force a change of login token
419
+ --npm register also for npm
420
+ --skipCI=<value> Skip login if environment variables is set
410
421
 
411
422
  EXAMPLES
412
423
  $ ops login
413
- $ ops login --servicePrincipal -c {client id} -s {secret}
424
+ $ ops login --npm
425
+ $ ops login --skipCi CI
426
+ $ ops login --deviceFlow
414
427
  ```
415
428
 
416
429
  ## `ops npm:check-publish`
@@ -18,4 +18,5 @@ export default abstract class CommandBase<T extends typeof Command> extends Comm
18
18
  * @returns {string[]} An array of files inside the directory with the specified filter
19
19
  */
20
20
  getFilesRecursive(dir: string, baseRelativePath: string, filter: RegExp): Promise<string[]>;
21
+ run(): Promise<any>;
21
22
  }
@@ -2,6 +2,8 @@ import { __awaiter } from "tslib";
2
2
  import { Command } from '@oclif/core';
3
3
  import fs from 'fs-extra';
4
4
  import path from 'path';
5
+ import chalk from 'chalk';
6
+ import axios from 'axios';
5
7
  import SecurityContext from './security/context.js';
6
8
  /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
7
9
  export default class CommandBase extends Command {
@@ -82,4 +84,13 @@ export default class CommandBase extends Command {
82
84
  return files;
83
85
  });
84
86
  }
87
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
+ run() {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ axios.interceptors.request.use(req => {
91
+ this.debug(`${chalk.bgCyan('DEBUG: ')} Request that was sent with your command:\n${JSON.stringify(req, null, 2)}`);
92
+ return req;
93
+ });
94
+ });
95
+ }
85
96
  }
@@ -5,7 +5,11 @@ import { parse as yamlParse, stringify as yamlStringify } from 'yaml';
5
5
  import CommandBase from '../../command.base.js';
6
6
  class DockerUpdateImageVersion extends CommandBase {
7
7
  run() {
8
+ const _super = Object.create(null, {
9
+ run: { get: () => super.run }
10
+ });
8
11
  return __awaiter(this, void 0, void 0, function* () {
12
+ _super.run.call(this);
9
13
  const { args, flags } = yield this.parse(DockerUpdateImageVersion);
10
14
  try {
11
15
  const parsedYaml = yamlParse(fs.readFileSync(flags['file-path'], 'utf8'));
@@ -263,7 +263,11 @@ class Doctor extends CommandBase {
263
263
  });
264
264
  }
265
265
  run() {
266
+ const _super = Object.create(null, {
267
+ run: { get: () => super.run }
268
+ });
266
269
  return __awaiter(this, void 0, void 0, function* () {
270
+ _super.run.call(this);
267
271
  const { flags } = yield this.parse(Doctor);
268
272
  yield this.gitCheck(flags.fix);
269
273
  yield this.nvmCheck();
@@ -29,7 +29,11 @@ class DownloadClient extends CommandBase {
29
29
  });
30
30
  }
31
31
  run() {
32
+ const _super = Object.create(null, {
33
+ run: { get: () => super.run }
34
+ });
32
35
  return __awaiter(this, void 0, void 0, function* () {
36
+ _super.run.call(this);
33
37
  const { flags } = yield this.parse(DownloadClient);
34
38
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
35
39
  const filename = `AdInsure-client-${flags.version}.zip`;
@@ -29,7 +29,11 @@ class DownloadIdentityServer extends CommandBase {
29
29
  });
30
30
  }
31
31
  run() {
32
+ const _super = Object.create(null, {
33
+ run: { get: () => super.run }
34
+ });
32
35
  return __awaiter(this, void 0, void 0, function* () {
36
+ _super.run.call(this);
33
37
  const { flags } = yield this.parse(DownloadIdentityServer);
34
38
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
35
39
  const filename = `AdInsure-identityServer-${flags.version}.zip`;
@@ -24,7 +24,11 @@ class DownloadJmeter extends CommandBase {
24
24
  });
25
25
  }
26
26
  run() {
27
+ const _super = Object.create(null, {
28
+ run: { get: () => super.run }
29
+ });
27
30
  return __awaiter(this, void 0, void 0, function* () {
31
+ _super.run.call(this);
28
32
  const { flags } = yield this.parse(DownloadJmeter);
29
33
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
30
34
  const filename = `jmeter-artifacts.zip`;
@@ -59,9 +63,9 @@ class DownloadJmeter extends CommandBase {
59
63
  }
60
64
  }
61
65
  DownloadJmeter.description = 'download jmeter examples from Azure storage';
62
- DownloadJmeter.usage = 'download:jmeter-examples <flags>';
66
+ DownloadJmeter.usage = 'download:jmeter <flags>';
63
67
  DownloadJmeter.examples = [
64
- `$ ops download:jmeter-examples -o ~/Downloads`,
68
+ `$ ops download:jmeter -o ~/Downloads`,
65
69
  ];
66
70
  DownloadJmeter.flags = {
67
71
  output: Flags.string({
@@ -24,7 +24,11 @@ class DownloadKeycloak extends CommandBase {
24
24
  });
25
25
  }
26
26
  run() {
27
+ const _super = Object.create(null, {
28
+ run: { get: () => super.run }
29
+ });
27
30
  return __awaiter(this, void 0, void 0, function* () {
31
+ _super.run.call(this);
28
32
  const { flags } = yield this.parse(DownloadKeycloak);
29
33
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
30
34
  const filename = `Keycloak-scim-${flags.version}.zip`;
@@ -29,7 +29,11 @@ class DownloadPlatform extends CommandBase {
29
29
  });
30
30
  }
31
31
  run() {
32
+ const _super = Object.create(null, {
33
+ run: { get: () => super.run }
34
+ });
32
35
  return __awaiter(this, void 0, void 0, function* () {
36
+ _super.run.call(this);
33
37
  const { flags } = yield this.parse(DownloadPlatform);
34
38
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
35
39
  const filename = `AdInsure-${flags.version}.zip`;
@@ -29,7 +29,11 @@ class DownloadScheduler extends CommandBase {
29
29
  });
30
30
  }
31
31
  run() {
32
+ const _super = Object.create(null, {
33
+ run: { get: () => super.run }
34
+ });
32
35
  return __awaiter(this, void 0, void 0, function* () {
36
+ _super.run.call(this);
33
37
  const { flags } = yield this.parse(DownloadScheduler);
34
38
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
35
39
  const filename = `AdInsureScheduler-${flags.version}.zip`;
@@ -29,7 +29,11 @@ class DownloadServer extends CommandBase {
29
29
  });
30
30
  }
31
31
  run() {
32
+ const _super = Object.create(null, {
33
+ run: { get: () => super.run }
34
+ });
32
35
  return __awaiter(this, void 0, void 0, function* () {
36
+ _super.run.call(this);
33
37
  const { flags } = yield this.parse(DownloadServer);
34
38
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
35
39
  const filename = `AdInsure-server-${flags.version}.zip`;
@@ -29,7 +29,11 @@ class DownloadSignalrServer extends CommandBase {
29
29
  });
30
30
  }
31
31
  run() {
32
+ const _super = Object.create(null, {
33
+ run: { get: () => super.run }
34
+ });
32
35
  return __awaiter(this, void 0, void 0, function* () {
36
+ _super.run.call(this);
33
37
  const { flags } = yield this.parse(DownloadSignalrServer);
34
38
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
35
39
  const filename = `AdInsure-signalr-${flags.version}.zip`;
@@ -47,7 +47,11 @@ class DownloadStudio extends CommandBase {
47
47
  });
48
48
  }
49
49
  run() {
50
+ const _super = Object.create(null, {
51
+ run: { get: () => super.run }
52
+ });
50
53
  return __awaiter(this, void 0, void 0, function* () {
54
+ _super.run.call(this);
51
55
  const { flags } = yield this.parse(DownloadStudio);
52
56
  // The os.homedir expands the ~ char, as the node path.resolve method does not expand it
53
57
  const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
@@ -83,7 +83,11 @@ class GitlabGetTagPipeline extends CommandBase {
83
83
  });
84
84
  }
85
85
  run() {
86
+ const _super = Object.create(null, {
87
+ run: { get: () => super.run }
88
+ });
86
89
  return __awaiter(this, void 0, void 0, function* () {
90
+ _super.run.call(this);
87
91
  const { args, flags } = yield this.parse(GitlabGetTagPipeline);
88
92
  const gitlab = new GitLab(flags.host, flags.project, flags.pat);
89
93
  if (!flags.wait) {
@@ -6,7 +6,11 @@ import CommandBase from '../../command.base.js';
6
6
  import GitLab from '../../lib/gitlab.js';
7
7
  class GitlabNextNightlyTag extends CommandBase {
8
8
  run() {
9
+ const _super = Object.create(null, {
10
+ run: { get: () => super.run }
11
+ });
9
12
  return __awaiter(this, void 0, void 0, function* () {
13
+ _super.run.call(this);
10
14
  const { args, flags } = yield this.parse(GitlabNextNightlyTag);
11
15
  const gitlab = new GitLab(flags.host, flags.project, flags.pat);
12
16
  const re = /^release\/(\w+-)?((\d+)(\.\d+)?)$/;
@@ -3,7 +3,11 @@ import { Args } from '@oclif/core';
3
3
  import CommandBaseJira from '../../command.base.jira.js';
4
4
  class JiraLabels extends CommandBaseJira {
5
5
  run() {
6
+ const _super = Object.create(null, {
7
+ run: { get: () => super.run }
8
+ });
6
9
  return __awaiter(this, void 0, void 0, function* () {
10
+ _super.run.call(this);
7
11
  const { args, flags } = yield this.parse(JiraLabels);
8
12
  const jira = yield this.jiraInit(flags.hostname, flags.username, flags.password);
9
13
  try {
@@ -27,7 +27,11 @@ class JiraLabels extends CommandBaseJira {
27
27
  });
28
28
  }
29
29
  run() {
30
+ const _super = Object.create(null, {
31
+ run: { get: () => super.run }
32
+ });
30
33
  return __awaiter(this, void 0, void 0, function* () {
34
+ _super.run.call(this);
31
35
  const { args, flags } = yield this.parse(JiraLabels);
32
36
  const jira = yield this.jiraInit(flags.hostname, flags.username, flags.password);
33
37
  if (flags.remove || flags.add) {
@@ -7,7 +7,11 @@ import path from 'path';
7
7
  import CommandBase from '../../command.base.js';
8
8
  class Changelog extends CommandBase {
9
9
  run() {
10
+ const _super = Object.create(null, {
11
+ run: { get: () => super.run }
12
+ });
10
13
  return __awaiter(this, void 0, void 0, function* () {
14
+ _super.run.call(this);
11
15
  const { args, flags } = yield this.parse(Changelog);
12
16
  // Validation of input parameters
13
17
  const changelogFolderBase = yield this.getChangelogsRoot();
@@ -76,8 +76,12 @@ class Generate extends CommandBase {
76
76
  });
77
77
  }
78
78
  run() {
79
+ const _super = Object.create(null, {
80
+ run: { get: () => super.run }
81
+ });
79
82
  var _a;
80
83
  return __awaiter(this, void 0, void 0, function* () {
84
+ _super.run.call(this);
81
85
  const { flags } = yield this.parse(Generate);
82
86
  const root = path.resolve(process.cwd());
83
87
  const changelogFolder = yield this.getChangelogsRoot();
@@ -30,7 +30,11 @@ class Validate extends CommandBase {
30
30
  });
31
31
  }
32
32
  run() {
33
+ const _super = Object.create(null, {
34
+ run: { get: () => super.run }
35
+ });
33
36
  return __awaiter(this, void 0, void 0, function* () {
37
+ _super.run.call(this);
34
38
  const directory = yield this.getChangelogsRoot();
35
39
  const files = yield this.getFilesRecursive(directory, directory, /\.md$/i);
36
40
  ux.action.start('validating changelogs', undefined, { stdout: true });
@@ -4,10 +4,7 @@ export default class Login extends CommandBase<typeof Login> {
4
4
  static usage: string;
5
5
  static examples: string[];
6
6
  static flags: {
7
- servicePrincipal: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
7
  deviceFlow: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
- clientId: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- secret: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
8
  npm: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
12
9
  skipCI: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
10
  force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
@@ -43,7 +43,11 @@ class Login extends CommandBase {
43
43
  });
44
44
  }
45
45
  run() {
46
+ const _super = Object.create(null, {
47
+ run: { get: () => super.run }
48
+ });
46
49
  return __awaiter(this, void 0, void 0, function* () {
50
+ _super.run.call(this);
47
51
  const { flags } = yield this.parse(Login);
48
52
  if (flags.force) {
49
53
  fs.unlink(path.resolve(this.security.getTokenPath()), () => {
@@ -75,9 +79,6 @@ class Login extends CommandBase {
75
79
  this.error(error);
76
80
  }
77
81
  }
78
- else if (flags.servicePrincipal || flags.clientId || flags.secret) {
79
- this.warn(`${chalk.red('[DEPRECATED] --servicePrincipal parameter is deprecated. To use with service principal, please set environment variables AZURE_CLIENT_ID and AZURE_CLIENT_SECRET! Login is not required!')}`);
80
- }
81
82
  else {
82
83
  this.log(`${chalk.yellow('Note: We have launched a browser for you to login.')}`);
83
84
  const loginUrl = yield this.security.getLoginUrl();
@@ -125,24 +126,10 @@ Login.examples = [
125
126
  `$ ops login --deviceFlow`,
126
127
  ];
127
128
  Login.flags = {
128
- servicePrincipal: Flags.boolean({
129
- description: 'authenticate using service principal credentials',
130
- default: false,
131
- }),
132
129
  deviceFlow: Flags.boolean({
133
130
  description: 'authenticate using device flow',
134
131
  default: false,
135
132
  }),
136
- clientId: Flags.string({
137
- char: 'c',
138
- env: 'AZURE_CLIENT_ID',
139
- description: '[DEPRECATED] (application) client id',
140
- }),
141
- secret: Flags.string({
142
- char: 's',
143
- env: 'AZURE_CLIENT_SECRET',
144
- description: '[DEPRECATED] client secret',
145
- }),
146
133
  npm: Flags.boolean({
147
134
  description: 'register also for npm',
148
135
  default: false,
@@ -29,7 +29,11 @@ class NpmCheckPublish extends CommandBase {
29
29
  });
30
30
  }
31
31
  run() {
32
+ const _super = Object.create(null, {
33
+ run: { get: () => super.run }
34
+ });
32
35
  return __awaiter(this, void 0, void 0, function* () {
36
+ _super.run.call(this);
33
37
  try {
34
38
  // eslint-disable-next-line unicorn/no-await-expression-member
35
39
  const { flags } = (yield this.parse(NpmCheckPublish)).flags;
@@ -69,7 +69,11 @@ class NpmDependencyUpdate extends CommandBase {
69
69
  });
70
70
  }
71
71
  run() {
72
+ const _super = Object.create(null, {
73
+ run: { get: () => super.run }
74
+ });
72
75
  return __awaiter(this, void 0, void 0, function* () {
76
+ _super.run.call(this);
73
77
  const { args, flags } = yield this.parse(NpmDependencyUpdate);
74
78
  const newVersion = semver.valid(args.version);
75
79
  const npmContext = new NpmContext();
@@ -138,7 +138,11 @@ class NpmPublish extends CommandBase {
138
138
  });
139
139
  }
140
140
  run() {
141
+ const _super = Object.create(null, {
142
+ run: { get: () => super.run }
143
+ });
141
144
  return __awaiter(this, void 0, void 0, function* () {
145
+ _super.run.call(this);
142
146
  try {
143
147
  const { flags } = yield this.parse(NpmPublish);
144
148
  const npmContext = new NpmContext();
@@ -1,5 +1,5 @@
1
- import { Command } from '@oclif/core';
2
- export default class NuGetDependencyUpdate extends Command {
1
+ import CommandBase from '../../command.base.js';
2
+ export default class NuGetDependencyUpdate extends CommandBase<typeof NuGetDependencyUpdate> {
3
3
  static description: string;
4
4
  static usage: string;
5
5
  static examples: string[];
@@ -1,10 +1,11 @@
1
1
  import { __awaiter } from "tslib";
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
3
  import chalk from 'chalk';
4
4
  import fs from 'fs-extra';
5
5
  import semver from 'semver';
6
6
  import NugetContext from '../../lib/nuget.js';
7
- class NuGetDependencyUpdate extends Command {
7
+ import CommandBase from '../../command.base.js';
8
+ class NuGetDependencyUpdate extends CommandBase {
8
9
  /**
9
10
  * Update dependencies in csproj files for @adinsure packages
10
11
  * @param
@@ -35,7 +36,11 @@ class NuGetDependencyUpdate extends Command {
35
36
  });
36
37
  }
37
38
  run() {
39
+ const _super = Object.create(null, {
40
+ run: { get: () => super.run }
41
+ });
38
42
  return __awaiter(this, void 0, void 0, function* () {
43
+ _super.run.call(this);
39
44
  const { args, flags } = yield this.parse(NuGetDependencyUpdate);
40
45
  const newVersion = semver.valid(args.version);
41
46
  const nugetContext = new NugetContext();
@@ -357,7 +357,11 @@ class PrepareContent extends CommandBase {
357
357
  }
358
358
  */
359
359
  run() {
360
+ const _super = Object.create(null, {
361
+ run: { get: () => super.run }
362
+ });
360
363
  return __awaiter(this, void 0, void 0, function* () {
364
+ _super.run.call(this);
361
365
  const { flags } = yield this.parse(PrepareContent);
362
366
  // read the flags and set paths relative to execution directory
363
367
  let source = path.relative(process.cwd(), flags.source);
@@ -145,8 +145,12 @@ end;`;
145
145
  }
146
146
  // eslint-disable-next-line complexity
147
147
  run() {
148
+ const _super = Object.create(null, {
149
+ run: { get: () => super.run }
150
+ });
148
151
  var _a, _b, _c;
149
152
  return __awaiter(this, void 0, void 0, function* () {
153
+ _super.run.call(this);
150
154
  const { args, flags } = yield this.parse(Sql);
151
155
  const fullVersion = (_a = flags.version) !== null && _a !== void 0 ? _a : yield this.getVersion('SQL_SCRIPTS_VERSION', 'PLATFORM_VERSION', 'VERSION');
152
156
  let version = semver.parse(fullVersion);
@@ -83,7 +83,11 @@ class Translate extends CommandBase {
83
83
  });
84
84
  }
85
85
  run() {
86
+ const _super = Object.create(null, {
87
+ run: { get: () => super.run }
88
+ });
86
89
  return __awaiter(this, void 0, void 0, function* () {
90
+ _super.run.call(this);
87
91
  const { args, flags } = yield this.parse(Translate);
88
92
  const destination = flags.output;
89
93
  if (flags.format === 'json' && flags.module === undefined) {
@@ -75,15 +75,15 @@ class Version extends CommandBase {
75
75
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
76
  validateOptions(args, flags) {
77
77
  if (args.type !== 'new' && flags.version) {
78
- this.error(`${chalk.red('Version flag can only be used with new type')}`);
78
+ this.error(`${chalk.red('Version flag can only be used with new type')}`, { exit: 2 });
79
79
  return false;
80
80
  }
81
81
  if (args.type === 'new' && !flags.version) {
82
- this.error(`${chalk.red('Version flag is required with new type')}`);
82
+ this.error(`${chalk.red('Version flag is required with new type')}`, { exit: 2 });
83
83
  return false;
84
84
  }
85
85
  if (args.type === 'new' && flags.increment) {
86
- this.error(`${chalk.red('Increment flag not supported with new type')}`);
86
+ this.error(`${chalk.red('Increment flag not supported with new type')}`, { exit: 2 });
87
87
  return false;
88
88
  }
89
89
  return true;
@@ -113,15 +113,11 @@ class Version extends CommandBase {
113
113
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
114
  insertScriptRequest(token, version, prefix) {
115
115
  return __awaiter(this, void 0, void 0, function* () {
116
- return axios.post(`https://ops.adinsure.com/api/script`, {
116
+ return axios.post(`https://ops.adinsure.com/api/script`, { version, prefix }, {
117
117
  headers: {
118
118
  Authorization: 'Bearer ' + token,
119
119
  'Content-Type': 'application/json',
120
120
  },
121
- params: {
122
- version,
123
- prefix,
124
- },
125
121
  });
126
122
  });
127
123
  }
@@ -132,12 +128,9 @@ class Version extends CommandBase {
132
128
  ux.action.stop(`${chalk.blue('skip')}`);
133
129
  }
134
130
  else if (token) {
135
- try {
136
- yield this.insertScriptRequest(token, version, prefix);
137
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
138
- }
139
- catch (error) {
140
- switch (error.statusCode) {
131
+ yield this.insertScriptRequest(token, version, prefix)
132
+ .catch((error) => {
133
+ switch (error.response.status) {
141
134
  case 401: {
142
135
  this.error(`${chalk.red('You don\'t have permissions. If this was intentional command, please contact Operations for permissions, do git reset and rerun command.')}`);
143
136
  break;
@@ -146,7 +139,7 @@ class Version extends CommandBase {
146
139
  this.error(`${chalk.red(error)}`);
147
140
  }
148
141
  }
149
- }
142
+ });
150
143
  ux.action.stop(`${chalk.green('done')}`);
151
144
  }
152
145
  else {
@@ -185,7 +178,11 @@ class Version extends CommandBase {
185
178
  });
186
179
  }
187
180
  run() {
181
+ const _super = Object.create(null, {
182
+ run: { get: () => super.run }
183
+ });
188
184
  return __awaiter(this, void 0, void 0, function* () {
185
+ _super.run.call(this);
189
186
  const { args, flags } = yield this.parse(Version);
190
187
  const currentPrereleaseDate = moment().format('YYYYMM');
191
188
  // Check if token is correct and save it for later use
@@ -17,7 +17,6 @@ export default class SecurityContext {
17
17
  this.devopsResourceId = '499b84ac-1321-427f-aa17-267ca6975798';
18
18
  this.tenant = 'adfintech.onmicrosoft.com';
19
19
  this.authorityUrl = `https://login.microsoftonline.com/${this.tenant}/`;
20
- // tslint:disable-next-line: no-http-string
21
20
  this.redirectUri = 'http://localhost:3044';
22
21
  this.resource = 'https://ops.adinsure.com';
23
22
  this._verifier = null;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.0.3",
2
+ "version": "5.0.5",
3
3
  "commands": {
4
4
  "doctor": {
5
5
  "id": "doctor",
@@ -40,32 +40,12 @@
40
40
  "$ ops login --deviceFlow"
41
41
  ],
42
42
  "flags": {
43
- "servicePrincipal": {
44
- "name": "servicePrincipal",
45
- "type": "boolean",
46
- "description": "authenticate using service principal credentials",
47
- "allowNo": false
48
- },
49
43
  "deviceFlow": {
50
44
  "name": "deviceFlow",
51
45
  "type": "boolean",
52
46
  "description": "authenticate using device flow",
53
47
  "allowNo": false
54
48
  },
55
- "clientId": {
56
- "name": "clientId",
57
- "type": "option",
58
- "char": "c",
59
- "description": "[DEPRECATED] (application) client id",
60
- "multiple": false
61
- },
62
- "secret": {
63
- "name": "secret",
64
- "type": "option",
65
- "char": "s",
66
- "description": "[DEPRECATED] client secret",
67
- "multiple": false
68
- },
69
49
  "npm": {
70
50
  "name": "npm",
71
51
  "type": "boolean",
@@ -477,13 +457,13 @@
477
457
  "id": "download:jmeter",
478
458
  "description": "download jmeter examples from Azure storage",
479
459
  "strict": true,
480
- "usage": "download:jmeter-examples <flags>",
460
+ "usage": "download:jmeter <flags>",
481
461
  "pluginName": "@adinsure-ops/ops-cli",
482
462
  "pluginAlias": "@adinsure-ops/ops-cli",
483
463
  "pluginType": "core",
484
464
  "aliases": [],
485
465
  "examples": [
486
- "$ ops download:jmeter-examples -o ~/Downloads"
466
+ "$ ops download:jmeter -o ~/Downloads"
487
467
  ],
488
468
  "flags": {
489
469
  "output": {
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@adinsure-ops/ops-cli",
3
3
  "description": "Operations CLI for working with AdInsure",
4
- "version": "5.0.3",
4
+ "version": "5.0.5",
5
5
  "author": "Adacta Digital Service Department",
6
6
  "bin": {
7
7
  "ops": "./bin/run.js"
8
8
  },
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@azure/msal-node": "^1.14.5",
11
+ "@azure/msal-node": "^2.1.0",
12
12
  "@oclif/core": "^2.11.8",
13
13
  "@oclif/plugin-help": "^5.2.17",
14
14
  "@oclif/plugin-not-found": "^2.3.37",
@@ -74,7 +74,7 @@
74
74
  "@types/node": "^20.5.7"
75
75
  },
76
76
  "engines": {
77
- "node": "^16 || ^18 || ^20"
77
+ "node": "^18 || ^20"
78
78
  },
79
79
  "files": [
80
80
  "/bin",