@hesed/conni 0.9.0 → 0.9.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.
Files changed (29) hide show
  1. package/README.md +67 -31
  2. package/dist/base-command.d.ts +9 -0
  3. package/dist/base-command.js +29 -0
  4. package/dist/commands/conni/content/attachment-download.d.ts +4 -3
  5. package/dist/commands/conni/content/attachment-download.js +5 -6
  6. package/dist/commands/conni/content/attachment.d.ts +4 -3
  7. package/dist/commands/conni/content/attachment.js +5 -6
  8. package/dist/commands/conni/content/comment-delete.d.ts +4 -3
  9. package/dist/commands/conni/content/comment-delete.js +5 -6
  10. package/dist/commands/conni/content/comment-update.d.ts +4 -3
  11. package/dist/commands/conni/content/comment-update.js +5 -6
  12. package/dist/commands/conni/content/comment.d.ts +4 -3
  13. package/dist/commands/conni/content/comment.js +5 -6
  14. package/dist/commands/conni/content/create.d.ts +4 -3
  15. package/dist/commands/conni/content/create.js +5 -6
  16. package/dist/commands/conni/content/delete.d.ts +4 -3
  17. package/dist/commands/conni/content/delete.js +5 -6
  18. package/dist/commands/conni/content/get.d.ts +4 -3
  19. package/dist/commands/conni/content/get.js +5 -6
  20. package/dist/commands/conni/content/search.d.ts +4 -3
  21. package/dist/commands/conni/content/search.js +5 -6
  22. package/dist/commands/conni/content/update.d.ts +4 -3
  23. package/dist/commands/conni/content/update.js +5 -6
  24. package/dist/commands/conni/space/get.d.ts +4 -3
  25. package/dist/commands/conni/space/get.js +5 -6
  26. package/dist/commands/conni/space/list.d.ts +4 -3
  27. package/dist/commands/conni/space/list.js +5 -6
  28. package/oclif.manifest.json +97 -13
  29. package/package.json +2 -2
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.0 linux-x64 node-v24.16.0
29
+ @hesed/conni/0.9.2 linux-x64 node-v24.17.0
30
30
  $ conni --help [COMMAND]
31
31
  USAGE
32
32
  $ conni COMMAND
@@ -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.0/src/commands/conni/auth/add.ts)_
85
+ _See code: [src/commands/conni/auth/add.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/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.0/src/commands/conni/auth/delete.ts)_
110
+ _See code: [src/commands/conni/auth/delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/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.0/src/commands/conni/auth/list.ts)_
130
+ _See code: [src/commands/conni/auth/list.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/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.0/src/commands/conni/auth/profile.ts)_
155
+ _See code: [src/commands/conni/auth/profile.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/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.0/src/commands/conni/auth/test.ts)_
180
+ _See code: [src/commands/conni/auth/test.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/auth/test.ts)_
181
181
 
182
182
  ## `conni conni auth update`
183
183
 
@@ -205,7 +205,7 @@ 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.0/src/commands/conni/auth/update.ts)_
208
+ _See code: [src/commands/conni/auth/update.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/auth/update.ts)_
209
209
 
210
210
  ## `conni conni content attachment PAGEID FILE`
211
211
 
@@ -213,7 +213,7 @@ Add attachment to Confluence content
213
213
 
214
214
  ```
215
215
  USAGE
216
- $ conni conni content attachment PAGEID FILE [-p <value>] [--toon]
216
+ $ conni conni content attachment PAGEID FILE [--json] [-p <value>] [--toon]
217
217
 
218
218
  ARGUMENTS
219
219
  PAGEID Page ID
@@ -223,6 +223,9 @@ FLAGS
223
223
  -p, --profile=<value> Authentication profile name
224
224
  --toon Format output as toon
225
225
 
226
+ GLOBAL FLAGS
227
+ --json Format output as json.
228
+
226
229
  DESCRIPTION
227
230
  Add attachment to Confluence content
228
231
 
@@ -230,7 +233,7 @@ EXAMPLES
230
233
  $ conni conni content attachment 123456 ./document.pdf
231
234
  ```
232
235
 
233
- _See code: [src/commands/conni/content/attachment.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/attachment.ts)_
236
+ _See code: [src/commands/conni/content/attachment.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/attachment.ts)_
234
237
 
