@adinsure-ops/ops-cli 5.4.2-rc1 → 5.5.0-rc1
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/README.md +140 -2
- package/bin/run.js +2 -6
- package/lib/command.base.d.ts +7 -1
- package/lib/command.base.jira.d.ts +23 -5
- package/lib/command.base.jira.js +47 -12
- package/lib/command.base.js +37 -8
- package/lib/command.download.d.ts +11 -0
- package/lib/command.download.js +27 -0
- package/lib/commands/config/get.d.ts +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.d.ts +2 -2
- package/lib/commands/config/set.js +2 -2
- package/lib/commands/config/unset.d.ts +1 -1
- package/lib/commands/docker/update-image-version.d.ts +31 -3
- package/lib/commands/docker/update-image-version.js +112 -6
- package/lib/commands/doctor.d.ts +1 -1
- package/lib/commands/download/client.d.ts +7 -20
- package/lib/commands/download/client.js +12 -47
- package/lib/commands/download/identity-server.d.ts +7 -20
- package/lib/commands/download/identity-server.js +12 -47
- package/lib/commands/download/jmeter.d.ts +3 -3
- package/lib/commands/download/jmeter.js +9 -11
- package/lib/commands/download/keycloak-scim.d.ts +4 -4
- package/lib/commands/download/keycloak-scim.js +9 -11
- package/lib/commands/download/platform.d.ts +7 -20
- package/lib/commands/download/platform.js +12 -47
- package/lib/commands/download/scheduler.d.ts +7 -20
- package/lib/commands/download/scheduler.js +12 -47
- package/lib/commands/download/server.d.ts +7 -20
- package/lib/commands/download/server.js +12 -47
- package/lib/commands/download/signalr.d.ts +7 -20
- package/lib/commands/download/signalr.js +12 -47
- package/lib/commands/download/studio.d.ts +12 -24
- package/lib/commands/download/studio.js +14 -48
- package/lib/commands/gitlab/get-tag-pipeline.d.ts +7 -7
- package/lib/commands/gitlab/get-tag-pipeline.js +5 -5
- package/lib/commands/gitlab/next-nightly-tag.d.ts +7 -7
- package/lib/commands/gitlab/next-nightly-tag.js +6 -6
- package/lib/commands/jira/issue.d.ts +4 -4
- package/lib/commands/jira/issue.js +2 -2
- package/lib/commands/jira/labels.d.ts +8 -9
- package/lib/commands/jira/labels.js +11 -10
- package/lib/commands/log/add.d.ts +10 -5
- package/lib/commands/log/add.js +42 -13
- package/lib/commands/log/generate.d.ts +6 -6
- package/lib/commands/log/generate.js +16 -8
- package/lib/commands/log/validate.js +2 -2
- package/lib/commands/login.d.ts +25 -5
- package/lib/commands/login.js +162 -40
- package/lib/commands/login.ru.d.ts +2 -2
- package/lib/commands/login.ru.js +1 -1
- package/lib/commands/npm/check-publish.d.ts +4 -4
- package/lib/commands/npm/check-publish.js +1 -1
- package/lib/commands/npm/dependency-update.d.ts +17 -4
- package/lib/commands/npm/dependency-update.js +64 -41
- package/lib/commands/npm/publish.d.ts +5 -5
- package/lib/commands/npm/publish.js +2 -2
- package/lib/commands/nuget/dependency-update.d.ts +3 -3
- package/lib/commands/prepare-content.d.ts +3 -3
- package/lib/commands/prepare-content.js +24 -41
- package/lib/commands/sql.d.ts +17 -17
- package/lib/commands/sql.js +23 -27
- package/lib/commands/translate.d.ts +8 -8
- package/lib/commands/translate.js +10 -8
- package/lib/commands/version.d.ts +10 -10
- package/lib/commands/version.js +6 -7
- package/lib/lib/command.d.ts +5 -3
- package/lib/lib/command.js +44 -44
- package/lib/lib/config.js +1 -1
- package/lib/lib/gitlab.d.ts +3 -1
- package/lib/lib/gitlab.js +13 -7
- package/lib/lib/http.d.ts +37 -0
- package/lib/lib/http.js +278 -0
- package/lib/lib/npm.d.ts +7 -4
- package/lib/lib/npm.js +15 -6
- package/lib/lib/npmrc.js +3 -3
- package/lib/lib/yarnrc.js +3 -3
- package/lib/security/cache.js +1 -1
- package/lib/security/context.d.ts +10 -8
- package/lib/security/context.js +49 -64
- package/oclif.manifest.json +533 -532
- package/package.json +71 -62
|
@@ -1,52 +1,17 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { Flags, ux } from '@oclif/core';
|
|
3
|
-
import axios from 'axios';
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import fs from 'fs-extra';
|
|
6
|
-
import os from 'os';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import DownloadCommand from '../../command.download.js';
|
|
8
|
+
import { HttpError } from '../../lib/http.js';
|
|
9
9
|
import OpsConfig from '../../lib/config.js';
|
|
10
|
-
class DownloadPlatform extends
|
|
10
|
+
class DownloadPlatform extends DownloadCommand {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Get unique AdInsure Platform zip by specified version
|
|
18
|
-
* @param {string} version The version of AdInsure Platform
|
|
19
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
20
|
-
*/
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
downloadFileFromAzure(version) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
return axios.get(`${this.url_azure}/AdInsure-${version}.zip`, {
|
|
25
|
-
headers: {
|
|
26
|
-
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
27
|
-
'Content-Type': 'application/octet-stream',
|
|
28
|
-
},
|
|
29
|
-
responseType: 'arraybuffer',
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get unique AdInsure Platform zip by specified version
|
|
35
|
-
* @param {string} version The version of AdInsure Platform
|
|
36
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
37
|
-
*/
|
|
38
|
-
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
-
downloadFileFromGitLabRu(version) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const packageName = 'AdInsure';
|
|
42
|
-
const fileName = `${packageName}-${version}.zip`;
|
|
43
|
-
return axios.get(`${this.url_gitlabru}/${packageName}/${version}/${fileName}`, {
|
|
44
|
-
headers: {
|
|
45
|
-
'PRIVATE-TOKEN': this.security.getTokenRu(),
|
|
46
|
-
},
|
|
47
|
-
responseType: 'arraybuffer',
|
|
48
|
-
});
|
|
49
|
-
});
|
|
13
|
+
this.azureUrl = 'https://ops.adinsure.com/api/storage/binaries';
|
|
14
|
+
this.packageName = 'AdInsure';
|
|
50
15
|
}
|
|
51
16
|
run() {
|
|
52
17
|
const _super = Object.create(null, {
|
|
@@ -64,14 +29,14 @@ class DownloadPlatform extends CommandBase {
|
|
|
64
29
|
outputDir = defaultFolder || './'; // no flag -> DEFAULT output is "./"
|
|
65
30
|
}
|
|
66
31
|
// Expand tilde if present
|
|
67
|
-
const basePath = outputDir.charAt(0) === '~'
|
|
68
|
-
|
|
69
|
-
|
|
32
|
+
const basePath = outputDir.charAt(0) === '~' ?
|
|
33
|
+
os.homedir() + outputDir.split('~')[1] :
|
|
34
|
+
outputDir;
|
|
70
35
|
const filename = `AdInsure-${flags.version}.zip`;
|
|
71
36
|
const filePath = path.resolve(basePath, filename);
|
|
72
37
|
ux.action.start(`Downloading AdInsure Platform version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
73
38
|
try {
|
|
74
|
-
|
|
39
|
+
let file;
|
|
75
40
|
if (!flags.source) {
|
|
76
41
|
const config = new OpsConfig(this.security.getConfigPath());
|
|
77
42
|
flags.source = config.get('endpoint') || 'azure'; // no flag -> DEFAULT source is azure
|
|
@@ -91,7 +56,7 @@ class DownloadPlatform extends CommandBase {
|
|
|
91
56
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
57
|
}
|
|
93
58
|
catch (error) {
|
|
94
|
-
switch (error.
|
|
59
|
+
switch (error instanceof HttpError ? error.status : undefined) {
|
|
95
60
|
case 404: {
|
|
96
61
|
this.error('Does not exist.', { exit: 1 });
|
|
97
62
|
}
|
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default class DownloadScheduler extends CommandBase<typeof DownloadScheduler> {
|
|
1
|
+
import DownloadCommand from '../../command.download.js';
|
|
2
|
+
export default class DownloadScheduler extends DownloadCommand<typeof DownloadScheduler> {
|
|
4
3
|
static description: string;
|
|
5
4
|
static usage: string;
|
|
6
5
|
static examples: string[];
|
|
7
6
|
static flags: {
|
|
8
|
-
source: import("@oclif/core/
|
|
9
|
-
version: import("@oclif/core/
|
|
10
|
-
output: import("@oclif/core/
|
|
7
|
+
source: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
version: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
10
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get unique AdInsureScheduler zip by specified version
|
|
16
|
-
* @param {string} version The version of AdInsureScheduler
|
|
17
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
18
|
-
*/
|
|
19
|
-
downloadFileFromAzure(version: string): Promise<AxiosResponse<any, any>>;
|
|
20
|
-
/**
|
|
21
|
-
* Get unique AdInsureScheduler zip by specified version
|
|
22
|
-
* @param {string} version The version of AdInsureScheduler
|
|
23
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
24
|
-
*/
|
|
25
|
-
downloadFileFromGitLabRu(version: string): Promise<AxiosResponse<any>>;
|
|
11
|
+
protected readonly azureUrl = "https://ops.adinsure.com/api/storage/binaries";
|
|
12
|
+
protected readonly packageName = "AdInsureScheduler";
|
|
26
13
|
run(): Promise<void>;
|
|
27
14
|
}
|
|
@@ -1,52 +1,17 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { Flags, ux } from '@oclif/core';
|
|
3
|
-
import axios from 'axios';
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import fs from 'fs-extra';
|
|
6
|
-
import os from 'os';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import DownloadCommand from '../../command.download.js';
|
|
8
|
+
import { HttpError } from '../../lib/http.js';
|
|
9
9
|
import OpsConfig from '../../lib/config.js';
|
|
10
|
-
class DownloadScheduler extends
|
|
10
|
+
class DownloadScheduler extends DownloadCommand {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Get unique AdInsureScheduler zip by specified version
|
|
18
|
-
* @param {string} version The version of AdInsureScheduler
|
|
19
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
20
|
-
*/
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
downloadFileFromAzure(version) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
return axios.get(`${this.url_azure}/AdInsureScheduler-${version}.zip`, {
|
|
25
|
-
headers: {
|
|
26
|
-
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
27
|
-
'Content-Type': 'application/octet-stream',
|
|
28
|
-
},
|
|
29
|
-
responseType: 'arraybuffer',
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get unique AdInsureScheduler zip by specified version
|
|
35
|
-
* @param {string} version The version of AdInsureScheduler
|
|
36
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
37
|
-
*/
|
|
38
|
-
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
-
downloadFileFromGitLabRu(version) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const packageName = 'AdInsureScheduler';
|
|
42
|
-
const fileName = `${packageName}-${version}.zip`;
|
|
43
|
-
return axios.get(`${this.url_gitlabru}/${packageName}/${version}/${fileName}`, {
|
|
44
|
-
headers: {
|
|
45
|
-
'PRIVATE-TOKEN': this.security.getTokenRu(),
|
|
46
|
-
},
|
|
47
|
-
responseType: 'arraybuffer',
|
|
48
|
-
});
|
|
49
|
-
});
|
|
13
|
+
this.azureUrl = 'https://ops.adinsure.com/api/storage/binaries';
|
|
14
|
+
this.packageName = 'AdInsureScheduler';
|
|
50
15
|
}
|
|
51
16
|
run() {
|
|
52
17
|
const _super = Object.create(null, {
|
|
@@ -63,14 +28,14 @@ class DownloadScheduler extends CommandBase {
|
|
|
63
28
|
outputDir = defaultFolder || './'; // no flag -> DEFAULT output is "./"
|
|
64
29
|
}
|
|
65
30
|
// Expand tilde if present
|
|
66
|
-
const basePath = outputDir.charAt(0) === '~'
|
|
67
|
-
|
|
68
|
-
|
|
31
|
+
const basePath = outputDir.charAt(0) === '~' ?
|
|
32
|
+
os.homedir() + outputDir.split('~')[1] :
|
|
33
|
+
outputDir;
|
|
69
34
|
const filename = `AdInsureScheduler-${flags.version}.zip`;
|
|
70
35
|
const filePath = path.resolve(basePath, filename);
|
|
71
36
|
ux.action.start(`Downloading AdInsure Scheduler version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
72
37
|
try {
|
|
73
|
-
|
|
38
|
+
let file;
|
|
74
39
|
if (!flags.source) {
|
|
75
40
|
const config = new OpsConfig(this.security.getConfigPath());
|
|
76
41
|
flags.source = config.get('endpoint') || 'azure'; // no flag -> DEFAULT source is azure
|
|
@@ -90,7 +55,7 @@ class DownloadScheduler extends CommandBase {
|
|
|
90
55
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
56
|
}
|
|
92
57
|
catch (error) {
|
|
93
|
-
switch (error.
|
|
58
|
+
switch (error instanceof HttpError ? error.status : undefined) {
|
|
94
59
|
case 404: {
|
|
95
60
|
this.error('Does not exist.', { exit: 1 });
|
|
96
61
|
}
|
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default class DownloadServer extends CommandBase<typeof DownloadServer> {
|
|
1
|
+
import DownloadCommand from '../../command.download.js';
|
|
2
|
+
export default class DownloadServer extends DownloadCommand<typeof DownloadServer> {
|
|
4
3
|
static description: string;
|
|
5
4
|
static usage: string;
|
|
6
5
|
static examples: string[];
|
|
7
6
|
static flags: {
|
|
8
|
-
source: import("@oclif/core/
|
|
9
|
-
version: import("@oclif/core/
|
|
10
|
-
output: import("@oclif/core/
|
|
7
|
+
source: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
version: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
10
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get unique AdInsure Server zip by specified version
|
|
16
|
-
* @param {string} version The version of AdInsure Server
|
|
17
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
18
|
-
*/
|
|
19
|
-
downloadFileFromAzure(version: string): Promise<AxiosResponse<any, any>>;
|
|
20
|
-
/**
|
|
21
|
-
* Get unique AdInsure Server zip by specified version
|
|
22
|
-
* @param {string} version The version of AdInsure Server
|
|
23
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
24
|
-
*/
|
|
25
|
-
downloadFileFromGitLabRu(version: string): Promise<AxiosResponse<any>>;
|
|
11
|
+
protected readonly azureUrl = "https://ops.adinsure.com/api/storage/binaries";
|
|
12
|
+
protected readonly packageName = "AdInsure-server";
|
|
26
13
|
run(): Promise<void>;
|
|
27
14
|
}
|
|
@@ -1,52 +1,17 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { Flags, ux } from '@oclif/core';
|
|
3
|
-
import axios from 'axios';
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import fs from 'fs-extra';
|
|
6
|
-
import os from 'os';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import DownloadCommand from '../../command.download.js';
|
|
8
|
+
import { HttpError } from '../../lib/http.js';
|
|
9
9
|
import OpsConfig from '../../lib/config.js';
|
|
10
|
-
class DownloadServer extends
|
|
10
|
+
class DownloadServer extends DownloadCommand {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Get unique AdInsure Server zip by specified version
|
|
18
|
-
* @param {string} version The version of AdInsure Server
|
|
19
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
20
|
-
*/
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
downloadFileFromAzure(version) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
return axios.get(`${this.url_azure}/AdInsure-server-${version}.zip`, {
|
|
25
|
-
headers: {
|
|
26
|
-
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
27
|
-
'Content-Type': 'application/octet-stream',
|
|
28
|
-
},
|
|
29
|
-
responseType: 'arraybuffer',
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get unique AdInsure Server zip by specified version
|
|
35
|
-
* @param {string} version The version of AdInsure Server
|
|
36
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
37
|
-
*/
|
|
38
|
-
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
-
downloadFileFromGitLabRu(version) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const packageName = 'AdInsure-server';
|
|
42
|
-
const fileName = `${packageName}-${version}.zip`;
|
|
43
|
-
return axios.get(`${this.url_gitlabru}/${packageName}/${version}/${fileName}`, {
|
|
44
|
-
headers: {
|
|
45
|
-
'PRIVATE-TOKEN': this.security.getTokenRu(),
|
|
46
|
-
},
|
|
47
|
-
responseType: 'arraybuffer',
|
|
48
|
-
});
|
|
49
|
-
});
|
|
13
|
+
this.azureUrl = 'https://ops.adinsure.com/api/storage/binaries';
|
|
14
|
+
this.packageName = 'AdInsure-server';
|
|
50
15
|
}
|
|
51
16
|
run() {
|
|
52
17
|
const _super = Object.create(null, {
|
|
@@ -63,14 +28,14 @@ class DownloadServer extends CommandBase {
|
|
|
63
28
|
outputDir = defaultFolder || './'; // no flag -> DEFAULT output is "./"
|
|
64
29
|
}
|
|
65
30
|
// Expand tilde if present
|
|
66
|
-
const basePath = outputDir.charAt(0) === '~'
|
|
67
|
-
|
|
68
|
-
|
|
31
|
+
const basePath = outputDir.charAt(0) === '~' ?
|
|
32
|
+
os.homedir() + outputDir.split('~')[1] :
|
|
33
|
+
outputDir;
|
|
69
34
|
const filename = `AdInsure-server-${flags.version}.zip`;
|
|
70
35
|
const filePath = path.resolve(basePath, filename);
|
|
71
36
|
ux.action.start(`Downloading AdInsure Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
72
37
|
try {
|
|
73
|
-
|
|
38
|
+
let file;
|
|
74
39
|
if (!flags.source) {
|
|
75
40
|
const config = new OpsConfig(this.security.getConfigPath());
|
|
76
41
|
flags.source = config.get('endpoint') || 'azure'; // no flag -> DEFAULT source is azure
|
|
@@ -90,7 +55,7 @@ class DownloadServer extends CommandBase {
|
|
|
90
55
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
56
|
}
|
|
92
57
|
catch (error) {
|
|
93
|
-
switch (error.
|
|
58
|
+
switch (error instanceof HttpError ? error.status : undefined) {
|
|
94
59
|
case 404: {
|
|
95
60
|
this.error('Does not exist.', { exit: 1 });
|
|
96
61
|
}
|
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default class DownloadSignalrServer extends CommandBase<typeof DownloadSignalrServer> {
|
|
1
|
+
import DownloadCommand from '../../command.download.js';
|
|
2
|
+
export default class DownloadSignalrServer extends DownloadCommand<typeof DownloadSignalrServer> {
|
|
4
3
|
static description: string;
|
|
5
4
|
static usage: string;
|
|
6
5
|
static examples: string[];
|
|
7
6
|
static flags: {
|
|
8
|
-
source: import("@oclif/core/
|
|
9
|
-
version: import("@oclif/core/
|
|
10
|
-
output: import("@oclif/core/
|
|
7
|
+
source: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
version: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
10
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get unique AdInsure SignalR Server zip by specified version
|
|
16
|
-
* @param {string} version The version of AdInsure SignalR Server
|
|
17
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
18
|
-
*/
|
|
19
|
-
downloadFileFromAzure(version: string): Promise<AxiosResponse<any, any>>;
|
|
20
|
-
/**
|
|
21
|
-
* Get unique AdInsure SignalR zip by specified version
|
|
22
|
-
* @param {string} version The version of AdInsure SignalR
|
|
23
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
24
|
-
*/
|
|
25
|
-
downloadFileFromGitLabRu(version: string): Promise<AxiosResponse<any>>;
|
|
11
|
+
protected readonly azureUrl = "https://ops.adinsure.com/api/storage/binaries";
|
|
12
|
+
protected readonly packageName = "AdInsure-signalr";
|
|
26
13
|
run(): Promise<void>;
|
|
27
14
|
}
|
|
@@ -1,52 +1,17 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { Flags, ux } from '@oclif/core';
|
|
3
|
-
import axios from 'axios';
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import fs from 'fs-extra';
|
|
6
|
-
import os from 'os';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import DownloadCommand from '../../command.download.js';
|
|
8
|
+
import { HttpError } from '../../lib/http.js';
|
|
9
9
|
import OpsConfig from '../../lib/config.js';
|
|
10
|
-
class DownloadSignalrServer extends
|
|
10
|
+
class DownloadSignalrServer extends DownloadCommand {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Get unique AdInsure SignalR Server zip by specified version
|
|
18
|
-
* @param {string} version The version of AdInsure SignalR Server
|
|
19
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
20
|
-
*/
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
downloadFileFromAzure(version) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
return axios.get(`${this.url_azure}/AdInsure-signalr-${version}.zip`, {
|
|
25
|
-
headers: {
|
|
26
|
-
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
27
|
-
'Content-Type': 'application/octet-stream',
|
|
28
|
-
},
|
|
29
|
-
responseType: 'arraybuffer',
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get unique AdInsure SignalR zip by specified version
|
|
35
|
-
* @param {string} version The version of AdInsure SignalR
|
|
36
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
37
|
-
*/
|
|
38
|
-
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
-
downloadFileFromGitLabRu(version) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const packageName = 'AdInsure-signalr';
|
|
42
|
-
const fileName = `${packageName}-${version}.zip`;
|
|
43
|
-
return axios.get(`${this.url_gitlabru}/${packageName}/${version}/${fileName}`, {
|
|
44
|
-
headers: {
|
|
45
|
-
'PRIVATE-TOKEN': this.security.getTokenRu(),
|
|
46
|
-
},
|
|
47
|
-
responseType: 'arraybuffer',
|
|
48
|
-
});
|
|
49
|
-
});
|
|
13
|
+
this.azureUrl = 'https://ops.adinsure.com/api/storage/binaries';
|
|
14
|
+
this.packageName = 'AdInsure-signalr';
|
|
50
15
|
}
|
|
51
16
|
run() {
|
|
52
17
|
const _super = Object.create(null, {
|
|
@@ -63,14 +28,14 @@ class DownloadSignalrServer extends CommandBase {
|
|
|
63
28
|
outputDir = defaultFolder || './'; // no flag -> DEFAULT output is "./"
|
|
64
29
|
}
|
|
65
30
|
// Expand tilde if present
|
|
66
|
-
const basePath = outputDir.charAt(0) === '~'
|
|
67
|
-
|
|
68
|
-
|
|
31
|
+
const basePath = outputDir.charAt(0) === '~' ?
|
|
32
|
+
os.homedir() + outputDir.split('~')[1] :
|
|
33
|
+
outputDir;
|
|
69
34
|
const filename = `AdInsure-signalr-${flags.version}.zip`;
|
|
70
35
|
const filePath = path.resolve(basePath, filename);
|
|
71
36
|
ux.action.start(`Downloading AdInsure SignalR Server version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
72
37
|
try {
|
|
73
|
-
|
|
38
|
+
let file;
|
|
74
39
|
if (!flags.source) {
|
|
75
40
|
const config = new OpsConfig(this.security.getConfigPath());
|
|
76
41
|
flags.source = config.get('endpoint') || 'azure'; // no flag -> DEFAULT source is azure
|
|
@@ -90,7 +55,7 @@ class DownloadSignalrServer extends CommandBase {
|
|
|
90
55
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
56
|
}
|
|
92
57
|
catch (error) {
|
|
93
|
-
switch (error.
|
|
58
|
+
switch (error instanceof HttpError ? error.status : undefined) {
|
|
94
59
|
case 404: {
|
|
95
60
|
this.error('Does not exist.', { exit: 1 });
|
|
96
61
|
}
|
|
@@ -1,33 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default class DownloadStudio extends CommandBase<typeof DownloadStudio> {
|
|
1
|
+
import DownloadCommand from '../../command.download.js';
|
|
2
|
+
export default class DownloadStudio extends DownloadCommand<typeof DownloadStudio> {
|
|
4
3
|
static description: string;
|
|
5
4
|
static usage: string;
|
|
6
5
|
static examples: string[];
|
|
7
6
|
static flags: {
|
|
8
|
-
source: import("@oclif/core/
|
|
9
|
-
version: import("@oclif/core/
|
|
10
|
-
output: import("@oclif/core/
|
|
11
|
-
install: import("@oclif/core/
|
|
12
|
-
skip: import("@oclif/core/
|
|
13
|
-
keep: import("@oclif/core/
|
|
14
|
-
force: import("@oclif/core/
|
|
7
|
+
source: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
version: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
install: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
skip: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
keep: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
14
|
};
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
protected readonly azureUrl = "https://ops.adinsure.com/api/storage/extensions";
|
|
16
|
+
protected readonly packageName = "adinsure-studio";
|
|
17
|
+
protected readonly extension = "vsix";
|
|
18
18
|
private get vscodeExecutable();
|
|
19
|
-
/**
|
|
20
|
-
* Get unique AdInsure Studio vsix zip by specified version
|
|
21
|
-
* @param {string} version The version of AdInsure Studio vsix
|
|
22
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
23
|
-
*/
|
|
24
|
-
downloadFileFromAzure(version: string): Promise<AxiosResponse<any, any>>;
|
|
25
|
-
/**
|
|
26
|
-
* Get unique AdInsure Studio zip by specified version
|
|
27
|
-
* @param {string} version The version of AdInsure Studio
|
|
28
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
29
|
-
*/
|
|
30
|
-
downloadFileFromGitLabRu(version: string): Promise<AxiosResponse<any>>;
|
|
31
19
|
installExtension(extensionPath: string): Promise<void>;
|
|
32
20
|
findExtensionIfEnabled(studioVersion: string, enabled: boolean): Promise<boolean>;
|
|
33
21
|
run(): Promise<0 | undefined>;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { Flags, ux } from '@oclif/core';
|
|
3
|
-
import axios from 'axios';
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import fs from 'fs-extra';
|
|
6
|
-
import os from 'os';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import DownloadCommand from '../../command.download.js';
|
|
8
|
+
import { HttpError } from '../../lib/http.js';
|
|
9
9
|
import ChildProcessCommand from '../../lib/command.js';
|
|
10
10
|
import OpsConfig from '../../lib/config.js';
|
|
11
|
-
class DownloadStudio extends
|
|
11
|
+
class DownloadStudio extends DownloadCommand {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
14
|
+
this.azureUrl = 'https://ops.adinsure.com/api/storage/extensions';
|
|
15
|
+
this.packageName = 'adinsure-studio';
|
|
16
|
+
this.extension = 'vsix';
|
|
16
17
|
}
|
|
17
18
|
get vscodeExecutable() {
|
|
18
19
|
if (process.platform === 'win32') {
|
|
@@ -27,41 +28,6 @@ class DownloadStudio extends CommandBase {
|
|
|
27
28
|
}
|
|
28
29
|
return 'code';
|
|
29
30
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Get unique AdInsure Studio vsix zip by specified version
|
|
32
|
-
* @param {string} version The version of AdInsure Studio vsix
|
|
33
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
34
|
-
*/
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
-
downloadFileFromAzure(version) {
|
|
37
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
return axios.get(`${this.url_azure}/adinsure-studio-${version}.vsix`, {
|
|
39
|
-
headers: {
|
|
40
|
-
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
41
|
-
'Content-Type': 'application/octet-stream',
|
|
42
|
-
},
|
|
43
|
-
responseType: 'arraybuffer',
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get unique AdInsure Studio zip by specified version
|
|
49
|
-
* @param {string} version The version of AdInsure Studio
|
|
50
|
-
* @returns {Promise<AxiosResponse<any, any>>}
|
|
51
|
-
*/
|
|
52
|
-
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
-
downloadFileFromGitLabRu(version) {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const packageName = 'adinsure-studio';
|
|
56
|
-
const fileName = `${packageName}-${version}.vsix`;
|
|
57
|
-
return axios.get(`${this.url_gitlabru}/${packageName}/${version}/${fileName}`, {
|
|
58
|
-
headers: {
|
|
59
|
-
'PRIVATE-TOKEN': this.security.getTokenRu(),
|
|
60
|
-
},
|
|
61
|
-
responseType: 'arraybuffer',
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
31
|
installExtension(extensionPath) {
|
|
66
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
33
|
const cp = new ChildProcessCommand();
|
|
@@ -99,10 +65,10 @@ class DownloadStudio extends CommandBase {
|
|
|
99
65
|
DownloadStudio.flags.output.default = defaultFolder || './';
|
|
100
66
|
const { flags } = yield this.parse(DownloadStudio);
|
|
101
67
|
// The os.homedir expands the ~ char, as the node path.resolve method does not expand it
|
|
102
|
-
|
|
103
|
-
const basePath = outputDir.charAt(0) === '~'
|
|
104
|
-
|
|
105
|
-
|
|
68
|
+
const outputDir = flags.output;
|
|
69
|
+
const basePath = outputDir.charAt(0) === '~' ?
|
|
70
|
+
os.homedir() + outputDir.split('~')[1] :
|
|
71
|
+
outputDir;
|
|
106
72
|
if (flags.force && !(yield fs.pathExists(basePath))) {
|
|
107
73
|
yield fs.mkdirp(basePath);
|
|
108
74
|
}
|
|
@@ -127,7 +93,7 @@ class DownloadStudio extends CommandBase {
|
|
|
127
93
|
return;
|
|
128
94
|
}
|
|
129
95
|
ux.action.start(`Downloading AdInsure Studio version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
130
|
-
|
|
96
|
+
let file;
|
|
131
97
|
if (!flags.source) {
|
|
132
98
|
const config = new OpsConfig(this.security.getConfigPath());
|
|
133
99
|
flags.source = config.get('endpoint') || 'azure'; // no flag -> DEFAULT source is azure
|
|
@@ -158,7 +124,7 @@ class DownloadStudio extends CommandBase {
|
|
|
158
124
|
if (error.oclif) {
|
|
159
125
|
throw error;
|
|
160
126
|
}
|
|
161
|
-
switch (error.
|
|
127
|
+
switch (error instanceof HttpError ? error.status : undefined) {
|
|
162
128
|
case 404: {
|
|
163
129
|
this.error('Does not exist.', { exit: 1 });
|
|
164
130
|
}
|
|
@@ -6,15 +6,15 @@ export default class GitlabGetTagPipeline extends CommandBase<typeof GitlabGetTa
|
|
|
6
6
|
static usage: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static args: {
|
|
9
|
-
tag: import("@oclif/core/
|
|
9
|
+
tag: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
10
|
};
|
|
11
11
|
static flags: {
|
|
12
|
-
pat: import("@oclif/core/
|
|
13
|
-
host: import("@oclif/core/
|
|
14
|
-
project: import("@oclif/core/
|
|
15
|
-
wait: import("@oclif/core/
|
|
16
|
-
timeout: import("@oclif/core/
|
|
17
|
-
delay: import("@oclif/core/
|
|
12
|
+
pat: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
host: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
wait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
timeout: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
delay: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
18
|
};
|
|
19
19
|
waitPipelineStatus(gitlab: GitLab, tag: string, timeout: number, delay: number): Promise<string>;
|
|
20
20
|
hostConfigValidation(config: OpsConfig): Promise<void>;
|