@forklaunch/express 2.2.0 → 2.2.2
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/lib/index.js +16 -3
- package/lib/index.mjs +19 -6
- package/lib/src/expressApplication.d.ts.map +1 -1
- package/package.json +10 -10
package/lib/index.js
CHANGED
|
@@ -2145,9 +2145,9 @@ function enrichResponseTransmission(req, res, next) {
|
|
|
2145
2145
|
res.setHeader = function(name, value) {
|
|
2146
2146
|
let stringifiedValue;
|
|
2147
2147
|
if (Array.isArray(value)) {
|
|
2148
|
-
stringifiedValue = value.map((v) => (0, import_common3.
|
|
2148
|
+
stringifiedValue = value.map((v) => (0, import_common3.toPlainString)(v));
|
|
2149
2149
|
} else {
|
|
2150
|
-
stringifiedValue = (0, import_common3.
|
|
2150
|
+
stringifiedValue = (0, import_common3.toPlainString)(value);
|
|
2151
2151
|
}
|
|
2152
2152
|
return originalSetHeader.call(this, name, stringifiedValue);
|
|
2153
2153
|
};
|
|
@@ -2254,7 +2254,8 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
|
|
|
2254
2254
|
this.mcpConfiguration,
|
|
2255
2255
|
options2,
|
|
2256
2256
|
contentTypeMapping,
|
|
2257
|
-
authenticate
|
|
2257
|
+
authenticate,
|
|
2258
|
+
this.openTelemetryCollector
|
|
2258
2259
|
);
|
|
2259
2260
|
if (additionalTools) {
|
|
2260
2261
|
additionalTools(mcpServer);
|
|
@@ -2266,6 +2267,18 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
|
|
|
2266
2267
|
sessionIdleTimeoutMs,
|
|
2267
2268
|
workerCount: this.hostingConfiguration?.workerCount
|
|
2268
2269
|
});
|
|
2270
|
+
for (const metadataPath of mcpHandler.metadataPaths) {
|
|
2271
|
+
this.internal.get(metadataPath, async (_req, res, next) => {
|
|
2272
|
+
try {
|
|
2273
|
+
await writeFetchResponse(
|
|
2274
|
+
mcpHandler.protectedResourceMetadata(),
|
|
2275
|
+
res
|
|
2276
|
+
);
|
|
2277
|
+
} catch (error) {
|
|
2278
|
+
next(error);
|
|
2279
|
+
}
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2269
2282
|
this.internal.all(mcpPath ?? "/mcp", async (req, res, next) => {
|
|
2270
2283
|
try {
|
|
2271
2284
|
const response = await mcpHandler.handle(
|
package/lib/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "@forklaunch/core/http";
|
|
5
5
|
|
|
6
6
|
// src/expressApplication.ts
|
|
7
|
-
import { getEnvVar, safeStringify
|
|
7
|
+
import { getEnvVar, safeStringify } from "@forklaunch/common";
|
|
8
8
|
import {
|
|
9
9
|
ATTR_HTTP_RESPONSE_STATUS_CODE,
|
|
10
10
|
createMcpHttpHandler,
|
|
@@ -2099,7 +2099,7 @@ async function writeFetchResponse(response, res) {
|
|
|
2099
2099
|
}
|
|
2100
2100
|
|
|
2101
2101
|
// src/middleware/enrichResponseTransmission.middleware.ts
|
|
2102
|
-
import {
|
|
2102
|
+
import { toPlainString } from "@forklaunch/common";
|
|
2103
2103
|
import {
|
|
2104
2104
|
enrichExpressLikeSend
|
|
2105
2105
|
} from "@forklaunch/core/http";
|
|
@@ -2123,9 +2123,9 @@ function enrichResponseTransmission(req, res, next) {
|
|
|
2123
2123
|
res.setHeader = function(name, value) {
|
|
2124
2124
|
let stringifiedValue;
|
|
2125
2125
|
if (Array.isArray(value)) {
|
|
2126
|
-
stringifiedValue = value.map((v) =>
|
|
2126
|
+
stringifiedValue = value.map((v) => toPlainString(v));
|
|
2127
2127
|
} else {
|
|
2128
|
-
stringifiedValue =
|
|
2128
|
+
stringifiedValue = toPlainString(value);
|
|
2129
2129
|
}
|
|
2130
2130
|
return originalSetHeader.call(this, name, stringifiedValue);
|
|
2131
2131
|
};
|
|
@@ -2232,7 +2232,8 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
|
2232
2232
|
this.mcpConfiguration,
|
|
2233
2233
|
options2,
|
|
2234
2234
|
contentTypeMapping,
|
|
2235
|
-
authenticate
|
|
2235
|
+
authenticate,
|
|
2236
|
+
this.openTelemetryCollector
|
|
2236
2237
|
);
|
|
2237
2238
|
if (additionalTools) {
|
|
2238
2239
|
additionalTools(mcpServer);
|
|
@@ -2244,6 +2245,18 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
|
2244
2245
|
sessionIdleTimeoutMs,
|
|
2245
2246
|
workerCount: this.hostingConfiguration?.workerCount
|
|
2246
2247
|
});
|
|
2248
|
+
for (const metadataPath of mcpHandler.metadataPaths) {
|
|
2249
|
+
this.internal.get(metadataPath, async (_req, res, next) => {
|
|
2250
|
+
try {
|
|
2251
|
+
await writeFetchResponse(
|
|
2252
|
+
mcpHandler.protectedResourceMetadata(),
|
|
2253
|
+
res
|
|
2254
|
+
);
|
|
2255
|
+
} catch (error) {
|
|
2256
|
+
next(error);
|
|
2257
|
+
}
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2247
2260
|
this.internal.all(mcpPath ?? "/mcp", async (req, res, next) => {
|
|
2248
2261
|
try {
|
|
2249
2262
|
const response = await mcpHandler.handle(
|
|
@@ -2362,7 +2375,7 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
|
2362
2375
|
this.internal.get(
|
|
2363
2376
|
`/api${process.env.VERSION ? `/${process.env.VERSION}` : ""}/openapi-hash`,
|
|
2364
2377
|
async (_, res) => {
|
|
2365
|
-
const hash = await crypto2.createHash("sha256").update(
|
|
2378
|
+
const hash = await crypto2.createHash("sha256").update(safeStringify(openApi)).digest("hex");
|
|
2366
2379
|
res.send(hash);
|
|
2367
2380
|
}
|
|
2368
2381
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expressApplication.d.ts","sourceRoot":"","sources":["../../src/expressApplication.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,gCAAgC,EAQhC,iBAAiB,EAEjB,sBAAsB,EACtB,aAAa,EACd,MAAM,uBAAuB,CAAC;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O,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,MAAM,CAAC;IACV,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC;IACtE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC;IACpD,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC;IACtC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC;IACpD,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC;CA+UjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/express",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Forklaunch framework for express.",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"lib/**"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@forklaunch/common": "^
|
|
32
|
-
"@forklaunch/core": "^4.
|
|
33
|
-
"@forklaunch/validator": "^1.3.
|
|
31
|
+
"@forklaunch/common": "^2.0.0",
|
|
32
|
+
"@forklaunch/core": "^4.3.0",
|
|
33
|
+
"@forklaunch/validator": "^1.3.1",
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
35
|
-
"@scalar/express-api-reference": "^0.10.
|
|
35
|
+
"@scalar/express-api-reference": "^0.10.44",
|
|
36
36
|
"@types/multer": "^2.3.0",
|
|
37
37
|
"body-parser": "^2.4.0",
|
|
38
38
|
"busboy": "^1.6.0",
|
|
39
39
|
"cors": "^2.8.6",
|
|
40
40
|
"express": "^5.3.0",
|
|
41
|
-
"fastmcp": "^4.
|
|
41
|
+
"fastmcp": "^4.30.2",
|
|
42
42
|
"multer": "2.5.0",
|
|
43
43
|
"qs": "^6.17.1",
|
|
44
44
|
"range-parser": "^1.3.0",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@eslint/js": "^10.0.1",
|
|
49
|
-
"@types/body-parser": "^
|
|
50
|
-
"@types/bun": "^1.4.
|
|
49
|
+
"@types/body-parser": "^2.2.0",
|
|
50
|
+
"@types/bun": "^1.4.5",
|
|
51
51
|
"@types/busboy": "^1.5.5",
|
|
52
52
|
"@types/cors": "^2.8.19",
|
|
53
53
|
"@types/express": "^5.0.6",
|
|
54
54
|
"@types/express-serve-static-core": "^5.1.3",
|
|
55
|
-
"@types/node": "^26.6.
|
|
55
|
+
"@types/node": "^26.6.11",
|
|
56
56
|
"@types/qs": "^6.15.1",
|
|
57
57
|
"@types/range-parser": "^1.2.7",
|
|
58
58
|
"@types/swagger-ui-express": "^4.1.8",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"ts-node": "^10.9.2",
|
|
62
62
|
"tsup": "^9.0.0",
|
|
63
63
|
"typescript": "^7.0.2",
|
|
64
|
-
"typescript-eslint": "^8.
|
|
64
|
+
"typescript-eslint": "^8.74.0"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "tsc --noEmit && tsup index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --outDir lib --clean && tsc -p tsconfig.build.json --emitDeclarationOnly",
|