235
238
  ## `conni conni content attachment-download ATTACHMENTID [OUTPUTPATH]`
236
239
 
@@ -238,7 +241,7 @@ Download attachment from Confluence content
238
241
 
239
242
  ```
240
243
  USAGE
241
- $ conni conni content attachment-download ATTACHMENTID [OUTPUTPATH] [-p <value>] [--toon]
244
+ $ conni conni content attachment-download ATTACHMENTID [OUTPUTPATH] [--json] [-p <value>] [--toon]
242
245
 
243
246
  ARGUMENTS
244
247
  ATTACHMENTID Attachment ID
@@ -248,6 +251,9 @@ FLAGS
248
251
  -p, --profile=<value> Authentication profile name
249
252
  --toon Format output as toon
250
253
 
254
+ GLOBAL FLAGS
255
+ --json Format output as json.
256
+
251
257
  DESCRIPTION
252
258
  Download attachment from Confluence content
253
259
 
@@ -257,7 +263,7 @@ EXAMPLES
257
263
  $ conni conni content attachment-download att12345 ./document.pdf
258
264
  ```
259
265
 
260
- _See code: [src/commands/conni/content/attachment-download.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/attachment-download.ts)_
266
+ _See code: [src/commands/conni/content/attachment-download.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/attachment-download.ts)_
261
267
 
262
268
  ## `conni conni content comment PAGEID BODY`
263
269
 
@@ -265,7 +271,7 @@ Add comment to Confluence content
265
271
 
266
272
  ```
267
273
  USAGE
268
- $ conni conni content comment PAGEID BODY [-p <value>] [--toon]
274
+ $ conni conni content comment PAGEID BODY [--json] [-p <value>] [--toon]
269
275
 
270
276
  ARGUMENTS
271
277
  PAGEID Page ID
@@ -275,6 +281,9 @@ FLAGS
275
281
  -p, --profile=<value> Authentication profile name
276
282
  --toon Format output as toon
277
283
 
284
+ GLOBAL FLAGS
285
+ --json Format output as json.
286
+
278
287
  DESCRIPTION
279
288
  Add comment to Confluence content
280
289
 
@@ -291,7 +300,7 @@ EXAMPLES
291
300
  $ conni conni content comment 123456 "$(cat content.md)"
292
301
  ```
293
302
 
294
- _See code: [src/commands/conni/content/comment.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/comment.ts)_
303
+ _See code: [src/commands/conni/content/comment.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/comment.ts)_
295
304
 
296
305
  ## `conni conni content comment-delete ID`
297
306
 
@@ -299,7 +308,7 @@ Delete comment from Confluence content
299
308
 
300
309
  ```
301
310
  USAGE
302
- $ conni conni content comment-delete ID [-p <value>] [--toon]
311
+ $ conni conni content comment-delete ID [--json] [-p <value>] [--toon]
303
312
 
304
313
  ARGUMENTS
305
314
  ID Comment ID to delete
@@ -308,6 +317,9 @@ FLAGS
308
317
  -p, --profile=<value> Authentication profile name
309
318
  --toon Format output as toon
310
319
 
320
+ GLOBAL FLAGS
321
+ --json Format output as json.
322
+
311
323
  DESCRIPTION
312
324
  Delete comment from Confluence content
313
325
 
@@ -315,7 +327,7 @@ EXAMPLES
315
327
  $ conni conni content comment-delete 1544224770
316
328
  ```
317
329
 
318
- _See code: [src/commands/conni/content/comment-delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/comment-delete.ts)_
330
+ _See code: [src/commands/conni/content/comment-delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/comment-delete.ts)_
319
331
 
320
332
  ## `conni conni content comment-update ID BODY`
321
333
 
@@ -323,7 +335,7 @@ Update a comment in Confluence content
323
335
 
324
336
  ```
325
337
  USAGE
326
- $ conni conni content comment-update ID BODY [-p <value>] [--toon]
338
+ $ conni conni content comment-update ID BODY [--json] [-p <value>] [--toon]
327
339
 
328
340
  ARGUMENTS
329
341
  ID Comment ID to update
@@ -333,6 +345,9 @@ FLAGS
333
345
  -p, --profile=<value> Authentication profile name
334
346
  --toon Format output as toon
335
347
 
348
+ GLOBAL FLAGS
349
+ --json Format output as json.
350
+
336
351
  DESCRIPTION
337
352
  Update a comment in Confluence content
338
353
 
@@ -349,7 +364,7 @@ EXAMPLES
349
364
  $ conni conni content comment-update 1544224770 "$(cat content.md)"
350
365
  ```
