@navios/commander 1.5.0 → 1.6.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.
Files changed (121) hide show
  1. package/.turbo/turbo-build.log +48 -0
  2. package/.turbo/turbo-check.log +0 -0
  3. package/.turbo/turbo-lint.log +2 -0
  4. package/.turbo/turbo-test$colon$ci.log +109 -0
  5. package/.turbo/turbo-test.log +107 -0
  6. package/CHANGELOG.md +15 -3
  7. package/README.md +8 -16
  8. package/dist/src/commander.factory.d.mts +126 -122
  9. package/dist/src/commander.factory.d.mts.map +1 -1
  10. package/dist/src/commands/help.command.d.mts +15 -11
  11. package/dist/src/commands/help.command.d.mts.map +1 -1
  12. package/dist/src/commands/index.d.mts +2 -2
  13. package/dist/src/decorators/cli-module.decorator.d.mts +51 -40
  14. package/dist/src/decorators/cli-module.decorator.d.mts.map +1 -1
  15. package/dist/src/decorators/command.decorator.d.mts +49 -37
  16. package/dist/src/decorators/command.decorator.d.mts.map +1 -1
  17. package/dist/src/decorators/index.d.mts +3 -3
  18. package/dist/src/define-environment.d.mts +9 -8
  19. package/dist/src/define-environment.d.mts.map +1 -1
  20. package/dist/src/index.d.mts +10 -10
  21. package/dist/src/interfaces/abstract-cli-adapter.interface.d.mts +45 -45
  22. package/dist/src/interfaces/command-handler.interface.d.mts +14 -10
  23. package/dist/src/interfaces/command-handler.interface.d.mts.map +1 -1
  24. package/dist/src/interfaces/commander-execution-context.interface.d.mts +40 -30
  25. package/dist/src/interfaces/commander-execution-context.interface.d.mts.map +1 -1
  26. package/dist/src/interfaces/environment.interface.d.mts +7 -7
  27. package/dist/src/interfaces/index.d.mts +5 -5
  28. package/dist/src/legacy-compat/decorators/cli-module.decorator.d.mts +6 -5
  29. package/dist/src/legacy-compat/decorators/cli-module.decorator.d.mts.map +1 -1
  30. package/dist/src/legacy-compat/decorators/command.decorator.d.mts +7 -6
  31. package/dist/src/legacy-compat/decorators/command.decorator.d.mts.map +1 -1
  32. package/dist/src/legacy-compat/decorators/index.d.mts +3 -3
  33. package/dist/src/legacy-compat/index.d.mts +3 -3
  34. package/dist/src/metadata/command-entry.metadata.d.mts +5 -5
  35. package/dist/src/metadata/command-entry.metadata.d.mts.map +1 -1
  36. package/dist/src/metadata/command.metadata.d.mts +30 -24
  37. package/dist/src/metadata/command.metadata.d.mts.map +1 -1
  38. package/dist/src/metadata/index.d.mts +3 -3
  39. package/dist/src/overrides/help.command.d.mts +15 -11
  40. package/dist/src/overrides/help.command.d.mts.map +1 -1
  41. package/dist/src/services/cli-parser.service.d.mts +54 -54
  42. package/dist/src/services/cli-parser.service.d.mts.map +1 -1
  43. package/dist/src/services/command-registry.service.d.mts +75 -74
  44. package/dist/src/services/command-registry.service.d.mts.map +1 -1
  45. package/dist/src/services/commander-adapter.service.d.mts +53 -48
  46. package/dist/src/services/commander-adapter.service.d.mts.map +1 -1
  47. package/dist/src/services/index.d.mts +4 -4
  48. package/dist/src/tokens/execution-context.token.d.mts +9 -4
  49. package/dist/src/tokens/execution-context.token.d.mts.map +1 -1
  50. package/dist/src/tokens/help-command.token.d.mts +5 -4
  51. package/dist/src/tokens/index.d.mts +2 -2
  52. package/dist/src/utils/index.d.mts +2 -2
  53. package/dist/src/utils/runtime.d.mts +2 -2
  54. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  55. package/dist/tsconfig.tsbuildinfo +1 -1
  56. package/dist/tsdown.config.d.mts +3 -3
  57. package/dist/vitest.config.d.mts +3 -3
  58. package/lib/{cli-module.decorator-CRaNGvgl.d.cts → cli-module.decorator-BV3vVKlR.d.cts} +60 -55
  59. package/lib/cli-module.decorator-BV3vVKlR.d.cts.map +1 -0
  60. package/lib/{cli-module.decorator-CkP22084.cjs → cli-module.decorator-CXt38aqF.cjs} +2 -2
  61. package/lib/cli-module.decorator-CXt38aqF.cjs.map +1 -0
  62. package/lib/{cli-module.decorator-UGbtkRYc.mjs → cli-module.decorator-DAjf_r_W.mjs} +2 -2
  63. package/lib/cli-module.decorator-DAjf_r_W.mjs.map +1 -0
  64. package/lib/{cli-module.decorator-bsP5gEn7.d.mts → cli-module.decorator-DDlgpTgI.d.mts} +133 -118
  65. package/lib/cli-module.decorator-DDlgpTgI.d.mts.map +1 -0
  66. package/lib/{command.decorator-UrNJmQN0.cjs → command.decorator-HziankUv.cjs} +3 -3
  67. package/lib/command.decorator-HziankUv.cjs.map +1 -0
  68. package/lib/{command.decorator-DVLSAqYZ.mjs → command.decorator-QiRU7ny3.mjs} +3 -3
  69. package/lib/command.decorator-QiRU7ny3.mjs.map +1 -0
  70. package/lib/{help-command.token-CMWYI6em.cjs → help-command.token-DamE31Aw.cjs} +4 -4
  71. package/lib/{help-command.token-CMWYI6em.cjs.map → help-command.token-DamE31Aw.cjs.map} +1 -1
  72. package/lib/{help-command.token-C0Kgj60o.mjs → help-command.token-XHx3WkoD.mjs} +4 -4
  73. package/lib/{help-command.token-C0Kgj60o.mjs.map → help-command.token-XHx3WkoD.mjs.map} +1 -1
  74. package/lib/{help.command-dtZbhq0w.mjs → help.command-Bynoll_7.mjs} +5 -8
  75. package/lib/help.command-Bynoll_7.mjs.map +1 -0
  76. package/lib/{help.command-DQyv6ali.cjs → help.command-DvKmMpB7.cjs} +6 -9
  77. package/lib/help.command-DvKmMpB7.cjs.map +1 -0
  78. package/lib/index.cjs +118 -106
  79. package/lib/index.cjs.map +1 -1
  80. package/lib/index.d.cts +294 -284
  81. package/lib/index.d.cts.map +1 -1
  82. package/lib/index.d.mts +221 -221
  83. package/lib/index.d.mts.map +1 -1
  84. package/lib/index.mjs +117 -105
  85. package/lib/index.mjs.map +1 -1
  86. package/lib/legacy-compat/index.cjs +6 -28
  87. package/lib/legacy-compat/index.cjs.map +1 -1
  88. package/lib/legacy-compat/index.d.cts +3 -2
  89. package/lib/legacy-compat/index.d.cts.map +1 -1
  90. package/lib/legacy-compat/index.d.mts +3 -2
  91. package/lib/legacy-compat/index.d.mts.map +1 -1
  92. package/lib/legacy-compat/index.mjs +4 -25
  93. package/lib/legacy-compat/index.mjs.map +1 -1
  94. package/package.json +26 -16
  95. package/src/__tests__/commander.factory.e2e.spec.mts +127 -79
  96. package/src/commands/help.command.mts +1 -1
  97. package/src/decorators/cli-module.decorator.mts +4 -9
  98. package/src/decorators/command.decorator.mts +4 -4
  99. package/src/define-environment.mts +4 -4
  100. package/src/interfaces/command-handler.interface.mts +8 -4
  101. package/src/interfaces/commander-execution-context.interface.mts +14 -1
  102. package/src/legacy-compat/decorators/cli-module.decorator.mts +2 -1
  103. package/src/legacy-compat/decorators/command.decorator.mts +3 -2
  104. package/src/metadata/command-entry.metadata.mts +3 -6
  105. package/src/metadata/command.metadata.mts +6 -8
  106. package/src/overrides/help.command.mts +2 -2
  107. package/src/services/__tests__/cli-parser.service.spec.mts +23 -178
  108. package/src/services/cli-parser.service.mts +23 -27
  109. package/src/services/command-registry.service.mts +5 -5
  110. package/src/services/commander-adapter.service.mts +12 -20
  111. package/src/tokens/execution-context.token.mts +4 -6
  112. package/tsconfig.json +3 -0
  113. package/lib/cli-module.decorator-CRaNGvgl.d.cts.map +0 -1
  114. package/lib/cli-module.decorator-CkP22084.cjs.map +0 -1
  115. package/lib/cli-module.decorator-UGbtkRYc.mjs.map +0 -1
  116. package/lib/cli-module.decorator-bsP5gEn7.d.mts.map +0 -1
  117. package/lib/command.decorator-DVLSAqYZ.mjs.map +0 -1
  118. package/lib/command.decorator-UrNJmQN0.cjs.map +0 -1
  119. package/lib/help.command-DQyv6ali.cjs.map +0 -1
  120. package/lib/help.command-dtZbhq0w.mjs.map +0 -1
  121. package/project.json +0 -66
