@forklaunch/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 +8 -3
- package/lib/index.d.ts +8 -3
- package/lib/index.js +7 -10
- package/lib/index.mjs +7 -10
- package/package.json +8 -8
package/lib/index.d.mts
CHANGED
@@ -3,6 +3,7 @@ import { ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefini
|
|
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';
|
6
|
+
import { CorsOptions } from 'cors';
|
6
7
|
import { Express, RequestHandler, Request, Response, NextFunction, Router as Router$1 } from 'express';
|
7
8
|
import { Server } from 'http';
|
8
9
|
import express from 'express-serve-static-core';
|
@@ -20,7 +21,7 @@ import { ParsedQs } from 'qs';
|
|
20
21
|
* ```
|
21
22
|
*/
|
22
23
|
declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpressLikeApplication<SV, Express, RequestHandler, Request, Response, NextFunction> {
|
23
|
-
private
|
24
|
+
private docsConfiguration;
|
24
25
|
/**
|
25
26
|
* Creates an instance of Application.
|
26
27
|
*
|
@@ -28,11 +29,13 @@ declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpre
|
|
28
29
|
* @param {OpenTelemetryCollector<MetricsDefinition>} openTelemetryCollector - Collector for OpenTelemetry metrics.
|
29
30
|
* @param {DocsConfiguration} [docsConfiguration] - Optional configuration for API documentation (Swagger/Scalar).
|
30
31
|
*/
|
31
|
-
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
32
|
+
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: {
|
33
|
+
docs?: DocsConfiguration;
|
32
34
|
busboy?: BusboyConfig;
|
33
35
|
text?: OptionsText;
|
34
36
|
json?: OptionsJson;
|
35
37
|
urlencoded?: OptionsUrlencoded;
|
38
|
+
cors?: CorsOptions;
|
36
39
|
});
|
37
40
|
/**
|
38
41
|
* Starts the Express server and sets up API documentation (Swagger/Scalar).
|
@@ -1974,11 +1977,13 @@ declare const unsubscribe: <SV extends AnySchemaValidator, Path extends `/${stri
|
|
1974
1977
|
* @param {SV} schemaValidator - The schema validator.
|
1975
1978
|
* @returns {Application<SV>} - The new application instance.
|
1976
1979
|
*/
|
1977
|
-
declare function forklaunchExpress<SV extends AnySchemaValidator>(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
1980
|
+
declare function forklaunchExpress<SV extends AnySchemaValidator>(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: {
|
1981
|
+
docs?: DocsConfiguration;
|
1978
1982
|
busboy?: BusboyConfig;
|
1979
1983
|
text?: OptionsText;
|
1980
1984
|
json?: OptionsJson;
|
1981
1985
|
urlencoded?: OptionsUrlencoded;
|
1986
|
+
cors?: CorsOptions;
|
1982
1987
|
}): Application<SV>;
|
1983
1988
|
/**
|
1984
1989
|
* 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 { ForklaunchExpressLikeApplication, OpenTelemetryCollector, MetricsDefini
|
|
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';
|
6
|
+
import { CorsOptions } from 'cors';
|
6
7
|
import { Express, RequestHandler, Request, Response, NextFunction, Router as Router$1 } from 'express';
|
7
8
|
import { Server } from 'http';
|
8
9
|
import express from 'express-serve-static-core';
|
@@ -20,7 +21,7 @@ import { ParsedQs } from 'qs';
|
|
20
21
|
* ```
|
21
22
|
*/
|
22
23
|
declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpressLikeApplication<SV, Express, RequestHandler, Request, Response, NextFunction> {
|
23
|
-
private
|
24
|
+
private docsConfiguration;
|
24
25
|
/**
|
25
26
|
* Creates an instance of Application.
|
26
27
|
*
|
@@ -28,11 +29,13 @@ declare class Application<SV extends AnySchemaValidator> extends ForklaunchExpre
|
|
28
29
|
* @param {OpenTelemetryCollector<MetricsDefinition>} openTelemetryCollector - Collector for OpenTelemetry metrics.
|
29
30
|
* @param {DocsConfiguration} [docsConfiguration] - Optional configuration for API documentation (Swagger/Scalar).
|
30
31
|
*/
|
31
|
-
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
32
|
+
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: {
|
33
|
+
docs?: DocsConfiguration;
|
32
34
|
busboy?: BusboyConfig;
|
33
35
|
text?: OptionsText;
|
34
36
|
json?: OptionsJson;
|
35
37
|
urlencoded?: OptionsUrlencoded;
|
38
|
+
cors?: CorsOptions;
|
36
39
|
});
|
37
40
|
/**
|
38
41
|
* Starts the Express server and sets up API documentation (Swagger/Scalar).
|
@@ -1974,11 +1977,13 @@ declare const unsubscribe: <SV extends AnySchemaValidator, Path extends `/${stri
|
|
1974
1977
|
* @param {SV} schemaValidator - The schema validator.
|
1975
1978
|
* @returns {Application<SV>} - The new application instance.
|
1976
1979
|
*/
|
1977
|
-
declare function forklaunchExpress<SV extends AnySchemaValidator>(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
1980
|
+
declare function forklaunchExpress<SV extends AnySchemaValidator>(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: {
|
1981
|
+
docs?: DocsConfiguration;
|
1978
1982
|
busboy?: BusboyConfig;
|
1979
1983
|
text?: OptionsText;
|
1980
1984
|
json?: OptionsJson;
|
1981
1985
|
urlencoded?: OptionsUrlencoded;
|
1986
|
+
cors?: CorsOptions;
|
1982
1987
|
}): Application<SV>;
|
1983
1988
|
/**
|
1984
1989
|
* Creates a new instance of Router with the given base path and schema validator.
|
package/lib/index.js
CHANGED
@@ -152,6 +152,7 @@ function enrichResponseTransmission(req, res, next) {
|
|
152
152
|
|
153
153
|
// src/expressApplication.ts
|
154
154
|
var Application = class extends import_http3.ForklaunchExpressLikeApplication {
|
155
|
+
docsConfiguration;
|
155
156
|
/**
|
156
157
|
* Creates an instance of Application.
|
157
158
|
*
|
@@ -159,7 +160,7 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
|
|
159
160
|
* @param {OpenTelemetryCollector<MetricsDefinition>} openTelemetryCollector - Collector for OpenTelemetry metrics.
|
160
161
|
* @param {DocsConfiguration} [docsConfiguration] - Optional configuration for API documentation (Swagger/Scalar).
|
161
162
|
*/
|
162
|
-
constructor(schemaValidator, openTelemetryCollector,
|
163
|
+
constructor(schemaValidator, openTelemetryCollector, options2) {
|
163
164
|
super(
|
164
165
|
schemaValidator,
|
165
166
|
(0, import_express2.default)(),
|
@@ -167,9 +168,10 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
|
|
167
168
|
contentParse(options2),
|
168
169
|
enrichResponseTransmission
|
169
170
|
],
|
170
|
-
openTelemetryCollector
|
171
|
+
openTelemetryCollector,
|
172
|
+
options2
|
171
173
|
);
|
172
|
-
this.docsConfiguration =
|
174
|
+
this.docsConfiguration = options2?.docs;
|
173
175
|
}
|
174
176
|
listen(...args) {
|
175
177
|
const port = typeof args[0] === "number" ? args[0] : Number(process.env.PORT);
|
@@ -592,13 +594,8 @@ var unsubscribe = (schemaValidator, path, contractDetails, ...handlers2) => {
|
|
592
594
|
};
|
593
595
|
|
594
596
|
// index.ts
|
595
|
-
function forklaunchExpress(schemaValidator, openTelemetryCollector,
|
596
|
-
return new Application(
|
597
|
-
schemaValidator,
|
598
|
-
openTelemetryCollector,
|
599
|
-
docsConfiguration,
|
600
|
-
options2
|
601
|
-
);
|
597
|
+
function forklaunchExpress(schemaValidator, openTelemetryCollector, options2) {
|
598
|
+
return new Application(schemaValidator, openTelemetryCollector, options2);
|
602
599
|
}
|
603
600
|
function forklaunchRouter(basePath, schemaValidator, openTelemetryCollector, options2) {
|
604
601
|
const router = new Router(
|
package/lib/index.mjs
CHANGED
@@ -123,6 +123,7 @@ function enrichResponseTransmission(req, res, next) {
|
|
123
123
|
|
124
124
|
// src/expressApplication.ts
|
125
125
|
var Application = class extends ForklaunchExpressLikeApplication {
|
126
|
+
docsConfiguration;
|
126
127
|
/**
|
127
128
|
* Creates an instance of Application.
|
128
129
|
*
|
@@ -130,7 +131,7 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
130
131
|
* @param {OpenTelemetryCollector<MetricsDefinition>} openTelemetryCollector - Collector for OpenTelemetry metrics.
|
131
132
|
* @param {DocsConfiguration} [docsConfiguration] - Optional configuration for API documentation (Swagger/Scalar).
|
132
133
|
*/
|
133
|
-
constructor(schemaValidator, openTelemetryCollector,
|
134
|
+
constructor(schemaValidator, openTelemetryCollector, options2) {
|
134
135
|
super(
|
135
136
|
schemaValidator,
|
136
137
|
express2(),
|
@@ -138,9 +139,10 @@ var Application = class extends ForklaunchExpressLikeApplication {
|
|
138
139
|
contentParse(options2),
|
139
140
|
enrichResponseTransmission
|
140
141
|
],
|
141
|
-
openTelemetryCollector
|
142
|
+
openTelemetryCollector,
|
143
|
+
options2
|
142
144
|
);
|
143
|
-
this.docsConfiguration =
|
145
|
+
this.docsConfiguration = options2?.docs;
|
144
146
|
}
|
145
147
|
listen(...args) {
|
146
148
|
const port = typeof args[0] === "number" ? args[0] : Number(process.env.PORT);
|
@@ -621,13 +623,8 @@ var unsubscribe = (schemaValidator, path, contractDetails, ...handlers2) => {
|
|
621
623
|
};
|
622
624
|
|
623
625
|
// index.ts
|
624
|
-
function forklaunchExpress(schemaValidator, openTelemetryCollector,
|
625
|
-
return new Application(
|
626
|
-
schemaValidator,
|
627
|
-
openTelemetryCollector,
|
628
|
-
docsConfiguration,
|
629
|
-
options2
|
630
|
-
);
|
626
|
+
function forklaunchExpress(schemaValidator, openTelemetryCollector, options2) {
|
627
|
+
return new Application(schemaValidator, openTelemetryCollector, options2);
|
631
628
|
}
|
632
629
|
function forklaunchRouter(basePath, schemaValidator, openTelemetryCollector, options2) {
|
633
630
|
const router = new Router(
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@forklaunch/express",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.10",
|
4
4
|
"description": "Forklaunch framework for express.",
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
6
6
|
"bugs": {
|
@@ -25,18 +25,18 @@
|
|
25
25
|
"lib/**"
|
26
26
|
],
|
27
27
|
"dependencies": {
|
28
|
-
"@scalar/express-api-reference": "^0.8.
|
28
|
+
"@scalar/express-api-reference": "^0.8.3",
|
29
29
|
"@types/multer": "^1.4.12",
|
30
30
|
"body-parser": "^2.2.0",
|
31
31
|
"busboy": "^1.6.0",
|
32
32
|
"cors": "^2.8.5",
|
33
33
|
"express": "^5.1.0",
|
34
|
-
"multer": "2.0.
|
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/
|
39
|
-
"@forklaunch/
|
37
|
+
"@forklaunch/common": "0.3.7",
|
38
|
+
"@forklaunch/validator": "0.6.7",
|
39
|
+
"@forklaunch/core": "0.9.1"
|
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.20250605.1",
|
52
52
|
"jest": "^29.7.0",
|
53
53
|
"kill-port-process": "^3.2.1",
|
54
54
|
"prettier": "^3.5.3",
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"tsup": "^8.5.0",
|
58
58
|
"typedoc": "^0.28.5",
|
59
59
|
"typescript": "^5.8.3",
|
60
|
-
"typescript-eslint": "^8.33.
|
60
|
+
"typescript-eslint": "^8.33.1"
|
61
61
|
},
|
62
62
|
"scripts": {
|
63
63
|
"build": "tsgo --noEmit && tsup index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --outDir lib --dts --clean",
|