@navios/commander 1.5.0 → 1.5.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.
Files changed (119) hide show
  1. package/.turbo/turbo-build.log +49 -0
  2. package/.turbo/turbo-check.log +2 -0
  3. package/.turbo/turbo-lint.log +3 -0
  4. package/.turbo/turbo-test$colon$ci.log +117 -0
  5. package/CHANGELOG.md +3 -3
  6. package/README.md +8 -16
  7. package/dist/src/commander.factory.d.mts +126 -122
  8. package/dist/src/commander.factory.d.mts.map +1 -1
  9. package/dist/src/commands/help.command.d.mts +15 -11
  10. package/dist/src/commands/help.command.d.mts.map +1 -1
  11. package/dist/src/commands/index.d.mts +2 -2
  12. package/dist/src/decorators/cli-module.decorator.d.mts +51 -40
  13. package/dist/src/decorators/cli-module.decorator.d.mts.map +1 -1
  14. package/dist/src/decorators/command.decorator.d.mts +49 -37
  15. package/dist/src/decorators/command.decorator.d.mts.map +1 -1
  16. package/dist/src/decorators/index.d.mts +3 -3
  17. package/dist/src/define-environment.d.mts +9 -8
  18. package/dist/src/define-environment.d.mts.map +1 -1
  19. package/dist/src/index.d.mts +10 -10
  20. package/dist/src/interfaces/abstract-cli-adapter.interface.d.mts +45 -45
  21. package/dist/src/interfaces/command-handler.interface.d.mts +9 -9
  22. package/dist/src/interfaces/commander-execution-context.interface.d.mts +30 -30
  23. package/dist/src/interfaces/commander-execution-context.interface.d.mts.map +1 -1
  24. package/dist/src/interfaces/environment.interface.d.mts +7 -7
  25. package/dist/src/interfaces/index.d.mts +5 -5
  26. package/dist/src/legacy-compat/decorators/cli-module.decorator.d.mts +6 -5
  27. package/dist/src/legacy-compat/decorators/cli-module.decorator.d.mts.map +1 -1
  28. package/dist/src/legacy-compat/decorators/command.decorator.d.mts +7 -6
  29. package/dist/src/legacy-compat/decorators/command.decorator.d.mts.map +1 -1
  30. package/dist/src/legacy-compat/decorators/index.d.mts +3 -3
  31. package/dist/src/legacy-compat/index.d.mts +3 -3
  32. package/dist/src/metadata/command-entry.metadata.d.mts +5 -5
  33. package/dist/src/metadata/command-entry.metadata.d.mts.map +1 -1
  34. package/dist/src/metadata/command.metadata.d.mts +30 -24
  35. package/dist/src/metadata/command.metadata.d.mts.map +1 -1
  36. package/dist/src/metadata/index.d.mts +3 -3
  37. package/dist/src/overrides/help.command.d.mts +15 -11
  38. package/dist/src/overrides/help.command.d.mts.map +1 -1
  39. package/dist/src/services/cli-parser.service.d.mts +54 -54
  40. package/dist/src/services/cli-parser.service.d.mts.map +1 -1
  41. package/dist/src/services/command-registry.service.d.mts +75 -74
  42. package/dist/src/services/command-registry.service.d.mts.map +1 -1
  43. package/dist/src/services/commander-adapter.service.d.mts +49 -48
  44. package/dist/src/services/commander-adapter.service.d.mts.map +1 -1
  45. package/dist/src/services/index.d.mts +4 -4
  46. package/dist/src/tokens/execution-context.token.d.mts +9 -4
  47. package/dist/src/tokens/execution-context.token.d.mts.map +1 -1
  48. package/dist/src/tokens/help-command.token.d.mts +5 -4
  49. package/dist/src/tokens/index.d.mts +2 -2
  50. package/dist/src/utils/index.d.mts +2 -2
  51. package/dist/src/utils/runtime.d.mts +2 -2
  52. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/tsdown.config.d.mts +3 -3
  55. package/dist/vitest.config.d.mts +3 -3
  56. package/lib/{cli-module.decorator-CRaNGvgl.d.cts → cli-module.decorator-BzsOEMPH.d.cts} +54 -53
  57. package/lib/cli-module.decorator-BzsOEMPH.d.cts.map +1 -0
  58. package/lib/{cli-module.decorator-bsP5gEn7.d.mts → cli-module.decorator-CCV_elPP.d.mts} +116 -115
  59. package/lib/cli-module.decorator-CCV_elPP.d.mts.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/{command.decorator-UrNJmQN0.cjs → command.decorator-HziankUv.cjs} +3 -3
  65. package/lib/command.decorator-HziankUv.cjs.map +1 -0
  66. package/lib/{command.decorator-DVLSAqYZ.mjs → command.decorator-QiRU7ny3.mjs} +3 -3
  67. package/lib/command.decorator-QiRU7ny3.mjs.map +1 -0
  68. package/lib/{help-command.token-CMWYI6em.cjs → help-command.token-DamE31Aw.cjs} +4 -4
  69. package/lib/{help-command.token-CMWYI6em.cjs.map → help-command.token-DamE31Aw.cjs.map} +1 -1
  70. package/lib/{help-command.token-C0Kgj60o.mjs → help-command.token-XHx3WkoD.mjs} +4 -4
  71. package/lib/{help-command.token-C0Kgj60o.mjs.map → help-command.token-XHx3WkoD.mjs.map} +1 -1
  72. package/lib/{help.command-dtZbhq0w.mjs → help.command-Bynoll_7.mjs} +5 -8
  73. package/lib/help.command-Bynoll_7.mjs.map +1 -0
  74. package/lib/{help.command-DQyv6ali.cjs → help.command-DvKmMpB7.cjs} +6 -9
  75. package/lib/help.command-DvKmMpB7.cjs.map +1 -0
  76. package/lib/index.cjs +102 -102
  77. package/lib/index.cjs.map +1 -1
  78. package/lib/index.d.cts +283 -283
  79. package/lib/index.d.cts.map +1 -1
  80. package/lib/index.d.mts +221 -221
  81. package/lib/index.d.mts.map +1 -1
  82. package/lib/index.mjs +101 -101
  83. package/lib/index.mjs.map +1 -1
  84. package/lib/legacy-compat/index.cjs +6 -28
  85. package/lib/legacy-compat/index.cjs.map +1 -1
  86. package/lib/legacy-compat/index.d.cts +3 -2
  87. package/lib/legacy-compat/index.d.cts.map +1 -1
  88. package/lib/legacy-compat/index.d.mts +3 -2
  89. package/lib/legacy-compat/index.d.mts.map +1 -1
  90. package/lib/legacy-compat/index.mjs +4 -25
  91. package/lib/legacy-compat/index.mjs.map +1 -1
  92. package/package.json +26 -16
  93. package/src/__tests__/commander.factory.e2e.spec.mts +22 -66
  94. package/src/commands/help.command.mts +1 -1
  95. package/src/decorators/cli-module.decorator.mts +4 -9
  96. package/src/decorators/command.decorator.mts +4 -4
  97. package/src/define-environment.mts +4 -4
  98. package/src/interfaces/command-handler.interface.mts +1 -1
  99. package/src/interfaces/commander-execution-context.interface.mts +1 -1
  100. package/src/legacy-compat/decorators/cli-module.decorator.mts +2 -1
  101. package/src/legacy-compat/decorators/command.decorator.mts +3 -2
  102. package/src/metadata/command-entry.metadata.mts +3 -6
  103. package/src/metadata/command.metadata.mts +6 -8
  104. package/src/overrides/help.command.mts +2 -2
  105. package/src/services/__tests__/cli-parser.service.spec.mts +23 -178
  106. package/src/services/cli-parser.service.mts +23 -27
  107. package/src/services/command-registry.service.mts +5 -5
  108. package/src/services/commander-adapter.service.mts +10 -27
  109. package/src/tokens/execution-context.token.mts +4 -6
  110. package/tsconfig.json +3 -0
  111. package/lib/cli-module.decorator-CRaNGvgl.d.cts.map +0 -1
  112. package/lib/cli-module.decorator-CkP22084.cjs.map +0 -1
  113. package/lib/cli-module.decorator-UGbtkRYc.mjs.map +0 -1
  114. package/lib/cli-module.decorator-bsP5gEn7.d.mts.map +0 -1
  115. package/lib/command.decorator-DVLSAqYZ.mjs.map +0 -1
  116. package/lib/command.decorator-UrNJmQN0.cjs.map +0 -1
  117. package/lib/help.command-DQyv6ali.cjs.map +0 -1
  118. package/lib/help.command-dtZbhq0w.mjs.map +0 -1
  119. package/project.json +0 -66
