@navios/core 1.0.0-alpha.3 → 1.0.0-alpha.4

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 (70) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/lib/{index-BISYCYEG.d.mts → index-6S7veHKD.d.mts} +400 -104
  3. package/lib/index-6S7veHKD.d.mts.map +1 -0
  4. package/lib/{index-CP80H6Dh.d.cts → index-r0i2txmg.d.cts} +400 -104
  5. package/lib/index-r0i2txmg.d.cts.map +1 -0
  6. package/lib/index.cjs +4420 -85
  7. package/lib/index.cjs.map +1 -0
  8. package/lib/index.d.cts +2 -2
  9. package/lib/index.d.mts +2 -2
  10. package/lib/index.mjs +4328 -3
  11. package/lib/index.mjs.map +1 -0
  12. package/lib/legacy-compat/index.cjs +5 -4
  13. package/lib/legacy-compat/index.cjs.map +1 -1
  14. package/lib/legacy-compat/index.d.cts +1 -1
  15. package/lib/legacy-compat/index.d.mts +1 -1
  16. package/lib/legacy-compat/index.mjs +2 -1
  17. package/lib/legacy-compat/index.mjs.map +1 -1
  18. package/lib/navios.factory-BanZIvtR.cjs +4134 -0
  19. package/lib/navios.factory-BanZIvtR.cjs.map +1 -0
  20. package/lib/navios.factory-C75yZCoD.mjs +3831 -0
  21. package/lib/navios.factory-C75yZCoD.mjs.map +1 -0
  22. package/lib/testing/index.cjs +3 -3
  23. package/lib/testing/index.cjs.map +1 -1
  24. package/lib/testing/index.d.cts +1 -1
  25. package/lib/testing/index.d.mts +1 -1
  26. package/lib/testing/index.mjs +2 -2
  27. package/lib/tokens-4J9sredA.mjs +100 -0
  28. package/lib/tokens-4J9sredA.mjs.map +1 -0
  29. package/lib/tokens-BuXXB01L.cjs +196 -0
  30. package/lib/tokens-BuXXB01L.cjs.map +1 -0
  31. package/lib/{use-guards.decorator-Be_QUx6b.mjs → use-guards.decorator-BecoQSmE.mjs} +3 -70
  32. package/lib/use-guards.decorator-BecoQSmE.mjs.map +1 -0
  33. package/lib/{use-guards.decorator-DtCGXcWZ.cjs → use-guards.decorator-DgD-kxF5.cjs} +7 -158
  34. package/lib/use-guards.decorator-DgD-kxF5.cjs.map +1 -0
  35. package/package.json +3 -3
  36. package/src/__tests__/console-logger.service.spec.mts +312 -0
  37. package/src/factories/adapter.factory.mts +20 -0
  38. package/src/factories/endpoint-adapter.factory.mts +1 -1
  39. package/src/factories/http-adapter.factory.mts +1 -1
  40. package/src/factories/index.mts +1 -0
  41. package/src/factories/multipart-adapter.factory.mts +1 -1
  42. package/src/factories/reply.factory.mts +1 -1
  43. package/src/factories/request.factory.mts +1 -1
  44. package/src/factories/stream-adapter.factory.mts +1 -1
  45. package/src/factories/xml-stream-adapter.factory.mts +1 -1
  46. package/src/index.mts +1 -0
  47. package/src/interfaces/abstract-adapter.interface.mts +32 -0
  48. package/src/interfaces/abstract-http-adapter.interface.mts +27 -20
  49. package/src/interfaces/adapter-environment.interface.mts +74 -0
  50. package/src/interfaces/index.mts +2 -0
  51. package/src/interfaces/plugin.interface.mts +50 -16
  52. package/src/logger/console-logger.service.mts +97 -7
  53. package/src/metadata/module.metadata.mts +43 -0
  54. package/src/navios.application.mts +172 -60
  55. package/src/navios.environment.mts +22 -12
  56. package/src/navios.factory.mts +31 -10
  57. package/src/services/module-loader.service.mts +1 -0
  58. package/src/tokens/adapter.token.mts +6 -0
  59. package/src/tokens/http-adapter.token.mts +1 -1
  60. package/src/tokens/index.mts +1 -0
  61. package/src/utils/adapter-supports.util.mts +47 -0
  62. package/src/utils/index.mts +1 -0
  63. package/lib/index-BISYCYEG.d.mts.map +0 -1
  64. package/lib/index-CP80H6Dh.d.cts.map +0 -1
  65. package/lib/src-CC5lmk_Q.cjs +0 -8187
  66. package/lib/src-CC5lmk_Q.cjs.map +0 -1
  67. package/lib/src-j1cBuAgy.mjs +0 -7746
  68. package/lib/src-j1cBuAgy.mjs.map +0 -1
  69. package/lib/use-guards.decorator-Be_QUx6b.mjs.map +0 -1
  70. package/lib/use-guards.decorator-DtCGXcWZ.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,60 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.0-alpha.4] - 2026-01-09
