bitbucketdc-cli 1.0.7 → 1.0.8
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/dist/index.js +24 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,6 +6,28 @@ import { Command as Command8 } from "commander";
|
|
|
6
6
|
|
|
7
7
|
// src/utils/client.ts
|
|
8
8
|
import { BitbucketClient } from "bitbucket-data-center-client";
|
|
9
|
+
|
|
10
|
+
// src/utils/credentials.ts
|
|
11
|
+
function getCredentialInfo() {
|
|
12
|
+
const baseUrl = process.env.BITBUCKET_URL;
|
|
13
|
+
const token = process.env.BITBUCKET_TOKEN;
|
|
14
|
+
return {
|
|
15
|
+
environment: {
|
|
16
|
+
BITBUCKET_URL: {
|
|
17
|
+
value: baseUrl ?? null,
|
|
18
|
+
description: "Your Bitbucket Server base URL (e.g., https://bitbucket.example.com)"
|
|
19
|
+
},
|
|
20
|
+
BITBUCKET_TOKEN: {
|
|
21
|
+
value: token ? "<set>" : null,
|
|
22
|
+
description: "Personal Access Token"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
tokenUrl: `${baseUrl ?? "https://bitbucket.example.com"}/plugins/servlet/access-tokens/users/<username>/manage`,
|
|
26
|
+
hint: "Export environment variables in your shell profile (e.g., ~/.zshrc)."
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/utils/client.ts
|
|
9
31
|
function getClient() {
|
|
10
32
|
const baseUrl = process.env.BITBUCKET_URL;
|
|
11
33
|
const token = process.env.BITBUCKET_TOKEN;
|
|
@@ -14,11 +36,7 @@ function getClient() {
|
|
|
14
36
|
process.stderr.write(
|
|
15
37
|
`${JSON.stringify({
|
|
16
38
|
error: `Missing required environment variables: ${missing.join(", ")}`,
|
|
17
|
-
|
|
18
|
-
BITBUCKET_URL: "Your Bitbucket Server base URL (e.g., https://bitbucket.example.com)",
|
|
19
|
-
BITBUCKET_TOKEN: "Personal Access Token \u2014 generate in Bitbucket > Profile > Personal Access Tokens"
|
|
20
|
-
},
|
|
21
|
-
hint: "Export these in your shell profile (e.g., ~/.zshrc)."
|
|
39
|
+
...getCredentialInfo()
|
|
22
40
|
})}
|
|
23
41
|
`
|
|
24
42
|
);
|
|
@@ -69,7 +87,7 @@ function handleError(err) {
|
|
|
69
87
|
process.stderr.write(
|
|
70
88
|
`${JSON.stringify({
|
|
71
89
|
error: "Authentication failed (HTTP 401)",
|
|
72
|
-
|
|
90
|
+
...getCredentialInfo()
|
|
73
91
|
})}
|
|
74
92
|
`
|
|
75
93
|
);
|