@hesed/conni 0.9.1 → 0.9.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.
Files changed (29) hide show
  1. package/README.md +47 -47
  2. package/dist/base-command.d.ts +8 -0
  3. package/dist/base-command.js +28 -0
  4. package/dist/commands/conni/content/attachment-download.d.ts +4 -3
  5. package/dist/commands/conni/content/attachment-download.js +4 -5
  6. package/dist/commands/conni/content/attachment.d.ts +4 -3
  7. package/dist/commands/conni/content/attachment.js +4 -5
  8. package/dist/commands/conni/content/comment-delete.d.ts +4 -3
  9. package/dist/commands/conni/content/comment-delete.js +4 -5
  10. package/dist/commands/conni/content/comment-update.d.ts +4 -3
  11. package/dist/commands/conni/content/comment-update.js +4 -5
  12. package/dist/commands/conni/content/comment.d.ts +4 -3
  13. package/dist/commands/conni/content/comment.js +4 -5
  14. package/dist/commands/conni/content/create.d.ts +4 -3
  15. package/dist/commands/conni/content/create.js +4 -5
  16. package/dist/commands/conni/content/delete.d.ts +4 -3
  17. package/dist/commands/conni/content/delete.js +4 -5
  18. package/dist/commands/conni/content/{get.d.ts → index.d.ts} +4 -3
  19. package/dist/commands/conni/content/{get.js → index.js} +4 -5
  20. package/dist/commands/conni/content/search.d.ts +4 -3
  21. package/dist/commands/conni/content/search.js +4 -5
  22. package/dist/commands/conni/content/update.d.ts +4 -3
  23. package/dist/commands/conni/content/update.js +4 -5
  24. package/dist/commands/conni/space/{get.d.ts → index.d.ts} +4 -3
  25. package/dist/commands/conni/space/{get.js → index.js} +4 -5
  26. package/dist/commands/conni/space/list.d.ts +4 -3
  27. package/dist/commands/conni/space/list.js +4 -5
  28. package/oclif.manifest.json +92 -104
  29. package/package.json +11 -6
package/README.md CHANGED
@@ -26,7 +26,7 @@ $ npm install -g @hesed/conni
26
26
  $ conni COMMAND
27
27
  running command...
28
28
  $ conni (--version)
29
- @hesed/conni/0.9.1 linux-x64 node-v24.16.0
29
+ @hesed/conni/0.9.3 linux-x64 node-v24.17.0
30
30
  $ conni --help [COMMAND]
31
31
  USAGE
32
32
  $ conni COMMAND
