@adinsure-ops/ops-cli 5.0.1 → 5.0.2

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/CHANGELOGS.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelogs
2
2
 
3
+ ## 5.0.2: 2023-09-14
4
+
5
+ - Fixed download commands and their output flag
6
+ - Fixed translate command to have correct url in the get request
7
+
3
8
  ## 5.0.1: 2023-09-12
4
9
 
5
10
  - Updated ops-cli to the stable version 5.x
package/README.md CHANGED
@@ -64,7 +64,7 @@ ARGUMENTS
64
64
  COMMAND command to show help for
65
65
 
66
66
  OPTIONS
67
- --all see all commands in CLI
67
+ --all see all commands in CLI.
68
68
  ```
69
69
 
70
70
  _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.0/src/commands/help.ts)_
@@ -78,7 +78,7 @@ USAGE
78
78
  $ ops doctor
79
79
 
80
80
  OPTIONS
81
- -p, --fix try to install missing packages
81
+ -p, --fix try to install missing packages.
82
82
 
83
83
  EXAMPLE
84
84
  $ ops doctor
@@ -93,8 +93,8 @@ USAGE
93
93
  $ ops download:client <flags>
94
94
 
95
95
  OPTIONS
96
- -o, --output=output [default: ./] output directory
97
- -v, --version=version (required) version we want to download
96
+ -o, --output=output [default: ./] output directory.
97
+ -v, --version=version (required) version we want to download.
98
98
 
99
99
  EXAMPLE
100
100
  $ ops download:client -v 3.2.0 -o ~/Downloads
@@ -109,8 +109,8 @@ USAGE
109
109
  $ ops download:identity-server <flags>
110
110
 
111
111
  OPTIONS
112
- -o, --output=output [default: ./] output directory
113
- -v, --version=version (required) version we want to download
112
+ -o, --output=output [default: ./] output directory.
113
+ -v, --version=version (required) version we want to download.
114
114
 
115
115
  EXAMPLE
116
116
  $ ops download:identity-server -v 3.0.3 -o ~/Downloads
@@ -125,8 +125,8 @@ USAGE
125
125
  $ ops download <flags>
126
126
 
127
127
  OPTIONS
128
- -o, --output=output [default: ./] output directory
129
- -v, --version=version (required) version we want to download
128
+ -o, --output=output [default: ./] output directory.
129
+ -v, --version=version (required) version we want to download.
130
130
 
131
131
  ALIASES
132
132
  $ ops download
@@ -144,8 +144,8 @@ USAGE
144
144
  $ ops download:scheduler <flags>
145
145
 
146
146
  OPTIONS
147
- -o, --output=output [default: ./] output directory
148
- -v, --version=version (required) version we want to download
147
+ -o, --output=output [default: ./] output directory.
148
+ -v, --version=version (required) version we want to download.
149
149
 
150
150
  EXAMPLE
151
151
  $ ops download:scheduler -v 3.2.0 -o ~/Downloads
@@ -160,8 +160,8 @@ USAGE
160
160
  $ ops download:server <flags>
161
161
 
162
162
  OPTIONS
163
- -o, --output=output [default: ./] output directory
164
- -v, --version=version (required) version we want to download
163
+ -o, --output=output [default: ./] output directory.
164
+ -v, --version=version (required) version we want to download.
165
165
 
166
166
  EXAMPLE
167
167
  $ ops download:server -v 3.2.0 -o ~/Downloads
@@ -176,8 +176,8 @@ USAGE
176
176
  $ ops download:signalr <flags>
177
177
 
178
178
  OPTIONS
179
- -o, --output=output [default: ./] output directory
180
- -v, --version=version (required) version we want to download
179
+ -o, --output=output [default: ./] output directory.
180
+ -v, --version=version (required) version we want to download.
181
181
 
182
182
  EXAMPLE
183
183
  $ ops download:signalr -v 18.0.0 -o ~/Downloads
@@ -192,11 +192,12 @@ USAGE
192
192
  $ ops download:studio <flags>
193
193
 
194
194
  OPTIONS
195
- -k, --keep only with install. If passed, it will not remove the vsix file
195
+ -k, --keep only with install. If passed, it will not remove the vsix file.
196
196
  -i, --install install plugin to vscode. save to temp folder and remove vsix after.
197
- -o, --output=output [default: ./] output directory
197
+ -o, --output=output [default: ./] output directory.
198
198
  -s, --skip only with install. If passed, and desired version is installed it will skip it.
199
- -v, --version=version (required) version we want to download
199
+ -v, --version=version (required) version we want to download.
200
+ -f, --force Create output directory if it does not exist. By default this is false and it depends on the output switch.
200
201
 
201
202
  EXAMPLES
202
203
  $ ops download:studio -v 15.0.0 -o ~/Downloads
@@ -213,8 +214,8 @@ USAGE
213
214
  $ ops download:keycloak-scim <flags>
214
215
 
215
216
  OPTIONS
216
- -o, --output=output [default: ./] output directory
217
- -v, --version=version (required) version we want to download
217
+ -o, --output=output [default: ./] output directory.
218
+ -v, --version=version (required) version we want to download.
218
219
 
219
220
  EXAMPLES
220
221
  $ ops download:keycloak-scim -v 3.2.0 -o ~/Downloads
@@ -230,7 +231,7 @@ USAGE
230
231
  $ ops download:jmeter-examples <flags>
231
232
 
232
233
  OPTIONS
233
- -o, --output=output [default: ./] output directory
234
+ -o, --output=output [default: ./] output directory.
234
235
 
235
236
  EXAMPLES
236
237
  $ ops download:jmeter-examples -o ~/Downloads
@@ -248,12 +249,12 @@ ARGUMENTS
248
249
  TAG Tag
249
250
 
250
251
  OPTIONS
251
- --delay=delay [default: 5] Delay of check in seconds (defaults to 5 seconds)
252
- --host=host (required) [default: https://git.adacta-fintech.com] Server hostname
253
- --pat=pat (required) Token from user that has permissions to list and create tags
254
- --project=project (required) [default: 413] Project ID
255
- --timeout=timeout [default: 120] Timeout for wait command in seconds (defaults to 120 seconds)
256
- --wait Wait for pipeline to finish
252
+ --delay=delay [default: 5] Delay of check in seconds (defaults to 5 seconds).
253
+ --host=host (required) [default: https://git.adacta-fintech.com] Server hostname.
254
+ --pat=pat (required) Token from user that has permissions to list and create tags.
255
+ --project=project (required) [default: 413] Project ID.
256
+ --timeout=timeout [default: 120] Timeout for wait command in seconds (defaults to 120 seconds).
257
+ --wait Wait for pipeline to finish.
257
258
  ```