9
+
10
+ ### Added
11
+
12
+ - **Unified Adapter Architecture**: New abstract adapter system supporting multiple adapter types (HTTP, CLI, etc.)
13
+ - `AbstractAdapterInterface` - Base interface for all adapters with lifecycle methods (`setupAdapter`, `onModulesInit`, `ready`, `dispose`)
14
+ - `AdapterEnvironment` - Base interface for adapter environments with type-safe options
15
+ - `HttpAdapterEnvironment` - Extended environment interface for HTTP adapters with server, CORS, multipart, and listen options types
16
+ - `DefaultAdapterEnvironment` - Default environment with unknown types for generic usage
17
+ - `AdapterToken` - New injection token for accessing the current adapter instance
18
+ - `AdapterFactory` - Factory for creating adapter instances from environment definitions
19
+ - **Type-Safe Application Generic**: `NaviosApplication<TEnvironment>` now accepts an environment type parameter
20
+ - All adapter-specific methods (`configure`, `enableCors`, `enableMultipart`, `listen`, `getServer`) are now properly typed based on the environment
21
+ - Environment types provide IntelliSense for adapter-specific options
22
+ - **Enhanced Plugin System**: Plugins are now typed with adapter constraints
23
+ - `NaviosPlugin<TOptions, TAdapter>` - Second type parameter for adapter-specific plugins
24
+ - `PluginContext<TAdapter>` - Typed context with adapter access
25
+ - Plugins can access `context.adapter` instead of `context.server` for better type safety
26
+ - **Module Custom Entries**: New `customEntries` property on `ModuleMetadata` for adapter-specific module data
27
+ - Allows adapters to store custom metadata on modules (e.g., commands for CLI adapter)
28
+ - **Console Logger Tests**: Added comprehensive test suite for `ConsoleLoggerService`
29
+
30
+ ### Changed
31
+
32
+ - **Renamed Environment Methods**: `getHttpToken` renamed to `getToken` for adapter-agnostic naming
33
+ - **Renamed Environment Property**: `httpTokens` renamed to `tokens` in environment definitions
34
+ - **Application Configuration**: New `configure()` method replaces `setupHttpServer()` for pre-init configuration
35
+ - Configuration options are merged with adapter defaults
36
+ - Must be called before `init()` for options to take effect
37
+ - **Plugin Context**: `PluginContext.server` replaced with `PluginContext.adapter` for accessing the adapter instance
38
+ - Use `context.adapter.getServer()` for HTTP server access
39
+ - `context.globalPrefix` removed; use `context.adapter.getGlobalPrefix()` instead
40
+ - **Abstract HTTP Adapter**: `AbstractHttpAdapterInterface` now extends `AbstractAdapterInterface`
41
+ - Added `configure(options)` method for pre-init configuration
42
+ - Method signatures updated for environment-based typing
43
+
44
+ ### Breaking Changes
45
+
46
+ - **Environment Definition Format**: `httpTokens` property renamed to `tokens`
47
+ - Before: `{ httpTokens: new Map([...]) }`
48
+ - After: `{ tokens: new Map([...]) }`
49
+ - **Plugin Context API**: `context.server` and `context.globalPrefix` removed
50
+ - Before: `const server = context.server`
51
+ - After: `const server = context.adapter.getServer()`
52
+ - Before: `const prefix = context.globalPrefix`
53
+ - After: `const prefix = context.adapter.getGlobalPrefix()`
54
+ - **Application Setup**: `setupHttpServer()` replaced with `configure()`
55
+ - Before: `await app.setupHttpServer({ logger: true })`
56
+ - After: `app.configure({ logger: true }); await app.init()`
57
+
58
+ ### Dependencies
59
+
60
+ - Updated to support unified adapter architecture across all packages
61
+
8
62
  ## [1.0.0-alpha.3] - 2026-01-08
9
63
 
10
64
  ### Added