@@ -1,4 +1,4 @@
1
- import type { AbstractAdapterInterface } from '@navios/core';
1
+ import type { AbstractAdapterInterface } from '@navios/core'
2
2
  /**
3
3
  * Interface for CLI adapters.
4
4
  * Extends the base adapter interface with CLI-specific methods.
@@ -6,48 +6,48 @@ import type { AbstractAdapterInterface } from '@navios/core';
6
6
  * @public
7
7
  */
8
8
  export interface AbstractCliAdapterInterface extends AbstractAdapterInterface {
9
- /**
10
- * Run the CLI application with the given arguments.
11
- * Parses arguments and executes the matching command.
12
- *
13
- * @param argv - Command-line arguments array (defaults to `process.argv`)
14
- *
15
- * @example
16
- * ```typescript
17
- * const adapter = app.getAdapter() as AbstractCliAdapterInterface
18
- * await adapter.run(process.argv)
19
- * ```
20
- */
21
- run(argv?: string[]): Promise<void>;
22
- /**
23
- * Execute a command programmatically with the provided options.
24
- *
25
- * @param path - The command path (e.g., 'greet', 'user:create')
26
- * @param options - The command options object
27
- *
28
- * @example
29
- * ```typescript
30
- * await adapter.executeCommand('user:create', {
31
- * name: 'John',
32
- * email: 'john@example.com',
33
- * })
34
- * ```
35
- */
36
- executeCommand(path: string, options: Record<string, unknown>): Promise<void>;
37
- /**
38
- * Get all registered command paths and their class references.
39
- *
40
- * @returns Array of objects containing path and class
41
- *
42
- * @example
43
- * ```typescript
44
- * const commands = adapter.getAllCommands()
45
- * commands.forEach(({ path }) => console.log(path))
46
- * ```
47
- */
48
- getAllCommands(): Array<{
49
- path: string;
50
- class: unknown;
51
- }>;
9
+ /**
10
+ * Run the CLI application with the given arguments.
11
+ * Parses arguments and executes the matching command.
12
+ *
13
+ * @param argv - Command-line arguments array (defaults to `process.argv`)
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const adapter = app.getAdapter() as AbstractCliAdapterInterface
18
+ * await adapter.run(process.argv)
19
+ * ```
20
+ */
21
+ run(argv?: string[]): Promise<void>
22
+ /**
23
+ * Execute a command programmatically with the provided options.
24
+ *
25
+ * @param path - The command path (e.g., 'greet', 'user:create')
26
+ * @param options - The command options object
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * await adapter.executeCommand('user:create', {
31
+ * name: 'John',
32
+ * email: 'john@example.com',
33
+ * })
34
+ * ```
35
+ */
36
+ executeCommand(path: string, options: Record<string, unknown>): Promise<void>
37
+ /**
38
+ * Get all registered command paths and their class references.
39
+ *
40
+ * @returns Array of objects containing path and class
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * const commands = adapter.getAllCommands()
45
+ * commands.forEach(({ path }) => console.log(path))
46
+ * ```
47
+ */
48
+ getAllCommands(): Array<{
49
+ path: string
50
+ class: unknown
51
+ }>
52
52
  }
