@adinsure-ops/ops-cli 4.8.3 → 5.0.0-rc4
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 +52 -36
- package/LICENSE +1 -1
- package/README.md +32 -242
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.cmd +1 -1
- package/bin/run.js +8 -0
- package/lib/command.base.d.ts +9 -5
- package/lib/command.base.jira.d.ts +7 -8
- package/lib/command.base.jira.js +26 -24
- package/lib/command.base.js +69 -57
- package/lib/commands/docker/update-image-version.d.ts +6 -9
- package/lib/commands/docker/update-image-version.js +35 -34
- package/lib/commands/doctor.d.ts +15 -5
- package/lib/commands/doctor.js +219 -186
- package/lib/commands/download/client.d.ts +10 -7
- package/lib/commands/download/client.js +60 -52
- package/lib/commands/download/identity-server.d.ts +9 -7
- package/lib/commands/download/identity-server.js +59 -53
- package/lib/commands/download/jmeter.d.ts +5 -5
- package/lib/commands/download/jmeter.js +54 -49
- package/lib/commands/download/keycloak-scim.d.ts +6 -6
- package/lib/commands/download/keycloak-scim.js +56 -51
- package/lib/commands/download/platform.d.ts +9 -7
- package/lib/commands/download/platform.js +59 -53
- package/lib/commands/download/scheduler.d.ts +9 -7
- package/lib/commands/download/scheduler.js +59 -53
- package/lib/commands/download/server.d.ts +9 -7
- package/lib/commands/download/server.js +59 -53
- package/lib/commands/download/signalr.d.ts +9 -7
- package/lib/commands/download/signalr.js +59 -53
- package/lib/commands/download/studio.d.ts +12 -9
- package/lib/commands/download/studio.js +107 -82
- package/lib/commands/gitlab/get-tag-pipeline.d.ts +11 -14
- package/lib/commands/gitlab/get-tag-pipeline.js +95 -92
- package/lib/commands/gitlab/next-nightly-tag.d.ts +10 -12
- package/lib/commands/gitlab/next-nightly-tag.js +96 -98
- package/lib/commands/jira/issue.d.ts +6 -8
- package/lib/commands/jira/issue.js +25 -23
- package/lib/commands/jira/labels.d.ts +9 -12
- package/lib/commands/jira/labels.js +52 -51
- package/lib/commands/log/add.d.ts +6 -8
- package/lib/commands/log/add.js +92 -87
- package/lib/commands/log/generate.d.ts +9 -10
- package/lib/commands/log/generate.js +112 -107
- package/lib/commands/log/validate.d.ts +2 -2
- package/lib/commands/log/validate.js +47 -43
- package/lib/commands/login.d.ts +9 -10
- package/lib/commands/login.js +101 -97
- package/lib/commands/npm/check-publish.d.ts +7 -8
- package/lib/commands/npm/check-publish.js +59 -54
- package/lib/commands/npm/dependency-update.d.ts +14 -12
- package/lib/commands/npm/dependency-update.js +94 -86
- package/lib/commands/npm/publish.d.ts +8 -9
- package/lib/commands/npm/publish.js +154 -140
- package/lib/commands/nuget/dependency-update.d.ts +15 -10
- package/lib/commands/nuget/dependency-update.js +60 -49
- package/lib/commands/sql.d.ts +24 -20
- package/lib/commands/sql.js +245 -226
- package/lib/commands/translate.d.ts +15 -16
- package/lib/commands/translate.js +109 -104
- package/lib/commands/version.d.ts +29 -19
- package/lib/commands/version.js +215 -190
- package/lib/config.js +3 -6
- package/lib/hooks/init/version-override.d.ts +2 -2
- package/lib/hooks/init/version-override.js +15 -13
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -4
- package/lib/lib/command.d.ts +2 -0
- package/lib/lib/command.js +65 -58
- package/lib/lib/gitlab.d.ts +8 -2
- package/lib/lib/gitlab.js +94 -82
- package/lib/lib/npm.d.ts +7 -3
- package/lib/lib/npm.js +72 -60
- package/lib/lib/npmrc.d.ts +5 -0
- package/lib/lib/npmrc.js +20 -13
- package/lib/lib/nuget.d.ts +2 -0
- package/lib/lib/nuget.js +20 -17
- package/lib/security/cache.js +31 -27
- package/lib/security/context.d.ts +2 -1
- package/lib/security/context.js +106 -103
- package/lib/types/changelog.types.js +1 -2
- package/lib/types/npm.types.d.ts +5 -5
- package/lib/types/npm.types.js +1 -2
- package/oclif.manifest.json +1223 -1
- package/package.json +50 -46
- package/bin/run +0 -5
- package/lib/commands/prepare-content.d.ts +0 -29
- package/lib/commands/prepare-content.js +0 -386
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadScheduler extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadScheduler extends CommandBase<typeof DownloadScheduler> {
|
|
4
4
|
static description: string;
|
|
5
5
|
static usage: string;
|
|
6
6
|
static examples: string[];
|
|
7
7
|
static flags: {
|
|
8
|
-
version:
|
|
9
|
-
output:
|
|
8
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
private readonly url;
|
|
12
12
|
/**
|
|
13
|
-
* Get unique
|
|
13
|
+
* Get unique AdInsureScheduler zip by specified version
|
|
14
|
+
* @param {string} version The version of AdInsureScheduler
|
|
15
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
14
16
|
*/
|
|
15
|
-
downloadFile(version: string): Promise<
|
|
17
|
+
downloadFile(version: string): Promise<AxiosResponse<any, any>>;
|
|
16
18
|
run(): Promise<void>;
|
|
17
19
|
}
|
|
@@ -1,75 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const command_base_1 = require("../../command.base");
|
|
10
|
-
class DownloadScheduler extends command_base_1.default {
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Flags, ux } from '@oclif/core';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import CommandBase from '../../command.base.js';
|
|
8
|
+
class DownloadScheduler extends CommandBase {
|
|
11
9
|
constructor() {
|
|
12
10
|
super(...arguments);
|
|
13
11
|
this.url = 'https://ops.adinsure.com/api/storage/binaries/';
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
|
-
* Get unique
|
|
14
|
+
* Get unique AdInsureScheduler zip by specified version
|
|
15
|
+
* @param {string} version The version of AdInsureScheduler
|
|
16
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return request.get(options);
|
|
27
|
-
}
|
|
28
|
-
async run() {
|
|
29
|
-
const { flags } = this.parse(DownloadScheduler);
|
|
30
|
-
let basePath = flags.output;
|
|
31
|
-
const filename = `AdInsureScheduler-${flags.version}.zip`;
|
|
32
|
-
let filePath = path.resolve(basePath, filename);
|
|
33
|
-
cli_ux_1.default.action.start(`Downloading AdInsure Scheduler version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
34
|
-
try {
|
|
35
|
-
let file = await this.downloadFile(flags.version);
|
|
36
|
-
let writeStream = fs.createWriteStream(filePath);
|
|
37
|
-
writeStream.write(file, 'binary');
|
|
38
|
-
writeStream.on('finish', () => {
|
|
39
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green('OK')}`);
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
downloadFile(version) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return axios.get(`${this.url}/AdInsureScheduler-${version}.zip`, {
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
24
|
+
'Content-Type': 'application/octet-stream',
|
|
25
|
+
},
|
|
40
26
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
run() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const { flags } = yield this.parse(DownloadScheduler);
|
|
32
|
+
const basePath = flags.output;
|
|
33
|
+
const filename = `AdInsureScheduler-${flags.version}.zip`;
|
|
34
|
+
const filePath = path.resolve(basePath, filename);
|
|
35
|
+
ux.action.start(`Downloading AdInsure Scheduler version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
36
|
+
try {
|
|
37
|
+
const file = yield this.downloadFile(flags.version);
|
|
38
|
+
const writeStream = fs.createWriteStream(filePath);
|
|
39
|
+
writeStream.write(file.data, 'binary');
|
|
40
|
+
writeStream.on('finish', () => {
|
|
41
|
+
ux.action.stop(`${chalk.green('OK')}`);
|
|
42
|
+
});
|
|
43
|
+
writeStream.end();
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
switch (error.statusCode) {
|
|
48
|
+
case 404: {
|
|
49
|
+
this.error('Does not exists.', { exit: 1 });
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case 400: {
|
|
53
|
+
this.error('Try refreshing your login credentials with "ops login".', { exit: 1 });
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
default: {
|
|
57
|
+
this.error(error.message);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
54
60
|
}
|
|
55
|
-
}
|
|
61
|
+
});
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
|
-
exports.default = DownloadScheduler;
|
|
59
64
|
DownloadScheduler.description = 'download AdInsure Scheduler zip from azure storage';
|
|
60
65
|
DownloadScheduler.usage = 'download:scheduler <flags>';
|
|
61
66
|
DownloadScheduler.examples = [
|
|
62
|
-
`$ ops download:scheduler -v 3.2.0 -o ~/Downloads
|
|
67
|
+
`$ ops download:scheduler -v 3.2.0 -o ~/Downloads`,
|
|
63
68
|
];
|
|
64
69
|
DownloadScheduler.flags = {
|
|
65
|
-
version:
|
|
70
|
+
version: Flags.string({
|
|
66
71
|
char: 'v',
|
|
67
72
|
description: 'version we want to download',
|
|
68
|
-
required: true
|
|
73
|
+
required: true,
|
|
69
74
|
}),
|
|
70
|
-
output:
|
|
75
|
+
output: Flags.string({
|
|
71
76
|
char: 'o',
|
|
72
77
|
description: 'output directory',
|
|
73
|
-
default: './'
|
|
78
|
+
default: './',
|
|
74
79
|
}),
|
|
75
80
|
};
|
|
81
|
+
export default DownloadScheduler;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadServer extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadServer extends CommandBase<typeof DownloadServer> {
|
|
4
4
|
static description: string;
|
|
5
5
|
static usage: string;
|
|
6
6
|
static examples: string[];
|
|
7
7
|
static flags: {
|
|
8
|
-
version:
|
|
9
|
-
output:
|
|
8
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
private readonly url;
|
|
12
12
|
/**
|
|
13
|
-
* Get unique
|
|
13
|
+
* Get unique AdInsure Server zip by specified version
|
|
14
|
+
* @param {string} version The version of AdInsure Server
|
|
15
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
14
16
|
*/
|
|
15
|
-
downloadFile(version: string): Promise<
|
|
17
|
+
downloadFile(version: string): Promise<AxiosResponse<any, any>>;
|
|
16
18
|
run(): Promise<void>;
|
|
17
19
|
}
|
|
@@ -1,75 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const command_base_1 = require("../../command.base");
|
|
10
|
-
class DownloadServer extends command_base_1.default {
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Flags, ux } from '@oclif/core';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import CommandBase from '../../command.base.js';
|
|
8
|
+
class DownloadServer extends CommandBase {
|
|
11
9
|
constructor() {
|
|
12
10
|
super(...arguments);
|
|
13
11
|
this.url = 'https://ops.adinsure.com/api/storage/binaries/';
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
|
-
* Get unique
|
|
14
|
+
* Get unique AdInsure Server zip by specified version
|
|
15
|
+
* @param {string} version The version of AdInsure Server
|
|
16
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return request.get(options);
|
|
27
|
-
}
|
|
28
|
-
async run() {
|
|
29
|
-
const { flags } = this.parse(DownloadServer);
|
|
30
|
-
let basePath = flags.output;
|
|
31
|
-
const filename = `AdInsure-server-${flags.version}.zip`;
|
|
32
|
-
let filePath = path.resolve(basePath, filename);
|
|
33
|
-
cli_ux_1.default.action.start(`Downloading AdInsure Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
34
|
-
try {
|
|
35
|
-
let file = await this.downloadFile(flags.version);
|
|
36
|
-
let writeStream = fs.createWriteStream(filePath);
|
|
37
|
-
writeStream.write(file, 'binary');
|
|
38
|
-
writeStream.on('finish', () => {
|
|
39
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green('OK')}`);
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
downloadFile(version) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return axios.get(`${this.url}/AdInsure-server-${version}.zip`, {
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
24
|
+
'Content-Type': 'application/octet-stream',
|
|
25
|
+
},
|
|
40
26
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
run() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const { flags } = yield this.parse(DownloadServer);
|
|
32
|
+
const basePath = flags.output;
|
|
33
|
+
const filename = `AdInsure-server-${flags.version}.zip`;
|
|
34
|
+
const filePath = path.resolve(basePath, filename);
|
|
35
|
+
ux.action.start(`Downloading AdInsure Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
36
|
+
try {
|
|
37
|
+
const file = yield this.downloadFile(flags.version);
|
|
38
|
+
const writeStream = fs.createWriteStream(filePath);
|
|
39
|
+
writeStream.write(file, 'binary');
|
|
40
|
+
writeStream.on('finish', () => {
|
|
41
|
+
ux.action.stop(`${chalk.green('OK')}`);
|
|
42
|
+
});
|
|
43
|
+
writeStream.end();
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
switch (error.statusCode) {
|
|
48
|
+
case 404: {
|
|
49
|
+
this.error('Does not exists.', { exit: 1 });
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case 400: {
|
|
53
|
+
this.error('Try refreshing your login credentials with "ops login".', { exit: 1 });
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
default: {
|
|
57
|
+
this.error(error.message);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
54
60
|
}
|
|
55
|
-
}
|
|
61
|
+
});
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
|
-
exports.default = DownloadServer;
|
|
59
64
|
DownloadServer.description = 'download AdInsure Server zip from Azure storage';
|
|
60
65
|
DownloadServer.usage = 'download:server <flags>';
|
|
61
66
|
DownloadServer.examples = [
|
|
62
|
-
`$ ops download:server -v 3.2.0 -o ~/Downloads
|
|
67
|
+
`$ ops download:server -v 3.2.0 -o ~/Downloads`,
|
|
63
68
|
];
|
|
64
69
|
DownloadServer.flags = {
|
|
65
|
-
version:
|
|
70
|
+
version: Flags.string({
|
|
66
71
|
char: 'v',
|
|
67
72
|
description: 'version we want to download',
|
|
68
|
-
required: true
|
|
73
|
+
required: true,
|
|
69
74
|
}),
|
|
70
|
-
output:
|
|
75
|
+
output: Flags.string({
|
|
71
76
|
char: 'o',
|
|
72
77
|
description: 'output directory',
|
|
73
|
-
default: './'
|
|
78
|
+
default: './',
|
|
74
79
|
}),
|
|
75
80
|
};
|
|
81
|
+
export default DownloadServer;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadSignalrServer extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadSignalrServer extends CommandBase<typeof DownloadSignalrServer> {
|
|
4
4
|
static description: string;
|
|
5
5
|
static usage: string;
|
|
6
6
|
static examples: string[];
|
|
7
7
|
static flags: {
|
|
8
|
-
version:
|
|
9
|
-
output:
|
|
8
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
private readonly url;
|
|
12
12
|
/**
|
|
13
|
-
* Get unique
|
|
13
|
+
* Get unique AdInsure SignalR Server zip by specified version
|
|
14
|
+
* @param {string} version The version of AdInsure SignalR Server
|
|
15
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
14
16
|
*/
|
|
15
|
-
downloadFile(version: string): Promise<
|
|
17
|
+
downloadFile(version: string): Promise<AxiosResponse<any, any>>;
|
|
16
18
|
run(): Promise<void>;
|
|
17
19
|
}
|
|
@@ -1,75 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const command_base_1 = require("../../command.base");
|
|
10
|
-
class DownloadSignalrServer extends command_base_1.default {
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Flags, ux } from '@oclif/core';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import CommandBase from '../../command.base.js';
|
|
8
|
+
class DownloadSignalrServer extends CommandBase {
|
|
11
9
|
constructor() {
|
|
12
10
|
super(...arguments);
|
|
13
11
|
this.url = 'https://ops.adinsure.com/api/storage/binaries/';
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
|
-
* Get unique
|
|
14
|
+
* Get unique AdInsure SignalR Server zip by specified version
|
|
15
|
+
* @param {string} version The version of AdInsure SignalR Server
|
|
16
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return request.get(options);
|
|
27
|
-
}
|
|
28
|
-
async run() {
|
|
29
|
-
const { flags } = this.parse(DownloadSignalrServer);
|
|
30
|
-
let basePath = flags.output;
|
|
31
|
-
const filename = `AdInsure-signalr-${flags.version}.zip`;
|
|
32
|
-
let filePath = path.resolve(basePath, filename);
|
|
33
|
-
cli_ux_1.default.action.start(`Downloading AdInsure SignalR Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
34
|
-
try {
|
|
35
|
-
let file = await this.downloadFile(flags.version);
|
|
36
|
-
let writeStream = fs.createWriteStream(filePath);
|
|
37
|
-
writeStream.write(file, 'binary');
|
|
38
|
-
writeStream.on('finish', () => {
|
|
39
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green('OK')}`);
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
downloadFile(version) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return axios.get(`${this.url}/AdInsure-signalr-${version}.zip`, {
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
24
|
+
'Content-Type': 'application/octet-stream',
|
|
25
|
+
},
|
|
40
26
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
run() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const { flags } = yield this.parse(DownloadSignalrServer);
|
|
32
|
+
const basePath = flags.output;
|
|
33
|
+
const filename = `AdInsure-signalr-${flags.version}.zip`;
|
|
34
|
+
const filePath = path.resolve(basePath, filename);
|
|
35
|
+
ux.action.start(`Downloading AdInsure SignalR Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
36
|
+
try {
|
|
37
|
+
const file = yield this.downloadFile(flags.version);
|
|
38
|
+
const writeStream = fs.createWriteStream(filePath);
|
|
39
|
+
writeStream.write(file.data, 'binary');
|
|
40
|
+
writeStream.on('finish', () => {
|
|
41
|
+
ux.action.stop(`${chalk.green('OK')}`);
|
|
42
|
+
});
|
|
43
|
+
writeStream.end();
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
switch (error.statusCode) {
|
|
48
|
+
case 404: {
|
|
49
|
+
this.error('Does not exists.', { exit: 1 });
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case 400: {
|
|
53
|
+
this.error('Try refreshing your login credentials with "ops login".', { exit: 1 });
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
default: {
|
|
57
|
+
this.error(error.message);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
54
60
|
}
|
|
55
|
-
}
|
|
61
|
+
});
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
|
-
exports.default = DownloadSignalrServer;
|
|
59
64
|
DownloadSignalrServer.description = 'download AdInsure SignalR Server zip from Azure storage';
|
|
60
65
|
DownloadSignalrServer.usage = 'download:signalr <flags>';
|
|
61
66
|
DownloadSignalrServer.examples = [
|
|
62
|
-
`$ ops download:signalr -v 18.0.0 -o ~/Downloads
|
|
67
|
+
`$ ops download:signalr -v 18.0.0 -o ~/Downloads`,
|
|
63
68
|
];
|
|
64
69
|
DownloadSignalrServer.flags = {
|
|
65
|
-
version:
|
|
70
|
+
version: Flags.string({
|
|
66
71
|
char: 'v',
|
|
67
72
|
description: 'version we want to download',
|
|
68
|
-
required: true
|
|
73
|
+
required: true,
|
|
69
74
|
}),
|
|
70
|
-
output:
|
|
75
|
+
output: Flags.string({
|
|
71
76
|
char: 'o',
|
|
72
77
|
description: 'output directory',
|
|
73
|
-
default: './'
|
|
78
|
+
default: './',
|
|
74
79
|
}),
|
|
75
80
|
};
|
|
81
|
+
export default DownloadSignalrServer;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadStudio extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadStudio extends CommandBase<typeof DownloadStudio> {
|
|
4
4
|
static description: string;
|
|
5
5
|
static usage: string;
|
|
6
6
|
static examples: string[];
|
|
7
7
|
static flags: {
|
|
8
|
-
version:
|
|
9
|
-
output:
|
|
10
|
-
install: import("@oclif/
|
|
11
|
-
skip: import("@oclif/
|
|
8
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
install: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
|
+
skip: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
12
|
+
keep: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
12
13
|
};
|
|
13
14
|
private readonly url;
|
|
14
15
|
/**
|
|
15
|
-
* Get unique
|
|
16
|
+
* Get unique AdInsure Studio vsix zip by specified version
|
|
17
|
+
* @param {string} version The version of AdInsure Studio vsix
|
|
18
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
16
19
|
*/
|
|
17
|
-
downloadFile(version: string): Promise<
|
|
20
|
+
downloadFile(version: string): Promise<AxiosResponse<any, any>>;
|
|
18
21
|
installExtension(extensionPath: string): Promise<void>;
|
|
19
22
|
findExtensionIfEnabled(studioVersion: string, enabled: boolean): Promise<boolean>;
|
|
20
23
|
run(): Promise<0 | undefined>;
|