@flancer32/teq-web 0.7.0 → 0.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.0] - 2026-03-17 - Flat runtime configuration and server startup alignment
4
+
5
+ ### Changed
6
+ - Flattened runtime startup configuration to top-level fields `port`, `type`, and `tls` (without nested `server` branch).
7
+ - Aligned server startup and runtime components with the updated flat runtime configuration contract.
8
+ - Updated and verified the `ai/` consumer interface documentation to reflect current runtime usage patterns.
9
+ - Updated package version metadata to `0.8.0`.
10
+
3
11
  ## [0.7.0] - 2026-03-16 - Runtime composition and agent interface alignment
4
12
 
5
13
  ### Changed
@@ -16,7 +16,7 @@ Main methods:
16
16
 
17
17
  `Fl32_Web_Back_Server$` is the built-in transport adapter around Node.js `http` and `http2`. On `start(cfg)` it locks the pipeline, creates the server instance, binds request events to the Pipeline Engine, and starts listening.
18
18
 
19
- Default transport settings come from `Fl32_Web_Back_Config_Runtime$` under the `server` branch. TLS values for `server.tls` are provided by the dedicated runtime configuration component `Fl32_Web_Back_Config_Runtime_Tls$`. Supported transport modes come from `Fl32_Web_Back_Enum_Server_Type$`:
19
+ Default transport settings come from flat fields of `Fl32_Web_Back_Config_Runtime$` (`port`, `type`, `tls`). TLS values for `tls` are provided by the dedicated runtime configuration component `Fl32_Web_Back_Config_Runtime_Tls$`. Supported transport modes come from `Fl32_Web_Back_Enum_Server_Type$`:
20
20
 
21
21
  - `http`
22
22
  - `http2`
@@ -74,6 +74,6 @@ Consumer notes:
74
74
  - The composition root configures namespace roots once and resolves one application entry service.
75
75
  - Application modules do not construct collaborators directly and do not call `new` for DI-managed handlers or infrastructure services.
76
76
  - `server.start()` locks handler registration for the runtime lifetime of that server instance.
77
- - Built-in server defaults may also be supplied through `Fl32_Web_Back_Config_Runtime__Factory$` as `{server: {port, type, tls}}`, where `tls` is owned by the runtime component `Fl32_Web_Back_Config_Runtime_Tls$`.
77
+ - Built-in server defaults may also be supplied through `Fl32_Web_Back_Config_Runtime__Factory$` as `{port, type, tls}`, where `tls` is owned by the runtime component `Fl32_Web_Back_Config_Runtime_Tls$`.
78
78
  - If your application already has its own transport layer, inject `Fl32_Web_Back_PipelineEngine$` and call `pipeline.onEventRequest(req, res)` from that adapter instead of using `Fl32_Web_Back_Server$`.
79
79
  - A correct PROCESS handler ends the response and then marks the context completed.
package/ai/overview.md CHANGED
@@ -6,7 +6,7 @@ This package is not a general-purpose web framework. It does not define routing,
6
6
 
7
7
  The package assumes `@teqfw/di` and exposes its runtime surface through DI-managed modules under the `Fl32_Web_` namespace rooted at the published `src/` tree. In normal usage, application modules receive these dependencies through constructor injection and orchestrate them from DI-managed services rather than creating containers or wiring collaborators manually inside feature code.
8
8
 
9
- Runtime startup configuration is exposed through `Fl32_Web_Back_Config_Runtime$`. Its built-in transport branch is `config.server`, which contains `port`, `type`, and a `tls` branch backed by `Fl32_Web_Back_Config_Runtime_Tls$`.
9
+ Runtime startup configuration is exposed through `Fl32_Web_Back_Config_Runtime$` with flat transport fields `config.port`, `config.type`, and `config.tls`. The `tls` field is backed by `Fl32_Web_Back_Config_Runtime_Tls$`.
10
10
 
11
11
  Use this package when external code needs one of these roles:
12
12
 
package/ai/rules.md CHANGED
@@ -38,7 +38,7 @@
38
38
 
39
39
  - The package is designed for `@teqfw/di`.
