@telorun/http-server 0.11.0 → 0.11.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.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/http-api-controller.js +6 -5
- package/package.json +2 -2
- package/src/http-api-controller.ts +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @telorun/http-server
|
|
2
2
|
|
|
3
|
+
## 0.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b41012f: http-server: a route handler now receives its resolved `inputs` once. Previously the dispatch passed `{ ...resolvedInputs, inputs: resolvedInputs }` — the resolved fields plus a second nested copy under `inputs` that nothing read (a templated handler's `${{ inputs.X }}` already resolves against the top-level fields). The redundant copy is gone, so the handler argument — and the debug trace's invocation inputs — show each value a single time. No reader relied on the nested key, so this is behaviour-preserving for handlers.
|
|
8
|
+
- @telorun/http-dispatch@0.4.1
|
|
9
|
+
|
|
3
10
|
## 0.11.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Language- and framework-agnostic HTTP server for Telo. Declarative routes, schem
|
|
|
24
24
|
kind: Telo.Application
|
|
25
25
|
metadata: { name: hello-http, version: 1.0.0 }
|
|
26
26
|
imports:
|
|
27
|
-
Http: std/http-server@0.
|
|
27
|
+
Http: std/http-server@0.12.0
|
|
28
28
|
JS: std/javascript@0.5.0
|
|
29
29
|
targets: [ !ref Server ]
|
|
30
30
|
---
|
|
@@ -98,13 +98,14 @@ export class HttpServerApi {
|
|
|
98
98
|
},
|
|
99
99
|
};
|
|
100
100
|
const acceptHeader = request.headers["accept"]?.toString();
|
|
101
|
-
|
|
101
|
+
// The handler receives the resolved inputs directly: a templated handler's
|
|
102
|
+
// `${{ inputs.X }}` reads these as its `inputs` bag, and a plain invocable
|
|
103
|
+
// reads the fields off its argument. (This previously also nested a second
|
|
104
|
+
// `inputs: resolvedInputs` copy — which nothing read, and which surfaced as
|
|
105
|
+
// duplicated data in the debug trace.)
|
|
106
|
+
const invokeInput = route.inputs
|
|
102
107
|
? (this.ctx.moduleContext.expandWith(route.inputs, requestContext) ?? {})
|
|
103
108
|
: requestContext;
|
|
104
|
-
const invokeInput = {
|
|
105
|
-
...resolvedInputs,
|
|
106
|
-
inputs: resolvedInputs,
|
|
107
|
-
};
|
|
108
109
|
const sink = fastifyReplySink(reply);
|
|
109
110
|
// Per-request cancellation: abandon downstream work when the client
|
|
110
111
|
// disconnects before the response is sent. Listen on the response
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/http-server",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Telo HTTP Server module - HTTP server and API resource kinds for Telo manifests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@types/node": "^20.0.0",
|
|
50
50
|
"typescript": "^5.0.0",
|
|
51
51
|
"vitest": "^2.1.8",
|
|
52
|
-
"@telorun/sdk": "0.
|
|
52
|
+
"@telorun/sdk": "0.31.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@telorun/sdk": "*"
|
|
@@ -137,13 +137,14 @@ export class HttpServerApi implements ResourceInstance {
|
|
|
137
137
|
| string
|
|
138
138
|
| undefined
|
|
139
139
|
)?.toString();
|
|
140
|
-
|
|
140
|
+
// The handler receives the resolved inputs directly: a templated handler's
|
|
141
|
+
// `${{ inputs.X }}` reads these as its `inputs` bag, and a plain invocable
|
|
142
|
+
// reads the fields off its argument. (This previously also nested a second
|
|
143
|
+
// `inputs: resolvedInputs` copy — which nothing read, and which surfaced as
|
|
144
|
+
// duplicated data in the debug trace.)
|
|
145
|
+
const invokeInput: Record<string, any> = route.inputs
|
|
141
146
|
? ((this.ctx.moduleContext.expandWith(route.inputs, requestContext) as any) ?? {})
|
|
142
147
|
: requestContext;
|
|
143
|
-
const invokeInput: Record<string, any> = {
|
|
144
|
-
...resolvedInputs,
|
|
145
|
-
inputs: resolvedInputs,
|
|
146
|
-
};
|
|
147
148
|
|
|
148
149
|
const sink = fastifyReplySink(reply);
|
|
149
150
|
|