@camunda8/cli 2.6.1 → 2.7.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.
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Declarative command registry — single source of truth for all
3
+ * verb×resource combinations, their flags, constraints, and metadata.
4
+ *
5
+ * Consumers (help, completion, validation, dispatch) derive their
6
+ * data from this registry instead of maintaining separate copies.
7
+ */
8
+ export interface FlagDef {
9
+ type: "string" | "boolean";
10
+ description: string;
11
+ short?: string;
12
+ required?: boolean;
13
+ /** SDK enum object for automatic validation (keys are valid values). */
14
+ enum?: Record<string, string>;
15
+ /** When true, flag value is comma-separated and each item is validated against enum. */
16
+ csv?: boolean;
17
+ }
18
+ export interface CommandDef {
19
+ description: string;
20
+ mutating: boolean;
21
+ /** When true, a positional resource argument is required after the verb. */
22
+ requiresResource: boolean;
23
+ /** Valid resource names (canonical short forms used in help). */
24
+ resources: string[];
25
+ /** Flags specific to this verb (beyond global flags). */
26
+ flags: Record<string, FlagDef>;
27
+ /** Verb aliases that dispatch to this command (e.g. "rm" → remove, "w" → watch). */
28
+ aliases?: string[];
29
+ }
30
+ /**
31
+ * Maps short/plural resource names to their canonical singular form.
32
+ * Used by the dispatch layer to normalize user input before lookup.
33
+ */
34
+ export declare const RESOURCE_ALIASES: Record<string, string>;
35
+ /**
36
+ * Flags accepted by every command (infrastructure/agent flags).
37
+ */
38
+ export declare const GLOBAL_FLAGS: Record<string, FlagDef>;
39
+ /**
40
+ * Flags shared across all search/list commands.
41
+ */
42
+ export declare const SEARCH_FLAGS: Record<string, FlagDef>;
43
+ export declare const COMMAND_REGISTRY: Record<string, CommandDef>;
44
+ /**
45
+ * Maps each searchable resource (canonical name) to the set of flag names
46
+ * that are valid for that resource's search command. Used for unknown-flag
47
+ * detection in search commands.
48
+ */
49
+ export declare const SEARCH_RESOURCE_FLAGS: Record<string, Set<string>>;
50
+ /**
51
+ * Maps verb aliases to their canonical verb names.
52
+ * Built from COMMAND_REGISTRY aliases fields.
53
+ * e.g. { "rm": ["remove", "unload"], "w": ["watch"] }
54
+ */
55
+ export declare const VERB_ALIASES: Record<string, string[]>;
56
+ /**
57
+ * Resolve a resource alias to its canonical form.
58
+ * Returns the input unchanged if no alias exists.
59
+ */
60
+ export declare function resolveAlias(resource: string): string;
61
+ /**
62
+ * Look up a command definition by verb (resolves verb aliases).
63
+ * For alias verbs that map to multiple commands (e.g. "rm" → remove + unload),
64
+ * returns the first match. Use VERB_ALIASES directly for multi-target aliases.
65
+ */
66
+ export declare function getCommandDef(verb: string): CommandDef | undefined;
67
+ /**
68
+ * Get all flags accepted for a given verb, including global flags.
69
+ */
70
+ export declare function getAcceptedFlags(verb: string): Record<string, FlagDef> | undefined;
71
+ /**
72
+ * Get the set of resource-specific search flags for a given canonical resource.
73
+ */
74
+ export declare function getSearchFlagsForResource(resource: string): Set<string> | undefined;
75
+ /**
76
+ * Check whether a verb×resource combination is valid.
77
+ * Accepts both raw aliases and canonical resource names.
78
+ */
79
+ export declare function isValidCommand(verb: string, resource: string): boolean;
80
+ /**
81
+ * Derive parseArgs options from the registry. This produces the flat
82
+ * options object that node:util parseArgs expects, covering all flags
83
+ * from all commands plus global flags.
84
+ */
85
+ export declare function deriveParseArgsOptions(): Record<string, {
86
+ type: "string" | "boolean";
87
+ short?: string;
88
+ }>;
89
+ //# sourceMappingURL=command-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-registry.d.ts","sourceRoot":"","sources":["../src/command-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,C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