53
- //# sourceMappingURL=abstract-cli-adapter.interface.d.mts.map
53
+ //# sourceMappingURL=abstract-cli-adapter.interface.d.mts.map
@@ -9,7 +9,7 @@
9
9
  * @example
10
10
  * ```typescript
11
11
  * import { Command, CommandHandler } from '@navios/commander'
12
- * import { z } from 'zod'
12
+ * import { z } from 'zod/v4'
13
13
  *
14
14
  * const optionsSchema = z.object({
15
15
  * name: z.string()
@@ -19,19 +19,23 @@
19
19
  *
20
20
  * @Command({ path: 'greet', optionsSchema })
21
21
  * export class GreetCommand implements CommandHandler<Options> {
22
- * async execute(options: Options) {
22
+ * async execute(options: Options, positionals?: string[]) {
23
23
  * console.log(`Hello, ${options.name}!`)
24
+ * if (positionals?.length) {
25
+ * console.log(`Files: ${positionals.join(', ')}`)
26
+ * }
24
27
  * }
25
28
  * }
26
29
  * ```
27
30
  */
28
31
  export interface CommandHandler<TOptions = any> {
29
- /**
30
- * Executes the command with the provided options.
31
- *
32
- * @param options - The validated command options (validated against the command's schema if provided)
33
- * @returns A promise or void
34
- */
35
- execute(options: TOptions): void | Promise<void>;
32
+ /**
33
+ * Executes the command with the provided options and positional arguments.
34
+ *
35
+ * @param options - The validated command options (validated against the command's schema if provided)
36
+ * @param positionals - Positional arguments that don't match any option flags
37
+ * @returns A promise or void
38
+ */
39
+ execute(options: TOptions, positionals?: string[]): void | Promise<void>
36
40
  }