351
366
 
352
- _See code: [src/commands/conni/content/comment-update.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/comment-update.ts)_
367
+ _See code: [src/commands/conni/content/comment-update.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/comment-update.ts)_
353
368
 
354
369
  ## `conni conni content create`
355
370
 
@@ -357,7 +372,7 @@ Create a new Confluence page
357
372
 
358
373
  ```
359
374
  USAGE
360
- $ conni conni content create --fields <value>... [--attach <value>...] [--full-width] [-p <value>] [--toon]
375
+ $ conni conni content create --fields <value>... [--json] [--attach <value>...] [--full-width] [-p <value>] [--toon]
361
376
 
362
377
  FLAGS
363
378
  -p, --profile=<value> Authentication profile name
@@ -366,6 +381,9 @@ FLAGS
366
381
  --full-width Set page appearance to full-width
367
382
  --toon Format output as toon
368
383
 
384
+ GLOBAL FLAGS
385
+ --json Format output as json.
386
+
369
387
  DESCRIPTION
370
388
  Create a new Confluence page
371
389
 
@@ -396,7 +414,7 @@ FLAG DESCRIPTIONS
396
414
  Content fields in key=value format. Use @file to read value from a file (e.g. body=@content.xml)
397
415
  ```
398
416
 
399
- _See code: [src/commands/conni/content/create.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/create.ts)_
417
+ _See code: [src/commands/conni/content/create.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/create.ts)_
400
418
 
401
419
  ## `conni conni content delete PAGEID`
402
420
 
@@ -404,7 +422,7 @@ Delete a Confluence page
404
422
 
405
423
  ```
406
424
  USAGE
407
- $ conni conni content delete PAGEID [-p <value>] [--toon]
425
+ $ conni conni content delete PAGEID [--json] [-p <value>] [--toon]
408
426
 
409
427
  ARGUMENTS
410
428
  PAGEID Page ID to delete
@@ -413,6 +431,9 @@ FLAGS
413
431
  -p, --profile=<value> Authentication profile name
414
432
  --toon Format output as toon
415
433
 
434
+ GLOBAL FLAGS
435
+ --json Format output as json.
436
+
416
437
  DESCRIPTION
417
438
  Delete a Confluence page
418
439
 
@@ -420,7 +441,7 @@ EXAMPLES
420
441
  $ conni conni content delete 1543634992
421
442
  ```
422
443
 
423
- _See code: [src/commands/conni/content/delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/delete.ts)_
444
+ _See code: [src/commands/conni/content/delete.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/delete.ts)_
424
445
 
425
446
  ## `conni conni content get PAGEID`
426
447
 
@@ -428,7 +449,7 @@ Get details of a Confluence content
428
449
 
429
450
  ```
430
451
  USAGE
431
- $ conni conni content get PAGEID [-p <value>] [--toon]
452
+ $ conni conni content get PAGEID [--json] [-p <value>] [--toon]
432
453
 
433
454
  ARGUMENTS
434
455
  PAGEID Page ID
@@ -437,6 +458,9 @@ FLAGS
437
458
  -p, --profile=<value> Authentication profile name
438
459
  --toon Format output as toon
439
460
 
461
+ GLOBAL FLAGS
462
+ --json Format output as json.
463
+
440
464
  DESCRIPTION
441
465
  Get details of a Confluence content
442
466
 
@@ -444,7 +468,7 @@ EXAMPLES
444
468
  $ conni conni content get 1544060948
445
469
  ```
446
470
 
447
- _See code: [src/commands/conni/content/get.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/get.ts)_
471
+ _See code: [src/commands/conni/content/get.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/get.ts)_
448
472
 
449
473
  ## `conni conni content search CQL`
450
474
 
@@ -452,7 +476,7 @@ Search for Confluence contents using CQL
452
476
 
