@klevar/portal-cli 0.1.4 → 0.1.5
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/README.md +13 -0
- package/dist/commands/capacity.d.ts +20 -0
- package/dist/commands/capacity.js +9 -1
- package/dist/commands/capacity.js.map +1 -1
- package/dist/commands/index.d.ts +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,6 +54,9 @@ npx @klevar/portal-cli capacity update <budgetId> --capacityAmount 20
|
|
|
54
54
|
npx @klevar/portal-cli capacity summary <projectId> --period 2026-06
|
|
55
55
|
npx @klevar/portal-cli capacity budget-summary <budgetId> --period 2026-06
|
|
56
56
|
npx @klevar/portal-cli capacity report <projectId> --period 2026-06
|
|
57
|
+
npx @klevar/portal-cli capacity notifications <budgetId>
|
|
58
|
+
npx @klevar/portal-cli capacity notifications-update <budgetId> --notifyAtWarning true --warningThresholdPct 80 --notifyAtCap true --notifyOverCap true --notifyClient false --notifyAdmin true
|
|
59
|
+
npx @klevar/portal-cli capacity notification-state <budgetId> --period 2026-06
|
|
57
60
|
npx @klevar/portal-cli capacity pause <budgetId>
|
|
58
61
|
npx @klevar/portal-cli capacity resume <budgetId>
|
|
59
62
|
npx @klevar/portal-cli capacity end <budgetId>
|
|
@@ -84,6 +87,16 @@ Supported `visibility` values:
|
|
|
84
87
|
- `client_visible_summary`: client can see summary totals only.
|
|
85
88
|
- `client_visible_detail`: client can see summary totals and visible usage entries.
|
|
86
89
|
|
|
90
|
+
Capacity notification flags are writable on `capacity create`, `capacity update`, and `capacity notifications-update`:
|
|
91
|
+
|
|
92
|
+
- `notifyAtWarning`: default `true`.
|
|
93
|
+
- `notifyAtCap`: default `true`.
|
|
94
|
+
- `notifyOverCap`: default `false`.
|
|
95
|
+
- `notifyOnReset`: stored for future reset notifications; no scheduler is active yet.
|
|
96
|
+
- `notifyClient`: default `false`; client capacity emails require explicit opt-in and non-internal visibility.
|
|
97
|
+
- `notifyAdmin`: default `true`.
|
|
98
|
+
- `warningThresholdPct`: default `80`.
|
|
99
|
+
|
|
87
100
|
Validation failures print API field details when the server returns them, for example:
|
|
88
101
|
|
|
89
102
|
```text
|
|
@@ -25,6 +25,26 @@ export declare const capacityCommands: {
|
|
|
25
25
|
description: string;
|
|
26
26
|
body: string[];
|
|
27
27
|
};
|
|
28
|
+
'capacity.notifications': {
|
|
29
|
+
method: "GET";
|
|
30
|
+
path: string;
|
|
31
|
+
auth: "apiKey";
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
'capacity.notifications-update': {
|
|
35
|
+
method: "PATCH";
|
|
36
|
+
path: string;
|
|
37
|
+
auth: "apiKey";
|
|
38
|
+
description: string;
|
|
39
|
+
body: string[];
|
|
40
|
+
};
|
|
41
|
+
'capacity.notification-state': {
|
|
42
|
+
method: "GET";
|
|
43
|
+
path: string;
|
|
44
|
+
auth: "apiKey";
|
|
45
|
+
description: string;
|
|
46
|
+
queryParams: string[];
|
|
47
|
+
};
|
|
28
48
|
'capacity.pause': {
|
|
29
49
|
method: "POST";
|
|
30
50
|
path: string;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
const budgetBody = [
|
|
2
2
|
'name', 'description', 'clientId', 'laneKey', 'unitType', 'customUnitLabel',
|
|
3
3
|
'periodType', 'periodStartDay', 'startDate', 'endDate', 'capacityAmount',
|
|
4
|
-
'warningThresholdPct', '
|
|
4
|
+
'warningThresholdPct', 'notifyAtWarning', 'notifyAtCap', 'notifyOverCap',
|
|
5
|
+
'notifyOnReset', 'notifyClient', 'notifyAdmin', 'hardCap', 'allowOverage', 'overagePolicy',
|
|
5
6
|
'resetBehavior', 'rolloverCapAmount', 'visibility', 'status', 'sortOrder',
|
|
6
7
|
];
|
|
8
|
+
const notificationBody = [
|
|
9
|
+
'warningThresholdPct', 'notifyAtWarning', 'notifyAtCap', 'notifyOverCap',
|
|
10
|
+
'notifyOnReset', 'notifyClient', 'notifyAdmin',
|
|
11
|
+
];
|
|
7
12
|
export const capacityCommands = {
|
|
8
13
|
'capacity.list': { method: 'GET', path: '/api/admin/projects/:projectId/capacity-budgets', auth: 'apiKey', description: 'List project capacity budgets' },
|
|
9
14
|
'capacity.get': { method: 'GET', path: '/api/admin/capacity-budgets/:id', auth: 'apiKey', description: 'Get a capacity budget' },
|
|
10
15
|
'capacity.create': { method: 'POST', path: '/api/admin/projects/:projectId/capacity-budgets', auth: 'apiKey', description: 'Create a capacity budget; periodType monthly|weekly, unitType hours|credits, visibility internal_only|client_visible_summary|client_visible_detail', body: budgetBody },
|
|
11
16
|
'capacity.update': { method: 'PATCH', path: '/api/admin/capacity-budgets/:id', auth: 'apiKey', description: 'Update a capacity budget; periodType monthly|weekly, unitType hours|credits, visibility internal_only|client_visible_summary|client_visible_detail', body: budgetBody },
|
|
17
|
+
'capacity.notifications': { method: 'GET', path: '/api/admin/capacity-budgets/:id/notifications', auth: 'apiKey', description: 'Show capacity notification settings' },
|
|
18
|
+
'capacity.notifications-update': { method: 'PATCH', path: '/api/admin/capacity-budgets/:id/notifications', auth: 'apiKey', description: 'Update capacity notification settings', body: notificationBody },
|
|
19
|
+
'capacity.notification-state': { method: 'GET', path: '/api/admin/capacity-budgets/:id/notification-state', auth: 'apiKey', description: 'List capacity notification dedupe state', queryParams: ['period'] },
|
|
12
20
|
'capacity.pause': { method: 'POST', path: '/api/admin/capacity-budgets/:id/pause', auth: 'apiKey', description: 'Pause a capacity budget' },
|
|
13
21
|
'capacity.resume': { method: 'POST', path: '/api/admin/capacity-budgets/:id/resume', auth: 'apiKey', description: 'Resume a capacity budget' },
|
|
14
22
|
'capacity.end': { method: 'POST', path: '/api/admin/capacity-budgets/:id/end', auth: 'apiKey', description: 'End a capacity budget' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capacity.js","sourceRoot":"","sources":["../../commands/capacity.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE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,yBAAyB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,+CAA+C,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE;IACpL,yBAAyB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,yCAAyC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE;IAC9K,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gDAAgD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE;IAC7K,yBAAyB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kDAAkD,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,yBAAyB,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE;IAC5L,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gDAAgD,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,+BAA+B,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE;CACxK,CAAC"}
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -302,6 +302,26 @@ export declare const COMMAND_GROUPS: {
|
|
|
302
302
|
description: string;
|
|
303
303
|
body: string[];
|
|
304
304
|
};
|
|
305
|
+
'capacity.notifications': {
|
|
306
|
+
method: "GET";
|
|
307
|
+
path: string;
|
|
308
|
+
auth: "apiKey";
|
|
309
|
+
description: string;
|
|
310
|
+
};
|
|
311
|
+
'capacity.notifications-update': {
|
|
312
|
+
method: "PATCH";
|
|
313
|
+
path: string;
|
|
314
|
+
auth: "apiKey";
|
|
315
|
+
description: string;
|
|
316
|
+
body: string[];
|
|
317
|
+
};
|
|
318
|
+
'capacity.notification-state': {
|
|
319
|
+
method: "GET";
|
|
320
|
+
path: string;
|
|
321
|
+
auth: "apiKey";
|
|
322
|
+
description: string;
|
|
323
|
+
queryParams: string[];
|
|
324
|
+
};
|
|
305
325
|
'capacity.pause': {
|
|
306
326
|
method: "POST";
|
|
307
327
|
path: string;
|