@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,129 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Args, Flags, ux } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import semver from 'semver';
|
|
5
|
+
import CommandBase from '../../command.base.js';
|
|
6
|
+
import GitLab from '../../lib/gitlab.js';
|
|
7
|
+
class GitlabNextNightlyTag extends CommandBase {
|
|
8
|
+
run() {
|
|
9
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
const { args, flags } = yield this.parse(GitlabNextNightlyTag);
|
|
11
|
+
const gitlab = new GitLab(flags.host, flags.project, flags.pat);
|
|
12
|
+
const re = /^release\/(\w+-)?((\d+)(\.\d+)?)$/;
|
|
13
|
+
let prefix = '';
|
|
14
|
+
let inputVersion = args.version;
|
|
15
|
+
const match = args.version.match(re);
|
|
16
|
+
if (match) {
|
|
17
|
+
if (match[1] !== 'adinsure-') {
|
|
18
|
+
prefix = match[1];
|
|
19
|
+
}
|
|
20
|
+
inputVersion = match[2];
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
let version = semver.parse(inputVersion);
|
|
23
|
+
let nextVersion = null;
|
|
24
|
+
// if version is not parsable try to find something that starts with this version
|
|
25
|
+
if (!version) {
|
|
26
|
+
try {
|
|
27
|
+
version = yield gitlab.getLatestVersion(inputVersion, prefix);
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
this.error(error.message);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// still version does not exists we will try to parse it with additional 0 as patch version
|
|
35
|
+
if (!version) {
|
|
36
|
+
version = semver.parse(`${inputVersion}.0`);
|
|
37
|
+
}
|
|
38
|
+
// last option trying to add 0 for minor and patch version
|
|
39
|
+
if (!version) {
|
|
40
|
+
version = semver.parse(`${inputVersion}.0.0`);
|
|
41
|
+
}
|
|
42
|
+
// fail because we were not able to parse this version
|
|
43
|
+
if (!version) {
|
|
44
|
+
return this.error(`${chalk.red('Version in incorrect format')}`);
|
|
29
45
|
}
|
|
30
|
-
|
|
31
|
-
|
|
46
|
+
if (!flags.outputVersionOnly) {
|
|
47
|
+
ux.action.start('Calculating next prerelease test version', undefined, { stdout: true });
|
|
32
48
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
version = semver.parse(`${inputVersion}.0`);
|
|
37
|
-
}
|
|
38
|
-
// last option trying to add 0 for minor and patch version
|
|
39
|
-
if (!version) {
|
|
40
|
-
version = semver.parse(`${inputVersion}.0.0`);
|
|
41
|
-
}
|
|
42
|
-
// fail because we were not able to parse this version
|
|
43
|
-
if (!version) {
|
|
44
|
-
return this.error(`${chalk_1.default.red('Version in incorrect format')}`);
|
|
45
|
-
}
|
|
46
|
-
if (!flags.outputVersionOnly) {
|
|
47
|
-
cli_ux_1.default.action.start('Calculating next prerelease test version', undefined, { stdout: true });
|
|
48
|
-
}
|
|
49
|
-
const date = new Date();
|
|
50
|
-
const prereleaseDate = `${date.getFullYear()}${('0' + (date.getMonth() + 1)).slice(-2)}`;
|
|
51
|
-
let lastVersion = null;
|
|
52
|
-
try {
|
|
53
|
-
lastVersion = await gitlab.getLatestVersion(version.version, prefix);
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
this.error(err.message);
|
|
57
|
-
}
|
|
58
|
-
if (lastVersion) {
|
|
59
|
-
nextVersion = `v${semver.inc(lastVersion, 'prerelease', prereleaseDate)}`;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
nextVersion = `v${semver.inc(`${version.version}-${prereleaseDate}.0`, 'prerelease', prereleaseDate)}`;
|
|
63
|
-
}
|
|
64
|
-
if (prefix) {
|
|
65
|
-
nextVersion = `${prefix}${nextVersion}`;
|
|
66
|
-
}
|
|
67
|
-
if (!flags.outputVersionOnly) {
|
|
68
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green(nextVersion)}`);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
this.log(`${nextVersion}`);
|
|
72
|
-
}
|
|
73
|
-
if (!flags.dryRun) {
|
|
49
|
+
const date = new Date();
|
|
50
|
+
const prereleaseDate = `${date.getFullYear()}${('0' + (date.getMonth() + 1)).slice(-2)}`;
|
|
51
|
+
let lastVersion = null;
|
|
74
52
|
try {
|
|
75
|
-
|
|
53
|
+
lastVersion = yield gitlab.getLatestVersion(version.version, prefix);
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
this.error(error.message);
|
|
58
|
+
}
|
|
59
|
+
nextVersion = lastVersion ? `v${semver.inc(lastVersion, 'prerelease', prereleaseDate)}` : `v${semver.inc(`${version.version}-${prereleaseDate}.0`, 'prerelease', prereleaseDate)}`;
|
|
60
|
+
if (prefix) {
|
|
61
|
+
nextVersion = `${prefix}${nextVersion}`;
|
|
62
|
+
}
|
|
63
|
+
if (flags.outputVersionOnly) {
|
|
64
|
+
this.log(`${nextVersion}`);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
ux.action.stop(`${chalk.green(nextVersion)}`);
|
|
76
68
|
}
|
|
77
|
-
|
|
78
|
-
this.
|
|
69
|
+
if (flags.dryRun) {
|
|
70
|
+
this.warn(`This is only dry run. no new tag will was created!`);
|
|
79
71
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
else {
|
|
73
|
+
try {
|
|
74
|
+
yield gitlab.createNewTag(nextVersion, flags.reference);
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
this.error(error.message);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
|
-
exports.default = GitlabNextNightlyTag;
|
|
87
84
|
GitlabNextNightlyTag.description = 'creates new gitlab tag';
|
|
88
85
|
GitlabNextNightlyTag.usage = 'gitlab:next-nightly-tag <version>';
|
|
89
86
|
GitlabNextNightlyTag.examples = [
|
|
90
|
-
`$ ops gitlab:next-nightly-tag 17.0.0
|
|
91
|
-
];
|
|
92
|
-
GitlabNextNightlyTag.args = [
|
|
93
|
-
{
|
|
94
|
-
name: 'version',
|
|
95
|
-
description: 'Tag version'
|
|
96
|
-
}
|
|
87
|
+
`$ ops gitlab:next-nightly-tag 17.0.0`,
|
|
97
88
|
];
|
|
89
|
+
GitlabNextNightlyTag.args = {
|
|
90
|
+
version: Args.string({
|
|
91
|
+
required: true,
|
|
92
|
+
description: 'Tag version',
|
|
93
|
+
}),
|
|
94
|
+
};
|
|
98
95
|
GitlabNextNightlyTag.flags = {
|
|
99
|
-
pat:
|
|
96
|
+
pat: Flags.string({
|
|
100
97
|
required: true,
|
|
101
98
|
env: 'PRIVATE_TOKEN',
|
|
102
|
-
description: 'Token from user that has permissions to list and create tags'
|
|
99
|
+
description: 'Token from user that has permissions to list and create tags',
|
|
103
100
|
}),
|
|
104
|
-
host:
|
|
101
|
+
host: Flags.string({
|
|
105
102
|
required: true,
|
|
106
103
|
default: 'https://git.adacta-fintech.com',
|
|
107
104
|
env: 'CI_SERVER_URL',
|
|
108
|
-
description: 'Server hostname'
|
|
105
|
+
description: 'Server hostname',
|
|
109
106
|
}),
|
|
110
|
-
project:
|
|
107
|
+
project: Flags.string({
|
|
111
108
|
required: true,
|
|
112
109
|
default: '413',
|
|
113
110
|
env: 'CI_PROJECT_ID',
|
|
114
|
-
description: 'Project ID'
|
|
111
|
+
description: 'Project ID',
|
|
115
112
|
}),
|
|
116
|
-
reference:
|
|
113
|
+
reference: Flags.string({
|
|
117
114
|
required: true,
|
|
118
115
|
env: 'CI_COMMIT_REF_NAME',
|
|
119
|
-
description: 'Reference to create tag on (branch, commit, tag)'
|
|
116
|
+
description: 'Reference to create tag on (branch, commit, tag)',
|
|
120
117
|
}),
|
|
121
|
-
outputVersionOnly:
|
|
118
|
+
outputVersionOnly: Flags.boolean({
|
|
122
119
|
description: `output only version instead of pretty output`,
|
|
123
|
-
default: false
|
|
120
|
+
default: false,
|
|
124
121
|
}),
|
|
125
|
-
dryRun:
|
|
122
|
+
dryRun: Flags.boolean({
|
|
126
123
|
description: `Only printout version and don't create it`,
|
|
127
|
-
default: false
|
|
128
|
-
})
|
|
124
|
+
default: false,
|
|
125
|
+
}),
|
|
129
126
|
};
|
|
127
|
+
export default GitlabNextNightlyTag;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import CommandBaseJira from '../../command.base.jira';
|
|
1
|
+
import CommandBaseJira from '../../command.base.jira.js';
|
|
2
2
|
export default class JiraLabels extends CommandBaseJira {
|
|
3
3
|
static description: string;
|
|
4
4
|
static usage: string;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static args: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
required: boolean;
|
|
10
|
-
}[];
|
|
7
|
+
issue: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
11
9
|
static flags: {
|
|
12
|
-
username: import("@oclif/
|
|
13
|
-
password: import("@oclif/
|
|
14
|
-
hostname: import("@oclif/
|
|
10
|
+
username: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
password: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
hostname: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
13
|
};
|
|
16
14
|
run(): Promise<void>;
|
|
17
15
|
}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class JiraLabels extends
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Args } from '@oclif/core';
|
|
3
|
+
import CommandBaseJira from '../../command.base.jira.js';
|
|
4
|
+
class JiraLabels extends CommandBaseJira {
|
|
5
|
+
run() {
|
|
6
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7
|
+
const { args, flags } = yield this.parse(JiraLabels);
|
|
8
|
+
const jira = yield this.jiraInit(flags.hostname, flags.username, flags.password);
|
|
9
|
+
try {
|
|
10
|
+
const issue = yield jira.findIssue(args.issue);
|
|
11
|
+
this.log(JSON.stringify(issue));
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
this.error(error);
|
|
16
|
+
this.exit(1);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
|
-
exports.default = JiraLabels;
|
|
19
21
|
JiraLabels.description = 'get Jira issue';
|
|
20
22
|
JiraLabels.usage = 'jira:issue <issue>';
|
|
21
23
|
JiraLabels.examples = [
|
|
22
24
|
`$ ops jira:issue LJADIRD-1337`,
|
|
23
25
|
];
|
|
24
|
-
JiraLabels.args =
|
|
25
|
-
{
|
|
26
|
-
|
|
26
|
+
JiraLabels.args = {
|
|
27
|
+
issue: Args.string({
|
|
28
|
+
required: true,
|
|
27
29
|
description: 'Jira issue number',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
JiraLabels.flags = Object.assign({}, CommandBaseJira.flags);
|
|
33
|
+
export default JiraLabels;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import CommandBaseJira from '../../command.base.jira';
|
|
1
|
+
import JiraApi from 'jira-client';
|
|
2
|
+
import CommandBaseJira from '../../command.base.jira.js';
|
|
4
3
|
export default class JiraLabels extends CommandBaseJira {
|
|
5
4
|
static description: string;
|
|
6
5
|
static usage: string;
|
|
7
6
|
static examples: string[];
|
|
8
7
|
static args: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
required: boolean;
|
|
12
|
-
}[];
|
|
8
|
+
issue: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
13
10
|
static flags: {
|
|
14
|
-
add:
|
|
15
|
-
remove:
|
|
16
|
-
username:
|
|
17
|
-
password:
|
|
18
|
-
hostname:
|
|
11
|
+
add: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
remove: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
username: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
password: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
hostname: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
19
16
|
};
|
|
20
17
|
setLabels(jira: JiraApi, issue: string, add?: string[], remove?: string[]): Promise<JiraApi.JsonResponse>;
|
|
21
18
|
run(): Promise<void>;
|
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Args, Flags, ux } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import CommandBaseJira from '../../command.base.jira.js';
|
|
5
|
+
class JiraLabels extends CommandBaseJira {
|
|
6
|
+
setLabels(jira, issue, add = [], remove = []) {
|
|
7
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
const labels = [];
|
|
9
|
+
for (const label of add) {
|
|
10
|
+
const add = {
|
|
11
|
+
add: label,
|
|
12
|
+
};
|
|
13
|
+
labels.push(add);
|
|
14
|
+
}
|
|
15
|
+
for (const label of remove) {
|
|
16
|
+
const remove = {
|
|
17
|
+
remove: label,
|
|
18
|
+
};
|
|
19
|
+
labels.push(remove);
|
|
20
|
+
}
|
|
21
|
+
const edit = {
|
|
22
|
+
update: {
|
|
23
|
+
labels,
|
|
24
|
+
},
|
|
19
25
|
};
|
|
20
|
-
|
|
26
|
+
return jira.updateIssue(issue, edit);
|
|
21
27
|
});
|
|
22
|
-
let edit = {
|
|
23
|
-
update: {
|
|
24
|
-
labels
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
return jira.updateIssue(issue, edit);
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
run() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const { args, flags } = yield this.parse(JiraLabels);
|
|
32
|
+
const jira = yield this.jiraInit(flags.hostname, flags.username, flags.password);
|
|
33
|
+
if (flags.remove || flags.add) {
|
|
34
|
+
ux.action.start(`adding "${flags.add}" and removing "${flags.remove}" labels to Jira issue ${args.issue}`, undefined, { stdout: true });
|
|
35
|
+
try {
|
|
36
|
+
yield this.setLabels(jira, args.issue, flags.add, flags.remove);
|
|
37
|
+
ux.action.stop(`${chalk.green('done')}`);
|
|
38
|
+
}
|
|
39
|
+
catch (_a) {
|
|
40
|
+
ux.action.stop(`${chalk.red('error')}`);
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
else {
|
|
44
|
+
const issue = yield jira.findIssue(args.issue);
|
|
45
|
+
this.log(JSON.stringify(issue.fields.labels));
|
|
40
46
|
}
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
let issue = await jira.findIssue(args.issue);
|
|
44
|
-
this.log(JSON.stringify(issue.fields.labels));
|
|
45
|
-
}
|
|
47
|
+
});
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
|
-
exports.default = JiraLabels;
|
|
49
50
|
// static aliases = ['jira:edit:labels'];
|
|
50
51
|
JiraLabels.description = 'list or edit labels on Jira issue';
|
|
51
52
|
JiraLabels.usage = 'jira:labels <issue> -a [label] -r [label]';
|
|
52
53
|
JiraLabels.examples = [
|
|
53
54
|
`$ ops jira:labels LJADIRD-1337`,
|
|
54
55
|
];
|
|
55
|
-
JiraLabels.args =
|
|
56
|
-
{
|
|
57
|
-
|
|
56
|
+
JiraLabels.args = {
|
|
57
|
+
issue: Args.string({
|
|
58
|
+
required: true,
|
|
58
59
|
description: 'Jira issue number',
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
JiraLabels.flags = Object.assign(Object.assign({}, command_base_jira_1.default.flags), { add: command_1.flags.string({
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
JiraLabels.flags = Object.assign(Object.assign({}, CommandBaseJira.flags), { add: Flags.string({
|
|
63
63
|
char: 'a',
|
|
64
64
|
description: 'add label',
|
|
65
|
-
multiple: true
|
|
66
|
-
}), remove:
|
|
65
|
+
multiple: true,
|
|
66
|
+
}), remove: Flags.string({
|
|
67
67
|
char: 'r',
|
|
68
68
|
description: 'remove label',
|
|
69
|
-
multiple: true
|
|
69
|
+
multiple: true,
|
|
70
70
|
}) });
|
|
71
|
+
export default JiraLabels;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default class Changelog extends CommandBase {
|
|
1
|
+
import CommandBase from '../../command.base.js';
|
|
2
|
+
export default class Changelog extends CommandBase<typeof Changelog> {
|
|
4
3
|
static aliases: string[];
|
|
5
4
|
static description: string;
|
|
6
5
|
static usage: string;
|
|
7
6
|
static examples: string[];
|
|
8
7
|
static args: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}[];
|
|
8
|
+
issue: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
12
10
|
static flags: {
|
|
13
|
-
type:
|
|
14
|
-
component:
|
|
11
|
+
type: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
component: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
13
|
};
|
|
16
14
|
run(): Promise<void>;
|
|
17
15
|
}
|