258
259
 
259
260
  ## `ops gitlab:next-nightly-tag`
@@ -268,11 +269,11 @@ ARGUMENTS
268
269
  VERSION Tag version
269
270
 
270
271
  OPTIONS
271
- --dryRun Only printout version and don't create it
272
- --host=host (required) [default: https://git.adacta-fintech.com] Server hostname
273
- --pat=pat (required) Token from user that has permissions to list and create tags
274
- --project=project (required) [default: 413] Project ID
275
- --reference=reference (required) Reference to create tag on (branch, commit, tag)
272
+ --dryRun Only printout version and don't create it.
273
+ --host=host (required) [default: https://git.adacta-fintech.com] Server hostname.
274
+ --pat=pat (required) Token from user that has permissions to list and create tags.
275
+ --project=project (required) [default: 413] Project ID.
276
+ --reference=reference (required) Reference to create tag on (branch, commit, tag).
276
277
  ```
277
278
 
278
279
  ## `ops jira:issue <issue>`
@@ -287,9 +288,9 @@ ARGUMENTS
287
288
  ISSUE Jira issue number
288
289
 
289
290
  OPTIONS
290
- --hostname=hostname [default: https://jira.adacta-fintech.com] jira hostname
291
- --password=password (required) jira password
292
- --username=username (required) jira username
291
+ --hostname=hostname [default: https://jira.adacta-fintech.com] jira hostname.
292
+ --password=password (required) jira password.
293
+ --username=username (required) jira username.
293
294
 
294
295
  EXAMPLE
295
296
  $ ops jira:issue LJADIRD-1337
@@ -307,11 +308,11 @@ ARGUMENTS
307
308
  ISSUE Jira issue number
308
309
 
309
310
  OPTIONS
310
- -a, --add=add add label
311
- -r, --remove=remove remove label
312
- --hostname=hostname [default: https://jira.adacta-fintech.com] jira hostname
313
- --password=password (required) jira password
314
- --username=username (required) jira username
311
+ -a, --add=add add label.
312
+ -r, --remove=remove remove label.
313
+ --hostname=hostname [default: https://jira.adacta-fintech.com] jira hostname.
314
+ --password=password (required) jira password.
315
+ --username=username (required) jira username.
315
316
 
316
317
  EXAMPLE
317
318
  $ ops jira:labels LJADIRD-1337
@@ -326,15 +327,16 @@ USAGE
326
327
  $ ops log <issue> -t <type> -c [component]
327
328
 
328
329
  ARGUMENTS
329
- ISSUE Jira issue number
330
- TYPE (feature|fixed|improve|breaking) Change type
331
- COMPONENT (Configuration|DevOps|Implementation|Platform) Component for which new changelog should be generated
330
+ ISSUE Jira issue number.
331
+ TYPE (feature|fixed|improve|breaking) Change type.
332
+ COMPONENT (Configuration|DevOps|Implementation|Platform) Component for which new changelog should be generated.
332
333
 
333
334
 
334
335
  OPTIONS
335
- -c, --component=component Component for which new changelog should be generated
336
- -t, --type=feature|fixed|improve|breaking (required) type of changelog
337
- -d, --description=description Description of a changelog
336
+ -c, --component=component Component for which new changelog should be generated.
337
+ -t, --type=feature|fixed|improve|breaking (required) type of changelog.
338
+ -d, --description=description Description of a changelog.
339
+ -f, --force Create logs directory if it does not exist.
338
340
 
339
341
  ALIASES
340
342
  $ ops log
@@ -358,12 +360,12 @@ USAGE
358
360
  $ ops log:gen [options]
359
361
 
360
362
  OPTIONS
361
- -c, --components=components components separated by comma (,) to process for final changelog
362
- -f, --file=file [default: CHANGELOG.md] file to update with new changelogs
363
- -p, --preview generates a preview markdown of current unreleased changelogs
364
- -v, --version=version version for which you're generating changelogs
365
- --force update target file without prompting for confirmation
366
- --ignore-no-changelogs generate final changelog even if no unreleased changelogs exist
363
+ -c, --components=components components separated by comma (,) to process for final changelog.
364
+ -f, --file=file [default: CHANGELOG.md] file to update with new changelogs.
365
+ -p, --preview generates a preview markdown of current unreleased changelogs.
366
+ -v, --version=version version for which you're generating changelogs.
367
+ --force update target file without prompting for confirmation.
368
+ --ignore-no-changelogs generate final changelog even if no unreleased changelogs exist.
367
369
 
368
370
  ALIASES
369
371
  $ ops log:gen
@@ -402,9 +404,9 @@ USAGE
402
404
  $ ops login
403
405
 
404
406
  OPTIONS
405
- --servicePrincipal # authenticate using service principal credentials
406
- -c, --clientId # (application) client id
407
- -s, --secret # client secret
407
+ --servicePrincipal # authenticate using service principal credentials.
408
+ -c, --clientId # (application) client id.
409
+ -s, --secret # client secret.
408
410
 
409
411
  EXAMPLES
410
412
  $ ops login
@@ -420,10 +422,10 @@ USAGE
420
422
  $ ops npm:check-publish [options]
421
423
 
422
424
  OPTIONS
423
- -p, --package=package package name filter you want to check
424
- -v, --version=version (required) version we want to check if published
425
- -x, --exclude=exclude exclude packages from filter
426
- --pat=pat PAT token or AZURE_DEVOPS_EXT_PAT environment variable
425
+ -p, --package=package package name filter you want to check.
426
+ -v, --version=version (required) version we want to check if published.
427
+ -x, --exclude=exclude exclude packages from filter.
428
+ --pat=pat PAT token or AZURE_DEVOPS_EXT_PAT environment variable.
427
429
 
428
430
  EXAMPLES
429
431
  $ ops npm:check-publish -v 6.0.1
@@ -440,10 +442,10 @@ USAGE
440
442
  $ ops npm:publish [options]
441
443
 
442
444
  OPTIONS
443
- -p, --package=package package name filter you want to check
444
- -v, --version=version (required) version we want to check if published
445
- -x, --exclude=exclude exclude packages from filter
446
- --pat=pat PAT token or AZURE_DEVOPS_EXT_PAT environment variable
445
+ -p, --package=package package name filter you want to check.
446
+ -v, --version=version (required) version we want to check if published.
447
+ -x, --exclude=exclude exclude packages from filter.
448
+ --pat=pat PAT token or AZURE_DEVOPS_EXT_PAT environment variable.
447
449
 
448
450
  EXAMPLES
449
451
  $ ops npm:publish -v 15.0.0
@@ -464,8 +466,8 @@ ARGUMENTS
464
466
  VERSION Type of release
465
467
 
466
468
  OPTIONS
467
- --exclude=exclude exclude directories where to search for package.json
468
- --filter=filter (required) regular expression for which NPM packages to update
469
+ --exclude=exclude exclude directories where to search for package.json.
470
+ --filter=filter (required) regular expression for which NPM packages to update.
469
471
 
470
472
  EXAMPLE
471
473
  $ ops npm:dependency-update 3.4.3 --filter @adinsure/*
@@ -483,8 +485,8 @@ ARGUMENTS
483
485
  VERSION Type of release
484
486
 
485
487
  OPTIONS
486
- --exclude=exclude exclude directories where to search for csproj files
487
- --filter=filter (required) regular expression for which NuGet packages to update
488
+ --exclude=exclude exclude directories where to search for csproj files.
489
+ --filter=filter (required) regular expression for which NuGet packages to update.
488
490
 
489
491
  EXAMPLE
490
492
  $ ops nuget:dependency-update 3.4.3 --filter Adacta.AdInsure --exclude Scheduler
@@ -502,13 +504,13 @@ ARGUMENTS
502
504
  TYPE (patch|minor|major|prerelease|preminor|premajor|new) Type of release
503
505
 
504
506
  OPTIONS
505
- -i, --independent increment npm packages independent of VERSION file
506
- -v, --version=version force version
507
- --no-deps skip dependency update
508
- --no-script skip creation of script
509
- --only-npm-packages=only-npm-packages [default: .*] regular expression for which NPM packages to include
507
+ -i, --independent increment npm packages independent of VERSION file.
508
+ -v, --version=version force version.
509
+ --no-deps skip dependency update.
510
+ --no-script skip creation of script.
511
+ --only-npm-packages=only-npm-packages [default: .*] regular expression for which NPM packages to include.
510
512
  --script-prefix=script-prefix [default: 7.10] prefix for db script version creation.
511
- --exclude-dir exclude directories where to search for package.json
513
+ --exclude-dir exclude directories where to search for package.json.
512
514
 
513
515
  EXAMPLES
514
516
  $ ops version minor
@@ -559,8 +561,8 @@ USAGE
559
561
 
560
562
 
561
563
  OPTIONS
562
- -d, --destination=destination path to target directory
563
- -s, --source=source optional path to source directory containing .opsprepare file, (default: current directory)
564
+ -d, --destination=destination path to target directory.
565
+ -s, --source=source optional path to source directory containing .opsprepare file, (default: current directory).
564
566
 
565
567
  EXAMPLES
566
568
  $ ops prepare-content -d ./target_directory/
@@ -769,11 +771,11 @@ ARGUMENTS
769
771
  MODULE (acc|claims|core|pas|reins|shared) Module of data database scripts
770
772
 
771
773
  OPTIONS
772
- -d, --description=description description of script to be used in filename for offline
773
- -l, --layer=layer name of the configuration layer for which you are generating database script
774
- -m, --major generate script for major version
775
- -o, --offline generate database script with timestamp
776
- -v, --version=version version for which you're generating database script
774
+ -d, --description=description description of script to be used in filename for offline.
775
+ -l, --layer=layer name of the configuration layer for which you are generating database script.
776
+ -m, --major generate script for major version.
777
+ -o, --offline generate database script with timestamp.
778
+ -v, --version=version version for which you're generating database script.
777
779
 
778
780
  Extend type options for extending DBs:
779
781
  --table-schema table schema name
@@ -803,7 +805,7 @@ ARGUMENTS
803
805
  LANGUAGE language id you want to download. Values must be semi-colon (;) separated.
804
806
 
805
807
  OPTIONS
806
- -f, --format=json|xml (required) translations format [xml - server translations, json - client translations]
808
+ -f, --format=json|xml (required) translations format [xml - server translations, json - client translations].
807
809
  -m, --module=module module name you want to download. Values must be semi-colon (;) separated.
808
810
  -o, --output=output [default: .] absolute or relative destination path to a folder where translations are extracted.
809
811
  --filename=filename specify filename of output (XML only).
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  class DownloadClient extends CommandBase {
9
10
  constructor() {
@@ -23,13 +24,14 @@ class DownloadClient extends CommandBase {
23
24
  Authorization: 'Bearer ' + (yield this.security.getToken()),
24
25
  'Content-Type': 'application/octet-stream',
25
26
  },
27
+ responseType: 'arraybuffer',
26
28
  });
27
29
  });
28
30
  }
29
31
  run() {
30
32
  return __awaiter(this, void 0, void 0, function* () {
31
33
  const { flags } = yield this.parse(DownloadClient);
32
- const basePath = flags.output;
34
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
33
35
  const filename = `AdInsure-client-${flags.version}.zip`;
34
36
  const filePath = path.resolve(basePath, filename);
35
37
  ux.action.start(`Downloading AdInsure Client version ${flags.version} to ${filePath}`, undefined, { stdout: true });
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  class DownloadIdentityServer extends CommandBase {
9
10
  constructor() {
@@ -23,13 +24,14 @@ class DownloadIdentityServer extends CommandBase {
23
24
  Authorization: 'Bearer ' + (yield this.security.getToken()),
24
25
  'Content-Type': 'application/octet-stream',
25
26
  },
27
+ responseType: 'arraybuffer',
26
28
  });
27
29
  });
28
30
  }
29
31
  run() {
30
32
  return __awaiter(this, void 0, void 0, function* () {
31
33
  const { flags } = yield this.parse(DownloadIdentityServer);
32
- const basePath = flags.output;
34
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
33
35
  const filename = `AdInsure-identityServer-${flags.version}.zip`;
34
36
  const filePath = path.resolve(basePath, filename);
35
37
  ux.action.start(`Downloading AdInsure Identity Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  class DownloadJmeter extends CommandBase {
9
10
  constructor() {
@@ -18,13 +19,14 @@ class DownloadJmeter extends CommandBase {
18
19
  Authorization: 'Bearer ' + (yield this.security.getToken()),
19
20
  'Content-Type': 'application/octet-stream',
20
21
  },
22
+ responseType: 'arraybuffer',
21
23
  });
22
24
  });
