@camunda8/cli 2.7.0-alpha.9 → 2.8.0-alpha.1
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/EXAMPLES.md +14 -1
- package/README.md +11 -3
- package/dist/client.d.ts +2 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js.map +1 -1
- package/dist/command-dispatch.d.ts.map +1 -1
- package/dist/command-dispatch.js +22 -1
- package/dist/command-dispatch.js.map +1 -1
- package/dist/command-framework.d.ts +36 -6
- package/dist/command-framework.d.ts.map +1 -1
- package/dist/command-framework.js +53 -19
- package/dist/command-framework.js.map +1 -1
- package/dist/command-registry.d.ts +85 -61
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +108 -52
- package/dist/command-registry.js.map +1 -1
- package/dist/command-validation.d.ts +14 -6
- package/dist/command-validation.d.ts.map +1 -1
- package/dist/command-validation.js +69 -8
- package/dist/command-validation.js.map +1 -1
- package/dist/commands/completion.d.ts +19 -0
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +36 -14
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/deployments.d.ts +30 -3
- package/dist/commands/deployments.d.ts.map +1 -1
- package/dist/commands/deployments.js +320 -218
- package/dist/commands/deployments.js.map +1 -1
- package/dist/commands/forms.d.ts.map +1 -1
- package/dist/commands/forms.js +2 -3
- package/dist/commands/forms.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +39 -39
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/identity-groups.d.ts.map +1 -1
- package/dist/commands/identity-groups.js +3 -5
- package/dist/commands/identity-groups.js.map +1 -1
- package/dist/commands/identity-mapping-rules.d.ts.map +1 -1
- package/dist/commands/identity-mapping-rules.js +5 -9
- package/dist/commands/identity-mapping-rules.js.map +1 -1
- package/dist/commands/identity-roles.d.ts.map +1 -1
- package/dist/commands/identity-roles.js +3 -5
- package/dist/commands/identity-roles.js.map +1 -1
- package/dist/commands/identity-tenants.d.ts.map +1 -1
- package/dist/commands/identity-tenants.js +3 -5
- package/dist/commands/identity-tenants.js.map +1 -1
- package/dist/commands/identity-users.d.ts.map +1 -1
- package/dist/commands/identity-users.js +3 -5
- package/dist/commands/identity-users.js.map +1 -1
- package/dist/commands/identity.d.ts +29 -2
- package/dist/commands/identity.d.ts.map +1 -1
- package/dist/commands/identity.js +247 -208
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/incidents.d.ts.map +1 -1
- package/dist/commands/incidents.js +2 -3
- package/dist/commands/incidents.js.map +1 -1
- package/dist/commands/jobs.d.ts.map +1 -1
- package/dist/commands/jobs.js +5 -9
- package/dist/commands/jobs.js.map +1 -1
- package/dist/commands/mcp-proxy.d.ts +4 -4
- package/dist/commands/mcp-proxy.d.ts.map +1 -1
- package/dist/commands/mcp-proxy.js +49 -39
- package/dist/commands/mcp-proxy.js.map +1 -1
- package/dist/commands/messages.d.ts.map +1 -1
- package/dist/commands/messages.js +2 -4
- package/dist/commands/messages.js.map +1 -1
- package/dist/commands/open.d.ts +4 -2
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +17 -18
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +16 -32
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/process-instances.d.ts.map +1 -1
- package/dist/commands/process-instances.js +5 -9
- package/dist/commands/process-instances.js.map +1 -1
- package/dist/commands/profiles.d.ts.map +1 -1
- package/dist/commands/profiles.js +8 -16
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/resource-extensions.d.ts +8 -0
- package/dist/commands/resource-extensions.d.ts.map +1 -0
- package/dist/commands/resource-extensions.js +20 -0
- package/dist/commands/resource-extensions.js.map +1 -0
- package/dist/commands/run.d.ts +2 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +10 -4
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +4 -8
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +4 -7
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/user-tasks.d.ts.map +1 -1
- package/dist/commands/user-tasks.js +2 -3
- package/dist/commands/user-tasks.js.map +1 -1
- package/dist/commands/variables.d.ts +10 -0
- package/dist/commands/variables.d.ts.map +1 -0
- package/dist/commands/variables.js +51 -0
- package/dist/commands/variables.js.map +1 -0
- package/dist/commands/watch.d.ts +7 -5
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +90 -39
- package/dist/commands/watch.js.map +1 -1
- package/dist/errors.d.ts +62 -8
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +99 -10
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -39
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
package/dist/errors.d.ts
CHANGED
|
@@ -1,19 +1,73 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized error handling for c8ctl command operations.
|
|
3
3
|
*
|
|
4
|
-
* When --verbose is set, errors are
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* When --verbose is set, errors are normalized via `normalizeToError`
|
|
5
|
+
* (Errors pass through unchanged; non-Error throws like RFC 9457
|
|
6
|
+
* problem-detail objects are wrapped in an `Error` whose message is
|
|
7
|
+
* built from `title` / `detail` / `status` and whose `cause` retains
|
|
8
|
+
* the original value) and then thrown so Node.js prints a meaningful
|
|
9
|
+
* stack trace. When it is not set, a terse user-friendly message is
|
|
10
|
+
* emitted and the process exits with a non-zero code, with a hint
|
|
11
|
+
* about using --verbose.
|
|
7
12
|
*/
|
|
8
13
|
import type { Logger } from "./logger.ts";
|
|
14
|
+
/**
|
|
15
|
+
* Marker error: the caller has already rendered a rich, user-facing
|
|
16
|
+
* error message (e.g. multi-line context, hints, formatted detail) and
|
|
17
|
+
* just needs the framework to exit non-zero. `handleCommandError` skips
|
|
18
|
+
* its default `logger.error(...)` + verbose-hint render for these,
|
|
19
|
+
* avoiding duplicate "Failed to <verb>: <message>" summary lines on
|
|
20
|
+
* top of the rich pre-rendered output.
|
|
21
|
+
*
|
|
22
|
+
* Use this only when the helper has already produced a complete,
|
|
23
|
+
* user-actionable failure message. For ordinary errors that just need
|
|
24
|
+
* to bubble up, throw a plain `Error` and let the framework format it.
|
|
25
|
+
*/
|
|
26
|
+
export declare class SilentError extends Error {
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Normalize any thrown value into an `Error` instance, with care taken
|
|
31
|
+
* to preserve actionable information from RFC 9457 problem-detail
|
|
32
|
+
* objects (which the Camunda SDK throws as plain objects, not Errors).
|
|
33
|
+
*
|
|
34
|
+
* - If `error` is already an `Error`, it is returned unchanged.
|
|
35
|
+
* - If `error` looks like an RFC 9457 problem detail (has any of
|
|
36
|
+
* `title` / `detail` / `status`), the synthesized Error message is
|
|
37
|
+
* built from those fields so it is meaningful to a user (instead of
|
|
38
|
+
* the useless `"[object Object]"` produced by `String(error)`).
|
|
39
|
+
* - Otherwise the synthesized Error uses `fallbackMessage`.
|
|
40
|
+
*
|
|
41
|
+
* The original value is always preserved as `cause` so it remains
|
|
42
|
+
* inspectable (e.g. under `--verbose` stack output).
|
|
43
|
+
*
|
|
44
|
+
* Class of defect this guards against: `new Error(String(error))` for
|
|
45
|
+
* non-Error throws collapses problem-detail responses to
|
|
46
|
+
* `Error: [object Object]`, losing every actionable field.
|
|
47
|
+
*/
|
|
48
|
+
export declare function normalizeToError(error: unknown, fallbackMessage?: string): Error;
|
|
9
49
|
/**
|
|
10
50
|
* Handle a command error in a consistent way across the codebase.
|
|
11
51
|
*
|
|
12
|
-
* - In verbose mode (`--verbose`): the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
52
|
+
* - In verbose mode (`--verbose`): the input is run through
|
|
53
|
+
* `normalizeToError` and the resulting `Error` is thrown so Node.js
|
|
54
|
+
* prints the full stack trace. For inputs that are already an
|
|
55
|
+
* `Error` this is a no-op (the same instance is thrown). For non-
|
|
56
|
+
* Error throws the thrown value is the synthesized normalized
|
|
57
|
+
* `Error`, which preserves the original value as `cause`. (Callers
|
|
58
|
+
* that need the exact original reference can read `.cause` from the
|
|
59
|
+
* thrown error.)
|
|
60
|
+
* - In normal mode: a terse message is printed via the logger,
|
|
61
|
+
* followed by any optional additional hints, and then a hint to
|
|
62
|
+
* re-run with `--verbose`. The process exits with code 1. To avoid
|
|
63
|
+
* duplicated output when the normalized error has no actionable
|
|
64
|
+
* detail beyond `message` (e.g. for primitive throws), the second
|
|
65
|
+
* `error` argument to `logger.error` is omitted in that case so the
|
|
66
|
+
* user message appears exactly once.
|
|
67
|
+
* - For `SilentError`: skip the default render entirely (the caller
|
|
68
|
+
* has already shown a user-facing error), and just exit non-zero
|
|
69
|
+
* (or rethrow in verbose mode — `SilentError` is an `Error`, so
|
|
70
|
+
* normalization is a no-op and the same instance is thrown).
|
|
17
71
|
*/
|
|
18
72
|
export declare function handleCommandError(logger: Logger, message: string, error: unknown, additionalHints?: string[]): never;
|
|
19
73
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,OAAO,EACd,eAAe,SAAqB,GAClC,KAAK,CAaP;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,EACd,eAAe,CAAC,EAAE,MAAM,EAAE,GACxB,KAAK,CAiCP"}
|
package/dist/errors.js
CHANGED
|
@@ -1,26 +1,115 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized error handling for c8ctl command operations.
|
|
3
3
|
*
|
|
4
|
-
* When --verbose is set, errors are
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* When --verbose is set, errors are normalized via `normalizeToError`
|
|
5
|
+
* (Errors pass through unchanged; non-Error throws like RFC 9457
|
|
6
|
+
* problem-detail objects are wrapped in an `Error` whose message is
|
|
7
|
+
* built from `title` / `detail` / `status` and whose `cause` retains
|
|
8
|
+
* the original value) and then thrown so Node.js prints a meaningful
|
|
9
|
+
* stack trace. When it is not set, a terse user-friendly message is
|
|
10
|
+
* emitted and the process exits with a non-zero code, with a hint
|
|
11
|
+
* about using --verbose.
|
|
7
12
|
*/
|
|
13
|
+
import { isRecord } from "./logger.js";
|
|
8
14
|
import { c8ctl } from "./runtime.js";
|
|
15
|
+
/**
|
|
16
|
+
* Marker error: the caller has already rendered a rich, user-facing
|
|
17
|
+
* error message (e.g. multi-line context, hints, formatted detail) and
|
|
18
|
+
* just needs the framework to exit non-zero. `handleCommandError` skips
|
|
19
|
+
* its default `logger.error(...)` + verbose-hint render for these,
|
|
20
|
+
* avoiding duplicate "Failed to <verb>: <message>" summary lines on
|
|
21
|
+
* top of the rich pre-rendered output.
|
|
22
|
+
*
|
|
23
|
+
* Use this only when the helper has already produced a complete,
|
|
24
|
+
* user-actionable failure message. For ordinary errors that just need
|
|
25
|
+
* to bubble up, throw a plain `Error` and let the framework format it.
|
|
26
|
+
*/
|
|
27
|
+
export class SilentError extends Error {
|
|
28
|
+
constructor(message) {
|
|
29
|
+
super(message);
|
|
30
|
+
this.name = "SilentError";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Normalize any thrown value into an `Error` instance, with care taken
|
|
35
|
+
* to preserve actionable information from RFC 9457 problem-detail
|
|
36
|
+
* objects (which the Camunda SDK throws as plain objects, not Errors).
|
|
37
|
+
*
|
|
38
|
+
* - If `error` is already an `Error`, it is returned unchanged.
|
|
39
|
+
* - If `error` looks like an RFC 9457 problem detail (has any of
|
|
40
|
+
* `title` / `detail` / `status`), the synthesized Error message is
|
|
41
|
+
* built from those fields so it is meaningful to a user (instead of
|
|
42
|
+
* the useless `"[object Object]"` produced by `String(error)`).
|
|
43
|
+
* - Otherwise the synthesized Error uses `fallbackMessage`.
|
|
44
|
+
*
|
|
45
|
+
* The original value is always preserved as `cause` so it remains
|
|
46
|
+
* inspectable (e.g. under `--verbose` stack output).
|
|
47
|
+
*
|
|
48
|
+
* Class of defect this guards against: `new Error(String(error))` for
|
|
49
|
+
* non-Error throws collapses problem-detail responses to
|
|
50
|
+
* `Error: [object Object]`, losing every actionable field.
|
|
51
|
+
*/
|
|
52
|
+
export function normalizeToError(error, fallbackMessage = "Operation failed") {
|
|
53
|
+
if (error instanceof Error) {
|
|
54
|
+
return error;
|
|
55
|
+
}
|
|
56
|
+
const raw = isRecord(error) ? error : {};
|
|
57
|
+
const title = typeof raw.title === "string" ? raw.title : undefined;
|
|
58
|
+
const detail = typeof raw.detail === "string" ? raw.detail : undefined;
|
|
59
|
+
const status = typeof raw.status === "number" ? raw.status : undefined;
|
|
60
|
+
const head = [title ?? fallbackMessage, detail]
|
|
61
|
+
.filter((p) => Boolean(p))
|
|
62
|
+
.join(": ");
|
|
63
|
+
const message = status !== undefined ? `${head} (status ${status})` : head;
|
|
64
|
+
return new Error(message, { cause: error });
|
|
65
|
+
}
|
|
9
66
|
/**
|
|
10
67
|
* Handle a command error in a consistent way across the codebase.
|
|
11
68
|
*
|
|
12
|
-
* - In verbose mode (`--verbose`): the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
69
|
+
* - In verbose mode (`--verbose`): the input is run through
|
|
70
|
+
* `normalizeToError` and the resulting `Error` is thrown so Node.js
|
|
71
|
+
* prints the full stack trace. For inputs that are already an
|
|
72
|
+
* `Error` this is a no-op (the same instance is thrown). For non-
|
|
73
|
+
* Error throws the thrown value is the synthesized normalized
|
|
74
|
+
* `Error`, which preserves the original value as `cause`. (Callers
|
|
75
|
+
* that need the exact original reference can read `.cause` from the
|
|
76
|
+
* thrown error.)
|
|
77
|
+
* - In normal mode: a terse message is printed via the logger,
|
|
78
|
+
* followed by any optional additional hints, and then a hint to
|
|
79
|
+
* re-run with `--verbose`. The process exits with code 1. To avoid
|
|
80
|
+
* duplicated output when the normalized error has no actionable
|
|
81
|
+
* detail beyond `message` (e.g. for primitive throws), the second
|
|
82
|
+
* `error` argument to `logger.error` is omitted in that case so the
|
|
83
|
+
* user message appears exactly once.
|
|
84
|
+
* - For `SilentError`: skip the default render entirely (the caller
|
|
85
|
+
* has already shown a user-facing error), and just exit non-zero
|
|
86
|
+
* (or rethrow in verbose mode — `SilentError` is an `Error`, so
|
|
87
|
+
* normalization is a no-op and the same instance is thrown).
|
|
17
88
|
*/
|
|
18
89
|
export function handleCommandError(logger, message, error, additionalHints) {
|
|
19
|
-
const normalizedError = error
|
|
90
|
+
const normalizedError = normalizeToError(error, message);
|
|
20
91
|
if (c8ctl.verbose) {
|
|
21
92
|
throw normalizedError;
|
|
22
93
|
}
|
|
23
|
-
|
|
94
|
+
if (error instanceof SilentError) {
|
|
95
|
+
// Caller already rendered a rich user-facing message. Don't
|
|
96
|
+
// stack a "Failed to ...: <message>" + verbose-hint summary on
|
|
97
|
+
// top — just exit non-zero.
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
// Avoid duplicated output when `normalizeToError` had no actionable
|
|
101
|
+
// fields to extract and fell back to the caller's `message`. In that
|
|
102
|
+
// case `Logger.error(message, error)` would print the same string
|
|
103
|
+
// twice (the prefix line "✗ <message>" followed by the indented
|
|
104
|
+
// " <error.message>" line, or both `message` and `error` fields in
|
|
105
|
+
// JSON mode). Pass only `message` so the second line / `error` field
|
|
106
|
+
// is omitted.
|
|
107
|
+
if (normalizedError.message === message) {
|
|
108
|
+
logger.error(message);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
logger.error(message, normalizedError);
|
|
112
|
+
}
|
|
24
113
|
if (additionalHints) {
|
|
25
114
|
for (const hint of additionalHints) {
|
|
26
115
|
logger.info(hint);
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACrC,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC3B,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,gBAAgB,CAC/B,KAAc,EACd,eAAe,GAAG,kBAAkB;IAEpC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,GAAG,GAA4B,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,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O,KAAK,OAAO,EAAE,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,eAAe,EAAE,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACF,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;IAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AA2EH;;GAEG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,GAAG,SAAS,CAMpB"}
|
package/dist/index.js
CHANGED
|
@@ -10,9 +10,8 @@ import { createClient } from "./client.js";
|
|
|
10
10
|
import { COMMAND_DISPATCH } from "./command-dispatch.js";
|
|
11
11
|
import { COMMAND_REGISTRY, deriveParseArgsOptions, getCommandDef, resolveAlias, } from "./command-registry.js";
|
|
12
12
|
import { detectUnknownFlags, validateFlags } from "./command-validation.js";
|
|
13
|
-
import {
|
|
13
|
+
import { refreshCompletionsIfStale } from "./commands/completion.js";
|
|
14
14
|
import { showCommandHelp, showHelp, showVerbResources, showVersion, } from "./commands/help.js";
|
|
15
|
-
import { handleAssign, handleUnassign } from "./commands/identity.js";
|
|
16
15
|
import { loadSessionState, resolveTenantId } from "./config.js";
|
|
17
16
|
import { getLogger } from "./logger.js";
|
|
18
17
|
import { executePluginCommand, loadInstalledPlugins } from "./plugin-loader.js";
|
|
@@ -158,19 +157,6 @@ async function main() {
|
|
|
158
157
|
}
|
|
159
158
|
return;
|
|
160
159
|
}
|
|
161
|
-
// Handle completion command
|
|
162
|
-
if (verb === "completion") {
|
|
163
|
-
// Run unknown-flag detection before early return (completion returns
|
|
164
|
-
// before the general detectUnknownFlags call below).
|
|
165
|
-
const completionUnknownFlags = detectUnknownFlags(verb, resource ?? "", values);
|
|
166
|
-
warnUnknownFlags(logger, completionUnknownFlags, verb, resource ?? "");
|
|
167
|
-
if (resource === "install") {
|
|
168
|
-
installCompletion(str(values.shell));
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
showCompletion(resource);
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
160
|
// Normalize resource
|
|
175
161
|
const normalizedResource = resource ? resolveAlias(resource) : "";
|
|
176
162
|
// Resource validation guard — single chokepoint for all verbs that require a resource.
|
|
@@ -187,35 +173,16 @@ async function main() {
|
|
|
187
173
|
}
|
|
188
174
|
// Flag validation — run all registered validators before dispatch.
|
|
189
175
|
// Validators throw on invalid input; validateFlags catches and exits.
|
|
176
|
+
// Also enforces `required: true` on the effective flag set (#308).
|
|
190
177
|
const commandDef = getCommandDef(verb);
|
|
191
178
|
if (commandDef) {
|
|
192
|
-
|
|
179
|
+
const effectiveFlags = commandDef.resourceFlags?.[normalizedResource] ?? commandDef.flags;
|
|
180
|
+
validateFlags(values, effectiveFlags);
|
|
193
181
|
}
|
|
194
182
|
// Unknown flag detection — warn about flags not recognised for this verb × resource.
|
|
195
183
|
// Derived from COMMAND_REGISTRY; resource-scoped for search/list.
|
|
196
184
|
const unknownFlags = detectUnknownFlags(verb, normalizedResource, values);
|
|
197
185
|
warnUnknownFlags(logger, unknownFlags, verb, resource);
|
|
198
|
-
// ── Assign / unassign — legacy delegation (not yet migrated to defineCommand) ──
|
|
199
|
-
if (verb === "assign") {
|
|
200
|
-
if (!args[0]) {
|
|
201
|
-
logger.error(`ID required. Usage: c8 assign ${normalizedResource} <id> --to-<target>=<targetId>`);
|
|
202
|
-
process.exit(1);
|
|
203
|
-
}
|
|
204
|
-
await handleAssign(normalizedResource, args[0], values, {
|
|
205
|
-
profile: str(values.profile),
|
|
206
|
-
});
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (verb === "unassign") {
|
|
210
|
-
if (!args[0]) {
|
|
211
|
-
logger.error(`ID required. Usage: c8 unassign ${normalizedResource} <id> --from-<target>=<targetId>`);
|
|
212
|
-
process.exit(1);
|
|
213
|
-
}
|
|
214
|
-
await handleUnassign(normalizedResource, args[0], values, {
|
|
215
|
-
profile: str(values.profile),
|
|
216
|
-
});
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
186
|
// ── Registry-driven dispatch ───────────────────────────────────────────
|
|
220
187
|
// For verbs with enumerated resources (e.g. `list process-instance`),
|
|
221
188
|
// the dispatch key includes the normalised resource.
|
|
@@ -235,10 +202,26 @@ async function main() {
|
|
|
235
202
|
(useResourceKey ? COMMAND_DISPATCH.get(`${verb}:`) : undefined);
|
|
236
203
|
if (handler) {
|
|
237
204
|
const profile = str(values.profile);
|
|
205
|
+
// Lazy config access: createClient() and resolveTenantId() are deferred
|
|
206
|
+
// until first access, so commands that never touch ctx.client or
|
|
207
|
+
// ctx.tenantId (e.g. session/profile management) skip config resolution.
|
|
208
|
+
let _client;
|
|
209
|
+
let _tenantId;
|
|
210
|
+
let _tenantResolved = false;
|
|
238
211
|
const ctx = {
|
|
239
|
-
client
|
|
212
|
+
get client() {
|
|
213
|
+
if (!_client)
|
|
214
|
+
_client = createClient(profile);
|
|
215
|
+
return _client;
|
|
216
|
+
},
|
|
240
217
|
logger,
|
|
241
|
-
tenantId
|
|
218
|
+
get tenantId() {
|
|
219
|
+
if (!_tenantResolved) {
|
|
220
|
+
_tenantId = resolveTenantId(profile);
|
|
221
|
+
_tenantResolved = true;
|
|
222
|
+
}
|
|
223
|
+
return _tenantId;
|
|
224
|
+
},
|
|
242
225
|
resource: useResourceKey ? normalizedResource : resource || "",
|
|
243
226
|
positionals: args,
|
|
244
227
|
sortOrder,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EACN,gBAAgB,EAEhB,sBAAsB,EACtB,aAAa,EACb,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EACN,gBAAgB,EAEhB,sBAAsB,EACtB,aAAa,EACb,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EACN,eAAe,EACf,QAAQ,EACR,iBA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YAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;AACF,CAAC;AAAC,MAAM,CAAC;IACR,0BAA0B;AAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda8/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0-alpha.1",
|
|
4
4
|
"description": "Camunda 8 CLI - minimal-dependency CLI for Camunda 8 operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -27,14 +27,16 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"prepare": "git rev-parse --is-inside-work-tree >/dev/null 2>&1 && sh -c 'hp=$(git config --local --get core.hooksPath 2>/dev/null || true); if [ -z \"$hp\" ] || [ \"$hp\" = \".githooks\" ]; then git config --local core.hooksPath .githooks; else echo \"prepare: leaving existing core.hooksPath=$hp\"; fi' || true",
|
|
29
29
|
"build": "npm run lint && npm run clean && tsc && npm run copy-plugins && npm run copy-templates",
|
|
30
|
-
"lint": "biome check src/",
|
|
30
|
+
"lint": "biome check src/ tests/",
|
|
31
|
+
"lint:src": "biome check src/",
|
|
32
|
+
"typecheck": "tsc --noEmit -p tsconfig.check.json",
|
|
31
33
|
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
32
34
|
"copy-plugins": "node -e \"const fs=require('fs');const path=require('path');const src='default-plugins';const dest='dist/default-plugins';if(fs.existsSync(src)){fs.cpSync(src,dest,{recursive:true})}\"",
|
|
33
35
|
"copy-templates": "node -e \"const fs=require('fs');const src='src/templates';const dest='dist/templates';if(fs.existsSync(src)){fs.cpSync(src,dest,{recursive:true})}\"",
|
|
34
36
|
"prepublishOnly": "npm run build",
|
|
35
|
-
"test": "node --experimental-strip-types --test
|
|
36
|
-
"test:unit": "node --experimental-strip-types --test
|
|
37
|
-
"test:integration": "node --experimental-strip-types --test
|
|
37
|
+
"test": "node --experimental-strip-types --test tests/unit/*.test.ts tests/integration/*.test.ts",
|
|
38
|
+
"test:unit": "node --experimental-strip-types --test tests/unit/*.test.ts",
|
|
39
|
+
"test:integration": "node --experimental-strip-types --test tests/integration/*.test.ts",
|
|
38
40
|
"dev": "node src/index.ts",
|
|
39
41
|
"cli": "node src/index.ts"
|
|
40
42
|
},
|