453
477
  ```
454
478
  USAGE
455
- $ conni conni content search CQL [--expand <value>] [--limit <value>] [-p <value>] [--toon]
479
+ $ conni conni content search CQL [--json] [--expand <value>] [--limit <value>] [-p <value>] [--toon]
456
480
 
457
481
  ARGUMENTS
458
482
  CQL CQL expression
@@ -463,6 +487,9 @@ FLAGS
463
487
  --limit=<value> Maximum number of contents per page
464
488
  --toon Format output as toon
465
489
 
490
+ GLOBAL FLAGS
491
+ --json Format output as json.
492
+
466
493
  DESCRIPTION
467
494
  Search for Confluence contents using CQL
468
495
 
@@ -472,7 +499,7 @@ EXAMPLES
472
499
  $ conni conni content search 'created > startOfMonth()' --limit=5 --expand=body,version
473
500
  ```
474
501
 
475
- _See code: [src/commands/conni/content/search.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/search.ts)_
502
+ _See code: [src/commands/conni/content/search.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/search.ts)_
476
503
 
477
504
  ## `conni conni content update PAGEID`
478
505
 
@@ -480,7 +507,7 @@ Update an existing Confluence content
480
507
 
481
508
  ```
482
509
  USAGE
483
- $ conni conni content update PAGEID --fields <value>... [--full-width] [-p <value>] [--toon]
510
+ $ conni conni content update PAGEID --fields <value>... [--json] [--full-width] [-p <value>] [--toon]
484
511
 
485
512
  ARGUMENTS
486
513
  PAGEID Page ID
@@ -492,6 +519,9 @@ FLAGS
492
519
  --full-width Set page appearance to full-width
493
520
  --toon Format output as toon
494
521
 
522
+ GLOBAL FLAGS
523
+ --json Format output as json.
524
+
495
525
  DESCRIPTION
496
526
  Update an existing Confluence content
497
527
 
@@ -512,7 +542,7 @@ EXAMPLES
512
542
  $ conni conni content update 1076199489 --fields body=@storage.xml representation=storage --full-width
513
543
  ```
514
544
 
515
- _See code: [src/commands/conni/content/update.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/content/update.ts)_
545
+ _See code: [src/commands/conni/content/update.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/content/update.ts)_
516
546
 
517
547
  ## `conni conni space get SPACEKEY`
518
548
 
@@ -520,7 +550,7 @@ Get details of a Confluence space
520
550
 
521
551
  ```
522
552
  USAGE
523
- $ conni conni space get SPACEKEY [-p <value>] [--toon]
553
+ $ conni conni space get SPACEKEY [--json] [-p <value>] [--toon]
524
554
 
525
555
  ARGUMENTS
526
556
  SPACEKEY Space key
@@ -529,6 +559,9 @@ FLAGS
529
559
  -p, --profile=<value> Authentication profile name
530
560
  --toon Format output as toon
531
561
 
562
+ GLOBAL FLAGS
563
+ --json Format output as json.
564
+
532
565
  DESCRIPTION
533
566
  Get details of a Confluence space
534
567
 
@@ -536,7 +569,7 @@ EXAMPLES
536
569
  $ conni conni space get DEV
537
570
  ```
538
571
 
539
- _See code: [src/commands/conni/space/get.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/space/get.ts)_
572
+ _See code: [src/commands/conni/space/get.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/space/get.ts)_
540
573
 
541
574
  ## `conni conni space list`
542
575
 
@@ -544,12 +577,15 @@ List all Confluence spaces
544
577
 
545
578
  ```
546
579
  USAGE
547
- $ conni conni space list [-p <value>] [--toon]
580
+ $ conni conni space list [--json] [-p <value>] [--toon]
548
581
 
549
582
  FLAGS
550
583
  -p, --profile=<value> Authentication profile name
551
584
  --toon Format output as toon
552
585
 
586
+ GLOBAL FLAGS
587
+ --json Format output as json.
588
+
553
589
  DESCRIPTION
554
590
  List all Confluence spaces
555
591
 
@@ -557,5 +593,5 @@ EXAMPLES
557
593
  $ conni conni space list
558
594
  ```
559
595
 