40
40
  - Consumer code should resolve package modules through the `Fl32_Web_` namespace mapped to the package `src/` path.
41
- - Startup configuration for the built-in server should be supplied through `Fl32_Web_Back_Config_Runtime__Factory$` using the hierarchical configuration shape `{server: {...}}`.
42
- - TLS startup configuration belongs to the dedicated runtime component `Fl32_Web_Back_Config_Runtime_Tls$`, even though consumers read it through `config.server.tls`.
41
+ - Startup configuration for the built-in server should be supplied through `Fl32_Web_Back_Config_Runtime__Factory$` using flat runtime fields (`{port, type, tls}`).
42
+ - TLS startup configuration belongs to the dedicated runtime component `Fl32_Web_Back_Config_Runtime_Tls$`, even though consumers read it through `config.tls`.
43
43
  - Configure runtime values during startup only; once the runtime configuration is frozen for use, consumers must treat `Fl32_Web_Back_Config_Runtime$` and `Fl32_Web_Back_Config_Runtime_Tls$` as immutable read-only state.
44
44
  - Treat helper internals under deep implementation paths as non-essential unless the task specifically requires them. Preferred consumer entry points are the Pipeline Engine, Server, handler API, DTO factories, enums, and built-in handlers.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flancer32/teq-web",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Server-side web request coordination infrastructure for TeqFW modular monolith applications.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -57,7 +57,6 @@ export class Factory {