@@ -43,6 +43,7 @@ USAGE
43
43
  * [`conni conni auth profile`](#conni-conni-auth-profile)
44
44
  * [`conni conni auth test`](#conni-conni-auth-test)
45
45
  * [`conni conni auth update`](#conni-conni-auth-update)
46
+ * [`conni conni content PAGEID`](#conni-conni-content-pageid)
46
47
  * [`conni conni content attachment PAGEID FILE`](#conni-conni-content-attachment-pageid-file)
47
48
  * [`conni conni content attachment-download ATTACHMENTID [OUTPUTPATH]`](#conni-conni-content-attachment-download-attachmentid-outputpath)
48
49
  * [`conni conni content comment PAGEID BODY`](#conni-conni-content-comment-pageid-body)
@@ -50,10 +51,9 @@ USAGE
50
51
  * [`conni conni content comment-update ID BODY`](#conni-conni-content-comment-update-id-body)
51
52
  * [`conni conni content create`](#conni-conni-content-create)
52
53
  * [`conni conni content delete PAGEID`](#conni-conni-content-delete-pageid)
53
- * [`conni conni content get PAGEID`](#conni-conni-content-get-pageid)
54
54
  * [`conni conni content search CQL`](#conni-conni-content-search-cql)
55
55
  * [`conni conni content update PAGEID`](#conni-conni-content-update-pageid)
56
- * [`conni conni space get SPACEKEY`](#conni-conni-space-get-spacekey)
56
+ * [`conni conni space SPACEKEY`](#conni-conni-space-spacekey)
57
57
  * [`conni conni space list`](#conni-conni-space-list)
58
58
 
59
59
  ## `conni conni auth add`
@@ -82,7 +82,7 @@ EXAMPLES
82
82
  $ conni conni auth add -p prod
83
83
  ```
84
84
 
85
- _See code: [src/commands/conni/auth/add.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/auth/add.ts)_
85
+ _See code: [src/commands/conni/auth/add.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/auth/add.ts)_
86
86
 
87
87
  ## `conni conni auth delete`
88
88
 
@@ -107,7 +107,7 @@ EXAMPLES
107
107
  $ conni conni auth delete -p prod
108
108
  ```
109
109
 
110
- _See code: [src/commands/conni/auth/delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/auth/delete.ts)_
110
+ _See code: [src/commands/conni/auth/delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/auth/delete.ts)_
111
111
 
112
112
  ## `conni conni auth list`
113
113
 
@@ -127,7 +127,7 @@ EXAMPLES
127
127
  $ conni conni auth list
128
128
  ```
129
129
 
130
- _See code: [src/commands/conni/auth/list.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/auth/list.ts)_
130
+ _See code: [src/commands/conni/auth/list.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/auth/list.ts)_
131
131
 
132
132
  ## `conni conni auth profile`
133
133
 
@@ -152,7 +152,7 @@ EXAMPLES
152
152
  $ conni conni auth profile --default test
153
153
  ```
154
154
 
155
- _See code: [src/commands/conni/auth/profile.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/auth/profile.ts)_
155
+ _See code: [src/commands/conni/auth/profile.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/auth/profile.ts)_
156
156
 
157
157
  ## `conni conni auth test`
158
158
 
@@ -177,7 +177,7 @@ EXAMPLES
177
177
  $ conni conni auth test -p prod
178
178
  ```
179
179
 
180
- _See code: [src/commands/conni/auth/test.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/auth/test.ts)_
180
+ _See code: [src/commands/conni/auth/test.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/auth/test.ts)_
181
181
 
182
182
  ## `conni conni auth update`
183
183
 
@@ -205,7 +205,31 @@ EXAMPLES
205
205
  $ conni conni auth update -p test
206
206
  ```
207
207
 
208
- _See code: [src/commands/conni/auth/update.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/auth/update.ts)_
208
+ _See code: [src/commands/conni/auth/update.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/auth/update.ts)_
209
+
210
+ ## `conni conni content PAGEID`
211
+
212
+ Get details of a Confluence content
213
+
214
+ ```
215
+ USAGE
216
+ $ conni conni content PAGEID [-p <value>] [--toon]
217
+
218
+ ARGUMENTS
219
+ PAGEID Page ID
220
+
221
+ FLAGS
222
+ -p, --profile=<value> Authentication profile name
223
+ --toon Format output as toon
224
+
225
+ DESCRIPTION
226
+ Get details of a Confluence content
227
+
228
+ EXAMPLES
229
+ $ conni conni content 1544060948
230
+ ```
231
+
232
+ _See code: [src/commands/conni/content/index.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/index.ts)_
209
233
 
210
234
  ## `conni conni content attachment PAGEID FILE`
211
235
 
@@ -230,7 +254,7 @@ EXAMPLES
230
254
  $ conni conni content attachment 123456 ./document.pdf
231
255
  ```
232
256
 
233
- _See code: [src/commands/conni/content/attachment.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/attachment.ts)_
257
+ _See code: [src/commands/conni/content/attachment.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/attachment.ts)_
234
258
 
235
259
  ## `conni conni content attachment-download ATTACHMENTID [OUTPUTPATH]`
236
260
 
@@ -257,7 +281,7 @@ EXAMPLES
257
281
  $ conni conni content attachment-download att12345 ./document.pdf
258
282
  ```
259
283
 
260
- _See code: [src/commands/conni/content/attachment-download.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/attachment-download.ts)_
284
+ _See code: [src/commands/conni/content/attachment-download.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/attachment-download.ts)_
261
285
 
262
286
  ## `conni conni content comment PAGEID BODY`
263
287
 
@@ -291,7 +315,7 @@ EXAMPLES
291
315
  $ conni conni content comment 123456 "$(cat content.md)"
292
316
  ```
293
317
 
294
- _See code: [src/commands/conni/content/comment.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/comment.ts)_
318
+ _See code: [src/commands/conni/content/comment.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/comment.ts)_
295
319
 
296
320
  ## `conni conni content comment-delete ID`
297
321
 
@@ -315,7 +339,7 @@ EXAMPLES
315
339
  $ conni conni content comment-delete 1544224770
316
340
  ```
317
341
 
318
- _See code: [src/commands/conni/content/comment-delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/comment-delete.ts)_
342
+ _See code: [src/commands/conni/content/comment-delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/comment-delete.ts)_
319
343
 
320
344
  ## `conni conni content comment-update ID BODY`
321
345
 
@@ -349,7 +373,7 @@ EXAMPLES
349
373
  $ conni conni content comment-update 1544224770 "$(cat content.md)"
350
374
  ```
351
375
 
352
- _See code: [src/commands/conni/content/comment-update.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/comment-update.ts)_
376
+ _See code: [src/commands/conni/content/comment-update.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/comment-update.ts)_
353
377
 
354
378
  ## `conni conni content create`
355
379
 
@@ -396,7 +420,7 @@ FLAG DESCRIPTIONS
396
420
  Content fields in key=value format. Use @file to read value from a file (e.g. body=@content.xml)
397
421
  ```
398
422
 
399
- _See code: [src/commands/conni/content/create.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/create.ts)_
423
+ _See code: [src/commands/conni/content/create.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/create.ts)_
400
424
 
401
425
  ## `conni conni content delete PAGEID`
402
426
 
@@ -420,31 +444,7 @@ EXAMPLES
420
444
  $ conni conni content delete 1543634992
421
445
  ```
422
446
 
423
- _See code: [src/commands/conni/content/delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/delete.ts)_
424
-
425
- ## `conni conni content get PAGEID`
426
-
427
- Get details of a Confluence content
428
-
429
- ```
430
- USAGE
431
- $ conni conni content get PAGEID [-p <value>] [--toon]
432
-
433
- ARGUMENTS
434
- PAGEID Page ID
435
-
436
- FLAGS
437
- -p, --profile=<value> Authentication profile name
438
- --toon Format output as toon
439
-
440
- DESCRIPTION
441
- Get details of a Confluence content
442
-
443
- EXAMPLES
444
- $ conni conni content get 1544060948
445
- ```
446
-
447
- _See code: [src/commands/conni/content/get.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/get.ts)_
447
+ _See code: [src/commands/conni/content/delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/delete.ts)_
448
448
 
449
449
  ## `conni conni content search CQL`
450
450
 
@@ -472,7 +472,7 @@ EXAMPLES
472
472
  $ conni conni content search 'created > startOfMonth()' --limit=5 --expand=body,version
473
473
  ```
474
474
 
475
- _See code: [src/commands/conni/content/search.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/search.ts)_
475
+ _See code: [src/commands/conni/content/search.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/search.ts)_
476
476
 
477
477
  ## `conni conni content update PAGEID`
478
478
 
@@ -512,15 +512,15 @@ EXAMPLES
512
512
  $ conni conni content update 1076199489 --fields body=@storage.xml representation=storage --full-width
513
513
  ```
514
514
 
515
- _See code: [src/commands/conni/content/update.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/content/update.ts)_
515
+ _See code: [src/commands/conni/content/update.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/content/update.ts)_
516
516
 
517
- ## `conni conni space get SPACEKEY`
517
+ ## `conni conni space SPACEKEY`
518
518
 
519
519
  Get details of a Confluence space
520
520
 
521
521
  ```
522
522
  USAGE
523
- $ conni conni space get SPACEKEY [-p <value>] [--toon]
523
+ $ conni conni space SPACEKEY [-p <value>] [--toon]
524
524
 
525
525
  ARGUMENTS
526
526
  SPACEKEY Space key
@@ -533,10 +533,10 @@ DESCRIPTION
533
533
  Get details of a Confluence space
534
534
 
535
535
  EXAMPLES
536
- $ conni conni space get DEV
536
+ $ conni conni space DEV
537
537
  ```
538
538
 
539
- _See code: [src/commands/conni/space/get.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/space/get.ts)_
539
+ _See code: [src/commands/conni/space/index.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/space/index.ts)_
540
540
 
541
541
  ## `conni conni space list`
542
542
 
@@ -557,5 +557,5 @@ EXAMPLES
557
557
  $ conni conni space list
558
558
  ```
559
559
 
560
- _See code: [src/commands/conni/space/list.ts](https://github.com/hesedcasa/conni/blob/v0.9.1/src/commands/conni/space/list.ts)_
560
+ _See code: [src/commands/conni/space/list.ts](https://github.com/hesedcasa/conni/blob/v0.9.3/src/commands/conni/space/list.ts)_
561
561
  <!-- commandsstop -->
@@ -0,0 +1,8 @@
1
+ import { Command } from '@oclif/core';
2
+ export declare abstract class BaseCommand extends Command {
3
+ jsonEnabled(): boolean;
4
+ protected parse(options?: any, argv?: string[]): Promise<any>;
5
+ protected toErrorJson(err: unknown): {
6
+ error: string;
7
+ };
8
+ }
@@ -0,0 +1,28 @@
1
+ import { Command } from '@oclif/core';
2
+ export class BaseCommand extends Command {
3
+ jsonEnabled() {
4
+ const separatorIndex = this.argv.indexOf('--');
5
+ const flagArgs = separatorIndex === -1 ? this.argv : this.argv.slice(0, separatorIndex);
6
+ if (flagArgs.includes('--toon'))
7
+ return false;
8
+ return true;
9
+ }
10
+ // oclif sets this.parsed=true only after Parser.parse() returns successfully.
11
+ // When parse() throws (e.g. missing required arg), this.parsed stays false and
12
+ // _run() emits an UnparsedCommand warning. The finally block prevents that.
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ async parse(options, argv) {
15
+ try {
16
+ return await super.parse(options, argv);
17
+ }
18
+ finally {
19
+ this.parsed = true;
20
+ }
21
+ }
22
+ // oclif's default toErrorJson returns the raw error object which for
23
+ // CLIParseError includes context:this (the full config). Strip it down.
24
+ toErrorJson(err) {
25
+ const message = err instanceof Error ? err.message : String(err);
26
+ return { error: message };
27
+ }
28
+ }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentDownloadAttachment extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentDownloadAttachment extends BaseCommand {
3
4
  static args: {
4
5
  attachmentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  outputPath: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
@@ -10,5 +11,5 @@ export default class ContentDownloadAttachment extends Command {
10
11
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
13
  };
13
- run(): Promise<void>;
14
+ run(): Promise<ApiResult>;
14
15
  }
@@ -1,8 +1,9 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
3
  import { action } from '@oclif/core/ux';
4
+ import { BaseCommand } from '../../../base-command.js';
4
5
  import { clearClients, downloadAttachment } from '../../../conni/conni-client.js';
5
- export default class ContentDownloadAttachment extends Command {
6
+ export default class ContentDownloadAttachment extends BaseCommand {
6
7
  static args = {
7
8
  attachmentId: Args.string({ description: 'Attachment ID', required: true }),
8
9
  outputPath: Args.string({ description: 'Output file path', required: false }),
@@ -38,8 +39,6 @@ export default class ContentDownloadAttachment extends Command {
38
39
  if (flags.toon) {
39
40
  this.log(formatAsToon(result));
40
41
  }
41
- else {
42
- this.logJson(result);
43
- }
42
+ return result;
44
43
  }
45
44
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentAttachment extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentAttachment extends BaseCommand {
3
4
  static args: {
4
5
  pageId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  file: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -10,5 +11,5 @@ export default class ContentAttachment extends Command {
10
11
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
13
  };
13
- run(): Promise<void>;
14
+ run(): Promise<ApiResult>;
14
15
  }
@@ -1,8 +1,9 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
3
  import { action } from '@oclif/core/ux';
4
+ import { BaseCommand } from '../../../base-command.js';
4
5
  import { addAttachment, clearClients } from '../../../conni/conni-client.js';
5
- export default class ContentAttachment extends Command {
6
+ export default class ContentAttachment extends BaseCommand {
6
7
  /* eslint-disable perfectionist/sort-objects */
7
8
  static args = {
8
9
  pageId: Args.string({ description: 'Page ID', required: true }),
@@ -34,8 +35,6 @@ export default class ContentAttachment extends Command {
34
35
  if (flags.toon) {
35
36
  this.log(formatAsToon(result));
36
37
  }
37
- else {
38
- this.logJson(result);
39
- }
38
+ return result;
40
39
  }
41
40
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentDeleteComment extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentDeleteComment extends BaseCommand {
3
4
  static args: {
4
5
  id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  };
@@ -9,5 +10,5 @@ export default class ContentDeleteComment extends Command {
9
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  };
12
- run(): Promise<void>;
13
+ run(): Promise<ApiResult>;
13
14
  }
@@ -1,7 +1,8 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { BaseCommand } from '../../../base-command.js';
3
4
  import { clearClients, deleteComment } from '../../../conni/conni-client.js';
4
- export default class ContentDeleteComment extends Command {
5
+ export default class ContentDeleteComment extends BaseCommand {
5
6
  static args = {
6
7
  id: Args.string({ description: 'Comment ID to delete', required: true }),
7
8
  };
@@ -23,8 +24,6 @@ export default class ContentDeleteComment extends Command {
23
24
  if (flags.toon) {
24
25
  this.log(formatAsToon(result));
25
26
  }
26
- else {
27
- this.logJson(result);
28
- }
27
+ return result;
29
28
  }
30
29
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentUpdateComment extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentUpdateComment extends BaseCommand {
3
4
  static args: {
4
5
  id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  body: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -10,5 +11,5 @@ export default class ContentUpdateComment extends Command {
10
11
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
13
  };
13
- run(): Promise<void>;
14
+ run(): Promise<ApiResult>;
14
15
  }
@@ -1,7 +1,8 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { BaseCommand } from '../../../base-command.js';
3
4
  import { clearClients, updateComment } from '../../../conni/conni-client.js';
4
- export default class ContentUpdateComment extends Command {
5
+ export default class ContentUpdateComment extends BaseCommand {
5
6
  /* eslint-disable perfectionist/sort-objects */
6
7
  static args = {
7
8
  id: Args.string({ description: 'Comment ID to update', required: true }),
@@ -29,8 +30,6 @@ export default class ContentUpdateComment extends Command {
29
30
  if (flags.toon) {
30
31
  this.log(formatAsToon(result));
31
32
  }
32
- else {
33
- this.logJson(result);
34
- }
33
+ return result;
35
34
  }
36
35
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentAddComment extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentAddComment extends BaseCommand {
3
4
  static args: {
4
5
  pageId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  body: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -10,5 +11,5 @@ export default class ContentAddComment extends Command {
10
11
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
13
  };
13
- run(): Promise<void>;
14
+ run(): Promise<ApiResult>;
14
15
  }
@@ -1,7 +1,8 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { BaseCommand } from '../../../base-command.js';
3
4
  import { addComment, clearClients } from '../../../conni/conni-client.js';
4
- export default class ContentAddComment extends Command {
5
+ export default class ContentAddComment extends BaseCommand {
5
6
  /* eslint-disable perfectionist/sort-objects */
6
7
  static args = {
7
8
  pageId: Args.string({ description: 'Page ID', required: true }),
@@ -29,8 +30,6 @@ export default class ContentAddComment extends Command {
29
30
  if (flags.toon) {
30
31
  this.log(formatAsToon(result));
31
32
  }
32
- else {
33
- this.logJson(result);
34
- }
33
+ return result;
35
34
  }
36
35
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentCreate extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentCreate extends BaseCommand {
3
4
  static args: {};
4
5
  static description: string;
5
6
  static examples: string[];
@@ -10,5 +11,5 @@ export default class ContentCreate extends Command {
10
11
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
13
  };
13
- run(): Promise<void>;
14
+ run(): Promise<ApiResult>;
14
15
  }
@@ -1,8 +1,9 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Command, Flags } from '@oclif/core';
2
+ import { Flags } from '@oclif/core';
3
3
  import fs from 'fs-extra';
4
+ import { BaseCommand } from '../../../base-command.js';
4
5
  import { clearClients, createPage, createPageWithMedia } from '../../../conni/conni-client.js';
5
- export default class ContentCreate extends Command {
6
+ export default class ContentCreate extends BaseCommand {
6
7
  static args = {};
7
8
  static description = 'Create a new Confluence page';
8
9
  static examples = [
@@ -66,8 +67,6 @@ export default class ContentCreate extends Command {
66
67
  if (flags.toon) {
67
68
  this.log(formatAsToon(result));
68
69
  }
69
- else {
70
- this.logJson(result);
71
- }
70
+ return result;
72
71
  }
73
72
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentDelete extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentDelete extends BaseCommand {
3
4
  static args: {
4
5
  pageId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  };
@@ -9,5 +10,5 @@ export default class ContentDelete extends Command {
9
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  };
12
- run(): Promise<void>;
13
+ run(): Promise<ApiResult>;
13
14
  }
@@ -1,7 +1,8 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { BaseCommand } from '../../../base-command.js';
3
4
  import { clearClients, deleteContent } from '../../../conni/conni-client.js';
4
- export default class ContentDelete extends Command {
5
+ export default class ContentDelete extends BaseCommand {
5
6
  static args = {
6
7
  pageId: Args.string({ description: 'Page ID to delete', required: true }),
7
8
  };
@@ -23,8 +24,6 @@ export default class ContentDelete extends Command {
23
24
  if (flags.toon) {
24
25
  this.log(formatAsToon(result));
25
26
  }
26
- else {
27
- this.logJson(result);
28
- }
27
+ return result;
29
28
  }
30
29
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentGet extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentGet extends BaseCommand {
3
4
  static args: {
4
5
  pageId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  };
@@ -9,5 +10,5 @@ export default class ContentGet extends Command {
9
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  };
12
- run(): Promise<void>;
13
+ run(): Promise<ApiResult>;
13
14
  }
@@ -1,7 +1,8 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { BaseCommand } from '../../../base-command.js';
3
4
  import { clearClients, getContent } from '../../../conni/conni-client.js';
4
- export default class ContentGet extends Command {
5
+ export default class ContentGet extends BaseCommand {
5
6
  static args = {
6
7
  pageId: Args.string({ description: 'Page ID', required: true }),
7
8
  };
@@ -23,8 +24,6 @@ export default class ContentGet extends Command {
23
24
  if (flags.toon) {
24
25
  this.log(formatAsToon(result));
25
26
  }
26
- else {
27
- this.logJson(result);
28
- }
27
+ return result;
29
28
  }
30
29
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentSearch extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentSearch extends BaseCommand {
3
4
  static args: {
4
5
  cql: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  };
@@ -11,5 +12,5 @@ export default class ContentSearch extends Command {
11
12
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
14
  };
14
- run(): Promise<void>;
15
+ run(): Promise<ApiResult>;
15
16
  }
@@ -1,7 +1,8 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { BaseCommand } from '../../../base-command.js';
3
4
  import { clearClients, searchContents } from '../../../conni/conni-client.js';
4
- export default class ContentSearch extends Command {
5
+ export default class ContentSearch extends BaseCommand {
5
6
  static args = {
6
7
  cql: Args.string({ description: 'CQL expression', required: true }),
7
8
  };
@@ -28,8 +29,6 @@ export default class ContentSearch extends Command {
28
29
  if (flags.toon) {
29
30
  this.log(formatAsToon(result));
30
31
  }
31
- else {
32
- this.logJson(result);
33
- }
32
+ return result;
34
33
  }
35
34
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class ContentUpdate extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class ContentUpdate extends BaseCommand {
3
4
  static args: {
4
5
  pageId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  };
@@ -11,5 +12,5 @@ export default class ContentUpdate extends Command {
11
12
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
14
  };
14
- run(): Promise<void>;
15
+ run(): Promise<ApiResult>;
15
16
  }
@@ -1,8 +1,9 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
3
  import fs from 'fs-extra';
4
+ import { BaseCommand } from '../../../base-command.js';
4
5
  import { clearClients, updateContent } from '../../../conni/conni-client.js';
5
- export default class ContentUpdate extends Command {
6
+ export default class ContentUpdate extends BaseCommand {
6
7
  static args = {
7
8
  pageId: Args.string({ description: 'Page ID', required: true }),
8
9
  };
@@ -53,8 +54,6 @@ export default class ContentUpdate extends Command {
53
54
  if (flags.toon) {
54
55
  this.log(formatAsToon(result));
55
56
  }
56
- else {
57
- this.logJson(result);
58
- }
57
+ return result;
59
58
  }
60
59
  }
@@ -1,5 +1,6 @@
1
- import { Command } from '@oclif/core';
2
- export default class SpaceGet extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class SpaceGet extends BaseCommand {
3
4
  static args: {
4
5
  spaceKey: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
6
  };
@@ -9,5 +10,5 @@ export default class SpaceGet extends Command {
9
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  };
12
- run(): Promise<void>;
13
+ run(): Promise<ApiResult>;
13
14
  }
@@ -1,7 +1,8 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Args, Command, Flags } from '@oclif/core';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { BaseCommand } from '../../../base-command.js';
3
4
  import { clearClients, getSpace } from '../../../conni/conni-client.js';
4
- export default class SpaceGet extends Command {
5
+ export default class SpaceGet extends BaseCommand {
5
6
  static args = {
6
7
  spaceKey: Args.string({ description: 'Space key', required: true }),
7
8
  };
@@ -23,8 +24,6 @@ export default class SpaceGet extends Command {
23
24
  if (flags.toon) {
24
25
  this.log(formatAsToon(result));
25
26
  }
26
- else {
27
- this.logJson(result);
28
- }
27
+ return result;
29
28
  }
30
29
  }
@@ -1,10 +1,11 @@
1
- import { Command } from '@oclif/core';
2
- export default class SpaceList extends Command {
1
+ import { type ApiResult } from '@hesed/plugin-lib';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ export default class SpaceList extends BaseCommand {
3
4
  static description: string;
4
5
  static examples: string[];
5
6
  static flags: {
6
7
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
8
  toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
9
  };
9
- run(): Promise<void>;
10
+ run(): Promise<ApiResult>;
10
11
  }
@@ -1,7 +1,8 @@
1
1
  import { createProfileManager, formatAsToon } from '@hesed/plugin-lib';
2
- import { Command, Flags } from '@oclif/core';
2
+ import { Flags } from '@oclif/core';
3
+ import { BaseCommand } from '../../../base-command.js';
3
4
  import { clearClients, listSpaces } from '../../../conni/conni-client.js';
4
- export default class SpaceList extends Command {
5
+ export default class SpaceList extends BaseCommand {
5
6
  static description = 'List all Confluence spaces';
6
7
  static examples = ['<%= config.bin %> <%= command.id %>'];
7
8
  static flags = {
@@ -20,8 +21,6 @@ export default class SpaceList extends Command {
20
21
  if (flags.toon) {
21
22
  this.log(formatAsToon(result));
22
23
  }
23
- else {
24
- this.logJson(result);
25
- }
24
+ return result;
26
25
  }
27
26
  }
@@ -301,96 +301,6 @@
301
301
  "update.js"
302
302
  ]
303
303
  },
304
- "conni:space:get": {
305
- "aliases": [],
306
- "args": {
307
- "spaceKey": {
308
- "description": "Space key",
309
- "name": "spaceKey",
310
- "required": true
311
- }
312
- },
313
- "description": "Get details of a Confluence space",
314
- "examples": [
315
- "<%= config.bin %> <%= command.id %> DEV"
316
- ],
317
- "flags": {
318
- "profile": {
319
- "char": "p",
320
- "description": "Authentication profile name",
321
- "name": "profile",
322
- "required": false,
323
- "hasDynamicHelp": false,
324
- "multiple": false,
325
- "type": "option"
326
- },
327
- "toon": {
328
- "description": "Format output as toon",
329
- "name": "toon",
330
- "required": false,
331
- "allowNo": false,
332
- "type": "boolean"
333
- }
334
- },
335
- "hasDynamicHelp": false,
336
- "hiddenAliases": [],
337
- "id": "conni:space:get",
338
- "pluginAlias": "@hesed/conni",
339
- "pluginName": "@hesed/conni",
340
- "pluginType": "core",
341
- "strict": true,
342
- "enableJsonFlag": false,
343
- "isESM": true,
344
- "relativePath": [
345
- "dist",
346
- "commands",
347
- "conni",
348
- "space",
349
- "get.js"
350
- ]
351
- },
352
- "conni:space:list": {
353
- "aliases": [],
354
- "args": {},
355
- "description": "List all Confluence spaces",
356
- "examples": [
357
- "<%= config.bin %> <%= command.id %>"
358
- ],
359
- "flags": {
360
- "profile": {
361
- "char": "p",
362
- "description": "Authentication profile name",
363
- "name": "profile",
364
- "required": false,
365
- "hasDynamicHelp": false,
366
- "multiple": false,
367
- "type": "option"
368
- },
369
- "toon": {
370
- "description": "Format output as toon",
371
- "name": "toon",
372
- "required": false,
373
- "allowNo": false,
374
- "type": "boolean"
375
- }
376
- },
377
- "hasDynamicHelp": false,
378
- "hiddenAliases": [],
379
- "id": "conni:space:list",
380
- "pluginAlias": "@hesed/conni",
381
- "pluginName": "@hesed/conni",
382
- "pluginType": "core",
383
- "strict": true,
384
- "enableJsonFlag": false,
385
- "isESM": true,
386
- "relativePath": [
387
- "dist",
388
- "commands",
389
- "conni",
390
- "space",
391
- "list.js"
392
- ]
393
- },
394
304
  "conni:content:attachment-download": {
395
305
  "aliases": [],
396
306
  "args": {
@@ -435,7 +345,6 @@
435
345
  "pluginName": "@hesed/conni",
436
346
  "pluginType": "core",
437
347
  "strict": true,
438
- "enableJsonFlag": false,
439
348
  "isESM": true,
440
349
  "relativePath": [
441
350
  "dist",
@@ -488,7 +397,6 @@
488
397
  "pluginName": "@hesed/conni",
489
398
  "pluginType": "core",
490
399
  "strict": true,
491
- "enableJsonFlag": false,
492
400
  "isESM": true,
493
401
  "relativePath": [
494
402
  "dist",
@@ -536,7 +444,6 @@
536
444
  "pluginName": "@hesed/conni",
537
445
  "pluginType": "core",
538
446
  "strict": true,
539
- "enableJsonFlag": false,
540
447
  "isESM": true,
541
448
  "relativePath": [
542
449
  "dist",
@@ -590,7 +497,6 @@
590
497
  "pluginName": "@hesed/conni",
591
498
  "pluginType": "core",
592
499
  "strict": true,
593
- "enableJsonFlag": false,
594
500
  "isESM": true,
595
501
  "relativePath": [
596
502
  "dist",
@@ -644,7 +550,6 @@
644
550
  "pluginName": "@hesed/conni",
645
551
  "pluginType": "core",
646
552
  "strict": true,
647
- "enableJsonFlag": false,
648
553
  "isESM": true,
649
554
  "relativePath": [
650
555
  "dist",
@@ -715,7 +620,6 @@
715
620
  "pluginName": "@hesed/conni",
716
621
  "pluginType": "core",
717
622
  "strict": true,
718
- "enableJsonFlag": false,
719
623
  "isESM": true,
720
624
  "relativePath": [
721
625
  "dist",
@@ -763,7 +667,6 @@
763
667
  "pluginName": "@hesed/conni",
764
668
  "pluginType": "core",
765
669
  "strict": true,
766
- "enableJsonFlag": false,
767
670
  "isESM": true,
768
671
  "relativePath": [
769
672
  "dist",
@@ -773,7 +676,7 @@
773
676
  "delete.js"
774
677
  ]
775
678
  },
776
- "conni:content:get": {
679
+ "conni:content": {
777
680
  "aliases": [],
778
681
  "args": {
779
682
  "pageId": {
@@ -806,19 +709,18 @@
806
709
  },
807
710
  "hasDynamicHelp": false,
808
711
  "hiddenAliases": [],
809
- "id": "conni:content:get",
712
+ "id": "conni:content",
810
713
  "pluginAlias": "@hesed/conni",
811
714
  "pluginName": "@hesed/conni",
812
715
  "pluginType": "core",
813
716
  "strict": true,
814
- "enableJsonFlag": false,
815
717
  "isESM": true,
816
718
  "relativePath": [
817
719
  "dist",
818
720
  "commands",
819
721
  "conni",
820
722
  "content",
821
- "get.js"
723
+ "index.js"
822
724
  ]
823
725
  },
824
726
  "conni:content:search": {
@@ -876,7 +778,6 @@
876
778
  "pluginName": "@hesed/conni",
877
779
  "pluginType": "core",
878
780
  "strict": true,
879
- "enableJsonFlag": false,
880
781
  "isESM": true,
881
782
  "relativePath": [
882
783
  "dist",
@@ -942,7 +843,6 @@
942
843
  "pluginName": "@hesed/conni",
943
844
  "pluginType": "core",
944
845
  "strict": true,
945
- "enableJsonFlag": false,
946
846
  "isESM": true,
947
847
  "relativePath": [
948
848
  "dist",
@@ -951,7 +851,95 @@
951
851
  "content",
952
852
  "update.js"
953
853
  ]
854
+ },
855
+ "conni:space": {
856
+ "aliases": [],
857
+ "args": {
858
+ "spaceKey": {
859
+ "description": "Space key",
860
+ "name": "spaceKey",
861
+ "required": true
862
+ }
863
+ },
864
+ "description": "Get details of a Confluence space",
865
+ "examples": [
866
+ "<%= config.bin %> <%= command.id %> DEV"
867
+ ],
868
+ "flags": {
869
+ "profile": {
870
+ "char": "p",
871
+ "description": "Authentication profile name",
872
+ "name": "profile",
873
+ "required": false,
874
+ "hasDynamicHelp": false,
875
+ "multiple": false,
876
+ "type": "option"
877
+ },
878
+ "toon": {
879
+ "description": "Format output as toon",
880
+ "name": "toon",
881
+ "required": false,
882
+ "allowNo": false,
883
+ "type": "boolean"
884
+ }
885
+ },
886
+ "hasDynamicHelp": false,
887
+ "hiddenAliases": [],
888
+ "id": "conni:space",
889
+ "pluginAlias": "@hesed/conni",
890
+ "pluginName": "@hesed/conni",
891
+ "pluginType": "core",
892
+ "strict": true,
893
+ "isESM": true,
894
+ "relativePath": [
895
+ "dist",
896
+ "commands",
897
+ "conni",
898
+ "space",
899
+ "index.js"
900
+ ]
901
+ },
902
+ "conni:space:list": {
903
+ "aliases": [],
904
+ "args": {},
905
+ "description": "List all Confluence spaces",
906
+ "examples": [
907
+ "<%= config.bin %> <%= command.id %>"
908
+ ],
909
+ "flags": {
910
+ "profile": {
911
+ "char": "p",
912
+ "description": "Authentication profile name",
913
+ "name": "profile",
914
+ "required": false,
915
+ "hasDynamicHelp": false,
916
+ "multiple": false,
917
+ "type": "option"
918
+ },
919
+ "toon": {
920
+ "description": "Format output as toon",
921
+ "name": "toon",
922
+ "required": false,
923
+ "allowNo": false,
924
+ "type": "boolean"
925
+ }
926
+ },
927
+ "hasDynamicHelp": false,
928
+ "hiddenAliases": [],
929
+ "id": "conni:space:list",
930
+ "pluginAlias": "@hesed/conni",
931
+ "pluginName": "@hesed/conni",
932
+ "pluginType": "core",
933
+ "strict": true,
934
+ "isESM": true,
935
+ "relativePath": [
936
+ "dist",
937
+ "commands",
938
+ "conni",
939
+ "space",
940
+ "list.js"
941
+ ]
954
942
  }
955
943
  },
956
- "version": "0.9.1"
944
+ "version": "0.9.3"
957
945
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hesed/conni",
3
3
  "description": "CLI for Confluence API interaction",
4
- "version": "0.9.1",
4
+ "version": "0.9.3",
5
5
  "author": "Hesed",
6
6
  "bin": {
7
7
  "conni": "./bin/run.js"
@@ -22,7 +22,7 @@
22
22
  "@types/chai": "^5",
23
23
  "@types/fs-extra": "^11.0.4",
24
24
  "@types/mocha": "^10",
25
- "@types/node": "^25",
25
+ "@types/node": "^26",
26
26
  "@types/sinon": "^21.0.0",
27
27
  "c8": "^11.0.0",
28
28
  "chai": "^6",
@@ -58,10 +58,15 @@
58
58
  "dirname": "conni",
59
59
  "commands": "./dist/commands",
60
60
  "topicSeparator": " ",
61
- "topics": {},
62
- "update": {
63
- "autoupdate": {
64
- "debounce": 7
61
+ "topics": {
62
+ "conni": {
63
+ "description": "Commands for managing Confluence workflows and operations"
64
+ },
65
+ "conni:content": {
66
+ "description": "Perform various operations on content"
67
+ },
68
+ "conni:space": {
69
+ "description": "Get space details or list spaces"
65
70
  }
66
71
  }
67
72
  },