@forklaunch/express 0.7.8 → 0.7.10
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.d.mts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +13 -6
- package/lib/index.mjs +14 -7
- package/package.json +4 -4
package/lib/index.d.mts
CHANGED
@@ -9,9 +9,9 @@ export { BusboyConfig } from 'busboy';
|
|
9
9
|
import { Express, RequestHandler, Request, Response, NextFunction, Router as Router$1 } from 'express';
|
10
10
|
export { NextFunction, Request, Response } from 'express';
|
11
11
|
import { Server, IncomingHttpHeaders } from 'http';
|
12
|
+
import { FastMCP } from '@forklaunch/fastmcp-fork';
|
12
13
|
import { CorsOptions } from 'cors';
|
13
14
|
export { CorsOptions } from 'cors';
|
14
|
-
import { FastMCP } from 'fastmcp';
|
15
15
|
import express__default, { NextFunction as NextFunction$1, RequestHandler as RequestHandler$1 } from 'express-serve-static-core';
|
16
16
|
export * from 'express-serve-static-core';
|
17
17
|
import { ParsedQs as ParsedQs$1 } from 'qs';
|
package/lib/index.d.ts
CHANGED
@@ -9,9 +9,9 @@ export { BusboyConfig } from 'busboy';
|
|
9
9
|
import { Express, RequestHandler, Request, Response, NextFunction, Router as Router$1 } from 'express';
|
10
10
|
export { NextFunction, Request, Response } from 'express';
|
11
11
|
import { Server, IncomingHttpHeaders } from 'http';
|
12
|
+
import { FastMCP } from '@forklaunch/fastmcp-fork';
|
12
13
|
import { CorsOptions } from 'cors';
|
13
14
|
export { CorsOptions } from 'cors';
|
14
|
-
import { FastMCP } from 'fastmcp';
|
15
15
|
import express__default, { NextFunction as NextFunction$1, RequestHandler as RequestHandler$1 } from 'express-serve-static-core';
|
16
16
|
export * from 'express-serve-static-core';
|
17
17
|
import { ParsedQs as ParsedQs$1 } from 'qs';
|
package/lib/index.js
CHANGED
@@ -195,23 +195,27 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
|
|
195
195
|
const port = typeof args[0] === "number" ? args[0] : Number(process.env.PORT);
|
196
196
|
const host = typeof args[1] === "string" ? args[1] : process.env.HOST ?? "localhost";
|
197
197
|
const protocol = process.env.PROTOCOL ?? "http";
|
198
|
+
const openApiServerUrls = (0, import_common3.getEnvVar)("DOCS_SERVER_URLS")?.split(",") ?? [
|
199
|
+
`${protocol}://${host}:${port}`
|
200
|
+
];
|
201
|
+
const openApiServerDescriptions = (0, import_common3.getEnvVar)(
|
202
|
+
"DOCS_SERVER_DESCRIPTIONS"
|
203
|
+
)?.split(",") ?? ["Main Server"];
|
198
204
|
const openApi = (0, import_http3.generateOpenApiSpecs)(
|
199
205
|
this.schemaValidator,
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
this.routers
|
206
|
+
openApiServerUrls,
|
207
|
+
openApiServerDescriptions,
|
208
|
+
this
|
204
209
|
);
|
205
210
|
if (this.schemaValidator instanceof import_zod.ZodSchemaValidator) {
|
206
211
|
const zodSchemaValidator = this.schemaValidator;
|
207
|
-
const routers = this.routers;
|
208
212
|
const mcpServer = (0, import_http3.generateMcpServer)(
|
209
213
|
zodSchemaValidator,
|
210
214
|
protocol,
|
211
215
|
host,
|
212
216
|
port,
|
213
217
|
"1.0.0",
|
214
|
-
|
218
|
+
this
|
215
219
|
);
|
216
220
|
mcpServer.start({
|
217
221
|
httpStream: {
|
@@ -268,6 +272,9 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
|
|
268
272
|
res.send(hash);
|
269
273
|
}
|
270
274
|
);
|
275
|
+
this.internal.get("/health", (_, res) => {
|
276
|
+
res.send("OK");
|
277
|
+
});
|
271
278
|
const errorHandler = (err, req, res, _next) => {
|
272
279
|
const statusCode = Number(res.statusCode);
|
273
280
|
res.locals.errorMessage = err.message;
|
package/lib/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
// src/expressApplication.ts
|
2
|
-
import { safeStringify as safeStringify2 } from "@forklaunch/common";
|
2
|
+
import { getEnvVar, safeStringify as safeStringify2 } from "@forklaunch/common";
|
3
3
|
import {
|
4
4
|
ATTR_HTTP_RESPONSE_STATUS_CODE,
|
5
5
|
ForklaunchExpressLikeApplication,
|
@@ -167,23 +167,27 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
167
167
|
const port = typeof args[0] === "number" ? args[0] : Number(process.env.PORT);
|
168
168
|
const host = typeof args[1] === "string" ? args[1] : process.env.HOST ?? "localhost";
|
169
169
|
const protocol = process.env.PROTOCOL ?? "http";
|
170
|
+
const openApiServerUrls = getEnvVar("DOCS_SERVER_URLS")?.split(",") ?? [
|
171
|
+
`${protocol}://${host}:${port}`
|
172
|
+
];
|
173
|
+
const openApiServerDescriptions = getEnvVar(
|
174
|
+
"DOCS_SERVER_DESCRIPTIONS"
|
175
|
+
)?.split(",") ?? ["Main Server"];
|
170
176
|
const openApi = generateOpenApiSpecs(
|
171
177
|
this.schemaValidator,
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
this.routers
|
178
|
+
openApiServerUrls,
|
179
|
+
openApiServerDescriptions,
|
180
|
+
this
|
176
181
|
);
|
177
182
|
if (this.schemaValidator instanceof ZodSchemaValidator) {
|
178
183
|
const zodSchemaValidator = this.schemaValidator;
|
179
|
-
const routers = this.routers;
|
180
184
|
const mcpServer = generateMcpServer(
|
181
185
|
zodSchemaValidator,
|
182
186
|
protocol,
|
183
187
|
host,
|
184
188
|
port,
|
185
189
|
"1.0.0",
|
186
|
-
|
190
|
+
this
|
187
191
|
);
|
188
192
|
mcpServer.start({
|
189
193
|
httpStream: {
|
@@ -240,6 +244,9 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
240
244
|
res.send(hash);
|
241
245
|
}
|
242
246
|
);
|
247
|
+
this.internal.get("/health", (_, res) => {
|
248
|
+
res.send("OK");
|
249
|
+
});
|
243
250
|
const errorHandler = (err, req, res, _next) => {
|
244
251
|
const statusCode = Number(res.statusCode);
|
245
252
|
res.locals.errorMessage = err.message;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@forklaunch/express",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.10",
|
4
4
|
"description": "Forklaunch framework for express.",
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
6
6
|
"bugs": {
|
@@ -25,6 +25,7 @@
|
|
25
25
|
"lib/**"
|
26
26
|
],
|
27
27
|
"dependencies": {
|
28
|
+
"@forklaunch/fastmcp-fork": "^1.0.3",
|
28
29
|
"@modelcontextprotocol/sdk": "^1.17.1",
|
29
30
|
"@scalar/express-api-reference": "^0.8.13",
|
30
31
|
"@types/multer": "^2.0.0",
|
@@ -32,13 +33,12 @@
|
|
32
33
|
"busboy": "^1.6.0",
|
33
34
|
"cors": "^2.8.5",
|
34
35
|
"express": "^5.1.0",
|
35
|
-
"fastmcp": "^3.13.0",
|
36
36
|
"multer": "2.0.2",
|
37
37
|
"qs": "^6.14.0",
|
38
38
|
"swagger-ui-express": "^5.0.1",
|
39
39
|
"@forklaunch/common": "0.4.6",
|
40
|
-
"@forklaunch/
|
41
|
-
"@forklaunch/
|
40
|
+
"@forklaunch/validator": "0.8.0",
|
41
|
+
"@forklaunch/core": "0.12.2"
|
42
42
|
},
|
43
43
|
"devDependencies": {
|
44
44
|
"@eslint/js": "^9.32.0",
|