@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.
- package/CHANGELOG.md +54 -0
- package/lib/{index-BISYCYEG.d.mts → index-6S7veHKD.d.mts} +400 -104
- package/lib/index-6S7veHKD.d.mts.map +1 -0
- package/lib/{index-CP80H6Dh.d.cts → index-r0i2txmg.d.cts} +400 -104
- package/lib/index-r0i2txmg.d.cts.map +1 -0
- package/lib/index.cjs +4420 -85
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +2 -2
- package/lib/index.d.mts +2 -2
- package/lib/index.mjs +4328 -3
- package/lib/index.mjs.map +1 -0
- package/lib/legacy-compat/index.cjs +5 -4
- package/lib/legacy-compat/index.cjs.map +1 -1
- package/lib/legacy-compat/index.d.cts +1 -1
- package/lib/legacy-compat/index.d.mts +1 -1
- package/lib/legacy-compat/index.mjs +2 -1
- package/lib/legacy-compat/index.mjs.map +1 -1
- package/lib/navios.factory-BanZIvtR.cjs +4134 -0
- package/lib/navios.factory-BanZIvtR.cjs.map +1 -0
- package/lib/navios.factory-C75yZCoD.mjs +3831 -0
- package/lib/navios.factory-C75yZCoD.mjs.map +1 -0
- package/lib/testing/index.cjs +3 -3
- package/lib/testing/index.cjs.map +1 -1
- package/lib/testing/index.d.cts +1 -1
- package/lib/testing/index.d.mts +1 -1
- package/lib/testing/index.mjs +2 -2
- package/lib/tokens-4J9sredA.mjs +100 -0
- package/lib/tokens-4J9sredA.mjs.map +1 -0
- package/lib/tokens-BuXXB01L.cjs +196 -0
- package/lib/tokens-BuXXB01L.cjs.map +1 -0
- package/lib/{use-guards.decorator-Be_QUx6b.mjs → use-guards.decorator-BecoQSmE.mjs} +3 -70
- package/lib/use-guards.decorator-BecoQSmE.mjs.map +1 -0
- package/lib/{use-guards.decorator-DtCGXcWZ.cjs → use-guards.decorator-DgD-kxF5.cjs} +7 -158
- package/lib/use-guards.decorator-DgD-kxF5.cjs.map +1 -0
- package/package.json +3 -3
- package/src/__tests__/console-logger.service.spec.mts +312 -0
- package/src/factories/adapter.factory.mts +20 -0
- package/src/factories/endpoint-adapter.factory.mts +1 -1
- package/src/factories/http-adapter.factory.mts +1 -1
- package/src/factories/index.mts +1 -0
- package/src/factories/multipart-adapter.factory.mts +1 -1
- package/src/factories/reply.factory.mts +1 -1
- package/src/factories/request.factory.mts +1 -1
- package/src/factories/stream-adapter.factory.mts +1 -1
- package/src/factories/xml-stream-adapter.factory.mts +1 -1
- package/src/index.mts +1 -0
- package/src/interfaces/abstract-adapter.interface.mts +32 -0
- package/src/interfaces/abstract-http-adapter.interface.mts +27 -20
- package/src/interfaces/adapter-environment.interface.mts +74 -0
- package/src/interfaces/index.mts +2 -0
- package/src/interfaces/plugin.interface.mts +50 -16
- package/src/logger/console-logger.service.mts +97 -7
- package/src/metadata/module.metadata.mts +43 -0
- package/src/navios.application.mts +172 -60
- package/src/navios.environment.mts +22 -12
- package/src/navios.factory.mts +31 -10
- package/src/services/module-loader.service.mts +1 -0
- package/src/tokens/adapter.token.mts +6 -0
- package/src/tokens/http-adapter.token.mts +1 -1
- package/src/tokens/index.mts +1 -0
- package/src/utils/adapter-supports.util.mts +47 -0
- package/src/utils/index.mts +1 -0
- package/lib/index-BISYCYEG.d.mts.map +0 -1
- package/lib/index-CP80H6Dh.d.cts.map +0 -1
- package/lib/src-CC5lmk_Q.cjs +0 -8187
- package/lib/src-CC5lmk_Q.cjs.map +0 -1
- package/lib/src-j1cBuAgy.mjs +0 -7746
- package/lib/src-j1cBuAgy.mjs.map +0 -1
- package/lib/use-guards.decorator-Be_QUx6b.mjs.map +0 -1
- 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
|