confluence-cli 2.6.0 → 2.6.1
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/bin/confluence.js +3 -17
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/bin/confluence.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
3
5
|
const { program } = require('commander');
|
|
4
6
|
const chalk = require('chalk');
|
|
5
7
|
const inquirer = require('inquirer');
|
|
@@ -195,8 +197,6 @@ program
|
|
|
195
197
|
.option('--dest <directory>', 'Target directory', './.claude/skills/confluence')
|
|
196
198
|
.option('-y, --yes', 'Skip confirmation prompt')
|
|
197
199
|
.action(async (options) => {
|
|
198
|
-
const fs = require('fs');
|
|
199
|
-
const path = require('path');
|
|
200
200
|
|
|
201
201
|
const skillSrc = path.join(__dirname, '..', 'plugins', 'confluence', 'skills', 'confluence', 'SKILL.md');
|
|
202
202
|
|
|
@@ -255,7 +255,6 @@ program
|
|
|
255
255
|
let content = '';
|
|
256
256
|
|
|
257
257
|
if (options.file) {
|
|
258
|
-
const fs = require('fs');
|
|
259
258
|
if (!fs.existsSync(options.file)) {
|
|
260
259
|
throw new Error(`File not found: ${options.file}`);
|
|
261
260
|
}
|
|
@@ -308,7 +307,6 @@ program
|
|
|
308
307
|
let content = '';
|
|
309
308
|
|
|
310
309
|
if (options.file) {
|
|
311
|
-
const fs = require('fs');
|
|
312
310
|
if (!fs.existsSync(options.file)) {
|
|
313
311
|
throw new Error(`File not found: ${options.file}`);
|
|
314
312
|
}
|
|
@@ -362,7 +360,6 @@ program
|
|
|
362
360
|
let content = null; // Use null to indicate no content change
|
|
363
361
|
|
|
364
362
|
if (options.file) {
|
|
365
|
-
const fs = require('fs');
|
|
366
363
|
if (!fs.existsSync(options.file)) {
|
|
367
364
|
throw new Error(`File not found: ${options.file}`);
|
|
368
365
|
}
|
|
@@ -615,7 +612,6 @@ program
|
|
|
615
612
|
console.log('');
|
|
616
613
|
|
|
617
614
|
if (options.output) {
|
|
618
|
-
const fs = require('fs');
|
|
619
615
|
fs.writeFileSync(options.output, pageData.content);
|
|
620
616
|
console.log(chalk.green(`✅ Content saved to: ${options.output}`));
|
|
621
617
|
console.log(chalk.yellow('💡 Edit the file and use "confluence update" to save changes'));
|
|
@@ -718,8 +714,6 @@ program
|
|
|
718
714
|
}
|
|
719
715
|
|
|
720
716
|
if (options.download) {
|
|
721
|
-
const fs = require('fs');
|
|
722
|
-
const path = require('path');
|
|
723
717
|
const destDir = path.resolve(options.dest || '.');
|
|
724
718
|
fs.mkdirSync(destDir, { recursive: true });
|
|
725
719
|
|
|
@@ -795,8 +789,6 @@ program
|
|
|
795
789
|
throw new Error('At least one --file option is required.');
|
|
796
790
|
}
|
|
797
791
|
|
|
798
|
-
const fs = require('fs');
|
|
799
|
-
const path = require('path');
|
|
800
792
|
const config = getConfig(getProfileName());
|
|
801
793
|
assertWritable(config);
|
|
802
794
|
const client = new ConfluenceClient(config);
|
|
@@ -998,7 +990,6 @@ program
|
|
|
998
990
|
|
|
999
991
|
let value;
|
|
1000
992
|
if (options.file) {
|
|
1001
|
-
const fs = require('fs');
|
|
1002
993
|
const raw = fs.readFileSync(options.file, 'utf-8');
|
|
1003
994
|
try {
|
|
1004
995
|
value = JSON.parse(raw);
|
|
@@ -1248,7 +1239,6 @@ program
|
|
|
1248
1239
|
let content = '';
|
|
1249
1240
|
|
|
1250
1241
|
if (options.file) {
|
|
1251
|
-
const fs = require('fs');
|
|
1252
1242
|
if (!fs.existsSync(options.file)) {
|
|
1253
1243
|
throw new Error(`File not found: ${options.file}`);
|
|
1254
1244
|
}
|
|
@@ -1409,8 +1399,6 @@ program
|
|
|
1409
1399
|
try {
|
|
1410
1400
|
const config = getConfig(getProfileName());
|
|
1411
1401
|
const client = new ConfluenceClient(config);
|
|
1412
|
-
const fs = require('fs');
|
|
1413
|
-
const path = require('path');
|
|
1414
1402
|
|
|
1415
1403
|
if (options.recursive) {
|
|
1416
1404
|
await exportRecursive(client, fs, path, pageId, options);
|
|
@@ -1512,7 +1500,6 @@ function sanitizeFilename(filename) {
|
|
|
1512
1500
|
if (!filename || typeof filename !== 'string') {
|
|
1513
1501
|
return 'unnamed';
|
|
1514
1502
|
}
|
|
1515
|
-
const path = require('path');
|
|
1516
1503
|
const stripped = path.basename(filename.replace(/\\/g, '/'));
|
|
1517
1504
|
const cleaned = stripped
|
|
1518
1505
|
// eslint-disable-next-line no-control-regex
|
|
@@ -2186,7 +2173,6 @@ program
|
|
|
2186
2173
|
process.exit(1);
|
|
2187
2174
|
}
|
|
2188
2175
|
|
|
2189
|
-
const fs = require('fs');
|
|
2190
2176
|
let input;
|
|
2191
2177
|
if (options.inputFile) {
|
|
2192
2178
|
input = fs.readFileSync(options.inputFile, 'utf-8');
|
|
@@ -2214,7 +2200,7 @@ program
|
|
|
2214
2200
|
const { convert: htmlToText } = require('html-to-text');
|
|
2215
2201
|
output = htmlToText(input, { wordwrap: 130 });
|
|
2216
2202
|
} else if (options.inputFormat === 'html' && options.outputFormat === 'markdown') {
|
|
2217
|
-
output = converter.
|
|
2203
|
+
output = converter.htmlToMarkdown(input);
|
|
2218
2204
|
} else if (options.inputFormat === 'markdown' && options.outputFormat === 'text') {
|
|
2219
2205
|
const html = converter.markdown.render(input);
|
|
2220
2206
|
const { convert: htmlToText } = require('html-to-text');
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence-cli",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "confluence-cli",
|
|
9
|
-
"version": "2.6.
|
|
9
|
+
"version": "2.6.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "~1.15.2",
|