confluencedc-cli 1.0.1 → 1.0.3
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/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +11 -3
- package/dist/utils/output.js.map +1 -1
- package/package.json +4 -4
|
@@ -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"}
|