confluence-cli 1.29.0 → 1.30.0
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/lib/confluence-client.js +20 -0
- package/npm-shrinkwrap.json +14 -11
- package/package.json +2 -2
package/lib/confluence-client.js
CHANGED
|
@@ -136,6 +136,26 @@ class ConfluenceClient {
|
|
|
136
136
|
return prettyMatch[1];
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
// Handle tiny links (/wiki/x/<code>)
|
|
140
|
+
const tinyLinkMatch = pageIdOrUrl.match(/\/wiki\/x\/([A-Za-z0-9_-]+)/);
|
|
141
|
+
if (tinyLinkMatch) {
|
|
142
|
+
try {
|
|
143
|
+
const response = await this.client.get(pageIdOrUrl, {
|
|
144
|
+
maxRedirects: 0,
|
|
145
|
+
validateStatus: (status) => status >= 300 && status < 400
|
|
146
|
+
});
|
|
147
|
+
const redirectUrl = response.headers.location;
|
|
148
|
+
if (redirectUrl) {
|
|
149
|
+
return this.extractPageId(redirectUrl);
|
|
150
|
+
}
|
|
151
|
+
} catch (error) {
|
|
152
|
+
if (error.response && error.response.headers && error.response.headers.location) {
|
|
153
|
+
return this.extractPageId(error.response.headers.location);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
throw new Error(`Could not resolve page ID from tiny link: ${pageIdOrUrl}`);
|
|
157
|
+
}
|
|
158
|
+
|
|
139
159
|
// Handle display URLs - search by space and title
|
|
140
160
|
const displayMatch = pageIdOrUrl.match(/\/display\/([^/]+)\/(.+)/);
|
|
141
161
|
if (displayMatch) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "confluence-cli",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.30.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"axios": "^1.
|
|
12
|
+
"axios": "^1.15.0",
|
|
13
13
|
"chalk": "^4.1.2",
|
|
14
14
|
"commander": "^11.1.0",
|
|
15
15
|
"form-data": "^4.0.5",
|
|
@@ -1503,14 +1503,14 @@
|
|
|
1503
1503
|
"license": "MIT"
|
|
1504
1504
|
},
|
|
1505
1505
|
"node_modules/axios": {
|
|
1506
|
-
"version": "1.
|
|
1507
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.
|
|
1508
|
-
"integrity": "sha512-
|
|
1506
|
+
"version": "1.15.0",
|
|
1507
|
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz",
|
|
1508
|
+
"integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==",
|
|
1509
1509
|
"license": "MIT",
|
|
1510
1510
|
"dependencies": {
|
|
1511
1511
|
"follow-redirects": "^1.15.11",
|
|
1512
1512
|
"form-data": "^4.0.5",
|
|
1513
|
-
"proxy-from-env": "^
|
|
1513
|
+
"proxy-from-env": "^2.1.0"
|
|
1514
1514
|
}
|
|
1515
1515
|
},
|
|
1516
1516
|
"node_modules/axios-mock-adapter": {
|
|
@@ -4691,10 +4691,13 @@
|
|
|
4691
4691
|
}
|
|
4692
4692
|
},
|
|
4693
4693
|
"node_modules/proxy-from-env": {
|
|
4694
|
-
"version": "
|
|
4695
|
-
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-
|
|
4696
|
-
"integrity": "sha512-
|
|
4697
|
-
"license": "MIT"
|
|
4694
|
+
"version": "2.1.0",
|
|
4695
|
+
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
|
|
4696
|
+
"integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==",
|
|
4697
|
+
"license": "MIT",
|
|
4698
|
+
"engines": {
|
|
4699
|
+
"node": ">=10"
|
|
4700
|
+
}
|
|
4698
4701
|
},
|
|
4699
4702
|
"node_modules/punycode": {
|
|
4700
4703
|
"version": "2.3.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "A command-line interface for Atlassian Confluence with page creation and editing capabilities",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"author": "pchuri",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"axios": "^1.
|
|
26
|
+
"axios": "^1.15.0",
|
|
27
27
|
"chalk": "^4.1.2",
|
|
28
28
|
"commander": "^11.1.0",
|
|
29
29
|
"form-data": "^4.0.5",
|