confluence-cli 2.0.1 → 2.0.2
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 +15 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/lib/confluence-client.js
CHANGED
|
@@ -496,14 +496,23 @@ class ConfluenceClient {
|
|
|
496
496
|
return { html, userMap: new Map() };
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
-
// Fetch user info for all keys in parallel
|
|
500
|
-
|
|
501
|
-
const
|
|
499
|
+
// Fetch user info for all keys in parallel; isolate per-key failures so a
|
|
500
|
+
// single rejection doesn't drop display names for the rest of the page.
|
|
501
|
+
const keysArray = Array.from(userKeys);
|
|
502
|
+
const results = await Promise.allSettled(
|
|
503
|
+
keysArray.map(key => this.getUserByKey(key))
|
|
504
|
+
);
|
|
502
505
|
|
|
503
|
-
// Build userkey -> displayName map
|
|
506
|
+
// Build userkey -> displayName map. On rejection, fall back to the raw
|
|
507
|
+
// userkey (mirrors getUserByKey's own caught-error fallback).
|
|
504
508
|
const userMap = new Map();
|
|
505
|
-
|
|
506
|
-
|
|
509
|
+
results.forEach((result, i) => {
|
|
510
|
+
const key = keysArray[i];
|
|
511
|
+
if (result.status === 'fulfilled') {
|
|
512
|
+
userMap.set(result.value.key, result.value.displayName);
|
|
513
|
+
} else {
|
|
514
|
+
userMap.set(key, key);
|
|
515
|
+
}
|
|
507
516
|
});
|
|
508
517
|
|
|
509
518
|
// Replace userkey references with display names in HTML
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "confluence-cli",
|
|
9
|
-
"version": "2.0.
|
|
9
|
+
"version": "2.0.2",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^1.15.0",
|