@forklaunch/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 +12 -10
- package/lib/index.d.ts +12 -10
- package/lib/index.js +8 -2
- package/lib/index.mjs +8 -2
- package/package.json +5 -5
package/lib/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as _forklaunch_core_http from '@forklaunch/core/http';
|
2
|
-
import { ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefinition,
|
2
|
+
import { DocsConfiguration, ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefinition, ForklaunchExpressLikeRouter, TypedMiddlewareDefinition, ParamsObject, ResponsesObject, Body, QueryObject, HeadersObject, ContractDetails, ExpressLikeSchemaHandler } from '@forklaunch/core/http';
|
3
3
|
import { AnySchemaValidator, LiteralSchema, IdiomaticSchema, SchemaResolve } from '@forklaunch/validator';
|
4
4
|
import { OptionsText, OptionsJson, OptionsUrlencoded } from 'body-parser';
|
5
5
|
import { BusboyConfig } from 'busboy';
|
@@ -10,6 +10,15 @@ import { Server } from 'http';
|
|
10
10
|
import express from 'express-serve-static-core';
|
11
11
|
import { ParsedQs } from 'qs';
|
12
12
|
|
13
|
+
type ExpressOptions = {
|
14
|
+
docs?: DocsConfiguration;
|
15
|
+
busboy?: BusboyConfig;
|
16
|
+
text?: OptionsText;
|
17
|
+
json?: OptionsJson;
|
18
|
+
urlencoded?: OptionsUrlencoded;
|
19
|
+
cors?: CorsOptions;
|
20
|
+
};
|
21
|
+
|
13
22
|
/**
|
14
23
|
* Application class that sets up an Express server with Forklaunch routers and middleware.
|
15
24
|
* This class extends ForklaunchExpressLikeApplication to provide Express-specific functionality.
|
@@ -30,14 +39,7 @@ declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpre
|
|
30
39
|
* @param {OpenTelemetryCollector<MetricsDefinition>} openTelemetryCollector - Collector for OpenTelemetry metrics.
|
31
40
|
* @param {DocsConfiguration} [docsConfiguration] - Optional configuration for API documentation (Swagger/Scalar).
|
32
41
|
*/
|
33
|
-
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?:
|
34
|
-
docs?: DocsConfiguration;
|
35
|
-
busboy?: BusboyConfig;
|
36
|
-
text?: OptionsText;
|
37
|
-
json?: OptionsJson;
|
38
|
-
urlencoded?: OptionsUrlencoded;
|
39
|
-
cors?: CorsOptions;
|
40
|
-
});
|
42
|
+
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: ExpressOptions);
|
41
43
|
/**
|
42
44
|
* Starts the Express server and sets up API documentation (Swagger/Scalar).
|
43
45
|
* This method is overloaded to support various ways of starting the server.
|
@@ -2032,4 +2034,4 @@ declare const handlers: {
|
|
2032
2034
|
unsubscribe: typeof unsubscribe;
|
2033
2035
|
};
|
2034
2036
|
|
2035
|
-
export { Application, Router, forklaunchExpress, forklaunchRouter, handlers };
|
2037
|
+
export { Application, type ExpressOptions, Router, forklaunchExpress, forklaunchRouter, handlers };
|
package/lib/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as _forklaunch_core_http from '@forklaunch/core/http';
|
2
|
-
import { ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefinition,
|
2
|
+
import { DocsConfiguration, ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefinition, ForklaunchExpressLikeRouter, TypedMiddlewareDefinition, ParamsObject, ResponsesObject, Body, QueryObject, HeadersObject, ContractDetails, ExpressLikeSchemaHandler } from '@forklaunch/core/http';
|
3
3
|
import { AnySchemaValidator, LiteralSchema, IdiomaticSchema, SchemaResolve } from '@forklaunch/validator';
|
4
4
|
import { OptionsText, OptionsJson, OptionsUrlencoded } from 'body-parser';
|
5
5
|
import { BusboyConfig } from 'busboy';
|
@@ -10,6 +10,15 @@ import { Server } from 'http';
|
|
10
10
|
import express from 'express-serve-static-core';
|
11
11
|
import { ParsedQs } from 'qs';
|
12
12
|
|
13
|
+
type ExpressOptions = {
|
14
|
+
docs?: DocsConfiguration;
|
15
|
+
busboy?: BusboyConfig;
|
16
|
+
text?: OptionsText;
|
17
|
+
json?: OptionsJson;
|
18
|
+
urlencoded?: OptionsUrlencoded;
|
19
|
+
cors?: CorsOptions;
|
20
|
+
};
|
21
|
+
|
13
22
|
/**
|
14
23
|
* Application class that sets up an Express server with Forklaunch routers and middleware.
|
15
24
|
* This class extends ForklaunchExpressLikeApplication to provide Express-specific functionality.
|
@@ -30,14 +39,7 @@ declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpre
|
|
30
39
|
* @param {OpenTelemetryCollector<MetricsDefinition>} openTelemetryCollector - Collector for OpenTelemetry metrics.
|
31
40
|
* @param {DocsConfiguration} [docsConfiguration] - Optional configuration for API documentation (Swagger/Scalar).
|
32
41
|
*/
|
33
|
-
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?:
|
34
|
-
docs?: DocsConfiguration;
|
35
|
-
busboy?: BusboyConfig;
|
36
|
-
text?: OptionsText;
|
37
|
-
json?: OptionsJson;
|
38
|
-
urlencoded?: OptionsUrlencoded;
|
39
|
-
cors?: CorsOptions;
|
40
|
-
});
|
42
|
+
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: ExpressOptions);
|
41
43
|
/**
|
42
44
|
* Starts the Express server and sets up API documentation (Swagger/Scalar).
|
43
45
|
* This method is overloaded to support various ways of starting the server.
|
@@ -2032,4 +2034,4 @@ declare const handlers: {
|
|
2032
2034
|
unsubscribe: typeof unsubscribe;
|
2033
2035
|
};
|
2034
2036
|
|
2035
|
-
export { Application, Router, forklaunchExpress, forklaunchRouter, handlers };
|
2037
|
+
export { Application, type ExpressOptions, Router, forklaunchExpress, forklaunchRouter, handlers };
|
package/lib/index.js
CHANGED
@@ -184,8 +184,14 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
|
|
184
184
|
this.internal.use(
|
185
185
|
`/api/${process.env.VERSION ?? "v1"}${process.env.DOCS_PATH ?? "/docs"}`,
|
186
186
|
(0, import_express_api_reference.apiReference)({
|
187
|
-
|
188
|
-
|
187
|
+
...this.docsConfiguration,
|
188
|
+
sources: [
|
189
|
+
{
|
190
|
+
content: openApi,
|
191
|
+
title: "API Reference"
|
192
|
+
},
|
193
|
+
...this.docsConfiguration?.sources ?? []
|
194
|
+
]
|
189
195
|
})
|
190
196
|
);
|
191
197
|
} else if (this.docsConfiguration.type === "swagger") {
|
package/lib/index.mjs
CHANGED
@@ -155,8 +155,14 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
155
155
|
this.internal.use(
|
156
156
|
`/api/${process.env.VERSION ?? "v1"}${process.env.DOCS_PATH ?? "/docs"}`,
|
157
157
|
apiReference({
|
158
|
-
|
159
|
-
|
158
|
+
...this.docsConfiguration,
|
159
|
+
sources: [
|
160
|
+
{
|
161
|
+
content: openApi,
|
162
|
+
title: "API Reference"
|
163
|
+
},
|
164
|
+
...this.docsConfiguration?.sources ?? []
|
165
|
+
]
|
160
166
|
})
|
161
167
|
);
|
162
168
|
} else if (this.docsConfiguration.type === "swagger") {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@forklaunch/express",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.21",
|
4
4
|
"description": "Forklaunch framework for express.",
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
6
6
|
"bugs": {
|
@@ -34,9 +34,9 @@
|
|
34
34
|
"multer": "2.0.1",
|
35
35
|
"qs": "^6.14.0",
|
36
36
|
"swagger-ui-express": "^5.0.1",
|
37
|
-
"@forklaunch/common": "0.3.
|
38
|
-
"@forklaunch/validator": "0.6.
|
39
|
-
"@forklaunch/core": "0.9.
|
37
|
+
"@forklaunch/common": "0.3.10",
|
38
|
+
"@forklaunch/validator": "0.6.10",
|
39
|
+
"@forklaunch/core": "0.9.10"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
42
|
"@eslint/js": "^9.28.0",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"@types/jest": "^29.5.14",
|
49
49
|
"@types/qs": "^6.14.0",
|
50
50
|
"@types/swagger-ui-express": "^4.1.8",
|
51
|
-
"@typescript/native-preview": "7.0.0-dev.
|
51
|
+
"@typescript/native-preview": "7.0.0-dev.20250611.1",
|
52
52
|
"jest": "^30.0.0",
|
53
53
|
"kill-port-process": "^3.2.1",
|
54
54
|
"prettier": "^3.5.3",
|