@forklaunch/hyper-express 0.5.7 → 0.5.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 +5 -2
- package/lib/index.d.ts +5 -2
- package/lib/index.js +7 -5
- package/lib/index.mjs +7 -5
- package/package.json +8 -8
package/lib/index.d.mts
CHANGED
@@ -3,6 +3,7 @@ import { ParamsObject, ResponsesObject, Body, QueryObject, HeadersObject, Contra
|
|
3
3
|
import { Request, Response, MiddlewareNext, Server, MiddlewareHandler, ServerConstructorOptions, Router as Router$1 } from '@forklaunch/hyper-express-fork';
|
4
4
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
5
5
|
import { BusboyConfig } from 'busboy';
|
6
|
+
import { CorsOptions } from 'cors';
|
6
7
|
import * as uWebsockets from 'uWebSockets.js';
|
7
8
|
|
8
9
|
/**
|
@@ -724,7 +725,7 @@ declare const trace: <SV extends AnySchemaValidator, Path extends `/${string}`,
|
|
724
725
|
* ```
|
725
726
|
*/
|
726
727
|
declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpressLikeApplication<SV, Server, MiddlewareHandler, Request<Record<string, unknown>>, Response<Record<string, unknown>>, MiddlewareNext> {
|
727
|
-
private
|
728
|
+
private docsConfiguration;
|
728
729
|
/**
|
729
730
|
* Creates an instance of the Application class.
|
730
731
|
*
|
@@ -745,7 +746,8 @@ declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpre
|
|
745
746
|
docs?: DocsConfiguration;
|
746
747
|
busboy?: BusboyConfig;
|
747
748
|
server?: ServerConstructorOptions;
|
748
|
-
|
749
|
+
cors?: CorsOptions;
|
750
|
+
});
|
749
751
|
/**
|
750
752
|
* Starts the server and sets up API documentation.
|
751
753
|
* Supports multiple listening configurations including port, host, and UNIX socket path.
|
@@ -799,6 +801,7 @@ declare function forklaunchExpress<SV extends AnySchemaValidator>(schemaValidato
|
|
799
801
|
docs?: DocsConfiguration;
|
800
802
|
busboy?: BusboyConfig;
|
801
803
|
server?: ServerConstructorOptions;
|
804
|
+
cors?: CorsOptions;
|
802
805
|
}): Application<SV>;
|
803
806
|
/**
|
804
807
|
* Creates a new instance of Router with the given base path and schema validator.
|
package/lib/index.d.ts
CHANGED
@@ -3,6 +3,7 @@ import { ParamsObject, ResponsesObject, Body, QueryObject, HeadersObject, Contra
|
|
3
3
|
import { Request, Response, MiddlewareNext, Server, MiddlewareHandler, ServerConstructorOptions, Router as Router$1 } from '@forklaunch/hyper-express-fork';
|
4
4
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
5
5
|
import { BusboyConfig } from 'busboy';
|
6
|
+
import { CorsOptions } from 'cors';
|
6
7
|
import * as uWebsockets from 'uWebSockets.js';
|
7
8
|
|
8
9
|
/**
|
@@ -724,7 +725,7 @@ declare const trace: <SV extends AnySchemaValidator, Path extends `/${string}`,
|
|
724
725
|
* ```
|
725
726
|
*/
|
726
727
|
declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpressLikeApplication<SV, Server, MiddlewareHandler, Request<Record<string, unknown>>, Response<Record<string, unknown>>, MiddlewareNext> {
|
727
|
-
private
|
728
|
+
private docsConfiguration;
|
728
729
|
/**
|
729
730
|
* Creates an instance of the Application class.
|
730
731
|
*
|
@@ -745,7 +746,8 @@ declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpre
|
|
745
746
|
docs?: DocsConfiguration;
|
746
747
|
busboy?: BusboyConfig;
|
747
748
|
server?: ServerConstructorOptions;
|
748
|
-
|
749
|
+
cors?: CorsOptions;
|
750
|
+
});
|
749
751
|
/**
|
750
752
|
* Starts the server and sets up API documentation.
|
751
753
|
* Supports multiple listening configurations including port, host, and UNIX socket path.
|
@@ -799,6 +801,7 @@ declare function forklaunchExpress<SV extends AnySchemaValidator>(schemaValidato
|
|
799
801
|
docs?: DocsConfiguration;
|
800
802
|
busboy?: BusboyConfig;
|
801
803
|
server?: ServerConstructorOptions;
|
804
|
+
cors?: CorsOptions;
|
802
805
|
}): Application<SV>;
|
803
806
|
/**
|
804
807
|
* Creates a new instance of Router with the given base path and schema validator.
|
package/lib/index.js
CHANGED
@@ -273,6 +273,7 @@ function swagger(path, document, opts, options2, customCss, customfavIcon, swagg
|
|
273
273
|
|
274
274
|
// src/hyperExpressApplication.ts
|
275
275
|
var Application = class extends import_http13.ForklaunchExpressLikeApplication {
|
276
|
+
docsConfiguration;
|
276
277
|
/**
|
277
278
|
* Creates an instance of the Application class.
|
278
279
|
*
|
@@ -297,9 +298,10 @@ var Application = class extends import_http13.ForklaunchExpressLikeApplication {
|
|
297
298
|
contentParse(configurationOptions),
|
298
299
|
enrichResponseTransmission
|
299
300
|
],
|
300
|
-
openTelemetryCollector
|
301
|
+
openTelemetryCollector,
|
302
|
+
configurationOptions
|
301
303
|
);
|
302
|
-
this.
|
304
|
+
this.docsConfiguration = configurationOptions?.docs;
|
303
305
|
}
|
304
306
|
async listen(arg0, arg1, arg2) {
|
305
307
|
if (typeof arg0 === "number") {
|
@@ -322,15 +324,15 @@ Correlation id: ${(0, import_http13.isForklaunchRequest)(req) ? req.context.corr
|
|
322
324
|
port,
|
323
325
|
this.routers
|
324
326
|
);
|
325
|
-
if (this.
|
327
|
+
if (this.docsConfiguration == null || this.docsConfiguration.type === "scalar") {
|
326
328
|
this.internal.use(
|
327
329
|
`/api/${process.env.VERSION ?? "v1"}${process.env.DOCS_PATH ?? "/docs"}`,
|
328
330
|
(0, import_express_api_reference.apiReference)({
|
329
331
|
content: openApi,
|
330
|
-
...this.
|
332
|
+
...this.docsConfiguration
|
331
333
|
})
|
332
334
|
);
|
333
|
-
} else if (this.
|
335
|
+
} else if (this.docsConfiguration?.type === "swagger") {
|
334
336
|
const swaggerPath = `/api/${process.env.VERSION ?? "v1"}${process.env.DOCS_PATH ?? "/docs"}`;
|
335
337
|
this.internal.use(swaggerPath, swaggerRedirect(swaggerPath));
|
336
338
|
this.internal.get(`${swaggerPath}/*`, swagger(swaggerPath, openApi));
|
package/lib/index.mjs
CHANGED
@@ -265,6 +265,7 @@ function swagger(path, document, opts, options2, customCss, customfavIcon, swagg
|
|
265
265
|
|
266
266
|
// src/hyperExpressApplication.ts
|
267
267
|
var Application = class extends ForklaunchExpressLikeApplication {
|
268
|
+
docsConfiguration;
|
268
269
|
/**
|
269
270
|
* Creates an instance of the Application class.
|
270
271
|
*
|
@@ -289,9 +290,10 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
289
290
|
contentParse(configurationOptions),
|
290
291
|
enrichResponseTransmission
|
291
292
|
],
|
292
|
-
openTelemetryCollector
|
293
|
+
openTelemetryCollector,
|
294
|
+
configurationOptions
|
293
295
|
);
|
294
|
-
this.
|
296
|
+
this.docsConfiguration = configurationOptions?.docs;
|
295
297
|
}
|
296
298
|
async listen(arg0, arg1, arg2) {
|
297
299
|
if (typeof arg0 === "number") {
|
@@ -314,15 +316,15 @@ Correlation id: ${isForklaunchRequest(req) ? req.context.correlationId : "No cor
|
|
314
316
|
port,
|
315
317
|
this.routers
|
316
318
|
);
|
317
|
-
if (this.
|
319
|
+
if (this.docsConfiguration == null || this.docsConfiguration.type === "scalar") {
|
318
320
|
this.internal.use(
|
319
321
|
`/api/${process.env.VERSION ?? "v1"}${process.env.DOCS_PATH ?? "/docs"}`,
|
320
322
|
apiReference({
|
321
323
|
content: openApi,
|
322
|
-
...this.
|
324
|
+
...this.docsConfiguration
|
323
325
|
})
|
324
326
|
);
|
325
|
-
} else if (this.
|
327
|
+
} else if (this.docsConfiguration?.type === "swagger") {
|
326
328
|
const swaggerPath = `/api/${process.env.VERSION ?? "v1"}${process.env.DOCS_PATH ?? "/docs"}`;
|
327
329
|
this.internal.use(swaggerPath, swaggerRedirect(swaggerPath));
|
328
330
|
this.internal.get(`${swaggerPath}/*`, swagger(swaggerPath, openApi));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@forklaunch/hyper-express",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.10",
|
4
4
|
"description": "Forklaunch framework for hyper-express.",
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
6
6
|
"bugs": {
|
@@ -26,17 +26,17 @@
|
|
26
26
|
],
|
27
27
|
"dependencies": {
|
28
28
|
"@forklaunch/hyper-express-fork": "^6.17.34",
|
29
|
-
"@scalar/express-api-reference": "^0.8.
|
29
|
+
"@scalar/express-api-reference": "^0.8.3",
|
30
30
|
"cors": "^2.8.5",
|
31
31
|
"live-directory": "^3.0.3",
|
32
32
|
"openapi3-ts": "^4.4.0",
|
33
33
|
"qs": "^6.14.0",
|
34
|
-
"swagger-ui-dist": "^5.
|
34
|
+
"swagger-ui-dist": "^5.24.0",
|
35
35
|
"swagger-ui-express": "^5.0.1",
|
36
36
|
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.44.0",
|
37
|
-
"@forklaunch/common": "0.3.
|
38
|
-
"@forklaunch/core": "0.
|
39
|
-
"@forklaunch/validator": "0.6.
|
37
|
+
"@forklaunch/common": "0.3.7",
|
38
|
+
"@forklaunch/core": "0.9.1",
|
39
|
+
"@forklaunch/validator": "0.6.7"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
42
|
"@eslint/js": "^9.28.0",
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"@types/qs": "^6.14.0",
|
47
47
|
"@types/swagger-ui-dist": "^3.30.5",
|
48
48
|
"@types/swagger-ui-express": "^4.1.8",
|
49
|
-
"@typescript/native-preview": "7.0.0-dev.
|
49
|
+
"@typescript/native-preview": "7.0.0-dev.20250605.1",
|
50
50
|
"jest": "^29.7.0",
|
51
51
|
"kill-port-process": "^3.2.1",
|
52
52
|
"prettier": "^3.5.3",
|
@@ -56,7 +56,7 @@
|
|
56
56
|
"tsx": "^4.19.4",
|
57
57
|
"typedoc": "^0.28.5",
|
58
58
|
"typescript": "^5.8.3",
|
59
|
-
"typescript-eslint": "^8.33.
|
59
|
+
"typescript-eslint": "^8.33.1"
|
60
60
|
},
|
61
61
|
"scripts": {
|
62
62
|
"build": "tsgo --noEmit && tsup index.ts --format cjs,esm --no-splitting --dts --tsconfig tsconfig.json --out-dir lib --clean",
|