23
25
  }
24
26
  run() {
25
27
  return __awaiter(this, void 0, void 0, function* () {
26
28
  const { flags } = yield this.parse(DownloadJmeter);
27
- const basePath = flags.output;
29
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
28
30
  const filename = `jmeter-artifacts.zip`;
29
31
  const filePath = path.resolve(basePath, filename);
30
32
  ux.action.start(`Downloading jmeter examples to ${filePath}`, undefined, { stdout: true });
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  class DownloadKeycloak extends CommandBase {
9
10
  constructor() {
@@ -18,13 +19,14 @@ class DownloadKeycloak extends CommandBase {
18
19
  Authorization: 'Bearer ' + (yield this.security.getToken()),
19
20
  'Content-Type': 'application/octet-stream',
20
21
  },
22
+ responseType: 'arraybuffer',
21
23
  });
22
24
  });
23
25
  }
24
26
  run() {
25
27
  return __awaiter(this, void 0, void 0, function* () {
26
28
  const { flags } = yield this.parse(DownloadKeycloak);
27
- const basePath = flags.output;
29
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
28
30
  const filename = `Keycloak-scim-${flags.version}.zip`;
29
31
  const filePath = path.resolve(basePath, filename);
30
32
  ux.action.start(`Downloading Keycloack version ${flags.version} to ${filePath}`, undefined, { stdout: true });
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  class DownloadPlatform extends CommandBase {
9
10
  constructor() {
@@ -23,13 +24,14 @@ class DownloadPlatform extends CommandBase {
23
24
  Authorization: 'Bearer ' + (yield this.security.getToken()),
24
25
  'Content-Type': 'application/octet-stream',
25
26
  },
27
+ responseType: 'arraybuffer',
26
28
  });
27
29
  });
28
30
  }