560
- _See code: [src/commands/conni/space/list.ts](https://github.com/hesedcasa/conni/blob/v0.9.0/src/commands/conni/space/list.ts)_
596
+ _See code: [src/commands/conni/space/list.ts](https://github.com/hesedcasa/conni/blob/v0.9.2/src/commands/conni/space/list.ts)_
561
597
  <!-- commandsstop -->
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ export declare abstract class BaseCommand extends Command {
3
+ static enableJsonFlag: boolean;
4
+ jsonEnabled(): boolean;
5
+ protected parse(options?: any, argv?: string[]): Promise<any>;
6
+ protected toErrorJson(err: unknown): {
7
+ error: string;
8
+ };
9
+ }
@@ -0,0 +1,29 @@
1
+ import { Command } from '@oclif/core';
2
+ export class BaseCommand extends Command {
3
+ static enableJsonFlag = true;
4
+ jsonEnabled() {
5
+ const separatorIndex = this.argv.indexOf('--');
6
+ const flagArgs = separatorIndex === -1 ? this.argv : this.argv.slice(0, separatorIndex);
7
+ if (flagArgs.includes('--toon'))
8
+ return false;
9
+ return true;
10
+ }
11
+ // oclif sets this.parsed=true only after Parser.parse() returns successfully.
12
+ // When parse() throws (e.g. missing required arg), this.parsed stays false and
13
+ // _run() emits an UnparsedCommand warning. The finally block prevents that.
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ async parse(options, argv) {
16
+ try {
17
+ return await super.parse(options, argv);
18
+ }
19
+ finally {
20
+ this.parsed = true;
21
+ }
22
+ }
23
+ // oclif's default toErrorJson returns the raw error object which for
24
+ // CLIParseError includes context:this (the full config). Strip it down.
25
+ toErrorJson(err) {
26
+ const message = err instanceof Error ? err.message : String(err);
27
+ return { error: message };
28
+ }
29
+ }
@@ -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 }),
@@ -18,7 +19,7 @@ export default class ContentDownloadAttachment extends Command {
18
19
  };
19
20
  async run() {
20
21
  const { args, flags } = await this.parse(ContentDownloadAttachment);
21
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
22
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
22
23
  const auth = await loadAuthConfig();
23
24
  if (!auth) {
24
25
  this.error(`Missing authentication config.`);
@@ -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 }),
@@ -17,7 +18,7 @@ export default class ContentAttachment extends Command {
17
18
  };
