confluencedc-cli 1.0.0 → 1.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/dist/commands/attachment/delete.d.ts.map +1 -1
- package/dist/commands/attachment/delete.js +4 -9
- package/dist/commands/attachment/delete.js.map +1 -1
- package/dist/commands/attachment/download-all.d.ts.map +1 -1
- package/dist/commands/attachment/download-all.js +30 -35
- package/dist/commands/attachment/download-all.js.map +1 -1
- package/dist/commands/attachment/download.d.ts.map +1 -1
- package/dist/commands/attachment/download.js +4 -9
- package/dist/commands/attachment/download.js.map +1 -1
- package/dist/commands/attachment/list.d.ts.map +1 -1
- package/dist/commands/attachment/list.js +9 -14
- package/dist/commands/attachment/list.js.map +1 -1
- package/dist/commands/attachment/upload.d.ts.map +1 -1
- package/dist/commands/attachment/upload.js +26 -31
- package/dist/commands/attachment/upload.js.map +1 -1
- package/dist/commands/comment/add.d.ts.map +1 -1
- package/dist/commands/comment/add.js +4 -9
- package/dist/commands/comment/add.js.map +1 -1
- package/dist/commands/comment/delete.d.ts.map +1 -1
- package/dist/commands/comment/delete.js +4 -9
- package/dist/commands/comment/delete.js.map +1 -1
- package/dist/commands/comment/list.d.ts.map +1 -1
- package/dist/commands/comment/list.js +11 -16
- package/dist/commands/comment/list.js.map +1 -1
- package/dist/commands/comment/reply.d.ts.map +1 -1
- package/dist/commands/comment/reply.js +8 -13
- package/dist/commands/comment/reply.js.map +1 -1
- package/dist/commands/comment/update.d.ts.map +1 -1
- package/dist/commands/comment/update.js +6 -11
- package/dist/commands/comment/update.js.map +1 -1
- package/dist/commands/label/add.d.ts.map +1 -1
- package/dist/commands/label/add.js +4 -9
- package/dist/commands/label/add.js.map +1 -1
- package/dist/commands/label/list.d.ts.map +1 -1
- package/dist/commands/label/list.js +4 -9
- package/dist/commands/label/list.js.map +1 -1
- package/dist/commands/page/children.d.ts.map +1 -1
- package/dist/commands/page/children.js +9 -14
- package/dist/commands/page/children.js.map +1 -1
- package/dist/commands/page/create.d.ts.map +1 -1
- package/dist/commands/page/create.js +10 -15
- package/dist/commands/page/create.js.map +1 -1
- package/dist/commands/page/delete.d.ts.map +1 -1
- package/dist/commands/page/delete.js +4 -9
- package/dist/commands/page/delete.js.map +1 -1
- package/dist/commands/page/get.d.ts.map +1 -1
- package/dist/commands/page/get.js +33 -38
- package/dist/commands/page/get.js.map +1 -1
- package/dist/commands/page/history.d.ts.map +1 -1
- package/dist/commands/page/history.js +4 -9
- package/dist/commands/page/history.js.map +1 -1
- package/dist/commands/page/update.d.ts.map +1 -1
- package/dist/commands/page/update.js +16 -21
- package/dist/commands/page/update.js.map +1 -1
- package/dist/commands/search/search.d.ts.map +1 -1
- package/dist/commands/search/search.js +4 -9
- package/dist/commands/search/search.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/client.js +1 -1
- package/dist/utils/client.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAUtD"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function deleteAttachment(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('delete <attachmentId>')
|
|
6
6
|
.description('Delete an attachment')
|
|
7
7
|
.addHelpText('after', '\nExamples:\n confluencedc attachment delete att12345')
|
|
8
8
|
.action(async (attachmentId) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
output({ deleted: true, attachmentId });
|
|
13
|
-
}
|
|
14
|
-
catch (err) {
|
|
15
|
-
handleError(err);
|
|
16
|
-
}
|
|
9
|
+
const client = getClient();
|
|
10
|
+
await client.attachments.delete({ attachmentId });
|
|
11
|
+
output({ deleted: true, attachmentId });
|
|
17
12
|
});
|
|
18
13
|
}
|
|
19
14
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/attachment/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/attachment/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,gBAAgB,CAAC,MAAe;IAC9C,MAAM;SACH,OAAO,CAAC,uBAAuB,CAAC;SAChC,WAAW,CAAC,sBAAsB,CAAC;SACnC,WAAW,CAAC,OAAO,EAAE,wDAAwD,CAAC;SAC9E,MAAM,CAAC,KAAK,EAAE,YAAoB,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download-all.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/download-all.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"download-all.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/download-all.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA4CjD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdirSync } from 'fs';
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { getClient } from '../../utils/client.js';
|
|
4
|
-
import { output
|
|
4
|
+
import { output } from '../../utils/output.js';
|
|
5
5
|
export function downloadAll(parent) {
|
|
6
6
|
parent
|
|
7
7
|
.command('download-all <pageId>')
|
|
@@ -9,43 +9,38 @@ export function downloadAll(parent) {
|
|
|
9
9
|
.requiredOption('--output <dir>', 'Local directory to save attachments into')
|
|
10
10
|
.addHelpText('after', '\nExamples:\n confluencedc attachment download-all 12345 --output ./downloads')
|
|
11
11
|
.action(async (pageId, opts) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const client = getClient();
|
|
13
|
+
mkdirSync(opts.output, { recursive: true });
|
|
14
|
+
const attachments = await client.attachments.get({ pageId });
|
|
15
|
+
const items = attachments.results ?? [];
|
|
16
|
+
if (items.length === 0) {
|
|
17
|
+
output({ pageId, downloaded: 0, files: [] });
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const results = [];
|
|
21
|
+
const failed = [];
|
|
22
|
+
for (const att of items) {
|
|
23
|
+
const downloadUrl = att._links?.download;
|
|
24
|
+
if (!downloadUrl) {
|
|
25
|
+
failed.push({ filename: att.title, error: 'No download URL' });
|
|
26
|
+
continue;
|
|
20
27
|
}
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
const destPath = join(opts.output, att.title);
|
|
30
|
-
try {
|
|
31
|
-
await client.attachments.download({ downloadUrl, destinationPath: destPath });
|
|
32
|
-
results.push({ filename: att.title, size: att.fileSize ?? 0, path: destPath });
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
failed.push({ filename: att.title, error: String(err) });
|
|
36
|
-
}
|
|
28
|
+
const destPath = join(opts.output, att.title);
|
|
29
|
+
try {
|
|
30
|
+
await client.attachments.download({ downloadUrl, destinationPath: destPath });
|
|
31
|
+
results.push({ filename: att.title, size: att.fileSize ?? 0, path: destPath });
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
failed.push({ filename: att.title, error: String(err) });
|
|
37
35
|
}
|
|
38
|
-
output({
|
|
39
|
-
pageId,
|
|
40
|
-
downloaded: results.length,
|
|
41
|
-
total: items.length,
|
|
42
|
-
files: results,
|
|
43
|
-
...(failed.length > 0 && { failed }),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
handleError(err);
|
|
48
36
|
}
|
|
37
|
+
output({
|
|
38
|
+
pageId,
|
|
39
|
+
downloaded: results.length,
|
|
40
|
+
total: items.length,
|
|
41
|
+
files: results,
|
|
42
|
+
...(failed.length > 0 && { failed }),
|
|
43
|
+
});
|
|
49
44
|
});
|
|
50
45
|
}
|
|
51
46
|
//# sourceMappingURL=download-all.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download-all.js","sourceRoot":"","sources":["../../../src/commands/attachment/download-all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"download-all.js","sourceRoot":"","sources":["../../../src/commands/attachment/download-all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,MAAM;SACH,OAAO,CAAC,uBAAuB,CAAC;SAChC,WAAW,CAAC,sCAAsC,CAAC;SACnD,cAAc,CAAC,gBAAgB,EAAE,0CAA0C,CAAC;SAC5E,WAAW,CAAC,OAAO,EAAE,gFAAgF,CAAC;SACtG,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAwB,EAAE,EAAE;QACzD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAE5C,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7D,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,IAAI,EAAE,CAAC;QAExC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7C,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAuD,EAAE,CAAC;QACvE,MAAM,MAAM,GAA0C,EAAE,CAAC;QAEzD,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC;YACzC,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC;gBAC/D,SAAS;YACX,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;YAC9C,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAC9E,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YACjF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;QAED,MAAM,CAAC;YACL,MAAM;YACN,UAAU,EAAE,OAAO,CAAC,MAAM;YAC1B,KAAK,EAAE,KAAK,CAAC,MAAM;YACnB,KAAK,EAAE,OAAO;YACd,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;SACrC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAe9C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function download(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('download')
|
|
@@ -8,14 +8,9 @@ export function download(parent) {
|
|
|
8
8
|
.requiredOption('--output <path>', 'Local file path to save to')
|
|
9
9
|
.addHelpText('after', '\nExamples:\n confluencedc attachment download --url "/download/attachments/12345/report.pdf" --output ./report.pdf')
|
|
10
10
|
.action(async (opts) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
output({ downloaded: true, path: opts.output });
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
handleError(err);
|
|
18
|
-
}
|
|
11
|
+
const client = getClient();
|
|
12
|
+
await client.attachments.download({ downloadUrl: opts.url, destinationPath: opts.output });
|
|
13
|
+
output({ downloaded: true, path: opts.output });
|
|
19
14
|
});
|
|
20
15
|
}
|
|
21
16
|
//# sourceMappingURL=download.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.js","sourceRoot":"","sources":["../../../src/commands/attachment/download.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"download.js","sourceRoot":"","sources":["../../../src/commands/attachment/download.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,qCAAqC,CAAC;SAClD,cAAc,CAAC,qBAAqB,EAAE,8CAA8C,CAAC;SACrF,cAAc,CAAC,iBAAiB,EAAE,4BAA4B,CAAC;SAC/D,WAAW,CACV,OAAO,EACP,sHAAsH,CACvH;SACA,MAAM,CAAC,KAAK,EAAE,IAAqC,EAAE,EAAE;QACtD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3F,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAqB1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function list(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('list <pageId>')
|
|
@@ -9,19 +9,14 @@ export function list(parent) {
|
|
|
9
9
|
.option('--filename <name>', 'Filter by filename')
|
|
10
10
|
.addHelpText('after', '\nExamples:\n confluencedc attachment list 12345\n confluencedc attachment list 12345 --filename report.pdf')
|
|
11
11
|
.action(async (pageId, opts) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
output(result);
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
handleError(err);
|
|
24
|
-
}
|
|
12
|
+
const client = getClient();
|
|
13
|
+
const result = await client.attachments.get({
|
|
14
|
+
pageId,
|
|
15
|
+
start: opts.start,
|
|
16
|
+
limit: opts.limit,
|
|
17
|
+
filename: opts.filename,
|
|
18
|
+
});
|
|
19
|
+
output(result);
|
|
25
20
|
});
|
|
26
21
|
}
|
|
27
22
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/attachment/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/attachment/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,2BAA2B,CAAC;SACxC,MAAM,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,CAAC;SACtD,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;SACjD,WAAW,CACV,OAAO,EACP,+GAA+G,CAChH;SACA,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAA2D,EAAE,EAAE;QAC5F,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC;YAC1C,MAAM;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/commands/attachment/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAyC5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function upload(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('upload <pageId>')
|
|
@@ -9,38 +9,33 @@ export function upload(parent) {
|
|
|
9
9
|
.option('--no-minor-edit', 'Mark as regular edit (default: minor edit)')
|
|
10
10
|
.addHelpText('after', '\nExamples:\n confluencedc attachment upload 12345 --files report.pdf\n confluencedc attachment upload 12345 --files file1.txt,file2.pdf --comment "Updated docs"')
|
|
11
11
|
.action(async (pageId, opts) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
failed.push({ filePath, error: err instanceof Error ? err.message : String(err) });
|
|
32
|
-
}
|
|
12
|
+
const client = getClient();
|
|
13
|
+
const filePaths = opts.files
|
|
14
|
+
.split(',')
|
|
15
|
+
.map((p) => p.trim())
|
|
16
|
+
.filter(Boolean);
|
|
17
|
+
const results = [];
|
|
18
|
+
const failed = [];
|
|
19
|
+
for (const filePath of filePaths) {
|
|
20
|
+
try {
|
|
21
|
+
const result = await client.attachments.upload({
|
|
22
|
+
pageId,
|
|
23
|
+
filePath,
|
|
24
|
+
comment: opts.comment,
|
|
25
|
+
minorEdit: opts.minorEdit,
|
|
26
|
+
});
|
|
27
|
+
results.push({ filename: result.title, id: result.id });
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
failed.push({ filePath, error: err instanceof Error ? err.message : String(err) });
|
|
33
31
|
}
|
|
34
|
-
output({
|
|
35
|
-
pageId,
|
|
36
|
-
uploaded: results.length,
|
|
37
|
-
files: results,
|
|
38
|
-
...(failed.length > 0 && { failed }),
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
handleError(err);
|
|
43
32
|
}
|
|
33
|
+
output({
|
|
34
|
+
pageId,
|
|
35
|
+
uploaded: results.length,
|
|
36
|
+
files: results,
|
|
37
|
+
...(failed.length > 0 && { failed }),
|
|
38
|
+
});
|
|
44
39
|
});
|
|
45
40
|
}
|
|
46
41
|
//# sourceMappingURL=upload.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/commands/attachment/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/commands/attachment/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,8BAA8B,CAAC;SAC3C,cAAc,CAAC,iBAAiB,EAAE,kCAAkC,CAAC;SACrE,MAAM,CAAC,kBAAkB,EAAE,oBAAoB,CAAC;SAChD,MAAM,CAAC,iBAAiB,EAAE,4CAA4C,CAAC;SACvE,WAAW,CACV,OAAO,EACP,qKAAqK,CACtK;SACA,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAA8D,EAAE,EAAE;QAC/F,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK;aACzB,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,OAAO,CAAC,CAAC;QACnB,MAAM,OAAO,GAAuC,EAAE,CAAC;QACvD,MAAM,MAAM,GAA0C,EAAE,CAAC;QAEzD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;oBAC7C,MAAM;oBACN,QAAQ;oBACR,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,SAAS,EAAE,IAAI,CAAC,SAAS;iBAC1B,CAAC,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1D,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACrF,CAAC;QACH,CAAC;QAED,MAAM,CAAC;YACL,MAAM;YACN,QAAQ,EAAE,OAAO,CAAC,MAAM;YACxB,KAAK,EAAE,OAAO;YACd,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;SACrC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAWzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function add(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('add <pageId>')
|
|
@@ -7,14 +7,9 @@ export function add(parent) {
|
|
|
7
7
|
.requiredOption('--body <text>', 'Comment body in wiki markup')
|
|
8
8
|
.addHelpText('after', '\nExamples:\n confluencedc comment add 12345 --body "Looks good, approved."')
|
|
9
9
|
.action(async (pageId, opts) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
output(result);
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
handleError(err);
|
|
17
|
-
}
|
|
10
|
+
const client = getClient();
|
|
11
|
+
const result = await client.comments.add({ pageId, body: opts.body });
|
|
12
|
+
output(result);
|
|
18
13
|
});
|
|
19
14
|
}
|
|
20
15
|
//# sourceMappingURL=add.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/comment/add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/comment/add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,yBAAyB,CAAC;SACtC,cAAc,CAAC,eAAe,EAAE,6BAA6B,CAAC;SAC9D,WAAW,CAAC,OAAO,EAAE,8EAA8E,CAAC;SACpG,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAsB,EAAE,EAAE;QACvD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAUnD"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function deleteComment(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('delete <commentId>')
|
|
6
6
|
.description('Delete a comment')
|
|
7
7
|
.addHelpText('after', '\nExamples:\n confluencedc comment delete 67890')
|
|
8
8
|
.action(async (commentId) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
output({ deleted: true, commentId });
|
|
13
|
-
}
|
|
14
|
-
catch (err) {
|
|
15
|
-
handleError(err);
|
|
16
|
-
}
|
|
9
|
+
const client = getClient();
|
|
10
|
+
await client.comments.delete({ commentId });
|
|
11
|
+
output({ deleted: true, commentId });
|
|
17
12
|
});
|
|
18
13
|
}
|
|
19
14
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/comment/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/comment/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAC,MAAe;IAC3C,MAAM;SACH,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CAAC,kBAAkB,CAAC;SAC/B,WAAW,CAAC,OAAO,EAAE,kDAAkD,CAAC;SACxE,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,EAAE;QAClC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QAC5C,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwB1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function list(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('list <pageId>')
|
|
@@ -10,21 +10,16 @@ export function list(parent) {
|
|
|
10
10
|
.option('--expand <expand>', 'Expand options (e.g., "children.comment,body.storage")')
|
|
11
11
|
.addHelpText('after', '\nExamples:\n confluencedc comment list 12345\n confluencedc comment list 12345 --depth all --limit 50\n confluencedc comment list 12345 --expand children.comment,body.storage')
|
|
12
12
|
.action(async (pageId, opts) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
output(result);
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
handleError(err);
|
|
27
|
-
}
|
|
13
|
+
const client = getClient();
|
|
14
|
+
const expand = opts.expand ? `body.storage,${opts.expand}` : undefined;
|
|
15
|
+
const result = await client.comments.get({
|
|
16
|
+
pageId,
|
|
17
|
+
start: opts.start,
|
|
18
|
+
limit: opts.limit,
|
|
19
|
+
depth: opts.depth,
|
|
20
|
+
expand,
|
|
21
|
+
});
|
|
22
|
+
output(result);
|
|
28
23
|
});
|
|
29
24
|
}
|
|
30
25
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/comment/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/comment/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,CAAC;SACtD,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,MAAM,CAAC,iBAAiB,EAAE,6CAA6C,CAAC;SACxE,MAAM,CAAC,mBAAmB,EAAE,wDAAwD,CAAC;SACrF,WAAW,CACV,OAAO,EACP,oLAAoL,CACrL;SACA,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAyE,EAAE,EAAE;QAC1G,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;YACvC,MAAM;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM;SACP,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAgB3C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function reply(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('reply <commentId>')
|
|
@@ -8,18 +8,13 @@ export function reply(parent) {
|
|
|
8
8
|
.requiredOption('--body <text>', 'Reply body in wiki markup')
|
|
9
9
|
.addHelpText('after', '\nExamples:\n confluencedc comment reply 67890 --page 12345 --body "Good point, agreed."')
|
|
10
10
|
.action(async (commentId, opts) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
output(result);
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
handleError(err);
|
|
22
|
-
}
|
|
11
|
+
const client = getClient();
|
|
12
|
+
const result = await client.comments.reply({
|
|
13
|
+
pageId: opts.page,
|
|
14
|
+
parentCommentId: commentId,
|
|
15
|
+
body: opts.body,
|
|
16
|
+
});
|
|
17
|
+
output(result);
|
|
23
18
|
});
|
|
24
19
|
}
|
|
25
20
|
//# sourceMappingURL=reply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reply.js","sourceRoot":"","sources":["../../../src/commands/comment/reply.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"reply.js","sourceRoot":"","sources":["../../../src/commands/comment/reply.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,KAAK,CAAC,MAAe;IACnC,MAAM;SACH,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,oBAAoB,CAAC;SACjC,cAAc,CAAC,iBAAiB,EAAE,gCAAgC,CAAC;SACnE,cAAc,CAAC,eAAe,EAAE,2BAA2B,CAAC;SAC5D,WAAW,CAAC,OAAO,EAAE,2FAA2F,CAAC;SACjH,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,IAAoC,EAAE,EAAE;QACxE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YACzC,MAAM,EAAE,IAAI,CAAC,IAAI;YACjB,eAAe,EAAE,SAAS;YAC1B,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/comment/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAa5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function update(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('update <commentId>')
|
|
@@ -7,16 +7,11 @@ export function update(parent) {
|
|
|
7
7
|
.requiredOption('--body <text>', 'New comment body in wiki markup')
|
|
8
8
|
.addHelpText('after', '\nExamples:\n confluencedc comment update 67890 --body "Updated text"')
|
|
9
9
|
.action(async (commentId, opts) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
output(result);
|
|
16
|
-
}
|
|
17
|
-
catch (err) {
|
|
18
|
-
handleError(err);
|
|
19
|
-
}
|
|
10
|
+
const client = getClient();
|
|
11
|
+
const current = await client.comments.getById(commentId);
|
|
12
|
+
const version = current.version?.number ?? 1;
|
|
13
|
+
const result = await client.comments.update({ commentId, body: opts.body, version });
|
|
14
|
+
output(result);
|
|
20
15
|
});
|
|
21
16
|
}
|
|
22
17
|
//# sourceMappingURL=update.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/comment/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/comment/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CAAC,kBAAkB,CAAC;SAC/B,cAAc,CAAC,eAAe,EAAE,iCAAiC,CAAC;SAClE,WAAW,CAAC,OAAO,EAAE,wEAAwE,CAAC;SAC9F,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,IAAsB,EAAE,EAAE;QAC1D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACrF,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/label/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/label/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAWzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function add(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('add <pageId>')
|
|
@@ -7,14 +7,9 @@ export function add(parent) {
|
|
|
7
7
|
.requiredOption('--label <name>', 'Label name')
|
|
8
8
|
.addHelpText('after', '\nExamples:\n confluencedc label add 12345 --label important')
|
|
9
9
|
.action(async (pageId, opts) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
output(result);
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
handleError(err);
|
|
17
|
-
}
|
|
10
|
+
const client = getClient();
|
|
11
|
+
const result = await client.labels.add({ pageId, label: opts.label });
|
|
12
|
+
output(result);
|
|
18
13
|
});
|
|
19
14
|
}
|
|
20
15
|
//# sourceMappingURL=add.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/label/add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/label/add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,uBAAuB,CAAC;SACpC,cAAc,CAAC,gBAAgB,EAAE,YAAY,CAAC;SAC9C,WAAW,CAAC,OAAO,EAAE,+DAA+D,CAAC;SACrF,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAuB,EAAE,EAAE;QACxD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/label/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/label/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAY1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function list(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('list <pageId>')
|
|
@@ -8,14 +8,9 @@ export function list(parent) {
|
|
|
8
8
|
.option('--limit <number>', 'Maximum results', parseInt)
|
|
9
9
|
.addHelpText('after', '\nExamples:\n confluencedc label list 12345')
|
|
10
10
|
.action(async (pageId, opts) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
output(result);
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
handleError(err);
|
|
18
|
-
}
|
|
11
|
+
const client = getClient();
|
|
12
|
+
const result = await client.labels.get({ pageId, start: opts.start, limit: opts.limit });
|
|
13
|
+
output(result);
|
|
19
14
|
});
|
|
20
15
|
}
|
|
21
16
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/label/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/label/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,sBAAsB,CAAC;SACnC,MAAM,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,CAAC;SACtD,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,WAAW,CAAC,OAAO,EAAE,8CAA8C,CAAC;SACpE,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAwC,EAAE,EAAE;QACzE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACzF,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children.d.ts","sourceRoot":"","sources":["../../../src/commands/page/children.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"children.d.ts","sourceRoot":"","sources":["../../../src/commands/page/children.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAqB9C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function children(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('children <pageId>')
|
|
@@ -9,19 +9,14 @@ export function children(parent) {
|
|
|
9
9
|
.option('--expand <expand>', 'Expand options')
|
|
10
10
|
.addHelpText('after', '\nExamples:\n confluencedc page children 12345\n confluencedc page children 12345 --limit 10')
|
|
11
11
|
.action(async (pageId, opts) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
output(result);
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
handleError(err);
|
|
24
|
-
}
|
|
12
|
+
const client = getClient();
|
|
13
|
+
const result = await client.pages.getChildren({
|
|
14
|
+
pageId,
|
|
15
|
+
start: opts.start,
|
|
16
|
+
limit: opts.limit,
|
|
17
|
+
expand: opts.expand,
|
|
18
|
+
});
|
|
19
|
+
output(result);
|
|
25
20
|
});
|
|
26
21
|
}
|
|
27
22
|
//# sourceMappingURL=children.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children.js","sourceRoot":"","sources":["../../../src/commands/page/children.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"children.js","sourceRoot":"","sources":["../../../src/commands/page/children.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,2BAA2B,CAAC;SACxC,MAAM,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,CAAC;SACtD,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC;SAC7C,WAAW,CACV,OAAO,EACP,gGAAgG,CACjG;SACA,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAyD,EAAE,EAAE;QAC1F,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;YAC5C,MAAM;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/page/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/page/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA2B5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function create(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('create')
|
|
@@ -14,20 +14,15 @@ export function create(parent) {
|
|
|
14
14
|
confluencedc page create --space DEV --title "Child Page" --body "<p>Content</p>" --parent 12345
|
|
15
15
|
confluencedc page create --space DEV --title "Wiki Page" --body "h1. Title" --format wiki`)
|
|
16
16
|
.action(async (opts) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
output(result);
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
handleError(err);
|
|
30
|
-
}
|
|
17
|
+
const client = getClient();
|
|
18
|
+
const result = await client.pages.create({
|
|
19
|
+
spaceKey: opts.space,
|
|
20
|
+
title: opts.title,
|
|
21
|
+
body: opts.body,
|
|
22
|
+
parentId: opts.parent,
|
|
23
|
+
contentFormat: opts.format,
|
|
24
|
+
});
|
|
25
|
+
output(result);
|
|
31
26
|
});
|
|
32
27
|
}
|
|
33
28
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/page/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/page/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,mBAAmB,CAAC;SAChC,cAAc,CAAC,eAAe,EAAE,WAAW,CAAC;SAC5C,cAAc,CAAC,iBAAiB,EAAE,YAAY,CAAC;SAC/C,cAAc,CAAC,kBAAkB,EAAE,gDAAgD,CAAC;SACpF,MAAM,CAAC,mBAAmB,EAAE,wCAAwC,CAAC;SACrE,MAAM,CAAC,mBAAmB,EAAE,2CAA2C,EAAE,SAAS,CAAC;SACnF,WAAW,CACV,OAAO,EACP;;;4FAGsF,CACvF;SACA,MAAM,CAAC,KAAK,EAAE,IAAqF,EAAE,EAAE;QACtG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YACvC,QAAQ,EAAE,IAAI,CAAC,KAAK;YACpB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,MAAM;YACrB,aAAa,EAAE,IAAI,CAAC,MAA4B;SACjD,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/page/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/page/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAUhD"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function deletePage(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('delete <pageId>')
|
|
6
6
|
.description('Delete a page')
|
|
7
7
|
.addHelpText('after', '\nExamples:\n confluencedc page delete 12345')
|
|
8
8
|
.action(async (pageId) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
output({ deleted: true, pageId });
|
|
13
|
-
}
|
|
14
|
-
catch (err) {
|
|
15
|
-
handleError(err);
|
|
16
|
-
}
|
|
9
|
+
const client = getClient();
|
|
10
|
+
await client.pages.delete({ pageId });
|
|
11
|
+
output({ deleted: true, pageId });
|
|
17
12
|
});
|
|
18
13
|
}
|
|
19
14
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/page/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/page/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,UAAU,CAAC,MAAe;IACxC,MAAM;SACH,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,eAAe,CAAC;SAC5B,WAAW,CAAC,OAAO,EAAE,+CAA+C,CAAC;SACrE,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACtC,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/page/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/page/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkEzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function get(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('get [pageId]')
|
|
@@ -14,47 +14,42 @@ export function get(parent) {
|
|
|
14
14
|
confluencedc page get --title "Meeting Notes" --space DEV
|
|
15
15
|
confluencedc page get 12345 --expand body.wiki,version`)
|
|
16
16
|
.action(async (pageId, opts) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (!
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
const searchResult = await client.search.query({
|
|
26
|
-
cql: `title = "${opts.title}" AND space = "${opts.space}" AND type = page`,
|
|
27
|
-
limit: 1,
|
|
28
|
-
});
|
|
29
|
-
const results = searchResult.results ?? [];
|
|
30
|
-
if (results.length === 0) {
|
|
31
|
-
process.stderr.write(`${JSON.stringify({ error: `No page found with title "${opts.title}" in space "${opts.space}"` })}\n`);
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
const content = results[0].content ?? results[0];
|
|
35
|
-
const id = content.id;
|
|
36
|
-
if (!id) {
|
|
37
|
-
process.stderr.write(`${JSON.stringify({
|
|
38
|
-
error: `Page found but missing ID: title="${opts.title}" in space "${opts.space}"`,
|
|
39
|
-
})}\n`);
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
resolvedPageId = String(id);
|
|
17
|
+
const client = getClient();
|
|
18
|
+
let resolvedPageId = pageId;
|
|
19
|
+
if (!resolvedPageId) {
|
|
20
|
+
if (!opts.title || !opts.space) {
|
|
21
|
+
process.stderr.write(`${JSON.stringify({ error: 'Provide <pageId> or both --title and --space' })}\n`);
|
|
22
|
+
process.exit(1);
|
|
43
23
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
const searchResult = await client.search.query({
|
|
25
|
+
cql: `title = "${opts.title}" AND space = "${opts.space}" AND type = page`,
|
|
26
|
+
limit: 1,
|
|
27
|
+
});
|
|
28
|
+
const results = searchResult.results ?? [];
|
|
29
|
+
if (results.length === 0) {
|
|
30
|
+
process.stderr.write(`${JSON.stringify({ error: `No page found with title "${opts.title}" in space "${opts.space}"` })}\n`);
|
|
31
|
+
process.exit(1);
|
|
51
32
|
}
|
|
52
|
-
const
|
|
53
|
-
|
|
33
|
+
const content = results[0].content ?? results[0];
|
|
34
|
+
const id = content.id;
|
|
35
|
+
if (!id) {
|
|
36
|
+
process.stderr.write(`${JSON.stringify({
|
|
37
|
+
error: `Page found but missing ID: title="${opts.title}" in space "${opts.space}"`,
|
|
38
|
+
})}\n`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
resolvedPageId = String(id);
|
|
54
42
|
}
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
const params = {
|
|
44
|
+
pageId: resolvedPageId,
|
|
45
|
+
expand: opts.expand,
|
|
46
|
+
};
|
|
47
|
+
if (opts.pageVersion !== undefined) {
|
|
48
|
+
params.version = opts.pageVersion;
|
|
49
|
+
params.status = 'historical';
|
|
57
50
|
}
|
|
51
|
+
const result = await client.pages.get(params);
|
|
52
|
+
output(result);
|
|
58
53
|
});
|
|
59
54
|
}
|
|
60
55
|
//# sourceMappingURL=get.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/page/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/page/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,iBAAiB,EAAE,+BAA+B,CAAC;SAC1D,MAAM,CAAC,eAAe,EAAE,8BAA8B,CAAC;SACvD,MAAM,CAAC,yBAAyB,EAAE,uCAAuC,EAAE,QAAQ,CAAC;SACpF,MAAM,CAAC,mBAAmB,EAAE,wDAAwD,CAAC;SACrF,WAAW,CACV,OAAO,EACP;;;;yDAImD,CACpD;SACA,MAAM,CACL,KAAK,EACH,MAA0B,EAC1B,IAA+E,EAC/E,EAAE;QACF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,IAAI,cAAc,GAAG,MAAM,CAAC;QAE5B,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,8CAA8C,EAAE,CAAC,IAAI,CAAC,CAAC;gBACvG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC7C,GAAG,EAAE,YAAY,IAAI,CAAC,KAAK,kBAAkB,IAAI,CAAC,KAAK,mBAAmB;gBAC1E,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,IAAI,EAAE,CAAC;YAC3C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,6BAA6B,IAAI,CAAC,KAAK,eAAe,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CACtG,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;YACjD,MAAM,EAAE,GAAI,OAAmC,CAAC,EAAwB,CAAC;YACzE,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC;oBAChB,KAAK,EAAE,qCAAqC,IAAI,CAAC,KAAK,eAAe,IAAI,CAAC,KAAK,GAAG;iBACnF,CAAC,IAAI,CACP,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9B,CAAC;QAED,MAAM,MAAM,GAA6F;YACvG,MAAM,EAAE,cAAc;YACtB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;QACF,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC;YAClC,MAAM,CAAC,MAAM,GAAG,YAAY,CAAC;QAC/B,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/commands/page/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/commands/page/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAY7C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function history(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('history <pageId>')
|
|
@@ -8,14 +8,9 @@ export function history(parent) {
|
|
|
8
8
|
.option('--limit <number>', 'Maximum results', parseInt)
|
|
9
9
|
.addHelpText('after', '\nExamples:\n confluencedc page history 12345\n confluencedc page history 12345 --limit 5')
|
|
10
10
|
.action(async (pageId, opts) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
output(result);
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
handleError(err);
|
|
18
|
-
}
|
|
11
|
+
const client = getClient();
|
|
12
|
+
const result = await client.pages.getHistory({ pageId, start: opts.start, limit: opts.limit });
|
|
13
|
+
output(result);
|
|
19
14
|
});
|
|
20
15
|
}
|
|
21
16
|
//# sourceMappingURL=history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/commands/page/history.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/commands/page/history.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,MAAM;SACH,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,+BAA+B,CAAC;SAC5C,MAAM,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,CAAC;SACtD,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,CAAC;SACvD,WAAW,CAAC,OAAO,EAAE,6FAA6F,CAAC;SACnH,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAwC,EAAE,EAAE;QACzE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/F,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/page/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/page/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwC5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function update(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('update <pageId>')
|
|
@@ -15,27 +15,22 @@ export function update(parent) {
|
|
|
15
15
|
confluencedc page update 12345 --title "Title" --body "<p>Fix typo</p>" --minor-edit --message "Fixed typo"
|
|
16
16
|
confluencedc page update 12345 --title "Title" --body "<p>Content</p>" --version 5`)
|
|
17
17
|
.action(async (pageId, opts) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
version = current.version?.number ?? 1;
|
|
24
|
-
}
|
|
25
|
-
const result = await client.pages.update({
|
|
26
|
-
pageId,
|
|
27
|
-
title: opts.title,
|
|
28
|
-
body: opts.body,
|
|
29
|
-
version,
|
|
30
|
-
minorEdit: opts.minorEdit,
|
|
31
|
-
versionMessage: opts.message,
|
|
32
|
-
contentFormat: opts.format,
|
|
33
|
-
});
|
|
34
|
-
output(result);
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
handleError(err);
|
|
18
|
+
const client = getClient();
|
|
19
|
+
let version = opts.version;
|
|
20
|
+
if (version === undefined) {
|
|
21
|
+
const current = await client.pages.get({ pageId, expand: 'version' });
|
|
22
|
+
version = current.version?.number ?? 1;
|
|
38
23
|
}
|
|
24
|
+
const result = await client.pages.update({
|
|
25
|
+
pageId,
|
|
26
|
+
title: opts.title,
|
|
27
|
+
body: opts.body,
|
|
28
|
+
version,
|
|
29
|
+
minorEdit: opts.minorEdit,
|
|
30
|
+
versionMessage: opts.message,
|
|
31
|
+
contentFormat: opts.format,
|
|
32
|
+
});
|
|
33
|
+
output(result);
|
|
39
34
|
});
|
|
40
35
|
}
|
|
41
36
|
//# sourceMappingURL=update.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/page/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/page/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,yDAAyD,CAAC;SACtE,cAAc,CAAC,iBAAiB,EAAE,YAAY,CAAC;SAC/C,cAAc,CAAC,kBAAkB,EAAE,gDAAgD,CAAC;SACpF,MAAM,CAAC,oBAAoB,EAAE,kDAAkD,EAAE,QAAQ,CAAC;SAC1F,MAAM,CAAC,cAAc,EAAE,qCAAqC,CAAC;SAC7D,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;SAC7C,MAAM,CAAC,mBAAmB,EAAE,2CAA2C,EAAE,SAAS,CAAC;SACnF,WAAW,CACV,OAAO,EACP;;;qFAG+E,CAChF;SACA,MAAM,CACL,KAAK,EACH,MAAc,EACd,IAA8G,EAC9G,EAAE;QACF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;YACtE,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YACvC,MAAM;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO;YACP,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,cAAc,EAAE,IAAI,CAAC,OAAO;YAC5B,aAAa,EAAE,IAAI,CAAC,MAA4B;SACjD,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/search/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/search/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAmB5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output
|
|
2
|
+
import { output } from '../../utils/output.js';
|
|
3
3
|
export function search(parent) {
|
|
4
4
|
parent
|
|
5
5
|
.command('search <cql>')
|
|
@@ -12,14 +12,9 @@ export function search(parent) {
|
|
|
12
12
|
confluencedc search "title ~ \\"meeting notes\\"" --limit 10
|
|
13
13
|
confluencedc search "label = important AND lastModified > now('-7d')" --expand body.wiki`)
|
|
14
14
|
.action(async (cql, opts) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
output(result);
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
handleError(err);
|
|
22
|
-
}
|
|
15
|
+
const client = getClient();
|
|
16
|
+
const result = await client.search.query({ cql, start: opts.start, limit: opts.limit, expand: opts.expand });
|
|
17
|
+
output(result);
|
|
23
18
|
});
|
|
24
19
|
}
|
|
25
20
|
//# sourceMappingURL=search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/search/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/search/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,yDAAyD,CAAC;SACtE,MAAM,CAAC,kBAAkB,EAAE,4CAA4C,EAAE,QAAQ,CAAC;SAClF,MAAM,CAAC,kBAAkB,EAAE,wCAAwC,EAAE,QAAQ,CAAC;SAC9E,MAAM,CAAC,mBAAmB,EAAE,4CAA4C,CAAC;SACzE,WAAW,CACV,OAAO,EACP;;;2FAGqF,CACtF;SACA,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,IAAyD,EAAE,EAAE;QACvF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7G,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import 'dotenv/config';
|
|
3
2
|
import { styleText } from 'node:util';
|
|
4
3
|
import { Command } from 'commander';
|
|
5
4
|
import { registerAttachmentCommands } from './commands/attachment/index.js';
|
|
@@ -7,6 +6,7 @@ import { registerCommentCommands } from './commands/comment/index.js';
|
|
|
7
6
|
import { registerLabelCommands } from './commands/label/index.js';
|
|
8
7
|
import { registerPageCommands } from './commands/page/index.js';
|
|
9
8
|
import { registerSearchCommands } from './commands/search/index.js';
|
|
9
|
+
import { handleError } from './utils/output.js';
|
|
10
10
|
const DIM = '\x1b[2m';
|
|
11
11
|
const RESET = '\x1b[0m';
|
|
12
12
|
const program = new Command();
|
|
@@ -42,5 +42,10 @@ registerPageCommands(program);
|
|
|
42
42
|
registerCommentCommands(program);
|
|
43
43
|
registerLabelCommands(program);
|
|
44
44
|
registerAttachmentCommands(program);
|
|
45
|
-
|
|
45
|
+
try {
|
|
46
|
+
await program.parseAsync();
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
handleError(err);
|
|
50
|
+
}
|
|
46
51
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,KAAK,GAAG,SAAS,CAAC;AAExB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,OAAO;KACJ,IAAI,CAAC,cAAc,CAAC;KACpB,WAAW,CAAC,4BAA4B,CAAC;KACzC,OAAO,CAAC,OAAO,CAAC;KAChB,aAAa,CAAC;IACb,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3C,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IAC1C,uBAAuB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACvD,sBAAsB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACtD,0BAA0B,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;CAC3D,CAAC;KACD,WAAW,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,GAAG,+BAA+B,KAAK,IAAI,CAAC;KAC/G,WAAW,CACV,OAAO,EACP;EACF,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC;mDACgB,GAAG,yCAAyC,KAAK;8CACtD,GAAG,8DAA8D,KAAK;;EAElH,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC5B,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;CACf,CACE,CAAC;AAEJ,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAChC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACjC,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,0BAA0B,CAAC,OAAO,CAAC,CAAC;AAEpC,IAAI,CAAC;IACH,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC;IACb,WAAW,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC"}
|
package/dist/utils/client.js
CHANGED
|
@@ -10,7 +10,7 @@ export function getClient() {
|
|
|
10
10
|
CONFLUENCE_URL: 'Your Confluence Server base URL (e.g., https://confluence.example.com)',
|
|
11
11
|
CONFLUENCE_TOKEN: 'Personal Access Token — generate in Confluence > Profile > Personal Access Tokens',
|
|
12
12
|
},
|
|
13
|
-
hint: 'Export these
|
|
13
|
+
hint: 'Export these in your shell profile (e.g., ~/.zshrc).',
|
|
14
14
|
})}\n`);
|
|
15
15
|
process.exit(1);
|
|
16
16
|
}
|
package/dist/utils/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/utils/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,UAAU,SAAS;IACvB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAE3C,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACnG,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC;YAChB,KAAK,EAAE,2CAA2C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACtE,KAAK,EAAE;gBACL,cAAc,EAAE,wEAAwE;gBACxF,gBAAgB,EAAE,mFAAmF;aACtG;YACD,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/utils/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,UAAU,SAAS;IACvB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAE3C,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACnG,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC;YAChB,KAAK,EAAE,2CAA2C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACtE,KAAK,EAAE;gBACL,cAAc,EAAE,wEAAwE;gBACxF,gBAAgB,EAAE,mFAAmF;aACtG;YACD,IAAI,EAAE,sDAAsD;SAC7D,CAAC,IAAI,CACP,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,IAAI,gBAAgB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluencedc-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"publish": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"commander": "^13.1.0",
|
|
15
|
-
"
|
|
16
|
-
"confluence-data-center-client": "1.0.0"
|
|
15
|
+
"confluence-data-center-client": "1.0.1"
|
|
17
16
|
},
|
|
18
17
|
"devDependencies": {
|
|
19
18
|
"@types/node": "24.10.4",
|
|
19
|
+
"dotenv": "17.2.3",
|
|
20
20
|
"eslint": "^9.39.0",
|
|
21
21
|
"tsx": "^4.19.2",
|
|
22
22
|
"typescript": "^5.7.2",
|
|
23
23
|
"vitest": "^4.0.16",
|
|
24
|
-
"config-
|
|
25
|
-
"config-
|
|
24
|
+
"config-eslint": "0.0.0",
|
|
25
|
+
"config-typescript": "0.0.0"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=22.0.0"
|