57
57
  constructor({cast}) {
58
58
  /**
59
59
  * @param {Fl32_Web_Back_Config_Runtime_Tls_Params} [params]
60
- * @returns {Fl32_Web_Back_Config_Runtime_Tls}
61
60
  */
62
61
  this.configure = function (params = {}) {
63
62
  if (frozen) throw new Error('Runtime configuration is frozen.');
@@ -70,7 +69,6 @@ export class Factory {
70
69
  if (cfg.key === undefined && params.key !== undefined) {
71
70
  cfg.key = cast.string(params.key);
72
71
  }
73
- return proxy;
74
72
  };
75
73
 
76
74
  /**
@@ -10,14 +10,6 @@ export const __deps__ = Object.freeze({
10
10
  * Backend runtime configuration.
11
11
  */
12
12
  export class Data {
13
- /** @type {Fl32_Web_Back_Config_Runtime_Server|undefined} */
14
- server;
15
- }
16
-
17
- /**
18
- * Built-in server runtime configuration subtree.
19
- */
20
- export class Server {
21
13
  /** @type {number|undefined} */
22
14
  port;
23
15
  /** @type {string|undefined} */
@@ -68,44 +60,38 @@ export class Factory {
68
60
  */
69
61
  constructor({ cast, SERVER_TYPE, tlsFactory }) {
70
62
  /**
71
- * @param {Fl32_Web_Back_Config_Runtime_Params} [params]
72
- * @returns {Fl32_Web_Back_Config_Runtime}
63
+ * @param {Fl32_Web_Back_Config_Runtime} [params]
73
64
  */
74
65
  this.configure = function (params = {}) {
75
66
  if (frozen) throw new Error('Runtime configuration is frozen.');
76
- if (cfg.server === undefined) cfg.server = new Server();
77
- if (cfg.server.port === undefined && params.server?.port !== undefined) {
78
- cfg.server.port = cast.int(params.server.port);
67
+ if (cfg.port === undefined && params.port !== undefined) {
68
+ cfg.port = cast.int(params.port);
79
69
  }
80
- if (cfg.server.type === undefined && params.server?.type !== undefined) {
81
- cfg.server.type = cast.enum(params.server.type, SERVER_TYPE, { lower: true });
70
+ if (cfg.type === undefined && params.type !== undefined) {
71
+ cfg.type = cast.enum(params.type, SERVER_TYPE, { lower: true });
82
72
  }
83
- if (params.server?.tls !== undefined) {
84
- tlsFactory.configure(params.server.tls);
73
+ if (params.tls !== undefined) {
74
+ tlsFactory.configure(params.tls);
85
75
  }
86
- return proxy;
87
76
  };
88
77
 
89
78
  /**
90
- * @returns {Fl32_Web_Back_Config_Runtime}
79
+ * @returns {void}
91
80
  */
92
81
  this.freeze = function () {
93
- if (frozen) return proxy;
94
- if (cfg.server === undefined) cfg.server = new Server();
95
- if (cfg.server.port === undefined) cfg.server.port = 3000;
96
- if (cfg.server.type === undefined) cfg.server.type = SERVER_TYPE.HTTP;
82
+ if (frozen) return;
83
+ if (cfg.port === undefined) cfg.port = 3000;
84
+ if (cfg.type === undefined) cfg.type = SERVER_TYPE.HTTP;
97
85
  const tls = tlsFactory.freeze();
98
- if (cfg.server.tls === undefined) cfg.server.tls = tls;
99
- if (cfg.server.type === SERVER_TYPE.HTTPS && cfg.server.tls === undefined) {
86
+ if (cfg.tls === undefined) cfg.tls = tls;
87
+ if (cfg.type === SERVER_TYPE.HTTPS && cfg.tls === undefined) {
100
88
  throw new Error('TLS configuration is required for HTTPS server type');
101
89
  }
102
- if (cfg.server.type === SERVER_TYPE.HTTPS && (!cfg.server.tls.key || !cfg.server.tls.cert)) {
90
+ if (cfg.type === SERVER_TYPE.HTTPS && (!cfg.tls.key || !cfg.tls.cert)) {
103
91
  throw new Error('TLS configuration is required for HTTPS server type');
104
92
  }
105
- Object.freeze(cfg.server);
106
93
  Object.freeze(cfg);
107
94
  frozen = true;
108
- return proxy;
109
95
  };
110
96
  }
111
97
  }
@@ -49,15 +49,15 @@ export default class Fl32_Web_Back_Server {
49
49
 
50
50
  /**
51
51
  * Starts the server with optional configuration.
52
- * @param {Fl32_Web_Back_Config_Runtime_Server} [cfg]
52
+ * @param {Fl32_Web_Back_Config_Runtime} [cfg]
53
53
  * @returns {Promise<void>}
54
54
  */
55
55
  this.start = async function (cfg) {
56
56
  pipelineEngine.lockHandlers();
57
57
  // create server
58
- const port = cfg?.port ?? config.server.port;
59
- const type = cfg?.type ?? config.server.type;
60
- const tls = cfg?.tls ?? config.server.tls;
58
+ const port = cfg?.port ?? config.port;
59
+ const type = cfg?.type ?? config.type;
60
+ const tls = cfg?.tls ?? config.tls;
61
61
 
62
62
  if (type === SERVER_TYPE.HTTP2) {
63
63
  _instance = createServerH2();
package/types.d.ts CHANGED
@@ -2,10 +2,8 @@ declare global {
2
2
  type Fl32_Web_Back_Api_Handler = import("./src/Back/Api/Handler.mjs").default;
3
3
  type Fl32_Web_Back_Config_Runtime = import("./src/Back/Config/Runtime.mjs").Data;
4
4
  type Fl32_Web_Back_Config_Runtime$Factory = import("./src/Back/Config/Runtime.mjs").Factory;
5
- type Fl32_Web_Back_Config_Runtime_Server = import("./src/Back/Config/Runtime.mjs").Server;
6
5
  type Fl32_Web_Back_Config_Runtime_Tls = import("./src/Back/Config/Runtime/Tls.mjs").Data;
7
6
  type Fl32_Web_Back_Config_Runtime_Tls$Factory = import("./src/Back/Config/Runtime/Tls.mjs").Factory;
8
- type Fl32_Web_Back_Config_Runtime_Params = {server?: {port?: unknown, type?: unknown, tls?: unknown}};
9
7
  type Fl32_Web_Back_Config_Runtime_Tls_Params = {ca?: unknown, cert?: unknown, key?: unknown};
10
8
  type Fl32_Web_Back_Dto_Info = import("./src/Back/Dto/Info.mjs").default;
11
9
  type Fl32_Web_Back_Dto_Info$Factory = import("./src/Back/Dto/Info.mjs").Factory;