29
31
  run() {
30
32
  return __awaiter(this, void 0, void 0, function* () {
31
33
  const { flags } = yield this.parse(DownloadPlatform);
32
- const basePath = flags.output;
34
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
33
35
  const filename = `AdInsure-${flags.version}.zip`;
34
36
  const filePath = path.resolve(basePath, filename);
35
37
  ux.action.start(`Downloading AdInsure Platform version ${flags.version} to ${filePath}`, undefined, { stdout: true });
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  class DownloadScheduler extends CommandBase {
9
10
  constructor() {
@@ -23,13 +24,14 @@ class DownloadScheduler extends CommandBase {
23
24
  Authorization: 'Bearer ' + (yield this.security.getToken()),
24
25
  'Content-Type': 'application/octet-stream',
25
26
  },
27
+ responseType: 'arraybuffer',
26
28
  });
27
29
  });
28
30
  }
29
31
  run() {
30
32
  return __awaiter(this, void 0, void 0, function* () {
31
33
  const { flags } = yield this.parse(DownloadScheduler);
32
- const basePath = flags.output;
34
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
33
35
  const filename = `AdInsureScheduler-${flags.version}.zip`;
34
36
  const filePath = path.resolve(basePath, filename);
35
37
  ux.action.start(`Downloading AdInsure Scheduler version ${flags.version} to ${filePath}`, undefined, { stdout: true });
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  class DownloadServer extends CommandBase {
9
10
  constructor() {
@@ -23,13 +24,14 @@ class DownloadServer extends CommandBase {
23
24
  Authorization: 'Bearer ' + (yield this.security.getToken()),
24
25
  'Content-Type': 'application/octet-stream',
25
26
  },
27
+ responseType: 'arraybuffer',
26
28
  });
27
29
  });
28
30
  }
