@adinsure-ops/ops-cli 4.8.3 → 5.0.0-rc3
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 +12 -0
- package/README.md +0 -211
- 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 +11 -9
- package/lib/commands/download/studio.js +92 -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 +1212 -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,74 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const command_base_1 = require("../../command.base");
|
|
10
|
-
class DownloadClient 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 DownloadClient 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 Client zip by specified version
|
|
15
|
+
* @param {string} version The version of AdInsure Client
|
|
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(DownloadClient);
|
|
30
|
-
let basePath = flags.output;
|
|
31
|
-
const filename = `AdInsure-client-${flags.version}.zip`;
|
|
32
|
-
let filePath = path.resolve(basePath, filename);
|
|
33
|
-
cli_ux_1.default.action.start(`Downloading AdInsure Client 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-client-${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
|
-
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
run() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const { flags } = yield this.parse(DownloadClient);
|
|
32
|
+
const basePath = flags.output;
|
|
33
|
+
const filename = `AdInsure-client-${flags.version}.zip`;
|
|
34
|
+
const filePath = path.resolve(basePath, filename);
|
|
35
|
+
ux.action.start(`Downloading AdInsure Client 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
|
+
}
|
|
53
60
|
}
|
|
54
|
-
}
|
|
61
|
+
});
|
|
55
62
|
}
|
|
56
63
|
}
|
|
57
|
-
|
|
64
|
+
DownloadClient.aliases = ['download:client'];
|
|
58
65
|
DownloadClient.description = 'download AdInsure Client zip from Azure storage';
|
|
59
66
|
DownloadClient.usage = 'download:client <flags>';
|
|
60
67
|
DownloadClient.examples = [
|
|
61
|
-
`$ ops download:client -v 3.2.0 -o ~/Downloads
|
|
68
|
+
`$ ops download:client -v 3.2.0 -o ~/Downloads`,
|
|
62
69
|
];
|
|
63
70
|
DownloadClient.flags = {
|
|
64
|
-
version:
|
|
71
|
+
version: Flags.string({
|
|
65
72
|
char: 'v',
|
|
66
73
|
description: 'version we want to download',
|
|
67
|
-
required: true
|
|
74
|
+
required: true,
|
|
68
75
|
}),
|
|
69
|
-
output:
|
|
76
|
+
output: Flags.string({
|
|
70
77
|
char: 'o',
|
|
71
78
|
description: 'output directory',
|
|
72
|
-
default: './'
|
|
79
|
+
default: './',
|
|
73
80
|
}),
|
|
74
81
|
};
|
|
82
|
+
export default DownloadClient;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadIdentityServer extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadIdentityServer extends CommandBase<typeof DownloadIdentityServer> {
|
|
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 Identity Server zip by specified version
|
|
14
|
+
* @param {string} version The version of Identity 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 DownloadIdentityServer 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 DownloadIdentityServer 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 Identity Server zip by specified version
|
|
15
|
+
* @param {string} version The version of Identity 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(DownloadIdentityServer);
|
|
30
|
-
let basePath = flags.output;
|
|
31
|
-
const filename = `AdInsure-identityServer-${flags.version}.zip`;
|
|
32
|
-
let filePath = path.resolve(basePath, filename);
|
|
33
|
-
cli_ux_1.default.action.start(`Downloading AdInsure Identity 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-identityServer-${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(DownloadIdentityServer);
|
|
32
|
+
const basePath = flags.output;
|
|
33
|
+
const filename = `AdInsure-identityServer-${flags.version}.zip`;
|
|
34
|
+
const filePath = path.resolve(basePath, filename);
|
|
35
|
+
ux.action.start(`Downloading AdInsure Identity 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 = DownloadIdentityServer;
|
|
59
64
|
DownloadIdentityServer.description = 'download AdInsure Identity Server zip from Azure storage';
|
|
60
65
|
DownloadIdentityServer.usage = 'download:identity-server <flags>';
|
|
61
66
|
DownloadIdentityServer.examples = [
|
|
62
|
-
`$ ops download:identity-server -v 3.0.3 -o ~/Downloads
|
|
67
|
+
`$ ops download:identity-server -v 3.0.3 -o ~/Downloads`,
|
|
63
68
|
];
|
|
64
69
|
DownloadIdentityServer.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 DownloadIdentityServer;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadJmeter extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadJmeter extends CommandBase<typeof DownloadJmeter> {
|
|
4
4
|
static description: string;
|
|
5
5
|
static usage: string;
|
|
6
6
|
static examples: string[];
|
|
7
7
|
static flags: {
|
|
8
|
-
output:
|
|
8
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
9
|
};
|
|
10
10
|
private readonly url;
|
|
11
|
-
downloadFile(): Promise<
|
|
11
|
+
downloadFile(): Promise<AxiosResponse<any, any>>;
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -1,66 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const command_base_1 = require("../../command.base");
|
|
10
|
-
class DownloadJmeter 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 DownloadJmeter extends CommandBase {
|
|
11
9
|
constructor() {
|
|
12
10
|
super(...arguments);
|
|
13
11
|
this.url = 'https://ops.adinsure.com/api/storage/jmeter/';
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return request.get(options);
|
|
24
|
-
}
|
|
25
|
-
async run() {
|
|
26
|
-
const { flags } = this.parse(DownloadJmeter);
|
|
27
|
-
let basePath = flags.output;
|
|
28
|
-
const filename = `jmeter-artifacts.zip`;
|
|
29
|
-
let filePath = path.resolve(basePath, filename);
|
|
30
|
-
cli_ux_1.default.action.start(`Downloading jmeter examples to ${filePath}`, undefined, { stdout: true });
|
|
31
|
-
try {
|
|
32
|
-
let file = await this.downloadFile();
|
|
33
|
-
let writeStream = fs.createWriteStream(filePath);
|
|
34
|
-
writeStream.write(file, 'binary');
|
|
35
|
-
writeStream.on('finish', () => {
|
|
36
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green('OK')}`);
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
downloadFile() {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
return axios.get(`${this.url}/jmeter-artifacts.zip`, {
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
19
|
+
'Content-Type': 'application/octet-stream',
|
|
20
|
+
},
|
|
37
21
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
run() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { flags } = yield this.parse(DownloadJmeter);
|
|
27
|
+
const basePath = flags.output;
|
|
28
|
+
const filename = `jmeter-artifacts.zip`;
|
|
29
|
+
const filePath = path.resolve(basePath, filename);
|
|
30
|
+
ux.action.start(`Downloading jmeter examples to ${filePath}`, undefined, { stdout: true });
|
|
31
|
+
try {
|
|
32
|
+
const file = yield this.downloadFile();
|
|
33
|
+
const writeStream = fs.createWriteStream(filePath);
|
|
34
|
+
writeStream.write(file.data, 'binary');
|
|
35
|
+
writeStream.on('finish', () => {
|
|
36
|
+
ux.action.stop(`${chalk.green('OK')}`);
|
|
37
|
+
});
|
|
38
|
+
writeStream.end();
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
switch (error.statusCode) {
|
|
43
|
+
case 404: {
|
|
44
|
+
this.error('Does not exists.', { exit: 1 });
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case 400: {
|
|
48
|
+
this.error('Try refreshing your login credentials with "ops login".', { exit: 1 });
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
default: {
|
|
52
|
+
this.error(error.message);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
|
-
}
|
|
56
|
+
});
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
|
-
exports.default = DownloadJmeter;
|
|
55
59
|
DownloadJmeter.description = 'download jmeter examples from Azure storage';
|
|
56
60
|
DownloadJmeter.usage = 'download:jmeter-examples <flags>';
|
|
57
61
|
DownloadJmeter.examples = [
|
|
58
|
-
`$ ops download:jmeter-examples -o ~/Downloads
|
|
62
|
+
`$ ops download:jmeter-examples -o ~/Downloads`,
|
|
59
63
|
];
|
|
60
64
|
DownloadJmeter.flags = {
|
|
61
|
-
output:
|
|
65
|
+
output: Flags.string({
|
|
62
66
|
char: 'o',
|
|
63
67
|
description: 'output directory',
|
|
64
|
-
default: './'
|
|
68
|
+
default: './',
|
|
65
69
|
}),
|
|
66
70
|
};
|
|
71
|
+
export default DownloadJmeter;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadKeycloak extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadKeycloak extends CommandBase<typeof DownloadKeycloak> {
|
|
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
|
-
downloadFile(version: string): Promise<
|
|
12
|
+
downloadFile(version: string): Promise<AxiosResponse<any, any>>;
|
|
13
13
|
run(): Promise<void>;
|
|
14
14
|
}
|
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const command_base_1 = require("../../command.base");
|
|
10
|
-
class DownloadKeycloak 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 DownloadKeycloak extends CommandBase {
|
|
11
9
|
constructor() {
|
|
12
10
|
super(...arguments);
|
|
13
11
|
this.url = 'https://ops.adinsure.com/api/storage/extensions/';
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return request.get(options);
|
|
24
|
-
}
|
|
25
|
-
async run() {
|
|
26
|
-
const { flags } = this.parse(DownloadKeycloak);
|
|
27
|
-
let basePath = flags.output;
|
|
28
|
-
const filename = `Keycloak-scim-${flags.version}.zip`;
|
|
29
|
-
let filePath = path.resolve(basePath, filename);
|
|
30
|
-
cli_ux_1.default.action.start(`Downloading Keycloack version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
31
|
-
try {
|
|
32
|
-
let file = await this.downloadFile(flags.version);
|
|
33
|
-
let writeStream = fs.createWriteStream(filePath);
|
|
34
|
-
writeStream.write(file, 'binary');
|
|
35
|
-
writeStream.on('finish', () => {
|
|
36
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green('OK')}`);
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
downloadFile(version) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
return axios.get(`${this.url}/keycloak-scim2-outbound-provisioning-${version}.zip`, {
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
19
|
+
'Content-Type': 'application/octet-stream',
|
|
20
|
+
},
|
|
37
21
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
run() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { flags } = yield this.parse(DownloadKeycloak);
|
|
27
|
+
const basePath = flags.output;
|
|
28
|
+
const filename = `Keycloak-scim-${flags.version}.zip`;
|
|
29
|
+
const filePath = path.resolve(basePath, filename);
|
|
30
|
+
ux.action.start(`Downloading Keycloack version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
31
|
+
try {
|
|
32
|
+
const file = yield this.downloadFile(flags.version);
|
|
33
|
+
const writeStream = fs.createWriteStream(filePath);
|
|
34
|
+
writeStream.write(file.data, 'binary');
|
|
35
|
+
writeStream.on('finish', () => {
|
|
36
|
+
ux.action.stop(`${chalk.green('OK')}`);
|
|
37
|
+
});
|
|
38
|
+
writeStream.end();
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
switch (error.statusCode) {
|
|
43
|
+
case 404: {
|
|
44
|
+
this.error('Does not exists.', { exit: 1 });
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case 400: {
|
|
48
|
+
this.error('Try refreshing your login credentials with "ops login".', { exit: 1 });
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
default: {
|
|
52
|
+
this.error(error.message);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
|
-
}
|
|
56
|
+
});
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
|
-
exports.default = DownloadKeycloak;
|
|
55
59
|
DownloadKeycloak.description = 'download Keycloak-scim from Azure storage';
|
|
56
60
|
DownloadKeycloak.usage = 'download:keycloak-scim <flags>';
|
|
57
61
|
DownloadKeycloak.examples = [
|
|
58
|
-
`$ ops download:keycloak-scim -v 3.2.0 -o ~/Downloads
|
|
62
|
+
`$ ops download:keycloak-scim -v 3.2.0 -o ~/Downloads`,
|
|
59
63
|
];
|
|
60
64
|
DownloadKeycloak.flags = {
|
|
61
|
-
version:
|
|
65
|
+
version: Flags.string({
|
|
62
66
|
char: 'v',
|
|
63
67
|
description: 'version we want to download',
|
|
64
|
-
required: true
|
|
68
|
+
required: true,
|
|
65
69
|
}),
|
|
66
|
-
output:
|
|
70
|
+
output: Flags.string({
|
|
67
71
|
char: 'o',
|
|
68
72
|
description: 'output directory',
|
|
69
|
-
default: './'
|
|
73
|
+
default: './',
|
|
70
74
|
}),
|
|
71
75
|
};
|
|
76
|
+
export default DownloadKeycloak;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadPlatform extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadPlatform extends CommandBase<typeof DownloadPlatform> {
|
|
4
4
|
static aliases: string[];
|
|
5
5
|
static description: string;
|
|
6
6
|
static usage: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
version:
|
|
10
|
-
output:
|
|
9
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
private readonly url;
|
|
13
13
|
/**
|
|
14
|
-
* Get unique
|
|
14
|
+
* Get unique AdInsure Platform zip by specified version
|
|
15
|
+
* @param {string} version The version of AdInsure Platform
|
|
16
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
15
17
|
*/
|
|
16
|
-
downloadFile(version: string): Promise<
|
|
18
|
+
downloadFile(version: string): Promise<AxiosResponse<any, any>>;
|
|
17
19
|
run(): Promise<void>;
|
|
18
20
|
}
|