confluence-cli 1.29.1 → 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 +2 -2
- package/package.json +1 -1
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,12 +1,12 @@
|
|
|
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
12
|
"axios": "^1.15.0",
|