@klevar/portal-cli 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/index.d.ts +81 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/notes.d.ts +68 -0
- package/dist/commands/notes.js +13 -0
- package/dist/commands/notes.js.map +1 -0
- package/dist/commands/portal.js +1 -1
- package/dist/commands/portal.js.map +1 -1
- package/dist/commands/updates.d.ts +13 -0
- package/dist/commands/updates.js +3 -1
- package/dist/commands/updates.js.map +1 -1
- package/dist/lib/legacy-runner.js +88 -2
- package/package.json +1 -1
package/dist/commands/index.d.ts
CHANGED
|
@@ -481,6 +481,19 @@ export declare const COMMAND_GROUPS: {
|
|
|
481
481
|
description: string;
|
|
482
482
|
body: string[];
|
|
483
483
|
};
|
|
484
|
+
'comments.update': {
|
|
485
|
+
method: "PATCH";
|
|
486
|
+
path: string;
|
|
487
|
+
auth: "apiKey";
|
|
488
|
+
description: string;
|
|
489
|
+
body: string[];
|
|
490
|
+
};
|
|
491
|
+
'comments.delete': {
|
|
492
|
+
method: "DELETE";
|
|
493
|
+
path: string;
|
|
494
|
+
auth: "apiKey";
|
|
495
|
+
description: string;
|
|
496
|
+
};
|
|
484
497
|
};
|
|
485
498
|
onboarding: {
|
|
486
499
|
'onboarding.list': {
|
|
@@ -509,6 +522,74 @@ export declare const COMMAND_GROUPS: {
|
|
|
509
522
|
description: string;
|
|
510
523
|
};
|
|
511
524
|
};
|
|
525
|
+
notes: {
|
|
526
|
+
'notes.list': {
|
|
527
|
+
method: "GET";
|
|
528
|
+
path: string;
|
|
529
|
+
auth: "apiKey";
|
|
530
|
+
description: string;
|
|
531
|
+
queryParams: string[];
|
|
532
|
+
};
|
|
533
|
+
'notes.create': {
|
|
534
|
+
method: "POST";
|
|
535
|
+
path: string;
|
|
536
|
+
auth: "apiKey";
|
|
537
|
+
description: string;
|
|
538
|
+
body: string[];
|
|
539
|
+
};
|
|
540
|
+
'notes.update': {
|
|
541
|
+
method: "PATCH";
|
|
542
|
+
path: string;
|
|
543
|
+
auth: "apiKey";
|
|
544
|
+
description: string;
|
|
545
|
+
body: string[];
|
|
546
|
+
};
|
|
547
|
+
'notes.comments': {
|
|
548
|
+
method: "GET";
|
|
549
|
+
path: string;
|
|
550
|
+
auth: "apiKey";
|
|
551
|
+
description: string;
|
|
552
|
+
};
|
|
553
|
+
'notes.reply': {
|
|
554
|
+
method: "POST";
|
|
555
|
+
path: string;
|
|
556
|
+
auth: "apiKey";
|
|
557
|
+
description: string;
|
|
558
|
+
body: string[];
|
|
559
|
+
};
|
|
560
|
+
'portal.notes': {
|
|
561
|
+
method: "GET";
|
|
562
|
+
path: string;
|
|
563
|
+
auth: "portalToken";
|
|
564
|
+
description: string;
|
|
565
|
+
};
|
|
566
|
+
'portal.notes.project': {
|
|
567
|
+
method: "GET";
|
|
568
|
+
path: string;
|
|
569
|
+
auth: "portalToken";
|
|
570
|
+
description: string;
|
|
571
|
+
};
|
|
572
|
+
'portal.notes.create': {
|
|
573
|
+
method: "POST";
|
|
574
|
+
path: string;
|
|
575
|
+
auth: "portalToken";
|
|
576
|
+
description: string;
|
|
577
|
+
body: string[];
|
|
578
|
+
};
|
|
579
|
+
'portal.notes.comments': {
|
|
580
|
+
method: "GET";
|
|
581
|
+
path: string;
|
|
582
|
+
auth: "portalToken";
|
|
583
|
+
description: string;
|
|
584
|
+
};
|
|
585
|
+
'portal.notes.reply': {
|
|
586
|
+
method: "POST";
|
|
587
|
+
path: string;
|
|
588
|
+
auth: "portalToken";
|
|
589
|
+
description: string;
|
|
590
|
+
body: string[];
|
|
591
|
+
};
|
|
592
|
+
};
|
|
512
593
|
metrics: {
|
|
513
594
|
'metrics.push': {
|
|
514
595
|
method: "POST";
|
package/dist/commands/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { docsCommands } from './docs.js';
|
|
|
3
3
|
import { capacityCommands } from './capacity.js';
|
|
4
4
|
import { metricCommands } from './metrics.js';
|
|
5
5
|
import { onboardingCommands } from './onboarding.js';
|
|
6
|
+
import { noteCommands } from './notes.js';
|
|
6
7
|
import { portalCommands } from './portal.js';
|
|
7
8
|
import { projectCommands } from './projects.js';
|
|
8
9
|
import { systemCommands } from './system.js';
|
|
@@ -18,6 +19,7 @@ export const COMMAND_GROUPS = {
|
|
|
18
19
|
usage: usageCommands,
|
|
19
20
|
updates: updateCommands,
|
|
20
21
|
onboarding: onboardingCommands,
|
|
22
|
+
notes: noteCommands,
|
|
21
23
|
metrics: metricCommands,
|
|
22
24
|
docs: docsCommands,
|
|
23
25
|
portal: portalCommands,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,cAAc;IACvB,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,gBAAgB;IAC1B,KAAK,EAAE,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,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,cAAc;CACgB,CAAC;AAEzC,MAAM,CAAC,MAAM,QAAQ,GAA+B,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const noteCommands: {
|
|
2
|
+
'notes.list': {
|
|
3
|
+
method: "GET";
|
|
4
|
+
path: string;
|
|
5
|
+
auth: "apiKey";
|
|
6
|
+
description: string;
|
|
7
|
+
queryParams: string[];
|
|
8
|
+
};
|
|
9
|
+
'notes.create': {
|
|
10
|
+
method: "POST";
|
|
11
|
+
path: string;
|
|
12
|
+
auth: "apiKey";
|
|
13
|
+
description: string;
|
|
14
|
+
body: string[];
|
|
15
|
+
};
|
|
16
|
+
'notes.update': {
|
|
17
|
+
method: "PATCH";
|
|
18
|
+
path: string;
|
|
19
|
+
auth: "apiKey";
|
|
20
|
+
description: string;
|
|
21
|
+
body: string[];
|
|
22
|
+
};
|
|
23
|
+
'notes.comments': {
|
|
24
|
+
method: "GET";
|
|
25
|
+
path: string;
|
|
26
|
+
auth: "apiKey";
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
'notes.reply': {
|
|
30
|
+
method: "POST";
|
|
31
|
+
path: string;
|
|
32
|
+
auth: "apiKey";
|
|
33
|
+
description: string;
|
|
34
|
+
body: string[];
|
|
35
|
+
};
|
|
36
|
+
'portal.notes': {
|
|
37
|
+
method: "GET";
|
|
38
|
+
path: string;
|
|
39
|
+
auth: "portalToken";
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
'portal.notes.project': {
|
|
43
|
+
method: "GET";
|
|
44
|
+
path: string;
|
|
45
|
+
auth: "portalToken";
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
'portal.notes.create': {
|
|
49
|
+
method: "POST";
|
|
50
|
+
path: string;
|
|
51
|
+
auth: "portalToken";
|
|
52
|
+
description: string;
|
|
53
|
+
body: string[];
|
|
54
|
+
};
|
|
55
|
+
'portal.notes.comments': {
|
|
56
|
+
method: "GET";
|
|
57
|
+
path: string;
|
|
58
|
+
auth: "portalToken";
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
'portal.notes.reply': {
|
|
62
|
+
method: "POST";
|
|
63
|
+
path: string;
|
|
64
|
+
auth: "portalToken";
|
|
65
|
+
description: string;
|
|
66
|
+
body: string[];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const noteCommands = {
|
|
2
|
+
'notes.list': { method: 'GET', path: '/api/admin/notes', auth: 'apiKey', description: 'List client notes', queryParams: ['clientId', 'projectId', 'status'] },
|
|
3
|
+
'notes.create': { method: 'POST', path: '/api/admin/notes', auth: 'apiKey', description: 'Create client note (--clientId --title --content/--content-file/--stdin --projectIds)', body: ['clientId', 'title', 'content', 'projectIds'] },
|
|
4
|
+
'notes.update': { method: 'PATCH', path: '/api/admin/notes/:noteId', auth: 'apiKey', description: 'Update client note', body: ['title', 'content', 'status', 'projectIds'] },
|
|
5
|
+
'notes.comments': { method: 'GET', path: '/api/admin/notes/:noteId/comments', auth: 'apiKey', description: 'List note comments' },
|
|
6
|
+
'notes.reply': { method: 'POST', path: '/api/admin/notes/:noteId/comments', auth: 'apiKey', description: 'Reply to client note (--content, --content-file, or --stdin)', body: ['content'] },
|
|
7
|
+
'portal.notes': { method: 'GET', path: '/api/portal/notes', auth: 'portalToken', description: 'List portal notes' },
|
|
8
|
+
'portal.notes.project': { method: 'GET', path: '/api/portal/projects/:id/notes', auth: 'portalToken', description: 'List portal notes for a project' },
|
|
9
|
+
'portal.notes.create': { method: 'POST', path: '/api/portal/notes', auth: 'portalToken', description: 'Create portal note (--title --content/--content-file/--stdin --projectIds)', body: ['title', 'content', 'projectIds'] },
|
|
10
|
+
'portal.notes.comments': { method: 'GET', path: '/api/portal/notes/:noteId/comments', auth: 'portalToken', description: 'List portal note comments' },
|
|
11
|
+
'portal.notes.reply': { method: 'POST', path: '/api/portal/notes/:noteId/comments', auth: 'portalToken', description: 'Reply to portal note (--content, --content-file, or --stdin)', body: ['content'] },
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.js","sourceRoot":"","sources":["../../commands/notes.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE;IAC7J,cAAc,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uFAAuF,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE;IACxO,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE;IAC5K,gBAAgB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mCAAmC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACjI,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mCAAmC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;IAC5L,cAAc,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE;IACnH,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gCAAgC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,iCAAiC,EAAE;IACtJ,qBAAqB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,4EAA4E,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE;IAC9N,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,oCAAoC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,2BAA2B,EAAE;IACrJ,oBAAoB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oCAAoC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,8DAA8D,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;CACnL,CAAC"}
|
package/dist/commands/portal.js
CHANGED
|
@@ -6,7 +6,7 @@ export const portalCommands = {
|
|
|
6
6
|
'portal.recent-updates': { method: 'GET', path: '/api/portal/updates/recent', auth: 'portalToken', description: 'List recent portal updates' },
|
|
7
7
|
'portal.updates': { method: 'GET', path: '/api/portal/projects/:id/updates', auth: 'portalToken', description: 'List portal project updates' },
|
|
8
8
|
'portal.comments.list': { method: 'GET', path: '/api/portal/projects/:id/updates/:updateId/comments', auth: 'portalToken', description: 'List portal update comments' },
|
|
9
|
-
'portal.comments.create': { method: 'POST', path: '/api/portal/projects/:id/updates/:updateId/comments', auth: 'portalToken', description: 'Create portal update comment', body: ['content'] },
|
|
9
|
+
'portal.comments.create': { method: 'POST', path: '/api/portal/projects/:id/updates/:updateId/comments', auth: 'portalToken', description: 'Create portal update comment (--content, --content-file, or --stdin)', body: ['content'] },
|
|
10
10
|
'portal.search': { method: 'GET', path: '/api/portal/search', auth: 'portalToken', description: 'Search portal content', queryParams: ['q|query'] },
|
|
11
11
|
'portal.my-tasks': { method: 'GET', path: '/api/portal/tasks/mine', auth: 'portalToken', description: 'List client-submitted portal requests' },
|
|
12
12
|
'portal.tasks': { method: 'GET', path: '/api/portal/projects/:id/tasks', auth: 'portalToken', description: 'List portal project tasks' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../commands/portal.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,4BAA4B,EAAE;IACtH,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE;IAC9H,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,sBAAsB,EAAE;IAC5H,gBAAgB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,qBAAqB,EAAE;IAC9H,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,4BAA4B,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC9I,gBAAgB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kCAAkC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC9I,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE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E;IAC3J,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kDAAkD,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,0BAA0B,EAAE;IACjK,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mCAAmC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,sBAAsB,EAAE;IACzI,kBAAkB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,oCAAoC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,uBAAuB,EAAE;IAC5I,0BAA0B,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,yCAAyC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,0BAA0B,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE;IACnL,yBAAyB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,wCAAwC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,yBAAyB,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE;CAC1J,CAAC"}
|
|
@@ -39,4 +39,17 @@ export declare const updateCommands: {
|
|
|
39
39
|
description: string;
|
|
40
40
|
body: string[];
|
|
41
41
|
};
|
|
42
|
+
'comments.update': {
|
|
43
|
+
method: "PATCH";
|
|
44
|
+
path: string;
|
|
45
|
+
auth: "apiKey";
|
|
46
|
+
description: string;
|
|
47
|
+
body: string[];
|
|
48
|
+
};
|
|
49
|
+
'comments.delete': {
|
|
50
|
+
method: "DELETE";
|
|
51
|
+
path: string;
|
|
52
|
+
auth: "apiKey";
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
42
55
|
};
|
package/dist/commands/updates.js
CHANGED
|
@@ -4,6 +4,8 @@ export const updateCommands = {
|
|
|
4
4
|
'updates.update': { method: 'PATCH', path: '/api/admin/updates/:updateId', auth: 'apiKey', description: 'Edit an existing update in place', body: ['content', 'visibility'] },
|
|
5
5
|
'updates.delete': { method: 'DELETE', path: '/api/admin/updates/:updateId', auth: 'apiKey', description: 'Delete update' },
|
|
6
6
|
'comments.list': { method: 'GET', path: '/api/admin/projects/:id/updates/:updateId/comments', auth: 'apiKey', description: 'List update comments' },
|
|
7
|
-
'comments.create': { method: 'POST', path: '/api/admin/projects/:id/updates/:updateId/comments', auth: 'apiKey', description: 'Create update comment', body: ['content'] },
|
|
7
|
+
'comments.create': { method: 'POST', path: '/api/admin/projects/:id/updates/:updateId/comments', auth: 'apiKey', description: 'Create update comment (--content, --content-file, or --stdin)', body: ['content'] },
|
|
8
|
+
'comments.update': { method: 'PATCH', path: '/api/admin/comments/:commentId', auth: 'apiKey', description: 'Edit your admin comment in place (--content, --content-file, or --stdin)', body: ['content'] },
|
|
9
|
+
'comments.delete': { method: 'DELETE', path: '/api/admin/comments/:commentId', auth: 'apiKey', description: 'Delete your admin comment' },
|
|
8
10
|
};
|
|
9
11
|
//# sourceMappingURL=updates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updates.js","sourceRoot":"","sources":["../../commands/updates.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,cAAc,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,iCAAiC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;IACvH,gBAAgB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAiC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE;IAC3L,gBAAgB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,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AI,EAAE,oDAAoD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;IACnJ,iBAAiB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oDAAoD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+DAA+D,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;IAClN,iBAAiB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,gCAAgC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0EAA0E,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;IAC1M,iBAAiB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,gCAAgC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;CACnH,CAAC"}
|
|
@@ -269,6 +269,32 @@ function parseArgs(args) {
|
|
|
269
269
|
return { positional, flags };
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
function normalizeCliMultiline(value) {
|
|
273
|
+
return typeof value === 'string'
|
|
274
|
+
? value.replace(/\\r\\n/g, '\n').replace(/\\n/g, '\n')
|
|
275
|
+
: value;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function normalizeCsvList(value) {
|
|
279
|
+
if (Array.isArray(value)) return value;
|
|
280
|
+
if (typeof value !== 'string') return value;
|
|
281
|
+
return value
|
|
282
|
+
.split(',')
|
|
283
|
+
.map((item) => item.trim())
|
|
284
|
+
.filter(Boolean);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function supportsCommentContentInput(commandKey) {
|
|
288
|
+
return commandKey === 'comments.create' ||
|
|
289
|
+
commandKey === 'comments.update' ||
|
|
290
|
+
commandKey === 'portal.comments.create' ||
|
|
291
|
+
commandKey === 'notes.create' ||
|
|
292
|
+
commandKey === 'notes.update' ||
|
|
293
|
+
commandKey === 'notes.reply' ||
|
|
294
|
+
commandKey === 'portal.notes.create' ||
|
|
295
|
+
commandKey === 'portal.notes.reply';
|
|
296
|
+
}
|
|
297
|
+
|
|
272
298
|
function interpolatePath(template, id) {
|
|
273
299
|
return template.replace(':id', id);
|
|
274
300
|
}
|
|
@@ -487,6 +513,33 @@ function formatOutput(data, commandKey) {
|
|
|
487
513
|
return;
|
|
488
514
|
}
|
|
489
515
|
|
|
516
|
+
if (commandKey === 'notes.list' || commandKey === 'portal.notes' || commandKey === 'portal.notes.project') {
|
|
517
|
+
const items = data.data || [];
|
|
518
|
+
if (items.length === 0) { console.log('No notes found.'); return; }
|
|
519
|
+
console.log(`\nClient Notes (${items.length}):`);
|
|
520
|
+
console.log('-'.repeat(80));
|
|
521
|
+
for (const note of items) {
|
|
522
|
+
const projects = note.projects?.length
|
|
523
|
+
? ` -> ${note.projects.map((project) => project.name).join(', ')}`
|
|
524
|
+
: '';
|
|
525
|
+
console.log(` ${note.title} [${note.status}]${projects} [${note.id}]`);
|
|
526
|
+
if (note.commentCount) console.log(` Discussion: ${note.commentCount} repl${note.commentCount === 1 ? 'y' : 'ies'}`);
|
|
527
|
+
}
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if (commandKey === 'notes.comments' || commandKey === 'portal.notes.comments') {
|
|
532
|
+
const items = data.data || [];
|
|
533
|
+
if (items.length === 0) { console.log('No note replies yet.'); return; }
|
|
534
|
+
console.log(`\nNote Discussion (${items.length}):`);
|
|
535
|
+
for (const comment of items) {
|
|
536
|
+
const badge = comment.authorType === 'admin' ? '[klevar]' : '[client]';
|
|
537
|
+
console.log(` ${comment.authorName} ${badge} - ${timeAgo(comment.createdAt)}`);
|
|
538
|
+
console.log(` ${comment.content}`);
|
|
539
|
+
}
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
|
|
490
543
|
if (
|
|
491
544
|
commandKey === 'clients.docs-invoices' ||
|
|
492
545
|
commandKey === 'projects.docs-invoices'
|
|
@@ -569,9 +622,21 @@ function formatOutput(data, commandKey) {
|
|
|
569
622
|
return;
|
|
570
623
|
}
|
|
571
624
|
|
|
572
|
-
if (commandKey === 'comments.create' && data.comment) {
|
|
625
|
+
if ((commandKey === 'comments.create' || commandKey === 'comments.update' || commandKey === 'comments.delete') && data.comment) {
|
|
626
|
+
const c = data.comment;
|
|
627
|
+
if (commandKey === 'comments.update') {
|
|
628
|
+
console.log(`Comment edited by ${c.authorName} [${c.id}]`);
|
|
629
|
+
} else if (commandKey === 'comments.delete') {
|
|
630
|
+
console.log(`Comment deleted by ${c.authorName} [${c.id}]`);
|
|
631
|
+
} else {
|
|
632
|
+
console.log(`Comment posted by ${c.authorName} [${c.authorType}] on ${c.visibility} update`);
|
|
633
|
+
}
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
if ((commandKey === 'notes.reply' || commandKey === 'portal.notes.reply') && data.comment) {
|
|
573
638
|
const c = data.comment;
|
|
574
|
-
console.log(`
|
|
639
|
+
console.log(`Note reply posted by ${c.authorName} [${c.authorType}] [${c.id}]`);
|
|
575
640
|
return;
|
|
576
641
|
}
|
|
577
642
|
|
|
@@ -628,6 +693,13 @@ function formatOutput(data, commandKey) {
|
|
|
628
693
|
console.log(`${action}${vis}: ${u.content.slice(0, 80)}${u.content.length > 80 ? '...' : ''} [${u.id}]${edited}`);
|
|
629
694
|
return;
|
|
630
695
|
}
|
|
696
|
+
if (data.note) {
|
|
697
|
+
const n = data.note;
|
|
698
|
+
const projects = n.projects?.length ? ` (${n.projects.map((project) => project.name).join(', ')})` : '';
|
|
699
|
+
const action = commandKey === 'notes.update' ? 'Note updated' : 'Note created';
|
|
700
|
+
console.log(`${action}: ${n.title} [${n.status}]${projects} [${n.id}]`);
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
631
703
|
if (data.portalToken) {
|
|
632
704
|
console.log(`New token: ${data.portalToken}`);
|
|
633
705
|
return;
|
|
@@ -732,6 +804,16 @@ OUTPUT_JSON = flags.json === 'true';
|
|
|
732
804
|
COMPACT_JSON = flags.compact === 'true';
|
|
733
805
|
const id = positional[0];
|
|
734
806
|
|
|
807
|
+
if (supportsCommentContentInput(commandKey)) {
|
|
808
|
+
if (flags['content-file']) {
|
|
809
|
+
flags.content = readFileSync(flags['content-file'], 'utf-8');
|
|
810
|
+
} else if (flags.stdin === 'true') {
|
|
811
|
+
flags.content = readFileSync(0, 'utf-8');
|
|
812
|
+
} else if (flags.content !== undefined) {
|
|
813
|
+
flags.content = normalizeCliMultiline(flags.content);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
735
817
|
// Interpolate path
|
|
736
818
|
let path = cmd.path;
|
|
737
819
|
const pathParams = [...path.matchAll(/:([A-Za-z][A-Za-z0-9_]*)/g)].map((match) => match[1]);
|
|
@@ -776,6 +858,7 @@ if (cmd.fixedBody) {
|
|
|
776
858
|
if (typeof val === 'string' && (val.startsWith('{') || val.startsWith('['))) {
|
|
777
859
|
try { val = JSON.parse(val); } catch { /* keep as string */ }
|
|
778
860
|
}
|
|
861
|
+
if (key === 'projectIds') val = normalizeCsvList(val);
|
|
779
862
|
if (val === 'true') val = true;
|
|
780
863
|
if (val === 'false') val = false;
|
|
781
864
|
body[key] = val;
|
|
@@ -787,6 +870,9 @@ if (cmd.fixedBody) {
|
|
|
787
870
|
if (commandKey === 'updates.create' && !body && positional[1]) {
|
|
788
871
|
body = { content: positional.slice(1).join(' '), visibility: 'client' };
|
|
789
872
|
}
|
|
873
|
+
if (supportsCommentContentInput(commandKey) && !body && positional[pathParams.length]) {
|
|
874
|
+
body = { content: normalizeCliMultiline(positional.slice(pathParams.length).join(' ')) };
|
|
875
|
+
}
|
|
790
876
|
|
|
791
877
|
// ── Search Command ──
|
|
792
878
|
if (commandKey === 'search') {
|