37
- //# sourceMappingURL=command-handler.interface.d.mts.map
41
+ //# sourceMappingURL=command-handler.interface.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-handler.interface.d.mts","sourceRoot":"","sources":["../../../src/interfaces/command-handler.interface.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,GAAG,GAAG;IAC5C;;;;;OAKG;IACH,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACjD"}
1
+ {"version":3,"file":"command-handler.interface.d.mts","sourceRoot":"","sources":["../../../src/interfaces/command-handler.interface.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,GAAG,GAAG;IAC5C;;;;;;OAMG;IACH,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE"}
@@ -1,4 +1,4 @@
1
- import type { CommandMetadata } from '../metadata/command.metadata.mjs';
1
+ import type { CommandMetadata } from '../metadata/command.metadata.mjs'
2
2
  /**
3
3
  * Execution context for a command execution.
4
4
  *
@@ -22,33 +22,43 @@ import type { CommandMetadata } from '../metadata/command.metadata.mjs';
22
22
  * ```
23
23
  */
24
24
  export declare class CommanderExecutionContext {
25
- private readonly command;
26
- private readonly commandPath;
27
- private readonly options;
28
- /**
29
- * @internal
30
- * Creates a new execution context.
31
- */
32
- constructor(command: CommandMetadata, commandPath: string, options: any);
33
- /**
34
- * Gets the command metadata.
35
- *
36
- * @returns The command metadata including path and options schema
37
- */
38
- getCommand(): CommandMetadata;
39
- /**
40
- * Gets the command path that was invoked.
41
- *
42
- * @returns The command path (e.g., 'greet', 'user:create')
43
- */
44
- getCommandPath(): string;
45
- /**
46
- * Gets the validated command options.
47
- *
48
- * Options are validated against the command's Zod schema if one was provided.
49
- *
50
- * @returns The validated options object
51
- */
52
- getOptions(): any;
25
+ private readonly command
26
+ private readonly commandPath
27
+ private readonly options
28
+ private readonly positionals
29
+ /**
30
+ * @internal
31
+ * Creates a new execution context.
32
+ */
33
+ constructor(command: CommandMetadata, commandPath: string, options: any, positionals?: string[])
34
+ /**
35
+ * Gets the command metadata.
36
+ *
37
+ * @returns The command metadata including path and options schema
38
+ */
39
+ getCommand(): CommandMetadata
40
+ /**
41
+ * Gets the command path that was invoked.
42
+ *
43
+ * @returns The command path (e.g., 'greet', 'user:create')
44
+ */
45
+ getCommandPath(): string
46
+ /**
47
+ * Gets the validated command options.
48
+ *
49
+ * Options are validated against the command's zod/v4 schema if one was provided.
50
+ *
51
+ * @returns The validated options object
52
+ */
53
+ getOptions(): any
54
+ /**
55
+ * Gets the positional arguments.
56
+ *
57
+ * Positional arguments are values that don't match any option flags.
58
+ * For example, in `copy --force source.txt dest.txt`, the positionals are `['source.txt', 'dest.txt']`.
59
+ *
60
+ * @returns The positional arguments array
61
+ */
62
+ getPositionals(): string[]
53
63
  }
54
- //# sourceMappingURL=commander-execution-context.interface.d.mts.map
64
+ //# sourceMappingURL=commander-execution-context.interface.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commander-execution-context.interface.d.mts","sourceRoot":"","sources":["../../../src/interfaces/commander-execution-context.interface.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,yBAAyB;IAMlC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAP1B;;;OAGG;gBAEgB,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,GAAG;IAG/B;;;;OAIG;IACH,UAAU,IAAI,eAAe;IAI7B;;;;OAIG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;;;OAMG;IACH,UAAU,IAAI,GAAG;CAGlB"}
1
+ {"version":3,"file":"commander-execution-context.interface.d.mts","sourceRoot":"","sources":["../../../src/interfaces/commander-execution-context.interface.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,yBAAyB;IAMlC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAR9B;;;OAGG;IACH,YACmB,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,GAAG,EACZ,WAAW,GAAE,MAAM,EAAO,EACzC;IAEJ;;;;OAIG;IACH,UAAU,IAAI,eAAe,CAE5B;IAED;;;;OAIG;IACH,cAAc,IAAI,MAAM,CAEvB;IAED;;;;;;OAMG;IACH,UAAU,IAAI,GAAG,CAEhB;IAED;;;;;;;OAOG;IACH,cAAc,IAAI,MAAM,EAAE,CAEzB;CACF"}
@@ -1,12 +1,12 @@
1
- import type { AdapterEnvironment } from '@navios/core';
2
- import type { AbstractCliAdapterInterface } from './abstract-cli-adapter.interface.mjs';
1
+ import type { AdapterEnvironment } from '@navios/core'
2
+
3
+ import type { AbstractCliAdapterInterface } from './abstract-cli-adapter.interface.mjs'
3
4
  /**
4
5
  * Options for configuring the CLI adapter.
5
6
  *
6
7
  * @public
7
8
  */
8
- export interface CliAdapterOptions {
9
- }
9
+ export interface CliAdapterOptions {}
10
10
  /**
11
11
  * Environment type definition for CLI adapters.
12
12
  * Used with NaviosFactory.create<CliEnvironment>() for type-safe CLI applications.
@@ -24,7 +24,7 @@ export interface CliAdapterOptions {
24
24
  * ```
25
25
  */
26
26
  export interface CliEnvironment extends AdapterEnvironment {
27
- options: CliAdapterOptions;
28
- adapter: AbstractCliAdapterInterface;
27
+ options: CliAdapterOptions
28
+ adapter: AbstractCliAdapterInterface
29
29
  }
30
- //# sourceMappingURL=environment.interface.d.mts.map
30
+ //# sourceMappingURL=environment.interface.d.mts.map
@@ -1,5 +1,5 @@
1
- export * from './command-handler.interface.mjs';
2
- export * from './commander-execution-context.interface.mjs';
3
- export * from './abstract-cli-adapter.interface.mjs';
4
- export * from './environment.interface.mjs';
5
- //# sourceMappingURL=index.d.mts.map
1
+ export * from './command-handler.interface.mjs'
2
+ export * from './commander-execution-context.interface.mjs'
3
+ export * from './abstract-cli-adapter.interface.mjs'
4
+ export * from './environment.interface.mjs'
5
+ //# sourceMappingURL=index.d.mts.map
@@ -1,6 +1,7 @@
1
- import type { ClassType } from '@navios/core';
2
- import { type CliModuleOptions } from '../../decorators/cli-module.decorator.mjs';
3
- export type { CliModuleOptions };
1
+ import type { ClassType } from '@navios/core'
2
+
3
+ import { type CliModuleOptions } from '../../decorators/cli-module.decorator.mjs'
4
+ export type { CliModuleOptions }
4
5
  /**
5
6
  * Legacy-compatible CliModule decorator.
6
7
  *
@@ -22,5 +23,5 @@ export type { CliModuleOptions };
22
23
  * export class AppModule {}
23
24
  * ```
24
25
  */
25
- export declare function CliModule(options?: CliModuleOptions): (target: ClassType) => ClassType;
26
- //# sourceMappingURL=cli-module.decorator.d.mts.map
26
+ export declare function CliModule(options?: CliModuleOptions): (target: ClassType) => ClassType
27
+ //# sourceMappingURL=cli-module.decorator.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-module.decorator.d.mts","sourceRoot":"","sources":["../../../../src/legacy-compat/decorators/cli-module.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAG7C,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,2CAA2C,CAAA;AAElD,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAEhC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CACvB,OAAO,GAAE,gBAMR,IAEgB,QAAQ,SAAS,eAKnC"}
1
+ {"version":3,"file":"cli-module.decorator.d.mts","sourceRoot":"","sources":["../../../../src/legacy-compat/decorators/cli-module.decorator.mts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,2CAA2C,CAAA;AAElD,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAEhC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CACvB,OAAO,GAAE,gBAMR,oCAOF"}
@@ -1,6 +1,7 @@
1
- import type { ClassType } from '@navios/core';
2
- import { type CommandOptions } from '../../decorators/command.decorator.mjs';
3
- export type { CommandOptions };
1
+ import type { ClassType } from '@navios/core'
2
+
3
+ import { type CommandOptions } from '../../decorators/command.decorator.mjs'
4
+ export type { CommandOptions }
4
5
  /**
5
6
  * Legacy-compatible Command decorator.
6
7
  *
@@ -12,7 +13,7 @@ export type { CommandOptions };
12
13
  * @example
13
14
  * ```typescript
14
15
  * import { Command, CommandHandler } from '@navios/commander/legacy-compat'
15
- * import { z } from 'zod'
16
+ * import { z } from 'zod/v4'
16
17
  *
17
18
  * const optionsSchema = z.object({
18
19
  * name: z.string(),
@@ -30,5 +31,5 @@ export type { CommandOptions };
30
31
  * }
31
32
  * ```
32
33
  */
33
- export declare function Command(options: CommandOptions): (target: ClassType) => any;
34
- //# sourceMappingURL=command.decorator.d.mts.map
34
+ export declare function Command(options: CommandOptions): (target: ClassType) => any
35
+ //# sourceMappingURL=command.decorator.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.decorator.d.mts","sourceRoot":"","sources":["../../../../src/legacy-compat/decorators/command.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAG7C,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,wCAAwC,CAAA;AAE/C,YAAY,EAAE,cAAc,EAAE,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,IAC5B,QAAQ,SAAS,SAKnC"}
1
+ {"version":3,"file":"command.decorator.d.mts","sourceRoot":"","sources":["../../../../src/legacy-compat/decorators/command.decorator.mts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,wCAAwC,CAAA;AAE/C,YAAY,EAAE,cAAc,EAAE,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,8BAM9C"}
@@ -1,3 +1,3 @@
1
- export * from './command.decorator.mjs';
2
- export * from './cli-module.decorator.mjs';
3
- //# sourceMappingURL=index.d.mts.map
1
+ export * from './command.decorator.mjs'
2
+ export * from './cli-module.decorator.mjs'
3
+ //# sourceMappingURL=index.d.mts.map
@@ -23,6 +23,6 @@
23
23
  *
24
24
  * @packageDocumentation
25
25
  */
26
- export * from './decorators/index.mjs';
27
- export * from '@navios/core/legacy-compat';
28
- //# sourceMappingURL=index.d.mts.map
26
+ export * from './decorators/index.mjs'
27
+ export * from '@navios/core/legacy-compat'
28
+ //# sourceMappingURL=index.d.mts.map
@@ -1,17 +1,17 @@
1
- import type { ClassType } from '@navios/core';
1
+ import type { ClassType } from '@navios/core'
2
2
  /**
3
3
  * Symbol key for storing commands in ModuleMetadata.customEntries.
4
4
  * Used by @CliModule to store command classes.
5
5
  *
6
6
  * @public
7
7
  */
8
- export declare const CommandEntryKey: unique symbol;
8
+ export declare const CommandEntryKey: unique symbol
9
9
  /**
10
10
  * Type for the command entry value stored in customEntries.
11
11
  *
12
12
  * @public
13
13
  */
14
- export type CommandEntryValue = Set<ClassType>;
14
+ export type CommandEntryValue = Set<ClassType>
15
15
  /**
16
16
  * Extracts commands from a module's metadata.
17
17
  * Returns empty set if no commands are defined.
@@ -27,5 +27,5 @@ export type CommandEntryValue = Set<ClassType>;
27
27
  * }
28
28
  * ```
29
29
  */
30
- export declare function extractModuleCommands(moduleClass: ClassType): Set<ClassType>;
31
- //# sourceMappingURL=command-entry.metadata.d.mts.map
30
+ export declare function extractModuleCommands(moduleClass: ClassType): Set<ClassType>
31
+ //# sourceMappingURL=command-entry.metadata.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-entry.metadata.d.mts","sourceRoot":"","sources":["../../../src/metadata/command-entry.metadata.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAI7C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,eAA4B,CAAA;AAExD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;AAE9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,CAM5E"}
1
+ {"version":3,"file":"command-entry.metadata.d.mts","sourceRoot":"","sources":["../../../src/metadata/command-entry.metadata.mts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,eAA4B,CAAA;AAExD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;AAE9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,CAG5E"}
@@ -1,32 +1,32 @@
1
- import type { ClassType } from '@navios/core';
2
- import type { ZodObject } from 'zod';
1
+ import type { ClassType } from '@navios/core'
2
+ import type { z } from 'zod/v4'
3
3
  /**
4
4
  * @internal
5
5
  * Symbol key used to store command metadata on classes.
6
6
  */
7
- export declare const CommandMetadataKey: unique symbol;
7
+ export declare const CommandMetadataKey: unique symbol
8
8
  /**
9
9
  * Metadata associated with a command.
10
10
  *
11
11
  * @public
12
12
  */
13
13
  export interface CommandMetadata {
14
- /**
15
- * The command path (e.g., 'greet', 'user:create').
16
- */
17
- path: string;
18
- /**
19
- * Optional description of the command for help text.
20
- */
21
- description?: string;
22
- /**
23
- * Optional Zod schema for validating command options.
24
- */
25
- optionsSchema?: ZodObject;
26
- /**
27
- * Map of custom attributes that can be attached to the command.
28
- */
29
- customAttributes: Map<string | symbol, any>;
14
+ /**
15
+ * The command path (e.g., 'greet', 'user:create').
16
+ */
17
+ path: string
18
+ /**
19
+ * Optional description of the command for help text.
20
+ */
21
+ description?: string
22
+ /**
23
+ * Optional zod/v4 schema for validating command options.
24
+ */
25
+ optionsSchema?: z.ZodObject
26
+ /**
27
+ * Map of custom attributes that can be attached to the command.
28
+ */
29
+ customAttributes: Map<string | symbol, any>
30
30
  }
31
31
  /**
32
32
  * Gets or creates command metadata for a class.
@@ -36,10 +36,16 @@ export interface CommandMetadata {
36
36
  * @param context - The decorator context
37
37
  * @param path - The command path
38
38
  * @param description - Optional description for help text
39
- * @param optionsSchema - Optional Zod schema
39
+ * @param optionsSchema - Optional zod/v4 schema
40
40
  * @returns The command metadata
41
41
  */
42
- export declare function getCommandMetadata(target: ClassType, context: ClassDecoratorContext, path: string, description?: string, optionsSchema?: ZodObject): CommandMetadata;
42
+ export declare function getCommandMetadata(
43
+ target: ClassType,
44
+ context: ClassDecoratorContext,
45
+ path: string,
46
+ description?: string,
47
+ optionsSchema?: z.ZodObject,
48
+ ): CommandMetadata
43
49
  /**
44
50
  * Extracts command metadata from a class.
45
51
  *
@@ -53,12 +59,12 @@ export declare function getCommandMetadata(target: ClassType, context: ClassDeco
53
59
  * console.log(metadata.path) // 'greet'
54
60
  * ```
55
61
  */
56
- export declare function extractCommandMetadata(target: ClassType): CommandMetadata;
62
+ export declare function extractCommandMetadata(target: ClassType): CommandMetadata
57
63
  /**
58
64
  * Checks if a class has command metadata.
59
65
  *
60
66
  * @param target - The class to check
61
67
  * @returns `true` if the class is decorated with @Command, `false` otherwise
62
68
  */
63
- export declare function hasCommandMetadata(target: ClassType): boolean;
64
- //# sourceMappingURL=command.metadata.d.mts.map
69
+ export declare function hasCommandMetadata(target: ClassType): boolean
70
+ //# sourceMappingURL=command.metadata.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.metadata.d.mts","sourceRoot":"","sources":["../../../src/metadata/command.metadata.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eAA+B,CAAA;AAE9D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB;;OAEG;IACH,gBAAgB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,qBAAqB,EAC9B,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,SAAS,GACxB,eAAe,CAqBjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CASzE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAI7D"}
1
+ {"version":3,"file":"command.metadata.d.mts","sourceRoot":"","sources":["../../../src/metadata/command.metadata.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE/B;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eAA+B,CAAA;AAE9D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,CAAC,SAAS,CAAA;IAC3B;;OAEG;IACH,gBAAgB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,qBAAqB,EAC9B,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,CAAC,CAAC,SAAS,GAC1B,eAAe,CAmBjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CASzE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAI7D"}
@@ -1,3 +1,3 @@
1
- export * from './command.metadata.mjs';
2
- export * from './command-entry.metadata.mjs';
3
- //# sourceMappingURL=index.d.mts.map
1
+ export * from './command.metadata.mjs'
2
+ export * from './command-entry.metadata.mjs'
3
+ //# sourceMappingURL=index.d.mts.map
@@ -1,18 +1,22 @@
1
- import { z } from 'zod';
2
- import type { CommandHandler } from '../interfaces/command-handler.interface.mjs';
3
- declare const helpOptionsSchema: z.ZodObject<{
4
- command: z.ZodOptional<z.ZodString>;
5
- }, z.core.$strip>;
6
- type HelpOptions = z.infer<typeof helpOptionsSchema>;
1
+ import { z } from 'zod/v4'
2
+
3
+ import type { CommandHandler } from '../interfaces/command-handler.interface.mjs'
4
+ declare const helpOptionsSchema: z.ZodObject<
5
+ {
6
+ command: z.ZodOptional<z.ZodString>
7
+ },
8
+ z.core.$strip
9
+ >
10
+ type HelpOptions = z.infer<typeof helpOptionsSchema>
7
11
  /**
8
12
  * Built-in help command that lists all available commands or shows help for a specific command.
9
13
  *
10
14
  * @public
11
15
  */
12
16
  export declare class HelpCommand implements CommandHandler<HelpOptions> {
13
- private logger;
14
- private commandRegistry;
15
- execute(options: HelpOptions): Promise<void>;
17
+ private logger
18
+ private commandRegistry
19
+ execute(options: HelpOptions): Promise<void>
16
20
  }
17
- export {};
18
- //# sourceMappingURL=help.command.d.mts.map
21
+ export {}
22
+ //# sourceMappingURL=help.command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help.command.d.mts","sourceRoot":"","sources":["../../../src/overrides/help.command.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAA;AAEjF,QAAA,MAAM,iBAAiB;;iBAErB,CAAA;AAEF,KAAK,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEpD;;;;GAIG;AACH,qBAOa,WAAY,YAAW,cAAc,CAAC,WAAW,CAAC;IAC7D,OAAO,CAAC,MAAM,CAAoF;IAClG,OAAO,CAAC,eAAe,CAAiC;IAElD,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAOnD"}
1
+ {"version":3,"file":"help.command.d.mts","sourceRoot":"","sources":["../../../src/overrides/help.command.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAM1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAA;AAEjF,QAAA,MAAM,iBAAiB;;iBAErB,CAAA;AAEF,KAAK,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEpD;;;;GAIG;AACH,qBAOa,WAAY,YAAW,cAAc,CAAC,WAAW,CAAC;IAC7D,OAAO,CAAC,MAAM,CAA4D;IAC1E,OAAO,CAAC,eAAe,CAAiC;IAElD,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAMjD;CACF"}