@forklaunch/hyper-express 0.5.19 → 0.5.21
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 +14 -10
- package/lib/index.d.ts +14 -10
- package/lib/index.js +8 -2
- package/lib/index.mjs +8 -2
- package/package.json +6 -6
package/lib/index.d.mts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import * as _forklaunch_core_http from '@forklaunch/core/http';
|
2
|
-
import { ParamsObject, ResponsesObject, Body, QueryObject, HeadersObject, ContractDetails, ExpressLikeSchemaHandler, ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefinition,
|
3
|
-
import { Request, Response, MiddlewareNext, Server, MiddlewareHandler,
|
4
|
-
export { MiddlewareNext as NextFunction, Request, Response } from '@forklaunch/hyper-express-fork';
|
2
|
+
import { ParamsObject, ResponsesObject, Body, QueryObject, HeadersObject, ContractDetails, ExpressLikeSchemaHandler, DocsConfiguration, ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefinition, ForklaunchExpressLikeRouter, ForklaunchRouter, TypedMiddlewareDefinition } from '@forklaunch/core/http';
|
3
|
+
import { Request, Response, MiddlewareNext, ServerConstructorOptions, Server, MiddlewareHandler, Router as Router$1 } from '@forklaunch/hyper-express-fork';
|
4
|
+
export { MiddlewareNext as NextFunction, Request, Response, ServerConstructorOptions } from '@forklaunch/hyper-express-fork';
|
5
5
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
6
6
|
import { BusboyConfig } from 'busboy';
|
7
|
+
export { BusboyConfig } from 'busboy';
|
7
8
|
import { CorsOptions } from 'cors';
|
9
|
+
export { CorsOptions } from 'cors';
|
8
10
|
import * as uWebsockets from 'uWebSockets.js';
|
9
11
|
|
10
12
|
/**
|
@@ -703,6 +705,13 @@ declare const put: <SV extends AnySchemaValidator, Path extends `/${string}`, P
|
|
703
705
|
*/
|
704
706
|
declare const trace: <SV extends AnySchemaValidator, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, "trace", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request<LocalsObj>>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request<LocalsObj>, Response<LocalsObj>, MiddlewareNext>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, "trace", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request<LocalsObj>, Response<LocalsObj>, MiddlewareNext>;
|
705
707
|
|
708
|
+
type ExpressOptions = {
|
709
|
+
docs?: DocsConfiguration;
|
710
|
+
busboy?: BusboyConfig;
|
711
|
+
server?: ServerConstructorOptions;
|
712
|
+
cors?: CorsOptions;
|
713
|
+
};
|
714
|
+
|
706
715
|
/**
|
707
716
|
* Represents an application built on top of Hyper-Express and Forklaunch.
|
708
717
|
* This class provides a high-performance web server implementation using uWebSockets.js
|
@@ -743,12 +752,7 @@ declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpre
|
|
743
752
|
* );
|
744
753
|
* ```
|
745
754
|
*/
|
746
|
-
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, configurationOptions?:
|
747
|
-
docs?: DocsConfiguration;
|
748
|
-
busboy?: BusboyConfig;
|
749
|
-
server?: ServerConstructorOptions;
|
750
|
-
cors?: CorsOptions;
|
751
|
-
});
|
755
|
+
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, configurationOptions?: ExpressOptions);
|
752
756
|
/**
|
753
757
|
* Starts the server and sets up API documentation.
|
754
758
|
* Supports multiple listening configurations including port, host, and UNIX socket path.
|
@@ -829,4 +833,4 @@ declare const handlers: {
|
|
829
833
|
trace: typeof trace;
|
830
834
|
};
|
831
835
|
|
832
|
-
export { type App, Application, Router, forklaunchExpress, forklaunchRouter, handlers };
|
836
|
+
export { type App, Application, type ExpressOptions, Router, forklaunchExpress, forklaunchRouter, handlers };
|
package/lib/index.d.ts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import * as _forklaunch_core_http from '@forklaunch/core/http';
|
2
|
-
import { ParamsObject, ResponsesObject, Body, QueryObject, HeadersObject, ContractDetails, ExpressLikeSchemaHandler, ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefinition,
|
3
|
-
import { Request, Response, MiddlewareNext, Server, MiddlewareHandler,
|
4
|
-
export { MiddlewareNext as NextFunction, Request, Response } from '@forklaunch/hyper-express-fork';
|
2
|
+
import { ParamsObject, ResponsesObject, Body, QueryObject, HeadersObject, ContractDetails, ExpressLikeSchemaHandler, DocsConfiguration, ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefinition, ForklaunchExpressLikeRouter, ForklaunchRouter, TypedMiddlewareDefinition } from '@forklaunch/core/http';
|
3
|
+
import { Request, Response, MiddlewareNext, ServerConstructorOptions, Server, MiddlewareHandler, Router as Router$1 } from '@forklaunch/hyper-express-fork';
|
4
|
+
export { MiddlewareNext as NextFunction, Request, Response, ServerConstructorOptions } from '@forklaunch/hyper-express-fork';
|
5
5
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
6
6
|
import { BusboyConfig } from 'busboy';
|
7
|
+
export { BusboyConfig } from 'busboy';
|
7
8
|
import { CorsOptions } from 'cors';
|
9
|
+
export { CorsOptions } from 'cors';
|
8
10
|
import * as uWebsockets from 'uWebSockets.js';
|
9
11
|
|
10
12
|
/**
|
@@ -703,6 +705,13 @@ declare const put: <SV extends AnySchemaValidator, Path extends `/${string}`, P
|
|
703
705
|
*/
|
704
706
|
declare const trace: <SV extends AnySchemaValidator, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, "trace", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request<LocalsObj>>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request<LocalsObj>, Response<LocalsObj>, MiddlewareNext>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, "trace", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request<LocalsObj>, Response<LocalsObj>, MiddlewareNext>;
|
705
707
|
|
708
|
+
type ExpressOptions = {
|
709
|
+
docs?: DocsConfiguration;
|
710
|
+
busboy?: BusboyConfig;
|
711
|
+
server?: ServerConstructorOptions;
|
712
|
+
cors?: CorsOptions;
|
713
|
+
};
|
714
|
+
|
706
715
|
/**
|
707
716
|
* Represents an application built on top of Hyper-Express and Forklaunch.
|
708
717
|
* This class provides a high-performance web server implementation using uWebSockets.js
|
@@ -743,12 +752,7 @@ declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpre
|
|
743
752
|
* );
|
744
753
|
* ```
|
745
754
|
*/
|
746
|
-
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, configurationOptions?:
|
747
|
-
docs?: DocsConfiguration;
|
748
|
-
busboy?: BusboyConfig;
|
749
|
-
server?: ServerConstructorOptions;
|
750
|
-
cors?: CorsOptions;
|
751
|
-
});
|
755
|
+
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, configurationOptions?: ExpressOptions);
|
752
756
|
/**
|
753
757
|
* Starts the server and sets up API documentation.
|
754
758
|
* Supports multiple listening configurations including port, host, and UNIX socket path.
|
@@ -829,4 +833,4 @@ declare const handlers: {
|
|
829
833
|
trace: typeof trace;
|
830
834
|
};
|
831
835
|
|
832
|
-
export { type App, Application, Router, forklaunchExpress, forklaunchRouter, handlers };
|
836
|
+
export { type App, Application, type ExpressOptions, Router, forklaunchExpress, forklaunchRouter, handlers };
|
package/lib/index.js
CHANGED
@@ -328,8 +328,14 @@ Correlation id: ${(0, import_http13.isForklaunchRequest)(req) ? req.context.corr
|
|
328
328
|
this.internal.use(
|
329
329
|
`/api/${process.env.VERSION ?? "v1"}${process.env.DOCS_PATH ?? "/docs"}`,
|
330
330
|
(0, import_express_api_reference.apiReference)({
|
331
|
-
|
332
|
-
|
331
|
+
...this.docsConfiguration,
|
332
|
+
sources: [
|
333
|
+
{
|
334
|
+
content: openApi,
|
335
|
+
title: "API Reference"
|
336
|
+
},
|
337
|
+
...this.docsConfiguration?.sources ?? []
|
338
|
+
]
|
333
339
|
})
|
334
340
|
);
|
335
341
|
} else if (this.docsConfiguration?.type === "swagger") {
|
package/lib/index.mjs
CHANGED
@@ -320,8 +320,14 @@ Correlation id: ${isForklaunchRequest(req) ? req.context.correlationId : "No cor
|
|
320
320
|
this.internal.use(
|
321
321
|
`/api/${process.env.VERSION ?? "v1"}${process.env.DOCS_PATH ?? "/docs"}`,
|
322
322
|
apiReference({
|
323
|
-
|
324
|
-
|
323
|
+
...this.docsConfiguration,
|
324
|
+
sources: [
|
325
|
+
{
|
326
|
+
content: openApi,
|
327
|
+
title: "API Reference"
|
328
|
+
},
|
329
|
+
...this.docsConfiguration?.sources ?? []
|
330
|
+
]
|
325
331
|
})
|
326
332
|
);
|
327
333
|
} else if (this.docsConfiguration?.type === "swagger") {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@forklaunch/hyper-express",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.21",
|
4
4
|
"description": "Forklaunch framework for hyper-express.",
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
6
6
|
"bugs": {
|
@@ -34,9 +34,9 @@
|
|
34
34
|
"swagger-ui-dist": "^5.24.1",
|
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.9.
|
39
|
-
"@forklaunch/validator": "0.6.
|
37
|
+
"@forklaunch/common": "0.3.10",
|
38
|
+
"@forklaunch/core": "0.9.10",
|
39
|
+
"@forklaunch/validator": "0.6.10"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
42
|
"@eslint/js": "^9.28.0",
|
@@ -46,14 +46,14 @@
|
|
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.20250611.1",
|
50
50
|
"jest": "^30.0.0",
|
51
51
|
"kill-port-process": "^3.2.1",
|
52
52
|
"prettier": "^3.5.3",
|
53
53
|
"ts-jest": "^29.3.4",
|
54
54
|
"ts-node": "^10.9.2",
|
55
55
|
"tsup": "^8.5.0",
|
56
|
-
"tsx": "^4.
|
56
|
+
"tsx": "^4.20.1",
|
57
57
|
"typedoc": "^0.28.5",
|
58
58
|
"typescript": "^5.8.3",
|
59
59
|
"typescript-eslint": "^8.34.0"
|