18
19
  async run() {
19
20
  const { args, flags } = await this.parse(ContentAttachment);
20
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
21
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
21
22
  const auth = await loadAuthConfig();
22
23
  if (!auth) {
23
24
  this.error(`Missing authentication config.`);
@@ -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
  };
@@ -13,7 +14,7 @@ export default class ContentDeleteComment extends Command {
13
14
  };
14
15
  async run() {
15
16
  const { args, flags } = await this.parse(ContentDeleteComment);
16
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
17
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
17
18
  const auth = await loadAuthConfig();
18
19
  if (!auth) {
19
20
  this.error(`Missing authentication config.`);
@@ -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 }),
@@ -19,7 +20,7 @@ export default class ContentUpdateComment extends Command {
19
20
  };
20
21
  async run() {
21
22
  const { args, flags } = await this.parse(ContentUpdateComment);
22
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
23
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
23
24
  const auth = await loadAuthConfig();
24
25
  if (!auth) {
25
26
  this.error(`Missing authentication config.`);
@@ -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 }),
@@ -19,7 +20,7 @@ export default class ContentAddComment extends Command {
19
20
  };
20
21
  async run() {
21
22
  const { args, flags } = await this.parse(ContentAddComment);
22
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
23
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
23
24
  const auth = await loadAuthConfig();
24
25
  if (!auth) {
25
26
  this.error(`Missing authentication config.`);
@@ -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 = [
@@ -34,7 +35,7 @@ export default class ContentCreate extends Command {
34
35
  };
35
36
  async run() {
36
37
  const { flags } = await this.parse(ContentCreate);
37
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
38
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
38
39
  const auth = await loadAuthConfig();
39
40
  if (!auth) {
40
41
  this.error(`Missing authentication config.`);
@@ -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
  };
@@ -13,7 +14,7 @@ export default class ContentDelete extends Command {
13
14
  };
14
15
  async run() {
15
16
  const { args, flags } = await this.parse(ContentDelete);
16
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
17
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
17
18
  const auth = await loadAuthConfig();
18
19
  if (!auth) {
19
20
  this.error(`Missing authentication config.`);
@@ -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
  };
@@ -13,7 +14,7 @@ export default class ContentGet extends Command {
13
14
  };
14
15
  async run() {
15
16
  const { args, flags } = await this.parse(ContentGet);
16
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
17
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
17
18
  const auth = await loadAuthConfig();
18
19
  if (!auth) {
19
20
  this.error(`Missing authentication config.`);
@@ -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
  };
@@ -18,7 +19,7 @@ export default class ContentSearch extends Command {
18
19
  };
19
20
  async run() {
20
21
  const { args, flags } = await this.parse(ContentSearch);
21
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
22
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
22
23
  const auth = await loadAuthConfig();
23
24
  if (!auth) {
24
25
  this.error(`Missing authentication config.`);
@@ -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
  };
@@ -28,7 +29,7 @@ export default class ContentUpdate extends Command {
28
29
  };
29
30
  async run() {
30
31
  const { args, flags } = await this.parse(ContentUpdate);
31
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
32
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
32
33
  const auth = await loadAuthConfig();
33
34
  if (!auth) {
34
35
  this.error(`Missing authentication config.`);
@@ -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
  };
@@ -13,7 +14,7 @@ export default class SpaceGet extends Command {
13
14
  };
14
15
  async run() {
15
16
  const { args, flags } = await this.parse(SpaceGet);
16
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
17
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
17
18
  const auth = await loadAuthConfig();
18
19
  if (!auth) {
19
20
  this.error(`Missing authentication config.`);
@@ -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 = {
@@ -10,7 +11,7 @@ export default class SpaceList extends Command {
10
11
  };
11
12
  async run() {
12
13
  const { flags } = await this.parse(SpaceList);
13
- const { loadAuthConfig } = createProfileManager(this.config, flags.profile);
14
+ const { loadAuthConfig } = createProfileManager(this.config, flags.profile, 'conni-config.json');
14
15
  const auth = await loadAuthConfig();
15
16
  if (!auth) {
16
17
  this.error(`Missing authentication config.`);
@@ -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
  }
@@ -315,6 +315,13 @@
315
315
  "<%= config.bin %> <%= command.id %> DEV"
316
316
  ],
317
317
  "flags": {
318
+ "json": {
319
+ "description": "Format output as json.",
320
+ "helpGroup": "GLOBAL",
321
+ "name": "json",
322
+ "allowNo": false,
323
+ "type": "boolean"
324
+ },
318
325
  "profile": {
319
326
  "char": "p",
320
327
  "description": "Authentication profile name",
@@ -339,7 +346,7 @@
339
346
  "pluginName": "@hesed/conni",
340
347
  "pluginType": "core",
341
348
  "strict": true,
342
- "enableJsonFlag": false,
349
+ "enableJsonFlag": true,
343
350
  "isESM": true,
344
351
  "relativePath": [
345
352
  "dist",
@@ -357,6 +364,13 @@
357
364
  "<%= config.bin %> <%= command.id %>"
358
365
  ],
359
366
  "flags": {
367
+ "json": {
368
+ "description": "Format output as json.",
369
+ "helpGroup": "GLOBAL",
370
+ "name": "json",
371
+ "allowNo": false,
372
+ "type": "boolean"
373
+ },
360
374
  "profile": {
361
375
  "char": "p",
362
376
  "description": "Authentication profile name",
@@ -381,7 +395,7 @@
381
395
  "pluginName": "@hesed/conni",
382
396
  "pluginType": "core",
383
397
  "strict": true,
384
- "enableJsonFlag": false,
398
+ "enableJsonFlag": true,
385
399
  "isESM": true,
386
400
  "relativePath": [
387
401
  "dist",
@@ -411,6 +425,13 @@
411
425
  "<%= config.bin %> <%= command.id %> att12345 ./document.pdf"
412
426
  ],
413
427
  "flags": {
428
+ "json": {
429
+ "description": "Format output as json.",
430
+ "helpGroup": "GLOBAL",
431
+ "name": "json",
432
+ "allowNo": false,
433
+ "type": "boolean"
434
+ },
414
435
  "profile": {
415
436
  "char": "p",
416
437
  "description": "Authentication profile name",
@@ -435,7 +456,7 @@
435
456
  "pluginName": "@hesed/conni",
436
457
  "pluginType": "core",
437
458
  "strict": true,
438
- "enableJsonFlag": false,
459
+ "enableJsonFlag": true,
439
460
  "isESM": true,
440
461
  "relativePath": [
441
462
  "dist",
@@ -464,6 +485,13 @@
464
485
  "<%= config.bin %> <%= command.id %> 123456 ./document.pdf"
465
486
  ],
466
487
  "flags": {
488
+ "json": {
489
+ "description": "Format output as json.",
490
+ "helpGroup": "GLOBAL",
491
+ "name": "json",
492
+ "allowNo": false,
493
+ "type": "boolean"
494
+ },
467
495
  "profile": {
468
496
  "char": "p",
469
497
  "description": "Authentication profile name",
@@ -488,7 +516,7 @@
488
516
  "pluginName": "@hesed/conni",
489
517
  "pluginType": "core",
490
518
  "strict": true,
491
- "enableJsonFlag": false,
519
+ "enableJsonFlag": true,
492
520
  "isESM": true,
493
521
  "relativePath": [
494
522
  "dist",
@@ -512,6 +540,13 @@
512
540
  "<%= config.bin %> <%= command.id %> 1544224770"
513
541
  ],
514
542
  "flags": {
543
+ "json": {
544
+ "description": "Format output as json.",
545
+ "helpGroup": "GLOBAL",
546
+ "name": "json",
547
+ "allowNo": false,
548
+ "type": "boolean"
549
+ },
515
550
  "profile": {
516
551
  "char": "p",
517
552
  "description": "Authentication profile name",
@@ -536,7 +571,7 @@
536
571
  "pluginName": "@hesed/conni",
537
572
  "pluginType": "core",
538
573
  "strict": true,
539
- "enableJsonFlag": false,
574
+ "enableJsonFlag": true,
540
575
  "isESM": true,
541
576
  "relativePath": [
542
577
  "dist",
@@ -566,6 +601,13 @@
566
601
  "<%= config.bin %> <%= command.id %> 1544224770 \"$(cat content.md)\""
567
602
  ],
568
603
  "flags": {
604
+ "json": {
605
+ "description": "Format output as json.",
606
+ "helpGroup": "GLOBAL",
607
+ "name": "json",
608
+ "allowNo": false,
609
+ "type": "boolean"
610
+ },
569
611
  "profile": {
570
612
  "char": "p",
571
613
  "description": "Authentication profile name",
@@ -590,7 +632,7 @@
590
632
  "pluginName": "@hesed/conni",
591
633
  "pluginType": "core",
592
634
  "strict": true,
593
- "enableJsonFlag": false,
635
+ "enableJsonFlag": true,
594
636
  "isESM": true,
595
637
  "relativePath": [
596
638
  "dist",
@@ -620,6 +662,13 @@
620
662
  "<%= config.bin %> <%= command.id %> 123456 \"$(cat content.md)\""
621
663
  ],
622
664
  "flags": {
665
+ "json": {
666
+ "description": "Format output as json.",
667
+ "helpGroup": "GLOBAL",
668
+ "name": "json",
669
+ "allowNo": false,
670
+ "type": "boolean"
671
+ },
623
672
  "profile": {
624
673
  "char": "p",
625
674
  "description": "Authentication profile name",
@@ -644,7 +693,7 @@
644
693
  "pluginName": "@hesed/conni",
645
694
  "pluginType": "core",
646
695
  "strict": true,
647
- "enableJsonFlag": false,
696
+ "enableJsonFlag": true,
648
697
  "isESM": true,
649
698
  "relativePath": [
650
699
  "dist",
@@ -667,6 +716,13 @@
667
716
  "<%= config.bin %> <%= command.id %> --fields spaceKey=\"DEV\" title=\"Storage page\" body=@storage.xml representation=storage --full-width"
668
717
  ],
669
718
  "flags": {
719
+ "json": {
720
+ "description": "Format output as json.",
721
+ "helpGroup": "GLOBAL",
722
+ "name": "json",
723
+ "allowNo": false,
724
+ "type": "boolean"
725
+ },
670
726
  "attach": {
671
727
  "description": "Path to a file to upload and embed inline (can be used multiple times)",
672
728
  "name": "attach",
@@ -715,7 +771,7 @@
715
771
  "pluginName": "@hesed/conni",
716
772
  "pluginType": "core",
717
773
  "strict": true,
718
- "enableJsonFlag": false,
774
+ "enableJsonFlag": true,
719
775
  "isESM": true,
720
776
  "relativePath": [
721
777
  "dist",
@@ -739,6 +795,13 @@
739
795
  "<%= config.bin %> <%= command.id %> 1543634992"
740
796
  ],
741
797
  "flags": {
798
+ "json": {
799
+ "description": "Format output as json.",
800
+ "helpGroup": "GLOBAL",
801
+ "name": "json",
802
+ "allowNo": false,
803
+ "type": "boolean"
804
+ },
742
805
  "profile": {
743
806
  "char": "p",
744
807
  "description": "Authentication profile name",
@@ -763,7 +826,7 @@
763
826
  "pluginName": "@hesed/conni",
764
827
  "pluginType": "core",
765
828
  "strict": true,
766
- "enableJsonFlag": false,
829
+ "enableJsonFlag": true,
767
830
  "isESM": true,
768
831
  "relativePath": [
769
832
  "dist",
@@ -787,6 +850,13 @@
787
850
  "<%= config.bin %> <%= command.id %> 1544060948"
788
851
  ],
789
852
  "flags": {
853
+ "json": {
854
+ "description": "Format output as json.",
855
+ "helpGroup": "GLOBAL",
856
+ "name": "json",
857
+ "allowNo": false,
858
+ "type": "boolean"
859
+ },
790
860
  "profile": {
791
861
  "char": "p",
792
862
  "description": "Authentication profile name",
@@ -811,7 +881,7 @@
811
881
  "pluginName": "@hesed/conni",
812
882
  "pluginType": "core",
813
883
  "strict": true,
814
- "enableJsonFlag": false,
884
+ "enableJsonFlag": true,
815
885
  "isESM": true,
816
886
  "relativePath": [
817
887
  "dist",
@@ -836,6 +906,13 @@
836
906
  "<%= config.bin %> <%= command.id %> 'created > startOfMonth()' --limit=5 --expand=body,version"
837
907
  ],
838
908
  "flags": {
909
+ "json": {
910
+ "description": "Format output as json.",
911
+ "helpGroup": "GLOBAL",
912
+ "name": "json",
913
+ "allowNo": false,
914
+ "type": "boolean"
915
+ },
839
916
  "expand": {
840
917
  "description": "Properties of the content to expand",
841
918
  "name": "expand",
@@ -876,7 +953,7 @@
876
953
  "pluginName": "@hesed/conni",
877
954
  "pluginType": "core",
878
955
  "strict": true,
879
- "enableJsonFlag": false,
956
+ "enableJsonFlag": true,
880
957
  "isESM": true,
881
958
  "relativePath": [
882
959
  "dist",
@@ -903,6 +980,13 @@
903
980
  "<%= config.bin %> <%= command.id %> 1076199489 --fields body=@storage.xml representation=storage --full-width"
904
981
  ],
905
982
  "flags": {
983
+ "json": {
984
+ "description": "Format output as json.",
985
+ "helpGroup": "GLOBAL",
986
+ "name": "json",
987
+ "allowNo": false,
988
+ "type": "boolean"
989
+ },
906
990
  "fields": {
907
991
  "description": "Content fields to update in key=value format. Use @file to read value from a file (e.g. body=@content.xml)",
908
992
  "name": "fields",
@@ -942,7 +1026,7 @@
942
1026
  "pluginName": "@hesed/conni",
943
1027
  "pluginType": "core",
944
1028
  "strict": true,
945
- "enableJsonFlag": false,
1029
+ "enableJsonFlag": true,
946
1030
  "isESM": true,
947
1031
  "relativePath": [
948
1032
  "dist",
@@ -953,5 +1037,5 @@
953
1037
  ]
954
1038
  }
955
1039
  },
956
- "version": "0.9.0"
1040
+ "version": "0.9.2"
957
1041
  }
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.0",
4
+ "version": "0.9.2",
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",