confluencedc-cli 1.0.6 → 1.0.7
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 } from "commander";
|
|
|
6
6
|
|
|
7
7
|
// src/utils/client.ts
|
|
8
8
|
import { ConfluenceClient } from "confluence-data-center-client";
|
|
9
|
+
|
|
10
|
+
// src/utils/credentials.ts
|
|
11
|
+
function getCredentialInfo() {
|
|
12
|
+
const baseUrl = process.env.CONFLUENCE_URL;
|
|
13
|
+
const token = process.env.CONFLUENCE_TOKEN;
|
|
14
|
+
return {
|
|
15
|
+
environment: {
|
|
16
|
+
CONFLUENCE_URL: {
|
|
17
|
+
value: baseUrl ?? null,
|
|
18
|
+
description: "Your Confluence Server base URL (e.g., https://confluence.example.com)"
|
|
19
|
+
},
|
|
20
|
+
CONFLUENCE_TOKEN: {
|
|
21
|
+
value: token ? "<set>" : null,
|
|
22
|
+
description: "Personal Access Token"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
tokenUrl: `${baseUrl ?? "https://confluence.example.com"}/plugins/personalaccesstokens/usertokens.action`,
|
|
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.CONFLUENCE_URL;
|
|
11
33
|
const token = process.env.CONFLUENCE_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
|
-
CONFLUENCE_URL: "Your Confluence Server base URL (e.g., https://confluence.example.com)",
|
|
19
|
-
CONFLUENCE_TOKEN: "Personal Access Token \u2014 generate in Confluence > 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
|
);
|