@zincapp/znvault-cli 2.11.0 → 2.12.0

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,69 @@
1
+ import type { Command } from 'commander';
2
+ import type { VaultClient } from '../lib/client.js';
3
+ import type { FullConfig } from '../types/index.js';
4
+ import * as output from '../lib/output.js';
5
+ /**
6
+ * CLI plugin interface
7
+ *
8
+ * Plugins can add commands to the znvault CLI by implementing this interface.
9
+ * Commands are registered on the commander program during CLI startup.
10
+ */
11
+ export interface CLIPlugin {
12
+ /** Unique plugin name (e.g., 'payara', 'kubernetes') */
13
+ name: string;
14
+ /** Semver version */
15
+ version: string;
16
+ /** Optional description */
17
+ description?: string;
18
+ /**
19
+ * Register commands on the CLI program.
20
+ * Can add top-level commands or subcommands under existing groups.
21
+ *
22
+ * @param program - The root Commander program
23
+ * @param ctx - Context with access to client, output, and config
24
+ */
25
+ registerCommands(program: Command, ctx: CLIPluginContext): void;
26
+ }
27
+ /**
28
+ * Factory function for creating configurable plugins
29
+ */
30
+ export type CLIPluginFactory = (config?: Record<string, unknown>) => CLIPlugin;
31
+ /**
32
+ * Context provided to CLI plugins - safe access to CLI internals
33
+ */
34
+ export interface CLIPluginContext {
35
+ /** HTTP client with authentication */
36
+ client: VaultClient;
37
+ /** Output utilities (respects --plain mode) */
38
+ output: typeof output;
39
+ /** Get current profile config */
40
+ getConfig(): FullConfig;
41
+ /** Get current profile name */
42
+ getProfileName(): string;
43
+ /** Check if plain mode is active */
44
+ isPlainMode(): boolean;
45
+ }
46
+ /**
47
+ * Plugin configuration stored in CLI config
48
+ */
49
+ export interface CLIPluginConfig {
50
+ /** npm package name (e.g., '@zincapp/znvault-plugin-payara') */
51
+ package?: string;
52
+ /** Local file path (alternative to package) */
53
+ path?: string;
54
+ /** Plugin-specific configuration passed to factory */
55
+ config?: Record<string, unknown>;
56
+ /** Enable/disable plugin (default: true) */
57
+ enabled?: boolean;
58
+ }
59
+ /**
60
+ * Internal loaded plugin state
61
+ */
62
+ export interface LoadedCLIPlugin {
63
+ plugin: CLIPlugin;
64
+ config?: Record<string, unknown>;
65
+ source: string;
66
+ status: 'loaded' | 'error';
67
+ error?: Error;
68
+ }
69
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IAEb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAEhB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACjE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,SAAS,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,MAAM,EAAE,WAAW,CAAC;IAEpB,+CAA+C;IAC/C,MAAM,EAAE,OAAO,MAAM,CAAC;IAEtB,iCAAiC;IACjC,SAAS,IAAI,UAAU,CAAC;IAExB,+BAA+B;IAC/B,cAAc,IAAI,MAAM,CAAC;IAEzB,oCAAoC;IACpC,WAAW,IAAI,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
@@ -0,0 +1,4 @@
1
+ // Path: znvault-cli/src/plugins/types.ts
2
+ // CLI plugin interfaces for znvault
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zincapp/znvault-cli",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "description": "Official CLI for ZN-Vault administration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",