29
31
  run() {
30
32
  return __awaiter(this, void 0, void 0, function* () {
31
33
  const { flags } = yield this.parse(DownloadServer);
32
- const basePath = flags.output;
34
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
33
35
  const filename = `AdInsure-server-${flags.version}.zip`;
34
36
  const filePath = path.resolve(basePath, filename);
35
37
  ux.action.start(`Downloading AdInsure Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  class DownloadSignalrServer extends CommandBase {
9
10
  constructor() {
@@ -23,13 +24,14 @@ class DownloadSignalrServer extends CommandBase {
23
24
  Authorization: 'Bearer ' + (yield this.security.getToken()),
24
25
  'Content-Type': 'application/octet-stream',
25
26
  },
27
+ responseType: 'arraybuffer',
26
28
  });
27
29
  });
28
30
  }
29
31
  run() {
30
32
  return __awaiter(this, void 0, void 0, function* () {
31
33
  const { flags } = yield this.parse(DownloadSignalrServer);
32
- const basePath = flags.output;
34
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
33
35
  const filename = `AdInsure-signalr-${flags.version}.zip`;
34
36
  const filePath = path.resolve(basePath, filename);
35
37
  ux.action.start(`Downloading AdInsure SignalR Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
@@ -4,6 +4,7 @@ import axios from 'axios';
4
4
  import chalk from 'chalk';
5
5
  import fs from 'fs-extra';
6
6
  import path from 'path';
7
+ import os from 'os';
7
8
  import CommandBase from '../../command.base.js';
8
9
  import ChildProcessCommand from '../../lib/command.js';
9
10
  class DownloadStudio extends CommandBase {
@@ -24,6 +25,7 @@ class DownloadStudio extends CommandBase {
24
25
  Authorization: 'Bearer ' + (yield this.security.getToken()),
25
26
  'Content-Type': 'application/octet-stream',
26
27
  },
28
+ responseType: 'arraybuffer',
27
29
  });
28
30
  });
29
31
  }