@@ -1,47 +1,47 @@
1
- import type { ClassType, Registry } from '@navios/core';
1
+ import type { ClassType, Registry } from '@navios/core'
2
2
  /**
3
3
  * Options for the `@CliModule` decorator.
4
4
  *
5
5
  * @public
6
6
  */
7
7
  export interface CliModuleOptions {
8
- /**
9
- * Array or Set of command classes to register in this module.
10
- * Commands must be decorated with `@Command`.
11
- */
12
- commands?: ClassType[] | Set<ClassType>;
13
- /**
14
- * Array or Set of controller classes for HTTP endpoints.
15
- * Allows mixing HTTP and CLI functionality in the same module.
16
- */
17
- controllers?: ClassType[] | Set<ClassType>;
18
- /**
19
- * Array or Set of other modules to import.
20
- * Imported modules' commands and controllers will be available.
21
- */
22
- imports?: ClassType[] | Set<ClassType>;
23
- /**
24
- * Guards to apply to all controllers in this module.
25
- * Guards are executed in reverse order (last guard first).
26
- */
27
- guards?: ClassType[] | Set<ClassType>;
28
- /**
29
- * Service override classes to import for side effects.
30
- * These classes are imported to ensure their @Injectable decorators execute,
31
- * allowing them to register with the DI system. Overrides should use the same
32
- * InjectionToken as the original service with a higher priority.
33
- */
34
- overrides?: ClassType[] | Set<ClassType>;
35
- /**
36
- * Priority level for the module.
37
- * Higher priority modules will be loaded first.
38
- */
39
- priority?: number;
40
- /**
41
- * Registry to use for the module.
42
- * Registry is used to store the module and its commands.
43
- */
44
- registry?: Registry;
8
+ /**
9
+ * Array or Set of command classes to register in this module.
10
+ * Commands must be decorated with `@Command`.
11
+ */
12
+ commands?: ClassType[] | Set<ClassType>
13
+ /**
14
+ * Array or Set of controller classes for HTTP endpoints.
15
+ * Allows mixing HTTP and CLI functionality in the same module.
16
+ */
17
+ controllers?: ClassType[] | Set<ClassType>
18
+ /**
19
+ * Array or Set of other modules to import.
20
+ * Imported modules' commands and controllers will be available.
21
+ */
22
+ imports?: ClassType[] | Set<ClassType>
23
+ /**
24
+ * Guards to apply to all controllers in this module.
25
+ * Guards are executed in reverse order (last guard first).
26
+ */
27
+ guards?: ClassType[] | Set<ClassType>
28
+ /**
29
+ * Service override classes to import for side effects.
30
+ * These classes are imported to ensure their @Injectable decorators execute,
31
+ * allowing them to register with the DI system. Overrides should use the same
32
+ * InjectionToken as the original service with a higher priority.
33
+ */
34
+ overrides?: ClassType[] | Set<ClassType>
35
+ /**
36
+ * Priority level for the module.
37
+ * Higher priority modules will be loaded first.
38
+ */
39
+ priority?: number
40
+ /**
41
+ * Registry to use for the module.
42
+ * Registry is used to store the module and its commands.
43
+ */
44
+ registry?: Registry
45
45
  }
