@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
package/lib/commands/login.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default class Login extends CommandBase {
|
|
1
|
+
import CommandBase from '../command.base.js';
|
|
2
|
+
export default class Login extends CommandBase<typeof Login> {
|
|
4
3
|
static description: string;
|
|
5
4
|
static usage: string;
|
|
6
5
|
static examples: string[];
|
|
7
6
|
static flags: {
|
|
8
|
-
servicePrincipal: import("@oclif/
|
|
9
|
-
deviceFlow: import("@oclif/
|
|
10
|
-
clientId:
|
|
11
|
-
secret:
|
|
12
|
-
npm: import("@oclif/
|
|
13
|
-
skipCI:
|
|
14
|
-
force: import("@oclif/
|
|
7
|
+
servicePrincipal: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
deviceFlow: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
9
|
+
clientId: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
secret: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
npm: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
12
|
+
skipCI: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
15
14
|
};
|
|
16
15
|
static responsePageContent: string;
|
|
17
16
|
private readonly npmRegistries;
|
package/lib/commands/login.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class Login extends command_base_1.default {
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Flags } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import http from 'http';
|
|
6
|
+
import open from 'open';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import url from 'url';
|
|
9
|
+
import CommandBase from '../command.base.js';
|
|
10
|
+
import NpmRc from '../lib/npmrc.js';
|
|
11
|
+
class Login extends CommandBase {
|
|
13
12
|
constructor() {
|
|
14
13
|
super(...arguments);
|
|
15
14
|
this.npmRegistries = [
|
|
@@ -22,97 +21,101 @@ class Login extends command_base_1.default {
|
|
|
22
21
|
*
|
|
23
22
|
* @returns [[Promise<string>]]
|
|
24
23
|
*/
|
|
25
|
-
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
24
|
+
setNPM() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
try {
|
|
28
|
+
const npmRc = new NpmRc();
|
|
29
|
+
const token = yield this.security.getNPMToken();
|
|
30
|
+
for (const registry of this.npmRegistries) {
|
|
31
|
+
const registryUrl = new url.URL(registry);
|
|
32
|
+
npmRc.set(`//${registryUrl.hostname}${registryUrl.pathname}:_authToken`, token);
|
|
33
|
+
}
|
|
34
|
+
npmRc.save();
|
|
35
|
+
this.log(`${chalk.green('NPM token generated!')}`);
|
|
36
|
+
resolve();
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
reject(error);
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
if (flags.skipCI && process.env[flags.skipCI]) {
|
|
56
|
-
if (flags.force)
|
|
57
|
-
this.error(new Error('Cannot skip login as the force login flag has been set'));
|
|
58
|
-
this.log(`${chalk_1.default.yellow('Note: skipping login because variables was set for CI')}`);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (flags.npm) {
|
|
62
|
-
try {
|
|
63
|
-
await this.setNPM();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
catch (_a) {
|
|
67
|
-
this.log(`${chalk_1.default.yellow('Note: Login is needed to get NPM token!')}`);
|
|
45
|
+
run() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const { flags } = yield this.parse(Login);
|
|
48
|
+
if (flags.force) {
|
|
49
|
+
fs.unlink(path.resolve(this.security.getTokenPath()), () => {
|
|
50
|
+
this.log(`${chalk.yellow('Note: We have launched a browser for you to login.')}`);
|
|
51
|
+
});
|
|
68
52
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
if (flags.skipCI && process.env[flags.skipCI]) {
|
|
54
|
+
if (flags.force)
|
|
55
|
+
this.error(new Error('Cannot skip login as the force login flag has been set'));
|
|
56
|
+
this.log(`${chalk.yellow('Note: skipping login because variables was set for CI')}`);
|
|
57
|
+
return;
|
|
74
58
|
}
|
|
75
|
-
|
|
76
|
-
|
|
59
|
+
if (flags.npm) {
|
|
60
|
+
try {
|
|
61
|
+
yield this.setNPM();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
catch (_a) {
|
|
65
|
+
this.log(`${chalk.yellow('Note: Login is needed to get NPM token!')}`);
|
|
66
|
+
}
|
|
77
67
|
}
|
|
78
|
-
|
|
79
|
-
else if (flags.servicePrincipal || flags.clientId || flags.secret) {
|
|
80
|
-
this.warn(`${chalk_1.default.red('[DEPRECATED] --servicePrincipal parameter is deprecated. To use with service principal, please set environment variables AZURE_CLIENT_ID and AZURE_CLIENT_SECRET! Login is not required!')}`);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
this.log(`${chalk_1.default.yellow('Note: We have launched a browser for you to login.')}`);
|
|
84
|
-
let loginUrl = await this.security.getLoginUrl();
|
|
85
|
-
await open(loginUrl);
|
|
86
|
-
let server = http.createServer(async (req, res) => {
|
|
87
|
-
// First let the user know everything was OK
|
|
88
|
-
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
89
|
-
res.write(Login.responsePageContent);
|
|
90
|
-
res.end();
|
|
91
|
-
this.log(`${chalk_1.default.yellow('You have logged in successfully. Acquiring your access token...')}`);
|
|
92
|
-
// Then let's acquire an authentication token from AAD
|
|
68
|
+
if (flags.deviceFlow) {
|
|
93
69
|
try {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
70
|
+
yield this.security.acquireTokenDeviceFlow();
|
|
71
|
+
this.log(`${chalk.green('Login Successful!')}`);
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
73
|
}
|
|
98
|
-
catch (
|
|
99
|
-
this.error(
|
|
74
|
+
catch (error) {
|
|
75
|
+
this.error(error);
|
|
100
76
|
}
|
|
101
|
-
|
|
77
|
+
}
|
|
78
|
+
else if (flags.servicePrincipal || flags.clientId || flags.secret) {
|
|
79
|
+
this.warn(`${chalk.red('[DEPRECATED] --servicePrincipal parameter is deprecated. To use with service principal, please set environment variables AZURE_CLIENT_ID and AZURE_CLIENT_SECRET! Login is not required!')}`);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.log(`${chalk.yellow('Note: We have launched a browser for you to login.')}`);
|
|
83
|
+
const loginUrl = yield this.security.getLoginUrl();
|
|
84
|
+
yield open(loginUrl);
|
|
85
|
+
const server = http.createServer((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
// First let the user know everything was OK
|
|
87
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
88
|
+
res.write(Login.responsePageContent);
|
|
89
|
+
res.end();
|
|
90
|
+
this.log(`${chalk.yellow('You have logged in successfully. Acquiring your access token...')}`);
|
|
91
|
+
// Then let's acquire an authentication token from AAD
|
|
102
92
|
try {
|
|
103
|
-
|
|
93
|
+
const queryURL = new url.URL(req.url, 'http://localhost:3044').searchParams;
|
|
94
|
+
const name = yield this.security.acquireToken(
|
|
95
|
+
// eslint-disable-next-line unicorn/prefer-spread
|
|
96
|
+
Object.fromEntries(Array.from(queryURL.entries())));
|
|
97
|
+
this.log(`Hello ${name}!`);
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
99
|
}
|
|
105
|
-
catch (
|
|
106
|
-
this.error(
|
|
100
|
+
catch (error) {
|
|
101
|
+
this.error(error, { exit: false });
|
|
107
102
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
if (flags.npm) {
|
|
104
|
+
try {
|
|
105
|
+
yield this.setNPM();
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
this.error(error, { exit: false });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
server.close();
|
|
113
|
+
}));
|
|
114
|
+
server.listen(3044);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
|
-
exports.default = Login;
|
|
116
119
|
Login.description = 'log in to use ops services';
|
|
117
120
|
Login.usage = 'login';
|
|
118
121
|
Login.examples = [
|
|
@@ -122,32 +125,32 @@ Login.examples = [
|
|
|
122
125
|
`$ ops login --deviceFlow`,
|
|
123
126
|
];
|
|
124
127
|
Login.flags = {
|
|
125
|
-
servicePrincipal:
|
|
128
|
+
servicePrincipal: Flags.boolean({
|
|
126
129
|
description: 'authenticate using service principal credentials',
|
|
127
130
|
default: false,
|
|
128
131
|
}),
|
|
129
|
-
deviceFlow:
|
|
132
|
+
deviceFlow: Flags.boolean({
|
|
130
133
|
description: 'authenticate using device flow',
|
|
131
134
|
default: false,
|
|
132
135
|
}),
|
|
133
|
-
clientId:
|
|
136
|
+
clientId: Flags.string({
|
|
134
137
|
char: 'c',
|
|
135
138
|
env: 'AZURE_CLIENT_ID',
|
|
136
139
|
description: '[DEPRECATED] (application) client id',
|
|
137
140
|
}),
|
|
138
|
-
secret:
|
|
141
|
+
secret: Flags.string({
|
|
139
142
|
char: 's',
|
|
140
143
|
env: 'AZURE_CLIENT_SECRET',
|
|
141
144
|
description: '[DEPRECATED] client secret',
|
|
142
145
|
}),
|
|
143
|
-
npm:
|
|
146
|
+
npm: Flags.boolean({
|
|
144
147
|
description: 'register also for npm',
|
|
145
148
|
default: false,
|
|
146
149
|
}),
|
|
147
|
-
skipCI:
|
|
150
|
+
skipCI: Flags.string({
|
|
148
151
|
description: 'Skip login if environment variables is set',
|
|
149
152
|
}),
|
|
150
|
-
force:
|
|
153
|
+
force: Flags.boolean({
|
|
151
154
|
description: 'Force a change of login token',
|
|
152
155
|
default: false,
|
|
153
156
|
}),
|
|
@@ -167,3 +170,4 @@ Login.responsePageContent = `
|
|
|
167
170
|
</script>
|
|
168
171
|
</body>
|
|
169
172
|
</html>`;
|
|
173
|
+
export default Login;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export default class NpmCheckPublish extends CommandBase {
|
|
1
|
+
import CommandBase from '../../command.base.js';
|
|
2
|
+
import { AzurePackageArray, NpmPackage } from '../../types/npm.types.js';
|
|
3
|
+
export default class NpmCheckPublish extends CommandBase<typeof NpmCheckPublish> {
|
|
5
4
|
static description: string;
|
|
6
5
|
static usage: string;
|
|
7
6
|
static examples: string[];
|
|
8
7
|
static flags: {
|
|
9
|
-
package:
|
|
10
|
-
exclude:
|
|
11
|
-
version:
|
|
12
|
-
pat:
|
|
8
|
+
package: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
exclude: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
pat: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
12
|
};
|
|
14
13
|
checkPackagesExists(packages: NpmPackage[], allPackages: AzurePackageArray, version: string): Promise<void>;
|
|
15
14
|
run(): Promise<void>;
|
|
@@ -1,77 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Flags, ux } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import CommandBase from '../../command.base.js';
|
|
5
|
+
import NpmContext from '../../lib/npm.js';
|
|
6
|
+
class NpmCheckPublish extends CommandBase {
|
|
7
|
+
checkPackagesExists(packages, allPackages, version) {
|
|
8
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
let errorCount = 0;
|
|
10
|
+
for (const pkg of packages) {
|
|
11
|
+
ux.action.start(`${pkg.name}@${version}`, undefined, { stdout: true });
|
|
12
|
+
const matchedPackage = allPackages.value.find(azurePackage => azurePackage.name === pkg.name);
|
|
13
|
+
if (!matchedPackage) {
|
|
14
|
+
ux.action.stop(`${chalk.red('package missing')}`);
|
|
15
|
+
errorCount++;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const matchVersion = matchedPackage.versions.find(azurePackageVersion => azurePackageVersion.version === version);
|
|
19
|
+
if (!matchVersion) {
|
|
20
|
+
ux.action.stop(`${chalk.red('version missing')}`);
|
|
21
|
+
errorCount++;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
ux.action.stop(`${chalk.green('exists')}`);
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.red('version missing')}`);
|
|
22
|
-
errorCount++;
|
|
23
|
-
continue;
|
|
26
|
+
if (errorCount > 0) {
|
|
27
|
+
throw new Error(`${errorCount} packages or versions missing!`);
|
|
24
28
|
}
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
if (errorCount > 0) {
|
|
28
|
-
throw new Error(`${errorCount} packages or versions missing!`);
|
|
29
|
-
}
|
|
29
|
+
});
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
31
|
+
run() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
try {
|
|
34
|
+
// eslint-disable-next-line unicorn/no-await-expression-member
|
|
35
|
+
const { flags } = (yield this.parse(NpmCheckPublish)).flags;
|
|
36
|
+
const npmContext = new NpmContext();
|
|
37
|
+
ux.action.start('Parsing packages to check', undefined, { stdout: true });
|
|
38
|
+
const packages = yield npmContext.packageList(this, flags.package, flags.exclude);
|
|
39
|
+
ux.action.stop(`${chalk.green('done')}`);
|
|
40
|
+
ux.action.start('Getting list of available packages', undefined, { stdout: true });
|
|
41
|
+
// eslint-disable-next-line unicorn/no-await-expression-member
|
|
42
|
+
const allPackages = JSON.parse((yield npmContext.getAllNpmPackages(flags.pat)).data);
|
|
43
|
+
ux.action.stop(`${chalk.green('done')}`);
|
|
44
|
+
yield this.checkPackagesExists(packages, allPackages, flags.version);
|
|
45
|
+
ux.action.stop('success');
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
ux.action.stop('error');
|
|
50
|
+
this.error(`${error.message}`);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
|
-
exports.default = NpmCheckPublish;
|
|
51
55
|
NpmCheckPublish.description = 'check if npm packages were published';
|
|
52
56
|
NpmCheckPublish.usage = 'npm:check-publish [options]';
|
|
53
57
|
NpmCheckPublish.examples = [
|
|
54
58
|
'$ ops npm:check-publish -v 6.0.1',
|
|
55
59
|
'$ ops npm:check-publish -p @adinsure/* -v 6.0.0',
|
|
56
|
-
'$ ops npm:check-publish -p @adinsure/* -x @adisure/demo -v 6.0.0'
|
|
60
|
+
'$ ops npm:check-publish -p @adinsure/* -x @adisure/demo -v 6.0.0',
|
|
57
61
|
];
|
|
58
62
|
NpmCheckPublish.flags = {
|
|
59
|
-
package:
|
|
63
|
+
package: Flags.string({
|
|
60
64
|
char: 'p',
|
|
61
65
|
description: 'package name filter you want to check',
|
|
62
|
-
multiple: true
|
|
66
|
+
multiple: true,
|
|
63
67
|
}),
|
|
64
|
-
exclude:
|
|
68
|
+
exclude: Flags.string({
|
|
65
69
|
char: 'x',
|
|
66
70
|
description: 'exclude packages from filter',
|
|
67
|
-
multiple: true
|
|
71
|
+
multiple: true,
|
|
68
72
|
}),
|
|
69
|
-
version:
|
|
73
|
+
version: Flags.string({
|
|
70
74
|
char: 'v',
|
|
71
75
|
description: 'version we want to check if published',
|
|
72
|
-
required: true
|
|
76
|
+
required: true,
|
|
73
77
|
}),
|
|
74
|
-
pat:
|
|
75
|
-
description: 'PAT token or AZURE_DEVOPS_EXT_PAT environment variable'
|
|
78
|
+
pat: Flags.string({
|
|
79
|
+
description: 'PAT token or AZURE_DEVOPS_EXT_PAT environment variable',
|
|
76
80
|
}),
|
|
77
81
|
};
|
|
82
|
+
export default NpmCheckPublish;
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export default class NpmDependencyUpdate extends CommandBase {
|
|
1
|
+
import CommandBase from '../../command.base.js';
|
|
2
|
+
import { NpmPackage } from '../../types/npm.types.js';
|
|
3
|
+
export default class NpmDependencyUpdate extends CommandBase<typeof NpmDependencyUpdate> {
|
|
5
4
|
static description: string;
|
|
6
5
|
static usage: string;
|
|
7
6
|
static examples: string[];
|
|
8
7
|
static args: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
description: string;
|
|
12
|
-
}[];
|
|
8
|
+
version: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
13
10
|
static flags: {
|
|
14
|
-
filter:
|
|
15
|
-
exclude:
|
|
16
|
-
force: import("@oclif/
|
|
11
|
+
filter: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
exclude: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
17
14
|
};
|
|
18
15
|
/**
|
|
19
16
|
* Update dependencies in package.json files for @adinsure packages
|
|
17
|
+
* @param {string} newVersion New version to update to
|
|
18
|
+
* @param {NpmPackage[]} packages Packages to update
|
|
19
|
+
* @param {boolean} [force=false] Force the update
|
|
20
|
+
* @param {string[]} filter Regular expressions filter for packages
|
|
21
|
+
* @returns {Prmoise<void>} Void Promise
|
|
20
22
|
*/
|
|
21
|
-
updateDependencies(newVersion: string,
|
|
23
|
+
updateDependencies(newVersion: string, packages: NpmPackage[], force?: boolean, filter?: string[]): Promise<void>;
|
|
22
24
|
run(): Promise<undefined>;
|
|
23
25
|
}
|