@@ -47,13 +49,18 @@ class DownloadStudio extends CommandBase {
47
49
  run() {
48
50
  return __awaiter(this, void 0, void 0, function* () {
49
51
  const { flags } = yield this.parse(DownloadStudio);
50
- const basePath = flags.output;
52
+ // The os.homedir expands the ~ char, as the node path.resolve method does not expand it
53
+ const basePath = flags.output.charAt(0) === '~' ? os.homedir() + flags.output.split('~')[1] : flags.output;
51
54
  if (flags.force && !(yield fs.pathExists(basePath))) {
52
55
  yield fs.mkdirp(basePath);
53
56
  }
57
+ if (!(yield fs.pathExists(basePath))) {
58
+ this.error(`${chalk.red('The output directory in which you want to download the studio does not exist!')}${chalk.yellow('\nYou can force to create it with the -f flag.')}`, { exit: 1 });
59
+ }
54
60
  const filename = `adinsure-studio-${flags.version}.vsix`;
55
61
  const studioVersion = `adacta-fintech.adinsure-studio@${flags.version}`;
56
62
  const filePath = path.resolve(basePath, filename);
63
+ console.log(filePath);
57
64
  const skipInstallation = yield this.findExtensionIfEnabled(studioVersion, flags.skip);
58
65
  if (skipInstallation) {
59
66
  this.log(`The ${studioVersion} already exists. Skipping install.`);
@@ -31,12 +31,11 @@ class Translate extends CommandBase {
31
31
  Authorization: 'Bearer ' + (yield this.security.getToken()),
32
32
  'Content-Type': this.getFormat(format),
33
33
  },
34
+ responseType: 'arraybuffer',
35
+ params: Object.assign({ languages: languages }, (modules && { modules: modules })),
34
36
  };
35
- if (modules) {
36
- requestOptions.url += `&modules=${modules}`;
37
- }
38
37
  try {
39
- return (yield axios.get(`https://dictionary.adinsure.com/api/Translations?languages=${languages}`, requestOptions));
38
+ return (yield axios.get(`https://dictionary.adinsure.com/api/Translations`, requestOptions));
40
39
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
40
  }
42
41
  catch (error) {
@@ -88,7 +87,7 @@ class Translate extends CommandBase {
88
87
  const { args, flags } = yield this.parse(Translate);
89
88
  const destination = flags.output;
90
89
  if (flags.format === 'json' && flags.module === undefined) {
91
- this.error('You need to specify `\'module\' when choosing client `\'json\' format.');
90
+ this.error(`${chalk.red('You need to specify `\'module\' when choosing client `\'json\' format.')}`);
92
91
  }
93
92
  try {
94
93
  // Get translations
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.0.1",
2
+ "version": "5.0.2",
3
3
  "commands": {
4
4
  "doctor": {
5
5
  "id": "doctor",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adinsure-ops/ops-cli",
3
3
  "description": "Operations CLI for working with AdInsure",
4
- "version": "5.0.1",
4
+ "version": "5.0.2",
5
5
  "author": "Adacta Digital Service Department",
6
6
  "bin": {
7
7
  "ops": "./bin/run.js"