46
46
  /**
47
47
  * Decorator that marks a class as a CLI module.
@@ -80,5 +80,16 @@ export interface CliModuleOptions {
80
80
  * export class AppModule {}
81
81
  * ```
82
82
  */
83
- export declare function CliModule({ commands, controllers, imports, guards, overrides, priority, registry, }?: CliModuleOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;
84
- //# sourceMappingURL=cli-module.decorator.d.mts.map
83
+ export declare function CliModule({
84
+ commands,
85
+ controllers,
86
+ imports,
87
+ guards,
88
+ overrides,
89
+ priority,
90
+ registry,
91
+ }?: CliModuleOptions): (
92
+ target: ClassType,
93
+ context: ClassDecoratorContext<abstract new (...args: any) => any>,
94
+ ) => ClassType
95
+ //# sourceMappingURL=cli-module.decorator.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-module.decorator.d.mts","sourceRoot":"","sources":["../../../src/decorators/cli-module.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AASvD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACrC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,SAAS,CACvB,EACE,QAAa,EACb,WAAgB,EAChB,OAAY,EACZ,MAAW,EACX,SAAc,EACd,QAAQ,EACR,QAAQ,GACT,GAAE,gBAMF,IAEO,QAAQ,SAAS,EAAE,SAAS,qBAAqB,eAgC1D"}
1
+ {"version":3,"file":"cli-module.decorator.d.mts","sourceRoot":"","sources":["../../../src/decorators/cli-module.decorator.mts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAIvD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACrC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,SAAS,CACvB,EACE,QAAa,EACb,WAAgB,EAChB,OAAY,EACZ,MAAW,EACX,SAAc,EACd,QAAQ,EACR,QAAQ,EACT,GAAE,gBAMF,wGAgCF"}
@@ -1,43 +1,45 @@
1
- import { InjectionToken } from '@navios/core';
2
- import type { ClassType, ClassTypeWithInstance, Registry } from '@navios/core';
3
- import type { ZodObject } from 'zod';
4
- import type { CommandHandler } from '../interfaces/index.mjs';
1
+ import { InjectionToken } from '@navios/core'
2
+
3
+ import type { ClassType, ClassTypeWithInstance, Registry } from '@navios/core'
4
+ import type { z } from 'zod/v4'
5
+
6
+ import type { CommandHandler } from '../interfaces/index.mjs'
5
7
  /**
6
8
  * Options for the `@Command` decorator.
7
9
  *
8
10
  * @public
9
11
  */
10
12
  export interface CommandOptions {
11
- /**
12
- * The token to use for the command.
13
- * If provided, the command will be registered with this token.
14
- */
15
- token?: InjectionToken<ClassTypeWithInstance<CommandHandler<any>>>;
16
- /**
17
- * The command path that users will invoke from the CLI.
18
- * Can be a single word (e.g., 'greet') or multi-word with colons (e.g., 'user:create', 'db:migrate').
19
- */
20
- path: string;
21
- /**
22
- * Optional description of the command for help text.
23
- * Displayed when users run `help` or `--help`.
24
- */
25
- description?: string;
26
- /**
27
- * Optional Zod schema for validating command options.
28
- * If provided, options will be validated and parsed according to this schema.
29
- */
30
- optionsSchema?: ZodObject;
31
- /**
32
- * Priority level for the command.
33
- * Higher priority commands will be loaded first.
34
- */
35
- priority?: number;
36
- /**
37
- * Registry to use for the command.
38
- * Registry is used to store the command and its options schema.
39
- */
40
- registry?: Registry;
13
+ /**
14
+ * The token to use for the command.
15
+ * If provided, the command will be registered with this token.
16
+ */
17
+ token?: InjectionToken<ClassTypeWithInstance<CommandHandler<any>>>
18
+ /**
19
+ * The command path that users will invoke from the CLI.
20
+ * Can be a single word (e.g., 'greet') or multi-word with colons (e.g., 'user:create', 'db:migrate').
21
+ */
22
+ path: string
23
+ /**
24
+ * Optional description of the command for help text.
25
+ * Displayed when users run `help` or `--help`.
26
+ */
27
+ description?: string
28
+ /**
29
+ * Optional zod/v4 schema for validating command options.
30
+ * If provided, options will be validated and parsed according to this schema.
31
+ */
32
+ optionsSchema?: z.ZodObject
33
+ /**
34
+ * Priority level for the command.
35
+ * Higher priority commands will be loaded first.
36
+ */
37
+ priority?: number
38
+ /**
39
+ * Registry to use for the command.
40
+ * Registry is used to store the command and its options schema.
41
+ */
42
+ registry?: Registry
41
43
  }
42
44
  /**
43
45
  * Decorator that marks a class as a CLI command.
@@ -51,7 +53,7 @@ export interface CommandOptions {
51
53
  * @example
52
54
  * ```typescript
53
55
  * import { Command, CommandHandler } from '@navios/commander'
54
- * import { z } from 'zod'
56
+ * import { z } from 'zod/v4'
55
57
  *
56
58
  * const optionsSchema = z.object({
57
59
  * name: z.string(),
@@ -69,5 +71,15 @@ export interface CommandOptions {
69
71
  * }
70
72
  * ```
71
73
  */
72
- export declare function Command({ path, description, token, optionsSchema, priority, registry, }: CommandOptions): (target: ClassType, context: ClassDecoratorContext) => any;
73
- //# sourceMappingURL=command.decorator.d.mts.map
74
+ export declare function Command({
75
+ path,
76
+ description,
77
+ token,
78
+ optionsSchema,
79
+ priority,
80
+ registry,
81
+ }: CommandOptions): (
82
+ target: ClassType,
83
+ context: ClassDecoratorContext<abstract new (...args: any) => any>,
84
+ ) => any
85
+ //# sourceMappingURL=command.decorator.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.decorator.d.mts","sourceRoot":"","sources":["../../../src/decorators/command.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,cAAc,EAAE,MAAM,cAAc,CAAA;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAIpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAClE;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,WAAW,EACX,KAAK,EACL,aAAa,EACb,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,IACE,QAAQ,SAAS,EAAE,SAAS,qBAAqB,SAkBnE"}
1
+ {"version":3,"file":"command.decorator.d.mts","sourceRoot":"","sources":["../../../src/decorators/command.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,cAAc,EAAE,MAAM,cAAc,CAAA;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAClE;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,CAAC,SAAS,CAAA;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,WAAW,EACX,KAAK,EACL,aAAa,EACb,QAAQ,EACR,QAAQ,EACT,EAAE,cAAc,kGAmBhB"}
@@ -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
@@ -1,7 +1,8 @@
1
- import type { AnyInjectableType, InjectionToken } from '@navios/core';
2
- import { CommanderAdapterService } from './services/commander-adapter.service.mjs';
3
- import { CommandRegistryService } from './services/command-registry.service.mjs';
4
- import { CliParserService } from './services/cli-parser.service.mjs';
1
+ import type { AnyInjectableType, InjectionToken } from '@navios/core'
2
+
3
+ import { CliParserService } from './services/cli-parser.service.mjs'
4
+ import { CommandRegistryService } from './services/command-registry.service.mjs'
5
+ import { CommanderAdapterService } from './services/commander-adapter.service.mjs'
5
6
  /**
6
7
  * Defines the CLI environment configuration for use with NaviosFactory.
7
8
  *
@@ -25,7 +26,7 @@ import { CliParserService } from './services/cli-parser.service.mjs';
25
26
  * ```
26
27
  */
27
28
  export declare function defineCliEnvironment(): {
28
- tokens: Map<InjectionToken<any, undefined, false>, AnyInjectableType>;
29
- };
30
- export { CommanderAdapterService, CommandRegistryService, CliParserService };
31
- //# sourceMappingURL=define-environment.d.mts.map
29
+ tokens: Map<InjectionToken<any, undefined, false>, AnyInjectableType>
30
+ }
31
+ export { CommanderAdapterService, CommandRegistryService, CliParserService }
32
+ //# sourceMappingURL=define-environment.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-environment.d.mts","sourceRoot":"","sources":["../../src/define-environment.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAIrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB;;EAKnC;AAGD,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"define-environment.d.mts","sourceRoot":"","sources":["../../src/define-environment.mts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAElF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB;;EAKnC;AAGD,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1,10 +1,10 @@
1
- export * from '@navios/core';
2
- export * from './commands/index.mjs';
3
- export * from './commander.factory.mjs';
4
- export * from './decorators/index.mjs';
5
- export * from './define-environment.mjs';
6
- export * from './interfaces/index.mjs';
7
- export * from './metadata/index.mjs';
8
- export * from './services/index.mjs';
9
- export * from './tokens/index.mjs';
10
- //# sourceMappingURL=index.d.mts.map
1
+ export * from '@navios/core'
2
+ export * from './commands/index.mjs'
3
+ export * from './commander.factory.mjs'
4
+ export * from './decorators/index.mjs'
5
+ export * from './define-environment.mjs'
6
+ export * from './interfaces/index.mjs'
7
+ export * from './metadata/index.mjs'
8
+ export * from './services/index.mjs'
9
+ export * from './tokens/index.mjs'
10
+ //# sourceMappingURL=index.d.mts.map
@@ -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()
@@ -26,12 +26,12 @@
26
26
  * ```
27
27
  */
28
28
  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>;
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>
36
36
  }
37
- //# sourceMappingURL=command-handler.interface.d.mts.map
37
+ //# sourceMappingURL=command-handler.interface.d.mts.map
@@ -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,33 @@ 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
+ /**
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/v4 schema if one was provided.
49
+ *
50
+ * @returns The validated options object
51
+ */
52
+ getOptions(): any
53
53
  }
54
- //# sourceMappingURL=commander-execution-context.interface.d.mts.map
54
+ //# 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;IAP1B;;;OAGG;IACH,YACmB,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,GAAG,EAC3B;IAEJ;;;;OAIG;IACH,UAAU,IAAI,eAAe,CAE5B;IAED;;;;OAIG;IACH,cAAc,IAAI,MAAM,CAEvB;IAED;;;;;;OAMG;IACH,UAAU,IAAI,GAAG,CAEhB;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